Prepare notes for general examination add relevant flow chart and example
/home/daytona/workspace
mkdir -p /home/daytona/workspace/general-exam-notes && ls /home/daytona/workspace/general-exam-notes
~/general-exam-notes/generate_notes.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
PageNumber, Header, Footer, PageBreak, TabStopType, TabStopPosition
} = require('docx');
const fs = require('fs');
// ─── Helpers ────────────────────────────────────────────────────────────────
function h1(text) {
return new Paragraph({
text,
heading: HeadingLevel.HEADING_1,
spacing: { before: 360, after: 120 },
thematicBreak: false,
});
}
function h2(text) {
return new Paragraph({
text,
heading: HeadingLevel.HEADING_2,
spacing: { before: 240, after: 80 },
});
}
function h3(text) {
return new Paragraph({
text,
heading: HeadingLevel.HEADING_3,
spacing: { before: 160, after: 60 },
});
}
function para(text, opts = {}) {
return new Paragraph({
children: [new TextRun({ text, size: 22, ...opts })],
spacing: { before: 80, after: 80 },
});
}
function bullet(text, level = 0) {
return new Paragraph({
children: [new TextRun({ text, size: 22 })],
bullet: { level },
spacing: { before: 40, after: 40 },
});
}
function boldBullet(label, detail, level = 0) {
return new Paragraph({
children: [
new TextRun({ text: label + ': ', bold: true, size: 22 }),
new TextRun({ text: detail, size: 22 }),
],
bullet: { level },
spacing: { before: 40, after: 40 },
});
}
function divider() {
return new Paragraph({
children: [],
border: { bottom: { color: '4472C4', size: 6, style: BorderStyle.SINGLE } },
spacing: { before: 120, after: 120 },
});
}
function blankLine() {
return new Paragraph({ children: [new TextRun({ text: '' })] });
}
function centeredBold(text, size = 28, color = '1F3864') {
return new Paragraph({
children: [new TextRun({ text, bold: true, size, color })],
alignment: AlignmentType.CENTER,
spacing: { before: 100, after: 100 },
});
}
function noteBox(text) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
children: [
new TableCell({
shading: { fill: 'FFF2CC', type: ShadingType.CLEAR },
children: [
new Paragraph({
children: [
new TextRun({ text: 'NOTE: ', bold: true, color: '7F6000', size: 20 }),
new TextRun({ text, size: 20, color: '7F6000' }),
],
spacing: { before: 60, after: 60 },
})
],
margins: { top: 80, bottom: 80, left: 120, right: 120 },
})
]
})
],
margins: { top: 100, bottom: 100 },
});
}
function exampleBox(label, rows) {
const tableRows = [
new TableRow({
children: [
new TableCell({
columnSpan: 2,
shading: { fill: '1F3864', type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text: label, bold: true, color: 'FFFFFF', size: 22 })],
alignment: AlignmentType.CENTER,
})],
margins: { top: 80, bottom: 80, left: 120, right: 120 },
})
]
}),
...rows.map(([k, v]) => new TableRow({
children: [
new TableCell({
width: { size: 35, type: WidthType.PERCENTAGE },
shading: { fill: 'D9E1F2', type: ShadingType.CLEAR },
children: [new Paragraph({ children: [new TextRun({ text: k, bold: true, size: 20 })] })],
margins: { top: 60, bottom: 60, left: 100, right: 80 },
}),
new TableCell({
width: { size: 65, type: WidthType.PERCENTAGE },
children: [new Paragraph({ children: [new TextRun({ text: v, size: 20 })] })],
margins: { top: 60, bottom: 60, left: 100, right: 80 },
}),
]
}))
];
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: tableRows,
});
}
// ─── Flowchart: ASCII-style table flow ──────────────────────────────────────
function flowBox(text, fill = '4472C4', textColor = 'FFFFFF') {
return new Table({
width: { size: 80, type: WidthType.PERCENTAGE },
float: { horizontalAnchor: 'margin', verticalAnchor: 'text', absoluteVerticalPosition: 0 },
rows: [new TableRow({
children: [new TableCell({
shading: { fill, type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text, bold: true, color: textColor, size: 20 })],
alignment: AlignmentType.CENTER,
})],
margins: { top: 80, bottom: 80, left: 120, right: 120 },
})]
})]
});
}
function arrowPara() {
return new Paragraph({
children: [new TextRun({ text: ' ▼', size: 24, bold: true, color: '1F3864' })],
spacing: { before: 40, after: 40 },
});
}
// ─── FLOWCHART as a proper embedded table ───────────────────────────────────
function makeFlowchartTable(steps) {
const fills = ['1F3864','2E75B6','2E75B6','2E75B6','2E75B6','2E75B6','2E75B6','2E75B6'];
const rows = [];
steps.forEach((step, i) => {
rows.push(new TableRow({
children: [new TableCell({
shading: { fill: fills[i] || '2E75B6', type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text: step, bold: true, color: 'FFFFFF', size: 20 })],
alignment: AlignmentType.CENTER,
})],
margins: { top: 100, bottom: 100, left: 200, right: 200 },
borders: {
top: { style: BorderStyle.SINGLE, size: 4, color: 'FFFFFF' },
bottom: { style: BorderStyle.SINGLE, size: 4, color: 'FFFFFF' },
left: { style: BorderStyle.SINGLE, size: 4, color: 'FFFFFF' },
right: { style: BorderStyle.SINGLE, size: 4, color: 'FFFFFF' },
},
})]
}));
if (i < steps.length - 1) {
rows.push(new TableRow({
children: [new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: '▼', size: 22, bold: true, color: '1F3864' })],
alignment: AlignmentType.CENTER,
})],
borders: {
top: { style: BorderStyle.NONE },
bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE },
right: { style: BorderStyle.NONE },
},
margins: { top: 40, bottom: 40 },
})]
}));
}
});
return new Table({
width: { size: 70, type: WidthType.PERCENTAGE },
rows,
});
}
function makeTwoColFlowchart(leftSteps, rightSteps, title) {
const fills = ['2E75B6','2472C4','1F3864','2472C4'];
const maxLen = Math.max(leftSteps.length, rightSteps.length);
const rows = [
new TableRow({
children: [
new TableCell({
columnSpan: 2,
shading: { fill: '1F3864', type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text: title, bold: true, color: 'FFFFFF', size: 22 })],
alignment: AlignmentType.CENTER,
})],
margins: { top: 100, bottom: 100, left: 200, right: 200 },
})
]
})
];
for (let i = 0; i < maxLen; i++) {
const l = leftSteps[i] || '';
const r = rightSteps[i] || '';
rows.push(new TableRow({
children: [
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
shading: { fill: l ? (fills[i % fills.length]) : 'FFFFFF', type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text: l, bold: !!l, color: l ? 'FFFFFF' : 'FFFFFF', size: 20 })],
alignment: AlignmentType.CENTER,
})],
margins: { top: 80, bottom: 80, left: 120, right: 60 },
borders: { top: { style: BorderStyle.SINGLE, size: 4, color: 'FFFFFF' }, bottom: { style: BorderStyle.SINGLE, size: 4, color: 'FFFFFF' }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
}),
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
shading: { fill: r ? (fills[(i + 2) % fills.length]) : 'FFFFFF', type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text: r, bold: !!r, color: r ? 'FFFFFF' : 'FFFFFF', size: 20 })],
alignment: AlignmentType.CENTER,
})],
margins: { top: 80, bottom: 80, left: 60, right: 120 },
borders: { top: { style: BorderStyle.SINGLE, size: 4, color: 'FFFFFF' }, bottom: { style: BorderStyle.SINGLE, size: 4, color: 'FFFFFF' }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
}),
]
}));
}
return new Table({ width: { size: 100, type: WidthType.PERCENTAGE }, rows });
}
function makeSignsTable(headers, dataRows) {
const headerRow = new TableRow({
children: headers.map(h => new TableCell({
shading: { fill: '1F3864', type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text: h, bold: true, color: 'FFFFFF', size: 20 })],
alignment: AlignmentType.CENTER,
})],
margins: { top: 80, bottom: 80, left: 100, right: 100 },
}))
});
const bodyRows = dataRows.map((row, ri) => new TableRow({
children: row.map(cell => new TableCell({
shading: { fill: ri % 2 === 0 ? 'DEEAF1' : 'FFFFFF', type: ShadingType.CLEAR },
children: [new Paragraph({ children: [new TextRun({ text: cell, size: 20 })] })],
margins: { top: 60, bottom: 60, left: 100, right: 100 },
}))
}));
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [headerRow, ...bodyRows],
});
}
// ═══════════════════════════════════════════════════════════════════════════
// DOCUMENT CONTENT
// ═══════════════════════════════════════════════════════════════════════════
const children = [
// ── TITLE PAGE ──────────────────────────────────────────────────────────
new Paragraph({ children: [new TextRun({ text: '' })], spacing: { before: 600, after: 200 } }),
centeredBold('GENERAL CLINICAL EXAMINATION', 48, '1F3864'),
centeredBold('Comprehensive Notes for Medical Students & Clinicians', 24, '2E75B6'),
new Paragraph({ children: [new TextRun({ text: '' })], spacing: { before: 200, after: 200 } }),
centeredBold('Sources: S. Das Manual on Clinical Surgery • Bailey & Love • Harrison\'s Principles • Park\'s Preventive Medicine', 18, '595959'),
new Paragraph({ children: [new PageBreak()] }),
// ── SECTION 1: OVERVIEW ─────────────────────────────────────────────────
h1('1. Overview of General Examination'),
para('The general examination is the systematic assessment of a patient\'s overall health status before proceeding to regional or system-specific examination. It provides a \'first impression\' that guides the entire clinical encounter and reveals systemic disease clues that might not emerge from a focused examination alone.'),
blankLine(),
noteBox('The general examination is not merely an introduction — many diagnoses (e.g., jaundice in hepatitis, cushingoid facies, Marfan syndrome) can be established from this first look alone. Never rush through it.'),
blankLine(),
// Flowchart 1 - overall approach
h2('1.1 Flowchart: Overall Approach to Clinical Examination'),
blankLine(),
makeFlowchartTable([
'1. PATIENT INTRODUCTION & CONSENT',
'2. GENERAL EXAMINATION (Systemic Survey)',
'3. VITAL SIGNS ASSESSMENT',
'4. REGIONAL / SYSTEM-SPECIFIC EXAMINATION',
'5. SPECIAL TESTS & INVESTIGATIONS',
'6. SYNTHESIS & DIFFERENTIAL DIAGNOSIS',
'7. MANAGEMENT PLAN'
]),
blankLine(),
// ── SECTION 2: COMPONENTS ───────────────────────────────────────────────
h1('2. Components of General Examination'),
para('A thorough general examination covers the following domains, assessed in a logical head-to-toe sequence:'),
h2('2.1 General Appearance'),
boldBullet('Age vs. appearance', 'Does the patient look older or younger than stated age? Chronic illness ages appearance.'),
boldBullet('Built & Nutrition', 'Obese, normal, thin, or cachectic (e.g., cachexia suggests malignancy, chronic infection, or heart failure).'),
boldBullet('Posture & Attitude', 'Patients with peritonitis lie still; colicky pain makes patients restless. Meningitis causes neck retraction. A patient lying with an everted leg after a fall suggests fractured neck of femur.'),
boldBullet('Decubitus', 'In cerebral irritation the patient lies curled on one side, away from light.'),
boldBullet('Comfort level', 'Is the patient in obvious distress, comfortable at rest, or agitated?'),
blankLine(),
h2('2.2 Level of Consciousness (GCS / LOC)'),
para('Assess mental state at the outset. Five levels (S. Das):'),
bullet('Fully conscious, fully oriented (time, place, person)'),
bullet('Fully conscious, disoriented to time and place'),
bullet('Semi-conscious (drowsy) - can be awakened'),
bullet('Unconscious (stupor) - responds to painful stimuli only'),
bullet('Unconscious (coma) - no response to any stimuli'),
blankLine(),
noteBox('Always assess GCS formally in head injury, stroke, or sepsis. Mental state must be documented before any sedation or anaesthesia.'),
blankLine(),
h2('2.3 Gait'),
para('Observe the patient walking if possible. Abnormal gait may indicate:'),
boldBullet('Waddling gait', 'Bilateral CDH, bilateral coxa vara'),
boldBullet('Trendelenburg gait', 'Muscle dystrophies, polio, unilateral coxa vara, Perthes\' disease, hip arthritis'),
boldBullet('Antalgic gait', 'Pain avoidance - shortened stance phase on affected side'),
boldBullet('Parkinsonian gait', 'Shuffling steps, festination, reduced arm swing'),
boldBullet('Hemiplegic gait', 'Circumduction of the affected leg'),
blankLine(),
h2('2.4 Facies'),
para('The face provides powerful diagnostic clues ("mirror of the mind"). Key facies:'),
blankLine(),
makeSignsTable(
['Facies', 'Description', 'Condition'],
[
['Hippocratic facies', 'Sunken eyes, hollow cheeks, pinched nose, cold grey skin', 'Generalised peritonitis / terminal illness'],
['Risus Sardonicus', 'Fixed sardonic smile, raised eyebrows', 'Tetanus'],
['Mask face', 'Expressionless, infrequent blinking, fixed stare', 'Parkinsonism'],
['Moon face', 'Round, plethoric, hirsute', 'Cushing\'s syndrome'],
['Adenoid facies', 'Open mouth, vacant expression', 'Hypertrophied adenoids'],
['Myxoedema facies', 'Puffiness, periorbital oedema, loss of outer eyebrow', 'Hypothyroidism'],
['Acromegalic facies', 'Prominent jaw, large nose and lips, frontal bossing', 'Acromegaly'],
['Mitral facies (malar flush)', 'Bilateral purplish-red cheeks', 'Advanced mitral stenosis'],
]
),
blankLine(),
h2('2.5 Skin Colour & Findings'),
h3('Pallor'),
para('Look at: lower palpebral conjunctiva, mucous membranes of lips/cheeks, nail beds, palmar creases.'),
para('Causes: massive haemorrhage, shock, intense emotion, anaemia.'),
blankLine(),
h3('Cyanosis'),
makeTwoColFlowchart(
['CENTRAL CYANOSIS', 'Site: tongue + lips + nail beds', 'Causes: lung disease, R-to-L cardiac shunt, low FiO2', 'O2 DOES NOT improve peripheral cyanosis'],
['PERIPHERAL CYANOSIS', 'Site: nail beds, fingertips, toes, tip of nose', 'Causes: cold, reduced cardiac output, vasoconstriction', 'O2 improves central cyanosis'],
'CYANOSIS: Central vs Peripheral'
),
blankLine(),
para('Minimum 5 g/dL of reduced Hb required for cyanosis to be visible. Cyanosis is absent in severe anaemia even with hypoxia (S. Das).'),
noteBox('Carbon monoxide poisoning produces cherry-red discolouration, NOT cyanosis. Methaemoglobinaemia/sulphaemoglobinaemia cause cyanosis with normal arterial O2 tension.'),
blankLine(),
h3('Jaundice'),
para('Look at: sclera (earliest and most reliable), nail beds, earlobe lobule, tip of nose, undersurface of tongue.'),
blankLine(),
makeSignsTable(
['Type', 'Colour', 'Urine', 'Stool', 'Examples'],
[
['Pre-hepatic (haemolytic)', 'Lemon yellow', 'Normal/dark', 'Normal/dark', 'Haemolytic anaemia, sickle cell'],
['Hepatic (hepatocellular)', 'Yellow-orange', 'Dark (bilirubin)', 'Pale/normal', 'Viral hepatitis, cirrhosis'],
['Post-hepatic (obstructive)', 'Dark olive-green', 'Very dark', 'Pale/clay', 'Gallstones, carcinoma head of pancreas'],
]
),
blankLine(),
noteBox('Hypercarotinaemia (yellow from excess carrot/vegetable intake) spares the sclera - helps distinguish from true jaundice.'),
blankLine(),
h3('Other Skin Findings'),
boldBullet('Grey Turner\'s sign', 'Flank discolouration - retroperitoneal haemorrhage (pancreatitis, leaking AAA)'),
boldBullet('Cullen\'s sign', 'Periumbilical discolouration - severe acute pancreatitis, ruptured ectopic pregnancy'),
boldBullet('Spider naevi', 'Central arteriole with radiating vessels - chronic liver disease (>5 = significant)'),
boldBullet('Scratch marks', 'Pruritus from bile salt retention in obstructive jaundice'),
boldBullet('Telangiectasia', 'Osler-Weber-Rendu syndrome, mitral stenosis, scleroderma'),
blankLine(),
// ── SECTION 3: VITAL SIGNS ──────────────────────────────────────────────
h1('3. Vital Signs'),
h2('3.1 Flowchart: Vital Signs Assessment'),
blankLine(),
makeFlowchartTable([
'1. PULSE - Rate, Rhythm, Volume, Character, Vessel wall',
'2. BLOOD PRESSURE - Both arms; postural changes if indicated',
'3. RESPIRATORY RATE - Count for 1 full minute; note pattern',
'4. TEMPERATURE - Oral / Axillary / Rectal / Tympanic',
'5. OXYGEN SATURATION (SpO2) - Pulse oximetry',
'6. WEIGHT & BMI - Elective settings; note recent changes',
]),
blankLine(),
h2('3.2 Pulse'),
makeSignsTable(
['Parameter', 'Normal', 'Clinical Significance'],
[
['Rate', '60-100 bpm (adult)', 'Tachycardia: fever, pain, haemorrhage, thyrotoxicosis; Bradycardia: heart block, hypothyroidism, athletes'],
['Rhythm', 'Regular', 'Irregularly irregular = AF; Regularly irregular = 2nd degree block'],
['Volume', 'Normal', 'Large: aortic regurgitation, thyrotoxicosis, CO2 retention; Small: hypovolaemia, AS, LVF'],
['Character', 'Normal upstroke', 'Collapsing (water-hammer): AR; Slow-rising: AS; Pulsus paradoxus: cardiac tamponade'],
['Vessel wall', 'Soft, compressible', 'Hardened (pipestem artery): atherosclerosis'],
]
),
blankLine(),
noteBox('In internal haemorrhage, pulse becomes immediately rapid. In peritonitis, pulse quickens as it spreads. Rising pulse rate with falling volume is a sign of worsening shock (S. Das, Bailey & Love).'),
blankLine(),
h2('3.3 Blood Pressure'),
boldBullet('Normal adult', '< 120/80 mmHg (optimal); < 130/85 mmHg (normal)'),
boldBullet('Hypertension', '>= 140/90 mmHg on two separate occasions'),
boldBullet('Hypotension', 'Systolic < 90 mmHg or > 20 mmHg drop from baseline'),
boldBullet('Postural hypotension', 'Drop >= 20 mmHg systolic on standing - autonomic neuropathy, hypovolaemia, drugs'),
boldBullet('BP difference >15 mmHg between arms', 'Suspect aortic dissection, subclavian artery stenosis'),
blankLine(),
h2('3.4 Temperature'),
boldBullet('Normal', '36.5 - 37.5 degrees C (oral); add 0.5 degrees C for rectal'),
boldBullet('Pyrexia', '>38 degrees C - infection, inflammation, malignancy'),
boldBullet('Hyperpyrexia', '>41 degrees C - heat stroke, malignant hyperthermia, drug fever'),
boldBullet('Hypothermia', '<35 degrees C - exposure, hypothyroidism, hypoadrenalism, sepsis'),
para('Pattern of fever: remittent (typhoid), intermittent (malaria), hectic/swinging (abscess), continuous (lobar pneumonia), relapsing (lymphoma - Pel-Ebstein pattern).'),
blankLine(),
noteBox('Murphy\'s rule in acute appendicitis: pain first, then vomiting, then fever LAST. Fever is never an early sign (S. Das).'),
blankLine(),
h2('3.5 Respiratory Rate'),
boldBullet('Normal adult', '12-20 breaths/min'),
boldBullet('Tachypnoea', '>20/min - fever, pneumonia, PE, metabolic acidosis, pain'),
boldBullet('Bradypnoea', '<12/min - opioids, raised ICP, hypothyroidism'),
para('Note: increased rate with flaring alae nasi directs attention to the thorax as the primary site of disease (S. Das).'),
blankLine(),
// ── SECTION 4: HANDS & NAILS ────────────────────────────────────────────
h1('4. Examination of Hands & Nails'),
para('Hands provide a wealth of diagnostic information and are examined as part of the general survey.'),
blankLine(),
makeSignsTable(
['Sign', 'Description', 'Disease Association'],
[
['Clubbing (Grade 1-4)', 'Loss of nail bed angle, drumstick fingers', 'Cyanotic CHD, IBD, lung cancer, cirrhosis, infective endocarditis'],
['Koilonychia', 'Spoon-shaped nails', 'Iron deficiency anaemia'],
['Leuconychia', 'White nails', 'Hypoalbuminaemia (cirrhosis, nephrotic syndrome)'],
['Terry\'s nails', 'White nails with distal pink band', 'Cirrhosis, heart failure, diabetes'],
['Splinter haemorrhages', 'Linear reddish-brown lines under nails', 'Infective endocarditis, vasculitis, trauma'],
['Palmar erythema', 'Redness of thenar/hypothenar eminences', 'Liver disease, pregnancy, thyrotoxicosis'],
['Dupuytren\'s contracture', 'Fibrous thickening of palmar fascia', 'Alcoholic liver disease, epilepsy, manual labour'],
['Osler\'s nodes', 'Tender nodules on fingertips', 'Infective endocarditis'],
['Janeway lesions', 'Non-tender haemorrhagic macules on palms', 'Infective endocarditis'],
['Heberden\'s nodes', 'Bony swelling at DIP joints', 'Osteoarthritis'],
['Bouchard\'s nodes', 'Bony swelling at PIP joints', 'Osteoarthritis'],
]
),
blankLine(),
h2('4.1 Flowchart: Assessing Clubbing'),
blankLine(),
makeFlowchartTable([
'INSPECT: Loss of nail-fold angle (Schamroth\'s sign)',
'FLUCTUATION: Increased nail-bed fluctuation',
'GRADE: I - Loss of angle only | II + Soft tissue hypertrophy | III + Curved nail | IV + Full drumstick',
'LOOK FOR: Peripheral cyanosis, signs of lung/heart/GI disease',
'INVESTIGATE: CXR, Echo, LFTs, colonoscopy per system suspected'
]),
blankLine(),
// ── SECTION 5: HEAD, NECK & LYMPH NODES ─────────────────────────────────
h1('5. Head, Neck & Lymph Nodes'),
h2('5.1 Head & Face'),
boldBullet('Eyes', 'Jaundice (sclera), anaemia (conjunctiva), Horner\'s syndrome (ptosis, miosis, anhidrosis), xanthelasma (hyperlipidaemia), corneal arcus, Kayser-Fleischer rings (Wilson\'s disease)'),
boldBullet('Mouth', 'Angular stomatitis (iron/B2 deficiency), central cyanosis (tongue), oral thrush (immunosuppression), tongue coated/dry (dehydration, toxaemia), gum hypertrophy (phenytoin, leukaemia)'),
boldBullet('Ear lobes', 'Jaundice assessment, gouty tophi'),
blankLine(),
h2('5.2 Neck'),
boldBullet('JVP', 'Raised in right heart failure, cardiac tamponade, SVC obstruction; Normal = 3-4 cm above sternal angle'),
boldBullet('Thyroid', 'Goitre - multinodular or diffuse; moves with swallowing; bruit in Graves\' disease'),
boldBullet('Carotid pulse', 'Assessed for character and bruits'),
boldBullet('Trachea', 'Central or deviated - tension pneumothorax (away), collapse/fibrosis (towards)'),
blankLine(),
h2('5.3 Lymphadenopathy'),
para('Always examine all lymph node groups: cervical, axillary, inguinal, epitrochlear, para-aortic (abdominal).'),
blankLine(),
makeSignsTable(
['Feature', 'Likely Diagnosis'],
[
['Tender, mobile, soft', 'Reactive (infection)'],
['Rubbery, non-tender, discrete', 'Lymphoma (Hodgkin\'s - \"beer bottle\" nodes)'],
['Hard, irregular, fixed (matted)', 'Metastatic carcinoma'],
['Firm, multiple, matted (collar-stud)', 'Tuberculosis'],
['Virchow\'s node (left supraclavicular)', 'Intra-abdominal or thoracic malignancy (Troisier\'s sign)'],
['Epitrochlear lymphadenopathy', 'Lymphoma, sarcoidosis, secondary syphilis'],
]
),
blankLine(),
noteBox('Virchow\'s node (left supraclavicular / Troisier\'s sign) is a key sign of intra-abdominal malignancy - specifically gastric cancer spreading via the thoracic duct. Always palpate for it. (Bailey & Love)'),
blankLine(),
// ── SECTION 6: OEDEMA ───────────────────────────────────────────────────
h1('6. Oedema'),
para('Oedema is the accumulation of fluid in the interstitial tissue. Assess for pitting vs. non-pitting and distribution.'),
blankLine(),
makeTwoColFlowchart(
['PITTING OEDEMA', 'Hypoalbuminaemia', 'Cardiac failure (bilateral dependent)', 'Venous insufficiency', 'Lymphoedema (late)', 'Pregnancy'],
['NON-PITTING OEDEMA', 'Lymphoedema (primary)', 'Myxoedema (pre-tibial)', 'Lipodystrophy', 'Filariasis'],
'OEDEMA: Pitting vs Non-Pitting'
),
blankLine(),
para('Grading of pitting oedema:'),
boldBullet('+1', '2 mm pit, immediate rebound'),
boldBullet('+2', '4 mm pit, 15-second rebound'),
boldBullet('+3', '6 mm pit, >1 minute rebound; noticeable limb swelling'),
boldBullet('+4', '8 mm pit, >2 minute rebound; gross anasarca'),
blankLine(),
// ── SECTION 7: CLINICAL EXAMPLES ────────────────────────────────────────
h1('7. Clinical Examples with General Examination Findings'),
h2('Example 1: Chronic Liver Disease'),
exampleBox('CLINICAL EXAMPLE: Patient with Chronic Liver Disease', [
['Chief Complaint', 'Abdominal swelling, fatigue for 3 months'],
['General Appearance', 'Wasted, icteric, mild confusion'],
['Hands', 'Leuconychia, palmar erythema, Dupuytren\'s contracture, asterixis (flap)'],
['Face', 'Jaundice (scleral icterus), parotid enlargement'],
['Skin', 'Spider naevi (>5), caput medusae, scratch marks'],
['Neck', 'No lymphadenopathy'],
['Vitals', 'BP 100/60 (hypotensive), HR 98 (tachycardia), T 37.8 (low-grade fever)'],
['Oedema', 'Bilateral pitting pedal oedema +3'],
['Diagnosis clue', 'Decompensated cirrhosis - ascites, encephalopathy'],
]),
blankLine(),
h2('Example 2: Acute Abdomen (Generalised Peritonitis)'),
exampleBox('CLINICAL EXAMPLE: Generalised Peritonitis (Perforated Peptic Ulcer)', [
['Chief Complaint', 'Sudden severe abdominal pain for 2 hours'],
['General Appearance', 'Hippocratic facies, lying perfectly still, clearly distressed'],
['Posture', 'Refuses to move; knees slightly flexed to relieve abdominal wall tension'],
['Vital Signs', 'HR 118 (tachycardia), BP 90/60 (hypotensive), T 37.2 (normal early), RR 24 (tachypnoea)'],
['Skin', 'Pallor, diaphoresis (sweating)'],
['Abdomen', 'Board-like rigidity, no movement with respiration'],
['Key Point', 'Fever is late - temperature normal or only mildly elevated in early peritonitis (Murphy\'s rule)'],
['Diagnosis clue', 'Perforated viscus - erect CXR (free air under diaphragm), urgent surgical review'],
]),
blankLine(),
h2('Example 3: Hypothyroidism'),
exampleBox('CLINICAL EXAMPLE: Hypothyroidism', [
['Chief Complaint', 'Weight gain, fatigue, cold intolerance for 6 months'],
['General Appearance', 'Obese, slow movements, lethargic, appears older than stated age'],
['Facies', 'Myxoedema facies: periorbital puffiness, loss of outer third of eyebrow, coarse hair'],
['Skin', 'Dry, scaly, pale-yellow (carotenaemia), cool to touch; non-pitting pretibial myxoedema'],
['Voice', 'Hoarse, slow, croaky'],
['Pulse', 'Bradycardia (50 bpm), low volume'],
['Neck', 'Diffuse or nodular goitre may be present'],
['Reflexes', 'Slow relaxation of deep tendon reflexes (pathognomonic)'],
['Diagnosis clue', 'TSH elevated, free T4 low; start levothyroxine replacement'],
]),
blankLine(),
h2('Example 4: Right Heart Failure'),
exampleBox('CLINICAL EXAMPLE: Decompensated Right Heart Failure', [
['Chief Complaint', 'Progressive leg swelling and breathlessness for 1 week'],
['General Appearance', 'Dyspnoeic at rest, mildly cyanosed, distressed'],
['Posture', 'Prefers sitting upright (orthopnoea)'],
['JVP', 'Raised 6 cm above sternal angle; pulsatile'],
['Hands', 'Peripheral cyanosis (acrocyanosis), cool extremities'],
['Skin', 'Central cyanosis visible on tongue, mild jaundice (congestive hepatomegaly)'],
['Oedema', 'Bilateral pitting oedema to knees (+3/+4)'],
['Vital Signs', 'HR 102, BP 95/65, RR 26, SpO2 88% on air'],
['Diagnosis clue', 'BNP elevated, Echo (TR, RV dilatation), CXR (cardiomegaly, pleural effusion)'],
]),
blankLine(),
// ── SECTION 8: SUMMARY FLOWCHART ────────────────────────────────────────
h1('8. Summary Flowchart: Systematic General Examination'),
blankLine(),
makeFlowchartTable([
'STEP 1: GREET & POSITION PATIENT - Consent, adequate exposure, comfortable position',
'STEP 2: GENERAL APPEARANCE - Age vs. look, built/nutrition, posture, decubitus, distress level',
'STEP 3: LEVEL OF CONSCIOUSNESS - Alert/confused/drowsy/stupor/coma; assess GCS if indicated',
'STEP 4: FACIES & GAIT - Observe face for diagnostic facies; watch patient walk into room',
'STEP 5: VITAL SIGNS - Pulse, BP (both arms), RR, Temperature, SpO2, Weight/BMI',
'STEP 6: SKIN & COLOUR - Pallor, cyanosis (central/peripheral), jaundice, rashes, lesions',
'STEP 7: HANDS & NAILS - Clubbing, koilonychia, leuconychia, splinter haemorrhages, palmar erythema',
'STEP 8: EYES, MOUTH & EARS - Scleral icterus, conjunctival pallor, corneal arcus, tongue, gums',
'STEP 9: NECK - JVP, thyroid, trachea, carotid pulse',
'STEP 10: LYMPH NODES - All groups: cervical, axillary, inguinal (note Virchow\'s node)',
'STEP 11: OEDEMA - Distribution, pitting vs. non-pitting, grading',
'STEP 12: SUMMARISE & PROCEED TO REGIONAL/SYSTEM EXAMINATION'
]),
blankLine(),
// ── SECTION 9: QUICK REFERENCE ──────────────────────────────────────────
h1('9. Quick Reference: Key Signs & Their Significance'),
blankLine(),
makeSignsTable(
['Sign', 'Where to Look', 'Disease Association'],
[
['Pallor', 'Conjunctiva, lips, nail beds, palmar creases', 'Anaemia, haemorrhage, shock'],
['Central cyanosis', 'Tongue, lips', 'Lung disease, R-to-L shunt'],
['Peripheral cyanosis', 'Fingertips, nail beds', 'LVF, shock, cold'],
['Jaundice', 'Sclera (earliest), skin, nail beds', 'Liver, biliary, haemolytic disease'],
['Clubbing', 'All fingers (Schamroth sign)', 'Lung, heart, GI, liver'],
['Koilonychia', 'Concave nails', 'Iron deficiency'],
['Leuconychia', 'White nails', 'Hypoalbuminaemia'],
['Spider naevi (>5)', 'Trunk/arms above umbilicus', 'Chronic liver disease'],
['Palmar erythema', 'Thenar/hypothenar areas', 'Liver disease, pregnancy'],
['Asterixis (flap)', 'Outstretched hands, wrists dorsiflexed', 'Hepatic/CO2/uraemic encephalopathy'],
['Grey Turner sign', 'Flanks', 'Retroperitoneal haemorrhage (pancreatitis, AAA)'],
['Cullen\'s sign', 'Periumbilical region', 'Acute pancreatitis, ruptured ectopic'],
['Troisier (Virchow) sign', 'Left supraclavicular fossa', 'Intra-abdominal malignancy'],
['Pretibial myxoedema', 'Anterior shin, non-pitting', 'Hypothyroidism, Graves\''],
['Malar flush', 'Cheeks (bilateral purplish-red)', 'Mitral stenosis'],
]
),
blankLine(),
// ── REFERENCES ──────────────────────────────────────────────────────────
h1('References'),
bullet('S. Das. A Manual on Clinical Surgery, 13th Edition. Kolkata: Dr. S. Das Publications.'),
bullet('Bailey & Love\'s Short Practice of Surgery, 28th Edition. CRC Press, 2023.'),
bullet('Harrison\'s Principles of Internal Medicine, 22nd Edition. McGraw-Hill Medical, 2025.'),
bullet('Pye\'s Surgical Handicraft, 22nd Edition.'),
bullet('Park\'s Textbook of Preventive and Social Medicine, 26th Edition.'),
blankLine(),
];
const doc = new Document({
title: 'General Clinical Examination Notes',
description: 'Comprehensive notes for medical students and clinicians',
styles: {
paragraphStyles: [
{
id: 'Heading1',
name: 'Heading 1',
run: { color: '1F3864', bold: true, size: 32 },
paragraph: { spacing: { before: 400, after: 160 } },
},
{
id: 'Heading2',
name: 'Heading 2',
run: { color: '2E75B6', bold: true, size: 26 },
paragraph: { spacing: { before: 280, after: 100 } },
},
{
id: 'Heading3',
name: 'Heading 3',
run: { color: '2E75B6', bold: true, size: 22, italics: true },
paragraph: { spacing: { before: 200, after: 80 } },
},
]
},
sections: [{
properties: {
page: {
margin: { top: 1080, bottom: 1080, left: 1080, right: 1080 },
}
},
headers: {
default: new Header({
children: [new Paragraph({
children: [
new TextRun({ text: 'GENERAL CLINICAL EXAMINATION NOTES', size: 16, color: '888888' }),
new TextRun({ text: ' | ', size: 16, color: 'CCCCCC' }),
new TextRun({ text: 'Medical Student & Clinician Reference', size: 16, color: '888888' }),
],
alignment: AlignmentType.CENTER,
})]
})
},
footers: {
default: new Footer({
children: [new Paragraph({
children: [
new TextRun({ text: 'Page ', size: 18, color: '888888' }),
new TextRun({ children: [PageNumber.CURRENT], size: 18, color: '888888' }),
new TextRun({ text: ' | Sources: S. Das | Bailey & Love | Harrison\'s | Park\'s', size: 18, color: '888888' }),
],
alignment: AlignmentType.CENTER,
})]
})
},
children,
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/general-exam-notes/General_Clinical_Examination_Notes.docx', buffer);
console.log('Document created successfully!');
}).catch(err => {
console.error('Error:', err);
process.exit(1);
});
cd /home/daytona/workspace/general-exam-notes && node generate_notes.js 2>&1
ls -lh /home/daytona/workspace/general-exam-notes/ && python /home/daytona/scripts/office/validate.py /home/daytona/workspace/general-exam-notes/General_Clinical_Examination_Notes.docx 2>&1
validate.py in /home/daytona/skills
cd /home/daytona/workspace/general-exam-notes && python3 -c " import zipfile with zipfile.ZipFile('General_Clinical_Examination_Notes.docx', 'r') as z: names = z.namelist() print('Files in docx:', names[:10]) # Check word/document.xml is valid XML import xml.etree.ElementTree as ET with z.open('word/document.xml') as f: tree = ET.parse(f) print('XML valid! File size OK') "
python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/general-exam-notes/General_Clinical_Examination_Notes.docx 2>&1
General Clinical Examination Notes
Word Document · DOCX
| # | Section | Key Content |
|---|---|---|
| 1 | Overview | Purpose of general examination; master flowchart (7-step approach) |
| 2 | Components | General appearance, LOC, gait, facies (diagnostic facies table), skin colour findings |
| 3 | Vital Signs | Pulse (5 parameters), BP, temperature patterns, RR - all with normal/abnormal ranges |
| 4 | Hands & Nails | 11-sign table (clubbing, koilonychia, Osler's nodes etc.); clubbing grading flowchart |
| 5 | Head, Neck & Lymph Nodes | Eye signs, JVP, thyroid, trachea; lymph node character table; Virchow's node |
| 6 | Oedema | Pitting vs. non-pitting flowchart; grading (+1 to +4) |
| 7 | Clinical Examples | 4 worked examples with full general exam findings |
| 8 | Summary Flowchart | 12-step systematic head-to-toe exam reminder |
| 9 | Quick Reference Table | 15 key signs, where to look, and disease associations |
Please arrange this pdf
Arrange this in proper manner
pandoc --track-changes=all "/home/daytona/workspace/attachments/84eff828-8e31-4c47-9e60-5ab3f2d521fe/General_Clinical_Examination_Notes orris.docx" -o /home/daytona/workspace/general-exam-notes/extracted_content.md 2>&1 && echo "Done"
~/general-exam-notes/build_arranged.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
PageNumber, Header, Footer, PageBreak, VerticalAlign,
TableOfContents, LevelFormat, convertInchesToTwip, UnderlineType
} = require('docx');
const fs = require('fs');
// ════════════════════════════════════════════════════════════
// COLOUR PALETTE
// ════════════════════════════════════════════════════════════
const C = {
navy: '1B3A6B',
blue: '2E75B6',
lblue: '4A90D9',
teal: '17607A',
gold: 'B8860B',
amber: 'FFF3CD',
amberBd: 'E6A817',
green: '1E6B3E',
lgreenBg:'E8F5E9',
red: 'C0392B',
white: 'FFFFFF',
light: 'EBF3FA',
light2: 'D9E8F5',
mid: 'B8D4EC',
rowAlt: 'F0F7FF',
gray: '555555',
lgray: 'DDDDDD',
black: '111111',
};
// ════════════════════════════════════════════════════════════
// HELPER FACTORIES
// ════════════════════════════════════════════════════════════
const sp = (b=0,a=0)=>({spacing:{before:b,after:a}});
function coverTitle(text, size=64, color=C.navy) {
return new Paragraph({
children:[new TextRun({text,bold:true,size,color,font:'Calibri'})],
alignment:AlignmentType.CENTER,
...sp(0,200),
});
}
function coverSub(text, size=26, color=C.blue) {
return new Paragraph({
children:[new TextRun({text,size,color,font:'Calibri Light'})],
alignment:AlignmentType.CENTER,
...sp(0,120),
});
}
function h1(text) {
return new Paragraph({
children:[new TextRun({text,bold:true,size:32,color:C.navy,font:'Calibri'})],
heading:HeadingLevel.HEADING_1,
...sp(400,140),
border:{bottom:{style:BorderStyle.SINGLE,size:8,color:C.blue}},
});
}
function h2(text) {
return new Paragraph({
children:[new TextRun({text,bold:true,size:26,color:C.blue,font:'Calibri'})],
heading:HeadingLevel.HEADING_2,
...sp(280,100),
});
}
function h3(text) {
return new Paragraph({
children:[new TextRun({text,bold:true,italics:true,size:23,color:C.teal,font:'Calibri'})],
heading:HeadingLevel.HEADING_3,
...sp(200,80),
});
}
function body(text,bold=false,italic=false,size=22,color=C.black) {
return new Paragraph({
children:[new TextRun({text,bold,italics:italic,size,color,font:'Calibri'})],
...sp(70,70),
});
}
function bullet(label,detail,level=0) {
const runs = label
? [new TextRun({text:label+': ',bold:true,size:21,font:'Calibri',color:C.navy}),
new TextRun({text:detail,size:21,font:'Calibri'})]
: [new TextRun({text:detail,size:21,font:'Calibri'})];
return new Paragraph({children:runs,bullet:{level},...sp(40,40)});
}
function blank() { return new Paragraph({children:[new TextRun({text:''})],...sp(60,60)}); }
// ════════════════════════════════════════════════════════════
// NOTE BOX (amber)
// ════════════════════════════════════════════════════════════
function noteBox(text) {
return new Table({
width:{size:100,type:WidthType.PERCENTAGE},
rows:[new TableRow({children:[new TableCell({
shading:{fill:C.amber,type:ShadingType.CLEAR},
borders:{
top:{style:BorderStyle.SINGLE,size:8,color:C.amberBd},
bottom:{style:BorderStyle.SINGLE,size:8,color:C.amberBd},
left:{style:BorderStyle.SINGLE,size:16,color:C.amberBd},
right:{style:BorderStyle.NONE},
},
children:[new Paragraph({
children:[
new TextRun({text:'📌 NOTE: ',bold:true,size:21,color:'7F5000',font:'Calibri'}),
new TextRun({text,size:21,color:'5C3A00',font:'Calibri'}),
],...sp(80,80),
})],
margins:{top:100,bottom:100,left:160,right:160},
})]})],
});
}
// ════════════════════════════════════════════════════════════
// COLOURED SECTION DIVIDER
// ════════════════════════════════════════════════════════════
function sectionTag(text, fill=C.navy) {
return new Table({
width:{size:100,type:WidthType.PERCENTAGE},
rows:[new TableRow({children:[new TableCell({
shading:{fill,type:ShadingType.CLEAR},
children:[new Paragraph({
children:[new TextRun({text,bold:true,color:C.white,size:22,font:'Calibri'})],
alignment:AlignmentType.LEFT,...sp(60,60),
})],
margins:{top:80,bottom:80,left:200,right:80},
})]})],
});
}
// ════════════════════════════════════════════════════════════
// VERTICAL FLOWCHART
// ════════════════════════════════════════════════════════════
function vertFlow(steps, fills) {
const rows=[];
const defaultFills=[C.navy,C.blue,C.blue,C.blue,C.blue,C.blue,C.blue,C.blue,C.blue,C.blue,C.blue,C.blue,C.blue];
steps.forEach((step,i)=>{
const bg = (fills&&fills[i]) || defaultFills[i] || C.blue;
rows.push(new TableRow({children:[new TableCell({
shading:{fill:bg,type:ShadingType.CLEAR},
children:[new Paragraph({
children:[new TextRun({text:step,bold:true,color:C.white,size:20,font:'Calibri'})],
alignment:AlignmentType.CENTER,...sp(90,90),
})],
margins:{top:60,bottom:60,left:200,right:200},
borders:{
top:{style:BorderStyle.SINGLE,size:4,color:C.white},
bottom:{style:BorderStyle.SINGLE,size:4,color:C.white},
left:{style:BorderStyle.SINGLE,size:4,color:C.white},
right:{style:BorderStyle.SINGLE,size:4,color:C.white},
},
})]})
);
if(i<steps.length-1){
rows.push(new TableRow({children:[new TableCell({
children:[new Paragraph({
children:[new TextRun({text:'▼',bold:true,color:C.navy,size:24})],
alignment:AlignmentType.CENTER,...sp(20,20),
})],
borders:{top:{style:BorderStyle.NONE},bottom:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE}},
margins:{top:0,bottom:0},
})]}));
}
});
return new Table({width:{size:75,type:WidthType.PERCENTAGE},rows});
}
// ════════════════════════════════════════════════════════════
// TWO-COLUMN COMPARISON TABLE (flowchart style)
// ════════════════════════════════════════════════════════════
function twoColFlow(title, leftLabel, leftItems, rightLabel, rightItems, fillL=C.blue, fillR=C.teal) {
const rows=[];
// Title row
rows.push(new TableRow({children:[
new TableCell({
columnSpan:2,
shading:{fill:C.navy,type:ShadingType.CLEAR},
children:[new Paragraph({children:[new TextRun({text:title,bold:true,color:C.white,size:24,font:'Calibri'})],alignment:AlignmentType.CENTER,...sp(80,80)})],
margins:{top:80,bottom:80,left:160,right:160},
})
]}));
// Header row
rows.push(new TableRow({children:[
new TableCell({shading:{fill:fillL,type:ShadingType.CLEAR},children:[new Paragraph({children:[new TextRun({text:leftLabel,bold:true,color:C.white,size:22,font:'Calibri'})],alignment:AlignmentType.CENTER,...sp(70,70)})],margins:{top:70,bottom:70,left:120,right:60}}),
new TableCell({shading:{fill:fillR,type:ShadingType.CLEAR},children:[new Paragraph({children:[new TextRun({text:rightLabel,bold:true,color:C.white,size:22,font:'Calibri'})],alignment:AlignmentType.CENTER,...sp(70,70)})],margins:{top:70,bottom:70,left:60,right:120}}),
]}));
const maxLen=Math.max(leftItems.length,rightItems.length);
for(let i=0;i<maxLen;i++){
const l=leftItems[i]||'';
const r=rightItems[i]||'';
rows.push(new TableRow({children:[
new TableCell({
shading:{fill:l?C.light:'F8F8F8',type:ShadingType.CLEAR},
children:[new Paragraph({children:[new TextRun({text:l,size:20,font:'Calibri'})],alignment:AlignmentType.CENTER,...sp(60,60)})],
margins:{top:60,bottom:60,left:100,right:60},
borders:{top:{style:BorderStyle.SINGLE,size:2,color:C.lgray},bottom:{style:BorderStyle.SINGLE,size:2,color:C.lgray},left:{style:BorderStyle.NONE},right:{style:BorderStyle.SINGLE,size:2,color:C.lgray}},
}),
new TableCell({
shading:{fill:r?'E8F5F0':'F8F8F8',type:ShadingType.CLEAR},
children:[new Paragraph({children:[new TextRun({text:r,size:20,font:'Calibri'})],alignment:AlignmentType.CENTER,...sp(60,60)})],
margins:{top:60,bottom:60,left:60,right:100},
borders:{top:{style:BorderStyle.SINGLE,size:2,color:C.lgray},bottom:{style:BorderStyle.SINGLE,size:2,color:C.lgray},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE}},
}),
]}));
}
return new Table({width:{size:100,type:WidthType.PERCENTAGE},rows});
}
// ════════════════════════════════════════════════════════════
// DATA TABLE with striped rows
// ════════════════════════════════════════════════════════════
function dataTable(headers, rows, colWidths=null) {
const headerRow = new TableRow({
children: headers.map((h,i)=>new TableCell({
shading:{fill:C.navy,type:ShadingType.CLEAR},
width: colWidths ? {size:colWidths[i],type:WidthType.PERCENTAGE} : undefined,
children:[new Paragraph({children:[new TextRun({text:h,bold:true,color:C.white,size:20,font:'Calibri'})],alignment:AlignmentType.CENTER,...sp(70,70)})],
margins:{top:70,bottom:70,left:100,right:100},
verticalAlign: VerticalAlign.CENTER,
}))
});
const bodyRows = rows.map((row,ri)=>new TableRow({
children: row.map((cell,ci)=>new TableCell({
shading:{fill:ri%2===0?C.rowAlt:C.white,type:ShadingType.CLEAR},
width: colWidths ? {size:colWidths[ci],type:WidthType.PERCENTAGE} : undefined,
children:[new Paragraph({children:[new TextRun({text:cell,size:20,font:'Calibri'})],alignment:ci===0?AlignmentType.LEFT:AlignmentType.LEFT,...sp(60,60)})],
margins:{top:60,bottom:60,left:100,right:100},
borders:{
top:{style:BorderStyle.SINGLE,size:2,color:C.lgray},
bottom:{style:BorderStyle.SINGLE,size:2,color:C.lgray},
left:{style:BorderStyle.SINGLE,size:2,color:C.lgray},
right:{style:BorderStyle.SINGLE,size:2,color:C.lgray},
},
}))
}));
return new Table({width:{size:100,type:WidthType.PERCENTAGE},rows:[headerRow,...bodyRows]});
}
// ════════════════════════════════════════════════════════════
// EXAMPLE CASE BOX (dark header + key-value rows)
// ════════════════════════════════════════════════════════════
function caseBox(title, kvPairs) {
const hdr = new TableRow({children:[
new TableCell({
columnSpan:2,
shading:{fill:C.teal,type:ShadingType.CLEAR},
children:[new Paragraph({children:[new TextRun({text:'🩺 '+title,bold:true,color:C.white,size:22,font:'Calibri'})],alignment:AlignmentType.LEFT,...sp(80,80)})],
margins:{top:80,bottom:80,left:160,right:120},
})
]});
const kvRows = kvPairs.map(([k,v],i)=>new TableRow({children:[
new TableCell({
width:{size:28,type:WidthType.PERCENTAGE},
shading:{fill:i%2===0?C.light2:'EAF4FF',type:ShadingType.CLEAR},
children:[new Paragraph({children:[new TextRun({text:k,bold:true,size:20,font:'Calibri',color:C.navy})],alignment:AlignmentType.LEFT,...sp(60,60)})],
margins:{top:60,bottom:60,left:120,right:80},
borders:{top:{style:BorderStyle.SINGLE,size:2,color:C.lgray},bottom:{style:BorderStyle.SINGLE,size:2,color:C.lgray},left:{style:BorderStyle.NONE},right:{style:BorderStyle.SINGLE,size:4,color:C.blue}},
}),
new TableCell({
width:{size:72,type:WidthType.PERCENTAGE},
shading:{fill:i%2===0?C.rowAlt:C.white,type:ShadingType.CLEAR},
children:[new Paragraph({children:[new TextRun({text:v,size:20,font:'Calibri'})],alignment:AlignmentType.LEFT,...sp(60,60)})],
margins:{top:60,bottom:60,left:100,right:80},
borders:{top:{style:BorderStyle.SINGLE,size:2,color:C.lgray},bottom:{style:BorderStyle.SINGLE,size:2,color:C.lgray},right:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE}},
}),
]}));
return new Table({width:{size:100,type:WidthType.PERCENTAGE},rows:[hdr,...kvRows]});
}
// ════════════════════════════════════════════════════════════
// PAGE BREAK
// ════════════════════════════════════════════════════════════
function pgBreak() { return new Paragraph({children:[new PageBreak()]}); }
// ════════════════════════════════════════════════════════════
// DOCUMENT CONTENT
// ════════════════════════════════════════════════════════════
const children = [];
// ─── COVER PAGE ───────────────────────────────────────────
children.push(blank(), blank(), blank(), blank());
children.push(
new Table({
width:{size:100,type:WidthType.PERCENTAGE},
rows:[new TableRow({children:[new TableCell({
shading:{fill:C.navy,type:ShadingType.CLEAR},
children:[
new Paragraph({children:[new TextRun({text:'',size:10})], ...sp(200,0)}),
new Paragraph({children:[new TextRun({text:'GENERAL CLINICAL EXAMINATION',bold:true,size:60,color:C.white,font:'Calibri'})],alignment:AlignmentType.CENTER,...sp(0,160)}),
new Paragraph({children:[new TextRun({text:'Comprehensive Clinical Notes for Medical Students & Clinicians',size:26,color:C.mid,font:'Calibri Light'})],alignment:AlignmentType.CENTER,...sp(0,200)}),
new Paragraph({children:[new TextRun({text:'─────────────────────────────────────────────',size:22,color:C.blue})],alignment:AlignmentType.CENTER,...sp(0,160)}),
new Paragraph({children:[new TextRun({text:'Based on:',size:21,color:C.mid,font:'Calibri Light'})],alignment:AlignmentType.CENTER,...sp(0,80)}),
new Paragraph({children:[new TextRun({text:'S. Das Manual on Clinical Surgery • Bailey & Love\'s Surgery',size:21,color:C.mid,font:'Calibri Light'})],alignment:AlignmentType.CENTER,...sp(0,60)}),
new Paragraph({children:[new TextRun({text:'Harrison\'s Principles of Internal Medicine • Park\'s Preventive Medicine',size:21,color:C.mid,font:'Calibri Light'})],alignment:AlignmentType.CENTER,...sp(0,200)}),
new Paragraph({children:[new TextRun({text:'',size:10})], ...sp(200,0)}),
],
margins:{top:0,bottom:0,left:400,right:400},
})]})],
})
);
children.push(pgBreak());
// ─── TABLE OF CONTENTS PAGE ────────────────────────────────
children.push(h1('Table of Contents'));
const tocItems = [
['1.', 'Overview of General Examination', '3'],
['2.', 'Components of General Examination', '3'],
[' 2.1', 'General Appearance', '3'],
[' 2.2', 'Level of Consciousness', '3'],
[' 2.3', 'Gait', '4'],
[' 2.4', 'Facies', '4'],
[' 2.5', 'Skin Colour & Findings', '4'],
['3.', 'Vital Signs', '5'],
[' 3.1', 'Pulse', '5'],
[' 3.2', 'Blood Pressure', '6'],
[' 3.3', 'Temperature', '6'],
[' 3.4', 'Respiratory Rate', '6'],
['4.', 'Examination of Hands & Nails', '7'],
['5.', 'Head, Neck & Lymph Nodes', '7'],
['6.', 'Oedema', '8'],
['7.', 'Clinical Examples', '9'],
['8.', 'Summary Flowchart', '10'],
['9.', 'Quick Reference: Key Signs', '11'],
['10.', 'References', '12'],
];
tocItems.forEach(([num,title,pg])=>{
const isMain = !num.startsWith(' ');
children.push(new Paragraph({
children:[
new TextRun({text:num+' ',bold:isMain,size:isMain?22:20,font:'Calibri',color:isMain?C.navy:C.gray}),
new TextRun({text:title,bold:isMain,size:isMain?22:20,font:'Calibri',color:isMain?C.navy:C.gray}),
new TextRun({text:' '+'.'.repeat(80),size:18,color:C.lgray,font:'Courier New'}),
new TextRun({text:' '+pg,bold:isMain,size:isMain?22:20,font:'Calibri',color:C.blue}),
],
...sp(isMain?120:60,isMain?60:30),
}));
});
children.push(pgBreak());
// ─── SECTION 1 ────────────────────────────────────────────
children.push(sectionTag('SECTION 1 Overview of General Examination'));
children.push(blank());
children.push(body('The general examination is the systematic assessment of a patient\'s overall health status before proceeding to regional or system-specific examination. It provides a first impression that guides the entire clinical encounter and reveals systemic disease clues that might not emerge from a focused examination alone.'));
children.push(blank());
children.push(noteBox('The general examination is not merely an introduction — many diagnoses (e.g., jaundice in hepatitis, cushingoid facies, Marfan syndrome) can be established from this first look alone. Never rush through it.'));
children.push(blank());
children.push(h2('1.1 Flowchart: Overall Approach to Clinical Examination'));
children.push(blank());
children.push(vertFlow([
'STEP 1 — Patient Introduction & Consent',
'STEP 2 — General Examination (Systemic Survey)',
'STEP 3 — Vital Signs Assessment',
'STEP 4 — Regional / System-Specific Examination',
'STEP 5 — Special Tests & Investigations',
'STEP 6 — Synthesis & Differential Diagnosis',
'STEP 7 — Management Plan',
], [C.navy, C.blue, C.blue, C.teal, C.teal, '1A6B3A', C.gold+'AA']));
children.push(blank());
// ─── SECTION 2 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 2 Components of General Examination', C.teal));
children.push(blank());
children.push(body('A thorough general examination covers the following domains, assessed in a logical head-to-toe sequence:'));
children.push(blank());
children.push(h2('2.1 General Appearance'));
children.push(bullet('Age vs. Appearance','Does the patient look older or younger than stated age? Chronic illness ages appearance.'));
children.push(bullet('Built & Nutrition','Obese, normal, thin, or cachectic. Cachexia suggests malignancy, chronic infection, or heart failure.'));
children.push(bullet('Posture & Attitude','Patients with peritonitis lie still. Colicky pain causes restlessness. Meningitis causes neck retraction. Everted leg after fall suggests fractured neck of femur (S. Das).'));
children.push(bullet('Decubitus','In cerebral irritation the patient lies curled on one side, away from light.'));
children.push(bullet('Comfort Level','Is the patient in obvious distress, comfortable at rest, or agitated?'));
children.push(blank());
children.push(h2('2.2 Level of Consciousness (GCS / LOC)'));
children.push(body('Assess mental state at the outset. Five levels (S. Das):'));
children.push(blank());
children.push(dataTable(
['Level','State','Response'],
[
['1','Fully conscious','Perfectly oriented — time, place, person'],
['2','Fully conscious','Disoriented to time and place'],
['3','Semi-conscious (drowsy)','Can be awakened'],
['4','Unconscious (stupor)','Responds to painful stimuli only'],
['5','Unconscious (coma)','No response to any stimuli'],
],
[10,40,50]
));
children.push(blank());
children.push(noteBox('Always assess GCS formally in head injury, stroke, or sepsis. Mental state must be documented before any sedation or anaesthesia.'));
children.push(blank());
children.push(h2('2.3 Gait'));
children.push(body('Observe the patient walking if possible. Abnormal gait may indicate:'));
children.push(blank());
children.push(dataTable(
['Gait Type','Clinical Features','Condition'],
[
['Waddling','Lateral trunk sway, wide base','Bilateral CDH, bilateral coxa vara'],
['Trendelenburg','Trunk tilts to weak side','Muscle dystrophy, polio, hip arthritis, Perthes'],
['Antalgic','Short stance phase on affected side','Pain (fracture, arthritis)'],
['Parkinsonian','Shuffling, festination, reduced arm swing','Parkinson\'s disease'],
['Hemiplegic','Circumduction of stiff leg','Stroke / upper motor neuron lesion'],
['Cerebellar (ataxic)','Wide base, staggering, cannot tandem walk','Cerebellar disease, alcohol intoxication'],
],
[20,40,40]
));
children.push(blank());
children.push(h2('2.4 Facies'));
children.push(body('The face provides powerful diagnostic clues. Key diagnostic facies:'));
children.push(blank());
children.push(dataTable(
['Facies','Characteristics','Condition'],
[
['Hippocratic (Facies Hippocratica)','Sunken eyes, hollow cheeks, pinched nose, grey-cold skin','Generalised peritonitis / terminal illness'],
['Risus Sardonicus','Fixed sardonic smile, raised eyebrows','Tetanus'],
['Mask Face','Expressionless, reduced blinking, fixed stare','Parkinson\'s disease'],
['Moon Face','Round, plethoric, hirsute, acne','Cushing\'s syndrome / long-term steroid use'],
['Adenoid Facies','Open mouth, vacant expression, elongated face','Hypertrophied adenoids'],
['Myxoedema Facies','Periorbital puffiness, loss of outer 1/3 eyebrow, coarse dry hair','Hypothyroidism'],
['Acromegalic Facies','Prominent jaw (prognathism), large nose & lips, frontal bossing','Acromegaly'],
['Malar Flush','Bilateral purplish-red blush on cheeks','Advanced mitral stenosis'],
],
[22,45,33]
));
children.push(blank());
children.push(h2('2.5 Skin Colour & Findings'));
children.push(blank());
children.push(h3('Pallor'));
children.push(body('Where to look: lower palpebral conjunctiva (most reliable), mucous membranes of lips and cheeks, nail beds, palmar creases.'));
children.push(bullet('Causes','Massive haemorrhage, shock, intense emotion, anaemia (iron-deficiency, haemolytic, aplastic)'));
children.push(blank());
children.push(h3('Cyanosis'));
children.push(blank());
children.push(twoColFlow(
'CYANOSIS — Central vs. Peripheral',
'CENTRAL CYANOSIS',
['Site: tongue, lips, oral mucosa','Inadequate O₂ saturation of arterial blood','Causes: lung disease, R-to-L cardiac shunt, low FiO₂','Key: O₂ therapy improves central cyanosis'],
'PERIPHERAL CYANOSIS',
['Site: fingertips, nail beds, toes, tip of nose','Excessive O₂ extraction from slow-flowing blood','Causes: cold, LVF, shock, peripheral vascular disease','Key: tongue is SPARED in peripheral cyanosis'],
C.blue, C.teal
));
children.push(blank());
children.push(body('Minimum 5 g/dL of reduced Hb needed for cyanosis to be visible. NOT detectable in severe anaemia even with severe hypoxia (S. Das).'));
children.push(blank());
children.push(noteBox('Carbon monoxide poisoning produces cherry-red discolouration — NOT cyanosis. Methaemoglobinaemia/sulphaemoglobinaemia cause cyanosis with NORMAL arterial O₂ tension.'));
children.push(blank());
children.push(h3('Jaundice'));
children.push(body('Where to look first: sclera of the eye (earliest and most reliable site). Also: nail beds, lobule of the ear, tip of nose, undersurface of tongue.'));
children.push(blank());
children.push(dataTable(
['Type','Skin Colour','Urine','Stool','Examples'],
[
['Pre-hepatic (haemolytic)','Lemon yellow','Normal or dark','Normal or dark','Haemolytic anaemia, sickle cell disease, G6PD'],
['Hepatic (hepatocellular)','Yellow-orange','Dark (bilirubin positive)','Pale or normal','Viral hepatitis, alcoholic cirrhosis, drugs'],
['Post-hepatic (obstructive)','Dark olive-green','Very dark (clay-coloured)','Pale / clay-coloured','Gallstones, carcinoma head of pancreas, cholangitis'],
],
[20,16,18,16,30]
));
children.push(blank());
children.push(noteBox('Hypercarotinaemia (yellow discolouration from excess carrot/vegetable intake) SPARES the sclera — key distinguishing feature from true jaundice.'));
children.push(blank());
children.push(h3('Other Significant Skin Signs'));
children.push(blank());
children.push(dataTable(
['Sign','Location','Significance'],
[
['Grey Turner\'s sign','Flanks (lateral)','Retroperitoneal haemorrhage — acute pancreatitis, leaking AAA'],
['Cullen\'s sign','Periumbilical region','Severe acute pancreatitis, ruptured ectopic pregnancy, liver trauma'],
['Spider naevi (>5)','Trunk/arms above umbilicus','Chronic liver disease (cirrhosis, hepatitis)'],
['Scratch marks','Any skin surface','Pruritus from bile salt retention — obstructive jaundice'],
['Telangiectasia','Lips, tongue, mucosa','Osler-Weber-Rendu syndrome; mitral stenosis; scleroderma'],
['Petechiae / Purpura','Skin, mucosae','Thrombocytopenia, vasculitis, meningococcaemia'],
],
[22,30,48]
));
children.push(blank());
// ─── SECTION 3 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 3 Vital Signs', C.navy));
children.push(blank());
children.push(h2('3.1 Flowchart: Vital Signs Assessment Sequence'));
children.push(blank());
children.push(vertFlow([
'1. PULSE — Rate, Rhythm, Volume, Character, Vessel Wall',
'2. BLOOD PRESSURE — Both arms; postural change if indicated',
'3. RESPIRATORY RATE — Count for 1 full minute; note pattern & depth',
'4. TEMPERATURE — Oral / Axillary / Rectal / Tympanic',
'5. OXYGEN SATURATION (SpO₂) — Pulse oximetry',
'6. WEIGHT & BMI — Document in all elective cases; note recent change',
]));
children.push(blank());
children.push(h2('3.2 Pulse'));
children.push(blank());
children.push(dataTable(
['Parameter','Normal Value','Abnormal & Clinical Significance'],
[
['Rate','60–100 bpm (adult)','Tachycardia (>100): fever, pain, haemorrhage, thyrotoxicosis, PE, AF\nBradycardia (<60): heart block, hypothyroidism, athletes, raised ICP'],
['Rhythm','Regular','Irregularly irregular = Atrial Fibrillation\nRegularly irregular = 2nd degree heart block / ectopics'],
['Volume','Normal / full','Large/bounding: AR, thyrotoxicosis, CO₂ retention, sepsis\nSmall/thready: hypovolaemia, AS, LVF, cardiac tamponade'],
['Character / Waveform','Smooth upstroke','Collapsing (water-hammer): aortic regurgitation\nSlow-rising (plateau): aortic stenosis\nPulsus paradoxus (>10 mmHg drop on inspiration): tamponade, asthma'],
['Vessel Wall','Soft, compressible','Hardened / pipe-stem: atherosclerosis'],
],
[18,22,60]
));
children.push(blank());
children.push(noteBox('In internal haemorrhage the pulse becomes immediately rapid. In peritonitis the pulse quickens as it spreads. A rising rate with falling volume = worsening shock. (S. Das; Bailey & Love)'));
children.push(blank());
children.push(h2('3.3 Blood Pressure'));
children.push(blank());
children.push(dataTable(
['Category','Systolic (mmHg)','Diastolic (mmHg)','Action'],
[
['Optimal','< 120','< 80','No action needed'],
['Normal','120–129','80–84','Lifestyle advice'],
['High-Normal','130–139','85–89','Monitor; lifestyle modification'],
['Hypertension Grade 1','140–159','90–99','Confirm; investigate end-organ damage'],
['Hypertension Grade 2','160–179','100–109','Initiate pharmacotherapy'],
['Hypertension Grade 3','≥ 180','≥ 110','Urgent treatment'],
['Hypotension','< 90','-','Assess cause: haemorrhage, sepsis, cardiac'],
],
[30,18,18,34]
));
children.push(blank());
children.push(body('Postural (orthostatic) hypotension: drop ≥ 20 mmHg systolic or ≥ 10 mmHg diastolic on standing. Causes: autonomic neuropathy (diabetes), hypovolaemia, drugs.'));
children.push(bullet('BP difference >15 mmHg between arms','Suspect aortic dissection or subclavian artery stenosis — always check both arms.'));
children.push(blank());
children.push(h2('3.4 Temperature'));
children.push(blank());
children.push(dataTable(
['Category','Value','Causes'],
[
['Normal','36.5–37.5 °C (oral)','—'],
['Low-grade fever','37.5–38 °C','Early infection, post-op, tissue injury'],
['Pyrexia','> 38 °C','Infection, inflammation, malignancy, drugs'],
['Hyperpyrexia','> 41 °C','Heat stroke, malignant hyperthermia, CNS bleed'],
['Hypothermia','< 35 °C','Exposure, hypothyroidism, hypoadrenalism, sepsis'],
],
[25,25,50]
));
children.push(blank());
children.push(body('Fever patterns:'));
children.push(bullet('Remittent','Temperature varies >1 °C but never touches normal — Typhoid'));
children.push(bullet('Intermittent (Quotidian)','Spikes and returns to normal — Malaria (Falciparum daily, Vivax every 48h, Quartan every 72h)'));
children.push(bullet('Hectic / Swinging','High spike then drops to normal with drenching sweats — Abscess, pyaemia'));
children.push(bullet('Continuous (Sustained)','Remains elevated, little variation — Lobar pneumonia'));
children.push(bullet('Pel-Ebstein Pattern','Alternate periods of fever and normal temperature — Hodgkin\'s lymphoma'));
children.push(blank());
children.push(noteBox('Murphy\'s rule in acute appendicitis: pain comes FIRST, then vomiting, then fever LAST. Temperature is never an early sign. (S. Das)'));
children.push(blank());
children.push(h2('3.5 Respiratory Rate'));
children.push(bullet('Normal adult','12–20 breaths/min'));
children.push(bullet('Tachypnoea (>20/min)','Fever, pneumonia, PE, metabolic acidosis, pain, anxiety'));
children.push(bullet('Bradypnoea (<12/min)','Opioids, raised ICP, hypothyroidism, metabolic alkalosis'));
children.push(body('Note: increased rate with flaring alae nasi directs attention to the thorax as the primary seat of disease. (S. Das)'));
children.push(blank());
// ─── SECTION 4 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 4 Examination of Hands & Nails', C.teal));
children.push(blank());
children.push(body('Hands provide a wealth of diagnostic information and should be examined routinely as part of the general survey.'));
children.push(blank());
children.push(dataTable(
['Sign','Description','Disease Association'],
[
['Clubbing (Grades 1–4)','Loss of nail-bed angle; spongy nail-bed; drumstick appearance','Cyanotic CHD, lung cancer, IBD, cirrhosis, infective endocarditis, mesothelioma'],
['Koilonychia','Spoon-shaped (concave) nails','Iron deficiency anaemia'],
['Leuconychia','White nails (whole or banded)','Hypoalbuminaemia — cirrhosis, nephrotic syndrome'],
['Terry\'s Nails','White nails with distal pink band','Cirrhosis, heart failure, type 2 diabetes'],
['Splinter Haemorrhages','Linear reddish-brown sub-ungual streaks','Infective endocarditis, vasculitis, trauma'],
['Palmar Erythema','Redness of thenar & hypothenar eminences','Chronic liver disease, pregnancy, thyrotoxicosis, RA'],
['Dupuytren\'s Contracture','Fibrous thickening of palmar fascia; ring/little finger contracture','Alcoholic liver disease, epilepsy, manual labour'],
['Osler\'s Nodes','Tender, raised nodules on fingertips / toe pads','Infective endocarditis (immune complex)'],
['Janeway Lesions','Non-tender haemorrhagic macules on palms & soles','Infective endocarditis (septic emboli)'],
['Heberden\'s Nodes','Bony swelling at DIP joints','Osteoarthritis'],
['Bouchard\'s Nodes','Bony swelling at PIP joints','Osteoarthritis'],
['Asterixis (Flapping Tremor)','Coarse flap with wrists dorsiflexed & arms outstretched','Hepatic, uraemic, or CO₂ encephalopathy'],
],
[22,38,40]
));
children.push(blank());
children.push(h2('4.1 Flowchart: Assessing Clubbing'));
children.push(blank());
children.push(vertFlow([
'INSPECT — Obliteration of nail-fold angle (Lovibond angle > 180°)',
'SCHAMROTH\'S SIGN — When dorsa of same fingers apposed, diamond gap disappears',
'FLUCTUATION — Press nail bed: increased boggy fluctuation',
'GRADE: I = angle loss only | II + soft tissue | III + curved nail | IV = full drumstick',
'SYSTEMS CHECK — Respiratory (CXR), Cardiac (Echo), GI (scope), Liver (LFTs)',
'INVESTIGATE — Targeted by system: HRCT, Echo, colonoscopy, LFTs/US abdomen',
]));
children.push(blank());
// ─── SECTION 5 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 5 Head, Neck & Lymph Nodes', C.navy));
children.push(blank());
children.push(h2('5.1 Eyes'));
children.push(blank());
children.push(dataTable(
['Finding','Significance'],
[
['Scleral icterus (yellow sclera)','Jaundice — earliest visible sign'],
['Conjunctival pallor','Anaemia (Hb typically < 10 g/dL)'],
['Xanthelasma (yellow plaques on eyelids)','Hyperlipidaemia (not always pathological)'],
['Corneal arcus in young (<45 yrs)','Hypercholesterolaemia (familial)'],
['Kayser-Fleischer rings','Wilson\'s disease (copper deposition)'],
['Ptosis + miosis + anhidrosis','Horner\'s syndrome — cervical sympathetic chain lesion'],
['Exophthalmos (proptosis)','Graves\' disease (thyrotoxicosis)'],
['Periorbital puffiness','Hypothyroidism, nephrotic syndrome, angioedema'],
],
[45,55]
));
children.push(blank());
children.push(h2('5.2 Mouth & Tongue'));
children.push(blank());
children.push(dataTable(
['Finding','Significance'],
[
['Central cyanosis (tongue)','Arterial desaturation — lung/cardiac cause'],
['Angular stomatitis','Iron or Vitamin B2 (riboflavin) deficiency'],
['Oral thrush (candidiasis)','Immunosuppression, antibiotics, inhaled steroids, HIV'],
['Dry, coated tongue','Dehydration, toxaemia (e.g., early appendicitis)'],
['Gum hypertrophy','Phenytoin, leukaemia, cyclosporin'],
['Smooth glossy tongue (glossitis)','Iron, B12, folate deficiency'],
['Telangiectasias on tongue/lips','Osler-Weber-Rendu (hereditary haemorrhagic telangiectasia)'],
],
[45,55]
));
children.push(blank());
children.push(h2('5.3 Neck'));
children.push(blank());
children.push(dataTable(
['Structure','What to Assess','Clinical Significance'],
[
['JVP','Height (cm above sternal angle); waveform','Raised (>4 cm): RHF, tamponade, SVC obstruction, fluid overload'],
['Thyroid','Size, consistency, tenderness; moves with swallowing; bruit','Goitre; bruit = Graves\' disease; hard/nodular = suspect malignancy'],
['Trachea','Deviation from midline','Away from lesion: tension pneumothorax, large pleural effusion\nTowards lesion: fibrosis, collapse'],
['Carotid pulse','Character; bruits on auscultation','Bruit = carotid stenosis; absent pulse = arterial occlusion'],
],
[20,35,45]
));
children.push(blank());
children.push(h2('5.4 Lymph Nodes'));
children.push(body('Always examine all node groups: cervical (anterior/posterior), submandibular, supraclavicular (especially left), axillary, epitrochlear, inguinal.'));
children.push(blank());
children.push(dataTable(
['Characteristics','Most Likely Diagnosis'],
[
['Tender, soft, mobile','Reactive — acute infection (viral URTI, dental sepsis)'],
['Rubbery, non-tender, discrete','Lymphoma (Hodgkin\'s disease — "beer bottle cork" firmness)'],
['Hard, irregular, fixed / matted','Metastatic carcinoma'],
['Firm, multiple, matted — collar-stud appearance','Tuberculosis (with possible central necrosis/softening)'],
['Virchow\'s node (left supraclavicular)','Intra-abdominal / thoracic malignancy — Troisier\'s sign'],
['Epitrochlear lymphadenopathy','Lymphoma, sarcoidosis, secondary syphilis'],
['Generalised lymphadenopathy','HIV, infectious mononucleosis, lymphoma, leukaemia, SLE'],
],
[50,50]
));
children.push(blank());
children.push(noteBox('Virchow\'s node (Troisier\'s sign): palpable left supraclavicular lymph node is a sinister sign of intra-abdominal malignancy (especially gastric cancer) spreading via the thoracic duct. Always palpate for it. (Bailey & Love)'));
children.push(blank());
// ─── SECTION 6 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 6 Oedema', C.teal));
children.push(blank());
children.push(body('Oedema is accumulation of fluid in the interstitial tissue. Assess distribution, consistency (pitting vs. non-pitting), and grade.'));
children.push(blank());
children.push(twoColFlow(
'OEDEMA — Pitting vs. Non-Pitting',
'PITTING OEDEMA',
['Finger pressure leaves a persistent pit','Hypoalbuminaemia (cirrhosis, nephrotic syndrome)','Cardiac failure (bilateral, dependent)','Venous insufficiency (unilateral/bilateral)','Lymphoedema (late stage)','Pregnancy','Drugs (CCBs, NSAIDs)'],
'NON-PITTING OEDEMA',
['No pit on pressure; firm/rubbery','Lymphoedema (primary/early)','Pre-tibial myxoedema (hypothyroidism)','Lipoedema (fat distribution disorder)','Filariasis (Wuchereria bancrofti)'],
C.blue, C.teal
));
children.push(blank());
children.push(h2('Grading of Pitting Oedema'));
children.push(blank());
children.push(dataTable(
['Grade','Depth of Pit','Rebound Time','Clinical Appearance'],
[
['+1','2 mm','Immediate','Barely detectable; slight impression'],
['+2','4 mm','< 15 seconds','Obvious pitting; normal limb contour'],
['+3','6 mm','> 1 minute','Marked swelling; limb contour clearly distorted'],
['+4','8 mm','> 2 minutes','Severe pitting; anasarca; possible skin breakdown'],
],
[12,22,22,44]
));
children.push(blank());
// ─── SECTION 7 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 7 Clinical Examples', C.navy));
children.push(blank());
children.push(h2('Example 1 — Chronic Liver Disease (Decompensated Cirrhosis)'));
children.push(blank());
children.push(caseBox('CHRONIC LIVER DISEASE — General Examination Findings', [
['Chief Complaint','Abdominal swelling, fatigue, and confusion for 3 months'],
['General Appearance','Wasted, deeply icteric, confused (encephalopathy grade II)'],
['Hands','Leuconychia, palmar erythema, Dupuytren\'s contracture, asterixis (metabolic flap)'],
['Face','Scleral icterus (deep), bilateral parotid enlargement (alcohol)'],
['Skin','> 5 spider naevi on trunk, caput medusae, excoriation marks (pruritus)'],
['Neck','No lymphadenopathy'],
['Vital Signs','BP 100/60 mmHg (hypotensive), HR 98 (tachycardia), T 37.8°C (low-grade fever)'],
['Oedema','Bilateral pitting pedal oedema +3, ascites'],
['Key Diagnosis Clue','Decompensated cirrhosis — ascites + encephalopathy + jaundice (Child-Pugh C)'],
['Next Step','LFTs, INR, serum albumin, Child-Pugh score, USS abdomen, diagnostic ascitic tap'],
]));
children.push(blank());
children.push(h2('Example 2 — Acute Abdomen (Generalised Peritonitis)'));
children.push(blank());
children.push(caseBox('GENERALISED PERITONITIS (Perforated Peptic Ulcer) — General Examination Findings', [
['Chief Complaint','Sudden severe abdominal pain for 2 hours'],
['General Appearance','Hippocratic facies, lying perfectly still, clearly distressed'],
['Posture','Refuses to move; knees slightly flexed to relieve abdominal wall tension'],
['Vital Signs','HR 118/min, BP 90/60 mmHg (shock), T 37.2°C (normal early), RR 24/min'],
['Skin','Pallor, diaphoresis (cold sweating)'],
['Abdomen','Board-like rigidity, no respiratory movement, rebound tenderness'],
['Key Point','Fever is LATE — temperature normal or mildly elevated in early peritonitis (Murphy\'s rule)'],
['Key Diagnosis Clue','Erect CXR: free gas under diaphragm. Urgent surgical review.'],
['Next Step','IV access, IV fluids, analgesia, NG tube, urgent surgical referral, erect CXR / CT abdomen'],
]));
children.push(blank());
children.push(h2('Example 3 — Hypothyroidism'));
children.push(blank());
children.push(caseBox('HYPOTHYROIDISM — General Examination Findings', [
['Chief Complaint','Weight gain, fatigue, cold intolerance for 6 months'],
['General Appearance','Obese, slow movements, lethargic, appears much older than stated age'],
['Facies','Myxoedema facies: periorbital puffiness, loss of outer 1/3 of eyebrow, coarse dry hair, macroglossia'],
['Skin','Dry, scaly, pale-yellow (carotenaemia), cool to touch; non-pitting pretibial myxoedema'],
['Voice','Hoarse, slow, croaky (macroglossia + laryngeal myxoedema)'],
['Pulse','Bradycardia 48 bpm, low volume'],
['Neck','Diffuse or nodular goitre may be present'],
['Reflexes','Slow relaxation phase of deep tendon reflexes — PATHOGNOMONIC'],
['Key Diagnosis Clue','TSH elevated, free T4 low; treat with levothyroxine'],
['Next Step','TSH, free T4, TPO antibodies, lipid panel, ECG (low-voltage QRS, bradycardia)'],
]));
children.push(blank());
children.push(h2('Example 4 — Right Heart Failure'));
children.push(blank());
children.push(caseBox('DECOMPENSATED RIGHT HEART FAILURE — General Examination Findings', [
['Chief Complaint','Progressive leg swelling and breathlessness for 1 week'],
['General Appearance','Dyspnoeic at rest, mildly cyanosed, distressed, prefers sitting upright'],
['JVP','Raised 6 cm above sternal angle; giant V wave (TR)'],
['Hands','Peripheral cyanosis (acrocyanosis), cool extremities, mild clubbing'],
['Skin','Central cyanosis on tongue; mild jaundice (congestive hepatomegaly)'],
['Oedema','Bilateral pitting oedema to knees (+3), mild ascites'],
['Vital Signs','HR 102/min, BP 95/65 mmHg, RR 26/min, SpO₂ 88% on air'],
['Key Diagnosis Clue','BNP elevated, echo shows TR + RV dilatation, CXR shows cardiomegaly + pleural effusion'],
['Next Step','O₂, diuretics (furosemide IV), fluid restriction, Echo, BNP, treat underlying cause (COPD, PE, PH)'],
]));
children.push(blank());
// ─── SECTION 8 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 8 Summary Flowchart: Systematic General Examination', C.teal));
children.push(blank());
children.push(body('Use this as a bedside checklist to ensure no component is missed.'));
children.push(blank());
children.push(vertFlow([
'STEP 1 — GREET & POSITION: Consent, adequate exposure, comfortable position (lying / sitting)',
'STEP 2 — GENERAL APPEARANCE: Age vs. look, build/nutrition, posture, decubitus, distress level',
'STEP 3 — LEVEL OF CONSCIOUSNESS: Alert / confused / drowsy / stupor / coma; assess GCS if indicated',
'STEP 4 — FACIES & GAIT: Diagnostic facies (see table); observe walking into room',
'STEP 5 — VITAL SIGNS: Pulse, BP (both arms), RR, Temperature, SpO₂, Weight/BMI',
'STEP 6 — SKIN & COLOUR: Pallor, cyanosis (central/peripheral), jaundice, rashes, purpura',
'STEP 7 — HANDS & NAILS: Clubbing, koilonychia, leuconychia, splinter haemorrhages, palmar erythema, asterixis',
'STEP 8 — EYES, MOUTH & EARS: Scleral icterus, conjunctival pallor, corneal arcus, tongue, gums, ear lobes',
'STEP 9 — NECK: JVP, thyroid, trachea position, carotid pulse',
'STEP 10 — LYMPH NODES: All groups — cervical, axillary, inguinal; note Virchow\'s node (left supraclavicular)',
'STEP 11 — OEDEMA: Distribution, pitting vs. non-pitting, grade (+1 to +4)',
'STEP 12 — SUMMARISE & PROCEED TO REGIONAL / SYSTEM EXAMINATION',
],[C.navy,C.blue,C.blue,C.teal,C.teal,'1A6B3A','1A6B3A',C.navy,C.blue,C.teal,C.teal,'1A6B3A']));
children.push(blank());
// ─── SECTION 9 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 9 Quick Reference: Key Clinical Signs', C.navy));
children.push(blank());
children.push(dataTable(
['Sign','Where to Look','Disease Association'],
[
['Pallor','Conjunctiva, lips, nail beds, palmar creases','Anaemia, haemorrhage, shock, uraemia'],
['Central cyanosis','Tongue, oral mucosa, lips','Lung disease, R-to-L cardiac shunt, methaemoglobinaemia'],
['Peripheral cyanosis','Fingertips, nail beds, toes','LVF, shock, cold, PVD, β-blocker use'],
['Jaundice','Sclera (earliest), skin, nail beds, tongue under-surface','Liver, biliary, haemolytic disease'],
['Clubbing','All fingers; Schamroth\'s sign','Lung cancer, cyanotic CHD, IBD, cirrhosis, IE'],
['Koilonychia','Concave nail surface','Iron deficiency anaemia'],
['Leuconychia','White / pale nails','Hypoalbuminaemia (cirrhosis, nephrotic syndrome)'],
['Splinter haemorrhages','Nail beds (longitudinal streaks)','Infective endocarditis, vasculitis'],
['Spider naevi (>5)','Trunk/arms above umbilicus','Chronic liver disease'],
['Palmar erythema','Thenar/hypothenar eminences','Liver disease, pregnancy, thyrotoxicosis'],
['Asterixis (metabolic flap)','Wrists dorsiflexed, arms outstretched','Hepatic, CO₂, uraemic encephalopathy'],
['Grey Turner\'s sign','Flanks (discolouration)','Retroperitoneal haemorrhage (pancreatitis, AAA)'],
['Cullen\'s sign','Periumbilical (discolouration)','Acute pancreatitis, ruptured ectopic pregnancy'],
['Virchow\'s node (Troisier)','Left supraclavicular fossa','Intra-abdominal/thoracic malignancy'],
['Pre-tibial myxoedema','Anterior shin (non-pitting)','Hypothyroidism, Graves\' disease'],
['Malar flush','Bilateral cheeks (purplish-red)','Mitral stenosis'],
['Xanthelasma','Eyelids (yellowish plaques)','Hyperlipidaemia'],
['Osler\'s nodes','Fingertip pulp (tender)','Infective endocarditis'],
['Janeway lesions','Palms and soles (haemorrhagic macules)','Infective endocarditis'],
['Kayser-Fleischer rings','Corneal periphery (slit lamp)','Wilson\'s disease'],
],
[25,30,45]
));
children.push(blank());
// ─── SECTION 10 ────────────────────────────────────────────
children.push(pgBreak());
children.push(sectionTag('SECTION 10 References', C.teal));
children.push(blank());
[
'S. Das. A Manual on Clinical Surgery, 13th Edition. Kolkata: Dr. S. Das Publications.',
'Bailey BJ, Love RJW. Bailey and Love\'s Short Practice of Surgery, 28th Edition. CRC Press, 2023.',
'Kasper DL et al. Harrison\'s Principles of Internal Medicine, 22nd Edition. McGraw-Hill Medical, 2025.',
'Pye\'s Surgical Handicraft, 22nd Edition.',
'Park K. Park\'s Textbook of Preventive and Social Medicine, 26th Edition.',
].forEach(ref=>{ children.push(bullet('',ref)); });
children.push(blank());
// ════════════════════════════════════════════════════════════
// BUILD DOCUMENT
// ════════════════════════════════════════════════════════════
const doc = new Document({
title:'General Clinical Examination — Comprehensive Notes',
description:'Arranged and formatted clinical notes for medical students',
styles:{
paragraphStyles:[
{id:'Heading1',name:'Heading 1',run:{color:C.navy,bold:true,size:32,font:'Calibri'},paragraph:{spacing:{before:400,after:140}}},
{id:'Heading2',name:'Heading 2',run:{color:C.blue,bold:true,size:26,font:'Calibri'},paragraph:{spacing:{before:280,after:100}}},
{id:'Heading3',name:'Heading 3',run:{color:C.teal,bold:true,italics:true,size:23,font:'Calibri'},paragraph:{spacing:{before:200,after:80}}},
],
},
sections:[{
properties:{page:{margin:{top:1008,bottom:1008,left:1080,right:1080}}},
headers:{default:new Header({children:[
new Paragraph({
children:[
new TextRun({text:'GENERAL CLINICAL EXAMINATION ',size:17,color:'888888',font:'Calibri'}),
new TextRun({text:'| Medical Reference Notes',size:17,color:C.blue,font:'Calibri'}),
],
alignment:AlignmentType.RIGHT,
border:{bottom:{style:BorderStyle.SINGLE,size:4,color:C.lgray}},
...sp(0,60),
})
]})},
footers:{default:new Footer({children:[
new Paragraph({
children:[
new TextRun({text:'Page ',size:18,color:'888888',font:'Calibri'}),
new TextRun({children:[PageNumber.CURRENT],size:18,color:C.blue,font:'Calibri'}),
new TextRun({text:' | Sources: S. Das · Bailey & Love · Harrison\'s · Park\'s',size:18,color:'888888',font:'Calibri'}),
],
alignment:AlignmentType.CENTER,
border:{top:{style:BorderStyle.SINGLE,size:4,color:C.lgray}},
...sp(60,0),
})
]})},
children,
}],
});
Packer.toBuffer(doc).then(buf=>{
fs.writeFileSync('/home/daytona/workspace/general-exam-notes/General_Clinical_Examination_ARRANGED.docx',buf);
console.log('SUCCESS — file written');
}).catch(err=>{console.error(err);process.exit(1);});
cd /home/daytona/workspace/general-exam-notes && node build_arranged.js 2>&1
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
C.gold+'AA'):~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
cd /home/daytona/workspace/general-exam-notes && node build_arranged.js 2>&1
ls -lh /home/daytona/workspace/general-exam-notes/ && python3 -c " import zipfile, xml.etree.ElementTree as ET with zipfile.ZipFile('/home/daytona/workspace/general-exam-notes/General_Clinical_Examination_ARRANGED.docx','r') as z: with z.open('word/document.xml') as f: ET.parse(f) print('XML valid. File ready.') "
General Clinical Examination ARRANGED
Word Document · DOCX
| Feature | Before | After |
|---|---|---|
| Cover page | Plain centred text | Full dark-blue professional cover with title, subtitle, and sources |
| Table of Contents | None | Manual TOC with all 10 sections and page numbers |
| Section breaks | None | Each major section starts on a new page with a colour-coded section banner |
| Header/Footer | Basic | Right-aligned header + centred page-numbered footer with source attribution |
Last pdf you arranged please but headers on right side is very long and inappropriate
"GENERAL CLINICAL EXAMINATION | Medical Reference Notes" — I'll shorten it to just the section title and page number, clean and concise.~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
cd /home/daytona/workspace/general-exam-notes && node build_arranged.js 2>&1
General Clinical Examination ARRANGED
Word Document · DOCX
There is left sided long headers are not appropriate kindly make proper
"SECTION 1 Overview of General Examination". I'll shorten them to just clean short labels.sectionTag() banners have long text. I'll shorten all of them to brief labels AND also update the sectionTag function itself to use a smaller font so even moderate text fits well.~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
sectionTag() calls to use the new two-argument format with short labels:~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
~/general-exam-notes/build_arranged.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/general-exam-notes/build_arranged.js'
cd /home/daytona/workspace/general-exam-notes && node build_arranged.js 2>&1
General Clinical Examination ARRANGED
Word Document · DOCX
§ 1, § 2 ... § 10 in the section colour - narrow and cleanOverview of General ExaminationWould you like me to convert this to PDF format?
python3 /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-to pdf "/home/daytona/workspace/general-exam-notes/General_Clinical_Examination_ARRANGED.docx" --outdir /home/daytona/workspace/general-exam-notes/ 2>&1
cp "/home/daytona/workspace/general-exam-notes/General_Clinical_Examination_ARRANGED.docx" /tmp/arranged.docx && python3 /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-to pdf /tmp/arranged.docx --outdir /tmp/ 2>&1 && ls -lh /tmp/arranged.pdf
cp /tmp/arranged.pdf "/home/daytona/workspace/general-exam-notes/General_Clinical_Examination_ARRANGED.pdf" && ls -lh /home/daytona/workspace/general-exam-notes/
General Clinical Examination ARRANGED
PDF Document · PDF