{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oracle-health-data-intelligence/json-schema/oracle-health-data-intelligence-allergy-schema.json",
  "title": "Allergy",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-health-data-intelligence-populations-api-openapi.yml#/components/schemas/Allergy",
  "type": "object",
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "assertedOn": {
      "type": "string",
      "format": "date-time"
    },
    "onset": {
      "type": "string",
      "format": "date-time"
    },
    "resolvedOn": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "$ref": "#/$defs/CodeableConcept"
    },
    "type": {
      "$ref": "#/$defs/CodeableConcept"
    },
    "category": {
      "$ref": "#/$defs/CodeableConcept"
    },
    "code": {
      "$ref": "#/$defs/CodeableConcept"
    },
    "criticality": {
      "$ref": "#/$defs/CodeableConcept"
    },
    "asserter": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        }
      }
    },
    "encounter": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "text": {
            "type": "string"
          },
          "author": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      }
    },
    "provenances": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "reactions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "reaction": {
            "$ref": "#/$defs/CodeableConcept"
          },
          "severity": {
            "$ref": "#/$defs/CodeableConcept"
          }
        }
      }
    },
    "sourceIdentifier": {
      "type": "object",
      "properties": {
        "dataPartitionId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    }
  },
  "$defs": {
    "CodeableConcept": {
      "type": "object",
      "properties": {
        "codings": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "sourceCodings": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "concepts": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "text": {
          "type": "string"
        }
      }
    }
  }
}