Building an EMPI with Medplum patient deduplication

Medplum can host the patient records and workflow around an enterprise master patient index, but matching, merge rules and review logic are work your team designs and owns. This page explains what to build, what to decide and what to confirm.

On this page

Building an EMPI with Medplum patient deduplication: when your team needs one

When several sources create duplicate Patient resources in Medplum, the organization needs one identity per person, and Medplum supplies the surrounding data plumbing rather than a matching engine. The matching and merge logic is custom work that your team or a partner designs, builds and tests. Medplum gives you the FHIR Patient resources, search, history, Bots and Subscriptions to build that logic on, but it does not ship a built-in enterprise master patient index (EMPI) with probabilistic or deterministic matching rules that you can switch on. This page covers the design of that custom work, not a product claim about a feature Medplum does not document.

Simple duplicate cleanup is usually enough when duplicates come from one source, appear rarely, and a staff member can merge them by hand with confidence. An EMPI becomes necessary when patients arrive from several systems such as registration, referrals, labs, devices or partner feeds, each with its own identifiers and data quality, and when downstream clinical, billing or reporting processes need a single trusted patient identity. Ask your data owners how many sources write Patient resources, how often duplicates appear, and which downstream consumers would be harmed by a wrong merge. Those answers set the scope of the matching design before any code is written.

The design decisions that follow are the matching rules that score candidate pairs, the merge rules that decide which field values survive and how linked identifiers are kept, the thresholds that route a pair to automatic handling or to a human reviewer, and the audit records that explain each decision. Confirm with your compliance and privacy leads which of these decisions must be reviewed by a person, and how long match and merge records must be kept, before you commit to an automatic merge policy. The HIPAA Security Rule applies to the electronic protected health information these pipelines handle, so the audit trail is part of the design, not an afterthought.

How source records move through matching, review and merge

The diagram starts with patient records arriving from several source systems through ingestion into Medplum. Each incoming record is compared against candidate matches and scored, then routed in one of two ways: high-confidence pairs follow an automatic link path, while uncertain pairs enter a human review queue. Approved pairs pass to a merge step, and every decision, whether automatic, reviewed or rejected, writes an audit record. Check that the audit trail links back to Medplum resource history, so each merge can be explained after the fact.

Source records flow through scoring to automatic or reviewed merge, with each decision audited.

What Medplum provides and what your team builds for patient matching

Medplum gives you the data layer and the extension points for patient matching, but it does not supply a finished EMPI. The components this work touches are the FHIR R4 API, which holds the Patient records from each source and serves the search calls your matching jobs depend on, Bots for server-side logic that runs candidate comparison and merge steps, Subscriptions that can trigger that logic when new patient data arrives, and access policies that decide which service accounts may read, write or merge patients. All of it persists in the Medplum data store on PostgreSQL. Your team should confirm how each of these behaves on the Medplum version you plan to run before fixing the design.

The matching scores, thresholds and merge rules are not supplied as a finished feature. Your implementing team must define the blocking strategy, the comparison fields and weights, the score bands that separate automatic links from human review, and the survivorship rules that decide which name, identifier or address wins in a merge. Each of these needs test sets built from your own source data, with documented false match and missed match rates reviewed by clinical data owners. Plan this as a distinct work package, because it determines most of the risk in an EMPI and is not a configuration toggle.

Medplum keeps a version history of every write to a resource, which gives your audit team a starting point for questions about when a patient record was linked, changed or merged and by which client. Treat that history as input to your match audit reports rather than as the report itself, since the reasons behind each match decision must be recorded by your own matching logic. Read the sibling topic on resource history on Medplum to confirm how history is read, how soft deletes appear and how history growth affects storage before you decide what to log in addition.

Matching and review approaches and when each fits

This table compares deterministic rules, probabilistic scoring, and a hybrid with thresholds, then sets automatic linking against human-reviewed merges. Read each row for the fit, the main risk and the effort driver, and use it to decide how much of the matching logic your team must build and govern before go-live.

ApproachBest fitMain riskEffort driver
Deterministic on exact identifiersSources that share a trusted national or organization-wide patient IDMissed matches when IDs are blank, reused or entered differentlyConfirming which identifier systems each source actually populates
Deterministic on normalized name and date of birthSmaller populations with clean demographics and a limited number of sourcesCommon names and shared birth dates create false linksDefining normalization for names, dates and transliteration
Probabilistic scoringSeveral sources with inconsistent fields where no single rule is reliableScore weights are hard to explain to reviewers and drift as data changesTuning weights on representative data and documenting each field's contribution
Hybrid with thresholdsMost multi-source EMPI designs that need both clear rules and borderline handlingThresholds set too loosely merge different people; too tight floods reviewersSetting separate auto-link, review and no-match bands with a retest after each change
Automatic linkingHigh-confidence matches where a wrong link is low impact and easy to reverseErrors propagate into downstream records before anyone noticesBuilding reversal logic and link history into the Medplum data model from the start
Human-reviewed mergesBorderline pairs, records with conflicting clinical data or any merge that is hard to undoReview queues grow faster than staff can clear them, causing delaysDesigning the review workflow, reviewer roles and queue prioritization
Audit reports explaining each matchAny deployment that must show why two records were combinedReports omit the rule or score that drove the decisionCapturing matched fields, rule version and reviewer decision in each event

Setup sequence for a Medplum deduplication service

This sequence takes a deduplication service from source inventory to a validated, auditable matching pipeline in Medplum, so that no production merge happens before the team has measured match quality on labeled records. Each step ends with a check that a named owner signs off on before the next step starts.

  1. Inventory sources and identifiers

    The integration lead and clinical data stewards list every system that creates or holds patient records, such as registration, lab, referral and billing feeds. For each source, they record which identifiers it carries (medical record numbers, national or regional IDs, insurance member IDs), how reliable each one is, and which fields are free text. The step is done when every source has an owner, a documented identifier list and a stated expectation about data quality. Stewards review the list before any code is written.

  2. Define the canonical patient model

    The data architect decides which Medplum Patient resource stores the surviving record, which source identifiers are kept as Patient.identifier entries, and how Patient.link is used to point duplicates at the surviving record with a type such as replaced-by or seealso. Each choice is written down with the reason for it. The check is a walkthrough with stewards on several sample patients, confirming that the model keeps every source identifier and that a reader can tell which record is current from the links alone.

  3. Build ingestion with validation

    Engineers build the pipelines that load each source into Medplum, mapping incoming data to FHIR Patient resources and rejecting or quarantining records that fail basic checks such as missing name, date of birth or identifier. Each source's raw messages are retained so that a mapping can be re-run. The step is complete when a test load from every source produces resources that pass validation, and when rejected records appear in a report with a reason code that the stewards can read.

  4. Implement candidate matching in a test environment

    Engineers implement the matching logic, which generates candidate pairs from blocking keys and scores each pair on fields such as name, date of birth, sex, address and identifiers. The matching rules and their thresholds live in version-controlled configuration, not in code paths that are hard to review. All of this runs against a copy of the data in a non-production Medplum project. The check is that candidate counts and score distributions are reviewed with stewards, and that the team can explain why any two given records were or were not paired.

  5. Define merge and survivorship rules

    Stewards and engineers agree which source wins for each field when records are combined, for example which name, address or contact details survive, and which identifiers are carried over. They also agree on conditions that always block an automatic merge, such as conflicting dates of birth or a shared identifier with a different name. The rules are written as versioned configuration and applied only to the surviving record. The check is a sample of proposed merges reviewed by a clinical data steward, with every disagreement either fixed in the rules or recorded as an accepted exception.

  6. Add the human review queue

    Engineers route every pair that falls between the automatic-merge and no-match thresholds, and every pair that hits a blocking condition, into a review queue. Reviewers see both records side by side with the matching evidence and record a decision and a reason. Decisions made in the queue feed back into the matching configuration review. The step is done when reviewers can complete a test batch end to end, and when the queue's volume and reviewer workload have been discussed with the operations owner.

  7. Write audit reports for each match

    Engineers produce a report for every merge, link and rejected pair that records the sources involved, the score and the rules that fired, the survivorship decisions applied, the reviewer if one was involved, and the time of each decision. Medplum's own version history supports this, but the report should be readable without FHIR expertise. The check is that a compliance or privacy reviewer can take one merged patient and reconstruct, from the report alone, why each field has its value and who approved the merge.

  8. Run a labeled test set before production merges

    Stewards build a labeled set of record pairs, marked as the same patient, different patients or unsure, drawn from each source and from the difficult cases seen in earlier steps. The team runs the full pipeline against it and measures false merges and missed matches, then reviews every error with the stewards. Production merges stay disabled until the stewards and the privacy lead accept the results in writing. Any change to matching or survivorship rules repeats this run. The test set itself is kept under access control because it contains patient data.

Merge rules, survivorship and audit reports that explain each match

Survivorship rules decide which values a merged patient keeps, and they need to be written down before the first merge runs. For each field, such as name, date of birth, address, telephone, identifiers and coverage, the team should state which source wins, what happens when two sources disagree, and whether a newer value overrides an older one. Identifiers deserve separate handling: a Medical Record Number from one facility should be kept as a Patient.identifier entry with its own system, not overwritten by another facility's number. Confirm with your clinical and registration leads how each field is weighted, and test the rules against a sample of known duplicates before they touch production data.

In FHIR, a merge is usually represented by keeping one surviving Patient and marking the other as inactive with Patient.active set to false and a Patient.link entry of type replaced-by pointing to the survivor, while the duplicate's Patient.link of type seealso or replaces records the relationship from the survivor's side. Confirm how your Medplum version and your access policies handle links, inactive resources and reads of retired IDs before relying on that pattern, and decide whether downstream systems should follow the link automatically or receive a notification. Every match and merge also needs a stored reason: the rule or score that produced it, the reviewer who approved it (or the fact that it was automatic), the timestamp, and the record versions involved. Medplum's resource history can support this, but the reason itself must be written to a record your auditors can query, such as an AuditEvent or a Bot-written log, so the explanation survives even if a resource later changes.

An audit report for a disputed patient should show every candidate pair the engine considered, the score and rule that linked them, the decision and its reviewer, the survivorship values that were chosen and the values discarded, and the full version history of each affected resource. Reversing a merge is a design question to settle before go-live: decide who may reverse a merge, how the split is recorded, which downstream systems are notified, and how records that were written to the survivor after the merge are reassigned. Then test the reversal path on a copy of production-like data, including a merge that was reviewed, one that was automatic, and one that changed clinical data after the merge. Confirm your reversal and retention procedure with your privacy and compliance team, since the outcome shapes what the audit trail must keep.

Security and privacy controls for patient matching data

A patient matching service holds some of the most sensitive data an organization runs: identifiers, demographics and links between records that describe the same person. The controls below cover who can see candidate pairs, what reaches logs and scoring tools, how reviewer actions are recorded and which HIPAA Security Rule duties apply to the organization and its vendors.

Least privilege for candidate pairs

Candidate pairs expose two patient records side by side, so access to the review queue is access to PHI for every patient in it. Separate the roles that run matching jobs, the roles that review and decide matches, and the roles that administer rules. Confirm in your own environment which Medplum project, access policy and client application each role uses, and test that a reviewer cannot open records outside the queue they are assigned.

Medplum auth docs

Separate review and rule administration

The people who change matching thresholds should not be the same people who approve merges they would benefit from. Keep rule changes under a controlled change process with its own approver, and record the rule version applied to each decision. Illustrative example: a rule change that lowers a score threshold should be reviewed before it affects the next batch, not after.

PHI in logs and scoring tools

Matching pipelines tend to log full records when a score is unexpected, and third-party scoring or notebook tools often receive copies of demographics. Decide which fields may appear in logs, mask or hash identifiers where the team only needs to trace a job, and confirm that any scoring service is covered by a business associate contract before it receives PHI.

Audit logging of reviewer actions

Every merge, split and rejection should record who acted, when, on which resources and under which rule version. These entries support investigations and the access reviews that the Security Rule expects organizations to perform. Confirm that audit events from the review process are retained for the period your policies require and that they cannot be edited by the reviewers whose actions they record.

Security Rule duties for ePHI

The HIPAA Security Rule applies to covered entities, which include health plans, health care clearinghouses and covered health care providers, and to their business associates, for all electronic PHI they create, receive, maintain or transmit. Its 18 standards cover administrative, physical and technical safeguards, and the technical standards include unique user identification and audit-related controls. Map each matching function to the safeguards it relies on and document who owns each one.

Security Rule text

Business associate contract terms

When a vendor hosts, operates or supports a matching service that handles ePHI, the covered entity needs a business associate contract. Under 45 CFR 164.314, the vendor must comply with the Security Rule, flow the same terms down to subcontractors that handle ePHI, and report security incidents, including breaches of unsecured PHI. Ask for these terms in writing before any patient data reaches a test environment.

164.314 text

No HIPAA certification exists

HHS states that no Security Rule standard requires certification and that private certifications do not prevent HHS from later finding a violation. DeployOpen does not issue HIPAA certification. Ask any vendor, including DeployOpen, to show the evidence behind its security claims, and treat HHS enforcement through complaints, reviews and audits as the actual test of compliance.

HHS certification FAQ

Questions buyers ask about building a Medplum EMPI

What does it cost to build patient deduplication on Medplum?

The cost is set by the written scope, not by a list price, and DeployOpen does not publish one. Effort rises with the number of source systems, the number of record types and identifiers each one carries, how messy the existing data is, and how many merge rules your clinical governance group wants to approve. Some costs are one-time, such as design, matching rule tuning, pipeline build and validation. Others recur, such as reviewing the human review queue, retuning rules as sources change and running audit reports. Medplum's own software licensing is a separate line item: its hosted plans are listed on its pricing page, and self-hosting is offered as a free Community option or custom-priced Enterprise Self-Hosted. Ask any partner for a quote that separates build, licensing, infrastructure and ongoing review.

How long does an EMPI build take on Medplum?

Duration depends mainly on how many sources feed the index and how clean their identifiers are. Each additional source adds profiling, mapping to FHIR Patient resources, matching tests and reconciliation work. Poor data quality, such as missing dates of birth, reused medical record numbers or inconsistent name formats, extends analysis and tuning. A realistic plan separates discovery, rule design, a shadow run against copied data, a review workflow pilot and cutover. No duration is supplied for this work, so ask for a timeline in the written scope with milestones tied to named sources and a stated assumption about data quality. Ask what the timeline assumes if the sources deliver extracts late.

What must our team provide for a patient deduplication project?

The project needs three inputs from your side. First, extracts or read access to each source system, including data dictionaries, sample records with known duplicates and the identifiers each source issues. Second, a named clinical governance owner who decides which attributes can survive a merge and who approves changes to matching thresholds. Third, reviewers from registration, health information management or the relevant department who work the human review queue and confirm or reject candidate matches. Also ask for a test environment that matches your deployment, and for the privacy and security approvals needed to copy patient data into it. Put each of these in the written scope with an owner and a date.

Can our internal team build an EMPI on Medplum without a partner?

An internal team can build it if it has engineers who know FHIR resources, Medplum's server and Bots model, and the self-hosted operations that go with it, plus analysts who understand patient identity matching. Most of the risk sits in matching quality and merge governance, so the team also needs the clinical sign-off and reviewer capacity described above. Be realistic about the skills gap: the Medplum server runs on Node.js and TypeScript with PostgreSQL and Redis, and a self-hosted deployment needs its own upgrade, backup and monitoring discipline. A partner can take on part of the build, such as the pipeline, the rules and the audit reporting, while your team keeps ownership of decisions. Decide which parts you will own before you ask for a quote.

Does Medplum include built-in patient matching for deduplication?

The supplied Medplum material describes the platform's components: a FHIR R4 API with GraphQL support, a clinical data repository, Bots for server-side logic, an HL7 client and server, and Medplum Auth. It does not describe a ready-made probabilistic or deterministic patient matching engine for EMPI use. Treat matching as something you design and build on top of the platform, using Bots, Subscriptions and your own rules, and confirm the exact capabilities against the current Medplum documentation before scoping. Also confirm how the platform's resource history supports merge tracking in your version, because audit reports depend on it.

What should we do when an automatic merge turns out to be wrong?

Plan the reversal before go-live. A wrong merge combines two patients' records, so the process must identify the affected resources, restore the separated records, repair downstream references and notify the teams that used the merged chart. Good designs keep each merge decision traceable, record which rule fired and which reviewer approved it, and avoid destructive deletes so the prior state can be read back. Ask the partner in the written scope to describe the unmerge procedure, who authorizes it, how far back the audit report can reconstruct a decision, and how a clinical or privacy incident would be reported. Confirm with your compliance team whether a wrong merge triggers a reportable event under your own policies.

Does the HIPAA Security Rule apply to our deduplication pipeline?

It applies if your organization is a covered entity or business associate and the pipeline creates, receives, maintains or transmits electronic protected health information. The Security Rule (45 CFR Part 164 Subpart C) covers those systems, and it has no certification. Ask a partner to map access controls, audit logging, encryption in transit and at rest, and the handling of copied test data to the safeguards that apply. Business associate contracts under 45 CFR 164.314 also matter if an outside party handles the data. Confirm your obligations with your privacy and legal teams, because this page does not give legal advice.

Limits to confirm before you commit to a design

An EMPI design depends on facts about your environment that no vendor page can settle for you. The cards below list the items to verify first, because each one changes the matching architecture, the review workload and the compliance evidence you will need.

Medplum version and deployment model

Confirm which Medplum version you run and whether you self-host or use Medplum Cloud, because the upgrade path and who patches the platform depend on it. Self-hosted Medplum must move through each minor version in sequence, so a deduplication service built against one release may need rework after an upgrade. Ask whether your deployment is on a supported version, and record which team owns patching. The latest release at research time was 5.2.5, published on October 15, 2026, so check the current release list before you fix a version.

Upgrade guide

Bots or external matching workers

Decide whether the matching service runs as Medplum Bots inside the platform or as external workers that read and write through the API. Bots keep logic close to the data and simplify deployment, but long matching runs compete with other server work. External workers scale separately and suit heavy comparison jobs, but they need their own credentials, monitoring and failure handling. Confirm this choice with your platform team before writing matching code.

Throughput and PostgreSQL sizing

Estimate how many patient records each source sends per day, how many candidate pairs a blocking strategy generates, and how many merges and review tasks result. Those volumes set the PostgreSQL capacity, connection limits and Redis cache sizing for your environment. Load test with copies of your real source feeds, not sample data, and run the test against the same database tier you plan to run in production. Ask your database team to confirm backup and restore timing for the expected data size.

Clinical sign-off for thresholds

Match score thresholds that auto-merge or route to review are clinical and operational decisions, not engineering defaults. Your HIM, patient safety and data stewardship leads should approve the thresholds, the fields that count as strong identifiers and the rules for conflicting values. Record who approved each version of the rules, because an audit will ask. Plan a periodic review of false merges and missed matches using a sample set those reviewers agree on.

Regulatory frame for the data

Identify which regimes apply before you decide how long match decisions and audit reports are kept and who can see them. HIPAA applies to covered entities and business associates for electronic protected health information, and GDPR or NIS2 may apply to EU operations. Ask counsel and your compliance lead to confirm the frame, since no HIPAA certification exists to point to, and HHS enforces through complaints, reviews and audits. The HIPAA Security Rule revision proposed on January 6, 2025 had no final rule as of October 2026.

Projected final action
July 2027
Security Rule text

Time-sensitive facts at research date

Standards, penalty amounts, framework versions and Medplum release status change over time, so re-check every figure in this design before it goes into a plan or a contract. Confirm the current Medplum release and support window, the current HITRUST CSF version if you plan an assessment, and the current HIPAA penalty table. Treat every date in this page as a point-in-time reading and assign an owner to refresh the design when a source changes.

How DeployOpen scopes and delivers patient matching on Medplum

DeployOpen delivers patient matching on Medplum as a fixed-scope engagement, with the scope, deliverables and timeline agreed in writing before any build work starts. The written scope should name each source system feeding patient records, the Medplum project and resource types in play (typically Patient and the identifiers that carry source-system keys), the matching and merge rules to be built, the review queue design, and the audit report format. Deliverables should be listed individually so the client can check each one at acceptance. A quote follows from that written scope, so the more precisely the source systems, data volumes and review roles are described up front, the more closely the quote will reflect the real work.

DeployOpen customizes and tests the matching and merge logic inside the client's own infrastructure, whether that is their cloud account, data center or air-gapped network, so patient data does not leave the environment. Testing should cover known duplicate pairs drawn from the client's data, false-positive cases that must not merge, and the rollback path for a merge that was approved in error. Confirm with your team which environment will hold the test data, who signs off on the test results, and how de-identified or synthetic fixtures will be handled where production PHI should not be copied into lower environments. Medplum's own compliance documentation describes compliance as a shared responsibility, so the boundary between DeployOpen's configuration work and your operating controls should be written into the scope.

Documentation and ongoing support are included in the delivery model on request. Handover documentation can cover the matching rule configuration, the review workflow, the audit report fields and the runbook for re-running ingestion. Retainer support can be added for rule tuning as new sources arrive, Medplum upgrades that touch the matching code, and periodic testing. Ask for these items to be priced separately from the initial build so you can see which costs are one-time and which recur. Confirm with DeployOpen during scoping which of these items each option in the quote includes.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.