awacke1 commited on
Commit
4350907
1 Parent(s): 38f51c2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -0
app.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import pandas as pd
3
+ import gradio as gr
4
+
5
+
6
+
7
+ def MatchLOINC(name):
8
+ import pandas as pd
9
+ basedir = os.path.dirname(__file__)
10
+ data = pd.read_csv(f'{basedir}/LoincTableCore.csv') # LOINC Download https://loinc.org/downloads/
11
+ swith = data[data['COMPONENT'].str.match(name)]
12
+ return switch
13
+
14
+ def MatchSNOMED(name):
15
+ import pandas as pd
16
+ basedir = os.path.dirname(__file__)
17
+ data = pd.read_csv(f'{basedir}/sct2_Description_Full-en_US1000124_20220901.txt',sep='\t') # SNOMEDCT Download https://www.nlm.nih.gov/healthit/snomedct/us_edition.html
18
+ swith = data[data['term'].str.match(name)]
19
+ return swith
20
+
21
+
22
+
23
+ # ECQM for Value Set Measures and Quality Reporting: https://vsac.nlm.nih.gov/download/ecqm?rel=20220505&res=eh_only.unique_vs.20220505.txt
24
+ # SNOMED Nurse Subset https://www.nlm.nih.gov/healthit/snomedct/index.html?_gl=1*36x5pi*_ga*MTI0ODMyNjkxOS4xNjY1NTY3Mjcz*_ga_P1FPTH9PL4*MTY2Nzk4OTI1My41LjEuMTY2Nzk4OTY5Ni4wLjAuMA..
25
+
26
+ with gr.Blocks() as demo:
27
+ name = gr.Textbox(label="Name")
28
+ output1 = gr.Textbox(label="Output Match LOINC")
29
+ output2 = gr.Textbox(label="Output Match SNOMED")
30
+ button1 = gr.Button("Match LOINC Clinical Terminology")
31
+ button1.click(fn=MatchLOINC, inputs=name, outputs=output1)
32
+ button2 = gr.Button("Match SNOMED Clinical Terminology")
33
+ button2.click(fn=MatchSNOMED, inputs=name, outputs=output2)
34
+
35
+ demo.launch(debug=True)