@mindbill/browser 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @mindbill/browser
2
+
3
+ Framework-neutral client used by the React and Angular packages. It exchanges
4
+ your authenticated same-origin session for a short-lived, origin-bound token;
5
+ the Partner API key never reaches the browser.
6
+
7
+ ```ts
8
+ import { createBillLifecycleClient } from "@mindbill/browser";
9
+
10
+ const billing = createBillLifecycleClient({
11
+ billId,
12
+ sessionEndpoint: "/api/mindbill/bill-session",
13
+ });
14
+
15
+ const bill = await billing.getLifecycle();
16
+ ```
17
+
18
+ The session endpoint is the only required partner-server integration. See the
19
+ [10-minute quickstart](https://app.mindbill.org/developers/reference).
@@ -0,0 +1,235 @@
1
+ declare const DEFAULT_API_BASE_URL = "https://app.mindbill.org";
2
+ declare const DEFAULT_SESSION_ENDPOINT = "/api/mindbill/bill-session";
3
+ type BillReviewDocumentType = "final_report" | "letter_of_attestation" | "proof_of_service" | "form_122" | "return_to_work_voucher" | "w9" | "medical_records" | "appeal" | "other";
4
+ type BillReviewBillingProvider = {
5
+ name: string;
6
+ taxId: string;
7
+ npi: string;
8
+ billType: "Professional" | "Institutional";
9
+ phone?: string;
10
+ billingStreet?: string;
11
+ billingCity?: string;
12
+ billingState?: string;
13
+ billingZip?: string;
14
+ };
15
+ type BillReviewClinician = {
16
+ name: string;
17
+ specialty: string;
18
+ npi: string;
19
+ taxonomy?: string;
20
+ licenseNumber?: string;
21
+ licenseState?: string;
22
+ signaturePng?: string;
23
+ signatureKey?: string;
24
+ isQME?: boolean;
25
+ isAME?: boolean;
26
+ email?: string;
27
+ active?: boolean;
28
+ };
29
+ type BillReviewLocation = {
30
+ name: string;
31
+ nickname?: string;
32
+ street: string;
33
+ city: string;
34
+ state: string;
35
+ zip: string;
36
+ county?: string;
37
+ posCode?: string;
38
+ isPrimary?: boolean;
39
+ active?: boolean;
40
+ };
41
+ type BillReviewLineItem = {
42
+ id?: string;
43
+ code: string;
44
+ modifiers: string[];
45
+ units: number;
46
+ charge: number;
47
+ feeSchedule?: number;
48
+ };
49
+ type BillReviewAttachment = {
50
+ id: string;
51
+ filename: string;
52
+ description?: string | null;
53
+ documentType: string;
54
+ reportType?: string | null;
55
+ source?: string;
56
+ addedAt?: string;
57
+ contentUrl?: string;
58
+ };
59
+ type BillReviewPayer = {
60
+ id: string;
61
+ name: string;
62
+ hasElectronic?: boolean;
63
+ states?: string[];
64
+ confidence?: "high" | "medium" | "directory";
65
+ recommended?: boolean;
66
+ signals?: Array<{
67
+ kind: "name" | "claim_number";
68
+ state: "match" | "warning";
69
+ label: string;
70
+ }>;
71
+ };
72
+ type BillReviewFeatures = {
73
+ authorizationNumber?: boolean;
74
+ serviceDateRange?: boolean;
75
+ wcabNumber?: boolean;
76
+ codingPresets?: boolean;
77
+ };
78
+ type BillReviewClaimPatternStatus = {
79
+ state: "match" | "warning" | "unknown";
80
+ label: string;
81
+ detail?: string;
82
+ suggestion?: string;
83
+ };
84
+ type BillReviewData = {
85
+ bill: {
86
+ id: string;
87
+ billNumber: string | number;
88
+ status: string;
89
+ transmissionState?: string;
90
+ dos: string;
91
+ dosEnd?: string | null;
92
+ authorizationNumber?: string | null;
93
+ billingSnapshot?: {
94
+ billingProvider?: BillReviewBillingProvider;
95
+ renderingProvider?: BillReviewClinician;
96
+ placeOfService?: BillReviewLocation;
97
+ } | null;
98
+ lineItems: BillReviewLineItem[];
99
+ attachments: BillReviewAttachment[];
100
+ totalCharge: number;
101
+ totalPaid: number;
102
+ balanceDue: number;
103
+ };
104
+ patient: {
105
+ name: string;
106
+ firstName?: string;
107
+ middleName?: string;
108
+ lastName?: string;
109
+ dob?: string;
110
+ };
111
+ injury: {
112
+ claimNumber?: string;
113
+ employer?: string;
114
+ doi?: string;
115
+ injuryEndDate?: string;
116
+ cumulativeTrauma?: boolean;
117
+ adjNumber?: string;
118
+ claimsAdminId?: string;
119
+ claimsAdminName?: string;
120
+ claimPatternStatus?: BillReviewClaimPatternStatus;
121
+ };
122
+ };
123
+ type BillReviewSaveInput = {
124
+ claimsAdminId: string;
125
+ patientOverrides?: {
126
+ firstName: string;
127
+ middleName?: string;
128
+ lastName: string;
129
+ dob?: string;
130
+ };
131
+ injuryOverrides?: {
132
+ claimNumber?: string;
133
+ employer?: string;
134
+ doi?: string;
135
+ injuryEndDate?: string;
136
+ cumulativeTrauma?: boolean;
137
+ adjNumber?: string;
138
+ };
139
+ dos: string;
140
+ dosEnd?: string | null;
141
+ authorizationNumber?: string | null;
142
+ billingProvider?: BillReviewBillingProvider;
143
+ renderingProvider?: BillReviewClinician;
144
+ placeOfService?: BillReviewLocation;
145
+ lineItems: Array<{
146
+ id?: string;
147
+ code: string;
148
+ modifiers: string[];
149
+ units: number;
150
+ }>;
151
+ };
152
+ type BillSubmissionRoute = "ebill" | "fax" | "mail" | "email";
153
+ type BillLifecycleActionId = "edit_and_submit" | "correct_and_resubmit" | "second_review" | "independent_bill_review" | "view_eor" | "post_payment" | "close";
154
+ type BillLifecycleAction = {
155
+ id: BillLifecycleActionId;
156
+ label: string;
157
+ enabled: boolean;
158
+ primary?: boolean;
159
+ reason?: string;
160
+ };
161
+ type BillEorDocument = {
162
+ id: string;
163
+ filename: string;
164
+ description: string | null;
165
+ addedAt: string;
166
+ contentUrl: string;
167
+ };
168
+ type BillLifecycleData = BillReviewData & {
169
+ lifecycle: {
170
+ state: string;
171
+ nativeStatus: string;
172
+ submittedAt?: string | null;
173
+ agingDays?: number | null;
174
+ updatedAt?: string | null;
175
+ actions: BillLifecycleAction[];
176
+ };
177
+ eors: BillEorDocument[];
178
+ };
179
+ type BillLifecycleSession = {
180
+ token: string;
181
+ expiresAt?: string;
182
+ apiBaseUrl?: string;
183
+ };
184
+ type BillLifecycleSessionRequest = {
185
+ billId: string;
186
+ component: "bill-review";
187
+ signal: AbortSignal;
188
+ };
189
+ type BillLifecycleSessionProvider = (request: BillLifecycleSessionRequest) => Promise<BillLifecycleSession>;
190
+ type CloseBillInput = {
191
+ reason: string;
192
+ };
193
+ type PostBillPaymentInput = {
194
+ amount: number;
195
+ method: "check" | "eft";
196
+ checkNumber?: string;
197
+ depositDate: string;
198
+ note?: string;
199
+ };
200
+ type SubmitSecondReviewInput = {
201
+ reason: string;
202
+ payerClaimControlNumber: string;
203
+ disputedAmount: number | undefined;
204
+ attachmentIds: string[];
205
+ route: BillSubmissionRoute;
206
+ };
207
+ type BillLifecycleClientOptions = {
208
+ billId: string;
209
+ sessionEndpoint?: string | undefined;
210
+ getSession?: BillLifecycleSessionProvider | undefined;
211
+ apiBaseUrl?: string | undefined;
212
+ fetch?: typeof globalThis.fetch | undefined;
213
+ };
214
+ type BillLifecycleClient = {
215
+ getLifecycle: (signal?: AbortSignal) => Promise<BillLifecycleData>;
216
+ searchClaimsAdministrators: (query: string, claimNumber?: string) => Promise<BillReviewPayer[]>;
217
+ saveReview: (input: BillReviewSaveInput) => Promise<BillLifecycleData>;
218
+ submitBill: (input: BillReviewSaveInput, route: BillSubmissionRoute) => Promise<BillLifecycleData>;
219
+ addAttachment: (file: File, documentType: BillReviewDocumentType, description?: string) => Promise<BillLifecycleData>;
220
+ removeAttachment: (attachmentId: string) => Promise<BillLifecycleData>;
221
+ getAttachment: (attachmentId: string) => Promise<Blob>;
222
+ getEor: (documentId: string) => Promise<Blob>;
223
+ closeBill: (input: CloseBillInput) => Promise<BillLifecycleData>;
224
+ postPayment: (input: PostBillPaymentInput) => Promise<BillLifecycleData>;
225
+ submitSecondReview: (input: SubmitSecondReviewInput) => Promise<BillLifecycleData>;
226
+ startCorrection: () => Promise<{
227
+ replacementBillId: string;
228
+ data: BillLifecycleData;
229
+ }>;
230
+ clearSession: () => void;
231
+ };
232
+ /** Browser-safe, framework-neutral client for the complete bill lifecycle. */
233
+ declare function createBillLifecycleClient({ billId, sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, }: BillLifecycleClientOptions): BillLifecycleClient;
234
+
235
+ export { type BillEorDocument, type BillLifecycleAction, type BillLifecycleActionId, type BillLifecycleClient, type BillLifecycleClientOptions, type BillLifecycleData, type BillLifecycleSession, type BillLifecycleSessionProvider, type BillLifecycleSessionRequest, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClaimPatternStatus, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewFeatures, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, type BillSubmissionRoute, type CloseBillInput, DEFAULT_API_BASE_URL, DEFAULT_SESSION_ENDPOINT, type PostBillPaymentInput, type SubmitSecondReviewInput, createBillLifecycleClient };
package/dist/index.js ADDED
@@ -0,0 +1,226 @@
1
+ // src/index.ts
2
+ var DEFAULT_API_BASE_URL = "https://app.mindbill.org";
3
+ var DEFAULT_SESSION_ENDPOINT = "/api/mindbill/bill-session";
4
+ async function responseError(response, fallback) {
5
+ const body = await response.json().catch(() => null);
6
+ const detail = body && typeof body === "object" ? body.detail ?? body.message ?? body.error : null;
7
+ return new Error(typeof detail === "string" ? detail : fallback);
8
+ }
9
+ function isSessionFresh(session) {
10
+ if (!session) return false;
11
+ if (!session.expiresAt) return true;
12
+ const expiresAt = new Date(session.expiresAt).getTime();
13
+ return Number.isFinite(expiresAt) && expiresAt > Date.now() + 3e4;
14
+ }
15
+ function normalizeSession(value) {
16
+ if (!value || typeof value !== "object") {
17
+ throw new Error("The billing session endpoint returned an invalid response.");
18
+ }
19
+ const candidate = value;
20
+ const nested = candidate.session ?? candidate.data;
21
+ const session = nested && typeof nested === "object" ? nested : candidate;
22
+ if (typeof session.token !== "string" || session.token.length < 8) {
23
+ throw new Error("The billing session endpoint did not return a browser session token.");
24
+ }
25
+ return {
26
+ token: session.token,
27
+ ...typeof session.expiresAt === "string" ? { expiresAt: session.expiresAt } : {},
28
+ ...typeof session.apiBaseUrl === "string" ? { apiBaseUrl: session.apiBaseUrl } : {}
29
+ };
30
+ }
31
+ function normalizeLifecycle(value) {
32
+ if (!value || typeof value !== "object") {
33
+ throw new Error("The billing service returned an invalid bill lifecycle.");
34
+ }
35
+ const data = value;
36
+ if (!data.bill || !data.patient || !data.injury || !data.lifecycle || !Array.isArray(data.lifecycle.actions) || !Array.isArray(data.eors)) {
37
+ throw new Error("The billing service returned an invalid bill lifecycle.");
38
+ }
39
+ return data;
40
+ }
41
+ function idempotencyKey() {
42
+ if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
43
+ return `mb-${Date.now()}-${Math.random().toString(36).slice(2)}`;
44
+ }
45
+ function createBillLifecycleClient({
46
+ billId,
47
+ sessionEndpoint = DEFAULT_SESSION_ENDPOINT,
48
+ getSession,
49
+ apiBaseUrl = DEFAULT_API_BASE_URL,
50
+ fetch: fetchOverride
51
+ }) {
52
+ const fetcher = fetchOverride ?? globalThis.fetch;
53
+ if (typeof fetcher !== "function") throw new Error("A Fetch API implementation is required.");
54
+ let session = null;
55
+ let sessionRequest = null;
56
+ const mintSession = async (signal, force = false) => {
57
+ if (!force && isSessionFresh(session)) return session;
58
+ if (!force && sessionRequest) return sessionRequest;
59
+ const pending = getSession ? getSession({ billId, component: "bill-review", signal }) : fetcher(sessionEndpoint, {
60
+ method: "POST",
61
+ credentials: "same-origin",
62
+ headers: { "content-type": "application/json" },
63
+ body: JSON.stringify({ billId, component: "bill-review" }),
64
+ signal
65
+ }).then(async (response) => {
66
+ if (!response.ok) throw await responseError(response, "The billing session could not be created.");
67
+ return response.json();
68
+ });
69
+ const request2 = Promise.resolve(pending).then(normalizeSession).then((nextSession) => {
70
+ session = nextSession;
71
+ return nextSession;
72
+ }).finally(() => {
73
+ if (sessionRequest === request2) sessionRequest = null;
74
+ });
75
+ sessionRequest = request2;
76
+ return request2;
77
+ };
78
+ const request = async (path, init = {}, providedSignal) => {
79
+ const controller = providedSignal ? null : new AbortController();
80
+ const signal = providedSignal ?? controller?.signal;
81
+ if (!signal) throw new Error("An AbortSignal could not be created.");
82
+ let browserSession = await mintSession(signal);
83
+ const perform = (current) => {
84
+ const base = (current.apiBaseUrl ?? apiBaseUrl).replace(/\/$/, "");
85
+ const headers = new Headers(init.headers);
86
+ headers.set("authorization", `Bearer ${current.token}`);
87
+ return fetcher(`${base}${path}`, { ...init, headers, signal });
88
+ };
89
+ let response = await perform(browserSession);
90
+ if (response.status === 401) {
91
+ session = null;
92
+ browserSession = await mintSession(signal, true);
93
+ response = await perform(browserSession);
94
+ }
95
+ return response;
96
+ };
97
+ const loadLifecycle = async (signal) => {
98
+ const response = await request("/partner/v2/browser/bill", {}, signal);
99
+ if (!response.ok) throw await responseError(response, "Bill lifecycle could not be loaded.");
100
+ const body = await response.json();
101
+ return normalizeLifecycle(body.data);
102
+ };
103
+ const searchClaimsAdministrators = async (query, claimNumber) => {
104
+ const params = new URLSearchParams();
105
+ if (query.trim()) params.set("q", query.trim());
106
+ if (claimNumber?.trim()) params.set("claimNumber", claimNumber.trim());
107
+ const response = await request(`/partner/v2/browser/claims-administrators?${params.toString()}`);
108
+ if (!response.ok) throw await responseError(response, "Claims administrator search is unavailable.");
109
+ const body = await response.json();
110
+ if (!Array.isArray(body.results)) throw new Error("Claims administrator search returned an invalid response.");
111
+ return body.results.flatMap((value) => {
112
+ if (!value || typeof value !== "object") return [];
113
+ const payer = value;
114
+ if (typeof payer.id !== "string" || typeof payer.name !== "string") return [];
115
+ return [{
116
+ id: payer.id,
117
+ name: payer.name,
118
+ ...typeof payer.hasElectronic === "boolean" ? { hasElectronic: payer.hasElectronic } : {},
119
+ ...Array.isArray(payer.states) ? { states: payer.states.filter((state) => typeof state === "string") } : {},
120
+ ...["high", "medium", "directory"].includes(payer.confidence ?? "") ? { confidence: payer.confidence } : {},
121
+ ...typeof payer.recommended === "boolean" ? { recommended: payer.recommended } : {},
122
+ ...Array.isArray(payer.signals) ? {
123
+ signals: payer.signals.flatMap((signal) => {
124
+ if (!signal || typeof signal !== "object") return [];
125
+ const candidate = signal;
126
+ if (!["name", "claim_number"].includes(String(candidate.kind)) || !["match", "warning"].includes(String(candidate.state)) || typeof candidate.label !== "string") return [];
127
+ return [{
128
+ kind: candidate.kind,
129
+ state: candidate.state,
130
+ label: candidate.label
131
+ }];
132
+ })
133
+ } : {}
134
+ }];
135
+ });
136
+ };
137
+ const mutation = async (path, init, fallback) => {
138
+ const headers = new Headers(init.headers);
139
+ headers.set("idempotency-key", idempotencyKey());
140
+ const response = await request(path, { ...init, headers });
141
+ if (!response.ok) throw await responseError(response, fallback);
142
+ return response;
143
+ };
144
+ const action = async (input, fallback) => {
145
+ const response = await mutation("/partner/v2/browser/actions", {
146
+ method: "POST",
147
+ headers: { "content-type": "application/json" },
148
+ body: JSON.stringify(input)
149
+ }, fallback);
150
+ const body = await response.json();
151
+ return normalizeLifecycle(body.data);
152
+ };
153
+ const saveReview = async (input) => {
154
+ await mutation("/partner/v2/browser/bill", {
155
+ method: "PATCH",
156
+ headers: { "content-type": "application/json" },
157
+ body: JSON.stringify(input)
158
+ }, "Bill changes could not be saved.");
159
+ return loadLifecycle();
160
+ };
161
+ return {
162
+ clearSession() {
163
+ session = null;
164
+ sessionRequest = null;
165
+ },
166
+ getLifecycle: loadLifecycle,
167
+ searchClaimsAdministrators,
168
+ saveReview,
169
+ async submitBill(input, route) {
170
+ await saveReview(input);
171
+ await mutation("/partner/v2/browser/submissions", {
172
+ method: "POST",
173
+ headers: { "content-type": "application/json" },
174
+ body: JSON.stringify({ route })
175
+ }, "Bill could not be submitted.");
176
+ return loadLifecycle();
177
+ },
178
+ async addAttachment(file, documentType, description) {
179
+ const body = new FormData();
180
+ body.set("file", file);
181
+ body.set("documentType", documentType);
182
+ if (description) body.set("description", description);
183
+ await mutation("/partner/v2/browser/documents", { method: "POST", body }, "Document could not be attached.");
184
+ return loadLifecycle();
185
+ },
186
+ async removeAttachment(attachmentId) {
187
+ await mutation(`/partner/v2/browser/documents/${encodeURIComponent(attachmentId)}`, { method: "DELETE" }, "Document could not be removed.");
188
+ return loadLifecycle();
189
+ },
190
+ async getAttachment(attachmentId) {
191
+ const response = await request(`/partner/v2/browser/documents/${encodeURIComponent(attachmentId)}`);
192
+ if (!response.ok) throw await responseError(response, "Document could not be opened.");
193
+ return response.blob();
194
+ },
195
+ async getEor(documentId) {
196
+ const response = await request(`/partner/v2/browser/eors/${encodeURIComponent(documentId)}`);
197
+ if (!response.ok) throw await responseError(response, "EOR could not be opened.");
198
+ return response.blob();
199
+ },
200
+ closeBill(input) {
201
+ return action({ action: "close", ...input }, "Bill could not be closed.");
202
+ },
203
+ postPayment(input) {
204
+ return action({ action: "post_payment", ...input, checkNumber: input.checkNumber ?? "" }, "Payment could not be posted.");
205
+ },
206
+ submitSecondReview(input) {
207
+ return action({ action: "second_review", ...input }, "Second Review could not be submitted.");
208
+ },
209
+ async startCorrection() {
210
+ const response = await mutation("/partner/v2/browser/actions", {
211
+ method: "POST",
212
+ headers: { "content-type": "application/json" },
213
+ body: JSON.stringify({ action: "start_correction" })
214
+ }, "Correction draft could not be created.");
215
+ const body = await response.json();
216
+ if (typeof body.replacementBillId !== "string") throw new Error("The billing service did not return the correction bill ID.");
217
+ return { replacementBillId: body.replacementBillId, data: normalizeLifecycle(body.data) };
218
+ }
219
+ };
220
+ }
221
+ export {
222
+ DEFAULT_API_BASE_URL,
223
+ DEFAULT_SESSION_ENDPOINT,
224
+ createBillLifecycleClient
225
+ };
226
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const DEFAULT_API_BASE_URL = \"https://app.mindbill.org\";\nexport const DEFAULT_SESSION_ENDPOINT = \"/api/mindbill/bill-session\";\n\nexport type BillReviewDocumentType =\n | \"final_report\"\n | \"letter_of_attestation\"\n | \"proof_of_service\"\n | \"form_122\"\n | \"return_to_work_voucher\"\n | \"w9\"\n | \"medical_records\"\n | \"appeal\"\n | \"other\";\n\nexport type BillReviewBillingProvider = {\n name: string;\n taxId: string;\n npi: string;\n billType: \"Professional\" | \"Institutional\";\n phone?: string;\n billingStreet?: string;\n billingCity?: string;\n billingState?: string;\n billingZip?: string;\n};\n\nexport type BillReviewClinician = {\n name: string;\n specialty: string;\n npi: string;\n taxonomy?: string;\n licenseNumber?: string;\n licenseState?: string;\n signaturePng?: string;\n signatureKey?: string;\n isQME?: boolean;\n isAME?: boolean;\n email?: string;\n active?: boolean;\n};\n\nexport type BillReviewLocation = {\n name: string;\n nickname?: string;\n street: string;\n city: string;\n state: string;\n zip: string;\n county?: string;\n posCode?: string;\n isPrimary?: boolean;\n active?: boolean;\n};\n\nexport type BillReviewLineItem = {\n id?: string;\n code: string;\n modifiers: string[];\n units: number;\n charge: number;\n feeSchedule?: number;\n};\n\nexport type BillReviewAttachment = {\n id: string;\n filename: string;\n description?: string | null;\n documentType: string;\n reportType?: string | null;\n source?: string;\n addedAt?: string;\n contentUrl?: string;\n};\n\nexport type BillReviewPayer = {\n id: string;\n name: string;\n hasElectronic?: boolean;\n states?: string[];\n confidence?: \"high\" | \"medium\" | \"directory\";\n recommended?: boolean;\n signals?: Array<{\n kind: \"name\" | \"claim_number\";\n state: \"match\" | \"warning\";\n label: string;\n }>;\n};\n\nexport type BillReviewFeatures = {\n authorizationNumber?: boolean;\n serviceDateRange?: boolean;\n wcabNumber?: boolean;\n codingPresets?: boolean;\n};\n\nexport type BillReviewClaimPatternStatus = {\n state: \"match\" | \"warning\" | \"unknown\";\n label: string;\n detail?: string;\n suggestion?: string;\n};\n\nexport type BillReviewData = {\n bill: {\n id: string;\n billNumber: string | number;\n status: string;\n transmissionState?: string;\n dos: string;\n dosEnd?: string | null;\n authorizationNumber?: string | null;\n billingSnapshot?: {\n billingProvider?: BillReviewBillingProvider;\n renderingProvider?: BillReviewClinician;\n placeOfService?: BillReviewLocation;\n } | null;\n lineItems: BillReviewLineItem[];\n attachments: BillReviewAttachment[];\n totalCharge: number;\n totalPaid: number;\n balanceDue: number;\n };\n patient: {\n name: string;\n firstName?: string;\n middleName?: string;\n lastName?: string;\n dob?: string;\n };\n injury: {\n claimNumber?: string;\n employer?: string;\n doi?: string;\n injuryEndDate?: string;\n cumulativeTrauma?: boolean;\n adjNumber?: string;\n claimsAdminId?: string;\n claimsAdminName?: string;\n claimPatternStatus?: BillReviewClaimPatternStatus;\n };\n};\n\nexport type BillReviewSaveInput = {\n claimsAdminId: string;\n patientOverrides?: {\n firstName: string;\n middleName?: string;\n lastName: string;\n dob?: string;\n };\n injuryOverrides?: {\n claimNumber?: string;\n employer?: string;\n doi?: string;\n injuryEndDate?: string;\n cumulativeTrauma?: boolean;\n adjNumber?: string;\n };\n dos: string;\n dosEnd?: string | null;\n authorizationNumber?: string | null;\n billingProvider?: BillReviewBillingProvider;\n renderingProvider?: BillReviewClinician;\n placeOfService?: BillReviewLocation;\n lineItems: Array<{\n id?: string;\n code: string;\n modifiers: string[];\n units: number;\n }>;\n};\n\nexport type BillSubmissionRoute = \"ebill\" | \"fax\" | \"mail\" | \"email\";\nexport type BillLifecycleActionId =\n | \"edit_and_submit\"\n | \"correct_and_resubmit\"\n | \"second_review\"\n | \"independent_bill_review\"\n | \"view_eor\"\n | \"post_payment\"\n | \"close\";\n\nexport type BillLifecycleAction = {\n id: BillLifecycleActionId;\n label: string;\n enabled: boolean;\n primary?: boolean;\n reason?: string;\n};\n\nexport type BillEorDocument = {\n id: string;\n filename: string;\n description: string | null;\n addedAt: string;\n contentUrl: string;\n};\n\nexport type BillLifecycleData = BillReviewData & {\n lifecycle: {\n state: string;\n nativeStatus: string;\n submittedAt?: string | null;\n agingDays?: number | null;\n updatedAt?: string | null;\n actions: BillLifecycleAction[];\n };\n eors: BillEorDocument[];\n};\n\nexport type BillLifecycleSession = {\n token: string;\n expiresAt?: string;\n apiBaseUrl?: string;\n};\n\nexport type BillLifecycleSessionRequest = {\n billId: string;\n component: \"bill-review\";\n signal: AbortSignal;\n};\n\nexport type BillLifecycleSessionProvider = (\n request: BillLifecycleSessionRequest,\n) => Promise<BillLifecycleSession>;\n\nexport type CloseBillInput = { reason: string };\nexport type PostBillPaymentInput = {\n amount: number;\n method: \"check\" | \"eft\";\n checkNumber?: string;\n depositDate: string;\n note?: string;\n};\nexport type SubmitSecondReviewInput = {\n reason: string;\n payerClaimControlNumber: string;\n disputedAmount: number | undefined;\n attachmentIds: string[];\n route: BillSubmissionRoute;\n};\n\nexport type BillLifecycleClientOptions = {\n billId: string;\n sessionEndpoint?: string | undefined;\n getSession?: BillLifecycleSessionProvider | undefined;\n apiBaseUrl?: string | undefined;\n fetch?: typeof globalThis.fetch | undefined;\n};\n\nexport type BillLifecycleClient = {\n getLifecycle: (signal?: AbortSignal) => Promise<BillLifecycleData>;\n searchClaimsAdministrators: (query: string, claimNumber?: string) => Promise<BillReviewPayer[]>;\n saveReview: (input: BillReviewSaveInput) => Promise<BillLifecycleData>;\n submitBill: (input: BillReviewSaveInput, route: BillSubmissionRoute) => Promise<BillLifecycleData>;\n addAttachment: (file: File, documentType: BillReviewDocumentType, description?: string) => Promise<BillLifecycleData>;\n removeAttachment: (attachmentId: string) => Promise<BillLifecycleData>;\n getAttachment: (attachmentId: string) => Promise<Blob>;\n getEor: (documentId: string) => Promise<Blob>;\n closeBill: (input: CloseBillInput) => Promise<BillLifecycleData>;\n postPayment: (input: PostBillPaymentInput) => Promise<BillLifecycleData>;\n submitSecondReview: (input: SubmitSecondReviewInput) => Promise<BillLifecycleData>;\n startCorrection: () => Promise<{ replacementBillId: string; data: BillLifecycleData }>;\n clearSession: () => void;\n};\n\nasync function responseError(response: Response, fallback: string): Promise<Error> {\n const body: unknown = await response.json().catch(() => null);\n const detail = body && typeof body === \"object\"\n ? (body as { detail?: unknown; message?: unknown; error?: unknown }).detail\n ?? (body as { message?: unknown }).message\n ?? (body as { error?: unknown }).error\n : null;\n return new Error(typeof detail === \"string\" ? detail : fallback);\n}\n\nfunction isSessionFresh(session: BillLifecycleSession | null): boolean {\n if (!session) return false;\n if (!session.expiresAt) return true;\n const expiresAt = new Date(session.expiresAt).getTime();\n return Number.isFinite(expiresAt) && expiresAt > Date.now() + 30_000;\n}\n\nfunction normalizeSession(value: unknown): BillLifecycleSession {\n if (!value || typeof value !== \"object\") {\n throw new Error(\"The billing session endpoint returned an invalid response.\");\n }\n const candidate = value as { token?: unknown; expiresAt?: unknown; apiBaseUrl?: unknown; session?: unknown; data?: unknown };\n const nested = candidate.session ?? candidate.data;\n const session = nested && typeof nested === \"object\" ? nested as typeof candidate : candidate;\n if (typeof session.token !== \"string\" || session.token.length < 8) {\n throw new Error(\"The billing session endpoint did not return a browser session token.\");\n }\n return {\n token: session.token,\n ...(typeof session.expiresAt === \"string\" ? { expiresAt: session.expiresAt } : {}),\n ...(typeof session.apiBaseUrl === \"string\" ? { apiBaseUrl: session.apiBaseUrl } : {}),\n };\n}\n\nfunction normalizeLifecycle(value: unknown): BillLifecycleData {\n if (!value || typeof value !== \"object\") {\n throw new Error(\"The billing service returned an invalid bill lifecycle.\");\n }\n const data = value as Partial<BillLifecycleData>;\n if (!data.bill || !data.patient || !data.injury || !data.lifecycle || !Array.isArray(data.lifecycle.actions) || !Array.isArray(data.eors)) {\n throw new Error(\"The billing service returned an invalid bill lifecycle.\");\n }\n return data as BillLifecycleData;\n}\n\nfunction idempotencyKey(): string {\n if (typeof globalThis.crypto?.randomUUID === \"function\") return globalThis.crypto.randomUUID();\n return `mb-${Date.now()}-${Math.random().toString(36).slice(2)}`;\n}\n\n/** Browser-safe, framework-neutral client for the complete bill lifecycle. */\nexport function createBillLifecycleClient({\n billId,\n sessionEndpoint = DEFAULT_SESSION_ENDPOINT,\n getSession,\n apiBaseUrl = DEFAULT_API_BASE_URL,\n fetch: fetchOverride,\n}: BillLifecycleClientOptions): BillLifecycleClient {\n const fetcher = fetchOverride ?? globalThis.fetch;\n if (typeof fetcher !== \"function\") throw new Error(\"A Fetch API implementation is required.\");\n let session: BillLifecycleSession | null = null;\n let sessionRequest: Promise<BillLifecycleSession> | null = null;\n\n const mintSession = async (signal: AbortSignal, force = false): Promise<BillLifecycleSession> => {\n if (!force && isSessionFresh(session)) return session as BillLifecycleSession;\n if (!force && sessionRequest) return sessionRequest;\n const pending = getSession\n ? getSession({ billId, component: \"bill-review\", signal })\n : fetcher(sessionEndpoint, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ billId, component: \"bill-review\" }),\n signal,\n }).then(async (response) => {\n if (!response.ok) throw await responseError(response, \"The billing session could not be created.\");\n return response.json();\n });\n const request = Promise.resolve(pending).then(normalizeSession).then((nextSession) => {\n session = nextSession;\n return nextSession;\n }).finally(() => {\n if (sessionRequest === request) sessionRequest = null;\n });\n sessionRequest = request;\n return request;\n };\n\n const request = async (path: string, init: RequestInit = {}, providedSignal?: AbortSignal): Promise<Response> => {\n const controller = providedSignal ? null : new AbortController();\n const signal = providedSignal ?? controller?.signal;\n if (!signal) throw new Error(\"An AbortSignal could not be created.\");\n let browserSession = await mintSession(signal);\n const perform = (current: BillLifecycleSession) => {\n const base = (current.apiBaseUrl ?? apiBaseUrl).replace(/\\/$/, \"\");\n const headers = new Headers(init.headers);\n headers.set(\"authorization\", `Bearer ${current.token}`);\n return fetcher(`${base}${path}`, { ...init, headers, signal });\n };\n let response = await perform(browserSession);\n if (response.status === 401) {\n session = null;\n browserSession = await mintSession(signal, true);\n response = await perform(browserSession);\n }\n return response;\n };\n\n const loadLifecycle = async (signal?: AbortSignal) => {\n const response = await request(\"/partner/v2/browser/bill\", {}, signal);\n if (!response.ok) throw await responseError(response, \"Bill lifecycle could not be loaded.\");\n const body = await response.json() as { data?: unknown };\n return normalizeLifecycle(body.data);\n };\n\n const searchClaimsAdministrators = async (query: string, claimNumber?: string): Promise<BillReviewPayer[]> => {\n const params = new URLSearchParams();\n if (query.trim()) params.set(\"q\", query.trim());\n if (claimNumber?.trim()) params.set(\"claimNumber\", claimNumber.trim());\n const response = await request(`/partner/v2/browser/claims-administrators?${params.toString()}`);\n if (!response.ok) throw await responseError(response, \"Claims administrator search is unavailable.\");\n const body = await response.json() as { results?: unknown };\n if (!Array.isArray(body.results)) throw new Error(\"Claims administrator search returned an invalid response.\");\n return body.results.flatMap((value): BillReviewPayer[] => {\n if (!value || typeof value !== \"object\") return [];\n const payer = value as Partial<BillReviewPayer>;\n if (typeof payer.id !== \"string\" || typeof payer.name !== \"string\") return [];\n return [{\n id: payer.id,\n name: payer.name,\n ...(typeof payer.hasElectronic === \"boolean\" ? { hasElectronic: payer.hasElectronic } : {}),\n ...(Array.isArray(payer.states)\n ? { states: payer.states.filter((state): state is string => typeof state === \"string\") }\n : {}),\n ...([\"high\", \"medium\", \"directory\"].includes(payer.confidence ?? \"\")\n ? { confidence: payer.confidence as NonNullable<BillReviewPayer[\"confidence\"]> }\n : {}),\n ...(typeof payer.recommended === \"boolean\" ? { recommended: payer.recommended } : {}),\n ...(Array.isArray(payer.signals)\n ? {\n signals: payer.signals.flatMap((signal) => {\n if (!signal || typeof signal !== \"object\") return [];\n const candidate = signal as { kind?: unknown; state?: unknown; label?: unknown };\n if (\n ![\"name\", \"claim_number\"].includes(String(candidate.kind))\n || ![\"match\", \"warning\"].includes(String(candidate.state))\n || typeof candidate.label !== \"string\"\n ) return [];\n return [{\n kind: candidate.kind as \"name\" | \"claim_number\",\n state: candidate.state as \"match\" | \"warning\",\n label: candidate.label,\n }];\n }),\n }\n : {}),\n }];\n });\n };\n\n const mutation = async (path: string, init: RequestInit, fallback: string) => {\n const headers = new Headers(init.headers);\n headers.set(\"idempotency-key\", idempotencyKey());\n const response = await request(path, { ...init, headers });\n if (!response.ok) throw await responseError(response, fallback);\n return response;\n };\n const action = async (input: Record<string, unknown>, fallback: string): Promise<BillLifecycleData> => {\n const response = await mutation(\"/partner/v2/browser/actions\", {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify(input),\n }, fallback);\n const body = await response.json() as { data?: unknown };\n return normalizeLifecycle(body.data);\n };\n const saveReview = async (input: BillReviewSaveInput): Promise<BillLifecycleData> => {\n await mutation(\"/partner/v2/browser/bill\", {\n method: \"PATCH\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify(input),\n }, \"Bill changes could not be saved.\");\n return loadLifecycle();\n };\n\n return {\n clearSession() { session = null; sessionRequest = null; },\n getLifecycle: loadLifecycle,\n searchClaimsAdministrators,\n saveReview,\n async submitBill(input, route) {\n await saveReview(input);\n await mutation(\"/partner/v2/browser/submissions\", {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ route }),\n }, \"Bill could not be submitted.\");\n return loadLifecycle();\n },\n async addAttachment(file, documentType, description) {\n const body = new FormData();\n body.set(\"file\", file);\n body.set(\"documentType\", documentType);\n if (description) body.set(\"description\", description);\n await mutation(\"/partner/v2/browser/documents\", { method: \"POST\", body }, \"Document could not be attached.\");\n return loadLifecycle();\n },\n async removeAttachment(attachmentId) {\n await mutation(`/partner/v2/browser/documents/${encodeURIComponent(attachmentId)}`, { method: \"DELETE\" }, \"Document could not be removed.\");\n return loadLifecycle();\n },\n async getAttachment(attachmentId) {\n const response = await request(`/partner/v2/browser/documents/${encodeURIComponent(attachmentId)}`);\n if (!response.ok) throw await responseError(response, \"Document could not be opened.\");\n return response.blob();\n },\n async getEor(documentId) {\n const response = await request(`/partner/v2/browser/eors/${encodeURIComponent(documentId)}`);\n if (!response.ok) throw await responseError(response, \"EOR could not be opened.\");\n return response.blob();\n },\n closeBill(input) { return action({ action: \"close\", ...input }, \"Bill could not be closed.\"); },\n postPayment(input) { return action({ action: \"post_payment\", ...input, checkNumber: input.checkNumber ?? \"\" }, \"Payment could not be posted.\"); },\n submitSecondReview(input) { return action({ action: \"second_review\", ...input }, \"Second Review could not be submitted.\"); },\n async startCorrection() {\n const response = await mutation(\"/partner/v2/browser/actions\", {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ action: \"start_correction\" }),\n }, \"Correction draft could not be created.\");\n const body = await response.json() as { replacementBillId?: unknown; data?: unknown };\n if (typeof body.replacementBillId !== \"string\") throw new Error(\"The billing service did not return the correction bill ID.\");\n return {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eAAe,GAAG,GAAG,8BAA8B;AAAA,IAAG;AAAA,IAChJ,mBAAmB,OAAO;AAAE,aAAO,OAAO,EAAE,QAAQ,iBAAiB,GAAG,MAAM,GAAG,uCAAuC;AAAA,IAAG;AAAA,IAC3H,MAAM,kBAAkB;AACtB,YAAM,WAAW,MAAM,SAAS,+BAA+B;AAAA,QAC7D,QAAQ;AAAA,QACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,QAC9C,MAAM,KAAK,UAAU,EAAE,QAAQ,mBAAmB,CAAC;AAAA,MACrD,GAAG,wCAAwC;AAC3C,YAAM,OAAO,MAAM,SAAS,KAAK;AACjC,UAAI,OAAO,KAAK,sBAAsB,SAAU,OAAM,IAAI,MAAM,4DAA4D;AAC5H,aAAO,EAAE,mBAAmB,KAAK,mBAAmB,MAAM,mBAAmB,KAAK,IAAI,EAAE;AAAA,IAC1F;AAAA,EACF;AACF;","names":["request"]}
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@mindbill/browser",
3
+ "version": "0.1.0",
4
+ "description": "Framework-neutral browser client for the MindBill bill lifecycle",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": ["dist", "README.md"],
16
+ "scripts": {
17
+ "build": "tsup src/index.ts --format esm --dts --clean --sourcemap",
18
+ "clean": "rm -rf dist"
19
+ },
20
+ "keywords": ["mindbill", "browser", "billing", "workers-compensation"],
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/incidentfox/mindbill-widgets.git",
25
+ "directory": "packages/browser"
26
+ },
27
+ "publishConfig": { "access": "public", "provenance": true },
28
+ "sideEffects": false
29
+ }