{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "lobar-pneumonia",
  "title": "Lobar pneumonia",
  "description": "Lobar pneumonia of the right lower lobe on the lungs, through congestion, red and grey hepatisation to resolution, with the spared middle lobe's silhouette sign and the observations, bloods and X-ray at each stage. Model licensed CC BY-SA 2.1 JP.",
  "registryDependencies": [
    "@organui/disease-viewer",
    "@organui/lungs"
  ],
  "files": [
    {
      "path": "registry/base-nova/lobar-pneumonia/lobar-pneumonia.tsx",
      "content": "import {\n  diseaseModel,\n  type Disease,\n  type DiseaseFinding,\n} from \"@/components/disease-model\"\nimport {\n  DiseaseViewer,\n  type DiseaseViewerProps,\n} from \"@/components/disease-viewer\"\nimport { lungsModel } from \"@/components/lungs\"\n\n// The model's four segments of the right lower lobe, which consolidate together.\nconst lowerLobe = [\"FMA7366\", \"FMA7364\", \"FMA7363\", \"FMA7362\"]\n\nconst consolidated = (description: string) =>\n  Object.fromEntries(\n    lowerLobe.map((id) => [id, { affected: true, description }])\n  ) as Record<string, DiseaseFinding>\n\n// Lobar pneumonia of the right lower lobe, usually pneumococcal: infection\n// fills the alveoli of the whole lobe, which passes through four classic\n// stages before it clears.\nexport const lobarPneumonia: Disease = {\n  name: \"Lobar pneumonia\",\n  code: \"J18.1\",\n  summary:\n    \"Bacteria, most often Streptococcus pneumoniae, fill the alveoli of a whole lobe with inflammatory exudate, so that part of the lung stops exchanging gas.\",\n  scales: [\n    {\n      id: \"lungs\",\n      label: \"Lungs\",\n      model: lungsModel,\n      // From the side, the oblique fissure separates the lower lobe from\n      // the middle lobe in front of it.\n      defaultView: \"Right lateral\",\n      findings: {\n        ...consolidated(\n          \"Protein-rich fluid, bacteria and a few neutrophils flood the alveoli. The lobe is heavy and red, and fine crackles are heard over the right base.\"\n        ),\n        FMA26661: {\n          label: \"Right bronchial tree\",\n          affected: false,\n          description:\n            \"The airways stay open, so on X-ray their air shows as dark branches through the white lobe (air bronchograms).\",\n        },\n        FMA7360: {\n          affected: false,\n          description:\n            \"The middle lobe is spared, so the right heart border it touches stays sharp on X-ray while the diaphragm outline behind the lower lobe is lost (the silhouette sign).\",\n        },\n        FMA7361: {\n          affected: false,\n          description:\n            \"Spared. The oblique fissure confines the infection to the lower lobe.\",\n        },\n      },\n    },\n  ],\n  stages: [\n    {\n      id: \"congestion\",\n      label: \"Congestion\",\n      summary:\n        \"Days 1–2. Fever, rigors and a cough; the lobe fills with fluid and bacteria multiply.\",\n    },\n    {\n      id: \"red-hepatisation\",\n      label: \"Red\",\n      summary:\n        \"Red hepatisation, days 2–4. The lobe is solid, red and airless, like liver; the cough brings up rust-coloured sputum.\",\n      findings: {\n        lungs: consolidated(\n          \"Red cells, neutrophils and fibrin pack the alveoli. Percussion is dull and the breathing sounds bronchial, because sound carries through solid lung.\"\n        ),\n      },\n      investigations: [\n        { name: \"SpO₂\", result: \"93% on air\", flag: \"low\" },\n        { name: \"White cells\", result: \"Neutrophilia\", flag: \"high\" },\n        { name: \"CRP\", result: \"Raised\", flag: \"high\" },\n        { name: \"Chest X-ray\", result: \"RLL consolidation\", flag: \"abnormal\" },\n      ],\n    },\n    {\n      id: \"grey-hepatisation\",\n      label: \"Grey\",\n      summary:\n        \"Grey hepatisation, days 4–8. Red cells break down and the lobe turns grey-brown; with antibiotics, the fever settles.\",\n      findings: {\n        lungs: consolidated(\n          \"Neutrophils and fibrin remain while red cells are broken down. The lobe is still solid, but the infection is being contained.\"\n        ),\n      },\n      investigations: [\n        { name: \"Temperature\", result: \"Settling\" },\n        { name: \"CRP\", result: \"Falling\", flag: \"high\" },\n        { name: \"Chest X-ray\", result: \"RLL consolidation\", flag: \"abnormal\" },\n      ],\n    },\n    {\n      id: \"resolution\",\n      label: \"Resolution\",\n      summary:\n        \"From about day 8. Enzymes and macrophages clear the exudate and the lobe's structure returns to normal.\",\n      findings: {\n        lungs: consolidated(\n          \"The exudate is digested and coughed up or cleared by macrophages. The lung heals without a scar; the X-ray can take six weeks to clear.\"\n        ),\n      },\n      investigations: [\n        { name: \"SpO₂\", result: \"Normal\" },\n        { name: \"CRP\", result: \"Normalising\" },\n        {\n          name: \"Chest X-ray\",\n          result: \"Repeat at 6 weeks if over 50 or smoking\",\n        },\n      ],\n    },\n  ],\n  investigations: [\n    { name: \"Temperature\", result: \"38.9 °C\", flag: \"high\" },\n    { name: \"Respiratory rate\", result: \"26 / min\", flag: \"high\" },\n    { name: \"CRP\", result: \"Raised\", flag: \"high\" },\n    { name: \"CURB-65\", result: \"0, treat at home\" },\n  ],\n}\n\n/** The lungs at congestion, the stage the viewer opens on. */\nexport const lobarPneumoniaModel = diseaseModel(lobarPneumonia)\n\nexport type LobarPneumoniaProps = Omit<DiseaseViewerProps, \"disease\">\n\nexport function LobarPneumonia(props: LobarPneumoniaProps) {\n  return <DiseaseViewer disease={lobarPneumonia} {...props} />\n}\n",
      "type": "registry:component"
    }
  ],
  "docs": "Lobar pneumonia docs: https://organui.com/docs/components/lobar-pneumonia. It reuses the lungs model, licensed CC BY-SA 2.1 JP (https://lifesciencedb.jp/bp3d/info/index.html#License); keep the viewer's credit visible. Educational, not for diagnosis.",
  "categories": [
    "disease",
    "respiratory"
  ],
  "type": "registry:component"
}