Domain specifications / D07-PEX / 8. Integration and Interoperability Requirements
8. Integration and Interoperability Requirements¶
8.1 Integration Overview¶
PEX sits behind the Domain 2 web and API gateways and is reached by patients over the internet. It calls other domains only through their published APIs and subscribes to their versioned events; it never reads their databases (REF-002 section 6). Synchronous calls are used where the patient is waiting for an answer or a policy decision (authorization, consent, reading an item, reading a statement). Durable events and commands with idempotency keys are used for state propagation and for submissions that another domain must act on (appointment requests, correction requests, patient-reported submissions, notifications).
Three rules shape every interface. First, every read of patient data is preceded by an authorization decision from Domain 10 and, for results and documents, a consent and restriction decision. Second, PEX calls to Tier 1 and Tier 2 services are rate-limited and isolated so that portal traffic cannot starve them (PRS 8.2, 12.1; REF-003 section 12.3). Third, data served to patient-authorized third-party applications through the Domain 2 FHIR facade is filtered by PEX release decisions (FR-PEX-ACC-005).
External parties are reached only through Domain 2: external messaging providers (SMS, WhatsApp, email, push), an external patient identity provider where one is approved, and patient-authorized applications. PEX has no point-to-point external connection (PRS 9.1).
8.2 Internal Integration Catalogue¶
| Integration ID | Source Module | Target Module | Purpose | Pattern |
|---|---|---|---|---|
| INT-PEX-001 | All PEX modules | Domain 10 authorization and identity services | Authentication assertions; policy decision per request with patient relationship, grant scope and sensitivity attributes | API |
| INT-PEX-002 | MOD-PEX-002, MOD-PEX-007 / Domain 1 MPI and registration | Domain 1 / MOD-PEX-002 | Identity match and status query; legal-representative record; identity events (PatientMerged, PatientUnmerged, IdentityUpdated); EncounterCorrected with reason "Reattributed after unmerge" (EVT-ADM-026) to move PEX records held under the encounter's CIN (FR-PEX-ACC-004 behaviour 3); demographic correction requests |
API + Event |
| INT-PEX-003 | MOD-PEX-003 / Domain 1 scheduling | Domain 1 / MOD-PEX-003 | Appointment query; appointment events (AppointmentBooked and changes); appointment request command; patient confirmation |
API + Event |
| INT-PEX-004 | Domain 3 and Domain 4 results | MOD-PEX-004 | Result finalized, corrected, cancelled, withdrawn events; result read; review and acknowledgement state | API + Event |
| INT-PEX-005 | Domain 3 clinical documentation | MOD-PEX-004 | Signed and amended document events; patient instructions; document metadata | API + Event |
| INT-PEX-006 | Domain 6 HIM / MOD-PEX-004, MOD-PEX-007 | MOD-PEX-004 / Domain 6 | Document class and portal-releasable flag; disclosure restriction and legal hold events; record-content correction requests; portal access records for disclosure audit | API + Event |
| INT-PEX-007 | MOD-PEX-005, MOD-PEX-007 | Domain 3 clinical record API | File a message to the record; incorporate reviewed patient-reported data with provenance | API |
| INT-PEX-008 | Domain 5 billing | MOD-PEX-008 | Issued statement and payment status query; online payment start request returning the provider's hosted page link; InvoiceIssued, PaymentPosted events |
API + Event |
| INT-PEX-009 | MOD-PEX-009, MOD-PEX-004 | Domain 10 consent service | Directive read; consent action submission; consent decision; ConsentChanged event |
API + Event |
| INT-PEX-010 | All PEX modules | Domain 10 audit service | Audit event delivery through outbox | Event |
| INT-PEX-011 | MOD-PEX-010 | Domain 10 notification service | Notification request; delivery status | API + Event |
| INT-PEX-012 | MOD-PEX-005, MOD-PEX-007, MOD-PEX-004 | Domain 10 workflow service | Review tasks, escalation tasks, hold review tasks | API |
| INT-PEX-013 | MOD-PEX-004, MOD-PEX-005, MOD-PEX-007 | Domain 10 document service | Secure document references; attachment storage | API |
| INT-PEX-014 | All PEX modules | Domain 8 analytics ingestion | Governed engagement events and extracts | Event |
| INT-PEX-015 | MOD-PEX-004, MOD-PEX-006 | Domain 10 terminology, master data and configuration | Value sets, item categories, security labels, facility and service reference data, configuration promotion | API |
| INT-PEX-016 | Domain 2 FHIR / API facade | MOD-PEX-004 | Release decision query for patient-authorized application access | API |
| INT-PEX-017 | Domain 9 pathway runtime, through Domain 3 | MOD-PEX-006 | Assignment of a form or education item as a pathway step, where an approved pathway includes one | API |
| INT-PEX-018 | MOD-PEX-004 | Domain 9 pathway instance and timeline API (IF-EBP-004) | Read of the active pathway plan of a patient (phases, planned next steps, expected timing) for the patient-facing plan view, only after the treating clinician releases it (FR-PEX-REL-005); Could, later release | API (read) |
8.3 External Integration Catalogue¶
All external connections are provided and operated by Domain 2 (ISE). PEX specifies the need.
| Integration ID | External System | Direction | Purpose | Standard / Protocol |
|---|---|---|---|---|
| EXT-PEX-001 | Patient browsers and mobile devices | Bidirectional | Patient-facing experience | HTTPS through the Domain 2 web gateway |
| EXT-PEX-002 | External messaging providers (SMS, WhatsApp, email, push) | Outbound, with delivery receipts inbound | Delivery of minimal-content notifications | Provider REST APIs behind the Domain 10 notification service and the Domain 2 partner gateway (EXT-ISE-013); WhatsApp through the WhatsApp Business Platform via an approved provider, opt-in only (DEC-PEX-010); delivery receipts by signed webhook; replaceable (PRS section 3) |
| EXT-PEX-003 | External patient identity provider, where approved | Inbound | Federated sign-in and proofing assertion | Open federation standard selected by governance; not named in the sources |
| EXT-PEX-004 | Patient-authorized third-party applications | Outbound (data), inbound (requests) | Scoped, revocable patient-authorized access (INT-007) | HL7 FHIR profile selected by governance; SMART on FHIR where selected |
| EXT-PEX-005 | National or regional patient-facing services, where the Indonesia deployment profile requires | None in the first releases | Settled 17 Nov 2026 (GAP-PEX-009): the Indonesia profile places no patient-portal obligation on the hospital. Patients see their national summary in the Ministry's SATUSEHAT Mobile application; SATUSEHAT and SIRS exchange stays with Domain 6 (COMP-PEX-003). The row is kept for a later national patient-facing service | Country profile (PRS 9.4) |
8.4 Interface Specification¶
Interface IF-PEX-001: Patient Experience API¶
Interface Purpose: Serve the patient-facing clients with all portal functions.
Producer: PEX services, through a backend-for-frontend layer (REF-003 section 4.1 lists web and mobile BFFs in the edge and access plane)
Consumer: PEX web and mobile clients
Interface Type: REST API
Protocol and Standard: HTTPS; JSON; versioned under the API catalogue policy (CFG-004)
Authentication and Authorization: Patient session established under FR-PEX-ACC-002; each call authorized by Domain 10 policy decision with subject patient resolved on the server.
Request Structure: Resource-oriented operations per module. The subject patient is taken from the session's link or selected grant. Submissions carry a client-generated idempotency key.
Response Structure: Projection resources with status, dates and "as at" time where applicable; submission resources with state. No internal identifiers of other domains beyond those needed for follow-up calls.
Error Handling: Uniform error model. Authorization failures do not reveal whether the item exists. Function-unavailable errors name the function (FR-PEX-PRT-002).
Idempotency and Duplicate Handling: Submissions are idempotent on the client key for the configured window.
Monitoring and Audit: Request rate, latency, error rate and denied-access counts; audit per section 5 conventions.
Interface IF-PEX-002: Identity Match and Status Query¶
Interface Purpose: Resolve an enrolling person to a patient identity and check identity status.
Producer: Domain 1 (ADM) MPI
Consumer: MOD-PEX-002
Interface Type: REST API (FHIR Patient or the IHE PDQm / PIXm transactions named in PRS 21.3, as selected in the interoperability profile)
Protocol and Standard: As selected by the interoperability profile.
Authentication and Authorization: Service identity for PEX, scoped to match and status operations only.
Request Structure: Identifying attributes listed in the proofing policy, or an enterprise person identifier for a status query.
Response Structure: Match outcome band (single high-confidence, review, none) and enterprise person identifier only for a single high-confidence match; identity status (resolved, under review, merged into).
Error Handling: Failure or timeout is treated as "cannot enrol online"; no partial result is used.
Idempotency and Duplicate Handling: Read-only.
Monitoring and Audit: Every query is audited with purpose "portal enrolment"; repeated queries from one origin are rate-limited.
Interface IF-PEX-003: Appointment Request Command¶
Interface Purpose: Pass a patient's appointment request to scheduling and receive the outcome.
Producer: MOD-PEX-003
Consumer: Domain 1 (ADM) scheduling
Interface Type: REST API command with outcome events
Protocol and Standard: Versioned API; FHIR Appointment profile where Domain 1 exposes one (PRS 21.3)
Authentication and Authorization: Service identity for PEX acting on behalf of the patient; patient and acting identity carried in the request.
Request Structure: Request identifier, type, patient, submitter, service, facility, preferred ranges, reason, target appointment for change or cancel.
Response Structure: Synchronous acknowledgement with Domain 1 work-item reference. Outcome events: under review, booked (appointment identifier), alternative offered, declined (patient-facing reason).
Error Handling: Timeouts and unavailable responses are retried with backoff from the PEX outbox; validation rejections are final and shown to the patient.
Idempotency and Duplicate Handling: Request identifier is the idempotency key; Domain 1 returns the existing work item for a repeat.
Monitoring and Audit: Requests sent, acknowledged, outstanding and aged; reconciliation of PEX request states against Domain 1 outcomes.
Interface IF-PEX-004: Clinician Release Action¶
Interface Purpose: Let an authorized clinician see and act on the release status of an item from the clinician workspace.
Producer: MOD-PEX-004
Consumer: Domain 3 (CLI) clinician workspace (embedding UI-PEX-014 or calling the API)
Interface Type: REST API
Protocol and Standard: Versioned API.
Authentication and Authorization: Workforce identity from Domain 10; authorization requires a care relationship to the patient or responsibility for the result, and the matched rule must permit the action.
Request Structure: Item reference and version; action (release, hold, lift hold, set patient comment); reason code and review date for hold.
Response Structure: Resulting release decision with state, rule and history.
Error Handling: Action refused with reason when the rule or authorization does not permit it, or when the item version is no longer current.
Idempotency and Duplicate Handling: Actions are idempotent on an action key; repeating a release on a Released decision has no effect.
Monitoring and Audit: Every action audited with clinician identity and reason.
Interface IF-PEX-005: Patient Notification Request¶
Interface Purpose: Ask the notification service to deliver a patient notification and receive its status.
Producer: MOD-PEX-010 (and MOD-PEX-003 for reminders)
Consumer: Domain 10 (ESS) notification service
Interface Type: REST API command with status events
Protocol and Standard: Versioned API.
Authentication and Authorization: Service identity for PEX.
Request Structure: Idempotency key, category, template identifier and version, language, channel, recipient contact reference, merge fields, not-before and not-after times.
Response Structure: Accepted with notification reference; status events sent, delivered, failed (with permanence indicator).
Error Handling: Retry with backoff until the not-after time; time-bound reminders are dropped, and recorded as not sent, when they can no longer arrive in time.
Idempotency and Duplicate Handling: Idempotency key prevents duplicate sends on retry or event replay.
Monitoring and Audit: Requests, deliveries, failures by channel and template; backlog age.
Interface IF-PEX-006: Release Decision Query¶
Interface Purpose: Tell another component whether an item is released to a patient.
Producer: MOD-PEX-004
Consumer: Domain 2 (ISE) FHIR / API facade serving patient-authorized applications; Domain 3 clinician workspace; Domain 6 HIM
Interface Type: REST API
Protocol and Standard: Versioned API.
Authentication and Authorization: Service identity, scoped to decision reads.
Request Structure: Patient identifier and one or more item references with versions.
Response Structure: For each item: state, released-at time, and whether the current version is the released version. No clinical content.
Error Handling: On error or timeout the consumer must treat the item as not released.
Idempotency and Duplicate Handling: Read-only.
Monitoring and Audit: Query volume and latency; consumer fail-closed behaviour verified by contract test.
8.5 Event Requirements¶
| Event ID | Event Name | Producer | Consumers | Trigger |
|---|---|---|---|---|
| EVT-PEX-001 | PortalAccessGranted |
MOD-PEX-002 | Domain 8, Domain 10 audit, Domain 1 (optional portal-enrolled indicator) | Account link becomes Active |
| EVT-PEX-002 | PortalAccessChanged |
MOD-PEX-002 | Domain 8, Domain 10 audit and authorization | Link suspended, reinstated or revoked |
| EVT-PEX-003 | RepresentativeAccessChanged |
MOD-PEX-002 | Domain 8, Domain 10 audit and authorization | Grant activated, changed, suspended, revoked |
| EVT-PEX-004 | AppointmentRequestSubmitted |
MOD-PEX-003 | Domain 8 | Request submitted (the command to Domain 1 is IF-PEX-003) |
| EVT-PEX-005 | ResultReleased |
MOD-PEX-004 | Domain 3, Domain 6, Domain 8 | Release decision for a result becomes Released |
| EVT-PEX-006 | DocumentReleased |
MOD-PEX-004 | Domain 3, Domain 6, Domain 8 | Release decision for a document becomes Released |
| EVT-PEX-007 | ReleaseWithdrawn |
MOD-PEX-004 | Domain 3, Domain 6, Domain 8 | Released decision becomes Withdrawn, Withheld or Superseded |
| EVT-PEX-008 | PatientMessageSent |
MOD-PEX-005 | Domain 10 workflow, Domain 8 | Patient or representative sends a message (metadata only) |
| EVT-PEX-009 | FormResponseSubmitted |
MOD-PEX-006 | Domain 10 workflow, Domain 1 (administrative forms), Domain 8 | Form response submitted |
| EVT-PEX-010 | PatientReportedOutcomeReceived |
MOD-PEX-007 | Domain 3, Domain 8 | Patient-reported outcome or item submitted |
| EVT-PEX-011 | CorrectionRequestSubmitted |
MOD-PEX-007 | Domain 8 | Correction request submitted (routing is by command) |
| EVT-PEX-012 | CommunicationPreferenceChanged |
MOD-PEX-009 | Domain 10 notification service | Preference or verified contact point changed |
| EVT-PEX-013 | PatientEngagementRecorded |
MOD-PEX-010 | Domain 8 | Notification requested or delivered, reminder response, item first viewed, education opened |
| EVT-PEX-014 | EngagementControlTotalsReported |
MOD-PEX-010 | Domain 8 | Daily control totals for the previous local day (by 01:00 local); re-sent with a higher version on correction |
PortalAccessGranted, ResultReleased and PatientReportedOutcomeReceived are the event names REF-003 section 4.2 gives for the Patient Engagement bounded context. The other names are defined here.
Common requirements for all PEX events (INF-001 to INF-003, INT-004):
- Purpose. State propagation and engagement measurement. No PEX event carries result values, document content, message bodies or free-text answers.
- Schema and version. Each event has a registered, versioned schema; changes follow the compatibility and deprecation policy (CFG-004, SDLC-006).
- Required identifiers. Unique event ID, event type and version, enterprise person identifier, facility, the PEX entity identifier, the referenced item identifier and version where applicable, and the acting identity type.
- Timestamps and correlation. Event time (when the business fact occurred), recorded time, and the correlation ID of the originating request (DAT-004).
- Delivery and ordering. At-least-once delivery through a transactional outbox. Ordering is preserved per patient and entity for EVT-PEX-002, 003, 005, 006 and 007, where a later event reverses an earlier one.
- Retry and dead-letter. Bounded retry with backoff; undeliverable events go to a dead-letter queue visible on the Domain 2 integration operations dashboard.
- Duplicate detection. Consumers deduplicate on event ID; PEX deduplicates inbound events the same way.
- Retention and replay. Retained and replayable under the Domain 2 event backbone policy. Replay of EVT-PEX-005 to 007 must not cause consumers to re-notify patients; PEX never re-notifies on its own replayed inbound events (PR-NTF-001-1).
For EngagementControlTotalsReported (EVT-PEX-014): the payload follows the Domain 8 control-total contract. It carries the producing domain, facility, business date (local calendar day), cutoff time in UTC, and one line per event type with the schema version and the count of events published with an event time in that day, for PortalAccessGranted, FormResponseSubmitted, PatientReportedOutcomeReceived, PatientMessageSent and PatientEngagementRecorded. It has no amounts and no patient identifiers. It is published by 01:00 local time for the previous local day. When PEX re-publishes or corrects events of a day already reported, it sends the totals for that day again with a higher version.
For ResultReleased in particular: the payload is the result reference and version, release decision ID, release time, release path (automatic by rule, or clinician) and rule set version. Domain 3 uses it to show clinicians that the patient can see the result.
Events consumed¶
The events this domain consumes, as listed in each publisher's section 8.5. The publisher's table is the single record of who consumes an event: to add or remove a consumer, change the publisher's Consumers column and rebuild.
| Event | Name | Producer | Producer's trigger | Condition |
|---|---|---|---|---|
| EVT-ADM-001 | PatientResolved | D01-ADM | A search or cross-reference resolves a person for a workflow | When this domain is the requesting domain |
| EVT-ADM-002 | IdentityUpdated | D01-ADM | Demographic or identifier change | – |
| EVT-ADM-005 | PatientMerged | D01-ADM | Merge committed | – |
| EVT-ADM-006 | PatientUnmerged | D01-ADM | Unmerge committed | – |
| EVT-ADM-007 | PatientRegistered | D01-ADM | Person registered at a facility | – |
| EVT-ADM-008 | EncounterOpened | D01-ADM | Encounter created | – |
| EVT-ADM-011 | PatientDischarged | D01-ADM | Discharge recorded | – |
| EVT-ADM-015 | EncounterCancelled | D01-ADM | Encounter cancelled | – |
| EVT-ADM-019 | AppointmentBooked | D01-ADM | Appointment created | – |
| EVT-ADM-020 | AppointmentChanged | D01-ADM | Rescheduled, cancelled or no-show | – |
| EVT-ADM-021 | AppointmentArrived | D01-ADM | Check-in | – |
| EVT-ADM-022 | WaitlistEntryChanged | D01-ADM | Entry created, priority changed, offered or closed | – |
| EVT-ADM-026 | EncounterCorrected | D01-ADM | Compensating correction of an encounter attribute or transition | – |
| EVT-ISE-001 | InterfaceMessageQuarantined | D02-ISE | A message fails validation or routing | When this domain is the owning domain |
| EVT-ISE-002 | InterfaceMessageDeadLettered | D02-ISE | Delivery attempts exhausted | When this domain is the owning domain |
| EVT-ISE-004 | InterfaceStatusChanged | D02-ISE | Interface lifecycle transition or partner availability change | When this domain is the owning domain |
| EVT-ISE-008 | ServiceStateChanged | D02-ISE | A service becomes Degraded, Unavailable or Normal | – |
| EVT-ISE-011 | FailoverCompleted | D02-ISE | Failover or failback finished | – |
| EVT-ISE-017 | DowntimeDeclared / DowntimeEnded | D02-ISE | Downtime window opened or closed | – |
| EVT-ISE-018 | EventReplayExecuted | D02-ISE | Operator replay completed | When this domain is the owning domain |
| EVT-CLI-002 | ClinicalEntrySigned | D03-CLI | Document signed or co-signed; carries the CIN and the document type (outpatient note, emergency note, discharge summary, death documentation and others) | – |
| EVT-CLI-003 | ClinicalEntryAmended | D03-CLI | Amendment, new version or entered in error; carries the CIN, entry type and document type | – |
| EVT-CLI-024 | MedicationReconciliationCompleted | D03-CLI | Reconciliation signed | – |
| EVT-FIN-002 | InvoiceIssued | D05-FIN | Invoice issued | – |
| EVT-FIN-005 | PaymentPosted | D05-FIN | Patient or payer payment posted | – |
| EVT-FIN-012 | RefundPaid (proposed) | D05-FIN | Refund paid out | – |
| EVT-HIM-003 | ChartCompleted | D06-HIM | Chart status becomes Complete | – |
| EVT-HIM-008 | LegalHoldApplied | D06-HIM | Hold created or scope changed | – |
| EVT-HIM-009 | LegalHoldReleased | D06-HIM | Hold released | – |
| EVT-HIM-012 | DisclosureDelivered | D06-HIM | Release package delivered and logged | – |
| EVT-HIM-016 | CorrectionRequestStateChanged | D06-HIM | Correction request acknowledged, given an outcome (Amended, Partly Amended, Declined) or Withdrawn; carries the HIM state and the portal state it maps to | – |
| EVT-ESS-001 | IdentityChanged | D10-ESS | Account, service identity or role assignment created, changed, suspended, revoked | – |
| EVT-ESS-002 | ConsentChanged | D10-ESS | Directive activated, superseded, expired, withdrawn, entered in error | – |
| EVT-ESS-003 | PolicyUpdated | D10-ESS | Policy or label taxonomy version activated or rolled back | – |
| EVT-ESS-006 | TerminologyPublished | D10-ESS | Code system, value set or concept map version effective | – |
| EVT-ESS-007 | MasterDataChanged | D10-ESS | Master-data or registry entity version published or retired | – |
| EVT-ESS-009 | NotificationStatusChanged | D10-ESS | Delivered, failed, acknowledged, escalated, exhausted, closed, cancelled | When this domain is the requesting domain |
| EVT-ESS-010 | TaskStateChanged | D10-ESS | Task assigned, overdue, escalated, completed, cancelled, failed | When this domain is the owning domain |
| EVT-ESS-011 | ConfigurationChanged | D10-ESS | Configuration version activated or rolled back | When this domain is the owning domain |
| EVT-ESS-012 | StewardshipItemRaised / StewardshipItemResolved | D10-ESS | Item created or closed | When this domain is the reporting domain |
| EVT-ESS-014 | WorkflowInstanceStateChanged | D10-ESS | Instance accepted, completed, failed, cancelled, compensated | When this domain is the owning domain |
8.6 Integration Failure and Recovery¶
- Timeout handling. Every outbound call has a timeout set within the response-time budget of the calling function. A timed-out read results in a function-unavailable notice or a marked read model; a timed-out policy decision results in denial (FR-PEX-PRT-002).
- Retry policy. Reads triggered by a patient are retried at most once within the request. Commands and events are retried from the durable outbox with backoff until accepted or until the retry limit moves them to the PEX exception list.
- Circuit breaker behaviour. A breaker per dependency opens after the configured failure rate and closes after successful probes. While open, PEX sends no traffic to the dependency other than probes, which protects the dependency during recovery.
- Reconciliation. Scheduled jobs reconcile: open appointment requests against Domain 1 work items; correction requests against Domain 1 and Domain 6; submissions against review tasks; release decisions against current source item versions and statuses; links against MPI identity status; notification requests against delivery status. Unmatched or stale items appear on operational work lists (INT-005).
- Manual recovery. Operations staff can re-drive an item from the exception list after the cause is fixed. Re-driving uses the original idempotency key. A missed result correction or withdrawal is recovered by replaying source events for the period; release decisions are re-evaluated without re-notifying patients for unchanged outcomes.
- Data consistency after failure. After any recovery, the release reconciliation must complete before result and document views are re-enabled if the outage could have caused a correction, withdrawal, hold or consent change to be missed. Until then those functions stay unavailable. Other functions resume as their dependencies recover.
- Source-domain downtime. During a clinical downtime in which source domains operate on fallback procedures (BCP-005, BCP-006), automatic release is paused; items reconciled after restoration are evaluated on their source timestamps.
← 7. Domain Data Requirements | Contents | Identifier index | 9. Security, Privacy, and Compliance Requirements →