{
  "resourceType": "StructureDefinition",
  "id": "profile-medication",
  "url": "https://fhir.synapxe.sg/StructureDefinition/profile-medication",
  "name": "Medication",
  "title": "Medication Profile",
  "status": "active",
  "publisher": "Synapxe",
  "description": "This profile represents medicinal products including medications, vaccines, and other substances administered.",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "nehr-putDispensedMedications",
      "name": "NEHR XML putDispensedMedications",
      "comment": "Paths are relative to the putDispensedMedications element of the NEHR XML message"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Medication",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Medication",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Medication",
        "path": "Medication",
        "definition": "Carries this NEHR XML element:\n\n- `putPatientMedicationList/list/entry/item/MedicationStatement/medicationReference`: Identifies the medication being administered."
      },
      {
        "id": "Medication.id",
        "path": "Medication.id",
        "definition": "Carries this NEHR XML element:\n\n- `putOrderedMedications/medicationOrder/medicationItem/sequenceNo`: Sequence identifier of the medication item within the medication order.",
        "mapping": [
          {
            "identity": "nehr-putDispensedMedications",
            "map": "medicationDispense/medicationItem/medicationName/code"
          }
        ]
      },
      {
        "id": "Medication.contained",
        "path": "Medication.contained",
        "max": "0"
      },
      {
        "id": "Medication.extension",
        "path": "Medication.extension",
        "max": "1"
      },
      {
        "id": "Medication.modifierExtension",
        "path": "Medication.modifierExtension",
        "max": "0"
      },
      {
        "id": "Medication.identifier",
        "path": "Medication.identifier",
        "definition": "Carries these NEHR XML elements:\n\n- `putDispensedMedications/medicationDispense/medicationItem/itemId`: Unique identifier for the medication item.\n- `putOrderedMedications/medicationOrder/medicationItem/itemId`: Unique identifier for the medication item.",
        "mapping": [
          {
            "identity": "nehr-putDispensedMedications",
            "map": "medicationDispense/medicationItem/itemId"
          }
        ]
      },
      {
        "id": "Medication.code",
        "path": "Medication.code",
        "definition": "Carries these NEHR XML elements:\n\n- `putDispensedMedications/medicationDispense/medicationItem/medicationName`: Name of the medication item.\n- `putOrderedMedications/medicationOrder/medicationItem/medicationName`: Name of the medication item.\n- `putPatientMedicationList/list/entry/item/MedicationStatement/medicationReference/code`: Description of the medication entered or selected during medication list review.",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/med-code"
        },
        "mapping": [
          {
            "identity": "nehr-putDispensedMedications",
            "map": "medicationDispense/medicationItem/medicationName"
          }
        ]
      },
      {
        "id": "Medication.code.extension",
        "path": "Medication.code.extension",
        "max": "0"
      },
      {
        "id": "Medication.status",
        "path": "Medication.status",
        "definition": "Carries these NEHR XML elements:\n\n- `putDispensedMedications/medicationDispense/medicationItem/medicationItemStatus`: Status of the medication item.\n- `putOrderedMedications/medicationOrder/medicationItem/medicationItemStatus`: Status of this medication item.",
        "mapping": [
          {
            "identity": "nehr-putDispensedMedications",
            "map": "medicationDispense/medicationItem/medicationItemStatus"
          }
        ]
      },
      {
        "id": "Medication.status.extension:medicationStatus",
        "path": "Medication.status.extension",
        "sliceName": "medicationStatus",
        "definition": "Carries this NEHR XML element:\n\n- `putDispensedMedications/medicationDispense/medicationItem/medicationItemStatus`: Status of the medication item.",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/ext-medication-status"
            ]
          }
        ],
        "isModifier": false,
        "mapping": [
          {
            "identity": "nehr-putDispensedMedications",
            "map": "medicationDispense/medicationItem/medicationItemStatus"
          }
        ]
      },
      {
        "id": "Medication.marketingAuthorizationHolder",
        "path": "Medication.marketingAuthorizationHolder",
        "max": "0"
      },
      {
        "id": "Medication.doseForm",
        "path": "Medication.doseForm",
        "definition": "Carries these NEHR XML elements:\n\n- `putDispensedMedications/medicationDispense/medicationItem/doseForm`: Physical form of the medication item.\n- `putOrderedMedications/medicationOrder/medicationItem/doseForm`: The physical form of this medication item.\n- `putPatientMedicationList/list/entry/item/MedicationStatement/medicationReference/product/form`: Dosage form of the medication.",
        "binding": {
          "strength": "preferred",
          "description": "The form in which the medication is administered."
        },
        "mapping": [
          {
            "identity": "nehr-putDispensedMedications",
            "map": "medicationDispense/medicationItem/doseForm"
          }
        ]
      },
      {
        "id": "Medication.doseForm.extension",
        "path": "Medication.doseForm.extension",
        "max": "0"
      },
      {
        "id": "Medication.doseForm.coding.version",
        "path": "Medication.doseForm.coding.version",
        "min": 1
      },
      {
        "id": "Medication.totalVolume",
        "path": "Medication.totalVolume",
        "max": "0"
      },
      {
        "id": "Medication.ingredient",
        "path": "Medication.ingredient",
        "max": "1"
      },
      {
        "id": "Medication.ingredient.id",
        "path": "Medication.ingredient.id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.extension",
        "path": "Medication.ingredient.extension",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.modifierExtension",
        "path": "Medication.ingredient.modifierExtension",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item",
        "path": "Medication.ingredient.item",
        "type": [
          {
            "code": "CodeableReference",
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-medication"
            ]
          }
        ]
      },
      {
        "id": "Medication.ingredient.item.id",
        "path": "Medication.ingredient.item.id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item.extension",
        "path": "Medication.ingredient.item.extension",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item.concept",
        "path": "Medication.ingredient.item.concept",
        "definition": "Carries these NEHR XML elements:\n\n- `putDispensedMedications/medicationDispense/medicationItem/medicationName`: Name of the medication item.\n- `putOrderedMedications/medicationOrder/medicationItem/medicationName`: Name of the medication item.\n- `putPatientMedicationList/list/entry/item/MedicationStatement/medicationReference/code`: Description of the medication entered or selected during medication list review.",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/med-code"
        },
        "mapping": [
          {
            "identity": "nehr-putDispensedMedications",
            "map": "medicationDispense/medicationItem/medicationName"
          }
        ]
      },
      {
        "id": "Medication.ingredient.item.concept.extension",
        "path": "Medication.ingredient.item.concept.extension",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item.concept.coding.version",
        "path": "Medication.ingredient.item.concept.coding.version",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item.reference",
        "path": "Medication.ingredient.item.reference",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.isActive",
        "path": "Medication.ingredient.isActive",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength[x]",
        "path": "Medication.ingredient.strength[x]",
        "definition": "Carries these NEHR XML elements:\n\n- `putDispensedMedications/medicationDispense/medicationItem/medicationStrength`: Amount of medication contained in a specific dose form.\n- `putDispensedMedications/medicationDispense/medicationItem/medicationStrengthUnit`: Unit of measure for medicationStrength.\n- `putOrderedMedications/medicationOrder/medicationItem/medicationStrength`: Amount of medication contained within the dose form.\n- `putOrderedMedications/medicationOrder/medicationItem/medicationStrengthUnit`: Unit of measure for the \"medicationStrength\" field.\n- `putPatientMedicationList/list/entry/item/MedicationStatement/medicationReference/product/strength`: Amount of drug in a dosage form.\n- `putPatientMedicationList/list/entry/item/MedicationStatement/medicationReference/product/strengthUnit`: Unit of measure for the strength.",
        "min": 1,
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "mapping": [
          {
            "identity": "nehr-putDispensedMedications",
            "map": "medicationDispense/medicationItem/medicationStrength | medicationDispense/medicationItem/medicationStrengthUnit"
          }
        ]
      },
      {
        "id": "Medication.ingredient.strength[x].id",
        "path": "Medication.ingredient.strength[x].id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength[x].extension",
        "path": "Medication.ingredient.strength[x].extension",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength[x].value",
        "path": "Medication.ingredient.strength[x].value",
        "min": 1
      },
      {
        "id": "Medication.ingredient.strength[x].comparator",
        "path": "Medication.ingredient.strength[x].comparator",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength[x].unit",
        "path": "Medication.ingredient.strength[x].unit",
        "min": 1
      },
      {
        "id": "Medication.ingredient.strength[x].code",
        "path": "Medication.ingredient.strength[x].code",
        "binding": {
          "strength": "preferred",
          "valueSet": "http://hl7.org/fhir/ValueSet/medication-ingredientstrength"
        }
      },
      {
        "id": "Medication.batch",
        "path": "Medication.batch",
        "max": "0"
      },
      {
        "id": "Medication.definition",
        "path": "Medication.definition",
        "max": "0"
      }
    ]
  }
}