{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-02",
  "title": "Dashboard 02",
  "description": "One patient's record on a ward: the patient banner, NEWS2 over time, the latest labs, and allergies and problems, with fictional data to replace with your records.",
  "registryDependencies": [
    "card",
    "@organui/patient-banner",
    "@organui/news2-chart",
    "@organui/lab-results",
    "@organui/allergy-list",
    "@organui/problem-list"
  ],
  "files": [
    {
      "path": "registry/base-nova/blocks/dashboard-02/page.tsx",
      "content": "import {\n  examplePatientRecord,\n  PatientRecord,\n} from \"@/components/patient-record\"\n\nexport default function Page() {\n  return (\n    <main className=\"mx-auto w-full max-w-7xl p-4 md:p-6\">\n      <PatientRecord record={examplePatientRecord} />\n    </main>\n  )\n}\n",
      "type": "registry:page",
      "target": "app/record/page.tsx"
    },
    {
      "path": "registry/base-nova/blocks/dashboard-02/components/patient-record.tsx",
      "content": "import {\n  AllergyList,\n  allergySummary,\n  type AllergyRecord,\n} from \"@/components/ui/allergy-list\"\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\"\nimport { LabResultsTable, type LabResult } from \"@/components/ui/lab-results\"\nimport { News2Chart, type News2Observation } from \"@/components/ui/news2-chart\"\nimport {\n  formatBannerDate,\n  formatNhsNumber,\n  PatientBanner,\n  type Patient,\n} from \"@/components/ui/patient-banner\"\nimport { ProblemList, type Problem } from \"@/components/ui/problem-list\"\n\nexport type PatientRecordData = {\n  patient: Patient\n  alerts?: readonly string[]\n  allergies?: AllergyRecord\n  problems: readonly Problem[]\n  observations: readonly News2Observation[]\n  labs: readonly LabResult[]\n  /** The day ages are counted on. */\n  today?: Date\n}\n\n// Every date on the record in the banner's unambiguous form, such as\n// \"25-Oct-2026\", and times as \"25-Oct 10:00\".\nconst formatTime = (time: string) =>\n  `${formatBannerDate(time).slice(0, 6)} ${time.slice(11, 16)}`\n\n/**\n * One patient's record on a ward: who they are, their early warning score\n * over time, the latest labs, and their allergies and problems. Replace\n * examplePatientRecord with your own records, such as from the fhir helper.\n */\nexport function PatientRecord({ record }: { record: PatientRecordData }) {\n  return (\n    // The page provides the main landmark, so the record also fits inside an\n    // app layout that has one.\n    <div className=\"flex flex-col gap-6\">\n      <h1 className=\"text-2xl font-semibold tracking-tight\">Patient record</h1>\n      <PatientBanner\n        patient={record.patient}\n        allergies={allergySummary(record.allergies)}\n        alerts={record.alerts}\n        today={record.today}\n      />\n      <div className=\"grid grid-cols-1 items-start gap-6 lg:grid-cols-[minmax(0,3fr)_minmax(0,2fr)]\">\n        <div className=\"flex min-w-0 flex-col gap-6\">\n          <Card>\n            <CardHeader>\n              <CardTitle>Observations</CardTitle>\n              <CardDescription>NEWS2, newest first</CardDescription>\n            </CardHeader>\n            <CardContent>\n              <News2Chart\n                observations={record.observations}\n                formatTime={formatTime}\n              />\n            </CardContent>\n          </Card>\n          <Card>\n            <CardHeader>\n              <CardTitle>Lab results</CardTitle>\n              <CardDescription>Latest values and their trend</CardDescription>\n            </CardHeader>\n            <CardContent>\n              <LabResultsTable\n                results={record.labs}\n                caption=\"Lab results this admission\"\n                formatDate={formatBannerDate}\n              />\n            </CardContent>\n          </Card>\n        </div>\n        <div className=\"flex min-w-0 flex-col gap-6\">\n          <Card>\n            <CardHeader>\n              <CardTitle>Allergies</CardTitle>\n              <CardDescription>And adverse reactions</CardDescription>\n            </CardHeader>\n            <CardContent>\n              <AllergyList\n                allergies={record.allergies}\n                caption=\"Allergies and adverse reactions\"\n                formatDate={formatBannerDate}\n              />\n            </CardContent>\n          </Card>\n          <Card>\n            <CardHeader>\n              <CardTitle>Problems</CardTitle>\n              <CardDescription>Active and past</CardDescription>\n            </CardHeader>\n            <CardContent>\n              <ProblemList\n                problems={record.problems}\n                caption=\"Problem list\"\n                formatDate={formatBannerDate}\n              />\n            </CardContent>\n          </Card>\n        </div>\n      </div>\n      <p className=\"text-xs text-muted-foreground\">\n        Fictional patient. Not for clinical use.\n      </p>\n    </div>\n  )\n}\n\nconst observation = (\n  time: string,\n  respirationRate: number,\n  spo2: number,\n  onOxygen: boolean,\n  systolic: number,\n  pulse: number,\n  temperature: number\n): News2Observation => ({\n  time,\n  respirationRate,\n  spo2,\n  onOxygen,\n  systolic,\n  pulse,\n  consciousness: \"alert\",\n  temperature,\n})\n\n// A fictional patient admitted with sepsis from a urinary infection, settling\n// overnight on antibiotics, so the page shows something before you connect\n// your own records. Not a treatment plan or clinical guidance.\nexport const examplePatientRecord: PatientRecordData = {\n  patient: {\n    name: { family: \"Okafor\", given: [\"Grace\", \"Adaeze\"], prefix: \"Mrs\" },\n    birthDate: \"1958-01-12\",\n    sex: \"Female\",\n    identifiers: [\n      { label: \"NHS number\", value: formatNhsNumber(\"9996543218\") },\n      { label: \"Hospital number\", value: \"RX4 118204\" },\n    ],\n  },\n  alerts: [\"Falls risk\"],\n  allergies: [\n    {\n      id: \"penicillin\",\n      substance: \"Penicillin\",\n      reactions: [\"Anaphylaxis\"],\n      severity: \"severe\",\n      verification: \"confirmed\",\n      recordedDate: \"2003-05-14\",\n    },\n    {\n      id: \"codeine\",\n      substance: \"Codeine\",\n      type: \"intolerance\",\n      reactions: [\"Vomiting\"],\n      severity: \"mild\",\n      recordedDate: \"2019-02-20\",\n    },\n  ],\n  problems: [\n    {\n      id: \"sepsis\",\n      name: \"Sepsis from a urinary tract infection\",\n      significance: \"major\",\n      onset: \"2026-10-24\",\n    },\n    {\n      id: \"diabetes\",\n      name: \"Type 2 diabetes mellitus\",\n      code: { system: \"SNOMED CT\", value: \"44054006\" },\n      significance: \"major\",\n      onset: \"2012-03-06\",\n    },\n    {\n      id: \"ckd\",\n      name: \"Chronic kidney disease stage 3A\",\n      code: { system: \"SNOMED CT\", value: \"700378005\" },\n      significance: \"major\",\n      onset: \"2023-06-02\",\n    },\n    {\n      id: \"hypertension\",\n      name: \"Essential hypertension\",\n      code: { system: \"SNOMED CT\", value: \"59621000\" },\n      onset: \"2009-11-17\",\n    },\n    {\n      id: \"pneumonia\",\n      name: \"Community acquired pneumonia\",\n      code: { system: \"SNOMED CT\", value: \"385093006\" },\n      status: \"resolved\",\n      onset: \"2024-01-08\",\n      resolved: \"2024-02-01\",\n    },\n  ],\n  observations: [\n    observation(\"2026-10-24T18:00:00Z\", 24, 93, false, 98, 112, 38.9),\n    observation(\"2026-10-24T22:00:00Z\", 22, 95, true, 108, 102, 38.2),\n    observation(\"2026-10-25T02:00:00Z\", 20, 96, true, 114, 96, 37.8),\n    observation(\"2026-10-25T06:00:00Z\", 18, 95, false, 118, 92, 37.6),\n    observation(\"2026-10-25T10:00:00Z\", 18, 96, false, 122, 88, 37.4),\n  ],\n  labs: [\n    {\n      id: \"crp\",\n      name: \"C-reactive protein\",\n      value: 186,\n      unit: \"mg/L\",\n      date: \"2026-10-25\",\n      referenceRange: { high: 5 },\n      history: [\n        { value: 212, date: \"2026-10-24\" },\n        { value: 186, date: \"2026-10-25\" },\n      ],\n    },\n    {\n      id: \"wcc\",\n      name: \"White cell count\",\n      value: 14.2,\n      unit: \"×10⁹/L\",\n      decimals: 1,\n      date: \"2026-10-25\",\n      referenceRange: { low: 4, high: 11 },\n      history: [\n        { value: 16.8, date: \"2026-10-24\" },\n        { value: 14.2, date: \"2026-10-25\" },\n      ],\n    },\n    {\n      id: \"creatinine\",\n      name: \"Creatinine\",\n      value: 142,\n      unit: \"µmol/L\",\n      date: \"2026-10-25\",\n      referenceRange: { low: 45, high: 84 },\n      history: [\n        { value: 118, date: \"2026-09-02\" },\n        { value: 156, date: \"2026-10-24\" },\n        { value: 142, date: \"2026-10-25\" },\n      ],\n    },\n    {\n      id: \"potassium\",\n      name: \"Potassium\",\n      value: 4.8,\n      unit: \"mmol/L\",\n      decimals: 1,\n      date: \"2026-10-25\",\n      referenceRange: {\n        low: 3.5,\n        high: 5.3,\n        criticalLow: 2.5,\n        criticalHigh: 6.5,\n      },\n    },\n  ],\n  today: new Date(\"2026-10-25\"),\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "1220px"
  },
  "docs": "Dashboard 02: https://organui.com/blocks#dashboard-02. The patient and readings are fictional; connect your own records, such as with the fhir helper, before clinical use.",
  "categories": [
    "dashboard"
  ],
  "type": "registry:block"
}