{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vaccinedatanavigator.org/schemas/injury_table.schema.json",
  "title": "COVID-19 Vaccine Injury Table Dataset",
  "description": "WHO causality framework injury table entries with structured supporting literature. Used by vaccine-pipeline/injury-tables/.",
  "type": "object",
  "required": ["_meta", "entries"],
  "additionalProperties": false,
  "properties": {
    "_meta": {
      "type": "object",
      "required": ["description", "criteriaVersion", "framework", "lastUpdated", "schemaVersion"],
      "additionalProperties": true,
      "properties": {
        "description": { "type": "string" },
        "criteriaVersion": { "type": "string", "enum": ["strict", "loosened"] },
        "framework": { "type": "string" },
        "lastUpdated": { "type": "string", "format": "date" },
        "schemaVersion": { "type": "string" },
        "updateCadence": { "type": "string" }
      }
    },
    "entries": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/entry" }
    }
  },
  "$defs": {
    "literatureCitation": {
      "type": "object",
      "required": ["label", "url", "type"],
      "additionalProperties": false,
      "properties": {
        "label": { "type": "string" },
        "url": { "type": "string", "format": "uri" },
        "type": {
          "type": "string",
          "enum": [
            "cohort_study",
            "case_series",
            "systematic_review",
            "narrative_review",
            "surveillance",
            "regulatory",
            "mechanism",
            "case_report"
          ]
        },
        "year": { "type": "integer", "minimum": 1990, "maximum": 2100 },
        "pmid": { "type": "string", "pattern": "^[0-9]+$" },
        "doi": { "type": "string" },
        "authors": { "type": "string" },
        "journal": { "type": "string" },
        "summary": { "type": "string" }
      }
    },
    "entry": {
      "type": "object",
      "required": [
        "vaccine",
        "condition",
        "causality_level",
        "time_window_days",
        "evidence_level",
        "supporting_studies_count",
        "supporting_literature",
        "last_updated"
      ],
      "additionalProperties": false,
      "properties": {
        "vaccine": { "type": "string" },
        "condition": { "type": "string" },
        "causality_level": {
          "type": "string",
          "enum": ["Very likely / Probable", "Possible", "Unlikely", "Unrelated", "Unclassifiable"]
        },
        "time_window_days": {
          "type": "array",
          "items": { "type": "integer" },
          "minItems": 2,
          "maxItems": 2
        },
        "evidence_level": {
          "type": "string",
          "enum": ["High", "Moderate", "Low", "Very Low"]
        },
        "supporting_studies_count": { "type": "integer", "minimum": 0 },
        "supporting_literature": {
          "type": "array",
          "minItems": 1,
          "items": { "$ref": "#/$defs/literatureCitation" }
        },
        "key_mechanisms": {
          "type": "array",
          "items": { "type": "string" }
        },
        "key_sources": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Deprecated shorthand labels; prefer supporting_literature."
        },
        "notes": { "type": "string" },
        "last_updated": { "type": "string", "format": "date" },
        "who_assessment_notes": { "type": "string" }
      }
    }
  }
}