{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://clarivius.com/track-a-schema.json",
  "title": "Clarivius Track A Anonymised Case Intake Schema",
  "description": "Strict JSON Schema for Clarivius Peer doctor-to-doctor consultations. In accordance with EU GDPR Recital 26 and Clarivius Hard Invariant #1, Track A cases must be completely de-identified. Only the four canonical clinical fields (age, sex, bmi, clinical_narrative) and operational routing fields are accepted. Real patient identifiers (PII/PHI), dates of birth, national health insurance numbers, hospital case IDs, addresses, and imaging files are strictly prohibited.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "age",
    "sex",
    "clinical_narrative"
  ],
  "properties": {
    "age": {
      "type": "integer",
      "minimum": 0,
      "maximum": 130,
      "description": "Patient age in completed years at the time of consultation request."
    },
    "sex": {
      "type": "string",
      "enum": [
        "male",
        "female",
        "other",
        "unknown"
      ],
      "description": "Biological sex or gender category relevant for clinical pathophysiology."
    },
    "bmi": {
      "type": "number",
      "minimum": 10.0,
      "maximum": 80.0,
      "description": "Body Mass Index (BMI in kg/m^2). Calculated or measured."
    },
    "clinical_narrative": {
      "type": "string",
      "minLength": 50,
      "maxLength": 30000,
      "description": "Anonymised clinical chronology, presentation, diagnostic history, lab values, and specific surgical/medical question for the peer specialist. Must NOT contain patient names, dates of birth, telephone numbers, hospital record numbers, clinician names, or geographic identifiers."
    },
    "requested_subspecialty": {
      "type": "string",
      "maxLength": 100,
      "description": "Optional medical subspecialty requested (e.g. Bulbourethral & Perineal Reconstructive Urology)."
    },
    "urgency": {
      "type": "string",
      "enum": [
        "routine",
        "expedited",
        "critical"
      ],
      "default": "routine",
      "description": "Clinical urgency of the consult request."
    },
    "submitting_physician_country": {
      "type": "string",
      "pattern": "^[A-Z]{2}$",
      "description": "ISO 3166-1 alpha-2 country code of the requesting physician (e.g. CZ, DE, AT)."
    }
  }
}
