Integration
How Demo-EHR and Ordina talk to each other: which API does what, who calls whom, and the credentials for each direction.
Two ways orders reach Ordina
- Connect the Ordina account below and paste its key into that account in Ordina. Set Ordina's base URL here.
- Demo-EHR calls
POST /integrations/ehr/demo-ehr/orders/bulkon Ordina with 25 NormalizedOrders per request, each with its PDF. - Ordina dedupes on
(ehr_source, external_order_id), creates the order in the Outbox queue and returns itsordina_order_id. - After the physician signs, Ordina calls
POST /api/v1/orders/:id/signedhere.
- Connect the Ordina account below and store its key in Ordina, along with this Demo-EHR base URL.
- Ordina calls
GET /api/v1/orders?since=last_sync_atpage by page, with the account's key as Bearer. It only gets that account's orders. - Ordina ingests the orders into its Outbox and calls
POST /api/v1/orders/ack. - Signed PDFs and returns are reported back the same way as in push mode.
Connected accounts
Only the Ordina accounts listed here can connect. Each one gets its own key and only sees the orders generated for it. Paste the key into that account in Ordina. It is sent as Authorization: Bearer … in both directions.
Demo-EHR → Ordina (push target)
Where pushed orders go. Ordina must expose the three “Ordina must expose” endpoints under this base URL. Each order is pushed with its own account's key. Use Test on an account to check the connection.
Pushes POST to {base}/integrations/ehr/demo-ehr/orders/bulk
API reference: which API is for what
OpenAPI JSON ↗Ordina → Demo-EHR (Demo-EHR exposes)
GET/api/v1/connectionHealth + handshake. Returns which connected account the key belongs to, EHR identity, office locations and that account's order counts.EHRConnector.getConnectionStatus()
GET/api/v1/orders?since=ISO&status=created,failed&limit=100&cursor=…&include=documentPull the calling account's orders created/updated since a timestamp, as NormalizedOrder objects. Cursor-paginated. include=document embeds the PDF as base64.EHRConnector.fetchOrders(agencyId, since) — EHRSyncJob pull mode
GET/api/v1/orders/{external_order_id}Fetch one order (by DEMO-xxxxx order number or UUID) as a NormalizedOrder.Re-fetch / reconcile a single order
GET/api/v1/orders/{external_order_id}/document?version=original|signedDownload the order PDF. version=signed returns the copy Ordina posted back after signature.documents[].url in pushed payloads
POST/api/v1/orders/ackBulk acknowledge orders Ordina pulled so they are not returned again as unsent. Stores Ordina's internal id.End of EHRSyncJob pull cycle
POST/api/v1/orders/{external_order_id}/statusOrdina reports lifecycle changes back: delivered, returned (with reason), rejected, undelivered.Order lifecycle webhooks (Ordina → EHR)
POST/api/v1/orders/{external_order_id}/signedOrdina posts the physician-signed PDF back to the EHR. JSON with base64, or multipart/form-data with a 'file' field.EHRConnector.pushSignedOrder(orderId, doc)
GET/api/v1/physicians/{npi}Look up a physician by NPI as known to the EHR (name, credential, phone, fax, address).MD Verification / physician matching
GET/api/v1/locationsList the agency's office locations so Ordina can map them to office_location_id.Connection setup: location mapping (stamps office_location_id at ingestion)
Demo-EHR → Ordina (Ordina must expose)
POST{ORDINA_BASE_URL}/integrations/ehr/demo-ehr/orders/bulkDemo-EHR pushes orders (25 per request) straight into Ordina; Ordina creates them in the Outbox queue. Idempotent on (ehr_source, external_order_id).Push mode — orders land in Ordina → Orders → Outbox
POST{ORDINA_BASE_URL}/integrations/ehr/demo-ehr/ordersSingle-order variant of the push endpoint (same body as one element of orders[]).Push one order from the Orders tab
GET{ORDINA_BASE_URL}/integrations/ehr/demo-ehr/pingConnectivity + account key check; Ordina returns the agency_id the key belongs to used by the 'Test connection' button.Integration tab → Test connection
NormalizedOrder payload
Same object in push (orders[]) and pull (data[]). It maps 1:1 to Ordina's NormalizedOrder / orders table.
Verifying push requests (Ordina side)
Every push carries Authorization: Bearer <account key>. Ordina looks up which account stored that key; an unknown key is rejected. Use HTTPS outside localhost.
Field mapping into Ordina
| external_order_id | orders.external_order_id (unique with ehr_source) |
| ehr_source = "demo-ehr" | orders.ehr_source |
| target_queue = "outbox" | initial status → Outbox view |
| office_location.ordina_location_id | orders.office_location_id (stamped at ingestion) |
| physician_npi | match physicians.npi → physician_id; unknown NPI → MD Verification |
| patient.external_patient_id | patients.external_patient_id (upsert) |
| order_type / order_type_label | orders.order_type enum + metadata.label (UI "ORDER TYPE") |
| service_type | orders.service_type (Home Health / Hospice / Pharmacy badge) |
| documents[0] | order_documents (document_type = original) → S3 |
| raw_payload | orders.raw_ehr_payload (audit) |
Delivery & API log
No calls yet.
Mock Ordina outbox
What the built-in receiver accepted (loopback mode, or Base URL = http://54.210.155.182/api/mock-ordina). Use it to check the contract before Ordina's endpoint is live.
Nothing received yet.