priorauth.indocs

Ports and adapters

Three ports - the clearinghouse, the EHR, and eligibility. Each defines canonical types, and nothing above the port knows a vendor's vocabulary.

#What a port owns

  • Canonical request and result types with our own field names.
  • A failure taxonomy in our terms - auth, not_found, conflict, validation, rate_limit, ambiguous, unavailable.
  • A method list, asserted at construction. An adapter missing a method fails immediately rather than at the first call.

#What never crosses

Nothing above the port knows the string serviceReview, the code A1, the shape of a Unity Magic envelope, or that a submission answers 202. A test asserts this directly: the canonical encounter is checked for Unity vocabulary - Parameter1, Appname, EncounterID, MagicJson, AppUserID - and fails if any of it leaks upward.

#Why it is worth the indirection here

CMS-0057-F requires impacted payers to stand up a FHIR prior authorization API from January 2027, and X12 278 does not disappear when they do. Both rails run for years, payer by payer. The port is what lets one payer move without the agents, the evals or the console noticing.

#The three adapters

AdapterBehaviour on the unknown
mockDeterministic, and deliberately awkward in the ways real vendors are - partial answers, locked encounters, conflicting referrals.
replayA cassette miss aborts. It never synthesises a plausible response.
liveRefuses to construct without credentials. Never falls back to the mock.