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