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'{basedir}/LoincTableCore.csv') # LOINC Download https://loinc.org/downloads/ swith = data[data['COMPONENT'].str.match(name)] return switch def MatchSNOMED(name): import pandas as pd basedir = os.path.dirname(__file__) 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 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") 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) demo.launch(debug=True)