awacke1 commited on
Commit
5de8680
1 Parent(s): 63e5147

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -24
app.py CHANGED
@@ -18,17 +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
- dataLOINC = pd.read_csv(f'LoincTableCore.csv')
28
- dataPanels = pd.read_csv(f'PanelsAndForms-ACW1208Labeled.csv')
29
- dataSNOMED = pd.read_csv(f'sct2_TextDefinition_Full-en_US1000124_20220901.txt',sep='\t')
30
- dataOMS = pd.read_csv(f'SnomedOMS.csv')
31
- dataICD10 = pd.read_csv(f'ICD10Diagnosis.csv')
32
 
33
  dir_path = os.path.dirname(os.path.realpath(__file__))
34
  EXAMPLES = {}
@@ -160,31 +154,31 @@ def group_by_entity(raw):
160
  col = " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19"
161
 
162
  #LOINC
163
- g11 = g1['LOINC_NUM'].to_string().replace(","," ")
164
- g12 = g1['COMPONENT'].to_string().replace(","," ")
165
  s1 = ("LOINC Terms of entity ," + myEntityGroup + ", with term ," + eterm + ", LOINC codes of ," + g11 + ", and LOINC questions of ," + g12 + ", Label,Value, Label,Value, Label,Value ")
166
  SaveResult(s1, outputFile)
167
 
168
  #LOINC Panels
169
- g21 = g2['Loinc'].to_string().replace(","," ")
170
- g22 = g2['LoincName'].to_string().replace(","," ")
171
- g23 = g2['ParentLoinc'].to_string().replace(","," ")
172
- g24 = g2['ParentName'].to_string().replace(","," ")
173
  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 ")
174
  SaveResult(s2, outputFile)
175
 
176
  #SNOMED
177
- g31 = g3['conceptId'].to_string().replace(","," ")
178
- g32 = g3['term'].to_string().replace(","," ")
179
  s3 = ("SNOMED Terms of entity ," + myEntityGroup + ", with term ," + eterm + ", SNOMED concepts of ," + g31 + ", and SNOMED terms of ," + g32 + ", Label,Value, Label,Value, Label,Value ")
180
  SaveResult(s3, outputFile)
181
 
182
  #OMS
183
- g41 = g4['Omaha Code'].to_string().replace(","," ")
184
- g42 = g4['SNOMED CT concept ID'].to_string().replace(","," ")
185
- g43 = g4['SNOMED CT'].to_string().replace(","," ")
186
- g44 = g4['PR'].to_string().replace(","," ")
187
- g45 = g4['S&S'].to_string().replace(","," ")
188
  s4 = ("OMS Terms of entity ," + myEntityGroup + ", with term ," + eterm + ", Omaha codes of ," + g41 + ", and SNOMED concepts of ," + g42 + ", and SNOMED codes of ," + g43 + ", and OMS problem of ," + g44 + ", and OMS Sign Symptom of ," + g45)
189
  if g41 != 'Series([] )': SaveResult(s4, outputFile)
190
 
 
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 = {}
 
154
  col = " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19"
155
 
156
  #LOINC
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"," ")
164
+ g22 = g2['LoincName'].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
  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"," ")
178
+ g42 = g4['SNOMED CT concept ID'].to_string().replace(","," ").replace("\n"," ")
179
+ g43 = g4['SNOMED CT'].to_string().replace(","," ").replace("\n"," ")
180
+ g44 = g4['PR'].to_string().replace(","," ").replace("\n"," ")
181
+ g45 = g4['S&S'].to_string().replace(","," ").replace("\n"," ")
182
  s4 = ("OMS Terms of entity ," + myEntityGroup + ", with term ," + eterm + ", Omaha codes of ," + g41 + ", and SNOMED concepts of ," + g42 + ", and SNOMED codes of ," + g43 + ", and OMS problem of ," + g44 + ", and OMS Sign Symptom of ," + g45)
183
  if g41 != 'Series([] )': SaveResult(s4, outputFile)
184