@mindbill/angular 0.3.0 → 0.4.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.
|
@@ -181,6 +181,14 @@ class MindBillBillLifecycleComponent {
|
|
|
181
181
|
store = new MindBillLifecycleStore();
|
|
182
182
|
documentTypes = DOCUMENT_TYPES;
|
|
183
183
|
medLegalCodes = ["ML200", "ML201", "ML202", "ML203", "ML204", "ML205", "ML206", "MLPRR"];
|
|
184
|
+
lifecycleStages = [
|
|
185
|
+
{ id: "created", label: "Created" },
|
|
186
|
+
{ id: "submitted", label: "Submitted" },
|
|
187
|
+
{ id: "accepted", label: "Accepted" },
|
|
188
|
+
{ id: "response", label: "Payer response" },
|
|
189
|
+
{ id: "follow_up", label: "Follow-up" },
|
|
190
|
+
{ id: "closed", label: "Closed" },
|
|
191
|
+
];
|
|
184
192
|
draft = null;
|
|
185
193
|
dirty = false;
|
|
186
194
|
payerQuery = "";
|
|
@@ -194,8 +202,9 @@ class MindBillBillLifecycleComponent {
|
|
|
194
202
|
panel = "";
|
|
195
203
|
notice = "";
|
|
196
204
|
closeReason = "";
|
|
197
|
-
payment = { amount: 0, method: "check", depositDate: new Date().toISOString().slice(0, 10) };
|
|
205
|
+
payment = { amount: 0, method: "check", checkNumber: "", depositDate: new Date().toISOString().slice(0, 10), note: "" };
|
|
198
206
|
review = { reason: "", payerClaimControlNumber: "", disputedAmount: 0 };
|
|
207
|
+
reviewAttachmentIds = [];
|
|
199
208
|
payerTimer = null;
|
|
200
209
|
constructor() {
|
|
201
210
|
effect(() => {
|
|
@@ -243,6 +252,24 @@ class MindBillBillLifecycleComponent {
|
|
|
243
252
|
}
|
|
244
253
|
stateLabel(data) { return data.lifecycle.state.replace(/_/g, " ").replace(/\b\w/g, (value) => value.toUpperCase()); }
|
|
245
254
|
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."; }
|
|
255
|
+
currentStageIndex(data) {
|
|
256
|
+
const value = data.lifecycle.state.toLowerCase();
|
|
257
|
+
if (value.includes("closed") || value.includes("written_off"))
|
|
258
|
+
return 5;
|
|
259
|
+
if (value.includes("second_review") || value.includes("ibr") || value.includes("lien") || value.includes("appeal"))
|
|
260
|
+
return 4;
|
|
261
|
+
if (value.includes("processed") || value.includes("paid") || value.includes("denied") || value.includes("rejected") || value.includes("response"))
|
|
262
|
+
return 3;
|
|
263
|
+
if (value.includes("accepted"))
|
|
264
|
+
return 2;
|
|
265
|
+
if (value.includes("submitted") || value.includes("queued") || value.includes("sent"))
|
|
266
|
+
return 1;
|
|
267
|
+
return 0;
|
|
268
|
+
}
|
|
269
|
+
activityLabel(type) {
|
|
270
|
+
const labels = { "bill.created": "Bill created", "bill.submitted": "Bill submitted", "bill.accepted": "Bill accepted", "bill.rejected": "Bill rejected", "bill.denied": "Bill denied", "bill.partially_paid": "Partial payment received", "bill.paid": "Bill paid", "bill.second_review": "Second Bill Review submitted", "bill.ibr": "Independent Bill Review submitted", "bill.lien": "Bill moved to lien", "bill.closed": "Bill closed", "payment.posted": "Payment posted", "eor.received": "EOR received" };
|
|
271
|
+
return labels[type] ?? type.replace(/[._-]+/g, " ").replace(/\b\w/g, (value) => value.toUpperCase());
|
|
272
|
+
}
|
|
246
273
|
isEditable(data) { return data.lifecycle.actions.some((action) => action.id === "edit_and_submit" && action.enabled) || ["incomplete", "draft", "not_submitted"].includes(data.lifecycle.state.toLowerCase()); }
|
|
247
274
|
payerExplanation(payer) { return payer.signals?.map((signal) => signal.label).join(" · ") || (payer.hasElectronic ? "Electronic billing available" : "Available in payer directory"); }
|
|
248
275
|
queuePayerSearch() { if (this.payerTimer)
|
|
@@ -320,22 +347,51 @@ class MindBillBillLifecycleComponent {
|
|
|
320
347
|
}
|
|
321
348
|
async submit() { const input = this.buildInput(); if (!input || !this.canSubmit() || !this.deliveryReady())
|
|
322
349
|
return; const data = await this.store.submitBill(input, this.submission); this.showSubmit = false; this.dirty = false; this.draft = this.makeDraft(data); this.notice = "Bill submitted."; this.submitted.emit(data); }
|
|
323
|
-
beginAction(action) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
350
|
+
beginAction(action) {
|
|
351
|
+
const data = this.store.data();
|
|
352
|
+
if (action === "post_payment")
|
|
353
|
+
this.panel = "payment";
|
|
354
|
+
else if (action === "second_review" || action === "independent_bill_review") {
|
|
355
|
+
this.reviewAttachmentIds = data?.bill.attachments.map((doc) => doc.id) ?? [];
|
|
356
|
+
this.panel = "review";
|
|
357
|
+
}
|
|
358
|
+
else if (action === "close")
|
|
359
|
+
this.panel = "close";
|
|
360
|
+
else if (action === "view_eor" && data?.eors[0]) {
|
|
361
|
+
const eor = data.eors[0];
|
|
362
|
+
void this.openEor(eor.id, eor.filename);
|
|
363
|
+
}
|
|
364
|
+
else if (action === "correct_and_resubmit")
|
|
365
|
+
this.panel = "correction";
|
|
366
|
+
}
|
|
367
|
+
actionTitle() { return this.panel === "payment" ? "Post payment" : this.panel === "review" ? "Submit Second Review" : this.panel === "correction" ? "Correct and resubmit" : "Close bill"; }
|
|
368
|
+
toggleReviewAttachment(id) { this.reviewAttachmentIds = this.reviewAttachmentIds.includes(id) ? this.reviewAttachmentIds.filter((item) => item !== id) : [...this.reviewAttachmentIds, id]; }
|
|
369
|
+
async attachForReview() { if (!this.pendingFile)
|
|
370
|
+
return; const filename = this.pendingFile.name; await this.attach(); const attachment = this.store.data()?.bill.attachments.find((doc) => doc.filename === filename); if (attachment && !this.reviewAttachmentIds.includes(attachment.id))
|
|
371
|
+
this.reviewAttachmentIds = [...this.reviewAttachmentIds, attachment.id]; }
|
|
372
|
+
async correct() { const data = await this.store.startCorrection(); this.billIdChange.emit(this.store.billId()); this.dirty = false; this.draft = this.makeDraft(data); this.panel = ""; this.notice = "Correction ready for review."; }
|
|
373
|
+
async postPayment() {
|
|
374
|
+
await this.store.postPayment({
|
|
375
|
+
amount: this.payment.amount,
|
|
376
|
+
method: this.payment.method,
|
|
377
|
+
depositDate: this.payment.depositDate,
|
|
378
|
+
...(this.payment.checkNumber ? { checkNumber: this.payment.checkNumber } : {}),
|
|
379
|
+
...(this.payment.note ? { note: this.payment.note } : {}),
|
|
380
|
+
});
|
|
381
|
+
this.panel = "";
|
|
382
|
+
this.notice = "Payment posted.";
|
|
383
|
+
}
|
|
384
|
+
async submitReview() {
|
|
385
|
+
await this.store.submitSecondReview({
|
|
386
|
+
reason: this.review.reason,
|
|
387
|
+
payerClaimControlNumber: this.review.payerClaimControlNumber,
|
|
388
|
+
disputedAmount: this.review.disputedAmount > 0 ? this.review.disputedAmount : undefined,
|
|
389
|
+
route: "ebill",
|
|
390
|
+
attachmentIds: this.reviewAttachmentIds,
|
|
391
|
+
});
|
|
392
|
+
this.panel = "";
|
|
393
|
+
this.notice = "Second Review submitted.";
|
|
332
394
|
}
|
|
333
|
-
else if (action === "correct_and_resubmit")
|
|
334
|
-
void this.correct(); }
|
|
335
|
-
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."; }
|
|
336
|
-
async postPayment() { await this.store.postPayment({ ...this.payment }); this.panel = ""; this.notice = "Payment posted."; }
|
|
337
|
-
async submitReview() { const data = this.store.data(); if (!data)
|
|
338
|
-
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."; }
|
|
339
395
|
async closeBill() { if (!this.closeReason.trim())
|
|
340
396
|
return; await this.store.closeBill({ reason: this.closeReason }); this.panel = ""; this.notice = "Bill closed."; }
|
|
341
397
|
buildInput() {
|
|
@@ -394,6 +450,16 @@ class MindBillBillLifecycleComponent {
|
|
|
394
450
|
<div class="money"><span>{{ data.bill.balanceDue | currency }}</span><small>balance</small></div>
|
|
395
451
|
</header>
|
|
396
452
|
|
|
453
|
+
<section class="card progress" aria-label="Bill lifecycle">
|
|
454
|
+
<div class="card-title"><div><h3>Bill status</h3><p>{{ lifecycleDetail(data) }}</p></div><span>{{ stateLabel(data) }}</span></div>
|
|
455
|
+
<ol>@for (stage of lifecycleStages; track stage.id; let i=$index) { <li [class.complete]="i < currentStageIndex(data)" [class.current]="i === currentStageIndex(data)" [attr.aria-current]="i === currentStageIndex(data) ? 'step' : null"><b>{{ i < currentStageIndex(data) ? '✓' : i + 1 }}</b><span>{{ stage.label }}</span></li> }</ol>
|
|
456
|
+
</section>
|
|
457
|
+
|
|
458
|
+
<section class="card snapshot" aria-label="Bill snapshot">
|
|
459
|
+
<div class="card-title"><div><h3>Bill snapshot</h3><p>The claim and financial values currently recorded on this bill.</p></div></div>
|
|
460
|
+
<dl><div><dt>Patient</dt><dd>{{ data.patient.name }}</dd></div><div><dt>Claim</dt><dd>{{ data.injury.claimNumber || '—' }}</dd></div><div><dt>Payer</dt><dd>{{ data.delivery.payerName || data.injury.claimsAdminName || '—' }}</dd></div><div><dt>Date of service</dt><dd>{{ data.bill.dos || '—' }}</dd></div><div><dt>Charged</dt><dd>{{ data.bill.totalCharge | currency }}</dd></div><div><dt>Balance</dt><dd>{{ data.bill.balanceDue | currency }}</dd></div></dl>
|
|
461
|
+
</section>
|
|
462
|
+
|
|
397
463
|
@if (isEditable(data) && draft) {
|
|
398
464
|
<form class="review" (submit)="$event.preventDefault(); submit()">
|
|
399
465
|
<section class="card">
|
|
@@ -499,12 +565,27 @@ class MindBillBillLifecycleComponent {
|
|
|
499
565
|
} @else {
|
|
500
566
|
<section class="card lifecycle">
|
|
501
567
|
<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>
|
|
502
|
-
|
|
568
|
+
<div class="lifecycle-grid">
|
|
569
|
+
<section><h4>Remittance</h4><dl class="facts"><div><dt>Payer reported</dt><dd>{{ data.remittance.payerReportedPaid == null ? '—' : (data.remittance.payerReportedPaid | currency) }}</dd></div><div><dt>Posted</dt><dd>{{ data.remittance.totalPaid | currency }}</dd></div><div><dt>Balance</dt><dd>{{ data.remittance.balanceDue | currency }}</dd></div></dl>@if (data.remittance.denialReason) { <div class="denial"><strong>Denial reason</strong><p>{{ data.remittance.denialReason }}</p></div> }</section>
|
|
570
|
+
<section><h4>{{ data.delivery.payerName || 'Claims administrator' }}</h4><dl class="contacts">@if (data.delivery.contacts.adjusterName) { <div><dt>Adjuster</dt><dd>{{ data.delivery.contacts.adjusterName }}</dd></div> }@if (data.delivery.contacts.adjusterPhone) { <div><dt>Phone</dt><dd><a [href]="'tel:'+data.delivery.contacts.adjusterPhone">{{ data.delivery.contacts.adjusterPhone }}</a></dd></div> }@if (data.delivery.contacts.adjusterEmail) { <div><dt>Adjuster email</dt><dd><a [href]="'mailto:'+data.delivery.contacts.adjusterEmail">{{ data.delivery.contacts.adjusterEmail }}</a></dd></div> }@if (data.delivery.contacts.faxNumber) { <div><dt>Fax</dt><dd><a [href]="'tel:'+data.delivery.contacts.faxNumber">{{ data.delivery.contacts.faxNumber }}</a></dd></div> }@if (data.delivery.contacts.claimsEmail) { <div><dt>Claims email</dt><dd><a [href]="'mailto:'+data.delivery.contacts.claimsEmail">{{ data.delivery.contacts.claimsEmail }}</a></dd></div> }@if (data.delivery.contacts.mailingAddress) { <div><dt>Mail</dt><dd>{{ data.delivery.contacts.mailingAddress }}</dd></div> }@if (data.delivery.contacts.portalUrl) { <div><dt>Portal</dt><dd><a [href]="data.delivery.contacts.portalUrl" target="_blank" rel="noopener">Open payer portal</a></dd></div> }</dl></section>
|
|
571
|
+
</div>
|
|
572
|
+
@if (data.eors.length) { <div class="eors"><h4>Explanation of Review</h4><p>Payer response details and the original returned document.</p>@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 original PDF</b></button> }</div> }
|
|
573
|
+
<section class="payments"><h4>Payments</h4>@if (!data.payments.length) { <p>No payments posted.</p> } @else { @for (paymentItem of data.payments; track paymentItem.id) { <article><div><strong>{{ paymentItem.amount | currency }}</strong><span>{{ paymentItem.method | uppercase }} · {{ paymentItem.status }}</span></div><div><span>{{ paymentItem.checkNumber ? '#'+paymentItem.checkNumber : paymentItem.source }}</span><span>{{ paymentItem.depositDate || (paymentItem.postedAt | date:'mediumDate') }}</span></div>@if (paymentItem.note) { <p>{{ paymentItem.note }}</p> }</article> } }</section>
|
|
574
|
+
<section class="history"><h4>Bill history</h4>@if (!data.activity.length) { <p>No bill activity yet.</p> } @else { <ol>@for (event of data.activity; track event.id) { <li><span></span><div><strong>{{ activityLabel(event.type) }}</strong><small>{{ event.createdAt | date:'medium' }}{{ event.actor ? ' · '+event.actor : '' }}</small>@if (event.description) { <p>{{ event.description }}</p> }</div></li> }</ol> }</section>
|
|
503
575
|
<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>
|
|
504
|
-
@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> }
|
|
505
|
-
@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> }
|
|
506
|
-
@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> }
|
|
507
576
|
</section>
|
|
577
|
+
@if (panel) {
|
|
578
|
+
<div class="modal-backdrop" (click)="panel=''">
|
|
579
|
+
<section class="submit-modal action-modal" role="dialog" aria-modal="true" (click)="$event.stopPropagation()">
|
|
580
|
+
<header><div><span class="eyebrow">Bill {{ data.bill.billNumber }}</span><h3>{{ actionTitle() }}</h3></div><button class="close" type="button" (click)="panel=''" aria-label="Close">×</button></header>
|
|
581
|
+
@if (panel === 'payment') { <p>Record funds received for this bill. This updates the payment ledger and remaining balance.</p><div class="grid two"><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>Check / EFT number</span><input [(ngModel)]="payment.checkNumber"></label><label><span>Deposit date</span><input type="date" [(ngModel)]="payment.depositDate"></label></div><label><span>Note (optional)</span><input [(ngModel)]="payment.note"></label> }
|
|
582
|
+
@if (panel === 'review') { <p>Explain the dispute and choose the exact payer documents to include with the Second Review.</p><label><span>Reason for Second Review</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><fieldset class="review-docs"><legend>Supporting documents</legend>@for (doc of data.bill.attachments; track doc.id) { <label><input type="checkbox" [checked]="reviewAttachmentIds.includes(doc.id)" (change)="toggleReviewAttachment(doc.id)"><span><strong>{{ doc.filename }}</strong><small>{{ doc.description || doc.documentType }}</small></span></label> }</fieldset><div class="upload"><select [(ngModel)]="documentType">@for (type of documentTypes; track type.value) { <option [value]="type.value">{{ type.label }}</option> }</select><input type="file" accept="application/pdf" (change)="fileSelected($event)"><button type="button" [disabled]="!pendingFile || store.mutating()" (click)="attachForReview()">Add document</button></div> }
|
|
583
|
+
@if (panel === 'correction') { <p>Create a replacement bill prefilled from this rejected submission. You can correct the payer, claim, provider, service lines, and packet before resubmitting.</p> }
|
|
584
|
+
@if (panel === 'close') { <p>Closing stops active follow-up. The bill history and documents remain available.</p><label><span>Reason</span><textarea [(ngModel)]="closeReason"></textarea></label> }
|
|
585
|
+
<footer><button type="button" (click)="panel=''">Cancel</button>@if (panel === 'payment') { <button class="primary" type="button" (click)="postPayment()" [disabled]="store.mutating() || payment.amount <= 0">Post payment</button> }@if (panel === 'review') { <button class="primary" type="button" (click)="submitReview()" [disabled]="store.mutating() || !review.reason.trim() || !review.payerClaimControlNumber.trim()">Submit Second Review</button> }@if (panel === 'correction') { <button class="primary" type="button" (click)="correct()" [disabled]="store.mutating()">Create correction</button> }@if (panel === 'close') { <button class="danger" type="button" (click)="closeBill()" [disabled]="store.mutating() || !closeReason.trim()">Close bill</button> }</footer>
|
|
586
|
+
</section>
|
|
587
|
+
</div>
|
|
588
|
+
}
|
|
508
589
|
}
|
|
509
590
|
@if (notice) { <div class="notice">{{ notice }}</div> }
|
|
510
591
|
@if (store.error()) { <div class="notice error">{{ store.error()?.message }}</div> }
|
|
@@ -512,7 +593,7 @@ class MindBillBillLifecycleComponent {
|
|
|
512
593
|
}
|
|
513
594
|
<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>
|
|
514
595
|
</section>
|
|
515
|
-
`, 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}.presets{display:flex;gap:8px;margin:-4px 0 12px}.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}.line.professional{grid-template-columns:1.1fr 1fr 1fr 1fr 110px 1fr 90px 110px 40px}.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)}.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.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}.modal-backdrop{position:fixed;z-index:1000;inset:0;display:grid;place-items:center;background:#0f20288f;padding:20px}.submit-modal{display:grid;gap:18px;width:min(680px,100%);max-height:calc(100vh - 40px);overflow:auto;border:1px solid var(--b);border-radius:var(--r);background:var(--s);padding:22px;box-shadow:0 24px 80px #0f202847}.submit-modal>header,.submit-modal>footer{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.submit-modal>footer{justify-content:flex-end}.submit-modal .close{border:0;background:transparent;font-size:26px}.route-list{display:grid;gap:8px}.route-option{display:grid;grid-template-columns:20px 1fr auto;align-items:center;gap:12px;text-align:left;padding:13px}.route-option>span:nth-child(2){display:grid}.route-option.selected{border-color:var(--a);box-shadow:0 0 0 2px color-mix(in srgb,var(--a) 18%,transparent)}.route-option .radio{width:16px;height:16px;border:2px solid var(--b);border-radius:50%}.route-option.selected .radio{border:5px solid var(--a)}.route-option b{color:var(--a);font-size:11px;text-transform:uppercase}@media(max-width:1100px){.line.professional{grid-template-columns:repeat(3,minmax(0,1fr))}.line.professional .allowed{grid-column:auto}}@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}.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,.line.professional{grid-template-columns:1fr}.allowed{grid-column:auto}.docs li{align-items:flex-start;flex-wrap:wrap}.modal-backdrop{padding:8px}.submit-modal{max-height:calc(100vh - 16px);padding:16px}.route-option{grid-template-columns:20px 1fr}.route-option b{grid-column:2}}\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.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" }] });
|
|
596
|
+
`, 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}a{color:var(--a)}.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}.presets{display:flex;gap:8px;margin:-4px 0 12px}.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}.line.professional{grid-template-columns:1.1fr 1fr 1fr 1fr 110px 1fr 90px 110px 40px}.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)}.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.progress ol{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));list-style:none;margin:0;padding:0}.progress li{position:relative;display:grid;justify-items:center;gap:7px;color:var(--m);font-size:12px;text-align:center}.progress li:before{content:\"\";position:absolute;top:14px;right:50%;left:-50%;height:2px;background:var(--b)}.progress li:first-child:before{display:none}.progress li b{position:relative;z-index:1;display:grid;place-items:center;width:28px;height:28px;border:2px solid var(--b);border-radius:50%;background:var(--s)}.progress li.complete,.progress li.current{color:var(--t)}.progress li.complete:before,.progress li.current:before{background:var(--a)}.progress li.complete b,.progress li.current b{border-color:var(--a);background:var(--a);color:var(--ac)}.snapshot dl,.facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0}.snapshot dl>div,.facts>div{display:grid;gap:3px;border-right:1px solid var(--b);padding:4px 14px}.snapshot dl>div:nth-child(3n),.facts>div:last-child{border-right:0}.snapshot dt,.facts dt,.contacts dt{color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.snapshot dd,.facts dd,.contacts dd{margin:0;font-weight:700}.lifecycle{display:grid;gap:20px}.actionbar{flex-wrap:wrap;border-top:1px solid var(--b);padding-top:18px}.lifecycle-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.lifecycle-grid>section,.payments,.history,.eors{display:grid;gap:11px;border:1px solid var(--b);border-radius:var(--cr);padding:15px}.contacts{display:grid;gap:9px;margin:0}.contacts>div{display:grid;grid-template-columns:70px 1fr;gap:10px}.denial{border-radius:var(--cr);background:#fff4ed;padding:11px}.eors>button{display:flex;align-items:center;justify-content:space-between;text-align:left}.eors span{display:grid}.payments article{display:grid;grid-template-columns:1fr auto;gap:4px;border-top:1px solid var(--b);padding-top:10px}.payments article>div{display:grid}.payments article>div:last-of-type{text-align:right}.payments article p{grid-column:1/-1}.history ol{display:grid;gap:0;list-style:none;margin:0;padding:0}.history li{display:grid;grid-template-columns:18px 1fr;gap:9px}.history li>span{position:relative;margin-top:5px;width:10px;height:10px;border-radius:50%;background:var(--a)}.history li>span:after{content:\"\";position:absolute;top:10px;bottom:-30px;left:4px;width:2px;background:var(--b)}.history li:last-child>span:after{display:none}.history li>div{display:grid;gap:2px;padding-bottom:15px}.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}.modal-backdrop{position:fixed;z-index:1000;inset:0;display:grid;place-items:center;background:#0f20288f;padding:20px}.submit-modal{display:grid;gap:18px;width:min(680px,100%);max-height:calc(100vh - 40px);overflow:auto;border:1px solid var(--b);border-radius:var(--r);background:var(--s);padding:22px;box-shadow:0 24px 80px #0f202847}.submit-modal>header,.submit-modal>footer{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.submit-modal>footer{justify-content:flex-end}.submit-modal .close{border:0;background:transparent;font-size:26px}.route-list{display:grid;gap:8px}.route-option{display:grid;grid-template-columns:20px 1fr auto;align-items:center;gap:12px;text-align:left;padding:13px}.route-option>span:nth-child(2){display:grid}.route-option.selected{border-color:var(--a);box-shadow:0 0 0 2px color-mix(in srgb,var(--a) 18%,transparent)}.route-option .radio{width:16px;height:16px;border:2px solid var(--b);border-radius:50%}.route-option.selected .radio{border:5px solid var(--a)}.route-option b{color:var(--a);font-size:11px;text-transform:uppercase}.action-modal{width:min(720px,100%)}.review-docs{display:grid;gap:8px;border:1px solid var(--b);border-radius:var(--cr);padding:12px}.review-docs label{display:grid;grid-template-columns:20px 1fr;align-items:start}.review-docs input{min-height:auto}.review-docs label>span{display:grid}@media(max-width:1100px){.line.professional{grid-template-columns:repeat(3,minmax(0,1fr))}.line.professional .allowed{grid-column:auto}}@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}.actions{justify-content:flex-start}.lifecycle-grid{grid-template-columns:1fr}}@media(max-width:600px){.summary,.card-title{align-items:stretch;flex-direction:column}.money{text-align:left}.grid.four,.grid.three,.grid.two,.line,.line.professional{grid-template-columns:1fr}.allowed{grid-column:auto}.docs li{align-items:flex-start;flex-wrap:wrap}.progress{overflow-x:auto}.progress ol{min-width:560px}.snapshot dl,.facts{grid-template-columns:1fr}.snapshot dl>div,.facts>div{border-right:0;border-bottom:1px solid var(--b);padding:10px 0}.snapshot dl>div:last-child,.facts>div:last-child{border-bottom:0}.modal-backdrop{align-items:end;padding:0}.submit-modal{max-height:92vh;border-radius:var(--r) var(--r) 0 0;padding:16px}.route-option{grid-template-columns:20px 1fr}.route-option b{grid-column:2}}\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.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.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
516
597
|
}
|
|
517
598
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MindBillBillLifecycleComponent, decorators: [{
|
|
518
599
|
type: Component,
|
|
@@ -528,6 +609,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
528
609
|
<div class="money"><span>{{ data.bill.balanceDue | currency }}</span><small>balance</small></div>
|
|
529
610
|
</header>
|
|
530
611
|
|
|
612
|
+
<section class="card progress" aria-label="Bill lifecycle">
|
|
613
|
+
<div class="card-title"><div><h3>Bill status</h3><p>{{ lifecycleDetail(data) }}</p></div><span>{{ stateLabel(data) }}</span></div>
|
|
614
|
+
<ol>@for (stage of lifecycleStages; track stage.id; let i=$index) { <li [class.complete]="i < currentStageIndex(data)" [class.current]="i === currentStageIndex(data)" [attr.aria-current]="i === currentStageIndex(data) ? 'step' : null"><b>{{ i < currentStageIndex(data) ? '✓' : i + 1 }}</b><span>{{ stage.label }}</span></li> }</ol>
|
|
615
|
+
</section>
|
|
616
|
+
|
|
617
|
+
<section class="card snapshot" aria-label="Bill snapshot">
|
|
618
|
+
<div class="card-title"><div><h3>Bill snapshot</h3><p>The claim and financial values currently recorded on this bill.</p></div></div>
|
|
619
|
+
<dl><div><dt>Patient</dt><dd>{{ data.patient.name }}</dd></div><div><dt>Claim</dt><dd>{{ data.injury.claimNumber || '—' }}</dd></div><div><dt>Payer</dt><dd>{{ data.delivery.payerName || data.injury.claimsAdminName || '—' }}</dd></div><div><dt>Date of service</dt><dd>{{ data.bill.dos || '—' }}</dd></div><div><dt>Charged</dt><dd>{{ data.bill.totalCharge | currency }}</dd></div><div><dt>Balance</dt><dd>{{ data.bill.balanceDue | currency }}</dd></div></dl>
|
|
620
|
+
</section>
|
|
621
|
+
|
|
531
622
|
@if (isEditable(data) && draft) {
|
|
532
623
|
<form class="review" (submit)="$event.preventDefault(); submit()">
|
|
533
624
|
<section class="card">
|
|
@@ -633,12 +724,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
633
724
|
} @else {
|
|
634
725
|
<section class="card lifecycle">
|
|
635
726
|
<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>
|
|
636
|
-
|
|
727
|
+
<div class="lifecycle-grid">
|
|
728
|
+
<section><h4>Remittance</h4><dl class="facts"><div><dt>Payer reported</dt><dd>{{ data.remittance.payerReportedPaid == null ? '—' : (data.remittance.payerReportedPaid | currency) }}</dd></div><div><dt>Posted</dt><dd>{{ data.remittance.totalPaid | currency }}</dd></div><div><dt>Balance</dt><dd>{{ data.remittance.balanceDue | currency }}</dd></div></dl>@if (data.remittance.denialReason) { <div class="denial"><strong>Denial reason</strong><p>{{ data.remittance.denialReason }}</p></div> }</section>
|
|
729
|
+
<section><h4>{{ data.delivery.payerName || 'Claims administrator' }}</h4><dl class="contacts">@if (data.delivery.contacts.adjusterName) { <div><dt>Adjuster</dt><dd>{{ data.delivery.contacts.adjusterName }}</dd></div> }@if (data.delivery.contacts.adjusterPhone) { <div><dt>Phone</dt><dd><a [href]="'tel:'+data.delivery.contacts.adjusterPhone">{{ data.delivery.contacts.adjusterPhone }}</a></dd></div> }@if (data.delivery.contacts.adjusterEmail) { <div><dt>Adjuster email</dt><dd><a [href]="'mailto:'+data.delivery.contacts.adjusterEmail">{{ data.delivery.contacts.adjusterEmail }}</a></dd></div> }@if (data.delivery.contacts.faxNumber) { <div><dt>Fax</dt><dd><a [href]="'tel:'+data.delivery.contacts.faxNumber">{{ data.delivery.contacts.faxNumber }}</a></dd></div> }@if (data.delivery.contacts.claimsEmail) { <div><dt>Claims email</dt><dd><a [href]="'mailto:'+data.delivery.contacts.claimsEmail">{{ data.delivery.contacts.claimsEmail }}</a></dd></div> }@if (data.delivery.contacts.mailingAddress) { <div><dt>Mail</dt><dd>{{ data.delivery.contacts.mailingAddress }}</dd></div> }@if (data.delivery.contacts.portalUrl) { <div><dt>Portal</dt><dd><a [href]="data.delivery.contacts.portalUrl" target="_blank" rel="noopener">Open payer portal</a></dd></div> }</dl></section>
|
|
730
|
+
</div>
|
|
731
|
+
@if (data.eors.length) { <div class="eors"><h4>Explanation of Review</h4><p>Payer response details and the original returned document.</p>@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 original PDF</b></button> }</div> }
|
|
732
|
+
<section class="payments"><h4>Payments</h4>@if (!data.payments.length) { <p>No payments posted.</p> } @else { @for (paymentItem of data.payments; track paymentItem.id) { <article><div><strong>{{ paymentItem.amount | currency }}</strong><span>{{ paymentItem.method | uppercase }} · {{ paymentItem.status }}</span></div><div><span>{{ paymentItem.checkNumber ? '#'+paymentItem.checkNumber : paymentItem.source }}</span><span>{{ paymentItem.depositDate || (paymentItem.postedAt | date:'mediumDate') }}</span></div>@if (paymentItem.note) { <p>{{ paymentItem.note }}</p> }</article> } }</section>
|
|
733
|
+
<section class="history"><h4>Bill history</h4>@if (!data.activity.length) { <p>No bill activity yet.</p> } @else { <ol>@for (event of data.activity; track event.id) { <li><span></span><div><strong>{{ activityLabel(event.type) }}</strong><small>{{ event.createdAt | date:'medium' }}{{ event.actor ? ' · '+event.actor : '' }}</small>@if (event.description) { <p>{{ event.description }}</p> }</div></li> }</ol> }</section>
|
|
637
734
|
<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>
|
|
638
|
-
@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> }
|
|
639
|
-
@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> }
|
|
640
|
-
@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> }
|
|
641
735
|
</section>
|
|
736
|
+
@if (panel) {
|
|
737
|
+
<div class="modal-backdrop" (click)="panel=''">
|
|
738
|
+
<section class="submit-modal action-modal" role="dialog" aria-modal="true" (click)="$event.stopPropagation()">
|
|
739
|
+
<header><div><span class="eyebrow">Bill {{ data.bill.billNumber }}</span><h3>{{ actionTitle() }}</h3></div><button class="close" type="button" (click)="panel=''" aria-label="Close">×</button></header>
|
|
740
|
+
@if (panel === 'payment') { <p>Record funds received for this bill. This updates the payment ledger and remaining balance.</p><div class="grid two"><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>Check / EFT number</span><input [(ngModel)]="payment.checkNumber"></label><label><span>Deposit date</span><input type="date" [(ngModel)]="payment.depositDate"></label></div><label><span>Note (optional)</span><input [(ngModel)]="payment.note"></label> }
|
|
741
|
+
@if (panel === 'review') { <p>Explain the dispute and choose the exact payer documents to include with the Second Review.</p><label><span>Reason for Second Review</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><fieldset class="review-docs"><legend>Supporting documents</legend>@for (doc of data.bill.attachments; track doc.id) { <label><input type="checkbox" [checked]="reviewAttachmentIds.includes(doc.id)" (change)="toggleReviewAttachment(doc.id)"><span><strong>{{ doc.filename }}</strong><small>{{ doc.description || doc.documentType }}</small></span></label> }</fieldset><div class="upload"><select [(ngModel)]="documentType">@for (type of documentTypes; track type.value) { <option [value]="type.value">{{ type.label }}</option> }</select><input type="file" accept="application/pdf" (change)="fileSelected($event)"><button type="button" [disabled]="!pendingFile || store.mutating()" (click)="attachForReview()">Add document</button></div> }
|
|
742
|
+
@if (panel === 'correction') { <p>Create a replacement bill prefilled from this rejected submission. You can correct the payer, claim, provider, service lines, and packet before resubmitting.</p> }
|
|
743
|
+
@if (panel === 'close') { <p>Closing stops active follow-up. The bill history and documents remain available.</p><label><span>Reason</span><textarea [(ngModel)]="closeReason"></textarea></label> }
|
|
744
|
+
<footer><button type="button" (click)="panel=''">Cancel</button>@if (panel === 'payment') { <button class="primary" type="button" (click)="postPayment()" [disabled]="store.mutating() || payment.amount <= 0">Post payment</button> }@if (panel === 'review') { <button class="primary" type="button" (click)="submitReview()" [disabled]="store.mutating() || !review.reason.trim() || !review.payerClaimControlNumber.trim()">Submit Second Review</button> }@if (panel === 'correction') { <button class="primary" type="button" (click)="correct()" [disabled]="store.mutating()">Create correction</button> }@if (panel === 'close') { <button class="danger" type="button" (click)="closeBill()" [disabled]="store.mutating() || !closeReason.trim()">Close bill</button> }</footer>
|
|
745
|
+
</section>
|
|
746
|
+
</div>
|
|
747
|
+
}
|
|
642
748
|
}
|
|
643
749
|
@if (notice) { <div class="notice">{{ notice }}</div> }
|
|
644
750
|
@if (store.error()) { <div class="notice error">{{ store.error()?.message }}</div> }
|
|
@@ -646,7 +752,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
646
752
|
}
|
|
647
753
|
<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>
|
|
648
754
|
</section>
|
|
649
|
-
`, 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}.presets{display:flex;gap:8px;margin:-4px 0 12px}.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}.line.professional{grid-template-columns:1.1fr 1fr 1fr 1fr 110px 1fr 90px 110px 40px}.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)}.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.lifecycle{display:grid;gap:
|
|
755
|
+
`, 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}a{color:var(--a)}.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}.presets{display:flex;gap:8px;margin:-4px 0 12px}.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}.line.professional{grid-template-columns:1.1fr 1fr 1fr 1fr 110px 1fr 90px 110px 40px}.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)}.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.progress ol{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));list-style:none;margin:0;padding:0}.progress li{position:relative;display:grid;justify-items:center;gap:7px;color:var(--m);font-size:12px;text-align:center}.progress li:before{content:\"\";position:absolute;top:14px;right:50%;left:-50%;height:2px;background:var(--b)}.progress li:first-child:before{display:none}.progress li b{position:relative;z-index:1;display:grid;place-items:center;width:28px;height:28px;border:2px solid var(--b);border-radius:50%;background:var(--s)}.progress li.complete,.progress li.current{color:var(--t)}.progress li.complete:before,.progress li.current:before{background:var(--a)}.progress li.complete b,.progress li.current b{border-color:var(--a);background:var(--a);color:var(--ac)}.snapshot dl,.facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0}.snapshot dl>div,.facts>div{display:grid;gap:3px;border-right:1px solid var(--b);padding:4px 14px}.snapshot dl>div:nth-child(3n),.facts>div:last-child{border-right:0}.snapshot dt,.facts dt,.contacts dt{color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.snapshot dd,.facts dd,.contacts dd{margin:0;font-weight:700}.lifecycle{display:grid;gap:20px}.actionbar{flex-wrap:wrap;border-top:1px solid var(--b);padding-top:18px}.lifecycle-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.lifecycle-grid>section,.payments,.history,.eors{display:grid;gap:11px;border:1px solid var(--b);border-radius:var(--cr);padding:15px}.contacts{display:grid;gap:9px;margin:0}.contacts>div{display:grid;grid-template-columns:70px 1fr;gap:10px}.denial{border-radius:var(--cr);background:#fff4ed;padding:11px}.eors>button{display:flex;align-items:center;justify-content:space-between;text-align:left}.eors span{display:grid}.payments article{display:grid;grid-template-columns:1fr auto;gap:4px;border-top:1px solid var(--b);padding-top:10px}.payments article>div{display:grid}.payments article>div:last-of-type{text-align:right}.payments article p{grid-column:1/-1}.history ol{display:grid;gap:0;list-style:none;margin:0;padding:0}.history li{display:grid;grid-template-columns:18px 1fr;gap:9px}.history li>span{position:relative;margin-top:5px;width:10px;height:10px;border-radius:50%;background:var(--a)}.history li>span:after{content:\"\";position:absolute;top:10px;bottom:-30px;left:4px;width:2px;background:var(--b)}.history li:last-child>span:after{display:none}.history li>div{display:grid;gap:2px;padding-bottom:15px}.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}.modal-backdrop{position:fixed;z-index:1000;inset:0;display:grid;place-items:center;background:#0f20288f;padding:20px}.submit-modal{display:grid;gap:18px;width:min(680px,100%);max-height:calc(100vh - 40px);overflow:auto;border:1px solid var(--b);border-radius:var(--r);background:var(--s);padding:22px;box-shadow:0 24px 80px #0f202847}.submit-modal>header,.submit-modal>footer{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.submit-modal>footer{justify-content:flex-end}.submit-modal .close{border:0;background:transparent;font-size:26px}.route-list{display:grid;gap:8px}.route-option{display:grid;grid-template-columns:20px 1fr auto;align-items:center;gap:12px;text-align:left;padding:13px}.route-option>span:nth-child(2){display:grid}.route-option.selected{border-color:var(--a);box-shadow:0 0 0 2px color-mix(in srgb,var(--a) 18%,transparent)}.route-option .radio{width:16px;height:16px;border:2px solid var(--b);border-radius:50%}.route-option.selected .radio{border:5px solid var(--a)}.route-option b{color:var(--a);font-size:11px;text-transform:uppercase}.action-modal{width:min(720px,100%)}.review-docs{display:grid;gap:8px;border:1px solid var(--b);border-radius:var(--cr);padding:12px}.review-docs label{display:grid;grid-template-columns:20px 1fr;align-items:start}.review-docs input{min-height:auto}.review-docs label>span{display:grid}@media(max-width:1100px){.line.professional{grid-template-columns:repeat(3,minmax(0,1fr))}.line.professional .allowed{grid-column:auto}}@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}.actions{justify-content:flex-start}.lifecycle-grid{grid-template-columns:1fr}}@media(max-width:600px){.summary,.card-title{align-items:stretch;flex-direction:column}.money{text-align:left}.grid.four,.grid.three,.grid.two,.line,.line.professional{grid-template-columns:1fr}.allowed{grid-column:auto}.docs li{align-items:flex-start;flex-wrap:wrap}.progress{overflow-x:auto}.progress ol{min-width:560px}.snapshot dl,.facts{grid-template-columns:1fr}.snapshot dl>div,.facts>div{border-right:0;border-bottom:1px solid var(--b);padding:10px 0}.snapshot dl>div:last-child,.facts>div:last-child{border-bottom:0}.modal-backdrop{align-items:end;padding:0}.submit-modal{max-height:92vh;border-radius:var(--r) var(--r) 0 0;padding:16px}.route-option{grid-template-columns:20px 1fr}.route-option b{grid-column:2}}\n"] }]
|
|
650
756
|
}], ctorParameters: () => [], propDecorators: { billId: [{
|
|
651
757
|
type: Input
|
|
652
758
|
}], create: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mindbill-angular.mjs","sources":["../../src/lib/lifecycle-store.ts","../../src/lib/procedure-lines.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 BrowserBillCreateInput,\n type BillReviewDocumentType,\n type BillReviewSaveInput,\n type CloseBillInput,\n type PostBillPaymentInput,\n type SubmitBillInput,\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 createInput: BrowserBillCreateInput | undefined;\n private onBillCreated: ((billId: string, data: BillLifecycleData) => void) | undefined;\n private refreshTimer: ReturnType<typeof setInterval> | null = null;\n\n connect(\n options: BillLifecycleClientOptions,\n refreshInterval = 60_000,\n createInput?: BrowserBillCreateInput,\n onBillCreated?: (billId: string, data: BillLifecycleData) => void,\n ): void {\n this.disconnect();\n this.billId.set(options.billId ?? \"\");\n this.createInput = createInput;\n this.onBillCreated = onBillCreated;\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 this.createInput = undefined;\n this.onBillCreated = undefined;\n }\n\n async refresh(): Promise<BillLifecycleData | null> {\n if (!this.client) return null;\n this.loading.set(this.data() === null);\n try {\n let data: BillLifecycleData;\n if (!this.client.getBillId()) {\n if (!this.createInput) {\n throw new Error(\"Pass billId to open a bill or create to start a new one.\");\n }\n const created = await this.client.createBill(this.createInput);\n const isNew = !this.billId();\n this.billId.set(created.billId);\n if (isNew) this.onBillCreated?.(created.billId, created.data);\n data = created.data;\n } else {\n data = await this.client.getLifecycle();\n }\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 getDeliveryOptions() { return this.requireClient().getDeliveryOptions(); }\n saveReview(input: BillReviewSaveInput) { return this.mutate(() => this.requireClient().saveReview(input)); }\n submitBill(input: BillReviewSaveInput, submission: SubmitBillInput) { return this.mutate(() => this.requireClient().submitBill(input, submission)); }\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","export type ProcedureLine = {\n id?: string;\n code: string;\n modifiers: string[];\n units: number;\n charge: number;\n feeSchedule?: number;\n serviceDate?: string | null;\n serviceDateEnd?: string | null;\n diagnosisPointers?: number[];\n};\n\nconst EMPTY_PROCEDURE_LINE: ProcedureLine = {\n code: \"\",\n modifiers: [],\n units: 1,\n charge: 0,\n};\n\nexport function isEmptyProcedureLine(line: ProcedureLine): boolean {\n return !line.code.trim()\n && line.modifiers.length === 0\n && line.units === 1\n && !line.serviceDate\n && !line.serviceDateEnd\n && !(line.diagnosisPointers?.length)\n && !line.charge;\n}\n\n/** Keeps completed/partial lines plus one keyboard-ready empty row. */\nexport function ensureTrailingProcedureLine(\n lines: readonly ProcedureLine[],\n): ProcedureLine[] {\n const entered = lines\n .filter((line) => !isEmptyProcedureLine(line))\n .map((line) => ({ ...line, modifiers: [...line.modifiers] }));\n\n return entered.length < 50\n ? [...entered, { ...EMPTY_PROCEDURE_LINE, modifiers: [] }]\n : entered;\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 BrowserBillCreateInput,\n BillReviewDocumentType,\n BillReviewBillingProvider,\n BillReviewClinician,\n BillReviewLocation,\n BillReviewPayer,\n BillReviewSaveInput,\n BillDeliveryOption,\n BillDeliveryOptions,\n SubmitBillInput,\n} from \"@mindbill/browser\";\nimport { MindBillLifecycleStore } from \"./lifecycle-store\";\nimport { ensureTrailingProcedureLine } from \"./procedure-lines\";\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: \"return_to_work_voucher\", label: \"Return-to-work voucher\" },\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>{{ draft.bill.billingMode === 'professional' ? 'Enter each treatment or professional service.' : 'Choose medical-legal codes, modifiers, units, and allowed amounts.' }} A keyboard-ready row appears automatically.</p></div></div>\n @if (draft.bill.billingMode === 'med_legal') {\n <div class=\"presets\"><button type=\"button\" (click)=\"applyPreset('qme')\">QME</button><button type=\"button\" (click)=\"applyPreset('ame')\">AME</button><button type=\"button\" (click)=\"applyPreset('psych')\">Psych QME</button></div>\n }\n <div class=\"lines\">@for (line of draft.bill.lineItems; track $index; let i=$index) {\n <div class=\"line\" [class.professional]=\"draft.bill.billingMode === 'professional'\">\n <label><span>Procedure</span>\n @if (draft.bill.billingMode === 'med_legal') {\n <select [(ngModel)]=\"line.code\" [name]=\"'code'+i\" (ngModelChange)=\"lineChanged()\"><option value=\"\">Choose code…</option>@for (code of medLegalCodes; track code) { <option [value]=\"code\">{{ code }}</option> }</select>\n } @else { <input [(ngModel)]=\"line.code\" [name]=\"'code'+i\" (ngModelChange)=\"lineChanged()\" placeholder=\"e.g. 99204\"> }\n </label>\n <label><span>Modifiers</span><input [ngModel]=\"line.modifiers.join(', ')\" (ngModelChange)=\"setModifiers(line,$any($event))\" [name]=\"'modifiers'+i\" placeholder=\"e.g. 25, 95\"></label>\n @if (draft.bill.billingMode === 'professional') {\n <label><span>Service date</span><input type=\"date\" [(ngModel)]=\"line.serviceDate\" [name]=\"'serviceDate'+i\" (ngModelChange)=\"lineChanged()\"></label>\n <label><span>End date</span><input type=\"date\" [(ngModel)]=\"line.serviceDateEnd\" [name]=\"'serviceDateEnd'+i\" (ngModelChange)=\"lineChanged()\"></label>\n <label><span>Charge</span><input type=\"number\" min=\"0\" step=\"0.01\" [(ngModel)]=\"line.charge\" [name]=\"'charge'+i\" (ngModelChange)=\"lineChanged()\"></label>\n <label><span>Diagnosis pointers</span><input [ngModel]=\"(line.diagnosisPointers || []).join(', ')\" (ngModelChange)=\"setDiagnosisPointers(line,$any($event))\" [name]=\"'pointers'+i\" placeholder=\"1, 2\"></label>\n }\n <label><span>Units</span><input type=\"number\" min=\"1\" [(ngModel)]=\"line.units\" [name]=\"'units'+i\" (ngModelChange)=\"lineChanged()\"></label>\n <div class=\"allowed\"><span>{{ draft.bill.billingMode === 'professional' ? 'Charge' : 'Allowed' }}</span><strong>{{ line.charge | currency }}</strong></div>\n <button type=\"button\" class=\"remove\" (click)=\"removeLine(i)\" aria-label=\"Remove line\">×</button>\n </div>\n }</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>Review the exact electronic, fax, email, or mail destination before anything is sent.</p></div><div class=\"actions\"><button type=\"button\" (click)=\"save()\" [disabled]=\"store.mutating()\">Save changes</button><button class=\"primary\" type=\"button\" (click)=\"openSubmit()\" [disabled]=\"store.mutating() || deliveryBusy || !canSubmit()\">{{ deliveryBusy ? 'Loading routes…' : 'Review delivery' }}</button></div></section>\n\n @if (showSubmit && deliveryOptions) {\n <div class=\"modal-backdrop\" (click)=\"closeSubmit()\">\n <section class=\"submit-modal\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"mb-submit-title\" (click)=\"$event.stopPropagation()\">\n <header><div><span class=\"eyebrow\">Send bill</span><h3 id=\"mb-submit-title\">Choose a delivery route</h3><p>{{ deliveryOptions.payerName }}</p></div><button type=\"button\" class=\"close\" (click)=\"closeSubmit()\" aria-label=\"Close\">×</button></header>\n <div class=\"route-list\">@for (option of deliveryOptions.options; track option.route) {\n <button type=\"button\" class=\"route-option\" [class.selected]=\"submission.route === option.route\" (click)=\"chooseDelivery(option)\"><span class=\"radio\"></span><span><strong>{{ option.label }}</strong><small>{{ option.detail }}</small></span>@if (option.route === deliveryOptions.recommended.route) { <b>Recommended</b> }</button>\n }</div>\n @if (selectedDelivery(); as option) {\n @if (option.route === 'fax') { <label><span>Fax number</span><input [ngModel]=\"submission.destination?.faxNumber || ''\" (ngModelChange)=\"setDestination('faxNumber',$any($event))\" name=\"submitFax\"></label> }\n @if (option.route === 'email') { <label><span>Email address</span><input type=\"email\" [ngModel]=\"submission.destination?.email || ''\" (ngModelChange)=\"setDestination('email',$any($event))\" name=\"submitEmail\"></label><label><span>Subject</span><input [(ngModel)]=\"submission.subject\" name=\"submitSubject\"></label> }\n @if (option.route === 'mail') { <label><span>Mailing address</span><textarea [ngModel]=\"submission.destination?.mailingAddress || ''\" (ngModelChange)=\"setDestination('mailingAddress',$any($event))\" name=\"submitMail\"></textarea></label> }\n @if (option.route !== 'ebill') { <label><span>Attention (optional)</span><input [(ngModel)]=\"submission.attention\" name=\"submitAttention\"></label> }\n }\n <footer><button type=\"button\" (click)=\"closeSubmit()\">Cancel</button><button type=\"button\" class=\"primary\" (click)=\"submit()\" [disabled]=\"store.mutating() || !deliveryReady()\">{{ store.mutating() ? 'Submitting…' : 'Submit bill' }}</button></footer>\n </section>\n </div>\n }\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}.presets{display:flex;gap:8px;margin:-4px 0 12px}.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}.line.professional{grid-template-columns:1.1fr 1fr 1fr 1fr 110px 1fr 90px 110px 40px}.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)}.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.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}.modal-backdrop{position:fixed;z-index:1000;inset:0;display:grid;place-items:center;background:rgba(15,32,40,.56);padding:20px}.submit-modal{display:grid;gap:18px;width:min(680px,100%);max-height:calc(100vh - 40px);overflow:auto;border:1px solid var(--b);border-radius:var(--r);background:var(--s);padding:22px;box-shadow:0 24px 80px rgba(15,32,40,.28)}.submit-modal>header,.submit-modal>footer{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.submit-modal>footer{justify-content:flex-end}.submit-modal .close{border:0;background:transparent;font-size:26px}.route-list{display:grid;gap:8px}.route-option{display:grid;grid-template-columns:20px 1fr auto;align-items:center;gap:12px;text-align:left;padding:13px}.route-option>span:nth-child(2){display:grid}.route-option.selected{border-color:var(--a);box-shadow:0 0 0 2px color-mix(in srgb,var(--a) 18%,transparent)}.route-option .radio{width:16px;height:16px;border:2px solid var(--b);border-radius:50%}.route-option.selected .radio{border:5px solid var(--a)}.route-option b{color:var(--a);font-size:11px;text-transform:uppercase}@media(max-width:1100px){.line.professional{grid-template-columns:repeat(3,minmax(0,1fr))}.line.professional .allowed{grid-column:auto}}@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}.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,.line.professional{grid-template-columns:1fr}.allowed{grid-column:auto}.docs li{align-items:flex-start;flex-wrap:wrap}.modal-backdrop{padding:8px}.submit-modal{max-height:calc(100vh - 16px);padding:16px}.route-option{grid-template-columns:20px 1fr}.route-option b{grid-column:2}}\n `],\n})\nexport class MindBillBillLifecycleComponent implements OnChanges, OnDestroy {\n @Input() billId = \"\";\n @Input() create?: BrowserBillCreateInput;\n @Input() sessionEndpoint = \"/api/mindbill/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() billCreated = new EventEmitter<{ billId: string; data: BillLifecycleData }>();\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 medLegalCodes = [\"ML200\", \"ML201\", \"ML202\", \"ML203\", \"ML204\", \"ML205\", \"ML206\", \"MLPRR\"];\n draft: BillDraft | null = null;\n dirty = false;\n payerQuery = \"\";\n payerResults: BillReviewPayer[] = [];\n documentType: BillReviewDocumentType = \"other\";\n pendingFile: File | null = null;\n deliveryOptions: BillDeliveryOptions | null = null;\n submission: SubmitBillInput = { route: \"ebill\" };\n showSubmit = false;\n deliveryBusy = false;\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[\"create\"] || changes[\"sessionEndpoint\"] || changes[\"apiBaseUrl\"] || changes[\"getSession\"]) {\n if (!this.billId && !this.create) {\n this.store.disconnect();\n return;\n }\n this.store.connect(\n {\n ...(this.billId ? { billId: this.billId } : {}),\n sessionEndpoint: this.sessionEndpoint,\n apiBaseUrl: this.apiBaseUrl,\n ...(this.getSession ? { getSession: this.getSession } : {}),\n },\n this.refreshInterval,\n this.create,\n (billId, data) => {\n this.billIdChange.emit(billId);\n this.billCreated.emit({ billId, data });\n },\n );\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 lineChanged(): void { this.normalizeLineItems(); this.dirty = true; }\n removeLine(index: number): void { this.draft?.bill.lineItems.splice(index, 1); this.normalizeLineItems(); this.dirty = true; }\n setModifiers(line: { modifiers: string[] }, value: string): void { line.modifiers = value.split(\",\").map((item) => item.trim().replace(/^-/, \"\")).filter(Boolean); this.normalizeLineItems(); this.dirty = true; }\n setDiagnosisPointers(line: { diagnosisPointers?: number[] }, value: string): void { line.diagnosisPointers = value.split(\",\").map((item) => Number(item.trim())).filter((item) => Number.isInteger(item) && item >= 1 && item <= 12); this.normalizeLineItems(); this.dirty = true; }\n applyPreset(kind: \"qme\" | \"ame\" | \"psych\"): void {\n if (!this.draft) return;\n const modifier = kind === \"ame\" ? \"94\" : kind === \"psych\" ? \"96\" : \"95\";\n const entered = this.draft.bill.lineItems.filter((line) => line.code.trim());\n if (entered.length === 0) entered.push({ code: \"ML201\", modifiers: [modifier], units: 1, charge: 0 });\n else entered.forEach((line) => { if (!line.modifiers.length) line.modifiers = [modifier]; });\n this.draft.bill.lineItems = ensureTrailingProcedureLine(entered);\n this.dirty = true;\n }\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 {\n const input = this.buildInput();\n if (!input || !input.claimsAdminId || !input.billingProvider?.name || !input.billingProvider.taxId || !input.billingProvider.npi || !input.renderingProvider?.name || !input.renderingProvider.npi || !input.lineItems.length) return false;\n return input.lineItems.every((line) => line.code && line.units > 0 && (this.draft?.bill.billingMode !== \"professional\" || Boolean(line.serviceDate && line.charge && line.charge > 0)));\n }\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 openSubmit(): Promise<void> {\n if (!this.canSubmit()) return;\n this.deliveryBusy = true;\n try {\n this.deliveryOptions = await this.store.getDeliveryOptions();\n this.chooseDelivery(this.deliveryOptions.recommended);\n this.showSubmit = true;\n } finally { this.deliveryBusy = false; }\n }\n closeSubmit(): void { this.showSubmit = false; }\n selectedDelivery(): BillDeliveryOption | undefined { return this.deliveryOptions?.options.find((option) => option.route === this.submission.route); }\n chooseDelivery(option: BillDeliveryOption): void {\n const destination = option.route === \"fax\" ? { faxNumber: option.target ?? this.deliveryOptions?.contacts.faxNumber ?? \"\" }\n : option.route === \"email\" ? { email: option.target ?? this.deliveryOptions?.contacts.claimsEmail ?? \"\" }\n : option.route === \"mail\" ? { mailingAddress: option.target ?? this.deliveryOptions?.contacts.mailingAddress ?? \"\" }\n : undefined;\n this.submission = { route: option.route, ...(destination ? { destination } : {}) };\n }\n setDestination(key: \"faxNumber\" | \"email\" | \"mailingAddress\", value: string): void { this.submission = { ...this.submission, destination: { ...this.submission.destination, [key]: value } }; }\n deliveryReady(): boolean {\n if (this.submission.route === \"fax\") return Boolean(this.submission.destination?.faxNumber?.trim());\n if (this.submission.route === \"email\") return Boolean(this.submission.destination?.email?.trim());\n if (this.submission.route === \"mail\") return Boolean(this.submission.destination?.mailingAddress?.trim());\n return true;\n }\n async submit(): Promise<void> { const input = this.buildInput(); if (!input || !this.canSubmit() || !this.deliveryReady()) return; const data = await this.store.submitBill(input, this.submission); this.showSubmit = false; 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.filter((line) => line.code.trim()).map((line) => ({\n ...(line.id ? { id: line.id } : {}),\n code: line.code,\n modifiers: line.modifiers,\n units: line.units,\n ...(line.charge > 0 ? { charge: line.charge } : {}),\n ...(line.serviceDate ? { serviceDate: line.serviceDate } : {}),\n ...(line.serviceDateEnd ? { serviceDateEnd: line.serviceDateEnd } : {}),\n ...(line.diagnosisPointers?.length ? { diagnosisPointers: line.diagnosisPointers } : {}),\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: ensureTrailingProcedureLine(data.bill.lineItems) }, 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 normalizeLineItems(): void { if (this.draft) this.draft.bill.lineItems = ensureTrailingProcedureLine(this.draft.bill.lineItems); }\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":";;;;;;;;MAea,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;AACzC,IAAA,WAAW;AACX,IAAA,aAAa;IACb,YAAY,GAA0C,IAAI;IAElE,OAAO,CACL,OAAmC,EACnC,eAAe,GAAG,MAAM,EACxB,WAAoC,EACpC,aAAiE,EAAA;QAEjE,IAAI,CAAC,UAAU,EAAE;QACjB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;AACrC,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW;AAC9B,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,yBAAyB,CAAC,OAAO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;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkIT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,y7LAAA,CAAA,EAAA;;sBAMA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;AC9NH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mindbill-angular.mjs","sources":["../../src/lib/lifecycle-store.ts","../../src/lib/procedure-lines.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 BrowserBillCreateInput,\n type BillReviewDocumentType,\n type BillReviewSaveInput,\n type CloseBillInput,\n type PostBillPaymentInput,\n type SubmitBillInput,\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 createInput: BrowserBillCreateInput | undefined;\n private onBillCreated: ((billId: string, data: BillLifecycleData) => void) | undefined;\n private refreshTimer: ReturnType<typeof setInterval> | null = null;\n\n connect(\n options: BillLifecycleClientOptions,\n refreshInterval = 60_000,\n createInput?: BrowserBillCreateInput,\n onBillCreated?: (billId: string, data: BillLifecycleData) => void,\n ): void {\n this.disconnect();\n this.billId.set(options.billId ?? \"\");\n this.createInput = createInput;\n this.onBillCreated = onBillCreated;\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 this.createInput = undefined;\n this.onBillCreated = undefined;\n }\n\n async refresh(): Promise<BillLifecycleData | null> {\n if (!this.client) return null;\n this.loading.set(this.data() === null);\n try {\n let data: BillLifecycleData;\n if (!this.client.getBillId()) {\n if (!this.createInput) {\n throw new Error(\"Pass billId to open a bill or create to start a new one.\");\n }\n const created = await this.client.createBill(this.createInput);\n const isNew = !this.billId();\n this.billId.set(created.billId);\n if (isNew) this.onBillCreated?.(created.billId, created.data);\n data = created.data;\n } else {\n data = await this.client.getLifecycle();\n }\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 getDeliveryOptions() { return this.requireClient().getDeliveryOptions(); }\n saveReview(input: BillReviewSaveInput) { return this.mutate(() => this.requireClient().saveReview(input)); }\n submitBill(input: BillReviewSaveInput, submission: SubmitBillInput) { return this.mutate(() => this.requireClient().submitBill(input, submission)); }\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","export type ProcedureLine = {\n id?: string;\n code: string;\n modifiers: string[];\n units: number;\n charge: number;\n feeSchedule?: number;\n serviceDate?: string | null;\n serviceDateEnd?: string | null;\n diagnosisPointers?: number[];\n};\n\nconst EMPTY_PROCEDURE_LINE: ProcedureLine = {\n code: \"\",\n modifiers: [],\n units: 1,\n charge: 0,\n};\n\nexport function isEmptyProcedureLine(line: ProcedureLine): boolean {\n return !line.code.trim()\n && line.modifiers.length === 0\n && line.units === 1\n && !line.serviceDate\n && !line.serviceDateEnd\n && !(line.diagnosisPointers?.length)\n && !line.charge;\n}\n\n/** Keeps completed/partial lines plus one keyboard-ready empty row. */\nexport function ensureTrailingProcedureLine(\n lines: readonly ProcedureLine[],\n): ProcedureLine[] {\n const entered = lines\n .filter((line) => !isEmptyProcedureLine(line))\n .map((line) => ({ ...line, modifiers: [...line.modifiers] }));\n\n return entered.length < 50\n ? [...entered, { ...EMPTY_PROCEDURE_LINE, modifiers: [] }]\n : entered;\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 BrowserBillCreateInput,\n BillReviewDocumentType,\n BillReviewBillingProvider,\n BillReviewClinician,\n BillReviewLocation,\n BillReviewPayer,\n BillReviewSaveInput,\n BillDeliveryOption,\n BillDeliveryOptions,\n SubmitBillInput,\n} from \"@mindbill/browser\";\nimport { MindBillLifecycleStore } from \"./lifecycle-store\";\nimport { ensureTrailingProcedureLine } from \"./procedure-lines\";\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: \"return_to_work_voucher\", label: \"Return-to-work voucher\" },\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 <section class=\"card progress\" aria-label=\"Bill lifecycle\">\n <div class=\"card-title\"><div><h3>Bill status</h3><p>{{ lifecycleDetail(data) }}</p></div><span>{{ stateLabel(data) }}</span></div>\n <ol>@for (stage of lifecycleStages; track stage.id; let i=$index) { <li [class.complete]=\"i < currentStageIndex(data)\" [class.current]=\"i === currentStageIndex(data)\" [attr.aria-current]=\"i === currentStageIndex(data) ? 'step' : null\"><b>{{ i < currentStageIndex(data) ? '✓' : i + 1 }}</b><span>{{ stage.label }}</span></li> }</ol>\n </section>\n\n <section class=\"card snapshot\" aria-label=\"Bill snapshot\">\n <div class=\"card-title\"><div><h3>Bill snapshot</h3><p>The claim and financial values currently recorded on this bill.</p></div></div>\n <dl><div><dt>Patient</dt><dd>{{ data.patient.name }}</dd></div><div><dt>Claim</dt><dd>{{ data.injury.claimNumber || '—' }}</dd></div><div><dt>Payer</dt><dd>{{ data.delivery.payerName || data.injury.claimsAdminName || '—' }}</dd></div><div><dt>Date of service</dt><dd>{{ data.bill.dos || '—' }}</dd></div><div><dt>Charged</dt><dd>{{ data.bill.totalCharge | currency }}</dd></div><div><dt>Balance</dt><dd>{{ data.bill.balanceDue | currency }}</dd></div></dl>\n </section>\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>{{ draft.bill.billingMode === 'professional' ? 'Enter each treatment or professional service.' : 'Choose medical-legal codes, modifiers, units, and allowed amounts.' }} A keyboard-ready row appears automatically.</p></div></div>\n @if (draft.bill.billingMode === 'med_legal') {\n <div class=\"presets\"><button type=\"button\" (click)=\"applyPreset('qme')\">QME</button><button type=\"button\" (click)=\"applyPreset('ame')\">AME</button><button type=\"button\" (click)=\"applyPreset('psych')\">Psych QME</button></div>\n }\n <div class=\"lines\">@for (line of draft.bill.lineItems; track $index; let i=$index) {\n <div class=\"line\" [class.professional]=\"draft.bill.billingMode === 'professional'\">\n <label><span>Procedure</span>\n @if (draft.bill.billingMode === 'med_legal') {\n <select [(ngModel)]=\"line.code\" [name]=\"'code'+i\" (ngModelChange)=\"lineChanged()\"><option value=\"\">Choose code…</option>@for (code of medLegalCodes; track code) { <option [value]=\"code\">{{ code }}</option> }</select>\n } @else { <input [(ngModel)]=\"line.code\" [name]=\"'code'+i\" (ngModelChange)=\"lineChanged()\" placeholder=\"e.g. 99204\"> }\n </label>\n <label><span>Modifiers</span><input [ngModel]=\"line.modifiers.join(', ')\" (ngModelChange)=\"setModifiers(line,$any($event))\" [name]=\"'modifiers'+i\" placeholder=\"e.g. 25, 95\"></label>\n @if (draft.bill.billingMode === 'professional') {\n <label><span>Service date</span><input type=\"date\" [(ngModel)]=\"line.serviceDate\" [name]=\"'serviceDate'+i\" (ngModelChange)=\"lineChanged()\"></label>\n <label><span>End date</span><input type=\"date\" [(ngModel)]=\"line.serviceDateEnd\" [name]=\"'serviceDateEnd'+i\" (ngModelChange)=\"lineChanged()\"></label>\n <label><span>Charge</span><input type=\"number\" min=\"0\" step=\"0.01\" [(ngModel)]=\"line.charge\" [name]=\"'charge'+i\" (ngModelChange)=\"lineChanged()\"></label>\n <label><span>Diagnosis pointers</span><input [ngModel]=\"(line.diagnosisPointers || []).join(', ')\" (ngModelChange)=\"setDiagnosisPointers(line,$any($event))\" [name]=\"'pointers'+i\" placeholder=\"1, 2\"></label>\n }\n <label><span>Units</span><input type=\"number\" min=\"1\" [(ngModel)]=\"line.units\" [name]=\"'units'+i\" (ngModelChange)=\"lineChanged()\"></label>\n <div class=\"allowed\"><span>{{ draft.bill.billingMode === 'professional' ? 'Charge' : 'Allowed' }}</span><strong>{{ line.charge | currency }}</strong></div>\n <button type=\"button\" class=\"remove\" (click)=\"removeLine(i)\" aria-label=\"Remove line\">×</button>\n </div>\n }</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>Review the exact electronic, fax, email, or mail destination before anything is sent.</p></div><div class=\"actions\"><button type=\"button\" (click)=\"save()\" [disabled]=\"store.mutating()\">Save changes</button><button class=\"primary\" type=\"button\" (click)=\"openSubmit()\" [disabled]=\"store.mutating() || deliveryBusy || !canSubmit()\">{{ deliveryBusy ? 'Loading routes…' : 'Review delivery' }}</button></div></section>\n\n @if (showSubmit && deliveryOptions) {\n <div class=\"modal-backdrop\" (click)=\"closeSubmit()\">\n <section class=\"submit-modal\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"mb-submit-title\" (click)=\"$event.stopPropagation()\">\n <header><div><span class=\"eyebrow\">Send bill</span><h3 id=\"mb-submit-title\">Choose a delivery route</h3><p>{{ deliveryOptions.payerName }}</p></div><button type=\"button\" class=\"close\" (click)=\"closeSubmit()\" aria-label=\"Close\">×</button></header>\n <div class=\"route-list\">@for (option of deliveryOptions.options; track option.route) {\n <button type=\"button\" class=\"route-option\" [class.selected]=\"submission.route === option.route\" (click)=\"chooseDelivery(option)\"><span class=\"radio\"></span><span><strong>{{ option.label }}</strong><small>{{ option.detail }}</small></span>@if (option.route === deliveryOptions.recommended.route) { <b>Recommended</b> }</button>\n }</div>\n @if (selectedDelivery(); as option) {\n @if (option.route === 'fax') { <label><span>Fax number</span><input [ngModel]=\"submission.destination?.faxNumber || ''\" (ngModelChange)=\"setDestination('faxNumber',$any($event))\" name=\"submitFax\"></label> }\n @if (option.route === 'email') { <label><span>Email address</span><input type=\"email\" [ngModel]=\"submission.destination?.email || ''\" (ngModelChange)=\"setDestination('email',$any($event))\" name=\"submitEmail\"></label><label><span>Subject</span><input [(ngModel)]=\"submission.subject\" name=\"submitSubject\"></label> }\n @if (option.route === 'mail') { <label><span>Mailing address</span><textarea [ngModel]=\"submission.destination?.mailingAddress || ''\" (ngModelChange)=\"setDestination('mailingAddress',$any($event))\" name=\"submitMail\"></textarea></label> }\n @if (option.route !== 'ebill') { <label><span>Attention (optional)</span><input [(ngModel)]=\"submission.attention\" name=\"submitAttention\"></label> }\n }\n <footer><button type=\"button\" (click)=\"closeSubmit()\">Cancel</button><button type=\"button\" class=\"primary\" (click)=\"submit()\" [disabled]=\"store.mutating() || !deliveryReady()\">{{ store.mutating() ? 'Submitting…' : 'Submit bill' }}</button></footer>\n </section>\n </div>\n }\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 <div class=\"lifecycle-grid\">\n <section><h4>Remittance</h4><dl class=\"facts\"><div><dt>Payer reported</dt><dd>{{ data.remittance.payerReportedPaid == null ? '—' : (data.remittance.payerReportedPaid | currency) }}</dd></div><div><dt>Posted</dt><dd>{{ data.remittance.totalPaid | currency }}</dd></div><div><dt>Balance</dt><dd>{{ data.remittance.balanceDue | currency }}</dd></div></dl>@if (data.remittance.denialReason) { <div class=\"denial\"><strong>Denial reason</strong><p>{{ data.remittance.denialReason }}</p></div> }</section>\n <section><h4>{{ data.delivery.payerName || 'Claims administrator' }}</h4><dl class=\"contacts\">@if (data.delivery.contacts.adjusterName) { <div><dt>Adjuster</dt><dd>{{ data.delivery.contacts.adjusterName }}</dd></div> }@if (data.delivery.contacts.adjusterPhone) { <div><dt>Phone</dt><dd><a [href]=\"'tel:'+data.delivery.contacts.adjusterPhone\">{{ data.delivery.contacts.adjusterPhone }}</a></dd></div> }@if (data.delivery.contacts.adjusterEmail) { <div><dt>Adjuster email</dt><dd><a [href]=\"'mailto:'+data.delivery.contacts.adjusterEmail\">{{ data.delivery.contacts.adjusterEmail }}</a></dd></div> }@if (data.delivery.contacts.faxNumber) { <div><dt>Fax</dt><dd><a [href]=\"'tel:'+data.delivery.contacts.faxNumber\">{{ data.delivery.contacts.faxNumber }}</a></dd></div> }@if (data.delivery.contacts.claimsEmail) { <div><dt>Claims email</dt><dd><a [href]=\"'mailto:'+data.delivery.contacts.claimsEmail\">{{ data.delivery.contacts.claimsEmail }}</a></dd></div> }@if (data.delivery.contacts.mailingAddress) { <div><dt>Mail</dt><dd>{{ data.delivery.contacts.mailingAddress }}</dd></div> }@if (data.delivery.contacts.portalUrl) { <div><dt>Portal</dt><dd><a [href]=\"data.delivery.contacts.portalUrl\" target=\"_blank\" rel=\"noopener\">Open payer portal</a></dd></div> }</dl></section>\n </div>\n @if (data.eors.length) { <div class=\"eors\"><h4>Explanation of Review</h4><p>Payer response details and the original returned document.</p>@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 original PDF</b></button> }</div> }\n <section class=\"payments\"><h4>Payments</h4>@if (!data.payments.length) { <p>No payments posted.</p> } @else { @for (paymentItem of data.payments; track paymentItem.id) { <article><div><strong>{{ paymentItem.amount | currency }}</strong><span>{{ paymentItem.method | uppercase }} · {{ paymentItem.status }}</span></div><div><span>{{ paymentItem.checkNumber ? '#'+paymentItem.checkNumber : paymentItem.source }}</span><span>{{ paymentItem.depositDate || (paymentItem.postedAt | date:'mediumDate') }}</span></div>@if (paymentItem.note) { <p>{{ paymentItem.note }}</p> }</article> } }</section>\n <section class=\"history\"><h4>Bill history</h4>@if (!data.activity.length) { <p>No bill activity yet.</p> } @else { <ol>@for (event of data.activity; track event.id) { <li><span></span><div><strong>{{ activityLabel(event.type) }}</strong><small>{{ event.createdAt | date:'medium' }}{{ event.actor ? ' · '+event.actor : '' }}</small>@if (event.description) { <p>{{ event.description }}</p> }</div></li> }</ol> }</section>\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 </section>\n @if (panel) {\n <div class=\"modal-backdrop\" (click)=\"panel=''\">\n <section class=\"submit-modal action-modal\" role=\"dialog\" aria-modal=\"true\" (click)=\"$event.stopPropagation()\">\n <header><div><span class=\"eyebrow\">Bill {{ data.bill.billNumber }}</span><h3>{{ actionTitle() }}</h3></div><button class=\"close\" type=\"button\" (click)=\"panel=''\" aria-label=\"Close\">×</button></header>\n @if (panel === 'payment') { <p>Record funds received for this bill. This updates the payment ledger and remaining balance.</p><div class=\"grid two\"><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>Check / EFT number</span><input [(ngModel)]=\"payment.checkNumber\"></label><label><span>Deposit date</span><input type=\"date\" [(ngModel)]=\"payment.depositDate\"></label></div><label><span>Note (optional)</span><input [(ngModel)]=\"payment.note\"></label> }\n @if (panel === 'review') { <p>Explain the dispute and choose the exact payer documents to include with the Second Review.</p><label><span>Reason for Second Review</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><fieldset class=\"review-docs\"><legend>Supporting documents</legend>@for (doc of data.bill.attachments; track doc.id) { <label><input type=\"checkbox\" [checked]=\"reviewAttachmentIds.includes(doc.id)\" (change)=\"toggleReviewAttachment(doc.id)\"><span><strong>{{ doc.filename }}</strong><small>{{ doc.description || doc.documentType }}</small></span></label> }</fieldset><div class=\"upload\"><select [(ngModel)]=\"documentType\">@for (type of documentTypes; track type.value) { <option [value]=\"type.value\">{{ type.label }}</option> }</select><input type=\"file\" accept=\"application/pdf\" (change)=\"fileSelected($event)\"><button type=\"button\" [disabled]=\"!pendingFile || store.mutating()\" (click)=\"attachForReview()\">Add document</button></div> }\n @if (panel === 'correction') { <p>Create a replacement bill prefilled from this rejected submission. You can correct the payer, claim, provider, service lines, and packet before resubmitting.</p> }\n @if (panel === 'close') { <p>Closing stops active follow-up. The bill history and documents remain available.</p><label><span>Reason</span><textarea [(ngModel)]=\"closeReason\"></textarea></label> }\n <footer><button type=\"button\" (click)=\"panel=''\">Cancel</button>@if (panel === 'payment') { <button class=\"primary\" type=\"button\" (click)=\"postPayment()\" [disabled]=\"store.mutating() || payment.amount <= 0\">Post payment</button> }@if (panel === 'review') { <button class=\"primary\" type=\"button\" (click)=\"submitReview()\" [disabled]=\"store.mutating() || !review.reason.trim() || !review.payerClaimControlNumber.trim()\">Submit Second Review</button> }@if (panel === 'correction') { <button class=\"primary\" type=\"button\" (click)=\"correct()\" [disabled]=\"store.mutating()\">Create correction</button> }@if (panel === 'close') { <button class=\"danger\" type=\"button\" (click)=\"closeBill()\" [disabled]=\"store.mutating() || !closeReason.trim()\">Close bill</button> }</footer>\n </section>\n </div>\n }\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}a{color:var(--a)}.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}.presets{display:flex;gap:8px;margin:-4px 0 12px}.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}.line.professional{grid-template-columns:1.1fr 1fr 1fr 1fr 110px 1fr 90px 110px 40px}.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)}.actions,.actionbar{display:flex;justify-content:flex-end;gap:8px}.progress ol{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));list-style:none;margin:0;padding:0}.progress li{position:relative;display:grid;justify-items:center;gap:7px;color:var(--m);font-size:12px;text-align:center}.progress li:before{content:\"\";position:absolute;top:14px;right:50%;left:-50%;height:2px;background:var(--b)}.progress li:first-child:before{display:none}.progress li b{position:relative;z-index:1;display:grid;place-items:center;width:28px;height:28px;border:2px solid var(--b);border-radius:50%;background:var(--s)}.progress li.complete,.progress li.current{color:var(--t)}.progress li.complete:before,.progress li.current:before{background:var(--a)}.progress li.complete b,.progress li.current b{border-color:var(--a);background:var(--a);color:var(--ac)}.snapshot dl,.facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0}.snapshot dl>div,.facts>div{display:grid;gap:3px;border-right:1px solid var(--b);padding:4px 14px}.snapshot dl>div:nth-child(3n),.facts>div:last-child{border-right:0}.snapshot dt,.facts dt,.contacts dt{color:var(--m);font-size:11px;font-weight:800;text-transform:uppercase}.snapshot dd,.facts dd,.contacts dd{margin:0;font-weight:700}.lifecycle{display:grid;gap:20px}.actionbar{flex-wrap:wrap;border-top:1px solid var(--b);padding-top:18px}.lifecycle-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.lifecycle-grid>section,.payments,.history,.eors{display:grid;gap:11px;border:1px solid var(--b);border-radius:var(--cr);padding:15px}.contacts{display:grid;gap:9px;margin:0}.contacts>div{display:grid;grid-template-columns:70px 1fr;gap:10px}.denial{border-radius:var(--cr);background:#fff4ed;padding:11px}.eors>button{display:flex;align-items:center;justify-content:space-between;text-align:left}.eors span{display:grid}.payments article{display:grid;grid-template-columns:1fr auto;gap:4px;border-top:1px solid var(--b);padding-top:10px}.payments article>div{display:grid}.payments article>div:last-of-type{text-align:right}.payments article p{grid-column:1/-1}.history ol{display:grid;gap:0;list-style:none;margin:0;padding:0}.history li{display:grid;grid-template-columns:18px 1fr;gap:9px}.history li>span{position:relative;margin-top:5px;width:10px;height:10px;border-radius:50%;background:var(--a)}.history li>span:after{content:\"\";position:absolute;top:10px;bottom:-30px;left:4px;width:2px;background:var(--b)}.history li:last-child>span:after{display:none}.history li>div{display:grid;gap:2px;padding-bottom:15px}.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}.modal-backdrop{position:fixed;z-index:1000;inset:0;display:grid;place-items:center;background:rgba(15,32,40,.56);padding:20px}.submit-modal{display:grid;gap:18px;width:min(680px,100%);max-height:calc(100vh - 40px);overflow:auto;border:1px solid var(--b);border-radius:var(--r);background:var(--s);padding:22px;box-shadow:0 24px 80px rgba(15,32,40,.28)}.submit-modal>header,.submit-modal>footer{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.submit-modal>footer{justify-content:flex-end}.submit-modal .close{border:0;background:transparent;font-size:26px}.route-list{display:grid;gap:8px}.route-option{display:grid;grid-template-columns:20px 1fr auto;align-items:center;gap:12px;text-align:left;padding:13px}.route-option>span:nth-child(2){display:grid}.route-option.selected{border-color:var(--a);box-shadow:0 0 0 2px color-mix(in srgb,var(--a) 18%,transparent)}.route-option .radio{width:16px;height:16px;border:2px solid var(--b);border-radius:50%}.route-option.selected .radio{border:5px solid var(--a)}.route-option b{color:var(--a);font-size:11px;text-transform:uppercase}.action-modal{width:min(720px,100%)}.review-docs{display:grid;gap:8px;border:1px solid var(--b);border-radius:var(--cr);padding:12px}.review-docs label{display:grid;grid-template-columns:20px 1fr;align-items:start}.review-docs input{min-height:auto}.review-docs label>span{display:grid}@media(max-width:1100px){.line.professional{grid-template-columns:repeat(3,minmax(0,1fr))}.line.professional .allowed{grid-column:auto}}@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}.actions{justify-content:flex-start}.lifecycle-grid{grid-template-columns:1fr}}@media(max-width:600px){.summary,.card-title{align-items:stretch;flex-direction:column}.money{text-align:left}.grid.four,.grid.three,.grid.two,.line,.line.professional{grid-template-columns:1fr}.allowed{grid-column:auto}.docs li{align-items:flex-start;flex-wrap:wrap}.progress{overflow-x:auto}.progress ol{min-width:560px}.snapshot dl,.facts{grid-template-columns:1fr}.snapshot dl>div,.facts>div{border-right:0;border-bottom:1px solid var(--b);padding:10px 0}.snapshot dl>div:last-child,.facts>div:last-child{border-bottom:0}.modal-backdrop{align-items:end;padding:0}.submit-modal{max-height:92vh;border-radius:var(--r) var(--r) 0 0;padding:16px}.route-option{grid-template-columns:20px 1fr}.route-option b{grid-column:2}}\n `],\n})\nexport class MindBillBillLifecycleComponent implements OnChanges, OnDestroy {\n @Input() billId = \"\";\n @Input() create?: BrowserBillCreateInput;\n @Input() sessionEndpoint = \"/api/mindbill/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() billCreated = new EventEmitter<{ billId: string; data: BillLifecycleData }>();\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 medLegalCodes = [\"ML200\", \"ML201\", \"ML202\", \"ML203\", \"ML204\", \"ML205\", \"ML206\", \"MLPRR\"];\n readonly lifecycleStages = [\n { id: \"created\", label: \"Created\" },\n { id: \"submitted\", label: \"Submitted\" },\n { id: \"accepted\", label: \"Accepted\" },\n { id: \"response\", label: \"Payer response\" },\n { id: \"follow_up\", label: \"Follow-up\" },\n { id: \"closed\", label: \"Closed\" },\n ];\n draft: BillDraft | null = null;\n dirty = false;\n payerQuery = \"\";\n payerResults: BillReviewPayer[] = [];\n documentType: BillReviewDocumentType = \"other\";\n pendingFile: File | null = null;\n deliveryOptions: BillDeliveryOptions | null = null;\n submission: SubmitBillInput = { route: \"ebill\" };\n showSubmit = false;\n deliveryBusy = false;\n panel = \"\";\n notice = \"\";\n closeReason = \"\";\n payment = { amount: 0, method: \"check\" as \"check\" | \"eft\", checkNumber: \"\", depositDate: new Date().toISOString().slice(0, 10), note: \"\" };\n review = { reason: \"\", payerClaimControlNumber: \"\", disputedAmount: 0 };\n reviewAttachmentIds: string[] = [];\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[\"create\"] || changes[\"sessionEndpoint\"] || changes[\"apiBaseUrl\"] || changes[\"getSession\"]) {\n if (!this.billId && !this.create) {\n this.store.disconnect();\n return;\n }\n this.store.connect(\n {\n ...(this.billId ? { billId: this.billId } : {}),\n sessionEndpoint: this.sessionEndpoint,\n apiBaseUrl: this.apiBaseUrl,\n ...(this.getSession ? { getSession: this.getSession } : {}),\n },\n this.refreshInterval,\n this.create,\n (billId, data) => {\n this.billIdChange.emit(billId);\n this.billCreated.emit({ billId, data });\n },\n );\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 currentStageIndex(data: BillLifecycleData): number {\n const value = data.lifecycle.state.toLowerCase();\n if (value.includes(\"closed\") || value.includes(\"written_off\")) return 5;\n if (value.includes(\"second_review\") || value.includes(\"ibr\") || value.includes(\"lien\") || value.includes(\"appeal\")) return 4;\n if (value.includes(\"processed\") || value.includes(\"paid\") || value.includes(\"denied\") || value.includes(\"rejected\") || value.includes(\"response\")) return 3;\n if (value.includes(\"accepted\")) return 2;\n if (value.includes(\"submitted\") || value.includes(\"queued\") || value.includes(\"sent\")) return 1;\n return 0;\n }\n activityLabel(type: string): string {\n const labels: Record<string, string> = { \"bill.created\": \"Bill created\", \"bill.submitted\": \"Bill submitted\", \"bill.accepted\": \"Bill accepted\", \"bill.rejected\": \"Bill rejected\", \"bill.denied\": \"Bill denied\", \"bill.partially_paid\": \"Partial payment received\", \"bill.paid\": \"Bill paid\", \"bill.second_review\": \"Second Bill Review submitted\", \"bill.ibr\": \"Independent Bill Review submitted\", \"bill.lien\": \"Bill moved to lien\", \"bill.closed\": \"Bill closed\", \"payment.posted\": \"Payment posted\", \"eor.received\": \"EOR received\" };\n return labels[type] ?? type.replace(/[._-]+/g, \" \").replace(/\\b\\w/g, (value) => value.toUpperCase());\n }\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 lineChanged(): void { this.normalizeLineItems(); this.dirty = true; }\n removeLine(index: number): void { this.draft?.bill.lineItems.splice(index, 1); this.normalizeLineItems(); this.dirty = true; }\n setModifiers(line: { modifiers: string[] }, value: string): void { line.modifiers = value.split(\",\").map((item) => item.trim().replace(/^-/, \"\")).filter(Boolean); this.normalizeLineItems(); this.dirty = true; }\n setDiagnosisPointers(line: { diagnosisPointers?: number[] }, value: string): void { line.diagnosisPointers = value.split(\",\").map((item) => Number(item.trim())).filter((item) => Number.isInteger(item) && item >= 1 && item <= 12); this.normalizeLineItems(); this.dirty = true; }\n applyPreset(kind: \"qme\" | \"ame\" | \"psych\"): void {\n if (!this.draft) return;\n const modifier = kind === \"ame\" ? \"94\" : kind === \"psych\" ? \"96\" : \"95\";\n const entered = this.draft.bill.lineItems.filter((line) => line.code.trim());\n if (entered.length === 0) entered.push({ code: \"ML201\", modifiers: [modifier], units: 1, charge: 0 });\n else entered.forEach((line) => { if (!line.modifiers.length) line.modifiers = [modifier]; });\n this.draft.bill.lineItems = ensureTrailingProcedureLine(entered);\n this.dirty = true;\n }\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 {\n const input = this.buildInput();\n if (!input || !input.claimsAdminId || !input.billingProvider?.name || !input.billingProvider.taxId || !input.billingProvider.npi || !input.renderingProvider?.name || !input.renderingProvider.npi || !input.lineItems.length) return false;\n return input.lineItems.every((line) => line.code && line.units > 0 && (this.draft?.bill.billingMode !== \"professional\" || Boolean(line.serviceDate && line.charge && line.charge > 0)));\n }\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 openSubmit(): Promise<void> {\n if (!this.canSubmit()) return;\n this.deliveryBusy = true;\n try {\n this.deliveryOptions = await this.store.getDeliveryOptions();\n this.chooseDelivery(this.deliveryOptions.recommended);\n this.showSubmit = true;\n } finally { this.deliveryBusy = false; }\n }\n closeSubmit(): void { this.showSubmit = false; }\n selectedDelivery(): BillDeliveryOption | undefined { return this.deliveryOptions?.options.find((option) => option.route === this.submission.route); }\n chooseDelivery(option: BillDeliveryOption): void {\n const destination = option.route === \"fax\" ? { faxNumber: option.target ?? this.deliveryOptions?.contacts.faxNumber ?? \"\" }\n : option.route === \"email\" ? { email: option.target ?? this.deliveryOptions?.contacts.claimsEmail ?? \"\" }\n : option.route === \"mail\" ? { mailingAddress: option.target ?? this.deliveryOptions?.contacts.mailingAddress ?? \"\" }\n : undefined;\n this.submission = { route: option.route, ...(destination ? { destination } : {}) };\n }\n setDestination(key: \"faxNumber\" | \"email\" | \"mailingAddress\", value: string): void { this.submission = { ...this.submission, destination: { ...this.submission.destination, [key]: value } }; }\n deliveryReady(): boolean {\n if (this.submission.route === \"fax\") return Boolean(this.submission.destination?.faxNumber?.trim());\n if (this.submission.route === \"email\") return Boolean(this.submission.destination?.email?.trim());\n if (this.submission.route === \"mail\") return Boolean(this.submission.destination?.mailingAddress?.trim());\n return true;\n }\n async submit(): Promise<void> { const input = this.buildInput(); if (!input || !this.canSubmit() || !this.deliveryReady()) return; const data = await this.store.submitBill(input, this.submission); this.showSubmit = false; this.dirty = false; this.draft = this.makeDraft(data); this.notice = \"Bill submitted.\"; this.submitted.emit(data); }\n beginAction(action: string): void {\n const data = this.store.data();\n if (action === \"post_payment\") this.panel = \"payment\";\n else if (action === \"second_review\" || action === \"independent_bill_review\") { this.reviewAttachmentIds = data?.bill.attachments.map((doc) => doc.id) ?? []; this.panel = \"review\"; }\n else if (action === \"close\") this.panel = \"close\";\n else if (action === \"view_eor\" && data?.eors[0]) { const eor = data.eors[0]; void this.openEor(eor.id, eor.filename); }\n else if (action === \"correct_and_resubmit\") this.panel = \"correction\";\n }\n actionTitle(): string { return this.panel === \"payment\" ? \"Post payment\" : this.panel === \"review\" ? \"Submit Second Review\" : this.panel === \"correction\" ? \"Correct and resubmit\" : \"Close bill\"; }\n toggleReviewAttachment(id: string): void { this.reviewAttachmentIds = this.reviewAttachmentIds.includes(id) ? this.reviewAttachmentIds.filter((item) => item !== id) : [...this.reviewAttachmentIds, id]; }\n async attachForReview(): Promise<void> { if (!this.pendingFile) return; const filename = this.pendingFile.name; await this.attach(); const attachment = this.store.data()?.bill.attachments.find((doc) => doc.filename === filename); if (attachment && !this.reviewAttachmentIds.includes(attachment.id)) this.reviewAttachmentIds = [...this.reviewAttachmentIds, attachment.id]; }\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.panel = \"\"; this.notice = \"Correction ready for review.\"; }\n async postPayment(): Promise<void> {\n await this.store.postPayment({\n amount: this.payment.amount,\n method: this.payment.method,\n depositDate: this.payment.depositDate,\n ...(this.payment.checkNumber ? { checkNumber: this.payment.checkNumber } : {}),\n ...(this.payment.note ? { note: this.payment.note } : {}),\n });\n this.panel = \"\";\n this.notice = \"Payment posted.\";\n }\n async submitReview(): Promise<void> {\n await this.store.submitSecondReview({\n reason: this.review.reason,\n payerClaimControlNumber: this.review.payerClaimControlNumber,\n disputedAmount: this.review.disputedAmount > 0 ? this.review.disputedAmount : undefined,\n route: \"ebill\",\n attachmentIds: this.reviewAttachmentIds,\n });\n this.panel = \"\";\n this.notice = \"Second Review submitted.\";\n }\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.filter((line) => line.code.trim()).map((line) => ({\n ...(line.id ? { id: line.id } : {}),\n code: line.code,\n modifiers: line.modifiers,\n units: line.units,\n ...(line.charge > 0 ? { charge: line.charge } : {}),\n ...(line.serviceDate ? { serviceDate: line.serviceDate } : {}),\n ...(line.serviceDateEnd ? { serviceDateEnd: line.serviceDateEnd } : {}),\n ...(line.diagnosisPointers?.length ? { diagnosisPointers: line.diagnosisPointers } : {}),\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: ensureTrailingProcedureLine(data.bill.lineItems) }, 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 normalizeLineItems(): void { if (this.draft) this.draft.bill.lineItems = ensureTrailingProcedureLine(this.draft.bill.lineItems); }\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":";;;;;;;;MAea,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;AACzC,IAAA,WAAW;AACX,IAAA,aAAa;IACb,YAAY,GAA0C,IAAI;IAElE,OAAO,CACL,OAAmC,EACnC,eAAe,GAAG,MAAM,EACxB,WAAoC,EACpC,aAAiE,EAAA;QAEjE,IAAI,CAAC,UAAU,EAAE;QACjB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;AACrC,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW;AAC9B,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC;AAChD,QAAA,KAAK,IAAI,CAAC,OAAO,EAAE;AACnB,QAAA,IAAI,eAAe,GAAG,CAAC,EAAE;AACvB,Y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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2JT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,0uRAAA,CAAA,EAAA;;sBAMA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;ACvPH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindbill/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Native Angular components for the complete MindBill bill lifecycle",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"rxjs": ">=7.8 <9"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@mindbill/browser": "^0.
|
|
13
|
+
"@mindbill/browser": "^0.4.0",
|
|
14
14
|
"tslib": "^2.8.1"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
@@ -79,6 +79,10 @@ declare class MindBillBillLifecycleComponent implements OnChanges, OnDestroy {
|
|
|
79
79
|
label: string;
|
|
80
80
|
}[];
|
|
81
81
|
readonly medLegalCodes: string[];
|
|
82
|
+
readonly lifecycleStages: {
|
|
83
|
+
id: string;
|
|
84
|
+
label: string;
|
|
85
|
+
}[];
|
|
82
86
|
draft: BillDraft | null;
|
|
83
87
|
dirty: boolean;
|
|
84
88
|
payerQuery: string;
|
|
@@ -95,13 +99,16 @@ declare class MindBillBillLifecycleComponent implements OnChanges, OnDestroy {
|
|
|
95
99
|
payment: {
|
|
96
100
|
amount: number;
|
|
97
101
|
method: "check" | "eft";
|
|
102
|
+
checkNumber: string;
|
|
98
103
|
depositDate: string;
|
|
104
|
+
note: string;
|
|
99
105
|
};
|
|
100
106
|
review: {
|
|
101
107
|
reason: string;
|
|
102
108
|
payerClaimControlNumber: string;
|
|
103
109
|
disputedAmount: number;
|
|
104
110
|
};
|
|
111
|
+
reviewAttachmentIds: string[];
|
|
105
112
|
private payerTimer;
|
|
106
113
|
constructor();
|
|
107
114
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -109,6 +116,8 @@ declare class MindBillBillLifecycleComponent implements OnChanges, OnDestroy {
|
|
|
109
116
|
get themeStyle(): Record<string, string>;
|
|
110
117
|
stateLabel(data: BillLifecycleData): any;
|
|
111
118
|
lifecycleDetail(data: BillLifecycleData): string;
|
|
119
|
+
currentStageIndex(data: BillLifecycleData): number;
|
|
120
|
+
activityLabel(type: string): string;
|
|
112
121
|
isEditable(data: BillLifecycleData): any;
|
|
113
122
|
payerExplanation(payer: BillReviewPayer): any;
|
|
114
123
|
queuePayerSearch(): void;
|
|
@@ -139,6 +148,9 @@ declare class MindBillBillLifecycleComponent implements OnChanges, OnDestroy {
|
|
|
139
148
|
deliveryReady(): boolean;
|
|
140
149
|
submit(): Promise<void>;
|
|
141
150
|
beginAction(action: string): void;
|
|
151
|
+
actionTitle(): string;
|
|
152
|
+
toggleReviewAttachment(id: string): void;
|
|
153
|
+
attachForReview(): Promise<void>;
|
|
142
154
|
correct(): Promise<void>;
|
|
143
155
|
postPayment(): Promise<void>;
|
|
144
156
|
submitReview(): Promise<void>;
|