Documentation / How to: MDM
How to set up match rules for patients
Set thresholds, weights, blocking keys and vetoes, and test them on a sample before you run.
Before you start
- Who
- Data stewards.
- You need
- mdm:rules.manage.
Choose the type
In Match rules, choose Patient in the left panel. Every type starts with a standard rule set.
Match rules: choosing the resource type in the left panel - Filter – Type part of a resource type name to shorten the list; matching groups open.
- Collapse all – Closes every group.
- Family group – Types are grouped by matching family (people, organizations, canonical definitions…); the arrow opens or closes a group.
- Selected type – The rule set shown on the right; an orange dot means the rules changed since the last MDM run, badges show off (matching disabled) and custom (edited).
Set the thresholds
Automatic merge at and Review at: pairs between the two go to stewards. Minimum attributes says how many attributes must have a value on both sides.
Thresholds and the score bar - Automatic merge at – Pairs scoring at or above this value are merged without a steward.
- Review at – Pairs from here up to the automatic threshold become possible matches in the Remediation queue.
- Minimum attributes – How many attributes must have a value on both sides before a score is trusted.
- Max. blocking group – Blocks with more records than this are skipped – protects against keys like a shared birth date.
- Score bar – The three zones update as you edit: no match, steward review, automatic merge.
- Scale – The two thresholds marked on the 0 to 1 scale.
- Legend – Plain-language reading of the current settings.
Weigh the attributes
Each attribute has a comparator (exact, phonetic, date, edit distance…) and a weight.
Weighted attributes - Attribute – A label for people, and underneath the technical id used by vetoes.
- Where – Element paths read from the record (comma separated), or for a relationship attribute: resource type, referencing path and value path.
- Comparator – How two values are compared (fuzzy text, date, phone, identifier, shared references…). The box below takes JSON parameters.
- Weight – How much the attribute counts when it agrees.
- Penalty – How much it counts against the pair when it disagrees.
- Options – required: a missing value means no match. agree only: only agreement counts, disagreement is ignored.
- Order and delete – Move the attribute up or down, or remove it.
Add blocking keys, rules and vetoes
Blocking keys decide which pairs are compared; deterministic rules match on an identifier; vetoes cap the score when attributes conflict.
Blocking keys, deterministic rules and vetoes - Blocking key – Each key has parts: element paths plus a transform (soundex, first letters, year, digits…). Records sharing a key are compared.
- Deterministic rule – Automatic match without a score, e.g. the same identifier system and value.
- Veto – If the chosen attribute's similarity is below the limit, the score is capped, so a steward must decide.
Test before you save
Test on sample runs the rules on screen over a sample: candidate pairs, automatic merges, reviews and a score histogram. Nothing is written.
The rule tester - Test on sample – Runs the rule set currently on screen – saved or not – over a sample of source records; nothing is changed.
- Result tiles – Sample size, candidate pairs, how many would merge automatically, go to review, or match by identifier.
- Score distribution – How many scored pairs fall in each score band; helps place the thresholds.
Run
Save, then start a matching run on the MDM dashboard.
Start matching run dialog - Scope – Choose which resource types to match. Masters (Patient, Practitioner, Organization…) are always processed before the types that refer to them.
- Start – Starts the run in the background; the dashboard switches to live progress.
TipPut the review threshold where the histogram has few pairs: fewer pairs to review, and fewer wrong merges.