An update to the medication resources in FHIR needs to be done. The following updates to each resource:
Medication- MedicationMix
[x] Update so only generating distinct medication mixes (currently generating one for every prescription). Look into using product_decription/product_code. Currently with prescriptions we get ~23,000 medication resources, but only 10,625 are straight medication resources and only ~2,000 prescriptions are needed for multiple drugs. The rest of the prescriptions are just one drug (so should be mapped to medication resource instead of making a medication mix).
[x] Debate UUID source text, should it be product_code or some concatenation of values. Currently pharmacy_id which won't work after distinct medication mixes are made
[x] Add medication-drug binding to mimic-medication profile (not bound right now until the medication/medication mix sorted)
MedicationAdministration
[x] Set provenance for administration (icu vs hosp). But also think of better provenance groupings than icu/hosp
Do we set this as the EventHistory provenance or add an extension for the info?
[x] Reference the medication mixes via product_description (found in emar_detail for hosp, not in inputevents or d_items). ICU medadmin should be fine without medication mixes as they are a subset of about ~400 meds just for ICU
[x] Add in SIG to the text field (or see if there is a good spot for it, SIG may go in MedicationRequest actually)
[x] dosage.dose.value must be numeric but the source column emar.dose_due does provides some text and some numeric values. Need to either decide on some logic how to deal with this, or have multiple medication admin for the dose_given?
Multiple admin for each dose given (but still text in dose_given... so need to strip that out)
Potentially have a parent med admin with dose_due information (kinda like a Dispense resource, but no way to connect Medication Dispense resource into Medication Administration resource
MedicationRequest
[x] Add medication requests not in pharmacy. Pull from prescriptions table
[x] Add fhir_etl table for status element for mapping of MIMIC-IV status value to FHIR standard value. status element is bound in MedicationRequest as a code, so no codesystem can be supplied like in a CodeableConcept. Need this updated so that profiles will validate in anneal.
[x] Add additional info to dosageInstructions. Look into prescriptions and pharmacy columns for anything on dose, rate, duration etc. Document in MIMIC-IV to FHIR mappings file
[x] Reference medication mixes via the updated medication-codes
MedicationDispense
[x] Investigate the use in adding MedicationDispense. Can link to MedicationAdministrations
Misc To Do
[x] Delete fhir_etl.map_drug_id. NDC mapping to be done later so all drugs pulled into Medication resource
[x] Map out medication landscape for MIMIC (jupyter notebook)
There are some product_description/product_code that are set to NULL. I don't think we can use this as the medication code. I'll be sticking with just the drug name for now
Also not all medication mix prescriptions are used in emar, so can't rely on the product_descriptions
An update to the medication resources in FHIR needs to be done. The following updates to each resource:
Medication- MedicationMix
MedicationAdministration
MedicationRequest
pharmacy
. Pull fromprescriptions
tablestatus
element for mapping of MIMIC-IV status value to FHIR standard value.status
element is bound in MedicationRequest as a code, so no codesystem can be supplied like in a CodeableConcept. Need this updated so that profiles will validate in anneal.dosageInstructions
. Look intoprescriptions
andpharmacy
columns for anything on dose, rate, duration etc. Document in MIMIC-IV to FHIR mappings fileMedicationDispense
Misc To Do
emar
,emar_detail
, andinputevents