Case study · Public sector healthcare
Replacing a public hospital's clinical records system without stopping care
The program started as a narrow contract to track supplies for one hospital service. Today it is the institution's own electronic health record: outpatient care, scheduling, prescriptions, emergency, inpatient care, surgery and admissions, used every day by hundreds of clinicians and staff in a public hospital, and expanding to more hospitals.
Published
My role
I lead it end to end and report to the firm's partners. In the same week I map processes on the hospital floor, review code and present progress to hospital and government leadership. I also structured the contract and the work plan in phases.
Constraints
Care can't stop
Emergency, prescriptions and inpatient care run around the clock. Any change had to happen while the hospital kept working.
Regulated, sensitive data
Clinical records follow Mexico's standards (NOM 004 and NOM 024), health data is among the most sensitive personal data there is, and the system exchanges data with federal platforms.
People before software
Staff work in shifts, nights and weekends included, and many had used the previous system for years.
Decisions that shaped it
Leadership announces the rules, not the vendor
I recommended closing the system's rules from day one and having every new control announced as a leadership decision. Exceptions stopped being negotiated case by case.
Close the old system one service at a time
The previous system stopped accepting prescriptions in each service only once all of its staff had been trained.
The patient never pays for the transition
If a physician wasn't trained yet, the prescription was filled anyway and we followed up with the physician.
Coverage first, robustness after
Smaller modules shipped as simple versions in three to four days each, so the cutover date never slipped. They get hardened afterwards.
Design for failure
Application servers in two availability zones, a replicated database with point in time recovery, and a local mirror per hospital designed to keep care going if the internet drops.
Adoption over control
Dashboards of inconsistencies instead of locks that discourage use, and an adoption dashboard per service and per physician that tells us where to train next.
Results
- The previous system was switched off across the whole hospital without interrupting a single service.
- The full legacy patient base was migrated with clinical sign off, checked by totals and by samples against the paper files.
- Duplicate statistical data entry was cut in half, and public health surveillance now gets data daily instead of one to two weeks late.
- Eligibility checks with federal institutions became automatic, removing a manual lookup per patient.
- The contract was extended and the program is expanding to more hospitals.
How it's built
- People
- Clinicians and staff on every shift
- Hospital and government leadership
- Application
- Web application in two availability zones
- CI gate: 3,500+ tests on every deploy
- Data
- Replicated PostgreSQL with point in time recovery
- Local mirror per hospital
- Integrations
- Federal health platforms
- Pharmacy and supplies
- APIs, webhooks and scheduled jobs
- Python, Flask, SQLAlchemy and PostgreSQL on AWS, with a data model of more than 200 tables designed with clinicians.
- Integrations with half a dozen external systems through REST APIs, webhooks and scheduled serverless jobs.
- Continuous integration runs more than 3,500 tests against a real database. No deploy moves forward with a failing test.
- Privacy by design: encryption, role based access on every route and a full audit trail. More than 30 official forms are prefilled from the record.
- The platform's first LLM feature is in production, next to a dashboard that measures how complete clinical notes are.
Team and leadership
- I coordinate about twelve people across development, on site implementation, support and data science, and I review the whole team's code.
- Every week we follow up on commitments with an owner and a date, and every meeting ends with minutes. An AI workflow turns each recording into minutes, project context and specs.
- I designed the structure to scale: one lead per hospital with their own team, with me leading the whole program. I'm training the person who will lead the second hospital.
- I trained the client's own staff to handle tasks that used to depend on the vendor.