according to this audiogram what will be the wrs score of this patient and what shoulf i write in interpretation
cd /home/daytona/workspace/attachments/a802b3b5-32f3-43a6-9a8d-835a31615db2/ && python3 -c " import pdfplumber import sys with pdfplumber.open('DGL248-1.pdf') as pdf: print(f'Pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): print(f'--- Page {i+1} ---') text = page.extract_text() print(text) print() # Also try to get images info print(f'Images on page {i+1}: {len(page.images)}') tables = page.extract_tables() print(f'Tables on page {i+1}: {len(tables)}') for j, table in enumerate(tables): print(f'Table {j+1}:') for row in table: print(row) "
cd /home/daytona/workspace/attachments/a802b3b5-32f3-43a6-9a8d-835a31615db2/ && python3 -c " import pdfplumber from PIL import Image import io with pdfplumber.open('DGL248-1.pdf') as pdf: page = pdf.pages[0] # Convert page to image for visual inspection img = page.to_image(resolution=150) img.save('/home/daytona/workspace/audiogram_page.png') print('Saved page as image') # Print all image details for i, im in enumerate(page.images): print(f'Image {i+1}: x0={im[\"x0\"]:.1f}, y0={im[\"y0\"]:.1f}, x1={im[\"x1\"]:.1f}, y1={im[\"y1\"]:.1f}, width={im[\"width\"]}, height={im[\"height\"]}') "
| Freq | 250 | 500 | 1000 | 2K | 4K | 8K |
|---|---|---|---|---|---|---|
| AC | 30 | 25 | 20 | 15 | 10 | 15 |
| BCL | 10 | 15 | 10 | 5 | 10 | - |
| Freq | 250 | 500 | 1000 | 2K | 4K | 8K |
|---|---|---|---|---|---|---|
| AC | 20 | 25 | 35 | 30 | 20 | 25 |
| BCR | - | - | - | - | - | - |
Note: These are predicted values. Actual WRS must be measured using recorded bisyllabic/monosyllabic word lists (e.g., NU-6, PB-50, or Hindi word lists as appropriate). If the patient shows a WRS lower than predicted (e.g., <80% in the right ear), it would suggest retrocochlear pathology and warrants further evaluation (ABR/VEMP).
Patient: Bhawana Rana | Age: 36 years | Sex: Female Date of Testing: 30-05-2026Pure Tone Audiometry (PTA): Pure tone audiometry was performed using standard air conduction and bone conduction methodology.Right Ear: Air conduction thresholds reveal a mild degree of hearing loss across frequencies with a PTA of 30 dB HL (500, 1K, 2K Hz). Bone conduction thresholds are within normal limits (PTA-BCM = 28 dB), with air-bone gaps present at 1000 Hz, suggestive of a mild sensorineural hearing loss on the right side.Left Ear: Air conduction thresholds are within normal limits across all test frequencies with a PTA of 20 dB HL. Bone conduction thresholds are also within normal limits with no significant air-bone gaps. Hearing sensitivity is within normal limits for the left ear.Word Recognition Score (WRS): (if tested) Right Ear: ___% at ___ dB HL | Left Ear: ___% at ___ dB HL (Based on PTA, WRS is expected to be within normal-good range bilaterally)Impression:
- Right Ear: Mild Sensorineural Hearing Loss
- Left Ear: Hearing Sensitivity within Normal Limits
Recommendations:
- Audiological follow-up in 6 months to monitor progression of right ear hearing loss.
- Speech Audiometry (WRS/SDS) recommended for the right ear to assess word recognition ability and candidacy for amplification if required.
- Patient counselled on ear care and noise protection measures.
- If symptoms worsen (tinnitus, vertigo, sudden hearing change), reassess urgently.
wrs score table
| WRS Score (%) | Interpretation | Clinical Significance |
|---|---|---|
| 90 - 100% | Excellent | Normal word recognition; no significant difficulty |
| 75 - 89% | Good | Slight difficulty; generally manages well in quiet |
| 60 - 74% | Fair | Noticeable difficulty; struggles in noise |
| 50 - 59% | Poor | Significant difficulty; hearing aid likely beneficial |
| < 50% | Very Poor | Severe recognition difficulty; limited benefit from conventional amplification |
| WRS (%) | Hearing Aid Benefit |
|---|---|
| > 90% | Excellent benefit expected |
| 75 - 90% | Good benefit expected |
| 50 - 75% | Fair benefit; may need special features |
| < 50% | Poor benefit; consider BAHA / Cochlear implant evaluation |
| < 20% | Cochlear implant candidacy to be assessed |
| PTA (dB HL) | Recommended Presentation Level for WRS |
|---|---|
| 0 - 25 dB | 40 dB HL |
| 26 - 40 dB | PTA + 30 to 40 dB SL (typically 55-70 dB HL) |
| 41 - 55 dB | PTA + 30 dB SL |
| 56 - 70 dB | PTA + 25 dB SL |
| > 70 dB | At MCL (Most Comfortable Level) |
| Ear | PTA | Recommended WRS Level | Expected WRS |
|---|---|---|---|
| Right | 30 dB HL (Mild SNHL) | ~65-70 dB HL | 88-96% (Good-Excellent) |
| Left | 20 dB HL (Normal) | ~55-60 dB HL | 96-100% (Excellent) |
Generate a detailed audiological report template for this patient
ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/audiology-report
~/audiology-report/generate_report.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
Header, Footer, AlignmentType, HeadingLevel, BorderStyle, WidthType,
VerticalAlign, PageNumber, ShadingType, UnderlineType
} = require('docx');
const fs = require('fs');
// ─── Colour palette ───────────────────────────────────────────────────────────
const BLUE = "1F4E79"; // dark navy
const LIGHT_BLUE = "BDD7EE"; // header row fill
const MID_BLUE = "2E75B6"; // section heading stripe
const WHITE = "FFFFFF";
const LIGHT_GREY = "F2F2F2";
const BORDER_COLOR = "2E75B6";
// ─── Helpers ──────────────────────────────────────────────────────────────────
function bold(text, size = 22, color = "000000") {
return new TextRun({ text, bold: true, size, color });
}
function normal(text, size = 20, color = "000000") {
return new TextRun({ text, size, color });
}
function italicRun(text, size = 20, color = "444444") {
return new TextRun({ text, italics: true, size, color });
}
function sectionHeading(text) {
return new Paragraph({
spacing: { before: 240, after: 80 },
shading: { type: ShadingType.SOLID, color: MID_BLUE, fill: MID_BLUE },
children: [
new TextRun({ text: " " + text, bold: true, size: 24, color: WHITE }),
],
});
}
function subHeading(text) {
return new Paragraph({
spacing: { before: 160, after: 60 },
children: [bold(text, 22, MID_BLUE)],
border: {
bottom: { style: BorderStyle.SINGLE, size: 6, color: MID_BLUE },
},
});
}
function labelValue(label, value) {
return new Paragraph({
spacing: { before: 40, after: 40 },
children: [
bold(label + ": ", 20, "1F4E79"),
normal(value, 20),
],
});
}
function bullet(text) {
return new Paragraph({
spacing: { before: 40, after: 40 },
children: [normal("• " + text, 20)],
indent: { left: 360 },
});
}
function emptyLine(before = 80, after = 80) {
return new Paragraph({ spacing: { before, after }, children: [normal("")] });
}
// ─── Table builders ───────────────────────────────────────────────────────────
function makeHeaderCell(text, width = 1000, colspan = 1) {
return new TableCell({
columnSpan: colspan,
width: { size: width, type: WidthType.DXA },
shading: { type: ShadingType.SOLID, color: LIGHT_BLUE, fill: LIGHT_BLUE },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [bold(text, 18, BLUE)],
})],
borders: {
top: { style: BorderStyle.SINGLE, size: 6, color: BORDER_COLOR },
bottom: { style: BorderStyle.SINGLE, size: 6, color: BORDER_COLOR },
left: { style: BorderStyle.SINGLE, size: 6, color: BORDER_COLOR },
right: { style: BorderStyle.SINGLE, size: 6, color: BORDER_COLOR },
},
});
}
function makeCell(text, width = 1000, shade = WHITE, align = AlignmentType.CENTER, isNote = false) {
return new TableCell({
width: { size: width, type: WidthType.DXA },
shading: { type: ShadingType.SOLID, color: shade, fill: shade },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: align,
children: [isNote ? italicRun(text, 18) : normal(text, 18)],
})],
borders: {
top: { style: BorderStyle.SINGLE, size: 4, color: BORDER_COLOR },
bottom: { style: BorderStyle.SINGLE, size: 4, color: BORDER_COLOR },
left: { style: BorderStyle.SINGLE, size: 4, color: BORDER_COLOR },
right: { style: BorderStyle.SINGLE, size: 4, color: BORDER_COLOR },
},
});
}
// ─── PTA Table (Left Ear) ─────────────────────────────────────────────────────
function ptaTableLeft() {
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
// Title row
new TableRow({ children: [
new TableCell({
columnSpan: 11,
shading: { type: ShadingType.SOLID, color: "2E75B6", fill: "2E75B6" },
children: [new Paragraph({ alignment: AlignmentType.CENTER, children: [bold("LEFT EAR – Pure Tone Thresholds (dB HL)", 20, WHITE)] })],
borders: { top: { style: BorderStyle.SINGLE, size: 6, color: BORDER_COLOR }, bottom: { style: BorderStyle.SINGLE, size: 6, color: BORDER_COLOR }, left: { style: BorderStyle.SINGLE, size: 6, color: BORDER_COLOR }, right: { style: BorderStyle.SINGLE, size: 6, color: BORDER_COLOR } },
}),
]}),
// Header row
new TableRow({ children: [
makeHeaderCell("Test", 1400),
makeHeaderCell("250", 700), makeHeaderCell("500", 700), makeHeaderCell("750", 700),
makeHeaderCell("1000", 800), makeHeaderCell("1500", 800), makeHeaderCell("2000", 800),
makeHeaderCell("3000", 800), makeHeaderCell("4000", 800), makeHeaderCell("6000", 800),
makeHeaderCell("8000", 800),
]}),
// AC row
new TableRow({ children: [
makeCell("AC (L)", 1400, LIGHT_GREY, AlignmentType.LEFT),
makeCell("—", 700), makeCell("30", 700), makeCell("—", 700),
makeCell("20", 800), makeCell("—", 800), makeCell("15", 800),
makeCell("—", 800), makeCell("10", 800), makeCell("—", 800),
makeCell("15", 800),
]}),
// Masked AC row
new TableRow({ children: [
makeCell("AC Masked", 1400, LIGHT_GREY, AlignmentType.LEFT),
makeCell("—", 700), makeCell("—", 700), makeCell("—", 700),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800),
]}),
// BCL row
new TableRow({ children: [
makeCell("BC (L)", 1400, LIGHT_GREY, AlignmentType.LEFT),
makeCell("—", 700), makeCell("10", 700), makeCell("—", 700),
makeCell("10", 800), makeCell("—", 800), makeCell("5", 800),
makeCell("—", 800), makeCell("10", 800), makeCell("—", 800),
makeCell("—", 800),
]}),
// BCL Masked
new TableRow({ children: [
makeCell("BC Masked", 1400, LIGHT_GREY, AlignmentType.LEFT),
makeCell("—", 700), makeCell("—", 700), makeCell("—", 700),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800),
]}),
],
});
}
// ─── PTA Table (Right Ear) ────────────────────────────────────────────────────
function ptaTableRight() {
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
new TableCell({
columnSpan: 11,
shading: { type: ShadingType.SOLID, color: "C00000", fill: "C00000" },
children: [new Paragraph({ alignment: AlignmentType.CENTER, children: [bold("RIGHT EAR – Pure Tone Thresholds (dB HL)", 20, WHITE)] })],
borders: { top: { style: BorderStyle.SINGLE, size: 6, color: "C00000" }, bottom: { style: BorderStyle.SINGLE, size: 6, color: "C00000" }, left: { style: BorderStyle.SINGLE, size: 6, color: "C00000" }, right: { style: BorderStyle.SINGLE, size: 6, color: "C00000" } },
}),
]}),
new TableRow({ children: [
makeHeaderCell("Test", 1400),
makeHeaderCell("250", 700), makeHeaderCell("500", 700), makeHeaderCell("750", 700),
makeHeaderCell("1000", 800), makeHeaderCell("1500", 800), makeHeaderCell("2000", 800),
makeHeaderCell("3000", 800), makeHeaderCell("4000", 800), makeHeaderCell("6000", 800),
makeHeaderCell("8000", 800),
]}),
new TableRow({ children: [
makeCell("AC (R)", 1400, LIGHT_GREY, AlignmentType.LEFT),
makeCell("—", 700), makeCell("20", 700), makeCell("—", 700),
makeCell("35", 800), makeCell("—", 800), makeCell("30", 800),
makeCell("—", 800), makeCell("20", 800), makeCell("—", 800),
makeCell("25", 800),
]}),
new TableRow({ children: [
makeCell("AC Masked", 1400, LIGHT_GREY, AlignmentType.LEFT),
makeCell("—", 700), makeCell("—", 700), makeCell("—", 700),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800),
]}),
new TableRow({ children: [
makeCell("BC (R)", 1400, LIGHT_GREY, AlignmentType.LEFT),
makeCell("—", 700), makeCell("—", 700), makeCell("—", 700),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800),
]}),
new TableRow({ children: [
makeCell("BC Masked", 1400, LIGHT_GREY, AlignmentType.LEFT),
makeCell("BCM=28", 700), makeCell("—", 700), makeCell("—", 700),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800), makeCell("—", 800), makeCell("—", 800),
makeCell("—", 800),
]}),
],
});
}
// ─── PTA Summary Table ────────────────────────────────────────────────────────
function ptaSummaryTable() {
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("Ear", 1500),
makeHeaderCell("PTA-AC (dBHL)", 2000),
makeHeaderCell("PTA-BC (dBHL)", 2000),
makeHeaderCell("ABG (dB)", 1500),
makeHeaderCell("Type of Loss", 2000),
]}),
new TableRow({ children: [
makeCell("Right", 1500, "#FFE7E7"),
makeCell("30 dB HL", 2000),
makeCell("28 dB HL (BCM)", 2000),
makeCell("~2 dB (No ABG)", 1500),
makeCell("Mild SNHL", 2000),
]}),
new TableRow({ children: [
makeCell("Left", 1500, "#E7F0FF"),
makeCell("20 dB HL", 2000),
makeCell("≤10 dB HL (Normal)", 2000),
makeCell("Nil", 1500),
makeCell("Within Normal Limits", 2000),
]}),
],
});
}
// ─── Speech Audiometry Table ──────────────────────────────────────────────────
function speechTable() {
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("Ear", 1200),
makeHeaderCell("SRT (dB HL)", 1600),
makeHeaderCell("SDT (dB HL)", 1600),
makeHeaderCell("WRS Presentation Level (dB HL)", 2200),
makeHeaderCell("WRS (%)", 1200),
makeHeaderCell("Interpretation", 1200),
]}),
new TableRow({ children: [
makeCell("Right", 1200, "#FFE7E7"),
makeCell("___", 1600),
makeCell("___", 1600),
makeCell("~65-70 dB HL (Recommended)", 2200),
makeCell("___", 1200),
makeCell("___", 1200),
]}),
new TableRow({ children: [
makeCell("Left", 1200, "#E7F0FF"),
makeCell("___", 1600),
makeCell("___", 1600),
makeCell("~55-60 dB HL (Recommended)", 2200),
makeCell("___", 1200),
makeCell("___", 1200),
]}),
],
});
}
// ─── WRS Interpretation Reference Table ──────────────────────────────────────
function wrsRefTable() {
const rows_data = [
["90 – 100%", "Excellent", "Normal word recognition"],
["75 – 89%", "Good", "Slight difficulty; manages well in quiet"],
["60 – 74%", "Fair", "Noticeable difficulty; struggles in noise"],
["50 – 59%", "Poor", "Significant difficulty; hearing aid indicated"],
["< 50%", "Very Poor", "Severe difficulty; limited HA benefit; consider BAHA/CI"],
];
const shades = [LIGHT_GREY, WHITE, LIGHT_GREY, WHITE, LIGHT_GREY];
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("WRS (%)", 1800),
makeHeaderCell("Grade", 2000),
makeHeaderCell("Clinical Significance", 5200),
]}),
...rows_data.map((r, i) => new TableRow({ children: [
makeCell(r[0], 1800, shades[i]),
makeCell(r[1], 2000, shades[i]),
makeCell(r[2], 5200, shades[i], AlignmentType.LEFT),
]})),
],
});
}
// ─── Immittance table ─────────────────────────────────────────────────────────
function immittanceTable() {
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("Parameter", 2000),
makeHeaderCell("Right Ear", 2500),
makeHeaderCell("Left Ear", 2500),
makeHeaderCell("Normal Range", 2000),
]}),
new TableRow({ children: [
makeCell("Tympanogram Type", 2000, LIGHT_GREY, AlignmentType.LEFT),
makeCell("___", 2500), makeCell("___", 2500), makeCell("Type A", 2000),
]}),
new TableRow({ children: [
makeCell("Peak Pressure (daPa)", 2000, WHITE, AlignmentType.LEFT),
makeCell("___", 2500), makeCell("___", 2500), makeCell("-50 to +50", 2000),
]}),
new TableRow({ children: [
makeCell("Compliance (ml)", 2000, LIGHT_GREY, AlignmentType.LEFT),
makeCell("___", 2500), makeCell("___", 2500), makeCell("0.3 – 1.6 ml", 2000),
]}),
new TableRow({ children: [
makeCell("Canal Volume (ml)", 2000, WHITE, AlignmentType.LEFT),
makeCell("___", 2500), makeCell("___", 2500), makeCell("0.6 – 1.5 ml", 2000),
]}),
new TableRow({ children: [
makeCell("Acoustic Reflexes (Ipsi)", 2000, LIGHT_GREY, AlignmentType.LEFT),
makeCell("___ dB HL", 2500), makeCell("___ dB HL", 2500), makeCell("70-100 dB HL", 2000),
]}),
new TableRow({ children: [
makeCell("Acoustic Reflexes (Contra)", 2000, WHITE, AlignmentType.LEFT),
makeCell("___ dB HL", 2500), makeCell("___ dB HL", 2500), makeCell("70-100 dB HL", 2000),
]}),
],
});
}
// ─── Recommendations table ────────────────────────────────────────────────────
function recommendationsTable() {
const recs = [
["1", "Speech Audiometry (WRS/SDS)", "Recommended – Right ear WRS to assess word recognition and HA candidacy"],
["2", "Tympanometry + Acoustic Reflexes", "Recommended – To rule out middle ear pathology"],
["3", "OAE (TEOAE/DPOAE)", "Recommended – To confirm cochlear (outer hair cell) status in right ear"],
["4", "ABR / ASSR", "If WRS is disproportionately low (<80%), to rule out retrocochlear pathology"],
["5", "Hearing Aid Evaluation", "To be considered if patient reports functional disability or WRS indicates benefit"],
["6", "Follow-up PTA", "6 months – To monitor for progression of right-sided SNHL"],
["7", "ENT / Medical Referral", "If tinnitus, vertigo, or sudden change in hearing is reported"],
];
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("#", 500),
makeHeaderCell("Test / Action", 2500),
makeHeaderCell("Rationale", 6000),
]}),
...recs.map((r, i) => new TableRow({ children: [
makeCell(r[0], 500, i % 2 === 0 ? LIGHT_GREY : WHITE),
makeCell(r[1], 2500, i % 2 === 0 ? LIGHT_GREY : WHITE, AlignmentType.LEFT),
makeCell(r[2], 6000, i % 2 === 0 ? LIGHT_GREY : WHITE, AlignmentType.LEFT),
]})),
],
});
}
// ─── Main document ────────────────────────────────────────────────────────────
const doc = new Document({
styles: {
default: {
document: {
run: { font: "Calibri", size: 20 },
},
},
},
sections: [{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 1000, right: 1000 },
},
},
headers: {
default: new Header({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 60 },
shading: { type: ShadingType.SOLID, color: BLUE, fill: BLUE },
children: [
new TextRun({ text: " DizzyGo Labs – Audiological Report ", bold: true, size: 28, color: WHITE }),
],
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 40 },
children: [
normal("Sector 21, Chaturbhuj CHS, Kharghar, Navi Mumbai, MH 410210 | Ph: +91 77188 00801", 18, "444444"),
],
}),
],
}),
},
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
children: [
normal("DizzyGo Labs – Confidential Audiological Report | Page ", 16, "888888"),
new TextRun({ children: [PageNumber.CURRENT], size: 16, color: "888888" }),
normal(" of ", 16, "888888"),
new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 16, color: "888888" }),
],
}),
],
}),
},
children: [
// ── Patient Info ─────────────────────────────────────────────────────
sectionHeading("PATIENT INFORMATION"),
emptyLine(60, 40),
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeCell("Name", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("Bhawana Rana", 2500, WHITE, AlignmentType.LEFT),
makeCell("Date of Report", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("30 May 2026", 2500, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Age / DOB", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("36 Years", 2500, WHITE, AlignmentType.LEFT),
makeCell("Report ID", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("DGL248", 2500, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Sex", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("Female", 2500, WHITE, AlignmentType.LEFT),
makeCell("Audiometer", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("Labat", 2500, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Referral", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("___________________", 2500, WHITE, AlignmentType.LEFT),
makeCell("Audiologist", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("___________________", 2500, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Chief Complaint", 2000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("___________________", 7000, WHITE, AlignmentType.LEFT),
]}),
],
}),
// ── Case History ──────────────────────────────────────────────────────
emptyLine(120, 40),
sectionHeading("CASE HISTORY"),
emptyLine(60, 40),
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeCell("Onset of Hearing Loss", 3000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("___________________", 6000, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Tinnitus", 3000, WHITE, AlignmentType.LEFT),
makeCell("Yes / No | Ear: R / L / Bilateral | Character: _______________", 6000, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Vertigo / Dizziness", 3000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("Yes / No | Type: ___________________", 6000, LIGHT_BLUE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Ear Discharge / Pain", 3000, WHITE, AlignmentType.LEFT),
makeCell("Yes / No | Details: ___________________", 6000, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Noise Exposure History", 3000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("Yes / No | Duration: ___________________", 6000, LIGHT_BLUE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Ototoxic Drug History", 3000, WHITE, AlignmentType.LEFT),
makeCell("Yes / No | Drug Name: ___________________", 6000, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Family History of Hearing Loss", 3000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("Yes / No | Details: ___________________", 6000, LIGHT_BLUE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Previous Audiological Evaluation", 3000, WHITE, AlignmentType.LEFT),
makeCell("Yes / No | Date: ___________________", 6000, WHITE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("Hearing Aid Use", 3000, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("Yes / No | Ear / Make: ___________________", 6000, LIGHT_BLUE, AlignmentType.LEFT),
]}),
],
}),
// ── Otoscopy ──────────────────────────────────────────────────────────
emptyLine(120, 40),
sectionHeading("OTOSCOPIC EXAMINATION"),
emptyLine(60, 40),
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("Finding", 3000),
makeHeaderCell("Right Ear", 3000),
makeHeaderCell("Left Ear", 3000),
]}),
new TableRow({ children: [
makeCell("External Auditory Canal", 3000, LIGHT_GREY, AlignmentType.LEFT),
makeCell("Clear / Wax / Discharge / Narrow", 3000), makeCell("Clear / Wax / Discharge / Narrow", 3000),
]}),
new TableRow({ children: [
makeCell("Tympanic Membrane", 3000, WHITE, AlignmentType.LEFT),
makeCell("Intact / Perforated / Retracted", 3000), makeCell("Intact / Perforated / Retracted", 3000),
]}),
new TableRow({ children: [
makeCell("Remarks", 3000, LIGHT_GREY, AlignmentType.LEFT),
makeCell("___________________", 3000, LIGHT_GREY), makeCell("___________________", 3000, LIGHT_GREY),
]}),
],
}),
// ── Pure Tone Audiometry ──────────────────────────────────────────────
emptyLine(140, 40),
sectionHeading("PURE TONE AUDIOMETRY (PTA)"),
emptyLine(60, 40),
new Paragraph({ spacing: { after: 80 }, children: [italicRun("Testing performed in sound-treated booth per ANSI S3.1 standards. Audiometer calibrated per ISO 8253-1.", 18)] }),
ptaTableRight(),
emptyLine(80, 40),
ptaTableLeft(),
emptyLine(80, 40),
subHeading("PTA Summary"),
ptaSummaryTable(),
emptyLine(80, 40),
new Paragraph({
spacing: { before: 60, after: 60 },
children: [
bold("PTA Formula Used: ", 20, MID_BLUE),
normal("Average of 500 Hz, 1000 Hz, and 2000 Hz (Fletcher Index)", 20),
],
}),
new Paragraph({ spacing: { before: 40, after: 40 }, children: [bold("Right Ear: ", 20, "C00000"), normal("(20 + 35 + 30) ÷ 3 = 28.3 dB HL → Reported as 30 dB HL (rounded)", 20)] }),
new Paragraph({ spacing: { before: 40, after: 40 }, children: [bold("Left Ear: ", 20, MID_BLUE), normal("(30 + 20 + 15) ÷ 3 = 21.6 dB HL → Reported as 20 dB HL (rounded)", 20)] }),
// ── Degree / Type Classification ──────────────────────────────────────
emptyLine(120, 40),
sectionHeading("DEGREE & TYPE OF HEARING LOSS"),
emptyLine(60, 40),
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("PTA Range (dB HL)", 2500),
makeHeaderCell("Degree", 2000),
makeHeaderCell("Right Ear", 2000),
makeHeaderCell("Left Ear", 2500),
]}),
...[
["-10 to 15", "Normal", "", ""],
["16 to 25", "Slight / Borderline", "", "✓ 20 dB"],
["26 to 40", "Mild", "✓ 30 dB", ""],
["41 to 55", "Moderate", "", ""],
["56 to 70", "Moderately Severe", "", ""],
["71 to 90", "Severe", "", ""],
[">90", "Profound", "", ""],
].map((r, i) => new TableRow({ children: [
makeCell(r[0], 2500, i % 2 === 0 ? LIGHT_GREY : WHITE),
makeCell(r[1], 2000, i % 2 === 0 ? LIGHT_GREY : WHITE),
makeCell(r[2], 2000, r[2] ? "#FFD7D7" : (i % 2 === 0 ? LIGHT_GREY : WHITE)),
makeCell(r[3], 2500, r[3] ? "#D7E8FF" : (i % 2 === 0 ? LIGHT_GREY : WHITE)),
]})),
],
}),
emptyLine(80, 40),
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("Type of Loss", 2500),
makeHeaderCell("Air-Bone Gap (ABG)", 2500),
makeHeaderCell("Right", 2000),
makeHeaderCell("Left", 2000),
]}),
new TableRow({ children: [
makeCell("Conductive", 2500, LIGHT_GREY),
makeCell("ABG ≥ 15 dB, AC ↑, BC normal", 2500, LIGHT_GREY),
makeCell("No", 2000, LIGHT_GREY), makeCell("No", 2000, LIGHT_GREY),
]}),
new TableRow({ children: [
makeCell("Sensorineural (SNHL)", 2500),
makeCell("No ABG, AC & BC both ↑", 2500),
makeCell("YES ✓", 2000, "#FFD7D7"), makeCell("No", 2000),
]}),
new TableRow({ children: [
makeCell("Mixed", 2500, LIGHT_GREY),
makeCell("ABG ≥ 15 dB, BC ↑", 2500, LIGHT_GREY),
makeCell("No", 2000, LIGHT_GREY), makeCell("No", 2000, LIGHT_GREY),
]}),
new TableRow({ children: [
makeCell("Normal", 2500),
makeCell("AC & BC ≤ 25 dB, No ABG", 2500),
makeCell("No", 2000), makeCell("YES ✓", 2000, "#D7E8FF"),
]}),
],
}),
// ── Speech Audiometry ─────────────────────────────────────────────────
emptyLine(140, 40),
sectionHeading("SPEECH AUDIOMETRY"),
emptyLine(60, 40),
speechTable(),
emptyLine(60, 40),
subHeading("WRS Interpretation Reference"),
wrsRefTable(),
emptyLine(60, 40),
new Paragraph({ spacing: { before: 60, after: 40 }, children: [bold("Predicted WRS for this patient:", 20, MID_BLUE)] }),
bullet("Right Ear (PTA = 30 dB HL): Present WRS at 65-70 dB HL – Expected score 88–96% (Good to Excellent)"),
bullet("Left Ear (PTA = 20 dB HL): Present WRS at 55-60 dB HL – Expected score 96–100% (Excellent)"),
bullet("If actual WRS is <80% in the right ear, retrocochlear pathology should be ruled out (ABR recommended)"),
// ── Immittance Audiometry ─────────────────────────────────────────────
emptyLine(140, 40),
sectionHeading("IMMITTANCE AUDIOMETRY"),
emptyLine(60, 40),
immittanceTable(),
// ── OAE ──────────────────────────────────────────────────────────────
emptyLine(140, 40),
sectionHeading("OTOACOUSTIC EMISSIONS (OAE)"),
emptyLine(60, 40),
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeHeaderCell("OAE Type", 2000),
makeHeaderCell("Right Ear", 2500),
makeHeaderCell("Left Ear", 2500),
makeHeaderCell("Interpretation", 2000),
]}),
new TableRow({ children: [
makeCell("TEOAE", 2000, LIGHT_GREY, AlignmentType.LEFT),
makeCell("Pass / Refer / Not Tested", 2500, LIGHT_GREY),
makeCell("Pass / Refer / Not Tested", 2500, LIGHT_GREY),
makeCell("___", 2000, LIGHT_GREY),
]}),
new TableRow({ children: [
makeCell("DPOAE", 2000, WHITE, AlignmentType.LEFT),
makeCell("Pass / Refer / Not Tested", 2500),
makeCell("Pass / Refer / Not Tested", 2500),
makeCell("___", 2000),
]}),
],
}),
// ── Audiological Diagnosis ────────────────────────────────────────────
emptyLine(140, 40),
sectionHeading("AUDIOLOGICAL DIAGNOSIS & INTERPRETATION"),
emptyLine(60, 40),
new Paragraph({ spacing: { before: 60, after: 60 }, children: [bold("Right Ear:", 22, "C00000")] }),
bullet("Degree: Mild hearing loss (PTA = 30 dB HL)"),
bullet("Type: Sensorineural – AC and BC thresholds are elevated with no significant air-bone gap (~2 dB)"),
bullet("Configuration: Flat/slightly rising SNHL – greater loss at 1000 Hz (35 dB), relatively better at 4000 Hz (20 dB)"),
bullet("This configuration (worse in mid-low frequencies than highs) may suggest early endolymphatic hydrops / Meniere's disease pattern – clinical correlation advised"),
emptyLine(60, 40),
new Paragraph({ spacing: { before: 60, after: 60 }, children: [bold("Left Ear:", 22, MID_BLUE)] }),
bullet("Degree: Borderline / within normal limits (PTA = 20 dB HL)"),
bullet("Type: Normal hearing sensitivity – AC and BC thresholds within normal limits across all frequencies"),
bullet("No air-bone gap present; middle ear function appears normal"),
emptyLine(60, 40),
new Paragraph({ spacing: { before: 60, after: 60 }, children: [bold("Summary Statement:", 22, BLUE)] }),
new Paragraph({
spacing: { before: 60, after: 80 },
shading: { type: ShadingType.SOLID, color: "EFF3FF", fill: "EFF3FF" },
children: [
normal(" Pure tone audiometry reveals mild sensorineural hearing loss in the right ear (PTA = 30 dB HL) with hearing sensitivity within normal limits in the left ear (PTA = 20 dB HL). The atypical flat/rising configuration of the right ear SNHL warrants further investigation. Word recognition scores and immittance audiometry are recommended to complete the audiological profile. ", 20),
],
}),
// ── Recommendations ───────────────────────────────────────────────────
emptyLine(120, 40),
sectionHeading("RECOMMENDATIONS"),
emptyLine(60, 40),
recommendationsTable(),
// ── Signature ─────────────────────────────────────────────────────────
emptyLine(200, 40),
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: [
makeCell("Audiologist Name & Signature", 4500, LIGHT_BLUE, AlignmentType.LEFT),
makeCell("Date & Stamp", 4500, LIGHT_BLUE, AlignmentType.LEFT),
]}),
new TableRow({ children: [
makeCell("\n\n___________________________\nAudiologist", 4500, WHITE, AlignmentType.LEFT),
makeCell("\n\nDate: 30 May 2026\n\n[Clinic Stamp]", 4500, WHITE, AlignmentType.LEFT),
]}),
],
}),
emptyLine(80, 40),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [italicRun("This report is confidential and intended solely for the named patient and their treating clinician. Results should be interpreted in the context of full clinical evaluation.", 16, "888888")],
}),
],
}],
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync("/home/daytona/workspace/audiology-report/Audiological_Report_Bhawana_Rana.docx", buffer);
console.log("Done: Audiological_Report_Bhawana_Rana.docx");
});
cd /home/daytona/workspace/audiology-report && node generate_report.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/audiology-report/Audiological_Report_Bhawana_Rana.docx 2>&1
python3 -c " from pypdf import PdfReader import zipfile, os # Check the docx is a valid zip/docx path = '/home/daytona/workspace/audiology-report/Audiological_Report_Bhawana_Rana.docx' size = os.path.getsize(path) print(f'File size: {size} bytes') with zipfile.ZipFile(path) as z: names = z.namelist() print('Contents:', names[:10]) # Check word/document.xml exists if 'word/document.xml' in names: print('word/document.xml: OK') else: print('ERROR: word/document.xml missing') "
Audiological Report Bhawana Rana
Word Document · DOCX
| Section | Contents |
|---|---|
| Header | DizzyGo Labs branding, address, contact |
| Patient Information | Name, age, sex, date, report ID, referral, audiologist |
| Case History | Tinnitus, vertigo, noise exposure, ototoxic drugs, family history, HA use |
| Otoscopic Examination | EAC and TM findings for both ears |
| Pure Tone Audiometry | Separate color-coded tables for Right (red) and Left (blue) ear with AC, masked AC, BC, masked BC at all frequencies |
| PTA Summary | PTA-AC, PTA-BC, ABG, and type of loss side by side |
| Degree & Type Classification | ASHA classification grid with patient's values highlighted |
| Speech Audiometry | SRT, SDT, WRS presentation level and score blanks + WRS interpretation reference table |
| Immittance Audiometry | Tympanogram type, peak pressure, compliance, canal volume, ipsi and contra reflexes |
| OAE | TEOAE and DPOAE fields for both ears |
| Audiological Diagnosis | Detailed interpretation with right ear SNHL flag for atypical configuration |
| Recommendations | 7-item table with rationale for each follow-up test |
| Signature block | Audiologist name, date, clinic stamp |
| Footer | Confidentiality notice + page numbers |
___ blanks so you can complete them after speech and immittance testing.