~/drug-info-forms/generate_forms.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, BorderStyle, WidthType, VerticalAlign, HeadingLevel,
PageBreak, ShadingType
} = require('docx');
const fs = require('fs');
// ─── Helper: thin border ─────────────────────────────────────────────────────
const thinBorder = {
top: { style: BorderStyle.SINGLE, size: 4, color: "1F3864" },
bottom: { style: BorderStyle.SINGLE, size: 4, color: "1F3864" },
left: { style: BorderStyle.SINGLE, size: 4, color: "1F3864" },
right: { style: BorderStyle.SINGLE, size: 4, color: "1F3864" },
};
const noBorder = {
top: { style: BorderStyle.NONE, size: 0, color: "FFFFFF" },
bottom: { style: BorderStyle.NONE, size: 0, color: "FFFFFF" },
left: { style: BorderStyle.NONE, size: 0, color: "FFFFFF" },
right: { style: BorderStyle.NONE, size: 0, color: "FFFFFF" },
};
function cell(text, opts = {}) {
const { bold = false, shaded = false, colspan = 1, align = AlignmentType.LEFT, width } = opts;
return new TableCell({
columnSpan: colspan,
width: width ? { size: width, type: WidthType.DXA } : { size: 100, type: WidthType.AUTO },
shading: shaded ? { type: ShadingType.SOLID, color: "D6E4F7", fill: "D6E4F7" } : undefined,
borders: thinBorder,
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: align,
children: [new TextRun({ text, bold, size: 18, font: "Calibri", color: "1F3864" })]
})]
});
}
function labeledCell(label, value, bold_label = true) {
return new TableCell({
borders: thinBorder,
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
children: [
new TextRun({ text: label + ": ", bold: bold_label, size: 18, font: "Calibri", color: "1F3864" }),
new TextRun({ text: value, size: 18, font: "Calibri", color: "000000" })
]
})]
});
}
function sectionHeader(text) {
return new TableRow({
children: [new TableCell({
columnSpan: 4,
borders: thinBorder,
shading: { type: ShadingType.SOLID, color: "1F3864", fill: "1F3864" },
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text, bold: true, size: 20, font: "Calibri", color: "FFFFFF" })]
})]
})]
});
}
function subHeader(text) {
return new TableRow({
children: [new TableCell({
columnSpan: 4,
borders: thinBorder,
shading: { type: ShadingType.SOLID, color: "D6E4F7", fill: "D6E4F7" },
children: [new Paragraph({
children: [new TextRun({ text, bold: true, size: 18, font: "Calibri", color: "1F3864" })]
})]
})]
});
}
function infoRow(pairs) {
// pairs = [{label, value}, ...] up to 4 cols
return new TableRow({
children: pairs.map(p => labeledCell(p.label, p.value))
});
}
function fullRow(label, value) {
return new TableRow({
children: [new TableCell({
columnSpan: 4,
borders: thinBorder,
children: [new Paragraph({
children: [
new TextRun({ text: label + ": ", bold: true, size: 18, font: "Calibri", color: "1F3864" }),
new TextRun({ text: value, size: 18, font: "Calibri", color: "000000" })
]
})]
})]
});
}
function blankRow(label, lines = 1) {
const paras = [];
paras.push(new Paragraph({
children: [new TextRun({ text: label + ": ", bold: true, size: 18, font: "Calibri", color: "1F3864" })]
}));
for (let i = 0; i < lines; i++) {
paras.push(new Paragraph({ children: [new TextRun({ text: " ", size: 18 })] }));
}
return new TableRow({
children: [new TableCell({
columnSpan: 4, borders: thinBorder,
children: paras
})]
});
}
function checkboxRow(label, options, checked) {
const runs = [new TextRun({ text: label + ": ", bold: true, size: 18, font: "Calibri", color: "1F3864" })];
options.forEach(opt => {
const isChecked = checked.includes(opt);
runs.push(new TextRun({ text: (isChecked ? "[✓] " : "[ ] ") + opt + " ", size: 18, font: "Calibri", color: "000000" }));
});
return new TableRow({
children: [new TableCell({
columnSpan: 4, borders: thinBorder,
children: [new Paragraph({ children: runs })]
})]
});
}
function answerRow(label, value) {
return new TableRow({
children: [new TableCell({
columnSpan: 4, borders: thinBorder,
children: [
new Paragraph({ children: [new TextRun({ text: label + ":", bold: true, size: 18, font: "Calibri", color: "1F3864" })] }),
new Paragraph({ children: [new TextRun({ text: value, size: 18, font: "Calibri", color: "000000" })] }),
new Paragraph({ children: [new TextRun({ text: " ", size: 18 })] }),
]
})]
});
}
// ─── Institute header (top of each form) ─────────────────────────────────────
function instituteHeader() {
return [
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "RIFA-HUL MUSLIMEEN EDUCATIONAL TRUST (REGD.)", bold: true, size: 20, font: "Calibri", color: "1F3864" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "FAROOQIA COLLEGE OF PHARMACY", bold: true, size: 28, font: "Calibri", color: "1F3864" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "DEPARTMENT OF CLINICAL PHARMACY", bold: true, size: 22, font: "Calibri", color: "1F3864" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "Approved by Pharmacy Council of India & AICTE, New Delhi. Affiliated to Rajiv Gandhi University of Health Sciences, Bangalore", size: 16, font: "Calibri", color: "555555" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 120 },
children: [new TextRun({ text: "DRUG INFORMATION REQUEST & DOCUMENTATION FORM", bold: true, size: 24, font: "Calibri", color: "1F3864", underline: {} })]
}),
];
}
// ─── Build one complete form ──────────────────────────────────────────────────
function buildForm(f) {
const tableRows = [
// Sl No / Date / Time
new TableRow({ children: [
labeledCell("Sl No", f.slNo),
labeledCell("Date", f.date),
labeledCell("Time", f.time),
labeledCell("Mode of Request", f.modeOfRequest),
]}),
// Enquirer details
new TableRow({ children: [
labeledCell("Name of Enquirer", f.enquirer, true),
labeledCell("Designation", f.designation, true),
labeledCell("Phone No", f.phone, true),
labeledCell("Unit", f.unit, true),
]}),
// Professional status
checkboxRow("Professional Status",
["Physician","Surgeon","Resident","PG's","Interns","Pharmacist","Nurse","Others"],
[f.profStatus]),
// Answer needed
checkboxRow("Answer Needed",
["Immediately","Within 2-4 hrs","Within 1-2 days","Others"],
[f.answerNeeded]),
// Signature
new TableRow({ children: [new TableCell({
columnSpan: 4, borders: thinBorder,
children: [new Paragraph({ children: [new TextRun({ text: "Signature: .............................", size: 18, font: "Calibri", color: "1F3864" })] })]
})]}),
// Details of enquiry
subHeader("Details of Enquiry"),
fullRow("Details", f.enquiryDetails),
// Question category
subHeader("Question Category"),
checkboxRow("Select Category",
["Drug Therapy","Indications","Efficacy","Pharmacokinetics/Pharmacodynamics",
"Dosage/Administration","ADR","Interaction","Contraindications",
"Pregnancy/Lactation","Poisoning","Stability","Identification",
"Incompatability","Cost/Availability","Others"],
[f.questionCategory]),
// Purpose
checkboxRow("Purpose of Enquiry",
["Update knowledge","Better patient care","Others"],
[f.purpose]),
// Patient details
new TableRow({ children: [
labeledCell("Age (yrs)", f.age),
labeledCell("Weight (Kgs)", f.weight),
labeledCell("Sex", f.sex),
labeledCell("Allergies", f.allergies),
]}),
fullRow("Current Medical Problem", f.medicalProblem),
fullRow("Hepatic/Renal Function", f.hepaticRenal),
fullRow("Pregnancy/Lactation", f.pregnancyLactation),
fullRow("Other Important Investigations", f.investigations),
fullRow("Drug Therapy (Current)", f.drugTherapy),
// Answer section
sectionHeader("ANSWER / INFORMATION PROVIDED"),
checkboxRow("Answer Given",
["Immediately","Within 2-4 hrs","Within 1-2 days","Within a day"],
[f.answerGiven]),
blankRow("Delay for Answer (If any)", 1),
checkboxRow("Mode of Reply",
["Written","Verbal","Both","Printed Literature","Others"],
[f.modeOfReply]),
answerRow("Information Provided", f.informationProvided),
// References
subHeader("References"),
fullRow("Textbook", f.refTextbook),
fullRow("Journals", f.refJournals),
fullRow("Website", f.refWebsite),
blankRow("Follow Up", 1),
new TableRow({ children: [new TableCell({
columnSpan: 4, borders: thinBorder,
children: [
new Paragraph({ children: [new TextRun({ text: "Name & Signature of Attending Pharmacist: ___________________________", size: 18, font: "Calibri", color: "1F3864" })] }),
new Paragraph({ children: [new TextRun({ text: "Date: " + f.date, size: 18, font: "Calibri", color: "1F3864" })] }),
]
})]}),
];
const table = new Table({
width: { size: 9500, type: WidthType.DXA },
borders: thinBorder,
rows: tableRows,
});
return [...instituteHeader(), table];
}
// ─── 10 FORMS DATA ────────────────────────────────────────────────────────────
const forms = [
// 1. Drug Therapy — Metformin
{
slNo: "001", date: "13/07/2026", time: "08:00 AM", modeOfRequest: "Direct",
enquirer: "Dr. Ravi Shankar", designation: "Physician", phone: "9876543210", unit: "Medicine Ward",
profStatus: "Physician", answerNeeded: "Immediately",
enquiryDetails: "Query regarding drug therapy choice for newly diagnosed Type 2 Diabetes Mellitus patient with BMI 32.",
questionCategory: "Drug Therapy",
purpose: "Better patient care",
age: "48", weight: "84", sex: "M", allergies: "None known",
medicalProblem: "Type 2 Diabetes Mellitus (newly diagnosed), Obesity (BMI 32)",
hepaticRenal: "Normal",
pregnancyLactation: "N/A",
investigations: "FBS: 196 mg/dL, HbA1c: 8.2%, Lipid profile: borderline",
drugTherapy: "Nil (newly diagnosed)",
answerGiven: "Immediately", modeOfReply: "Written",
informationProvided: "Metformin is the first-line drug of choice for Type 2 DM, especially in obese patients. It works by decreasing hepatic glucose production (gluconeogenesis), reducing intestinal glucose absorption, and improving peripheral insulin sensitivity. It does NOT cause weight gain — an advantage in this obese patient. Starting dose: 500 mg twice daily with meals, titrated gradually up to 2000 mg/day. It does not cause hypoglycemia as monotherapy. Vitamin B12 levels should be monitored with long-term use. Contraindicated in eGFR <30 mL/min and acute illness with risk of dehydration.",
refTextbook: "Katzung's Basic & Clinical Pharmacology 16th Ed; Harrison's Principles of Internal Medicine 22E",
refJournals: "ADA Standards of Medical Care in Diabetes 2024, Diabetes Care 47:S1",
refWebsite: "www.diabetes.org",
},
// 2. Indications — Warfarin
{
slNo: "002", date: "13/07/2026", time: "09:15 AM", modeOfRequest: "Ward Rounds",
enquirer: "Dr. Priya Nair", designation: "Resident", phone: "9845001234", unit: "Cardiology",
profStatus: "Resident", answerNeeded: "Within 2-4 hrs",
enquiryDetails: "Indications for warfarin therapy in patient with atrial fibrillation and prosthetic heart valve.",
questionCategory: "Indications",
purpose: "Better patient care",
age: "62", weight: "70", sex: "F", allergies: "Aspirin (GI intolerance)",
medicalProblem: "Atrial Fibrillation (non-valvular), Mechanical Mitral Valve Replacement (2021)",
hepaticRenal: "Normal hepatic function; Creatinine 1.1 mg/dL",
pregnancyLactation: "N/A (post-menopausal)",
investigations: "INR: 1.8, ECG: Atrial fibrillation with controlled ventricular rate",
drugTherapy: "Digoxin 0.25 mg OD, Bisoprolol 5 mg OD",
answerGiven: "Within 2-4 hrs", modeOfReply: "Both",
informationProvided: "Warfarin is indicated in: (1) Mechanical prosthetic heart valves — mandatory lifelong anticoagulation; target INR 2.5–3.5 for mitral mechanical valves. (2) Atrial fibrillation — to prevent thromboembolism and stroke (CHA2DS2-VASc score should guide dosing). (3) DVT & Pulmonary Embolism treatment. (4) Antiphospholipid syndrome. For this patient, given mechanical mitral valve + AF, warfarin remains the gold standard (NOACs are contraindicated with mechanical valves). Target INR: 2.5–3.5. INR must be monitored regularly (every 1–4 weeks once stable).",
refTextbook: "Lippincott Illustrated Reviews Pharmacology; Braunwald's Heart Disease 12th Ed",
refJournals: "Circulation 2021 ACC/AHA Guideline for Diagnosis and Management of Atrial Fibrillation",
refWebsite: "www.acc.org",
},
// 3. Efficacy — Omeprazole
{
slNo: "003", date: "13/07/2026", time: "10:30 AM", modeOfRequest: "Phone",
enquirer: "Dr. Suresh Kumar", designation: "Surgeon", phone: "9900112233", unit: "Surgical Ward",
profStatus: "Surgeon", answerNeeded: "Within 2-4 hrs",
enquiryDetails: "Efficacy of omeprazole vs pantoprazole for prevention of NSAID-induced gastric ulcers in post-operative patient.",
questionCategory: "Efficacy",
purpose: "Better patient care",
age: "55", weight: "68", sex: "M", allergies: "None",
medicalProblem: "Post-operative (Hip arthroplasty); Osteoarthritis on chronic NSAIDs",
hepaticRenal: "Normal",
pregnancyLactation: "N/A",
investigations: "Endoscopy: gastric mucosal erythema, no active ulcer",
drugTherapy: "Diclofenac 75 mg BD, Calcium supplements",
answerGiven: "Within 2-4 hrs", modeOfReply: "Written",
informationProvided: "Proton Pump Inhibitors (PPIs) are the most effective agents for NSAID-induced gastroprotection. Omeprazole 20 mg OD reduces the risk of gastric ulcer by ~80% in NSAID users. Multiple RCTs confirm PPIs (omeprazole, pantoprazole, esomeprazole) are superior to H2 blockers and misoprostol for prevention. Pantoprazole has fewer CYP450 interactions and may be preferred in patients on clopidogrel. Both omeprazole and pantoprazole achieve >90% acid suppression when taken 30 mins before meals. Recommendation: Continue omeprazole 20 mg OD (or pantoprazole 40 mg OD) for the duration of NSAID therapy.",
refTextbook: "Textbook of Family Medicine 9e; Yamada's Textbook of Gastroenterology 7th Ed",
refJournals: "Gastroenterology 2009;137:1047; Cochrane Review: PPIs for NSAID gastroprotection",
refWebsite: "www.gastro.org",
},
// 4. Pharmacokinetics/Pharmacodynamics — Amlodipine
{
slNo: "004", date: "13/07/2026", time: "11:00 AM", modeOfRequest: "Direct",
enquirer: "Dr. Kavitha Rao", designation: "PG (MD Pharmacology)", phone: "9731567890", unit: "Clinical Pharmacology",
profStatus: "PG's", answerNeeded: "Within 1-2 days",
enquiryDetails: "Detailed pharmacokinetics and pharmacodynamics of amlodipine in hypertensive patient with renal impairment.",
questionCategory: "Pharmacokinetics/Pharmacodynamics",
purpose: "Update knowledge",
age: "58", weight: "72", sex: "F", allergies: "None",
medicalProblem: "Hypertension (Stage II), Chronic Kidney Disease (Stage 3b)",
hepaticRenal: "eGFR: 32 mL/min/1.73m2; Creatinine: 2.1 mg/dL; Normal LFT",
pregnancyLactation: "N/A",
investigations: "BP: 158/96 mmHg, Urine protein: +2",
drugTherapy: "Telmisartan 80 mg OD",
answerGiven: "Within 1-2 days", modeOfReply: "Written",
informationProvided: "Amlodipine — Pharmacokinetics: Oral bioavailability: 60–65%; Tmax: 6–12 hrs; Protein binding: ~98%; Volume of distribution: 21 L/kg; Metabolism: Hepatic (CYP3A4) to inactive metabolites; Half-life: 30–50 hours (allows once-daily dosing); Excretion: Mainly renal (60% as metabolites), 10% unchanged. Renal impairment: Pharmacokinetics NOT significantly altered — dose adjustment NOT required in renal impairment, making it ideal for CKD patients. Pharmacodynamics: Blocks L-type calcium channels in vascular smooth muscle → vasodilation → reduced peripheral vascular resistance → BP reduction. Also reduces cardiac afterload. Onset: 24–48 hrs; Max effect: 6–9 hrs after dose.",
refTextbook: "Katzung's Basic & Clinical Pharmacology 16th Ed; Lippincott Illustrated Reviews Pharmacology",
refJournals: "Br J Clin Pharmacol 1988;26:21–28",
refWebsite: "www.accesspharmacy.com",
},
// 5. Dosage/Administration — Amoxicillin
{
slNo: "005", date: "13/07/2026", time: "12:00 PM", modeOfRequest: "Ward Rounds",
enquirer: "Sr. Anitha Mathew", designation: "Nurse", phone: "8890123456", unit: "Paediatric Ward",
profStatus: "Nurse", answerNeeded: "Immediately",
enquiryDetails: "Correct dosage and route of administration of amoxicillin for 6-year-old child with community-acquired pneumonia.",
questionCategory: "Dosage/Administration",
purpose: "Better patient care",
age: "6", weight: "20", sex: "M", allergies: "None",
medicalProblem: "Community-Acquired Pneumonia (CAP), mild-moderate severity",
hepaticRenal: "Normal",
pregnancyLactation: "N/A",
investigations: "CXR: Right lower lobe infiltrate; WBC: 14,000/mm3; CRP elevated",
drugTherapy: "Paracetamol 250 mg PRN",
answerGiven: "Immediately", modeOfReply: "Verbal",
informationProvided: "Amoxicillin dosage in Community-Acquired Pneumonia (Paediatric): Standard dose: 40–90 mg/kg/day divided every 8 hours (oral route preferred for mild-moderate CAP). For this 20 kg child: 40 mg/kg/day = 800 mg/day → approx. 250–300 mg every 8 hours (oral suspension 250 mg/5 mL). Severe CAP: IV amoxicillin 50 mg/kg/day divided every 6–8 hours. Duration: 5–7 days for mild-moderate CAP. Amoxicillin is well-absorbed orally (bioavailability ~80%), widely distributed, excreted renally. Absorption is NOT significantly affected by food. Reconstituted suspension must be stored in refrigerator and used within 14 days.",
refTextbook: "Jawetz Melnick & Adelberg's Medical Microbiology 28E; BNF for Children",
refJournals: "Pediatrics 2011;128(6):e1543; WHO Pocket Book of Hospital Care for Children",
refWebsite: "www.who.int/publications",
},
// 6. ADR — Warfarin
{
slNo: "006", date: "13/07/2026", time: "01:30 PM", modeOfRequest: "Direct",
enquirer: "Dr. Arjun Reddy", designation: "Pharmacist", phone: "9988776655", unit: "Medicine OPD",
profStatus: "Pharmacist", answerNeeded: "Immediately",
enquiryDetails: "Adverse drug reactions of warfarin — patient presenting with unusual bruising and blood in urine.",
questionCategory: "ADR",
purpose: "Better patient care",
age: "70", weight: "65", sex: "M", allergies: "Penicillin (rash)",
medicalProblem: "Atrial Fibrillation, Hypertension",
hepaticRenal: "Mild hepatic dysfunction (ALT: 68 IU/L); Creatinine: 1.4 mg/dL",
pregnancyLactation: "N/A",
investigations: "INR: 5.8 (target 2.0–3.0), Haematuria on urine routine",
drugTherapy: "Warfarin 5 mg OD, Amlodipine 5 mg OD, Amiodarone 200 mg OD",
answerGiven: "Immediately", modeOfReply: "Both",
informationProvided: "Warfarin ADRs — Major: (1) BLEEDING — most common and serious: haematuria, ecchymosis, epistaxis, GI haemorrhage, intracranial haemorrhage (life-threatening). This patient's INR of 5.8 indicates supratherapeutic anticoagulation with active haematuria. (2) Skin necrosis (rare, days 3–5 of therapy). (3) 'Purple toe syndrome' (cholesterol emboli). (4) Teratogenicity in pregnancy (first trimester). Interaction Alert: AMIODARONE inhibits CYP2C9 (warfarin's metabolism enzyme) → significantly increases INR. This explains the supratherapeutic INR. Management: Withhold warfarin, monitor INR daily, consider Vitamin K1 if INR >8 or active bleeding. Reduce warfarin dose by 30–50% when co-administered with amiodarone.",
refTextbook: "Harrison's Principles of Internal Medicine 22E; Lippincott Illustrated Reviews Pharmacology",
refJournals: "Chest 2012;141(2 Suppl):e531S; Tietz Textbook of Laboratory Medicine 7th Ed",
refWebsite: "www.uptodate.com",
},
// 7. Drug Interaction — Atorvastatin
{
slNo: "007", date: "13/07/2026", time: "02:45 PM", modeOfRequest: "Phone",
enquirer: "Dr. Meena Pillai", designation: "Resident", phone: "9123456789", unit: "Cardiology OPD",
profStatus: "Resident", answerNeeded: "Within 2-4 hrs",
enquiryDetails: "Potential drug interactions of atorvastatin in patient newly started on HIV antiretroviral therapy.",
questionCategory: "Interaction",
purpose: "Better patient care",
age: "38", weight: "58", sex: "F", allergies: "None",
medicalProblem: "HIV infection (CD4: 250/mm3), Hypercholesterolaemia, Hypertension",
hepaticRenal: "Normal",
pregnancyLactation: "N/A",
investigations: "LDL: 198 mg/dL, TC: 260 mg/dL, Viral Load: 45,000 copies/mL",
drugTherapy: "Tenofovir 300 mg OD, Emtricitabine 200 mg OD, Ritonavir 100 mg OD (booster)",
answerGiven: "Within 2-4 hrs", modeOfReply: "Written",
informationProvided: "Atorvastatin — Drug Interactions with ART: (1) Ritonavir (CYP3A4 inhibitor) significantly increases atorvastatin plasma levels (up to 5–10x) → risk of myopathy and rhabdomyolysis. (2) Lopinavir/ritonavir: Atorvastatin AUC increases by ~450%. (3) Grapefruit juice (>1 litre/day): Also increases plasma atorvastatin via CYP3A4 inhibition. RECOMMENDATION: Atorvastatin is CONTRAINDICATED with lopinavir/ritonavir. If atorvastatin must be used with other PIs, limit dose to 10 mg/day with careful monitoring of CK levels. PREFERRED ALTERNATIVES: Pravastatin (not metabolised by CYP3A4) or Pitavastatin (least DDI, preferred in HIV patients). Monitor: CK, LFTs, muscle symptoms.",
refTextbook: "Braunwald's Heart Disease 12th Ed; Katzung's Basic & Clinical Pharmacology 16th Ed",
refJournals: "Fuster & Hurst's The Heart 15th Ed — TABLE: Statin DDI with ART",
refWebsite: "www.hiv-druginteractions.org",
},
// 8. Contraindications — Methotrexate
{
slNo: "008", date: "13/07/2026", time: "03:30 PM", modeOfRequest: "Direct",
enquirer: "Dr. Sunita Bhatt", designation: "Physician", phone: "9876001122", unit: "Rheumatology",
profStatus: "Physician", answerNeeded: "Within 1-2 days",
enquiryDetails: "Contraindications to methotrexate therapy in a patient with rheumatoid arthritis and significant comorbidities.",
questionCategory: "Contraindications",
purpose: "Better patient care",
age: "45", weight: "55", sex: "F", allergies: "Sulfonamides",
medicalProblem: "Rheumatoid Arthritis (active, erosive), CKD Stage 2, Alcohol use (3 units/day)",
hepaticRenal: "ALT: 85 IU/L (elevated); eGFR: 55 mL/min; Creatinine: 1.3 mg/dL",
pregnancyLactation: "Pre-menopausal; planning pregnancy in 1 year",
investigations: "RF positive, Anti-CCP: 180 IU/mL, CXR: Normal",
drugTherapy: "NSAIDs PRN, Prednisolone 5 mg OD",
answerGiven: "Within 1-2 days", modeOfReply: "Written",
informationProvided: "Methotrexate (MTX) ABSOLUTE CONTRAINDICATIONS: (1) PREGNANCY — highly teratogenic (neural tube defects, craniofacial abnormalities, limb defects); must be stopped at least 3–6 months before conception in both male and female patients. (2) Breastfeeding/Lactation. (3) Severe renal impairment (eGFR <30 mL/min) — MTX is renally excreted; toxicity risk. RELATIVE CONTRAINDICATIONS in this patient: (a) Elevated LFTs (ALT >3x ULN) — MTX is hepatotoxic; pre-existing hepatic injury is a contraindication. (b) Alcohol use — potentiates hepatotoxicity; must stop alcohol. (c) Active infections, pulmonary disease (risk of MTX pneumonitis). (d) Planning pregnancy within 1 year — must defer MTX. RECOMMENDATION: MTX is currently CONTRAINDICATED for this patient. Alternative DMARDs: Hydroxychloroquine or Sulfasalazine (avoid in sulfonamide allergy → caution) until comorbidities resolved.",
refTextbook: "Dermatology 2-Volume Set 5th Ed; Yamada's Textbook of Gastroenterology 7th Ed",
refJournals: "ACR Guidelines for RA Management 2021; Ann Rheum Dis 2022;81:787",
refWebsite: "www.rheumatology.org",
},
// 9. Pregnancy/Lactation — Insulin
{
slNo: "009", date: "13/07/2026", time: "04:15 PM", modeOfRequest: "Ward Rounds",
enquirer: "Dr. Fatima Hussain", designation: "Interns", phone: "8765432109", unit: "Obstetrics & Gynaecology",
profStatus: "Interns", answerNeeded: "Immediately",
enquiryDetails: "Safety and use of insulin therapy in gestational diabetes mellitus — are oral agents safe during pregnancy?",
questionCategory: "Pregnancy/Lactation",
purpose: "Better patient care",
age: "30", weight: "78", sex: "F", allergies: "None",
medicalProblem: "Gestational Diabetes Mellitus (GDM) — diagnosed at 26 weeks gestation",
hepaticRenal: "Normal",
pregnancyLactation: "Yes — 26 weeks pregnant (G2P1)",
investigations: "OGTT: 2-hr glucose 172 mg/dL; FBS 106 mg/dL; HbA1c: 6.8%; Urine glucose: 1+",
drugTherapy: "Folic acid, Iron supplements, Calcium",
answerGiven: "Immediately", modeOfReply: "Both",
informationProvided: "INSULIN IN PREGNANCY — Safety: Insulin does NOT cross the placenta and is the SAFEST and most effective treatment for GDM when diet and exercise fail. Both NPH insulin and rapid-acting analogs (aspart, lispro) are considered safe in pregnancy. Intensive insulin therapy prior to and during pregnancy reduces fetal malformations, macrosomia, and neonatal morbidity. Insulin lispro and aspart are FDA Category B in pregnancy. ORAL HYPOGLYCAEMICS: Metformin — crosses the placenta; increasingly used for GDM but insulin preferred in many guidelines. Glibenclamide — crosses the placenta; neonatal hypoglycaemia risk; NOT preferred. RECOMMENDATION: Start insulin therapy (NPH 0.3 units/kg/day as starting dose) with glucose monitoring. Target: FBS <95 mg/dL, 2-hr post-prandial <120 mg/dL. LACTATION: Insulin is safe during breastfeeding. Metformin in small amounts in breast milk — generally considered safe.",
refTextbook: "Harrison's Principles of Internal Medicine 22E; Washington Manual of Medical Therapeutics",
refJournals: "ADA Standards of Medical Care in Diabetes 2024; NEJM 2018;379:2241",
refWebsite: "www.diabetes.org",
},
// 10. Poisoning — Paracetamol (Acetaminophen)
{
slNo: "010", date: "13/07/2026", time: "05:00 PM", modeOfRequest: "Phone",
enquirer: "Dr. Samuel Thomas", designation: "Physician", phone: "9090909090", unit: "Emergency/Casualty",
profStatus: "Physician", answerNeeded: "Immediately",
enquiryDetails: "Emergency management protocol for paracetamol (acetaminophen) overdose in young adult brought to casualty.",
questionCategory: "Poisoning",
purpose: "Better patient care",
age: "24", weight: "62", sex: "M", allergies: "None",
medicalProblem: "Deliberate self-harm — ingested approximately 25 tablets of Paracetamol 500 mg (12.5 g total) ~3 hours ago",
hepaticRenal: "Unknown at presentation",
pregnancyLactation: "N/A",
investigations: "Paracetamol level: 220 mcg/mL at 3 hrs (above Rumack-Matthew nomogram treatment line); LFT: Pending; PT/INR: Pending",
drugTherapy: "Nil regular medications",
answerGiven: "Immediately", modeOfReply: "Verbal",
informationProvided: "PARACETAMOL OVERDOSE MANAGEMENT: Mechanism of toxicity: At toxic doses (>150 mg/kg or >7.5 g adults), hepatic glutathione is depleted → NAPQI accumulates → centrilobular hepatic necrosis. TREATMENT: (1) N-ACETYLCYSTEINE (NAC) — antidote of choice; replenishes glutathione. IV regimen: 150 mg/kg in 200 mL D5W over 60 min → 50 mg/kg over 4 hrs → 100 mg/kg over 16 hrs (Prescott IV protocol). Oral: 140 mg/kg loading, then 70 mg/kg every 4 hrs x 17 doses. Most effective if given within 8–10 hours of ingestion. (2) ACTIVATED CHARCOAL 50 g orally within 1–2 hours of ingestion if patient conscious. (3) Monitor LFTs, PT/INR, creatinine, blood glucose every 12 hours. (4) Assess with Rumack-Matthew nomogram using paracetamol level vs time post-ingestion. (5) King's College criteria for liver transplant if fulminant hepatic failure develops. This patient (220 mcg/mL at 3 hrs) is ABOVE treatment threshold — START NAC IMMEDIATELY.",
refTextbook: "ROSEN's Emergency Medicine 10th Ed; Sleisenger & Fordtran's GI and Liver Disease",
refJournals: "Comprehensive Clinical Nephrology 7th Ed; Wong A & Graudins A: Simplified 3-bag IV NAC, Clin Toxicol 2016",
refWebsite: "www.toxbase.org; www.emedicine.medscape.com",
},
];
// ─── Build document ───────────────────────────────────────────────────────────
const sections = [];
forms.forEach((f, idx) => {
const content = buildForm(f);
if (idx < forms.length - 1) {
content.push(new Paragraph({ children: [new PageBreak()] }));
}
sections.push(...content);
});
const doc = new Document({
sections: [{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 900, right: 900 },
}
},
children: sections,
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/drug-info-forms/Drug_Information_Forms_10.docx', buffer);
console.log('Document created successfully!');
}).catch(err => {
console.error('Error:', err);
process.exit(1);
});