CDA-FHIR-Maps (R4)
0.3.0 - DSTU 1
This page is part of the CDA-FHIR-Maps (R4) (v0.3.0: DSTU 1) based on FHIR R4. . For a full list of available versions, see the Directory of published versions
map "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaChEmedMedicationCardDocumentToBundle" = "CdaChEmedMedicationCardDocumentToBundle" // Medication Card document, 2.16.756.5.30.1.1.10.1.3 // 2020-01-09 Oliver Egger, copyright ahdis ag, Apache License // CDA-CH-EMED: https://art-decor.org/art-decor/decor-project--cdachemed- // FHIR CH-EMED: http://fhir.ch/ig/ch-emed/index.html uses "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument" alias ClinicalDocument as source uses "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor" alias AssignedAuthor as source uses "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity" alias AssignedEntity as source uses "http://hl7.org/fhir/cda/StructureDefinition/Author" alias Author as source uses "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization" alias CustodianOrganization as source uses "http://hl7.org/fhir/cda/StructureDefinition/IVL_TS" alias IVL_TS as source uses "http://hl7.org/fhir/cda/StructureDefinition/EIVL_TS" alias EIVL_TS as source uses "http://hl7.org/fhir/cda/StructureDefinition/Observation" alias Observation as source uses "http://hl7.org/fhir/cda/StructureDefinition/PatientRole" alias PatientRole as source uses "http://hl7.org/fhir/cda/StructureDefinition/RecordTarget" alias RecordTarget as source uses "http://hl7.org/fhir/cda/StructureDefinition/Section" alias Section as source uses "http://hl7.org/fhir/cda/StructureDefinition/SubstanceAdministration" alias SubstanceAdministration as source uses "http://hl7.org/fhir/cda/StructureDefinition/SXPR_TS" alias SXPR_TS as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target uses "http://hl7.org/fhir/StructureDefinition/Composition" alias Composition as produced uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as produced uses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as produced uses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as produced uses "http://hl7.org/fhir/StructureDefinition/MedicationStatement" alias MedicationStatement as produced uses "http://hl7.org/fhir/StructureDefinition/Dosage" alias Dosage as produced imports "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToFhirTypes" imports "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToBundle" imports "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaChToBundle" imports "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaChEmedToBundle" // source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.1.3 // target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-composition-medicationcard.html group CdaChEmedMedicationCardDocumentToBundle(source cda : ClinicalDocument, target bundle : Bundle) { cda -> bundle.entry as e, e.resource = create('Composition') as composition, composition.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), bundle.entry as e2, e2.resource = create('Patient') as patient, patient share patient, patient.id = uuid() as uuid2, e2.fullUrl = append('urn:uuid:', uuid2) then ClinicalDocumentChEmedMedicationCardDocumentToBundle(cda, patient, composition, bundle) "ClinicalDocumentToBody"; } // source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.1.3 // target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-composition-medicationcard.html group ClinicalDocumentChEmedMedicationCardDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target bundle : Bundle) extends ClinicalDocumentToBundle { cda then ClinicalDocumentCompositionCh(cda, composition, patient, bundle) "composition"; cda.component as component then { component.structuredBody as body then { body.component as component then { component.section as srcSection where (templateId.where(root = '2.16.756.5.30.1.1.10.3.9')) -> composition.section as tgtSection then SectionMedicationCardSectionContentModule(cda, srcSection, patient, tgtSection, bundle); component.section as srcSection where (templateId.where(root = '2.16.756.5.30.1.1.10.3.2')) -> composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle); component.section as srcSection where (templateId.where(root = '2.16.756.5.30.1.1.10.3.45')) -> composition.section as tgtSection then SectionOriginalRepresentation(cda, srcSection, patient, tgtSection, bundle); }; } "body"; }; } // _________________________ Section Level Templates _________________________ // source: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-composition-medicationcard.html // target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.3.9 group SectionMedicationCardSectionContentModule(source cda : ClinicalDocument, source src : Section, source patient : Patient, target tgt, target bundle : Bundle) extends ClinicalDocumentSection { src.entry as cdaEntry where (substanceAdministration.templateId.where(root = '2.16.756.5.30.1.1.10.4.34')) -> bundle.entry as e, e.resource = create('MedicationStatement') as medicationstatement, medicationstatement.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), tgt.entry = create('Reference') as reference, reference.reference = append('urn:uuid:', uuid) then { cdaEntry.substanceAdministration as substanceAdministration then MedicationTreatmentPlanItemEntryContentModule(src, substanceAdministration, patient, medicationstatement); } "cdaEntry"; }