Version: 1.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Last Updated: 2026-02-16
Source: EHR_PM_PLANNING_BUNDLE.md This document catalogs external (out-of-platform) integrations for EHR and Practice Management: clearinghouses, payer APIs, PDMP, HIE, e-prescribing, and lab. Entries may be Implemented (operational), Blocked (requires external verification or blocked by external requirements), or Planned (specified but not yet implemented).
Quick Reference
| Integration Type | Status | Key Standards | Spec |
|---|---|---|---|
| Clearinghouse (EDI) | 📝 Planned | X12 837P/I, 835, 270/271, 276/277 | PM-15 |
| Payer ePA | 📝 Planned | Da Vinci CRD, DTR, PAS | PM-10 |
| Arizona CSPMP (PDMP) | 📝 Planned | State API / PMP Gateway | CL-17 |
| HIE (Contexture) | 📝 Planned | C-CDA 2.1, XDS/XCA, ADT | CL-12, CL-16 |
| EPCS | 📝 Planned | NCPDP SCRIPT 2023011 | CL-06 |
| Lab / LIS | 📝 Planned | HL7v2, FHIR DiagnosticReport | CL-09 |
Status Legend
- ✅ Implemented - Integrated and operational
- 🟡 In Progress - Implementation underway
- ⚠️ Blocked - Requires external verification or is blocked by external requirements (e.g., OAuth app verification, vendor approval)
- 📝 Planned - Specified; not yet implemented
Catalog
| Name | Type | Standard / API | Status | Spec Reference | Notes |
|---|---|---|---|---|---|
| Clearinghouse (generic) | Clearinghouse / EDI | ANSI X12 837P, 837I, 835, 270, 271, 276, 277 | 📝 Planned | PM-15 | Claims submission, remittance, eligibility, claim status |
| Payer FHIR ePA | Payer API | HL7 Da Vinci CRD, DTR, PAS | 📝 Planned | PM-10 | CMS-0057-F; payer API requirements Jan 1, 2027 |
| Arizona CSPMP (PDMP) | PDMP | PMP Gateway / HIE / third-party; state API | 📝 Planned | CL-17 | EMR vendor integration deadline Dec 31, 2026; A.R.S. § 36-2606 |
| Contexture (AZ HIE) | HIE | DirectTrust, C-CDA 2.1, XDS/XCA, ADT | 📝 Planned | CL-12, CL-16 | Care coordination, document exchange |
| Waystar Coverage Detection | Coverage Discovery | REST/JSON; Waystar Coverage API | 📝 Planned | PM-60 | BAA: required (existing Waystar BAA may amend); data classes: PHI (name, DOB, SSN); transport: REST over TLS 1.2+; Phase 1 candidate vendor for self-pay coverage discovery |
| pVerify Coverage Discovery | Coverage Discovery | REST/JSON; pVerify API | 📝 Planned | PM-60 | BAA: required (new); data classes: PHI; transport: REST; alternative vendor for adapter pattern |
| Inovalon Coverage Discovery | Coverage Discovery | SOAP/REST hybrid | 📝 Planned | PM-60 | BAA: required; strong retroactive Medicaid panel; alternative vendor |
| Apple Push Notification Service (APNs) | Push Notifications | HTTP/2 binary protocol | 📝 Planned | PM-59 | BAA: not applicable (Apple does not store payload — generic, no-PHI titles only); transport: TLS 1.2+; per HHS HIPAA mobile guidance |
| Google Firebase Cloud Messaging (FCM) | Push Notifications | HTTP/REST | 📝 Planned | PM-59 | BAA: required (Google Cloud BAA); transport: TLS 1.2+; no-PHI payloads only |
| Stripe (Apple Pay / Google Pay) | Payments / Wallets | PaymentRequest API + Stripe REST | 📝 Planned | PM-59, PM-45 | Existing Stripe BAA; PCI SAQ-A scope (tokenized; no PAN handling) |
| Medplum FHIR Server (or alternative) | FHIR R4 / SMART App Launch | FHIR R4, SMART App Launch v2.0.0, US Core 7.0 | 📝 Planned | PM-55 | Vendor selection pending (Medplum / Aidbox / build-in-house); BAA required for hosted; required for ONC HTI-1 (g)(10) certification |
| Authentik (or alternative OAuth2 server) | OAuth2 / SMART | OAuth2 + Dynamic Client Registration | 📝 Planned | PM-55 | Vendor selection pending; required for SMART App Launch dynamic registration |
| EPCS / Surescripts | e-Prescribing | Surescripts, NCPDP SCRIPT 2023011 | 📝 Planned | CL-06 | HTI-4; SCRIPT transition by Dec 31, 2027 |
| RTPB | e-Prescribing | NCPDP RTPB v13 | 📝 Planned | CL-06 | Real-Time Prescription Benefit; Base EHR Jan 2028 |
| Lab / LIS | Lab | HL7v2, FHIR DiagnosticReport | 📝 Planned | CL-09 | Orders and results |
| Ramp (Spend Management / Corporate Cards) | External API | Ramp Developer API (OAuth, REST) | 📝 Planned | FA-30 | Card transaction sync, ERP sync; optional virtual cards; sandbox via Ramp partnerships |
| RingCentral (Telephony) | Telephony API | RingCentral REST API, Webhooks, Embeddable SDK | ✅ Implemented | CE-03, CE-14 | Call tracking, recording, disposition, WebRTC embeddable widget |
| Twilio (SMS) | SMS API | Twilio SMS REST API, Webhooks | ✅ Implemented | CE-08 | Two-way SMS messaging, TCPA compliance |
| Gmail API | Email API | Gmail REST API (OAuth 2.0) | ⚠️ Blocked | CE-07 | Email sync (blocked: requires Google app verification) |
| Microsoft Graph (Outlook) | Email API | Microsoft Graph Mail API (OAuth 2.0) | ✅ Implemented | CE-07 | Email sync for Outlook/Microsoft 365 |
Integration Engine Strategy
Per ehr_pm research: avoid hard dependency on a single integration engine vendor (e.g. Mirth Connect 4.6+ licensing). Prefer:- Abstraction layer so EHR does not hard-depend on one engine
- Standards-first payloads (FHIR, X12, NCPDP, C-CDA) with contract tests
- Interface catalog (data contracts, endpoints, versioning, monitoring) as a first-class artifact
Decision Tree(s)
Choosing an integration approach:- Is the integration external (clearinghouse, payer, PDMP, HIE, eRx, lab)? → Use this catalog and API Contracts / Event Contracts for in-platform contracts that wrap external APIs.
- Is the payload standardized (X12, FHIR, NCPDP)? → Prefer standards-first contracts and abstraction; avoid vendor-specific formats in core.
- Does the integration require audit or consent (e.g. PDMP, Part 2)? → Document in spec (CL-17, CL-11) and use platform consent/layers.
- Is it real-time (eligibility, claim status) vs batch (837 submission, 835 posting)? → Define SLA, timeout, and retry in API contract.
Pattern Library
- Abstraction layer: All external calls go through an adapter or edge function; no direct vendor SDK in core. See Integration Engine Strategy.
- Standards-first contracts: Define request/response shapes using FHIR, X12, or NCPDP types; validate with contract tests before going live.
- Interface catalog: Each integration has a catalog entry (name, type, standard, status, spec), plus documented endpoints and payload samples (see code examples below).
Common Mistakes
| Mistake | Symptom | Fix |
|---|---|---|
| Hard dependency on one integration engine | Vendor lock-in; costly migration | Use abstraction layer; keep engine behind adapter |
| Non-standard or undocumented payloads | Broken pipelines; hard to debug | Define contracts (FHIR/X12/NCPDP); add examples to catalog |
| Missing audit for PDMP or Part 2 | Compliance failure | Document audit requirements in CL-17/CL-11; log query/response IDs only |
| No versioning or monitoring | Downtime or silent failures | Add version to contracts; health checks and alerting for external endpoints |
Pre-Flight Checklist
Before enabling or changing an external integration:- Standards: Payload and endpoint match the chosen standard (FHIR R4, X12, NCPDP) and version.
- Contracts: Request/response schemas and error codes documented in API Contracts or event payload in Event Contracts.
- Monitoring: Health check and latency/error metrics for the external endpoint; alerts on failure or SLA breach.
- Versioning: Contract version and external API version documented; upgrade path for breaking changes.
- Consent/Audit: If PDMP or Part 2–related, consent and audit requirements implemented per CL-17/CL-11.
Data Flow, Authentication & Monitoring (Per Integration)
Each external integration MUST document the following before go-live. Stubs below.Clearinghouse (PM-15)
- Data flow: App → Edge function or backend → Clearinghouse (SFTP or API). Outbound: 837P/I, 270, 276, 278. Inbound: 835, 271, 277, 999. Batch and/or real-time per contract.
- Authentication: TLS 1.2+; credentials (SFTP key or API key) in secrets; no credentials in code.
- Sandbox/testing: Use clearinghouse test environment; separate config for prod vs test.
- Error handling: Retry 5xx/network with backoff; rejections (999/277) logged and routed to correction workflow; DLQ for repeated failures.
- Monitoring: Health check (connectivity + test transaction); latency p95; error rate; alert on SLA breach or connection failure.
Payer ePA (PM-10)
- Data flow: App → FHIR Da Vinci CRD/DTR/PAS endpoint. Request/response per CMS-0057-F.
- Authentication: OAuth2 or API key per payer; store in secrets.
- Sandbox: Payer sandbox for development; document base URLs per environment.
- Error handling: Retry 429/5xx; return structured error to user; log request_id for support.
- Monitoring: Latency; success vs denial rate; alert on payer endpoint down.
Arizona CSPMP / PDMP (CL-17)
- Data flow: App → State PMP Gateway or HIE; query-in-workflow; response stored for audit only (no PII in logs).
- Authentication: State-issued credentials; certificate or API key per state requirements.
- Sandbox: State test environment if available.
- Error handling: Fail closed (do not prescribe without PDMP when required); log query_id only; audit per CL-17.
- Monitoring: Query success rate; latency; alerts on gateway errors.
Contexture (AZ HIE) (CL-12, CL-16)
- Data flow: DirectTrust or XDS/XCA; ADT and C-CDA document exchange. Outbound: C-CDA 2.1; Inbound: documents and ADT.
- Authentication: DirectTrust certificate; enrollment and onboarding per Contexture.
- Sandbox: HIE test environment.
- Error handling: Retry transient; log document_id and outcome; no PHI in logs.
- Monitoring: Submission success; document retrieval latency; certificate expiry alerts.
EPCS / Surescripts (CL-06)
- Data flow: NCPDP SCRIPT 2023011 to Surescripts; two-factor auth; prescription and status.
- Authentication: EPCS credentials (hardware or software token); FIPS 140-2 where required.
- Sandbox: Surescripts test environment.
- Error handling: Prescription failure returned to user; no retry of invalid sig; audit all attempts.
- Monitoring: Send success rate; response latency; token/credential expiry.
Lab / LIS (CL-09)
- Data flow: HL7v2 or FHIR DiagnosticReport; order outbound; results inbound.
- Authentication: Lab-specific (often VPN or HL7 MLLP with mutual TLS).
- Sandbox: Lab test environment or mock.
- Error handling: Retry HL7 NAK; map errors to user message; log order_id only.
- Monitoring: Order and result throughput; error rate; interface uptime.
Integration Adapter Pattern
All external calls MUST go through an adapter (edge function or server-side module). No direct vendor SDK in core CL/PM UI. Adapter responsibilities:- Map internal IDs to external identifiers.
- Transform request/response to/from standard shapes (FHIR, X12, NCPDP).
- Apply authentication and retry.
- Log metrics and errors (no PII/PHI).
- Support feature-flag or config to switch environments (sandbox vs prod).
Code Examples (Contract / Endpoint / Payload)
Example: FHIR R4 request (EHI export scope).Label: FHIR patient read – used by CL-16 / PM-12.
Label: X12 270 – eligibility request; see PM-02, PM-15.
Label: NCPDP SCRIPT – e-prescribing; see CL-06.
Microsoft 365 Deep Integrations (PF-63)
Status: ✅ ImplementedSpec: PF-63
Catalog: Entra ID (Azure AD) app-only; Graph API for presence, Teams, SharePoint, activity feed.
Last Verified: 2026-02-21
| Integration | API | Edge Function | Status |
|---|---|---|---|
| Teams Presence | Graph Presence API (/users/{id}/presence) | entra-employee-presence | ✅ |
| Teams Channel Messaging | Graph Teams API (/teams/{id}/channels/{id}/messages) | entra-teams-notify | ✅ |
| SharePoint Files | Graph Drive API (/sites/{id}/drive/items) | entra-sharepoint-documents | ✅ |
| Teams Activity Feed | Graph Teams Activity API (/users/{id}/teamwork/sendActivityNotification) | entra-teams-activity | ✅ |
Tenant Isolation: All edge functions enforce
verifyOrgAccess() + org-scoped credential lookup.PHI Controls: OOO message content redacted; no PHI in logs.
Related Documentation
- Event Contracts - CL/PM planned events
- API Contracts - CL/PM planned APIs
- Platform Integration Layers - CL/PM planned platform layers
- CROSS_CORE_INTEGRATIONS - Cross-core matrix
- EHR_PM_PLANNING_BUNDLE - Planning source
Next Review: When CL/PM implementation starts or external contracts are signed.