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

: Bundle to CDA-CH-EMED - TTL Representation

Raw ttl | Download


@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

 a fhir:StructureMap;
  fhir:nodeRole fhir:treeRoot;
  fhir:Resource.id [ fhir:value "BundleToCdaChEmed"];
  fhir:Resource.meta [
     fhir:Meta.versionId [ fhir:value "2" ];
     fhir:Meta.lastUpdated [ fhir:value "2021-11-04T13:41:21.790+01:00"^^xsd:dateTime ]
  ];
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ];
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n         <pre>map &quot;http://fhir.ch/ig/cda-fhir-maps/StructureMap/BundleToCdaChEmed&quot; = &quot;BundleToCdaChEmed&quot;\n\n\n// Medication Entries\n// 2020-11-11 Michaela Ziegler, copyright ahdis ag, Apache License\n// CDA-CH-EMED:  https://art-decor.org/art-decor/decor-project--cdachemed-\n// FHIR CH-EMED: http://fhir.ch/ig/ch-emed/index.html\n\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument&quot; alias ClinicalDocument as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor&quot; alias AssignedAuthor as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity&quot; alias AssignedEntity as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Author&quot; alias Author as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization&quot; alias CustodianOrganization as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/IVL_TS&quot; alias IVL_TS as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/EIVL_TS&quot; alias EIVL_TS as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/PatientRole&quot; alias PatientRole as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/RecordTarget&quot; alias RecordTarget as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Section&quot; alias Section as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/SubstanceAdministration&quot; alias SubstanceAdministration as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/SXPR_TS&quot; alias SXPR_TS as target\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Supply&quot; alias Supply as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias Bundle as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Composition&quot; alias Composition as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Patient&quot; alias Patient as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Practitioner&quot; alias Practitioner as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Organization&quot; alias Organization as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/MedicationStatement&quot; alias MedicationStatement as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Dosage&quot; alias Dosage as source\n\nimports &quot;http://fhir.ch/ig/cda-fhir-maps/StructureMap/FhirToCdaTypes&quot;\nimports &quot;http://fhir.ch/ig/cda-fhir-maps/StructureMap/BundleToCda&quot;\nimports &quot;http://fhir.ch/ig/cda-fhir-maps/StructureMap/BundleToCdaCh&quot;\n\n// source: Annotation note (e.g. http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html)\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.2\ngroup AnnotationComment(source note : Annotation, target act : Act) {\n  note -&gt; act.classCode = 'ACT' &quot;ACT&quot;;\n  note -&gt; act.moodCode = 'EVN' &quot;EVN&quot;;\n  note -&gt;  act.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.2' &quot;templateId&quot;;\n  note -&gt;  act.templateId as templateId,  templateId.root = '2.16.840.1.113883.10.20.1.40' &quot;templateId&quot;;\n  note -&gt;  act.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.2' &quot;templateId&quot;;\n  note -&gt;  act.code as code,  code.code = '48767-8',  code.codeSystem = '2.16.840.1.113883.6.1',  code.displayName = 'Annotation comment',  code.codeSystemName = 'LOINC' &quot;code&quot;;\n  note.text as noteText -&gt; act.text as text then {\n    noteText -&gt; text.data = noteText &quot;text&quot;;\n    note.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' then {\n      extension.valueUrl as valueUrl -&gt;  text.reference as reference,  reference.value = valueUrl &quot;reference&quot;;\n    } &quot;id&quot;;\n    note where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n  };\n  note -&gt;  act.statusCode as code,  code.code = 'completed' &quot;statusCode&quot;;\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.33&amp;effectiveDate=2019-12-11T11:34:24&amp;language=en-US\ngroup ManufacturedMaterialEntryContentModuleStatement(source bundle : Bundle, source medicationStatement : MedicationStatement, source medication : Medication, target manufacturedMaterial : ManufacturedMaterial) {\n  medication -&gt; manufacturedMaterial.classCode = 'MMAT' &quot;MMAT&quot;;\n  medication -&gt; manufacturedMaterial.determinerCode = 'KIND' &quot;KIND&quot;;\n  medication -&gt;  manufacturedMaterial.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.33' &quot;CH-PHARM-ManufacturedMaterialContentModule&quot;;\n  medication -&gt;  manufacturedMaterial.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.1' &quot;templateId&quot;;\n  medication.code as code then {\n    code.text as text -&gt;  manufacturedMaterial.name as name,  name.other = text &quot;brandname&quot;;\n  } &quot;name&quot;;\n  medication.code as code then {\n    // #mtpc.no.brandedmedication\n    code.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' -&gt; manufacturedMaterial.code as code then {\n      extension.valueUrl as valueUrl -&gt;  code.originalText as text,  text.reference as reference,  reference.value = valueUrl &quot;reference&quot;;\n    } &quot;id&quot;;\n    code where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  manufacturedMaterial.code as code,  code.originalText as text,  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n    code.coding as coding -&gt; manufacturedMaterial.code as ce then CodingCE(coding, ce) &quot;code&quot;;\n    code where coding.exists() = false -&gt;  manufacturedMaterial.code as ce,  ce.nullFlavor = 'NA' &quot;nullFlavor&quot;;\n  };\n  medication.form as form then {\n    form.coding as coding -&gt; manufacturedMaterial.formCode as formCode then CodingCE(coding, formCode) &quot;formCode&quot;;\n  };\n  medication.code as code -&gt;  manufacturedMaterial.asContent as asContent,  asContent.classCode = 'CONT',  asContent.containerPackagedMedicine as containerPackagedMedicine then {\n    code -&gt; containerPackagedMedicine.classCode = 'CONT' &quot;CONT&quot;;\n    code -&gt; containerPackagedMedicine.determinerCode = 'INSTANCE' &quot;INSTANCE&quot;;\n    code.coding as coding -&gt; containerPackagedMedicine.code as ce then CodingCE(coding, ce) &quot;pharm-code&quot;;\n    code.text as text -&gt;  containerPackagedMedicine.name as name,  name.other = text &quot;pharm-name&quot;;\n    medication.form as form then {\n      form.coding as coding -&gt; containerPackagedMedicine.formCode as formCode then CodingCE(coding, formCode) &quot;pharm-formCode&quot;;\n    };\n    // Package size\n    medication.amount as amount then {\n      amount.numerator as numerator -&gt; containerPackagedMedicine.capacityQuantity as capacityQuantity then {\n        numerator.value as value -&gt; capacityQuantity.value = value;\n        numerator.code as unit -&gt; capacityQuantity.unit = unit &quot;unit&quot;;\n      };\n    };\n  };\n  medication.ingredient as ingredient -&gt;  manufacturedMaterial.ingredient as ingredient,  ingredient.classCode = 'ACTI' then {\n    ingredient.itemCodeableConcept as itemCodeableConcept -&gt; ingredient.ingredient as pharmsubstance then {\n      itemCodeableConcept -&gt; pharmsubstance.classCode = 'MMAT' &quot;MMAT&quot;;\n      itemCodeableConcept -&gt; pharmsubstance.determinerCode = 'KIND' &quot;KIND&quot;;\n      itemCodeableConcept.text as text -&gt;  pharmsubstance.name as name,  name.other = text &quot;name&quot;;\n      itemCodeableConcept.coding as coding then {\n        coding -&gt; pharmsubstance.code as ce then CodingCE(coding, ce) &quot;formCode&quot;;\n      };\n    } &quot;PharmSubstance&quot;;\n    ingredient.strength as strength -&gt; ingredient.quantity as quantity then RatioRTOPQPQ(strength, quantity);\n  };\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.34&amp;effectiveDate=2019-12-11T11:31:52&amp;language=en-US\ngroup MedicationTreatmentPlanItemEntryContentModule(source bundle : Bundle, source medicationStatement : MedicationStatement, target substanceAdministration : SubstanceAdministration) {\n  medicationStatement -&gt; substanceAdministration.classCode = 'SBADM' &quot;SBADM&quot;;\n  medicationStatement -&gt; substanceAdministration.moodCode = 'INT' &quot;INT&quot;;\n  medicationStatement -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.34' &quot;CH-PHARM-MedicationTreatmentPlanItemEntryContentModule&quot;;\n  medicationStatement -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.7' &quot;IHE-PHARM-MTP&quot;;\n  medicationStatement -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '2.16.840.1.113883.10.20.1.24' &quot;CCD&quot;;\n  medicationStatement -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7' &quot;PCC-MedicationEntryContentModule&quot;;\n  medicationStatement.identifier as identifier -&gt; substanceAdministration.id as id then IdentifierII(identifier, id) &quot;id&quot;;\n  medicationStatement.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' -&gt;  substanceAdministration.text as text,  text.reference as reference then {\n    extension.valueUrl as valueUrl -&gt; reference.value = valueUrl;\n  } &quot;narrativeLink&quot;;\n  medicationStatement where extension.where(url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists().not() -&gt;  substanceAdministration.text as text,  text.reference as reference then {\n    medicationStatement -&gt; reference.value = '#refpdf' &quot;referencetopdf&quot;;\n  } &quot;cat1narrativelink&quot;;\n  medicationStatement -&gt;  substanceAdministration.statusCode as statusCode,  statusCode.code = 'completed' &quot;code&quot;;\n  medicationStatement.contained as medication where ('#' + $this.id) in %medicationStatement.medicationReference.reference -&gt;  substanceAdministration.consumable as consumable,  consumable.manufacturedProduct as manufacturedProduct,  manufacturedProduct.classCode = 'MANU' then {\n    medication -&gt;  manufacturedProduct.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.2' &quot;MP-TemplateId&quot;;\n    medication -&gt;  manufacturedProduct.templateId as templateId,  templateId.root = '2.16.840.1.113883.10.20.1.53' &quot;MP-TemplateId&quot;;\n    medication -&gt; manufacturedProduct.manufacturedMaterial as manufacturedMaterial then ManufacturedMaterialEntryContentModuleStatement(bundle, medicationStatement, medication, manufacturedMaterial) &quot;manufacturedMaterial&quot;;\n  };\n  // TODO: AUTHOR1 Medication Treatment Plan Author\n  medicationStatement where dosage.count() = 1 then {\n    medicationStatement.dosage as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured') -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.1' &quot;normalDose&quot;;\n  } &quot;onylonedosage&quot;;\n  // dosage for normal dosing, as no sequences are present there\n  medicationStatement.dosage as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal') then DosageInstructionsStartStopFrequencySubstanceAdministration(dosage, substanceAdministration) &quot;DosageSubstanceAdministration&quot;;\n  // dosage for split dosing (with sequences): effectiveTime (start/stop) &amp; routeCode\n  medicationStatement.dosage first as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split') -&gt; substanceAdministration.entryRelationship as entryRelationship then DosageInstructionsEntryStartStopRoute(dosage, substanceAdministration, entryRelationship) &quot;DosageSubstanceAdministration&quot;;\n  // dosage for split dosing (with sequences): sequence number, effectiveTime (when), dose quantity, consumable\n  medicationStatement.dosage as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split') -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP' then DosageInstructionsEntryDosageChangeSubstanceAdministration(dosage, substanceAdministration, entryRelationship) &quot;DosageSubstanceAdministration&quot;;\n  medicationStatement.reasonCode as reasonCode -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'RSON',  entryRelationship.observation as observation then TreatmentReasonEntryContentModule(reasonCode, observation) &quot;TreatmentReasonEntryContentModule&quot;;\n  medicationStatement.extension as extension where url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan' -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'REFR',  entryRelationship.substanceAdministration as substanceAdministration then MTPReferenceEntryContentModule(extension, substanceAdministration) &quot;MTP-Reference&quot;;\n  // https://github.com/ehealthsuisse/ch-emed/issues/56\n  medicationStatement -&gt;  substanceAdministration.repeatNumber as repeatNumber,  repeatNumber.nullFlavor = 'NI' &quot;repeatNumberDefault&quot;;\n  // TODO: Patient Medication Instructions Contains 1.3.6.1.4.1.19376.1.5.3.1.4.3 IHE Patient Medication Instructions (DYNAMIC)\n  medicationStatement.dosage as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured') -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.substanceAdministration as substanceAdministration then DosageInstructionsNonStructuredEntryContentModule(dosage, substanceAdministration) &quot;DosageInstructionsNonStructuredEntryContentModule&quot;;\n  medicationStatement.note as note -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.act as act then AnnotationComment(note, act) &quot;AnnotationComment&quot;;\n  medicationStatement.extension as extension where $this.url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-substitution' -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.act as act then SubstitutionStatement(extension, act) &quot;Substitution&quot;;\n}\n\n// TODO: Tapered Dose\n// medicationStatement -&gt; substanceAdministration.templateId as templateId, templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.8' &quot;taperedDose&quot;;\n// source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal\n// target: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.35\n// dosage for normal dosing (without sequences) (Statement, Prescription)\ngroup DosageInstructionsStartStopFrequencySubstanceAdministration(source dosage : Dosage, target substanceAdministration : SubstanceAdministration) {\n  dosage -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.1' &quot;normalDose&quot;;\n  dosage as dosage -&gt; substanceAdministration as substanceAdministration then EffectiveTimeStartEnd(dosage, substanceAdministration) &quot;effectiveTimeStartEnd&quot;;\n  dosage as dosage -&gt; substanceAdministration as substanceAdministration then EffectiveTimeWhenNormal(dosage, substanceAdministration) &quot;effectiveTimeWhen&quot;;\n  dosage.route as route -&gt; substanceAdministration.routeCode as routeCode then CodeableConceptCE(route, routeCode);\n  dosage as dosage -&gt; substanceAdministration as substanceAdministration then DoseQuantity(dosage, substanceAdministration) &quot;doseQuantity&quot;;\n}\n\n// source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\n// target: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\n// dosage for split dosing: effectiveTime (start/stop) &amp; routeCode (Statement, Prescription)\ngroup DosageInstructionsEntryStartStopRoute(source dosage : Dosage, target substanceAdministration : substanceAdministration, target entry : entryRelationship) {\n  // if the FHIR doucment has no dosage templateId -&gt; create templateId for split dose\n  dosage -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.9' &quot;splitDose&quot;;\n  dosage as dosage -&gt; substanceAdministration as substanceAdministration then EffectiveTimeStartEnd(dosage, substanceAdministration) &quot;effectiveTimeStartEnd&quot;;\n  dosage.route as route -&gt; substanceAdministration.routeCode as routeCode then CodeableConceptCE(route, routeCode);\n}\n\n// source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\n// target: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\n// dosage for split dosing: sequence number, effectiveTime (when), dose quantity, consumable (Statement, Prescription)\ngroup DosageInstructionsEntryDosageChangeSubstanceAdministration(source dosage : Dosage, target substanceAdministration : substanceAdministration, target entry : entryRelationship) {\n  dosage.sequence as sequence -&gt;  entry.sequenceNumber as sequenceNumber,  sequenceNumber.value = sequence;\n  dosage -&gt;  entry.substanceAdministration as substanceAdministration,  substanceAdministration.classCode = 'SBADM',  substanceAdministration.moodCode = 'INT' then {\n    dosage as dosage -&gt; substanceAdministration as substanceAdministration then EffectiveTimeWhenSplit(dosage, substanceAdministration) &quot;effectiveTimeWhen&quot;;\n    dosage as dosage -&gt; substanceAdministration as substanceAdministration then DoseQuantity(dosage, substanceAdministration) &quot;doseQuantity&quot;;\n    dosage as dosage -&gt;  substanceAdministration as substanceAdministration,  substanceAdministration.consumable as consumable,  consumable.manufacturedProduct as manufacturedProduct,  manufacturedProduct.manufacturedMaterial as manufacturedMaterial,  manufacturedMaterial.nullFlavor = 'NA' &quot;consumable&quot;;\n  } &quot;dosage&quot;;\n}\n\n// effective time low and high for dosage (Statement, Prescription)\ngroup EffectiveTimeStartEnd(source dosage : Dosage, target substanceAdministration : SubstanceAdministration) {\n  dosage.timing as timing then {\n    timing.repeat as repeat then {\n      repeat.bounds : Period as bounds -&gt; substanceAdministration.effectiveTime = create('IVL_TS') as effectiveTime then {\n        bounds.start as start -&gt; effectiveTime.low as low then DateTS(start, low) &quot;low&quot;;\n        bounds where start.exists().not() -&gt;  effectiveTime.low as low,  low.nullFlavor = 'UNK' &quot;NullFlavorLow&quot;;\n        bounds.end as end -&gt; effectiveTime.high as high then DateTS(end, high) &quot;high&quot;;\n        bounds where end.exists().not() -&gt;  effectiveTime.high as high,  high.nullFlavor = 'UNK' &quot;NullFlavorhigh&quot;;\n      };\n    };\n  };\n}\n\n// dose quantity for dosage (application schema) (Statement)\ngroup DoseQuantity(source dosage : Dosage, target substanceAdministration : SubstanceAdministration) {\n  dosage.doseAndRate as doseAndRate -&gt; substanceAdministration.doseQuantity as doseQuantity then {\n    doseAndRate.dose : Quantity as quantity then {\n      quantity.value as value -&gt; doseQuantity.value = value;\n      quantity.code as code -&gt; doseQuantity.unit = code;\n    } &quot;quantity&quot;;\n  } &quot;doseQuantity&quot;;\n}\n\n// source: reasonCode Coding (e.g. http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-medicationstatement)\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.41\n// Treatment Reason (Statement, Prescription)\ngroup TreatmentReasonEntryContentModule(source reasonCode : Coding, target observation : Observation) {\n  reasonCode -&gt; observation.classCode = 'OBS' &quot;OBS&quot;;\n  reasonCode -&gt; observation.moodCode = 'EVN' &quot;EVN&quot;;\n  reasonCode -&gt;  observation.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.41' &quot;TreatmentReasonEntryContentModule&quot;;\n  reasonCode -&gt;  observation.code as code,  code.code = '75326-9',  code.codeSystem = '2.16.840.1.113883.6.1',  code.displayName = 'Problem',  code.codeSystemName = 'LOINC' &quot;code&quot;;\n  reasonCode.text as reasonText -&gt; observation.text as text then {\n    reasonText -&gt; text.data = reasonText &quot;text&quot;;\n    reasonCode.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' then {\n      extension.valueUrl as valueUrl -&gt;  text.reference as reference,  reference.value = valueUrl &quot;reference&quot;;\n    } &quot;id&quot;;\n    reasonCode where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n  };\n  reasonCode -&gt;  observation.statusCode as code,  code.code = 'completed' &quot;statusCode&quot;;\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-ext-treatmentplan.html\n// target: https://art-decor.org/art-decor/decor-templates--ch-pharm-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.45&amp;effectiveDate=2017-01-10T15:34:25&amp;language=en-US\ngroup MTPReferenceEntryContentModule(source ext : Extension, target substanceAdministration : SubstanceAdministration) {\n  ext -&gt; substanceAdministration.classCode = 'SBADM' &quot;SBADM&quot;;\n  ext -&gt; substanceAdministration.moodCode = 'INT' &quot;INT&quot;;\n  ext -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.10' &quot;referenceTo-MTP-PlanItemGeneralSpecificationTemplateId&quot;;\n  ext -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.45' &quot;CH-PHARM-templateId&quot;;\n  ext.extension as extension where $this.url = 'id' then {\n    extension.valueIdentifier as valueIdentifier -&gt; substanceAdministration.id as id then IdentifierII(valueIdentifier, id) &quot;id&quot;;\n  } &quot;id&quot;;\n  ext -&gt;  substanceAdministration.code as code,  code.code = 'MTPItem',  code.codeSystem = '1.3.6.1.4.1.19376.1.9.2.2',  code.displayName = 'Medication Treatment Plan Item',  code.codeSystemName = 'IHE Pharmacy Item Type List' &quot;code&quot;;\n  ext -&gt;  substanceAdministration.consumable as consumable,  consumable.manufacturedProduct as manufacturedProduct,  manufacturedProduct.manufacturedMaterial as manufacturedMaterial,  manufacturedMaterial.nullFlavor = 'NA' &quot;consumable&quot;;\n  ext.extension as extension where $this.url = 'externalDocumentId' then {\n    extension.valueIdentifier as valueIdentifier -&gt;  substanceAdministration.reference as reference,  reference.typeCode = 'XCRPT',  reference.externalDocument as externalDocument,  externalDocument.id as id then IdentifierII(valueIdentifier, id) &quot;id&quot;;\n  } &quot;externalDocumentId&quot;;\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-dosage-nonstructured.html\n// target: https://art-decor.org/art-decor/decor-templates--ch-pharm-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.52\n// Dosage Instruction (Statement, Prescription)\ngroup DosageInstructionsNonStructuredEntryContentModule(source dosage : Dosage, target substanceAdministration : SubstanceAdministration) {\n  dosage -&gt; substanceAdministration.classCode = 'SBADM' &quot;SBADM&quot;;\n  dosage -&gt; substanceAdministration.moodCode = 'INT' &quot;INT&quot;;\n  dosage -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.52' &quot;templateId&quot;;\n  dosage.text as noteText -&gt; substanceAdministration.text as text then {\n    noteText -&gt; text.data = noteText &quot;text&quot;;\n    dosage.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' then {\n      extension.valueUrl as valueUrl -&gt;  text.reference as reference,  reference.value = valueUrl &quot;reference&quot;;\n    } &quot;id&quot;;\n    dosage where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n  };\n  dosage -&gt;  substanceAdministration.consumable as consumable,  consumable.manufacturedProduct as manufacturedProduct,  manufacturedProduct.manufacturedMaterial as manufacturedMaterial,  manufacturedMaterial.nullFlavor = 'NA' &quot;consumable&quot;;\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html\n// target: Substitution act Contains 1.3.6.1.4.1.19376.1.9.1.3.9.2 IHE Substitution Act Content Module\n// Substitution (Dispense)\ngroup SubstitutionDispense(source substitution : Substitution, target act : Act) {\n  substitution -&gt; act.classCode = 'ACT' &quot;ACT&quot;;\n  substitution -&gt; act.moodCode = 'EVN' &quot;EVN&quot;;\n  substitution -&gt;  act.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.9.2' &quot;templateId&quot;;\n  substitution.type as type -&gt; act.code as code then CodeableConceptCE(type, code) &quot;substitution&quot;;\n  substitution -&gt;  act.statusCode as statusCode,  statusCode.code = 'completed' &quot;statusCode&quot;;\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.33&amp;effectiveDate=2019-12-11T11:34:24&amp;language=en-US\ngroup ManufacturedMaterialEntryContentModuleDispense(source bundle : Bundle, source medicationDispense : MedicationDispense, source medication : Medication, target manufacturedMaterial : ManufacturedMaterial) {\n  medication -&gt; manufacturedMaterial.classCode = 'MMAT' &quot;MMAT&quot;;\n  medication -&gt; manufacturedMaterial.determinerCode = 'KIND' &quot;KIND&quot;;\n  medication -&gt;  manufacturedMaterial.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.33' &quot;CH-PHARM-ManufacturedMaterialContentModule&quot;;\n  medication -&gt;  manufacturedMaterial.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.1' &quot;templateId&quot;;\n  medication.code as code then {\n    code.text as text -&gt;  manufacturedMaterial.name as name,  name.other = text &quot;brandname&quot;;\n  } &quot;name&quot;;\n  medication.code as code then {\n    // #dis.no.brandedmedication\n    code.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' -&gt; manufacturedMaterial.code as code then {\n      extension.valueUrl as valueUrl -&gt;  code.originalText as text,  text.reference as reference,  reference.value = valueUrl &quot;reference&quot;;\n    } &quot;id&quot;;\n    code where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  manufacturedMaterial.code as code,  code.originalText as text,  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n    code.coding as coding -&gt; manufacturedMaterial.code as ce then CodingCE(coding, ce) &quot;code&quot;;\n  };\n  medication.form as form then {\n    form.coding as coding -&gt; manufacturedMaterial.formCode as formCode then CodingCE(coding, formCode) &quot;formCode&quot;;\n  };\n  medication.code as code -&gt;  manufacturedMaterial.asContent as asContent,  asContent.classCode = 'CONT',  asContent.containerPackagedMedicine as containerPackagedMedicine then {\n    code -&gt; containerPackagedMedicine.classCode = 'CONT' &quot;CONT&quot;;\n    code -&gt; containerPackagedMedicine.determinerCode = 'INSTANCE' &quot;INSTANCE&quot;;\n    code.coding as coding -&gt; containerPackagedMedicine.code as ce then CodingCE(coding, ce) &quot;pharm-code&quot;;\n    code.text as text -&gt;  containerPackagedMedicine.name as name,  name.other = text &quot;pharm-name&quot;;\n    medication.form as form then {\n      form.coding as coding -&gt; containerPackagedMedicine.formCode as formCode then CodingCE(coding, formCode) &quot;pharm-formCode&quot;;\n    };\n    // Package size\n    medication.amount as amount then {\n      amount.numerator as numerator -&gt; containerPackagedMedicine.capacityQuantity as capacityQuantity then {\n        numerator.value as value -&gt; capacityQuantity.value = value;\n        numerator.code as unit -&gt; capacityQuantity.unit = unit &quot;unit&quot;;\n      };\n    };\n  };\n  medication.ingredient as ingredient -&gt;  manufacturedMaterial.ingredient as ingredient,  ingredient.classCode = 'ACTI' then {\n    ingredient.itemCodeableConcept as itemCodeableConcept -&gt; ingredient.ingredient as pharmsubstance then {\n      itemCodeableConcept -&gt; pharmsubstance.classCode = 'MMAT' &quot;MMAT&quot;;\n      itemCodeableConcept -&gt; pharmsubstance.determinerCode = 'KIND' &quot;KIND&quot;;\n      itemCodeableConcept.text as text -&gt;  pharmsubstance.name as name,  name.other = text &quot;name&quot;;\n      itemCodeableConcept.coding as coding then {\n        coding -&gt; pharmsubstance.code as ce then CodingCE(coding, ce) &quot;formCode&quot;;\n      };\n    } &quot;PharmSubstance&quot;;\n    ingredient.strength as strength -&gt; ingredient.quantity as quantity then RatioRTOPQPQ(strength, quantity);\n  };\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.42\ngroup DispenseItemEntryContentModule(source bundle : Bundle, source medicationDispense : MedicationDispense, target supply : Supply) {\n  medicationDispense -&gt; supply.classCode = 'SPLY' &quot;SPLY&quot;;\n  medicationDispense -&gt; supply.moodCode = 'EVN' &quot;EVN&quot;;\n  medicationDispense -&gt;  supply.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.42' &quot;CH-PHARM-DispenseItemEntryContentModule&quot;;\n  medicationDispense -&gt;  supply.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.4' &quot;IHE-PHARM-DIS&quot;;\n  medicationDispense -&gt;  supply.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.3' &quot;supplyEntry&quot;;\n  medicationDispense -&gt;  supply.templateId as templateId,  templateId.root = '2.16.840.1.113883.10.20.1.34' &quot;CCD&quot;;\n  medicationDispense.identifier as identifier -&gt; supply.id as id then IdentifierII(identifier, id) &quot;id&quot;;\n  medicationDispense.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' -&gt;  supply.text as text,  text.reference as reference then {\n    extension.valueUrl as valueUrl -&gt; reference.value = valueUrl;\n  } &quot;narrativeLink&quot;;\n  medicationDispense where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  supply.text as text,  text.reference as reference,  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n  medicationDispense.contained as medication where ('#' + $this.id) in %medicationDispense.medicationReference.reference -&gt;  supply.product as product,  product.manufacturedProduct as manufacturedProduct,  manufacturedProduct.classCode = 'MANU' then {\n    medication -&gt;  manufacturedProduct.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.2' &quot;MP-TemplateId&quot;;\n    medication -&gt;  manufacturedProduct.templateId as templateId,  templateId.root = '2.16.840.1.113883.10.20.1.53' &quot;MP-TemplateId&quot;;\n    medication -&gt; manufacturedProduct.manufacturedMaterial as manufacturedMaterial then ManufacturedMaterialEntryContentModuleDispense(bundle, medicationDispense, medication, manufacturedMaterial) &quot;manufacturedMaterial&quot;;\n  };\n  // TODO: AUTHOR1 Medication Treatment Plan Author\n  medicationDispense.extension as extension where url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan' -&gt;  supply.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'REFR',  entryRelationship.substanceAdministration as substanceAdministration then MTPReferenceEntryContentModule(extension, substanceAdministration) &quot;MTP-Reference&quot;;\n  // #24 missing template it if ch-emed-dosage-nonstructured\n  medicationDispense where dosageInstruction.count() = 1 then {\n    medicationDispense.dosageInstruction as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured') -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.1' &quot;normalDose&quot;;\n  } &quot;onylonedosage&quot;;\n  // dosage for normal dosing, as no sequences are present there\n  medicationDispense.dosageInstruction as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal') then DosageInstructionsStartStopFrequencySupply(dosage, supply) &quot;DosageSubstanceAdministration&quot;;\n  // dosage for split dosing, as sequences are present there\n  medicationDispense -&gt; supply.entryRelationship as entryRelationship then {\n    medicationDispense -&gt; entryRelationship.substanceAdministration as substanceAdministration then {\n      // split dosing (with sequences): effectiveTime (start/stop) &amp; routeCode &amp; consumable\n      medicationDispense.dosageInstruction first as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split') -&gt; substanceAdministration then DosageInstructionsEntryStartStopRouteConsumable(dosage, entryRelationship, substanceAdministration) &quot;DosageSubstanceAdministration&quot;;\n      // split dosing (with sequences): sequence number, effectiveTime (when), dose quantity, consumable\n      medicationDispense.dosageInstruction as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split') -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP' then DosageInstructionsEntryDosageChangeEntryRelationship(dosage, entryRelationship) &quot;DosageSubstanceAdministration&quot;;\n    } &quot;substanceAdministration&quot;;\n  } &quot;entryRelationship&quot;;\n  // TODO: Precondition Criterion\n  medicationDispense.dosageInstruction as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured') -&gt;  supply.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.substanceAdministration as substanceAdministration then DosageInstructionsNonStructuredEntryContentModule(dosage, substanceAdministration) &quot;DosageInstructionsNonStructuredEntryContentModule&quot;;\n  // Number of packages\n  medicationDispense.quantity as quantity -&gt; supply.quantity as supplyQuantity then {\n    quantity.value as value -&gt; supplyQuantity.value = value;\n  };\n  medicationDispense.note as note -&gt;  supply.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.act as act then AnnotationComment(note, act) &quot;AnnotationComment&quot;;\n  medicationDispense.substitution as substitution -&gt;  supply.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.act as act then SubstitutionDispense(substitution, act) &quot;Substitution&quot;;\n}\n\n// source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal\n// target: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.35\n// dosage for normal dosing (without sequences) (Dispense)\ngroup DosageInstructionsStartStopFrequencySupply(source dosage : Dosage, target supply : Supply) {\n  dosage -&gt; supply.entryRelationship as entryRelationship then {\n    dosage -&gt; entryRelationship.typeCode = 'COMP' &quot;COMP&quot;;\n    dosage -&gt; entryRelationship.substanceAdministration as substanceAdministration then {\n      dosage -&gt; substanceAdministration.classCode = 'SBADM' &quot;SBADM&quot;;\n      dosage -&gt; substanceAdministration.moodCode = 'INT' &quot;INT&quot;;\n      dosage -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.6' &quot;templateId&quot;;\n      dosage -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.1' &quot;normalDose&quot;;\n      dosage -&gt; substanceAdministration as substanceAdministration then EffectiveTimeStartEnd(dosage, substanceAdministration) &quot;effectiveTimeStartEnd&quot;;\n      dosage -&gt; substanceAdministration as substanceAdministration then EffectiveTimeWhenNormal(dosage, substanceAdministration) &quot;effectiveTimeWhen&quot;;\n      dosage.route as route -&gt; substanceAdministration.routeCode as routeCode then CodeableConceptCE(route, routeCode);\n      dosage -&gt; substanceAdministration as substanceAdministration then DoseQuantity(dosage, substanceAdministration) &quot;doseQuantity&quot;;\n      dosage -&gt;  substanceAdministration as substanceAdministration,  substanceAdministration.consumable as consumable,  consumable.manufacturedProduct as manufacturedProduct,  manufacturedProduct.manufacturedMaterial as manufacturedMaterial,  manufacturedMaterial.nullFlavor = 'NA' &quot;consumable&quot;;\n    } &quot;substanceAdministration&quot;;\n  } &quot;entryRelationship&quot;;\n}\n\n// source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\n// target: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\n// dosage for split dosing: effectiveTime (start/stop) &amp; routeCode &amp; consumable (Dispense)\ngroup DosageInstructionsEntryStartStopRouteConsumable(source dosage : Dosage, target entryRelationship : entryRelationship, target substanceAdministration : SubstanceAdministration) {\n  dosage -&gt; entryRelationship.typeCode = 'COMP' &quot;COMP&quot;;\n  dosage -&gt; substanceAdministration.classCode = 'SBADM' &quot;SBADM&quot;;\n  dosage -&gt; substanceAdministration.moodCode = 'INT' &quot;INT&quot;;\n  dosage -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.6' &quot;templateId&quot;;\n  dosage -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.9' &quot;splitDose&quot;;\n  dosage -&gt; substanceAdministration as substanceAdministration then EffectiveTimeStartEnd(dosage, substanceAdministration) &quot;effectiveTimeStartEnd&quot;;\n  dosage.route as route -&gt; substanceAdministration.routeCode as routeCode then CodeableConceptCE(route, routeCode);\n  dosage -&gt;  substanceAdministration.consumable as consumable,  consumable.manufacturedProduct as manufacturedProduct,  manufacturedProduct.manufacturedMaterial as manufacturedMaterial,  manufacturedMaterial.nullFlavor = 'NA' &quot;consumable&quot;;\n}\n\n// source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\n// target: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\n// dosage for split dosing: sequence number, effectiveTime (when), dose quantity, consumable (Dispense)\ngroup DosageInstructionsEntryDosageChangeEntryRelationship(source dosage : Dosage, target entryRelationship : entryRelationship) {\n  dosage.sequence as sequence -&gt;  entryRelationship.sequenceNumber as sequenceNumber,  sequenceNumber.value = sequence;\n  dosage -&gt;  entryRelationship.substanceAdministration as substanceAdministration,  substanceAdministration.classCode = 'SBADM',  substanceAdministration.moodCode = 'INT' then {\n    dosage as dosage -&gt; substanceAdministration then EffectiveTimeWhenSplit(dosage, substanceAdministration) &quot;effectiveTimeWhen&quot;;\n    dosage as dosage -&gt; substanceAdministration then DoseQuantity(dosage, substanceAdministration) &quot;doseQuantity&quot;;\n    dosage as dosage -&gt;  substanceAdministration.consumable as consumable,  consumable.manufacturedProduct as manufacturedProduct,  manufacturedProduct.manufacturedMaterial as manufacturedMaterial,  manufacturedMaterial.nullFlavor = 'NA' &quot;consumable&quot;;\n  } &quot;dosage&quot;;\n}\n\n// effective time when for normal dosage (Dispense, Statement, Prescription)\ngroup EffectiveTimeWhenNormal(source dosage : Dosage, target substanceAdministration : SubstanceAdministration) {\n  dosage.timing as timing then {\n    timing.repeat as repeat then {\n      repeat where $this.when.count() = 1 -&gt;  substanceAdministration.effectiveTime = create('EIVL_TS') as effectiveTime,  effectiveTime.operator = 'A' then {\n        repeat.when as when -&gt;  effectiveTime.event as event,  event.code = when;\n      } &quot;when&quot;;\n      repeat where $this.when.count() &gt; 1 -&gt;  substanceAdministration.effectiveTime = create('SXPR_TS') as effectiveTime,  effectiveTime.operator = 'A' then {\n        repeat.when first as when -&gt; effectiveTime.comp = create('EIVL_TS') as comp then {\n          when -&gt;  comp.event as event,  event.code = when &quot;when&quot;;\n        } &quot;comp&quot;;\n        repeat.when not_first as when -&gt;  effectiveTime.comp = create('EIVL_TS') as comp,  comp.operator = 'I' then {\n          when -&gt;  comp.event as event,  event.code = when &quot;when&quot;;\n        } &quot;compnotfirst&quot;;\n      } &quot;when&quot;;\n    };\n  };\n}\n\n// effective time when for split dosage (Dispense, Statement, Prescription)\ngroup EffectiveTimeWhenSplit(source dosage : Dosage, target substanceAdministration : SubstanceAdministration) {\n  dosage.timing as timing then {\n    timing.repeat as repeat then {\n      repeat where $this.when.count() = 1 -&gt; substanceAdministration.effectiveTime = create('EIVL_TS') as effectiveTime then {\n        repeat.when as when -&gt;  effectiveTime.event as event,  event.code = when;\n      } &quot;when&quot;;\n      repeat where $this.when.count() &gt; 1 -&gt;  substanceAdministration.effectiveTime = create('SXPR_TS') as effectiveTime,  effectiveTime.operator = 'A' then {\n        repeat.when first as when -&gt; effectiveTime.comp = create('EIVL_TS') as comp then {\n          when -&gt;  comp.event as event,  event.code = when &quot;when&quot;;\n        } &quot;comp&quot;;\n        repeat.when not_first as when -&gt;  effectiveTime.comp = create('EIVL_TS') as comp,  comp.operator = 'I' then {\n          when -&gt;  comp.event as event,  event.code = when &quot;when&quot;;\n        } &quot;compnotfirst&quot;;\n      } &quot;when&quot;;\n    };\n  };\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\n// target: Substitution permission Contains 1.3.6.1.4.1.19376.1.9.1.3.9.1 IHE Substitution Permission Content Module\ngroup SubstitutionRequest(source substitution : Substitution, target act : Act) {\n  substitution -&gt; act.classCode = 'ACT' &quot;ACT&quot;;\n  substitution -&gt; act.moodCode = 'DEF' &quot;DEF&quot;;\n  substitution -&gt;  act.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.9.1' &quot;templateId&quot;;\n  substitution.allowedCodeableConcept as allowedCC -&gt; act.code as code then CodeableConceptCE(allowedCC, code) &quot;substitution&quot;;\n  substitution -&gt;  act.statusCode as statusCode,  statusCode.code = 'completed' &quot;statusCode&quot;;\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\n// target: Substitution permission Contains 1.3.6.1.4.1.19376.1.9.1.3.9.1 IHE Substitution Permission Content Module\ngroup SubstitutionStatement(source extension : Extension, target act : Act) {\n  extension -&gt; act.classCode = 'ACT' &quot;ACT&quot;;\n  extension -&gt; act.moodCode = 'DEF' &quot;DEF&quot;;\n  extension -&gt;  act.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.9.1' &quot;templateId&quot;;\n  extension.valueCodeableConcept as valueCC -&gt; act.code as code then CodeableConceptCE(valueCC, code) &quot;extension&quot;;\n  extension -&gt;  act.statusCode as statusCode,  statusCode.code = 'completed' &quot;statusCode&quot;;\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?id=2.16.756.5.30.1.1.10.4.38\ngroup PrescribedQuantity(source dispenseRequest : DispenseRequest, target supply : Supply) {\n  dispenseRequest -&gt; supply.classCode = 'SPLY' &quot;SPLY&quot;;\n  dispenseRequest -&gt; supply.moodCode = 'RQO' &quot;RQO&quot;;\n  dispenseRequest -&gt;  supply.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.8' &quot;templateId&quot;;\n  dispenseRequest -&gt;  supply.independentInd as independentInd,  independentInd.value = 'false' &quot;independentInd&quot;;\n  // Number of packages\n  dispenseRequest.quantity as quantity -&gt; supply.quantity as quant then {\n    quantity.value as value -&gt; quant.value = value;\n  };\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?id=2.16.756.5.30.1.1.10.4.38\ngroup PrescribedQuantityUnit(source dispenseRequest : DispenseRequest, target supply : Supply) {\n  dispenseRequest -&gt; supply.classCode = 'SPLY' &quot;SPLY&quot;;\n  dispenseRequest -&gt; supply.moodCode = 'RQO' &quot;RQO&quot;;\n  dispenseRequest -&gt;  supply.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.8' &quot;TemplateId&quot;;\n  dispenseRequest -&gt;  supply.independentInd as independentInd,  independentInd.value = 'false' &quot;independentInd&quot;;\n  // Number of packages\n  dispenseRequest.quantity as quantity -&gt; supply.quantity as quant then {\n    quantity.value as value -&gt; quant.value = value;\n    quantity.unit as unit -&gt; quant.unit = unit;\n  };\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.33\ngroup ManufacturedMaterialEntryContentModulePrescription(source bundle : Bundle, source medicationRequest : MedicationRequest, source medication : Medication, target manufacturedMaterial : ManufacturedMaterial, target substanceAdministration : SubstanceAdministration) {\n  medication -&gt; manufacturedMaterial.classCode = 'MMAT' &quot;MMAT&quot;;\n  medication -&gt; manufacturedMaterial.determinerCode = 'KIND' &quot;KIND&quot;;\n  medication -&gt;  manufacturedMaterial.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.33' &quot;CH-PHARM-ManufacturedMaterialContentModule&quot;;\n  medication -&gt;  manufacturedMaterial.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.1' &quot;templateId&quot;;\n  medication.code as code then {\n    code.text as text -&gt;  manufacturedMaterial.name as name,  name.other = text &quot;brandname&quot;;\n  } &quot;name&quot;;\n  medication.code as code then {\n    // #pre.no.brandedmedication\n    code.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' -&gt; manufacturedMaterial.code as code then {\n      extension.valueUrl as valueUrl -&gt;  code.originalText as text,  text.reference as reference,  reference.value = valueUrl &quot;reference&quot;;\n    } &quot;id&quot;;\n    code where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  manufacturedMaterial.code as code,  code.originalText as text,  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n    code.coding as coding -&gt; manufacturedMaterial.code as ce then CodingCE(coding, ce) &quot;code&quot;;\n  };\n  medication.form as form then {\n    form.coding as coding -&gt; manufacturedMaterial.formCode as formCode then CodingCE(coding, formCode) &quot;formCode&quot;;\n  };\n  medication.code as code -&gt;  manufacturedMaterial.asContent as asContent,  asContent.classCode = 'CONT',  asContent.containerPackagedMedicine as containerPackagedMedicine then {\n    code -&gt; containerPackagedMedicine.classCode = 'CONT' &quot;CONT&quot;;\n    code -&gt; containerPackagedMedicine.determinerCode = 'INSTANCE' &quot;INSTANCE&quot;;\n    code.coding as coding -&gt; containerPackagedMedicine.code as ce then CodingCE(coding, ce) &quot;pharm-code&quot;;\n    code.text as text -&gt;  containerPackagedMedicine.name as name,  name.other = text &quot;pharm-name&quot;;\n    medication.form as form then {\n      form.coding as coding -&gt; containerPackagedMedicine.formCode as formCode then CodingCE(coding, formCode) &quot;pharm-formCode&quot;;\n    };\n    // Package size\n    medication.amount as amount then {\n      amount.numerator as numerator -&gt; containerPackagedMedicine.capacityQuantity as capacityQuantity then {\n        numerator.value as value -&gt; capacityQuantity.value = value;\n        numerator.code as unit -&gt; capacityQuantity.unit = unit &quot;unit&quot;;\n      };\n      // IHE-DIS: Case 1: If the product-element contains package information, the unit attribute is not be present\n      medicationRequest.dispenseRequest as dispenseRequest -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.supply as supply then PrescribedQuantity(dispenseRequest, supply) &quot;PrescribedQuantity&quot;;\n    };\n    // IHE-DIS: Case 2: If the product-element does not contain package information, the unit attribut is present and the value SHALL be out of the UCUM code system\n    medication where $this.amount.exists() = false then {\n      medicationRequest.dispenseRequest as dispenseRequest -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.supply as supply then PrescribedQuantityUnit(dispenseRequest, supply) &quot;PrescribedQuantityUnit&quot;;\n    } &quot;noAmount&quot;;\n  };\n  medication.ingredient as ingredient -&gt;  manufacturedMaterial.ingredient as ingredient,  ingredient.classCode = 'ACTI' then {\n    ingredient.itemCodeableConcept as itemCodeableConcept -&gt; ingredient.ingredient as pharmsubstance then {\n      itemCodeableConcept -&gt; pharmsubstance.classCode = 'MMAT' &quot;MMAT&quot;;\n      itemCodeableConcept -&gt; pharmsubstance.determinerCode = 'KIND' &quot;KIND&quot;;\n      itemCodeableConcept.text as text -&gt;  pharmsubstance.name as name,  name.other = text &quot;name&quot;;\n      itemCodeableConcept.coding as coding then {\n        coding -&gt; pharmsubstance.code as ce then CodingCE(coding, ce) &quot;formCode&quot;;\n      };\n    } &quot;PharmSubstance&quot;;\n    ingredient.strength as strength -&gt; ingredient.quantity as quantity then RatioRTOPQPQ(strength, quantity);\n  };\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.43\ngroup PrescriptionItemEntryContentModule(source bundle : Bundle, source medicationRequest : MedicationRequest, target substanceAdministration : SubstanceAdministration) {\n  medicationRequest -&gt; substanceAdministration.classCode = 'SBADM' &quot;SBADM&quot;;\n  medicationRequest -&gt; substanceAdministration.moodCode = 'INT' &quot;INT&quot;;\n  medicationRequest -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.43' &quot;CH-PHARM-PrescriptionItemEntryContentModule&quot;;\n  medicationRequest -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.2' &quot;PrescriptionItemEntryTemplateId&quot;;\n  medicationRequest -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '2.16.840.1.113883.10.20.1.24' &quot;CCD&quot;;\n  medicationRequest -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7' &quot;PCC-MedicationEntryContentModule&quot;;\n  medicationRequest.identifier as identifier -&gt; substanceAdministration.id as id then IdentifierII(identifier, id) &quot;id&quot;;\n  medicationRequest.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' -&gt;  substanceAdministration.text as text,  text.reference as reference then {\n    extension.valueUrl as valueUrl -&gt; reference.value = valueUrl;\n  } &quot;narrativeLink&quot;;\n  medicationRequest where extension.where(url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists().not() -&gt;  substanceAdministration.text as text,  text.reference as reference then {\n    medicationRequest -&gt; reference.value = '#refpdf' &quot;referencetopdf&quot;;\n  } &quot;cat1narrativelink&quot;;\n  medicationRequest -&gt;  substanceAdministration.statusCode as statusCode,  statusCode.code = 'completed' &quot;code&quot;;\n  medicationRequest.dispenseRequest as dispenseRequest -&gt; substanceAdministration.repeatNumber as repeatNumber then {\n    dispenseRequest.numberOfRepeatsAllowed as number -&gt; repeatNumber.value = number &quot;repeatNumber&quot;;\n    dispenseRequest where numberOfRepeatsAllowed.exists() = false -&gt; repeatNumber.nullFlavor = 'NI' &quot;repeatNumberNull&quot;;\n  };\n  medicationRequest.contained as medication where ('#' + $this.id) in %medicationRequest.medicationReference.reference -&gt;  substanceAdministration.consumable as consumable,  consumable.manufacturedProduct as manufacturedProduct,  manufacturedProduct.classCode = 'MANU' then {\n    medication -&gt;  manufacturedProduct.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.2' &quot;MP-templateId&quot;;\n    medication -&gt;  manufacturedProduct.templateId as templateId,  templateId.root = '2.16.840.1.113883.10.20.1.53' &quot;MP-templateId&quot;;\n    medication -&gt; manufacturedProduct.manufacturedMaterial as manufacturedMaterial then ManufacturedMaterialEntryContentModulePrescription(bundle, medicationRequest, medication, manufacturedMaterial, substanceAdministration) &quot;manufacturedMaterial&quot;;\n  };\n  // TODO: AUTHOR1 Medication Treatment Plan Author\n  medicationRequest where dosageInstruction.count() = 1 then {\n    medicationRequest.dosageInstruction as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured') -&gt;  substanceAdministration.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.7.1' &quot;normalDose&quot;;\n  } &quot;onylonedosage&quot;;\n  medicationRequest.dosageInstruction as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal-medicationrequest') then DosageInstructionsStartStopFrequencySubstanceAdministration(dosage, substanceAdministration) &quot;DosageSubstanceAdministration&quot;;\n  // dosage for split dosing (with sequences): effectiveTime (start/stop) &amp; routeCode\n  medicationRequest.dosageInstruction first as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split-medicationrequest') -&gt; substanceAdministration.entryRelationship as entryRelationship then DosageInstructionsEntryStartStopRoute(dosage, substanceAdministration, entryRelationship) &quot;DosageSubstanceAdministration&quot;;\n  // dosage for split dosing (with sequences): sequence number, effectiveTime (when), dose quantity, consumable\n  medicationRequest.dosageInstruction as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split-medicationrequest') -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP' then DosageInstructionsEntryDosageChangeSubstanceAdministration(dosage, substanceAdministration, entryRelationship) &quot;DosageSubstanceAdministration&quot;;\n  medicationRequest.reasonCode as reasonCode -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'RSON',  entryRelationship.observation as observation then TreatmentReasonEntryContentModule(reasonCode, observation) &quot;TreatmentReasonEntryContentModule&quot;;\n  medicationRequest.extension as extension where url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan' -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'REFR',  entryRelationship.substanceAdministration as substanceAdministration then MTPReferenceEntryContentModule(extension, substanceAdministration) &quot;MTP-Reference&quot;;\n  // TODO: Patient Medication Instructions Contains 1.3.6.1.4.1.19376.1.5.3.1.4.3 IHE Patient Medication Instructions (DYNAMIC)\n  medicationRequest.dosageInstruction as dosage where $this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured') -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.substanceAdministration as substanceAdministration then DosageInstructionsNonStructuredEntryContentModule(dosage, substanceAdministration) &quot;DosageInstructionsNonStructuredEntryContentModule&quot;;\n  medicationRequest.note as note -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.act as act then AnnotationComment(note, act) &quot;AnnotationComment&quot;;\n  medicationRequest.substitution as substitution -&gt;  substanceAdministration.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'COMP',  entryRelationship.act as act then SubstitutionRequest(substitution, act) &quot;Substitution&quot;;\n}\n\n// source: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-observation.html\n// target: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.44\ngroup PharmaceuticalAdviceItemEntryContentModule(source bundle : Bundle, source fhirobservation : Observation, target cdaobservation : Observation) {\n  fhirobservation -&gt; cdaobservation.classCode = 'OBS' &quot;OBS&quot;;\n  fhirobservation -&gt; cdaobservation.moodCode = 'EVN' &quot;EVN&quot;;\n  fhirobservation -&gt;  cdaobservation.templateId as templateId,  templateId.root = '1.3.6.1.4.1.19376.1.9.1.3.3' &quot;IHE-PHARM-PADV&quot;;\n  fhirobservation -&gt;  cdaobservation.templateId as templateId,  templateId.root = '2.16.756.5.30.1.1.10.4.44' &quot;CH-PHARM-PharmaceuticalAdviceItemEntryContentModule&quot;;\n  fhirobservation.identifier as identifier -&gt; cdaobservation.id as id then IdentifierII(identifier, id) &quot;id&quot;;\n  fhirobservation.code as fhirCode -&gt; cdaobservation.code as cdaCode then CodeableConceptCE(fhirCode, cdaCode);\n  fhirobservation -&gt;  cdaobservation.statusCode as statusCode,  statusCode.code = 'completed' &quot;code&quot;;\n  fhirobservation.effectiveDateTime as effectiveDateTime -&gt; cdaobservation.effectiveTime as effectiveTime then {\n    effectiveDateTime -&gt; effectiveTime.value = effectiveDateTime &quot;value&quot;;\n  } &quot;effectiveTime&quot;;\n  fhirobservation.extension as extension where url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan' -&gt;  cdaobservation.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'REFR',  entryRelationship.substanceAdministration as substanceAdministration then MTPReferenceEntryContentModule(extension, substanceAdministration) &quot;MTP-Reference&quot;;\n  fhirobservation.extension as extension where url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-medicationstatement-changed' -&gt;  cdaobservation.entryRelationship as entryRelationship,  entryRelationship.typeCode = 'REFR' then {\n    bundle.entry as entry then {\n      entry.fullUrl where ($this in %extension.valueReference.reference) and $this.startsWith('urn:uuid') then {\n        entry.resource as medicationStatement where $this.ofType(FHIR.MedicationStatement) -&gt; entryRelationship.substanceAdministration as substanceAdministration then MedicationTreatmentPlanItemEntryContentModule(bundle, medicationStatement, substanceAdministration) &quot;MedicationStatement&quot;;\n      } &quot;fullUrlAsUuid&quot;;\n      entry.resource as medicationStatement where $this.ofType(FHIR.MedicationStatement) and (('MedicationStatement' + '/' + $this.id) in %extension.valueReference.reference) -&gt; entryRelationship.substanceAdministration as substanceAdministration then MedicationTreatmentPlanItemEntryContentModule(bundle, medicationStatement, substanceAdministration) &quot;MedicationStatement&quot;;\n    };\n  } &quot;changedmtp&quot;;\n  fhirobservation.note as note then {\n    note.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' -&gt;  cdaobservation.text as text,  text.reference as reference then {\n      extension.valueUrl as valueUrl -&gt; reference.value = valueUrl;\n    } &quot;narrativeLink&quot;;\n    note where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  cdaobservation.text as text,  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n  };\n  fhirobservation.note as note -&gt; cdaobservation.text as text then {\n    note.text as noteText -&gt; text.data = noteText;\n    note.extension as extension where $this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' then {\n      extension.valueUrl as valueUrl -&gt;  text.reference as reference,  reference.value = valueUrl &quot;reference&quot;;\n    } &quot;id&quot;;\n    note where (extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false) -&gt;  text.reference as reference,  reference.value = '#refpdf' &quot;reference&quot;;\n  } &quot;text&quot;;\n}\n\n</pre>\n      </div>"
  ];
  fhir:StructureMap.url [ fhir:value "http://fhir.ch/ig/cda-fhir-maps/StructureMap/BundleToCdaChEmed"];
  fhir:StructureMap.version [ fhir:value "0.3.0"];
  fhir:StructureMap.name [ fhir:value "BundleToCdaChEmed"];
  fhir:StructureMap.status [ fhir:value "draft"];
  fhir:StructureMap.date [ fhir:value "2022-02-11T11:14:39+01:00"^^xsd:dateTime];
  fhir:StructureMap.publisher [ fhir:value "ahdis"];
  fhir:StructureMap.contact [
     fhir:index 0;
     fhir:ContactDetail.name [ fhir:value "ahdis" ];
     fhir:ContactDetail.telecom [
       fhir:index 0;
       fhir:ContactPoint.system [ fhir:value "url" ];
       fhir:ContactPoint.value [ fhir:value "http://www.ahdis.ch/" ]     ]
  ];
  fhir:StructureMap.description [ fhir:value "\r\nMedication Entries\r\n2020-11-11 Michaela Ziegler, copyright ahdis ag, Apache License\r\nCDA-CH-EMED:  https://art-decor.org/art-decor/decor-project--cdachemed-\r\nFHIR CH-EMED: http://fhir.ch/ig/ch-emed/index.html\r\n"];
  fhir:StructureMap.copyright [ fhir:value "CC-BY-SA-4.0"];
  fhir:StructureMap.structure [
     fhir:index 0;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "ClinicalDocument" ]
  ], [
     fhir:index 1;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "AssignedAuthor" ]
  ], [
     fhir:index 2;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "AssignedEntity" ]
  ], [
     fhir:index 3;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/Author";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/Author>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "Author" ]
  ], [
     fhir:index 4;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "CustodianOrganization" ]
  ], [
     fhir:index 5;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/IVL_TS";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/IVL_TS>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "IVL_TS" ]
  ], [
     fhir:index 6;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/EIVL_TS";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/EIVL_TS>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "EIVL_TS" ]
  ], [
     fhir:index 7;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/PatientRole";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/PatientRole>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "PatientRole" ]
  ], [
     fhir:index 8;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/RecordTarget";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/RecordTarget>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "RecordTarget" ]
  ], [
     fhir:index 9;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/Section";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/Section>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "Section" ]
  ], [
     fhir:index 10;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/SubstanceAdministration";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/SubstanceAdministration>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "SubstanceAdministration" ]
  ], [
     fhir:index 11;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/SXPR_TS";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/SXPR_TS>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "SXPR_TS" ]
  ], [
     fhir:index 12;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/Supply";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/Supply>     ];
     fhir:StructureMap.structure.mode [ fhir:value "target" ];
     fhir:StructureMap.structure.alias [ fhir:value "Supply" ]
  ], [
     fhir:index 13;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Bundle";
       fhir:link <http://hl7.org/fhir/StructureDefinition/Bundle>     ];
     fhir:StructureMap.structure.mode [ fhir:value "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "Bundle" ]
  ], [
     fhir:index 14;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Composition";
       fhir:link <http://hl7.org/fhir/StructureDefinition/Composition>     ];
     fhir:StructureMap.structure.mode [ fhir:value "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "Composition" ]
  ], [
     fhir:index 15;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Patient";
       fhir:link <http://hl7.org/fhir/StructureDefinition/Patient>     ];
     fhir:StructureMap.structure.mode [ fhir:value "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "Patient" ]
  ], [
     fhir:index 16;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Practitioner";
       fhir:link <http://hl7.org/fhir/StructureDefinition/Practitioner>     ];
     fhir:StructureMap.structure.mode [ fhir:value "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "Practitioner" ]
  ], [
     fhir:index 17;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Organization";
       fhir:link <http://hl7.org/fhir/StructureDefinition/Organization>     ];
     fhir:StructureMap.structure.mode [ fhir:value "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "Organization" ]
  ], [
     fhir:index 18;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/MedicationStatement";
       fhir:link <http://hl7.org/fhir/StructureDefinition/MedicationStatement>     ];
     fhir:StructureMap.structure.mode [ fhir:value "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "MedicationStatement" ]
  ], [
     fhir:index 19;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Dosage";
       fhir:link <http://hl7.org/fhir/StructureDefinition/Dosage>     ];
     fhir:StructureMap.structure.mode [ fhir:value "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "Dosage" ]
  ];
  fhir:StructureMap.import [
     fhir:value "http://fhir.ch/ig/cda-fhir-maps/StructureMap/FhirToCdaTypes";
     fhir:index 0;
     fhir:link <http://fhir.ch/ig/cda-fhir-maps/StructureMap/FhirToCdaTypes>
  ], [
     fhir:value "http://fhir.ch/ig/cda-fhir-maps/StructureMap/BundleToCda";
     fhir:index 1;
     fhir:link <http://fhir.ch/ig/cda-fhir-maps/StructureMap/BundleToCda>
  ], [
     fhir:value "http://fhir.ch/ig/cda-fhir-maps/StructureMap/BundleToCdaCh";
     fhir:index 2;
     fhir:link <http://fhir.ch/ig/cda-fhir-maps/StructureMap/BundleToCdaCh>
  ];
  fhir:StructureMap.group [
     fhir:index 0;
     fhir:StructureMap.group.name [ fhir:value "AnnotationComment" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: Annotation note (e.g. http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html)\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.2" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "note" ];
       fhir:StructureMap.group.input.type [ fhir:value "Annotation" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "act" ];
       fhir:StructureMap.group.input.type [ fhir:value "Act" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "ACT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "ACT" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "EVN" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EVN" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.2" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.10.20.1.40" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.2" ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "48767-8" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "codeSystem" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.6.1" ]         ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "displayName" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Annotation comment" ]         ]       ], [
         fhir:index 4;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "codeSystemName" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "LOINC" ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "text" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "note" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "noteText" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "noteText" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "data" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "noteText" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]             ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "statusCode" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]         ]       ]     ]
  ], [
     fhir:index 1;
     fhir:StructureMap.group.name [ fhir:value "ManufacturedMaterialEntryContentModuleStatement" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.33&effectiveDate=2019-12-11T11:34:24&language=en-US" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ];
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "medicationStatement" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationStatement" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "medication" ];
       fhir:StructureMap.group.input.type [ fhir:value "Medication" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.input.name [ fhir:value "manufacturedMaterial" ];
       fhir:StructureMap.group.input.type [ fhir:value "ManufacturedMaterial" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "MMAT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MMAT" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "KIND" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "KIND" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "CH-PHARM-ManufacturedMaterialContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.33" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.1" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "name" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "brandname" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]           ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "originalText" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "#mtpc.no.brandedmedication" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "originalText" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "ce";
             fhir:index 1           ]         ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.name [ fhir:value "nullFlavor" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "coding.exists() = false" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ce" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NA" ]           ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "form" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "form" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "form" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "formCode" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "form" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "formCode" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "formCode" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "formCode";
             fhir:index 1           ]         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "asContent" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CONT" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "containerPackagedMedicine" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "containerPackagedMedicine" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "CONT" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CONT" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "INSTANCE" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INSTANCE" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "pharm-code" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "ce";
             fhir:index 1           ]         ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.name [ fhir:value "pharm-name" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]           ]         ]       ], [
         fhir:index 4;
         fhir:StructureMap.group.rule.name [ fhir:value "form" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "form" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "form" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "pharm-formCode" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "form" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "formCode" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "formCode" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "coding";
               fhir:index 0             ], [
               fhir:value "formCode";
               fhir:index 1             ]           ]         ]       ], [
         fhir:index 5;
         fhir:StructureMap.group.rule.name [ fhir:value "amount" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "amount" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "amount" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "numerator" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "amount" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "numerator" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "numerator" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "capacityQuantity" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "capacityQuantity" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "value" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "numerator" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "value" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "capacityQuantity" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "value" ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "numerator" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "unit" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "capacityQuantity" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "unit" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "unit" ]               ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "Package size" ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "ingredient" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "ingredient" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ingredient" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "ACTI" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "PharmSubstance" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "itemCodeableConcept" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "itemCodeableConcept" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "pharmsubstance" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "MMAT" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MMAT" ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "KIND" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "KIND" ]             ]           ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.name [ fhir:value "name" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]             ]           ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.name [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "formCode" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "coding" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "coding";
                 fhir:index 0               ], [
                 fhir:value "ce";
                 fhir:index 1               ]             ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "strength" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "strength" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "strength" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "quantity" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "quantity" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "RatioRTOPQPQ" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "strength";
             fhir:index 0           ], [
             fhir:value "quantity";
             fhir:index 1           ]         ]       ]     ]
  ], [
     fhir:index 2;
     fhir:StructureMap.group.name [ fhir:value "MedicationTreatmentPlanItemEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.34&effectiveDate=2019-12-11T11:31:52&language=en-US" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ];
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "medicationStatement" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationStatement" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "SBADM" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SBADM" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "INT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INT" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "CH-PHARM-MedicationTreatmentPlanItemEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.34" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "IHE-PHARM-MTP" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.7" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "CCD" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.10.20.1.24" ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "PCC-MedicationEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7" ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "id" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "identifier" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "identifier" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "id" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "IdentifierII" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "identifier";
           fhir:index 0         ], [
           fhir:value "id";
           fhir:index 1         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "narrativeLink" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "valueUrl" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]           ]         ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "cat1narrativelink" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "extension.where(url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists().not()" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "referencetopdf" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ]     ], [
       fhir:index 9;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "statusCode" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]         ]       ]     ], [
       fhir:index 10;
       fhir:StructureMap.group.rule.name [ fhir:value "contained" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "contained" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "('#' + $this.id) in %medicationStatement.medicationReference.reference" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "consumable" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MANU" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "MP-TemplateId" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.2" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "MP-TemplateId" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.10.20.1.53" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "ManufacturedMaterialEntryContentModuleStatement" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "bundle";
             fhir:index 0           ], [
             fhir:value "medicationStatement";
             fhir:index 1           ], [
             fhir:value "medication";
             fhir:index 2           ], [
             fhir:value "manufacturedMaterial";
             fhir:index 3           ]         ]       ]     ], [
       fhir:index 11;
       fhir:StructureMap.group.rule.name [ fhir:value "onylonedosage" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "dosage.count() = 1" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "normalDose" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured')" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.1" ]           ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "TODO: AUTHOR1 Medication Treatment Plan Author" ]     ], [
       fhir:index 12;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal')" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsStartStopFrequencySubstanceAdministration" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for normal dosing, as no sequences are present there" ]     ], [
       fhir:index 13;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.listMode [ fhir:value "first" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split')" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryStartStopRoute" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ], [
           fhir:value "entryRelationship";
           fhir:index 2         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for split dosing (with sequences): effectiveTime (start/stop) & routeCode" ]     ], [
       fhir:index 14;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split')" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryDosageChangeSubstanceAdministration" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ], [
           fhir:value "entryRelationship";
           fhir:index 2         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for split dosing (with sequences): sequence number, effectiveTime (when), dose quantity, consumable" ]     ], [
       fhir:index 15;
       fhir:StructureMap.group.rule.name [ fhir:value "TreatmentReasonEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "reasonCode" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "reasonCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "RSON" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "observation" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "observation" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "TreatmentReasonEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "reasonCode";
           fhir:index 0         ], [
           fhir:value "observation";
           fhir:index 1         ]       ]     ], [
       fhir:index 16;
       fhir:StructureMap.group.rule.name [ fhir:value "MTP-Reference" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "REFR" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "MTPReferenceEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "extension";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ], [
       fhir:index 17;
       fhir:StructureMap.group.rule.name [ fhir:value "repeatNumberDefault" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "repeatNumber" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "repeatNumber" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "repeatNumber" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NI" ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "https://github.com/ehealthsuisse/ch-emed/issues/56" ]     ], [
       fhir:index 18;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageInstructionsNonStructuredEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured')" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsNonStructuredEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "TODO: Patient Medication Instructions Contains 1.3.6.1.4.1.19376.1.5.3.1.4.3 IHE Patient Medication Instructions (DYNAMIC)" ]     ], [
       fhir:index 19;
       fhir:StructureMap.group.rule.name [ fhir:value "AnnotationComment" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "note" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "AnnotationComment" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "note";
           fhir:index 0         ], [
           fhir:value "act";
           fhir:index 1         ]       ]     ], [
       fhir:index 20;
       fhir:StructureMap.group.rule.name [ fhir:value "Substitution" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-substitution'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "SubstitutionStatement" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "extension";
           fhir:index 0         ], [
           fhir:value "act";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 3;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsStartStopFrequencySubstanceAdministration" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "TODO: Tapered Dose\r\nmedicationStatement -> substanceAdministration.templateId as templateId, templateId.root = '1.3.6.1.4.1.19376.1.5.3.1.4.8' \"taperedDose\";\r\nsource: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal\r\ntarget: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.35\r\ndosage for normal dosing (without sequences) (Statement, Prescription)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "normalDose" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.1" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeStartEnd" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeStartEnd" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeWhen" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeWhenNormal" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "route" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "route" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "route" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "routeCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "routeCode" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodeableConceptCE" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "route";
           fhir:index 0         ], [
           fhir:value "routeCode";
           fhir:index 1         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "doseQuantity" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DoseQuantity" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 4;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsEntryStartStopRoute" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\r\ntarget: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\r\ndosage for split dosing: effectiveTime (start/stop) & routeCode (Statement, Prescription)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "entry" ];
       fhir:StructureMap.group.input.type [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "splitDose" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.9" ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "if the FHIR doucment has no dosage templateId -> create templateId for split dose" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeStartEnd" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeStartEnd" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "route" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "route" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "route" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "routeCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "routeCode" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodeableConceptCE" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "route";
           fhir:index 0         ], [
           fhir:value "routeCode";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 5;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsEntryDosageChangeSubstanceAdministration" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\r\ntarget: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\r\ndosage for split dosing: sequence number, effectiveTime (when), dose quantity, consumable (Statement, Prescription)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "entry" ];
       fhir:StructureMap.group.input.type [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "sequence" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "sequence" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "sequence" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "sequenceNumber" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "sequenceNumber" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "sequenceNumber" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "sequence" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SBADM" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INT" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeWhen" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]           ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeWhenSplit" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "dosage";
             fhir:index 0           ], [
             fhir:value "substanceAdministration";
             fhir:index 1           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "doseQuantity" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]           ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "DoseQuantity" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "dosage";
             fhir:index 0           ], [
             fhir:value "substanceAdministration";
             fhir:index 1           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "consumable" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "consumable" ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.target.context [ fhir:value "consumable" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]         ], [
           fhir:index 4;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NA" ]           ]         ]       ]     ]
  ], [
     fhir:index 6;
     fhir:StructureMap.group.name [ fhir:value "EffectiveTimeStartEnd" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "effective time low and high for dosage (Statement, Prescription)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "timing" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "timing" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "repeat" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "timing" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "repeat" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "repeat" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "bounds" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
             fhir:StructureMap.group.rule.source.type [ fhir:value "Period" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "bounds" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "bounds" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "IVL_TS" ]             ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "low" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "bounds" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "start" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "start" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "low" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "low" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "DateTS" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "start";
                 fhir:index 0               ], [
                 fhir:value "low";
                 fhir:index 1               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "NullFlavorLow" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "bounds" ];
               fhir:StructureMap.group.rule.source.condition [ fhir:value "start.exists().not()" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "low" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "low" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "low" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "UNK" ]               ]             ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.name [ fhir:value "high" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "bounds" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "end" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "end" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "high" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "high" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "DateTS" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "end";
                 fhir:index 0               ], [
                 fhir:value "high";
                 fhir:index 1               ]             ]           ], [
             fhir:index 3;
             fhir:StructureMap.group.rule.name [ fhir:value "NullFlavorhigh" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "bounds" ];
               fhir:StructureMap.group.rule.source.condition [ fhir:value "end.exists().not()" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "high" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "high" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "high" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "UNK" ]               ]             ]           ]         ]       ]     ]
  ], [
     fhir:index 7;
     fhir:StructureMap.group.name [ fhir:value "DoseQuantity" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "dose quantity for dosage (application schema) (Statement)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "doseQuantity" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "doseAndRate" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "doseAndRate" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "doseQuantity" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "doseQuantity" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "quantity" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "doseAndRate" ];
           fhir:StructureMap.group.rule.source.type [ fhir:value "Quantity" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "dose" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "quantity" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "value" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "quantity" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "value" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "doseQuantity" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "value" ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "quantity" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "doseQuantity" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "unit" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "code" ]             ]           ]         ]       ]     ]
  ], [
     fhir:index 8;
     fhir:StructureMap.group.name [ fhir:value "TreatmentReasonEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: reasonCode Coding (e.g. http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-medicationstatement)\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.41\r\nTreatment Reason (Statement, Prescription)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "reasonCode" ];
       fhir:StructureMap.group.input.type [ fhir:value "Coding" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "observation" ];
       fhir:StructureMap.group.input.type [ fhir:value "Observation" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "OBS" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "reasonCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "observation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "OBS" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "EVN" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "reasonCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "observation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EVN" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "TreatmentReasonEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "reasonCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "observation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.41" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "reasonCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "observation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "75326-9" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "codeSystem" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.6.1" ]         ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "displayName" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Problem" ]         ]       ], [
         fhir:index 4;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "codeSystemName" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "LOINC" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "text" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "reasonCode" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "reasonText" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "observation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "reasonText" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "data" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "reasonText" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "reasonCode" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]             ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "reasonCode" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "statusCode" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "reasonCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "observation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]         ]       ]     ]
  ], [
     fhir:index 9;
     fhir:StructureMap.group.name [ fhir:value "MTPReferenceEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-ext-treatmentplan.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--ch-pharm-?section=templates&id=2.16.756.5.30.1.1.10.4.45&effectiveDate=2017-01-10T15:34:25&language=en-US" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "ext" ];
       fhir:StructureMap.group.input.type [ fhir:value "Extension" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "SBADM" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ext" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SBADM" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "INT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ext" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INT" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "referenceTo-MTP-PlanItemGeneralSpecificationTemplateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ext" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.10" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "CH-PHARM-templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ext" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.45" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "id" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'id'" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "valueIdentifier" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "valueIdentifier" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "id" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "IdentifierII" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "valueIdentifier";
             fhir:index 0           ], [
             fhir:value "id";
             fhir:index 1           ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ext" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MTPItem" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "codeSystem" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.2.2" ]         ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "displayName" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Medication Treatment Plan Item" ]         ]       ], [
         fhir:index 4;
         fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "codeSystemName" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "IHE Pharmacy Item Type List" ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "consumable" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ext" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "consumable" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NA" ]         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "externalDocumentId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'externalDocumentId'" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "valueIdentifier" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "valueIdentifier" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "XCRPT" ]           ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "externalDocument" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "externalDocument" ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.target.context [ fhir:value "externalDocument" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "id" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "IdentifierII" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "valueIdentifier";
             fhir:index 0           ], [
             fhir:value "id";
             fhir:index 1           ]         ]       ]     ]
  ], [
     fhir:index 10;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsNonStructuredEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-dosage-nonstructured.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--ch-pharm-?section=templates&id=2.16.756.5.30.1.1.10.4.52\r\nDosage Instruction (Statement, Prescription)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "SBADM" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SBADM" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "INT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INT" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.52" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "text" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "noteText" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "noteText" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "data" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "noteText" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]             ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "consumable" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "consumable" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NA" ]         ]       ]     ]
  ], [
     fhir:index 11;
     fhir:StructureMap.group.name [ fhir:value "SubstitutionDispense" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html\r\ntarget: Substitution act Contains 1.3.6.1.4.1.19376.1.9.1.3.9.2 IHE Substitution Act Content Module\r\nSubstitution (Dispense)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "substitution" ];
       fhir:StructureMap.group.input.type [ fhir:value "Substitution" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "act" ];
       fhir:StructureMap.group.input.type [ fhir:value "Act" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "ACT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "ACT" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "EVN" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EVN" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.9.2" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "substitution" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "type" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "type" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodeableConceptCE" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "type";
           fhir:index 0         ], [
           fhir:value "code";
           fhir:index 1         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "statusCode" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "statusCode" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]         ]       ]     ]
  ], [
     fhir:index 12;
     fhir:StructureMap.group.name [ fhir:value "ManufacturedMaterialEntryContentModuleDispense" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.33&effectiveDate=2019-12-11T11:34:24&language=en-US" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ];
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "medicationDispense" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationDispense" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "medication" ];
       fhir:StructureMap.group.input.type [ fhir:value "Medication" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.input.name [ fhir:value "manufacturedMaterial" ];
       fhir:StructureMap.group.input.type [ fhir:value "ManufacturedMaterial" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "MMAT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MMAT" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "KIND" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "KIND" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "CH-PHARM-ManufacturedMaterialContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.33" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.1" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "name" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "brandname" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]           ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "originalText" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "#dis.no.brandedmedication" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "originalText" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "ce";
             fhir:index 1           ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "form" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "form" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "form" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "formCode" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "form" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "formCode" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "formCode" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "formCode";
             fhir:index 1           ]         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "asContent" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CONT" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "containerPackagedMedicine" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "containerPackagedMedicine" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "CONT" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CONT" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "INSTANCE" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INSTANCE" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "pharm-code" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "ce";
             fhir:index 1           ]         ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.name [ fhir:value "pharm-name" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]           ]         ]       ], [
         fhir:index 4;
         fhir:StructureMap.group.rule.name [ fhir:value "form" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "form" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "form" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "pharm-formCode" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "form" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "formCode" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "formCode" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "coding";
               fhir:index 0             ], [
               fhir:value "formCode";
               fhir:index 1             ]           ]         ]       ], [
         fhir:index 5;
         fhir:StructureMap.group.rule.name [ fhir:value "amount" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "amount" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "amount" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "numerator" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "amount" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "numerator" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "numerator" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "capacityQuantity" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "capacityQuantity" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "value" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "numerator" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "value" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "capacityQuantity" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "value" ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "numerator" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "unit" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "capacityQuantity" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "unit" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "unit" ]               ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "Package size" ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "ingredient" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "ingredient" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ingredient" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "ACTI" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "PharmSubstance" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "itemCodeableConcept" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "itemCodeableConcept" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "pharmsubstance" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "MMAT" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MMAT" ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "KIND" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "KIND" ]             ]           ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.name [ fhir:value "name" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]             ]           ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.name [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "formCode" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "coding" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "coding";
                 fhir:index 0               ], [
                 fhir:value "ce";
                 fhir:index 1               ]             ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "strength" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "strength" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "strength" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "quantity" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "quantity" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "RatioRTOPQPQ" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "strength";
             fhir:index 0           ], [
             fhir:value "quantity";
             fhir:index 1           ]         ]       ]     ]
  ], [
     fhir:index 13;
     fhir:StructureMap.group.name [ fhir:value "DispenseItemEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.42" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ];
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "medicationDispense" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationDispense" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "supply" ];
       fhir:StructureMap.group.input.type [ fhir:value "Supply" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "SPLY" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SPLY" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "EVN" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EVN" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "CH-PHARM-DispenseItemEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.42" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "IHE-PHARM-DIS" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.4" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "supplyEntry" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.3" ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "CCD" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.10.20.1.34" ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "id" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "identifier" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "identifier" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "id" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "IdentifierII" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "identifier";
           fhir:index 0         ], [
           fhir:value "id";
           fhir:index 1         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "narrativeLink" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "valueUrl" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]           ]         ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]         ]       ]     ], [
       fhir:index 9;
       fhir:StructureMap.group.rule.name [ fhir:value "contained" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "contained" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "('#' + $this.id) in %medicationDispense.medicationReference.reference" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "product" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "product" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "product" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MANU" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "MP-TemplateId" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.2" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "MP-TemplateId" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.10.20.1.53" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "ManufacturedMaterialEntryContentModuleDispense" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "bundle";
             fhir:index 0           ], [
             fhir:value "medicationDispense";
             fhir:index 1           ], [
             fhir:value "medication";
             fhir:index 2           ], [
             fhir:value "manufacturedMaterial";
             fhir:index 3           ]         ]       ]     ], [
       fhir:index 10;
       fhir:StructureMap.group.rule.name [ fhir:value "MTP-Reference" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "REFR" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "MTPReferenceEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "extension";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "TODO: AUTHOR1 Medication Treatment Plan Author" ]     ], [
       fhir:index 11;
       fhir:StructureMap.group.rule.name [ fhir:value "onylonedosage" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "dosageInstruction.count() = 1" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "normalDose" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured')" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.1" ]           ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "#24 missing template it if ch-emed-dosage-nonstructured" ]     ], [
       fhir:index 12;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal')" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsStartStopFrequencySupply" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "supply";
           fhir:index 1         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for normal dosing, as no sequences are present there" ]     ], [
       fhir:index 13;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
             fhir:StructureMap.group.rule.source.listMode [ fhir:value "first" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split')" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]             ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryStartStopRouteConsumable" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "dosage";
               fhir:index 0             ], [
               fhir:value "entryRelationship";
               fhir:index 1             ], [
               fhir:value "substanceAdministration";
               fhir:index 2             ]           ];
           fhir:StructureMap.group.rule.documentation [ fhir:value "split dosing (with sequences): effectiveTime (start/stop) & routeCode & consumable" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split')" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]             ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryDosageChangeEntryRelationship" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "dosage";
               fhir:index 0             ], [
               fhir:value "entryRelationship";
               fhir:index 1             ]           ];
           fhir:StructureMap.group.rule.documentation [ fhir:value "split dosing (with sequences): sequence number, effectiveTime (when), dose quantity, consumable" ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for split dosing, as sequences are present there" ]     ], [
       fhir:index 14;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageInstructionsNonStructuredEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured')" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsNonStructuredEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "TODO: Precondition Criterion" ]     ], [
       fhir:index 15;
       fhir:StructureMap.group.rule.name [ fhir:value "quantity" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "quantity" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "quantity" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "quantity" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "supplyQuantity" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "value" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "quantity" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "value" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "supplyQuantity" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "value" ]           ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "Number of packages" ]     ], [
       fhir:index 16;
       fhir:StructureMap.group.rule.name [ fhir:value "AnnotationComment" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "note" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "AnnotationComment" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "note";
           fhir:index 0         ], [
           fhir:value "act";
           fhir:index 1         ]       ]     ], [
       fhir:index 17;
       fhir:StructureMap.group.rule.name [ fhir:value "Substitution" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "substitution" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "SubstitutionDispense" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "substitution";
           fhir:index 0         ], [
           fhir:value "act";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 14;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsStartStopFrequencySupply" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal\r\ntarget: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.35\r\ndosage for normal dosing (without sequences) (Dispense)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "supply" ];
       fhir:StructureMap.group.input.type [ fhir:value "Supply" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "COMP" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "SBADM" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SBADM" ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "INT" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INT" ]             ]           ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.6" ]             ]           ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.name [ fhir:value "normalDose" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.1" ]             ]           ]         ], [
           fhir:index 4;
           fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeStartEnd" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]             ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeStartEnd" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "dosage";
               fhir:index 0             ], [
               fhir:value "substanceAdministration";
               fhir:index 1             ]           ]         ], [
           fhir:index 5;
           fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeWhen" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]             ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeWhenNormal" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "dosage";
               fhir:index 0             ], [
               fhir:value "substanceAdministration";
               fhir:index 1             ]           ]         ], [
           fhir:index 6;
           fhir:StructureMap.group.rule.name [ fhir:value "route" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "route" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "route" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "routeCode" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "routeCode" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodeableConceptCE" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "route";
               fhir:index 0             ], [
               fhir:value "routeCode";
               fhir:index 1             ]           ]         ], [
           fhir:index 7;
           fhir:StructureMap.group.rule.name [ fhir:value "doseQuantity" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]             ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "DoseQuantity" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "dosage";
               fhir:index 0             ], [
               fhir:value "substanceAdministration";
               fhir:index 1             ]           ]         ], [
           fhir:index 8;
           fhir:StructureMap.group.rule.name [ fhir:value "consumable" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "consumable" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "consumable" ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.target.context [ fhir:value "consumable" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]           ], [
             fhir:index 3;
             fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]           ], [
             fhir:index 4;
             fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NA" ]             ]           ]         ]       ]     ]
  ], [
     fhir:index 15;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsEntryStartStopRouteConsumable" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\r\ntarget: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\r\ndosage for split dosing: effectiveTime (start/stop) & routeCode & consumable (Dispense)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.input.type [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "COMP" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "SBADM" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SBADM" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "INT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INT" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.6" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "splitDose" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.9" ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeStartEnd" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeStartEnd" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "route" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "route" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "route" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "routeCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "routeCode" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodeableConceptCE" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "route";
           fhir:index 0         ], [
           fhir:value "routeCode";
           fhir:index 1         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "consumable" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "consumable" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NA" ]         ]       ]     ]
  ], [
     fhir:index 16;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsEntryDosageChangeEntryRelationship" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\r\ntarget: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\r\ndosage for split dosing: sequence number, effectiveTime (when), dose quantity, consumable (Dispense)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.input.type [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "sequence" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "sequence" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "sequence" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "sequenceNumber" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "sequenceNumber" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "sequenceNumber" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "sequence" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SBADM" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INT" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeWhen" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]           ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeWhenSplit" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "dosage";
             fhir:index 0           ], [
             fhir:value "substanceAdministration";
             fhir:index 1           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "doseQuantity" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "substanceAdministration" ]           ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "DoseQuantity" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "dosage";
             fhir:index 0           ], [
             fhir:value "substanceAdministration";
             fhir:index 1           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "consumable" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "consumable" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "consumable" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NA" ]           ]         ]       ]     ]
  ], [
     fhir:index 17;
     fhir:StructureMap.group.name [ fhir:value "EffectiveTimeWhenNormal" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "effective time when for normal dosage (Dispense, Statement, Prescription)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "timing" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "timing" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "repeat" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "timing" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "repeat" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "repeat" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "when" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.when.count() = 1" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EIVL_TS" ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "operator" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "A" ]             ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "when" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "when" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "event" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "event" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "event" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "when" ]               ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "when" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.when.count() > 1" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SXPR_TS" ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "operator" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "A" ]             ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "comp" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source.listMode [ fhir:value "first" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "when" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EIVL_TS" ]               ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "when" ]               ];
               fhir:StructureMap.group.rule.target [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "comp" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "event" ];
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "event" ]               ], [
                 fhir:index 1;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "event" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "when" ]                 ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "compnotfirst" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source.listMode [ fhir:value "not_first" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "when" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EIVL_TS" ]               ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "operator" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "I" ]               ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "when" ]               ];
               fhir:StructureMap.group.rule.target [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "comp" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "event" ];
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "event" ]               ], [
                 fhir:index 1;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "event" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "when" ]                 ]               ]             ]           ]         ]       ]     ]
  ], [
     fhir:index 18;
     fhir:StructureMap.group.name [ fhir:value "EffectiveTimeWhenSplit" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "effective time when for split dosage (Dispense, Statement, Prescription)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "timing" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "timing" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "repeat" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "timing" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "repeat" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "repeat" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "when" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.when.count() = 1" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EIVL_TS" ]             ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "when" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "when" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "event" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "event" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "event" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "when" ]               ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "when" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.when.count() > 1" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SXPR_TS" ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "operator" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "A" ]             ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "comp" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source.listMode [ fhir:value "first" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "when" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EIVL_TS" ]               ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "when" ]               ];
               fhir:StructureMap.group.rule.target [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "comp" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "event" ];
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "event" ]               ], [
                 fhir:index 1;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "event" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "when" ]                 ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "compnotfirst" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "repeat" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source.listMode [ fhir:value "not_first" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "when" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EIVL_TS" ]               ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "operator" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "I" ]               ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "when" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "when" ]               ];
               fhir:StructureMap.group.rule.target [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "comp" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "event" ];
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "event" ]               ], [
                 fhir:index 1;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "event" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "when" ]                 ]               ]             ]           ]         ]       ]     ]
  ], [
     fhir:index 19;
     fhir:StructureMap.group.name [ fhir:value "SubstitutionRequest" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\r\ntarget: Substitution permission Contains 1.3.6.1.4.1.19376.1.9.1.3.9.1 IHE Substitution Permission Content Module" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "substitution" ];
       fhir:StructureMap.group.input.type [ fhir:value "Substitution" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "act" ];
       fhir:StructureMap.group.input.type [ fhir:value "Act" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "ACT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "ACT" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "DEF" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "DEF" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.9.1" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "substitution" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "allowedCodeableConcept" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "allowedCC" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodeableConceptCE" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "allowedCC";
           fhir:index 0         ], [
           fhir:value "code";
           fhir:index 1         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "statusCode" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "statusCode" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]         ]       ]     ]
  ], [
     fhir:index 20;
     fhir:StructureMap.group.name [ fhir:value "SubstitutionStatement" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\r\ntarget: Substitution permission Contains 1.3.6.1.4.1.19376.1.9.1.3.9.1 IHE Substitution Permission Content Module" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "extension" ];
       fhir:StructureMap.group.input.type [ fhir:value "Extension" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "act" ];
       fhir:StructureMap.group.input.type [ fhir:value "Act" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "ACT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "ACT" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "DEF" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "DEF" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.9.1" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "extension" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "valueCodeableConcept" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "valueCC" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodeableConceptCE" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "valueCC";
           fhir:index 0         ], [
           fhir:value "code";
           fhir:index 1         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "statusCode" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "statusCode" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]         ]       ]     ]
  ], [
     fhir:index 21;
     fhir:StructureMap.group.name [ fhir:value "PrescribedQuantity" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?id=2.16.756.5.30.1.1.10.4.38" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dispenseRequest" ];
       fhir:StructureMap.group.input.type [ fhir:value "DispenseRequest" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "supply" ];
       fhir:StructureMap.group.input.type [ fhir:value "Supply" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "SPLY" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SPLY" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "RQO" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "RQO" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.8" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "independentInd" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "independentInd" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "independentInd" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "independentInd" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "false" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "quantity" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "quantity" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "quantity" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "quantity" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "quant" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "value" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "quantity" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "value" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "quant" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "value" ]           ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "Number of packages" ]     ]
  ], [
     fhir:index 22;
     fhir:StructureMap.group.name [ fhir:value "PrescribedQuantityUnit" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?id=2.16.756.5.30.1.1.10.4.38" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "dispenseRequest" ];
       fhir:StructureMap.group.input.type [ fhir:value "DispenseRequest" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "supply" ];
       fhir:StructureMap.group.input.type [ fhir:value "Supply" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "SPLY" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SPLY" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "RQO" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "RQO" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "TemplateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.8" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "independentInd" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "independentInd" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "independentInd" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "independentInd" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "false" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "quantity" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "quantity" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "quantity" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "supply" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "quantity" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "quant" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "value" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "quantity" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "value" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "quant" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "value" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "quantity" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "unit" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "unit" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "quant" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "unit" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "unit" ]           ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "Number of packages" ]     ]
  ], [
     fhir:index 23;
     fhir:StructureMap.group.name [ fhir:value "ManufacturedMaterialEntryContentModulePrescription" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.33" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ];
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "medicationRequest" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationRequest" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "medication" ];
       fhir:StructureMap.group.input.type [ fhir:value "Medication" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.input.name [ fhir:value "manufacturedMaterial" ];
       fhir:StructureMap.group.input.type [ fhir:value "ManufacturedMaterial" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "MMAT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MMAT" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "KIND" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "KIND" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "CH-PHARM-ManufacturedMaterialContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.33" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "templateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.1" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "name" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "brandname" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]           ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "originalText" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "#pre.no.brandedmedication" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "originalText" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "ce";
             fhir:index 1           ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "form" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "form" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "form" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "formCode" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "form" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "formCode" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "formCode" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "formCode";
             fhir:index 1           ]         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "code" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "asContent" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CONT" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "asContent" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "containerPackagedMedicine" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "containerPackagedMedicine" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "CONT" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CONT" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "INSTANCE" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INSTANCE" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "pharm-code" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "coding";
             fhir:index 0           ], [
             fhir:value "ce";
             fhir:index 1           ]         ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.name [ fhir:value "pharm-name" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]           ]         ]       ], [
         fhir:index 4;
         fhir:StructureMap.group.rule.name [ fhir:value "form" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "form" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "form" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "pharm-formCode" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "form" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "formCode" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "formCode" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "coding";
               fhir:index 0             ], [
               fhir:value "formCode";
               fhir:index 1             ]           ]         ]       ], [
         fhir:index 5;
         fhir:StructureMap.group.rule.name [ fhir:value "amount" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "amount" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "amount" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "numerator" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "amount" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "numerator" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "numerator" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "containerPackagedMedicine" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "capacityQuantity" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "capacityQuantity" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "value" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "numerator" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "value" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "capacityQuantity" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "value" ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "numerator" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "unit" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "capacityQuantity" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "unit" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "unit" ]               ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "PrescribedQuantity" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "dispenseRequest" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "dispenseRequest" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]             ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "supply" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "supply" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "PrescribedQuantity" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "dispenseRequest";
               fhir:index 0             ], [
               fhir:value "supply";
               fhir:index 1             ]           ];
           fhir:StructureMap.group.rule.documentation [ fhir:value "IHE-DIS: Case 1: If the product-element contains package information, the unit attribute is not be present" ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "Package size" ]       ], [
         fhir:index 6;
         fhir:StructureMap.group.rule.name [ fhir:value "noAmount" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.amount.exists() = false" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "PrescribedQuantityUnit" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "dispenseRequest" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "dispenseRequest" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]             ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "supply" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "supply" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "PrescribedQuantityUnit" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "dispenseRequest";
               fhir:index 0             ], [
               fhir:value "supply";
               fhir:index 1             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "IHE-DIS: Case 2: If the product-element does not contain package information, the unit attribut is present and the value SHALL be out of the UCUM code system" ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "ingredient" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "ingredient" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ingredient" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "ACTI" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "PharmSubstance" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "itemCodeableConcept" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "itemCodeableConcept" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "pharmsubstance" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "MMAT" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MMAT" ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "KIND" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "determinerCode" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "KIND" ]             ]           ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.name [ fhir:value "name" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "name" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "name" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "other" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "text" ]             ]           ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.name [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "itemCodeableConcept" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "coding" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "formCode" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "coding" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "pharmsubstance" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "ce" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodingCE" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "coding";
                 fhir:index 0               ], [
                 fhir:value "ce";
                 fhir:index 1               ]             ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "strength" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "strength" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "strength" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ingredient" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "quantity" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "quantity" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "RatioRTOPQPQ" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "strength";
             fhir:index 0           ], [
             fhir:value "quantity";
             fhir:index 1           ]         ]       ]     ]
  ], [
     fhir:index 24;
     fhir:StructureMap.group.name [ fhir:value "PrescriptionItemEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.43" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ];
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "medicationRequest" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationRequest" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "SBADM" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "SBADM" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "INT" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INT" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "CH-PHARM-PrescriptionItemEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.43" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "PrescriptionItemEntryTemplateId" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.2" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "CCD" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.10.20.1.24" ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "PCC-MedicationEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7" ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "id" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "identifier" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "identifier" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "id" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "IdentifierII" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "identifier";
           fhir:index 0         ], [
           fhir:value "id";
           fhir:index 1         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "narrativeLink" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "valueUrl" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]           ]         ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "cat1narrativelink" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "extension.where(url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists().not()" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "referencetopdf" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ]     ], [
       fhir:index 9;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "statusCode" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]         ]       ]     ], [
       fhir:index 10;
       fhir:StructureMap.group.rule.name [ fhir:value "dispenseRequest" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dispenseRequest" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dispenseRequest" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "repeatNumber" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "repeatNumber" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "repeatNumber" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "numberOfRepeatsAllowed" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "number" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "repeatNumber" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "number" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "repeatNumberNull" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "dispenseRequest" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "numberOfRepeatsAllowed.exists() = false" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "repeatNumber" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "nullFlavor" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NI" ]           ]         ]       ]     ], [
       fhir:index 11;
       fhir:StructureMap.group.rule.name [ fhir:value "contained" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "contained" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "('#' + $this.id) in %medicationRequest.medicationReference.reference" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "consumable" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedProduct" ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MANU" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "MP-templateId" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.2" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "MP-templateId" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.840.1.113883.10.20.1.53" ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "manufacturedMaterial" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medication" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "manufacturedMaterial" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "ManufacturedMaterialEntryContentModulePrescription" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "bundle";
             fhir:index 0           ], [
             fhir:value "medicationRequest";
             fhir:index 1           ], [
             fhir:value "medication";
             fhir:index 2           ], [
             fhir:value "manufacturedMaterial";
             fhir:index 3           ], [
             fhir:value "substanceAdministration";
             fhir:index 4           ]         ]       ]     ], [
       fhir:index 12;
       fhir:StructureMap.group.rule.name [ fhir:value "onylonedosage" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "dosageInstruction.count() = 1" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "normalDose" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured')" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.5.3.1.4.7.1" ]           ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "TODO: AUTHOR1 Medication Treatment Plan Author" ]     ], [
       fhir:index 13;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal-medicationrequest')" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsStartStopFrequencySubstanceAdministration" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ], [
       fhir:index 14;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.source.listMode [ fhir:value "first" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split-medicationrequest')" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryStartStopRoute" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ], [
           fhir:value "entryRelationship";
           fhir:index 2         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for split dosing (with sequences): effectiveTime (start/stop) & routeCode" ]     ], [
       fhir:index 15;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageSubstanceAdministration" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split-medicationrequest')" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryDosageChangeSubstanceAdministration" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ], [
           fhir:value "entryRelationship";
           fhir:index 2         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for split dosing (with sequences): sequence number, effectiveTime (when), dose quantity, consumable" ]     ], [
       fhir:index 16;
       fhir:StructureMap.group.rule.name [ fhir:value "TreatmentReasonEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "reasonCode" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "reasonCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "RSON" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "observation" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "observation" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "TreatmentReasonEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "reasonCode";
           fhir:index 0         ], [
           fhir:value "observation";
           fhir:index 1         ]       ]     ], [
       fhir:index 17;
       fhir:StructureMap.group.rule.name [ fhir:value "MTP-Reference" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "REFR" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "MTPReferenceEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "extension";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ], [
       fhir:index 18;
       fhir:StructureMap.group.rule.name [ fhir:value "DosageInstructionsNonStructuredEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-nonstructured')" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsNonStructuredEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "dosage";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "TODO: Patient Medication Instructions Contains 1.3.6.1.4.1.19376.1.5.3.1.4.3 IHE Patient Medication Instructions (DYNAMIC)" ]     ], [
       fhir:index 19;
       fhir:StructureMap.group.rule.name [ fhir:value "AnnotationComment" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "note" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "AnnotationComment" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "note";
           fhir:index 0         ], [
           fhir:value "act";
           fhir:index 1         ]       ]     ], [
       fhir:index 20;
       fhir:StructureMap.group.rule.name [ fhir:value "Substitution" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "substitution" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "COMP" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "act" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "SubstitutionRequest" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "substitution";
           fhir:index 0         ], [
           fhir:value "act";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 25;
     fhir:StructureMap.group.name [ fhir:value "PharmaceuticalAdviceItemEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-observation.html\r\ntarget: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.44" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ];
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "fhirobservation" ];
       fhir:StructureMap.group.input.type [ fhir:value "Observation" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "cdaobservation" ];
       fhir:StructureMap.group.input.type [ fhir:value "Observation" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "OBS" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "classCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "OBS" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "EVN" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "moodCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "EVN" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "IHE-PHARM-PADV" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "1.3.6.1.4.1.19376.1.9.1.3.3" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "CH-PHARM-PharmaceuticalAdviceItemEntryContentModule" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "templateId" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "templateId" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "root" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "2.16.756.5.30.1.1.10.4.44" ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "id" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "identifier" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "identifier" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "id" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "IdentifierII" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "identifier";
           fhir:index 0         ], [
           fhir:value "id";
           fhir:index 1         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "fhirCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "cdaCode" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CodeableConceptCE" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "fhirCode";
           fhir:index 0         ], [
           fhir:value "cdaCode";
           fhir:index 1         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "code" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "statusCode" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "statusCode" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTime" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "effectiveDateTime" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "effectiveDateTime" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "effectiveTime" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "effectiveTime" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "value" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "effectiveDateTime" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "effectiveTime" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "effectiveDateTime" ]           ]         ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "MTP-Reference" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "REFR" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "MTPReferenceEntryContentModule" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "extension";
           fhir:index 0         ], [
           fhir:value "substanceAdministration";
           fhir:index 1         ]       ]     ], [
       fhir:index 9;
       fhir:StructureMap.group.rule.name [ fhir:value "changedmtp" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-medicationstatement-changed'" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "entryRelationship" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "typeCode" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "REFR" ]         ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "bundle" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "entry" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "fullUrlAsUuid" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "entry" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "fullUrl" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "($this in %extension.valueReference.reference) and $this.startsWith('urn:uuid')" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "MedicationStatement" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "entry" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "resource" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "medicationStatement" ];
               fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.ofType(FHIR.MedicationStatement)" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "MedicationTreatmentPlanItemEntryContentModule" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "bundle";
                 fhir:index 0               ], [
                 fhir:value "medicationStatement";
                 fhir:index 1               ], [
                 fhir:value "substanceAdministration";
                 fhir:index 2               ]             ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "MedicationStatement" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "entry" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "resource" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "medicationStatement" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.ofType(FHIR.MedicationStatement) and (('MedicationStatement' + '/' + $this.id) in %extension.valueReference.reference)" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "substanceAdministration" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "MedicationTreatmentPlanItemEntryContentModule" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "bundle";
               fhir:index 0             ], [
               fhir:value "medicationStatement";
               fhir:index 1             ], [
               fhir:value "substanceAdministration";
               fhir:index 2             ]           ]         ]       ]     ], [
       fhir:index 10;
       fhir:StructureMap.group.rule.name [ fhir:value "note" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "note" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "narrativeLink" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "valueUrl" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]             ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ]     ], [
       fhir:index 11;
       fhir:StructureMap.group.rule.name [ fhir:value "text" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "fhirobservation" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "note" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "cdaobservation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "text" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "noteText" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "data" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "noteText" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink'" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "valueUrl" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "valueUrl" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueUrl" ]             ]           ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.name [ fhir:value "reference" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(extension.where($this.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink').exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "#refpdf" ]           ]         ]       ]     ]
  ].

# - ontology header ------------------------------------------------------------

 a owl:Ontology;
  owl:imports fhir:fhir.ttl.