PriorAuthdocs

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

ModeWhat it talks toUsed for
mockA deterministic in-process simulatorDevelopment and most evals
replayCassettes recorded from a vendor sandboxContract tests that must not drift
liveReal HTTPS to the vendorProduction, 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

VariableUsed byNotes
AVAILITY_CLIENT_IDLive Availity adaptersOAuth2 client credentials
AVAILITY_CLIENT_SECRETLive Availity adaptersNever logged, never in an audit record
AVAILITY_SCOPELive Availity adaptersDefaults to healthcare-hipaa-transactions
AVAILITY_CUSTOMER_IDLive Availity adaptersSent as X-Availity-Customer-Id
PLATFORM_MODEL_IDThe model seamWhich allowlisted model the platform runs; defaults to gemini-2.5-pro
GOOGLE_VERTEX_PROJECT / GOOGLE_VERTEX_LOCATIONThe model seamWhere Gemini runs. One platform project, never one per practice
NEXT_PUBLIC_APP_URLThe marketing pageWhere 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.