F POLARIS · FHIR
sdk · billing conformance

Decide before booking.

evaluatePointOfActionConformance resolves the effective ChargeItemDefinition, contract membership, and active marker-attested Library rules for a prospective ChargeItem on an Account. Polaris owns the artifact selectors and prospective DE projection, Billing Core owns rule semantics and evaluation, and the consumer supplies an authenticated, tenant-bound FHIR transport.

Point of action

One call, one authority decision.

import { evaluatePointOfActionConformance } from '@polaris/sdk/conformance'

const result = await evaluatePointOfActionConformance(
  { transport: authenticatedTenantTransport },
  {
    schemaVersion: 1,
    account,
    prospectiveChargeItem,
  },
)

if (result.decision !== 'allow') {
  return result
}

await persistChargeItem(prospectiveChargeItem)

The call is side-effect free. It reads the current Account state and authoritative artifacts, then evaluates the current plus prospective ChargeItems. The SDK performs bounded pagination and fails closed on missing, stale, malformed, ambiguous, or unsupported authority.

allow

The write is authorized. Deterministic advisory findings may be returned and do not introduce a per-case approval step.

block

The prospective Account state violates an effective contractual rule. Do not persist the ChargeItem; use the returned reason codes to explain or propose a correction.

unavailable

Polaris cannot establish a decision from authoritative state. Do not persist and do not reconstruct the artifacts in the consumer; restore authority and retry.