@mindbill/angular 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 +54 -0
- package/fesm2022/mindbill-angular.mjs +477 -0
- package/fesm2022/mindbill-angular.mjs.map +1 -0
- package/package.json +44 -0
- package/types/mindbill-angular.d.ts +137 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @mindbill/angular
|
|
2
|
+
|
|
3
|
+
Native Angular billing UI with built-in session renewal and lifecycle API calls.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @mindbill/angular @mindbill/node
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Import the standalone component and give it the one value your application keeps: the bill ID.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { Component } from "@angular/core";
|
|
13
|
+
import { MindBillBillLifecycleComponent } from "@mindbill/angular";
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: "app-case-billing",
|
|
17
|
+
standalone: true,
|
|
18
|
+
imports: [MindBillBillLifecycleComponent],
|
|
19
|
+
template: `
|
|
20
|
+
<mindbill-bill-lifecycle
|
|
21
|
+
[billId]="billId"
|
|
22
|
+
sessionEndpoint="/api/mindbill/bill-session"
|
|
23
|
+
[appearance]="{ preset: 'clinical-blue' }"
|
|
24
|
+
(billIdChange)="billId = $event"
|
|
25
|
+
/>
|
|
26
|
+
`,
|
|
27
|
+
})
|
|
28
|
+
export class CaseBillingComponent {
|
|
29
|
+
billId = "bill_123";
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The component loads and refreshes status, searches the payer directory, saves bill edits, manages the explicit payer packet, submits the bill, shows EORs, and exposes the correct payment, review, correction, resubmission, and close actions for the current state.
|
|
34
|
+
|
|
35
|
+
Add one authenticated server endpoint. It verifies that the signed-in user may access the bill, then mints a short-lived token bound to that bill and browser origin.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { MindBillClient } from "@mindbill/node";
|
|
39
|
+
|
|
40
|
+
const mindbill = new MindBillClient({ apiKey: process.env["MINDBILL_API_KEY"]! });
|
|
41
|
+
|
|
42
|
+
app.post("/api/mindbill/bill-session", requireUser, async (req, res) => {
|
|
43
|
+
await requireBillAccess(req.user, req.body.billId);
|
|
44
|
+
const session = await mindbill.createBrowserSession({
|
|
45
|
+
component: "bill-review",
|
|
46
|
+
billId: req.body.billId,
|
|
47
|
+
allowedOrigin: `${req.protocol}://${req.get("host")}`,
|
|
48
|
+
expiresIn: 900,
|
|
49
|
+
});
|
|
50
|
+
res.json(session);
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Your permanent API key never reaches Angular. Available presets are `mindbill`, `qme-companion`, `orange-bright`, and `clinical-blue`; every visual token can also be overridden.
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, computed, EventEmitter, effect, Output, Input, Component } from '@angular/core';
|
|
3
|
+
import { createBillLifecycleClient } from '@mindbill/browser';
|
|
4
|
+
import * as i1 from '@angular/common';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import * as i2 from '@angular/forms';
|
|
7
|
+
import { FormsModule } from '@angular/forms';
|
|
8
|
+
|
|
9
|
+
class MindBillLifecycleStore {
|
|
10
|
+
billId = signal("", ...(ngDevMode ? [{ debugName: "billId" }] : /* istanbul ignore next */ []));
|
|
11
|
+
data = signal(null, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
12
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
13
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
14
|
+
mutating = signal(false, ...(ngDevMode ? [{ debugName: "mutating" }] : /* istanbul ignore next */ []));
|
|
15
|
+
ready = computed(() => this.data() !== null && !this.loading(), ...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
|
|
16
|
+
client = null;
|
|
17
|
+
refreshTimer = null;
|
|
18
|
+
connect(options, refreshInterval = 60_000) {
|
|
19
|
+
this.disconnect();
|
|
20
|
+
this.billId.set(options.billId);
|
|
21
|
+
this.client = createBillLifecycleClient(options);
|
|
22
|
+
void this.refresh();
|
|
23
|
+
if (refreshInterval > 0) {
|
|
24
|
+
this.refreshTimer = setInterval(() => void this.refresh(), refreshInterval);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
disconnect() {
|
|
28
|
+
if (this.refreshTimer)
|
|
29
|
+
clearInterval(this.refreshTimer);
|
|
30
|
+
this.refreshTimer = null;
|
|
31
|
+
this.client?.clearSession();
|
|
32
|
+
this.client = null;
|
|
33
|
+
}
|
|
34
|
+
async refresh() {
|
|
35
|
+
if (!this.client)
|
|
36
|
+
return null;
|
|
37
|
+
this.loading.set(this.data() === null);
|
|
38
|
+
try {
|
|
39
|
+
const data = await this.client.getLifecycle();
|
|
40
|
+
this.data.set(data);
|
|
41
|
+
this.error.set(null);
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
catch (cause) {
|
|
45
|
+
this.error.set(cause instanceof Error ? cause : new Error("Bill could not be loaded."));
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
this.loading.set(false);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
searchClaimsAdministrators(query, claimNumber) {
|
|
53
|
+
return this.requireClient().searchClaimsAdministrators(query, claimNumber);
|
|
54
|
+
}
|
|
55
|
+
saveReview(input) { return this.mutate(() => this.requireClient().saveReview(input)); }
|
|
56
|
+
submitBill(input, route) { return this.mutate(() => this.requireClient().submitBill(input, route)); }
|
|
57
|
+
addAttachment(file, type, description) { return this.mutate(() => this.requireClient().addAttachment(file, type, description)); }
|
|
58
|
+
removeAttachment(id) { return this.mutate(() => this.requireClient().removeAttachment(id)); }
|
|
59
|
+
getAttachment(id) { return this.requireClient().getAttachment(id); }
|
|
60
|
+
getEor(id) { return this.requireClient().getEor(id); }
|
|
61
|
+
closeBill(input) { return this.mutate(() => this.requireClient().closeBill(input)); }
|
|
62
|
+
postPayment(input) { return this.mutate(() => this.requireClient().postPayment(input)); }
|
|
63
|
+
submitSecondReview(input) { return this.mutate(() => this.requireClient().submitSecondReview(input)); }
|
|
64
|
+
async startCorrection() {
|
|
65
|
+
this.mutating.set(true);
|
|
66
|
+
try {
|
|
67
|
+
const result = await this.requireClient().startCorrection();
|
|
68
|
+
this.billId.set(result.replacementBillId);
|
|
69
|
+
this.data.set(result.data);
|
|
70
|
+
this.error.set(null);
|
|
71
|
+
return result.data;
|
|
72
|
+
}
|
|
73
|
+
catch (cause) {
|
|
74
|
+
const error = cause instanceof Error ? cause : new Error("Correction draft could not be created.");
|
|
75
|
+
this.error.set(error);
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
this.mutating.set(false);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
requireClient() {
|
|
83
|
+
if (!this.client)
|
|
84
|
+
throw new Error("Connect the lifecycle store before using it.");
|
|
85
|
+
return this.client;
|
|
86
|
+
}
|
|
87
|
+
async mutate(task) {
|
|
88
|
+
this.mutating.set(true);
|
|
89
|
+
this.error.set(null);
|
|
90
|
+
try {
|
|
91
|
+
const data = await task();
|
|
92
|
+
this.data.set(data);
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
95
|
+
catch (cause) {
|
|
96
|
+
const error = cause instanceof Error ? cause : new Error("The billing request could not be completed.");
|
|
97
|
+
this.error.set(error);
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
this.mutating.set(false);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const THEMES = {
|
|
107
|
+
mindbill: { preset: "mindbill", accentColor: "#238dbd", accentTextColor: "#fff", backgroundColor: "#f3f8fa", surfaceColor: "#fff", textColor: "#203743", mutedColor: "#657982", borderColor: "#dbe6ea", borderRadius: "14px", controlRadius: "8px", fontFamily: "Inter,system-ui,sans-serif" },
|
|
108
|
+
"qme-companion": { preset: "qme-companion", accentColor: "#53b5dc", accentTextColor: "#173542", backgroundColor: "#f2f8fb", surfaceColor: "#fff", textColor: "#1d3440", mutedColor: "#617783", borderColor: "#d7e5eb", borderRadius: "12px", controlRadius: "8px", fontFamily: "Inter,system-ui,sans-serif" },
|
|
109
|
+
"orange-bright": { preset: "orange-bright", accentColor: "#ff4f0a", accentTextColor: "#fff", backgroundColor: "#fffaf6", surfaceColor: "#fff", textColor: "#111827", mutedColor: "#626a73", borderColor: "#e5e1dc", borderRadius: "8px", controlRadius: "6px", fontFamily: "Inter,system-ui,sans-serif" },
|
|
110
|
+
"clinical-blue": { preset: "clinical-blue", accentColor: "#1677ff", accentTextColor: "#fff", backgroundColor: "#f5f7fa", surfaceColor: "#fff", textColor: "#1f2d3d", mutedColor: "#66788a", borderColor: "#d9e2ec", borderRadius: "8px", controlRadius: "6px", fontFamily: "Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif" },
|
|
111
|
+
};
|
|
112
|
+
const DOCUMENT_TYPES = [
|
|
113
|
+
{ value: "final_report", label: "Final report" },
|
|
114
|
+
{ value: "proof_of_service", label: "Proof of service" },
|
|
115
|
+
{ value: "letter_of_attestation", label: "Letter of attestation" },
|
|
116
|
+
{ value: "form_122", label: "Required form" },
|
|
117
|
+
{ value: "w9", label: "W-9" },
|
|
118
|
+
{ value: "appeal", label: "Appeal support" },
|
|
119
|
+
{ value: "medical_records", label: "Medical records (intentional)" },
|
|
120
|
+
{ value: "other", label: "Other supporting document" },
|
|
121
|
+
];
|
|
122
|
+
class MindBillBillLifecycleComponent {
|
|
123
|
+
billId = "";
|
|
124
|
+
sessionEndpoint = "/api/mindbill/bill-session";
|
|
125
|
+
apiBaseUrl = "https://app.mindbill.org";
|
|
126
|
+
getSession;
|
|
127
|
+
refreshInterval = 60_000;
|
|
128
|
+
appearance = { preset: "mindbill" };
|
|
129
|
+
billIdChange = new EventEmitter();
|
|
130
|
+
submitted = new EventEmitter();
|
|
131
|
+
billingError = new EventEmitter();
|
|
132
|
+
store = new MindBillLifecycleStore();
|
|
133
|
+
documentTypes = DOCUMENT_TYPES;
|
|
134
|
+
routes = [{ value: "ebill", label: "E-bill" }, { value: "fax", label: "Fax" }, { value: "mail", label: "Mail" }, { value: "email", label: "Email" }];
|
|
135
|
+
draft = null;
|
|
136
|
+
dirty = false;
|
|
137
|
+
payerQuery = "";
|
|
138
|
+
payerResults = [];
|
|
139
|
+
documentType = "other";
|
|
140
|
+
pendingFile = null;
|
|
141
|
+
route = "ebill";
|
|
142
|
+
panel = "";
|
|
143
|
+
notice = "";
|
|
144
|
+
closeReason = "";
|
|
145
|
+
payment = { amount: 0, method: "check", depositDate: new Date().toISOString().slice(0, 10) };
|
|
146
|
+
review = { reason: "", payerClaimControlNumber: "", disputedAmount: 0 };
|
|
147
|
+
payerTimer = null;
|
|
148
|
+
constructor() {
|
|
149
|
+
effect(() => {
|
|
150
|
+
const data = this.store.data();
|
|
151
|
+
if (data && !this.dirty)
|
|
152
|
+
this.draft = this.makeDraft(data);
|
|
153
|
+
const error = this.store.error();
|
|
154
|
+
if (error)
|
|
155
|
+
this.billingError.emit(error);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
ngOnChanges(changes) {
|
|
159
|
+
if ((changes["billId"] || changes["sessionEndpoint"] || changes["apiBaseUrl"] || changes["getSession"]) && this.billId) {
|
|
160
|
+
this.store.connect({ billId: this.billId, sessionEndpoint: this.sessionEndpoint, apiBaseUrl: this.apiBaseUrl, ...(this.getSession ? { getSession: this.getSession } : {}) }, this.refreshInterval);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
ngOnDestroy() { this.store.disconnect(); if (this.payerTimer)
|
|
164
|
+
clearTimeout(this.payerTimer); }
|
|
165
|
+
get themeStyle() {
|
|
166
|
+
const base = THEMES[this.appearance.preset ?? "mindbill"];
|
|
167
|
+
return {
|
|
168
|
+
"--a": this.appearance.accentColor ?? base.accentColor,
|
|
169
|
+
"--ac": this.appearance.accentTextColor ?? base.accentTextColor,
|
|
170
|
+
"--bg": this.appearance.backgroundColor ?? base.backgroundColor,
|
|
171
|
+
"--s": this.appearance.surfaceColor ?? base.surfaceColor,
|
|
172
|
+
"--t": this.appearance.textColor ?? base.textColor,
|
|
173
|
+
"--m": this.appearance.mutedColor ?? base.mutedColor,
|
|
174
|
+
"--b": this.appearance.borderColor ?? base.borderColor,
|
|
175
|
+
"--r": this.appearance.borderRadius ?? base.borderRadius,
|
|
176
|
+
"--cr": this.appearance.controlRadius ?? base.controlRadius,
|
|
177
|
+
"--font": this.appearance.fontFamily ?? base.fontFamily,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
stateLabel(data) { return data.lifecycle.state.replace(/_/g, " ").replace(/\b\w/g, (value) => value.toUpperCase()); }
|
|
181
|
+
lifecycleDetail(data) { return data.lifecycle.submittedAt ? `Submitted ${new Date(data.lifecycle.submittedAt).toLocaleDateString()}${data.lifecycle.agingDays != null ? ` · ${data.lifecycle.agingDays} days old` : ""}` : "Review the prefilled bill and payer packet before submission."; }
|
|
182
|
+
isEditable(data) { return data.lifecycle.actions.some((action) => action.id === "edit_and_submit" && action.enabled) || ["incomplete", "draft", "not_submitted"].includes(data.lifecycle.state.toLowerCase()); }
|
|
183
|
+
payerExplanation(payer) { return payer.signals?.map((signal) => signal.label).join(" · ") || (payer.hasElectronic ? "Electronic billing available" : "Available in payer directory"); }
|
|
184
|
+
queuePayerSearch() { if (this.payerTimer)
|
|
185
|
+
clearTimeout(this.payerTimer); this.payerTimer = setTimeout(() => void this.searchPayers(), 250); }
|
|
186
|
+
async searchPayers() { if (!this.payerQuery.trim()) {
|
|
187
|
+
this.payerResults = [];
|
|
188
|
+
return;
|
|
189
|
+
} this.payerResults = await this.store.searchClaimsAdministrators(this.payerQuery, this.draft?.injury.claimNumber); }
|
|
190
|
+
selectPayer(payer) { if (!this.draft)
|
|
191
|
+
return; this.draft.injury.claimsAdminId = payer.id; this.draft.injury.claimsAdminName = payer.name; this.payerQuery = ""; this.payerResults = []; this.dirty = true; }
|
|
192
|
+
clearPayer() { if (!this.draft)
|
|
193
|
+
return; this.draft.injury.claimsAdminId = ""; this.draft.injury.claimsAdminName = ""; this.dirty = true; }
|
|
194
|
+
addLine() { this.draft?.bill.lineItems.push({ code: "", modifiers: [], units: 1, charge: 0 }); this.dirty = true; }
|
|
195
|
+
removeLine(index) { this.draft?.bill.lineItems.splice(index, 1); this.dirty = true; }
|
|
196
|
+
setModifiers(line, value) { line.modifiers = value.split(",").map((item) => item.trim().replace(/^-/, "")).filter(Boolean); this.dirty = true; }
|
|
197
|
+
fileSelected(event) { this.pendingFile = event.target.files?.[0] ?? null; }
|
|
198
|
+
async attach() { if (!this.pendingFile)
|
|
199
|
+
return; await this.store.addAttachment(this.pendingFile, this.documentType); this.pendingFile = null; this.notice = "Document attached."; }
|
|
200
|
+
async removeAttachment(id) { await this.store.removeAttachment(id); this.notice = "Document removed."; }
|
|
201
|
+
async openAttachment(id, filename) { this.openBlob(await this.store.getAttachment(id), filename); }
|
|
202
|
+
async openEor(id, filename) { this.openBlob(await this.store.getEor(id), filename); }
|
|
203
|
+
canSubmit() { const input = this.buildInput(); return Boolean(input && input.claimsAdminId && input.dos && input.billingProvider?.name && input.billingProvider.taxId && input.billingProvider.npi && input.renderingProvider?.name && input.renderingProvider.npi && input.lineItems.some((line) => line.code && line.units > 0)); }
|
|
204
|
+
async save() { const input = this.buildInput(); if (!input)
|
|
205
|
+
return; const data = await this.store.saveReview(input); this.dirty = false; this.draft = this.makeDraft(data); this.notice = "Bill saved."; }
|
|
206
|
+
async submit() { const input = this.buildInput(); if (!input || !this.canSubmit())
|
|
207
|
+
return; const data = await this.store.submitBill(input, this.route); this.dirty = false; this.draft = this.makeDraft(data); this.notice = "Bill submitted."; this.submitted.emit(data); }
|
|
208
|
+
beginAction(action) { if (action === "post_payment")
|
|
209
|
+
this.panel = "payment";
|
|
210
|
+
else if (action === "second_review" || action === "independent_bill_review")
|
|
211
|
+
this.panel = "review";
|
|
212
|
+
else if (action === "close")
|
|
213
|
+
this.panel = "close";
|
|
214
|
+
else if (action === "view_eor" && this.store.data()?.eors[0]) {
|
|
215
|
+
const eor = this.store.data().eors[0];
|
|
216
|
+
void this.openEor(eor.id, eor.filename);
|
|
217
|
+
}
|
|
218
|
+
else if (action === "correct_and_resubmit")
|
|
219
|
+
void this.correct(); }
|
|
220
|
+
async correct() { const data = await this.store.startCorrection(); this.billIdChange.emit(this.store.billId()); this.dirty = false; this.draft = this.makeDraft(data); this.notice = "Correction draft created."; }
|
|
221
|
+
async postPayment() { await this.store.postPayment({ ...this.payment }); this.panel = ""; this.notice = "Payment posted."; }
|
|
222
|
+
async submitReview() { const data = this.store.data(); if (!data)
|
|
223
|
+
return; await this.store.submitSecondReview({ ...this.review, disputedAmount: this.review.disputedAmount || undefined, route: "ebill", attachmentIds: data.bill.attachments.map((doc) => doc.id) }); this.panel = ""; this.notice = "Second Review submitted."; }
|
|
224
|
+
async closeBill() { if (!this.closeReason.trim())
|
|
225
|
+
return; await this.store.closeBill({ reason: this.closeReason }); this.panel = ""; this.notice = "Bill closed."; }
|
|
226
|
+
buildInput() {
|
|
227
|
+
if (!this.draft)
|
|
228
|
+
return null;
|
|
229
|
+
return {
|
|
230
|
+
claimsAdminId: this.draft.injury.claimsAdminId ?? "",
|
|
231
|
+
patientOverrides: {
|
|
232
|
+
firstName: this.draft.patient.firstName,
|
|
233
|
+
lastName: this.draft.patient.lastName,
|
|
234
|
+
...(this.draft.patient.middleName ? { middleName: this.draft.patient.middleName } : {}),
|
|
235
|
+
...(this.draft.patient.dob ? { dob: this.draft.patient.dob } : {}),
|
|
236
|
+
},
|
|
237
|
+
injuryOverrides: {
|
|
238
|
+
...(this.draft.injury.claimNumber ? { claimNumber: this.draft.injury.claimNumber } : {}),
|
|
239
|
+
...(this.draft.injury.employer ? { employer: this.draft.injury.employer } : {}),
|
|
240
|
+
...(this.draft.injury.doi ? { doi: this.draft.injury.doi } : {}),
|
|
241
|
+
...(this.draft.injury.injuryEndDate ? { injuryEndDate: this.draft.injury.injuryEndDate } : {}),
|
|
242
|
+
...(typeof this.draft.injury.cumulativeTrauma === "boolean" ? { cumulativeTrauma: this.draft.injury.cumulativeTrauma } : {}),
|
|
243
|
+
...(this.draft.injury.adjNumber ? { adjNumber: this.draft.injury.adjNumber } : {}),
|
|
244
|
+
},
|
|
245
|
+
dos: this.draft.bill.dos,
|
|
246
|
+
billingProvider: this.draft.billingProvider,
|
|
247
|
+
renderingProvider: this.draft.clinician,
|
|
248
|
+
placeOfService: this.draft.location,
|
|
249
|
+
lineItems: this.draft.bill.lineItems.map((line) => ({
|
|
250
|
+
...(line.id ? { id: line.id } : {}),
|
|
251
|
+
code: line.code,
|
|
252
|
+
modifiers: line.modifiers,
|
|
253
|
+
units: line.units,
|
|
254
|
+
})),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
makeDraft(data) {
|
|
258
|
+
const snapshot = data.bill.billingSnapshot ?? {};
|
|
259
|
+
const names = data.patient.name.trim().split(/\s+/);
|
|
260
|
+
return { patient: { ...data.patient, firstName: data.patient.firstName ?? names[0] ?? "", lastName: data.patient.lastName ?? names.slice(1).join(" ") }, injury: { ...data.injury }, bill: { ...data.bill, lineItems: data.bill.lineItems.map((line) => ({ ...line, modifiers: [...line.modifiers] })) }, billingProvider: snapshot.billingProvider ?? { name: "", taxId: "", npi: "", billType: "Professional" }, clinician: snapshot.renderingProvider ?? { name: "", specialty: "", npi: "" }, location: snapshot.placeOfService ?? { name: "", street: "", city: "", state: "", zip: "", posCode: "11" } };
|
|
261
|
+
}
|
|
262
|
+
openBlob(blob, filename) { const url = URL.createObjectURL(blob); const link = document.createElement("a"); link.href = url; link.target = "_blank"; link.rel = "noopener"; link.download = filename; link.click(); setTimeout(() => URL.revokeObjectURL(url), 60_000); }
|
|
263
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MindBillBillLifecycleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
264
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: MindBillBillLifecycleComponent, isStandalone: true, selector: "mindbill-bill-lifecycle", inputs: { billId: "billId", sessionEndpoint: "sessionEndpoint", apiBaseUrl: "apiBaseUrl", getSession: "getSession", refreshInterval: "refreshInterval", appearance: "appearance" }, outputs: { billIdChange: "billIdChange", submitted: "submitted", billingError: "billingError" }, usesOnChanges: true, ngImport: i0, template: `
|
|
265
|
+
<section class="mb" [ngStyle]="themeStyle">
|
|
266
|
+
@if (store.loading() && !store.data()) {
|
|
267
|
+
<div class="state">Loading billing…</div>
|
|
268
|
+
} @else if (store.error() && !store.data()) {
|
|
269
|
+
<div class="state error"><strong>Billing is temporarily unavailable</strong><span>{{ store.error()?.message }}</span><button (click)="store.refresh()">Try again</button></div>
|
|
270
|
+
} @else if (store.data(); as data) {
|
|
271
|
+
<header class="summary">
|
|
272
|
+
<div><span class="eyebrow">Bill {{ data.bill.billNumber }}</span><h2>{{ stateLabel(data) }}</h2><p>{{ lifecycleDetail(data) }}</p></div>
|
|
273
|
+
<div class="money"><span>{{ data.bill.balanceDue | currency }}</span><small>balance</small></div>
|
|
274
|
+
</header>
|
|
275
|
+
|
|
276
|
+
@if (isEditable(data) && draft) {
|
|
277
|
+
<form class="review" (submit)="$event.preventDefault(); submit()">
|
|
278
|
+
<section class="card">
|
|
279
|
+
<div class="card-title"><div><h3>Patient and claim</h3><p>Prefilled from the case. Correct anything that should print differently on this bill.</p></div><span>Required</span></div>
|
|
280
|
+
<div class="grid four">
|
|
281
|
+
<label><span>First name</span><input required [(ngModel)]="draft.patient.firstName" name="firstName" (ngModelChange)="dirty=true"></label>
|
|
282
|
+
<label><span>Last name</span><input required [(ngModel)]="draft.patient.lastName" name="lastName" (ngModelChange)="dirty=true"></label>
|
|
283
|
+
<label><span>Date of birth</span><input type="date" [(ngModel)]="draft.patient.dob" name="dob" (ngModelChange)="dirty=true"></label>
|
|
284
|
+
<label><span>Date of injury</span><input type="date" [(ngModel)]="draft.injury.doi" name="doi" (ngModelChange)="dirty=true"></label>
|
|
285
|
+
<label><span>Claim number</span><input [(ngModel)]="draft.injury.claimNumber" name="claimNumber" (ngModelChange)="dirty=true"></label>
|
|
286
|
+
<label><span>Employer</span><input [(ngModel)]="draft.injury.employer" name="employer" (ngModelChange)="dirty=true"></label>
|
|
287
|
+
<label><span>WCAB / case number</span><input [(ngModel)]="draft.injury.adjNumber" name="adjNumber" (ngModelChange)="dirty=true"></label>
|
|
288
|
+
<label><span>Date of service</span><input required type="date" [(ngModel)]="draft.bill.dos" name="dos" (ngModelChange)="dirty=true"></label>
|
|
289
|
+
</div>
|
|
290
|
+
</section>
|
|
291
|
+
|
|
292
|
+
<section class="card payer">
|
|
293
|
+
<div class="card-title"><div><h3>Claims administrator</h3><p>Select who should receive this bill. Search uses payer names and claim-number patterns.</p></div><span>Required</span></div>
|
|
294
|
+
@if (draft.injury.claimsAdminId) { <div class="selected"><div><strong>{{ draft.injury.claimsAdminName }}</strong><small>Selected recipient</small></div><button type="button" (click)="clearPayer()">Change</button></div> }
|
|
295
|
+
@else {
|
|
296
|
+
<label><span>Insurance company or claims administrator</span><input name="payerSearch" [(ngModel)]="payerQuery" (ngModelChange)="queuePayerSearch()" placeholder="Search by payer or administrator name" autocomplete="off"></label>
|
|
297
|
+
@if (payerResults.length) { <div class="results">@for (payer of payerResults; track payer.id) { <button type="button" (click)="selectPayer(payer)"><strong>{{ payer.name }}</strong><span>{{ payerExplanation(payer) }}</span></button> }</div> }
|
|
298
|
+
}
|
|
299
|
+
</section>
|
|
300
|
+
|
|
301
|
+
<section class="card">
|
|
302
|
+
<div class="card-title"><div><h3>Billing identity</h3><p>The payee, rendering clinician, and place of service are bill snapshots—not synchronization records.</p></div><span>Prefilled</span></div>
|
|
303
|
+
<div class="subhead">Billing provider</div>
|
|
304
|
+
<div class="grid three">
|
|
305
|
+
<label><span>Practice name</span><input required [(ngModel)]="draft.billingProvider.name" name="practiceName" (ngModelChange)="dirty=true"></label>
|
|
306
|
+
<label><span>Tax ID</span><input required [(ngModel)]="draft.billingProvider.taxId" name="taxId" (ngModelChange)="dirty=true"></label>
|
|
307
|
+
<label><span>Billing NPI</span><input required [(ngModel)]="draft.billingProvider.npi" name="billingNpi" (ngModelChange)="dirty=true"></label>
|
|
308
|
+
</div>
|
|
309
|
+
<div class="subhead">Rendering clinician</div>
|
|
310
|
+
<div class="grid three">
|
|
311
|
+
<label><span>Name</span><input required [(ngModel)]="draft.clinician.name" name="clinicianName" (ngModelChange)="dirty=true"></label>
|
|
312
|
+
<label><span>NPI</span><input required [(ngModel)]="draft.clinician.npi" name="clinicianNpi" (ngModelChange)="dirty=true"></label>
|
|
313
|
+
<label><span>Taxonomy</span><input [(ngModel)]="draft.clinician.taxonomy" name="taxonomy" (ngModelChange)="dirty=true"></label>
|
|
314
|
+
</div>
|
|
315
|
+
<div class="subhead">Service location</div>
|
|
316
|
+
<div class="grid three">
|
|
317
|
+
<label><span>Location</span><input required [(ngModel)]="draft.location.name" name="locationName" (ngModelChange)="dirty=true"></label>
|
|
318
|
+
<label><span>Street</span><input required [(ngModel)]="draft.location.street" name="street" (ngModelChange)="dirty=true"></label>
|
|
319
|
+
<label><span>City</span><input required [(ngModel)]="draft.location.city" name="city" (ngModelChange)="dirty=true"></label>
|
|
320
|
+
<label><span>State</span><input required list="mb-states" maxlength="2" [(ngModel)]="draft.location.state" name="state" (ngModelChange)="dirty=true"></label>
|
|
321
|
+
<label><span>ZIP</span><input required [(ngModel)]="draft.location.zip" name="zip" (ngModelChange)="dirty=true"></label>
|
|
322
|
+
<label><span>Place of service</span><input required [(ngModel)]="draft.location.posCode" name="pos" (ngModelChange)="dirty=true"></label>
|
|
323
|
+
</div>
|
|
324
|
+
</section>
|
|
325
|
+
|
|
326
|
+
<section class="card">
|
|
327
|
+
<div class="card-title"><div><h3>Charges</h3><p>Review procedure codes, modifiers, units, and allowed amounts.</p></div><button type="button" (click)="addLine()">+ Add line</button></div>
|
|
328
|
+
<div class="lines">@for (line of draft.bill.lineItems; track $index; let i=$index) { <div class="line"><label><span>Procedure</span><input required [(ngModel)]="line.code" [name]="'code'+i" (ngModelChange)="dirty=true"></label><label><span>Modifiers</span><input [ngModel]="line.modifiers.join(', ')" (ngModelChange)="setModifiers(line,$any($event))" [name]="'modifiers'+i" placeholder="95, 93"></label><label><span>Units</span><input required type="number" min="1" [(ngModel)]="line.units" [name]="'units'+i" (ngModelChange)="dirty=true"></label><div class="allowed"><span>Allowed</span><strong>{{ line.charge | currency }}</strong></div><button type="button" class="remove" (click)="removeLine(i)" aria-label="Remove line">×</button></div> }</div>
|
|
329
|
+
</section>
|
|
330
|
+
|
|
331
|
+
<section class="card">
|
|
332
|
+
<div class="card-title"><div><h3>Payer packet</h3><p>Only these documents will be sent. Medical records are never attached unless selected intentionally.</p></div><span>{{ data.bill.attachments.length }} files</span></div>
|
|
333
|
+
<ul class="docs">@for (doc of data.bill.attachments; track doc.id) { <li><div><strong>{{ doc.filename }}</strong><small>{{ doc.description || doc.documentType }}</small></div><button type="button" (click)="openAttachment(doc.id,doc.filename)">View</button><button type="button" (click)="removeAttachment(doc.id)">Remove</button></li> }</ul>
|
|
334
|
+
<div class="upload"><select [(ngModel)]="documentType" name="documentType">@for (type of documentTypes; track type.value) { <option [value]="type.value">{{ type.label }}</option> }</select><input #fileInput type="file" accept="application/pdf" (change)="fileSelected($event)"><button type="button" [disabled]="!pendingFile || store.mutating()" (click)="attach()">Attach document</button></div>
|
|
335
|
+
</section>
|
|
336
|
+
|
|
337
|
+
<section class="delivery"><div><span class="eyebrow">Delivery</span><h3>Submit this bill</h3><p>Submission and every later action remain available in this case.</p></div><div><div class="routes">@for (item of routes; track item.value) { <label><input type="radio" name="route" [value]="item.value" [(ngModel)]="route"> {{ item.label }}</label> }</div><div class="actions"><button type="button" (click)="save()" [disabled]="store.mutating()">Save changes</button><button class="primary" type="submit" [disabled]="store.mutating() || !canSubmit()">{{ store.mutating() ? 'Submitting…' : 'Submit bill' }}</button></div></div></section>
|
|
338
|
+
</form>
|
|
339
|
+
} @else {
|
|
340
|
+
<section class="card lifecycle">
|
|
341
|
+
<div class="card-title"><div><h3>Billing activity</h3><p>Available actions change automatically with bill status.</p></div><button (click)="store.refresh()">Refresh</button></div>
|
|
342
|
+
@if (data.eors.length) { <div class="eors"><h4>Explanation of Review</h4>@for (eor of data.eors; track eor.id) { <button (click)="openEor(eor.id,eor.filename)"><span><strong>{{ eor.filename }}</strong><small>{{ eor.description || 'Payer response' }}</small></span><b>View PDF</b></button> }</div> }
|
|
343
|
+
<div class="actionbar">@for (action of data.lifecycle.actions; track action.id) { @if (action.enabled) { <button [class.primary]="action.primary" (click)="beginAction(action.id)">{{ action.label }}</button> } }</div>
|
|
344
|
+
@if (panel === 'payment') { <div class="panel"><h4>Post payment</h4><div class="grid three"><label><span>Amount</span><input type="number" min="0.01" [(ngModel)]="payment.amount"></label><label><span>Method</span><select [(ngModel)]="payment.method"><option value="check">Check</option><option value="eft">EFT</option></select></label><label><span>Deposit date</span><input type="date" [(ngModel)]="payment.depositDate"></label></div><div class="actions"><button (click)="panel=''">Cancel</button><button class="primary" (click)="postPayment()">Post payment</button></div></div> }
|
|
345
|
+
@if (panel === 'review') { <div class="panel"><h4>Submit Second Review</h4><label><span>Reason</span><textarea [(ngModel)]="review.reason"></textarea></label><div class="grid two"><label><span>Payer control number</span><input [(ngModel)]="review.payerClaimControlNumber"></label><label><span>Disputed amount</span><input type="number" [(ngModel)]="review.disputedAmount"></label></div><div class="actions"><button (click)="panel=''">Cancel</button><button class="primary" (click)="submitReview()">Submit review</button></div></div> }
|
|
346
|
+
@if (panel === 'close') { <div class="panel"><h4>Close bill</h4><label><span>Reason</span><textarea [(ngModel)]="closeReason"></textarea></label><div class="actions"><button (click)="panel=''">Cancel</button><button class="danger" (click)="closeBill()">Close bill</button></div></div> }
|
|
347
|
+
</section>
|
|
348
|
+
}
|
|
349
|
+
@if (notice) { <div class="notice">{{ notice }}</div> }
|
|
350
|
+
@if (store.error()) { <div class="notice error">{{ store.error()?.message }}</div> }
|
|
351
|
+
<footer class="powered">Powered by MindBill</footer>
|
|
352
|
+
}
|
|
353
|
+
<datalist id="mb-states"><option value="CA"></option><option value="AZ"></option><option value="NV"></option><option value="OR"></option><option value="WA"></option><option value="TX"></option><option value="NY"></option></datalist>
|
|
354
|
+
</section>
|
|
355
|
+
`, isInline: true, styles: [":host{display:block}.mb{--a:#238dbd;--ac:#fff;--bg:#f3f8fa;--s:#fff;--t:#203743;--m:#657982;--b:#dbe6ea;--r:12px;--cr:8px;display:grid;gap:16px;color:var(--t);font:14px/1.45 var(--font,Inter,system-ui,sans-serif)}*{box-sizing:border-box}h2,h3,h4,p{margin:0}.summary,.card,.delivery,.state{border:1px solid var(--b);border-radius:var(--r);background:var(--s)}.summary{display:flex;justify-content:space-between;gap:20px;padding:20px}.summary h2{font-size:24px}.summary p,.card p,.delivery p,small{color:var(--m)}.eyebrow{color:var(--m);font-size:11px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}.money{text-align:right}.money span{display:block;font-size:28px;font-weight:800}.money small{font-size:12px}.review{display:grid;gap:16px}.card{padding:20px}.card-title{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:18px}.card-title h3,.delivery h3{font-size:18px}.card-title>span{border-radius:999px;background:var(--bg);padding:5px 9px;color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.grid{display:grid;gap:14px}.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}label{display:grid;gap:6px;color:var(--t);font-size:12px;font-weight:700}input,select,textarea,button{font:inherit}input,select,textarea{width:100%;min-height:42px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;color:var(--t);padding:9px 11px}textarea{min-height:90px;resize:vertical}button{min-height:38px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;color:var(--t);padding:8px 13px;cursor:pointer;font-weight:700}button.primary{border-color:var(--a);background:var(--a);color:var(--ac)}button.danger{border-color:#d4380d;background:#d4380d;color:#fff}button:disabled{cursor:not-allowed;opacity:.5}.subhead{margin:18px 0 9px;border-top:1px solid var(--b);padding-top:15px;font-size:12px;font-weight:800}.selected{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--b);border-radius:var(--cr);padding:12px}.selected div{display:grid}.results{position:relative;z-index:3;display:grid;margin-top:5px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;box-shadow:0 12px 30px #1f2d3d1f;overflow:hidden}.results button{display:grid;gap:2px;text-align:left;border:0;border-bottom:1px solid var(--b);border-radius:0;padding:12px}.results span{color:var(--m);font-weight:400}.lines{display:grid;gap:10px}.line{display:grid;grid-template-columns:1.2fr 1.2fr 110px 120px 40px;align-items:end;gap:10px;border-radius:var(--cr);background:var(--bg);padding:12px}.allowed{display:grid;gap:7px;text-align:right}.allowed span{color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.allowed strong{font-size:17px}.remove{border:0;background:transparent;font-size:20px}.docs{list-style:none;margin:0;padding:0}.docs li{display:flex;align-items:center;gap:8px;border-top:1px solid var(--b);padding:11px 0}.docs li>div{display:grid;flex:1}.upload{display:grid;grid-template-columns:240px 1fr auto;gap:10px;margin-top:12px;border-radius:var(--cr);background:var(--bg);padding:12px}.delivery{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px;background:color-mix(in srgb,var(--a) 5%,white)}.routes,.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.routes{margin-bottom:10px}.routes label{display:flex;align-items:center;border:1px solid var(--b);border-radius:var(--cr);background:#fff;padding:9px 12px}.routes input{width:auto;min-height:auto}.lifecycle{display:grid;gap:16px}.actionbar{flex-wrap:wrap}.eors{display:grid;gap:8px}.eors>button{display:flex;align-items:center;justify-content:space-between;text-align:left}.eors span{display:grid}.panel{display:grid;gap:14px;border-top:1px solid var(--b);padding-top:16px}.notice,.state{padding:13px 15px}.notice{border-radius:var(--cr);background:#edf8f2;color:#23734c}.notice.error,.state.error{background:#fff2f0;color:#b42318}.state{display:grid;gap:10px}.state button{justify-self:start}.powered{text-align:right;color:var(--m);font-size:11px}@media(max-width:900px){.grid.four,.grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}.line{grid-template-columns:1fr 1fr 90px}.allowed{grid-column:1/-2;text-align:left}.upload{grid-template-columns:1fr}.delivery{align-items:stretch;flex-direction:column}.routes,.actions{justify-content:flex-start}}@media(max-width:600px){.summary,.card-title{align-items:stretch;flex-direction:column}.money{text-align:left}.grid.four,.grid.three,.grid.two,.line{grid-template-columns:1fr}.allowed{grid-column:auto}.routes{flex-wrap:wrap}.docs li{align-items:flex-start;flex-wrap:wrap}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }] });
|
|
356
|
+
}
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MindBillBillLifecycleComponent, decorators: [{
|
|
358
|
+
type: Component,
|
|
359
|
+
args: [{ selector: "mindbill-bill-lifecycle", standalone: true, imports: [CommonModule, FormsModule], template: `
|
|
360
|
+
<section class="mb" [ngStyle]="themeStyle">
|
|
361
|
+
@if (store.loading() && !store.data()) {
|
|
362
|
+
<div class="state">Loading billing…</div>
|
|
363
|
+
} @else if (store.error() && !store.data()) {
|
|
364
|
+
<div class="state error"><strong>Billing is temporarily unavailable</strong><span>{{ store.error()?.message }}</span><button (click)="store.refresh()">Try again</button></div>
|
|
365
|
+
} @else if (store.data(); as data) {
|
|
366
|
+
<header class="summary">
|
|
367
|
+
<div><span class="eyebrow">Bill {{ data.bill.billNumber }}</span><h2>{{ stateLabel(data) }}</h2><p>{{ lifecycleDetail(data) }}</p></div>
|
|
368
|
+
<div class="money"><span>{{ data.bill.balanceDue | currency }}</span><small>balance</small></div>
|
|
369
|
+
</header>
|
|
370
|
+
|
|
371
|
+
@if (isEditable(data) && draft) {
|
|
372
|
+
<form class="review" (submit)="$event.preventDefault(); submit()">
|
|
373
|
+
<section class="card">
|
|
374
|
+
<div class="card-title"><div><h3>Patient and claim</h3><p>Prefilled from the case. Correct anything that should print differently on this bill.</p></div><span>Required</span></div>
|
|
375
|
+
<div class="grid four">
|
|
376
|
+
<label><span>First name</span><input required [(ngModel)]="draft.patient.firstName" name="firstName" (ngModelChange)="dirty=true"></label>
|
|
377
|
+
<label><span>Last name</span><input required [(ngModel)]="draft.patient.lastName" name="lastName" (ngModelChange)="dirty=true"></label>
|
|
378
|
+
<label><span>Date of birth</span><input type="date" [(ngModel)]="draft.patient.dob" name="dob" (ngModelChange)="dirty=true"></label>
|
|
379
|
+
<label><span>Date of injury</span><input type="date" [(ngModel)]="draft.injury.doi" name="doi" (ngModelChange)="dirty=true"></label>
|
|
380
|
+
<label><span>Claim number</span><input [(ngModel)]="draft.injury.claimNumber" name="claimNumber" (ngModelChange)="dirty=true"></label>
|
|
381
|
+
<label><span>Employer</span><input [(ngModel)]="draft.injury.employer" name="employer" (ngModelChange)="dirty=true"></label>
|
|
382
|
+
<label><span>WCAB / case number</span><input [(ngModel)]="draft.injury.adjNumber" name="adjNumber" (ngModelChange)="dirty=true"></label>
|
|
383
|
+
<label><span>Date of service</span><input required type="date" [(ngModel)]="draft.bill.dos" name="dos" (ngModelChange)="dirty=true"></label>
|
|
384
|
+
</div>
|
|
385
|
+
</section>
|
|
386
|
+
|
|
387
|
+
<section class="card payer">
|
|
388
|
+
<div class="card-title"><div><h3>Claims administrator</h3><p>Select who should receive this bill. Search uses payer names and claim-number patterns.</p></div><span>Required</span></div>
|
|
389
|
+
@if (draft.injury.claimsAdminId) { <div class="selected"><div><strong>{{ draft.injury.claimsAdminName }}</strong><small>Selected recipient</small></div><button type="button" (click)="clearPayer()">Change</button></div> }
|
|
390
|
+
@else {
|
|
391
|
+
<label><span>Insurance company or claims administrator</span><input name="payerSearch" [(ngModel)]="payerQuery" (ngModelChange)="queuePayerSearch()" placeholder="Search by payer or administrator name" autocomplete="off"></label>
|
|
392
|
+
@if (payerResults.length) { <div class="results">@for (payer of payerResults; track payer.id) { <button type="button" (click)="selectPayer(payer)"><strong>{{ payer.name }}</strong><span>{{ payerExplanation(payer) }}</span></button> }</div> }
|
|
393
|
+
}
|
|
394
|
+
</section>
|
|
395
|
+
|
|
396
|
+
<section class="card">
|
|
397
|
+
<div class="card-title"><div><h3>Billing identity</h3><p>The payee, rendering clinician, and place of service are bill snapshots—not synchronization records.</p></div><span>Prefilled</span></div>
|
|
398
|
+
<div class="subhead">Billing provider</div>
|
|
399
|
+
<div class="grid three">
|
|
400
|
+
<label><span>Practice name</span><input required [(ngModel)]="draft.billingProvider.name" name="practiceName" (ngModelChange)="dirty=true"></label>
|
|
401
|
+
<label><span>Tax ID</span><input required [(ngModel)]="draft.billingProvider.taxId" name="taxId" (ngModelChange)="dirty=true"></label>
|
|
402
|
+
<label><span>Billing NPI</span><input required [(ngModel)]="draft.billingProvider.npi" name="billingNpi" (ngModelChange)="dirty=true"></label>
|
|
403
|
+
</div>
|
|
404
|
+
<div class="subhead">Rendering clinician</div>
|
|
405
|
+
<div class="grid three">
|
|
406
|
+
<label><span>Name</span><input required [(ngModel)]="draft.clinician.name" name="clinicianName" (ngModelChange)="dirty=true"></label>
|
|
407
|
+
<label><span>NPI</span><input required [(ngModel)]="draft.clinician.npi" name="clinicianNpi" (ngModelChange)="dirty=true"></label>
|
|
408
|
+
<label><span>Taxonomy</span><input [(ngModel)]="draft.clinician.taxonomy" name="taxonomy" (ngModelChange)="dirty=true"></label>
|
|
409
|
+
</div>
|
|
410
|
+
<div class="subhead">Service location</div>
|
|
411
|
+
<div class="grid three">
|
|
412
|
+
<label><span>Location</span><input required [(ngModel)]="draft.location.name" name="locationName" (ngModelChange)="dirty=true"></label>
|
|
413
|
+
<label><span>Street</span><input required [(ngModel)]="draft.location.street" name="street" (ngModelChange)="dirty=true"></label>
|
|
414
|
+
<label><span>City</span><input required [(ngModel)]="draft.location.city" name="city" (ngModelChange)="dirty=true"></label>
|
|
415
|
+
<label><span>State</span><input required list="mb-states" maxlength="2" [(ngModel)]="draft.location.state" name="state" (ngModelChange)="dirty=true"></label>
|
|
416
|
+
<label><span>ZIP</span><input required [(ngModel)]="draft.location.zip" name="zip" (ngModelChange)="dirty=true"></label>
|
|
417
|
+
<label><span>Place of service</span><input required [(ngModel)]="draft.location.posCode" name="pos" (ngModelChange)="dirty=true"></label>
|
|
418
|
+
</div>
|
|
419
|
+
</section>
|
|
420
|
+
|
|
421
|
+
<section class="card">
|
|
422
|
+
<div class="card-title"><div><h3>Charges</h3><p>Review procedure codes, modifiers, units, and allowed amounts.</p></div><button type="button" (click)="addLine()">+ Add line</button></div>
|
|
423
|
+
<div class="lines">@for (line of draft.bill.lineItems; track $index; let i=$index) { <div class="line"><label><span>Procedure</span><input required [(ngModel)]="line.code" [name]="'code'+i" (ngModelChange)="dirty=true"></label><label><span>Modifiers</span><input [ngModel]="line.modifiers.join(', ')" (ngModelChange)="setModifiers(line,$any($event))" [name]="'modifiers'+i" placeholder="95, 93"></label><label><span>Units</span><input required type="number" min="1" [(ngModel)]="line.units" [name]="'units'+i" (ngModelChange)="dirty=true"></label><div class="allowed"><span>Allowed</span><strong>{{ line.charge | currency }}</strong></div><button type="button" class="remove" (click)="removeLine(i)" aria-label="Remove line">×</button></div> }</div>
|
|
424
|
+
</section>
|
|
425
|
+
|
|
426
|
+
<section class="card">
|
|
427
|
+
<div class="card-title"><div><h3>Payer packet</h3><p>Only these documents will be sent. Medical records are never attached unless selected intentionally.</p></div><span>{{ data.bill.attachments.length }} files</span></div>
|
|
428
|
+
<ul class="docs">@for (doc of data.bill.attachments; track doc.id) { <li><div><strong>{{ doc.filename }}</strong><small>{{ doc.description || doc.documentType }}</small></div><button type="button" (click)="openAttachment(doc.id,doc.filename)">View</button><button type="button" (click)="removeAttachment(doc.id)">Remove</button></li> }</ul>
|
|
429
|
+
<div class="upload"><select [(ngModel)]="documentType" name="documentType">@for (type of documentTypes; track type.value) { <option [value]="type.value">{{ type.label }}</option> }</select><input #fileInput type="file" accept="application/pdf" (change)="fileSelected($event)"><button type="button" [disabled]="!pendingFile || store.mutating()" (click)="attach()">Attach document</button></div>
|
|
430
|
+
</section>
|
|
431
|
+
|
|
432
|
+
<section class="delivery"><div><span class="eyebrow">Delivery</span><h3>Submit this bill</h3><p>Submission and every later action remain available in this case.</p></div><div><div class="routes">@for (item of routes; track item.value) { <label><input type="radio" name="route" [value]="item.value" [(ngModel)]="route"> {{ item.label }}</label> }</div><div class="actions"><button type="button" (click)="save()" [disabled]="store.mutating()">Save changes</button><button class="primary" type="submit" [disabled]="store.mutating() || !canSubmit()">{{ store.mutating() ? 'Submitting…' : 'Submit bill' }}</button></div></div></section>
|
|
433
|
+
</form>
|
|
434
|
+
} @else {
|
|
435
|
+
<section class="card lifecycle">
|
|
436
|
+
<div class="card-title"><div><h3>Billing activity</h3><p>Available actions change automatically with bill status.</p></div><button (click)="store.refresh()">Refresh</button></div>
|
|
437
|
+
@if (data.eors.length) { <div class="eors"><h4>Explanation of Review</h4>@for (eor of data.eors; track eor.id) { <button (click)="openEor(eor.id,eor.filename)"><span><strong>{{ eor.filename }}</strong><small>{{ eor.description || 'Payer response' }}</small></span><b>View PDF</b></button> }</div> }
|
|
438
|
+
<div class="actionbar">@for (action of data.lifecycle.actions; track action.id) { @if (action.enabled) { <button [class.primary]="action.primary" (click)="beginAction(action.id)">{{ action.label }}</button> } }</div>
|
|
439
|
+
@if (panel === 'payment') { <div class="panel"><h4>Post payment</h4><div class="grid three"><label><span>Amount</span><input type="number" min="0.01" [(ngModel)]="payment.amount"></label><label><span>Method</span><select [(ngModel)]="payment.method"><option value="check">Check</option><option value="eft">EFT</option></select></label><label><span>Deposit date</span><input type="date" [(ngModel)]="payment.depositDate"></label></div><div class="actions"><button (click)="panel=''">Cancel</button><button class="primary" (click)="postPayment()">Post payment</button></div></div> }
|
|
440
|
+
@if (panel === 'review') { <div class="panel"><h4>Submit Second Review</h4><label><span>Reason</span><textarea [(ngModel)]="review.reason"></textarea></label><div class="grid two"><label><span>Payer control number</span><input [(ngModel)]="review.payerClaimControlNumber"></label><label><span>Disputed amount</span><input type="number" [(ngModel)]="review.disputedAmount"></label></div><div class="actions"><button (click)="panel=''">Cancel</button><button class="primary" (click)="submitReview()">Submit review</button></div></div> }
|
|
441
|
+
@if (panel === 'close') { <div class="panel"><h4>Close bill</h4><label><span>Reason</span><textarea [(ngModel)]="closeReason"></textarea></label><div class="actions"><button (click)="panel=''">Cancel</button><button class="danger" (click)="closeBill()">Close bill</button></div></div> }
|
|
442
|
+
</section>
|
|
443
|
+
}
|
|
444
|
+
@if (notice) { <div class="notice">{{ notice }}</div> }
|
|
445
|
+
@if (store.error()) { <div class="notice error">{{ store.error()?.message }}</div> }
|
|
446
|
+
<footer class="powered">Powered by MindBill</footer>
|
|
447
|
+
}
|
|
448
|
+
<datalist id="mb-states"><option value="CA"></option><option value="AZ"></option><option value="NV"></option><option value="OR"></option><option value="WA"></option><option value="TX"></option><option value="NY"></option></datalist>
|
|
449
|
+
</section>
|
|
450
|
+
`, styles: [":host{display:block}.mb{--a:#238dbd;--ac:#fff;--bg:#f3f8fa;--s:#fff;--t:#203743;--m:#657982;--b:#dbe6ea;--r:12px;--cr:8px;display:grid;gap:16px;color:var(--t);font:14px/1.45 var(--font,Inter,system-ui,sans-serif)}*{box-sizing:border-box}h2,h3,h4,p{margin:0}.summary,.card,.delivery,.state{border:1px solid var(--b);border-radius:var(--r);background:var(--s)}.summary{display:flex;justify-content:space-between;gap:20px;padding:20px}.summary h2{font-size:24px}.summary p,.card p,.delivery p,small{color:var(--m)}.eyebrow{color:var(--m);font-size:11px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}.money{text-align:right}.money span{display:block;font-size:28px;font-weight:800}.money small{font-size:12px}.review{display:grid;gap:16px}.card{padding:20px}.card-title{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:18px}.card-title h3,.delivery h3{font-size:18px}.card-title>span{border-radius:999px;background:var(--bg);padding:5px 9px;color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.grid{display:grid;gap:14px}.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}label{display:grid;gap:6px;color:var(--t);font-size:12px;font-weight:700}input,select,textarea,button{font:inherit}input,select,textarea{width:100%;min-height:42px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;color:var(--t);padding:9px 11px}textarea{min-height:90px;resize:vertical}button{min-height:38px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;color:var(--t);padding:8px 13px;cursor:pointer;font-weight:700}button.primary{border-color:var(--a);background:var(--a);color:var(--ac)}button.danger{border-color:#d4380d;background:#d4380d;color:#fff}button:disabled{cursor:not-allowed;opacity:.5}.subhead{margin:18px 0 9px;border-top:1px solid var(--b);padding-top:15px;font-size:12px;font-weight:800}.selected{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--b);border-radius:var(--cr);padding:12px}.selected div{display:grid}.results{position:relative;z-index:3;display:grid;margin-top:5px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;box-shadow:0 12px 30px #1f2d3d1f;overflow:hidden}.results button{display:grid;gap:2px;text-align:left;border:0;border-bottom:1px solid var(--b);border-radius:0;padding:12px}.results span{color:var(--m);font-weight:400}.lines{display:grid;gap:10px}.line{display:grid;grid-template-columns:1.2fr 1.2fr 110px 120px 40px;align-items:end;gap:10px;border-radius:var(--cr);background:var(--bg);padding:12px}.allowed{display:grid;gap:7px;text-align:right}.allowed span{color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.allowed strong{font-size:17px}.remove{border:0;background:transparent;font-size:20px}.docs{list-style:none;margin:0;padding:0}.docs li{display:flex;align-items:center;gap:8px;border-top:1px solid var(--b);padding:11px 0}.docs li>div{display:grid;flex:1}.upload{display:grid;grid-template-columns:240px 1fr auto;gap:10px;margin-top:12px;border-radius:var(--cr);background:var(--bg);padding:12px}.delivery{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px;background:color-mix(in srgb,var(--a) 5%,white)}.routes,.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.routes{margin-bottom:10px}.routes label{display:flex;align-items:center;border:1px solid var(--b);border-radius:var(--cr);background:#fff;padding:9px 12px}.routes input{width:auto;min-height:auto}.lifecycle{display:grid;gap:16px}.actionbar{flex-wrap:wrap}.eors{display:grid;gap:8px}.eors>button{display:flex;align-items:center;justify-content:space-between;text-align:left}.eors span{display:grid}.panel{display:grid;gap:14px;border-top:1px solid var(--b);padding-top:16px}.notice,.state{padding:13px 15px}.notice{border-radius:var(--cr);background:#edf8f2;color:#23734c}.notice.error,.state.error{background:#fff2f0;color:#b42318}.state{display:grid;gap:10px}.state button{justify-self:start}.powered{text-align:right;color:var(--m);font-size:11px}@media(max-width:900px){.grid.four,.grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}.line{grid-template-columns:1fr 1fr 90px}.allowed{grid-column:1/-2;text-align:left}.upload{grid-template-columns:1fr}.delivery{align-items:stretch;flex-direction:column}.routes,.actions{justify-content:flex-start}}@media(max-width:600px){.summary,.card-title{align-items:stretch;flex-direction:column}.money{text-align:left}.grid.four,.grid.three,.grid.two,.line{grid-template-columns:1fr}.allowed{grid-column:auto}.routes{flex-wrap:wrap}.docs li{align-items:flex-start;flex-wrap:wrap}}\n"] }]
|
|
451
|
+
}], ctorParameters: () => [], propDecorators: { billId: [{
|
|
452
|
+
type: Input,
|
|
453
|
+
args: [{ required: true }]
|
|
454
|
+
}], sessionEndpoint: [{
|
|
455
|
+
type: Input
|
|
456
|
+
}], apiBaseUrl: [{
|
|
457
|
+
type: Input
|
|
458
|
+
}], getSession: [{
|
|
459
|
+
type: Input
|
|
460
|
+
}], refreshInterval: [{
|
|
461
|
+
type: Input
|
|
462
|
+
}], appearance: [{
|
|
463
|
+
type: Input
|
|
464
|
+
}], billIdChange: [{
|
|
465
|
+
type: Output
|
|
466
|
+
}], submitted: [{
|
|
467
|
+
type: Output
|
|
468
|
+
}], billingError: [{
|
|
469
|
+
type: Output
|
|
470
|
+
}] } });
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Generated bundle index. Do not edit.
|
|
474
|
+
*/
|
|
475
|
+
|
|
476
|
+
export { MindBillBillLifecycleComponent, MindBillLifecycleStore };
|
|
477
|
+
//# sourceMappingURL=mindbill-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mindbill-angular.mjs","sources":["../../src/lib/lifecycle-store.ts","../../src/lib/bill-lifecycle.component.ts","../../src/mindbill-angular.ts"],"sourcesContent":["import { computed, signal } from \"@angular/core\";\nimport {\n createBillLifecycleClient,\n type BillLifecycleClient,\n type BillLifecycleClientOptions,\n type BillLifecycleData,\n type BillReviewDocumentType,\n type BillReviewSaveInput,\n type BillSubmissionRoute,\n type CloseBillInput,\n type PostBillPaymentInput,\n type SubmitSecondReviewInput,\n} from \"@mindbill/browser\";\n\nexport class MindBillLifecycleStore {\n readonly billId = signal(\"\");\n readonly data = signal<BillLifecycleData | null>(null);\n readonly error = signal<Error | null>(null);\n readonly loading = signal(false);\n readonly mutating = signal(false);\n readonly ready = computed(() => this.data() !== null && !this.loading());\n private client: BillLifecycleClient | null = null;\n private refreshTimer: ReturnType<typeof setInterval> | null = null;\n\n connect(options: BillLifecycleClientOptions, refreshInterval = 60_000): void {\n this.disconnect();\n this.billId.set(options.billId);\n this.client = createBillLifecycleClient(options);\n void this.refresh();\n if (refreshInterval > 0) {\n this.refreshTimer = setInterval(() => void this.refresh(), refreshInterval);\n }\n }\n\n disconnect(): void {\n if (this.refreshTimer) clearInterval(this.refreshTimer);\n this.refreshTimer = null;\n this.client?.clearSession();\n this.client = null;\n }\n\n async refresh(): Promise<BillLifecycleData | null> {\n if (!this.client) return null;\n this.loading.set(this.data() === null);\n try {\n const data = await this.client.getLifecycle();\n this.data.set(data);\n this.error.set(null);\n return data;\n } catch (cause) {\n this.error.set(cause instanceof Error ? cause : new Error(\"Bill could not be loaded.\"));\n return null;\n } finally {\n this.loading.set(false);\n }\n }\n\n searchClaimsAdministrators(query: string, claimNumber?: string) {\n return this.requireClient().searchClaimsAdministrators(query, claimNumber);\n }\n saveReview(input: BillReviewSaveInput) { return this.mutate(() => this.requireClient().saveReview(input)); }\n submitBill(input: BillReviewSaveInput, route: BillSubmissionRoute) { return this.mutate(() => this.requireClient().submitBill(input, route)); }\n addAttachment(file: File, type: BillReviewDocumentType, description?: string) { return this.mutate(() => this.requireClient().addAttachment(file, type, description)); }\n removeAttachment(id: string) { return this.mutate(() => this.requireClient().removeAttachment(id)); }\n getAttachment(id: string) { return this.requireClient().getAttachment(id); }\n getEor(id: string) { return this.requireClient().getEor(id); }\n closeBill(input: CloseBillInput) { return this.mutate(() => this.requireClient().closeBill(input)); }\n postPayment(input: PostBillPaymentInput) { return this.mutate(() => this.requireClient().postPayment(input)); }\n submitSecondReview(input: SubmitSecondReviewInput) { return this.mutate(() => this.requireClient().submitSecondReview(input)); }\n\n async startCorrection(): Promise<BillLifecycleData> {\n this.mutating.set(true);\n try {\n const result = await this.requireClient().startCorrection();\n this.billId.set(result.replacementBillId);\n this.data.set(result.data);\n this.error.set(null);\n return result.data;\n } catch (cause) {\n const error = cause instanceof Error ? cause : new Error(\"Correction draft could not be created.\");\n this.error.set(error);\n throw error;\n } finally {\n this.mutating.set(false);\n }\n }\n\n private requireClient(): BillLifecycleClient {\n if (!this.client) throw new Error(\"Connect the lifecycle store before using it.\");\n return this.client;\n }\n\n private async mutate(task: () => Promise<BillLifecycleData>): Promise<BillLifecycleData> {\n this.mutating.set(true);\n this.error.set(null);\n try {\n const data = await task();\n this.data.set(data);\n return data;\n } catch (cause) {\n const error = cause instanceof Error ? cause : new Error(\"The billing request could not be completed.\");\n this.error.set(error);\n throw error;\n } finally {\n this.mutating.set(false);\n }\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n effect,\n} from \"@angular/core\";\nimport { FormsModule } from \"@angular/forms\";\nimport type {\n BillLifecycleData,\n BillLifecycleSessionProvider,\n BillReviewDocumentType,\n BillReviewBillingProvider,\n BillReviewClinician,\n BillReviewLocation,\n BillReviewPayer,\n BillReviewSaveInput,\n BillSubmissionRoute,\n} from \"@mindbill/browser\";\nimport { MindBillLifecycleStore } from \"./lifecycle-store\";\n\nexport type MindBillAngularThemePreset = \"mindbill\" | \"qme-companion\" | \"orange-bright\" | \"clinical-blue\";\nexport type MindBillAngularAppearance = {\n preset?: MindBillAngularThemePreset;\n accentColor?: string;\n accentTextColor?: string;\n backgroundColor?: string;\n surfaceColor?: string;\n textColor?: string;\n mutedColor?: string;\n borderColor?: string;\n borderRadius?: string;\n controlRadius?: string;\n fontFamily?: string;\n};\n\nconst THEMES: Record<MindBillAngularThemePreset, Required<MindBillAngularAppearance>> = {\n mindbill: { preset: \"mindbill\", accentColor: \"#238dbd\", accentTextColor: \"#fff\", backgroundColor: \"#f3f8fa\", surfaceColor: \"#fff\", textColor: \"#203743\", mutedColor: \"#657982\", borderColor: \"#dbe6ea\", borderRadius: \"14px\", controlRadius: \"8px\", fontFamily: \"Inter,system-ui,sans-serif\" },\n \"qme-companion\": { preset: \"qme-companion\", accentColor: \"#53b5dc\", accentTextColor: \"#173542\", backgroundColor: \"#f2f8fb\", surfaceColor: \"#fff\", textColor: \"#1d3440\", mutedColor: \"#617783\", borderColor: \"#d7e5eb\", borderRadius: \"12px\", controlRadius: \"8px\", fontFamily: \"Inter,system-ui,sans-serif\" },\n \"orange-bright\": { preset: \"orange-bright\", accentColor: \"#ff4f0a\", accentTextColor: \"#fff\", backgroundColor: \"#fffaf6\", surfaceColor: \"#fff\", textColor: \"#111827\", mutedColor: \"#626a73\", borderColor: \"#e5e1dc\", borderRadius: \"8px\", controlRadius: \"6px\", fontFamily: \"Inter,system-ui,sans-serif\" },\n \"clinical-blue\": { preset: \"clinical-blue\", accentColor: \"#1677ff\", accentTextColor: \"#fff\", backgroundColor: \"#f5f7fa\", surfaceColor: \"#fff\", textColor: \"#1f2d3d\", mutedColor: \"#66788a\", borderColor: \"#d9e2ec\", borderRadius: \"8px\", controlRadius: \"6px\", fontFamily: \"Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif\" },\n};\n\nconst DOCUMENT_TYPES: Array<{ value: BillReviewDocumentType; label: string }> = [\n { value: \"final_report\", label: \"Final report\" },\n { value: \"proof_of_service\", label: \"Proof of service\" },\n { value: \"letter_of_attestation\", label: \"Letter of attestation\" },\n { value: \"form_122\", label: \"Required form\" },\n { value: \"w9\", label: \"W-9\" },\n { value: \"appeal\", label: \"Appeal support\" },\n { value: \"medical_records\", label: \"Medical records (intentional)\" },\n { value: \"other\", label: \"Other supporting document\" },\n];\n\ntype BillDraft = {\n patient: BillLifecycleData[\"patient\"] & { firstName: string; lastName: string };\n injury: BillLifecycleData[\"injury\"];\n bill: BillLifecycleData[\"bill\"];\n billingProvider: BillReviewBillingProvider;\n clinician: BillReviewClinician;\n location: BillReviewLocation;\n};\n\n@Component({\n selector: \"mindbill-bill-lifecycle\",\n standalone: true,\n imports: [CommonModule, FormsModule],\n template: `\n <section class=\"mb\" [ngStyle]=\"themeStyle\">\n @if (store.loading() && !store.data()) {\n <div class=\"state\">Loading billing…</div>\n } @else if (store.error() && !store.data()) {\n <div class=\"state error\"><strong>Billing is temporarily unavailable</strong><span>{{ store.error()?.message }}</span><button (click)=\"store.refresh()\">Try again</button></div>\n } @else if (store.data(); as data) {\n <header class=\"summary\">\n <div><span class=\"eyebrow\">Bill {{ data.bill.billNumber }}</span><h2>{{ stateLabel(data) }}</h2><p>{{ lifecycleDetail(data) }}</p></div>\n <div class=\"money\"><span>{{ data.bill.balanceDue | currency }}</span><small>balance</small></div>\n </header>\n\n @if (isEditable(data) && draft) {\n <form class=\"review\" (submit)=\"$event.preventDefault(); submit()\">\n <section class=\"card\">\n <div class=\"card-title\"><div><h3>Patient and claim</h3><p>Prefilled from the case. Correct anything that should print differently on this bill.</p></div><span>Required</span></div>\n <div class=\"grid four\">\n <label><span>First name</span><input required [(ngModel)]=\"draft.patient.firstName\" name=\"firstName\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Last name</span><input required [(ngModel)]=\"draft.patient.lastName\" name=\"lastName\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Date of birth</span><input type=\"date\" [(ngModel)]=\"draft.patient.dob\" name=\"dob\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Date of injury</span><input type=\"date\" [(ngModel)]=\"draft.injury.doi\" name=\"doi\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Claim number</span><input [(ngModel)]=\"draft.injury.claimNumber\" name=\"claimNumber\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Employer</span><input [(ngModel)]=\"draft.injury.employer\" name=\"employer\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>WCAB / case number</span><input [(ngModel)]=\"draft.injury.adjNumber\" name=\"adjNumber\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Date of service</span><input required type=\"date\" [(ngModel)]=\"draft.bill.dos\" name=\"dos\" (ngModelChange)=\"dirty=true\"></label>\n </div>\n </section>\n\n <section class=\"card payer\">\n <div class=\"card-title\"><div><h3>Claims administrator</h3><p>Select who should receive this bill. Search uses payer names and claim-number patterns.</p></div><span>Required</span></div>\n @if (draft.injury.claimsAdminId) { <div class=\"selected\"><div><strong>{{ draft.injury.claimsAdminName }}</strong><small>Selected recipient</small></div><button type=\"button\" (click)=\"clearPayer()\">Change</button></div> }\n @else {\n <label><span>Insurance company or claims administrator</span><input name=\"payerSearch\" [(ngModel)]=\"payerQuery\" (ngModelChange)=\"queuePayerSearch()\" placeholder=\"Search by payer or administrator name\" autocomplete=\"off\"></label>\n @if (payerResults.length) { <div class=\"results\">@for (payer of payerResults; track payer.id) { <button type=\"button\" (click)=\"selectPayer(payer)\"><strong>{{ payer.name }}</strong><span>{{ payerExplanation(payer) }}</span></button> }</div> }\n }\n </section>\n\n <section class=\"card\">\n <div class=\"card-title\"><div><h3>Billing identity</h3><p>The payee, rendering clinician, and place of service are bill snapshots—not synchronization records.</p></div><span>Prefilled</span></div>\n <div class=\"subhead\">Billing provider</div>\n <div class=\"grid three\">\n <label><span>Practice name</span><input required [(ngModel)]=\"draft.billingProvider.name\" name=\"practiceName\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Tax ID</span><input required [(ngModel)]=\"draft.billingProvider.taxId\" name=\"taxId\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Billing NPI</span><input required [(ngModel)]=\"draft.billingProvider.npi\" name=\"billingNpi\" (ngModelChange)=\"dirty=true\"></label>\n </div>\n <div class=\"subhead\">Rendering clinician</div>\n <div class=\"grid three\">\n <label><span>Name</span><input required [(ngModel)]=\"draft.clinician.name\" name=\"clinicianName\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>NPI</span><input required [(ngModel)]=\"draft.clinician.npi\" name=\"clinicianNpi\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Taxonomy</span><input [(ngModel)]=\"draft.clinician.taxonomy\" name=\"taxonomy\" (ngModelChange)=\"dirty=true\"></label>\n </div>\n <div class=\"subhead\">Service location</div>\n <div class=\"grid three\">\n <label><span>Location</span><input required [(ngModel)]=\"draft.location.name\" name=\"locationName\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Street</span><input required [(ngModel)]=\"draft.location.street\" name=\"street\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>City</span><input required [(ngModel)]=\"draft.location.city\" name=\"city\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>State</span><input required list=\"mb-states\" maxlength=\"2\" [(ngModel)]=\"draft.location.state\" name=\"state\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>ZIP</span><input required [(ngModel)]=\"draft.location.zip\" name=\"zip\" (ngModelChange)=\"dirty=true\"></label>\n <label><span>Place of service</span><input required [(ngModel)]=\"draft.location.posCode\" name=\"pos\" (ngModelChange)=\"dirty=true\"></label>\n </div>\n </section>\n\n <section class=\"card\">\n <div class=\"card-title\"><div><h3>Charges</h3><p>Review procedure codes, modifiers, units, and allowed amounts.</p></div><button type=\"button\" (click)=\"addLine()\">+ Add line</button></div>\n <div class=\"lines\">@for (line of draft.bill.lineItems; track $index; let i=$index) { <div class=\"line\"><label><span>Procedure</span><input required [(ngModel)]=\"line.code\" [name]=\"'code'+i\" (ngModelChange)=\"dirty=true\"></label><label><span>Modifiers</span><input [ngModel]=\"line.modifiers.join(', ')\" (ngModelChange)=\"setModifiers(line,$any($event))\" [name]=\"'modifiers'+i\" placeholder=\"95, 93\"></label><label><span>Units</span><input required type=\"number\" min=\"1\" [(ngModel)]=\"line.units\" [name]=\"'units'+i\" (ngModelChange)=\"dirty=true\"></label><div class=\"allowed\"><span>Allowed</span><strong>{{ line.charge | currency }}</strong></div><button type=\"button\" class=\"remove\" (click)=\"removeLine(i)\" aria-label=\"Remove line\">×</button></div> }</div>\n </section>\n\n <section class=\"card\">\n <div class=\"card-title\"><div><h3>Payer packet</h3><p>Only these documents will be sent. Medical records are never attached unless selected intentionally.</p></div><span>{{ data.bill.attachments.length }} files</span></div>\n <ul class=\"docs\">@for (doc of data.bill.attachments; track doc.id) { <li><div><strong>{{ doc.filename }}</strong><small>{{ doc.description || doc.documentType }}</small></div><button type=\"button\" (click)=\"openAttachment(doc.id,doc.filename)\">View</button><button type=\"button\" (click)=\"removeAttachment(doc.id)\">Remove</button></li> }</ul>\n <div class=\"upload\"><select [(ngModel)]=\"documentType\" name=\"documentType\">@for (type of documentTypes; track type.value) { <option [value]=\"type.value\">{{ type.label }}</option> }</select><input #fileInput type=\"file\" accept=\"application/pdf\" (change)=\"fileSelected($event)\"><button type=\"button\" [disabled]=\"!pendingFile || store.mutating()\" (click)=\"attach()\">Attach document</button></div>\n </section>\n\n <section class=\"delivery\"><div><span class=\"eyebrow\">Delivery</span><h3>Submit this bill</h3><p>Submission and every later action remain available in this case.</p></div><div><div class=\"routes\">@for (item of routes; track item.value) { <label><input type=\"radio\" name=\"route\" [value]=\"item.value\" [(ngModel)]=\"route\"> {{ item.label }}</label> }</div><div class=\"actions\"><button type=\"button\" (click)=\"save()\" [disabled]=\"store.mutating()\">Save changes</button><button class=\"primary\" type=\"submit\" [disabled]=\"store.mutating() || !canSubmit()\">{{ store.mutating() ? 'Submitting…' : 'Submit bill' }}</button></div></div></section>\n </form>\n } @else {\n <section class=\"card lifecycle\">\n <div class=\"card-title\"><div><h3>Billing activity</h3><p>Available actions change automatically with bill status.</p></div><button (click)=\"store.refresh()\">Refresh</button></div>\n @if (data.eors.length) { <div class=\"eors\"><h4>Explanation of Review</h4>@for (eor of data.eors; track eor.id) { <button (click)=\"openEor(eor.id,eor.filename)\"><span><strong>{{ eor.filename }}</strong><small>{{ eor.description || 'Payer response' }}</small></span><b>View PDF</b></button> }</div> }\n <div class=\"actionbar\">@for (action of data.lifecycle.actions; track action.id) { @if (action.enabled) { <button [class.primary]=\"action.primary\" (click)=\"beginAction(action.id)\">{{ action.label }}</button> } }</div>\n @if (panel === 'payment') { <div class=\"panel\"><h4>Post payment</h4><div class=\"grid three\"><label><span>Amount</span><input type=\"number\" min=\"0.01\" [(ngModel)]=\"payment.amount\"></label><label><span>Method</span><select [(ngModel)]=\"payment.method\"><option value=\"check\">Check</option><option value=\"eft\">EFT</option></select></label><label><span>Deposit date</span><input type=\"date\" [(ngModel)]=\"payment.depositDate\"></label></div><div class=\"actions\"><button (click)=\"panel=''\">Cancel</button><button class=\"primary\" (click)=\"postPayment()\">Post payment</button></div></div> }\n @if (panel === 'review') { <div class=\"panel\"><h4>Submit Second Review</h4><label><span>Reason</span><textarea [(ngModel)]=\"review.reason\"></textarea></label><div class=\"grid two\"><label><span>Payer control number</span><input [(ngModel)]=\"review.payerClaimControlNumber\"></label><label><span>Disputed amount</span><input type=\"number\" [(ngModel)]=\"review.disputedAmount\"></label></div><div class=\"actions\"><button (click)=\"panel=''\">Cancel</button><button class=\"primary\" (click)=\"submitReview()\">Submit review</button></div></div> }\n @if (panel === 'close') { <div class=\"panel\"><h4>Close bill</h4><label><span>Reason</span><textarea [(ngModel)]=\"closeReason\"></textarea></label><div class=\"actions\"><button (click)=\"panel=''\">Cancel</button><button class=\"danger\" (click)=\"closeBill()\">Close bill</button></div></div> }\n </section>\n }\n @if (notice) { <div class=\"notice\">{{ notice }}</div> }\n @if (store.error()) { <div class=\"notice error\">{{ store.error()?.message }}</div> }\n <footer class=\"powered\">Powered by MindBill</footer>\n }\n <datalist id=\"mb-states\"><option value=\"CA\"></option><option value=\"AZ\"></option><option value=\"NV\"></option><option value=\"OR\"></option><option value=\"WA\"></option><option value=\"TX\"></option><option value=\"NY\"></option></datalist>\n </section>\n `,\n styles: [`\n :host{display:block}.mb{--a:#238dbd;--ac:#fff;--bg:#f3f8fa;--s:#fff;--t:#203743;--m:#657982;--b:#dbe6ea;--r:12px;--cr:8px;display:grid;gap:16px;color:var(--t);font:14px/1.45 var(--font,Inter,system-ui,sans-serif)}*{box-sizing:border-box}h2,h3,h4,p{margin:0}.summary,.card,.delivery,.state{border:1px solid var(--b);border-radius:var(--r);background:var(--s)}.summary{display:flex;justify-content:space-between;gap:20px;padding:20px}.summary h2{font-size:24px}.summary p,.card p,.delivery p,small{color:var(--m)}.eyebrow{color:var(--m);font-size:11px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}.money{text-align:right}.money span{display:block;font-size:28px;font-weight:800}.money small{font-size:12px}.review{display:grid;gap:16px}.card{padding:20px}.card-title{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:18px}.card-title h3,.delivery h3{font-size:18px}.card-title>span{border-radius:999px;background:var(--bg);padding:5px 9px;color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.grid{display:grid;gap:14px}.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}label{display:grid;gap:6px;color:var(--t);font-size:12px;font-weight:700}input,select,textarea,button{font:inherit}input,select,textarea{width:100%;min-height:42px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;color:var(--t);padding:9px 11px}textarea{min-height:90px;resize:vertical}button{min-height:38px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;color:var(--t);padding:8px 13px;cursor:pointer;font-weight:700}button.primary{border-color:var(--a);background:var(--a);color:var(--ac)}button.danger{border-color:#d4380d;background:#d4380d;color:#fff}button:disabled{cursor:not-allowed;opacity:.5}.subhead{margin:18px 0 9px;border-top:1px solid var(--b);padding-top:15px;font-size:12px;font-weight:800}.selected{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--b);border-radius:var(--cr);padding:12px}.selected div{display:grid}.results{position:relative;z-index:3;display:grid;margin-top:5px;border:1px solid var(--b);border-radius:var(--cr);background:#fff;box-shadow:0 12px 30px rgba(31,45,61,.12);overflow:hidden}.results button{display:grid;gap:2px;text-align:left;border:0;border-bottom:1px solid var(--b);border-radius:0;padding:12px}.results span{color:var(--m);font-weight:400}.lines{display:grid;gap:10px}.line{display:grid;grid-template-columns:1.2fr 1.2fr 110px 120px 40px;align-items:end;gap:10px;border-radius:var(--cr);background:var(--bg);padding:12px}.allowed{display:grid;gap:7px;text-align:right}.allowed span{color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.allowed strong{font-size:17px}.remove{border:0;background:transparent;font-size:20px}.docs{list-style:none;margin:0;padding:0}.docs li{display:flex;align-items:center;gap:8px;border-top:1px solid var(--b);padding:11px 0}.docs li>div{display:grid;flex:1}.upload{display:grid;grid-template-columns:240px 1fr auto;gap:10px;margin-top:12px;border-radius:var(--cr);background:var(--bg);padding:12px}.delivery{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px;background:color-mix(in srgb,var(--a) 5%,white)}.routes,.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.routes{margin-bottom:10px}.routes label{display:flex;align-items:center;border:1px solid var(--b);border-radius:var(--cr);background:#fff;padding:9px 12px}.routes input{width:auto;min-height:auto}.lifecycle{display:grid;gap:16px}.actionbar{flex-wrap:wrap}.eors{display:grid;gap:8px}.eors>button{display:flex;align-items:center;justify-content:space-between;text-align:left}.eors span{display:grid}.panel{display:grid;gap:14px;border-top:1px solid var(--b);padding-top:16px}.notice,.state{padding:13px 15px}.notice{border-radius:var(--cr);background:#edf8f2;color:#23734c}.notice.error,.state.error{background:#fff2f0;color:#b42318}.state{display:grid;gap:10px}.state button{justify-self:start}.powered{text-align:right;color:var(--m);font-size:11px}@media(max-width:900px){.grid.four,.grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}.line{grid-template-columns:1fr 1fr 90px}.allowed{grid-column:1/-2;text-align:left}.upload{grid-template-columns:1fr}.delivery{align-items:stretch;flex-direction:column}.routes,.actions{justify-content:flex-start}}@media(max-width:600px){.summary,.card-title{align-items:stretch;flex-direction:column}.money{text-align:left}.grid.four,.grid.three,.grid.two,.line{grid-template-columns:1fr}.allowed{grid-column:auto}.routes{flex-wrap:wrap}.docs li{align-items:flex-start;flex-wrap:wrap}}\n `],\n})\nexport class MindBillBillLifecycleComponent implements OnChanges, OnDestroy {\n @Input({ required: true }) billId = \"\";\n @Input() sessionEndpoint = \"/api/mindbill/bill-session\";\n @Input() apiBaseUrl = \"https://app.mindbill.org\";\n @Input() getSession?: BillLifecycleSessionProvider;\n @Input() refreshInterval = 60_000;\n @Input() appearance: MindBillAngularAppearance = { preset: \"mindbill\" };\n @Output() billIdChange = new EventEmitter<string>();\n @Output() submitted = new EventEmitter<BillLifecycleData>();\n @Output() billingError = new EventEmitter<Error>();\n\n readonly store = new MindBillLifecycleStore();\n readonly documentTypes = DOCUMENT_TYPES;\n readonly routes: Array<{ value: BillSubmissionRoute; label: string }> = [{ value: \"ebill\", label: \"E-bill\" }, { value: \"fax\", label: \"Fax\" }, { value: \"mail\", label: \"Mail\" }, { value: \"email\", label: \"Email\" }];\n draft: BillDraft | null = null;\n dirty = false;\n payerQuery = \"\";\n payerResults: BillReviewPayer[] = [];\n documentType: BillReviewDocumentType = \"other\";\n pendingFile: File | null = null;\n route: BillSubmissionRoute = \"ebill\";\n panel = \"\";\n notice = \"\";\n closeReason = \"\";\n payment = { amount: 0, method: \"check\" as \"check\" | \"eft\", depositDate: new Date().toISOString().slice(0, 10) };\n review = { reason: \"\", payerClaimControlNumber: \"\", disputedAmount: 0 };\n private payerTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n effect(() => {\n const data = this.store.data();\n if (data && !this.dirty) this.draft = this.makeDraft(data);\n const error = this.store.error();\n if (error) this.billingError.emit(error);\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ((changes[\"billId\"] || changes[\"sessionEndpoint\"] || changes[\"apiBaseUrl\"] || changes[\"getSession\"]) && this.billId) {\n this.store.connect({ billId: this.billId, sessionEndpoint: this.sessionEndpoint, apiBaseUrl: this.apiBaseUrl, ...(this.getSession ? { getSession: this.getSession } : {}) }, this.refreshInterval);\n }\n }\n ngOnDestroy(): void { this.store.disconnect(); if (this.payerTimer) clearTimeout(this.payerTimer); }\n\n get themeStyle(): Record<string, string> {\n const base = THEMES[this.appearance.preset ?? \"mindbill\"];\n return {\n \"--a\": this.appearance.accentColor ?? base.accentColor,\n \"--ac\": this.appearance.accentTextColor ?? base.accentTextColor,\n \"--bg\": this.appearance.backgroundColor ?? base.backgroundColor,\n \"--s\": this.appearance.surfaceColor ?? base.surfaceColor,\n \"--t\": this.appearance.textColor ?? base.textColor,\n \"--m\": this.appearance.mutedColor ?? base.mutedColor,\n \"--b\": this.appearance.borderColor ?? base.borderColor,\n \"--r\": this.appearance.borderRadius ?? base.borderRadius,\n \"--cr\": this.appearance.controlRadius ?? base.controlRadius,\n \"--font\": this.appearance.fontFamily ?? base.fontFamily,\n };\n }\n stateLabel(data: BillLifecycleData) { return data.lifecycle.state.replace(/_/g, \" \").replace(/\\b\\w/g, (value) => value.toUpperCase()); }\n lifecycleDetail(data: BillLifecycleData) { return data.lifecycle.submittedAt ? `Submitted ${new Date(data.lifecycle.submittedAt).toLocaleDateString()}${data.lifecycle.agingDays != null ? ` · ${data.lifecycle.agingDays} days old` : \"\"}` : \"Review the prefilled bill and payer packet before submission.\"; }\n isEditable(data: BillLifecycleData) { return data.lifecycle.actions.some((action) => action.id === \"edit_and_submit\" && action.enabled) || [\"incomplete\", \"draft\", \"not_submitted\"].includes(data.lifecycle.state.toLowerCase()); }\n payerExplanation(payer: BillReviewPayer) { return payer.signals?.map((signal) => signal.label).join(\" · \") || (payer.hasElectronic ? \"Electronic billing available\" : \"Available in payer directory\"); }\n queuePayerSearch(): void { if (this.payerTimer) clearTimeout(this.payerTimer); this.payerTimer = setTimeout(() => void this.searchPayers(), 250); }\n async searchPayers(): Promise<void> { if (!this.payerQuery.trim()) { this.payerResults = []; return; } this.payerResults = await this.store.searchClaimsAdministrators(this.payerQuery, this.draft?.injury.claimNumber); }\n selectPayer(payer: BillReviewPayer): void { if (!this.draft) return; this.draft.injury.claimsAdminId = payer.id; this.draft.injury.claimsAdminName = payer.name; this.payerQuery = \"\"; this.payerResults = []; this.dirty = true; }\n clearPayer(): void { if (!this.draft) return; this.draft.injury.claimsAdminId = \"\"; this.draft.injury.claimsAdminName = \"\"; this.dirty = true; }\n addLine(): void { this.draft?.bill.lineItems.push({ code: \"\", modifiers: [], units: 1, charge: 0 }); this.dirty = true; }\n removeLine(index: number): void { this.draft?.bill.lineItems.splice(index, 1); this.dirty = true; }\n setModifiers(line: { modifiers: string[] }, value: string): void { line.modifiers = value.split(\",\").map((item) => item.trim().replace(/^-/, \"\")).filter(Boolean); this.dirty = true; }\n fileSelected(event: Event): void { this.pendingFile = (event.target as HTMLInputElement).files?.[0] ?? null; }\n async attach(): Promise<void> { if (!this.pendingFile) return; await this.store.addAttachment(this.pendingFile, this.documentType); this.pendingFile = null; this.notice = \"Document attached.\"; }\n async removeAttachment(id: string): Promise<void> { await this.store.removeAttachment(id); this.notice = \"Document removed.\"; }\n async openAttachment(id: string, filename: string): Promise<void> { this.openBlob(await this.store.getAttachment(id), filename); }\n async openEor(id: string, filename: string): Promise<void> { this.openBlob(await this.store.getEor(id), filename); }\n canSubmit(): boolean { const input = this.buildInput(); return Boolean(input && input.claimsAdminId && input.dos && input.billingProvider?.name && input.billingProvider.taxId && input.billingProvider.npi && input.renderingProvider?.name && input.renderingProvider.npi && input.lineItems.some((line) => line.code && line.units > 0)); }\n async save(): Promise<void> { const input = this.buildInput(); if (!input) return; const data = await this.store.saveReview(input); this.dirty = false; this.draft = this.makeDraft(data); this.notice = \"Bill saved.\"; }\n async submit(): Promise<void> { const input = this.buildInput(); if (!input || !this.canSubmit()) return; const data = await this.store.submitBill(input, this.route); this.dirty = false; this.draft = this.makeDraft(data); this.notice = \"Bill submitted.\"; this.submitted.emit(data); }\n beginAction(action: string): void { if (action === \"post_payment\") this.panel = \"payment\"; else if (action === \"second_review\" || action === \"independent_bill_review\") this.panel = \"review\"; else if (action === \"close\") this.panel = \"close\"; else if (action === \"view_eor\" && this.store.data()?.eors[0]) { const eor = this.store.data()!.eors[0]!; void this.openEor(eor.id, eor.filename); } else if (action === \"correct_and_resubmit\") void this.correct(); }\n async correct(): Promise<void> { const data = await this.store.startCorrection(); this.billIdChange.emit(this.store.billId()); this.dirty = false; this.draft = this.makeDraft(data); this.notice = \"Correction draft created.\"; }\n async postPayment(): Promise<void> { await this.store.postPayment({ ...this.payment }); this.panel = \"\"; this.notice = \"Payment posted.\"; }\n async submitReview(): Promise<void> { const data = this.store.data(); if (!data) return; await this.store.submitSecondReview({ ...this.review, disputedAmount: this.review.disputedAmount || undefined, route: \"ebill\", attachmentIds: data.bill.attachments.map((doc) => doc.id) }); this.panel = \"\"; this.notice = \"Second Review submitted.\"; }\n async closeBill(): Promise<void> { if (!this.closeReason.trim()) return; await this.store.closeBill({ reason: this.closeReason }); this.panel = \"\"; this.notice = \"Bill closed.\"; }\n\n private buildInput(): BillReviewSaveInput | null {\n if (!this.draft) return null;\n return {\n claimsAdminId: this.draft.injury.claimsAdminId ?? \"\",\n patientOverrides: {\n firstName: this.draft.patient.firstName,\n lastName: this.draft.patient.lastName,\n ...(this.draft.patient.middleName ? { middleName: this.draft.patient.middleName } : {}),\n ...(this.draft.patient.dob ? { dob: this.draft.patient.dob } : {}),\n },\n injuryOverrides: {\n ...(this.draft.injury.claimNumber ? { claimNumber: this.draft.injury.claimNumber } : {}),\n ...(this.draft.injury.employer ? { employer: this.draft.injury.employer } : {}),\n ...(this.draft.injury.doi ? { doi: this.draft.injury.doi } : {}),\n ...(this.draft.injury.injuryEndDate ? { injuryEndDate: this.draft.injury.injuryEndDate } : {}),\n ...(typeof this.draft.injury.cumulativeTrauma === \"boolean\" ? { cumulativeTrauma: this.draft.injury.cumulativeTrauma } : {}),\n ...(this.draft.injury.adjNumber ? { adjNumber: this.draft.injury.adjNumber } : {}),\n },\n dos: this.draft.bill.dos,\n billingProvider: this.draft.billingProvider,\n renderingProvider: this.draft.clinician,\n placeOfService: this.draft.location,\n lineItems: this.draft.bill.lineItems.map((line) => ({\n ...(line.id ? { id: line.id } : {}),\n code: line.code,\n modifiers: line.modifiers,\n units: line.units,\n })),\n };\n }\n private makeDraft(data: BillLifecycleData): BillDraft {\n const snapshot = data.bill.billingSnapshot ?? {};\n const names = data.patient.name.trim().split(/\\s+/);\n return { patient: { ...data.patient, firstName: data.patient.firstName ?? names[0] ?? \"\", lastName: data.patient.lastName ?? names.slice(1).join(\" \") }, injury: { ...data.injury }, bill: { ...data.bill, lineItems: data.bill.lineItems.map((line) => ({ ...line, modifiers: [...line.modifiers] })) }, billingProvider: snapshot.billingProvider ?? { name: \"\", taxId: \"\", npi: \"\", billType: \"Professional\" as const }, clinician: snapshot.renderingProvider ?? { name: \"\", specialty: \"\", npi: \"\" }, location: snapshot.placeOfService ?? { name: \"\", street: \"\", city: \"\", state: \"\", zip: \"\", posCode: \"11\" } };\n }\n private openBlob(blob: Blob, filename: string): void { const url = URL.createObjectURL(blob); const link = document.createElement(\"a\"); link.href = url; link.target = \"_blank\"; link.rel = \"noopener\"; link.download = filename; link.click(); setTimeout(() => URL.revokeObjectURL(url), 60_000); }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAca,sBAAsB,CAAA;AACxB,IAAA,MAAM,GAAG,MAAM,CAAC,EAAE,6EAAC;AACnB,IAAA,IAAI,GAAG,MAAM,CAA2B,IAAI,2EAAC;AAC7C,IAAA,KAAK,GAAG,MAAM,CAAe,IAAI,4EAAC;AAClC,IAAA,OAAO,GAAG,MAAM,CAAC,KAAK,8EAAC;AACvB,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,+EAAC;AACxB,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,4EAAC;IAChE,MAAM,GAA+B,IAAI;IACzC,YAAY,GAA0C,IAAI;AAElE,IAAA,OAAO,CAAC,OAAmC,EAAE,eAAe,GAAG,MAAM,EAAA;QACnE,IAAI,CAAC,UAAU,EAAE;QACjB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;AAC/B,QAAA,IAAI,CAAC,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC;AAChD,QAAA,KAAK,IAAI,CAAC,OAAO,EAAE;AACnB,QAA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B;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;AChLH;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mindbill/angular",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Native Angular components for the complete MindBill bill lifecycle",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"peerDependencies": {
|
|
7
|
+
"@angular/common": ">=18 <22",
|
|
8
|
+
"@angular/core": ">=18 <22",
|
|
9
|
+
"@angular/forms": ">=18 <22",
|
|
10
|
+
"rxjs": ">=7.8 <9"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@mindbill/browser": "^0.1.0",
|
|
14
|
+
"tslib": "^2.8.1"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"mindbill",
|
|
18
|
+
"angular",
|
|
19
|
+
"medical-billing",
|
|
20
|
+
"workers-compensation"
|
|
21
|
+
],
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/incidentfox/mindbill-widgets.git",
|
|
26
|
+
"directory": "packages/angular"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public",
|
|
30
|
+
"provenance": true
|
|
31
|
+
},
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"module": "fesm2022/mindbill-angular.mjs",
|
|
34
|
+
"typings": "types/mindbill-angular.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
"./package.json": {
|
|
37
|
+
"default": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./types/mindbill-angular.d.ts",
|
|
41
|
+
"default": "./fesm2022/mindbill-angular.mjs"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as _mindbill_browser from '@mindbill/browser';
|
|
2
|
+
import { BillLifecycleData, BillLifecycleClientOptions, BillReviewSaveInput, BillSubmissionRoute, BillReviewDocumentType, CloseBillInput, PostBillPaymentInput, SubmitSecondReviewInput, BillLifecycleSessionProvider, BillReviewBillingProvider, BillReviewClinician, BillReviewLocation, BillReviewPayer } from '@mindbill/browser';
|
|
3
|
+
export { BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleSession, BillLifecycleSessionProvider, BillReviewData, BillReviewDocumentType, BillReviewPayer, BillReviewSaveInput, BillSubmissionRoute, CloseBillInput, PostBillPaymentInput, SubmitSecondReviewInput } from '@mindbill/browser';
|
|
4
|
+
import * as _angular_core from '@angular/core';
|
|
5
|
+
import { OnChanges, OnDestroy, EventEmitter, SimpleChanges } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
declare class MindBillLifecycleStore {
|
|
8
|
+
readonly billId: _angular_core.WritableSignal<string>;
|
|
9
|
+
readonly data: _angular_core.WritableSignal<BillLifecycleData>;
|
|
10
|
+
readonly error: _angular_core.WritableSignal<Error>;
|
|
11
|
+
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
12
|
+
readonly mutating: _angular_core.WritableSignal<boolean>;
|
|
13
|
+
readonly ready: _angular_core.Signal<boolean>;
|
|
14
|
+
private client;
|
|
15
|
+
private refreshTimer;
|
|
16
|
+
connect(options: BillLifecycleClientOptions, refreshInterval?: number): void;
|
|
17
|
+
disconnect(): void;
|
|
18
|
+
refresh(): Promise<BillLifecycleData | null>;
|
|
19
|
+
searchClaimsAdministrators(query: string, claimNumber?: string): Promise<_mindbill_browser.BillReviewPayer[]>;
|
|
20
|
+
saveReview(input: BillReviewSaveInput): Promise<BillLifecycleData>;
|
|
21
|
+
submitBill(input: BillReviewSaveInput, route: BillSubmissionRoute): Promise<BillLifecycleData>;
|
|
22
|
+
addAttachment(file: File, type: BillReviewDocumentType, description?: string): Promise<BillLifecycleData>;
|
|
23
|
+
removeAttachment(id: string): Promise<BillLifecycleData>;
|
|
24
|
+
getAttachment(id: string): Promise<Blob>;
|
|
25
|
+
getEor(id: string): Promise<Blob>;
|
|
26
|
+
closeBill(input: CloseBillInput): Promise<BillLifecycleData>;
|
|
27
|
+
postPayment(input: PostBillPaymentInput): Promise<BillLifecycleData>;
|
|
28
|
+
submitSecondReview(input: SubmitSecondReviewInput): Promise<BillLifecycleData>;
|
|
29
|
+
startCorrection(): Promise<BillLifecycleData>;
|
|
30
|
+
private requireClient;
|
|
31
|
+
private mutate;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type MindBillAngularThemePreset = "mindbill" | "qme-companion" | "orange-bright" | "clinical-blue";
|
|
35
|
+
type MindBillAngularAppearance = {
|
|
36
|
+
preset?: MindBillAngularThemePreset;
|
|
37
|
+
accentColor?: string;
|
|
38
|
+
accentTextColor?: string;
|
|
39
|
+
backgroundColor?: string;
|
|
40
|
+
surfaceColor?: string;
|
|
41
|
+
textColor?: string;
|
|
42
|
+
mutedColor?: string;
|
|
43
|
+
borderColor?: string;
|
|
44
|
+
borderRadius?: string;
|
|
45
|
+
controlRadius?: string;
|
|
46
|
+
fontFamily?: string;
|
|
47
|
+
};
|
|
48
|
+
type BillDraft = {
|
|
49
|
+
patient: BillLifecycleData["patient"] & {
|
|
50
|
+
firstName: string;
|
|
51
|
+
lastName: string;
|
|
52
|
+
};
|
|
53
|
+
injury: BillLifecycleData["injury"];
|
|
54
|
+
bill: BillLifecycleData["bill"];
|
|
55
|
+
billingProvider: BillReviewBillingProvider;
|
|
56
|
+
clinician: BillReviewClinician;
|
|
57
|
+
location: BillReviewLocation;
|
|
58
|
+
};
|
|
59
|
+
declare class MindBillBillLifecycleComponent implements OnChanges, OnDestroy {
|
|
60
|
+
billId: string;
|
|
61
|
+
sessionEndpoint: string;
|
|
62
|
+
apiBaseUrl: string;
|
|
63
|
+
getSession?: BillLifecycleSessionProvider;
|
|
64
|
+
refreshInterval: number;
|
|
65
|
+
appearance: MindBillAngularAppearance;
|
|
66
|
+
billIdChange: EventEmitter<string>;
|
|
67
|
+
submitted: EventEmitter<BillLifecycleData>;
|
|
68
|
+
billingError: EventEmitter<Error>;
|
|
69
|
+
readonly store: MindBillLifecycleStore;
|
|
70
|
+
readonly documentTypes: {
|
|
71
|
+
value: BillReviewDocumentType;
|
|
72
|
+
label: string;
|
|
73
|
+
}[];
|
|
74
|
+
readonly routes: Array<{
|
|
75
|
+
value: BillSubmissionRoute;
|
|
76
|
+
label: string;
|
|
77
|
+
}>;
|
|
78
|
+
draft: BillDraft | null;
|
|
79
|
+
dirty: boolean;
|
|
80
|
+
payerQuery: string;
|
|
81
|
+
payerResults: BillReviewPayer[];
|
|
82
|
+
documentType: BillReviewDocumentType;
|
|
83
|
+
pendingFile: File | null;
|
|
84
|
+
route: BillSubmissionRoute;
|
|
85
|
+
panel: string;
|
|
86
|
+
notice: string;
|
|
87
|
+
closeReason: string;
|
|
88
|
+
payment: {
|
|
89
|
+
amount: number;
|
|
90
|
+
method: "check" | "eft";
|
|
91
|
+
depositDate: string;
|
|
92
|
+
};
|
|
93
|
+
review: {
|
|
94
|
+
reason: string;
|
|
95
|
+
payerClaimControlNumber: string;
|
|
96
|
+
disputedAmount: number;
|
|
97
|
+
};
|
|
98
|
+
private payerTimer;
|
|
99
|
+
constructor();
|
|
100
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
101
|
+
ngOnDestroy(): void;
|
|
102
|
+
get themeStyle(): Record<string, string>;
|
|
103
|
+
stateLabel(data: BillLifecycleData): string;
|
|
104
|
+
lifecycleDetail(data: BillLifecycleData): string;
|
|
105
|
+
isEditable(data: BillLifecycleData): boolean;
|
|
106
|
+
payerExplanation(payer: BillReviewPayer): string;
|
|
107
|
+
queuePayerSearch(): void;
|
|
108
|
+
searchPayers(): Promise<void>;
|
|
109
|
+
selectPayer(payer: BillReviewPayer): void;
|
|
110
|
+
clearPayer(): void;
|
|
111
|
+
addLine(): void;
|
|
112
|
+
removeLine(index: number): void;
|
|
113
|
+
setModifiers(line: {
|
|
114
|
+
modifiers: string[];
|
|
115
|
+
}, value: string): void;
|
|
116
|
+
fileSelected(event: Event): void;
|
|
117
|
+
attach(): Promise<void>;
|
|
118
|
+
removeAttachment(id: string): Promise<void>;
|
|
119
|
+
openAttachment(id: string, filename: string): Promise<void>;
|
|
120
|
+
openEor(id: string, filename: string): Promise<void>;
|
|
121
|
+
canSubmit(): boolean;
|
|
122
|
+
save(): Promise<void>;
|
|
123
|
+
submit(): Promise<void>;
|
|
124
|
+
beginAction(action: string): void;
|
|
125
|
+
correct(): Promise<void>;
|
|
126
|
+
postPayment(): Promise<void>;
|
|
127
|
+
submitReview(): Promise<void>;
|
|
128
|
+
closeBill(): Promise<void>;
|
|
129
|
+
private buildInput;
|
|
130
|
+
private makeDraft;
|
|
131
|
+
private openBlob;
|
|
132
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MindBillBillLifecycleComponent, never>;
|
|
133
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MindBillBillLifecycleComponent, "mindbill-bill-lifecycle", never, { "billId": { "alias": "billId"; "required": true; }; "sessionEndpoint": { "alias": "sessionEndpoint"; "required": false; }; "apiBaseUrl": { "alias": "apiBaseUrl"; "required": false; }; "getSession": { "alias": "getSession"; "required": false; }; "refreshInterval": { "alias": "refreshInterval"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; }, { "billIdChange": "billIdChange"; "submitted": "submitted"; "billingError": "billingError"; }, never, never, true, never>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export { MindBillBillLifecycleComponent, MindBillLifecycleStore };
|
|
137
|
+
export type { MindBillAngularAppearance, MindBillAngularThemePreset };
|