Kindly make RBS BP Spo2 PR urine output charting chart with column and rows

Asking for Preferences
Reading File
Running Command

mkdir -p /home/daytona/workspace/vitals-chart && ls /home/daytona/workspace/vitals-chart/

Writing File

~/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.");
});
Running Command

cd /home/daytona/workspace/vitals-chart && node create_chart.js

Running Command

python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/vitals-chart/Vitals_Monitoring_Chart.docx

Running Command

python -c "import zipfile; z = zipfile.ZipFile('/home/daytona/workspace/vitals-chart/Vitals_Monitoring_Chart.docx'); print(z.namelist())"

The file is a valid ZIP/DOCX archive. Your chart is ready for download.

Vitals Monitoring Chart

Word Document · DOCX


What's included in the chart:
ColumnDescription
Time8 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
RemarksFree-text notes
Additional features:
  • Landscape A4 layout for easy bedside use
  • Patient details header (Name, Date, Ward/Bed, MRN, Consultant, Nurse)
  • Alternating row shading for readability
  • Abbreviation legend at the bottom
  • Nurse signature line

Kindly make it in name of Assam medical College and hospital Dibrugarh

Editing File

~/vitals-chart/create_chart.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/vitals-chart/create_chart.js'
Running Command

cd /home/daytona/workspace/vitals-chart && node create_chart.js

Done! The updated chart is ready:

Vitals Monitoring Chart

Word Document · DOCX

The header now reads:
ASSAM MEDICAL COLLEGE AND HOSPITAL Dibrugarh, Assam – 786002 PATIENT VITAL SIGNS MONITORING CHART (in red)
Everything else — the 8 time-slot rows, all vital sign columns (RBS, BP, SpO2, PR, Urine Output), patient details fields, and nurse signature line — remains intact.

Kindly make it for 2 hourly chart with blank space for timing

Reading File
Editing File

~/vitals-chart/create_chart.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/vitals-chart/create_chart.js'
Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.
This is a shared conversation. Sign in to Orris to start your own chat.