Environments
Every port has exactly three adapters. The mode is per practice, resolved through the config cascade, and an unrecognised value is an error rather than a default.
#The three modes
| Mode | What it talks to | Used for |
|---|---|---|
mock | A deterministic in-process simulator | Development and most evals |
replay | Cassettes recorded from a vendor sandbox | Contract tests that must not drift |
live | Real HTTPS to the vendor | Production, behind credentials and a BAA |
#An unknown mode is refused
javascript
createEhrAdapter('staging');
// Error: Unknown EHR mode "staging". Expected one of: mock, replay, live.
// There is no default: guessing here means guessing whether payer answers are real.Every wrong default in this position ends the same way - a simulated answer treated as a real one. So there is no default.
#Live refuses to start without credentials
A live adapter with missing credentials does not fall back to the mock. It throws at construction.
text
The live eligibility adapter needs AVAILITY_CLIENT_ID and AVAILITY_CLIENT_SECRET.
It will not fall back to the mock: a simulated "no authorization required" served as if
it came from a payer is the single most expensive thing this platform could say.#A cassette miss is a failure
In replay mode, asking for an interaction that was never recorded aborts. It does not synthesise a plausible response. Filling a gap with an invented payer answer would manufacture exactly the thing the rail exists to eliminate, and it would be indistinguishable from a real one downstream.
#Environment variables
| Variable | Used by | Notes |
|---|---|---|
AVAILITY_CLIENT_ID | Live Availity adapters | OAuth2 client credentials |
AVAILITY_CLIENT_SECRET | Live Availity adapters | Never logged, never in an audit record |
AVAILITY_SCOPE | Live Availity adapters | Defaults to healthcare-hipaa-transactions |
AVAILITY_CUSTOMER_ID | Live Availity adapters | Sent as X-Availity-Customer-Id |
PLATFORM_MODEL_ID | The model seam | Which allowlisted model the platform runs; defaults to gemini-2.5-pro |
GOOGLE_VERTEX_PROJECT / GOOGLE_VERTEX_LOCATION | The model seam | Where Gemini runs. One platform project, never one per practice |
NEXT_PUBLIC_APP_URL | The marketing page | Where the console lives |
Credentials are held at the channel, never at the practice
One partner app registration serves many practices. A practice never holds vendor credentials, and the platform stores a reference to a secret manager entry rather than the secret itself -
secretsmanager://veradigm/unity-app, not the value.