{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://hl7.erp.uno/priv/schema/Dosage.schema.json",
  "$ref": "#/definitions/Dosage",
  "description": "see https://hl7.org/fhir/R5/json.html for information about the FHIR Json Schemas",
  "definitions": {
    "Dosage": {
      "allOf": [
        {
          "description": "Indicates how the medication is/was taken or should be taken by the patient.",
          "properties": {
            "sequence": {
              "description": "Indicates the order in which the dosage instructions should be applied or interpreted.",
              "type": "number",
              "pattern": "-?([0]|([1-9][0-9]*))"
            },
            "text": {
              "description": "Free text dosage instructions e.g. SIG.",
              "type": "string"
            },
            "additionalInstruction": {
              "description": "Supplemental instruction - e.g. \"with meals\".",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
              }
            },
            "patientInstruction": {
              "description": "Instructions in terms that are understood by the patient or consumer.",
              "type": "string"
            },
            "timing": {
              "description": "When medication should be administered.",
              "$ref": "Timing.schema.json#/definitions/Timing"
            },
            "asNeededBoolean": {
              "description": "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).",
              "type": "boolean"
            },
            "asNeededCodeableConcept": {
              "description": "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).",
              "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
            },
            "site": {
              "description": "Body site to administer to.",
              "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
            },
            "route": {
              "description": "How drug should enter body.",
              "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
            },
            "method": {
              "description": "Technique for administering medication.",
              "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
            },
            "doseRange": {
              "description": "Amount of medication per dose.",
              "$ref": "Range.schema.json#/definitions/Range"
            },
            "doseSimpleQuantity": {
              "description": "Amount of medication per dose.",
              "$ref": "Quantity.schema.json#/definitions/Quantity"
            },
            "maxDosePerPeriod": {
              "description": "Upper limit on medication per unit of time.",
              "$ref": "Ratio.schema.json#/definitions/Ratio"
            },
            "maxDosePerAdministration": {
              "description": "Upper limit on medication per administration.",
              "$ref": "Quantity.schema.json#/definitions/Quantity"
            },
            "maxDosePerLifetime": {
              "description": "Upper limit on medication per lifetime of the patient.",
              "$ref": "Quantity.schema.json#/definitions/Quantity"
            },
            "rateRatio": {
              "description": "Amount of medication per unit of time.",
              "$ref": "Ratio.schema.json#/definitions/Ratio"
            },
            "rateRange": {
              "description": "Amount of medication per unit of time.",
              "$ref": "Range.schema.json#/definitions/Range"
            },
            "rateSimpleQuantity": {
              "description": "Amount of medication per unit of time.",
              "$ref": "Quantity.schema.json#/definitions/Quantity"
            }
          }
        }
      ]
    }
  }
}
