Australian Base Implementation Guide (AU Base 1)

This page is part of the Australian Base IG (v1.0.2: AU Base 1 on STU3) based on FHIR R3. This is the current published version in it's permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions

Example: StructureDefinition-au-medicationstatement

Formats: XML, JSON, Turtle

Raw xml


<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="au-medicationstatement"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><table border="0" cellpadding="0" cellspacing="0" style="border: 0px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;"><tr style="border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;"><th style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/formats.html#table" title="The logical name of the element">Name</a></th><th style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/formats.html#table" title="Information about the use of the element">Flags</a></th><th style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/formats.html#table" title="Minimum and Maximum # of times the the element can appear in the instance">Card.</a></th><th style="width: 100px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/formats.html#table" title="Reference to the type of the element">Type</a></th><th style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/formats.html#table" title="Additional information about the element">Description &amp; Constraints</a><span style="float: right"><a href="http://hl7.org/fhir/STU3/formats.html#table" title="Legend for this format"><img src="http://hl7.org/fhir/STU3/help16.png" alt="doco" style="background-color: inherit"/></a></span></th></tr><tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck1.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_element.gif" alt="." style="background-color: white; background-color: inherit" title="Element" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement" title="null">MedicationStatement</a><a name="MedicationStatement"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">A record of medication being taken by a patient in an Australian healthcare context</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck12.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_extension_simple.png" alt="." style="background-color: white; background-color: inherit" title="Simple Extension" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.extension" title="null">extension</a><a name="MedicationStatement.extension"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><span style="font-weight:bold">Slice: </span>Unordered, Open by value:url</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck14.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_extension_simple.png" alt="." style="background-color: white; background-color: inherit" title="Simple Extension" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.extension:longTerm" title="Extension URL = http://hl7.org.au/fhir/StructureDefinition/medication-long-term">medication-long-term</a><a name="MedicationStatement.extension"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/datatypes.html#boolean">boolean</a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Medication Long Term Indicator<br/><span style="font-weight:bold">URL: </span><a href="http://hl7.org/fhir/STU3/StructureDefinition-medication-long-term.html">http://hl7.org.au/fhir/StructureDefinition/medication-long-term</a></td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck14.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_extension_simple.png" alt="." style="background-color: white; background-color: inherit" title="Simple Extension" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.extension:brandName" title="Extension URL = http://hl7.org.au/fhir/StructureDefinition/medication-brand-name">medication-brand-name</a><a name="MedicationStatement.extension"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/datatypes.html#string">string</a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Medication Brand Name<br/><span style="font-weight:bold">URL: </span><a href="http://hl7.org/fhir/STU3/StructureDefinition-medication-brand-name.html">http://hl7.org.au/fhir/StructureDefinition/medication-brand-name</a></td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck14.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_extension_simple.png" alt="." style="background-color: white; background-color: inherit" title="Simple Extension" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.extension:genericName" title="Extension URL = http://hl7.org.au/fhir/StructureDefinition/medication-generic-name">medication-generic-name</a><a name="MedicationStatement.extension"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/datatypes.html#string">string</a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Medication Generic Drug Name<br/><span style="font-weight:bold">URL: </span><a href="http://hl7.org/fhir/STU3/StructureDefinition-medication-generic-name.html">http://hl7.org.au/fhir/StructureDefinition/medication-generic-name</a></td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck12.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_slice.png" alt="." style="background-color: white; background-color: inherit" title="Slice Definition" class="hierarchy"/> <a style="font-style: italic" href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]" title="null">medication[x]</a><a name="MedicationStatement.medication_x_"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a style="font-style: italic" href="http://hl7.org/fhir/STU3/datatypes.html#CodeableConcept">CodeableConcept</a><span style="font-style: italic">, </span><a style="font-style: italic" href="http://hl7.org/fhir/STU3/references.html">Reference</a><span style="font-style: italic">(</span><a style="font-style: italic" href="StructureDefinition-au-medication.html">AU Base Medication</a><span style="font-style: italic">)</span></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><span style="font-style: italic">Medication Detail</span><br style="font-style: italic"/><span style="font-weight:bold; font-style: italic">Slice: </span><span style="font-style: italic">Unordered, Open by type:$this</span></td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck15.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_datatype.gif" alt="." style="background-color: white; background-color: inherit" title="Data Type" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded" title="Slice medicationCoded: null">medication[x]</a><a name="MedicationStatement.medication_x_"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><span style="padding-left: 3px; padding-right: 3px; color: black; background-color: white" title="This element has or is affected by some invariants">I</span></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/datatypes.html#CodeableConcept">CodeableConcept</a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Coded Medication<br/><span style="font-weight:bold">inv-amt-tpuu: </span>AMT TPUU valueset membership required<br/><span style="font-weight:bold">inv-amt-tpp: </span>AMT TPU valueset membership required<br/><span style="font-weight:bold">inv-amt-tp: </span>AMT TP valueset membership required<br/><span style="font-weight:bold">inv-amp-mpuu: </span>AMT MPUU valueset membership required<br/><span style="font-weight:bold">inv-amt-mpp: </span>AMT MPP valueset membership required<br/><span style="font-weight:bold">inv-amt-mp: </span>AMT MP valueset membership required<br/><span style="font-weight:bold">inv-amt-ctpp: </span>AMT CTPP valueset membership required</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck152.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_slice.png" alt="." style="background-color: white; background-color: inherit" title="Slice Definition" class="hierarchy"/> <a style="font-style: italic" href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded.coding" title="null">coding</a><a name="MedicationStatement.medication_x_.coding"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><span style="font-style: italic">Medication Codes</span><br style="font-style: italic"/><span style="font-weight:bold; font-style: italic">Slice: </span><span style="font-style: italic">Unordered, Open by value:system, value:code</span></td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck154.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_element.gif" alt="." style="background-color: white; background-color: inherit" title="Element" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded.coding:pbs" title="Slice pbs: PBS code from http://pbs.gov.au/code/item. Use of PBS as a code to refer to a type of medication, this excludes implication of context based on the PBS code. Where context is to be implied or stated PBS code needs to be associated with recording a prescription (MedicationRequest) or dispense record(MedicationDispense)">coding</a><a name="MedicationStatement.medication_x_.coding"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">PBS Item Code<br/><span style="font-weight:bold">Binding: </span><a href="ValueSet-pbs-item.html">PBS Medicines Item Codes</a> (<a href="http://hl7.org/fhir/STU3/terminologies.html#required" title="To be conformant, the concept in this element SHALL be from the specified value set.">required</a>)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck154.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_element.gif" alt="." style="background-color: white; background-color: inherit" title="Element" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded.coding:gtin" title="Slice gtin: GTIN value from http://www.gs1.org/gtin.">coding</a><a name="MedicationStatement.medication_x_.coding"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Medication Package Global Trade Item Number (GTIN)<br/><span style="font-weight:bold">Binding: </span><a href="ValueSet-gtin.html">GTIN for Medicines</a> (<a href="http://hl7.org/fhir/STU3/terminologies.html#required" title="To be conformant, the concept in this element SHALL be from the specified value set.">required</a>)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck155.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_element.gif" alt="." style="background-color: white; background-color: inherit" title="Element" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded.coding:amt" title="Slice amt: null">coding</a><a name="MedicationStatement.medication_x_.coding"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">AMT Medicines<br/><span style="font-weight:bold">Binding: </span><a href="https://healthterminologies.gov.au/fhir/ValueSet/australian-medication-1">https://healthterminologies.gov.au/fhir/ValueSet/australian-medication-1</a> (<a href="http://hl7.org/fhir/STU3/terminologies.html#required" title="To be conformant, the concept in this element SHALL be from the specified value set.">required</a>)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck1552.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_extension_simple.png" alt="." style="background-color: white; background-color: inherit" title="Simple Extension" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded.coding:amt.extension" title="null">extension</a><a name="MedicationStatement.medication_x_.coding.extension"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><span style="font-weight:bold">Slice: </span>Unordered, Open by value:url</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck1545.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_end_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_extension_simple.png" alt="." style="background-color: white; background-color: inherit" title="Simple Extension" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded.coding:amt.extension:medicationClass" title="Extension URL = http://hl7.org.au/fhir/StructureDefinition/medication-type">medication-type</a><a name="MedicationStatement.medication_x_.coding.extension"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/datatypes.html#Coding">Coding</a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Class of Medication Coding<br/><span style="font-weight:bold">URL: </span><a href="http://hl7.org/fhir/STU3/StructureDefinition-medication-type.html">http://hl7.org.au/fhir/StructureDefinition/medication-type</a><br/><span style="font-weight:bold">Binding: </span><a href="ValueSet-medication-type.html">Medication Type</a> (<a href="http://hl7.org/fhir/STU3/terminologies.html#required" title="To be conformant, the concept in this element SHALL be from the specified value set.">required</a>)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck15444.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_blank.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_end_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_element.gif" alt="." style="background-color: white; background-color: inherit" title="Element" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded.coding:amt.extension:medicationClass.valueCoding:valueCoding" title="Slice valueCoding: null">valueCoding</a><a name="MedicationStatement.medication_x_.coding.extension.valueCoding"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><span style="font-weight:bold">Fixed Value: </span><span style="color: darkgreen">{&quot;system&quot;:&quot;http://hl7.org.au/fhir/CodeSystem/medication-type&quot;,&quot;code&quot;:&quot;BPG&quot;,&quot;display&quot;:&quot;Branded package with no container&quot;}</span></td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck144.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vline.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_end_slice.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_element.gif" alt="." style="background-color: white; background-color: inherit" title="Element" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationCoded.coding:mimsPackage" title="Slice mimsPackage: null">coding</a><a name="MedicationStatement.medication_x_.coding"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">..1</td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">MIMS Package<br/><span style="font-weight:bold">Binding: </span><a href="ValueSet-mims.html">MIMS Terminology</a> (<a href="http://hl7.org/fhir/STU3/terminologies.html#required" title="To be conformant, the concept in this element SHALL be from the specified value set.">required</a>)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck14.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_reference.png" alt="." style="background-color: white; background-color: inherit" title="Reference to another Resource" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.medication[x]:medicationReference" title="Slice medicationReference: null">medication[x]</a><a name="MedicationStatement.medication_x_"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/STU3/references.html">Reference</a>(<a href="StructureDefinition-au-medication.html">AU Base Medication</a>)</td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Medication Reference</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;"><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck00.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_end.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_datatype.gif" alt="." style="background-color: white; background-color: inherit" title="Data Type" class="hierarchy"/> <a href="StructureDefinition-au-medicationstatement-definitions.html#MedicationStatement.dosage" title="null">dosage</a><a name="MedicationStatement.dosage"> </a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="StructureDefinition-au-dosage.html" title="Dosage">AUBaseDosage</a></td><td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/></tr>
<tr><td colspan="5" class="hierarchy"><br/><a href="http://hl7.org/fhir/STU3/formats.html#table" title="Legend for this format"><img src="http://hl7.org/fhir/STU3/help16.png" alt="doco" style="background-color: inherit"/> Documentation for this format</a></td></tr></table></div>
  </text>
  <url value="http://hl7.org.au/fhir/StructureDefinition/au-medicationstatement"/>
  <version value="1.0.0"/>
  <name value="AUBaseMedicationStatement"/>
  <title value="AU Base Medication Statement"/>
  <status value="draft"/>
  <date value="2017-05-05T10:53:27+10:00"/>
  <publisher value="Health Level Seven Australia (Medications WG)"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="http://hl7.org.au/fhir"/>
      <use value="work"/>
    </telecom>
  </contact>
  <description
               value="This profile defines a medication statement structure including core localisation concepts for use in an Australian context."/>
  <fhirVersion value="3.0.1"/>
  <mapping>
    <identity value="workflow"/>
    <uri value="http://hl7.org/fhir/workflow"/>
    <name value="Workflow Mapping"/>
  </mapping>
  <mapping>
    <identity value="rim"/>
    <uri value="http://hl7.org/v3"/>
    <name value="RIM Mapping"/>
  </mapping>
  <mapping>
    <identity value="w5"/>
    <uri value="http://hl7.org/fhir/w5"/>
    <name value="W5 Mapping"/>
  </mapping>
  <mapping>
    <identity value="v2"/>
    <uri value="http://hl7.org/v2"/>
    <name value="HL7 v2 Mapping"/>
  </mapping>
  <kind value="resource"/>
  <abstract value="false"/>
  <type value="MedicationStatement"/>
  <baseDefinition
                  value="http://hl7.org/fhir/StructureDefinition/MedicationStatement"/>
  <derivation value="constraint"/>
  <snapshot>
    <element id="MedicationStatement">
      <path value="MedicationStatement"/>
      <short
             value="A record of medication being taken by a patient in an Australian healthcare context"/>
      <definition
                  value="A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from sources such as the patient&#39;s memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains 

The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the medication statement information may come from the patient&#39;s memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information."/>
      <comment
               value="When interpreting a medicationStatement, the value of the status and NotTaken needed to be considered:
MedicationStatement.status + MedicationStatement.wasNotTaken
Status=Active + NotTaken=T = Not currently taking
Status=Completed + NotTaken=T = Not taken in the past
Status=Intended + NotTaken=T = No intention of taking
Status=Active + NotTaken=F = Taking, but not as prescribed
Status=Active + NotTaken=F = Taking
Status=Intended +NotTaken= F = Will be taking (not started)
Status=Completed + NotTaken=F = Taken in past
Status=In Error + NotTaken=N/A = In Error."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <constraint>
        <key value="dom-2"/>
        <severity value="error"/>
        <human
               value="If the resource is contained in another resource, it SHALL NOT contain nested Resources"/>
        <expression value="contained.contained.empty()"/>
        <xpath value="not(parent::f:contained and f:contained)"/>
        <source value="DomainResource"/>
      </constraint>
      <constraint>
        <key value="dom-1"/>
        <severity value="error"/>
        <human
               value="If the resource is contained in another resource, it SHALL NOT contain any narrative"/>
        <expression value="contained.text.empty()"/>
        <xpath value="not(parent::f:contained and f:text)"/>
        <source value="DomainResource"/>
      </constraint>
      <constraint>
        <key value="dom-4"/>
        <severity value="error"/>
        <human
               value="If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated"/>
        <expression
                    value="contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()"/>
        <xpath
               value="not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))"/>
        <source value="DomainResource"/>
      </constraint>
      <constraint>
        <key value="dom-3"/>
        <severity value="error"/>
        <human
               value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource"/>
        <expression
                    value="contained.where((&#39;#&#39;+id in %resource.descendants().reference).not()).empty()"/>
        <xpath
               value="not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat(&#39;#&#39;, $id))]))"/>
        <source value="DomainResource"/>
      </constraint>
      <constraint>
        <key value="mst-1"/>
        <severity value="error"/>
        <human value="Reason not taken is only permitted if Taken is No"/>
        <expression
                    value="reasonNotTaken.exists().not() or (taken = &#39;n&#39;)"/>
        <xpath
               value="not(exists(f:reasonNotTaken)) or f:taken/@value=&#39;n&#39;"/>
        <source value="MedicationStatement"/>
      </constraint>
      <mapping>
        <identity value="rim"/>
        <map value="Entity. Role, or Act"/>
      </mapping>
      <mapping>
        <identity value="workflow"/>
        <map value="..Event"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="SubstanceAdministration"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="clinical.medication"/>
      </mapping>
    </element>
    <element id="MedicationStatement.id">
      <path value="MedicationStatement.id"/>
      <short value="Logical id of this artifact"/>
      <definition
                  value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."/>
      <comment
               value="The only time that a resource does not have an id is when it is being submitted to the server using a create operation."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Resource.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="id"/>
      </type>
      <isSummary value="true"/>
    </element>
    <element id="MedicationStatement.meta">
      <path value="MedicationStatement.meta"/>
      <short value="Metadata about the resource"/>
      <definition
                  value="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Resource.meta"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Meta"/>
      </type>
      <isSummary value="true"/>
    </element>
    <element id="MedicationStatement.implicitRules">
      <path value="MedicationStatement.implicitRules"/>
      <short value="A set of rules under which this content was created"/>
      <definition
                  value="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content."/>
      <comment
               value="Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. 

This element is labelled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it&#39;s meaning or interpretation."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Resource.implicitRules"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="uri"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
    </element>
    <element id="MedicationStatement.language">
      <path value="MedicationStatement.language"/>
      <short value="Language of the resource content"/>
      <definition value="The base language in which the resource is written."/>
      <comment
               value="Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies  to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource  Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Resource.language"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
          <valueReference>
            <reference value="http://hl7.org/fhir/ValueSet/all-languages"/>
          </valueReference>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Language"/>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/>
        </extension>
        <strength value="extensible"/>
        <description value="A human language."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/languages"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="MedicationStatement.text">
      <path value="MedicationStatement.text"/>
      <short value="Text summary of the resource, for human interpretation"/>
      <definition
                  value="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it &quot;clinically safe&quot; for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety."/>
      <comment
               value="Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied).  This may be necessary for data from legacy systems where information is captured as a &quot;text blob&quot; or where text is additionally entered raw or narrated and encoded in formation is added later."/>
      <alias value="narrative"/>
      <alias value="html"/>
      <alias value="xhtml"/>
      <alias value="display"/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="DomainResource.text"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Narrative"/>
      </type>
      <condition value="dom-1"/>
      <mapping>
        <identity value="rim"/>
        <map value="Act.text?"/>
      </mapping>
    </element>
    <element id="MedicationStatement.contained">
      <path value="MedicationStatement.contained"/>
      <short value="Contained, inline Resources"/>
      <definition
                  value="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope."/>
      <comment
               value="This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again."/>
      <alias value="inline resources"/>
      <alias value="anonymous resources"/>
      <alias value="contained resources"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="DomainResource.contained"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Resource"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="MedicationStatement.extension">
      <path value="MedicationStatement.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <short value="Extension"/>
      <definition value="An Extension"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="DomainResource.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
    </element>
    <element id="MedicationStatement.extension:longTerm">
      <path value="MedicationStatement.extension"/>
      <sliceName value="longTerm"/>
      <short value="Medication Long Term Indicator"/>
      <definition value="Medication long-term indicator"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="DomainResource.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org.au/fhir/StructureDefinition/medication-long-term"/>
      </type>
      <condition value="ele-1"/>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <constraint>
        <key value="ext-1"/>
        <severity value="error"/>
        <human value="Must have either extensions or value[x], not both"/>
        <expression value="extension.exists() != value.exists()"/>
        <xpath
               value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), &#39;value&#39;)])"/>
        <source value="Extension"/>
      </constraint>
    </element>
    <element id="MedicationStatement.extension:brandName">
      <path value="MedicationStatement.extension"/>
      <sliceName value="brandName"/>
      <short value="Medication Brand Name"/>
      <definition value="An Extension"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="DomainResource.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org.au/fhir/StructureDefinition/medication-brand-name"/>
      </type>
      <condition value="ele-1"/>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <constraint>
        <key value="ext-1"/>
        <severity value="error"/>
        <human value="Must have either extensions or value[x], not both"/>
        <expression value="extension.exists() != value.exists()"/>
        <xpath
               value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), &#39;value&#39;)])"/>
        <source value="Extension"/>
      </constraint>
    </element>
    <element id="MedicationStatement.extension:genericName">
      <path value="MedicationStatement.extension"/>
      <sliceName value="genericName"/>
      <short value="Medication Generic Drug Name"/>
      <definition value="An Extension"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="DomainResource.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org.au/fhir/StructureDefinition/medication-generic-name"/>
      </type>
      <condition value="ele-1"/>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <constraint>
        <key value="ext-1"/>
        <severity value="error"/>
        <human value="Must have either extensions or value[x], not both"/>
        <expression value="extension.exists() != value.exists()"/>
        <xpath
               value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), &#39;value&#39;)])"/>
        <source value="Extension"/>
      </constraint>
    </element>
    <element id="MedicationStatement.modifierExtension">
      <path value="MedicationStatement.modifierExtension"/>
      <short value="Extensions that cannot be ignored"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="DomainResource.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="MedicationStatement.identifier">
      <path value="MedicationStatement.identifier"/>
      <short value="External identifier"/>
      <definition
                  value="External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.identifier"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Identifier"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="workflow"/>
        <map value="…identifer"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".id"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="id"/>
      </mapping>
    </element>
    <element id="MedicationStatement.basedOn">
      <path value="MedicationStatement.basedOn"/>
      <short value="Fulfils plan, proposal or order"/>
      <definition
                  value="A plan, proposal or order that is fulfilled in whole or in part by this event."/>
      <requirements
                    value="Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.basedOn"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/CarePlan"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/ProcedureRequest"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/ReferralRequest"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="workflow"/>
        <map value="…basedOn"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=FLFS].target[classCode=SBADM or PROC or PCPR or OBS, moodCode=RQO orPLAN or PRP]"/>
      </mapping>
    </element>
    <element id="MedicationStatement.partOf">
      <path value="MedicationStatement.partOf"/>
      <short value="Part of referenced event"/>
      <definition
                  value="A larger event of which this particular event is a component or step."/>
      <requirements
                    value="This should not be used when indicating which resource a MedicationStatement has been derived from.  If that is the use case, then MedicationStatement.derivedFrom should be used."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.partOf"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/MedicationDispense"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/MedicationStatement"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/Observation"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="workflow"/>
        <map value="…part of"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=COMP]/target[classCode=SPLY or SBADM or PROC or OBS,moodCode=EVN]"/>
      </mapping>
    </element>
    <element id="MedicationStatement.context">
      <path value="MedicationStatement.context"/>
      <short value="Encounter / Episode associated with MedicationStatement"/>
      <definition
                  value="The encounter or episode of care that establishes the context for this MedicationStatement."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.context"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="workflow"/>
        <map value="…context"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code=&quot;type of encounter or episode&quot;]"/>
      </mapping>
    </element>
    <element id="MedicationStatement.status">
      <path value="MedicationStatement.status"/>
      <short
             value="active | completed | entered-in-error | intended | stopped | on-hold"/>
      <definition
                  value="A code representing the patient or other source&#39;s judgment about the state of the medication used that this statement is about.  Generally this will be active or completed."/>
      <comment
               value="MedicationStatement is a statement at a point in time.  The status is only representative at the point when it was asserted.  The value set for MedicationStatement.status contains codes that assert the status of the use of the medication by the patient (for example, stopped or on hold) as well as codes that assert the status of the medication statement itself (for example, entered in error).

This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.status"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationStatementStatus"/>
        </extension>
        <strength value="required"/>
        <description
                     value="A coded concept indicating the current status of a MedicationStatement."/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/medication-statement-status"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="workflow"/>
        <map value="…status"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".statusCode"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="status"/>
      </mapping>
    </element>
    <element id="MedicationStatement.category">
      <path value="MedicationStatement.category"/>
      <short value="Type of medication usage"/>
      <definition
                  value="Indicates where type of medication statement and where the medication is expected to be consumed or administered."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.category"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationStatementCategory"/>
        </extension>
        <strength value="preferred"/>
        <description
                     value="A coded concept identifying where the medication included in the medicationstatement is expected to be consumed or administered"/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/medication-statement-category"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map
             value=".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code=&quot;type of medication usage&quot;].value"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="class"/>
      </mapping>
    </element>
    <element id="MedicationStatement.medication[x]">
      <path value="MedicationStatement.medication[x]"/>
      <short value="Medication Detail"/>
      <definition
                  value="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications."/>
      <comment
               value="If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example if you require form or lot number, then you must reference the Medication resource. ."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.medication[x]"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org.au/fhir/StructureDefinition/au-medication"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationCode"/>
        </extension>
        <strength value="example"/>
        <description
                     value="A coded concept identifying the substance or product being taken."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/medication-codes"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="workflow"/>
        <map value="…code"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=CSM].role[classCode=ADMM or MANU]"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="what"/>
      </mapping>
    </element>
    <element id="MedicationStatement.medicationCodeableConcept:medicationCoded">
      <path value="MedicationStatement.medicationCodeableConcept"/>
      <sliceName value="medicationCoded"/>
      <short value="Coded Medication"/>
      <definition
                  value="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications."/>
      <comment
               value="If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example if you require form or lot number, then you must reference the Medication resource. ."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.medication[x]"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <constraint>
        <key value="inv-amt-tpuu"/>
        <severity value="error"/>
        <human value="AMT TPUU valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPDSF&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPDSF&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-tpuu-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-tpp"/>
        <severity value="error"/>
        <human value="AMT TPU valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPG&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPG&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-tpp-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-tp"/>
        <severity value="error"/>
        <human value="AMT TP valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPD&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPD&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-tp-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amp-mpuu"/>
        <severity value="error"/>
        <human value="AMT MPUU valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPDSF&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPDSF&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-mpuu-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-mpp"/>
        <severity value="error"/>
        <human value="AMT MPP valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPG&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPG&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-mpp-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-mp"/>
        <severity value="error"/>
        <human value="AMT MP valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPD&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPD&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-mp-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-ctpp"/>
        <severity value="error"/>
        <human value="AMT CTPP valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPGC&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPGC&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-ctpp-codes&#39;"/>
      </constraint>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationCode"/>
        </extension>
        <strength value="example"/>
        <description
                     value="A coded concept identifying the substance or product being taken."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/medication-codes"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="workflow"/>
        <map value="…code"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=CSM].role[classCode=ADMM or MANU]"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="what"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.id">
      <path value="MedicationStatement.medicationCodeableConcept.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.extension">
      <path value="MedicationStatement.medicationCodeableConcept.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding">
      <path value="MedicationStatement.medicationCodeableConcept.coding"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="system"/>
        </discriminator>
        <discriminator>
          <type value="value"/>
          <path value="code"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <short value="Medication Codes"/>
      <definition value="A reference to a code defined by a terminology system."/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:pbs">
      <path value="MedicationStatement.medicationCodeableConcept.coding"/>
      <sliceName value="pbs"/>
      <short value="PBS Item Code"/>
      <definition
                  value="PBS code from http://pbs.gov.au/code/item. Use of PBS as a code to refer to a type of medication, this excludes implication of context based on the PBS code. Where context is to be implied or stated PBS code needs to be associated with recording a prescription (MedicationRequest) or dispense record(MedicationDispense)"/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference value="http://hl7.org.au/fhir/ValueSet/pbs-item"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:gtin">
      <path value="MedicationStatement.medicationCodeableConcept.coding"/>
      <sliceName value="gtin"/>
      <short value="Medication Package Global Trade Item Number (GTIN)"/>
      <definition value="GTIN value from http://www.gs1.org/gtin."/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference value="http://hl7.org.au/fhir/ValueSet/gtin"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt">
      <path value="MedicationStatement.medicationCodeableConcept.coding"/>
      <sliceName value="amt"/>
      <short value="AMT Medicines"/>
      <definition value="A reference to a code defined by a terminology system."/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference
                     value="https://healthterminologies.gov.au/fhir/ValueSet/australian-medication-1"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.id">
      <path value="MedicationStatement.medicationCodeableConcept.coding.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.extension">
      <path
            value="MedicationStatement.medicationCodeableConcept.coding.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Extension"/>
      <definition value="An Extension"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.extension:medicationClass">
      <path
            value="MedicationStatement.medicationCodeableConcept.coding.extension"/>
      <sliceName value="medicationClass"/>
      <short value="Class of Medication Coding"/>
      <definition
                  value="General category of coding to allow usage of codes to be distinguished from the same CodeSystem"/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org.au/fhir/StructureDefinition/medication-type"/>
      </type>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.extension:medicationClass.id">
      <path
            value="MedicationStatement.medicationCodeableConcept.coding.extension.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.extension:medicationClass.extension">
      <path
            value="MedicationStatement.medicationCodeableConcept.coding.extension.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.extension:medicationClass.url">
      <path
            value="MedicationStatement.medicationCodeableConcept.coding.extension.url"/>
      <representation value="xmlAttr"/>
      <short value="identifies the meaning of the extension"/>
      <definition
                  value="Source of the definition for the extension code - a logical name or a URL."/>
      <comment
               value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Extension.url"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="uri"/>
      </type>
      <fixedUri
                value="http://hl7.org.au/fhir/StructureDefinition/medication-type"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.extension:medicationClass.valueCoding:valueCoding">
      <path
            value="MedicationStatement.medicationCodeableConcept.coding.extension.valueCoding"/>
      <sliceName value="valueCoding"/>
      <short value="Value of extension"/>
      <definition
                  value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Extension.value[x]"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <fixedCoding>
        <system value="http://hl7.org.au/fhir/CodeSystem/medication-type"/>
        <code value="BPG"/>
        <display value="Branded package with no container"/>
      </fixedCoding>
      <binding>
        <strength value="required"/>
        <description value="Medication Type"/>
        <valueSetReference>
          <reference value="http://hl7.org.au/fhir/ValueSet/medication-type"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.system">
      <path value="MedicationStatement.medicationCodeableConcept.coding.system"/>
      <short value="Identity of the terminology system"/>
      <definition
                  value="The identification of the code system that defines the meaning of the symbol in the code."/>
      <comment
               value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7&#39;s list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously."/>
      <requirements
                    value="Need to be unambiguous about the source of the definition of the symbol."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Coding.system"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="uri"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.3"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="./codeSystem"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map
             value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.version">
      <path value="MedicationStatement.medicationCodeableConcept.coding.version"/>
      <short value="Version of the system - if relevant"/>
      <definition
                  value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged."/>
      <comment
               value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Coding.version"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.7"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="./codeSystemVersion"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map
             value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.code">
      <path value="MedicationStatement.medicationCodeableConcept.coding.code"/>
      <short value="Symbol in syntax defined by the system"/>
      <definition
                  value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)."/>
      <requirements value="Need to refer to a particular code in the system."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Coding.code"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="./code"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.display">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="MedicationStatement.medicationCodeableConcept.coding.display"/>
      <short value="Representation defined by the system"/>
      <definition
                  value="A representation of the meaning of the code in the system, following the rules of the system."/>
      <requirements
                    value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Coding.display"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.2 - but note this is not well followed"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="CV.displayName"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map
             value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:amt.userSelected">
      <path
            value="MedicationStatement.medicationCodeableConcept.coding.userSelected"/>
      <short value="If this coding was chosen directly by the user"/>
      <definition
                  value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)."/>
      <comment
               value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly &#39;directly chosen&#39; implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely."/>
      <requirements
                    value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Coding.userSelected"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="boolean"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="Sometimes implied by being first"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="CD.codingRationale"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map
             value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.coding:mimsPackage">
      <path value="MedicationStatement.medicationCodeableConcept.coding"/>
      <sliceName value="mimsPackage"/>
      <short value="MIMS Package"/>
      <definition value="A reference to a code defined by a terminology system."/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference value="http://hl7.org.au/fhir/ValueSet/mims"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element
             id="MedicationStatement.medicationCodeableConcept:medicationCoded.text">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="MedicationStatement.medicationCodeableConcept.text"/>
      <short value="Plain text representation of the concept"/>
      <definition
                  value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user."/>
      <comment
               value="Very often the text is the same as a displayName of one of the codings."/>
      <requirements
                    value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="CodeableConcept.text"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.9. But note many systems use C*E.2 for this"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map
             value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"/>
      </mapping>
    </element>
    <element id="MedicationStatement.medicationReference:medicationReference">
      <path value="MedicationStatement.medicationReference"/>
      <sliceName value="medicationReference"/>
      <short value="Medication Reference"/>
      <definition
                  value="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications."/>
      <comment
               value="If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example if you require form or lot number, then you must reference the Medication resource. ."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.medication[x]"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org.au/fhir/StructureDefinition/au-medication"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="workflow"/>
        <map value="…code"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=CSM].role[classCode=ADMM or MANU]"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="what"/>
      </mapping>
    </element>
    <element id="MedicationStatement.effective[x]">
      <path value="MedicationStatement.effective[x]"/>
      <short value="The date/time or interval when the medication was taken"/>
      <definition
                  value="The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true)."/>
      <comment
               value="This attribute reflects the period over which the patient consumed the medication and is expected to be populated on the majority of Medication Statements. If the medication is still being taken at the time the statement is recorded, the &quot;end&quot; date will be omitted."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.effective[x]"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="dateTime"/>
      </type>
      <type>
        <code value="Period"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="workflow"/>
        <map value="…occurrence[x]"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".effectiveTime"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="when.done"/>
      </mapping>
    </element>
    <element id="MedicationStatement.dateAsserted">
      <path value="MedicationStatement.dateAsserted"/>
      <short value="When the statement was asserted?"/>
      <definition
                  value="The date when the medication statement was asserted by the information source."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.dateAsserted"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="dateTime"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=AUT].time"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="when.recorded"/>
      </mapping>
    </element>
    <element id="MedicationStatement.informationSource">
      <path value="MedicationStatement.informationSource"/>
      <short
             value="Person or organization that provided the information about the taking of this medication"/>
      <definition
                  value="The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g Claim or MedicationRequest."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.informationSource"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/RelatedPerson"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/Organization"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map
             value=".participation[typeCode=INF].role[classCode=PAT, or codes for Practioner or Related Person (if PAT is the informer, then syntax for self-reported =true)"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="who.source"/>
      </mapping>
    </element>
    <element id="MedicationStatement.subject">
      <path value="MedicationStatement.subject"/>
      <short value="Who is/was taking  the medication"/>
      <definition
                  value="The person, animal or group who is/was taking the medication."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.subject"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="workflow"/>
        <map value="…subject"/>
      </mapping>
      <mapping>
        <identity value="v2"/>
        <map value="PID-3-Patient ID List"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=SBJ].role[classCode=PAT]"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="who"/>
      </mapping>
    </element>
    <element id="MedicationStatement.derivedFrom">
      <path value="MedicationStatement.derivedFrom"/>
      <short value="Additional supporting information"/>
      <definition
                  value="Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement."/>
      <comment
               value="Likely references would be to MedicationRequest, MedicationDispense, Claim, Observation or QuestionnaireAnswers.  The most common use cases for deriving a MedicationStatement comes from creating a MedicationStatement from a MedicationRequest or from a lab observation or a claim.  it should be noted that the amount of information that is available varies from the type resource that you derive the MedicationStatement from."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.derivedFrom"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=SPRT]/target[classCode=ACT,moodCode=EVN]"/>
      </mapping>
    </element>
    <element id="MedicationStatement.taken">
      <path value="MedicationStatement.taken"/>
      <short value="y | n | unk | na"/>
      <definition
                  value="Indicator of the certainty of whether the medication was taken by the patient."/>
      <comment
               value="This element is labeled as a modifier because it indicates that the medication was not taken."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.taken"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationStatementTaken"/>
        </extension>
        <strength value="required"/>
        <description
                     value="A coded concept identifying level of certainty if patient has taken or has not taken the medication"/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/medication-statement-taken"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="workflow"/>
        <map value="…notDone"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".actionNegationInd"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonNotTaken">
      <path value="MedicationStatement.reasonNotTaken"/>
      <short value="True if asserting medication was not given"/>
      <definition value="A code indicating why the medication was not taken."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.reasonNotTaken"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <condition value="mst-1"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationStatementNotTakenReason"/>
        </extension>
        <strength value="example"/>
        <description
                     value="A coded concept indicating the reason why the medication was not taken"/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/reason-medication-not-taken-codes"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code=&quot;reason not taken&quot;].value"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonNotTaken.id">
      <path value="MedicationStatement.reasonNotTaken.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonNotTaken.extension">
      <path value="MedicationStatement.reasonNotTaken.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonNotTaken.coding">
      <path value="MedicationStatement.reasonNotTaken.coding"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="system"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <short value="Code defined by a terminology system"/>
      <definition value="A reference to a code defined by a terminology system."/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonNotTaken.coding:snomedReasonNotTaken">
      <path value="MedicationStatement.reasonNotTaken.coding"/>
      <sliceName value="snomedReasonNotTaken"/>
      <short value="Reason Not Taken (SNOMED CT)"/>
      <definition value="A reference to a code defined by a terminology system."/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference
                     value="https://healthterminologies.gov.au/fhir/ValueSet/medication-reason-not-taken-1"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonNotTaken.text">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="MedicationStatement.reasonNotTaken.text"/>
      <short value="Plain text representation of the concept"/>
      <definition
                  value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user."/>
      <comment
               value="Very often the text is the same as a displayName of one of the codings."/>
      <requirements
                    value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="CodeableConcept.text"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.9. But note many systems use C*E.2 for this"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map
             value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonCode">
      <path value="MedicationStatement.reasonCode"/>
      <short value="Reason for why the medication is being/was taken"/>
      <definition value="A reason for why the medication is being/was taken."/>
      <comment
               value="This could be a diagnosis code. If a full condition record exists or additional detail is needed, use reasonForUseReference."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.reasonCode"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationReason"/>
        </extension>
        <strength value="example"/>
        <description
                     value="A coded concept identifying why the medication is being taken."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/condition-code"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="workflow"/>
        <map value="…reasoneCodeableConcept"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".reasonCode"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="why"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonCode.id">
      <path value="MedicationStatement.reasonCode.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonCode.extension">
      <path value="MedicationStatement.reasonCode.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonCode.coding">
      <path value="MedicationStatement.reasonCode.coding"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="system"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <short value="Code defined by a terminology system"/>
      <definition value="A reference to a code defined by a terminology system."/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonCode.coding:snomedReasonCode">
      <path value="MedicationStatement.reasonCode.coding"/>
      <sliceName value="snomedReasonCode"/>
      <short value="Reason For Medication (SNOMED CT)"/>
      <definition value="A reference to a code defined by a terminology system."/>
      <comment
               value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true."/>
      <requirements
                    value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference
                     value="https://healthterminologies.gov.au/fhir/ValueSet/medication-reason-taken-1"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.1-8, C*E.10-22"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="union(., ./translation)"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonCode.text">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="MedicationStatement.reasonCode.text"/>
      <short value="Plain text representation of the concept"/>
      <definition
                  value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user."/>
      <comment
               value="Very often the text is the same as a displayName of one of the codings."/>
      <requirements
                    value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="CodeableConcept.text"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="C*E.9. But note many systems use C*E.2 for this"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data"/>
      </mapping>
      <mapping>
        <identity value="orim"/>
        <map
             value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"/>
      </mapping>
    </element>
    <element id="MedicationStatement.reasonReference">
      <path value="MedicationStatement.reasonReference"/>
      <short
             value="Condition or observation that supports why the medication is being/was taken"/>
      <definition
                  value="Condition or observation that supports why the medication is being/was taken."/>
      <comment
               value="This is a reference to a condition that is the reason why the medication is being/was taken.  If only a code exists, use reasonForUseCode."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.reasonReference"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/Observation"/>
      </type>
      <mapping>
        <identity value="workflow"/>
        <map value="…reasonReference"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code=&quot;reason for use&quot;].value"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="why"/>
      </mapping>
    </element>
    <element id="MedicationStatement.note">
      <path value="MedicationStatement.note"/>
      <short value="Further information about the statement"/>
      <definition
                  value="Provides extra information about the medication statement that is not conveyed by the other attributes."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.note"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Annotation"/>
      </type>
      <mapping>
        <identity value="workflow"/>
        <map value="…note"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".inboundRelationship[typeCode=SUBJ]/source[classCode=OBS,moodCode=EVN,code=&quot;annotation&quot;].value"/>
      </mapping>
    </element>
    <element id="MedicationStatement.dosage">
      <path value="MedicationStatement.dosage"/>
      <short value="Dosage information in an Australian healthcare context"/>
      <definition
                  value="Indicates how the medication is/was taken or should be taken by the patient."/>
      <comment
               value="The dates included in the dosage on a Medication Statement reflect the dates for a given dose.  For example, &quot;from November 1, 2016 to November 3, 2016, take one tablet daily and from November 4, 2016 to November 7, 2016, take two tablets daily.&quot;  It is expected that this specificity may only be populated where the patient brings in their labeled container or where the Medication Statement is derived from a MedicationRequest."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="MedicationStatement.dosage"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Dosage"/>
        <profile value="http://hl7.org.au/fhir/StructureDefinition/au-dosage"/>
      </type>
      <condition value="ele-1"/>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=COMP].target[classCode=SBADM, moodCode=INT]"/>
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="MedicationStatement">
      <path value="MedicationStatement"/>
      <short
             value="A record of medication being taken by a patient in an Australian healthcare context"/>
    </element>
    <element id="MedicationStatement.extension">
      <path value="MedicationStatement.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
    </element>
    <element id="MedicationStatement.extension:longTerm">
      <path value="MedicationStatement.extension"/>
      <sliceName value="longTerm"/>
      <short value="Medication Long Term Indicator"/>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org.au/fhir/StructureDefinition/medication-long-term"/>
      </type>
    </element>
    <element id="MedicationStatement.extension:brandName">
      <path value="MedicationStatement.extension"/>
      <sliceName value="brandName"/>
      <short value="Medication Brand Name"/>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org.au/fhir/StructureDefinition/medication-brand-name"/>
      </type>
    </element>
    <element id="MedicationStatement.extension:genericName">
      <path value="MedicationStatement.extension"/>
      <sliceName value="genericName"/>
      <short value="Medication Generic Drug Name"/>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org.au/fhir/StructureDefinition/medication-generic-name"/>
      </type>
    </element>
    <element id="MedicationStatement.medication[x]">
      <path value="MedicationStatement.medication[x]"/>
      <slicing>
        <discriminator>
          <type value="type"/>
          <path value="$this"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <short value="Medication Detail"/>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org.au/fhir/StructureDefinition/au-medication"/>
      </type>
    </element>
    <element id="MedicationStatement.medication[x]:medicationCoded">
      <path value="MedicationStatement.medication[x]"/>
      <sliceName value="medicationCoded"/>
      <short value="Coded Medication"/>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <constraint>
        <key value="inv-amt-tpuu"/>
        <severity value="error"/>
        <human value="AMT TPUU valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPDSF&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPDSF&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-tpuu-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-tpp"/>
        <severity value="error"/>
        <human value="AMT TPU valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPG&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPG&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-tpp-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-tp"/>
        <severity value="error"/>
        <human value="AMT TP valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPD&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPD&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-tp-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amp-mpuu"/>
        <severity value="error"/>
        <human value="AMT MPUU valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPDSF&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPDSF&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-mpuu-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-mpp"/>
        <severity value="error"/>
        <human value="AMT MPP valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPG&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPG&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-mpp-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-mp"/>
        <severity value="error"/>
        <human value="AMT MP valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPD&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;UPD&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-mp-codes&#39;"/>
      </constraint>
      <constraint>
        <key value="inv-amt-ctpp"/>
        <severity value="error"/>
        <human value="AMT CTPP valueset membership required"/>
        <expression
                    value="coding.exists(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPGC&#39;) implies coding.where(system=&#39;http://snomed.info/sct&#39; and extension.where(url=&#39;http://hl7.org.au/fhir/CodeSystem/medication-type&#39;).valueCoding=&#39;BPGC&#39;).code in &#39;http://hl7.org.au/fhir/ValueSet/amt-ctpp-codes&#39;"/>
      </constraint>
    </element>
    <element id="MedicationStatement.medication[x]:medicationCoded.coding">
      <path value="MedicationStatement.medication[x].coding"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="system"/>
        </discriminator>
        <discriminator>
          <type value="value"/>
          <path value="code"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <short value="Medication Codes"/>
    </element>
    <element id="MedicationStatement.medication[x]:medicationCoded.coding:pbs">
      <path value="MedicationStatement.medication[x].coding"/>
      <sliceName value="pbs"/>
      <short value="PBS Item Code"/>
      <definition
                  value="PBS code from http://pbs.gov.au/code/item. Use of PBS as a code to refer to a type of medication, this excludes implication of context based on the PBS code. Where context is to be implied or stated PBS code needs to be associated with recording a prescription (MedicationRequest) or dispense record(MedicationDispense)"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference value="http://hl7.org.au/fhir/ValueSet/pbs-item"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="MedicationStatement.medication[x]:medicationCoded.coding:gtin">
      <path value="MedicationStatement.medication[x].coding"/>
      <sliceName value="gtin"/>
      <short value="Medication Package Global Trade Item Number (GTIN)"/>
      <definition value="GTIN value from http://www.gs1.org/gtin."/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference value="http://hl7.org.au/fhir/ValueSet/gtin"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="MedicationStatement.medication[x]:medicationCoded.coding:amt">
      <path value="MedicationStatement.medication[x].coding"/>
      <sliceName value="amt"/>
      <short value="AMT Medicines"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference
                     value="https://healthterminologies.gov.au/fhir/ValueSet/australian-medication-1"/>
        </valueSetReference>
      </binding>
    </element>
    <element
             id="MedicationStatement.medication[x]:medicationCoded.coding:amt.extension">
      <path value="MedicationStatement.medication[x].coding.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
    </element>
    <element
             id="MedicationStatement.medication[x]:medicationCoded.coding:amt.extension:medicationClass">
      <path value="MedicationStatement.medication[x].coding.extension"/>
      <sliceName value="medicationClass"/>
      <short value="Class of Medication Coding"/>
      <definition
                  value="General category of coding to allow usage of codes to be distinguished from the same CodeSystem"/>
      <max value="1"/>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org.au/fhir/StructureDefinition/medication-type"/>
      </type>
    </element>
    <element
             id="MedicationStatement.medication[x]:medicationCoded.coding:amt.extension:medicationClass.valueCoding:valueCoding">
      <path
            value="MedicationStatement.medication[x].coding.extension.valueCoding"/>
      <sliceName value="valueCoding"/>
      <fixedCoding>
        <system value="http://hl7.org.au/fhir/CodeSystem/medication-type"/>
        <code value="BPG"/>
        <display value="Branded package with no container"/>
      </fixedCoding>
    </element>
    <element
             id="MedicationStatement.medication[x]:medicationCoded.coding:mimsPackage">
      <path value="MedicationStatement.medication[x].coding"/>
      <sliceName value="mimsPackage"/>
      <short value="MIMS Package"/>
      <max value="1"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference value="http://hl7.org.au/fhir/ValueSet/mims"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="MedicationStatement.medication[x]:medicationReference">
      <path value="MedicationStatement.medication[x]"/>
      <sliceName value="medicationReference"/>
      <short value="Medication Reference"/>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org.au/fhir/StructureDefinition/au-medication"/>
      </type>
    </element>
    <element id="MedicationStatement.reasonNotTaken.coding">
      <path value="MedicationStatement.reasonNotTaken.coding"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="system"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
    </element>
    <element id="MedicationStatement.reasonNotTaken.coding:snomedReasonNotTaken">
      <path value="MedicationStatement.reasonNotTaken.coding"/>
      <sliceName value="snomedReasonNotTaken"/>
      <short value="Reason Not Taken (SNOMED CT)"/>
      <max value="1"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference
                     value="https://healthterminologies.gov.au/fhir/ValueSet/medication-reason-not-taken-1"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="MedicationStatement.reasonCode.coding">
      <path value="MedicationStatement.reasonCode.coding"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="system"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
    </element>
    <element id="MedicationStatement.reasonCode.coding:snomedReasonCode">
      <path value="MedicationStatement.reasonCode.coding"/>
      <sliceName value="snomedReasonCode"/>
      <short value="Reason For Medication (SNOMED CT)"/>
      <max value="1"/>
      <binding>
        <strength value="required"/>
        <valueSetReference>
          <reference
                     value="https://healthterminologies.gov.au/fhir/ValueSet/medication-reason-taken-1"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="MedicationStatement.dosage">
      <path value="MedicationStatement.dosage"/>
      <type>
        <code value="Dosage"/>
        <profile value="http://hl7.org.au/fhir/StructureDefinition/au-dosage"/>
      </type>
    </element>
  </differential>
</StructureDefinition>