Give me a proper case sheet for Abortion case as in above format
ls /home/daytona/workspace/ && ls /home/daytona/skills/docx/scripts/office/ 2>/dev/null || echo "checking scripts"
mkdir -p /home/daytona/workspace/abortion-case-sheet && ls /home/daytona/workspace/abortion-case-sheet
~/abortion-case-sheet/create_case_sheet.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, HeadingLevel, BorderStyle, WidthType, UnderlineType,
PageOrientation, ShadingType
} = require('docx');
const fs = require('fs');
// Helper: underlined bold heading paragraph
function heading(text) {
return new Paragraph({
children: [new TextRun({ text, bold: true, underline: { type: UnderlineType.SINGLE }, size: 22 })],
spacing: { before: 200, after: 80 },
});
}
// Helper: normal paragraph
function para(text, opts = {}) {
return new Paragraph({
children: [new TextRun({ text, size: 20, ...opts })],
spacing: { before: 40, after: 40 },
});
}
// Helper: bold label + normal value inline
function labelVal(label, value) {
return new Paragraph({
children: [
new TextRun({ text: label + ': ', bold: true, size: 20 }),
new TextRun({ text: value, size: 20 }),
],
spacing: { before: 30, after: 30 },
});
}
// Helper: circled item simulation (using ① ② etc) + bold text
function trimesterEntry(num, text) {
const circles = ['①', '②', '③'];
return new Paragraph({
children: [
new TextRun({ text: circles[num - 1] + ' ', bold: true, size: 20 }),
new TextRun({ text, size: 20 }),
],
spacing: { before: 50, after: 50 },
indent: { left: 200 },
});
}
// Helper: bullet
function bullet(text) {
return new Paragraph({
children: [new TextRun({ text: '• ' + text, size: 20 })],
spacing: { before: 30, after: 30 },
indent: { left: 300 },
});
}
// Two-column row helper for patient info table
function twoColRow(l1, v1, l2, v2) {
return new TableRow({
children: [
new TableCell({
children: [new Paragraph({ children: [new TextRun({ text: l1 + ': ', bold: true, size: 20 }), new TextRun({ text: v1, size: 20 })] })],
borders: noBorder(),
width: { size: 50, type: WidthType.PERCENTAGE },
}),
new TableCell({
children: [new Paragraph({ children: [new TextRun({ text: l2 + ': ', bold: true, size: 20 }), new TextRun({ text: v2, size: 20 })] })],
borders: noBorder(),
width: { size: 50, type: WidthType.PERCENTAGE },
}),
],
});
}
function noBorder() {
const b = { style: BorderStyle.NONE, size: 0, color: 'FFFFFF' };
return { top: b, bottom: b, left: b, right: b, insideHorizontal: b, insideVertical: b };
}
const doc = new Document({
sections: [{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 900, right: 720 },
},
},
children: [
// ══════════════════════════════════════
// TITLE
// ══════════════════════════════════════
new Paragraph({
children: [new TextRun({ text: 'Obstetrics Case Presentation', bold: true, underline: { type: UnderlineType.SINGLE }, size: 26 })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 200 },
}),
// ══════════════════════════════════════
// PATIENT BIO-DATA (two-column table)
// ══════════════════════════════════════
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
twoColRow('Name', 'Mrs. Sunita Devi', 'Husband\'s Name', 'Mr. Ramesh Kumar'),
twoColRow('Age', '26 yrs / F', 'Age', '30 yrs'),
twoColRow('Address', 'Rajnagar Colony', 'Sex', 'M'),
twoColRow('Occupation', 'Housewife', 'Blood Group', 'B+ve'),
twoColRow('Education', '10th Std', 'Occupation', 'Labourer'),
twoColRow('Blood Group', 'O+ve', 'LMP', '10/02/25'),
twoColRow('Married for', '4 years', 'EDD', '17/11/25'),
twoColRow('Socioeconomic Status', 'Lower-middle', 'POG', '10 wks + 2 days'),
],
borders: { insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE } },
}),
para(''),
labelVal('Informant', 'Self; Reliability – Good'),
labelVal('Obstetric Score', 'G2P1L1A0'),
// ══════════════════════════════════════
// CHIEF COMPLAINTS
// ══════════════════════════════════════
para(''),
new Paragraph({
children: [
new TextRun({ text: 'C/O: ', bold: true, size: 20 }),
new TextRun({ text: 'G2P1L1A0 with 10 weeks of amenorrhoea is admitted to hospital with complaints of:', size: 20 }),
],
spacing: { before: 100, after: 60 },
}),
bullet('Bleeding per vaginum (PV) since 2 days – mild to moderate, bright red, with passage of clots'),
bullet('Pain in lower abdomen (crampy) since 1 day'),
bullet('No passage of fleshy mass PV'),
bullet('No fever, no urinary complaints'),
// ══════════════════════════════════════
// HISTORY OF PRESENT PREGNANCY
// ══════════════════════════════════════
para(''),
heading('History of Present Pregnancy:'),
trimesterEntry(1, 'Spontaneous conception. UPT positive at 6 weeks of amenorrhoea. Dating scan done – confirmed single intrauterine gestational sac with FHR +ve. No NT scan done as patient presented late. Indirect Coombs test – Negative. ANC profile (CBC, blood group, urine R/E, VDRL, HIV) – within normal limits. Folic acid tablets were taken.'),
para('No h/o easy fatigability, pain abdomen, bleeding PV, fever, rashes, exposure to radiation or drug intake.', { indent: { left: 200 } }),
trimesterEntry(2, 'At 8 weeks of amenorrhoea, patient noticed spotting PV for 2–3 days – was managed conservatively (rest + progesterone). Anomaly scan was not yet due. ANC profile was normal; iron & folic acid tablets continued.'),
para('No h/o pedal edema, epigastric pain, blurring of vision, headache, leaking PV or palpitations.', { indent: { left: 200 } }),
new Paragraph({
children: [
new TextRun({ text: 'Now at 10 weeks', bold: true, size: 20 }),
new TextRun({ text: ': Patient presents with fresh bleeding PV and pain abdomen as described above.', size: 20 }),
],
spacing: { before: 50, after: 50 },
indent: { left: 200 },
}),
// ══════════════════════════════════════
// PAST OBSTETRIC HISTORY
// ══════════════════════════════════════
para(''),
heading('Past Obstetric History:'),
labelVal('Married life', '4 years | Non-consanguineous marriage'),
para(''),
new Paragraph({
children: [new TextRun({ text: '1st Baby:', bold: true, size: 20 })],
spacing: { before: 50, after: 30 },
indent: { left: 200 },
}),
bullet('Boy baby, 2.9 kg BW, 2 years old – Full-term Normal Vaginal Delivery (NVD) at term'),
bullet('No complications; Inj. Anti-D was not required (patient O+ve)'),
new Paragraph({
children: [new TextRun({ text: '2nd Pregnancy (Present):', bold: true, size: 20 })],
spacing: { before: 50, after: 30 },
indent: { left: 200 },
}),
// ══════════════════════════════════════
// PAST HISTORY
// ══════════════════════════════════════
para(''),
heading('Past History:'),
para('No h/o Diabetes mellitus, Hypertension, Tuberculosis, Asthma, Epilepsy, Thyroid disorders.'),
para('No h/o previous blood transfusion.'),
para('No h/o similar episodes of bleeding PV in the past.'),
// ══════════════════════════════════════
// FAMILY HISTORY
// ══════════════════════════════════════
para(''),
heading('Family History:'),
para('No h/o any hereditary illness in the family.'),
para('No h/o any children with congenital malformations.'),
para('No h/o twinning.'),
// ══════════════════════════════════════
// PERSONAL HISTORY
// ══════════════════════════════════════
para(''),
heading('Personal History:'),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
twoColRow('Diet', 'Mixed / Vegetarian', 'Bowel & Bladder', 'Regular'),
twoColRow('Appetite', 'Good', 'Substance Abuse', 'None'),
twoColRow('Sleep', 'Normal', 'Smoking / Alcohol', 'Nil'),
],
borders: { insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE } },
}),
para('No h/o any high-risk behaviour.'),
// ══════════════════════════════════════
// MENSTRUAL HISTORY
// ══════════════════════════════════════
para(''),
heading('Menstrual History:'),
labelVal('LMP', '10/02/25'),
para('Regular cycles. 28-day cycle. 3–4 days flow. No h/o dysmenorrhoea. No h/o passage of clots normally.'),
// ══════════════════════════════════════
// GENERAL PHYSICAL EXAMINATION
// ══════════════════════════════════════
para(''),
heading('General Physical Examination (GPE):'),
para('Patient is conscious, cooperative and well-oriented to time, place and person.'),
para('Patient is moderately built and nourished. Consent was taken.'),
para(''),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
twoColRow('Height', '155 cm', 'BMI', '21.5 kg/m²'),
twoColRow('Weight', '52 kg', 'Pre-pregnancy weight', '50 kg'),
],
borders: { insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE } },
}),
para(''),
heading('Vitals:'),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
twoColRow('Temperature', 'Afebrile', 'Pulse Rate', '88 beats/min'),
twoColRow('RR', '18 breaths/min', 'BP', '110/70 mmHg'),
],
borders: { insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE } },
}),
para(''),
para('Pallor – Mild pallor present'),
para('Icterus – Absent | Clubbing – Absent | Cyanosis – Absent | Lymphadenopathy – Absent'),
para(''),
para('Gait – Normal | Spine – Normal'),
para('Thyroid – Normal | Breast – Normal, no retracted/cracked nipples, no palpable lump'),
para('No dilated veins over neck.'),
para('No signs of nutritional deficiency.'),
// ══════════════════════════════════════
// SYSTEMIC EXAMINATION
// ══════════════════════════════════════
para(''),
heading('Systemic Examination:'),
labelVal('CVS', 'S1, S2 heard; no murmurs'),
labelVal('RS', 'Normal vesicular breath sounds heard'),
labelVal('CNS', 'No focal neurological deficit is present'),
// ══════════════════════════════════════
// P/A EXAMINATION
// ══════════════════════════════════════
para(''),
heading('Per Abdomen (P/A) Examination:'),
new Paragraph({ children: [new TextRun({ text: 'Inspection:', bold: true, underline: { type: UnderlineType.SINGLE }, size: 20 })], spacing: { before: 100, after: 40 } }),
para('Shape of abdomen → Flat, no obvious distension'),
para('Umbilicus – Central and inverted'),
para('Linea nigra and striae gravidarum – Absent (early gestation)'),
para('No scar marks, sinuses or dilated veins'),
para('Hernial orifices – Intact'),
new Paragraph({ children: [new TextRun({ text: 'Palpation:', bold: true, underline: { type: UnderlineType.SINGLE }, size: 20 })], spacing: { before: 100, after: 40 } }),
para('Uterus not palpable abdominally (10 weeks POG – uterus is still a pelvic organ)'),
para('No hepatosplenomegaly. No tenderness.'),
para('No guarding or rigidity.'),
new Paragraph({ children: [new TextRun({ text: 'Percussion:', bold: true, underline: { type: UnderlineType.SINGLE }, size: 20 })], spacing: { before: 100, after: 40 } }),
para('Tympanitic note all over abdomen.'),
new Paragraph({ children: [new TextRun({ text: 'Auscultation:', bold: true, underline: { type: UnderlineType.SINGLE }, size: 20 })], spacing: { before: 100, after: 40 } }),
para('Bowel sounds – Present, Normal'),
para('FHS – Not audible by Doppler at this gestation (FHR to be confirmed on USG)'),
// ══════════════════════════════════════
// PER SPECULUM EXAMINATION
// ══════════════════════════════════════
para(''),
heading('Per Speculum (P/S) Examination:'),
para('Cervix – Slightly dilated external os (≈ 1–2 cm), bright red blood and clots seen coming from os.'),
para('No cervical erosion, no discharge.'),
para('Vaginal walls – Normal.'),
// ══════════════════════════════════════
// PER VAGINAL EXAMINATION
// ══════════════════════════════════════
para(''),
heading('Per Vaginal (P/V) Examination:'),
para('Cervix – Soft, slightly open internal os.'),
para('Uterus – Anteverted, enlarged corresponding to ~10 weeks size, slightly tender.'),
para('No adnexal mass or tenderness.'),
para('Fornices – Free and non-tender.'),
// ══════════════════════════════════════
// SUMMARY
// ══════════════════════════════════════
para(''),
heading('Summary:'),
new Paragraph({
children: [new TextRun({ text: 'A 26-year-old G2P1L1A0, at 10 weeks + 2 days POG, with spontaneous conception, married to O+ve husband; presented with bleeding PV and pain abdomen for 2 days. USG findings awaited. Patient is currently hemodynamically stable with mild pallor. P/S shows slightly open os with active bleeding, and P/V reveals a bulky tender uterus corresponding to 10 weeks size. No features suggestive of ectopic pregnancy or sepsis at present. Being evaluated for Threatened / Incomplete Abortion.', size: 20 })],
spacing: { before: 80, after: 80 },
}),
// ══════════════════════════════════════
// PROVISIONAL DIAGNOSIS
// ══════════════════════════════════════
para(''),
new Paragraph({
children: [new TextRun({ text: 'Provisional Diagnosis:', bold: true, underline: { type: UnderlineType.SINGLE }, size: 22 })],
spacing: { before: 200, after: 80 },
}),
new Paragraph({
children: [new TextRun({ text: 'A 26-year-old G2P1L1A0, at 10 weeks + 2 days POG with Rh+ve pregnancy, with single intrauterine pregnancy, presenting with bleeding PV and pain abdomen – ', size: 20 }), new TextRun({ text: 'Incomplete Abortion', bold: true, size: 20 }), new TextRun({ text: ' (rule out Threatened Abortion).', size: 20 })],
spacing: { before: 60, after: 60 },
}),
// ══════════════════════════════════════
// INVESTIGATIONS
// ══════════════════════════════════════
para(''),
new Paragraph({
children: [
new TextRun({ text: 'Ix', bold: true, size: 20 }),
new TextRun({ text: ': Complete Blood Profile:', bold: true, size: 20 }),
],
spacing: { before: 160, after: 60 },
}),
bullet('CBC (Hb, PCV, TLC, DLC, Platelets)'),
bullet('Blood grouping & Rh typing of patient and husband'),
bullet('Urine Routine / Microscopy'),
bullet('Serum β-hCG (quantitative)'),
bullet('Serum progesterone'),
bullet('Coagulation profile (PT, aPTT, INR) – if heavy bleeding'),
bullet('USG abdomen & pelvis (Transvaginal/Transabdominal) – to assess:'),
new Paragraph({ children: [new TextRun({ text: ' – Viability of fetus (FHR), gestational sac integrity, POG confirmation', size: 20 })], spacing: { before: 20, after: 20 }, indent: { left: 500 } }),
new Paragraph({ children: [new TextRun({ text: ' – Rule out retained products of conception (RPOC)', size: 20 })], spacing: { before: 20, after: 20 }, indent: { left: 500 } }),
new Paragraph({ children: [new TextRun({ text: ' – Rule out ectopic pregnancy', size: 20 })], spacing: { before: 20, after: 20 }, indent: { left: 500 } }),
bullet('DCT (Direct Coombs test) if Rh-negative'),
bullet('Inj. Anti-D if required (Rh-negative patient)'),
],
}],
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/abortion-case-sheet/Abortion_Case_Sheet.docx', buffer);
console.log('Done: Abortion_Case_Sheet.docx created');
});
cd /home/daytona/workspace/abortion-case-sheet && node create_case_sheet.js 2>&1
python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/abortion-case-sheet/Abortion_Case_Sheet.docx 2>&1
cd /home/daytona/workspace/abortion-case-sheet && python3 -c "import zipfile; z = zipfile.ZipFile('Abortion_Case_Sheet.docx'); print('Valid ZIP with files:', z.namelist()[:5])" 2>&1
Abortion Case Sheet
Word Document · DOCX
| Name: Mrs. Sunita Devi | Husband's Name: Mr. Ramesh Kumar |
| Age: 26 yrs / F | Age: 30 yrs |
| Blood Group: O+ve | Blood Group: B+ve |
| LMP: 10/02/25 | EDD: 17/11/25 |
| POG: 10 wks + 2 days | Obs. Score: G2P1L1A0 |
Give HOPI and weight and height
How to top up