OpenEMR events system and message brokers

My name is Chris from Focalize Health, a healthcare software startup. We’ve built several apps for healthcare admin workflows that sit outside of OpenEMR, and we’d like to keep our systems in sync with OpenEMR data.

Goal
Enable near real-time outbound events from OpenEMR (e.g., patient created, appointment scheduled, vitals recorded) to a message broker (likely RabbitMQ) using pub/sub so external systems can react immediately.

Why here
If this capability is broadly useful, we’d like to implement it in a way that can be contributed back to OpenEMR, rather than a one-off fork.

Initial approach
From a quick review, there appears to be an existing event mechanism (Symfony EventDispatcher). Event coverage looks partial. My plan would be to:

  1. Inventory current events and identify gaps for key domains (patients, encounters, appointments, vitals, users, billing/claims, orders/results, documents, etc.).

  2. Add missing events where appropriate (create/update/delete, status changes).

  3. Create an OpenEMR module to pass-thru the OpenEMR events to RabbitMQ

Questions

  1. Is there an existing feature that already covers this (and I’ve missed it)?

  2. Is using the existing Symfony EventDispatcher the right path?

  3. For the broker integration: should this live as an OpenEMR module or as part of the main codebase?

Any advice so we can develop this in a broadly useful way would be appreciated.

1 Like

To followup, there appears to be an active refactor from an older style of PHP coding to a new service layer. Adding this feature in the middle of a refactor will likely cause headaches, so it’s something we can revisit later.

In the meantime, there are several open source products that can watch the MySQL binlogs for changes and broadcast them for the key updates we need to sync. The tradeoff is that the messages are low-level database changes instead of high-level events, but it works for now.