Kindly make RBS BP Spo2 PR urine output charting chart with column and rows
mkdir -p /home/daytona/workspace/vitals-chart && ls /home/daytona/workspace/vitals-chart/
~/vitals-chart/create_chart.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, PageOrientation, BorderStyle, WidthType, VerticalAlign,
HeadingLevel, ShadingType
} = require('docx');
const fs = require('fs');
// Time slots every 3 hours for 24 hours
const timeSlots = [
"00:00", "03:00", "06:00", "09:00",
"12:00", "15:00", "18:00", "21:00"
];
const columns = [
"Time",
"RBS\n(mg/dL)",
"BP\nSystolic\n(mmHg)",
"BP\nDiastolic\n(mmHg)",
"SpO2\n(%)",
"PR\n(bpm)",
"Urine Output\n(mL)",
"Remarks"
];
const headerColor = "1F4E79"; // dark blue
const altRowColor = "DEEAF1"; // light blue
const whiteColor = "FFFFFF";
function makeHeaderCell(text) {
return new TableCell({
shading: { type: ShadingType.CLEAR, color: headerColor, fill: headerColor },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 80, bottom: 80, left: 100, right: 100 },
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
children: text.split('\n').map((line, i) =>
new TextRun({
text: line,
bold: true,
color: "FFFFFF",
size: 18,
break: i > 0 ? 1 : 0
})
)
})
]
});
}
function makeDataCell(text = "", fill = whiteColor) {
return new TableCell({
shading: { type: ShadingType.CLEAR, color: fill, fill: fill },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 100, right: 100 },
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text, size: 18 })]
})
]
});
}
// Header row
const headerRow = new TableRow({
tableHeader: true,
children: columns.map(col => makeHeaderCell(col))
});
// Data rows
const dataRows = timeSlots.map((time, i) => {
const fill = i % 2 === 0 ? whiteColor : altRowColor;
return new TableRow({
children: [
makeDataCell(time, fill),
makeDataCell("", fill),
makeDataCell("", fill),
makeDataCell("", fill),
makeDataCell("", fill),
makeDataCell("", fill),
makeDataCell("", fill),
makeDataCell("", fill),
]
});
});
const table = new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [headerRow, ...dataRows],
borders: {
top: { style: BorderStyle.SINGLE, size: 4, color: "1F4E79" },
bottom: { style: BorderStyle.SINGLE, size: 4, color: "1F4E79" },
left: { style: BorderStyle.SINGLE, size: 4, color: "1F4E79" },
right: { style: BorderStyle.SINGLE, size: 4, color: "1F4E79" },
insideH:{ style: BorderStyle.SINGLE, size: 2, color: "7BAFD4" },
insideV:{ style: BorderStyle.SINGLE, size: 2, color: "7BAFD4" },
}
});
const doc = new Document({
sections: [{
properties: {
page: {
size: { orientation: PageOrientation.LANDSCAPE },
margin: { top: 720, bottom: 720, left: 720, right: 720 }
}
},
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 100 },
children: [
new TextRun({ text: "PATIENT VITAL SIGNS MONITORING CHART", bold: true, size: 28, color: "1F4E79" })
]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 60 },
children: [
new TextRun({ text: "Date: ________________ Patient Name: ________________________________ Ward/Bed No: ____________", size: 18 })
]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { after: 200 },
children: [
new TextRun({ text: "Consultant: ____________________________ Nurse In-charge: ____________________________ MRN: ____________", size: 18 })
]
}),
table,
new Paragraph({
spacing: { before: 200 },
children: [
new TextRun({ text: "RBS = Random Blood Sugar | BP = Blood Pressure | SpO2 = Oxygen Saturation | PR = Pulse Rate", size: 16, italics: true, color: "595959" })
]
}),
new Paragraph({
spacing: { before: 60 },
children: [
new TextRun({ text: "Nurse Signature: _____________________________ Verified By: _____________________________", size: 16, italics: true, color: "595959" })
]
})
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync("/home/daytona/workspace/vitals-chart/Vitals_Monitoring_Chart.docx", buffer);
console.log("Done: Vitals_Monitoring_Chart.docx created.");
});
cd /home/daytona/workspace/vitals-chart && node create_chart.js
python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/vitals-chart/Vitals_Monitoring_Chart.docx
python -c "import zipfile; z = zipfile.ZipFile('/home/daytona/workspace/vitals-chart/Vitals_Monitoring_Chart.docx'); print(z.namelist())"
Vitals Monitoring Chart
Word Document · DOCX
| Column | Description |
|---|---|
| Time | 8 slots every 3 hours: 00:00 → 21:00 |
| RBS (mg/dL) | Random Blood Sugar |
| BP Systolic (mmHg) | Systolic blood pressure |
| BP Diastolic (mmHg) | Diastolic blood pressure |
| SpO2 (%) | Oxygen saturation |
| PR (bpm) | Pulse Rate |
| Urine Output (mL) | Hourly/per-slot urine output |
| Remarks | Free-text notes |
Kindly make it in name of Assam medical College and hospital Dibrugarh
~/vitals-chart/create_chart.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/vitals-chart/create_chart.js'
cd /home/daytona/workspace/vitals-chart && node create_chart.js
Vitals Monitoring Chart
Word Document · DOCX
ASSAM MEDICAL COLLEGE AND HOSPITAL Dibrugarh, Assam – 786002 PATIENT VITAL SIGNS MONITORING CHART (in red)
Kindly make it for 2 hourly chart with blank space for timing
~/vitals-chart/create_chart.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/vitals-chart/create_chart.js'