0

I am attempting to write an ICD10 CM program look up using an ICD text file saved on my computer. I need to input the icd 10 code and have the program print a text description of the code. However, when I ran my code, the description doesn’t match my code. I have tried writing my program using regular expressions.#ICD-10-CM PROGRAM LOOK UP

`pattern=""
 import re
 regex=re.compile(pattern)
 infile=open("icd10cm.txt", "r")
 #patient_icd10= input("Please enter the ICD-10 code or diagnosis: ")
 #pattern=patient_icd10
 code=[]
 description=[] 
 code_key_dict = {}
 desc_key_dict = {}
 infile.readline()
 for line in infile:
 line=line.strip()
 elements=line.split("\t")
 #elements[0]=elements[1]
 code=elements[0]
 description=elements[1]
 code=input("Please enter the ICD-10 code or diagnosis: ")
 print(description)
 for X in infile:
 description=code_key_dict.get(X)
 code=desc_key_dict.get(X)
 if re.search(patient_icd10, code):
 print(description)
 if re.search(patient_icd10,description):
 print(code)

infile.close()
Ella
  • 1
  • 1
  • please paste the code – Aaj Kaal Dec 05 '20 at 18:12
  • import re regexp=re.compile(pattern) infile= open("icd10cm.txt", "r") infile.readlines() for line in infile: line= line.strip() elements= line. split("\t") #for line in infile: line= line.strip() elements= line.split("\t") elements[0]=elements[1] code= elements[0] description= elements[1] code= input("please enter your ICD-10-CM code number: ") print(description) description= input("please enter your ICD-10-CM description: ") print(code) – Ella Dec 05 '20 at 19:00
  • #ICD-10-CM PROGRAM LOOK UP pattern="" import re regexp=re.compile(pattern) infile= open("icd10cm.txt", "r") infile.readline() for line in infile: line= line.strip() elements= line.split("\t") elements[0] = elements[1] code=elements[0] description=elements[1] code=input("please enter your ICD-10-CM code number: ") print(description) description=input("please enter your ICD-10-CM description: ") print(code) infile.close – Ella Dec 05 '20 at 19:32
  • Edit your original post and then paste the code. and use the code sample button of the editor – Aaj Kaal Dec 06 '20 at 14:22
  • You are using "add a comment' click 'edit' above the comments – Aaj Kaal Dec 06 '20 at 23:25

0 Answers0