File size: 1,958 Bytes
4350907
 
 
 
 
 
 
 
 
1ff8b36
01a65c5
8587a88
eb39f38
4350907
7552c7b
 
 
 
 
 
 
4350907
 
 
f8b3070
4350907
 
 
 
 
 
 
 
 
 
 
 
7552c7b
 
4350907
 
7552c7b
4350907
 
7552c7b
 
 
 
 
4350907
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import os
import pandas as pd
import gradio as gr



def MatchLOINC(name):
    import pandas as pd
    basedir = os.path.dirname(__file__)
    data = pd.read_csv(f'LoincTableCore.csv')     # LOINC Download https://loinc.org/downloads/
    swith=data.loc[data['COMPONENT'].str.contains(name, case=False)]
    #swith = data[data['COMPONENT'].str.match(name)]
    return swith
    
def MatchLOINCPanelsandForms(name):
    import pandas as pd
    basedir = os.path.dirname(__file__)
    data = pd.read_csv(f'PanelsAndForms.csv')     # LOINC Download https://loinc.org/downloads/
    swith = data[data['ParentName'].str.match(name)]
    return swith
    
def MatchSNOMED(name):
    import pandas as pd
    basedir = os.path.dirname(__file__)
    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
    swith = data[data['term'].str.match(name)]
    return swith



# ECQM for Value Set Measures and Quality Reporting: https://vsac.nlm.nih.gov/download/ecqm?rel=20220505&res=eh_only.unique_vs.20220505.txt
# SNOMED Nurse Subset https://www.nlm.nih.gov/healthit/snomedct/index.html?_gl=1*36x5pi*_ga*MTI0ODMyNjkxOS4xNjY1NTY3Mjcz*_ga_P1FPTH9PL4*MTY2Nzk4OTI1My41LjEuMTY2Nzk4OTY5Ni4wLjAuMA..

with gr.Blocks() as demo:
    name = gr.Textbox(label="Name")
    output1 = gr.Textbox(label="Output Match LOINC")
    output2 = gr.Textbox(label="Output Match SNOMED")
    output3 = gr.Textbox(label="Output Match LOINC Panels and Forms")

    button1 = gr.Button("Match LOINC Clinical Terminology")
    button1.click(fn=MatchLOINC, inputs=name, outputs=output1)
    
    button2 = gr.Button("Match SNOMED Clinical Terminology")
    button2.click(fn=MatchSNOMED, inputs=name, outputs=output2)
    
    button3 = gr.Button("Match LOINC Panels and Forms")
    button3.click(fn=MatchLOINCPanelsandForms, inputs=name, outputs=output3)
    
    

demo.launch(debug=True)