Architecture / Decision records / ADR-HIS-053
ADR-HIS-053 The identity unit: module split, the matching engine and its scale, review routing and the D10 stand-ins¶
| Status | Accepted |
| Decided | 2026-11-25 by session RC-1-S08 |
| Record | Drafted 2026-11-25; approved 2026-11-25 by the Enterprise Architecture Board |
| Where the rule lives | services/adm-identity/ (its README.md; mod-adm-001/.../matching/, review/; mod-adm-003/) |
Context¶
RC-1-S08 builds services/adm-identity: MOD-ADM-001 (enterprise MPI and identity matching) and MOD-ADM-003 (identifiers). It serves patient-identity.v1 (ADR-HIS-049) for FR-ADM-MPI-001 to 003 and FR-ADM-XRF-001.
The specification leaves these open: - the choice of matching algorithm, which the PRS leaves open (ADM-004); - how the Fellegi-Sunter weights of CFG-ADM-001 become the 0 to 100 score that the CFG-ADM-002 bands are set on.
The unit also depends on four D10 services that it has no client for yet: - the registry of assigning authorities (IF-ESS-007); - the configuration service that approves and activates matching versions (IF-ESS-012); - the workflow and task service (IF-ESS-010); - the audit intake (IF-ESS-008).
How the work is split between the two modules is open too, and so is how a Java unit runs the Node.js contract tools of FN-S04.
Options considered¶
- Module split.
- Each module serves its own operations, with each calling the other: rejected, because Gradle forbids a dependency cycle and ArchUnit forbids crossing outside
api. - Chosen: MOD-ADM-003 is the identifier register beneath the person. MOD-ADM-001 owns the person and all of patient-identity.v1.
- Score.
- Normalise over every configured attribute: a missing attribute then lowers the score, which PR-MPI-002-1 forbids.
- Normalise over the compared attributes only: two bare names that agree then score 100.
- Chosen: normalise over the compared attributes, with a minimum evidence weight.
- Matching library. Chosen: none. Jaro-Winkler, a Soundex-style phonetic code and the Indonesian normalisation are a few hundred lines of the unit's own code, behind
IdentityMatcher. No dependency was added. - Creation.
createPersontakes a transaction-scoped advisory lock per blocking key of the new data, in sorted order, then runs the duplicate check again inside its transaction. Creations that could be the same person are therefore serialized and see each other (PR-REG-003-2). An "unsure" answer creates the person with a review item (FR-ADM-REG-003 part 6.3). The person is provisional, as WF-ADM-001 registers an uncertain identity, until RC-1-S03 Q3 is answered; the settinghis.adm.registration.identity-status-after-unsure(defaultprovisional) carries that answer. - Review items.
- Let D10 create the task from DuplicateReviewRequested: the contract asks the unit to call createTask (contract point 6).
- Chosen: call createTask from a local queue.
- D10 stand-ins.
- Stop until the D10 clients exist: rejected, because session rule 12 says to build against contracts and stubs.
- Chosen: one class per dependency, each easy to replace.
Decision¶
- Modules.
mod-adm-003holds the identifier assignments (DE-ADM-002), and a registerissued_valueof every value ever assigned under an authority and type. No statement deletes or updates that register, so a value is never issued again (BR-ADM-003). - The No. RM sequence of each facility takes a row lock (PR-XRF-001-1). It allocates from 1 to 89999999, and skips a value already in the register.
- The downtime range 90000000 to 99999999 is issued in blocks per registration point (PR-XRF-001-3).
mod-adm-001depends onmod-adm-003throughmod003.api.IdentifierRegistryonly. It holds the person, the engine, the routing and the HTTP layer. A command takes the person's row lock first, so every identifier change of one person is serialised.- Engine.
IdentityMatcheris the stable contract (FR-ADM-MPI-002 part 6.3).IndexIdentityMatcherblocks on the keys of CFG-ADM-001: NIK; each name token's phonetic code with the year of birth, plus or minus one; date of birth with sex, also with day and month swapped; mobile number. It then scores each candidate withPairScorer: - the weights and comparators of CFG-ADM-001;
- names normalised (case, diacritics, titles and the old spelling) and compared in any order, aliases included;
- the deterministic rule DET-NIK-DOB of DEC-ADM-002.
- Score.
score = (sum − least) / (max(most, minimumEvidence) − least) × 100. Here most and least are the agreement and disagreement weights of the attributes actually compared. A missing attribute adds nothing and does not widen the scale (PR-MPI-002-1), and the evidence shows it as not compared. minimumEvidenceWeightis 13 in CFG-ADM-001@1: name, date of birth and sex. Below that a pair cannot reach the high-confidence band.- DET-NIK-DOB makes a pair high-confidence, unless the name or the sex disagrees. Then the pair is placed in the review band as a high-risk case (PR-MPI-002-3).
- The values are starting points, re-tuned on the legacy data before go-live (CFG-ADM-001, CFG-ADM-002).
- Routing (
ReviewRouter, FR-ADM-MPI-003). Automatic merge is none (DEC-ADM-002). A policy that would permit one is treated as none, because merge itself is FR-ADM-MPI-005 (RC-3). - A pair in the high-confidence or review band becomes a review item, and so does a pair with any exclusion flag in any band (part 6.3). The flag gives the route reason, and the pair is prompted to the clerk.
- No newborn age is assumed: CFG-ADM-001@1 has no
newbornAgeDays, so the newborn flag is not derived from a date of birth until a configuration version sets one (Q-S08-2 of the handover). - The clerk's answer is stored on the match and never removes the item (contract point 5).
- A pair a steward adjudicated as different persons is re-queued only when its matching-relevant data changed. A digest of both sides tells whether it did (PR-MPI-003-2).
- An open item for a pair is not duplicated (PR-MPI-004-1).
- A high-risk case sets the ambiguity flag of both persons (BR-ADM-007).
- Twins means the same full date of birth, the same address or family name, and different given names.
- Review items. A request to the D10 task service is written in the transaction that routes the match. It is submitted afterwards with the match identifier as Idempotency-Key, and retried with backoff while the service is unavailable (FR-ADM-MPI-003 part 10). DuplicateReviewRequested is published in the routing transaction, without a task identifier.
- Stand-ins. Each has one class, and each is replaced when its client exists:
- assigning authorities:
AuthorityCatalogue, the systems of the contract README. BPJS and KK use namespaces of their own until D10 registers theirs; - matching configuration versions:
MatchingConfigurations, the tablematching_configurationwith the CFG-002 lifecycle. CFG-ADM-001@1 is seeded from D01-ADM section 13, and activation without a recorded approval is refused; - reference data sets: tables loaded by
Benchmarks.loadReferenceDataSet; - the NIK area code: checked only for its shape, until the Kemendagri value set is reachable.
- Audit. The unit's copy of the kit emits the audit intake schema, as
services/ess-auditdoes (RC-1-S04), and every event meets its category in D10-ESS 9.5.AuditTrailmakes the events: - record access: one event per person returned or opened, with the query criteria;
- record change: the record's version and the changed field names, with no values. The values stay in the record's own history;
- configuration: before and after values.
A refusal is audited under the action's own event type, with outcome denied, or failure for an outage. The policy request names the patient patientRef, as the ESS contract does.
- Contract test. A Java unit runs his-contract verify and validate-event in the pinned node:22.18-bookworm image, the one RC-1-S03 used. The container shares the host network to reach the unit on its test port. The unit is seeded per operation with the records that the contract examples name.
Rationale¶
- The register below the person is the only split without a cycle. It also keeps never-reuse in one primary key that nothing deletes, instead of in a rule each caller must keep.
- The normalisation follows PR-MPI-002-1 literally: no silent inflation or deflation from missing data. The minimum evidence weight closes the one hole that rule leaves, so thin data cannot look certain.
- Sending every high-confidence or flagged pair to a steward, whatever the clerk answers, is the safe reading of BR-ADM-001 and DEC-ADM-002, and it is what the contract fixes.
- Each stand-in is one class, so the D10 clients replace it without touching the requirements' code.
Consequences¶
- The thresholds and weights are configuration. A new version is benchmarked with
startMatchingBenchmark, and approved and activated through the governed lifecycle. Past results keep their version (FR-ADM-MPI-002 part 6.7). - On the synthetic identity safety set (TEST-ADM-031), CFG-ADM-001@1 sends every same-person pair to a steward (recall 1.0). One pair of twins reached the high-confidence band, flagged and so reviewed. This is evidence for the tuning that governance approves.
- The D10 clients (IF-ESS-007, IF-ESS-012) and the reference data import are follow-ups. Merge, unmerge and the steward's decisions (FR-ADM-MPI-004, 005) come in RC-3, and they set
adjudicationandstateon the match records this unit stores. - Every service unit is affected by three kit changes: problem
errors, the audit payload, andpatientRef. Each belongs in the template, by a session whose card covers it.