Use this skill when configuring duplicate detection for Health Cloud patient records, managing Person Account merges in a clinical org, or designing pre-merge clinical record reassignment strategies. Trigger keywords: patient deduplication, MPI, duplicate patients, merge person accounts Health Cloud, clinical record orphan, EpisodeOfCare orphan, PatientMedication orphan. NOT for generic Salesforce data quality or standard deduplication outside Health Cloud.
Use this skill when working with duplicate patient detection, Person Account merges, or clinical record integrity in a Salesforce Health Cloud org. It activates whenever a practitioner needs to configure Duplicate/Matching Rules for patients, perform Account merges while preserving clinical data, or evaluate MPI alternatives.
Gather this context before working on anything in this domain:
Health Cloud does not ship with a native MPI. There is no out-of-the-box enterprise patient identity resolution engine. Duplicate detection relies entirely on standard Salesforce Duplicate Management: Duplicate Rules scoped to the Account object (which covers Person Accounts) backed by fuzzy or exact Matching Rules on fields such as FirstName, LastName, BirthDate, and SSN-equivalent custom fields. For healthcare organizations at enterprise scale or with complex identity-matching requirements (probabilistic matching, cross-system record linkage), a third-party ISV — such as Veeva, ReltioConnect, or Informatica MDM for Salesforce — is the only path to true MPI capability.
Person Accounts are Accounts with IsPersonAccount = true. The merge flow for Person Accounts is the Account merge flow, not the Contact merge flow. Attempting to invoke a Contact merge on the underlying Contact record of a Person Account is unsupported and will produce errors. The standard Salesforce UI (and the Merge Accounts API) merges exactly two Account records at a time: you select a master record, and the losing record is deleted after related records are reparented. This two-at-a-time constraint is a hard platform limit for the standard merge action.
This is the highest-risk behavior in Health Cloud deduplication work. When two Person Account records are merged, standard Salesforce reparenting logic moves related records that belong to the winning record. However, Health Cloud clinical objects — including EpisodeOfCare, PatientMedication, ClinicalEncounter, and custom objects with explicit Account lookup fields — are not automatically reparented. They remain associated with the losing (deleted) Account and become orphaned records. Orphaned clinical records are not surfaced on the winning patient's timeline, care plan, or clinical summary, creating silent patient data loss that is difficult to detect post-merge without explicit audit queries.
When to use: Every Health Cloud org that stores patient records should have at least one Matching Rule and one Duplicate Rule scoped to the Account object to detect potential duplicates at record creation time.
How it works:
FirstName, LastName, PersonBirthdate, and any identity field (e.g., MedicalRecordNumber__c). Use Fuzzy matching for name fields to catch typos. Use Exact matching for identifier fields.Why not the alternative: Applying a Duplicate Rule to the Contact object instead of Account does not cover Person Accounts. Person Account deduplication must be targeted at Account.
When to use: Before merging any two Patient (Person Account) records, reassign all clinical records from the losing account to the winning account. This must happen before the merge DML — not after — because after the merge the losing Account ID no longer exists.
How it works:
merge masterAccount duplicateAccount; in Apex.Why not the alternative: Performing the merge first and trying to reassign clinical records afterward is not possible — the losing Account record no longer exists after merge, and its ID is tombstoned. Queries against the deleted Account ID will return no rows.
| Situation | Recommended Approach | Reason |
|---|---|---|
| Small org, low duplicate volume, single source of truth | Native Duplicate Rules + Matching Rules on Account | Sufficient for controlled intake; no ISV cost |
| Enterprise scale, multi-source patient data, probabilistic matching needed | Third-party MPI ISV (ReltioConnect, Veeva, Informatica) | Native rules only support field-level exact/fuzzy; no cross-system record linkage |
| Merging 2 known duplicates interactively | Standard Account Merge UI or Apex merge DML | Supported path for Person Accounts |
| Bulk merge of hundreds of duplicate pairs | Apex Batch with pre-reassignment loop + merge DML pairs | Only way to handle volume; two-at-a-time limit applies per DML call |
| Clinical records already orphaned post-merge | Apex data fix script querying by known losing Account IDs | No platform-native fix; must reassign via code |
Step-by-step instructions for an AI agent or practitioner working on this task:
Run through these before marking work in this area complete:
Non-obvious platform behaviors that cause real production problems:
merge DML) merges exactly two Account records per call. There is no bulk merge API. Attempting to merge three-way or pass a list of duplicates to a single merge call will throw a compile or runtime error.| Artifact | Description |
|---|---|
| Matching Rule + Duplicate Rule configuration | Account-scoped matching with fuzzy name + exact identifier fields, set to Alert mode for initial rollout |
| Pre-merge clinical record reassignment batch | Apex batch class that accepts losing/winning Account IDs and reassigns all clinical object records before merge |
| Post-merge audit SOQL queries | Per-object queries to confirm zero orphaned records after a merge operation |