{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://backpr.com/standard/v1/participant.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": "Participant",
  "description": "A child or youth registered in programs. 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": {
    "id": {
      "$ref": "common.schema.json#/$defs/id"
    },
    "firstName": {
      "type": "string"
    },
    "lastName": {
      "type": "string"
    },
    "preferredName": {
      "type": "string"
    },
    "dateOfBirth": {
      "$ref": "common.schema.json#/$defs/date"
    },
    "gender": {
      "enum": [
        "female",
        "male",
        "other",
        "unknown"
      ],
      "description": "As the family reports it. Used for grouping such as cabins, rooms or teams. Values match HL7 FHIR AdministrativeGender."
    },
    "pronouns": {
      "type": "string"
    },
    "grade": {
      "type": "object",
      "properties": {
        "level": {
          "enum": [
            "PK",
            "TK",
            "K",
            "1",
            "2",
            "3",
            "4",
            "5",
            "6",
            "7",
            "8",
            "9",
            "10",
            "11",
            "12"
          ],
          "description": "PK = pre-kindergarten, TK = transitional kindergarten, K = kindergarten (OneRoster KG), 1-12 = grades (OneRoster 01-12)."
        },
        "schoolYear": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{4}$",
          "description": "For example 2026-2027."
        }
      }
    },
    "school": {
      "type": "string"
    },
    "languagesAtHome": {
      "type": "array",
      "items": {
        "$ref": "common.schema.json#/$defs/language"
      }
    },
    "health": {
      "$ref": "health-profile.schema.json"
    },
    "custodyNotes": {
      "type": "string",
      "description": "Living or custody arrangements staff should know, for example alternating weeks. Record anyone who may not pick up in pickupRestrictions."
    },
    "notes": {
      "type": "string"
    },
    "externalIds": {
      "$ref": "common.schema.json#/$defs/externalIds"
    },
    "updatedAt": {
      "$ref": "common.schema.json#/$defs/dateTime",
      "description": "When this record last changed. When two files disagree, the later updatedAt wins."
    }
  },
  "required": [
    "id",
    "firstName",
    "lastName"
  ],
  "additionalProperties": true
}