awacke1 commited on
Commit
3eacf29
1 Parent(s): 5de8680

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -18,11 +18,11 @@ import os
18
 
19
  # Load terminology datasets:
20
  basedir = os.path.dirname(__file__)
21
- dataLOINC = pd.read_csv(basedir + "\\" + f'LoincTableCore.csv')
22
- dataPanels = pd.read_csv(basedir + "\\" + f'PanelsAndForms-ACW1208Labeled.csv')
23
- dataSNOMED = pd.read_csv(basedir + "\\" + f'sct2_TextDefinition_Full-en_US1000124_20220901.txt',sep='\t')
24
- dataOMS = pd.read_csv(basedir + "\\" + f'SnomedOMS.csv')
25
- dataICD10 = pd.read_csv(basedir + "\\" + f'ICD10Diagnosis.csv')
26
 
27
  dir_path = os.path.dirname(os.path.realpath(__file__))
28
  EXAMPLES = {}
@@ -157,7 +157,7 @@ def group_by_entity(raw):
157
  g11 = g1['LOINC_NUM'].to_string().replace(","," ").replace("\n"," ")
158
  g12 = g1['COMPONENT'].to_string().replace(","," ").replace("\n"," ")
159
  s1 = ("LOINC Terms of entity ," + myEntityGroup + ", with term ," + eterm + ", LOINC codes of ," + g11 + ", and LOINC questions of ," + g12 + ", Label,Value, Label,Value, Label,Value ")
160
- SaveResult(s1, outputFile)
161
 
162
  #LOINC Panels
163
  g21 = g2['Loinc'].to_string().replace(","," ").replace("\n"," ")
@@ -165,13 +165,13 @@ def group_by_entity(raw):
165
  g23 = g2['ParentLoinc'].to_string().replace(","," ").replace("\n"," ")
166
  g24 = g2['ParentName'].to_string().replace(","," ").replace("\n"," ")
167
  s2 = ("LOINC Panels of entity ," + myEntityGroup + ", with term ," + eterm + ", LOINC codes of ," + g21 + ", and LOINC name of ," + g22 + ", and Parent codes of ," + g23 + ", with Parent names of ," + g24 + ", Label,Value ")
168
- SaveResult(s2, outputFile)
169
 
170
  #SNOMED
171
  g31 = g3['conceptId'].to_string().replace(","," ").replace("\n"," ")
172
  g32 = g3['term'].to_string().replace(","," ").replace("\n"," ")
173
  s3 = ("SNOMED Terms of entity ," + myEntityGroup + ", with term ," + eterm + ", SNOMED concepts of ," + g31 + ", and SNOMED terms of ," + g32 + ", Label,Value, Label,Value, Label,Value ")
174
- SaveResult(s3, outputFile)
175
 
176
  #OMS
177
  g41 = g4['Omaha Code'].to_string().replace(","," ").replace("\n"," ")
@@ -183,10 +183,10 @@ def group_by_entity(raw):
183
  if g41 != 'Series([] )': SaveResult(s4, outputFile)
184
 
185
  #ICD10
186
- g51 = g5['Code'].to_string().replace(","," ")
187
- g52 = g5['Description'].to_string().replace(","," ")
188
  s5 = ("ICD10 matches of entity ," + myEntityGroup + ", with term ," + eterm + ", ICD10 codes of ," + g51 + ", and descriptions of ," + g52 + ", Label,Value, Label,Value, Label,Value ")
189
- if g51 != 'Series([] )':SaveResult(s5, outputFile)
190
 
191
  except ValueError as err:
192
  raise ValueError("Error in group by entity \n" + format_tb(err.__traceback__)[0] + err.args[0] + "\nEnd of error message.") from None
 
18
 
19
  # Load terminology datasets:
20
  basedir = os.path.dirname(__file__)
21
+ dataLOINC = pd.read_csv(basedir + f'LoincTableCore.csv')
22
+ dataPanels = pd.read_csv(basedir + f'PanelsAndForms-ACW1208Labeled.csv')
23
+ dataSNOMED = pd.read_csv(basedir + f'sct2_TextDefinition_Full-en_US1000124_20220901.txt',sep='\t')
24
+ dataOMS = pd.read_csv(basedir + f'SnomedOMS.csv')
25
+ dataICD10 = pd.read_csv(basedir + f'ICD10Diagnosis.csv')
26
 
27
  dir_path = os.path.dirname(os.path.realpath(__file__))
28
  EXAMPLES = {}
 
157
  g11 = g1['LOINC_NUM'].to_string().replace(","," ").replace("\n"," ")
158
  g12 = g1['COMPONENT'].to_string().replace(","," ").replace("\n"," ")
159
  s1 = ("LOINC Terms of entity ," + myEntityGroup + ", with term ," + eterm + ", LOINC codes of ," + g11 + ", and LOINC questions of ," + g12 + ", Label,Value, Label,Value, Label,Value ")
160
+ if g11 != 'Series([] )': SaveResult(s1, outputFile)
161
 
162
  #LOINC Panels
163
  g21 = g2['Loinc'].to_string().replace(","," ").replace("\n"," ")
 
165
  g23 = g2['ParentLoinc'].to_string().replace(","," ").replace("\n"," ")
166
  g24 = g2['ParentName'].to_string().replace(","," ").replace("\n"," ")
167
  s2 = ("LOINC Panels of entity ," + myEntityGroup + ", with term ," + eterm + ", LOINC codes of ," + g21 + ", and LOINC name of ," + g22 + ", and Parent codes of ," + g23 + ", with Parent names of ," + g24 + ", Label,Value ")
168
+ if g21 != 'Series([] )': SaveResult(s2, outputFile)
169
 
170
  #SNOMED
171
  g31 = g3['conceptId'].to_string().replace(","," ").replace("\n"," ")
172
  g32 = g3['term'].to_string().replace(","," ").replace("\n"," ")
173
  s3 = ("SNOMED Terms of entity ," + myEntityGroup + ", with term ," + eterm + ", SNOMED concepts of ," + g31 + ", and SNOMED terms of ," + g32 + ", Label,Value, Label,Value, Label,Value ")
174
+ if g31 != 'Series([] )': SaveResult(s3, outputFile)
175
 
176
  #OMS
177
  g41 = g4['Omaha Code'].to_string().replace(","," ").replace("\n"," ")
 
183
  if g41 != 'Series([] )': SaveResult(s4, outputFile)
184
 
185
  #ICD10
186
+ g51 = g5['Code'].to_string().replace(","," ").replace("\n"," ")
187
+ g52 = g5['Description'].to_string().replace(","," ").replace("\n"," ")
188
  s5 = ("ICD10 matches of entity ," + myEntityGroup + ", with term ," + eterm + ", ICD10 codes of ," + g51 + ", and descriptions of ," + g52 + ", Label,Value, Label,Value, Label,Value ")
189
+ if g51 != 'Series([] )': SaveResult(s5, outputFile)
190
 
191
  except ValueError as err:
192
  raise ValueError("Error in group by entity \n" + format_tb(err.__traceback__)[0] + err.args[0] + "\nEnd of error message.") from None