Architecture / Decision records / ADR-HIS-093
ADR-HIS-093 patient-identity.v1 1.1 in adm-identity: checks keep the data they ran on, a "same person" item is a pair of one person, identity under review is derived, and the demographic handoff is applied in order and matched again¶
| Status | Accepted |
| Decided | 2026-11-29 by session RC-1-S28-F2 |
| Record | Drafted 2026-11-29; approved 2026-11-30 by the Enterprise Architecture Board |
| Where the rule lives | services/adm-identity/mod-adm-001: IdentityReviews, PersonCommands.recordDemographicChange, ReviewRouter.routeAnswered, PersonStore (identityUnderReview), migration V5__identity_review_and_handoff.sql |
Context¶
RC-2-S01 added version 1.1 of patient-identity.v1 (ADR-HIS-067, answer A to Q-S09-4). It has three parts:
- recordIdentityReview: adm-patient-administration hands over the duplicate prompts a clerk answered at a registration against an existing person, or on a change of an existing person;
- recordDemographicChange: each applied change of an existing person's demographics, in order (INT-ADM-001);
- Person.identityUnderReview: set while any review item of the person is open (GAP-ADM-011, GAP-ADM-012).
RC-1-S09 built the consumer against the stub. The RC-1 gate (RC-1-S28) found that adm-identity serves none of it (issue #207). The contract and the README's points of "The RC-1-S08 fix" say what each operation does. Five things about how the unit does it were left open:
1. The check is to be run "again on the answered data". The request carries only the answer, the held data and the source, not the data that was checked.
2. A "same person" item is for "the selected person and the matched candidate data" (GAP-ADM-011). The contract's example names the person itself as candidatePersonId. DE-ADM-004 stores a pair of two persons.
3. identityUnderReview can be kept on the person, or derived from the open items.
4. The policy action of recordIdentityReview: the call is the clerk's answer, and it creates matches.
5. How the handoff's matching run (PR-REG-002-3, FR-ADM-MPI-002 part 5, INT-ADM-001) treats the prompts the clerk answered for the same change with recordIdentityReview before it.
Decision¶
- A duplicate check keeps the data it ran on.
runDuplicateCheckstores its Demographics and recorded identifiers with the check (duplicate_check.subject).recordIdentityReviewruns the check again on that data, excluding the person the check was run for, if any. It holds the clerk to the stored prompts (PR-REG-003-2), ascreatePersondoes. A check of another person is refused. A check stored before this version has no data, and is answered "run the duplicate check again". - A "same person" item is a pair of one person. Its match names the selected person on both sides. The comparison is between the captured data and the person, and it holds the captured data that was not written onto the person (
held_demographics,held_identifiers), with the registration (registration_id). The pair-order check ofidentity_matchbecomes "not after". A steward cannot merge such an item: the resolution refusesmergewith a message, and "different persons" or "defer" resolve it. Every other answer pairs the person with the candidate, as increatePerson. - The routes of an answered prompt are
ReviewRouter.routeAnswered, following contract point 1: - "same" and "unsure" are review items;
- "different" on a flagged candidate is a review item (PR-REG-003-3), and so is "different" on a pair a steward found different whose data changed since (
previous-non-match); - "different" on an unflagged candidate is stored as a non-match, with no task;
- an open item for the pair takes the answer as evidence and is answered again, so there is one item per pair (PR-MPI-004-1).
High-risk pairs set the ambiguity flag of both persons as before (BR-ADM-007).
4. identityUnderReview is derived, not stored. The person's read computes it from the open review items (routed to review, pending review or deferred) and from records of an unmerge awaiting attribution. It is right whichever route opens or closes an item: creation, a review, a report, a resolution, a deferral coming due. It is not a change of the person, so it does not move the person's version. Moving the version would break the caller's If-Match on the next step of the same registration.
5. recordIdentityReview is authorized as a change of the patient. The decision point is asked for update on adm.Patient, for the person. The clerk's answers to the prompts are a change of the patient (FR-ADM-REG-003 part 3; D01-ADM 9.5 audits a response as a person change), and adm-patient-administration makes the call with the clerk's token. The review items are this unit's consequence of the answers, as they are in createPerson (create on adm.Patient). create on adm.IdentityMatch stays the action of a reported work item (FR-ADM-MPI-004). recordDemographicChange is update on adm.Patient too.
6. The demographic handoff is applied in order, then matched again.
- person.demographics_version holds the last demographicsVersion applied. A lower or equal one answers the person unchanged, and a gap is 412.
- The values of the listed groups replace the person's: name is the official names, alias the others, and the other groups their fields. The person is re-indexed.
- A verification sent with the change makes the person verified.
- IdentityUpdated demographics-changed carries the groups.
- A change of a group matching compares (name, alias, birth, sex, mother, contact, address) is matched again after its commit, in a transaction of its own, with trigger demographic-change (PR-REG-002-3, INT-ADM-001 "submit new or changed identity data for matching"). An engine failure leaves the person duplicate-check-pending, and the existing retry runs the check later (FR-ADM-MPI-002 part 10). A change of citizenship or social attributes is not matched again.
- The clerk's answers for the same change stand. An open item for a pair takes the run as evidence (PR-MPI-004-1). A pair the clerk answered "different person" without an exclusion flag (stored as a non-match with no item, PR-REG-003-3) raises no item while the pair's data is the data the clerk answered, recognised by the pair fingerprint. A flagged pair, or changed data, is routed as usual. So a change handed over without a check, for example by an interface, is matched and reviewed, and a change the clerk already answered does not raise the items the clerk declined.
Consequences¶
- adm-patient-administration's registrations and changes that need a review item complete against the built unit, and the new person after "unsure" shows "Identity under review" (PR-REG-003-4 and 5).
- The held data is stored, but
IdentityMatchinpatient-identity.v1has no field for it, nor for the registration. The steward cannot read either through the API until an ADM contract session adds them as a compatible minor version (handover RC-1-S28-F2, follow-ups). - A "same person" item appears in the steward's queue with one person on both sides. The steward's screen should show the held data, not a second person.
- A person's read and search answer runs one indexed subquery on
identity_match. - A handoff delivered later under the service identity (answered on #207). adm-patient-administration's relay delivers a handoff that waited with its own service identity, with no person's request behind it. The D10 starter policy has no rule that lets a service
updateanadm.Patient. So such a delivery is refused, and that person's later handoffs wait behind it. The owner chose option A on 2026-11-29. A D10 rule permitsupdateonadm.Patientfor the INT-ADM-001 handoff only, to service subjects holding a scope of its own,adm.identity-handoff:write, which is given only to the service identity of adm-patient-administration. adm-identity keeps asking the decision point for every handoff, as now, so nothing bypasses authorization and this unit's code does not change. The rule and the scope are inservices/ess-runtime-decisionand the stacks' service identities, folders this card does not own. A fix session there makes them (handover RC-1-S28-F2, "Needs a person").
Alternatives considered¶
- Send the checked data in the request. That changes the contract, and the stored check is what the clerk answered.
- Make the "same person" item a demographic-reconciliation item. Contract point 1 names the D10 task
adm.duplicate-reviewfor every item. - Not matching again after the handoff (the first version of this record): a change handed over without a check would go unmatched, against PR-REG-002-3 (review round 1).
- Store
identity_under_reviewon the person and set it on every route. Each of the five routes would have to keep it right, and the If-Match problem of point 4 remains.