{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "entry": {
      "description": "One allergy or intolerance.",
      "properties": {
        "allergens": {
          "description": "List of the allergens or substances that cause the reaction.",
          "items": {
            "description": "One item of the list of the allergens or substances that cause the reaction.",
            "maxGraphemes": 256,
            "maxLength": 2560,
            "type": "string"
          },
          "maxLength": 100,
          "type": "array"
        },
        "category": {
          "description": "The cause category of the allergy or intolerance.",
          "knownValues": [
            "environment",
            "food",
            "medication",
            "biologic"
          ],
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "codes": {
          "description": "List of the codes for this allergy or intolerance, or for its allergen, in standard classifications (for example SNOMED CT).",
          "items": {
            "description": "One item of the list of the codes for this allergy or intolerance, or for its allergen, in standard classifications (for example SNOMED CT).",
            "ref": "ai.newnal.mydata.defs#coding",
            "type": "ref"
          },
          "maxLength": 20,
          "type": "array"
        },
        "frequency": {
          "description": "How often it recurs.",
          "knownValues": [
            "seasonal",
            "occasional",
            "after_trigger",
            "daily"
          ],
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "name": {
          "description": "The name of the allergy or intolerance.",
          "maxGraphemes": 256,
          "maxLength": 2560,
          "type": "string"
        },
        "notes": {
          "description": "An additional note.",
          "maxGraphemes": 3000,
          "maxLength": 30000,
          "type": "string"
        },
        "precautions": {
          "description": "List of the precautions the user recorded. They are not to be taken as medically verified prohibitions.",
          "items": {
            "description": "One item of the list of the precautions the user recorded.",
            "maxGraphemes": 256,
            "maxLength": 2560,
            "type": "string"
          },
          "maxLength": 100,
          "type": "array"
        },
        "reactions": {
          "description": "List of the reaction symptoms that appear.",
          "items": {
            "description": "One item of the list of the reaction symptoms that appear.",
            "maxGraphemes": 256,
            "maxLength": 2560,
            "type": "string"
          },
          "maxLength": 100,
          "type": "array"
        },
        "severity": {
          "description": "The severity of the reaction.",
          "knownValues": [
            "mild",
            "moderate",
            "severe",
            "critical"
          ],
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "status": {
          "description": "The management or progress status of this allergy or intolerance.",
          "knownValues": [
            "active",
            "resolved"
          ],
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "Allergies and intolerances the user has, with their allergens, reactions and severity. They are kept apart from health.healthStatus so that they can be shared on their own, for example with a food, medication or care service. Other health conditions and symptoms are kept in health.healthStatus, and food preferences and dislikes in interestsAndTastes.food.",
      "key": "tid",
      "record": {
        "properties": {
          "_meta": {
            "ref": "ai.newnal.mydata.defs#recordMeta",
            "type": "ref"
          },
          "data": {
            "closed": true,
            "refs": [
              "#entry"
            ],
            "type": "union"
          }
        },
        "required": [
          "data",
          "_meta"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "ai.newnal.mydata.healthAllergies",
  "lexicon": 1
}
