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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -7,35 +7,38 @@ import gradio as gr
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)
@@ -44,7 +47,10 @@ with gr.Blocks() as demo:
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
 
 
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
  basedir = os.path.dirname(__file__)
11
  data = pd.read_csv(f'LoincTableCore.csv')
12
  swith=data.loc[data['COMPONENT'].str.contains(name, case=False)]
13
  return swith
14
 
15
  def MatchLOINCPanelsandForms(name):
 
16
  basedir = os.path.dirname(__file__)
17
  data = pd.read_csv(f'PanelsAndForms.csv')
18
  swith=data.loc[data['ParentName'].str.contains(name, case=False)]
19
  return swith
20
 
21
  def MatchSNOMED(name):
 
22
  basedir = os.path.dirname(__file__)
23
  data = pd.read_csv(f'sct2_TextDefinition_Full-en_US1000124_20220901.txt',sep='\t')
 
24
  swith = data[data['term'].str.match(name)]
25
  return swith
26
 
27
+ def MatchOMS(name):
28
+ basedir = os.path.dirname(__file__)
29
+ data = pd.read_csv(f'SnomedOMS.csv')
30
+ swith = data[data['SNOMED CT'].str.match(name)]
31
+ return swith
32
+
33
 
34
 
35
  with gr.Blocks() as demo:
36
  name = gr.Textbox(label="Name")
37
 
38
  output1 = gr.TextArea(label="Output Match LOINC", max_lines=100, interactive=True, )
39
+ output2 = gr.TextArea(label="Output Match LOINC Panels and Forms", max_lines=100, interactive=True,)
40
+ output3 = gr.TextArea(label="Output Match SNOMED", max_lines=100, interactive=True,)
41
+ output4 = gr.TextArea(label="Output Match SNOMED", max_lines=100, interactive=True,)
42
 
43
  button1 = gr.Button("Match LOINC Clinical Terminology")
44
  button1.click(fn=MatchLOINC, inputs=name, outputs=output1)
 
47
  button2.click(fn=MatchLOINCPanelsandForms, inputs=name, outputs=output2)
48
 
49
  button3 = gr.Button("Match SNOMED Clinical Terminology")
50
+ button3.click(fn=MatchSNOMED, inputs=name, outputs=output3)
51
+
52
+ button3 = gr.Button("Match SNOMED and OMS Clinical Terminology")
53
+ button3.click(fn=MatchOMS, inputs=name, outputs=output4)
54
 
55
 
56