{
  "scenario": {
    "id": "sofa-partial-spo2-fallback-01",
    "name": "Ward Patient — Partial SOFA with SpO₂/FiO₂ Proxy",
    "description": "General medicine patient with worsening pneumonia. No ABG — SpO₂/FiO₂ used for respiratory SOFA. Partial scoring when labs missing; carry-forward and staleness flags when data ages.",
    "durationMinutes": 360,
    "tags": ["sofa", "partial-scoring", "spo2-fallback", "carry-forward", "ward"]
  },
  "patient": {
    "firstName": "Priya",
    "lastName": "Sharma",
    "dateOfBirth": "1970-01-14",
    "gender": "Female"
  },
  "encounter": {
    "department": "GeneralMedicine",
    "encounterType": "Inpatient",
    "attendingPhysician": "Dr. Noah Chen",
    "roomBed": "GM-8B-2",
    "admissionReason": "Worsening pneumonia, transferred from ED"
  },
  "events": [
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "HEART_RATE", "value": 92, "unit": "bpm", "source": "Device" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "RESP_RATE", "value": 20, "unit": "/min", "source": "Device" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "SYSTOLIC_BP", "value": 118, "unit": "mmHg", "source": "Device" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "DIASTOLIC_BP", "value": 72, "unit": "mmHg", "source": "Device" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "SPO2", "value": 93, "unit": "%", "source": "Device" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "FIO2_PCT", "value": 28, "unit": "%", "source": "Manual" },
      "note": "Nasal cannula 2L — S/F ~332, SOFA Resp 0"
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "SUPPLEMENTAL_O2", "value": 1, "unit": "flag", "source": "Manual" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "TEMP_C", "value": 38.5, "unit": "°C", "source": "Manual" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "GCS_EYE", "value": 4, "unit": "score", "source": "Manual" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "GCS_VERBAL", "value": 5, "unit": "score", "source": "Manual" }
    },
    {
      "offsetMinutes": 0,
      "type": "observation",
      "data": { "code": "GCS_MOTOR", "value": 6, "unit": "score", "source": "Manual" }
    },
    {
      "offsetMinutes": 30,
      "type": "observation",
      "data": { "code": "CREATININE_MG_DL", "value": 1.1, "unit": "mg/dL", "source": "Lab" },
      "note": "Partial SOFA — no platelets/bilirubin yet"
    },
    {
      "offsetMinutes": 120,
      "type": "observation",
      "data": { "code": "PLATELET_K_UL", "value": 165, "unit": "k/µL", "source": "Lab" }
    },
    {
      "offsetMinutes": 120,
      "type": "observation",
      "data": { "code": "BILIRUBIN_MG_DL", "value": 0.8, "unit": "mg/dL", "source": "Lab" },
      "note": "Baseline SOFA now more complete"
    },
    {
      "offsetMinutes": 180,
      "type": "observation",
      "data": { "code": "SPO2", "value": 88, "unit": "%", "source": "Device" }
    },
    {
      "offsetMinutes": 180,
      "type": "observation",
      "data": { "code": "FIO2_PCT", "value": 40, "unit": "%", "source": "Manual" },
      "note": "S/F 220 → SOFA Resp ~1; usedSpO2Fallback true"
    },
    {
      "offsetMinutes": 180,
      "type": "observation",
      "data": { "code": "RESP_RATE", "value": 26, "unit": "/min", "source": "Device" }
    },
    {
      "offsetMinutes": 240,
      "type": "observation",
      "data": { "code": "SPO2", "value": 84, "unit": "%", "source": "Device" }
    },
    {
      "offsetMinutes": 240,
      "type": "observation",
      "data": { "code": "FIO2_PCT", "value": 60, "unit": "%", "source": "Manual" },
      "note": "S/F 140 → SOFA Resp 2"
    },
    {
      "offsetMinutes": 240,
      "type": "observation",
      "data": { "code": "CREATININE_MG_DL", "value": 1.9, "unit": "mg/dL", "source": "Lab" }
    },
    {
      "offsetMinutes": 240,
      "type": "observation",
      "data": { "code": "PLATELET_K_UL", "value": 110, "unit": "k/µL", "source": "Lab" },
      "note": "SOFA Coag 1"
    },
    {
      "offsetMinutes": 300,
      "type": "observation",
      "data": { "code": "SYSTOLIC_BP", "value": 88, "unit": "mmHg", "source": "Device" }
    },
    {
      "offsetMinutes": 300,
      "type": "observation",
      "data": { "code": "DIASTOLIC_BP", "value": 52, "unit": "mmHg", "source": "Device" },
      "note": "MAP 64 → SOFA CV 1"
    },
    {
      "offsetMinutes": 300,
      "type": "observation",
      "data": { "code": "CREATININE_MG_DL", "value": 2.5, "unit": "mg/dL", "source": "Lab" },
      "note": "SOFA Renal 2; delta may reach ≥ 2"
    }
  ],
  "expectedOutcomes": [
    {
      "afterOffsetMinutes": 180,
      "type": "score",
      "scoreType": "SOFA",
      "description": "SOFA computed with usedSpO2Fallback in staleness flags"
    },
    {
      "afterOffsetMinutes": 300,
      "type": "alert",
      "alertType": "SOFA_SEPSIS",
      "description": "Multi-organ decline — delta ≥ 2 from baseline"
    }
  ]
}