import { Effect, Schema } from "effect"; export declare const SupportingInfoSchema: Schema.Struct<{ id: Schema.filter; value: Schema.filter; source: Schema.Literal<["chart", "patient", "payer", "external"]>; }>; export type SupportingInfo = typeof SupportingInfoSchema.Type; export declare const SupportingInfoListSchema: Schema.Array$; value: Schema.filter; source: Schema.Literal<["chart", "patient", "payer", "external"]>; }>>; export declare const decodeSupportingInfoList: (input: unknown) => Effect.Effect, ProtocolError>; export declare const DocumentationRequirementSchema: Schema.Struct<{ id: Schema.filter; description: Schema.filter; questionnaire: Schema.filter; }>; export type DocumentationRequirement = typeof DocumentationRequirementSchema.Type; export declare const AuthorizationRequestSchema: Schema.Struct<{ patient: Schema.Struct<{ memberId: Schema.filter; dob: Schema.filter; }>; provider: Schema.Struct<{ npi: Schema.filter; tin: Schema.filter; }>; service: Schema.Struct<{ code: Schema.filter; codeSystem: Schema.filter; diagnosis: Schema.Array$>; placeOfService: Schema.filter; requestedStart: Schema.filter; units: Schema.filter>; urgency: Schema.Literal<["standard", "expedited"]>; }>; supportingInfo: Schema.Array$; value: Schema.filter; source: Schema.Literal<["chart", "patient", "payer", "external"]>; }>>; }>; export type AuthorizationRequest = typeof AuthorizationRequestSchema.Type; export type ProtocolErrorKind = "validation" | "transport" | "workflow" | "payer"; export type ProtocolErrorReason = "invalid-request" | "invalid-evidence" | "invalid-determination" | "invalid-terminal-determination" | "invalid-resume-token" | "invalid-subscription-event" | "unknown-subscription" | "subscription-timeout" | "evidence-required" | "evidence-missing-requirements" | "evidence-collection-failed" | "max-steps-exceeded" | "policy-evaluation-failed" | "policy-review-failed" | "http-error" | "http-timeout" | "http-request-failed" | "missing-base-url" | "smart-auth-configuration-invalid" | "smart-configuration-failed" | "smart-token-request-failed" | "smart-token-response-invalid" | "transport-authorize-failed" | "transport-resume-failed" | "transport-await-failed" | "transport-audit-failed" | "transport-verify-failed" | "transport-capabilities-failed" | (string & {}); declare const ProtocolError_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & { readonly _tag: "ProtocolError"; } & Readonly; /** * Structured protocol failure raised by the SDK and Effect services. * * @example * try { * await client.request(request); * } catch (error) { * if (error instanceof ProtocolError && error.kind === "validation") { * console.error(error.reason, error.detail); * } * } */ export declare class ProtocolError extends ProtocolError_base<{ readonly reason: ProtocolErrorReason; readonly kind?: ProtocolErrorKind; readonly detail?: unknown; readonly requestId?: string; }> { get message(): string; } export declare const decodeAuthorizationRequest: (input: unknown) => Effect.Effect; export type DeterminationStatus = "approved" | "denied" | "info-needed" | "pended" | "error"; export type NextAction = "none" | "attach-evidence" | "await-payer" | "appeal" | "contact-payer"; export type PendingReason = "human-review" | "payer-processing" | "external-records"; export type DeterminationBy = "rules" | "clinical-reviewer" | null; export interface SignatureReceipt { readonly alg: "EdDSA"; readonly format: "detached-json"; readonly keyId: string; readonly issuedAt: string; readonly requestHash: string; readonly payloadHash: string; readonly nonce: string; readonly signature: string; } export interface X278Capabilities { readonly protocol: "x278"; readonly implementation: string; readonly endpoints: { readonly authorize: string; readonly resume: string; readonly awaitDetermination: string; readonly auditLog?: string; readonly verify?: string; }; readonly signing?: { readonly alg: SignatureReceipt["alg"]; readonly publicKeyPem?: string; }; } export declare const SignatureReceiptSchema: Schema.Struct<{ alg: Schema.Literal<["EdDSA"]>; format: Schema.Literal<["detached-json"]>; keyId: typeof Schema.String; issuedAt: typeof Schema.String; requestHash: typeof Schema.String; payloadHash: typeof Schema.String; nonce: typeof Schema.String; signature: typeof Schema.String; }>; export interface DeterminationBase { readonly authId: string; readonly status: DeterminationStatus; readonly nextAction: NextAction; readonly ruleSetVersion: string; readonly expiresAt: string | null; readonly determinationBy: DeterminationBy; } export interface ApprovedDetermination extends DeterminationBase { readonly status: "approved"; readonly nextAction: "none"; readonly authNumber: string; readonly approvedUnits: number; readonly validFrom: string; readonly validThrough: string; readonly determinationBy: "rules" | "clinical-reviewer"; readonly signature: SignatureReceipt; } export declare const ApprovedDeterminationSchema: Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["approved"]>; nextAction: Schema.Literal<["none"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: Schema.Literal<["rules", "clinical-reviewer"]>; authNumber: typeof Schema.String; approvedUnits: Schema.filter>; validFrom: Schema.filter; validThrough: Schema.filter; signature: Schema.Struct<{ alg: Schema.Literal<["EdDSA"]>; format: Schema.Literal<["detached-json"]>; keyId: typeof Schema.String; issuedAt: typeof Schema.String; requestHash: typeof Schema.String; payloadHash: typeof Schema.String; nonce: typeof Schema.String; signature: typeof Schema.String; }>; }>; export type UnsignedApprovedDetermination = Omit; export interface DeniedDetermination extends DeterminationBase { readonly status: "denied"; readonly nextAction: "appeal"; readonly reasonCode: string; readonly reasonText: string; readonly appealPath: string; readonly determinationBy: "rules" | "clinical-reviewer"; readonly signature: SignatureReceipt; } export declare const DeniedDeterminationSchema: Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["denied"]>; nextAction: Schema.Literal<["appeal"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: Schema.Literal<["rules", "clinical-reviewer"]>; reasonCode: typeof Schema.String; reasonText: typeof Schema.String; appealPath: typeof Schema.String; signature: Schema.Struct<{ alg: Schema.Literal<["EdDSA"]>; format: Schema.Literal<["detached-json"]>; keyId: typeof Schema.String; issuedAt: typeof Schema.String; requestHash: typeof Schema.String; payloadHash: typeof Schema.String; nonce: typeof Schema.String; signature: typeof Schema.String; }>; }>; export type UnsignedDeniedDetermination = Omit; export type UnsignedTerminalDetermination = UnsignedApprovedDetermination | UnsignedDeniedDetermination; export interface InfoNeededDetermination extends DeterminationBase { readonly status: "info-needed"; readonly nextAction: "attach-evidence"; readonly documentationRequired: ReadonlyArray; readonly resumeToken: string; readonly determinationBy: null; } export declare const InfoNeededDeterminationSchema: Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["info-needed"]>; nextAction: Schema.Literal<["attach-evidence"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: typeof Schema.Null; documentationRequired: Schema.Array$; description: Schema.filter; questionnaire: Schema.filter; }>>; resumeToken: typeof Schema.String; }>; export interface PendedDetermination extends DeterminationBase { readonly status: "pended"; readonly nextAction: "await-payer"; readonly pendingReason: PendingReason; readonly subscription: string; readonly determinationBy: "clinical-reviewer" | null; } export declare const PendedDeterminationSchema: Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["pended"]>; nextAction: Schema.Literal<["await-payer"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: Schema.NullOr>; pendingReason: Schema.Literal<["human-review", "payer-processing", "external-records"]>; subscription: typeof Schema.String; }>; export interface ErrorDetermination extends DeterminationBase { readonly status: "error"; readonly nextAction: "contact-payer"; readonly reasonCode: string; readonly reasonText: string; readonly determinationBy: null; } export declare const ErrorDeterminationSchema: Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["error"]>; nextAction: Schema.Literal<["contact-payer"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: typeof Schema.Null; reasonCode: typeof Schema.String; reasonText: typeof Schema.String; }>; export type TerminalDetermination = ApprovedDetermination | DeniedDetermination; export type NonTerminalDetermination = InfoNeededDetermination | PendedDetermination; export type Determination = TerminalDetermination | NonTerminalDetermination | ErrorDetermination; export declare const TerminalDeterminationSchema: Schema.Union<[Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["approved"]>; nextAction: Schema.Literal<["none"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: Schema.Literal<["rules", "clinical-reviewer"]>; authNumber: typeof Schema.String; approvedUnits: Schema.filter>; validFrom: Schema.filter; validThrough: Schema.filter; signature: Schema.Struct<{ alg: Schema.Literal<["EdDSA"]>; format: Schema.Literal<["detached-json"]>; keyId: typeof Schema.String; issuedAt: typeof Schema.String; requestHash: typeof Schema.String; payloadHash: typeof Schema.String; nonce: typeof Schema.String; signature: typeof Schema.String; }>; }>, Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["denied"]>; nextAction: Schema.Literal<["appeal"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: Schema.Literal<["rules", "clinical-reviewer"]>; reasonCode: typeof Schema.String; reasonText: typeof Schema.String; appealPath: typeof Schema.String; signature: Schema.Struct<{ alg: Schema.Literal<["EdDSA"]>; format: Schema.Literal<["detached-json"]>; keyId: typeof Schema.String; issuedAt: typeof Schema.String; requestHash: typeof Schema.String; payloadHash: typeof Schema.String; nonce: typeof Schema.String; signature: typeof Schema.String; }>; }>]>; export declare const DeterminationSchema: Schema.Union<[Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["approved"]>; nextAction: Schema.Literal<["none"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: Schema.Literal<["rules", "clinical-reviewer"]>; authNumber: typeof Schema.String; approvedUnits: Schema.filter>; validFrom: Schema.filter; validThrough: Schema.filter; signature: Schema.Struct<{ alg: Schema.Literal<["EdDSA"]>; format: Schema.Literal<["detached-json"]>; keyId: typeof Schema.String; issuedAt: typeof Schema.String; requestHash: typeof Schema.String; payloadHash: typeof Schema.String; nonce: typeof Schema.String; signature: typeof Schema.String; }>; }>, Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["denied"]>; nextAction: Schema.Literal<["appeal"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: Schema.Literal<["rules", "clinical-reviewer"]>; reasonCode: typeof Schema.String; reasonText: typeof Schema.String; appealPath: typeof Schema.String; signature: Schema.Struct<{ alg: Schema.Literal<["EdDSA"]>; format: Schema.Literal<["detached-json"]>; keyId: typeof Schema.String; issuedAt: typeof Schema.String; requestHash: typeof Schema.String; payloadHash: typeof Schema.String; nonce: typeof Schema.String; signature: typeof Schema.String; }>; }>, Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["info-needed"]>; nextAction: Schema.Literal<["attach-evidence"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: typeof Schema.Null; documentationRequired: Schema.Array$; description: Schema.filter; questionnaire: Schema.filter; }>>; resumeToken: typeof Schema.String; }>, Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["pended"]>; nextAction: Schema.Literal<["await-payer"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: Schema.NullOr>; pendingReason: Schema.Literal<["human-review", "payer-processing", "external-records"]>; subscription: typeof Schema.String; }>, Schema.Struct<{ authId: typeof Schema.String; status: Schema.Literal<["error"]>; nextAction: Schema.Literal<["contact-payer"]>; ruleSetVersion: typeof Schema.String; expiresAt: Schema.NullOr; determinationBy: typeof Schema.Null; reasonCode: typeof Schema.String; reasonText: typeof Schema.String; }>]>; export declare const decodeDetermination: (input: unknown) => Effect.Effect; export declare const decodeTerminalDetermination: (input: unknown) => Effect.Effect; export interface AuditRecord { readonly authId: string; readonly status: TerminalDetermination["status"]; readonly requestHash: string; readonly determinationHash: string; readonly signatureKeyId: string; readonly appendedAt: string; } export {}; //# sourceMappingURL=domain.d.mts.map