Best Practices / APIs & SDK / Next Steps
9 of 9Practical guidance, API and SDK examples, and recommended steps to implement, modernize and operate HIS/EHR integrations with Mediloop from sandbox to production.
Inventory source systems, interfaces, messages, identifiers and owners.
Define canonical/FHIR mappings, terminology and source-of-truth rules.
Set authentication, scopes, tenant context, consent/legal basis and certificates.
Use standards, connector SDK and adapters appropriate to each integration surface.
Validate happy paths, errors, retries, duplicates, ordering and reconciliation.
Stage rollout, monitoring, rollback and production support.
| Surface | Examples | Use when | Status classification |
|---|---|---|---|
| FHIR | Patient, Encounter, Appointment, ServiceRequest, Observation, DiagnosticReport, DocumentReference, MedicationRequest, CarePlan, Task | You want modern standards-based clinical data access | FHIR endpoint / resource surface |
| HL7 v2 | ADT, SIU, ORM/OML, ORU, ACK | You must integrate established hospital/interface-engine workflows | Protocol operation |
| CDA / C-CDA / IHE | Clinical documents, MHD/XDS exchange | You need document-centric enterprise/national exchange | Document/profile operation |
| Events / Webhooks | Lifecycle/status/change notifications | You need event-driven synchronization | Planned until backend contract verified |
| Connector SDK | Build adapters, parsing/mapping and operational handlers | You are developing reusable/custom connectors | SDK surface |
| Mediloop REST façade | Simplified domain APIs above standards where useful | You are building a new app or modernizing legacy modules | Planned until route verified |
POST /fhir/ServiceRequest
Content-Type: application/fhir+json
Authorization: Bearer <token>
{
"resourceType": "ServiceRequest",
"status": "active",
"intent": "order",
"subject": { "reference": "Patient/pat_123" },
"encounter": { "reference": "Encounter/enc_456" }
}connector.on('hl7.adt', async ({ message, context }) => {
const parsed = await connector.hl7.parse(message);
const result = await connector.map.toFhir(parsed, {
resources: ['Patient', 'Encounter'],
tenantId: context.tenantId,
});
await connector.fhir.upsert(result);
return connector.hl7.ack('AA');
});| Problem | Recommended behavior |
|---|---|
| Schema / message validation failure | Reject with actionable error; do not partially persist unknown state |
| Temporary downstream outage | Retry with exponential backoff and idempotency |
| Duplicate message/resource | Detect via source identifiers and safely acknowledge duplicate |
| Identity ambiguity | Route to controlled identity-reconciliation workflow |
| Terminology mapping uncertainty | Preserve source code and flag unresolved mapping |
| Out-of-order events | Use event/version timestamps and reconciliation rules |
| Permanent failure | Move to DLQ / exception queue with support visibility |
Choose the right surface for each capability.
Build reusable adapters and protocol handlers.
Complete security, testing and operational readiness.
Validate mappings, standards and rollout plan with Mediloop.