{
  "resourceType": "StructureDefinition",
  "id": "profile-medicationdispense-dataConnector",
  "meta": {
    "lastUpdated": "2021-03-17T16:41:45.236+00:00"
  },
  "url": "https://fhir.infoway-inforoute.ca/StructureDefinition/profile-medicationDispense",
  "name": "PHIAccessMedicationDispense",
  "title": "PHI Access MedicationDispense",
  "status": "draft",
  "date": "2021-03-17T16:38:01.11052+00:00",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "rx-dispense-rmim",
      "uri": "http://www.hl7.org/v3/PORX_RM020070UV",
      "name": "V3 Pharmacy Dispense RMIM"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "MedicationDispense",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationDispense",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationDispense.id",
        "path": "MedicationDispense.id",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.meta",
        "path": "MedicationDispense.meta",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.meta.versionId",
        "path": "MedicationDispense.meta.versionId",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.meta.lastUpdated",
        "path": "MedicationDispense.meta.lastUpdated",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.meta.source",
        "path": "MedicationDispense.meta.source",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.text",
        "path": "MedicationDispense.text",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.identifier",
        "path": "MedicationDispense.identifier",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.identifier.system",
        "path": "MedicationDispense.identifier.system",
        "min": 1,
        "example": [
          {
            "label": "New Brunswick DIS ID",
            "valueUri": "https://fhir.infoway-inforoute.ca/NamingSystem/ca-nb-dis-id"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.identifier.value",
        "path": "MedicationDispense.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.status",
        "path": "MedicationDispense.status",
        "requirements": "Included to support the ability to query for and group medication dispenses based on the status of the dispense (e.g., in-progress, completed, stopped, etc.).",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]",
        "path": "MedicationDispense.medication[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "closed"
        },
        "requirements": "Identification of the medication is critical for citizens and clinicians to understand what was dispensed.\r\n\r\nIncluded to support the ability to query for medication dispenses pertaining to a specific medication.",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationReference",
        "path": "MedicationDispense.medication[x]",
        "sliceName": "medicationReference",
        "comment": "If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example, if you require form or lot number, then you must reference the Medication resource.\r\n\r\nImplementors should anticipate a mixture of FHIR references that are persistant and/or retrievable outside of the initial response to the request, as well as references that are provided in the bundle response but are not retrievable using their resource.id. See implementation guidance.",
        "requirements": "MedicationReference has been marked as mustSupport to ensure that implementors can support medications that include additional information (i.e. form, lot number, etc.) if provided.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-medicationdispense"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept",
        "path": "MedicationDispense.medicationCodeableConcept",
        "sliceName": "medicationCodeableConcept",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "strength": "example",
          "description": "A Drug Identification Number (DIN) is a number assigned by Health Canada to a drug product prior to being marketed in Canada. It consists of eight digits (numbers) generated by a computer system in the Submission and Information Policy Division. http://www.hc-sc.gc.ca/dhp-mps/prodpharma/databasdon/index_e.html",
          "valueSet": "https://fhir.infoway-inforoute.ca/ValueSet/CA-HC-DIN"
        }
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding",
        "path": "MedicationDispense.medicationCodeableConcept.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding.system",
        "path": "MedicationDispense.medicationCodeableConcept.coding.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding.code",
        "path": "MedicationDispense.medicationCodeableConcept.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding.display",
        "path": "MedicationDispense.medicationCodeableConcept.coding.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:DIN",
        "path": "MedicationDispense.medicationCodeableConcept.coding",
        "sliceName": "DIN"
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:DIN.system",
        "path": "MedicationDispense.medicationCodeableConcept.coding.system",
        "min": 1,
        "patternUri": "https://fhir.infoway-inforoute.ca/ValueSet/CA-HC-DIN",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:DIN.code",
        "path": "MedicationDispense.medicationCodeableConcept.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:DIN.display",
        "path": "MedicationDispense.medicationCodeableConcept.coding.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:NPN",
        "path": "MedicationDispense.medicationCodeableConcept.coding",
        "sliceName": "NPN"
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:NPN.system",
        "path": "MedicationDispense.medicationCodeableConcept.coding.system",
        "min": 1,
        "patternUri": "https://fhir.infoway-inforoute.ca/ValueSet/CA-HC-NPN",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:NPN.code",
        "path": "MedicationDispense.medicationCodeableConcept.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:NPN.display",
        "path": "MedicationDispense.medicationCodeableConcept.coding.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:CCDD",
        "path": "MedicationDispense.medicationCodeableConcept.coding",
        "sliceName": "CCDD"
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:CCDD.system",
        "path": "MedicationDispense.medicationCodeableConcept.coding.system",
        "min": 1,
        "patternUri": "https://fhir.infoway-inforoute.ca/ValueSet/prescriptionmedicinalproduct",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:CCDD.code",
        "path": "MedicationDispense.medicationCodeableConcept.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.coding:CCDD.display",
        "path": "MedicationDispense.medicationCodeableConcept.coding.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.medication[x]:medicationCodeableConcept.text",
        "path": "MedicationDispense.medicationCodeableConcept.text",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.subject",
        "path": "MedicationDispense.subject",
        "definition": "A link to a resource representing the person to whom the medication will be given.",
        "comment": "Implementors should anticipate a mixture of FHIR references that are persistant and/or retrievable outside of the initial response to the request, as well as references that are provided in the bundle response but are not retrievable using their resource.id. See implementation guidance.",
        "requirements": "MedicationReference has been marked as mustSupport and mandatory to support the search for medicationDispenses that have occured for a particular patient.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.subject.reference",
        "path": "MedicationDispense.subject.reference",
        "requirements": "The string value for this element can be used to communicate an absolute or relative reference for a resource that is persistant and/or retrievable through REST (see https://www.hl7.org/fhir/references.html#literal) as well as a urn:uuid for a reference to resource that is provided in the bundle response but not retrievable using their resource.id. See implementation guidance.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.location",
        "path": "MedicationDispense.location",
        "requirements": "Included to support the ability to query for medications dispensed at a specified pharmacy location.",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.location.reference",
        "path": "MedicationDispense.location.reference",
        "comment": "Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries.   Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure \"/[type]/[id]\" then it should be assumed that the reference is to a FHIR RESTful server.\r\n\r\nInitially, very few participating jurisdictions are expected to support a literal reference for the location resource. When some information about location is known, but a literal reference is not available, the location SHALL be communicated as a contained resource with a reference value that matches the id value in the contained resource. See example on http://www.hl7.org/implement/standards/fhir/references.html#contained",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.authorizingPrescription",
        "path": "MedicationDispense.authorizingPrescription",
        "comment": "Maps to basedOn in Event logical model.\r\n\r\nWhen known, minimal information about a prescription (prescription id, prescriber, etc.) will be included in a referenced resource.",
        "requirements": "Included to support the ability to query for and group medication dispenses based on authorizing prescription, as well as to support queries for medication dispenses based on the prescriber of the medication.",
        "type": [
          {
            "code": "Reference",
            "aggregation": [
              "contained"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.authorizingPrescription.reference",
        "path": "MedicationDispense.authorizingPrescription.reference",
        "comment": "Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries.   Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure \"/[type]/[id]\" then it should be assumed that the reference is to a FHIR RESTful server.\r\n\r\n\r\nInitially, very few participating jurisdictions are expected to support a literal reference for the medicationRequest resource. When some information about medicationRequest is known, but a literal reference is not available, the medicationRequest SHALL be communicated as a contained resource with a reference value that matches the id value in the contained resource. See example on http://www.hl7.org/implement/standards/fhir/references.html#contained",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.quantity",
        "path": "MedicationDispense.quantity",
        "requirements": "Quantity of the medication dispensed should be provided if known. Patient and Clinician applications may use quantity in combination with other elements to help determine what dispenses are expected to still expected to have remaining supply.",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.daysSupply",
        "path": "MedicationDispense.daysSupply",
        "requirements": "daysSupply of the medication dispensed should be provided if known. Patient and Clinician applications may use daysSupply in combination with other elements to help determine what dispenses are expected to still expected to have remaining supply.",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.whenPrepared",
        "path": "MedicationDispense.whenPrepared",
        "requirements": "Included to support the ability to query for dispenses that occured suring a specific time period.",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.dosageInstruction",
        "path": "MedicationDispense.dosageInstruction",
        "mustSupport": true
      },
      {
        "id": "MedicationDispense.dosageInstruction.text",
        "path": "MedicationDispense.dosageInstruction.text",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size.",
        "requirements": "Free text dosage instructions can be used for cases where the instructions are too complex to code.  The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated.  If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.  Additional information about administration or preparation of the medication should be included as text.\r\n \r\nBecause v3 CeRX specifications (common input for participating data sources) do not differentiate patient specific instructions from dosage instructions, dosageInstruction.text is considered must support and mandatory (as opposed to separating into additional instructions and patientInstruction).",
        "min": 1,
        "mustSupport": true
      }
    ]
  }
}