{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://backpr.com/standard/v1/health-profile.schema.json",
  "$comment": "Open Youth Registration format 1.x, BackPR, https://backpr.com/open-youth-registration. CC BY 4.0: https://creativecommons.org/licenses/by/4.0/",
  "title": "Health profile",
  "description": "A participant's allergies, medications, conditions and care needs, as the family reports them. Custom fields must start with x- (for example x-bunk); other names are reserved for this format. Software that rewrites a file must keep fields it doesn't recognize.",
  "type": "object",
  "properties": {
    "noKnownAllergies": {
      "type": "boolean",
      "description": "True when the family reports no known allergies (as opposed to leaving allergies blank)."
    },
    "allergies": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "allergen": {
            "type": "string"
          },
          "category": {
            "enum": [
              "food",
              "insect",
              "medication",
              "environmental",
              "latex",
              "other"
            ]
          },
          "reaction": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "mild",
              "moderate",
              "severe",
              "unknown"
            ]
          },
          "actionPlan": {
            "type": "string",
            "description": "What staff should do if the child reacts."
          },
          "epinephrine": {
            "type": "object",
            "properties": {
              "prescribed": {
                "type": "boolean"
              },
              "carriedBy": {
                "enum": [
                  "participant",
                  "staff",
                  "both",
                  "unknown"
                ],
                "description": "Who carries the auto-injector: the participant, staff, or both (child carries one, staff keep a spare)."
              },
              "expires": {
                "$ref": "common.schema.json#/$defs/date",
                "description": "Expiration date on the auto-injector's label."
              }
            }
          }
        },
        "required": [
          "allergen"
        ]
      }
    },
    "medications": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "strength": {
            "type": "string"
          },
          "dose": {
            "type": "string"
          },
          "route": {
            "type": "string",
            "description": "For example by mouth, inhaled or on the skin."
          },
          "schedule": {
            "type": "string"
          },
          "givenByStaff": {
            "type": "boolean"
          },
          "authorizationOnFile": {
            "type": "boolean",
            "description": "A signed medication authorization is on file with the program."
          },
          "expires": {
            "$ref": "common.schema.json#/$defs/date",
            "description": "Expiration date on the medication's label."
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "actionPlan": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "dietaryNeeds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "supportNeeds": {
      "type": "string",
      "description": "Behavioral, learning or sensory needs and what helps."
    },
    "physician": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        }
      }
    },
    "insurance": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string",
          "description": "Insurance company or Medicaid."
        },
        "memberId": {
          "type": "string"
        },
        "groupNumber": {
          "type": "string"
        }
      }
    },
    "immunizationRecordOnFile": {
      "type": "boolean"
    },
    "updatedAt": {
      "$ref": "common.schema.json#/$defs/dateTime",
      "description": "When this record last changed. When two files disagree, the later updatedAt wins."
    }
  },
  "required": [],
  "additionalProperties": true
}