<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="dcae1550-a48a-4d44-a431-73c47c9dd075" />
  <meta>
    <versionId value="1" />
    <lastUpdated value="2020-04-15T13:33:29.383+00:00" />
  </meta>
  <url value="http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest" />
  <name value="NLLMedicationRequest" />
  <status value="draft" />
  <date value="2020-04-15T13:33:28.2761048Z" />
  <fhirVersion value="4.0.0" />
  <mapping>
    <identity value="EHM" />
    <name value="E-hälsomyndigheten internal model" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="MedicationRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="MedicationRequest">
      <path value="MedicationRequest" />
      <short value="A prescription" />
      <definition value="MedicationRequest in the National Swedish Medication List is used for prescriptions.&#xD;&#xA;A prescription can be made for either a medicine package or for a reimbursed consumable." />
    </element>
    <element id="MedicationRequest.extension">
      <path value="MedicationRequest.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.extension:nllPatientTreatmentReason">
      <path value="MedicationRequest.extension" />
      <sliceName value="nllPatientTreatmentReason" />
      <short value="The treatment reason described for the patient" />
      <definition value="The reason for the treatment described in a way that is understood by the patient (behandlingsändamål). &#xD;&#xA;A text from &quot;Nationell källa för ordinationsorsak&quot; which is a code system that is defined by the Swedish National Board of Health and Welfare (Socialstyrelsen). The code system consists of SnomedCT codes for reasons (behandlingsorsak). Each medical product has of a selection of valid SnomedCT reason codes, and in connection with the codes are the available patient reasons. The corresponding patient text should be entered here in &quot;nllPatientTreatmentReason&quot;, and the SnomedCT reason code (behandlingsorsak) should be entered in &quot;reasonCode&quot;." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLPatientTreatmentReason" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Behandlingsinformation.Behandlingsändamål" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension:nllPrescriptionChain">
      <path value="MedicationRequest.extension" />
      <sliceName value="nllPrescriptionChain" />
      <short value="Prescription chain id" />
      <definition value="An id used to identify all prescriptions in one prescription chain.&#xD;&#xA;A prescription chain is a set of prescriptions that are linked together in chronological order (The attribute priorPrescription is used to find the previos prescription). This is not to be confused with prescription version.&#xD;&#xA;A prescription chain is used when a prescription is renewed or replaced. The purpose is to be able provide a grouping of related prescriptions." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionChain" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Förskrivningskedja" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension:nllMedicationListVersion">
      <path value="MedicationRequest.extension" />
      <sliceName value="nllMedicationListVersion" />
      <short value="Medication list version" />
      <definition value="The version of the patients medication list as considered when this MedicationRequest was created or updated." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/Version" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Läkemedelslisteversion.Senaste version" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension:nllMedicationListVersion.value[x]">
      <path value="MedicationRequest.extension.value[x]" />
      <min value="1" />
    </element>
    <element id="MedicationRequest.extension:nllPrescriptionFormat">
      <path value="MedicationRequest.extension" />
      <sliceName value="nllPrescriptionFormat" />
      <short value="Current prescription format" />
      <definition value="Current prescription format can be either &quot;electronic&quot; (Elektroniskt) or &quot;paper&quot; (Papper). If the prescription has been printed out on paper, i.e. the format is &quot;paper&quot; , then the patient needs to bring the print-out with him to the pharmacy be able to get a dispense." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionFormat" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/prescription-format" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Aktuellt format" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension:nllTreatmentdates">
      <path value="MedicationRequest.extension" />
      <sliceName value="nllTreatmentdates" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLTreatmentdates" />
      </type>
    </element>
    <element id="MedicationRequest.extension:nllRegistrationBasis">
      <path value="MedicationRequest.extension" />
      <sliceName value="nllRegistrationBasis" />
      <short value="Format for prescription registration" />
      <definition value="The format of the basis for the registration of the prescription. A prescriber can register a prescirption as en electronic prescription, or as a paper prescription. A pharmacy can also register a prescription based on a fax or a phone call from a prescriber.&#xD;&#xA;This value is entered when creating the prescription, and is never updated." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLRegistrationBasis" />
      </type>
      <mapping>
        <identity value="EHM" />
        <map value="Typ av registreringsunderlag" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension:nllUsageDates">
      <path value="MedicationRequest.extension" />
      <sliceName value="nllUsageDates" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLUsageDates" />
      </type>
    </element>
    <element id="MedicationRequest.identifier">
      <path value="MedicationRequest.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.identifier:NEF">
      <path value="MedicationRequest.identifier" />
      <sliceName value="NEF" />
      <short value="Legacy ids used in NEF and OR" />
      <definition value="Ids used for identifying prescriptions originally created in NEF or OR.&#xD;&#xA;In OR this corresponds to originalOrdinationsId, which is the same as PrescriptionSetId in NEF. In OR a originalOrdinationsId/PrescriptionSetId always correspons to one unique prescription.&#xD;&#xA;In NEF the combination of PrescriptionSetId-PrescriptionItemId corresponds to one unique prescription.&#xD;&#xA;PrescriptionItemId is made up from RowId-ProductRowId.&#xD;&#xA;originalOrdinationsId/PrescriptionSetId is in the form of a UUID.&#xD;&#xA;RowId and ProductRowId are counters." />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.identifier:NEF.extension">
      <path value="MedicationRequest.identifier.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.identifier:NEF.extension:NEFIdParts">
      <path value="MedicationRequest.identifier.extension" />
      <sliceName value="NEFIdParts" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLNEFId" />
      </type>
    </element>
    <element id="MedicationRequest.identifier:NEF.extension:NEFIdParts.extension">
      <path value="MedicationRequest.identifier.extension.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.identifier:NEF.extension:NEFIdParts.extension:PrescriptionSetId">
      <path value="MedicationRequest.identifier.extension.extension" />
      <sliceName value="PrescriptionSetId" />
      <definition value="NEF: PrescriptionSetId, OR: Originalordinationsid is a legacy identifier used by NEF/PIRR and OR. Every prescription created by systems connected before Swedish National Medication List will have a PrescriptionSetId/orignalordinationsid. However, it does not allways identify a unique prescription. To search for a unique prescriptions the RowId/radnummer and ProductRowId/produktradnummer may be needed as well." />
    </element>
    <element id="MedicationRequest.identifier:NEF.system">
      <path value="MedicationRequest.identifier.system" />
      <min value="1" />
      <fixedUri value="http://electronichealth.se/fhir/CodeSystem/NEFId" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.identifier:NEF.value">
      <path value="MedicationRequest.identifier.value" />
      <short value="The complete NEFid" />
      <definition value="The complete NEFid for the specific prescribed article, i.e. a combination of PrescriptionSetId and PrescriptionItemId where applicable. &#xD;&#xA;PrescriptionItemId is made up from RowId-ProductRowId.&#xD;&#xA;In OR only PrescriptionSetId/originalOrdinationsId is used.&#xD;&#xA;originalOrdinationsId/PrescriptionSetId is in the form of a UUID.&#xD;&#xA;RowId and ProductRowId are counters.&#xD;&#xA;The format is &quot;PrescriptionSetId/Originalordinationsid - PrescriptionItemid/RadnummerNEF&quot;,  i.e. UUID-x-y. Example 123e4567-e89b-12d3-a456-426655440000-2-1, where the ending &quot;2-1&quot; are RowId-ProductRowId." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.status">
      <path value="MedicationRequest.status" />
      <short value="active | on-hold | cancelled | completed | stopped | unknown" />
      <definition value="The status of the prescription. The following statuses will be used: active, cancelled, on-hold (suspended), completed and stopped. The following statuses will not be used: entered-in-error, draft and unknown." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/medication-request-status" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Förskrivning.Förskrivningsstatus" />
      </mapping>
    </element>
    <element id="MedicationRequest.statusReason">
      <path value="MedicationRequest.statusReason" />
      <definition value="Calculated be the Swedish E-health Agency.&#xD;&#xA;Reason for the current status of the prescription." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/medication-request-status-reason" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Förskrivningsstatusorsak" />
      </mapping>
    </element>
    <element id="MedicationRequest.statusReason.coding">
      <path value="MedicationRequest.statusReason.coding" />
      <max value="1" />
    </element>
    <element id="MedicationRequest.statusReason.coding.system">
      <path value="MedicationRequest.statusReason.coding.system" />
      <min value="1" />
    </element>
    <element id="MedicationRequest.statusReason.coding.code">
      <path value="MedicationRequest.statusReason.coding.code" />
      <min value="1" />
    </element>
    <element id="MedicationRequest.intent">
      <path value="MedicationRequest.intent" />
      <definition value="A prescription is always an order." />
      <fixedCode value="order" />
    </element>
    <element id="MedicationRequest.priority">
      <path value="MedicationRequest.priority" />
      <short value="urgent" />
      <definition value="Shall only be used for dose dispensed prescriptions. Indicates that actions may need to be taken before next ordinary production date." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/medication-dispense-priority" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för dosdispenserat recept.Akut förändring" />
      </mapping>
    </element>
    <element id="MedicationRequest.medication[x]">
      <path value="MedicationRequest.medication[x]" />
      <short value="Prescribed product" />
      <definition value="Identifies the medical product being prescribed. The codes used are Swedish NplPackId for medicine packages and Varunr for reimbursed consumables." />
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="Swedish medicine packages and reimbursed consumables." />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/medicines-consumables" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Artikel.Läkemedelsartikel.NPL Pack id" />
      </mapping>
      <mapping>
        <identity value="EHM" />
        <map value="Artikel.Handelsvaruartikel.Varunummer" />
      </mapping>
    </element>
    <element id="MedicationRequest.medication[x].coding">
      <path value="MedicationRequest.medication[x].coding" />
      <definition value="Varunr only one&#xD;&#xA;NPLId + NPLPackId" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="MedicationRequest.subject">
      <path value="MedicationRequest.subject" />
      <short value="Who the prescription is for" />
      <definition value="Patient resource representing the person to whom the medical product will be given.&#xD;&#xA;When the patient has a Swedish personal identity number (personnummer) the patient shall be provided as a referenced Patient resorce. If the patient does not have a Swedish personal identity number the Patient resource should be contained in the MedicationRequest resource." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLPatient" />
        <aggregation value="contained" />
        <aggregation value="referenced" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Patient" />
      </mapping>
    </element>
    <element id="MedicationRequest.authoredOn">
      <path value="MedicationRequest.authoredOn" />
      <short value="When prescription was initially authored" />
      <definition value="The date when the prescription was authored." />
      <min value="1" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Förskrivning.Utfärdandedatum" />
      </mapping>
    </element>
    <element id="MedicationRequest.requester">
      <path value="MedicationRequest.requester" />
      <short value="The practitioner who prescribed the medical product" />
      <definition value="The practitioner who prescribed the medical product" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLPractitioner" />
        <aggregation value="contained" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Personal.Förskrivare" />
      </mapping>
    </element>
    <element id="MedicationRequest.reasonCode">
      <path value="MedicationRequest.reasonCode" />
      <short value="The reason stated by the pratitioner" />
      <definition value="Mandatory when prescribing medications. Should not be used for reimbursed consumables.&#xD;&#xA;The reason stated by the practitioner for ordering a medical product (behandlingsorsak). A code from &quot;Nationell källa för ordinationsorsak&quot; which is a code system that is defined by the Swedish National Board of Health and Welfare (Socialstyrelsen). The code system consists of SnomedCT codes for reasons. Each medical product has of a selection of valid SnomedCT reason codes.&#xD;&#xA;The reason shall also be expressed in a way that can be easily understood by the patient (behandlingsändamål). This should be entered in nllPatientTreatmentReason.&#xD;&#xA;If there is no available code that describes the reason, then the code &quot;OTH&quot; (Other) shall be used. In that case a text describing the reason must be provided in reasonCode.text." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/nll-snomed-behandlingsorsak" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Orsak till behandling.Behandlingsorsak" />
      </mapping>
    </element>
    <element id="MedicationRequest.reasonCode.coding">
      <path value="MedicationRequest.reasonCode.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="MedicationRequest.reasonCode.text">
      <path value="MedicationRequest.reasonCode.text" />
      <short value="Other reason" />
      <definition value="It no code could be chosen from &quot;Nationell källa för ordinationsorsak&quot; an other reason may be entered here." />
      <mapping>
        <identity value="EHM" />
        <map value="Orsak till behandling.Beskrivning annan behandlingsorsak" />
      </mapping>
    </element>
    <element id="MedicationRequest.note">
      <path value="MedicationRequest.note" />
      <definition value="Prescriptions in the Swedish National Medication List can contain 4 different kinds of notes:&#xD;&#xA;pre=Prescribers comment (Förskrivarens kommentar, read/write)&#xD;&#xA;pha=Pharmacists comment (Apotekets kommentar, read/write)&#xD;&#xA;not=Prescribers note (Notat förskrivare, read only, will be phased out)&#xD;&#xA;dli=Delivery message (Leveransmeddelande, read only, will be phased out)" />
      <max value="4" />
      <type>
        <code value="Annotation" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLAnnotation" />
      </type>
    </element>
    <element id="MedicationRequest.note.extension">
      <path value="MedicationRequest.note.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.note.extension:nllCoding">
      <path value="MedicationRequest.note.extension" />
      <sliceName value="nllCoding" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/medreq-note-types" />
      </binding>
    </element>
    <element id="MedicationRequest.dosageInstruction">
      <path value="MedicationRequest.dosageInstruction" />
      <short value="How the medication should be taken" />
      <definition value="Mandatory for medications and technical spirit" />
      <type>
        <code value="Dosage" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLDosage" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.extension">
      <path value="MedicationRequest.dosageInstruction.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.dosageInstruction.extension:nllAdministeringInstruction">
      <path value="MedicationRequest.dosageInstruction.extension" />
      <sliceName value="nllAdministeringInstruction" />
    </element>
    <element id="MedicationRequest.dosageInstruction.extension:nllAdministeringInstruction.value[x]">
      <path value="MedicationRequest.dosageInstruction.extension.value[x]" />
      <mapping>
        <identity value="EHM" />
        <map value="Administreringsinstruktion" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest">
      <path value="MedicationRequest.dispenseRequest" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.extension">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllNumberOfPackagesPrescribed">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllNumberOfPackagesPrescribed" />
      <short value="Number of packages prescribed per dispense" />
      <definition value="The number of packages prescribed per dispense. Not used for dose dispensed prescriptions." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfPackagesPrescribed" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för helförpackning.Antal förpackningar" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllDosePackaging">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllDosePackaging" />
      <short value="Dose dispensed prescription" />
      <definition value="Indicates if the prescriptions should be dose dispensed." />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLDosePackaging" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllPrescriptionCommunicableDiseasesAct">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllPrescriptionCommunicableDiseasesAct" />
      <short value="Prescription according to the Communicable Diseases Act" />
      <definition value="Indicates of the prescription is created according to the Communicable Diseases Act (Smittskyddslagen)" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionCommunicableDiseasesAct" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Förskrivning enligt smittskyddslagen" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllPatientPharmaceuticalBenefitsAct">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllPatientPharmaceuticalBenefitsAct" />
      <short value="Patient eligible to benefits" />
      <definition value="Indicates if the patient is eligible to benefits according to the Pharmaceutical Benefits Act (Lag (2002:160) om läkemedelsförmån)" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLPatientPharmaceuticalBenefitsAct" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Patient förmånsberättigad" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllConditionsPharmaceuticalBenefitsAct">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllConditionsPharmaceuticalBenefitsAct" />
      <short value="Pharmaceutical benefits act conditions" />
      <definition value="Indicats if the conditions in the Pharmaceutical Benefits Act have been filled (Lag (2002:160) om läkemedelsförmån) when prescribing the chosen treatment." />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLConditionsPharmaceuticalBenefitsAct" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Förmånsvillkor uppfyllda" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllTotalQuantity">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllTotalQuantity" />
      <short value="Amount of medication to supply in total" />
      <definition value="Amount of medication to supply in total for this prescription. Calculated be the Swedish E-health Agency." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLTotalQuantity" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/dose-quantity-units" />
      </binding>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllTotalQuantity.extension">
      <path value="MedicationRequest.dispenseRequest.extension.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllTotalQuantity.extension:prescibed">
      <path value="MedicationRequest.dispenseRequest.extension.extension" />
      <sliceName value="prescibed" />
      <short value="Total amount prescribed" />
      <definition value="Total amount prescribed in this prescription. Calculated by the Swedish e-health Agency. Not used for dose dispensed prescriptions." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för helförpackning.Förskriven mängd" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllTotalQuantity.extension:prescibed.value[x]">
      <path value="MedicationRequest.dispenseRequest.extension.extension.value[x]" />
      <min value="1" />
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllTotalQuantity.extension:remaining">
      <path value="MedicationRequest.dispenseRequest.extension.extension" />
      <sliceName value="remaining" />
      <short value="Quantity remaining" />
      <definition value="The remaining quantity that may be dispensed for this prescription. Not used for dose dispensed prescriptions." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Förskrivningssaldo.Mängd kvar" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllTotalQuantity.extension:remaining.value[x]">
      <path value="MedicationRequest.dispenseRequest.extension.extension.value[x]" />
      <min value="1" />
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllBenefitDetails">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllBenefitDetails" />
      <short value="Benefit calculation information" />
      <definition value="Information needed for calculating benefit" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLBenefitDetails" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllBenefitDetails.extension">
      <path value="MedicationRequest.dispenseRequest.extension.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllBenefitDetails.extension:dateNextDispenseBenefit">
      <path value="MedicationRequest.dispenseRequest.extension.extension" />
      <sliceName value="dateNextDispenseBenefit" />
      <definition value="The earliest date for the next dispense with benefit. Set by the dispensing pharmacy. Not used for dose dispensed prescriptions." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Förmånsdetaljer.Nästa uttag inom förmån" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllBenefitDetails.extension:dailyQuantityBenefit">
      <path value="MedicationRequest.dispenseRequest.extension.extension" />
      <sliceName value="dailyQuantityBenefit" />
      <definition value="Calculated daily quantity within benefit. Calculated by the dispensing pharmacy. Not used for dose dispensed prescriptions." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Förmånsdetaljer.Daglig mängd förmån" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllBenefitDetails.extension:dailyQuantityBenefitCalculation">
      <path value="MedicationRequest.dispenseRequest.extension.extension" />
      <sliceName value="dailyQuantityBenefitCalculation" />
      <definition value="Indication if daily quantity is possible to calculate. Set by the dispensing pharmacist. Not used for dose dispensed prescriptions." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Förmånsdetaljer.Daglig mängd kan ej anges" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllNumberOfFillsRemaining">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllNumberOfFillsRemaining" />
      <short value="Number of fills remaining" />
      <definition value="The number of fills this prescriptions has remaining. Calculated by the Swedish E-health Agency. Not used for dose dispensed prescriptions." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfFillsRemaining" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllReceivingPharmacy">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllReceivingPharmacy" />
      <short value="Receiving Pharmacy" />
      <definition value="Receiving Pharmacy is used when the patient does not have a Swedish national identification number (&quot;personnummer&quot;). The patient has to pick up his/her medication at the receiving pharmacy where he/she is identified through name, birthdate and sex.&#xD;&#xA;The receiving pharmacy is tied to the physical adress. This means that if the premises are taken over by a different organization, the prescription will still be available at the same physical adress," />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLReceivingPharmacy" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för helförpackning.Mottagande apotek" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllReceivingPharmacy.value[x]">
      <path value="MedicationRequest.dispenseRequest.extension.value[x]" />
      <type>
        <code value="Reference" />
        <aggregation value="contained" />
      </type>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllPrescriberCostCenter">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllPrescriberCostCenter" />
      <short value="The prescribers cost center" />
      <definition value="The prescribers cost center code when making the prescription. Used for benefit billing from pharmacies to regions." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLPrescriberCostCenter" />
      </type>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllSubstitutionOpposed">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="nllSubstitutionOpposed" />
      <short value="PATIENT | APOTEK" />
      <definition value="Substitution is opposed (sv: bytes ej)" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLSubstitutionOpposed" />
      </type>
      <mapping>
        <identity value="EHM" />
        <map value="Bytes ej" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:nllSubstitutionOpposed.value[x].coding">
      <path value="MedicationRequest.dispenseRequest.extension.value[x].coding" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/substitution-opposition-type" />
      </binding>
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill">
      <path value="MedicationRequest.dispenseRequest.initialFill" />
      <short value="Indication for Trial Fill" />
      <definition value="Used for indicating &quot;Trial Fill&quot;. May only be one package, usually smallest package available. Not used for dose dispensed prescriptions." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för helförpackning.Startförpackning" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity" />
      <short value="Trial fill quantity, one package" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity.value">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity.value" />
      <min value="1" />
      <fixedDecimal value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity.unit">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity.unit" />
      <fixedString value="Package" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity.system">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity.system" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/ValueSet/ucum-units" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity.code">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity.code" />
      <min value="1" />
      <fixedCode value="{Package}" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.duration">
      <path value="MedicationRequest.dispenseRequest.initialFill.duration" />
      <max value="0" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval" />
      <definition value="Not used for dose dispensed prescriptions.&#xD;&#xA;The minimum period of time that must occur between dispenses of the medical product. Not used for dose dispensed prescriptions." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för helförpackning.Absolut expeditionsintervall" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval.value">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval.value" />
      <min value="1" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval.comparator">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval.comparator" />
      <max value="0" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval.unit">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval.unit" />
      <fixedString value="day" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval.system">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval.system" />
      <min value="1" />
      <fixedUri value="http://unitsofmeasure.org" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval.code">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval.code" />
      <min value="1" />
      <fixedCode value="d" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.validityPeriod">
      <path value="MedicationRequest.dispenseRequest.validityPeriod" />
      <definition value="This indicates the validity period of a prescription (stale dating the Prescription). I no validityPeriod.end is provided, then it will be calculated by the Swedish E-health Agency. The validity period may not be longer than one year." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.validityPeriod.extension">
      <path value="MedicationRequest.dispenseRequest.validityPeriod.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.dispenseRequest.validityPeriod.extension:nllFirstDispenseBefore">
      <path value="MedicationRequest.dispenseRequest.validityPeriod.extension" />
      <sliceName value="nllFirstDispenseBefore" />
      <short value="First dispense must occur before" />
      <definition value="Not used for dose dispensed prescriptions&#xD;&#xA;The first dispense must occur before this date. If not, the prescription will be invalidated. Not used for dose dispensed prescriptions." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLFirstDispenseBefore" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för helförpackning.Första uttag före" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.validityPeriod.end">
      <path value="MedicationRequest.dispenseRequest.validityPeriod.end" />
      <short value="Last date when dispensing is allowed" />
      <definition value="Last date when dispensing is allowed. If no date is provided it will be calculated by the Swedish E-health Agency." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Sista giltighetsdag" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.numberOfRepeatsAllowed">
      <path value="MedicationRequest.dispenseRequest.numberOfRepeatsAllowed" />
      <definition value="Not used for dose dispensed prescriptions.&#xD;&#xA;An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus &quot;3 repeats&quot;, then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.  A prescriber may explicitly say that zero refills are permitted after the initial dispense." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för helförpackning.Förskrivet antal uttag" />
        <comment value="NB! Förskrivet antal uttag -1" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest.quantity">
      <path value="MedicationRequest.dispenseRequest.quantity" />
      <definition value="The amount that is to be dispensed for one fill.&#xD;&#xA;Calculated by the Swedish E-health Agency based on nllNumberOfPackagesPrescibed and the quantity of medicaition in the package.&#xD;&#xA;Not used for dose dispensed prescriptions." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/dose-quantity-units" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Expedieringsdetaljer för helförpackning.Förskriven mängd per uttag" />
      </mapping>
    </element>
    <element id="MedicationRequest.substitution">
      <path value="MedicationRequest.substitution" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.substitution.allowed[x]">
      <path value="MedicationRequest.substitution.allowed[x]" />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Expedieringsdetaljer.Substitution ej tillåten" />
      </mapping>
    </element>
    <element id="MedicationRequest.priorPrescription">
      <path value="MedicationRequest.priorPrescription" />
      <short value="An order/prescription that is being replaced/renewed" />
      <definition value="When replacing or renewing a prescription, the version of the replaced/renewed prescription must be provided in the POST operation.&#xD;&#xA;When reading a prescription, the reference to the replaced/renewed prescription will not be version specific." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest" />
        <aggregation value="referenced" />
        <versioning value="either" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.detectedIssue">
      <path value="MedicationRequest.detectedIssue" />
      <short value="Automatic Format and Constitution Control (AFF) error or warning" />
      <definition value="Read only for MedicationRequest.&#xD;&#xA;Automatic Format and Constitution Control (AFF) warning generated by the Swedish eHealth Agency according to the current conditions." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLDetectedIssue" />
        <aggregation value="contained" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.eventHistory">
      <path value="MedicationRequest.eventHistory" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLProvenanceMedicationRequest" />
      </type>
    </element>
  </differential>
</StructureDefinition>