Skip to main content

Stage 6 — DISPATCH

What happens

Dispatch runs asynchronously after the FHIR write succeeds. Three things happen concurrently:

  1. FHIR subscription fan-outSubscriptionEventDispatcher evaluates 17 seeded subscriptions
  2. JamConnect POST_WRITE — clinical intelligence event routing
  3. DHIS2 push — for notifiable disease LOINC codes (optional)

FHIR subscriptions

JamBridge ships with 17 seeded FHIR subscriptions that cover common hospital chain scenarios:

#CriteriaChannelPurpose
1–3Patient?MLLP to other branchesCross-branch patient sync
4–6Encounter?FHIR RESTEncounter propagation
7–9Observation?code=CBCFHIR RESTCritical lab result routing
10–12MedicationRequest?FHIR RESTPharmacy notification
13–14DiagnosticReport?SMSCHW alerts
15–17Condition?FHIR RESTDisease surveillance

Custom subscriptions can be added via the JamBridge admin API.

JamConnect POST_WRITE

After every successful FHIR write, JamBridge fires a POST_WRITE event to JamConnect:

POST /jamconnect/events
Host: jamconnect:8091

{
"eventType": "POST_WRITE",
"resourceType": "Patient",
"patientGoldenId": "GOLDEN-00441",
"facilityCode": "BRANCH-01",
"transactionId": "BR01-26060612-001"
}

JamConnect evaluates its rule engine (5 rules per event in virtual threads):

  • IPS cache invalidation in JamSHR
  • CDS Hooks dispatch to clinician portals
  • Critical value alerts to clinical staff
  • Escalation timer start
  • DHIS2 surveillance triggers

DHIS2 surveillance

When an ORU message contains a notifiable LOINC code (dengue, malaria, TB, cholera), JamBridge pushes a data value to DHIS2:

POST /api/dataValueSets
Host: dhis2

{
"dataValues": [{
"dataElement": "DE_DENGUE_NS1",
"period": "20260612",
"orgUnit": "OU_BRANCH_01",
"value": "positive"
}]
}

This is non-blocking — a DHIS2 failure does not affect the pipeline or the ACK.