Opened 5 years ago

Last modified 3 years ago

#2059 new enhancement

Medications mapped to Other Medication Concepts folder belong elsewhere in the hierarchy

Reported by: ngraham Owned by: ngraham
Priority: minor Milestone: heron-menomonee-update
Component: data-repository Keywords: public-web
Cc: dconnolly, rwaitman, tmcmahon Blocked By:
Blocking: Sensitive: no

Description

There are medications in the "Other Medication Concepts" folder in i2b2 that really belong elsewhere in the hierarchy. As per ticket:1451#comment:16, let's take a manual approach to moving these medications to their appropriate place in the hierarchy.

This is a follow-on to #1451.

Change History (24)

comment:1 Changed 5 years ago by ngraham

  • Priority changed from major to minor

comment:2 Changed 5 years ago by ngraham

  • Blocked By set to 2278
  • Milestone changed from heron-solomon-update to heron-lovewell-update

Perhaps the Epic/FDB module that the hospital has purchased will help us get more medication mapped to the hierarchy (#2278)

comment:3 Changed 5 years ago by ngraham

  • Blocked By 2278 deleted

comment:4 Changed 4 years ago by dconnolly

  • Blocking set to 2626

(In #2626) While those medication ids are in the clarity metadata ("content") tables, there are almost no relevant orders.

We have some plans to do better with metadata in such cases (#2059) but given how little data there is anyway, I doubt it's of much use to the investigators.

There are no orders in clarity at all for 315068 and only a handful for any of the 3.

It turns out we prune medication_ids where there are no mappings to standard medication terminologies and very few facts.

No rows:

select *
from
clarity.order_med com
where com.medication_id in (315068);

A handful of rows:

select *
from
clarity.order_med com
where com.medication_id in (315068, 314765, 314857);

comment:5 Changed 4 years ago by ngraham

Let's make sure the following get mapped to [HA000] HERBS/ALTERNATIVE THERAPIES:

314765	ASHWAGANDHA ROOT EXTRACT(BULK) 2.5 % MISC POWD
314857	ASHWAGANDHA ROOT EXTRACT(BULK) MISC
315068	ASHWAGANDHA ROOT EXTRACT

See #2626.

comment:6 Changed 4 years ago by ngraham

  • Blocking 2626 deleted

(In #2626) It turns out we already have the the the data from pat_enc_curr_meds loaded into HERON as they are the ones marked as "home medications" in the order table. Making sure that Ashwagandha is in the hierarchy is a duplicate of #2059 - I've noted Ashwagandha there.

Details

Dolores responded and let us know that the rows in the pat_enc_curr_meds table are the same ones marked as "historical" in the order table so this is already searchable in HERON (see ticket:1004).

From: Dolores Boring <dboring@kumc.edu>
To: Nathan Graham <ngraham@kumc.edu>, Jean Sunega <jsunega@kumc.edu>
CC: Tamara McMahon <tmcmahon@kumc.edu>
Subject: RE: Photo - PAT_ENC_CURR_MEDS
Date: Mon, 14 Apr 2014 21:23:35 +0000

In Clarity, the PAT_ENC_CURR_MEDS table contains the ‘meds’ that the patient reports they are taking when they arrive. Many of these are over-the-counter, but they are included and recorded with a medication ID.
They will be in the Orders table for the Medications, but they will be marked as a ‘Historical’ order, since they are not prescribed during an encounter.

So, I don't think there new facts for us to bring in. But, I've noted 'Ashwagandha root' as something that could be manually curated as part of #2059 (see also med_ontology_g78 branch).

comment:7 Changed 4 years ago by ngraham

  • Keywords public-web added

comment:8 Changed 4 years ago by ngraham

The medication mapping code was redesigned as part of GPC related work. This redesign included changing the concept paths to be based on atom identifiers/Atomic Unique Identifiers (AUIs) rather than medication names (requiring string manipulation to get uniqueness). When we ran the new AUI-based code against recent KUMC Clarity data, the "most facts covered by mapped medications" test failed. I realized that the new AUI-based code didn't count items in the "Other Medications" folder as being mapped whereas the old code did.

I feel that the test is more appropriate before we add things that don't map directly to RxNorm. So, I adjusted the test threshold by 1% to account for the difference in [49c397c27696].

Details

I just recently merged the new AUI-based medication ontology (see GPC:ticket:78) to default (see GPC:ticket:152, and 2a4c44f8723a). I was asked to upload the new ontology for KUMC to Babel. When I manually ran the medication mapping code code against recent data, the "most med facts covered by mapped medications" test failed. It showed only 98% of medication facts were mapped medications (goal was 99% or better). The "old" code (before rewriting the AUI-based approach) passed the 99% threshold.

However, after further investigation I realized that the new AUI-based code includes items in the "Other Medications" folder after the most med facts covered by mapped medications test. Whereas the "old" method includes items in the "Other Medications" folder before the "most med facts covered by mapped medications" test.

Note that the "Other Medications" folder is where we put the top 500 medications by fact count that didn't get mapped to RxNorm directly.

In other words, the new AUI-based code didn't count items in the "Other Medications" folder as being mapped whereas the old code did.

Out of curiosity, I ran the old code and found the "most meds are mapped" test only covered 95.44% of the facts. So, medication fact-wise, the new code actually covers more (98%).

I added the "Other Medications" folder to the AUI-based code after the coverage test in b362d46625b4.

For reference, here's the modified test ("old" code):

with med_facts as(
  --Distinct counts by concept wrt medications
  select distinct concept_cd, facts
  from blueheronmetadata.counts_by_concept@deid cbc
  where cbc.concept_cd like 'KUH|MEDICATION_ID:%'
  ),
rxnorm_med_concepts as(
  --Distinct concepts that link to RxNorm
  select distinct(c_basecode) concept_cd
  from BLUEHERONMETADATA.rxnorm_terms@deid
  where c_visualattributes = 'LA'
  and c_fullname not like '\i2b2\Medications\Other Medication Concepts%'
  ),
joined_rx_med_concepts as(
  -- Find facts where we don't map to RxNorm
  select distinct mfct.concept_cd facts_concept_cd, mfct.facts, rxnc.concept_cd rxn_concept_cd
  from med_facts mfct
  left join rxnorm_med_concepts rxnc
  on mfct.concept_cd = rxnc.concept_cd
  where rxnc.concept_cd is null
  ),
total_facts as(
  -- Total facts summed up
  select sum(medf.facts) sumfacts
  from med_facts medf
  ),
non_matching_rxfacts as(
  --Non-Matching facts summed up
  select sum(j.facts) sumfacts
  from joined_rx_med_concepts j
  ),
report as(
  select round(100*( 1 - (non_matching_rxfacts.sumfacts / total_facts.sumfacts) ), 2) prcnt_matching_rxnorm, 
    total_facts.sumfacts total_facts, non_matching_rxfacts.sumfacts non_matching_rxnorm_facts
  from total_facts, non_matching_rxfacts
  )
select *--case when r.prcnt_matching_rxnorm < 99.0 then 1/0 else 1 end rxnorm_fact_coverage
from report r;
--99.5, but without "other"....95.44

comment:9 Changed 4 years ago by dconnolly

  • Milestone changed from heron-verdigris-update to heron-kanopolis-update

postponing tickets other than those identified as Verdigris priorities in today's heron-weekly meeting

comment:10 Changed 4 years ago by ngraham

Matt reviewed the changeset noted in comment:8 at my desk. I ran a test build in Jenkins build 231. Merged in [1aa80dbd089f].

comment:11 Changed 3 years ago by dconnolly

  • Milestone changed from heron-kanopolis-update to dconnolly

Milestone renamed

comment:12 Changed 3 years ago by dconnolly

  • Milestone changed from dconnolly to heron-kanopolis-update

Milestone renamed

comment:13 Changed 3 years ago by dconnolly

  • Milestone changed from heron-kanopolis-update to dconnolly

Milestone renamed

comment:14 Changed 3 years ago by dconnolly

  • Milestone changed from dconnolly to heron-kanopolis-update

Milestone renamed

comment:15 Changed 3 years ago by dconnolly

  • Milestone changed from heron-kanopolis-update to heron-webster-update

closing Kanopolis, postponing remaining minor tickets without discussion

comment:16 Changed 3 years ago by ngraham

  • Milestone changed from heron-webster-update to heron-mcmillan-marsh-update

Ticket retargeted after milestone closed

comment:17 Changed 3 years ago by dconnolly

  • Milestone changed from heron-mcmillan-marsh-update to heron-cheyenne-bottoms-update

Ticket retargeted after milestone closed

comment:18 Changed 3 years ago by ngraham

  • Milestone changed from heron-cheyenne-bottoms-update to heron-quivira-update

Postponing tickets not promoted in heron-weekly today.

comment:19 Changed 3 years ago by mhoag

  • Milestone changed from heron-quivira-update to heron-jamestown-update

Ticket retargeted after milestone closed

comment:20 Changed 3 years ago by ngraham

  • Milestone changed from heron-jamestown-update to heron-calhoun-update

Ticket retargeted after milestone closed

comment:21 Changed 3 years ago by ngraham

  • Milestone changed from heron-calhoun-update to heron-riverwalk-update

Ticket retargeted after milestone closed

comment:22 Changed 3 years ago by mhoag

  • Milestone changed from heron-riverwalk-update to heron-ray-hubbard-update

Ticket retargeted after milestone closed

comment:23 Changed 3 years ago by ngraham

  • Milestone changed from heron-ray-hubbard-update to heron-michigan-update

Ticket retargeted after milestone closed

comment:24 Changed 3 years ago by ngraham

  • Milestone changed from heron-michigan-update to heron-menomonee-update

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.