MedicationAdministration.jq · fhir2omop
refs/refs/fhir-to-omop-demo/demo/translate/map/MedicationAdministration.jq
59 lines · jq
2# Transforms FHIR MedicationAdministrations into OMOP table records. 10 if (.medicationCodeableConcept.coding | length) > 1 then 11 error("Multiple medicationCodeableConcept.codings in MedicationAdministration/\(.id)") 13 | .medicationCodeableConcept.coding[0].concept 17# See: https://ohdsi.github.io/CommonDataModel/drug_dose.html 18# TODO: include the 'has dose form' value in concept 19# TODO: include numerator in concept 21 if (drug | has("drug") and drug.has_dose_form) then 28MedicationAdministration | 30 "drug_exposure", # TABLE COLUMNS 31 .id, # drug_exposure_id 32 .subject.id, # person_id 33 drug.concept_id, # drug_concept_id 34 .effectiveDateTime, # drug_exposure_start_date 35 .effectiveDateTime, # drug_exposure_start_datetime 36 .effectiveDateTime, # drug_exposure_end_date 37 .effectiveDateTime, # drug_exposure_end_datetime 38 null, # verbatim_end_date 39 32818, # drug_type_concept_id - EHR administration record 45 null, # route_concept_id 48 .context.id, # visit_occurrence_id 49 null, # visit_detail_id 50 drug.concept_code, # drug_source_value 51 drug.source_concept_id, # drug_source_concept_id 52 null, # route_source_value 53 null # dose_unit_source_value 56 ((.[0] == "drug_exposure") and length == 24)