Build a Hospital Operations Dashboard Without Writing Code

    Learn how a hospital IT team delivered a web-based operations dashboard using an AI coding tool: the four-chart requirement, metric definitions, read-only data APIs, frontend chart constraints, deployment, and lessons learned.

    1. Where the Requirement Came From: A Typical “Four Charts” Request

    The hospital leadership had a simple ask: a way to see outpatient volume, inpatient volume, bed occupancy rate, and revenue structure at any time. Historically, the IT department’s standard answer was “contact a vendor, and here is the budget.” This time the approach was different: the work was handled in-house with the help of an AI coding tool, and the deliverable was a web page.

    The result can be summed up in one sentence: open a browser and the dashboard is there. The page consists of four charts.

    • Outpatient volume trend: a line chart by month, so the ups and downs are directly readable;
    • Inpatient volume comparison: a bar chart showing admissions and discharges side by side, making the gap easy to spot;
    • Department workload ranking: outpatient testing and examination counts sorted by department, with horizontal bars making comparison easier;
    • Bed occupancy threshold alert: for months where occupancy exceeds 85%, a red reference line is automatically overlaid.

    One common misunderstanding is worth clearing up: this is not an LED video-wall project costing hundreds of thousands. It is essentially a responsive web page. For most medical institutions, a web-based dashboard is enough: in a meeting room, you just put the browser in full screen and cast it, leaving the budget for more worthwhile investments.

    2. The Real Barriers: Four Hurdles and a Shift in Role

    The reason not to do it was never “we don’t want to,” but that any one of four hurdles was enough to put people off:

    1. Backend APIs: turning business data in the database into a format the frontend can consume, involving queries, aggregation, and serialization;
    2. Frontend pages: layout, components, chart rendering, and interaction;
    3. Chart library configuration: many parameters and a high documentation reading cost;
    4. Deployment and access control: environments, account systems, and access control, which are hard to troubleshoot when something breaks.

    The traditional path had only one option: external procurement. The key change this time was that all four hurdles were handed to an AI coding tool, and the individual’s role shifted from “the person who writes code” to “the person who states requirements.” It sounds easy, but stating requirements has its own methodology, and the quality of the expression directly determines the quality of the output.

    3. The First Step Is Requirements Only: Deliberately No Implementation Plan

    The first interaction deliberately avoided any technology selection and instead made three things clear: which charts are needed, where the data comes from, and where the page will live. A reference phrasing:

    1. We have an in-house backend system written in Python. We want to add an
    2. operations dashboard page that shows four metrics by month: outpatient
    3. volume, inpatient volume, bed occupancy rate, and revenue structure.
    4. The data comes from the in-house business database. Please provide a
    5. design first, and do not write code yet.

    The emphasis on “design first, code later” has three reasons:

    • Avoid locking in a framework too early, and hand decisions that are not yours back to the tool;
    • Align metric definitions first to reduce rework;
    • Make the plan reviewable, so the department can judge whether it matches what leadership expects.

    4. Metric Definitions Must Be Unified First

    Data projects fail mostly not because of technology but because of definitions. It is worth locking down the definitions in a table before starting:

    Metric Period Calculation Data source
    Outpatient volume Calendar month Count of visits where registration was followed by a completed consultation Outpatient and emergency business table
    Inpatient volume Calendar month Admissions and discharges counted separately Admission registration and discharge records
    Bed occupancy rate Calendar month Actual occupied bed-days / available bed-days Bed and inpatient records
    Revenue structure Calendar month Share aggregated by revenue category Billing details

    Once the definitions are written down, later prompts can reference them directly instead of explaining them over and over.

    5. Data APIs: Read-Only, Aggregated, Rate-Limited

    The backend’s job is simple: turn wide tables into narrow results. Three engineering constraints are worth keeping:

    • Read-only account: the dashboard needs no write access, which eliminates the risk of accidental changes at the database level;
    • Pre-aggregation: aggregate by month and by department first, so the dashboard does not scan full tables on every refresh;
    • Result caching: operational metrics change at daily granularity, so caching for a few minutes is perfectly acceptable.

    A sketch of the API design (pseudocode, structure only):

    1. @app.get("/api/ops/outpatient")
    2. def outpatient(months: int = 12):
    3. rows = query("""
    4. SELECT month, COUNT(*) AS visits
    5. FROM outpatient_visit
    6. WHERE visit_date >= :start
    7. GROUP BY month ORDER BY month
    8. """, start=shift_months(-months))
    9. return {"unit": "visits", "series": rows}

    Returning series and unit uniformly lets the frontend handle different metrics with the same rendering logic.

    6. Frontend and Charts: Let the Tool Choose, Review It Yourself

    Chart types follow clear conventions: trends use lines, comparisons use bars, rankings use horizontal bars, and shares use stacked or pie charts. A threshold line is a reference-line capability that mainstream chart libraries generally support; you only need to provide the target value and color.

    Writing requirements as constraints rather than steps works better:

    1. Reuse the existing system's login and menu; do not create a separate site;
    2. one chart per metric, with a toggle for the last 6/12 months;
    3. show a red threshold line when bed occupancy exceeds 85%;
    4. follow the system theme colors and fit a 1920x1080 screen.

    7. Deployment, Access Control, and Performance

    Mounting the dashboard inside the existing backend system and reusing the original account login was the most convenient part of this plan: no new operations surface and no separate user system to maintain. If the metrics involve sensitive data such as revenue, it is advisable to control visibility by role and keep access records in the logging service for auditing.

    On performance, three points matter: load only the default time range on first paint; paginate API results or limit the number of months; and show the last successful data on errors so the dashboard is not blank.

    8. Pitfalls Encountered

    • Asking for too much in one prompt made the output hard to review; splitting it into three rounds — design, then APIs, then pages — was more stable;
    • Empty-data handling was not specified, so holiday months showed gaps;
    • Time zone and month boundaries were not agreed on, so cross-month data was attributed to the wrong month;
    • Letting the tool decide chart parameters actually converged faster.

    9. Conclusion

    The real bottleneck for this kind of requirement is not coding ability but the ability to express requirements. Once metric definitions, data sources, where the page is hosted, and acceptance criteria are clearly stated, an IT department can turn “find a vendor” into “deliver it ourselves” with the help of an AI coding tool. General cloud capabilities from platforms such as Baidu AI Cloud, including container platforms, logging services, and monitoring and alerting, can also serve as general options for later runtime and operations support.