{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/elation-health/main/json-schema/elation-health-paginated-patient-drug-intolerance-list-schema.json",
  "title": "PaginatedPatientDrugIntoleranceList",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elation-health-drug-intolerances-api-openapi.yml#/components/schemas/PaginatedPatientDrugIntoleranceList",
  "properties": {
    "count": {
      "type": "integer"
    },
    "next": {
      "format": "uri",
      "type": [
        "string",
        "null"
      ]
    },
    "previous": {
      "format": "uri",
      "type": [
        "string",
        "null"
      ]
    },
    "results": {
      "items": {
        "$ref": "#/$defs/PatientDrugIntolerance"
      },
      "type": "array"
    }
  },
  "required": [
    "results"
  ],
  "type": "object",
  "$defs": {
    "BlankEnum": {
      "enum": [
        ""
      ]
    },
    "PatientDrugIntolerance": {
      "properties": {
        "created_date": {
          "description": "When the record was created in Elation's systems.",
          "format": "date-time",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "deleted_date": {
          "description": "When the record was recorded deleted in Elation's systems.",
          "format": "date-time",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "readOnly": true,
          "type": "integer"
        },
        "name": {
          "description": "The Drug Intolerance's name; e.g. what drug the patient cannot tolerate.",
          "type": "string"
        },
        "patient": {
          "description": "The id of the patient.",
          "format": "int64",
          "type": "integer"
        },
        "reaction": {
          "description": "The type of reaction the patient experiences when taking the drug",
          "maxLength": 200,
          "type": [
            "string",
            "null"
          ]
        },
        "severity": {
          "description": "The severity of the patient's reaction.\n\n* `` - unknown\n* `255604002` - mild\n* `6736007` - moderate\n* `24484000` - severe",
          "oneOf": [
            {
              "$ref": "#/$defs/PatientDrugIntoleranceSeverityEnum"
            },
            {
              "$ref": "#/$defs/BlankEnum"
            }
          ]
        },
        "start_date": {
          "description": "The date of onset for the drug intolerance.",
          "format": "date",
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "allOf": [
            {
              "$ref": "#/$defs/PatientDrugIntoleranceStatusEnum"
            }
          ],
          "description": "Whether the drug intolerance is active or not.\n\n* `1` - Active\n* `2` - Inactive",
          "maximum": 65535,
          "minimum": 0
        }
      },
      "required": [
        "name",
        "patient"
      ],
      "type": "object"
    },
    "PatientDrugIntoleranceSeverityEnum": {
      "description": "* `` - unknown\n* `255604002` - mild\n* `6736007` - moderate\n* `24484000` - severe",
      "enum": [
        "255604002",
        "6736007",
        "24484000"
      ],
      "type": "string"
    },
    "PatientDrugIntoleranceStatusEnum": {
      "description": "* `1` - Active\n* `2` - Inactive",
      "enum": [
        1,
        2
      ],
      "type": "integer"
    }
  }
}