attachment
attachment

Analyze this ecg

Reading File
Finding Sources
Finding Sources
Searching PubMed

"anterior myocardial infarction" AND "left anterior fascicular block" ECG

Finding Sources
Finding Sources
Reading File
Reading File
Here is a structured analysis of this ECG:

ECG Analysis — Pushap Devi, Female, 68 Years

Date: 30-04-2026 | HR: 96 bpm | Paper speed: 25 mm/s | Gain: 10 mm/mV

Measured Intervals

ParameterValueNormal
PR132 ms120–200 ms ✅
QRS128 ms<120 ms ⚠️ (widened)
QT / QTc372 / 474 msQTc borderline prolonged ⚠️
RV5/SV10.40 / 2.316 mV
P-R-S-T74–61–84

Machine-Reported Diagnoses (confirmed by report)

  1. Sinus Rhythm — Rate 96 bpm, regular
  2. Prolonged P-wave — Suggests left atrial enlargement/Right Atrial Enlargement (see below)
  3. Poor R-wave Progression (V2–V3) — Anterior forces diminished
  4. QS Wave in Lead V1 — Consistent with anterior septal infarction
  5. Left Anterior Fascicular Block (LAFB) — Left axis deviation (QRS –45° or more leftward)
  6. Right Atrial Enlargement — Tall, peaked P waves
  7. Acute Anteroseptal Myocardial Infarction — The most critical finding
  8. Slight ST Elevation in V1–V2 — Active injury pattern
  9. T-Wave Abnormality in aVL — Lateral ischemia/injury extension

Clinical Interpretation

🔴 Acute Anteroseptal STEMI (Highest Priority)

  • ST elevation in V1–V2 with QS morphology in V1 indicates proximal or mid-LAD occlusion
  • Poor R-wave progression (V2–V3) with QS in V1 reflects established anterior septal necrosis or a very early acute event
  • The machine flags this as "Acute Anteroseptal Myocardial Infarction" — this must be treated as a STEMI equivalent until proven otherwise
  • Per Tintinalli's Emergency Medicine: "ST-segment elevation in V1, V2, and V3 from proximal LAD occlusion is a critical finding requiring emergent reperfusion"

🟠 Left Anterior Fascicular Block (LAFB)

  • QRS is widened (128 ms) with left axis deviation
  • LAFB occurs with block of the anterior fascicle of the left bundle — produces abnormal left axis deviation on ECG
  • Per Harrison's: "A block in the anterior fascicle of the left bundle system (LAFB or hemiblock) produces left axis deviation"
  • LAFB in the setting of acute anterior MI indicates the infarct is encroaching on the conduction system — increases risk of progression to complete heart block

🟡 Right Atrial Enlargement

  • Prolonged/tall P-waves suggest right atrial enlargement, possibly due to pulmonary hypertension or cor pulmonale as a pre-existing condition

🟡 Borderline QTc Prolongation (474 ms)

  • May be a consequence of ischemia or electrolyte disturbance — monitor closely; avoid QT-prolonging drugs

Key Concern: LAD Territory Involvement

The combination of:
  • QS pattern in V1
  • Poor R-wave progression V2–V3
  • Slight ST elevation V1–V2
  • LAFB (conduction system involvement)
  • T-wave abnormality in aVL
…strongly localizes the infarct to the proximal-to-mid Left Anterior Descending (LAD) artery, potentially involving the first septal perforator.

Immediate Clinical Actions Required

PriorityAction
1Activate Cath Lab / STEMI protocol — door-to-balloon time <90 min
212-lead serial ECGs every 15–30 min to track evolution
3IV access, continuous cardiac monitoring, defibrillator at bedside
4Aspirin 325 mg loading + P2Y12 inhibitor (ticagrelor or clopidogrel)
5Anticoagulation (heparin or enoxaparin)
6Troponin, CK-MB, BMP (electrolytes, renal function)
7Watch for AV block progression given LAFB + anterior MI
8Avoid QT-prolonging medications (QTc 474 ms)

⚠️ Clinical Disclaimer: This analysis is intended to support — not replace — clinical judgment. A qualified cardiologist must review the original ECG tracing and assess the patient clinically. Given the acute anteroseptal MI pattern in a 68-year-old female, emergent management is indicated.

Generate a clinical summary document for the medical team

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not foun…

Running Command

mkdir -p /home/daytona/workspace/ecg-report && ls /home/daytona/skills/docx/

Writing File

~/ecg-report/generate_report.js

const {
  Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
  HeadingLevel, AlignmentType, BorderStyle, WidthType, VerticalAlign,
  ShadingType, PageNumber, Header, Footer
} = require('docx');
const fs = require('fs');

// ── Helpers ────────────────────────────────────────────────────────────────

const RED   = "C0392B";
const ORANGE= "E67E22";
const DARK  = "1A252F";
const BLUE  = "1A5276";
const LIGHT_BLUE = "D6EAF8";
const LIGHT_RED  = "FADBD8";
const LIGHT_ORANGE = "FDEBD0";
const LIGHT_GRAY = "F2F3F4";
const WHITE = "FFFFFF";

function heading1(text) {
  return new Paragraph({
    heading: HeadingLevel.HEADING_1,
    spacing: { before: 320, after: 120 },
    children: [
      new TextRun({
        text,
        bold: true,
        size: 28,
        color: WHITE,
        font: "Calibri",
      }),
    ],
    shading: { type: ShadingType.SOLID, color: BLUE },
    indent: { left: 200, right: 200 },
  });
}

function heading2(text, color = BLUE) {
  return new Paragraph({
    spacing: { before: 240, after: 80 },
    children: [
      new TextRun({ text, bold: true, size: 24, color, font: "Calibri" }),
    ],
    border: {
      bottom: { style: BorderStyle.SINGLE, size: 6, color },
    },
  });
}

function bodyText(text, opts = {}) {
  return new Paragraph({
    spacing: { after: 80 },
    children: [
      new TextRun({
        text,
        size: 20,
        font: "Calibri",
        color: DARK,
        bold: opts.bold || false,
        italics: opts.italic || false,
      }),
    ],
  });
}

function bulletPoint(text, highlight = null) {
  return new Paragraph({
    bullet: { level: 0 },
    spacing: { after: 60 },
    children: [
      new TextRun({
        text,
        size: 20,
        font: "Calibri",
        color: DARK,
        highlight: highlight || undefined,
        bold: highlight ? true : false,
      }),
    ],
  });
}

function alertBox(text, bgColor, textColor = DARK) {
  return new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    margins: { top: 60, bottom: 60, left: 100, right: 100 },
    borders: {
      top:    { style: BorderStyle.SINGLE, size: 8, color: RED },
      bottom: { style: BorderStyle.SINGLE, size: 8, color: RED },
      left:   { style: BorderStyle.SINGLE, size: 8, color: RED },
      right:  { style: BorderStyle.SINGLE, size: 8, color: RED },
    },
    rows: [
      new TableRow({
        children: [
          new TableCell({
            shading: { type: ShadingType.SOLID, color: bgColor },
            verticalAlign: VerticalAlign.CENTER,
            children: [
              new Paragraph({
                alignment: AlignmentType.CENTER,
                children: [
                  new TextRun({ text, bold: true, size: 22, color: textColor, font: "Calibri" }),
                ],
              }),
            ],
          }),
        ],
      }),
    ],
  });
}

function makeTable(headers, rows, headerBg = BLUE) {
  const headerRow = new TableRow({
    tableHeader: true,
    children: headers.map(h =>
      new TableCell({
        shading: { type: ShadingType.SOLID, color: headerBg },
        verticalAlign: VerticalAlign.CENTER,
        children: [
          new Paragraph({
            alignment: AlignmentType.CENTER,
            children: [new TextRun({ text: h, bold: true, size: 19, color: WHITE, font: "Calibri" })],
          }),
        ],
      })
    ),
  });

  const dataRows = rows.map((row, i) =>
    new TableRow({
      children: row.map((cell, j) =>
        new TableCell({
          shading: { type: ShadingType.SOLID, color: i % 2 === 0 ? LIGHT_GRAY : WHITE },
          verticalAlign: VerticalAlign.CENTER,
          children: [
            new Paragraph({
              alignment: j === 0 ? AlignmentType.LEFT : AlignmentType.CENTER,
              children: [
                new TextRun({
                  text: cell.text || cell,
                  size: 19,
                  font: "Calibri",
                  bold: cell.bold || false,
                  color: cell.color || DARK,
                }),
              ],
            }),
          ],
        })
      ),
    })
  );

  return new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    rows: [headerRow, ...dataRows],
  });
}

function spacer(lines = 1) {
  return new Paragraph({ spacing: { after: 80 * lines }, children: [] });
}

// ── Document Assembly ──────────────────────────────────────────────────────

const doc = new Document({
  creator: "Orris Clinical AI",
  title: "ECG Clinical Summary — Pushap Devi",
  description: "AI-assisted ECG interpretation for medical team handover",
  sections: [
    {
      headers: {
        default: new Header({
          children: [
            new Paragraph({
              alignment: AlignmentType.RIGHT,
              children: [
                new TextRun({ text: "CONFIDENTIAL — CLINICAL DOCUMENT", size: 16, color: "7F8C8D", font: "Calibri", italics: true }),
              ],
            }),
          ],
        }),
      },
      footers: {
        default: new Footer({
          children: [
            new Paragraph({
              alignment: AlignmentType.CENTER,
              children: [
                new TextRun({ text: "ECG Clinical Summary | Pushap Devi | 68F | Generated: 22-May-2026 | ", size: 16, color: "7F8C8D", font: "Calibri" }),
                new TextRun({ children: [new PageNumber()], size: 16, color: "7F8C8D", font: "Calibri" }),
              ],
            }),
          ],
        }),
      },
      children: [

        // ── Title Block ──
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { before: 0, after: 40 },
          children: [
            new TextRun({ text: "ECG CLINICAL SUMMARY", bold: true, size: 40, color: BLUE, font: "Calibri" }),
          ],
        }),
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 40 },
          children: [
            new TextRun({ text: "AI-Assisted Interpretation | For Medical Team Review", size: 20, color: "7F8C8D", font: "Calibri", italics: true }),
          ],
        }),
        spacer(),

        // ── Alert Box ──
        alertBox("⚠  URGENT: ACUTE ANTEROSEPTAL STEMI PATTERN — IMMEDIATE CATH LAB ACTIVATION REQUIRED", LIGHT_RED, RED),
        spacer(),

        // ── Patient Info ──
        heading1("1. PATIENT INFORMATION"),
        makeTable(
          ["Field", "Detail"],
          [
            ["Patient Name", "Pushap Devi"],
            ["Patient ID", "155234"],
            ["Sex / Age", "Female, 68 Years"],
            ["Requisition No.", "368"],
            ["ECG Date & Time", "30-04-2026 at 10:46:26"],
            ["Reporting Institution", "Bee Emm General Hospital"],
            ["Document Generated", "22-May-2026 by Orris Clinical AI"],
          ]
        ),
        spacer(),

        // ── ECG Parameters ──
        heading1("2. ECG TECHNICAL PARAMETERS"),
        makeTable(
          ["Parameter", "Recorded Value", "Normal Range", "Status"],
          [
            ["Heart Rate", "96 bpm", "60–100 bpm", { text: "Normal ✓", color: "1E8449" }],
            ["PR Interval", "132 ms", "120–200 ms", { text: "Normal ✓", color: "1E8449" }],
            ["QRS Duration", "128 ms", "<120 ms", { text: "Widened ⚠", bold: true, color: ORANGE }],
            ["QT / QTc", "372 / 474 ms", "QTc <450 ms (F)", { text: "Borderline ⚠", bold: true, color: ORANGE }],
            ["RV5 / SV1", "0.40 / 2.316 mV", "—", "Recorded"],
            ["P / R / S / T", "74 / –61 / 84 ms", "—", "See analysis"],
            ["Paper Speed", "25 mm/s", "Standard", "✓"],
            ["Gain", "10 mm/mV", "Standard", "✓"],
            ["Filter", "0.67–100 Hz, AC 50", "Standard", "✓"],
          ]
        ),
        spacer(),

        // ── Diagnoses ──
        heading1("3. DIAGNOSES & FINDINGS"),

        heading2("3a. PRIMARY FINDING — CRITICAL", RED),
        spacer(0.5),

        new Table({
          width: { size: 100, type: WidthType.PERCENTAGE },
          rows: [
            new TableRow({
              children: [
                new TableCell({
                  shading: { type: ShadingType.SOLID, color: LIGHT_RED },
                  children: [
                    new Paragraph({
                      children: [new TextRun({ text: "🔴  ACUTE ANTEROSEPTAL MYOCARDIAL INFARCTION", bold: true, size: 22, color: RED, font: "Calibri" })],
                      spacing: { after: 80 },
                    }),
                    bulletPoint("ST elevation in leads V1–V2 (slight but present) — active injury pattern"),
                    bulletPoint("QS morphology in lead V1 — established septal necrosis or evolving infarct"),
                    bulletPoint("Poor R-wave progression in V2–V3 — anterior wall involvement"),
                    bulletPoint("T-wave abnormality in aVL — lateral extension of ischemia"),
                    new Paragraph({
                      spacing: { before: 80, after: 0 },
                      children: [new TextRun({ text: "Likely culprit vessel: Proximal–mid Left Anterior Descending (LAD) artery", bold: true, size: 20, font: "Calibri", color: RED })],
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
        spacer(),

        heading2("3b. CONDUCTION ABNORMALITY", ORANGE),
        spacer(0.5),
        new Table({
          width: { size: 100, type: WidthType.PERCENTAGE },
          rows: [
            new TableRow({
              children: [
                new TableCell({
                  shading: { type: ShadingType.SOLID, color: LIGHT_ORANGE },
                  children: [
                    new Paragraph({
                      children: [new TextRun({ text: "🟠  LEFT ANTERIOR FASCICULAR BLOCK (LAFB)", bold: true, size: 22, color: ORANGE, font: "Calibri" })],
                      spacing: { after: 80 },
                    }),
                    bulletPoint("QRS widened to 128 ms with marked left axis deviation"),
                    bulletPoint("Indicates block of anterior fascicle of the left bundle branch"),
                    bulletPoint("LAFB in the setting of acute anterior MI signals conduction system involvement"),
                    bulletPoint("Risk of progression to complete (3rd degree) AV block — monitor continuously"),
                  ],
                }),
              ],
            }),
          ],
        }),
        spacer(),

        heading2("3c. ADDITIONAL FINDINGS"),
        makeTable(
          ["Finding", "Clinical Significance"],
          [
            ["Sinus Rhythm (96 bpm)", "Normal rhythm; heart rate at upper limit — may reflect pain/catecholamine surge"],
            ["Right Atrial Enlargement", "Tall peaked P-waves; suggests right heart strain (pulmonary HTN, COPD, or pre-existing)"],
            ["Prolonged P-wave", "May indicate biatrial abnormality or intra-atrial conduction delay"],
            ["Borderline QTc (474 ms)", "Avoid QT-prolonging medications; monitor electrolytes (K⁺, Mg²⁺)"],
          ]
        ),
        spacer(),

        // ── Localisation ──
        heading1("4. INFARCT LOCALISATION"),
        bodyText("Based on the ECG pattern, the infarct territory and likely coronary anatomy are:"),
        spacer(0.5),
        makeTable(
          ["ECG Territory", "Leads Affected", "Likely Vessel", "Risk"],
          [
            [
              { text: "Anteroseptal", bold: true },
              "V1, V2 (V3 evolving)",
              { text: "LAD — proximal to mid", bold: true, color: RED },
              { text: "HIGH", bold: true, color: RED },
            ],
            ["Lateral (possible extension)", "aVL (T-wave change)", "LAD diagonal branch / LCx", { text: "MODERATE", bold: true, color: ORANGE }],
            ["Conduction system", "LAFB pattern", "Septal perforator of LAD", { text: "HIGH", bold: true, color: RED }],
          ]
        ),
        spacer(),

        // ── Immediate Actions ──
        heading1("5. IMMEDIATE MANAGEMENT PRIORITIES"),
        spacer(0.5),
        makeTable(
          ["Priority", "Action", "Target / Goal"],
          [
            [{ text: "1 — URGENT", bold: true, color: RED },    "Activate STEMI protocol / Cath Lab", "Door-to-balloon time < 90 minutes"],
            [{ text: "2 — URGENT", bold: true, color: RED },    "Serial 12-lead ECGs", "Every 15–30 min to track evolution"],
            [{ text: "3 — URGENT", bold: true, color: RED },    "IV access + continuous cardiac monitoring", "Defibrillator at bedside; pacing equipment available"],
            [{ text: "4 — HIGH", bold: true, color: ORANGE },   "Antiplatelet therapy", "Aspirin 325 mg load + Ticagrelor 180 mg or Clopidogrel 600 mg"],
            [{ text: "5 — HIGH", bold: true, color: ORANGE },   "Anticoagulation", "UFH 60 U/kg IV bolus or Enoxaparin 0.5 mg/kg IV"],
            [{ text: "6 — HIGH", bold: true, color: ORANGE },   "Labs: Troponin I/T (serial), CK-MB, BMP", "Establish baseline; repeat Troponin at 3h & 6h"],
            [{ text: "7 — HIGH", bold: true, color: ORANGE },   "Electrolytes", "Correct K⁺ >4.0 mEq/L and Mg²⁺ >2.0 mg/dL"],
            [{ text: "8 — ROUTINE", bold: true, color: "1E8449" }, "Echocardiography (post-stabilisation)", "Assess LVEF, wall motion abnormality, pericardial effusion"],
            [{ text: "9 — ROUTINE", bold: true, color: "1E8449" }, "Monitor AV conduction", "LAFB + anterior MI → risk of complete AV block"],
            [{ text: "10 — ROUTINE", bold: true, color: "1E8449" }, "Avoid QT-prolonging drugs", "QTc 474 ms — use caution with ondansetron, azithromycin, etc."],
          ]
        ),
        spacer(),

        // ── Differential Diagnoses ──
        heading1("6. DIFFERENTIAL DIAGNOSES TO CONSIDER"),
        bodyText("The following conditions can mimic the ST/QS pattern — clinical context and serial ECGs are essential:"),
        spacer(0.5),
        makeTable(
          ["Differential", "Distinguishing Feature"],
          [
            ["Left Ventricular Aneurysm (old MI)", "Persistent ST elevation without dynamic change; no chest pain"],
            ["LBBB with anterior pattern", "QRS >120 ms with broad notched morphology; no QS in V1 with this QRS width"],
            ["Takotsubo Cardiomyopathy", "Stress trigger; often post-menopausal women; no obstructive CAD on cath"],
            ["Pericarditis / Myocarditis", "Diffuse saddle-shaped ST elevation; PR depression; pleuritic chest pain"],
            ["Early Repolarization", "J-point notching; no reciprocal changes; benign in isolated form"],
          ]
        ),
        spacer(),

        // ── Disclaimer ──
        heading1("7. DISCLAIMER"),
        new Table({
          width: { size: 100, type: WidthType.PERCENTAGE },
          rows: [
            new TableRow({
              children: [
                new TableCell({
                  shading: { type: ShadingType.SOLID, color: LIGHT_GRAY },
                  children: [
                    new Paragraph({
                      children: [
                        new TextRun({
                          text: "This document was generated with AI-assisted ECG interpretation (Orris Clinical AI) on 22-May-2026 at 05:20 AM. It is intended as a clinical decision-support tool only and does NOT replace the independent assessment of a qualified cardiologist or emergency physician. All findings must be correlated with the patient's clinical presentation, history, and examination. The treating medical team bears full responsibility for final clinical decisions.",
                          size: 18,
                          font: "Calibri",
                          color: "555555",
                          italics: true,
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
        spacer(),

      ],
    },
  ],
});

Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync("/home/daytona/workspace/ecg-report/ECG_Clinical_Summary_Pushap_Devi.docx", buffer);
  console.log("SUCCESS: Document written.");
}).catch(err => {
  console.error("ERROR:", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/ecg-report && node generate_report.js 2>&1

Editing File

~/ecg-report/generate_report.js

Error: String not found in file: '        Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink,
        InternalHyperlink, Bookmark, FootnoteReferenceRun, PositionalTab,
        PositionalTabAlignment, PositionalTabRelativeTo, PositionalTabLeader,
        TabStopType, TabStopPosition, Column, SectionType,
        TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType,
        VerticalAlign, PageNumber, PageBreak } = require('docx');'
Editing File

~/ecg-report/generate_report.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/ecg-report/generate_report.js'
Reading File
Editing File

~/ecg-report/generate_report.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/ecg-report/generate_report.js'
Running Command

cd /home/daytona/workspace/ecg-report && node generate_report.js 2>&1

Running Command

python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/worksp…

Running Command

ls -lh /home/daytona/workspace/ecg-report/ && python3 -c "import zipfile; z=zipf…

The document is valid and ready for download.

ECG Clinical Summary Pushap Devi

Word Document · DOCX


The Word document includes:
  • Urgent alert banner — Acute Anteroseptal STEMI highlighted in red at the top
  • Patient information table — ID, age, sex, institution, date/time
  • ECG parameters table — All measured intervals with normal range comparison and colour-coded status flags
  • Diagnoses section — Primary STEMI finding (red box), LAFB (orange box), and additional findings table
  • Infarct localisation table — Territory, leads affected, likely vessel, risk level
  • 10-item immediate management priority table — Colour-coded by urgency (red/orange/green)
  • Differential diagnoses — Five conditions to consider with distinguishing features
  • Disclaimer — AI-assist advisory for the treating team
  • Header/footer with confidentiality notice and document identification
This is a shared conversation. Sign in to Orris to start your own chat.