<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="cyehr-sd-medication-r4" />
  <meta>
    <versionId value="9" />
    <lastUpdated value="2022-12-20T09:34:10.8613771+00:00" />
  </meta>
  <url value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-medication-r4" />
  <name value="CYEHRSDMedication" />
  <title value="Cyprus EHR Medication profile" />
  <status value="draft" />
  <experimental value="true" />
  <date value="2022-03-19T16:09:47.3549741Z" />
  <publisher value="eHealth4U" />
  <contact>
    <name value="eHealth Lab (University of Cyprus)" />
    <telecom>
      <system value="email" />
      <value value="ehealthl@ucy.ac.cy" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="The profile for representing a medication product in the following cases:&#xD;&#xA;(1) as registered by the Pharmaceutical Services of Ministry of Health of Cyprus &#xD;&#xA;(2) as recorded by a medical doctor in the Medication History section of a patient's EHR" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Medication" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Medication" />
  <derivation value="constraint" />
  <differential>
    <element id="Medication">
      <path value="Medication" />
      <constraint>
        <key value="cyehr-medication-1" />
        <severity value="error" />
        <human value="If the medication is registered by the Cyprus Drug Information System then the following SHALL be provided: (1) a code using ATC terminology, (2) a form using EDQM standard and (3) the product extension." />
        <expression value="identifier.where(system='2.16.840.1.113883.3.9143.2.3.1').exists() implies (code.coding.where(system='http://fhir.de/CodeSystem/dimdi/atc').exists() and form.coding.where(system ='http://standardterms.edqm.eu').exists() and extension('http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-medicinalproductdefinition').exists())" />
      </constraint>
      <constraint>
        <key value="cyehr-medication-2" />
        <severity value="error" />
        <human value="If the medication is registered by the Cyprus Drug Information System and the MedicinalProductDefinition extension exists then the following SHALL be provided: (1) the name (both productName and namePartStrength) , (2) the product.description and (3) the product.routeOfAdministration." />
        <expression value="(identifier.where(system='2.16.840.1.113883.3.9143.2.3.1').exists() and extension('http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-medicinalproductdefinition').exists()) implies (extension('http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-medicinalproductdefinition').extension('name').exists() and extension('http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-medicinalproductdefinition').extension('name').extension('namePartStrength').exists() and extension('http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-medicinalproductdefinition').extension('description').exists() and extension('http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-medicinalproductdefinition').extension('routeOfAdministration').exists())" />
      </constraint>
    </element>
    <element id="Medication.meta">
      <path value="Medication.meta" />
    </element>
    <element id="Medication.meta.profile">
      <path value="Medication.meta.profile" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Medication.meta.profile:cyprusEHRProfile">
      <path value="Medication.meta.profile" />
      <sliceName value="cyprusEHRProfile" />
      <comment value="It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set.&#xD;&#xA;&#xD;&#xA;CyprusEHR: All downstream projects using Medication resource of Cyprus EHR should conform to http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-medication-r4" />
      <min value="1" />
      <max value="1" />
      <fixedCanonical value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-medication-r4" />
    </element>
    <element id="Medication.extension">
      <path value="Medication.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="Medication.extension:product">
      <path value="Medication.extension" />
      <sliceName value="product" />
      <short value="Medicinal product definition elements for products as registered by the Cyprus Drug Information System" />
      <definition value="CyprusEHR: Short definition of a medicinal product as registered by the Cyprus Drug Information System (CYPDIS). It SHALL be used when a medication has a cypdis identifier." />
      <comment value="CyprusEHR: Inspired by: http://hl7.org/fhir/5.0.0-snapshot1/medicinalproductdefinition.html" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-medicinalproductdefinition" />
      </type>
    </element>
    <element id="Medication.extension:product.extension">
      <path value="Medication.extension.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="Medication.extension:product.extension:routeOfAdministration">
      <path value="Medication.extension.extension" />
      <sliceName value="routeOfAdministration" />
      <min value="0" />
    </element>
    <element id="Medication.extension:product.extension:routeOfAdministration.value[x].coding">
      <path value="Medication.extension.extension.value[x].coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Medication.extension:marketingAuthorizationHolder">
      <path value="Medication.extension" />
      <sliceName value="marketingAuthorizationHolder" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-marketingauthorizationholder" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Medication.identifier">
      <path value="Medication.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Medication.identifier.use">
      <path value="Medication.identifier.use" />
      <mustSupport value="true" />
    </element>
    <element id="Medication.identifier.system">
      <path value="Medication.identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="Medication.identifier.value">
      <path value="Medication.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="Medication.identifier:cypdis">
      <path value="Medication.identifier" />
      <sliceName value="cypdis" />
      <short value="CYPDIS identifier" />
      <definition value="Business identifier for this medication.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The Cyprus Drug Information System identifier." />
      <comment value="The serial number could be included as an identifier.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The Cyprus Drug Information System barcode is used as an identifier for the registered drugs. The &quot;barcode&quot; field is constructed as the concatenation of the drugId and the packNr. If any of these two fields are required to be recorded per each CYPDIS drug, an extension should be created and be used individually for all the cypdis drugs." />
      <max value="1" />
      <patternIdentifier>
        <use value="official" />
        <system value="urn:oid:2.16.840.1.113883.3.9143.2.3.1" />
      </patternIdentifier>
      <mustSupport value="true" />
    </element>
    <element id="Medication.identifier:cypdis.use">
      <path value="Medication.identifier.use" />
      <mustSupport value="true" />
    </element>
    <element id="Medication.identifier:cypdis.type">
      <path value="Medication.identifier.type" />
      <definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.&#xD;&#xA;&#xD;&#xA;CyprusEHR: not to be used for Cyprus EHR" />
    </element>
    <element id="Medication.identifier:cypdis.system">
      <path value="Medication.identifier.system" />
      <definition value="Establishes the namespace for the value - that is, a URL that describes a set values that are unique.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The OID as registered by NeHA for the Cyprus Drug Information System id." />
      <min value="1" />
      <example>
        <label value="CYPDIS OID" />
        <valueUri value="urn:oid:2.16.840.1.113883.3.9143.2.3.1" />
      </example>
      <mustSupport value="true" />
    </element>
    <element id="Medication.identifier:cypdis.value">
      <path value="Medication.identifier.value" />
      <short value="CYPDIS barcode" />
      <definition value="The portion of the identifier typically relevant to the user and which is unique within the context of the system.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Cyprus Drug Information System uses barcode as the combination of drugID and packNR for each medication." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Medication.identifier:cypdis.period">
      <path value="Medication.identifier.period" />
      <definition value="Time period during which identifier is/was valid for use.&#xD;&#xA;CyprusEHR: not to be used for Cyprus EHR" />
    </element>
    <element id="Medication.identifier:cypdis.assigner">
      <path value="Medication.identifier.assigner" />
      <definition value="Organization that issued/manages the identifier.&#xD;&#xA;CyprusEHR: not to be used for Cyprus EHR" />
    </element>
    <element id="Medication.identifier:cypdis.assigner.reference">
      <path value="Medication.identifier.assigner.reference" />
      <min value="1" />
    </element>
    <element id="Medication.code">
      <path value="Medication.code" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Medication.code.coding">
      <path value="Medication.code.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Medication.code.coding:atcCode">
      <path value="Medication.code.coding" />
      <sliceName value="atcCode" />
      <patternCoding>
        <system value="http://www.whocc.no/atc" />
      </patternCoding>
      <binding>
        <strength value="required" />
        <description value="All codes from system http://www.whocc.no/atc" />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiactiveingredient" />
      </binding>
    </element>
    <element id="Medication.code.coding:atcCode.system">
      <path value="Medication.code.coding.system" />
      <min value="1" />
    </element>
    <element id="Medication.code.coding:atcCode.code">
      <path value="Medication.code.coding.code" />
      <min value="1" />
    </element>
    <element id="Medication.code.coding:atcCode.display">
      <path value="Medication.code.coding.display" />
      <min value="1" />
    </element>
    <element id="Medication.code.coding:eHDSIAbsentOrUnknownMedication">
      <path value="Medication.code.coding" />
      <sliceName value="eHDSIAbsentOrUnknownMedication" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiabsentorunknownmedication" />
      </binding>
    </element>
    <element id="Medication.code.coding:eHDSIAbsentOrUnknownMedication.system">
      <path value="Medication.code.coding.system" />
      <min value="1" />
    </element>
    <element id="Medication.code.coding:eHDSIAbsentOrUnknownMedication.code">
      <path value="Medication.code.coding.code" />
      <min value="1" />
    </element>
    <element id="Medication.code.coding:eHDSIAbsentOrUnknownMedication.display">
      <path value="Medication.code.coding.display" />
      <min value="1" />
    </element>
    <element id="Medication.status">
      <path value="Medication.status" />
      <comment value="This status is intended to identify if the medication in a local system is in active use within a drug database or inventory.  For example, a pharmacy system may create a new drug file record for a compounded product &quot;ABC Hospital Special Cream&quot; with an active status.  At some point in the future, it may be determined that the drug record was created with an error and the status is changed to &quot;entered in error&quot;.   This status is not intended to specify if a medication is part of a particular formulary.  It is possible that the drug record may be referenced by multiple formularies or catalogues and each of those entries would have a separate status.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Not to be used in the context of Cyprus EHR." />
    </element>
    <element id="Medication.manufacturer">
      <path value="Medication.manufacturer" />
      <short value="Describes the details of the manufacturer of the medication product. This is not intended to represent the distributor of a medication product." />
      <definition value="Describes the details of the manufacturer of the medication product. This is not intended to represent the distributor of a medication product." />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Not to be used in the context of Cyprus EHR. Use the extension marketingAuthorizationHolder instead." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-organization-r4" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
    </element>
    <element id="Medication.form">
      <path value="Medication.form" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Medication.form.coding">
      <path value="Medication.form.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="A reference to a code defined by a terminology system. &#xD;&#xA;&#xD;&#xA;CyprusEHR: If a medication is provided by the Cyprus Drug Information System (CYPDIS), an EDQM form dose code SHALL be defined." />
      <min value="1" />
    </element>
    <element id="Medication.form.coding:edqmCode">
      <path value="Medication.form.coding" />
      <sliceName value="edqmCode" />
      <binding>
        <strength value="required" />
        <description value="EDQM Dose Form codes." />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsidoseform" />
      </binding>
    </element>
    <element id="Medication.form.coding:edqmCode.system">
      <path value="Medication.form.coding.system" />
      <min value="1" />
    </element>
    <element id="Medication.form.coding:edqmCode.code">
      <path value="Medication.form.coding.code" />
      <min value="1" />
    </element>
    <element id="Medication.form.coding:edqmCode.display">
      <path value="Medication.form.coding.display" />
      <min value="1" />
    </element>
    <element id="Medication.amount">
      <path value="Medication.amount" />
      <label value="Total Volume" />
      <definition value="Specific amount of the drug in the packaged product. For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.)." />
      <comment value="The Ratio datatype should only be used to express a relationship of two numbers if the relationship cannot be suitably expressed using a Quantity and a common unit.  Where the denominator value is known to be fixed to &quot;1&quot;, Quantity should be used instead of Ratio.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Not to be used in the context of Cyprus EHR." />
    </element>
    <element id="Medication.ingredient">
      <path value="Medication.ingredient" />
      <comment value="The ingredients need not be a complete list.  If an ingredient is not specified, this does not indicate whether an ingredient is present or absent.  If an ingredient is specified it does not mean that all ingredients are specified.  It is possible to specify both inactive and active ingredients.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Not to be used in the context of Cyprus EHR." />
    </element>
    <element id="Medication.batch">
      <path value="Medication.batch" />
      <comment value="CyprusEHR: Not to be used in the context of Cyprus EHR." />
    </element>
  </differential>
</StructureDefinition>