Explain this in much "detail" like I get a clear picture. Explain like I never knew anything about it before.
| Method | What it involves | Common name |
|---|---|---|
| Invasive | A plastic tube is inserted into your windpipe (trachea) through your mouth or nose | Endotracheal intubation / "being on a ventilator" |
| Non-Invasive | A tight-fitting mask over your face or nose does the job — no tube down the throat | NIV / CPAP / BiPAP |
"NIV avoids the complications of invasive mechanical ventilation by keeping the upper airway defense mechanisms intact — the patient can still eat, clear secretions, and communicate normally." — Roberts and Hedges' Clinical Procedures in Emergency Medicine
| Phase | Pressure Name | Abbreviation |
|---|---|---|
| Breathing in (inspiration) | Inspiratory Positive Airway Pressure | IPAP |
| Breathing out (expiration) | Expiratory Positive Airway Pressure | EPAP |
"BiPAP unloads the respiratory muscles and can provide complete respiratory support." — Textbook passage (image)
| CPAP | BiPAP | |
|---|---|---|
| Analogy | Like inflating a tyre to a constant pressure — air is always pushing | Like a hand on your chest: pushes harder when you breathe in, relaxes when you breathe out |
| Pressures | One single constant pressure | Two pressures: higher (in) + lower (out) |
| Muscle unloading | None — you still do all the breathing work | Yes — significantly reduces breathing muscle effort |
| Best for | Oxygenation support, OSA | CO₂ retention, exhausted breathing muscles, heart failure |
| Contraindication | Why it's dangerous |
|---|---|
| Severe hypoxaemia (PaO₂:FiO₂ < 75) | Lungs failing so badly that a mask is not enough — need a ventilator tube |
| Severe acidaemia | Blood too acidic; requires more aggressive support |
| Multiorgan failure | Body failing in multiple systems simultaneously |
| Upper airway obstruction | If the airway is blocked (e.g., foreign body, severe swelling), positive pressure can't reach the lungs |
| Facial burns or trauma/anatomical abnormalities | The mask can't form a seal; may worsen injury |
| Respiratory arrest | Patient has stopped breathing — needs immediate intubation |
| Cardiac arrest or hemodynamic instability | NIV cannot stabilize a crashing heart |
| Uncooperative patient | A patient who fights the mask gets no benefit and may be harmed |
| Encephalopathy / altered consciousness | Cannot protect their own airway; risk of vomiting and aspirating (inhaling stomach contents into lungs) — potentially fatal |
| High aspiration risk (vomiting, excessive secretions, GI bleeding) | Positive pressure can force gastric contents into the lungs |
| Recent airway or GI surgery | Positive pressure can blow open surgical anastomoses (stitched connections) |
| Can't fit mask | No seal = no treatment |
"NIV reduces work of breathing by 60% and dyspnea scores by 29–67%, while improving inspiratory muscle endurance by 14–95% over spontaneous respirations." — Tintinalli's Emergency Medicine
| Feature | CPAP | BiPAP (NIV) |
|---|---|---|
| Pressure type | Single constant | Two levels (higher in, lower out) |
| Helps oxygenation? | Yes | Yes |
| Helps eliminate CO₂? | Minimally | Yes — strongly |
| Unloads breathing muscles? | No | Yes |
| Device needed | Mask + CPAP machine | Mask + BiPAP machine |
| Main uses | OSA, mild oxygenation support | COPD, heart failure, hypercapnic failure |
Make a mind map out of this.
ls /home/daytona/workspace/
mkdir -p /home/daytona/workspace/niv-mindmap && ls /home/daytona/workspace/
~/niv-mindmap/mindmap.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Non-Invasive Ventilation – Mind Map</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: #0f172a;
font-family: 'Segoe UI', sans-serif;
overflow: auto;
}
svg {
display: block;
}
/* Node styles */
.node-center rect { fill: #6366f1; rx: 16; stroke: #a5b4fc; stroke-width: 3; }
.node-center text { fill: #fff; font-size: 18px; font-weight: 800; }
.node-l1 rect { rx: 12; stroke-width: 2.5; }
.node-l1 text { font-size: 13px; font-weight: 700; }
.node-l2 rect { rx: 8; stroke-width: 1.5; }
.node-l2 text { font-size: 11px; font-weight: 500; }
.node-l3 rect { rx: 6; stroke-width: 1; }
.node-l3 text { font-size: 10px; font-weight: 400; }
.link { fill: none; stroke-width: 2; opacity: 0.6; }
</style>
</head>
<body>
<svg id="mindmap" xmlns="http://www.w3.org/2000/svg" width="2200" height="1600">
<defs>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="2" dy="3" stdDeviation="5" flood-color="#000" flood-opacity="0.45"/>
</filter>
</defs>
<!-- ===================== CONNECTOR LINES ===================== -->
<!-- Branch colours: CPAP=#22d3ee, BiPAP=#f472b6, Indications=#4ade80, Contraindications=#f87171, Equipment=#facc15, Benefits=#a78bfa -->
<!-- Center → L1 nodes -->
<!-- → CPAP (left-top) -->
<line class="link" stroke="#22d3ee" x1="1100" y1="800" x2="540" y2="430"/>
<!-- → BiPAP (left-mid) -->
<line class="link" stroke="#f472b6" x1="1100" y1="800" x2="480" y2="720"/>
<!-- → Indications (left-bot) -->
<line class="link" stroke="#4ade80" x1="1100" y1="800" x2="530" y2="1050"/>
<!-- → Contraindications (right-bot) -->
<line class="link" stroke="#f87171" x1="1100" y1="800" x2="1680" y2="1080"/>
<!-- → Equipment (right-top) -->
<line class="link" stroke="#facc15" x1="1100" y1="800" x2="1680" y2="430"/>
<!-- → Benefits vs Invasive (right-mid) -->
<line class="link" stroke="#a78bfa" x1="1100" y1="800" x2="1700" y2="750"/>
<!-- ===================== CPAP BRANCH (cyan) ===================== -->
<!-- L1 → L2 -->
<line class="link" stroke="#22d3ee" x1="540" y1="430" x2="290" y2="230"/>
<line class="link" stroke="#22d3ee" x1="540" y1="430" x2="200" y2="420"/>
<line class="link" stroke="#22d3ee" x1="540" y1="430" x2="260" y2="600"/>
<line class="link" stroke="#22d3ee" x1="540" y1="430" x2="540" y2="180"/>
<!-- ===================== BiPAP BRANCH (pink) ===================== -->
<line class="link" stroke="#f472b6" x1="480" y1="720" x2="200" y2="640"/>
<line class="link" stroke="#f472b6" x1="480" y1="720" x2="190" y2="820"/>
<line class="link" stroke="#f472b6" x1="480" y1="720" x2="280" y2="920"/>
<line class="link" stroke="#f472b6" x1="480" y1="720" x2="480" y2="580"/>
<!-- ===================== INDICATIONS BRANCH (green) ===================== -->
<line class="link" stroke="#4ade80" x1="530" y1="1050" x2="220" y2="990"/>
<line class="link" stroke="#4ade80" x1="530" y1="1050" x2="200" y2="1110"/>
<line class="link" stroke="#4ade80" x1="530" y1="1050" x2="220" y2="1230"/>
<line class="link" stroke="#4ade80" x1="530" y1="1050" x2="400" y2="1340"/>
<line class="link" stroke="#4ade80" x1="530" y1="1050" x2="560" y2="1340"/>
<!-- ===================== CONTRAINDICATIONS BRANCH (red) ===================== -->
<line class="link" stroke="#f87171" x1="1680" y1="1080" x2="1910" y2="940"/>
<line class="link" stroke="#f87171" x1="1680" y1="1080" x2="1950" y2="1060"/>
<line class="link" stroke="#f87171" x1="1680" y1="1080" x2="1930" y2="1180"/>
<line class="link" stroke="#f87171" x1="1680" y1="1080" x2="1880" y2="1290"/>
<line class="link" stroke="#f87171" x1="1680" y1="1080" x2="1700" y2="1340"/>
<line class="link" stroke="#f87171" x1="1680" y1="1080" x2="1510" y2="1360"/>
<!-- ===================== EQUIPMENT BRANCH (yellow) ===================== -->
<line class="link" stroke="#facc15" x1="1680" y1="430" x2="1900" y2="260"/>
<line class="link" stroke="#facc15" x1="1680" y1="430" x2="1980" y2="420"/>
<line class="link" stroke="#facc15" x1="1680" y1="430" x2="1900" y2="570"/>
<line class="link" stroke="#facc15" x1="1680" y1="430" x2="1680" y2="230"/>
<!-- ===================== BENEFITS BRANCH (purple) ===================== -->
<line class="link" stroke="#a78bfa" x1="1700" y1="750" x2="1940" y2="640"/>
<line class="link" stroke="#a78bfa" x1="1700" y1="750" x2="1960" y2="750"/>
<line class="link" stroke="#a78bfa" x1="1700" y1="750" x2="1940" y2="860"/>
<!-- ===================== NODES ===================== -->
<!-- ===== CENTER ===== -->
<g filter="url(#shadow)">
<rect x="960" y="750" width="280" height="100" rx="18" fill="#6366f1" stroke="#a5b4fc" stroke-width="3"/>
<text x="1100" y="793" text-anchor="middle" fill="white" font-size="20" font-weight="800" font-family="Segoe UI">Non-Invasive</text>
<text x="1100" y="820" text-anchor="middle" fill="white" font-size="20" font-weight="800" font-family="Segoe UI">Ventilation (NIV)</text>
</g>
<!-- ===== L1: CPAP ===== -->
<g filter="url(#shadow)">
<rect x="410" y="400" width="260" height="60" rx="12" fill="#0e7490" stroke="#22d3ee" stroke-width="2.5"/>
<text x="540" y="424" text-anchor="middle" fill="#cffafe" font-size="15" font-weight="700" font-family="Segoe UI">CPAP</text>
<text x="540" y="446" text-anchor="middle" fill="#cffafe" font-size="11" font-family="Segoe UI">Continuous Positive Airway Pressure</text>
</g>
<!-- CPAP L2 nodes -->
<g filter="url(#shadow)">
<rect x="150" y="195" width="280" height="50" rx="8" fill="#164e63" stroke="#22d3ee" stroke-width="1.5"/>
<text x="290" y="215" text-anchor="middle" fill="#a5f3fc" font-size="11" font-weight="600" font-family="Segoe UI">Single constant pressure</text>
<text x="290" y="233" text-anchor="middle" fill="#7dd3fc" font-size="10" font-family="Segoe UI">Same during IN and OUT breath</text>
</g>
<g filter="url(#shadow)">
<rect x="66" y="390" width="268" height="60" rx="8" fill="#164e63" stroke="#22d3ee" stroke-width="1.5"/>
<text x="200" y="413" text-anchor="middle" fill="#a5f3fc" font-size="11" font-weight="600" font-family="Segoe UI">Keeps alveoli open (PEEP)</text>
<text x="200" y="430" text-anchor="middle" fill="#7dd3fc" font-size="10" font-family="Segoe UI">Prevents collapse after each breath</text>
<text x="200" y="445" text-anchor="middle" fill="#7dd3fc" font-size="10" font-family="Segoe UI">No inspiratory muscle unloading</text>
</g>
<g filter="url(#shadow)">
<rect x="115" y="572" width="290" height="60" rx="8" fill="#164e63" stroke="#22d3ee" stroke-width="1.5"/>
<text x="260" y="595" text-anchor="middle" fill="#a5f3fc" font-size="11" font-weight="600" font-family="Segoe UI">Best Uses</text>
<text x="260" y="612" text-anchor="middle" fill="#7dd3fc" font-size="10" font-family="Segoe UI">Sleep apnoea (OSA) · Oxygenation</text>
<text x="260" y="627" text-anchor="middle" fill="#7dd3fc" font-size="10" font-family="Segoe UI">support · Ventilator weaning</text>
</g>
<g filter="url(#shadow)">
<rect x="400" y="140" width="280" height="50" rx="8" fill="#164e63" stroke="#22d3ee" stroke-width="1.5"/>
<text x="540" y="160" text-anchor="middle" fill="#a5f3fc" font-size="11" font-weight="600" font-family="Segoe UI">Tidal volume depends on patient</text>
<text x="540" y="178" text-anchor="middle" fill="#7dd3fc" font-size="10" font-family="Segoe UI">Patient still does all breathing work</text>
</g>
<!-- ===== L1: BiPAP ===== -->
<g filter="url(#shadow)">
<rect x="340" y="690" width="280" height="60" rx="12" fill="#9d174d" stroke="#f472b6" stroke-width="2.5"/>
<text x="480" y="714" text-anchor="middle" fill="#fce7f3" font-size="15" font-weight="700" font-family="Segoe UI">BiPAP</text>
<text x="480" y="736" text-anchor="middle" fill="#fce7f3" font-size="11" font-family="Segoe UI">Bilevel Positive Airway Pressure</text>
</g>
<!-- BiPAP L2 nodes -->
<g filter="url(#shadow)">
<rect x="30" y="610" width="340" height="60" rx="8" fill="#500724" stroke="#f472b6" stroke-width="1.5"/>
<text x="200" y="633" text-anchor="middle" fill="#fbcfe8" font-size="11" font-weight="600" font-family="Segoe UI">Two pressure levels</text>
<text x="200" y="650" text-anchor="middle" fill="#f9a8d4" font-size="10" font-family="Segoe UI">IPAP (higher, on breathing in)</text>
<text x="200" y="665" text-anchor="middle" fill="#f9a8d4" font-size="10" font-family="Segoe UI">EPAP (lower, on breathing out)</text>
</g>
<g filter="url(#shadow)">
<rect x="30" y="795" width="320" height="50" rx="8" fill="#500724" stroke="#f472b6" stroke-width="1.5"/>
<text x="190" y="815" text-anchor="middle" fill="#fbcfe8" font-size="11" font-weight="600" font-family="Segoe UI">Actively assists each breath</text>
<text x="190" y="833" text-anchor="middle" fill="#f9a8d4" font-size="10" font-family="Segoe UI">Unloads inspiratory muscles</text>
</g>
<g filter="url(#shadow)">
<rect x="100" y="895" width="360" height="60" rx="8" fill="#500724" stroke="#f472b6" stroke-width="1.5"/>
<text x="280" y="917" text-anchor="middle" fill="#fbcfe8" font-size="11" font-weight="600" font-family="Segoe UI">Best Uses</text>
<text x="280" y="934" text-anchor="middle" fill="#f9a8d4" font-size="10" font-family="Segoe UI">COPD exacerbation · Heart failure</text>
<text x="280" y="949" text-anchor="middle" fill="#f9a8d4" font-size="10" font-family="Segoe UI">Hypercapnic failure · Weak muscles</text>
</g>
<g filter="url(#shadow)">
<rect x="340" y="545" width="280" height="50" rx="8" fill="#500724" stroke="#f472b6" stroke-width="1.5"/>
<text x="480" y="565" text-anchor="middle" fill="#fbcfe8" font-size="11" font-weight="600" font-family="Segoe UI">Near-complete respiratory support</text>
<text x="480" y="583" text-anchor="middle" fill="#f9a8d4" font-size="10" font-family="Segoe UI">Without intubation</text>
</g>
<!-- ===== L1: INDICATIONS ===== -->
<g filter="url(#shadow)">
<rect x="380" y="1020" width="300" height="60" rx="12" fill="#14532d" stroke="#4ade80" stroke-width="2.5"/>
<text x="530" y="1044" text-anchor="middle" fill="#d1fae5" font-size="15" font-weight="700" font-family="Segoe UI">Indications</text>
<text x="530" y="1066" text-anchor="middle" fill="#d1fae5" font-size="11" font-family="Segoe UI">When to use NIV</text>
</g>
<!-- Indications L2 -->
<g filter="url(#shadow)">
<rect x="50" y="962" width="340" height="50" rx="8" fill="#052e16" stroke="#4ade80" stroke-width="1.5"/>
<text x="220" y="982" text-anchor="middle" fill="#bbf7d0" font-size="11" font-weight="600" font-family="Segoe UI">Increased dyspnoea</text>
<text x="220" y="1000" text-anchor="middle" fill="#86efac" font-size="10" font-family="Segoe UI">Moderate to severe breathlessness</text>
</g>
<g filter="url(#shadow)">
<rect x="30" y="1080" width="340" height="50" rx="8" fill="#052e16" stroke="#4ade80" stroke-width="1.5"/>
<text x="200" y="1100" text-anchor="middle" fill="#bbf7d0" font-size="11" font-weight="600" font-family="Segoe UI">Tachypnoea (fast breathing)</text>
<text x="200" y="1118" text-anchor="middle" fill="#86efac" font-size="10" font-family="Segoe UI">>24/min obstructive · >30/min restrictive</text>
</g>
<g filter="url(#shadow)">
<rect x="50" y="1200" width="340" height="60" rx="8" fill="#052e16" stroke="#4ade80" stroke-width="1.5"/>
<text x="220" y="1222" text-anchor="middle" fill="#bbf7d0" font-size="11" font-weight="600" font-family="Segoe UI">Increased work of breathing</text>
<text x="220" y="1240" text-anchor="middle" fill="#86efac" font-size="10" font-family="Segoe UI">Accessory muscle use</text>
<text x="220" y="1255" text-anchor="middle" fill="#86efac" font-size="10" font-family="Segoe UI">Abdominal paradox</text>
</g>
<g filter="url(#shadow)">
<rect x="240" y="1310" width="320" height="60" rx="8" fill="#052e16" stroke="#4ade80" stroke-width="1.5"/>
<text x="400" y="1332" text-anchor="middle" fill="#bbf7d0" font-size="11" font-weight="600" font-family="Segoe UI">Blood gas abnormalities</text>
<text x="400" y="1350" text-anchor="middle" fill="#86efac" font-size="10" font-family="Segoe UI">PaCO₂ >45 mmHg, pH <7.35</text>
<text x="400" y="1365" text-anchor="middle" fill="#86efac" font-size="10" font-family="Segoe UI">PaO₂:FiO₂ ratio <200 mmHg</text>
</g>
<g filter="url(#shadow)">
<rect x="430" y="1310" width="260" height="60" rx="8" fill="#052e16" stroke="#4ade80" stroke-width="1.5"/>
<text x="560" y="1332" text-anchor="middle" fill="#bbf7d0" font-size="11" font-weight="600" font-family="Segoe UI">Common conditions</text>
<text x="560" y="1350" text-anchor="middle" fill="#86efac" font-size="10" font-family="Segoe UI">COPD · Heart failure</text>
<text x="560" y="1365" text-anchor="middle" fill="#86efac" font-size="10" font-family="Segoe UI">Sleep apnoea (OSA)</text>
</g>
<!-- ===== L1: CONTRAINDICATIONS ===== -->
<g filter="url(#shadow)">
<rect x="1530" y="1045" width="300" height="70" rx="12" fill="#7f1d1d" stroke="#f87171" stroke-width="2.5"/>
<text x="1680" y="1071" text-anchor="middle" fill="#fee2e2" font-size="15" font-weight="700" font-family="Segoe UI">Contraindications</text>
<text x="1680" y="1093" text-anchor="middle" fill="#fee2e2" font-size="11" font-family="Segoe UI">When NOT to use NIV</text>
</g>
<!-- Contra L2 -->
<g filter="url(#shadow)">
<rect x="1780" y="910" width="320" height="60" rx="8" fill="#450a0a" stroke="#f87171" stroke-width="1.5"/>
<text x="1940" y="932" text-anchor="middle" fill="#fecaca" font-size="11" font-weight="600" font-family="Segoe UI">Severe hypoxaemia</text>
<text x="1940" y="950" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">PaO₂:FiO₂ <75 · Mask not enough</text>
<text x="1940" y="965" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Severe acidaemia</text>
</g>
<g filter="url(#shadow)">
<rect x="1810" y="1030" width="300" height="60" rx="8" fill="#450a0a" stroke="#f87171" stroke-width="1.5"/>
<text x="1960" y="1052" text-anchor="middle" fill="#fecaca" font-size="11" font-weight="600" font-family="Segoe UI">Airway compromise</text>
<text x="1960" y="1070" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Upper airway obstruction</text>
<text x="1960" y="1085" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Respiratory / cardiac arrest</text>
</g>
<g filter="url(#shadow)">
<rect x="1790" y="1150" width="300" height="60" rx="8" fill="#450a0a" stroke="#f87171" stroke-width="1.5"/>
<text x="1940" y="1172" text-anchor="middle" fill="#fecaca" font-size="11" font-weight="600" font-family="Segoe UI">Patient factors</text>
<text x="1940" y="1190" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Uncooperative · Encephalopathy</text>
<text x="1940" y="1205" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Inability to protect airway</text>
</g>
<g filter="url(#shadow)">
<rect x="1720" y="1260" width="320" height="60" rx="8" fill="#450a0a" stroke="#f87171" stroke-width="1.5"/>
<text x="1880" y="1282" text-anchor="middle" fill="#fecaca" font-size="11" font-weight="600" font-family="Segoe UI">Aspiration risk</text>
<text x="1880" y="1300" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Vomiting · Copious secretions</text>
<text x="1880" y="1315" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Severe GI bleeding</text>
</g>
<g filter="url(#shadow)">
<rect x="1570" y="1310" width="280" height="60" rx="8" fill="#450a0a" stroke="#f87171" stroke-width="1.5"/>
<text x="1710" y="1332" text-anchor="middle" fill="#fecaca" font-size="11" font-weight="600" font-family="Segoe UI">Structural / surgical</text>
<text x="1710" y="1350" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Facial burns / trauma</text>
<text x="1710" y="1365" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Recent GI or airway surgery</text>
</g>
<g filter="url(#shadow)">
<rect x="1390" y="1335" width="240" height="50" rx="8" fill="#450a0a" stroke="#f87171" stroke-width="1.5"/>
<text x="1510" y="1358" text-anchor="middle" fill="#fecaca" font-size="11" font-weight="600" font-family="Segoe UI">Multiorgan failure</text>
<text x="1510" y="1375" text-anchor="middle" fill="#fca5a5" font-size="10" font-family="Segoe UI">Can't fit mask</text>
</g>
<!-- ===== L1: EQUIPMENT ===== -->
<g filter="url(#shadow)">
<rect x="1570" y="400" width="220" height="60" rx="12" fill="#78350f" stroke="#facc15" stroke-width="2.5"/>
<text x="1680" y="424" text-anchor="middle" fill="#fef9c3" font-size="15" font-weight="700" font-family="Segoe UI">Equipment</text>
<text x="1680" y="446" text-anchor="middle" fill="#fef9c3" font-size="11" font-family="Segoe UI">What's needed</text>
</g>
<!-- Equipment L2 -->
<g filter="url(#shadow)">
<rect x="1760" y="228" width="290" height="60" rx="8" fill="#451a03" stroke="#facc15" stroke-width="1.5"/>
<text x="1905" y="250" text-anchor="middle" fill="#fef3c7" font-size="11" font-weight="600" font-family="Segoe UI">Mask types</text>
<text x="1905" y="268" text-anchor="middle" fill="#fde68a" font-size="10" font-family="Segoe UI">Full-face mask</text>
<text x="1905" y="283" text-anchor="middle" fill="#fde68a" font-size="10" font-family="Segoe UI">Nasal mask — must be tight-fitting</text>
</g>
<g filter="url(#shadow)">
<rect x="1840" y="390" width="290" height="60" rx="8" fill="#451a03" stroke="#facc15" stroke-width="1.5"/>
<text x="1985" y="412" text-anchor="middle" fill="#fef3c7" font-size="11" font-weight="600" font-family="Segoe UI">Machine settings</text>
<text x="1985" y="430" text-anchor="middle" fill="#fde68a" font-size="10" font-family="Segoe UI">IPAP · EPAP · Backup rate</text>
<text x="1985" y="445" text-anchor="middle" fill="#fde68a" font-size="10" font-family="Segoe UI">FiO₂ (oxygen concentration)</text>
</g>
<g filter="url(#shadow)">
<rect x="1760" y="545" width="290" height="60" rx="8" fill="#451a03" stroke="#facc15" stroke-width="1.5"/>
<text x="1905" y="567" text-anchor="middle" fill="#fef3c7" font-size="11" font-weight="600" font-family="Segoe UI">Patient requirement</text>
<text x="1905" y="585" text-anchor="middle" fill="#fde68a" font-size="10" font-family="Segoe UI">Co-operative & medically stable</text>
<text x="1905" y="600" text-anchor="middle" fill="#fde68a" font-size="10" font-family="Segoe UI">Awake and alert</text>
</g>
<g filter="url(#shadow)">
<rect x="1540" y="198" width="280" height="50" rx="8" fill="#451a03" stroke="#facc15" stroke-width="1.5"/>
<text x="1680" y="218" text-anchor="middle" fill="#fef3c7" font-size="11" font-weight="600" font-family="Segoe UI">Delivery modes</text>
<text x="1680" y="236" text-anchor="middle" fill="#fde68a" font-size="10" font-family="Segoe UI">Standalone NIV unit or ventilator</text>
</g>
<!-- ===== L1: BENEFITS ===== -->
<g filter="url(#shadow)">
<rect x="1590" y="715" width="220" height="70" rx="12" fill="#3b0764" stroke="#a78bfa" stroke-width="2.5"/>
<text x="1700" y="742" text-anchor="middle" fill="#ede9fe" font-size="15" font-weight="700" font-family="Segoe UI">Benefits</text>
<text x="1700" y="762" text-anchor="middle" fill="#ede9fe" font-size="11" font-family="Segoe UI">vs. Invasive ventilation</text>
</g>
<!-- Benefits L2 -->
<g filter="url(#shadow)">
<rect x="1820" y="608" width="310" height="60" rx="8" fill="#2e1065" stroke="#a78bfa" stroke-width="1.5"/>
<text x="1975" y="630" text-anchor="middle" fill="#ede9fe" font-size="11" font-weight="600" font-family="Segoe UI">No intubation needed</text>
<text x="1975" y="648" text-anchor="middle" fill="#c4b5fd" font-size="10" font-family="Segoe UI">No sedation · No ventilator pneumonia</text>
<text x="1975" y="663" text-anchor="middle" fill="#c4b5fd" font-size="10" font-family="Segoe UI">Patient can eat, speak, cough</text>
</g>
<g filter="url(#shadow)">
<rect x="1840" y="720" width="310" height="60" rx="8" fill="#2e1065" stroke="#a78bfa" stroke-width="1.5"/>
<text x="1995" y="742" text-anchor="middle" fill="#ede9fe" font-size="11" font-weight="600" font-family="Segoe UI">Physiological gains</text>
<text x="1995" y="760" text-anchor="middle" fill="#c4b5fd" font-size="10" font-family="Segoe UI">↓ Work of breathing by 60%</text>
<text x="1995" y="775" text-anchor="middle" fill="#c4b5fd" font-size="10" font-family="Segoe UI">↓ Dyspnoea scores by 29–67%</text>
</g>
<g filter="url(#shadow)">
<rect x="1820" y="833" width="310" height="60" rx="8" fill="#2e1065" stroke="#a78bfa" stroke-width="1.5"/>
<text x="1975" y="855" text-anchor="middle" fill="#ede9fe" font-size="11" font-weight="600" font-family="Segoe UI">Clinical outcomes</text>
<text x="1975" y="873" text-anchor="middle" fill="#c4b5fd" font-size="10" font-family="Segoe UI">Shorter hospital stay · Less ICU</text>
<text x="1975" y="888" text-anchor="middle" fill="#c4b5fd" font-size="10" font-family="Segoe UI">Reduced mortality in selected patients</text>
</g>
<!-- ===== LEGEND ===== -->
<rect x="30" y="40" width="680" height="90" rx="10" fill="#1e293b" stroke="#334155" stroke-width="1.5"/>
<text x="370" y="65" text-anchor="middle" fill="#94a3b8" font-size="13" font-weight="700" font-family="Segoe UI">LEGEND</text>
<circle cx="70" cy="90" r="7" fill="#22d3ee"/>
<text x="85" y="95" fill="#e2e8f0" font-size="11" font-family="Segoe UI">CPAP</text>
<circle cx="160" cy="90" r="7" fill="#f472b6"/>
<text x="175" y="95" fill="#e2e8f0" font-size="11" font-family="Segoe UI">BiPAP</text>
<circle cx="260" cy="90" r="7" fill="#4ade80"/>
<text x="275" y="95" fill="#e2e8f0" font-size="11" font-family="Segoe UI">Indications</text>
<circle cx="380" cy="90" r="7" fill="#f87171"/>
<text x="395" y="95" fill="#e2e8f0" font-size="11" font-family="Segoe UI">Contraindications</text>
<circle cx="530" cy="90" r="7" fill="#facc15"/>
<text x="545" y="95" fill="#e2e8f0" font-size="11" font-family="Segoe UI">Equipment</text>
<circle cx="630" cy="90" r="7" fill="#a78bfa"/>
<text x="645" y="95" fill="#e2e8f0" font-size="11" font-family="Segoe UI">Benefits</text>
<text x="370" y="120" text-anchor="middle" fill="#64748b" font-size="10" font-family="Segoe UI">NIV = Non-Invasive Ventilation · CPAP = Continuous Positive Airway Pressure · BiPAP = Bilevel Positive Airway Pressure</text>
</svg>
</body>
</html>
cd /home/daytona/workspace/niv-mindmap && python3 -c " from PIL import Image import subprocess, os # Convert HTML to PNG using a headless browser approach with playwright or cutycapt # Check what's available import shutil tools = ['chromium-browser','chromium','google-chrome','cutycapt','wkhtmltoimage','firefox'] for t in tools: path = shutil.which(t) if path: print(f'Found: {t} at {path}') "
chromium --headless --no-sandbox --disable-gpu --screenshot=/home/daytona/workspace/niv-mindmap/mindmap.png --window-size=2200,1600 "file:///home/daytona/workspace/niv-mindmap/mindmap.html" 2>&1
mindmap
Image · PNG
mindmap
HTML File · HTML
| Color | Branch | Contents |
|---|---|---|
| 🔵 Cyan | CPAP | Single constant pressure, PEEP, no muscle unloading, uses (OSA, weaning) |
| 🩷 Pink | BiPAP | IPAP/EPAP, actively assists breathing, near-complete support, uses (COPD, heart failure) |
| 🟢 Green | Indications | Dyspnoea, tachypnoea, accessory muscles, blood gas thresholds, common conditions |
| 🔴 Red | Contraindications | Arrest, severe hypoxaemia, encephalopathy, aspiration risk, structural issues |
| 🟡 Yellow | Equipment | Mask types, machine settings, patient requirements |
| 🟣 Purple | Benefits | No intubation, 60% ↓ work of breathing, shorter stays, reduced mortality |