Building a Hospital Dashboard with AI Coding Tools: Lessons from an IT Engineer
A hospital IT engineer with limited programming experience used an AI coding agent to build a browser-based dashboard inside an existing Python system. This practical retrospective covers defining requirements, validating one chart at a time, troubleshooting with accurate context, and addressing database permissions, metric definitions, sensitive data, and code security before deployment.
1. The Result: A Web Page That Works as a Dashboard
I work in a hospital IT department. Only a few of us, myself included, have even basic programming skills. Writing SQL means consulting documentation as we go, and front-end development was entirely new territory.
Recently, hospital management asked for a way to check key operational metrics whenever needed: outpatient volume, inpatient volume, bed occupancy, and revenue breakdown. Our usual response would have been, “We’ll need a vendor to build that and provide a quote.”
This time, I tried a different approach. Using an AI coding agent, I built a dashboard while writing almost no code by hand. The result was a browser-based page with four charts visible on a single screen:
- Outpatient volume trend: A line chart showing which months had higher or lower activity.
- Inpatient volume: Side-by-side bars comparing admissions and discharges, making patient turnover easier to see.
- Outpatient laboratory and examination volumes by department: A ranking that clearly shows which departments handle the most activity.
- Bed occupancy threshold: Months with occupancy above 85% are automatically highlighted in red. Management particularly liked this view. What had previously been an isolated column of numbers in Excel now made threshold crossings immediately visible.
The page runs inside our department’s existing administrative system. Users can access it with their existing accounts, without installing additional software. In a meeting room, displaying the browser in full-screen mode on a television turns it into a large-screen dashboard.
This is not an expensive LED video wall. It is simply a web page. For many hospital information needs, that is sufficient, leaving more budget available for other practical priorities.
2. Why We Had Not Built It Before: Four Barriers
The issue was not a lack of interest in developing something ourselves. The traditional approach involved four barriers, any one of which could stop the project:
- Backend APIs: Turning database records into a format a web page can consume, such as JSON, requires an API. We did not know how to write one.
- Front-end development: Page layouts, chart rendering, and styling require front-end skills we did not have.
- Chart library configuration: Common charting libraries can have hundreds of configuration options. Even understanding the documentation was difficult.
- Deployment and operations: Environment setup, access management, and troubleshooting during deployment could leave us stuck if anything went wrong.
Previously, these barriers left us with one practical option: hire a vendor.
What changed was that I delegated the implementation work across all four areas to an AI coding tool. My role shifted from writing code to defining requirements. That sounds straightforward, but communicating requirements effectively takes a deliberate approach.
3. How I Built the System Through Iterative Instructions
Step 1: Describe the Requirements Before Asking for Code
My first instruction to the tool was roughly:
Our hospital has an existing administrative system written in Python. I want to add a dashboard page with four charts showing outpatient volume, inpatient volume, bed occupancy, and revenue breakdown, viewed by month. The data comes from the hospital information system (HIS) database. Help me design the approach first. Do not write code yet.
I deliberately emphasized three things:
- The deliverable: Four charts, including what each should show and the dimensions to use.
- The data source: The HIS database, with monthly aggregation.
- The integration point: The existing system, rather than a separate application.
I did not specify a framework or dictate implementation details. Those were questions for the tool to address. Since I did not understand those choices, trying to direct them would have added confusion.
For developers with limited technical experience, the real advantage is understanding the business and its requirements—not pretending to understand every technology choice.
Let the AI propose an approach, check whether it meets the business expectations, and confirm it before proceeding. That can prevent substantial rework.
Step 2: Validate Small Pieces Instead of Requesting Everything at Once
After confirming the approach, I did not ask the tool to build the entire dashboard in one pass. I broke the work into stages:
- Build a minimal page containing only the outpatient volume trend chart, and verify the complete path from database query to backend API to front-end chart.
- Once that path works, add the other three charts. With the data flow established, much of the remaining work follows the same pattern.
- Adjust the overall layout and styling last.
The benefit is simple: small changes make problems easier to isolate.
Getting the first chart working let me verify three things: whether the database connection settings were correct, whether the API returned the expected format, and whether the chart rendered properly.
If I had requested the complete system immediately, a failure anywhere in that chain would have been much harder to diagnose.
Step 3: Send Back the Full Error Details
Errors were inevitable. My approach was straightforward: paste the complete error message and relevant screenshots into the tool, then ask it to diagnose and fix the problem.
It could identify most issues and provide corrected code. I generally only needed to replace files and restart the service as instructed.
When a proposed fix was wrong, I supplied more context. For example:
The actual database field is called
admit_date, notadmission_time.
An AI coding tool does not know your real environment. The quality of the context you provide directly affects the quality of its output.
4. Lessons and Pitfalls
Keep Database Permissions Narrow
I requested a dedicated read-only account with access limited to the few tables needed for reporting. A highly privileged production database account should never be handed to an automated workflow.
Agree on Metric Definitions First
Does outpatient volume count registrations or completed visits? Should discharge counts use the discharge date or the billing settlement date?
The tool cannot resolve these business definitions for you. They must be agreed upon with the relevant departments before implementation. Otherwise, you may end up with polished charts whose numbers do not match the expected reports.
Keep Sensitive Data Out of the Dashboard
The dashboard displays aggregate statistics only, with no patient-level details. This supports compliance requirements and substantially reduces system complexity.
Do Not Trust One-Shot Code Generation
AI-generated code can occasionally contain security problems, such as SQL built through string concatenation.
Even if you cannot understand every line, ask the tool to explain the critical logic and check for obvious vulnerabilities before putting the system into production. Generated code is not automatically ready to deploy.
5. A Practical Method for Teams with Limited Development Capacity
Looking back, three principles made this approach work:
- Shift your role: You define what the system must do; the AI handles implementation. Your business understanding remains essential to deciding whether the result is correct.
- Work in small increments: Establish the smallest complete workflow first, then expand it. Avoid requesting a large, all-in-one deliverable at the outset.
- Provide accurate context: Complete error messages, real field names, and agreed metric definitions give the tool a better basis for producing useful results.
The most important outcome was not the money saved. It was demonstrating that business understanding and the ability to express requirements are becoming increasingly important—and potentially scarcer—inputs to software delivery than coding ability alone.
For hospital IT teams that understand their operations but lack development capacity, this approach is worth a serious trial.
