In short
- Rescue a struggling healthcare software project when its data model is sound, its security gaps can be closed, and the code can be changed safely, and rebuild when the foundation itself blocks what the product must do next.
- Many projects fall in between, and for those the lower-risk path is to replace the system piece by piece while it keeps running, the approach Martin Fowler calls the strangler fig.
- Base the decision on evidence from a short technical audit of the data model, HIPAA safeguards, changeability, integrations and documentation, because frustration with the current code says little about which path is safer.
Rescue a struggling healthcare software project when its data model is sound, its security gaps can be closed, and the code can be changed without breaking something else each time. Rebuild when the foundation itself blocks what the product must do next, for example multi-tenant white-labeling, a reliable audit trail, or role-based access the design never allowed for. Many projects sit in between. For those, the lower-risk path is usually to replace the system piece by piece while it keeps running. Either way, base the decision on evidence about the system; how frustrating the current code feels says little about whether it can carry the product.
Why is a full rewrite riskier than it looks?
A rewrite promises a clean start. The cost is time without progress. In his essay Things You Should Never Do, Joel Spolsky calls Netscape's decision to rewrite its browser from scratch the company's single worst strategic mistake: it went about three years without a meaningful release while competitors moved ahead.
His second point matters even more in healthcare. Old code that looks strange often contains bug fixes. That odd branch may handle a rare edge case someone found after weeks of real use. Throw the code away and you throw away those fixes, then rediscover them in production.
Martin Fowler makes the same case from the other side: replacing a serious system takes a long time, and the users cannot wait for new features. He prefers gradual modernization, where new parts grow around the old system until it can be retired.
Healthcare adds its own costs to a rewrite. Patient data has to be migrated without loss and with its history. Access rules and audit logs have to be rebuilt and checked. Clinicians and staff have to be retrained. Every integration with an EHR, lab, payer or device has to be tested again.
What should you inspect before deciding?
Look at five areas. For each, ask whether it can carry the product for the next few years, however the code looks.
1. The data model
This is the hardest thing to change later. Check whether patients, encounters, users, roles and organizations are modeled clearly, and whether the model can hold what the roadmap needs. A product that must become multi-tenant but stores every customer's data with no tenant boundary is a rebuild signal. A model that is messy but correct is a rescue signal.
2. Security and HIPAA safeguards
Compare the system to the HIPAA Security Rule. Under 45 CFR 164.312, unique user identification and an emergency access procedure are required. Automatic logoff and encryption of electronic PHI are addressable specifications. Audit controls that record and examine activity, integrity protection, person or entity authentication, and transmission security are standards in the same section. Under 45 CFR 164.308, you also need an accurate and thorough risk analysis and security measures that reduce risks to a reasonable and appropriate level.
Missing controls can usually be added: an idle timeout, encryption at rest, stronger authentication. It is harder when the design cannot tell users apart, for example shared logins, or when there is no reliable record of who viewed or changed a patient record. If adding those means touching every screen and every query, weigh that in the rebuild column.
3. Changeability
Ask the team to make one small, real change and watch it ship. How long did it take? Did tests catch problems, or did someone check by hand? Is there an automated build and deploy? Can you run the system on a laptop? Code that is ugly but well tested can be rescued. Code that nobody dares to change is expensive whatever you decide.
4. Integrations
List every connection: EHRs, labs, payers, devices, messaging, payments. For each, note the standard used (FHIR, HL7 v2, a vendor API, files), who maintains it, and whether it is documented. Integrations are often the hardest-won part of an old system, because they took the longest to get right with the other side. Keeping them working is a strong argument for replacing the system gradually.
5. Knowledge
Is there a specification? Can anyone explain why the system works the way it does? Are the original developers reachable? When knowledge is missing, a rescue starts with discovery, and so does a rebuild. The difference is that a rescue can learn from running code.
How do you score rescue versus rebuild?
Give each area a score from 0 to 2, where 0 means it blocks the roadmap, 1 means it needs serious work, and 2 means it is fit for purpose. Then read the result with a few rules rather than a single total:
data_model, security, changeability, integrations, knowledge: each 0, 1 or 2
if data_model == 0 and security == 0 -> plan a rebuild, keep integrations as reference
if data_model == 2 and changeability >= 1 -> rescue in place
if data_model >= 1 and integrations == 2 -> replace piece by piece around the integrations
otherwise -> run a short spike on the riskiest area, then score againThis is a heuristic with no research behind it. It is useful because it forces the team to write down evidence for each score, and it puts the data model and security first because they are the most expensive to change later.
What does replacing a system piece by piece look like?
Fowler's strangler fig pattern grows new components alongside the legacy system, moves behavior over a piece at a time, and adds seams so parts can be replaced independently. Temporary transitional code lets old and new run together until the migration finishes. In a healthcare product, plan these pieces up front:
- A routing layer in front of both systems, so each feature can be moved without users noticing.
- One identity and access model shared by old and new parts, so a user's permissions are the same everywhere.
- Audit logging that covers both systems, so every view or change of PHI is recorded during the transition too.
- A data sync strategy with one source of truth for each record type at any moment.
- Hosting for the new parts covered by the same BAA chain as the old ones.
- A retirement date for each old module, so the transition does not become permanent.
Fowler also notes that organizational change has to go with the technical work. If the process that produced the old system stays the same, the new one can drift into the same state.
What does a justified rebuild look like?
Sometimes a rebuild is the right call. A digital health company in Australia wanted white-label software that lets healthcare organizations launch branded apps for patients, carers and family networks. The previous codebase and design were outdated, and the platform needed a full rebuild before it could support white-labeling at scale. There was no specification for developers to work from.
We rebuilt the platform from scratch, using the previous materials as references, and started with discovery before any delivery: a review of the existing UX, a detailed user flow, a defined MVP scope and a full specification. The Home page went through 10 versions with user and UX testing. We built mobile apps in React Native for iOS and Android plus a web dashboard, with access control for five user roles. Six apps now run on that foundation, and the partnership has continued since 2017.
The rebuild was reasonable because the product needed a capability, white-labeling at scale, that the old foundation could not carry, and there was no specification to rescue against.
What mistakes make the decision harder?
- Deciding to rewrite because the code is unpleasant to read, without checking whether it works.
- Freezing all features for the length of a rebuild, so users and sales wait with nothing new.
- Underestimating data migration, especially history, attachments and audit records.
- Leaving compliance and clinical users out of the decision until the new system is nearly done.
- Scoring the project on gut feeling instead of a written assessment of each area.
What should a technical audit give you?
Before you commit budget either way, get a written assessment that covers the five areas above, lists the security gaps against the HIPAA Security Rule, maps every integration, and recommends rescue, piece-by-piece replacement or rebuild with reasons. A good audit also says what it could not check.
Talk to an engineer at Onix Health about your project. Onix Systems has built software since 2000 and has 370+ engineers. Our 5-day free technical audit ends with a written report, so you can make the rescue or rebuild call on evidence.