ExposuresProvider / icees-api-config

Other
0 stars 1 forks source link

FHIR_mappings #70

Open karafecho opened 2 years ago

karafecho commented 2 years ago

This issue is intended to track progress on our FHIR_mappings effort.

To recap, Hong generated code to convert the manually generated input YAML file here, which contains Athena search terms and parameters for ICEES feature variables, to FHIR mappings with systems + codes to enable FHIR PIT to retrieve patient data from FHIR files.

The search schema for different variable domains is as follows.

Athena Query Rules - Examples:

  1. Diagnoses

    CysticFibrosisDx:

    search_term: "cystic fibrosis"
    domain: Condition
    class: ICD10 Hierarchy
  2. Medications

    AlbuterolRx

    search_term: "albuterol"
    domain: Drug
    vocab: RxNorm
    class: Ingredient
  3. Labs

    FEV

    search_term: "forced expiratory volume"
    domain: Measurement, Observation
    class: LOINC component (optional)
    vocab: LOINC
  4. Procedures

    LungTransplant

    search_term: "lung transplant"
    domain: Procedure
    vocab: CPT4, ICD9Proc, ICD9ProcCN
  5. Patient Demographics

    Race_UNC_Health Hard coded

karafecho commented 2 years ago

Upon initial testing, Kara noted the following:

For one lab, one diagnosis, and one med, I reversed looked up the codes in Athena and sometimes directly from the source vocab (e.g., http://loinc.org)). I also tested my ability to retrieve the correct code manually when I entered the search terms in the Athena web browser using the search parameters I defined. I'm not sure the code is working as desired. In addition, for labs, I think we may need to restrict the answer to the first result only and/or add class LOINC component to the parameters. For meds and diagnoses, I don't think we need to restrict the answer to the first result only because the hierarchy traversal seems to work just fine.

Examples:

Albumin: https://athena.ohdsi.org/search-terms/terms?domain=Measurement&domain=Observation&vocabulary=LOINC&page=1&pageSize=15&query=%22albumin%22&boosts (without class LOINC component) AND https://athena.ohdsi.org/search-terms/terms?conceptClass=LOINC+Component&domain=Measu[…]cabulary=LOINC&page=1&pageSize=50&query=%22albumin%22&boosts (with class LOINC component); https://athena.ohdsi.org/search-terms/terms/40791227 first result is correct

AlbuterolRx: https://athena.ohdsi.org/search-terms/terms?conceptClass=Ingredient&domain=Drug&vocabulary=RxNorm&page=1&pageSize=15&query=%22albuterol%22&boosts; https://athena.ohdsi.org/search-terms/terms/1154343 albuterol only result returned

AsthmaDx: https://athena.ohdsi.org/search-terms/terms?conceptClass=ICD10+Hierarchy&domain=Condition&page=1&pageSize=50&query=%22asthma%22&boosts; https://athena.ohdsi.org/search-terms/terms/45596282 asthma only result returned (four hits to highest level of ICD10 ontology)

LungTransplant: https://athena.ohdsi.org/search-terms/terms?domain=Procedure&vocabulary=CPT4&vocabulary=ICD10PCS&vocabulary=ICD9Proc&vocabulary=ICD9ProcCN&vocabulary=ICD10CM&page=1&pageSize=15&query=%22lung+transplant%22&boosts; https://athena.ohdsi.org/search-terms/terms/2001372 15 results, accurate apart from one for anesthesia for lung transplant rather than the actual procedure

karafecho commented 2 years ago

Test2 is looking much more promising. I tested the same four variables as previously. Results are appended below. A + next to a code indicates a correct mapping; a - indicates an incorrect mapping.

A couple of comments:

  1. Hits appear to be restricted to a maximum of 15 per query. Given that this limit was not embedded in your code, I am thinking it is a limit at the API level, one that we hopefully can adjust.
  2. For diagnoses and meds, all 15 hits are correct. However, for both answer sets, the first hit is the only one that should have been returned. Apparently, Class ICD10 Hierarchy is not being applied for diagnoses and Class Ingredient is not being applied for meds.
  3. For procedures, the first 13 hits are correct; the 14th hit is incorrect but an exact string match for 'transplant'; and the 15th hit is simply incorrect. Is there a way to restrict the returns only to the full exact string match for, in this example, 'lung transplant'.
  4. Labs are a bit of a mess. (Figures!) However, I played around a bit, and I think it might work if we (i) add a parameter to Class LOINC Hierarchy (not LOINC Component); (ii) remove the 15-hit limit; and (iii) ensure exact string matches only.

We're getting closer...although I've said that before.

FHIR:
  AgeStudyStart:
    Patient:
      code: 21112-8
      system: http://loinc.org
  AgeStudyStart2:
    Patient:
      code: 21112-8
      system: http://loinc.org
  Albumin:
    Observation:
    - code: LP6118-6 + 
      system: http://loinc.org
    - code: LP14579-4 INCORRECT, but exact string match
      system: http://loinc.org
    - code: LP173997-0 INCORRECT, but exact string match
      system: http://loinc.org
    - code: LP264991-3 INCORRECT, but exact string match
      system: http://loinc.org
    - code: LP29302-4 INCORRECT, but exact string match
      system: http://loinc.org
    - code: LP99330-0 STOPPED TESTING
      system: http://loinc.org
    - code: LP14599-2
      system: http://loinc.org
    - code: 18180-0
      system: http://loinc.org
    - code: LP19341-4
      system: http://loinc.org
    - code: 10414-1
      system: http://loinc.org
    - code: LP62862-5
      system: http://loinc.org
    - code: LP147590-6
      system: http://loinc.org
    - code: LP147595-5
      system: http://loinc.org
    - code: LP147612-8
      system: http://loinc.org
    - code: 10385-3
      system: http://loinc.org

  AlbuterolRx:
    Drug:
    - code: '435'+
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '142153' + PRECISE INGREDIENT
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '58917' + BRAND NAME
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '1154606' + CLINICAL DOSE GROUP
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '1008406' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '687225' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '1007732' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '812737' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '214199' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '370541' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '252298' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '197316' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '197318' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '2108368'+
      system: http://www.nlm.nih.gov/research/umls/rxnorm
    - code: '2108232' +
      system: http://www.nlm.nih.gov/research/umls/rxnorm
  AsthmaDx:
    Condition:
    - code: J45 - +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '155574008'- +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '21341004'- +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: D001249 +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '195967001' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '34015007' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '57607007' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '233688007' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '31387002' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '11641008' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '829976001' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '71892000' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '16862005' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '187687003' +
      system: http://hl7.org/fhir/sid/icd-10-cm
    - code: '401193004'+
      system: http://hl7.org/fhir/sid/icd-10-cm
 LungTransplant:
    Procedure:
    - code: '33.5' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '33.5' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '1006038' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '32851'+
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '32852' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: 00580 +/- (anesthesia)
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '32853'+
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '32854' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '1006041' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '33.52' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '33.51' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '33.50' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '33935' +
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '11.69' - but exact string match for 'transplant'
      system: http://hl7.org/fhir/sid/icd-9-cm
    - code: '50.59' -
      system: http://hl7.org/fhir/sid/icd-9-cm
karafecho commented 2 years ago

Test4 - something went awry. (1) The output is now maxed at 10 hits. (2) Albumin, AlbuterolRx, and LungTransplant all have the same mappings. (3) AsthmaDx is picking up non-ICD codes. (4) I don't think class: Ingredient and class: ICD Heirarchy are being applied correctly to Drug and Condition, respectively. (5) Albumin is picking up non-LOINC codes.

karafecho commented 2 years ago

Test5 - identical to Test 2, except that hits appear to be capped at a maximum of 10 per variable. See comments re Test 2.