Projo FHIR Documentation
0.1.0 - ci-build Switzerland flag

Projo FHIR Documentation - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Subscriptions

Subscriptions

Four managed FHIR Subscriptions wire the orchestrator and sidecar together. Each consuming app's sweeper (every 5 min) reconciles its own Subscription by _tag search (always indexed in HAPI), NOT by criteria — so criteria changes are recoverable without duplicates.

The four managed Subscriptions

Subscription Owner Criteria Queue Managed tag code
cr-events sidecar CommunicationRequest?status=active,revoked&medium=whatsapp&category:not=identity-resolution cr-events sidecar-cr-events
cr-status-events projo CommunicationRequest?status=completed,revoked&category:not=identity-resolution cr-status-events projo-cr-status-events
identity-resolution-events projo CommunicationRequest?status=active&category=identity-resolution-required identity-resolution-events projo-identity-resolution-events
careplan-bootstrap projo CarePlan?status=active&_tag:not=careplan-scheduling|scheduled fhir-events projo-careplan-bootstrap

Subscription channel shape

  • channel.type = message
  • channel.endpoint = channel:fire-arrow-azure-queue:<queueName>
  • channel.payload = application/fhir+json
  • status starts requested; Fire Arrow promotes to active after the channel handshake
  • Projo never resets status (doing so would tear down the live subscription)

Reconciliation

Each app's sweeper (every 5 min) searches for its Subscription by _tag. Reconciliation rules:

  • 0 hits: create the Subscription
  • 1 hit: verify criteria; update if changed (criteria is recoverable)
  • 2+ hits: log warning; keep the first, delete the rest

Per-CarePlan due-event Subscriptions

In addition to the four managed Subscriptions, per-CarePlan due-events Subscriptions are registered via Fire Arrow's $subscribe-due-events operation. These fire Task?status=ready notifications onto the fhir-events queue. Fire Arrow tags the CarePlan with careplan-scheduling|scheduled after subscribing so the bootstrap subscription excludes it.

carePlanMaintenance (daily 2 AM) calls $renew-due-events with a 30-day window.

Fast-path HTTP dispatch

dispatchCrViaSidecarFastPath bypasses the cr-events queue cold start when the sidecar HTTP host is warm. It validates the x-sidecar-dispatch-secret header. This path is strictly additive; the subscription remains the durable fallback.

Azure Storage Queue topology

6 main queues and 7 poison queues:

Main queues:

  • fhir-events (projo)
  • cr-status-events (projo)
  • identity-resolution-events (projo)
  • cr-events (sidecar)
  • wa-inbound (sidecar)
  • wa-status (sidecar)
  • wa-reminder-checks (sidecar)

Each queue has a *-poison counterpart.

Saturation retry

saturationRetry.ts re-enqueues the same notification with exponential backoff and messageTimeToLive=-1 (never expire), ensuring notifications survive HAPI saturation without being dropped.