Before you write a line of code, settle the question most build guides skip: should you build a custom EHR at all? For plenty of teams the honest answer is no — a certified off-the-shelf system fits faster and cheaper, and custom only earns its cost past a real threshold of workflow uniqueness and long-term ownership.
This guide covers both halves: whether a custom build is even the right call, and — once you've settled that — how to actually build one in order, without pretending it's simpler than it is. What an EHR really is, the core modules, the compliance gates (HIPAA, ONC certification, FHIR), the six-step process, and what moves cost.

Quick answer. An EHR (electronic health record) system is clinical software that stores, manages, and shares a patient's complete medical history across multiple care providers — distinct from an EMR, which stays inside a single practice. Building one follows six phases: discovery and compliance scoping, architecture and data model, MVP scope, integrations, compliance validation and security testing, and launch and post-launch.
An electronic health record is a certified, standards-based patient data system built to move information between providers rather than merely store it. That certifiability is the whole point: a chart that only lives on one clinic's server is just a database. Most teams that come to us for custom EHR development services already know this distinction and are past the "digital chart" pitch, asking how to get certified and interoperable — which is where general healthcare software development advice stops being useful.
An EHR holds a patient's full clinical picture across every organization that treats them — labs, medications, allergies, encounter notes, imaging references — and it's built so a different hospital's system can pull that data on request.
Picture a patient referred from a primary care clinic to an oncologist across town. If the clinic runs an EMR, that record stays put — it's a digital chart built for one practice's own diagnosis and treatment workflow, and per ONC's own framing, it "doesn't travel easily" outside that practice. The oncologist starts from scratch: a faxed summary, maybe a phone call, no lab history — the full difference between EMR and EHR comes down to exactly this portability gap.
An EHR is built for the opposite scenario. It's architected so the same record follows the patient — shareable across providers, labs, and specialists, with authorized cross-organization access built into the data model from the start.
ONC notes most vendors marketing "EHR" products today evolved from earlier EMR systems — which is exactly why so many still behave like single-practice charts with a sharing feature duct-taped on.
| EMR | EHR | |
| Scope | Single practice | Cross-provider |
| Data travels with patient | No | Yes |
| Interoperability standard | Not required | FHIR R4 / HL7 v2 |
| Typical origin | Digital chart | Certified, standards-based system |
The distinction is architectural, not cosmetic — an EMR relabeled "EHR" in marketing copy still can't pass ONC's interoperability testing
Most EHR guides skip this question because the honest answer sends some readers to a vendor instead of a dev shop. A certified off-the-shelf EHR is the right call more often than founders expect — custom only wins past a specific threshold of workflow uniqueness and long-term ownership appetite.
Building pays off when the clinical workflow doesn't map to any certified product on the market — a specialty protocol, a novel care pathway, or a data model general EHRs weren't designed to hold. It also pays off when direct control over integrations matters: multiple EHR instances, custom device feeds, or a data pipeline no vendor's API will bend to fit. And it pays off when the buyer is funding the system as a multi-year asset, not a one-time purchase, since ONC certification and Security Rule compliance are ongoing costs that continue long after launch.
A certified system needed live in months rules out custom — ONC certification and HIPAA-by-design work take longer than most software launches. So does an organization that can't staff or fund compliance upkeep past year one, since certified status lapses without maintenance. And in most cases, when an existing certified EHR already covers most of the target workflow, customizing that remaining gap costs less than owning a full system.
If custom is the right call after that filter, the next question is what actually goes inside an EHR — that's where the core modules start.
An EHR is really a bundle of certifiable capabilities working off one shared patient record. Each module below maps to functionality that ONC-ACB testing checks during certification, which is why scoping them early saves rework later.
This is the core data layer — problem lists, medication history, allergies, vitals, encounter notes, all tied to a single patient identity. It's also where USCDI data classes live, since certified systems have to capture and exchange that data set in a structured form. Get this schema wrong and every other module inherits the mess. A medical speech recognition workflow can prepare draft notes for that record, but a clinician should approve them before finalization.
E-prescribing routes medication orders electronically to pharmacies and checks them against drug interaction and allergy data before they go out. Most teams don't build this from scratch — they integrate a certified e-prescribing network (Surescripts is the dominant one in the US), since custom routing logic would need its own certification pass.
Appointment booking, intake forms, and insurance eligibility checks sit here. It sounds like the simplest module, but it's the one clinical staff touch most often per shift — sluggish scheduling UX is a leading cause of EHR abandonment complaints.
RCM handles charge capture, claims generation, and payer submission, usually through clearinghouse integrations using X12 EDI transaction formats. This module is where clinical documentation turns into reimbursement, so coding accuracy upstream directly affects claim denial rates downstream.
Clinical decision support (CDS) surfaces alerts — drug interactions, allergy conflicts, care gaps — at the point of care, based on rules or reference data tied to the patient record. Poorly tuned CDS is the top driver of alert fatigue, so certification testing checks not just that alerts fire, but that they're configurable.
The portal gives patients access to their own records, messaging, and appointment requests — a capability tied directly to USCDI-based patient access requirements. Portal design overlaps heavily with the broader question of how clinical systems expose data to outside interfaces. Our EMR/EHR interface design piece goes deeper on that layer.

Each module maps to a specific ONC-ACB test criterion — scoping them upfront is what keeps certification from becoming a rebuild
HIPAA is an architecture decision made in sprint one — the data model, access control, and logging shipped on day one determine whether ePHI protection is structural or gets stitched in later at far higher cost.
The HIPAA Security Rule groups protection into three buckets. Administrative covers risk analysis, workforce training, and a designated security official. Physical covers facility access and device/media disposal. Technical is where engineers spend most of their time — access control, audit logging, transmission security, encryption of ePHI at rest and in transit.
Teams that treat these as a post-launch audit item find the fix touches the schema, the auth layer, and every service that ever wrote to the patient record. Here is where the discipline actually shows up in the codebase, not the compliance doc:
"The expensive mistake is treating HIPAA as a compliance checklist you run at the end. If audit logging, access control, and encryption aren't in the data model from the first sprint, retrofitting them into a system that already stores PHI costs far more than building them in from day one."
— Sergey Ponomarev, CTO, Purrweb
HHS proposed updates to the Security Rule in late 2024 that push the direction further, collapsing much of the current "addressable" category into "required," with encryption and multi-factor authentication expected at essentially every ePHI access point. That's the compliance floor rising, not a distant maybe. Teams building HIPAA-compliant development practices into their default stack today won't need a rebuild when the rule finalizes.

The 2024 proposal turns most "addressable" Technical safeguards into "required" — encryption and MFA move from best practice to baseline
Most "how to build an EHR" guides stop at HIPAA and call it done. The harder half is proving the API and data model actually behave the way federal rules say a certified EHR must — and that proof doesn't come from an in-house QA team.
Developers don't self-certify. They demonstrate conformance to specific criteria under 45 CFR 170.315 — the rule that spells out exactly which capabilities count as "certified" health IT — through test procedures administered by an ONC-Authorized Certification Body (ONC-ACB). Pass, and the product gets listed on the Certified Health IT Product List.
That's not the finish line. ONC-ACBs run ongoing surveillance against live production systems after certification, not just a one-time lab test before launch. A build that passes the initial suite and then drifts — a schema change, a dropped field, an API response that quietly stops matching spec — can fail surveillance months later. "Certified" describes a system under continuous obligation, not a badge earned once.
The criterion that trips up most teams building "just a database with a patient list" is (g)(10), the Standardized API for patient and population services. It requires responding with a patient's complete USCDI dataset through the US Core Implementation Guide, over HL7 FHIR R4 version 4.0.1, the version ONC mandates. ONC-ACBs validate that conformance using the Inferno test kit — a system that stores patient records correctly but can't pass Inferno on (g)(10) is just an uncertified clinical database with a nicer UI.
Interoperability is where EHR builds quietly fail. A system can pass ONC certification and still fail to exchange a clean referral with the hospital next door. Three pieces matter: FHIR R4, HL7 v2, and TEFCA.
ONC's (g)(10) certification criterion mandates FHIR R4, specifically version 4.0.1, not the newer FHIR R5 spec published in 2023. Teams that build against "the latest FHIR" without checking the certification requirement end up rebuilding integration layers mid-project. R4 is the version USCDI data classes and Inferno test suites are written against.
FHIR compliance alone doesn't guarantee two systems can talk. Integration engineers who've done this work put it plainly:
"FHIR gives you a shared data model, not a shared workflow. Two systems can both be 'FHIR-compliant' and still fail to exchange a referral cleanly because the resource profiles they chose to implement don't overlap."
— Konstantin Romanov, VP Engineering, Purrweb
HL7 v2, currently v2.9.1, is still the workhorse for lab results, ADT feeds, and order messaging, and it runs in parallel with FHIR. Budget for both.
TEFCA adds a third layer: a live network-of-networks connecting Qualified Health Information Networks (QHINs), with the first QHINs designated in December 2023 under a roughly 12-month onboarding process managed by the Sequoia Project. Neither of the two competitor guides reviewed for this piece mentions TEFCA at all — a gap worth knowing about before scoping integrations.
| Layer | What it moves | Status |
| FHIR R4 (4.0.1) | Structured USCDI data via API | Mandated by ONC (g)(10) |
| HL7 v2.9.1 | Lab results, ADT feeds, orders | Still the workhorse, runs in parallel |
| TEFCA / QHINs | Network-of-networks exchange | Onboarding since Dec 2023 |
Most build guides scope FHIR and stop — HL7 v2 and TEFCA still show up in nearly every real integration budget
Building an EHR system follows a strict sequence. The order matters: compliance scoping has to happen before architecture, and validation before launch. Here's the process, step by step.
Discovery starts with the regulatory boundary — mapping which HIPAA safeguards apply, whether ONC certification is in scope, and which data types (PHI, USCDI elements) the system will touch. The feature list comes after. These decisions drive every later step.
The data model has to accommodate FHIR R4 resources and USCDI data classes from day one, even if certification isn't an immediate goal. Access control, audit logging, and encryption-at-rest get designed into the schema at this stage.
MVP scope is a delivery-framework decision, defined the same way any healthcare MVP development project gets scoped: the smallest working record system a real clinical workflow can run on, with lower-priority modules deferred to later phases.
EHR systems rarely stand alone. EHR integration covers lab systems, e-prescribing, billing, and health information exchange, typically via HL7 v2 or FHIR R4 APIs. Each integration point is a new attack surface, so access scoping happens alongside the connection build.
This is a dedicated gate in its own right. The team runs security testing — penetration testing, access-control verification, audit-log review — against the HIPAA safeguard categories scoped in step 1. If ONC certification is the goal, this is also where (g)(10) testing against Inferno happens.
Launch includes data migration from legacy systems, staff training, and a monitoring plan for the safeguards validated in step 5. Post-launch, the compliance posture isn't static — the 2024 Security Rule direction signals tighter requirements ahead.

Steps 1 and 5 are the ones most build guides compress — skipping compliance scoping or security testing is what turns a 7-month build into a 14-month one
The stack matters less than the compliance boundary around it. Any cloud provider needs to sign a Business Associate Agreement (BAA) and offer HIPAA-eligible services — AWS, Azure, and Google Cloud all do, but eligibility is per-service, not account-wide. Pick the wrong storage or logging service outside that eligible list and PHI ends up sitting somewhere the BAA doesn't cover.
On the application layer, the FHIR server is the real architectural decision, not the frontend framework. Teams either stand up an open-source FHIR server (HAPI FHIR is the common pick) or use a managed FHIR service from a cloud vendor, then build the EHR's UI and workflow logic on top of it. That choice shapes everything downstream: how USCDI data classes get handled, how (g)(10) testing goes, how HL7 v2 interfaces connect later.
Forget the single headline number. EHR cost and timeline move on four levers, each pushing an estimate up or down independently.
Certification scope is the biggest lever — a pilot that skips ONC (g)(10) certification moves faster and cheaper than one passing Inferno test procedures for FHIR R4, USCDI data classes, and API documentation. Integration count is next: every HL7 v2 feed from a legacy lab system, every FHIR R4 connection to a payer or pharmacy network, adds mapping, testing, and edge-case handling. Two integrations behave nothing like eight.
Module count matters more than most founders expect — a scheduling-plus-notes MVP is a different animal than one that also owns billing, e-prescribing, and a patient portal, since each module adds its own compliance surface. Compliance-validation and security-testing depth — risk assessments, penetration testing, audit-log verification — scales with how sensitive the data flows are, not with the size of the UI.
As a rough planning range, a founder-facing team should expect a narrow, single-specialty MVP with core charting and scheduling to land around $150,000–$300,000, taking roughly 4–7 months. A fuller multi-module build with interoperability and ONC certification work typically runs $400,000–$900,000+ and 9–14 months, since certification testing runs in parallel tracks that can't be compressed. For a deeper breakdown by module, see our healthcare app development cost guide.
| Lever | Narrow MVP | Multi-module + ONC |
| Certification scope | Skipped | Full (g)(10) + Inferno |
| Integration count | 1–2 | 5–8+ |
| Module count | 2–3 | 6 |
| Timeline | 4–7 months | 9–14 months |
Certification scope alone can double a timeline — it runs on a parallel track that no amount of extra engineers compresses
Everything in this guide collapses into three go/no-go calls. Get these right and the rest — modules, stack, timeline — falls into place.
Build vs buy. A configurable platform (athenahealth, DrChrono, OpenEMR) covers most practices faster than custom development. Custom only pays off when the workflow genuinely doesn't fit existing systems — a new care model, a data structure no vendor supports, or a product built to resell.
Certification scope. ONC certification shapes the FHIR API, USCDI data classes, and audit trail from the start. Reversing that decision mid-build means rework, not a patch.
Compliance-first sequencing. HIPAA safeguards belong in the architecture before the first screen gets designed. Teams that sequence it this way avoid the rebuild that catches everyone else.
➡️ If you're weighing build-vs-buy or need a compliance-aware estimate before committing budget, reach out for a free consultation — we'll scope it against your actual workflow, not a generic template.
Building a custom EHR starts with a build-vs-buy decision, then a scoping phase that locks down which core modules and integrations are actually needed. From there, teams move through data model design, HIPAA-aligned architecture, ONC certification planning (if billing under MIPS/MU incentive programs), sprint-based development, and a staged rollout with clinician pilot testing before go-live.
Most EHR platforms are built around patient charting, e-prescribing, clinical decision support, scheduling, and billing/claims management. Interoperability sits underneath all five as a connective layer — without FHIR R4 or HL7 v2 messaging, these modules stay siloed instead of exchanging data with labs and pharmacies.
Epic and Oracle Health (formerly Cerner) dominate hospital-system deployments, with athenahealth, eClinicalWorks, and NextGen Healthcare common in ambulatory settings. These platforms are a useful reference point for expected feature depth, not a template to copy — a custom build exists precisely because off-the-shelf systems don't fit a specific workflow or patient population.
Cost depends on module count, integration scope, and whether ONC certification is in scope. A narrow, single-specialty EHR with core charting and scheduling typically lands around $150,000–$300,000. A multi-module platform with interoperability and certification work can run $400,000–$900,000+.
A focused MVP with core charting, scheduling, and basic interoperability generally takes 4–7 months. Adding ONC certification testing, multi-role permissioning, and deeper FHIR integrations extends that to 9–14 months.