awacke1 commited on
Commit
07a0433
·
1 Parent(s): b7b4d5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -20
app.py CHANGED
@@ -1,52 +1,51 @@
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'LoincTableCore.csv') # LOINC Download https://loinc.org/downloads/
11
  swith=data.loc[data['COMPONENT'].str.contains(name, case=False)]
12
- #swith = data[data['COMPONENT'].str.match(name)]
13
  return swith
14
 
15
  def MatchLOINCPanelsandForms(name):
16
  import pandas as pd
17
  basedir = os.path.dirname(__file__)
18
- data = pd.read_csv(f'PanelsAndForms.csv') # LOINC Download https://loinc.org/downloads/
19
- swith = data[data['ParentName'].str.match(name)]
20
  return swith
21
 
22
  def MatchSNOMED(name):
23
  import pandas as pd
24
  basedir = os.path.dirname(__file__)
25
- data = pd.read_csv(f'sct2_TextDefinition_Full-en_US1000124_20220901.txt',sep='\t') # SNOMEDCT Download https://www.nlm.nih.gov/healthit/snomedct/us_edition.html
 
26
  swith = data[data['term'].str.match(name)]
27
  return swith
28
 
29
 
30
 
31
- # ECQM for Value Set Measures and Quality Reporting: https://vsac.nlm.nih.gov/download/ecqm?rel=20220505&res=eh_only.unique_vs.20220505.txt
32
- # SNOMED Nurse Subset https://www.nlm.nih.gov/healthit/snomedct/index.html?_gl=1*36x5pi*_ga*MTI0ODMyNjkxOS4xNjY1NTY3Mjcz*_ga_P1FPTH9PL4*MTY2Nzk4OTI1My41LjEuMTY2Nzk4OTY5Ni4wLjAuMA..
33
-
34
  with gr.Blocks() as demo:
35
  name = gr.Textbox(label="Name")
36
- output1 = gr.TextArea(label="Output Match LOINC, max_lines=100", interactive=True, )
37
- #output1 = gr.Dataframe(label="Dataframe"),
38
- output2 = gr.Textbox(label="Output Match SNOMED")
39
- output3 = gr.Textbox(label="Output Match LOINC Panels and Forms")
40
 
41
  button1 = gr.Button("Match LOINC Clinical Terminology")
42
  button1.click(fn=MatchLOINC, inputs=name, outputs=output1)
43
 
44
- button2 = gr.Button("Match SNOMED Clinical Terminology")
45
- button2.click(fn=MatchSNOMED, inputs=name, outputs=output2)
46
-
47
- button3 = gr.Button("Match LOINC Panels and Forms")
48
- button3.click(fn=MatchLOINCPanelsandForms, inputs=name, outputs=output3)
49
-
50
 
51
 
52
  demo.launch(debug=True)
 
1
  import os
2
  import pandas as pd
3
  import gradio as gr
4
+ # SNOMEDCT Download https://www.nlm.nih.gov/healthit/snomedct/us_edition.html
5
+ # LOINC Download https://loinc.org/downloads/
6
+ # ECQM for Value Set Measures and Quality Reporting: https://vsac.nlm.nih.gov/download/ecqm?rel=20220505&res=eh_only.unique_vs.20220505.txt
7
+ # SNOMED Nurse Subset https://www.nlm.nih.gov/healthit/snomedct/index.html?_gl=1*36x5pi*_ga*MTI0ODMyNjkxOS4xNjY1NTY3Mjcz*_ga_P1FPTH9PL4*MTY2Nzk4OTI1My41LjEuMTY2Nzk4OTY5Ni4wLjAuMA..
8
 
9
  def MatchLOINC(name):
10
  import pandas as pd
11
  basedir = os.path.dirname(__file__)
12
+ data = pd.read_csv(f'LoincTableCore.csv')
13
  swith=data.loc[data['COMPONENT'].str.contains(name, case=False)]
 
14
  return swith
15
 
16
  def MatchLOINCPanelsandForms(name):
17
  import pandas as pd
18
  basedir = os.path.dirname(__file__)
19
+ data = pd.read_csv(f'PanelsAndForms.csv')
20
+ swith=data.loc[data['ParentName'].str.contains(name, case=False)]
21
  return swith
22
 
23
  def MatchSNOMED(name):
24
  import pandas as pd
25
  basedir = os.path.dirname(__file__)
26
+ data = pd.read_csv(f'sct2_TextDefinition_Full-en_US1000124_20220901.txt',sep='\t')
27
+ #swith = data[data['term'].str.match(name)]
28
  swith = data[data['term'].str.match(name)]
29
  return swith
30
 
31
 
32
 
 
 
 
33
  with gr.Blocks() as demo:
34
  name = gr.Textbox(label="Name")
35
+
36
+ output1 = gr.TextArea(label="Output Match LOINC", max_lines=100, interactive=True, )
37
+ output2 = gr.Textbox(label="Output Match LOINC Panels and Forms")
38
+ output3 = gr.Textbox(label="Output Match SNOMED")
39
 
40
  button1 = gr.Button("Match LOINC Clinical Terminology")
41
  button1.click(fn=MatchLOINC, inputs=name, outputs=output1)
42
 
43
+ button2 = gr.Button("Match LOINC Panels and Forms")
44
+ button2.click(fn=MatchLOINCPanelsandForms, inputs=name, outputs=output2)
45
+
46
+ button3 = gr.Button("Match SNOMED Clinical Terminology")
47
+ button3.click(fn=MatchSNOMED, inputs=name, outputs=output2)
48
+
49
 
50
 
51
  demo.launch(debug=True)