@mindbill/angular 0.4.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,35 +1,61 @@
1
1
  # @mindbill/angular
2
2
 
3
- Native Angular billing UI with built-in session renewal and lifecycle API calls.
3
+ Native Angular billing UI with built-in session renewal, bill lifecycle API calls, dashboards, aging, bill lists, and reporting. The components are standalone and do not bundle React.
4
4
 
5
5
  ```bash
6
6
  npm install @mindbill/angular @mindbill/node
7
7
  ```
8
8
 
9
- Import the standalone component and pass the ID returned by your server's atomic create-and-submit request.
9
+ Import the standalone components. The submission component owns the review form, reference-directory lookups, validation, PDF upload, and atomic submission; the host app only provides initial case data and a short-lived browser session.
10
10
 
11
11
  ```ts
12
12
  import { Component } from "@angular/core";
13
- import { MindBillBillLifecycleComponent } from "@mindbill/angular";
13
+ import {
14
+ MindBillBillLifecycleComponent,
15
+ MindBillBillSubmissionComponent,
16
+ MindBillBillingDashboardComponent,
17
+ MindBillBillingManagementButtonComponent,
18
+ MindBillBillingReportComponent,
19
+ } from "@mindbill/angular";
14
20
 
15
21
  @Component({
16
22
  selector: "app-case-billing",
17
23
  standalone: true,
18
- imports: [MindBillBillLifecycleComponent],
24
+ imports: [
25
+ MindBillBillLifecycleComponent,
26
+ MindBillBillSubmissionComponent,
27
+ MindBillBillingDashboardComponent,
28
+ MindBillBillingManagementButtonComponent,
29
+ MindBillBillingReportComponent,
30
+ ],
19
31
  template: `
32
+ @if (!billId) {
33
+ <mindbill-bill-submission
34
+ [initialBill]="initialBill"
35
+ [attachments]="attachments"
36
+ sessionEndpoint="/api/mindbill/session"
37
+ [appearance]="{ preset: 'clinical-blue' }"
38
+ (submitted)="billId = $event.bill.id"
39
+ />
40
+ } @else {
20
41
  <mindbill-bill-lifecycle
21
42
  [billId]="billId"
22
43
  sessionEndpoint="/api/mindbill/session"
23
44
  [appearance]="{ preset: 'clinical-blue' }"
24
45
  />
46
+ }
25
47
  `,
26
48
  })
27
49
  export class CaseBillingComponent {
28
- billId = "bill_123";
50
+ billId = "";
51
+ initialBill = caseToMindBillInput(this.case);
52
+ attachments = [{ file: this.finalReport, description: "Final report" }];
29
53
  }
30
54
  ```
31
55
 
32
- The component loads and refreshes submitted-bill status, shows EORs, and exposes the correct payment, review, and close actions for the current state. It never creates or edits a bill.
56
+ `MindBillBillSubmissionComponent` marks required fields, scrolls to invalid input, resolves ZIP codes, searches the MindBill claims-administrator and ICD-10 directories, calculates service-line totals, and uploads attachments. On success, render `MindBillBillLifecycleComponent` with the returned bill ID. The lifecycle component loads its own immutable bill snapshot, status, EORs, payments, history, and available actions.
57
+
58
+ The default reference directories and field rules live in the component library. Hosts can provide custom procedure, modifier, and taxonomy options without reimplementing the form. For a fixture or Storybook, pass an async `submitter`; omit it in production so the component talks directly to the Partner API.
33
59
 
34
60
  Add one authenticated server endpoint. It maps the signed-in user's role to permissions and mints a short-lived token bound to your organization, that user, and the browser origin.
35
61
 
@@ -50,3 +76,43 @@ app.post("/api/mindbill/session", requireUser, async (req, res) => {
50
76
  ```
51
77
 
52
78
  Your permanent API key never reaches Angular. Available presets are `mindbill`, `qme-companion`, `orange-bright`, and `clinical-blue`; every visual token can also be overridden.
79
+
80
+ ## Billing management SSO
81
+
82
+ Use the ready-made button wherever organization-level users should open the full MindBill workspace:
83
+
84
+ ```html
85
+ <mindbill-billing-management-button
86
+ sessionEndpoint="/api/mindbill/management-session"
87
+ [appearance]="{ preset: 'clinical-blue' }"
88
+ />
89
+ ```
90
+
91
+ The endpoint returns `{ "url": "https://app.mindbill.org/..." }` after authenticating the user and creating a short-lived management session. The component opens a blank tab synchronously, then navigates it after the request completes so Safari and other popup blockers do not discard the SSO window.
92
+
93
+ ## Operations components
94
+
95
+ The operations surfaces consume a normalized list of bills, so they can be used together or independently. The dashboard includes monthly submitted/closed metrics, clickable aging buckets, search, status filtering, and bill drill-down:
96
+
97
+ ```html
98
+ <mindbill-billing-dashboard
99
+ [bills]="bills"
100
+ [appearance]="appearance"
101
+ (billSelected)="openBill($event)"
102
+ />
103
+
104
+ <mindbill-bill-aging-summary
105
+ [buckets]="summary.aging"
106
+ [appearance]="appearance"
107
+ />
108
+
109
+ <mindbill-bill-list
110
+ [bills]="bills"
111
+ [appearance]="appearance"
112
+ (billSelected)="openBill($event)"
113
+ />
114
+
115
+ <mindbill-billing-report [bills]="bills" [appearance]="appearance" />
116
+ ```
117
+
118
+ `summarizeMindBillDashboard`, `buildMindBillReportRows`, and `buildMindBillReportCsv` are also exported for custom layouts and server-side reporting.