{
  "resourceType": "StructureDefinition",
  "id": "il-core-dosage",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode": "trial-use"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 1
    }
  ],
  "url": "http://fhir.health.gov.il/StructureDefinition/il-core-dosage",
  "version": "0.21.0",
  "name": "ILCoreDosage",
  "title": "ILCore Dosage Profile",
  "status": "active",
  "date": "2026-03-23",
  "publisher": "Israel Core Team",
  "contact": [
    {
      "telecom": [
        {
          "system": "email",
          "value": "tal.primak@moh.gov.il",
          "use": "work"
        }
      ]
    }
  ],
  "description": "Adds several Israel-specific extensions and constraints to the Dosage datatype",
  "jurisdiction": [
    {
      "coding": [
        {
          "code": "IL",
          "system": "urn:iso:std:iso:3166"
        }
      ]
    }
  ],
  "copyright": "Israeli Ministry of Health",
  "fhirVersion": "4.0.1",
  "kind": "complex-type",
  "abstract": false,
  "type": "Dosage",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Dosage",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Dosage",
        "path": "Dosage",
        "constraint": [
          {
            "key": "il-core-dosage-ext",
            "severity": "error",
            "human": "If extension ext-sub-dosage-step is used, it must appear at least once",
            "expression": "extension.where(url = 'http://fhir.health.gov.il/StructureDefinition/ext-sub-dosage-step').count() = 0 or extension.where(url = 'http://fhir.health.gov.il/StructureDefinition/ext-sub-dosage-step').count() >= 1",
            "source": "http://fhir.health.gov.il/StructureDefinition/il-core-dosage"
          },
          {
            "key": "il-dosage-no-parent-dose-when-substeps",
            "severity": "error",
            "human": "If ext-sub-dosage-step extension is present on Dosage, doseAndRate SHALL NOT be present on the parent Dosage.",
            "expression": "extension.where(url = 'http://fhir.health.gov.il/StructureDefinition/ext-sub-dosage-step').exists()\r\n    implies\r\n  doseAndRate.empty()",
            "source": "http://fhir.health.gov.il/StructureDefinition/il-core-dosage"
          },
          {
            "key": "il-dosage-no-parent-asneeded-when-substeps-have",
            "severity": "error",
            "human": "If any sub-dosage step has asNeeded, the parent Dosage SHALL NOT define asNeeded.",
            "expression": "extension.where(url = 'http://fhir.health.gov.il/StructureDefinition/ext-sub-dosage-step').valueDosage.asNeeded.exists()\r\n    implies\r\n  asNeeded.empty()",
            "source": "http://fhir.health.gov.il/StructureDefinition/il-core-dosage"
          }
        ]
      },
      {
        "id": "Dosage.text",
        "path": "Dosage.text",
        "mustSupport": true
      },
      {
        "id": "Dosage.additionalInstruction",
        "path": "Dosage.additionalInstruction",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AdditionalInstruction"
            }
          ],
          "strength": "extensible",
          "description": "A coded concept identifying additional instructions such as \"take with water\" or \"avoid operating heavy machinery\".",
          "valueSet": "http://hl7.org/fhir/ValueSet/additional-instruction-codes"
        }
      },
      {
        "id": "Dosage.asNeeded[x]",
        "path": "Dosage.asNeeded[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Dosage.asNeeded[x]:asNeededCodeableConcept",
        "path": "Dosage.asNeeded[x]",
        "sliceName": "asNeededCodeableConcept",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "MedicationAsNeededReason"
            }
          ],
          "strength": "extensible",
          "description": "A coded concept identifying the precondition that should be met or evaluated prior to consuming or administering a medication dose.  For example \"pain\", \"30 minutes prior to sexual intercourse\", \"on flare-up\" etc.",
          "valueSet": "http://hl7.org/fhir/ValueSet/medication-as-needed-reason"
        }
      },
      {
        "id": "Dosage.site",
        "path": "Dosage.site",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://hl7.org/fhir/ValueSet/body-site"
        }
      },
      {
        "id": "Dosage.route",
        "path": "Dosage.route",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "RouteOfAdministration"
            }
          ],
          "strength": "extensible",
          "description": "A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject.",
          "valueSet": "http://hl7.org/fhir/ValueSet/route-codes"
        }
      },
      {
        "id": "Dosage.method",
        "path": "Dosage.method",
        "binding": {
          "strength": "preferred",
          "valueSet": "http://fhir.health.gov.il/ValueSet/il-core-medication-administration-code"
        }
      },
      {
        "id": "Dosage.doseAndRate.type",
        "path": "Dosage.doseAndRate.type",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "DoseAndRateType"
            }
          ],
          "strength": "extensible",
          "description": "The kind of dose or rate specified.",
          "valueSet": "http://hl7.org/fhir/ValueSet/dose-rate-type"
        }
      },
      {
        "id": "Dosage.doseAndRate.dose[x]",
        "path": "Dosage.doseAndRate.dose[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Dosage.doseAndRate.dose[x]:doseQuantity",
        "path": "Dosage.doseAndRate.dose[x]",
        "sliceName": "doseQuantity",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Quantity",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"
            ]
          }
        ],
        "binding": {
          "strength": "extensible",
          "valueSet": "http://fhir.health.gov.il/ValueSet/il-core-common-units-of-measure",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueCanonical": "http://fhir.health.gov.il/ValueSet/il-core-units-of-measure"
            }
          ]
        }
      },
      {
        "id": "Dosage.doseAndRate.dose[x]:doseRange",
        "path": "Dosage.doseAndRate.dose[x]",
        "sliceName": "doseRange",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Range"
          }
        ]
      },
      {
        "id": "Dosage.doseAndRate.dose[x]:doseRange.low.code",
        "path": "Dosage.doseAndRate.dose[x].low.code",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://fhir.health.gov.il/ValueSet/il-core-common-units-of-measure",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueCanonical": "http://fhir.health.gov.il/ValueSet/il-core-units-of-measure"
            }
          ]
        }
      },
      {
        "id": "Dosage.doseAndRate.dose[x]:doseRange.high.code",
        "path": "Dosage.doseAndRate.dose[x].high.code",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://fhir.health.gov.il/ValueSet/il-core-common-units-of-measure",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueCanonical": "http://fhir.health.gov.il/ValueSet/il-core-units-of-measure"
            }
          ]
        }
      },
      {
        "id": "Dosage.maxDosePerAdministration",
        "path": "Dosage.maxDosePerAdministration",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://fhir.health.gov.il/ValueSet/il-core-common-units-of-measure",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueCanonical": "http://fhir.health.gov.il/ValueSet/il-core-units-of-measure"
            }
          ]
        }
      },
      {
        "id": "Dosage.maxDosePerLifetime",
        "path": "Dosage.maxDosePerLifetime",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://fhir.health.gov.il/ValueSet/il-core-common-units-of-measure",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueCanonical": "http://fhir.health.gov.il/ValueSet/il-core-units-of-measure"
            }
          ]
        }
      }
    ]
  }
}