{
  "resourceType": "StructureDefinition",
  "id": "vkp-MedicationDispense-v06",
  "meta": {
    "versionId": "4",
    "lastUpdated": "2018-06-29T07:52:59.488+00:00"
  },
  "url": "http://ehelse.no/fhir/StructureDefinition/vkp-MedicationDispense-v06",
  "version": "0.6",
  "name": "vkp-MedicationDispense-v06",
  "status": "draft",
  "date": "2018-09-12",
  "description": "Profile of the MedicationDispense resource. Used in the Norwegian Personal Connected Health project to document MedicationDispense events from devices dispensing medication to the user at the patients home.",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationDispense",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationDispense",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationDispense",
        "path": "MedicationDispense",
        "definition": "Profile of the MedicationDispense resource. Used in the Norwegian Personal Connected Health project to document MedicationDispense events from devices dispensing medication to the user at the patients home. The Resource is also used to report that a planned dispense event did not occur according to plan.\r\n\r\nIndicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.",
        "constraint": [
          {
            "key": "category-1",
            "severity": "error",
            "human": "When category code is 19 | 20 dosageInstruction.text should be filled out",
            "expression": "category.coding.code = '19'|'20' implies dosageInstruction.text.exists()"
          }
        ]
      },
      {
        "id": "MedicationDispense.identifier",
        "path": "MedicationDispense.identifier",
        "short": "Unique code or number identifying the MedicationDispense",
        "definition": "Unique code or number identifying the MedicationDispense\r\n\r\nVKP project uses UUID. \r\n\r\nExample:\r\n~~~\r\n\"identifier\": [\r\n     {\r\n         \"system\":\"urn:ietf:rfc:3986\",\r\n         \"value\":\"urn:uuid:a76d9bbf-f293-4fb7-ad4c-2851cac77162\"\r\n     }\r\n]\r\n~~~",
        "comment": "Should be a UUID"
      },
      {
        "id": "MedicationDispense.identifier.system",
        "path": "MedicationDispense.identifier.system",
        "short": "The namespace for UUID",
        "definition": "VKP project uses UUID identifiers, the namespace of UUID is identified by urn:ietf:rfc:3986\r\nEstablishes the namespace for the value - that is, a URL that describes a set values that are unique.",
        "fixedUri": "urn:ietf:rfc:3986",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.identifier.value",
        "path": "MedicationDispense.identifier.value",
        "definition": "The actual UUID value.\r\nThe portion of the identifier typically relevant to the user and which is unique within the context of the system.",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.partOf",
        "path": "MedicationDispense.partOf",
        "max": "0"
      },
      {
        "id": "MedicationDispense.status",
        "path": "MedicationDispense.status",
        "short": "in-progress | completed",
        "definition": "A code specifying the state of the set of dispense events.\r\n\r\nThe VKP project uses a subset of the message-status (http://hl7.org/fhir/medication-admin-status) CodeSystem containing the codes:\r\n- in-progress\r\n- completed - Normal reporting of medication dispenced should have status completed",
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://ehelse.no/fhir/ValueSet/vkp-medicationdispense-message-status-v05"
          }
        }
      },
      {
        "id": "MedicationDispense.category",
        "path": "MedicationDispense.category",
        "short": "Event types when medication dispencer performs the medication dispense",
        "definition": "Event types when medication dispencer performs the medication dispense. Values from http://ehelse.no/fhir/CodeSystem/vkp-medicationdispense-events-v06 is required",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSetUri": "http://ehelse.no/fhir/ValueSet/vkp-medicationdispense-events-v06"
        }
      },
      {
        "id": "MedicationDispense.category.coding",
        "path": "MedicationDispense.category.coding",
        "min": 1
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept",
        "path": "MedicationDispense.medicationCodeableConcept",
        "sliceName": "medicationCodeableConcept",
        "short": "Will always be unknown",
        "definition": "VKP project always uses unknown value \r\n\r\nFixed value: \"Ukjent medisin\"",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "fixedCodeableConcept": {
          "text": "Ukjent medisin"
        }
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.text",
        "path": "MedicationDispense.medicationCodeableConcept.text",
        "short": "VKP always unknown medicine",
        "definition": "VKP expects a fixed value of \"Ukjent medisin\"\r\n\r\nA human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.",
        "fixedString": "Ukjent medisin"
      },
      {
        "id": "MedicationDispense.subject",
        "path": "MedicationDispense.subject",
        "definition": "A link to a resource representing the person or the group to whom the medication will be given.\r\n\r\nVKP always references a Patient Resource using a norwegian Fødslesnummer, Felles hjelpenummer or D-nummer in a logical identifier in the subject.identifier element.\r\nThe Name of the patient should be given in the subject.display element.\r\n\r\nExample:\r\n~~~~\r\n\"subject\":{\r\n   \"identifier\":{\r\n      \"system\":\"urn:oid:2.16.578.1.12.4.1.4.1\",\r\n      \"value\":\"05073500186\"\r\n     },\r\n     \"display\":\"Ærlend Sørgård\"\r\n}\r\n~~~~",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient"
          },
          {
            "code": "Reference",
            "targetProfile": "http://ehelse.no/fhir/StructureDefinition/vkp-Patient-v06"
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.no/fhir/StructureDefinition/no-basis-Patient"
          }
        ]
      },
      {
        "id": "MedicationDispense.subject.reference",
        "path": "MedicationDispense.subject.reference",
        "max": "0",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.subject.identifier",
        "path": "MedicationDispense.subject.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "closed"
        },
        "definition": "VKP expects a FNR for the patient given using system and value elements, as well as the name in the subject.display element.\r\n\r\nAn identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.",
        "comment": "VKP expects a FNR, DNR or Felles hjelpenummer for the patient that is subject of the medicationdispense. The subject should be identified using system and value elements, as well as the name of the patient in the subject.display element.\r\n\r\nWhen an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy. \n\nWhen both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference\n\nApplications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.",
        "min": 1,
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.subject.identifier:FNR",
        "path": "MedicationDispense.subject.identifier",
        "sliceName": "FNR",
        "short": "Norwegian FNR",
        "definition": "Fødselsnummer for the patient. Fødselsnummer as one of the possible patient identifier, should at least be sent unless there is a reason not to. Reasons for not sending the Fødselsnummer include but are not limited to, research and apps without a contract for processing data.\r\n\r\nMultiple FNR can exist for a person. If several FNR is provided the time period that each identifier is valid should be provided. No information about period is required when only one FNR is provided.",
        "alias": [
          "Fødselsnummer"
        ]
      },
      {
        "id": "MedicationDispense.subject.identifier:FNR.system",
        "path": "MedicationDispense.subject.identifier.system",
        "short": "Identification of the Norwegian FNR",
        "definition": "Identifies that this is a Norwegian Fødselsnummer",
        "min": 1,
        "fixedUri": "urn:oid:2.16.578.1.12.4.1.4.1"
      },
      {
        "id": "MedicationDispense.subject.identifier:FNR.value",
        "path": "MedicationDispense.subject.identifier.value",
        "short": "The actual Fødselsnumme",
        "definition": "The Norwegian Fødselsnummer",
        "alias": [
          "Fødselsnummer"
        ],
        "min": 1
      },
      {
        "id": "MedicationDispense.subject.identifier:DNR",
        "path": "MedicationDispense.subject.identifier",
        "sliceName": "DNR",
        "short": "The D-nummer of the patient",
        "definition": "The D-nummer of the patient. (assigned by the norwegian Skatteetaten)",
        "alias": [
          "D-nummer"
        ]
      },
      {
        "id": "MedicationDispense.subject.identifier:DNR.system",
        "path": "MedicationDispense.subject.identifier.system",
        "short": "The identification of the D-nummer",
        "definition": "The identification of the Norwegian D-nummer",
        "min": 1,
        "fixedUri": "urn:oid:2.16.578.1.12.4.1.4.2"
      },
      {
        "id": "MedicationDispense.subject.identifier:DNR.value",
        "path": "MedicationDispense.subject.identifier.value",
        "short": "The actual D-numme",
        "definition": "The actual Norwegian D-nummer",
        "min": 1
      },
      {
        "id": "MedicationDispense.subject.identifier:FHN",
        "path": "MedicationDispense.subject.identifier",
        "sliceName": "FHN",
        "short": "Felles hjelpenummer used for the patient",
        "definition": "Felles hjelpenummer for the patient. Felles hjelpenummer as one of the possible patient identification numbers. The norwegian Felles hjelpenummer shoud only be used when the Fødselsnummer og D-number is unknown.",
        "alias": [
          "Felles hjelpenummer"
        ]
      },
      {
        "id": "MedicationDispense.subject.identifier:FHN.system",
        "path": "MedicationDispense.subject.identifier.system",
        "short": "Identification of the Norwegian felles hjelpenumme",
        "definition": "Identification of the Norwegian felles hjelpenummer system",
        "min": 1,
        "fixedUri": "urn:oid:2.16.578.1.12.4.1.4.3"
      },
      {
        "id": "MedicationDispense.subject.identifier:FHN.value",
        "path": "MedicationDispense.subject.identifier.value",
        "short": "The actual Hjelpenummer",
        "definition": "The actual Norwegian Hjelpenummer",
        "min": 1
      },
      {
        "id": "MedicationDispense.subject.display",
        "path": "MedicationDispense.subject.display",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.context",
        "path": "MedicationDispense.context",
        "max": "0"
      },
      {
        "id": "MedicationDispense.supportingInformation",
        "path": "MedicationDispense.supportingInformation",
        "max": "0"
      },
      {
        "id": "MedicationDispense.performer",
        "path": "MedicationDispense.performer",
        "short": "Device and person who performed the dispense",
        "definition": "Indicates what device and person that performed the event. It should be assumed that the performer is the dispenser of the medication. The Practitioner handling tthe device can be indicated in addition to the identity of he the device used.\r\n\r\nExample:\r\n~~~\r\n\"performer\": [\r\n          {\r\n            \"actor\": {\r\n              \"identifier\": {\r\n                \"system\": \"https://fhir.evondos.com/e300-codes/serialnumber\",\r\n                \"value\": \"PP000533\"\r\n              },\r\n              \"display\": \"Evondos E300 multidosedispenser\"\r\n            }\r\n          },\r\n          {\r\n             \"actor\":{\r\n                \"identifier\":{\r\n                   \"system\":\"urn:oid:2.16.578.1.12.4.1.4.1\",\r\n                   \"value\":\"04056600324\"\r\n                  },\r\n               \"display\":\"Magnar Koman\"\r\n            }\r\n          }\r\n      ]\r\n~~~",
        "min": 1
      },
      {
        "id": "MedicationDispense.performer.actor",
        "path": "MedicationDispense.performer.actor",
        "short": "The device used to dispense the medication to the patient.  For example, a particular medication dispense device",
        "definition": "The device used to dispense the medication to the patient.  For example, a particular medication dispense device\r\n\r\nVKP-norway: Should be a logical reference containing the IMEI/serial number of the device.\r\ndisplay value should contain the name of the device type.\r\n\r\nExample:\r\n~~~~\r\n\"performer\": [\r\n                    {\r\n                        \"actor\":{\r\n                            \"identifier\":{\r\n                                \"system\":\"http://dignio.no/IMEInummer\",\r\n                                \"value\":\"123456789101112\"\r\n                            },\r\n                            \"display\":\"Medido multidosesdispenser\"\r\n                        }\r\n                    }\r\n                ]\r\n~~~~"
      },
      {
        "id": "MedicationDispense.performer.actor.reference",
        "path": "MedicationDispense.performer.actor.reference",
        "max": "0"
      },
      {
        "id": "MedicationDispense.performer.actor.identifier",
        "path": "MedicationDispense.performer.actor.identifier",
        "short": "Logical reference to the medication dispenser/person/organization",
        "definition": "Logical reference to the medication dispenser\r\nVKP-norway: Should be a logical reference containing the IMEI/serial number of the device.\r\ndisplay value should contain the name of the device type. VKP uses serial numbers decided by the manufacturer of the device.",
        "min": 1
      },
      {
        "id": "MedicationDispense.performer.actor.identifier.system",
        "path": "MedicationDispense.performer.actor.identifier.system",
        "min": 1
      },
      {
        "id": "MedicationDispense.performer.actor.identifier.value",
        "path": "MedicationDispense.performer.actor.identifier.value",
        "min": 1
      },
      {
        "id": "MedicationDispense.authorizingPrescription",
        "path": "MedicationDispense.authorizingPrescription",
        "max": "0"
      },
      {
        "id": "MedicationDispense.type",
        "path": "MedicationDispense.type",
        "max": "0"
      },
      {
        "id": "MedicationDispense.quantity",
        "path": "MedicationDispense.quantity",
        "max": "0"
      },
      {
        "id": "MedicationDispense.daysSupply",
        "path": "MedicationDispense.daysSupply",
        "max": "0"
      },
      {
        "id": "MedicationDispense.whenPrepared",
        "path": "MedicationDispense.whenPrepared",
        "max": "0"
      },
      {
        "id": "MedicationDispense.whenHandedOver",
        "path": "MedicationDispense.whenHandedOver",
        "definition": "Timestamp defining the point in time the MedicationDispense event took place. The timestamp could also be set for \"negative\" events, when a product was not provided to the patient according to plan.\r\n\r\nThe time the dispensed product was/was not provided to the patient or their representative.\r\n\r\nExample:\r\n~~~\r\n\"timestamp\":\"2018-07-18T07:01:06+00:00\"\r\n~~~",
        "min": 1
      },
      {
        "id": "MedicationDispense.destination",
        "path": "MedicationDispense.destination",
        "max": "0"
      },
      {
        "id": "MedicationDispense.receiver",
        "path": "MedicationDispense.receiver",
        "max": "0"
      },
      {
        "id": "MedicationDispense.note",
        "path": "MedicationDispense.note",
        "definition": "VKP: In the VPK project additional information about the MedicationDispense event sould be documented in a Composition in the Message Bundle\r\n\r\n'Extra information about the dispense that could not be conveyed in the other attributes.",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction",
        "path": "MedicationDispense.dosageInstruction",
        "definition": "VKP takes handles information about the dosage given in the text element.\r\n\r\nExample text could be: \r\n«10 doser medisin ble matet ut for bruk på reise.\r\nFørste dose: 22/6 kl. 19:00. \r\nSiste dose: 24/6 kl. 19:00.»\r\n\r\nIndicates how the medication is to be used by the patient.\r\n\r\nExample code:\r\n~~~\r\n\"dosageInstruction\": [\r\n     {\r\n         \"text\":\"Husk øyedråper!\"\r\n     }\r\n]\r\n~~~"
      },
      {
        "id": "MedicationDispense.dosageInstruction.sequence",
        "path": "MedicationDispense.dosageInstruction.sequence",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.text",
        "path": "MedicationDispense.dosageInstruction.text",
        "definition": "Free text dosage instructions e.g. SIG. from the medication dispenser.\r\n\r\nVKP handles information from the medication dispenser given in the text element. Example text: \r\nVKP takes handles information about the dosage given in the text element.\r\n\r\nExample text could be: \r\n«10 doser medisin ble matet ut for bruk på reise.\r\nFørste dose: 22/6 kl. 19:00. \r\nSiste dose: 24/6 kl. 19:00.»",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.dosageInstruction.additionalInstruction",
        "path": "MedicationDispense.dosageInstruction.additionalInstruction",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.patientInstruction",
        "path": "MedicationDispense.dosageInstruction.patientInstruction",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.timing",
        "path": "MedicationDispense.dosageInstruction.timing",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.asNeeded[x]",
        "path": "MedicationDispense.dosageInstruction.asNeeded[x]",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.site",
        "path": "MedicationDispense.dosageInstruction.site",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.route",
        "path": "MedicationDispense.dosageInstruction.route",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.method",
        "path": "MedicationDispense.dosageInstruction.method",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.dose[x]",
        "path": "MedicationDispense.dosageInstruction.dose[x]",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerAdministration",
        "path": "MedicationDispense.dosageInstruction.maxDosePerAdministration",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerLifetime",
        "path": "MedicationDispense.dosageInstruction.maxDosePerLifetime",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.dosageInstruction.rate[x]",
        "path": "MedicationDispense.dosageInstruction.rate[x]",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.substitution",
        "path": "MedicationDispense.substitution",
        "max": "0"
      },
      {
        "id": "MedicationDispense.detectedIssue",
        "path": "MedicationDispense.detectedIssue",
        "max": "0"
      },
      {
        "id": "MedicationDispense.notDone",
        "path": "MedicationDispense.notDone",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.notDoneReason[x]",
        "path": "MedicationDispense.notDoneReason[x]",
        "mustSupport": false
      },
      {
        "id": "MedicationDispense.eventHistory",
        "path": "MedicationDispense.eventHistory",
        "mustSupport": false
      }
    ]
  }
}