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

: CDA-CH-EMED to Bundle - 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 "CdaChEmedToBundle"];
  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/CdaChEmedToBundle&quot; = &quot;CdaChEmedToBundle&quot;\n\n// Medication Entries\n// 2020-10-30 Oliver Egger, 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 source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor&quot; alias AssignedAuthor as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity&quot; alias AssignedEntity as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Author&quot; alias Author as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization&quot; alias CustodianOrganization as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/IVL_TS&quot; alias IVL_TS as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/EIVL_TS&quot; alias EIVL_TS as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Observation&quot; alias Observation as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/PatientRole&quot; alias PatientRole as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/RecordTarget&quot; alias RecordTarget as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Section&quot; alias Section as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/SubstanceAdministration&quot; alias SubstanceAdministration as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/SXPR_TS&quot; alias SXPR_TS as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias Bundle as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Composition&quot; alias Composition as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Patient&quot; alias Patient as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Practitioner&quot; alias Practitioner as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Organization&quot; alias Organization as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/MedicationStatement&quot; alias MedicationStatement as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Dosage&quot; alias Dosage as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Observation&quot; alias Observation as produced\n\nimports &quot;http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToFhirTypes&quot;\nimports &quot;http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToBundle&quot;\nimports &quot;http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaChToBundle&quot;\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.2\n// target: Annotation note (e.g. http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html)\ngroup AnnotationComment(source section : Section, source act : Act, target note : Annotation) {\n  act.text as text then {\n    text.data as data -&gt; note.text = data &quot;level3&quot;;\n    text.reference as reference then {\n      reference.value as value -&gt; note.extension as ext then NarrativeLink(value, ext) &quot;narrativeLink&quot;;\n    };\n  };\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.33\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html\ngroup ManufacturedMaterialEntryContentModuleDispense(source src : Supply, target medicationDispense : MedicationDispense, target medication : Medication) {\n  src -&gt;  medication.id = 'med',  medicationDispense.medication = create('Reference') as vt,  vt.reference = '#med' &quot;medication&quot;;\n  // quantity value (number of packages)\n  src.quantity as quantity -&gt; medicationDispense.quantity as medDispQuantity then {\n    // IHE-DIS: If the product-element contains package information, the unit attribute is not be present\n    quantity.value as value -&gt; medDispQuantity.value = value;\n    // IHE-DIS: 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    quantity.unit as unit then {\n      unit -&gt; medDispQuantity.unit = unit &quot;unit&quot;;\n      unit -&gt; medDispQuantity.system = 'http://unitsofmeasure.org' &quot;ucum&quot;;\n      unit -&gt; medDispQuantity.code = unit &quot;code&quot;;\n    };\n  };\n  src.product as product then {\n    product.manufacturedProduct as manufacturedProduct then {\n      manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n        manufacturedMaterial.name as name where asContent.exists() = false -&gt;  medication.code as fhircode,  fhircode.text = (%manufacturedMaterial.name.other) &quot;code&quot;;\n        manufacturedMaterial.asContent as asContent then {\n          asContent.containerPackagedMedicine as containerPackagedMedicine then {\n            containerPackagedMedicine.code as code -&gt; medication.code as fhircode share medcode then CECodeableConcept(code, fhircode);\n            containerPackagedMedicine.name as name -&gt; medication.code as fhircode share medcode then {\n              name -&gt; fhircode.text = (%name.other) &quot;text&quot;;\n            } &quot;text&quot;;\n            containerPackagedMedicine.formCode as formCode -&gt; medication.form as form then CECodeableConcept(formCode, form);\n            // Package size\n            containerPackagedMedicine.capacityQuantity as capacityQuantity -&gt;  medication.amount = create('Ratio') as ratio,  ratio.denominator = create('Quantity') as denominator,  denominator.value = '1',  denominator.unit = 'Package',  denominator.system = 'http://unitsofmeasure.org',  denominator.code = '{Package}',  ratio.numerator = create('Quantity') as quantity then EmedPQQuantity(capacityQuantity, quantity);\n          };\n        };\n        manufacturedMaterial.ingredient as ingredient -&gt; medication.ingredient as ing then {\n          ingredient.quantity as quantity -&gt; ing.strength = create('Ratio') as strength then EmedRTOPQPQRatio(quantity, strength) &quot;strength&quot;;\n          ingredient.ingredient as medingredient then {\n            medingredient.code as code -&gt;  ing.item = create('CodeableConcept') as ingcode,  ingcode.text = (%medingredient.name.other) then CECodeableConcept(code, ingcode) &quot;ingredientCode&quot;;\n          };\n        };\n      };\n    };\n    // dosage for normal dosing, as no sequences are present there\n    src.entryRelationship as entry then {\n      entry.substanceAdministration as substanceAdministration then {\n        substanceAdministration where $this.entryRelationship.sequenceNumber.exists() = false -&gt; medicationDispense.dosageInstruction as dosage then DosageInstructionsStartStopFrequency(substanceAdministration, dosage) &quot;dosage&quot;;\n      };\n    } &quot;entry&quot;;\n  };\n}\n\ngroup EmedPQQuantity(source src : PQ, target tgt : Quantity) {\n  src.value as value -&gt; tgt.value = value;\n  src.unit as unit -&gt; tgt.code = unit;\n  src.unit as unit -&gt; tgt.system = ('http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.where(concept.where(code = %unit)).system);\n  src.unit as unit -&gt; tgt.unit = ('http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.concept.where(code = %unit).display);\n}\n\ngroup EmedRTOPQPQRatio(source src : RTO_PQ_PQ, target tgt : Ratio) {\n  src.numerator as numerator -&gt; tgt.numerator as targetNumerator then EmedPQQuantity(numerator, targetNumerator);\n  src.denominator as denominator -&gt; tgt.denominator as targetDenominator then EmedPQQuantity(denominator, targetDenominator);\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.33\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html\ngroup ManufacturedMaterialEntryContentModuleStatement(source src : SubstanceAdministration, target medicationStatement : MedicationStatement, target medication : Medication) {\n  src -&gt;  medication.id = 'med',  medicationStatement.medication = create('Reference') as vt,  vt.reference = '#med' &quot;medication&quot;;\n  src.consumable as consumable then {\n    consumable.manufacturedProduct as manufacturedProduct then {\n      manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n        manufacturedMaterial.name as name where asContent.exists() = false -&gt;  medication.code as fhircode,  fhircode.text = (%manufacturedMaterial.name.other) &quot;code&quot;;\n        manufacturedMaterial.asContent as asContent then {\n          asContent.containerPackagedMedicine as containerPackagedMedicine then {\n            containerPackagedMedicine.code as code -&gt; medication.code as fhircode share medcode then CECodeableConcept(code, fhircode);\n            containerPackagedMedicine.name as name -&gt; medication.code as fhircode share medcode then {\n              name -&gt; fhircode.text = (%name.other) &quot;text&quot;;\n            } &quot;text&quot;;\n            containerPackagedMedicine.formCode as formCode -&gt; medication.form as form then CECodeableConcept(formCode, form);\n            // Package size\n            containerPackagedMedicine.capacityQuantity as capacityQuantity -&gt;  medication.amount = create('Ratio') as ratio,  ratio.denominator = create('Quantity') as denominator,  denominator.value = '1',  denominator.unit = 'Package',  denominator.system = 'http://unitsofmeasure.org',  denominator.code = '{Package}',  ratio.numerator = create('Quantity') as quantity then EmedPQQuantity(capacityQuantity, quantity);\n          };\n        };\n        manufacturedMaterial.ingredient as ingredient -&gt; medication.ingredient as ing then {\n          ingredient.quantity as quantity -&gt; ing.strength = create('Ratio') as strength then EmedRTOPQPQRatio(quantity, strength) &quot;strength&quot;;\n          ingredient.ingredient as medingredient then {\n            medingredient.code as code -&gt;  ing.item = create('CodeableConcept') as ingcode,  ingcode.text = (%medingredient.name.other) then CECodeableConcept(code, ingcode) &quot;ingredientCode&quot;;\n          };\n        };\n      };\n    };\n    // dosage for normal dosing, as no sequences are present there\n    src where $this.entryRelationship.sequenceNumber.exists() = false -&gt; medicationStatement.dosage as dosage then DosageInstructionsStartStopFrequency(src, dosage) &quot;dosage&quot;;\n  };\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.34\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html\ngroup MedicationTreatmentPlanItemEntryContentModule(source section : Section, source src : SubstanceAdministration, source patient : Patient, target medicationStatement : MedicationStatement) {\n  // src.templateId as template then TemplateID(template, medicationStatement) &quot;templateId&quot;;\n  src.id -&gt; medicationStatement.identifier;\n  patient -&gt;  medicationStatement.subject = create('Reference') as reference,  reference.reference = ('urn:uuid:' + %patient.id) &quot;patient&quot;;\n  src -&gt; medicationStatement.status = 'completed' &quot;completed&quot;;\n  src.text as text then {\n    text.reference as reference then {\n      reference.value as value -&gt; medicationStatement.extension as ext then NarrativeLink(value, ext) &quot;narrativeLink&quot;;\n    };\n  };\n  src -&gt; medicationStatement.contained = create('Medication') as medication then ManufacturedMaterialEntryContentModuleStatement(src, medicationStatement, medication) &quot;medication&quot;;\n  src.entryRelationship as entry where typeCode = 'RSON' then {\n    entry.observation as observation -&gt; medicationStatement.reasonCode as reasonCode then TreatmentReasonEntryContentModule(section, observation, reasonCode) &quot;reasonCode&quot;;\n  } &quot;41&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and (substanceAdministration.templateId.root = '2.16.756.5.30.1.1.10.4.52')) -&gt; medicationStatement.dosage as dosage then DosageInstructionsNonStructuredEntryContentModule(section, entry, dosage) &quot;52&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and (sequenceNumber.value &gt;= 0)) -&gt; medicationStatement.dosage as dosage then DosageInstructionsEntryDosageChange(src, entry, dosage) &quot;36&quot;;\n  src.entryRelationship as entry where ((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.10').exists()) -&gt; medicationStatement.extension as ext then MTPReferenceEntryContentModule(entry, ext) &quot;MTPReferenceEntry&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and act.templateId.where(root = '2.16.756.5.30.1.1.10.4.2').exists()) then {\n    entry.act as act -&gt; medicationStatement.note as note then AnnotationComment(section, act, note) &quot;annotation&quot;;\n  } &quot;2&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and act.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.9.1').exists()) then {\n    entry.act as act -&gt; medicationStatement as medicationStatement then SubstitutionStatement(act, medicationStatement) &quot;substitution&quot;;\n  } &quot;1&quot;;\n}\n\n// source https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36\n// target: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split\n// dosage for split dosing, with sequences\ngroup DosageInstructionsEntryDosageChange(source src : substanceAdministration, source entry : entryRelationship, target dosage : Dosage) {\n  entry.sequenceNumber as sequenceNumber then {\n    sequenceNumber.value as val -&gt; dosage.sequence = val;\n  };\n  src as src -&gt; dosage as dosage then EffectiveTimeStartEnd(src, dosage) &quot;effectiveTimeStartEnd&quot;;\n  entry.substanceAdministration as src -&gt; dosage as dosage then EffectiveTimeWhen(src, dosage) &quot;effectiveTimeWhen&quot;;\n  src.routeCode as routeCode -&gt; dosage.route as route then CECodeableConcept(routeCode, route);\n  entry.substanceAdministration as src -&gt; dosage as dosage then DoseQuantity(src, dosage) &quot;doseQuantity&quot;;\n}\n\n// effective time start &amp; end for dosage\ngroup EffectiveTimeStartEnd(source src : substanceAdministration, target dosage : Dosage) {\n  src.effectiveTime : IVL_TS as effectiveTime -&gt; dosage.timing as timing share sharetiming then {\n    effectiveTime -&gt; timing.repeat as repeat then {\n      effectiveTime -&gt; repeat.bounds = create('Period') as period then {\n        effectiveTime.low as low then {\n          low.value as lowDate -&gt; period.start = lowDate &quot;lowDate&quot;;\n        };\n        effectiveTime.high as high then {\n          high.value as highDate -&gt; period.end = highDate &quot;highDate&quot;;\n        };\n      } &quot;period&quot;;\n    } &quot;repeat&quot;;\n  } &quot;effectiveTime-IVL-TS&quot;;\n}\n\n// effective time when for dosage\ngroup EffectiveTimeWhen(source src : substanceAdministration, target dosage : Dosage) {\n  src.effectiveTime : EIVL_TS as effectiveTime -&gt; dosage.timing as timing share sharetiming then {\n    effectiveTime -&gt; timing.repeat as repeat then {\n      effectiveTime.event as event then {\n        event.code as code -&gt; repeat.when = code;\n      };\n    } &quot;repeat&quot;;\n  } &quot;effectiveTime-EIVL-TS&quot;;\n  src.effectiveTime : SXPR_TS as effectiveTime -&gt; dosage.timing as timing share sharetiming then {\n    effectiveTime -&gt; timing.repeat as repeat then {\n      effectiveTime.comp as comp then {\n        comp.event as event then {\n          event.code as code -&gt; repeat.when = code;\n        };\n      };\n    } &quot;repeat&quot;;\n  } &quot;effectiveTime-SXPR-TS&quot;;\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.41\n// target: reasonCode Coding (e.g. http://build.fhir.org/ig/hl7ch/ig/ch-emed/StructureDefinition/ch-emed-medicationstatement)\ngroup TreatmentReasonEntryContentModule(source section : Section, source observation : Observation, target reasonCode : Coding) {\n  // extraxt text (Bluthochdruck) from id #mtpc.1.reason in section text &lt;td ID=&quot;mtpc.1.reason&quot;&gt;Bluthochdruck&lt;/td&gt;\n  observation.text as text then {\n    text.data as data -&gt; reasonCode.text = data &quot;level3&quot;;\n    text.reference as reference then {\n      reference.value as value -&gt; reasonCode.extension as ext then NarrativeLink(value, ext) &quot;narrativeLink&quot;;\n    };\n  };\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--ch-pharm-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.45\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-ext-treatmentplan.html\ngroup MTPReferenceEntryContentModule(source entryrelationship, target ext : Extension) {\n  entryrelationship -&gt; ext.url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan' &quot;url&quot;;\n  entryrelationship.substanceAdministration as substanceAdministration then {\n    substanceAdministration.id as id -&gt; ext.extension as ext then InnerExtensionId(id, ext) &quot;innerExtensionId&quot;;\n    substanceAdministration.reference as reference then {\n      reference.externalDocument as externalDocument then {\n        externalDocument.id as id -&gt; ext.extension as ext then InnerExtensionExternalDocumentId(id, ext) &quot;innerExtensionExternalDocumentId&quot;;\n      };\n    } &quot;substanceAdministration&quot;;\n  } &quot;id&quot;;\n}\n\n// source: 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// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-dosage-nonstructured.html\ngroup DosageInstructionsNonStructuredEntryContentModule(source section : Section, source entry : Element, target dosage : Dosage) {\n  // see MedicationTreatmentPlanItemEntryContentModule\n  entry.substanceAdministration as observation then {\n    observation.text as text then {\n      text.data as data -&gt; dosage.text = data &quot;level3&quot;;\n      text.reference as reference then {\n        reference.value as value -&gt; dosage.extension as ext then NarrativeLink(value, ext) &quot;narrativeLink&quot;;\n      };\n    };\n  } &quot;observation&quot;;\n}\n\n// source: Substitution act Contains 1.3.6.1.4.1.19376.1.9.1.3.9.2 IHE Substitution Act Content Module\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationdispense.html\ngroup SubstitutionDispense(source act : Act, target medicationDispense : MedicationDispense) {\n  act -&gt; medicationDispense.substitution as substitution then {\n    act -&gt;  substitution.wasSubstituted as wasSubstituted,  wasSubstituted.value = 'true' &quot;wasSubstituted&quot;;\n    // act.code as code -&gt; substitution.type as type then CECodeableConcept(code, type) &quot;type&quot;;\n    act.code as actCode -&gt;  substitution.type as type,  type.coding as coding then {\n      actCode -&gt;  coding.system as systemCC,  systemCC.value = 'http://terminology.hl7.org/CodeSystem/v3-substanceAdminSubstitution' &quot;system&quot;;\n      actCode.code as code -&gt;  coding.code as codeCC,  codeCC.value = code;\n      actCode.displayName as display -&gt;  coding.display as displayCC,  displayCC.value = display &quot;display&quot;;\n    } &quot;allowedCC&quot;;\n  } &quot;substitution&quot;;\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.42\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html\ngroup DispenseItemEntryContentModule(source section : Section, source src : Supply, source patient : Patient, target medicationDispense : MedicationDispense) {\n  // src.templateId as template then TemplateID(template, medicationDispense) &quot;templateId&quot;;\n  src.id -&gt; medicationDispense.identifier;\n  patient -&gt;  medicationDispense.subject = create('Reference') as reference,  reference.reference = ('urn:uuid:' + %patient.id) &quot;patient&quot;;\n  src -&gt; medicationDispense.status = 'completed' &quot;completed&quot;;\n  src.text as text then {\n    text.reference as reference then {\n      reference.value as value -&gt; medicationDispense.extension as ext then NarrativeLink(value, ext) &quot;narrativeLink&quot;;\n    };\n  };\n  src -&gt; medicationDispense.contained = create('Medication') as medication then ManufacturedMaterialEntryContentModuleDispense(src, medicationDispense, medication) &quot;medication&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and (substanceAdministration.templateId.root = '2.16.756.5.30.1.1.10.4.52')) -&gt; medicationDispense.dosageInstruction as dosage then DosageInstructionsNonStructuredEntryContentModule(section, entry, dosage) &quot;52&quot;;\n  src.entryRelationship as entryRelationship then {\n    entryRelationship.substanceAdministration as substanceAdministration then {\n      // dosage for split dosing, as sequences are present there\n      substanceAdministration.entryRelationship as entryRelationship where ((typeCode = 'COMP') and (sequenceNumber.value &gt;= 0)) -&gt; medicationDispense.dosageInstruction as dosage then DosageInstructionsEntryDosageChange(substanceAdministration, entryRelationship, dosage) &quot;36&quot;;\n    };\n  };\n  src.entryRelationship as entry where ((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.10').exists()) -&gt; medicationDispense.extension as ext then MTPReferenceEntryContentModule(entry, ext) &quot;MTPReferenceEntry&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and act.templateId.where(root = '2.16.756.5.30.1.1.10.4.2').exists()) then {\n    entry.act as act -&gt; medicationDispense.note as note then AnnotationComment(section, act, note) &quot;annotation&quot;;\n  } &quot;2&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and act.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.9.2').exists()) then {\n    entry.act as act -&gt; medicationDispense as medicationDispense then SubstitutionDispense(act, medicationDispense) &quot;substitution&quot;;\n  } &quot;2&quot;;\n}\n\n// dose quantity for dosage (application schema)\ngroup DoseQuantity(source src : substanceAdministration, target dosage : Dosage) {\n  src.doseQuantity as doseQuantity -&gt; dosage.doseAndRate as doseAndRate then {\n    doseQuantity.value as value -&gt; doseAndRate.dose = create('Quantity') as quantity then {\n      value -&gt; quantity.value = value &quot;value&quot;;\n      doseQuantity.unit as unit -&gt; quantity.code = unit;\n      doseQuantity.unit as unit -&gt; quantity.system = ('http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.where(concept.where(code = %unit)).system);\n      doseQuantity.unit as unit -&gt; quantity.unit = ('http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.concept.where(code = %unit).display);\n    } &quot;quantity&quot;;\n  };\n}\n\n// source: Substitution permission Contains 1.3.6.1.4.1.19376.1.9.1.3.9.1 IHE Substitution Permission Content Module (DYNAMIC)\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationrequest.html\ngroup SubstitutionRequest(source act : Act, target medicationRequest : MedicationRequest) {\n  act -&gt; medicationRequest.substitution as substitution then {\n    // act.code as code -&gt; substitution.allowed = create('CodeableConcept') as allowedCC then CECodeableConcept(code, allowedCC) &quot;allowedCC&quot;;\n    act.code as actCode -&gt;  substitution.allowed = create('CodeableConcept') as allowedCC,  allowedCC.coding as coding then {\n      actCode -&gt;  coding.system as systemCC,  systemCC.value = 'http://terminology.hl7.org/CodeSystem/v3-substanceAdminSubstitution' &quot;system&quot;;\n      actCode.code as code -&gt;  coding.code as codeCC,  codeCC.value = code;\n      actCode.displayName as display -&gt;  coding.display as displayCC,  displayCC.value = display &quot;display&quot;;\n    } &quot;allowedCC&quot;;\n  } &quot;substitutionRequest&quot;;\n}\n\n// source: Substitution permission Contains 1.3.6.1.4.1.19376.1.9.1.3.9.1 IHE Substitution Permission Content Module (DYNAMIC)\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationstatement.html\ngroup SubstitutionStatement(source act : Act, target medicationStatement : MedicationStatement) {\n  act -&gt; medicationStatement.extension as ext then {\n    act -&gt; ext.url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-substitution' then {\n      // act.code as code -&gt; ext.value = create('CodeableConcept') as valueCC then CECodeableConcept(code, valueCC) &quot;valueCC&quot;;\n      act.code as actCode -&gt;  ext.value = create('CodeableConcept') as valueCC,  valueCC.coding as coding then {\n        actCode -&gt;  coding.system as systemCC,  systemCC.value = 'http://terminology.hl7.org/CodeSystem/v3-substanceAdminSubstitution' &quot;system&quot;;\n        actCode.code as code -&gt;  coding.code as codeCC,  codeCC.value = code;\n        actCode.displayName as display -&gt;  coding.display as displayCC,  displayCC.value = display &quot;display&quot;;\n      } &quot;valueCC&quot;;\n    } &quot;substitutionExtension&quot;;\n  } &quot;substitutionStatement&quot;;\n}\n\n// Number of packages\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?id=2.16.756.5.30.1.1.10.4.38\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html\ngroup PrescribedQuantity(source supply : Supply, target medicationRequest : MedicationRequest) {\n  supply.quantity as quantity -&gt;  medicationRequest.dispenseRequest as dispenseRequest,  dispenseRequest.quantity as quant then {\n    // IHE-PRE: If the product-element contains package information, the unit attribute is not be present\n    quantity.value as value -&gt; quant.value = value;\n    // IHE-PRE: 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    quantity.unit as unit then {\n      unit -&gt; quant.unit = unit &quot;unit&quot;;\n      unit -&gt; quant.system = 'http://unitsofmeasure.org' &quot;ucum&quot;;\n      unit -&gt; quant.code = unit &quot;code&quot;;\n    };\n  };\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.33\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationrequest.html\ngroup ManufacturedMaterialEntryContentModuleRequest(source src : SubstanceAdministration, target medicationRequest : MedicationRequest, target medication : Medication) {\n  src -&gt;  medication.id = 'med',  medicationRequest.medication = create('Reference') as vt,  vt.reference = '#med' &quot;medication&quot;;\n  src.consumable as consumable then {\n    consumable.manufacturedProduct as manufacturedProduct then {\n      manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n        manufacturedMaterial.name as name where asContent.exists() = false -&gt;  medication.code as fhircode,  fhircode.text = (%manufacturedMaterial.name.other) &quot;code&quot;;\n        manufacturedMaterial.asContent as asContent then {\n          asContent.containerPackagedMedicine as containerPackagedMedicine then {\n            containerPackagedMedicine.code as code -&gt; medication.code as fhircode share medcode then CECodeableConcept(code, fhircode);\n            containerPackagedMedicine.name as name -&gt; medication.code as fhircode share medcode then {\n              name -&gt; fhircode.text = (%name.other) &quot;text&quot;;\n            } &quot;text&quot;;\n            containerPackagedMedicine.formCode as formCode -&gt; medication.form as form then CECodeableConcept(formCode, form);\n            // Package size\n            containerPackagedMedicine.capacityQuantity as capacityQuantity -&gt;  medication.amount = create('Ratio') as ratio,  ratio.denominator = create('Quantity') as denominator,  denominator.value = '1',  denominator.unit = 'Package',  denominator.system = 'http://unitsofmeasure.org',  denominator.code = '{Package}',  ratio.numerator = create('Quantity') as quantity then EmedPQQuantity(capacityQuantity, quantity);\n          };\n        };\n        manufacturedMaterial.ingredient as ingredient -&gt; medication.ingredient as ing then {\n          ingredient.quantity as quantity -&gt; ing.strength = create('Ratio') as strength then EmedRTOPQPQRatio(quantity, strength) &quot;strength&quot;;\n          ingredient.ingredient as medingredient then {\n            medingredient.code as code -&gt;  ing.item = create('CodeableConcept') as ingcode,  ingcode.text = (%medingredient.name.other) then CECodeableConcept(code, ingcode) &quot;ingredientCode&quot;;\n          };\n        };\n      };\n    };\n    // dosage for normal dosing, as no sequences are present there\n    src where $this.entryRelationship.sequenceNumber.exists() = false -&gt; medicationRequest.dosageInstruction as dosage then DosageInstructionsStartStopFrequency(src, dosage) &quot;dosage&quot;;\n  };\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.43\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationrequest.html\ngroup PrescriptionItemEntryContentModule(source section : Section, source src : SubstanceAdministration, source patient : Patient, target medicationRequest : MedicationRequest) {\n  src.id -&gt; medicationRequest.identifier;\n  patient -&gt;  medicationRequest.subject = create('Reference') as reference,  reference.reference = ('urn:uuid:' + %patient.id) &quot;patient&quot;;\n  src -&gt; medicationRequest.status = 'completed' &quot;completed&quot;;\n  src -&gt; medicationRequest.intent = 'order' &quot;order&quot;;\n  src.text as text then {\n    text.reference as reference then {\n      reference.value as value -&gt; medicationRequest.extension as ext then NarrativeLink(value, ext) &quot;narrativeLink&quot;;\n    };\n  };\n  src -&gt; medicationRequest.contained = create('Medication') as medication then ManufacturedMaterialEntryContentModuleRequest(src, medicationRequest, medication) &quot;medication&quot;;\n  src.entryRelationship as entry where typeCode = 'RSON' then {\n    entry.observation as observation -&gt; medicationRequest.reasonCode as reasonCode then TreatmentReasonEntryContentModule(section, observation, reasonCode) &quot;reasonCode&quot;;\n  } &quot;41&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and (substanceAdministration.templateId.root = '2.16.756.5.30.1.1.10.4.52')) -&gt; medicationRequest.dosageInstruction as dosage then DosageInstructionsNonStructuredEntryContentModule(section, entry, dosage) &quot;52&quot;;\n  // dosage for split dosing, as sequences are present there\n  src.entryRelationship as entry where ((typeCode = 'COMP') and (sequenceNumber.value &gt;= 0)) -&gt; medicationRequest.dosageInstruction as dosage then DosageInstructionsEntryDosageChange(src, entry, dosage) &quot;36&quot;;\n  src.entryRelationship as entry where ((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.10').exists()) -&gt; medicationRequest.extension as ext then MTPReferenceEntryContentModule(entry, ext) &quot;MTPReferenceEntry&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and act.templateId.where(root = '2.16.756.5.30.1.1.10.4.2').exists()) then {\n    entry.act as act -&gt; medicationRequest.note as note then AnnotationComment(section, act, note) &quot;annotation&quot;;\n  } &quot;2&quot;;\n  src.repeatNumber as repeatNumber -&gt; medicationRequest.dispenseRequest as dispenseRequest then {\n    repeatNumber.value as val -&gt; dispenseRequest.numberOfRepeatsAllowed = val &quot;repeatNumber&quot;;\n  } &quot;repeats&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and supply.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.8').exists()) then {\n    entry.supply as supply -&gt; medicationRequest as medicationRequest then PrescribedQuantity(supply, medicationRequest) &quot;quantity&quot;;\n  } &quot;8&quot;;\n  src.entryRelationship as entry where ((typeCode = 'COMP') and act.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.9.1').exists()) then {\n    entry.act as act -&gt; medicationRequest as medicationRequest then SubstitutionRequest(act, medicationRequest) &quot;substitution&quot;;\n  } &quot;1&quot;;\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.35\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal\n// dosage for normal dosing, without sequences\ngroup DosageInstructionsStartStopFrequency(source src : SubstanceAdministration, target dosage : Dosage) {\n  src as src -&gt; dosage as dosage then EffectiveTimeStartEnd(src, dosage) &quot;effectiveTimeStartEnd&quot;;\n  src as src -&gt; dosage as dosage then EffectiveTimeWhen(src, dosage) &quot;effectiveTimeWhen&quot;;\n  src.routeCode as routeCode -&gt; dosage.route as route then CECodeableConcept(routeCode, route);\n  src as src -&gt; dosage as dosage then DoseQuantity(src, dosage) &quot;doseQuantity&quot;;\n}\n\n// source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&amp;id=2.16.756.5.30.1.1.10.4.44\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-observation.html\ngroup PharmaceuticalAdviceItemEntryContentModule(source section : Section, source src : Observation, source patient : Patient, target observation : Observation, target bundle : Bundle) {\n  src.id -&gt; observation.identifier;\n  patient -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('urn:uuid:' + %patient.id) &quot;patient&quot;;\n  src -&gt; observation.status = 'final' &quot;final&quot;;\n  src.effectiveTime as effectiveTime -&gt; observation.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value&quot;;\n  src.entryRelationship as entry where ((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.10').exists()) -&gt; observation.extension as ext then MTPReferenceEntryContentModule(entry, ext) &quot;MTPReferenceEntry&quot;;\n  src.entryRelationship as entry where ((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.7').exists()) -&gt;  bundle.entry as e,  e.id = uuid() as uuid,  e.fullUrl = append('urn:uuid:', uuid),  e.resource = create('MedicationStatement') as medicationstatement,  observation.extension as ext,  ext.url = 'http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-medicationstatement-changed',  ext.value = create('Reference') as reference,  reference.reference = append('urn:uuid:', uuid) then {\n    entry.substanceAdministration as substanceAdministration then MedicationTreatmentPlanItemEntryContentModule(section, substanceAdministration, patient, medicationstatement);\n  } &quot;cdaEntry&quot;;\n  src.text as text -&gt; observation.note as note then {\n    text.data as data -&gt; note.text = data &quot;level3observation&quot;;\n    text where (data.exists() = false) -&gt; note.text = (%section.text.substring(%section.text.indexOf(%src.text.reference.value.substring(1))).substring(%section.text.substring(%section.text.indexOf(%src.text.reference.value.substring(1))).indexOf('&gt;') + 1, %section.text.substring(%section.text.indexOf(%src.text.reference.value.substring(1))).indexOf('&lt;') - %section.text.substring(%section.text.indexOf(%src.text.reference.value.substring(1))).indexOf('&gt;') - 1)) &quot;idRef&quot;;\n    text.reference as reference then {\n      reference.value as value -&gt; note.extension as ext then NarrativeLink(value, ext) &quot;narrativeLink&quot;;\n    };\n  } &quot;note&quot;;\n  src.code -&gt; observation.code;\n}\n\n// _________________________ Template Type not specified   _________________________\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-ext-treatmentplan.html\ngroup InnerExtensionExternalDocumentId(source src, target ext : Extension) {\n  src -&gt; ext.url = 'externalDocumentId' &quot;url&quot;;\n  src -&gt; ext.value = create('Identifier') as id then II(src, id) &quot;value&quot;;\n}\n\n// target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-ext-treatmentplan.html\ngroup InnerExtensionId(source src, target ext : Extension) {\n  src -&gt; ext.url = 'id' &quot;url&quot;;\n  src -&gt; ext.value = create('Identifier') as id then II(src, id) &quot;value&quot;;\n}\n\n</pre>\n      </div>"
  ];
  fhir:StructureMap.url [ fhir:value "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaChEmedToBundle"];
  fhir:StructureMap.version [ fhir:value "0.3.0"];
  fhir:StructureMap.name [ fhir:value "CdaChEmedToBundle"];
  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 "Medication Entries 2020-10-30 Oliver Egger, copyright ahdis ag, Apache License CDA-CH-EMED:  https://art-decor.org/art-decor/decor-project--cdachemed- FHIR CH-EMED: http://fhir.ch/ig/ch-emed/index.html"];
  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 "source" ];
     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 "source" ];
     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 "source" ];
     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 "source" ];
     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 "source" ];
     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 "source" ];
     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 "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "EIVL_TS" ]
  ], [
     fhir:index 7;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/cda/StructureDefinition/Observation";
       fhir:link <http://hl7.org/fhir/cda/StructureDefinition/Observation>     ];
     fhir:StructureMap.structure.mode [ fhir:value "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "Observation" ]
  ], [
     fhir:index 8;
     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 "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "PatientRole" ]
  ], [
     fhir:index 9;
     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 "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "RecordTarget" ]
  ], [
     fhir:index 10;
     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 "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "Section" ]
  ], [
     fhir:index 11;
     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 "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "SubstanceAdministration" ]
  ], [
     fhir:index 12;
     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 "source" ];
     fhir:StructureMap.structure.alias [ fhir:value "SXPR_TS" ]
  ], [
     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 "target" ];
     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 "produced" ];
     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 "produced" ];
     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 "produced" ];
     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 "produced" ];
     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 "produced" ];
     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 "produced" ];
     fhir:StructureMap.structure.alias [ fhir:value "Dosage" ]
  ], [
     fhir:index 20;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Observation";
       fhir:link <http://hl7.org/fhir/StructureDefinition/Observation>     ];
     fhir:StructureMap.structure.mode [ fhir:value "produced" ];
     fhir:StructureMap.structure.alias [ fhir:value "Observation" ]
  ];
  fhir:StructureMap.import [
     fhir:value "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToFhirTypes";
     fhir:index 0;
     fhir:link <http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToFhirTypes>
  ], [
     fhir:value "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToBundle";
     fhir:index 1;
     fhir:link <http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToBundle>
  ], [
     fhir:value "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaChToBundle";
     fhir:index 2;
     fhir:link <http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaChToBundle>
  ];
  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: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.2 target: Annotation note (e.g. http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "section" ];
       fhir:StructureMap.group.input.type [ fhir:value "Section" ];
       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 "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "note" ];
       fhir:StructureMap.group.input.type [ fhir:value "Annotation" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.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 "act" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "level3" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "data" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "data" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
           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 "data" ]           ]         ]       ], [
         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 "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "reference" ]         ];
         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 "reference" ];
             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 "note" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "NarrativeLink" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "value";
               fhir:index 0             ], [
               fhir:value "ext";
               fhir:index 1             ]           ]         ]       ]     ]
  ], [
     fhir:index 1;
     fhir:StructureMap.group.name [ fhir:value "ManufacturedMaterialEntryContentModuleDispense" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.33 target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "Supply" ];
       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 "target" ]     ], [
       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 "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "medication" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
         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 "med" ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "vt" ];
         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 "Reference" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "vt" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         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 "#med" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "quantity" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         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 "medicationDispense" ];
         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 "medDispQuantity" ]       ];
       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 "medDispQuantity" ];
           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 "IHE-DIS: If the product-element contains package information, the unit attribute is not be present" ]       ], [
         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.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "unit" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "medDispQuantity" ];
             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 "ucum" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "unit" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "medDispQuantity" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
             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 "http://unitsofmeasure.org" ]             ]           ]         ], [
           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 "unit" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "medDispQuantity" ];
             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 "unit" ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "IHE-DIS: 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:StructureMap.group.rule.documentation [ fhir:value "quantity value (number of packages)" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "product" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "product" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "product" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "product" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "manufacturedProduct" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedProduct" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "manufacturedMaterial" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "manufacturedMaterial" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "medication.code" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "name" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "name" ];
               fhir:StructureMap.group.rule.source.condition [ fhir:value "asContent.exists() = false" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
               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 "fhircode" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "fhircode" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%manufacturedMaterial.name.other" ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "asContent" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "asContent" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "asContent" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "containerPackagedMedicine" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "asContent" ];
                 fhir:StructureMap.group.rule.source.element [ fhir:value "containerPackagedMedicine" ];
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "containerPackagedMedicine" ]               ];
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.name [ fhir:value "medication.code" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   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 "medication" ];
                   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 "fhircode" ];
                   fhir:StructureMap.group.rule.target.listMode [
                     fhir:value "share";
                     fhir:index 0                   ];
                   fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "medcode" ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "code";
                     fhir:index 0                   ], [
                     fhir:value "fhircode";
                     fhir:index 1                   ]                 ]               ], [
                 fhir:index 1;
                 fhir:StructureMap.group.rule.name [ fhir:value "code.text" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "name" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "name" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   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 "fhircode" ];
                   fhir:StructureMap.group.rule.target.listMode [
                     fhir:value "share";
                     fhir:index 0                   ];
                   fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "medcode" ]                 ];
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.name [ fhir:value "medication.code.text" ];
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "name" ]                   ];
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "fhircode" ];
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                     fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%name.other" ]                     ]                   ]                 ]               ], [
                 fhir:index 2;
                 fhir:StructureMap.group.rule.name [ fhir:value "medication.formCode" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "formCode" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "formCode" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "form" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "form" ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "formCode";
                     fhir:index 0                   ], [
                     fhir:value "form";
                     fhir:index 1                   ]                 ]               ], [
                 fhir:index 3;
                 fhir:StructureMap.group.rule.name [ fhir:value "capacityQuantity" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "capacityQuantity" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "capacityQuantity" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "amount" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "ratio" ];
                   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 "Ratio" ]                   ]                 ], [
                   fhir:index 1;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ratio" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "denominator" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "denominator" ];
                   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 "Quantity" ]                   ]                 ], [
                   fhir:index 2;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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 "1" ]                   ]                 ], [
                   fhir:index 3;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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.valueString [ fhir:value "Package" ]                   ]                 ], [
                   fhir:index 4;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
                   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 "http://unitsofmeasure.org" ]                   ]                 ], [
                   fhir:index 5;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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 "{Package}" ]                   ]                 ], [
                   fhir:index 6;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ratio" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "numerator" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "quantity" ];
                   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 "Quantity" ]                   ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "EmedPQQuantity" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "capacityQuantity";
                     fhir:index 0                   ], [
                     fhir:value "quantity";
                     fhir:index 1                   ]                 ];
                 fhir:StructureMap.group.rule.documentation [ fhir:value "Package size" ]               ]             ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.name [ fhir:value "ingredient" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               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 "medication" ];
               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 "ing" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               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 "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 "ing" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "strength" ];
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "strength" ];
                 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 "Ratio" ]                 ]               ];
               fhir:StructureMap.group.rule.dependent [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.dependent.name [ fhir:value "EmedRTOPQPQRatio" ];
                 fhir:StructureMap.group.rule.dependent.variable [
                   fhir:value "quantity";
                   fhir:index 0                 ], [
                   fhir:value "strength";
                   fhir:index 1                 ]               ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.name [ fhir:value "ingredient.ingredient" ];
               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 "ingredient" ];
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "medingredient" ]               ];
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.name [ fhir:value "ingredientCode" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "medingredient" ];
                   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 "ing" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "item" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "ingcode" ];
                   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 "CodeableConcept" ]                   ]                 ], [
                   fhir:index 1;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ingcode" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%medingredient.name.other" ]                   ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "code";
                     fhir:index 0                   ], [
                     fhir:value "ingcode";
                     fhir:index 1                   ]                 ]               ]             ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ]         ];
         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 "entry" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "substanceAdministration" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "dosage" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "substanceAdministration" ];
               fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.entryRelationship.sequenceNumber.exists() = false" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "dosageInstruction" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsStartStopFrequency" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "substanceAdministration";
                 fhir:index 0               ], [
                 fhir:value "dosage";
                 fhir:index 1               ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for normal dosing, as no sequences are present there" ]       ]     ]
  ], [
     fhir:index 2;
     fhir:StructureMap.group.name [ fhir:value "EmedPQQuantity" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "PQ" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "tgt" ];
       fhir:StructureMap.group.input.type [ fhir:value "Quantity" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.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 "src" ];
         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 "tgt" ];
         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 "src" ];
         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 "tgt" ];
         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 "unit" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         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 "tgt" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "'http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.where(concept.where(code = %unit)).system" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         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 "tgt" ];
         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 "evaluate" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "'http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.concept.where(code = %unit).display" ]         ]       ]     ]
  ], [
     fhir:index 3;
     fhir:StructureMap.group.name [ fhir:value "EmedRTOPQPQRatio" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "RTO_PQ_PQ" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "tgt" ];
       fhir:StructureMap.group.input.type [ fhir:value "Ratio" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.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 "src" ];
         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 "tgt" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "numerator" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "targetNumerator" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "EmedPQQuantity" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "numerator";
           fhir:index 0         ], [
           fhir:value "targetNumerator";
           fhir:index 1         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "denominator" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "denominator" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "denominator" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "tgt" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "denominator" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "targetDenominator" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "EmedPQQuantity" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "denominator";
           fhir:index 0         ], [
           fhir:value "targetDenominator";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 4;
     fhir:StructureMap.group.name [ fhir:value "ManufacturedMaterialEntryContentModuleStatement" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.33 target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       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 "target" ]     ], [
       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 "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "medication" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
         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 "med" ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "vt" ];
         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 "Reference" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "vt" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         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 "#med" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "consumable" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "consumable" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "consumable" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "manufacturedProduct" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedProduct" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "manufacturedMaterial" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "manufacturedMaterial" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "medication.code" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "name" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "name" ];
               fhir:StructureMap.group.rule.source.condition [ fhir:value "asContent.exists() = false" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
               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 "fhircode" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "fhircode" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%manufacturedMaterial.name.other" ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "asContent" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "asContent" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "asContent" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "containerPackagedMedicine" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "asContent" ];
                 fhir:StructureMap.group.rule.source.element [ fhir:value "containerPackagedMedicine" ];
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "containerPackagedMedicine" ]               ];
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.name [ fhir:value "medication.code" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   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 "medication" ];
                   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 "fhircode" ];
                   fhir:StructureMap.group.rule.target.listMode [
                     fhir:value "share";
                     fhir:index 0                   ];
                   fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "medcode" ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "code";
                     fhir:index 0                   ], [
                     fhir:value "fhircode";
                     fhir:index 1                   ]                 ]               ], [
                 fhir:index 1;
                 fhir:StructureMap.group.rule.name [ fhir:value "code.text" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "name" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "name" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   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 "fhircode" ];
                   fhir:StructureMap.group.rule.target.listMode [
                     fhir:value "share";
                     fhir:index 0                   ];
                   fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "medcode" ]                 ];
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.name [ fhir:value "medication.code.text" ];
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "name" ]                   ];
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "fhircode" ];
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                     fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%name.other" ]                     ]                   ]                 ]               ], [
                 fhir:index 2;
                 fhir:StructureMap.group.rule.name [ fhir:value "medication.formCode" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "formCode" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "formCode" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "form" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "form" ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "formCode";
                     fhir:index 0                   ], [
                     fhir:value "form";
                     fhir:index 1                   ]                 ]               ], [
                 fhir:index 3;
                 fhir:StructureMap.group.rule.name [ fhir:value "capacityQuantity" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "capacityQuantity" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "capacityQuantity" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "amount" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "ratio" ];
                   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 "Ratio" ]                   ]                 ], [
                   fhir:index 1;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ratio" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "denominator" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "denominator" ];
                   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 "Quantity" ]                   ]                 ], [
                   fhir:index 2;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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 "1" ]                   ]                 ], [
                   fhir:index 3;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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.valueString [ fhir:value "Package" ]                   ]                 ], [
                   fhir:index 4;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
                   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 "http://unitsofmeasure.org" ]                   ]                 ], [
                   fhir:index 5;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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 "{Package}" ]                   ]                 ], [
                   fhir:index 6;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ratio" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "numerator" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "quantity" ];
                   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 "Quantity" ]                   ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "EmedPQQuantity" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "capacityQuantity";
                     fhir:index 0                   ], [
                     fhir:value "quantity";
                     fhir:index 1                   ]                 ];
                 fhir:StructureMap.group.rule.documentation [ fhir:value "Package size" ]               ]             ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.name [ fhir:value "ingredient" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               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 "medication" ];
               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 "ing" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               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 "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 "ing" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "strength" ];
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "strength" ];
                 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 "Ratio" ]                 ]               ];
               fhir:StructureMap.group.rule.dependent [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.dependent.name [ fhir:value "EmedRTOPQPQRatio" ];
                 fhir:StructureMap.group.rule.dependent.variable [
                   fhir:value "quantity";
                   fhir:index 0                 ], [
                   fhir:value "strength";
                   fhir:index 1                 ]               ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.name [ fhir:value "ingredient.ingredient" ];
               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 "ingredient" ];
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "medingredient" ]               ];
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.name [ fhir:value "ingredientCode" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "medingredient" ];
                   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 "ing" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "item" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "ingcode" ];
                   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 "CodeableConcept" ]                   ]                 ], [
                   fhir:index 1;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ingcode" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%medingredient.name.other" ]                   ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "code";
                     fhir:index 0                   ], [
                     fhir:value "ingcode";
                     fhir:index 1                   ]                 ]               ]             ]           ]         ]       ], [
         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 "src" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.entryRelationship.sequenceNumber.exists() = false" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsStartStopFrequency" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "src";
             fhir:index 0           ], [
             fhir:value "dosage";
             fhir:index 1           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for normal dosing, as no sequences are present there" ]       ]     ]
  ], [
     fhir:index 5;
     fhir:StructureMap.group.name [ fhir:value "MedicationTreatmentPlanItemEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.34 target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationstatement.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "section" ];
       fhir:StructureMap.group.input.type [ fhir:value "Section" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ];
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.input.name [ fhir:value "medicationStatement" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationStatement" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "vvv" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "identifier" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "vvv" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "src.templateId as template then TemplateID(template, medicationStatement) \"templateId\";" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "patient" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "patient" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ];
         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 "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 "reference" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "'urn:uuid:' + %patient.id" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "completed" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "status" ];
         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 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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]       ];
       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 "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "reference" ]         ];
         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 "reference" ];
             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 "medicationStatement" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "NarrativeLink" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "value";
               fhir:index 0             ], [
               fhir:value "ext";
               fhir:index 1             ]           ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "medication" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "contained" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "medication" ];
         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 "Medication" ]         ]       ];
       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 "src";
           fhir:index 0         ], [
           fhir:value "medicationStatement";
           fhir:index 1         ], [
           fhir:value "medication";
           fhir:index 2         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.41" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "typeCode = 'RSON'" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "reasonCode" ];
         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 "observation" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "observation" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reasonCode" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reasonCode" ]         ];
         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 "section";
             fhir:index 0           ], [
             fhir:value "observation";
             fhir:index 1           ], [
             fhir:value "reasonCode";
             fhir:index 2           ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.52" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and (substanceAdministration.templateId.root = '2.16.756.5.30.1.1.10.4.52'))" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]       ];
       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 "section";
           fhir:index 0         ], [
           fhir:value "entry";
           fhir:index 1         ], [
           fhir:value "dosage";
           fhir:index 2         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.36" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and (sequenceNumber.value >= 0))" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryDosageChange" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "src";
           fhir:index 0         ], [
           fhir:value "entry";
           fhir:index 1         ], [
           fhir:value "dosage";
           fhir:index 2         ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "MTPReferenceEntry" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.10').exists())" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]       ];
       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 "entry";
           fhir:index 0         ], [
           fhir:value "ext";
           fhir:index 1         ]       ]     ], [
       fhir:index 9;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.2" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and act.templateId.where(root = '2.16.756.5.30.1.1.10.4.2').exists())" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "annotation" ];
         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 "act" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "act" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "note" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "note" ]         ];
         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 "section";
             fhir:index 0           ], [
             fhir:value "act";
             fhir:index 1           ], [
             fhir:value "note";
             fhir:index 2           ]         ]       ]     ], [
       fhir:index 10;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-1.3.6.1.4.1.19376.1.9.1.3.9.1" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and act.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.9.1').exists())" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "substitution" ];
         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 "act" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "act" ]         ];
         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 "medicationStatement" ];
           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 "medicationStatement" ]           ]         ];
         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 "act";
             fhir:index 0           ], [
             fhir:value "medicationStatement";
             fhir:index 1           ]         ]       ]     ]
  ], [
     fhir:index 6;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsEntryDosageChange" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.36 target: http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-structured-split dosage for split dosing, with sequences" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "entry" ];
       fhir:StructureMap.group.input.type [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "sequenceNumber" ];
       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 "sequenceNumber" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "sequenceNumber" ]       ];
       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 "sequenceNumber" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "val" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "sequence" ];
           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 "val" ]           ]         ]       ]     ], [
       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 "src" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "src" ]       ];
       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 "dosage" ];
         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 "dosage" ]         ]       ];
       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 "src";
           fhir:index 0         ], [
           fhir:value "dosage";
           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 "entry" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "src" ]       ];
       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 "dosage" ];
         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 "dosage" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeWhen" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "src";
           fhir:index 0         ], [
           fhir:value "dosage";
           fhir:index 1         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "routeCode" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "routeCode" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "routeCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "route" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "route" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "routeCode";
           fhir:index 0         ], [
           fhir:value "route";
           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 "entry" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "src" ]       ];
       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 "dosage" ];
         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 "dosage" ]         ]       ];
       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 "src";
           fhir:index 0         ], [
           fhir:value "dosage";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 7;
     fhir:StructureMap.group.name [ fhir:value "EffectiveTimeStartEnd" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "effective time start & end for dosage" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTime-IVL-TS" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.type [ fhir:value "IVL_TS" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "effectiveTime" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "effectiveTime" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.target.listMode [
           fhir:value "share";
           fhir:index 0         ];
         fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "sharetiming" ]       ];
       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 "effectiveTime" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "timing" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "repeat" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "repeat" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "period" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "effectiveTime" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "repeat" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "bounds" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "period" ];
             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 "Period" ]             ]           ];
           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 "effectiveTime" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "low" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "low" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "lowDate" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "low" ];
                 fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "lowDate" ]               ];
               fhir:StructureMap.group.rule.target [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "period" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "start" ];
                 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 "lowDate" ]                 ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "high" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "effectiveTime" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "high" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "high" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "highDate" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "high" ];
                 fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "highDate" ]               ];
               fhir:StructureMap.group.rule.target [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "period" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "end" ];
                 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 "highDate" ]                 ]               ]             ]           ]         ]       ]     ]
  ], [
     fhir:index 8;
     fhir:StructureMap.group.name [ fhir:value "EffectiveTimeWhen" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "effective time when for dosage" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTime-EIVL-TS" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.type [ fhir:value "EIVL_TS" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "effectiveTime" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "effectiveTime" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.target.listMode [
           fhir:value "share";
           fhir:index 0         ];
         fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "sharetiming" ]       ];
       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 "effectiveTime" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "timing" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "repeat" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "repeat" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "event" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "effectiveTime" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "event" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "event" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "code" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "event" ];
               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 "repeat" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "when" ];
               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 1;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTime-SXPR-TS" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.type [ fhir:value "SXPR_TS" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "effectiveTime" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "effectiveTime" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "timing" ];
         fhir:StructureMap.group.rule.target.listMode [
           fhir:value "share";
           fhir:index 0         ];
         fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "sharetiming" ]       ];
       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 "effectiveTime" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "timing" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "repeat" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "repeat" ]         ];
         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 "effectiveTime" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "comp" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "comp" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "event" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "comp" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "event" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "event" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "code" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "event" ];
                 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 "repeat" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "when" ];
                 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 9;
     fhir:StructureMap.group.name [ fhir:value "TreatmentReasonEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.41 target: reasonCode Coding (e.g. http://build.fhir.org/ig/hl7ch/ig/ch-emed/StructureDefinition/ch-emed-medicationstatement)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "section" ];
       fhir:StructureMap.group.input.type [ fhir:value "Section" ];
       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 "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "reasonCode" ];
       fhir:StructureMap.group.input.type [ fhir:value "Coding" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.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 "observation" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "level3" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "data" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "data" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "reasonCode" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
           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 "data" ]           ]         ]       ], [
         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 "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "reference" ]         ];
         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 "reference" ];
             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 "reasonCode" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "NarrativeLink" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "value";
               fhir:index 0             ], [
               fhir:value "ext";
               fhir:index 1             ]           ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "extraxt text (Bluthochdruck) from id #mtpc.1.reason in section text <td ID=\"mtpc.1.reason\">Bluthochdruck</td>" ]     ]
  ], [
     fhir:index 10;
     fhir:StructureMap.group.name [ fhir:value "MTPReferenceEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--ch-pharm-?section=templates&id=2.16.756.5.30.1.1.10.4.45 target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-ext-treatmentplan.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "entryrelationship" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "ext" ];
       fhir:StructureMap.group.input.type [ fhir:value "Extension" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "url" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "entryrelationship" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "url" ];
         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 "http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-treatmentplan" ]         ]       ]     ], [
       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 "entryrelationship" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "substanceAdministration" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "substanceAdministration" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "innerExtensionId" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "id" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "id" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "InnerExtensionId" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "id";
             fhir:index 0           ], [
             fhir:value "ext";
             fhir:index 1           ]         ]       ], [
         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 "substanceAdministration" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "reference" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "externalDocument" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "externalDocument" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "externalDocument" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "innerExtensionExternalDocumentId" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "externalDocument" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "id" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "id" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "InnerExtensionExternalDocumentId" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "id";
                 fhir:index 0               ], [
                 fhir:value "ext";
                 fhir:index 1               ]             ]           ]         ]       ]     ]
  ], [
     fhir:index 11;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsNonStructuredEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--ch-pharm-?section=templates&id=2.16.756.5.30.1.1.10.4.52 target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-dosage-nonstructured.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "section" ];
       fhir:StructureMap.group.input.type [ fhir:value "Section" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "entry" ];
       fhir:StructureMap.group.input.type [ fhir:value "Element" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "observation" ];
       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 "substanceAdministration" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "observation" ]       ];
       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 "observation" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "level3" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "text" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "data" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "data" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
             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 "data" ]             ]           ]         ], [
           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 "text" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "reference" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "reference" ]           ];
           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 "reference" ];
               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 "dosage" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]             ];
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "NarrativeLink" ];
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "value";
                 fhir:index 0               ], [
                 fhir:value "ext";
                 fhir:index 1               ]             ]           ]         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "see MedicationTreatmentPlanItemEntryContentModule" ]     ]
  ], [
     fhir:index 12;
     fhir:StructureMap.group.name [ fhir:value "SubstitutionDispense" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: Substitution act Contains 1.3.6.1.4.1.19376.1.9.1.3.9.2 IHE Substitution Act Content Module target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationdispense.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "act" ];
       fhir:StructureMap.group.input.type [ fhir:value "Act" ];
       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 "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "substitution" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substitution" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "wasSubstituted" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "act" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substitution" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "wasSubstituted" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "wasSubstituted" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "wasSubstituted" ];
           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 "true" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "allowedCC" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "act" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "actCode" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substitution" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "type" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "type" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "type" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "system" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "actCode" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "systemCC" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "systemCC" ];
             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 "http://terminology.hl7.org/CodeSystem/v3-substanceAdminSubstitution" ]             ]           ]         ], [
           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 "actCode" ];
             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 "coding" ];
             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 "codeCC" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "codeCC" ];
             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 "code" ]             ]           ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.name [ fhir:value "display" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "actCode" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "displayName" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "display" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "display" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "displayCC" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "displayCC" ];
             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 "display" ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "act.code as code -> substitution.type as type then CECodeableConcept(code, type) \"type\";" ]       ]     ]
  ], [
     fhir:index 13;
     fhir:StructureMap.group.name [ fhir:value "DispenseItemEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.42 target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationdispense.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "section" ];
       fhir:StructureMap.group.input.type [ fhir:value "Section" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "Supply" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ];
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.input.name [ fhir:value "medicationDispense" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationDispense" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "vvv" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "identifier" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "vvv" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "src.templateId as template then TemplateID(template, medicationDispense) \"templateId\";" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "patient" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "patient" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ];
         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 "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 "reference" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "'urn:uuid:' + %patient.id" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "completed" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "status" ];
         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 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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]       ];
       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 "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "reference" ]         ];
         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 "reference" ];
             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 "medicationDispense" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "NarrativeLink" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "value";
               fhir:index 0             ], [
               fhir:value "ext";
               fhir:index 1             ]           ]         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "medication" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "contained" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "medication" ];
         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 "Medication" ]         ]       ];
       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 "src";
           fhir:index 0         ], [
           fhir:value "medicationDispense";
           fhir:index 1         ], [
           fhir:value "medication";
           fhir:index 2         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.52" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and (substanceAdministration.templateId.root = '2.16.756.5.30.1.1.10.4.52'))" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]       ];
       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 "section";
           fhir:index 0         ], [
           fhir:value "entry";
           fhir:index 1         ], [
           fhir:value "dosage";
           fhir:index 2         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationship" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.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 "entryRelationship" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "substanceAdministration" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.36" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "substanceAdministration" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "entryRelationship" ];
             fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and (sequenceNumber.value >= 0))" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "dosageInstruction" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryDosageChange" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "substanceAdministration";
               fhir:index 0             ], [
               fhir:value "entryRelationship";
               fhir:index 1             ], [
               fhir:value "dosage";
               fhir:index 2             ]           ];
           fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for split dosing, as sequences are present there" ]         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "MTPReferenceEntry" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.10').exists())" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]       ];
       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 "entry";
           fhir:index 0         ], [
           fhir:value "ext";
           fhir:index 1         ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.2" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and act.templateId.where(root = '2.16.756.5.30.1.1.10.4.2').exists())" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "annotation" ];
         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 "act" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "act" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "medicationDispense" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "note" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "note" ]         ];
         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 "section";
             fhir:index 0           ], [
             fhir:value "act";
             fhir:index 1           ], [
             fhir:value "note";
             fhir:index 2           ]         ]       ]     ], [
       fhir:index 9;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-1.3.6.1.4.1.19376.1.9.1.3.9.2" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and act.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.9.2').exists())" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "substitution" ];
         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 "act" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "act" ]         ];
         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 "medicationDispense" ];
           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 "medicationDispense" ]           ]         ];
         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 "act";
             fhir:index 0           ], [
             fhir:value "medicationDispense";
             fhir:index 1           ]         ]       ]     ]
  ], [
     fhir:index 14;
     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)" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "substanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "doseQuantity" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "doseQuantity" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "doseAndRate" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "doseAndRate" ]       ];
       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 "doseQuantity" ];
           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 "doseAndRate" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "dose" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "quantity" ];
           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 "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 "value" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "quantity" ];
             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 "doseQuantity" ];
             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 "quantity" ];
             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 "unit" ]             ]           ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "doseQuantity" ];
             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 "quantity" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
             fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "'http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.where(concept.where(code = %unit)).system" ]             ]           ]         ], [
           fhir:index 3;
           fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "doseQuantity" ];
             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 "quantity" ];
             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 "evaluate" ];
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "'http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.concept.where(code = %unit).display" ]             ]           ]         ]       ]     ]
  ], [
     fhir:index 15;
     fhir:StructureMap.group.name [ fhir:value "SubstitutionRequest" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: Substitution permission Contains 1.3.6.1.4.1.19376.1.9.1.3.9.1 IHE Substitution Permission Content Module (DYNAMIC) target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationrequest.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "act" ];
       fhir:StructureMap.group.input.type [ fhir:value "Act" ];
       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 "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "substitutionRequest" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "substitution" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "substitution" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "allowedCC" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "act" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "actCode" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "substitution" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "allowed" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "allowedCC" ];
           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 "CodeableConcept" ]           ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.context [ fhir:value "allowedCC" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "coding" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "system" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "actCode" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "systemCC" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "systemCC" ];
             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 "http://terminology.hl7.org/CodeSystem/v3-substanceAdminSubstitution" ]             ]           ]         ], [
           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 "actCode" ];
             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 "coding" ];
             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 "codeCC" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "codeCC" ];
             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 "code" ]             ]           ]         ], [
           fhir:index 2;
           fhir:StructureMap.group.rule.name [ fhir:value "display" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "actCode" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "displayName" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "display" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "display" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "displayCC" ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "displayCC" ];
             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 "display" ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "act.code as code -> substitution.allowed = create('CodeableConcept') as allowedCC then CECodeableConcept(code, allowedCC) \"allowedCC\";" ]       ]     ]
  ], [
     fhir:index 16;
     fhir:StructureMap.group.name [ fhir:value "SubstitutionStatement" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: Substitution permission Contains 1.3.6.1.4.1.19376.1.9.1.3.9.1 IHE Substitution Permission Content Module (DYNAMIC) target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationstatement.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "act" ];
       fhir:StructureMap.group.input.type [ fhir:value "Act" ];
       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 "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "substitutionStatement" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "act" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationStatement" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "substitutionExtension" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "act" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "url" ];
           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 "http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-substitution" ]           ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "valueCC" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "act" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "actCode" ]           ];
           fhir:StructureMap.group.rule.target [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "valueCC" ];
             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 "CodeableConcept" ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.target.context [ fhir:value "valueCC" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "coding" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "system" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "actCode" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "systemCC" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "systemCC" ];
               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 "http://terminology.hl7.org/CodeSystem/v3-substanceAdminSubstitution" ]               ]             ]           ], [
             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 "actCode" ];
               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 "coding" ];
               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 "codeCC" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "codeCC" ];
               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 "code" ]               ]             ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.name [ fhir:value "display" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "actCode" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "displayName" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "display" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "display" ];
               fhir:StructureMap.group.rule.target.variable [ fhir:value "displayCC" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "displayCC" ];
               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 "display" ]               ]             ]           ];
           fhir:StructureMap.group.rule.documentation [ fhir:value "act.code as code -> ext.value = create('CodeableConcept') as valueCC then CECodeableConcept(code, valueCC) \"valueCC\";" ]         ]       ]     ]
  ], [
     fhir:index 17;
     fhir:StructureMap.group.name [ fhir:value "PrescribedQuantity" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "Number of packages source: https://art-decor.org/art-decor/decor-templates--cdachemed-?id=2.16.756.5.30.1.1.10.4.38 target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-medicationrequest.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "supply" ];
       fhir:StructureMap.group.input.type [ fhir:value "Supply" ];
       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 "target" ]     ];
     fhir:StructureMap.group.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 "supply" ];
         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 "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "dispenseRequest" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "dispenseRequest" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "dispenseRequest" ];
         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 "IHE-PRE: If the product-element contains package information, the unit attribute is not be present" ]       ], [
         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.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "unit" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ 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:index 1;
           fhir:StructureMap.group.rule.name [ fhir:value "ucum" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ 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 "system" ];
             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 "http://unitsofmeasure.org" ]             ]           ]         ], [
           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 "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 "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 "unit" ]             ]           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "IHE-PRE: 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 18;
     fhir:StructureMap.group.name [ fhir:value "ManufacturedMaterialEntryContentModuleRequest" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.33 target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationrequest.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       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 "target" ]     ], [
       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 "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "medication" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ];
         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 "med" ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "medication" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "vt" ];
         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 "Reference" ]         ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "vt" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ];
         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 "#med" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "consumable" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "consumable" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "consumable" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "manufacturedProduct" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "consumable" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "manufacturedProduct" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "manufacturedProduct" ]         ];
         fhir:StructureMap.group.rule.rule [
           fhir:index 0;
           fhir:StructureMap.group.rule.name [ fhir:value "manufacturedMaterial" ];
           fhir:StructureMap.group.rule.source [
             fhir:index 0;
             fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedProduct" ];
             fhir:StructureMap.group.rule.source.element [ fhir:value "manufacturedMaterial" ];
             fhir:StructureMap.group.rule.source.variable [ fhir:value "manufacturedMaterial" ]           ];
           fhir:StructureMap.group.rule.rule [
             fhir:index 0;
             fhir:StructureMap.group.rule.name [ fhir:value "medication.code" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "name" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "name" ];
               fhir:StructureMap.group.rule.source.condition [ fhir:value "asContent.exists() = false" ]             ];
             fhir:StructureMap.group.rule.target [
               fhir:index 0;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
               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 "fhircode" ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.target.context [ fhir:value "fhircode" ];
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
               fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%manufacturedMaterial.name.other" ]               ]             ]           ], [
             fhir:index 1;
             fhir:StructureMap.group.rule.name [ fhir:value "asContent" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               fhir:StructureMap.group.rule.source.element [ fhir:value "asContent" ];
               fhir:StructureMap.group.rule.source.variable [ fhir:value "asContent" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               fhir:StructureMap.group.rule.name [ fhir:value "containerPackagedMedicine" ];
               fhir:StructureMap.group.rule.source [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "asContent" ];
                 fhir:StructureMap.group.rule.source.element [ fhir:value "containerPackagedMedicine" ];
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "containerPackagedMedicine" ]               ];
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.name [ fhir:value "medication.code" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   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 "medication" ];
                   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 "fhircode" ];
                   fhir:StructureMap.group.rule.target.listMode [
                     fhir:value "share";
                     fhir:index 0                   ];
                   fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "medcode" ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "code";
                     fhir:index 0                   ], [
                     fhir:value "fhircode";
                     fhir:index 1                   ]                 ]               ], [
                 fhir:index 1;
                 fhir:StructureMap.group.rule.name [ fhir:value "code.text" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "name" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "name" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   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 "fhircode" ];
                   fhir:StructureMap.group.rule.target.listMode [
                     fhir:value "share";
                     fhir:index 0                   ];
                   fhir:StructureMap.group.rule.target.listRuleId [ fhir:value "medcode" ]                 ];
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.name [ fhir:value "medication.code.text" ];
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "name" ]                   ];
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "fhircode" ];
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                     fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%name.other" ]                     ]                   ]                 ]               ], [
                 fhir:index 2;
                 fhir:StructureMap.group.rule.name [ fhir:value "medication.formCode" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "formCode" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "formCode" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "form" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "form" ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "formCode";
                     fhir:index 0                   ], [
                     fhir:value "form";
                     fhir:index 1                   ]                 ]               ], [
                 fhir:index 3;
                 fhir:StructureMap.group.rule.name [ fhir:value "capacityQuantity" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "containerPackagedMedicine" ];
                   fhir:StructureMap.group.rule.source.element [ fhir:value "capacityQuantity" ];
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "capacityQuantity" ]                 ];
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medication" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "amount" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "ratio" ];
                   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 "Ratio" ]                   ]                 ], [
                   fhir:index 1;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ratio" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "denominator" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "denominator" ];
                   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 "Quantity" ]                   ]                 ], [
                   fhir:index 2;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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 "1" ]                   ]                 ], [
                   fhir:index 3;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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.valueString [ fhir:value "Package" ]                   ]                 ], [
                   fhir:index 4;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "system" ];
                   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 "http://unitsofmeasure.org" ]                   ]                 ], [
                   fhir:index 5;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "denominator" ];
                   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 "{Package}" ]                   ]                 ], [
                   fhir:index 6;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ratio" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "numerator" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "quantity" ];
                   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 "Quantity" ]                   ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "EmedPQQuantity" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "capacityQuantity";
                     fhir:index 0                   ], [
                     fhir:value "quantity";
                     fhir:index 1                   ]                 ];
                 fhir:StructureMap.group.rule.documentation [ fhir:value "Package size" ]               ]             ]           ], [
             fhir:index 2;
             fhir:StructureMap.group.rule.name [ fhir:value "ingredient" ];
             fhir:StructureMap.group.rule.source [
               fhir:index 0;
               fhir:StructureMap.group.rule.source.context [ fhir:value "manufacturedMaterial" ];
               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 "medication" ];
               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 "ing" ]             ];
             fhir:StructureMap.group.rule.rule [
               fhir:index 0;
               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 "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 "ing" ];
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                 fhir:StructureMap.group.rule.target.element [ fhir:value "strength" ];
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "strength" ];
                 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 "Ratio" ]                 ]               ];
               fhir:StructureMap.group.rule.dependent [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.dependent.name [ fhir:value "EmedRTOPQPQRatio" ];
                 fhir:StructureMap.group.rule.dependent.variable [
                   fhir:value "quantity";
                   fhir:index 0                 ], [
                   fhir:value "strength";
                   fhir:index 1                 ]               ]             ], [
               fhir:index 1;
               fhir:StructureMap.group.rule.name [ fhir:value "ingredient.ingredient" ];
               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 "ingredient" ];
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "medingredient" ]               ];
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0;
                 fhir:StructureMap.group.rule.name [ fhir:value "ingredientCode" ];
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "medingredient" ];
                   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 "ing" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "item" ];
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "ingcode" ];
                   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 "CodeableConcept" ]                   ]                 ], [
                   fhir:index 1;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ingcode" ];
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
                   fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%medingredient.name.other" ]                   ]                 ];
                 fhir:StructureMap.group.rule.dependent [
                   fhir:index 0;
                   fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
                   fhir:StructureMap.group.rule.dependent.variable [
                     fhir:value "code";
                     fhir:index 0                   ], [
                     fhir:value "ingcode";
                     fhir:index 1                   ]                 ]               ]             ]           ]         ]       ], [
         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 "src" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "$this.entryRelationship.sequenceNumber.exists() = false" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "dosageInstruction" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]         ];
         fhir:StructureMap.group.rule.dependent [
           fhir:index 0;
           fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsStartStopFrequency" ];
           fhir:StructureMap.group.rule.dependent.variable [
             fhir:value "src";
             fhir:index 0           ], [
             fhir:value "dosage";
             fhir:index 1           ]         ];
         fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for normal dosing, as no sequences are present there" ]       ]     ]
  ], [
     fhir:index 19;
     fhir:StructureMap.group.name [ fhir:value "PrescriptionItemEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.43 target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-medicationrequest.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "section" ];
       fhir:StructureMap.group.input.type [ fhir:value "Section" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ];
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.input.name [ fhir:value "medicationRequest" ];
       fhir:StructureMap.group.input.type [ fhir:value "MedicationRequest" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "vvv" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "identifier" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "vvv" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "patient" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "patient" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ];
         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 "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 "reference" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "'urn:uuid:' + %patient.id" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "completed" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "status" ];
         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 3;
       fhir:StructureMap.group.rule.name [ fhir:value "order" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "intent" ];
         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 "order" ]         ]       ]     ], [
       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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "text" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "text" ]       ];
       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 "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "reference" ]         ];
         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 "reference" ];
             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 "medicationRequest" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "NarrativeLink" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "value";
               fhir:index 0             ], [
               fhir:value "ext";
               fhir:index 1             ]           ]         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "medication" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "contained" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "medication" ];
         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 "Medication" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "ManufacturedMaterialEntryContentModuleRequest" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "src";
           fhir:index 0         ], [
           fhir:value "medicationRequest";
           fhir:index 1         ], [
           fhir:value "medication";
           fhir:index 2         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.41" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "typeCode = 'RSON'" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "reasonCode" ];
         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 "observation" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "observation" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "reasonCode" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "reasonCode" ]         ];
         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 "section";
             fhir:index 0           ], [
             fhir:value "observation";
             fhir:index 1           ], [
             fhir:value "reasonCode";
             fhir:index 2           ]         ]       ]     ], [
       fhir:index 7;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.52" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and (substanceAdministration.templateId.root = '2.16.756.5.30.1.1.10.4.52'))" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]       ];
       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 "section";
           fhir:index 0         ], [
           fhir:value "entry";
           fhir:index 1         ], [
           fhir:value "dosage";
           fhir:index 2         ]       ]     ], [
       fhir:index 8;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.36" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and (sequenceNumber.value >= 0))" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "dosageInstruction" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "DosageInstructionsEntryDosageChange" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "src";
           fhir:index 0         ], [
           fhir:value "entry";
           fhir:index 1         ], [
           fhir:value "dosage";
           fhir:index 2         ]       ];
       fhir:StructureMap.group.rule.documentation [ fhir:value "dosage for split dosing, as sequences are present there" ]     ], [
       fhir:index 9;
       fhir:StructureMap.group.rule.name [ fhir:value "MTPReferenceEntry" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.10').exists())" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]       ];
       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 "entry";
           fhir:index 0         ], [
           fhir:value "ext";
           fhir:index 1         ]       ]     ], [
       fhir:index 10;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-2.16.756.5.30.1.1.10.4.2" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and act.templateId.where(root = '2.16.756.5.30.1.1.10.4.2').exists())" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "annotation" ];
         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 "act" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "act" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "note" ];
           fhir:StructureMap.group.rule.target.variable [ fhir:value "note" ]         ];
         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 "section";
             fhir:index 0           ], [
             fhir:value "act";
             fhir:index 1           ], [
             fhir:value "note";
             fhir:index 2           ]         ]       ]     ], [
       fhir:index 11;
       fhir:StructureMap.group.rule.name [ fhir:value "repeats" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "repeatNumber" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "repeatNumber" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "medicationRequest" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "dispenseRequest" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "dispenseRequest" ]       ];
       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 "repeatNumber" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "value" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "val" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "dispenseRequest" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "numberOfRepeatsAllowed" ];
           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 "val" ]           ]         ]       ]     ], [
       fhir:index 12;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-1.3.6.1.4.1.19376.1.9.1.3.8" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and supply.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.8').exists())" ]       ];
       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 "entry" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "supply" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "supply" ]         ];
         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 "medicationRequest" ];
           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 "medicationRequest" ]           ]         ];
         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 "supply";
             fhir:index 0           ], [
             fhir:value "medicationRequest";
             fhir:index 1           ]         ]       ]     ], [
       fhir:index 13;
       fhir:StructureMap.group.rule.name [ fhir:value "entryRelationShip-1.3.6.1.4.1.19376.1.9.1.3.9.1" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'COMP') and act.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.9.1').exists())" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "substitution" ];
         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 "act" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "act" ]         ];
         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 "medicationRequest" ];
           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 "medicationRequest" ]           ]         ];
         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 "act";
             fhir:index 0           ], [
             fhir:value "medicationRequest";
             fhir:index 1           ]         ]       ]     ]
  ], [
     fhir:index 20;
     fhir:StructureMap.group.name [ fhir:value "DosageInstructionsStartStopFrequency" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--ch-pharm-?id=2.16.756.5.30.1.1.10.4.35 target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition/ch-emed-dosage-structured-normal dosage for normal dosing, without sequences" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.type [ fhir:value "SubstanceAdministration" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "dosage" ];
       fhir:StructureMap.group.input.type [ fhir:value "Dosage" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeStartEnd" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "src" ]       ];
       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 "dosage" ];
         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 "dosage" ]         ]       ];
       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 "src";
           fhir:index 0         ], [
           fhir:value "dosage";
           fhir:index 1         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "effectiveTimeWhen" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "src" ]       ];
       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 "dosage" ];
         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 "dosage" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "EffectiveTimeWhen" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "src";
           fhir:index 0         ], [
           fhir:value "dosage";
           fhir:index 1         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "routeCode" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "routeCode" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "routeCode" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "route" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "route" ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "CECodeableConcept" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "routeCode";
           fhir:index 0         ], [
           fhir:value "route";
           fhir:index 1         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "doseQuantity" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "src" ]       ];
       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 "dosage" ];
         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 "dosage" ]         ]       ];
       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 "src";
           fhir:index 0         ], [
           fhir:value "dosage";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 21;
     fhir:StructureMap.group.name [ fhir:value "PharmaceuticalAdviceItemEntryContentModule" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "source: https://art-decor.org/art-decor/decor-templates--cdachemed-?section=templates&id=2.16.756.5.30.1.1.10.4.44 target: http://build.fhir.org/ig/hl7ch/ch-emed/StructureDefinition-ch-emed-observation.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "section" ];
       fhir:StructureMap.group.input.type [ fhir:value "Section" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       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 "patient" ];
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 3;
       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:index 4;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ];
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "id" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "vvv" ]       ];
       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 "identifier" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "vvv" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "patient" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "patient" ]       ];
       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 "subject" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ];
         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 "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 "reference" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "'urn:uuid:' + %patient.id" ]         ]       ]     ], [
       fhir:index 2;
       fhir:StructureMap.group.rule.name [ fhir:value "final" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       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 "status" ];
         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 "final" ]         ]       ]     ], [
       fhir:index 3;
       fhir:StructureMap.group.rule.name [ fhir:value "value" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "effectiveTime" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "effectiveTime" ]       ];
       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 "effective" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "value" ];
         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 "dateTime" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "TSDateTime" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "effectiveTime";
           fhir:index 0         ], [
           fhir:value "value";
           fhir:index 1         ]       ]     ], [
       fhir:index 4;
       fhir:StructureMap.group.rule.name [ fhir:value "MTPReferenceEntry" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.10').exists())" ]       ];
       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 "extension" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]       ];
       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 "entry";
           fhir:index 0         ], [
           fhir:value "ext";
           fhir:index 1         ]       ]     ], [
       fhir:index 5;
       fhir:StructureMap.group.rule.name [ fhir:value "cdaEntry" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "entryRelationship" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.source.condition [ fhir:value "((typeCode = 'REFR') and substanceAdministration.templateId.where(root = '1.3.6.1.4.1.19376.1.9.1.3.7').exists())" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "e" ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.target.context [ fhir:value "e" ];
         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 "uuid" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]       ], [
         fhir:index 2;
         fhir:StructureMap.group.rule.target.context [ fhir:value "e" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "uuid" ]         ]       ], [
         fhir:index 3;
         fhir:StructureMap.group.rule.target.context [ fhir:value "e" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "medicationstatement" ];
         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 "MedicationStatement" ]         ]       ], [
         fhir:index 4;
         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 "extension" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]       ], [
         fhir:index 5;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "url" ];
         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 "http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-ext-medicationstatement-changed" ]         ]       ], [
         fhir:index 6;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "reference" ];
         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 "Reference" ]         ]       ], [
         fhir:index 7;
         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 "reference" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ];
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]         ], [
           fhir:index 1;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "uuid" ]         ]       ];
       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 "entry" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "substanceAdministration" ];
           fhir:StructureMap.group.rule.source.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 "section";
             fhir:index 0           ], [
             fhir:value "substanceAdministration";
             fhir:index 1           ], [
             fhir:value "patient";
             fhir:index 2           ], [
             fhir:value "medicationstatement";
             fhir:index 3           ]         ]       ]     ], [
       fhir:index 6;
       fhir:StructureMap.group.rule.name [ fhir:value "note" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ];
         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 "observation" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "note" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "note" ]       ];
       fhir:StructureMap.group.rule.rule [
         fhir:index 0;
         fhir:StructureMap.group.rule.name [ fhir:value "level3observation" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "data" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "data" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
           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 "data" ]           ]         ]       ], [
         fhir:index 1;
         fhir:StructureMap.group.rule.name [ fhir:value "idRef" ];
         fhir:StructureMap.group.rule.source [
           fhir:index 0;
           fhir:StructureMap.group.rule.source.context [ fhir:value "text" ];
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(data.exists() = false)" ]         ];
         fhir:StructureMap.group.rule.target [
           fhir:index 0;
           fhir:StructureMap.group.rule.target.context [ fhir:value "note" ];
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
           fhir:StructureMap.group.rule.target.element [ fhir:value "text" ];
           fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ];
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%section.text.substring(%section.text.indexOf(%src.text.reference.value.substring(1))).substring(%section.text.substring(%section.text.indexOf(%src.text.reference.value.substring(1))).indexOf('>') + 1, %section.text.substring(%section.text.indexOf(%src.text.reference.value.substring(1))).indexOf('<') - %section.text.substring(%section.text.indexOf(%src.text.reference.value.substring(1))).indexOf('>') - 1)" ]           ]         ]       ], [
         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 "text" ];
           fhir:StructureMap.group.rule.source.element [ fhir:value "reference" ];
           fhir:StructureMap.group.rule.source.variable [ fhir:value "reference" ]         ];
         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 "reference" ];
             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 "note" ];
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
             fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ];
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ]           ];
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "NarrativeLink" ];
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "value";
               fhir:index 0             ], [
               fhir:value "ext";
               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 "src" ];
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ];
         fhir:StructureMap.group.rule.source.variable [ fhir:value "vvv" ]       ];
       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 "vvv" ];
         fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ]       ]     ]
  ], [
     fhir:index 22;
     fhir:StructureMap.group.name [ fhir:value "InnerExtensionExternalDocumentId" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "_________________________ Template Type not specified   _________________________ target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-ext-treatmentplan.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "ext" ];
       fhir:StructureMap.group.input.type [ fhir:value "Extension" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "url" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "url" ];
         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 "externalDocumentId" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "value" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "id" ];
         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 "Identifier" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "II" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "src";
           fhir:index 0         ], [
           fhir:value "id";
           fhir:index 1         ]       ]     ]
  ], [
     fhir:index 23;
     fhir:StructureMap.group.name [ fhir:value "InnerExtensionId" ];
     fhir:StructureMap.group.typeMode [ fhir:value "none" ];
     fhir:StructureMap.group.documentation [ fhir:value "target: http://build.fhir.org/ig/hl7ch/ch-emed/branches/master/StructureDefinition-ch-emed-ext-treatmentplan.html" ];
     fhir:StructureMap.group.input [
       fhir:index 0;
       fhir:StructureMap.group.input.name [ fhir:value "src" ];
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.input.name [ fhir:value "ext" ];
       fhir:StructureMap.group.input.type [ fhir:value "Extension" ];
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]     ];
     fhir:StructureMap.group.rule [
       fhir:index 0;
       fhir:StructureMap.group.rule.name [ fhir:value "url" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "url" ];
         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 "id" ]         ]       ]     ], [
       fhir:index 1;
       fhir:StructureMap.group.rule.name [ fhir:value "value" ];
       fhir:StructureMap.group.rule.source [
         fhir:index 0;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]       ];
       fhir:StructureMap.group.rule.target [
         fhir:index 0;
         fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ];
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ];
         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ];
         fhir:StructureMap.group.rule.target.variable [ fhir:value "id" ];
         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 "Identifier" ]         ]       ];
       fhir:StructureMap.group.rule.dependent [
         fhir:index 0;
         fhir:StructureMap.group.rule.dependent.name [ fhir:value "II" ];
         fhir:StructureMap.group.rule.dependent.variable [
           fhir:value "src";
           fhir:index 0         ], [
           fhir:value "id";
           fhir:index 1         ]       ]     ]
  ].

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

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