ICU Insulin Infusion Calculator

Author: John Paul Feliciano
In Collaboration With: My sister, an RN at RUHS


Digitizing the Physical Table

My sister works in the ICU at Riverside University Health System (RUHS), where she relies on a paper-based reference table to quickly adjust insulin drip rates for patients with varying blood sugar levels. Below is the photograph of that table:

Physical Insulin Infusion Table
The original drip-adjustment guide used in the ICU.

Project Goal

This project transforms the paper reference into an interactive, web-based tool, significantly cutting down on calculation time and potential errors. By automating the drip-adjustment logic, ICU nurses can quickly get recommended actions—like “hold for 30 minutes” or “increase infusion rate by 0.5 units”—based on real-time blood glucose entries.


Key Features

  • Automated Calculations: Enter current BG, previous BG, and infusion rate, and the tool applies the branching logic to give an immediate recommendation.
  • Clarity and Consistency: Standardizes the protocol, reducing variation in how nurses interpret the table.
  • Lightweight Flask App: Easy to deploy and maintain on local hospital intranets or via a simple hosting service.
  • Updatable Rules: The infusion adjustment logic is modular, so any hospital policy changes can be quickly integrated.

App Screenshots

Below are a couple of screenshots illustrating the user interface:

Form for BG & Infusion Inputs

ICU Calculator Input Form
The user provides current/previous BG levels and the current drip rate.

Real-Time Recommendations

ICU Calculator Result
Clear text instructions are generated based on the logic from the original table.

Tech Stack

  • Backend: Flask (Python), with carefully structured conditional logic
  • Frontend: HTML/Jinja templates; minimal custom CSS or Bootstrap
  • Deployment: Hosted via PythonAnywhere (see link below)
  • Local/Dev Usage: Run python app.py in a virtual environment for quick local testing

Development Highlights

  • Paper-to-Code Mapping: Every row in the table was carefully translated into Python conditions and computations, ensuring all edge cases (e.g., big drops in BG) were covered.
  • Real-World Testing: My sister tested in a simulated ICU environment, providing feedback on clarity, usability, and correctness of the recommendation text.
  • Incremental Improvements: The instructions (e.g. "Hold infusion 30min") were refined multiple times to match real-world nurse workflows.

Challenges & Solutions

  • Edge-Case Handling: Some rules overlapped or had intricate numeric thresholds. Solution: thorough unit testing of each possible BG range and infusion change scenario.
  • Keeping It Nurse-Friendly: Medical staff prefer explicit instructions without unnecessary jargon. We kept outputs simple.
  • Potential EHR Integration: While not yet implemented, the design anticipates an API approach for future auto-fetching of BG values from a patient’s EHR.

Lessons Learned

  • Direct Nurse Involvement: The best feedback loop involves actual users (in this case, an ICU nurse) from day one of development.
  • Lightweight Architecture: A simple Flask-based approach is sufficient for many clinical tools, especially internal hospital use.
  • Documentation of Rule Changes: Keeping each threshold in a well-organized dataset (or JSON) can make policy updates straightforward.

Future Directions

  • Data Tracking: Log each recommended change, building a patient-specific BG profile over time.
  • EHR Integration: Automatic input from hospital systems to reduce manual typing and potential mis-entries.
  • Expanded Medical Calculations: Incorporating additional ICU dosing protocols (e.g., sedation, vasopressors) for a broader critical-care tool.

Interested in More?

Live Demo: You can try the calculator here: ICU Insulin Infusion Calculator (Hosted on PythonAnywhere) .

Source Code: ICU Insulin Infusion Calculator