systematic examination for a diabetic patient should target the following key areas:1. Hands and FingersPrayer Sign: Ask the patient to press their palms and fingers together with the wrists dorsiflexed. Inability to appress the entire surface of the hands indicates Limited Joint Mobility (Cheiroarthropathy).Tabletop Sign: Have the patient place their palms flat on a table. A positive sign (inability to flatten the fingers) suggests joint contractures.Dupuytren’s Contracture: Palpate the palmar fascia for thickening, nodules, or pretendinous cords, particularly in the ring and little fingers.Trigger Finger (Tenosynovitis): Palpate the palm at the base of the digits for nodules, and check for a "locking" or catching phenomenon when the patient flexes and extends the fingers.Carpal Tunnel Syndrome (CTS): Assess for thenar muscle wasting and perform tests like Tinel’s (tapping the median nerve) or Phalen’s (wrist flexion) if the patient reports numbness or tingling in the hand.2. ShouldersAdhesive Capsulitis (Frozen Shoulder): Assess both active and passive Range of Motion (ROM). Look for limitations in abduction, internal rotation, and external rotation of the glenohumeral joint, which are highly prevalent in patients with DM.3. The Musculoskeletal Foot ExamDeformities: Inspect the foot for abnormal pressure points. Look for Charcot foot (a swollen, red, and deformed midfoot), hallux valgus (bunions), and claw toes or hammer toes.Tendon Assessment: Check for a tight Achilles tendon (equinus) and thickness of the plantar fascia, which increase the risk of plantar ulceration.Joint Mobility: Assess the subtalar joint and the first metatarsophalangeal (MTP) joint for restricted motion, as stiffness here alters load-bearing capacity.4. General Muscle AssessmentMuscle Wasting: Inspect the proximal thighs and pelvic girdle for diabetic amyotrophy, which presents as asymmetric muscle weakness and atrophy.Reflexes & Sensation: The MSK exam must always be paired with a comprehensive neurological and vascular assessment. Test the ankle and patellar reflexes, and use a 128-Hz tuning fork and a 10g monofilament to check for peripheral neuropathy.
systematic examination for a diabetic patient should target the following key areas:1. Hands and FingersPrayer Sign: Ask the patient to press their palms and fingers together with the wrists dorsiflexed. Inability to appress the entire surface of the hands indicates Limited Joint Mobility (Cheiroarthropathy).Tabletop Sign: Have the patient place their palms flat on a table. A positive sign (inability to flatten the fingers) suggests joint contractures.Dupuytren’s Contracture: Palpate the palmar fascia for thickening, nodules, or pretendinous cords, particularly in the ring and little fingers.Trigger Finger (Tenosynovitis): Palpate the palm at the base of the digits for nodules, and check for a "locking" or catching phenomenon when the patient flexes and extends the fingers.Carpal Tunnel Syndrome (CTS): Assess for thenar muscle wasting and perform tests like Tinel’s (tapping the median nerve) or Phalen’s (wrist flexion) if the patient reports numbness or tingling in the hand.2. ShouldersAdhesive Capsulitis (Frozen Shoulder): Assess both active and passive Range of Motion (ROM). Look for limitations in abduction, internal rotation, and external rotation of the glenohumeral joint, which are highly prevalent in patients with DM.3. The Musculoskeletal Foot ExamDeformities: Inspect the foot for abnormal pressure points. Look for Charcot foot (a swollen, red, and deformed midfoot), hallux valgus (bunions), and claw toes or hammer toes.Tendon Assessment: Check for a tight Achilles tendon (equinus) and thickness of the plantar fascia, which increase the risk of plantar ulceration.Joint Mobility: Assess the subtalar joint and the first metatarsophalangeal (MTP) joint for restricted motion, as stiffness here alters load-bearing capacity.4. General Muscle AssessmentMuscle Wasting: Inspect the proximal thighs and pelvic girdle for diabetic amyotrophy, which presents as asymmetric muscle weakness and atrophy.Reflexes & Sensation: The MSK exam must always be paired with a comprehensive neurological and vascular assessment. Test the ankle and patellar reflexes, and use a 128-Hz tuning fork and a 10g monofilament to check for peripheral neuropathy. Tell me how to do all test and give me other clinical examination and musculoskeletal examination to the patient
diabetes musculoskeletal complications examination
How to approach the diabetes mellitus patient
As a medical student how the questions and clinical question and examination need to ask and do to the diabetes mellitus patient to take medical record and history taking
"Good morning, I am [your name], a medical student. May I ask you some questions about your health today? Everything you tell me is confidential."
| Field | What to Ask |
|---|---|
| Full name | "May I have your full name?" |
| Age | "How old are you?" |
| Sex | Record as seen / "Do you identify as male or female?" |
| Occupation | "What is your job or daily activity?" |
| Marital status | "Are you married, single, or widowed?" |
| Address | "Where do you currently live?" |
| Date of admission/consultation | Record today's date |
| Informant | Who gave the history? Patient themselves, relative, carer? How reliable? |
Why occupation matters in DM: Shift workers have disrupted glycemic patterns; sedentary workers have worse insulin resistance; certain jobs involve driving (hypoglycemia risk).
"What brought you here today?" "What is the main problem bothering you?"
"Increased thirst and frequent urination for 3 weeks"
| Letter | Stands for | Question to Ask |
|---|---|---|
| S | Site | "Where exactly is the problem?" |
| O | Onset | "When did it start? Was it sudden or gradual?" |
| C | Character | "What does it feel like?" |
| R | Radiation | "Does it spread anywhere?" |
| A | Associations | "Is there anything else that comes with it?" |
| T | Time course | "Is it constant or does it come and go? Is it getting better or worse?" |
| E | Exacerbating/Relieving factors | "What makes it better? What makes it worse?" |
| S | Severity | "On a scale of 0-10, how bad is it? Does it affect your daily life?" |
"How many times do you urinate during the day?" "Do you wake up at night to urinate? How many times?" (Nocturia) "How much do you urinate each time - a small amount or a lot?" "Is your urine pale, dark, or does it look foamy?" "Have you noticed ants being attracted to where you urinate?" (Glycosuria - a classical question in clinical practice)
"Do you feel very thirsty more than usual?" "How much water or fluids do you drink in a day?" "Is the thirst there all the time, or does drinking relieve it only briefly?"
"Is your appetite increased, decreased, or normal?" "Do you feel hungry soon after eating a full meal?"
"Have you lost or gained weight recently without trying?" "How much weight have you lost/gained and over what period of time?"
"Do you feel tired all the time?" "Does the tiredness come on even without activity, or only after effort?" "Do you feel weak in your arms or legs?"
"Has your vision changed recently?" "Is the blurring in one eye or both?" "Is it constant or does it fluctuate with your blood sugar levels?" "Have you seen any floaters, flashes, or sudden loss of vision?"
"Do you get infections frequently - skin, genital, or urinary?" "Have you noticed itching around the genitals or white discharge?" (Candidiasis) "Do wounds, cuts, or sores take a long time to heal?" "Do you have any sores or ulcers that are not healing, especially on the feet?"
"I am now going to ask about different parts of your body to make sure everything is being checked."
"Has a doctor ever looked at the back of your eyes with a special instrument?" "Have you had any changes in your vision - blurring, dark spots, or sudden loss of sight?" "Have you had any eye injections or laser treatment for your eyes?"
"Have you noticed your urine becoming foamy or frothy?" "Do you have swelling in your legs, ankles, or around your eyes in the morning?" "Have you ever been told your kidneys are not working properly?" "Do you know your kidney function test results?"
"Do you have numbness, tingling, or a burning sensation in your feet or hands?" "Does it feel like you are walking on cotton wool or sand?" "Is the tingling or pain worse at night?" "Have you lost feeling in your feet - for example, unable to feel hot or cold water?" "Have you had any falls because of loss of balance?"
"Do you feel dizzy or lightheaded when you stand up quickly?" (Postural hypotension) "Do you feel full quickly after eating a small meal?" (Gastroparesis) "Do you have nausea, vomiting, or bloating after eating?" "Do you have problems with your bowels - constipation or diarrhea that comes and goes?" "For male patients: Do you have difficulty getting or maintaining an erection?" (Erectile dysfunction - ask sensitively and privately) "Do you have difficulty controlling your bladder or do you need to strain to pass urine?" "Do you sweat abnormally - too much or not at all?"
"Do you have chest pain or tightness, especially when you walk or climb stairs?" "Do you feel short of breath with activity or when lying flat?" "Have you had a heart attack or been told your heart arteries are blocked?" "Do you get pain in your calves when walking that goes away with rest?" (Claudication = peripheral arterial disease) "Have you ever had a stroke or weakness on one side of the body?"
"Do you check your feet every day?" "Have you ever had a foot ulcer or wound that did not heal?" "Have you had any amputations?" "Do you have pain in your feet? Or is there no pain even when you injure them?" (Painless foot = neuropathy) "Do you wear special diabetic footwear?"
"Have you ever been diagnosed with any other medical conditions?"
| Condition | Question |
|---|---|
| Previous DM diagnosis | "When were you first told you have diabetes?" |
| Hypertension | "Have you ever been told your blood pressure is high?" |
| Heart disease | "Have you ever had a heart attack, angina, or heart failure?" |
| Stroke | "Have you ever had a stroke or brain attack?" |
| Kidney disease | "Have you ever had kidney problems or been on dialysis?" |
| Previous surgery | "Have you had any operations? What were they for?" |
| Hospitalizations | "Have you ever been admitted to hospital for your diabetes? Why?" |
| DKA or HHS | "Have you ever been in a diabetic coma or had very high blood sugar requiring emergency treatment?" |
| Gestational DM (women) | "Did you ever have diabetes during pregnancy?" |
| Pancreatic problems | "Have you ever had pancreatitis or pancreatic surgery?" |
| Thyroid disease | "Have you been told you have a thyroid problem?" |
"What medications are you currently taking? Include tablets, injections, and any traditional or herbal medicines."
| Drug Category | Question |
|---|---|
| Diabetes drugs | "Do you take tablets or injections for your diabetes? Which ones? What dose? Do you take them regularly?" |
| Insulin | "What type of insulin do you use? Do you take it at the right time before meals? Where do you inject it?" |
| Blood pressure medication | "Do you take anything for blood pressure?" |
| Cholesterol medication | "Are you on any tablets for cholesterol?" |
| Aspirin/antiplatelet | "Do you take a small aspirin tablet daily?" |
| Drugs that worsen DM | "Are you on any steroid tablets (like prednisolone)? Diuretics (water tablets)?" |
| Allergies | "Do you have any allergies to medicines? What happened when you took it?" |
| Herbal/traditional remedies | "Do you take any traditional medicine, herbs, or supplements?" |
"Does anyone in your family have diabetes or any medical conditions?"
"Father - hypertension and T2DM; Mother - alive and well; 2 siblings - one has T2DM"
"Do you smoke or have you ever smoked?" If yes: "How many cigarettes per day? For how many years?" → Calculate pack-years = (cigarettes per day ÷ 20) × years smoked If stopped: "When did you stop?"
"Do you drink alcohol?" If yes: "What type of drink? How many units per week?" Alert the patient: alcohol can mask hypoglycemia symptoms
"Tell me about what you usually eat in a day - from when you wake up until bedtime." "Do you eat regular meals, or do you skip meals?" "How much sugar, rice, bread, or sweet drinks do you consume?" "Do you follow a special diabetic diet?"
"How physically active are you?" "Do you do any structured exercise - walking, swimming, gym? How often and for how long?"
"What is your daily routine like?" "Do you work night shifts?" (disrupts glycemic control) "Do you drive?" (critical - hypoglycemia while driving is dangerous)
"Can you afford your medications?" "Do you have someone at home who helps you?" "Do you live alone?"
"Are you currently pregnant or planning a pregnancy?" "Are you using any contraception?" "Did you have any problems with blood sugar during previous pregnancies?"
"Let me quickly ask about a few other body systems to make sure we haven't missed anything."
| System | Questions |
|---|---|
| General | Fever, night sweats, unexplained weight change |
| Skin | Rashes, itching, non-healing wounds, changes in skin color |
| Head | Headaches, dizziness |
| Eyes | Vision changes, double vision, eye pain |
| Ears/Nose/Throat | Hearing loss, oral sores, difficulty swallowing |
| Respiratory | Shortness of breath, cough, snoring, daytime sleepiness (sleep apnoea, linked to insulin resistance) |
| Cardiovascular | Chest pain, palpitations, ankle swelling |
| GI | Nausea, vomiting, abdominal pain, heartburn, diarrhoea, constipation |
| Genitourinary | Foamy urine, difficulty urinating, sexual dysfunction |
| Musculoskeletal | Joint pain, hand stiffness, shoulder stiffness, foot pain/deformity |
| Neurological | Numbness, tingling, weakness, falls, memory problems |
| Psychiatric | Low mood, anxiety, sleep problems (depression is 2-3x more common in DM) |
"Tell me about how your diabetes has been managed so far."
| Question | What you are assessing |
|---|---|
| "What was your last HbA1c result? When was it done?" | Glycemic control trend |
| "Do you monitor your blood sugar at home?" | Self-monitoring ability |
| "What are your typical blood sugar readings in the morning before eating?" | Fasting glucose |
| "What are they after meals?" | Postprandial glucose |
| "Have you had episodes where your blood sugar went too low - sweating, shaking, confusion?" | Hypoglycemia frequency |
| "Did you need help from another person or emergency services for low blood sugar?" | Severe hypoglycemia |
| "Do you feel warning signs before your sugar goes low - sweating, trembling, hunger?" | Hypoglycemia awareness |
| "If you have lost warning signs, that is very important to tell your doctor" | Hypoglycemia unawareness |
| "Have you ever been admitted for very high blood sugar or diabetic coma?" | DKA/HHS history |
DATE: ___________
PATIENT: Full name, Age, Sex, Occupation
CHIEF COMPLAINT:
"[patient's own words]" – duration
HISTORY OF PRESENTING ILLNESS:
[Narrative paragraph: onset, character, progression, associated
symptoms, exacerbating/relieving factors, severity, impact on daily life]
Example: "Mr X is a 52-year-old male who presents with a 3-week history
of polyuria, polydipsia, and fatigue. He reports urinating 8-10 times
daily including 3-4 times nightly. He drinks approximately 4 litres of
water per day. He has lost 5 kg over 1 month without dietary change.
He denies chest pain, visual changes, or foot ulcers. He has no prior
history of diabetes."
PAST MEDICAL HISTORY:
[List diagnoses with year of diagnosis]
- Hypertension - diagnosed 2018
- No previous DM, no prior surgery
DRUG HISTORY:
[Drug / Dose / Frequency]
- Amlodipine 5mg OD
- NKDA (No Known Drug Allergies)
FAMILY HISTORY:
- Father: Type 2 DM, hypertension
- Mother: Deceased, CVA
- Siblings: No known illness
SOCIAL HISTORY:
- Married, 3 children
- Office worker, sedentary
- Non-smoker; alcohol: 2 beers on weekends
- Diet: high carbohydrate, skips breakfast
- No regular exercise
REVIEW OF SYSTEMS:
- Positive: polyuria, polydipsia, blurred vision, fatigue
- Negative: no chest pain, no foot ulcers, no nausea,
no numbness in feet, no postural dizziness
PHYSICAL EXAMINATION:
[Always document findings systematically - see examination section]
General → Vitals → HEENT → CVS → RS → Abdomen → Neuro → MSK → Feet → Skin
SUMMARY:
"Mr X is a 52-year-old male with a 3-week history of polyuria,
polydipsia, weight loss, and fatigue with a strong family history of
T2DM, presenting most likely with new-onset Type 2 Diabetes Mellitus."
INVESTIGATIONS REQUESTED:
[List with justification]
DIFFERENTIAL DIAGNOSIS:
1. Type 2 Diabetes Mellitus (most likely)
2. Type 1 DM (less likely - age, onset)
3. Secondary DM (e.g., steroid-induced - exclude)
4. Diabetes insipidus (polyuria without osmotic symptoms)
MANAGEMENT PLAN:
[Lifestyle / Medication / Monitoring / Referrals / Follow-up]
"I would like to examine you now. I will start from your general appearance and work my way through. Please tell me if anything is uncomfortable."
| Step | What to do | What to say |
|---|---|---|
| 1. General inspection | Look at the patient from the end of the bed - well/unwell, obese/thin, cushingoid? | "I am going to look at you first from here." |
| 2. Vitals | BP (both arms), HR, RR, Temp, O2 sat, weight, height, BMI | "I am going to measure your blood pressure and pulse." |
| 3. Hands | Inspect - cheiroarthropathy, Dupuytren's, trigger finger; Prayer sign, Tabletop sign; thenar wasting (CTS); capillary refill | "Can I look at your hands? Can you press your palms together like this?" |
| 4. Eyes | Visual acuity (Snellen chart); fundoscopy if available; look for xanthelasma | "Can you read the letters on this chart for me?" |
| 5. Mouth/throat | Oral candidiasis; gum disease | "Can you open your mouth wide for me?" |
| 6. Thyroid | Palpate from behind | "I am going to feel your neck gently." |
| 7. Blood pressure (orthostatic) | Supine → standing at 1 and 3 min | "I will measure your BP lying down, then standing up." |
| 8. Cardiovascular | JVP, apex beat, heart sounds, carotid bruits, abdominal bruit | "I am going to listen to your heart and check the blood vessels in your neck." |
| 9. Abdomen | Liver size (NAFLD); renal angle; inspection of injection sites | "I am going to feel your abdomen - tell me if it hurts." |
| 10. Skin | Acanthosis nigricans (neck/axillae), necrobiosis lipoidica (tibiae), shin spots, injection sites | "I am going to look at your skin in a few areas." |
| 11. Lower limbs | Inspect for edema, skin changes, muscle wasting | "Can I have a look at your legs?" |
| 12. Feet | Remove shoes and socks; inspect all surfaces; palpate pulses; monofilament; tuning fork; reflexes | "I need to examine your feet thoroughly - please remove your shoes and socks." |
| 13. Neurological | Reflexes (ankle, patellar); vibration; pinprick; proprioception | "I am going to test the feeling in your feet and your reflexes." |
| 14. Shoulders | Active + passive ROM (adhesive capsulitis) | "Can you raise your arm as high as possible? Now let me help move it." |
Create a practical checklist of diabetes history-taking questions
"What brings you here today?" "How long has this been going on?"
For each drug: Name → Dose → Frequency → Route → Compliance
| System | Check if asked | Positive findings |
|---|---|---|
| General | ☐ | Fever / weight change / night sweats |
| Skin | ☐ | Itching / rash / non-healing wounds |
| Eyes | ☐ | Vision change / floaters / double vision |
| ENT | ☐ | Oral sores / difficulty swallowing |
| Respiratory | ☐ | Snoring / daytime sleepiness (sleep apnoea) |
| Cardiovascular | ☐ | Chest pain / palpitations / ankle swelling |
| GI | ☐ | Nausea / vomiting / heartburn / change in bowel habit |
| Genitourinary | ☐ | Foamy urine / dysuria / sexual dysfunction |
| Musculoskeletal | ☐ | Hand/shoulder stiffness / foot pain |
| Neurological | ☐ | Numbness / weakness / falls |
| Psychiatric | ☐ | Low mood / anxiety / sleep difficulty |
| Area | Done | Key Finding |
|---|---|---|
| General - well/unwell, obese, Cushingoid | ☐ | |
| Weight, height, BMI | ☐ | |
| Blood pressure (both arms) | ☐ | |
| Orthostatic BP (lying → standing) | ☐ | |
| Heart rate - regular/irregular | ☐ | |
| Respiratory rate | ☐ | |
| Temperature | ☐ | |
| Hands - prayer sign, tabletop, Dupuytren's | ☐ | |
| Eyes - visual acuity, fundoscopy | ☐ | |
| Mouth - candidiasis, gum disease | ☐ | |
| Thyroid palpation | ☐ | |
| Carotid bruits | ☐ | |
| Heart sounds | ☐ | |
| Abdomen - liver size, injection sites | ☐ | |
| Skin - acanthosis nigricans, necrobiosis lipoidica, shin spots | ☐ | |
| Legs - edema, skin changes, hair loss | ☐ | |
| FEET - Remove shoes + socks | ☐ | |
| Foot inspection - ulcers, deformities, calluses | ☐ | |
| Posterior tibial pulse | ☐ | |
| Dorsalis pedis pulse | ☐ | |
| 10g monofilament sensation | ☐ | |
| 128-Hz tuning fork vibration (hallux → malleolus) | ☐ | |
| Pin-prick sensation | ☐ | |
| Ankle jerk reflex | ☐ | |
| Patellar reflex | ☐ | |
| Shoulder ROM (adhesive capsulitis screen) | ☐ |
Write a 2-3 sentence summary after completing the history.
"[Name] is a [age]-year-old [sex] with a [duration] history of [chief complaint], likely representing [diagnosis]. Relevant history includes [key risk factors / complications]. Key findings on examination include [positive examination findings]."
| Red Flag | Suspected Emergency |
|---|---|
| Kussmaul breathing + fruity breath + vomiting | DKA |
| Extreme thirst + confusion + no ketones | HHS |
| Sweating + shaking + confusion + low glucose | Hypoglycemia |
| Sudden vision loss | Vitreous hemorrhage / proliferative retinopathy |
| Hot, swollen, painless foot | Acute Charcot foot |
| Foot wound probes to bone | Osteomyelitis |
| Absent foot pulses + cold foot + rest pain | Critical limb ischemia |
all information from pdfs make me a best history taking medical record for diabetics mellitus and it's associated disease
python3 -c " import pdfplumber import os pdf_dir = '/home/daytona/workspace/attachments/f0d5cb2f-6a34-458f-8e7a-1b6d0e8c7d2f/' pdfs = os.listdir(pdf_dir) print('Files found:') for f in pdfs: print(f) "
python3 -c " import pdfplumber import os pdf_dir = '/home/daytona/workspace/attachments/f0d5cb2f-6a34-458f-8e7a-1b6d0e8c7d2f/' pdfs = os.listdir(pdf_dir) all_text = {} for fname in pdfs: path = os.path.join(pdf_dir, fname) with pdfplumber.open(path) as pdf: text = '' for page in pdf.pages: t = page.extract_text() if t: text += t + '\n' all_text[fname] = text print(f'--- {fname} ---') print(f'Pages: {len(pdf.pages)}, chars: {len(text)}') print(text[:800]) print() " 2>&1 | head -200
mkdir -p /home/daytona/workspace/dm-medical-record && ls /home/daytona/workspace/dm-medical-record
~/dm-medical-record/create_dm_record.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, Header, Footer, PageBreak,
UnderlineType, TabStopType, TabStopPosition
} = require('docx');
const fs = require('fs');
// ── Colour palette ──
const DARK_BLUE = "1F3864";
const MED_BLUE = "2E74B5";
const LIGHT_BLUE = "DEEAF1";
const ACCENT_RED = "C00000";
const ACCENT_GOLD = "BF9000";
const LIGHT_GRAY = "F2F2F2";
const WHITE = "FFFFFF";
const BLACK = "000000";
// ── Helpers ──────────────────────────────────────────────────────────────────
function heading1(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_1,
spacing: { before: 300, after: 120 },
children: [new TextRun({
text,
bold: true,
color: WHITE,
size: 26,
font: "Calibri",
})],
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
indent: { left: 100, right: 100 },
});
}
function heading2(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_2,
spacing: { before: 240, after: 80 },
border: { bottom: { style: BorderStyle.SINGLE, size: 8, color: MED_BLUE } },
children: [new TextRun({
text,
bold: true,
color: MED_BLUE,
size: 24,
font: "Calibri",
})],
});
}
function heading3(text) {
return new Paragraph({
spacing: { before: 160, after: 60 },
children: [new TextRun({
text,
bold: true,
color: DARK_BLUE,
size: 22,
font: "Calibri",
underline: { type: UnderlineType.SINGLE, color: MED_BLUE },
})],
});
}
function body(text, { bold = false, italic = false, color = BLACK, indent = 0 } = {}) {
return new Paragraph({
spacing: { after: 60 },
indent: { left: indent },
children: [new TextRun({ text, bold, italic, color, size: 20, font: "Calibri" })],
});
}
function bullet(text, { level = 0, bold = false, color = BLACK } = {}) {
return new Paragraph({
bullet: { level },
spacing: { after: 40 },
indent: { left: 360 + level * 360, hanging: 360 },
children: [new TextRun({ text, bold, color, size: 20, font: "Calibri" })],
});
}
function checkItem(label, subtext = "") {
return new Paragraph({
spacing: { after: 50 },
indent: { left: 360, hanging: 360 },
children: [
new TextRun({ text: "☐ ", bold: true, size: 20, font: "Calibri", color: MED_BLUE }),
new TextRun({ text: label, bold: true, size: 20, font: "Calibri" }),
...(subtext ? [new TextRun({ text: " — " + subtext, size: 20, font: "Calibri", color: "595959", italic: true })] : []),
],
});
}
function question(q) {
return new Paragraph({
spacing: { after: 50 },
indent: { left: 720 },
children: [
new TextRun({ text: "▶ ", size: 20, font: "Calibri", color: MED_BLUE }),
new TextRun({ text: q, size: 20, font: "Calibri", italic: true, color: "404040" }),
],
});
}
function blankField(label, lines = 1) {
const lineText = "_".repeat(55);
return new Paragraph({
spacing: { after: 80 },
children: [
new TextRun({ text: label + ": ", bold: true, size: 20, font: "Calibri", color: DARK_BLUE }),
new TextRun({ text: lineText, size: 20, font: "Calibri", color: "AAAAAA" }),
],
});
}
function spacer(n = 1) {
return new Paragraph({ spacing: { after: 80 * n }, children: [new TextRun("")] });
}
function noteBox(text, color = LIGHT_BLUE) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
margins: { top: 80, bottom: 80, left: 100, right: 100 },
borders: {
top: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE },
bottom: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE },
left: { style: BorderStyle.THICK, size: 16, color: MED_BLUE },
right: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE },
},
rows: [
new TableRow({
children: [
new TableCell({
shading: { type: ShadingType.SOLID, color },
children: [new Paragraph({
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 19, font: "Calibri", italic: true, color: "1F3864" })]
})],
}),
],
}),
],
});
}
function redBox(text) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.THICK, size: 16, color: ACCENT_RED },
bottom: { style: BorderStyle.THICK, size: 16, color: ACCENT_RED },
left: { style: BorderStyle.THICK, size: 16, color: ACCENT_RED },
right: { style: BorderStyle.THICK, size: 16, color: ACCENT_RED },
},
rows: [
new TableRow({
children: [
new TableCell({
shading: { type: ShadingType.SOLID, color: "FFF0F0" },
children: [new Paragraph({
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 19, font: "Calibri", bold: true, color: ACCENT_RED })]
})],
}),
],
}),
],
});
}
function twoColTable(rows, headerRow = null) {
const tableRows = [];
if (headerRow) {
tableRows.push(new TableRow({
tableHeader: true,
children: headerRow.map(h => new TableCell({
shading: { type: ShadingType.SOLID, color: MED_BLUE },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: h, bold: true, color: WHITE, size: 20, font: "Calibri" })]
})]
}))
}));
}
rows.forEach((row, i) => {
tableRows.push(new TableRow({
children: row.map((cell, ci) => new TableCell({
shading: { type: ShadingType.SOLID, color: i % 2 === 0 ? WHITE : LIGHT_GRAY },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
spacing: { before: 40, after: 40 },
indent: { left: 80 },
children: [new TextRun({ text: cell, size: 19, font: "Calibri", bold: ci === 0 })]
})]
}))
}));
});
return new Table({ width: { size: 100, type: WidthType.PERCENTAGE }, rows: tableRows });
}
function sectionDivider(label) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE }, insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE } },
rows: [
new TableRow({
children: [
new TableCell({
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
children: [new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 80, after: 80 },
children: [new TextRun({ text: label.toUpperCase(), bold: true, color: WHITE, size: 22, font: "Calibri", characterSpacing: 100 })]
})]
})
]
})
]
});
}
// ── Title page ────────────────────────────────────────────────────────────────
function titlePage() {
return [
spacer(2),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.THICK, size: 24, color: DARK_BLUE },
bottom: { style: BorderStyle.THICK, size: 24, color: DARK_BLUE },
left: { style: BorderStyle.THICK, size: 24, color: DARK_BLUE },
right: { style: BorderStyle.THICK, size: 24, color: DARK_BLUE },
},
rows: [
new TableRow({
children: [new TableCell({
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
children: [
new Paragraph({ spacing: { before: 200, after: 80 }, alignment: AlignmentType.CENTER, children: [new TextRun({ text: "DIABETES MELLITUS", bold: true, color: WHITE, size: 44, font: "Calibri" })] }),
new Paragraph({ spacing: { before: 40, after: 40 }, alignment: AlignmentType.CENTER, children: [new TextRun({ text: "& Associated Diseases", bold: false, color: "B8D3EE", size: 32, font: "Calibri" })] }),
new Paragraph({ spacing: { before: 80, after: 40 }, alignment: AlignmentType.CENTER, children: [new TextRun({ text: "─────────────────────────────────", color: MED_BLUE, size: 20, font: "Calibri" })] }),
new Paragraph({ spacing: { before: 40, after: 40 }, alignment: AlignmentType.CENTER, children: [new TextRun({ text: "COMPREHENSIVE HISTORY-TAKING MEDICAL RECORD", bold: true, color: WHITE, size: 26, font: "Calibri", characterSpacing: 60 })] }),
new Paragraph({ spacing: { before: 40, after: 200 }, alignment: AlignmentType.CENTER, children: [new TextRun({ text: "For Medical Students & Clinicians", italic: true, color: "B8D3EE", size: 22, font: "Calibri" })] }),
]
})]
})
]
}),
spacer(2),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "Based on: Harrison's Principles of Internal Medicine 22nd Ed. (2025) | Goldman-Cecil Medicine | Tintinalli's Emergency Medicine | Firestein & Kelley's Rheumatology | Campbell's Operative Orthopaedics", size: 17, font: "Calibri", italic: true, color: "595959" })]
}),
spacer(1),
new Paragraph({ children: [new PageBreak()] }),
];
}
// ═══════════════════════════════════════════════════════════════════════════════
// DOCUMENT BUILD
// ═══════════════════════════════════════════════════════════════════════════════
const doc = new Document({
numbering: {
config: [{
reference: "bullet-list",
levels: [{ level: 0, format: "bullet", text: "•", alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 360, hanging: 260 } } } }]
}]
},
sections: [{
properties: { page: { margin: { top: 900, bottom: 900, left: 1080, right: 1080 } } },
headers: {
default: new Header({
children: [new Paragraph({
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE } },
alignment: AlignmentType.RIGHT,
children: [new TextRun({ text: "DM Comprehensive History-Taking Medical Record | ", size: 16, font: "Calibri", color: "595959" }), new TextRun({ children: [PageNumber.CURRENT], size: 16, font: "Calibri", color: MED_BLUE })]
})]
})
},
footers: {
default: new Footer({
children: [new Paragraph({
border: { top: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE } },
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "Harrison's 22nd Ed. (2025) | Goldman-Cecil | Tintinalli's EM | Firestein & Kelley's Rheumatology | Campbell's Operative Orthopaedics", size: 15, font: "Calibri", color: "808080" })]
})]
})
},
children: [
// ── TITLE PAGE ────────────────────────────────────────────────────────
...titlePage(),
// ══════════════════════════════════════════════════════════════════════
// PART A — ADMINISTRATIVE / BIODATA
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART A — PATIENT BIODATA & ADMINISTRATIVE INFORMATION"),
spacer(),
heading2("A1. Patient Identification"),
blankField("Full Name"),
blankField("Date of Birth / Age"),
blankField("Sex"),
blankField("Ethnicity / Race"),
blankField("National ID / Hospital Number"),
blankField("Date of Consultation / Admission"),
blankField("Ward / Clinic"),
spacer(),
heading2("A2. Occupation & Social Context"),
blankField("Occupation"),
blankField("Marital Status"),
blankField("Address"),
blankField("Next of Kin / Emergency Contact"),
blankField("Informant (who gave history?)"),
blankField("Reliability of Informant (Good / Fair / Poor)"),
spacer(),
noteBox("⚠ Why occupation matters: shift workers have disrupted circadian rhythms worsening glycaemic control; sedentary workers have greater insulin resistance; drivers must be screened for hypoglycaemia unawareness."),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART B — CHIEF COMPLAINT
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART B — CHIEF COMPLAINT"),
spacer(),
heading2("B1. Chief Complaint (in patient's own words)"),
noteBox("▶ Ask: \"What brings you here today?\" — Do NOT suggest symptoms. Write verbatim."),
spacer(),
blankField("Chief Complaint"),
blankField("Duration of Complaint"),
spacer(),
heading2("B2. Is the Patient Newly Diagnosed or Known Diabetic?"),
checkItem("Newly presenting — establish diagnosis, classify type, assess baseline"),
checkItem("Known diabetic — assess glycaemic control, complications, current treatment"),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART C — HISTORY OF PRESENTING ILLNESS
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART C — HISTORY OF PRESENTING ILLNESS (HPI)"),
spacer(),
heading2("C1. Symptoms of Hyperglycaemia — The 'Polys' + More"),
noteBox("Use SOCRATES for each symptom: Site · Onset · Character · Radiation · Associations · Time course · Exacerbating/Relieving factors · Severity"),
spacer(),
heading3("Polyuria (Excessive Urination)"),
checkItem("Frequency of urination per day"),
question("\"How many times do you urinate in a day?\""),
checkItem("Nocturia — waking at night to urinate"),
question("\"Do you wake up at night to urinate? How many times?\""),
question("\"Do ants appear where you urinate?\" (classical sign of glycosuria)"),
blankField("Polyuria details"),
spacer(),
heading3("Polydipsia (Excessive Thirst)"),
checkItem("Unusual or excessive thirst"),
question("\"Do you feel unusually thirsty compared to before?\""),
question("\"How many litres of fluid do you drink daily?\""),
question("\"Does drinking relieve the thirst only briefly?\""),
blankField("Polydipsia details"),
spacer(),
heading3("Polyphagia (Excessive Hunger)"),
checkItem("Increased appetite or hunger soon after eating"),
question("\"Is your appetite increased? Do you feel hungry soon after a full meal?\""),
blankField("Polyphagia details"),
spacer(),
heading3("Weight Changes"),
checkItem("Unexplained weight loss (common in T1DM and uncontrolled T2DM)"),
checkItem("Weight gain (insulin therapy, T2DM with metabolic syndrome)"),
question("\"Have you lost or gained weight without trying?\""),
question("\"How much weight? Over what period of time?\""),
blankField("Weight change (amount / duration)"),
spacer(),
heading3("Fatigue, Weakness & Other Symptoms"),
checkItem("Fatigue / tiredness — present even at rest?"),
checkItem("General weakness in arms or legs"),
checkItem("Blurred vision — one or both eyes? Constant or fluctuating?"),
question("\"Has your vision changed recently? Is it worse when your blood sugar is high?\""),
checkItem("Recurrent infections — skin, genital (candidiasis), urinary tract"),
question("\"Do you get frequent infections — itching, discharge, or burning in the genital area?\""),
checkItem("Slow wound healing — cuts or sores taking longer than usual"),
question("\"Do wounds or sores heal slowly or refuse to close?\""),
blankField("Other symptoms / narrative"),
spacer(),
heading2("C2. Onset and Mode of Presentation"),
twoColTable([
["Sudden onset (days to weeks) + DKA symptoms", "Suggests Type 1 DM or Insulin-deficient T2DM"],
["Gradual onset (months to years) + obesity + family history", "Suggests Type 2 DM"],
["Young, non-obese, strong family history", "Consider MODY (Maturity-Onset DM of Youth)"],
["Steroid use / recent illness / pancreatic surgery", "Consider Secondary DM"],
["Pregnancy", "Consider Gestational DM"],
], ["Clinical Clue", "Type Suggested"]),
spacer(),
heading2("C3. Acute Decompensation Screen — Rule Out Emergencies FIRST"),
redBox("⚠ SCREEN FOR THESE BEFORE CONTINUING — ANY POSITIVE REQUIRES URGENT ACTION"),
spacer(),
checkItem("Nausea, vomiting, abdominal pain, fruity/acetone breath → SUSPECT DKA"),
question("\"Do you have nausea, vomiting, or stomach pain?\" \"Has anyone noticed a fruity smell on your breath?\""),
checkItem("Extreme thirst, confusion, drowsiness, no ketones → SUSPECT HHS (Hyperosmolar Hyperglycaemic State)"),
question("\"Are you more confused than usual? Has anyone noticed you seem drowsy or disoriented?\""),
checkItem("Sweating, shaking, palpitations, confusion, hunger → SUSPECT HYPOGLYCAEMIA"),
question("\"Do you feel shaky, sweaty, or confused, especially if you missed a meal?\""),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART D — GLYCAEMIC CONTROL HISTORY
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART D — GLYCAEMIC CONTROL HISTORY"),
spacer(),
heading2("D1. Diagnosis and Duration"),
blankField("When was DM first diagnosed?"),
blankField("How was it discovered? (routine test / symptoms / complication)"),
blankField("Type of DM (T1 / T2 / Gestational / MODY / Secondary)"),
spacer(),
heading2("D2. Monitoring"),
checkItem("Self-monitoring of blood glucose (SMBG) at home?"),
question("\"Do you check your blood sugar at home using a glucometer?\""),
question("\"How often do you check?\""),
blankField("Typical fasting morning blood glucose (mmol/L or mg/dL)"),
blankField("Typical 2-hour post-meal blood glucose"),
blankField("Most recent HbA1c result and date"),
spacer(),
heading2("D3. Hypoglycaemia Episodes"),
checkItem("History of low blood sugar episodes?"),
question("\"Have you ever had episodes of feeling shaky, sweaty, confused, or very hungry?\""),
blankField("Frequency of hypoglycaemia (times per week/month)"),
checkItem("Severity — mild (self-treated) / severe (needed help from others)"),
checkItem("Hypoglycaemia unawareness — has patient LOST warning signs?"),
question("\"Do you still feel warning signs (sweating, shakiness) before your sugar goes low?\""),
noteBox("⚠ CRITICAL: Hypoglycaemia unawareness dramatically increases the risk of severe episodes. Report to supervisor immediately. This patient MUST NOT drive until reviewed."),
blankField("Hypoglycaemia details / frequency / unawareness (Y/N)"),
spacer(),
heading2("D4. Previous Hospital Admissions for DM"),
checkItem("DKA episodes — how many? Most recent?"),
checkItem("HHS (diabetic coma) — how many? Most recent?"),
checkItem("Hypoglycaemia requiring emergency services or hospital?"),
blankField("Admission history details"),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART E — COMPLICATIONS SCREENING
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART E — COMPLICATIONS SCREENING (Systematic by System)"),
spacer(),
noteBox("Tell the patient: \"I am now going to ask about different parts of your body to make sure everything is being checked carefully.\""),
spacer(),
heading2("E1. 👁 Eyes — Diabetic Retinopathy"),
checkItem("Change in vision — blurring, dark spots, floaters, flashes"),
question("\"Has your vision changed recently? Do you see floaters or flashing lights?\""),
checkItem("Sudden loss of vision in one or both eyes"),
question("\"Have you ever had a sudden loss of vision?\""),
checkItem("Previous fundoscopy / retinal screening — when, where, result?"),
question("\"Has a doctor ever examined the back of your eyes with a special instrument?\""),
checkItem("Laser treatment or eye injections (anti-VEGF) for retinopathy?"),
checkItem("Diplopia (double vision) — may indicate diabetic mononeuropathy of CN III, IV, VI"),
blankField("Eye complaint details / last fundoscopy date"),
spacer(),
heading2("E2. 🫘 Kidneys — Diabetic Nephropathy"),
checkItem("Foamy or frothy urine (proteinuria)"),
question("\"Have you noticed your urine becoming foamy or bubbly?\""),
checkItem("Ankle, leg, or periorbital swelling (oedema from hypoalbuminaemia)"),
question("\"Do your ankles or feet swell? Do you notice swelling around your eyes in the morning?\""),
checkItem("Told kidneys are not working properly / low eGFR"),
checkItem("Any history of dialysis or kidney transplant?"),
question("\"Have you ever been on dialysis? Have doctors told you to restrict your fluid or protein intake?\""),
blankField("Renal complaint details / last eGFR / last urine ACR"),
spacer(),
heading2("E3. 🦶 Feet & Lower Limbs — Neuropathy + Peripheral Arterial Disease"),
heading3("Peripheral Neuropathy"),
checkItem("Numbness, tingling, or burning sensation in feet or hands"),
question("\"Do you feel tingling, numbness, or a burning pain in your feet or hands?\""),
question("\"Is the pain or tingling worse at night?\""),
checkItem("\"Feels like walking on cotton wool, sand, or wearing thick socks\""),
checkItem("Loss of ability to feel heat, cold, or sharp objects in feet"),
question("\"Can you feel the difference between hot and cold water on your feet?\""),
checkItem("Falls or loss of balance due to sensory loss"),
heading3("Peripheral Arterial Disease"),
checkItem("Calf or thigh pain when walking that goes away with rest (claudication)"),
question("\"Do you get pain in your calves when you walk a certain distance, that disappears when you stop?\""),
checkItem("Rest pain (pain even when not walking — indicates severe ischaemia)"),
heading3("Foot Ulcers and Charcot"),
checkItem("Current or previous foot ulcers / wounds not healing"),
question("\"Do you have any sores or wounds on your feet that are not healing?\""),
checkItem("Previous foot surgeries or amputations"),
checkItem("Swollen, hot, red foot without pain (Charcot foot — emergency)"),
checkItem("Does the patient check their own feet daily?"),
checkItem("Type of footwear — ill-fitting shoes, no socks, barefoot walking?"),
blankField("Foot complaint details / last foot exam date"),
spacer(),
heading2("E4. ❤️ Cardiovascular — Macrovascular Disease"),
checkItem("Chest pain, pressure, or tightness — at rest or on exertion?"),
question("\"Do you have chest pain or tightness, especially when climbing stairs or walking fast?\""),
question("\"Diabetics can have silent heart attacks without chest pain — do you feel unusually short of breath or very tired with exertion?\""),
checkItem("Shortness of breath on exertion or lying flat (orthopnoea — heart failure)"),
checkItem("Palpitations or irregular heartbeat"),
checkItem("Previous heart attack, angina, coronary stenting, or bypass surgery"),
checkItem("Previous stroke or TIA (sudden weakness, speech difficulty, facial droop)"),
checkItem("Leg swelling and breathlessness together (heart failure)"),
blankField("Cardiovascular complaint details"),
spacer(),
heading2("E5. 🧠 Nervous System — Autonomic Neuropathy"),
checkItem("Postural dizziness / lightheadedness when standing up (orthostatic hypotension)"),
question("\"Do you feel dizzy or faint when you stand up from sitting or lying?\""),
checkItem("Early satiety — feeling full very quickly after a small amount of food (gastroparesis)"),
question("\"Do you feel very full after eating just a small meal? Do you have nausea or vomiting after eating?\""),
checkItem("Bloating, upper abdominal discomfort after meals"),
checkItem("Alternating constipation and diarrhoea (diabetic enteric neuropathy)"),
question("\"Are your bowels unpredictable — sometimes very constipated, sometimes loose?\""),
checkItem("Difficulty starting urination, incomplete bladder emptying (diabetic cystopathy)"),
question("\"Do you have to strain to pass urine or feel like your bladder never fully empties?\""),
checkItem("Erectile dysfunction — ask sensitively and privately (male patients)"),
question("\"[Private setting] Do you experience any difficulty with erections?\""),
checkItem("Reduced sweating in feet / excessive sweating elsewhere (gustatory sweating)"),
checkItem("Falls due to postural hypotension"),
blankField("Autonomic neuropathy details"),
spacer(),
heading2("E6. 🦴 Musculoskeletal Complications"),
checkItem("Hand stiffness — unable to press palms flat together (cheiroarthropathy / Prayer sign)"),
question("\"Do you have difficulty fully straightening or flattening your fingers?\""),
checkItem("Shoulder stiffness or pain — difficulty raising arm above head (frozen shoulder / adhesive capsulitis)"),
question("\"Do you have difficulty raising your arm or rotating your shoulder?\""),
checkItem("Thickened cords or nodules in the palm with finger contracture (Dupuytren's)"),
checkItem("Locking or triggering of fingers when bending and straightening (trigger finger)"),
checkItem("Numbness or tingling in thumb, index, and middle fingers — worse at night (CTS)"),
checkItem("Proximal thigh weakness and pain — asymmetric (diabetic amyotrophy)"),
question("\"Do you have severe pain and weakness in one thigh that came on over weeks?\""),
blankField("MSK complaint details"),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART F — PAST MEDICAL HISTORY
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART F — PAST MEDICAL HISTORY"),
spacer(),
heading2("F1. Comorbid Conditions (tick all that apply and record year of diagnosis)"),
twoColTable([
["Hypertension", "Year: _______ Controlled? Y / N"],
["Dyslipidaemia (high cholesterol / triglycerides)", "Year: _______ On statin? Y / N"],
["Coronary artery disease / Angina / Previous MI", "Year: _______ Stented / CABG? Y / N"],
["Heart failure", "Year: _______ EF known? ____"],
["Stroke / TIA", "Year: _______ Any residual deficit?"],
["Peripheral arterial disease", "Year: _______ ABI known? ____"],
["Chronic kidney disease (CKD)", "Year: _______ Stage: ____ eGFR: ____"],
["Diabetic retinopathy", "Year: _______ Laser / injection treatment? Y / N"],
["Peripheral neuropathy", "Year: _______ On treatment? Y / N"],
["Thyroid disease (hypothyroid / hyperthyroid)", "Year: _______ On thyroxine? Y / N"],
["NAFLD / NASH (fatty liver)", "Year: _______ Biopsy done? Y / N"],
["Sleep apnoea (OSA)", "Year: _______ On CPAP? Y / N"],
["PCOS (polycystic ovary syndrome)", "Year: _______ (Women only)"],
["Gestational diabetes", "Year: _______ Which pregnancy?"],
["Pancreatitis / pancreatic surgery", "Year: _______ Details: ______"],
["Previous foot ulcer / amputation", "Year: _______ Level: ______"],
["Previous surgery (any)", "Year: _______ Type: ______"],
["Other autoimmune disease (coeliac, Addison's, thyroiditis)", "Details: ______"],
], ["Condition", "Details"]),
spacer(),
heading2("F2. Hospitalisations Related to Diabetes"),
blankField("Hospital admission history"),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART G — DRUG & TREATMENT HISTORY
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART G — DRUG & TREATMENT HISTORY"),
spacer(),
heading2("G1. Current Diabetes Medications"),
twoColTable([
["Metformin", "Dose: ___mg Frequency: ___ Compliant? Y/N"],
["Sulfonylurea (gliclazide / glibenclamide)", "Dose: ___mg Frequency: ___ Compliant? Y/N"],
["SGLT2 inhibitor (empagliflozin / dapagliflozin)", "Dose: ___mg Frequency: ___ Compliant? Y/N"],
["GLP-1 agonist (semaglutide / liraglutide)", "Dose: ___mg Frequency: ___ Compliant? Y/N"],
["DPP-4 inhibitor (sitagliptin / vildagliptin)", "Dose: ___mg Frequency: ___ Compliant? Y/N"],
["Thiazolidinedione (pioglitazone)", "Dose: ___mg Frequency: ___ Compliant? Y/N"],
["Basal insulin (glargine / detemir / degludec)", "Dose: ___units Time: ___ Site: ___"],
["Short-acting insulin (aspart / lispro / regular)", "Dose: ___units Meals: ___ Site: ___"],
["Mixed insulin (70/30, biphasic)", "Dose: ___units Frequency: ___ Site: ___"],
], ["Drug Class", "Details / Dose / Compliance"]),
spacer(),
heading2("G2. Other Medications"),
twoColTable([
["ACE inhibitor / ARB (renoprotective)", "Name: _____ Dose: _____"],
["Antihypertensive (other)", "Name: _____ Dose: _____"],
["Statin (cholesterol)", "Name: _____ Dose: _____"],
["Antiplatelet / Aspirin", "Dose: _____"],
["Diuretic (water tablet)", "Name: _____ — NOTE: worsens glycaemia"],
["Corticosteroids (prednisolone, dexamethasone)", "Name: _____ — NOTE: causes steroid hyperglycaemia"],
["Antipsychotics (olanzapine, clozapine)", "Name: _____ — NOTE: cause insulin resistance"],
["Thyroid medication (thyroxine)", "Dose: _____"],
["Beta-blocker (masks hypoglycaemia symptoms)", "Name: _____"],
["Herbal / traditional medicine", "Details: _____"],
], ["Medication", "Details / Notes"]),
spacer(),
heading2("G3. Allergies"),
blankField("Drug allergies (name of drug and reaction)"),
blankField("Food / other allergies"),
spacer(),
heading2("G4. Compliance Assessment"),
checkItem("Does the patient take medications every day?"),
question("\"Do you ever miss doses? If yes — how often and why?\""),
checkItem("Reason for non-compliance: cost / side effects / forgetfulness / denial?"),
checkItem("Insulin technique — correct injection sites? Rotating sites? Storing insulin correctly?"),
question("\"Where do you inject your insulin? Do you rotate the injection sites?\""),
checkItem("Lipohypertrophy — firm nodules at injection sites causing erratic absorption?"),
blankField("Compliance details"),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART H — FAMILY HISTORY
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART H — FAMILY HISTORY"),
spacer(),
twoColTable([
["Father", "DM? ___ HTN? ___ CVD? ___ Other: ___ Status: Alive/Deceased"],
["Mother", "DM? ___ HTN? ___ CVD? ___ Other: ___ Status: Alive/Deceased"],
["Sibling 1", "DM? ___ HTN? ___ CVD? ___ Other: ___"],
["Sibling 2", "DM? ___ HTN? ___ CVD? ___ Other: ___"],
["Grandparents", "DM? ___ HTN? ___ CVD? ___ Other: ___"],
["Children", "DM? ___ HTN? ___ Other: ___"],
], ["Relation", "Relevant Medical History"]),
spacer(),
noteBox("Strong family history of T2DM + obesity = insulin resistance trait. Family history of T1DM in first-degree relative increases risk ~5–10%. Early CVD in first-degree male relative (<55 yrs) or female relative (<65 yrs) = major independent cardiovascular risk factor."),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART I — SOCIAL HISTORY
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART I — SOCIAL HISTORY"),
spacer(),
heading2("I1. Smoking"),
checkItem("Current smoker?"),
question("\"Do you smoke cigarettes, roll-your-own, or use any tobacco products?\""),
blankField("Cigarettes per day"),
blankField("Years of smoking"),
blankField("Pack-years = (cigarettes per day ÷ 20) × years"),
checkItem("Ex-smoker — when did they stop?"),
checkItem("Non-smoker — confirm"),
noteBox("Smoking doubles cardiovascular risk in diabetes, impairs wound healing, and worsens peripheral arterial disease. Cessation is a top priority in every DM patient."),
spacer(),
heading2("I2. Alcohol"),
checkItem("Does the patient drink alcohol?"),
question("\"Do you drink alcohol? What type? How many drinks per week?\""),
blankField("Type of alcohol / units per week"),
noteBox("Alcohol can cause hypoglycaemia (especially with insulin or sulfonylurea) by inhibiting hepatic gluconeogenesis. It also raises triglycerides and blood pressure. Ask about binge drinking."),
spacer(),
heading2("I3. Diet Assessment"),
checkItem("Typical daily meal pattern — breakfast, lunch, dinner, snacks?"),
question("\"Can you describe what you usually eat from morning to bedtime?\""),
checkItem("Amount of high-GI carbohydrates: white rice, bread, noodles, sugar, sweet drinks?"),
question("\"How much rice, bread, or sugary drinks do you consume daily?\""),
checkItem("Meal regularity — does the patient skip meals?"),
checkItem("Following a diabetic diet or dietitian advice?"),
checkItem("Fruit and vegetable intake?"),
blankField("Dietary summary"),
spacer(),
heading2("I4. Physical Activity"),
checkItem("Any regular exercise?"),
question("\"How active are you during the day? Do you do any planned exercise?\""),
blankField("Type of exercise"),
blankField("Frequency (days per week)"),
blankField("Duration (minutes per session)"),
noteBox("Regular aerobic exercise reduces HbA1c by approximately 0.6% independently of diet. Target: 150 min/week of moderate activity (brisk walking, swimming)."),
spacer(),
heading2("I5. Occupation and Daily Routine"),
checkItem("Nature of work — sedentary / physical / shift work?"),
question("\"Do you work night shifts?\" (disrupts circadian rhythm and glycaemic control)"),
checkItem("Does the patient drive? — CRITICAL for hypoglycaemia risk counselling"),
question("\"Do you drive a car or operate machinery?\" (Inform patient of DVLA/driving authority rules for DM)"),
blankField("Occupation details"),
spacer(),
heading2("I6. Social Support and Socioeconomic Factors"),
checkItem("Living situation — alone / with family / in care facility?"),
checkItem("Financial capability to afford medications, glucose strips, insulin?"),
question("\"Are you able to afford all your diabetes medications and testing supplies?\""),
checkItem("Social support — someone at home who can help if hypoglycaemia occurs?"),
checkItem("Health literacy — does the patient understand their disease and treatment?"),
blankField("Social support details"),
spacer(),
heading2("I7. Reproductive History (Women of Childbearing Age)"),
checkItem("Currently pregnant or planning pregnancy?"),
question("\"Are you pregnant or planning to become pregnant in the near future?\""),
noteBox("ADA recommends HbA1c <6.5% (48 mmol/mol) before conception to minimise congenital malformation risk. All women of childbearing age must be counselled about this."),
checkItem("Contraception in use?"),
checkItem("History of gestational diabetes? Which pregnancy? Current status?"),
blankField("Reproductive history details"),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART J — REVIEW OF SYSTEMS
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART J — REVIEW OF SYSTEMS (SYSTEMATIC SCREEN)"),
spacer(),
noteBox("\"I am going to quickly ask about a few other body systems to make sure we haven't missed anything.\""),
spacer(),
twoColTable([
["General", "☐ Fever / night sweats ☐ Unintentional weight change ☐ Fatigue"],
["Skin", "☐ Pruritus / itching ☐ Rashes ☐ Non-healing wounds ☐ Skin discolouration"],
["Head", "☐ Headaches ☐ Dizziness (postural?)"],
["Eyes", "☐ Visual changes ☐ Double vision ☐ Eye pain or redness"],
["ENT", "☐ Oral sores (candidiasis) ☐ Difficulty swallowing ☐ Gum disease"],
["Respiratory", "☐ Cough ☐ Shortness of breath ☐ Snoring / daytime sleepiness (OSA)"],
["Cardiovascular", "☐ Chest pain ☐ Palpitations ☐ Ankle swelling ☐ Orthopnoea"],
["Gastrointestinal", "☐ Nausea / vomiting ☐ Heartburn ☐ Abdominal pain ☐ Bowel changes"],
["Genitourinary", "☐ Foamy urine ☐ Dysuria / frequency ☐ Sexual dysfunction"],
["Musculoskeletal", "☐ Joint stiffness ☐ Shoulder pain ☐ Hand contractures ☐ Foot deformity"],
["Neurological", "☐ Numbness / tingling ☐ Weakness ☐ Falls ☐ Memory problems"],
["Psychiatric", "☐ Low mood / depression ☐ Anxiety ☐ Sleep disturbance"],
["Endocrine", "☐ Cold/heat intolerance (thyroid) ☐ Increased thirst / urination"],
], ["System", "Symptoms — Tick if Positive"]),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART K — CLINICAL EXAMINATION
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART K — CLINICAL EXAMINATION CHECKLIST"),
spacer(),
noteBox("\"I would like to examine you now. I will start from your general appearance. Please tell me if anything is uncomfortable.\" — Always explain what you are doing before you do it."),
spacer(),
heading2("K1. General Examination"),
twoColTable([
["General appearance", "☐ Well / Unwell ☐ Obese / Thin ☐ Cushingoid ☐ Acutely ill"],
["Weight (kg)", ""],
["Height (cm)", ""],
["BMI (kg/m²)", "Target: 18.5–24.9 | Obese: ≥30"],
["Waist circumference", "M: >90 cm (Asian) / >102 cm (Western) F: >80 cm / >88 cm = central obesity"],
["Kussmaul breathing (deep sighing)", "Suggests DKA — URGENT"],
["Fruity / acetone breath odour", "Suggests DKA — URGENT"],
], ["Parameter", "Finding"]),
spacer(),
heading2("K2. Vital Signs"),
twoColTable([
["Blood pressure (right arm)", "mmHg | Target <130/80 (with CKD/CVD) | <140/90 (general)"],
["Blood pressure (left arm)", "mmHg | Difference >10 mmHg = investigate for subclavian stenosis"],
["Orthostatic BP — Supine", "mmHg"],
["Orthostatic BP — Standing 1 min", "mmHg | Drop ≥20 systolic / ≥10 diastolic = autonomic neuropathy"],
["Orthostatic BP — Standing 3 min", "mmHg"],
["Heart rate", "bpm | Resting tachycardia = autonomic neuropathy; irregular = AF (risk in DM)"],
["Respiratory rate", "breaths/min"],
["Temperature", "°C | Fever = suspect infection"],
["SpO2", "%"],
["Blood glucose (capillary)", "mmol/L — document time relative to last meal"],
], ["Vital Sign", "Value / Normal Range / Clinical Significance"]),
spacer(),
heading2("K3. Hands and Upper Limb MSK Examination"),
twoColTable([
["General hand inspection", "☐ Thenar wasting (CTS) ☐ Skin thickening ☐ Colour changes"],
["Prayer sign", "☐ Normal ☐ Positive (gap = cheiroarthropathy / LJM)"],
["Tabletop sign", "☐ Normal ☐ Positive (cannot flatten fingers on table)"],
["Dupuytren's contracture", "☐ Absent ☐ Nodules ☐ Cords ☐ Flexion contracture (ring/little finger)"],
["Trigger finger (tenosynovitis)", "☐ Absent ☐ Click/locking Finger(s): _______"],
["Tinel's sign (tap carpal tunnel)", "☐ Negative ☐ Positive (tingling in median distribution)"],
["Phalen's maneuver (wrist flexion 60s)", "☐ Negative ☐ Positive (paresthesia in median distribution)"],
["Durkan's compression test", "☐ Negative ☐ Positive"],
["Capillary refill", "seconds (Normal: <2 sec)"],
], ["Test", "Finding"]),
spacer(),
heading2("K4. Head, Eyes, Ears, Nose, Throat"),
twoColTable([
["Visual acuity (Snellen chart)", "R: ___/___ L: ___/___"],
["Rubeosis iridis (neovascularisation of iris)", "☐ Absent ☐ Present — URGENT ophthalmology referral"],
["Fundoscopy", "☐ Normal ☐ Microaneurysms ☐ Haemorrhages ☐ Exudates ☐ Neovascularisation"],
["Xanthelasma (periorbital)", "☐ Absent ☐ Present (dyslipidaemia)"],
["Oral candidiasis", "☐ Absent ☐ Present (white plaques — poor glycaemic control)"],
["Gum disease / periodontitis", "☐ Absent ☐ Present (more common in DM)"],
["Thyroid palpation", "☐ Normal ☐ Goitre ☐ Nodule(s)"],
["Carotid bruit", "R: ☐ Present ☐ Absent L: ☐ Present ☐ Absent"],
], ["Area", "Finding"]),
spacer(),
heading2("K5. Cardiovascular Examination"),
twoColTable([
["JVP", "cm H2O — elevated in heart failure"],
["Apex beat", "☐ Normal position ☐ Displaced (cardiomegaly)"],
["Heart sounds", "☐ Normal S1 S2 ☐ S3 (heart failure) ☐ S4 (diastolic dysfunction) ☐ Murmurs"],
["Aortic bruit (abdominal auscultation)", "☐ Absent ☐ Present"],
["Renal bruit (renal artery auscultation)", "☐ Absent ☐ Present"],
["Femoral pulse", "R: ___/2+ L: ___/2+"],
["Popliteal pulse", "R: ___/2+ L: ___/2+"],
["Posterior tibial pulse", "R: ___/2+ L: ___/2+"],
["Dorsalis pedis pulse", "R: ___/2+ L: ___/2+"],
["Ankle-Brachial Index (ABI)", "R: ___ L: ___ (Normal 1.0–1.4; PAD <0.9)"],
], ["Finding", "Result"]),
spacer(),
heading2("K6. Abdominal Examination"),
twoColTable([
["Liver (NAFLD — hepatomegaly)", "☐ Normal ☐ Enlarged ___cm below costal margin ☐ Tender"],
["Renal angle tenderness", "R: ☐ Present ☐ Absent L: ☐ Present ☐ Absent (pyelonephritis risk in DM)"],
["Insulin injection sites", "☐ Normal ☐ Lipohypertrophy (describe site and size)"],
["Generalised oedema (ascites / fluid)", "☐ Absent ☐ Present (renal/cardiac failure)"],
], ["Area", "Finding"]),
spacer(),
heading2("K7. Skin Examination"),
twoColTable([
["Acanthosis nigricans (neck, axillae, groin)", "☐ Absent ☐ Present — indicates insulin resistance"],
["Necrobiosis lipoidica diabeticorum (anterior tibiae)", "☐ Absent ☐ Present (yellow-brown waxy atrophic plaques)"],
["Diabetic dermopathy ('shin spots')", "☐ Absent ☐ Present (bilateral round brown macules on shins)"],
["Eruptive xanthomas", "☐ Absent ☐ Present (yellow papules = severe hypertriglyceridaemia)"],
["Tinea pedis / onychomycosis", "☐ Absent ☐ Present"],
["Lipoatrophy at injection sites", "☐ Absent ☐ Present"],
["Lipohypertrophy at injection sites", "☐ Absent ☐ Present — Site(s): ___________"],
["Non-healing wounds / cellulitis", "☐ Absent ☐ Present — Location: ___________"],
], ["Finding", "Result"]),
spacer(),
heading2("K8. Comprehensive Foot Examination"),
redBox("MANDATORY AT EVERY ENCOUNTER — Remove shoes AND socks. Document every finding precisely."),
spacer(),
heading3("Inspection"),
twoColTable([
["Hallux valgus (bunion)", "R: ☐ Present ☐ Absent L: ☐ Present ☐ Absent"],
["Claw toes / hammer toes / mallet toes", "R: ☐ Present ☐ Absent L: ☐ Present ☐ Absent"],
["Charcot foot (hot, swollen, deformed midfoot)", "R: ☐ Present ☐ Absent L: ☐ Present ☐ Absent — URGENT if present"],
["Calluses (mark high-pressure sites)", "Location: ___________"],
["Ulcers — size, depth, wound base, surrounding tissue", "Location / Dimensions / Depth: ___________"],
["Probe-to-bone test (if ulcer present)", "☐ Negative ☐ Positive — strongly suggests osteomyelitis"],
["Skin condition (dry, cracked, macerated)", "Description: ___________"],
["Interdigital spaces (maceration, fungal)", "☐ Normal ☐ Maceration ☐ Fungal infection"],
["Nails (onychomycosis, ingrown, subungual ulcer)", "Description: ___________"],
["Hair loss on dorsal foot (ischaemia)", "☐ Present ☐ Absent"],
["Skin colour changes (pallor, rubor, cyanosis)", "Description: ___________"],
], ["Finding", "Result"]),
spacer(),
heading3("Neurological Assessment of Foot"),
twoColTable([
["10g monofilament (plantar surface — 10 sites per foot)", "R: ___/10 felt L: ___/10 felt (Loss at any site = LOPS)"],
["128-Hz tuning fork — hallux IP joint", "R: ☐ Present ☐ Absent L: ☐ Present ☐ Absent"],
["128-Hz tuning fork — medial malleolus", "R: ☐ Present ☐ Absent L: ☐ Present ☐ Absent"],
["Pin-prick sensation (dorsum of foot)", "R: ☐ Normal ☐ Reduced ☐ Absent L: ☐ Normal ☐ Reduced ☐ Absent"],
["Temperature discrimination", "R: ☐ Normal ☐ Reduced L: ☐ Normal ☐ Reduced"],
["Proprioception (hallux up/down)", "R: ☐ Normal ☐ Impaired L: ☐ Normal ☐ Impaired"],
["Ankle jerk reflex (S1)", "R: 0/1+/2+/3+ L: 0/1+/2+/3+"],
["Patellar reflex (L3-L4)", "R: 0/1+/2+/3+ L: 0/1+/2+/3+"],
["Capillary refill time (toenail)", "R: ___sec L: ___sec (Normal <2 sec)"],
], ["Assessment", "Result"]),
spacer(),
heading3("Tendon and Joint Assessment"),
twoColTable([
["Achilles tendon — thickening / tightness", "☐ Normal ☐ Tight (equinus) ☐ Thickened"],
["Silfverskiöld test (gastrocnemius vs Achilles equinus)", "Knee extended dorsiflexion: ___° Knee flexed: ___°"],
["Plantar fascia thickening / heel tenderness", "☐ Normal ☐ Tender at calcaneal insertion"],
["Windlass test (passive hallux dorsiflexion)", "☐ Negative ☐ Positive (heel pain reproduced)"],
["Subtalar joint inversion / eversion", "R: ___°/___° L: ___°/___° (Normal: Inv 30°, Ev 15°)"],
["First MTP joint dorsiflexion", "R: ___° L: ___° (Normal: 65–75°)"],
], ["Test", "Finding"]),
spacer(),
heading2("K9. Shoulder Examination (Adhesive Capsulitis Screening)"),
twoColTable([
["Active abduction", "R: ___° L: ___° (Normal 180°)"],
["Active forward flexion", "R: ___° L: ___° (Normal 180°)"],
["Active external rotation", "R: ___° L: ___° (Normal 60–80°) — MOST RESTRICTED in frozen shoulder"],
["Active internal rotation (reach behind back)", "R: reaches T___ L: reaches T___ (Normal T7–T10)"],
["Passive external rotation", "R: ___° L: ___°"],
["Passive abduction", "R: ___° L: ___°"],
["Capsular pattern confirmed?", "☐ Yes (ER > Abduction > IR) ☐ No"],
], ["Movement", "Result"]),
spacer(),
heading2("K10. Proximal Muscle Assessment (Diabetic Amyotrophy Screen)"),
twoColTable([
["Thigh circumference at 15cm above patella", "R: ___cm L: ___cm (>2cm difference = significant wasting)"],
["Hip flexion power (L2-L3, iliopsoas)", "R: MRC ___/5 L: MRC ___/5"],
["Knee extension power (L3-L4, quadriceps)", "R: MRC ___/5 L: MRC ___/5"],
["Hip abduction power (L4-L5, gluteus medius)", "R: MRC ___/5 L: MRC ___/5"],
["Gait observation", "☐ Normal ☐ Trendelenburg ☐ Waddling ☐ Antalgic"],
], ["Assessment", "Result"]),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART L — INVESTIGATIONS
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART L — INVESTIGATIONS"),
spacer(),
heading2("L1. Diagnostic Criteria (ADA) — Confirm or Exclude DM"),
twoColTable([
["Fasting plasma glucose ≥7.0 mmol/L (126 mg/dL)", "Result: _____ mmol/L ☐ Normal ☐ Pre-DM ☐ DM"],
["Random glucose ≥11.1 mmol/L + symptoms", "Result: _____ mmol/L ☐ Normal ☐ DM"],
["2-hr OGTT (75g) ≥11.1 mmol/L", "Result: _____ mmol/L ☐ Normal ☐ IGT ☐ DM"],
["HbA1c ≥48 mmol/mol (≥6.5%)", "Result: _____ mmol/mol (___%) ☐ Normal ☐ Pre-DM ☐ DM"],
], ["Test", "Result"]),
spacer(),
noteBox("Pre-diabetes: FPG 5.6–6.9 mmol/L | 2-hr OGTT 7.8–11.0 mmol/L | HbA1c 39–47 mmol/mol (5.7–6.4%)"),
spacer(),
heading2("L2. Routine Investigations — Record Results"),
twoColTable([
["HbA1c", "Result: _____ Date: _____ Target: <53 mmol/mol (<7%)"],
["Fasting glucose", "Result: _____ Date: _____"],
["Full blood count (FBC)", "Hb: ___ WBC: ___ Plt: ___ (anaemia affects HbA1c interpretation)"],
["eGFR (renal function)", "Result: _____ Stage of CKD: _____ Date: _____"],
["Urea + Creatinine", "Urea: ___ Creatinine: ___ Date: _____"],
["Urine Albumin:Creatinine Ratio (ACR)", "Result: _____ (Normal <3 mg/mmol; Micro: 3–30; Macro: >30) Date: _____"],
["Fasting lipid profile", "Total cholesterol: ___ LDL: ___ HDL: ___ TG: ___ Date: _____"],
["Liver function tests (LFTs)", "ALT: ___ AST: ___ ALP: ___ (NAFLD screening) Date: _____"],
["Thyroid function (TSH, FT4)", "TSH: ___ FT4: ___ Date: _____"],
["Serum electrolytes (Na, K)", "Na: ___ K: ___ (K critical in DKA management)"],
["Uric acid", "Result: ___ (elevated in metabolic syndrome)"],
["12-lead ECG", "☐ Normal sinus rhythm ☐ LVH ☐ Q waves (silent MI) ☐ AF ☐ Other: ___"],
["Urine dipstick / urinalysis", "Glucose: ___ Protein: ___ Ketones: ___ Nitrites: ___ Leucocytes: ___"],
["Blood ketones (if DKA suspected)", "Result: _____ (DKA: >3.0 mmol/L)"],
["C-peptide (if type classification uncertain)", "Result: _____ (Low = T1DM; Normal/High = T2DM)"],
["Anti-GAD antibodies (if T1DM suspected)", "Result: _____"],
], ["Test", "Result / Date / Target"]),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART M — SUMMARY & CLINICAL FORMULATION
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART M — CLINICAL SUMMARY & FORMULATION"),
spacer(),
heading2("M1. Summary Statement"),
noteBox("Template: \"[Name] is a [age]-year-old [sex] with a [duration] history of [chief complaint], presenting with [key symptoms]. Relevant background includes [key risk factors and comorbidities]. Key examination findings include [positive findings]. The most likely diagnosis is [diagnosis].\""),
spacer(),
...Array(8).fill(null).map(() => blankField("")),
spacer(),
heading2("M2. Differential Diagnosis"),
twoColTable([
["1st (Most likely)", ""],
["2nd", ""],
["3rd", ""],
["Important to exclude", ""],
], ["Priority", "Diagnosis"]),
spacer(),
heading2("M3. Problem List"),
body("List each active problem separately:"),
...Array(6).fill(null).map((_, i) => blankField(`Problem ${i+1}`)),
spacer(),
heading2("M4. Management Plan"),
twoColTable([
["Lifestyle", "Diet / Exercise / Weight loss / Smoking cessation"],
["Diabetes pharmacotherapy", "Initiate / Adjust / Continue: ___________"],
["Comorbidity treatment", "Antihypertensive / Statin / Antiplatelet: ___________"],
["Referrals required", "Ophthalmology / Podiatry / Nephrology / Cardiology / Dietitian / Physiotherapy"],
["Patient education", "Hypoglycaemia management / Foot care / SMBG technique / Sick-day rules"],
["Investigations ordered", "___________"],
["Follow-up plan", "Next HbA1c: ___ Next foot exam: ___ Next eye exam: ___"],
], ["Domain", "Plan"]),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART N — RED FLAGS
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART N — RED FLAGS — ACT IMMEDIATELY"),
spacer(),
redBox("⚠ If ANY of the following are present, escalate to a senior immediately."),
spacer(),
twoColTable([
["Kussmaul breathing + fruity breath + vomiting + high glucose", "DIABETIC KETOACIDOSIS (DKA) — EMERGENCY"],
["Extreme thirst + confusion + glucose >33 mmol/L + no ketones", "HYPEROSMOLAR HYPERGLYCAEMIC STATE (HHS) — EMERGENCY"],
["Sweating + shaking + confusion + glucose <3.9 mmol/L", "SEVERE HYPOGLYCAEMIA — EMERGENCY"],
["Sudden, painless vision loss — one or both eyes", "Vitreous haemorrhage / proliferative retinopathy — URGENT ophthalmology"],
["Hot, swollen, red foot — minimal or no pain — in neuropathic patient", "ACUTE CHARCOT FOOT — URGENT — non-weight-bearing + urgent referral"],
["Wound that probes to bone", "OSTEOMYELITIS — URGENT — IV antibiotics + imaging"],
["Cold, pulseless, painful foot + absent pulses + pallor", "CRITICAL LIMB ISCHAEMIA — VASCULAR EMERGENCY"],
["Asymmetric proximal thigh pain + rapid muscle wasting", "DIABETIC AMYOTROPHY — urgent neurology referral"],
["Loss of hypoglycaemia warning signs (unawareness)", "DO NOT DISCHARGE WITHOUT SPECIALIST REVIEW — no driving"],
], ["Clinical Finding", "Action Required"]),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART O — ASSOCIATED DISEASES QUICK REFERENCE
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART O — ASSOCIATED DISEASES: HISTORY QUESTIONS QUICK REFERENCE"),
spacer(),
noteBox("Diabetes mellitus is rarely a solitary disease. Screen for all of the following associated conditions at every consultation."),
spacer(),
twoColTable([
["Hypertension", "\"Have you ever been told your blood pressure is high? Do you take tablets for it? What does your BP run at home?\""],
["Dyslipidaemia", "\"Have you had a cholesterol test? Were you told it was high? Are you on a statin?\""],
["Coronary artery disease", "\"Have you had a heart attack, angina, or stents placed in your heart arteries?\""],
["Heart failure", "\"Do you become breathless lying flat? Do your legs swell?\""],
["Stroke / TIA", "\"Have you ever had sudden weakness on one side of your body, drooping of the face, or difficulty speaking?\""],
["Peripheral arterial disease", "\"Do you get calf pain when walking that stops when you rest?\""],
["Chronic kidney disease", "\"Have you been told your kidneys are not working fully? Do you know your kidney number (eGFR)?\""],
["Diabetic retinopathy", "\"When were your eyes last examined? Has anyone looked at the back of your eye?\""],
["Peripheral neuropathy", "\"Do you have numbness, tingling, or burning in your feet? Worse at night?\""],
["Autonomic neuropathy", "\"Do you feel dizzy standing up? Do you feel full quickly after eating?\""],
["Non-alcoholic fatty liver disease", "\"Have you been told you have fatty liver? Any right upper abdominal discomfort?\""],
["Obstructive sleep apnoea", "\"Do you snore loudly? Has anyone seen you stop breathing during sleep? Are you sleepy in the day?\""],
["Hypothyroidism (co-exists with T1DM)", "\"Do you feel unusually cold, tired, constipated, or have you gained weight without reason?\""],
["Coeliac disease (T1DM)", "\"Do you have diarrhoea, bloating, or weight loss after eating wheat or bread?\""],
["PCOS (women with T2DM)", "\"Are your periods regular? Have you had difficulty conceiving or excess body hair?\""],
["Depression / anxiety", "\"Over the past 2 weeks have you felt low in mood, hopeless, or lost interest in things you used to enjoy?\""],
["Cheiroarthropathy / Dupuytren's", "\"Do you have stiffness or difficulty fully opening or closing your hands?\""],
["Adhesive capsulitis (frozen shoulder)", "\"Do you have pain or stiffness in your shoulder making it hard to raise your arm?\""],
["Charcot arthropathy", "\"Has your foot ever become very swollen, red, and warm without an obvious injury or infection?\""],
["Diabetic amyotrophy", "\"Have you had severe pain followed by weakness and wasting of one thigh over weeks?\""],
["Diffuse idiopathic skeletal hyperostosis (DISH)", "\"Do you have stiffness in your back or neck, especially in the morning or after rest?\""],
["Recurrent infections", "\"Do you get frequent urinary infections, skin infections, or thrush (candida)?\""],
["Erectile dysfunction (men)", "\"[Private — ask sensitively] Do you experience any difficulty with erections?\""],
["Diabetic gastroparesis", "\"Do you have nausea, vomiting, or feeling full very quickly after eating?\""],
], ["Associated Condition", "Key History Question to Ask"]),
spacer(),
new Paragraph({ children: [new PageBreak()] }),
// ══════════════════════════════════════════════════════════════════════
// PART P — HbA1c MONITORING TARGETS
// ══════════════════════════════════════════════════════════════════════
sectionDivider("PART P — HbA1c & MONITORING TARGETS REFERENCE"),
spacer(),
twoColTable([
["Most adults with DM", "<53 mmol/mol (<7.0%)"],
["Older / frail / hypoglycaemia unawareness", "<64 mmol/mol (<8.0%) — relaxed target"],
["Pre-conception (women planning pregnancy)", "<48 mmol/mol (<6.5%) — ADA recommendation"],
["Recent new diagnosis — short disease duration", "<48 mmol/mol (<6.5%) — tight target if safe"],
["Blood pressure target (with CKD/CVD)", "<130/80 mmHg"],
["Blood pressure target (general)", "<140/90 mmHg"],
["LDL cholesterol (high CV risk patient)", "<1.8 mmol/L (<70 mg/dL)"],
["Fasting glucose target", "4.0–7.0 mmol/L (72–126 mg/dL)"],
["2-hr postprandial glucose target", "<10.0 mmol/L (<180 mg/dL)"],
["Time-in-range (CGM target)", ">70% of readings in 3.9–10.0 mmol/L"],
], ["Parameter", "Target"]),
spacer(),
spacer(),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200 },
children: [new TextRun({
text: "End of Diabetes Mellitus Comprehensive History-Taking Medical Record",
bold: true, italic: true, color: DARK_BLUE, size: 20, font: "Calibri"
})]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({
text: "Sources: Harrison's Principles of Internal Medicine 22nd Ed. (2025, McGraw-Hill) | Goldman-Cecil Medicine International Ed. | Tintinalli's Emergency Medicine 9th Ed. | Firestein & Kelley's Textbook of Rheumatology | Campbell's Operative Orthopaedics 15th Ed. (2026)",
size: 16, font: "Calibri", color: "808080", italic: true
})]
}),
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/dm-medical-record/DM_Comprehensive_Medical_Record.docx', buffer);
console.log('Document created successfully.');
});
cd /home/daytona/workspace/dm-medical-record && node create_dm_record.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/dm-medical-record/DM_Comprehensive_Medical_Record.docx 2>&1
python3 -c " from pypdf import PdfReader # Use alternative validation: check the docx opens correctly with pypdf-equivalent docx check import zipfile, os path = '/home/daytona/workspace/dm-medical-record/DM_Comprehensive_Medical_Record.docx' size = os.path.getsize(path) print(f'File size: {size:,} bytes') with zipfile.ZipFile(path, 'r') as z: names = z.namelist() print(f'ZIP entries: {len(names)}') print('Key files:', [n for n in names if 'document' in n or 'style' in n or 'numbering' in n][:10]) print('File is valid ZIP/DOCX structure.') "
DM Comprehensive Medical Record
Word Document · DOCX
| Part | Content |
|---|---|
| A | Patient Biodata & Administrative Information - all identification fields with blank lines |
| B | Chief Complaint - open-ended prompting, newly vs. known DM |
| C | History of Presenting Illness - SOCRATES framework, all "Polys," acute decompensation screen (DKA / HHS / Hypo) with exact questions to ask |
| D | Glycaemic Control History - HbA1c, SMBG, hypoglycaemia frequency, unawareness, DKA admissions |
| E | Complications Screening - 6 systems: Eyes, Kidneys, Feet (neuropathy + PAD + ulcers), Cardiovascular, Autonomic neuropathy, MSK (cheiroarthropathy, frozen shoulder, trigger finger, CTS, amyotrophy) |
| F | Past Medical History - full comorbidity table with year-of-diagnosis fields |
| G | Drug & Treatment History - all diabetes drug classes individually listed, drugs that worsen DM, compliance assessment, insulin technique |
| H | Family History - structured family table |
| I | Social History - smoking (pack-years formula), alcohol, diet, exercise, occupation (shift work / driving), reproductive history |
| J | Review of Systems - 13-system table with tick boxes |
| K | Clinical Examination - 10 subsections: General, Vitals (including orthostatic BP), Hands MSK (Prayer / Tabletop / Tinel's / Phalen's), HEENT (fundoscopy), CVS (all pulses + ABI), Abdomen, Skin (all DM skin signs), Comprehensive Foot Exam (inspection + neuro + tendon + joint), Shoulder ROM, Proximal muscle / amyotrophy |
| L | Investigations - ADA diagnostic criteria with result fields + full annual investigation panel |
| M | Clinical Summary, Differential Diagnosis, Problem List, Management Plan |
| N | Red Flags table - 9 emergencies with specific actions |
| O | Associated Diseases Quick Reference - 25 conditions each with the specific history question to ask |
| P | HbA1c & Monitoring Targets Reference card |
I downloaded document but nothing is there give me again
python3 -c " import zipfile path = '/home/daytona/workspace/dm-medical-record/DM_Comprehensive_Medical_Record.docx' with zipfile.ZipFile(path, 'r') as z: with z.open('word/document.xml') as f: content = f.read().decode('utf-8') print(f'document.xml size: {len(content)} chars') print(content[:2000]) "