fastenhealth / fasten-onprem

Fasten is an open-source, self-hosted, personal/family electronic medical record aggregator, designed to integrate with 100,000's of insurances/hospitals/clinics
GNU General Public License v3.0
1.61k stars 84 forks source link

"patient-friendly" descriptions of LOINC/SNOMED/etc codes. #46

Open jaspermayone opened 1 year ago

jaspermayone commented 1 year ago

Creating this issue to stash some resources we have found to find "patient-friendly" descriptions of LOINC/SNOMED/etc codes.

I will post resources here shortly.

jaspermayone commented 1 year ago

Both https://github.com/IHTSDO/snomed-database-loader and https://github.com/IHTSDO/snowstorm look like good SNOMED options, provided by https://github.com/IHTSDO

jaspermayone commented 1 year ago

We know that snomed content is licensed - we are not sure how it is for open-source, but commercial usage of it definitely requires the vendor to have a license

jaspermayone commented 1 year ago

We know that snomed content is licensed - we are not sure how it is for open-source, but commercial usage of it definitely requires the vendor to have a license

See https://www.snomed.org/snomed-ct/get-snomed

jaspermayone commented 1 year ago

From the Fasten discord....

Vadi: snomed content is licensed - I'm not sure how it is for open-source, but commercial usage of it definitely requires the vendor to have a license see https://www.snomed.org/snomed-ct/get-snomed

Analog J: @Vadi my understanding is that the HL7 Fhir foundation has a agreement/partnership with SNOMED to officially support their codes, which is why they show up in the FHIR exports and terminology server. Since there's no "patient friendly" description of codes, I don't think we need a SNOMED license, since we won't be using the raw code dataset

Vadi: Yeah, codes which are included in the FHIR spec itself are okay. Specifically, the Global Patient Set: https://terminology.hl7.org/3.1.0/ValueSet-snomed-intl-gps.html More info: https://www.snomed.org/news-and-events/articles/broadening-intl-patient-care-interoperability- gps

jaspermayone commented 1 year ago

Also from @AnalogJ in the Discord.....

Hi,

I'm working on a patient facing application and I'd like to display LOINC/SNOMED/etc codes with additional context -- basically patient friendly descriptions of the codes.

eg. when searching LOINC LP14890-5 we arrive at https://loinc.org/LP14890-5/ which has 2 text blocks under the Descriptions header - one from Wikipedia and one from Lab Tests Online

However when searching the LOINC dataset CSV files (or the FHIR terminology server https://tx.fhir.org/loinc/

jaspermayone commented 1 year ago

Also from @AnalogJ in the Discord.....

Hi, I'm working on a patient facing application and I'd like to display LOINC/SNOMED/etc codes with additional context -- basically patient friendly descriptions of the codes. eg. when searching LOINC LP14890-5 we arrive at https://loinc.org/LP14890-5/ which has 2 text blocks under the Descriptions header - one from Wikipedia and one from Lab Tests Online However when searching the LOINC dataset CSV files (or the FHIR terminology server https://tx.fhir.org/loinc/

That post can be found here.

or at https://chat.fhir.org/#narrow/stream/179202-terminology/topic/Patient.20Friendly.20LOINC.2FSNOMED.20descriptions/near/320988014

jaspermayone commented 1 year ago

From Carol Macumber In reply...

If the additional information is available in the LOINC release files, they could be represented as codesystem.concept.definition in the tx.fhir LOINC Code System. Rob Hausam looks like the LOINC code system resource at tx.fhir is limited to the axises, code and LOINC name (similar to what's available from Regenstrief directly https://fhir.loinc.org/CodeSystem/$lookup?system=http://loinc.org&code=LP14890-5). If this reference material were to be represented as a definition, there doesn't appear a way to declare it's origin (in this case wikipedia and lab tests online). There is a code system extension for source reference, but that's extending codesystem not codesystem.code http://build.fhir.org/extension-codesystem-sourcereference.html

jaspermayone commented 1 year ago

@AnalogJ#3506 my UMLS License was just Approved.... I will take a look at the data they provide in a little bit....

jaspermayone commented 1 year ago

SCR-20230130-h8v

jaspermayone commented 1 year ago

I think we want Value Set Authority Center (VSAC) and/or SNOMED CT

RxNorm could also be useful to integrate.

jaspermayone commented 1 year ago

https://documentation.uts.nlm.nih.gov/rest/home.html

image
jaspermayone commented 1 year ago

SCR-20230130-hhx

jaspermayone commented 1 year ago

When you make a get request to the uri inside the first result, you get

SCR-20230130-iu3

jaspermayone commented 1 year ago

The key there is the definitions. When you preform a get request on that, you get

SCR-20230130-ixr

jaspermayone commented 1 year ago

The full object body for that, is

{
    "pageSize": 25,
    "pageNumber": 1,
    "pageCount": 1,
    "result": [
        {
            "rootSource": "MSHCZE",
            "value": "Zlomeniny některé kosti/kostí v kotníku. Bimaleolární fraktura = fraktura obou kotníků, trimaleolární zlomenina = fraktura obou kotníků a zadní hrany tibie.",
            "classType": "Definition",
            "sourceOriginated": true
        },
        {
            "rootSource": "NCI",
            "value": "Traumatic or pathological injury to the ankle joint in which the continuity of an ankle bone is broken. Symptoms include pain, swelling, and difficulty moving the affected leg and foot.",
            "classType": "Definition",
            "sourceOriginated": true
        },
        {
            "rootSource": "MSH",
            "value": "Fractures of any of the bones of the ANKLE.",
            "classType": "Definition",
            "sourceOriginated": true
        },
        {
            "rootSource": "HPO",
            "value": "A fracture or multiple fractures of one or more of three bones in the ankle joint: the tibia (shinbone), the fibula (outer ankle bone), and the talus (which is the bone that connects your leg to your foot). [https://www.hss.edu/condition-list_ankle-fractures.asp]",
            "classType": "Definition",
            "sourceOriginated": true
        },
        {
            "rootSource": "MSHNOR",
            "value": "Brudd i ankelbeina.",
            "classType": "Definition",
            "sourceOriginated": true
        },
        {
            "rootSource": "MSHPOR",
            "value": "Fraturas de quaisquer ossos do TORNOZELO.",
            "classType": "Definition",
            "sourceOriginated": true
        },
        {
            "rootSource": "MSHSPA",
            "value": "Fracturas de cualquiera de los huesos del TOBILLO.",
            "classType": "Definition",
            "sourceOriginated": true
        }
    ]
}
jaspermayone commented 1 year ago

For LONIC, the first 2 steps work, but there is no definition...

Step 1 for a LONIC code looks the same in terms of a response. For the 2nd response, the LONIC res looks like this.

{
    "pageSize": 25,
    "pageNumber": 1,
    "pageCount": 1,
    "result": {
        "ui": "C4739649",
        "name": "Fracture Risk Assessment:-:Pt:^Patient:-:FRAX",
        "dateAdded": "05-06-2019",
        "majorRevisionDate": "01-03-2019",
        "classType": "Concept",
        "suppressible": false,
        "status": "R",
        "semanticTypes": [
            {
                "name": "Clinical Attribute",
                "uri": "https://uts-ws.nlm.nih.gov/rest/semantic-network/2022AB/TUI/T201"
            }
        ],
        "atoms": "https://uts-ws.nlm.nih.gov/rest/content/2022AB/CUI/C4739649/atoms",
        "definitions": "NONE",
        "relations": "NONE",
        "defaultPreferredAtom": "https://uts-ws.nlm.nih.gov/rest/content/2022AB/CUI/C4739649/atoms/preferred",
        "atomCount": 4,
        "cvMemberCount": 0,
        "attributeCount": 0,
        "relationCount": 0
    }
}
AnalogJ commented 1 year ago

Hey @j-dogcoder Thanks for diving into this, this is great!

So it sounds like you were able to find the "Description" for SNOMED codes but not LOINC? Hm. Is there another way that we can pull the LOINC descriptions? maybe using a medical wiki database query?

jaspermayone commented 1 year ago

Hrm.... none of the suggested links seem to have anything. I will keep looking. The SNOMED description seems to be patent friendly enough

jaspermayone commented 1 year ago

Are you looking for a dataset you can store? Or will API queries be sufficient?

Being able to store the data will allow Fasten to be closer to offline able

AnalogJ commented 1 year ago

@j-dogcoder fixed some of the links above. Basically wikidata is a wiki-like database, with easy access to data in json format. Wikidoc and Wikipedia are both built ontop of MediaWiki, which has an API.

Are you looking for a dataset you can store? Or will API queries be sufficient? Being able to store the data will allow Fasten to be closer to offline able

Agreed, ideally we'd be able to generate a dataset of patient-friendly descriptions for each code, and have that available in the Fasten database, without requiring API access. Most of Wikipedia's content is licensed under Creative Commons, so this should be fair use as long as we reference Wikipedia in the UI.

Since you found SNOMED patient-friendly descriptions already, should we start with them? Write a script to extract the code, description, and any other fields that would be useful for Fasten, and then import it into the database?

AnalogJ commented 1 year ago

I also posted on LOINC's contact-us page, asking them the same question as my FHIR Tulip post

AnalogJ commented 1 year ago

Hell, it might be interesting to use ChatGPT to create summaries of each code as well -- if we had a good way to verify that the results weren't complete lies 😨

jaspermayone commented 1 year ago

Hell, it might be interesting to use ChatGPT to create summaries of each code as well -- if we had a good way to verify that the results weren't complete lies 😨

That could be interesting, but without a way to verify that, we should steer clear for now.

jaspermayone commented 1 year ago

@j-dogcoder fixed some of the links above. Basically wikidata is a wiki-like database, with easy access to data in json format. Wikidoc and Wikipedia are both built ontop of MediaWiki, which has an API.

Are you looking for a dataset you can store? Or will API queries be sufficient? Being able to store the data will allow Fasten to be closer to offline able

Agreed, ideally we'd be able to generate a dataset of patient-friendly descriptions for each code, and have that available in the Fasten database, without requiring API access. Most of Wikipedia's content is licensed under Creative Commons, so this should be fair use as long as we reference Wikipedia in the UI.

Since you found SNOMED patient-friendly descriptions already, should we start with them? Write a script to extract the code, description, and any other fields that would be useful for Fasten, and then import it into the database?

I agree that ideally we would have it in the DB... I will write a script to extract it all... do you just want it as json? or... how are we getting this into the db?

jaspermayone commented 1 year ago

@AnalogJ What kind of db do we use?

jaspermayone commented 1 year ago

I was browsing https://www.nlm.nih.gov/research/umls/licensedcontent/umlsknowledgesources.html and downloaded both the UMLS Metathesaurus Full Subset and MRCONSO.RRF

jaspermayone commented 1 year ago

@AnalogJ what one looks better for our usecase?

jaspermayone commented 1 year ago
image
jaspermayone commented 1 year ago

Or is there something else on that page that looks better?

jaspermayone commented 1 year ago

would you like be to import it into the db?? or just upload the file for you to use?

AnalogJ commented 1 year ago

sorry for the delay getting back to you @j-dogcoder

AnalogJ commented 1 year ago

on the other hand, the Definitions file - MRDEF.RRF - https://www.ncbi.nlm.nih.gov/books/NBK9685/#ch03.sec3.3.6 does have a description

jaspermayone commented 1 year ago

I can't seem to find that file in the download, and I don't seem to see definitions in the other one. The definitions I found were in the API... maybe I need to write some script to query the API for every single code?

jaspermayone commented 1 year ago

@AnalogJ what are your thoughts on this?

jaspermayone commented 1 year ago

Ugh... when searching with exact, it doesn’t work at all... (doesn’t provide any results) 😠 😠 😠 @AnalogJ plan b?

AnalogJ commented 1 year ago

Just some notes for future me:


Here are some medical databases that can be used to find patient-friendly articles by LOINC code:


AnalogJ commented 1 year ago

https://www.wikidata.org/wiki/Q183392

jaspermayone commented 1 year ago

👍🏻

jaspermayone commented 1 year ago

@AnalogJ Should have this done on the repo by the 2nd week in April

AnalogJ commented 1 year ago

I think this is what we're going to want to use:

**Search By Codes*** https://medlineplus.gov/medlineplus-connect/web-service/

https://medlineplus.gov/about/developers/webservices/

examples:

*Search By Text

https://medlineplus.gov/about/developers/webservices/

It's not perfect, but it supports SNOMED, LOINC and ICD-9/10 codes.

AnalogJ commented 1 year ago

I'm going to try to play around with it today.

Our fallback might be the wikidata database or Unified Medical Language System (UMLS) api.

jaspermayone commented 1 year ago

👍🏻

jaspermayone commented 1 year ago

Hey @AnalogJ, looking at your changes... For best offline usability, perhaps these things can be stored in the lighthouse db? I am planning on updating the script in Vital-Link/patient-friendly-codes, which exports it all to JSON, and periodically updates it if anything changes (will do something similar with Issue #95 (NPI numbers) after I get this finished up. In the long term, I will probably expose the codes over an API as well... Fasten is welcome to use one or both of those when it's complete, so only one of us has to maintain it if that makes sense.

jaspermayone commented 1 year ago

Ah! Keep putting things in the wrong repo!

AnalogJ commented 1 year ago

Hey @j-dogcoder

For best offline usability, perhaps these things can be stored in the lighthouse db? I am planning on updating the script in Vital-Link/patient-friendly-codes, which exports it all to JSON, and periodically updates it if anything changes

Yep, this data needs to be available offline. I think the best place to do this caching is in the Fasten db (locally).


I think the next step should be to work on NPI numbers, finding a way to look them up/map them to each Organization.

I've been noodling around with a couple of ideas for how we can build something to allow the community to contribute. I'll update https://github.com/fastenhealth/fasten-onprem/issues/95

jaspermayone commented 1 year ago

Glad this got completed! Left you a comment on the NPI numbers issue.

Will continue to keep this open in Vital-Link/patient-friendly-codes#2 for anyone interested.

AnalogJ commented 1 year ago

code - descriptions

AnalogJ commented 1 year ago

http://lite.bmi.utah.edu/OpenInfobuttonDemo.html#