awacke1 commited on
Commit
0f81f0a
·
1 Parent(s): ab11838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -1
app.py CHANGED
@@ -46,8 +46,51 @@ def create_phq9_questions():
46
  ]
47
  return questions
48
 
 
 
 
 
 
 
 
 
49
 
50
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
 
53
  # Define main function
@@ -84,6 +127,8 @@ def main():
84
  # Get the PHQ9 questions
85
  questions = create_phq9_questions()
86
 
 
 
87
  # Display each question and an input text field for the answer
88
  for question in questions:
89
  st.markdown(question["question"])
 
46
  ]
47
  return questions
48
 
49
+ def diabetes_code_lookup(code):
50
+ # LOINC codes related to diabetes
51
+ loinc_codes = {
52
+ '14771-0': 'Glucose [Mass/volume] in Blood',
53
+ '49642-8': 'Hemoglobin A1c/Hemoglobin.total in Blood',
54
+ '2345-7': 'Glucose [Mass/volume] in Serum or Plasma',
55
+ # Add more LOINC codes related to diabetes here
56
+ }
57
 
58
+ # SNOMED-CT codes related to diabetes
59
+ snomed_codes = {
60
+ '73211009': 'Diabetes mellitus (disorder)',
61
+ '15777000': 'Insulin-dependent diabetes mellitus (disorder)',
62
+ '44054006': 'Non-insulin dependent diabetes mellitus (disorder)',
63
+ # Add more SNOMED-CT codes related to diabetes here
64
+ }
65
+
66
+ # ICD-10 codes related to diabetes
67
+ icd_codes = {
68
+ 'E10.9': 'Type 1 diabetes mellitus without complications',
69
+ 'E11.9': 'Type 2 diabetes mellitus without complications',
70
+ 'E08.9': 'Diabetes mellitus due to an underlying condition without complications',
71
+ # Add more ICD-10 codes related to diabetes here
72
+ }
73
+
74
+ # Look up the code in each dictionary
75
+ loinc_desc = loinc_codes.get(code, 'Code not found')
76
+ snomed_desc = snomed_codes.get(code, 'Code not found')
77
+ icd_desc = icd_codes.get(code, 'Code not found')
78
+
79
+ # Display the results
80
+ st.markdown(f'### LOINC code {code}: {loinc_desc}')
81
+ st.markdown(f'### SNOMED-CT code {code}: {snomed_desc}')
82
+ st.markdown(f'### ICD-10 code {code}: {icd_desc}')
83
+ st.markdown("""
84
+ # Diabetes ICD10 Codes:
85
+ E10.9 - Type 1 diabetes mellitus without complications
86
+ E11.9 - Type 2 diabetes mellitus without complications
87
+ E08.9 - Diabetes mellitus due to an underlying condition without complications
88
+ E13.9 - Other specified diabetes mellitus without complications
89
+ E10.65 - Type 1 diabetes mellitus with hyperglycemia
90
+ E11.65 - Type 2 diabetes mellitus with hyperglycemia
91
+ E08.65 - Diabetes mellitus due to an underlying condition with hyperglycemia
92
+ E13.65 - Other specified diabetes mellitus with hyperglycemia
93
+ """)
94
 
95
 
96
  # Define main function
 
127
  # Get the PHQ9 questions
128
  questions = create_phq9_questions()
129
 
130
+ diabetes_code_lookup('E11.9')
131
+
132
  # Display each question and an input text field for the answer
133
  for question in questions:
134
  st.markdown(question["question"])