Registration Service — Event Schemas
Status: populated Owner: TBD Last updated: 2026-04-17 Companion: Service Template · 04 event-driven · NAMING
1. Transport Configuration
| Property | Value |
|---|---|
| Stream | REGISTRATION |
| Subject prefix | REGISTRATION. |
| CloudEvents source | ghasi/registration |
| Envelope | CloudEvents 1.0 via CloudEventsBuilder |
| Storage | File (persistent) |
| Retention | WorkQueue — consumers must ACK |
2. Events Produced
2.1 REGISTRATION.patient.created v1
Trigger: Successful patient create (including provisional, unidentified, newborn).
{
"specversion": "1.0",
"type": "ghasi.registration.patient.created",
"source": "ghasi/registration",
"id": "<uuid>",
"time": "2026-04-17T10:00:00Z",
"data": {
"patientId": "0dbf5a8b-6b19-4d67-bde7-7b7e12b2c4df",
"stablePatientId": "0dbf5a8b-6b19-4d67-bde7-7b7e12b2c4df",
"mrn": "PAT-AAAA-1739999999999",
"tenantId": "aaaaaaaa-0000-0000-0000-000000000000",
"isUnidentified": false,
"isProvisional": false,
"isNewborn": false,
"temporaryEnterpriseKey": null,
"unidentifiedSlaDueAt": null
}
}
Retention class: Long-term (identity lifecycle) — 7 years minimum.
Consumers: scheduling-service, orders-service, immunizations-service, patient-chart-service, laboratory-service, medication-service, population-health-service, audit-service.
2.2 REGISTRATION.patient.updated v1
Trigger: Successful demographics or identifier update.
Payload: Same envelope fields as patient.created (stablePatientId, isUnidentified, isProvisional, isNewborn, temporaryEnterpriseKey, unidentifiedSlaDueAt).
2.3 REGISTRATION.patient.vital-status-changed v1
Trigger: Deceased status recorded or corrected.
{
"data": {
"tenantId": "...",
"patientId": "...",
"stablePatientId": "...",
"deceased": true,
"deceasedDateTime": "2026-04-10T14:00:00.000Z",
"isCorrection": false
}
}
isCorrection = true when a prior deceased state was overwritten.
Consumers: scheduling-service (cancel future appointments), patient-chart-service, population-health-service.
2.4 REGISTRATION.patient.duplicate-detected v1
Trigger: MPI score ≥ 85 aborts create (no patient row created).
{
"data": {
"tenantId": "...",
"matchCount": 1,
"matchIds": ["11111111-1111-1111-1111-111111111111"],
"matches": [
{ "id": "11111111-...", "mrn": "PAT-AAAA-...", "score": 92 }
]
}
}
2.5 REGISTRATION.patient.unidentified-duplicate-review v1
Trigger: Unidentified create succeeds + weak MPI match > 70.
{
"data": {
"tenantId": "...",
"newPatientId": "...",
"mrn": "...",
"temporaryEnterpriseKey": "UNK-AAAA-...",
"matchCount": 1,
"matches": [ { "id": "...", "mrn": "...", "score": 75 } ]
}
}
2.6 REGISTRATION.patient.merged v1
Trigger: Merge executes (source deactivated).
{
"data": {
"survivorId": "11111111-...",
"sourceId": "22222222-...",
"stableSurvivorId": "11111111-...",
"stableSourceId": "22222222-...",
"tenantId": "...",
"involvedUnidentified": false,
"involvedProvisional": false
}
}
2.7 REGISTRATION.patient.unmerged v1
Trigger: Unmerge succeeds; source reactivated.
{
"data": {
"survivorId": "...",
"sourceId": "...",
"stableSurvivorId": "...",
"stableSourceId": "...",
"tenantId": "..."
}
}
2.8 REGISTRATION.encounter.registered v1
Trigger: Encounter created.
{
"data": {
"encounterId": "6a1d3b5a-...",
"patientId": "0dbf5a8b-...",
"stablePatientId": "0dbf5a8b-...",
"tenantId": "...",
"encounterType": "AMB",
"status": "planned"
}
}
2.9 REGISTRATION.encounter.status-changed v1
Trigger: Encounter status transitions.
{
"data": {
"encounterId": "...",
"patientId": "...",
"stablePatientId": "...",
"tenantId": "...",
"previousStatus": "planned",
"newStatus": "arrived"
}
}
3. Events Consumed
| Event | Source | Purpose |
|---|---|---|
portal.appointment.requested | patient-portal-service | Awareness of portal registration intent (read-only) |
4. Delivery Semantics
| Property | Value |
|---|---|
| At-least-once | Outbox relay retries until ACK |
| Deduplication | Consumers use CloudEvents id + domain patientId/encounterId |
| Idempotent consumers | Required — same event may arrive multiple times |