{
  "resourceType": "StructureDefinition",
  "id": "f06c6e96-4495-4afa-b688-02bef19f2d6d",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2019-10-24T07:52:25.658+00:00"
  },
  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLMedicationDispense",
  "name": "NLLMedicationDispense",
  "status": "draft",
  "date": "2019-10-24T07:52:24.8322637Z",
  "fhirVersion": "4.0.0",
  "mapping": [
    {
      "identity": "EHM",
      "name": "E-hälsomyndigheten internal model"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "MedicationDispense",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationDispense",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationDispense.extension",
        "path": "MedicationDispense.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MedicationDispense.extension:nllNumberOfPackagesDispensed",
        "path": "MedicationDispense.extension",
        "sliceName": "nllNumberOfPackagesDispensed",
        "short": "Number of packages dispensed",
        "definition": "The number of packages that were included in the dispense. Should not be set for dose dispensed dispenses.",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfPackagesDispensed"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Uttag.Antal expedierade förpackningar"
          }
        ]
      },
      {
        "id": "MedicationDispense.extension:nllDeductedQuantity",
        "path": "MedicationDispense.extension",
        "sliceName": "nllDeductedQuantity",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLDeductedQuantity"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Uttag.Avräknad mängd"
          }
        ]
      },
      {
        "id": "MedicationDispense.extension:nllDeductedQuantity.value[x]",
        "path": "MedicationDispense.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MedicationDispense.extension:nllCompletePrescriptionChoice",
        "path": "MedicationDispense.extension",
        "sliceName": "nllCompletePrescriptionChoice",
        "definition": "When 12% or less of the total quantity of the prescribed medication is left, the prescription will automatically be set to status \"Completed\". \r\nThe pharmacist can set the prescription to \"Completed\" manually by setting \"nllCompletePrescriptionChoice\" to \"Slutexpediera\" (prescomp).\r\nThe pharmacist can prevent to prescription to be automatically set to \"Completed\" by setting \"nllCompletePrescriptionChoice\" to \"Slutexpediera inte\" (presact).",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLCoding"
            ]
          }
        ],
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://electronichealth.se/fhir/ValueSet/complete-prescription-choices"
        }
      },
      {
        "id": "MedicationDispense.extension:nllActorDispatchId",
        "path": "MedicationDispense.extension",
        "sliceName": "nllActorDispatchId",
        "short": "The identifier of the actors dispatch in which the dispense was made",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealtb.se/fhir/StructureDefinition/NLLActorDispatchId"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Expedition.Aktörens expeditions-id"
          }
        ]
      },
      {
        "id": "MedicationDispense.extension:nllDispatchId",
        "path": "MedicationDispense.extension",
        "sliceName": "nllDispatchId",
        "short": "The identifier of the dispatch in which the dispense was made",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLDispatchId"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Expedition.Expeditions-id"
          }
        ]
      },
      {
        "id": "MedicationDispense.extension:nllBenefitChoiceCode",
        "path": "MedicationDispense.extension",
        "sliceName": "nllBenefitChoiceCode",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLBenefitChoiceCode"
            ]
          }
        ]
      },
      {
        "id": "MedicationDispense.extension:nllDispatchRowNo",
        "path": "MedicationDispense.extension",
        "sliceName": "nllDispatchRowNo",
        "short": "Identier for MedicationDispense within dispatch",
        "definition": "Used when communicationg an error or warning for a MedicationDispense within a dispatch. The DispatchRowNo (ExpeditionsRadNummer) uniquely identifies a MediationDispense within a dispatch.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLDispatchRowNo"
            ]
          }
        ]
      },
      {
        "id": "MedicationDispense.identifier",
        "path": "MedicationDispense.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.identifier:dispenseId",
        "path": "MedicationDispense.identifier",
        "sliceName": "dispenseId",
        "short": "UttagsId from OR",
        "definition": "Read only.\r\nThe identifier for the dispense in OR (Receptdepå Human). Should only be used for mapping of dispense-resources made by systems that have not yet integrated to the National Medication List.",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.identifier:dispenseId.system",
        "path": "MedicationDispense.identifier.system",
        "min": 1,
        "fixedUri": "http://electronichealth.se/fhir/NamingSystem/dispenseIdOR",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.identifier:dispenseId.value",
        "path": "MedicationDispense.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]",
        "path": "MedicationDispense.medication[x]",
        "short": "Dispensed product",
        "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": "MedicationDispense.performer.actor",
        "path": "MedicationDispense.performer.actor",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLPractitioner"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "EHM",
            "map": "Personal.Expedierande personal"
          }
        ]
      },
      {
        "id": "MedicationDispense.authorizingPrescription",
        "path": "MedicationDispense.authorizingPrescription",
        "short": "MedicationRequest that authorizes the dispense",
        "definition": "Reference to the MedicationRequest that was dispatched. Note that authorizingprescription must include the version of the medication request. That is done by using the /_history/ suffix.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "aggregation": [
              "referenced"
            ],
            "versioning": "specific"
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Förskrivning"
          }
        ]
      },
      {
        "id": "MedicationDispense.type",
        "path": "MedicationDispense.type",
        "short": "Trial fill",
        "definition": "Type is only used for \"Trial fill\" (startförpackning) in the Swedish National Medication List. May not be set for dose dispensed dispenses.",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "description": "Indicates the type of dispensing event that is performed, e.g. Trial fill, Dose dispense refill",
          "valueSet": "http://ehalsomyndigheten.se/fhir/ValueSet/nll-dispense-type"
        },
        "mapping": [
          {
            "identity": "EHM",
            "map": "Uttag.Startförpackning"
          }
        ]
      },
      {
        "id": "MedicationDispense.type.coding",
        "path": "MedicationDispense.type.coding",
        "max": "1"
      },
      {
        "id": "MedicationDispense.quantity",
        "path": "MedicationDispense.quantity",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://electronichealth.se/fhir/ValueSet/dose-quantity-units"
        },
        "mapping": [
          {
            "identity": "EHM",
            "map": "Uttag.Expedierad mängd"
          }
        ]
      },
      {
        "id": "MedicationDispense.whenHandedOver",
        "path": "MedicationDispense.whenHandedOver",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Expediering.Expedieringstidpunkt"
          }
        ]
      },
      {
        "id": "MedicationDispense.note",
        "path": "MedicationDispense.note",
        "short": "Pharmacists note",
        "definition": "The pharmacists note about the dispense.",
        "max": "1",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Uttag.Farmaceuts notering"
          }
        ]
      },
      {
        "id": "MedicationDispense.dosageInstruction",
        "path": "MedicationDispense.dosageInstruction",
        "type": [
          {
            "code": "Dosage",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLDosage"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.dosageInstruction.extension:nllSiteQualifier",
        "path": "MedicationDispense.dosageInstruction.extension",
        "sliceName": "nllSiteQualifier"
      },
      {
        "id": "MedicationDispense.dosageInstruction.extension:nllSiteQualifier.value[x].text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "MedicationDispense.dosageInstruction.extension.value[x].text"
      },
      {
        "id": "MedicationDispense.dosageInstruction.extension:nllMedicalDevice",
        "path": "MedicationDispense.dosageInstruction.extension",
        "sliceName": "nllMedicalDevice"
      },
      {
        "id": "MedicationDispense.dosageInstruction.extension:nllMedicalDevice.value[x].text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "MedicationDispense.dosageInstruction.extension.value[x].text"
      },
      {
        "id": "MedicationDispense.dosageInstruction.additionalInstruction.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "MedicationDispense.dosageInstruction.additionalInstruction.text"
      },
      {
        "id": "MedicationDispense.dosageInstruction.site.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "MedicationDispense.dosageInstruction.site.text"
      },
      {
        "id": "MedicationDispense.dosageInstruction.route.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "MedicationDispense.dosageInstruction.route.text"
      },
      {
        "id": "MedicationDispense.dosageInstruction.method.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "MedicationDispense.dosageInstruction.method.text"
      },
      {
        "id": "MedicationDispense.substitution",
        "path": "MedicationDispense.substitution",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Uttag.Utbytt artikel"
          }
        ]
      },
      {
        "id": "MedicationDispense.substitution.wasSubstituted",
        "path": "MedicationDispense.substitution.wasSubstituted",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.detectedIssue",
        "path": "MedicationDispense.detectedIssue",
        "short": "Automatic Format and Constitution Control (AFF) warning",
        "definition": "Accepted warnings must be provided when creating a MedicationDispense.\r\nAutomatic Format and Constitution Control (AFF) accepted by the pharmacist.\r\nNB! The DetectedIssues are never saved by the Swedish eHealth Agency.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLDetectedIssue"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ],
        "mustSupport": true
      }
    ]
  }
}