Instance: OpenMRS (IO-Sandbox)
Contents
Login
URL | https://bahmni.s2.openimis.org |
|---|---|
Admin | admin/Admin123 |
User |
|
Other |
|
Instructions |
Description
How Atom Feed Syncs Data to Odoo
Bahmni/openMRS uses an Atom Feed synchronization framework to keep the clinical side (OpenMRS) communicating with the billing and inventory side (Odoo/OpenERP). It relies on event notifications over REST APIs.
Step-by-step process of how data moves from the EMR to Odoo:
1.Action occurs in the EMR:
A user creates or updates a record in Bahmni/openMRS, such as registering a new patient or a doctor prescribing a medication.
2.Event is published to the feed:
OpenMRS acts as the Publisher. It logs this change as an XML event to a specific Atom Feed URL (e.g., the Patient Feed or Drug Feed) and records it in its event_recordsdatabase table.
3.Odoo service polls for updates:
A background service called odoo-connect (or openerp-atomfeed-service) acts as the Consumer. It runs batch jobs that continuously poll the OpenMRS feed URLs looking for new events.
4.Data is pulled via REST API:
When the consumer detects a new event, it makes a REST API call back to OpenMRS to pull the full data packet associated with that specific change.
5.Record updates in Odoo:
The service reformats the data and pushes it into Odoo, creating or updating the necessary record, such as generating a billing quotation for the prescribed drug or adjusting pharmacy inventory. In this usecase for openIMIS, the sandbox will directly creates a claim (Insurance claim out of the medical bill)
6.Sync position is marked:
The consumer logs its progress in a markers table, ensuring it knows exactly where to resume on its next poll and preventing duplicate syncs. If an update fails, it is sent to a failed_events table to be retried later.