1- Identification: Michael Reynolds, 62-year-old male, admitted yesterday afternoon to the medica ward from ED. S- Situation: Michael is being managed for Hyperosmolar Hyperglycemic State (HHS) secondary to poorly controlled Type 2 Diabetes Mellitus. After 24 hours of treatment, he is now alert and oriented, with improved hydration and urine output. Insulin therapy and potassium replacement have been commenced. B - Background * 15-year history of Type 2 Diabetes Mellitus, poorly controlled * Presented with progressive confusion, extreme thirst, weakness, and dehydration No history of alcohol use, no abdominal pain or vomiting A -Assessment * Current vitals: T 37.3°C, HR 98 bpm, RR 18, BP 110/70 mmHg * Physical: Mucous membranes moist, skin turgor improving, eyes less sunken * Neurological: Alert, oriented, no longer confused Urine output: Improving * Labs: * Blood glucose trending down (last: 16.5mmol/L) Serum osmolality improving Potassium within normal range with replacement BUN/Creatinine improving R - Recommendation * Continue IV fluids (adjust rate as per current hydration status and cardiac/renal function) * Continue insulin therapy, titrate as per protocol * Hourly Hourly GL(Ensure BLs are also done before and 2 hours after a meal * Ongoing monitoring and replacement of electrolytes, especially potassium * Monitor neurological status and vital signs 4 hourly or PRN * Begin diabetes education and discuss discharge planning, including medication adherence and sick day management * Liaise with diabetes educator and dietitian for ongoing support Looking at the picture above generate a shift planner for patient 3 as given in for Mitchel Reynolds.
ls -la /home/daytona/workspace/attachments/d041f1cb-3d40-44fc-a3f9-ec586f39eab9/
cd /home/daytona/workspace/attachments/d041f1cb-3d40-44fc-a3f9-ec586f39eab9/ && …
cd /home/daytona/workspace/attachments/d041f1cb-3d40-44fc-a3f9-ec586f39eab9/ && …
python3 -c " from PIL import Image import os img = Image.open('/home/daytona/wor…
python3 -c " import pyheif from PIL import Image heif_file = pyheif.read('/home/…
mkdir -p /home/daytona/workspace/shift-planner && ls /home/daytona/workspace/shi…
~/shift-planner/generate_planner.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.platypus import (
SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, HRFlowable
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.lib.colors import HexColor
# ── Color palette ──────────────────────────────────────────────────────────────
NAVY = HexColor("#1B3A5C")
TEAL = HexColor("#2A7A8C")
LIGHT_TEAL = HexColor("#D6EEF2")
AMBER = HexColor("#F5A623")
LIGHT_AMBER = HexColor("#FFF4DD")
WHITE = colors.white
LIGHT_GREY = HexColor("#F4F6F8")
MID_GREY = HexColor("#BEC8D2")
RED_ALERT = HexColor("#C0392B")
GREEN_OK = HexColor("#27AE60")
LIGHT_GREEN = HexColor("#E8F8F0")
doc = SimpleDocTemplate(
"/home/daytona/workspace/shift-planner/Michael_Reynolds_Shift_Planner.pdf",
pagesize=A4,
rightMargin=12*mm, leftMargin=12*mm,
topMargin=14*mm, bottomMargin=14*mm,
)
styles = getSampleStyleSheet()
W, H = A4
def style(name, **kw):
s = ParagraphStyle(name, parent=styles["Normal"], **kw)
return s
title_style = style("Title", fontSize=15, textColor=WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold", leading=18)
sub_style = style("Sub", fontSize=9, textColor=WHITE, alignment=TA_CENTER, fontName="Helvetica", leading=11)
head_style = style("Head", fontSize=8, textColor=WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold", leading=10)
cell_style = style("Cell", fontSize=7.5,textColor=NAVY, alignment=TA_LEFT, fontName="Helvetica", leading=9)
cell_bold = style("CellB", fontSize=7.5,textColor=NAVY, alignment=TA_LEFT, fontName="Helvetica-Bold", leading=9)
cell_center = style("CellC", fontSize=7.5,textColor=NAVY, alignment=TA_CENTER, fontName="Helvetica", leading=9)
cell_red = style("CellR", fontSize=7.5,textColor=RED_ALERT,alignment=TA_CENTER,fontName="Helvetica-Bold",leading=9)
cell_green = style("CellG", fontSize=7.5,textColor=GREEN_OK,alignment=TA_CENTER,fontName="Helvetica-Bold", leading=9)
section_style = style("Sec", fontSize=9, textColor=WHITE, alignment=TA_LEFT, fontName="Helvetica-Bold", leading=11)
note_style = style("Note", fontSize=7, textColor=NAVY, alignment=TA_LEFT, fontName="Helvetica-Oblique", leading=9)
alert_style = style("Alert", fontSize=7.5,textColor=RED_ALERT,alignment=TA_LEFT, fontName="Helvetica-Bold", leading=9)
elements = []
# ══════════════════════════════════════════════════════════════════════════════
# HEADER BANNER
# ══════════════════════════════════════════════════════════════════════════════
header_data = [[
Paragraph("NURSING SHIFT PLANNER", title_style),
Paragraph("Medical Ward | Day Shift 07:00 – 19:00", sub_style),
Paragraph("Date: 10 July 2026 (Friday)", sub_style),
]]
header_table = Table(header_data, colWidths=[65*mm, 85*mm, 36*mm])
header_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TEXTCOLOR", (0,0), (-1,-1), WHITE),
("ALIGN", (0,0), (-1,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ROWHEIGHT", (0,0), (-1,-1), 14*mm),
("BOX", (0,0), (-1,-1), 1, NAVY),
("INNERGRID", (0,0), (-1,-1), 0.5, TEAL),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING",(0,0),(-1,-1), 3),
]))
elements.append(header_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# PATIENT ID BANNER
# ══════════════════════════════════════════════════════════════════════════════
pid_data = [[
Paragraph("PATIENT 3", head_style),
Paragraph("Michael Reynolds", head_style),
Paragraph("62 yrs | Male", head_style),
Paragraph("Medical Ward | Bed 3", head_style),
Paragraph("Admitted: 09 Jul 2026", head_style),
Paragraph("Dr. [Attending Physician]", head_style),
]]
pid_table = Table(pid_data, colWidths=[22*mm, 32*mm, 22*mm, 36*mm, 30*mm, 44*mm])
pid_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL),
("TEXTCOLOR", (0,0), (-1,-1), WHITE),
("ALIGN", (0,0), (-1,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ROWHEIGHT", (0,0), (-1,-1), 8*mm),
("BOX", (0,0), (-1,-1), 1, NAVY),
("INNERGRID", (0,0), (-1,-1), 0.5, NAVY),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING",(0,0),(-1,-1), 2),
]))
elements.append(pid_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# DIAGNOSIS / ALERTS STRIP
# ══════════════════════════════════════════════════════════════════════════════
dx_data = [[
Paragraph("PRIMARY DX:", cell_bold),
Paragraph("Hyperosmolar Hyperglycaemic State (HHS) secondary to poorly controlled Type 2 Diabetes Mellitus", cell_style),
Paragraph("⚠ ALLERGY/ALERTS:", alert_style),
Paragraph("None documented | Falls risk: MONITOR", cell_red),
]]
dx_table = Table(dx_data, colWidths=[25*mm, 80*mm, 35*mm, 46*mm])
dx_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_AMBER),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("BOX", (0,0), (-1,-1), 1, AMBER),
("INNERGRID", (0,0), (-1,-1), 0.4, AMBER),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING",(0,0),(-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 4),
]))
elements.append(dx_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# CURRENT STATUS SUMMARY (from SBAR)
# ══════════════════════════════════════════════════════════════════════════════
def section_header(text):
t = Table([[Paragraph(text, section_style)]], colWidths=[186*mm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING",(0,0),(-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("BOX", (0,0), (-1,-1), 0.5, NAVY),
]))
return t
elements.append(section_header("CURRENT STATUS SUMMARY (from SBAR handover)"))
elements.append(Spacer(1, 1*mm))
status_data = [
[Paragraph("Vitals", cell_bold),
Paragraph("T 37.3°C | HR 98 bpm | RR 18 | BP 110/70 mmHg", cell_style),
Paragraph("BGL (last)", cell_bold),
Paragraph("16.5 mmol/L (trending ↓)", cell_style)],
[Paragraph("Neuro", cell_bold),
Paragraph("Alert & oriented – no confusion", cell_green),
Paragraph("Serum Osmolality", cell_bold),
Paragraph("Improving", cell_green)],
[Paragraph("Hydration", cell_bold),
Paragraph("Mucous membranes moist; skin turgor improving; eyes less sunken", cell_style),
Paragraph("Urine Output", cell_bold),
Paragraph("Improving – continue monitoring", cell_style)],
[Paragraph("Potassium", cell_bold),
Paragraph("Within normal range with replacement", cell_green),
Paragraph("BUN/Creatinine", cell_bold),
Paragraph("Improving", cell_green)],
[Paragraph("IV Access", cell_bold),
Paragraph("In situ – IV fluids running (rate as per hydration status & cardiac/renal function)", cell_style),
Paragraph("Insulin", cell_bold),
Paragraph("IV insulin – titrate per protocol", cell_style)],
]
status_table = Table(status_data, colWidths=[22*mm, 72*mm, 28*mm, 64*mm])
status_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_TEAL),
("ROWBACKGROUNDS",(0,0),(-1,-1), [LIGHT_TEAL, WHITE]),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("BOX", (0,0), (-1,-1), 1, TEAL),
("INNERGRID", (0,0), (-1,-1), 0.4, MID_GREY),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING",(0,0),(-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 4),
]))
elements.append(status_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# HOURLY / TIME-BASED TASK SCHEDULE
# ══════════════════════════════════════════════════════════════════════════════
elements.append(section_header("HOURLY TASK SCHEDULE – Day Shift 07:00 – 19:00"))
elements.append(Spacer(1, 1*mm))
sched_header = [
Paragraph("TIME", head_style),
Paragraph("TASK / INTERVENTION", head_style),
Paragraph("PRIORITY", head_style),
Paragraph("DONE ✓", head_style),
Paragraph("NURSE INITIALS", head_style),
Paragraph("NOTES / FINDINGS", head_style),
]
sched_rows = [
["07:00",
"Handover receive | Introduce self to patient | Initial assessment: neuro, hydration, urine output",
"HIGH",
"☐", "", ""],
["07:15",
"Check & document current IV fluid rate; inspect IV site for patency/phlebitis",
"HIGH",
"☐", "", ""],
["07:30",
"BGL check (fasting / pre-breakfast)\nTarget: gradual ↓; do not drop >3 mmol/L/hr",
"HIGH",
"☐", "", ""],
["07:30",
"Administer IV insulin as per titration protocol (based on BGL result)",
"HIGH",
"☐", "", ""],
["07:30",
"Check potassium level – administer replacement if K⁺ < 3.5 mmol/L (hold insulin if K⁺ < 3.3)",
"HIGH",
"☐", "", ""],
["08:00",
"Vital signs: T, HR, RR, BP, SpO₂\nDocument & compare to baseline",
"HIGH",
"☐", "", ""],
["08:00",
"Urine output measurement & documentation",
"HIGH",
"☐", "", ""],
["08:00",
"Encourage oral fluids (if swallowing safe & tolerated)",
"MOD",
"☐", "", ""],
["08:30",
"Breakfast served – BGL check BEFORE meal",
"HIGH",
"☐", "", ""],
["08:30",
"Administer morning medications as charted (e.g., antihypertensives, others)",
"HIGH",
"☐", "", ""],
["09:00",
"Electrolyte review (Na⁺, K⁺, Mg²⁺, Phosphate) – liaise with team for replacement orders",
"HIGH",
"☐", "", ""],
["09:00",
"Reassess neurological status: GCS/orientation, confusion, headache",
"HIGH",
"☐", "", ""],
["09:00",
"Serum osmolality & BGL trending review with medical team",
"HIGH",
"☐", "", ""],
["10:00",
"BGL check (hourly)\nAdjust insulin infusion per protocol",
"HIGH",
"☐", "", ""],
["10:30",
"BGL check 2 hrs post-breakfast\nDocument result & trend",
"HIGH",
"☐", "", ""],
["10:30",
"Skin integrity assessment: pressure area check, reposition if needed",
"MOD",
"☐", "", ""],
["11:00",
"BGL check (hourly)\nIV fluid rate reassessment with team",
"HIGH",
"☐", "", ""],
["11:00",
"Urine output check & documentation",
"HIGH",
"☐", "", ""],
["11:00",
"Commence Diabetes Education (Session 1):\n• What is HHS / hyperglycaemia\n• Importance of medication adherence\n• Sick day management plan",
"MOD",
"☐", "", ""],
["12:00",
"Vital signs: T, HR, RR, BP, SpO₂",
"HIGH",
"☐", "", ""],
["12:00",
"BGL check (hourly)",
"HIGH",
"☐", "", ""],
["12:00",
"Lunch served – BGL check BEFORE meal",
"HIGH",
"☐", "", ""],
["12:00",
"Urine output measurement",
"HIGH",
"☐", "", ""],
["13:00",
"BGL check (hourly) | Insulin titration review",
"HIGH",
"☐", "", ""],
["13:00",
"Electrolyte replacement review (K⁺ trending – reassess with team)",
"HIGH",
"☐", "", ""],
["14:00",
"BGL check 2 hrs post-lunch",
"HIGH",
"☐", "", ""],
["14:00",
"BGL check (hourly)",
"HIGH",
"☐", "", ""],
["14:00",
"Dietitian consult – liaise re: carbohydrate-consistent diet, fluid intake plan",
"MOD",
"☐", "", ""],
["15:00",
"BGL check (hourly) | Urine output",
"HIGH",
"☐", "", ""],
["15:00",
"Vital signs: T, HR, RR, BP",
"HIGH",
"☐", "", ""],
["15:00",
"IV fluid rate & site review",
"HIGH",
"☐", "", ""],
["15:30",
"Diabetes Education (Session 2):\n• Home BGL monitoring technique\n• When to seek medical attention\n• Medication (insulin/oral agents) routine",
"MOD",
"☐", "", ""],
["16:00",
"BGL check (hourly)",
"HIGH",
"☐", "", ""],
["16:00",
"Neurological assessment (4-hourly)",
"HIGH",
"☐", "", ""],
["16:00",
"Electrolytes review – potassium replacement check",
"HIGH",
"☐", "", ""],
["16:30",
"Afternoon tea – BGL check BEFORE",
"HIGH",
"☐", "", ""],
["17:00",
"BGL check (hourly) | Urine output",
"HIGH",
"☐", "", ""],
["17:00",
"Liaise with Diabetes Educator re progress & ongoing plan",
"MOD",
"☐", "", ""],
["17:00",
"Commence discharge planning discussion with patient & family:\n• Medication adherence\n• Follow-up appointment\n• Sick day management rules",
"MOD",
"☐", "", ""],
["18:00",
"Vital signs (4-hourly): T, HR, RR, BP, SpO₂",
"HIGH",
"☐", "", ""],
["18:00",
"BGL check (hourly)",
"HIGH",
"☐", "", ""],
["18:00",
"Dinner served – BGL check BEFORE meal",
"HIGH",
"☐", "", ""],
["18:00",
"Urine output measurement & 12-hr fluid balance",
"HIGH",
"☐", "", ""],
["18:30",
"IV fluid rate final review for end of shift; document fluid balance",
"HIGH",
"☐", "", ""],
["18:45",
"BGL check 2 hrs post-dinner (if dinner at ~16:45) OR document as pending for evening shift",
"HIGH",
"☐", "", ""],
["19:00",
"Complete shift documentation: vitals, BGL trend, fluid balance, neuro status, education delivered",
"HIGH",
"☐", "", ""],
["19:00",
"SBAR Handover to evening nurse (include BGL trend, insulin rate, K⁺ status, IV fluids, neuro, education progress)",
"HIGH",
"☐", "", ""],
]
# Build rows with alternating colour
table_data = [sched_header]
for i, row in enumerate(sched_rows):
table_data.append([
Paragraph(row[0], cell_center),
Paragraph(row[1], cell_style),
Paragraph(row[2], cell_red if row[2] == "HIGH" else cell_style),
Paragraph(row[3], cell_center),
Paragraph(row[4], cell_center),
Paragraph(row[5], cell_style),
])
sched_table = Table(
table_data,
colWidths=[16*mm, 74*mm, 18*mm, 13*mm, 22*mm, 43*mm],
repeatRows=1
)
row_bg = []
for i in range(1, len(table_data)):
bg = LIGHT_GREY if i % 2 == 0 else WHITE
row_bg.append(("BACKGROUND", (0,i), (-1,i), bg))
sched_table.setStyle(TableStyle([
# Header
("BACKGROUND", (0,0), (-1,0), NAVY),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,0), 8),
("ALIGN", (0,0), (-1,0), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("BOX", (0,0), (-1,-1), 1, NAVY),
("INNERGRID", (0,0), (-1,-1), 0.3, MID_GREY),
("TOPPADDING", (0,0), (-1,-1), 2.5),
("BOTTOMPADDING",(0,0),(-1,-1), 2.5),
("LEFTPADDING", (0,0), (-1,-1), 3),
("ROWHEIGHT", (0,0), (-1,-1), 10),
] + row_bg))
elements.append(sched_table)
elements.append(Spacer(1, 4*mm))
# ══════════════════════════════════════════════════════════════════════════════
# PRIORITY MONITORING REMINDERS
# ══════════════════════════════════════════════════════════════════════════════
elements.append(section_header("PRIORITY MONITORING REMINDERS"))
elements.append(Spacer(1, 1*mm))
reminders = [
["BGL", "HOURLY + before and 2 hours after EVERY meal. Target: gradual reduction. Alert if <4 mmol/L or if rate of fall >3 mmol/L/hr."],
["Potassium", "Do NOT administer insulin if K⁺ < 3.3 mmol/L. Replace potassium if < 3.5 mmol/L. Re-check 2 hourly while replacing."],
["IV Fluids", "Adjust rate based on current hydration, cardiac function, and renal function. Document fluid balance every shift."],
["Neuro Status", "4-hourly or PRN. Sudden confusion/headache → ALERT MEDICAL TEAM immediately (risk of cerebral oedema)."],
["Vital Signs", "4-hourly minimum. HR trending up + BP dropping → ESCALATE. Target HR < 100, BP > 100/60."],
["Urine Output", "Minimum 0.5 mL/kg/hr. Oliguria → review fluid status, renal function. Document accurately."],
["Osmolality", "Should be trending down. Correlate with neuro status. Rapid reduction risk: cerebral oedema."],
["Insulin Infusion", "Titrate per hospital protocol. When BGL < 14–15 mmol/L – add dextrose to IV fluids. DO NOT stop insulin prematurely (risk of DKA in T2DM)."],
]
rem_data = [[Paragraph(r[0], cell_bold), Paragraph(r[1], cell_style)] for r in reminders]
rem_table = Table(rem_data, colWidths=[28*mm, 158*mm])
rem_table.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0), (-1,-1), [LIGHT_TEAL, WHITE]),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("BOX", (0,0), (-1,-1), 1, TEAL),
("INNERGRID", (0,0), (-1,-1), 0.4, MID_GREY),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0),(-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 4),
]))
elements.append(rem_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# ESCALATION / WHEN TO CALL DOCTOR
# ══════════════════════════════════════════════════════════════════════════════
elements.append(section_header("ESCALATION CRITERIA – CALL MEDICAL TEAM IMMEDIATELY IF:"))
elements.append(Spacer(1, 1*mm))
esc_items = [
"BGL < 4.0 mmol/L (hypoglycaemia) or persistent BGL > 20 mmol/L despite treatment",
"BGL falling faster than 3 mmol/L per hour",
"Potassium < 3.3 mmol/L before insulin dose",
"Sudden deterioration in neuro status: confusion, headache, drowsiness, GCS drop",
"HR > 120 bpm or < 50 bpm | BP < 90/60 mmHg",
"Urine output < 30 mL/hr for 2 consecutive hours",
"Signs of fluid overload: new dyspnoea, SpO₂ drop, peripheral oedema",
"New fever (T > 38°C) – consider precipitating infection",
]
esc_data = [[Paragraph(f"• {item}", alert_style)] for item in esc_items]
esc_table = Table(esc_data, colWidths=[186*mm])
esc_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), HexColor("#FEF0F0")),
("ROWBACKGROUNDS",(0,0),(-1,-1), [HexColor("#FEF0F0"), HexColor("#FFF8F8")]),
("BOX", (0,0), (-1,-1), 1, RED_ALERT),
("INNERGRID", (0,0), (-1,-1), 0.3, HexColor("#F5B7B1")),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING",(0,0),(-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
elements.append(esc_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# EDUCATION & DISCHARGE PLANNING
# ══════════════════════════════════════════════════════════════════════════════
elements.append(section_header("DIABETES EDUCATION & DISCHARGE PLANNING"))
elements.append(Spacer(1, 1*mm))
edu_data = [
[Paragraph("TOPIC", head_style), Paragraph("STATUS", head_style), Paragraph("DELIVERED BY", head_style), Paragraph("PATIENT UNDERSTANDS ✓", head_style)],
[Paragraph("What is HHS & why it occurred", cell_style), Paragraph("☐ Pending ☐ Done", cell_center), Paragraph("RN / Diabetes Educator", cell_style), Paragraph("☐ Yes ☐ Needs review", cell_center)],
[Paragraph("Importance of medication adherence", cell_style), Paragraph("☐ Pending ☐ Done", cell_center), Paragraph("RN / Diabetes Educator", cell_style), Paragraph("☐ Yes ☐ Needs review", cell_center)],
[Paragraph("Home BGL monitoring technique", cell_style), Paragraph("☐ Pending ☐ Done", cell_center), Paragraph("Diabetes Educator", cell_style), Paragraph("☐ Yes ☐ Needs review", cell_center)],
[Paragraph("Sick day management rules", cell_style), Paragraph("☐ Pending ☐ Done", cell_center), Paragraph("RN / Diabetes Educator", cell_style), Paragraph("☐ Yes ☐ Needs review", cell_center)],
[Paragraph("Diet & carbohydrate management", cell_style), Paragraph("☐ Pending ☐ Done", cell_center), Paragraph("Dietitian", cell_style), Paragraph("☐ Yes ☐ Needs review", cell_center)],
[Paragraph("When to seek emergency care (warning signs)", cell_style), Paragraph("☐ Pending ☐ Done", cell_center), Paragraph("RN / Diabetes Educator", cell_style), Paragraph("☐ Yes ☐ Needs review", cell_center)],
[Paragraph("Follow-up appointment arranged", cell_style), Paragraph("☐ Pending ☐ Done", cell_center), Paragraph("Social Work / Ward Clerk", cell_style), Paragraph("☐ Yes ☐ Pending", cell_center)],
[Paragraph("Prescriptions / medication chart reviewed", cell_style), Paragraph("☐ Pending ☐ Done", cell_center), Paragraph("Pharmacist / Medical Officer", cell_style), Paragraph("☐ Yes ☐ Pending", cell_center)],
]
edu_table = Table(edu_data, colWidths=[60*mm, 40*mm, 46*mm, 40*mm], repeatRows=1)
edu_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("ROWBACKGROUNDS",(0,1),(-1,-1), [LIGHT_GREY, WHITE]),
("ALIGN", (0,0), (-1,0), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("BOX", (0,0), (-1,-1), 1, TEAL),
("INNERGRID", (0,0), (-1,-1), 0.4, MID_GREY),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0),(-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 4),
]))
elements.append(edu_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# FLUID BALANCE TRACKER
# ══════════════════════════════════════════════════════════════════════════════
elements.append(section_header("FLUID BALANCE TRACKER – Day Shift"))
elements.append(Spacer(1, 1*mm))
fb_header = [
Paragraph("TIME", head_style),
Paragraph("IV FLUID TYPE & RATE", head_style),
Paragraph("ORAL INTAKE (mL)", head_style),
Paragraph("URINE OUTPUT (mL)", head_style),
Paragraph("OTHER LOSSES", head_style),
Paragraph("CUMULATIVE BALANCE", head_style),
]
fb_rows = [["07:00", "", "", "", "", ""],
["08:00", "", "", "", "", ""],
["09:00", "", "", "", "", ""],
["10:00", "", "", "", "", ""],
["11:00", "", "", "", "", ""],
["12:00", "", "", "", "", ""],
["13:00", "", "", "", "", ""],
["14:00", "", "", "", "", ""],
["15:00", "", "", "", "", ""],
["16:00", "", "", "", "", ""],
["17:00", "", "", "", "", ""],
["18:00", "", "", "", "", ""],
[Paragraph("SHIFT TOTAL", cell_bold), "", "", "", "", ""],
]
fb_data = [fb_header] + [[Paragraph(r[0] if isinstance(r[0], str) else "", cell_center),
Paragraph("", cell_style),
Paragraph("", cell_center),
Paragraph("", cell_center),
Paragraph("", cell_center),
Paragraph("", cell_center)] for r in fb_rows[:-1]]
# last total row
fb_data.append([Paragraph("SHIFT TOTAL", cell_bold),
Paragraph("", cell_style),
Paragraph("", cell_center),
Paragraph("", cell_center),
Paragraph("", cell_center),
Paragraph("", cell_center)])
# Re-build cleanly
fb_table_data = [fb_header]
for i, r in enumerate(fb_rows):
if i < len(fb_rows)-1:
fb_table_data.append([
Paragraph(r[0], cell_center),
Paragraph(r[1], cell_style),
Paragraph(r[2], cell_center),
Paragraph(r[3], cell_center),
Paragraph(r[4], cell_center),
Paragraph(r[5], cell_center),
])
else:
fb_table_data.append([
Paragraph("SHIFT TOTAL", cell_bold),
Paragraph("", cell_style),
Paragraph("", cell_center),
Paragraph("", cell_center),
Paragraph("", cell_center),
Paragraph("", cell_center),
])
fb_table = Table(fb_table_data, colWidths=[16*mm, 46*mm, 28*mm, 28*mm, 28*mm, 40*mm], repeatRows=1)
fb_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("BACKGROUND", (0,-1),(-1,-1), LIGHT_AMBER),
("ROWBACKGROUNDS",(0,1),(-1,-2), [LIGHT_TEAL, WHITE]),
("ALIGN", (0,0), (-1,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("BOX", (0,0), (-1,-1), 1, NAVY),
("INNERGRID", (0,0), (-1,-1), 0.4, MID_GREY),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0),(-1,-1), 4),
("ROWHEIGHT", (0,0), (-1,-1), 7*mm),
]))
elements.append(fb_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# SHIFT NOTES
# ══════════════════════════════════════════════════════════════════════════════
elements.append(section_header("SHIFT NARRATIVE NOTES"))
elements.append(Spacer(1, 1*mm))
notes_rows = [["Time", "Narrative Entry", "RN Signature"]] + [["", "", ""] for _ in range(8)]
notes_data = [[Paragraph(r[0], head_style if i==0 else cell_center),
Paragraph(r[1], head_style if i==0 else cell_style),
Paragraph(r[2], head_style if i==0 else cell_center)] for i, r in enumerate(notes_rows)]
notes_table = Table(notes_data, colWidths=[20*mm, 136*mm, 30*mm], repeatRows=1)
notes_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("ROWBACKGROUNDS",(0,1),(-1,-1), [LIGHT_GREY, WHITE]),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("BOX", (0,0), (-1,-1), 1, NAVY),
("INNERGRID", (0,0), (-1,-1), 0.4, MID_GREY),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0),(-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 4),
("ROWHEIGHT", (0,1),(-1,-1), 10*mm),
]))
elements.append(notes_table)
elements.append(Spacer(1, 3*mm))
# ══════════════════════════════════════════════════════════════════════════════
# FOOTER
# ══════════════════════════════════════════════════════════════════════════════
footer_data = [[
Paragraph("Nurse Name: ____________________", cell_style),
Paragraph("Signature: ____________________", cell_style),
Paragraph("RN #: ____________", cell_style),
Paragraph("Shift End Time: ____________", cell_style),
]]
footer_table = Table(footer_data, colWidths=[50*mm, 50*mm, 40*mm, 46*mm])
footer_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TEXTCOLOR", (0,0), (-1,-1), WHITE),
("ALIGN", (0,0), (-1,-1), "LEFT"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("BOX", (0,0), (-1,-1), 1, NAVY),
("INNERGRID", (0,0), (-1,-1), 0.5, TEAL),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING",(0,0),(-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("ROWHEIGHT", (0,0), (-1,-1), 10*mm),
]))
elements.append(footer_table)
# ── BUILD ──────────────────────────────────────────────────────────────────────
doc.build(elements)
print("PDF generated successfully.")
python3 /home/daytona/workspace/shift-planner/generate_planner.py 2>&1
ls -lh /home/daytona/workspace/shift-planner/
Michael Reynolds Shift Planner
PDF Document · PDF
Note: I was unable to open the attached HEIC image (the format requires conversion tools not available in this environment). The planner above is built directly from the SBAR clinical data you provided. If the image contains a specific layout or additional patient details you'd like replicated, please re-upload it as a JPG/PNG or describe the template structure and I'll adjust accordingly.