Inspiration

Nurse schedules are high-stakes operational documents assembled from staffing rules, skill mix, leave, education, and individual requests. The work is repetitive, difficult to audit, and still requires an experienced human decision-maker. We built NurseFlow AI to make that workflow faster and more explainable without pretending AI should make the final staffing decision.

What it does

NurseFlow imports pseudonymous nurse request sheets, normalizes ambiguous request values for human review, and creates multiple ICU roster candidates. It supports the supplied MICU form while discarding employee codes and notes before the normalized dataset reaches the browser workflow, solver, OpenAI, or exports. Every candidate is checked by an independent validator against coverage, skill-mix, request, sequence, and workload constraints. Schedulers can compare trade-offs, inspect assignment evidence, confirm one version, and export a review-ready workbook. When Supabase has a matching staged period roster, confirmation also saves an immutable schedule-version history.

The application is admin-only. Public examples use synthetic nicknames and no patient data. The configured administrator email is never written to scheduling records.

How we built it

The interface and server boundary use Next.js, React, and TypeScript. A private FastAPI service models the roster with Google OR-Tools CP-SAT. Supabase stores confirmed versions and validation evidence, while ExcelJS and openpyxl produce exports.

GPT-5.6 is used through the OpenAI Responses API with Structured Outputs to suggest normalization for ambiguous request tokens and to explain solver evidence. It does not generate the roster: CP-SAT creates assignments, a separate deterministic validator checks them, and a human scheduler approves the result.

Codex accelerated architecture exploration, implementation across TypeScript and Python, admin authentication, security hardening, test generation, browser QA, documentation, and release preparation. We used Codex to challenge design decisions and verify boundaries rather than simply generate an unchecked prototype.

Challenges

The hardest part was keeping feasibility, privacy, and explainability aligned. We had to encode real scheduling constraints, bound every import and solver input, distinguish AI suggestions from deterministic decisions, and make complex trade-offs readable in one workspace.

Accomplishments

  • End-to-end prototype path for import, review, optimization, validation, comparison, confirmation, and export
  • Immutable candidate history when Supabase has a matching staged period roster
  • Independent validation of every generated candidate
  • Admin-only JWT session and protected server-to-server solver boundary
  • Formula-safe spreadsheet exports and bounded runtime inputs
  • 117 web test cases, 58 solver tests, clean dependency audits, and responsive browser QA
  • Public, reproducible repository with synthetic pseudonymous sample data

What we learned

AI is most useful here at the ambiguous edges: interpreting messy request notation and translating structured evidence into clear explanations. Constraint solving and validation remain the right tools for schedule correctness, while the final decision remains human.

What's next

Before any hospital pilot, we would move identity to managed authentication with MFA, add shared abuse controls and session revocation, introduce stable pseudonymous employee identity and transactional roster synchronization, harden deployment and spreadsheet decompression limits, and validate the workflow with real scheduling teams under an approved privacy and governance process.

Built With

  • codex
  • exceljs
  • fastapi
  • google-or-tools-cp-sat
  • gpt-5.6
  • next.js
  • openai-responses-api
  • pytest
  • python
  • react
  • supabase
  • typescript
  • vitest
  • zod
Share this project:

Updates