{
  "resourceType": "StructureDefinition",
  "url": "http://fhir.healthbc.org/StructureDefinition/MedicationDispense",
  "version": "1.0",
  "name": "ca-bc-careconnect-medication-dispense",
  "status": "active",
  "date": "2021-07-16",
  "fhirVersion": "3.0.2",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/w5",
      "name": "W5 Mapping"
    },
    {
      "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",
        "min": 1
      },
      {
        "id": "MedicationDispense.meta",
        "path": "MedicationDispense.meta",
        "max": "0"
      },
      {
        "id": "MedicationDispense.implicitRules",
        "path": "MedicationDispense.implicitRules",
        "max": "0"
      },
      {
        "id": "MedicationDispense.language",
        "path": "MedicationDispense.language",
        "max": "0"
      },
      {
        "id": "MedicationDispense.text",
        "path": "MedicationDispense.text",
        "max": "0"
      },
      {
        "id": "MedicationDispense.extension",
        "path": "MedicationDispense.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "MedicationDispense.extension:sameStoreIndicator",
        "path": "MedicationDispense.extension",
        "sliceName": "sameStoreIndicator",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-medication-dispense-same-store-indicator-extension"
          }
        ]
      },
      {
        "id": "MedicationDispense.extension:drugDiscontinued",
        "path": "MedicationDispense.extension",
        "sliceName": "drugDiscontinued",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-drug-discontinued-extension"
          }
        ]
      },
      {
        "id": "MedicationDispense.extension:pharmacyInterventionCode",
        "path": "MedicationDispense.extension",
        "sliceName": "pharmacyInterventionCode",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": "http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-pharmacy-intervention-code-extension"
          }
        ]
      },
      {
        "id": "MedicationDispense.extension:dataQualityWarning",
        "path": "MedicationDispense.extension",
        "sliceName": "dataQualityWarning",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": "http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-medication-dispense-data-quality-warning"
          }
        ],
        "isModifier": false
      },
      {
        "id": "MedicationDispense.identifier",
        "path": "MedicationDispense.identifier",
        "max": "0"
      },
      {
        "id": "MedicationDispense.partOf",
        "path": "MedicationDispense.partOf",
        "max": "0"
      },
      {
        "id": "MedicationDispense.status.extension",
        "path": "MedicationDispense.status.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "MedicationDispense.status.extension:renderedValue",
        "path": "MedicationDispense.status.extension",
        "sliceName": "renderedValue",
        "short": "This is the dispense status of this medication for the patient.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://hl7.org/fhir/StructureDefinition/rendered-value"
          }
        ]
      },
      {
        "id": "MedicationDispense.category",
        "path": "MedicationDispense.category",
        "max": "0"
      },
      {
        "id": "MedicationDispense.medication[x]:medicationReference",
        "path": "MedicationDispense.medicationReference",
        "sliceName": "medicationReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/ca-bc-careconnct-medication",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "MedicationDispense.medication[x]:medicationReference.id",
        "path": "MedicationDispense.medicationReference.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.medication[x]:medicationReference.identifier",
        "path": "MedicationDispense.medicationReference.identifier",
        "max": "0"
      },
      {
        "id": "MedicationDispense.medication[x]:medicationReference.display",
        "path": "MedicationDispense.medicationReference.display",
        "max": "0"
      },
      {
        "id": "MedicationDispense.subject",
        "path": "MedicationDispense.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "MedicationDispense.subject.id",
        "path": "MedicationDispense.subject.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.subject.identifier",
        "path": "MedicationDispense.subject.identifier",
        "max": "0"
      },
      {
        "id": "MedicationDispense.subject.display",
        "path": "MedicationDispense.subject.display",
        "max": "0"
      },
      {
        "id": "MedicationDispense.context",
        "path": "MedicationDispense.context",
        "max": "0"
      },
      {
        "id": "MedicationDispense.supportingInformation",
        "path": "MedicationDispense.supportingInformation",
        "max": "0"
      },
      {
        "id": "MedicationDispense.performer.id",
        "path": "MedicationDispense.performer.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.performer.actor",
        "path": "MedicationDispense.performer.actor",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Organization",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "MedicationDispense.performer.actor.id",
        "path": "MedicationDispense.performer.actor.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.performer.actor.identifier",
        "path": "MedicationDispense.performer.actor.identifier",
        "max": "0"
      },
      {
        "id": "MedicationDispense.performer.actor.display",
        "path": "MedicationDispense.performer.actor.display",
        "max": "0"
      },
      {
        "id": "MedicationDispense.performer.onBehalfOf",
        "path": "MedicationDispense.performer.onBehalfOf",
        "max": "0"
      },
      {
        "id": "MedicationDispense.authorizingPrescription",
        "path": "MedicationDispense.authorizingPrescription",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/MedicationRequest",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "MedicationDispense.authorizingPrescription.id",
        "path": "MedicationDispense.authorizingPrescription.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.authorizingPrescription.identifier",
        "path": "MedicationDispense.authorizingPrescription.identifier",
        "max": "0"
      },
      {
        "id": "MedicationDispense.authorizingPrescription.display",
        "path": "MedicationDispense.authorizingPrescription.display",
        "max": "0"
      },
      {
        "id": "MedicationDispense.type",
        "path": "MedicationDispense.type",
        "max": "0"
      },
      {
        "id": "MedicationDispense.quantity.id",
        "path": "MedicationDispense.quantity.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.quantity.unit",
        "path": "MedicationDispense.quantity.unit",
        "max": "0"
      },
      {
        "id": "MedicationDispense.quantity.system",
        "path": "MedicationDispense.quantity.system",
        "max": "0"
      },
      {
        "id": "MedicationDispense.quantity.code",
        "path": "MedicationDispense.quantity.code",
        "max": "0"
      },
      {
        "id": "MedicationDispense.daysSupply",
        "path": "MedicationDispense.daysSupply",
        "max": "0"
      },
      {
        "id": "MedicationDispense.whenPrepared",
        "path": "MedicationDispense.whenPrepared",
        "max": "0"
      },
      {
        "id": "MedicationDispense.whenHandedOver",
        "path": "MedicationDispense.whenHandedOver",
        "min": 0
      },
      {
        "id": "MedicationDispense.destination",
        "path": "MedicationDispense.destination",
        "max": "0"
      },
      {
        "id": "MedicationDispense.receiver",
        "path": "MedicationDispense.receiver",
        "max": "0"
      },
      {
        "id": "MedicationDispense.note.id",
        "path": "MedicationDispense.note.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.note.author[x]:authorReference",
        "path": "MedicationDispense.note.authorReference",
        "sliceName": "authorReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "MedicationDispense.dosageInstruction.id",
        "path": "MedicationDispense.dosageInstruction.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.sequence",
        "path": "MedicationDispense.dosageInstruction.sequence",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.additionalInstruction",
        "path": "MedicationDispense.dosageInstruction.additionalInstruction",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.patientInstruction",
        "path": "MedicationDispense.dosageInstruction.patientInstruction",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.timing",
        "path": "MedicationDispense.dosageInstruction.timing",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.asNeeded[x]",
        "path": "MedicationDispense.dosageInstruction.asNeeded[x]",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.site",
        "path": "MedicationDispense.dosageInstruction.site",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.route",
        "path": "MedicationDispense.dosageInstruction.route",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.method",
        "path": "MedicationDispense.dosageInstruction.method",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.dose[x]",
        "path": "MedicationDispense.dosageInstruction.dose[x]",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.id",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.id",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.comparator",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.comparator",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.unit",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.unit",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.system",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.system",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.code",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.numerator.code",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.denominator.id",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.denominator.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.denominator.comparator",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.denominator.comparator",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.denominator.system",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.denominator.system",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerPeriod.denominator.code",
        "path": "MedicationDispense.dosageInstruction.maxDosePerPeriod.denominator.code",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerAdministration",
        "path": "MedicationDispense.dosageInstruction.maxDosePerAdministration",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.maxDosePerLifetime",
        "path": "MedicationDispense.dosageInstruction.maxDosePerLifetime",
        "max": "0"
      },
      {
        "id": "MedicationDispense.dosageInstruction.rate[x]",
        "path": "MedicationDispense.dosageInstruction.rate[x]",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.id",
        "path": "MedicationDispense.substitution.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.extension",
        "path": "MedicationDispense.substitution.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "MedicationDispense.substitution.extension:clinicalSubstitutionCode",
        "path": "MedicationDispense.substitution.extension",
        "sliceName": "clinicalSubstitutionCode",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": "http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-medication-dispense-clinical-substitution-code-extension"
          }
        ]
      },
      {
        "id": "MedicationDispense.substitution.extension:clinicalSubstitutionCode.valueCodeableConcept:valueCodeableConcept.id",
        "path": "MedicationDispense.substitution.extension.valueCodeableConcept.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.extension:clinicalSubstitutionCode.valueCodeableConcept:valueCodeableConcept.coding.id",
        "path": "MedicationDispense.substitution.extension.valueCodeableConcept.coding.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.extension:clinicalSubstitutionCode.valueCodeableConcept:valueCodeableConcept.coding.version",
        "path": "MedicationDispense.substitution.extension.valueCodeableConcept.coding.version",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.extension:clinicalSubstitutionCode.valueCodeableConcept:valueCodeableConcept.coding.userSelected",
        "path": "MedicationDispense.substitution.extension.valueCodeableConcept.coding.userSelected",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.extension:clinicalSubstitutionCode.valueCodeableConcept:valueCodeableConcept.text",
        "path": "MedicationDispense.substitution.extension.valueCodeableConcept.text",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.type",
        "path": "MedicationDispense.substitution.type",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.reason.id",
        "path": "MedicationDispense.substitution.reason.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.reason.coding.id",
        "path": "MedicationDispense.substitution.reason.coding.id",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.reason.coding.version",
        "path": "MedicationDispense.substitution.reason.coding.version",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.reason.coding.userSelected",
        "path": "MedicationDispense.substitution.reason.coding.userSelected",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.reason.text",
        "path": "MedicationDispense.substitution.reason.text",
        "max": "0"
      },
      {
        "id": "MedicationDispense.substitution.responsibleParty",
        "path": "MedicationDispense.substitution.responsibleParty",
        "max": "0"
      },
      {
        "id": "MedicationDispense.detectedIssue",
        "path": "MedicationDispense.detectedIssue",
        "max": "0"
      },
      {
        "id": "MedicationDispense.notDone",
        "path": "MedicationDispense.notDone",
        "max": "0"
      },
      {
        "id": "MedicationDispense.notDoneReason[x]",
        "path": "MedicationDispense.notDoneReason[x]",
        "max": "0"
      },
      {
        "id": "MedicationDispense.eventHistory",
        "path": "MedicationDispense.eventHistory",
        "max": "0"
      }
    ]
  }
}