DDemo-EHRSynthetic EHR · Ordina test harness
Synthetic data only — no real PHI

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

Push mode (default)
  1. Connect the Ordina account below and paste its key into that account in Ordina. Set Ordina's base URL here.
  2. Demo-EHR calls POST /integrations/ehr/demo-ehr/orders/bulk on Ordina with 25 NormalizedOrders per request, each with its PDF.
  3. Ordina dedupes on (ehr_source, external_order_id), creates the order in the Outbox queue and returns its ordina_order_id.
  4. After the physician signs, Ordina calls POST /api/v1/orders/:id/signed here.
Pull mode (EHRSyncJob)
  1. Connect the Ordina account below and store its key in Ordina, along with this Demo-EHR base URL.
  2. Ordina calls GET /api/v1/orders?since=last_sync_at page by page, with the account's key as Bearer. It only gets that account's orders.
  3. Ordina ingests the orders into its Outbox and calls POST /api/v1/orders/ack.
  4. 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_BASE_URL=http://54.210.155.182 DEMO_EHR_API_KEY=dehr_fa7f09661b248fb8731f2f11fbb1acb4703c34d8fcb6cad6
Never used · agency.ehrdemo@yopmail.com
Connect an Ordina account

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)

MethodEndpointPurposeUsed for
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()
Auth: Bearer {DEMO_EHR_API_KEY}
Response
{ "status": "connected", "ehr_source": "demo-ehr", "version": "1.0.0", "account": { "name": "ProHealth", "ordina_agency_id": "uuid" }, "agency": {…}, "locations": [...], "orders": { "total": 1000, "unsent": 120 } }
curl
curl 'http://54.210.155.182/api/v1/connection' \ -H "authorization: Bearer $DEMO_EHR_API_KEY"
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
Auth: Bearer {DEMO_EHR_API_KEY}
Response
{ "data": [NormalizedOrder…], "next_cursor": "2026-11-19T09:10:00.000Z|DEMO-100250" | null, "count": 100 }
curl
curl 'http://54.210.155.182/api/v1/orders?since=2026-11-01T00:00:00Z&status=created,failed&limit=100' \ -H "authorization: Bearer $DEMO_EHR_API_KEY"
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
Auth: Bearer {DEMO_EHR_API_KEY}
Response
NormalizedOrder
curl
curl 'http://54.210.155.182/api/v1/orders/DEMO-100001' \ -H "authorization: Bearer $DEMO_EHR_API_KEY"
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
Auth: Bearer {DEMO_EHR_API_KEY}
Response
application/pdf (binary)
curl
curl -o order.pdf 'http://54.210.155.182/api/v1/orders/DEMO-100001/document?version=original' \ -H "authorization: Bearer $DEMO_EHR_API_KEY"
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
Auth: Bearer {DEMO_EHR_API_KEY}
Request
{ "orders": [ { "external_order_id": "DEMO-100001", "ordina_order_id": "uuid", "queue": "outbox" } ] }
Response
{ "acknowledged": 1, "not_found": [] }
curl
curl -X POST 'http://54.210.155.182/api/v1/orders/ack' \ -H "authorization: Bearer $DEMO_EHR_API_KEY" \ -H 'content-type: application/json' \ -d '{ "orders": [ { "external_order_id": "DEMO-100001", "ordina_order_id": "uuid", "queue": "outbox" } ] }'
POST/api/v1/orders/{external_order_id}/statusOrdina reports lifecycle changes back: delivered, returned (with reason), rejected, undelivered.Order lifecycle webhooks (Ordina → EHR)
Auth: Bearer {DEMO_EHR_API_KEY}
Request
{ "status": "returned", "reason": "Wrong physician", "ordina_order_id": "uuid", "occurred_at": "2026-11-19T10:00:00Z" }
Response
{ "external_order_id": "DEMO-100001", "status": "returned" }
curl
curl -X POST 'http://54.210.155.182/api/v1/orders/DEMO-100001/status' \ -H "authorization: Bearer $DEMO_EHR_API_KEY" \ -H 'content-type: application/json' \ -d '{ "status": "returned", "reason": "Wrong physician", "ordina_order_id": "uuid", "occurred_at": "2026-11-19T10:00:00Z" }'
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)
Auth: Bearer {DEMO_EHR_API_KEY}
Request
{ "signed_pdf_base64": "JVBERi0…", "signed_by": "Dr. Scott Schneiderman", "signed_by_npi": "1234567893", "signed_at": "2026-11-19T10:00:00Z", "ordina_order_id": "uuid" }
Response
{ "external_order_id": "DEMO-100001", "status": "signed", "bytes": 48211 }
curl
curl -X POST 'http://54.210.155.182/api/v1/orders/DEMO-100001/signed' \ -H "authorization: Bearer $DEMO_EHR_API_KEY" \ -H 'content-type: application/json' \ -d '{ "signed_pdf_base64": "JVBERi0…", "signed_by": "Dr. Scott Schneiderman", "signed_by_npi": "1234567893", "signed_at": "2026-11-19T10:00:00Z", "ordina_order_id": "uuid" }'
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
Auth: Bearer {DEMO_EHR_API_KEY}
Response
{ "npi": "1234567893", "first_name": "Scott", "last_name": "Schneiderman", "credential": "DO", ... }
curl
curl 'http://54.210.155.182/api/v1/physicians/1234567893' \ -H "authorization: Bearer $DEMO_EHR_API_KEY"
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)
Auth: Bearer {DEMO_EHR_API_KEY}
Response
{ "data": [ { "external_id": "uuid", "code": "02", "name": "ProHealth Hospice San Jose", "service_line": "hospice" } ] }
curl
curl 'http://54.210.155.182/api/v1/locations' \ -H "authorization: Bearer $DEMO_EHR_API_KEY"

Demo-EHR → Ordina (Ordina must expose)

MethodEndpointPurposeUsed for
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
Auth: Bearer {DEMO_EHR_API_KEY} (the order’s account key)
Request
{ "source": "demo-ehr", "sent_at": "…", "count": 25, "orders": [NormalizedOrder…] }
Response
{ "results": [ { "external_order_id": "DEMO-100001", "status": "accepted" | "duplicate" | "rejected", "ordina_order_id": "uuid", "queue": "outbox", "error": null } ] }
curl
curl -X POST 'https://devapi.ordina.health/api/v1/integrations/ehr/demo-ehr/orders/bulk' \ -H "authorization: Bearer $DEMO_EHR_API_KEY" \ -H 'content-type: application/json' \ -d '{ "source": "demo-ehr", "sent_at": "…", "count": 25, "orders": [NormalizedOrder…] }'
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
Auth: Same as bulk
Request
NormalizedOrder
Response
{ "external_order_id": "DEMO-100001", "status": "accepted", "ordina_order_id": "uuid", "queue": "outbox" }
curl
curl -X POST 'https://devapi.ordina.health/api/v1/integrations/ehr/demo-ehr/orders' \ -H "authorization: Bearer $DEMO_EHR_API_KEY" \ -H 'content-type: application/json' \ -d 'NormalizedOrder'
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
Auth: Bearer {DEMO_EHR_API_KEY}
Response
{ "ok": true, "agency_id": "uuid", "ehr_source": "demo-ehr" }
curl
curl 'https://devapi.ordina.health/api/v1/integrations/ehr/demo-ehr/ping' \ -H "authorization: Bearer $DEMO_EHR_API_KEY"

NormalizedOrder payload

Same object in push (orders[]) and pull (data[]). It maps 1:1 to Ordina's NormalizedOrder / orders table.

{ "external_order_id": "DEMO-100001", "ehr_source": "demo-ehr", "target_queue": "outbox", "agency": { "external_id": "uuid", "name": "ProHealth Home Care Inc.", "npi": "1457389210", "ordina_agency_id": "ordina-agency-uuid" }, "office_location": { "external_id": "uuid", "code": "02", "name": "ProHealth Hospice San Jose", "ordina_location_id": "ordina-location-uuid" }, "patient": { "external_patient_id": "70001", "first_name": "Ursula", "middle_name": "N", "last_name": "Tisson", "date_of_birth": "1931-08-10", "gender": "female", "phone": "(408) 555-0134", "address": { "line1": "2635 N First St", "city": "San Jose", "state": "CA", "zip": "95134" }, "medicare_id": "1EG4TE5MK73" }, "physician_npi": "1234567893", "physician": { "npi": "1234567893", "first_name": "Scott", "last_name": "Schneiderman", "credential": "DO", "phone": "(831) 649-0350", "fax": "(831) 649-0351" }, "order_type": "other", "order_type_label": "Hospice Certification", "service_type": "hospice", "discipline": null, "priority": "normal", "order_date": "2026-11-19", "due_date": "2026-12-03", "documents": [ { "document_type": "original", "file_name": "DEMO-100001_Tisson_Hospice-Certification.pdf", "mime_type": "application/pdf", "url": "http://localhost:3100/api/v1/orders/DEMO-100001/document", "size_bytes": 9123, "sha256": "…", "content_base64": "JVBERi0xLjcK…" } ], "raw_payload": { "template": "hospice_cti", "title": "Hospice Physician Certification of Terminal Illness", "…": "all fields printed on the PDF" }, "created_at": "2026-11-19T09:10:00.000Z", "updated_at": "2026-11-19T09:10:00.000Z" }

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.

import { createHash, timingSafeEqual } from "crypto"; export function verifyDemoEhr(authHeader: string, storedKeyHash: string) { const key = authHeader.replace(/^Bearer\s+/i, ""); const h = createHash("sha256").update(key).digest("hex"); return h.length === storedKeyHash.length && timingSafeEqual(Buffer.from(h), Buffer.from(storedKeyHash)); }

Field mapping into Ordina

external_order_idorders.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_idorders.office_location_id (stamped at ingestion)
physician_npimatch physicians.npi → physician_id; unknown NPI → MD Verification
patient.external_patient_idpatients.external_patient_id (upsert)
order_type / order_type_labelorders.order_type enum + metadata.label (UI "ORDER TYPE")
service_typeorders.service_type (Home Health / Hospice / Pharmacy badge)
documents[0]order_documents (document_type = original) → S3
raw_payloadorders.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.