@mindbill/browser 0.48.0 → 0.50.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/dist/index.d.ts CHANGED
@@ -1,165 +1,3 @@
1
- type RfaLifecycleStatus = "incomplete" | "sent" | "failed" | "received" | "closed" | "canceled";
2
- declare const RFA_LIFECYCLE_LABELS: Readonly<Record<RfaLifecycleStatus, string>>;
3
- type LifecycleRecord = Pick<RfaRecord, "status"> & Partial<Pick<RfaRecord, "lifecycleStatus" | "submittedAt" | "receivedAt" | "transmissions">>;
4
- /** Prefer the API lifecycle. Older responses are derived from the current submission's evidence. */
5
- declare function getRfaLifecycleStatus(rfa: LifecycleRecord): RfaLifecycleStatus;
6
-
7
- /** One patient's complete services for one provider/group. Dates are service dates, not publication dates. */
8
- type CaClaimFeeQuoteInput = {
9
- lines: Array<Omit<BillFeeQuoteInput, "billingProviderId" | "payerId" | "physicianContext"> & {
10
- id: string;
11
- serviceCounty?: string;
12
- physicianContext?: Omit<NonNullable<BillFeeQuoteInput["physicianContext"]>, "providerKind"> & {
13
- providerKind: NonNullable<BillFeeQuoteInput["physicianContext"]>["providerKind"] | "clinical_social_worker";
14
- telehealthModality?: "audio_video" | "audio_only";
15
- cmsSpecialtyCode?: string;
16
- };
17
- }>;
18
- completeDateOfServiceContext: boolean;
19
- ordinaryMultipleSurgeryContext?: boolean;
20
- };
21
- type CaFeeCitation = {
22
- id: string;
23
- url: string;
24
- sha256?: string;
25
- effectiveFrom?: string;
26
- effectiveThrough?: string;
27
- };
28
- type CaFeeCalculation = {
29
- method: "rbrvs" | "therapy_mppr";
30
- locality: string;
31
- serviceZip?: string;
32
- serviceCounty?: string;
33
- setting: "facility" | "nonfacility";
34
- units: number;
35
- conversionFactor: string;
36
- providerPercent: number;
37
- baseMaximumCents?: number;
38
- cmsIndicators?: Record<string, string>;
39
- sourceFiles?: Array<{
40
- kind: string;
41
- filename: string;
42
- }>;
43
- components: Array<{
44
- name: string;
45
- rvu: string;
46
- gpci: string;
47
- payableUnits: number;
48
- }>;
49
- rounding: string;
50
- };
51
- type CaClaimEditFinding = {
52
- type: string;
53
- lineIds: string[];
54
- message: string;
55
- citationUrl: string;
56
- column1?: string;
57
- column2?: string;
58
- modifierIndicator?: number;
59
- code?: string;
60
- limit?: number;
61
- submittedUnits?: number;
62
- adjudicationIndicator?: number;
63
- scope?: "line" | "patient_provider_date";
64
- };
65
- type CaClaimFeeFinding = {
66
- code: string;
67
- lineIds: string[];
68
- message: string;
69
- citationUrl?: string;
70
- edit?: CaClaimEditFinding;
71
- };
72
- type CaClaimLineQuote = ({
73
- status: "priced";
74
- amountCents: number;
75
- scheduleMaximumCents: number;
76
- basis: BillFeeQuoteBasis | "ca_ambulance";
77
- notes: string[];
78
- feeBreakdown?: {
79
- method: string;
80
- inputs: Array<{
81
- label: string;
82
- value: string;
83
- }>;
84
- steps: Array<{
85
- label: string;
86
- value: string;
87
- }>;
88
- };
89
- } | {
90
- status: "requires_review" | "not_separately_payable";
91
- reason: string;
92
- }) & {
93
- provenance: CaFeeCitation[];
94
- calculation?: CaFeeCalculation;
95
- };
96
- type CaClaimFeeQuoteResult = {
97
- status: "priced" | "requires_review" | "not_separately_payable";
98
- lines: Array<{
99
- id: string;
100
- input: CaClaimFeeQuoteInput["lines"][number];
101
- quote: CaClaimLineQuote;
102
- assessment: CaClaimFeeQuoteResult["status"];
103
- findings: CaClaimFeeFinding[];
104
- paymentAdjustment?: {
105
- rule: "ca_multiple_surgery";
106
- rank: number;
107
- percent: 100 | 50;
108
- unadjustedScheduleMaximumCents: number;
109
- scheduleMaximumCents: number;
110
- amountCents: number;
111
- citationUrl: string;
112
- };
113
- }>;
114
- totals: {
115
- submittedChargeCents: number | null;
116
- pricedSubtotalCents: number;
117
- estimatedPayableCents: number | null;
118
- scheduleMaximumCents: number | null;
119
- reviewLineCount: number;
120
- };
121
- claimEdits: Array<{
122
- dateOfService: string;
123
- lineIds: string[];
124
- status: "evaluated" | "requires_review" | "source_unavailable" | "not_applicable";
125
- reason?: string;
126
- findings: CaClaimEditFinding[];
127
- provenance?: unknown;
128
- supportedDateRange?: {
129
- from: string;
130
- through: string;
131
- };
132
- supportedDateIntervals?: Array<{
133
- from: string;
134
- through: string;
135
- }>;
136
- }>;
137
- limitations: string[];
138
- };
139
-
140
- type RfaAuthorizationDestinationOption = {
141
- method: "fax" | "email";
142
- destination: string;
143
- label: string;
144
- phone?: string;
145
- /** Recipient attention line, retained on the reviewed delivery cover. */
146
- recipientName?: string;
147
- };
148
- /** Accept fax numbers only, never telephone notes, email addresses, or extensions. */
149
- declare function normalizeRfaFax(value: string): string | null;
150
- /** Returns choices only. Selecting or transmitting a destination is a separate user action. */
151
- declare function rfaAuthorizationDestinations(directory: BillClaimsAdministratorDirectory | null): RfaAuthorizationDestinationOption[];
152
- declare function rfaAuthorizationGuidance(directory: BillClaimsAdministratorDirectory | null): string;
153
-
154
- type CorrectionDraft = {
155
- correctBilling: boolean;
156
- units: string;
157
- modifiers: string;
158
- charge: string;
159
- chargeReviewed: boolean;
160
- };
161
- declare function parseSecondReviewCorrection(draft: CorrectionDraft): SecondReviewLineInput["correction"];
162
-
163
1
  type RfaReceiptInput = {
164
2
  channel: "fax" | "email" | "edi" | "portal" | "mail" | "manual";
165
3
  receivedAt: string;
@@ -221,6 +59,18 @@ type RfaSchedulingInput = {
221
59
  disposition: "no_appointment" | "canceled";
222
60
  reason: string;
223
61
  });
62
+ type RfaTreatmentClosureInput = {
63
+ closed: boolean;
64
+ reason: string;
65
+ expectedVersion: number;
66
+ };
67
+ type RfaTreatmentClosure = {
68
+ closed: boolean;
69
+ reason: string;
70
+ version: number;
71
+ updatedAt: string;
72
+ updatedBy: string;
73
+ };
224
74
  type RfaDecisionCorrectionInput = {
225
75
  itemId: string;
226
76
  expectedDecisionEventId: string;
@@ -301,6 +151,7 @@ type RfaLifecycleClient = {
301
151
  matchInboundFax(faxId: string, rfaId: string, idempotencyKey: string): Promise<RfaInboundFaxMatch>;
302
152
  listScheduling(id: string): Promise<RfaScheduling[]>;
303
153
  updateScheduling(id: string, itemId: string, input: RfaSchedulingInput, idempotencyKey: string): Promise<RfaScheduling[]>;
154
+ updateTreatmentClosure(id: string, itemId: string, input: RfaTreatmentClosureInput, idempotencyKey: string): Promise<RfaRecord>;
304
155
  correctDecision(id: string, input: RfaDecisionCorrectionInput, idempotencyKey: string): Promise<RfaRecord>;
305
156
  listHistory(id: string): Promise<RfaHistoryEvent[]>;
306
157
  addNote(id: string, text: string, idempotencyKey: string): Promise<RfaHistoryEvent>;
@@ -322,6 +173,168 @@ type RfaLifecycleClient = {
322
173
  /** Records clinical workflow evidence. These methods never send faxes or reconcile notification queues. */
323
174
  declare function createRfaLifecycleClient({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride }?: OrganizationClientOptions): RfaLifecycleClient;
324
175
 
176
+ type RfaLifecycleStatus = "incomplete" | "sent" | "failed" | "received" | "closed" | "canceled";
177
+ declare const RFA_LIFECYCLE_LABELS: Readonly<Record<RfaLifecycleStatus, string>>;
178
+ type LifecycleRecord = Pick<RfaRecord, "status"> & Partial<Pick<RfaRecord, "lifecycleStatus" | "submittedAt" | "receivedAt" | "transmissions">>;
179
+ /** Prefer the API lifecycle. Older responses are derived from the current submission's evidence. */
180
+ declare function getRfaLifecycleStatus(rfa: LifecycleRecord): RfaLifecycleStatus;
181
+
182
+ /** One patient's complete services for one provider/group. Dates are service dates, not publication dates. */
183
+ type CaClaimFeeQuoteInput = {
184
+ lines: Array<Omit<BillFeeQuoteInput, "billingProviderId" | "payerId" | "physicianContext"> & {
185
+ id: string;
186
+ serviceCounty?: string;
187
+ physicianContext?: Omit<NonNullable<BillFeeQuoteInput["physicianContext"]>, "providerKind"> & {
188
+ providerKind: NonNullable<BillFeeQuoteInput["physicianContext"]>["providerKind"] | "clinical_social_worker";
189
+ telehealthModality?: "audio_video" | "audio_only";
190
+ cmsSpecialtyCode?: string;
191
+ };
192
+ }>;
193
+ completeDateOfServiceContext: boolean;
194
+ ordinaryMultipleSurgeryContext?: boolean;
195
+ };
196
+ type CaFeeCitation = {
197
+ id: string;
198
+ url: string;
199
+ sha256?: string;
200
+ effectiveFrom?: string;
201
+ effectiveThrough?: string;
202
+ };
203
+ type CaFeeCalculation = {
204
+ method: "rbrvs" | "therapy_mppr";
205
+ locality: string;
206
+ serviceZip?: string;
207
+ serviceCounty?: string;
208
+ setting: "facility" | "nonfacility";
209
+ units: number;
210
+ conversionFactor: string;
211
+ providerPercent: number;
212
+ baseMaximumCents?: number;
213
+ cmsIndicators?: Record<string, string>;
214
+ sourceFiles?: Array<{
215
+ kind: string;
216
+ filename: string;
217
+ }>;
218
+ components: Array<{
219
+ name: string;
220
+ rvu: string;
221
+ gpci: string;
222
+ payableUnits: number;
223
+ }>;
224
+ rounding: string;
225
+ };
226
+ type CaClaimEditFinding = {
227
+ type: string;
228
+ lineIds: string[];
229
+ message: string;
230
+ citationUrl: string;
231
+ column1?: string;
232
+ column2?: string;
233
+ modifierIndicator?: number;
234
+ code?: string;
235
+ limit?: number;
236
+ submittedUnits?: number;
237
+ adjudicationIndicator?: number;
238
+ scope?: "line" | "patient_provider_date";
239
+ };
240
+ type CaClaimFeeFinding = {
241
+ code: string;
242
+ lineIds: string[];
243
+ message: string;
244
+ citationUrl?: string;
245
+ edit?: CaClaimEditFinding;
246
+ };
247
+ type CaClaimLineQuote = ({
248
+ status: "priced";
249
+ amountCents: number;
250
+ scheduleMaximumCents: number;
251
+ basis: BillFeeQuoteBasis | "ca_ambulance";
252
+ notes: string[];
253
+ feeBreakdown?: {
254
+ method: string;
255
+ inputs: Array<{
256
+ label: string;
257
+ value: string;
258
+ }>;
259
+ steps: Array<{
260
+ label: string;
261
+ value: string;
262
+ }>;
263
+ };
264
+ } | {
265
+ status: "requires_review" | "not_separately_payable";
266
+ reason: string;
267
+ }) & {
268
+ provenance: CaFeeCitation[];
269
+ calculation?: CaFeeCalculation;
270
+ };
271
+ type CaClaimFeeQuoteResult = {
272
+ status: "priced" | "requires_review" | "not_separately_payable";
273
+ lines: Array<{
274
+ id: string;
275
+ input: CaClaimFeeQuoteInput["lines"][number];
276
+ quote: CaClaimLineQuote;
277
+ assessment: CaClaimFeeQuoteResult["status"];
278
+ findings: CaClaimFeeFinding[];
279
+ paymentAdjustment?: {
280
+ rule: "ca_multiple_surgery";
281
+ rank: number;
282
+ percent: 100 | 50;
283
+ unadjustedScheduleMaximumCents: number;
284
+ scheduleMaximumCents: number;
285
+ amountCents: number;
286
+ citationUrl: string;
287
+ };
288
+ }>;
289
+ totals: {
290
+ submittedChargeCents: number | null;
291
+ pricedSubtotalCents: number;
292
+ estimatedPayableCents: number | null;
293
+ scheduleMaximumCents: number | null;
294
+ reviewLineCount: number;
295
+ };
296
+ claimEdits: Array<{
297
+ dateOfService: string;
298
+ lineIds: string[];
299
+ status: "evaluated" | "requires_review" | "source_unavailable" | "not_applicable";
300
+ reason?: string;
301
+ findings: CaClaimEditFinding[];
302
+ provenance?: unknown;
303
+ supportedDateRange?: {
304
+ from: string;
305
+ through: string;
306
+ };
307
+ supportedDateIntervals?: Array<{
308
+ from: string;
309
+ through: string;
310
+ }>;
311
+ }>;
312
+ limitations: string[];
313
+ };
314
+
315
+ type RfaAuthorizationDestinationOption = {
316
+ method: "fax" | "email";
317
+ destination: string;
318
+ label: string;
319
+ phone?: string;
320
+ /** Recipient attention line, retained on the reviewed delivery cover. */
321
+ recipientName?: string;
322
+ };
323
+ /** Accept fax numbers only, never telephone notes, email addresses, or extensions. */
324
+ declare function normalizeRfaFax(value: string): string | null;
325
+ /** Returns choices only. Selecting or transmitting a destination is a separate user action. */
326
+ declare function rfaAuthorizationDestinations(directory: BillClaimsAdministratorDirectory | null): RfaAuthorizationDestinationOption[];
327
+ declare function rfaAuthorizationGuidance(directory: BillClaimsAdministratorDirectory | null): string;
328
+
329
+ type CorrectionDraft = {
330
+ correctBilling: boolean;
331
+ units: string;
332
+ modifiers: string;
333
+ charge: string;
334
+ chargeReviewed: boolean;
335
+ };
336
+ declare function parseSecondReviewCorrection(draft: CorrectionDraft): SecondReviewLineInput["correction"];
337
+
325
338
  type ReportAutofillField = {
326
339
  key: string;
327
340
  value: string;
@@ -636,6 +649,7 @@ type BillReviewData = {
636
649
  injuryEndDate?: string;
637
650
  cumulativeTrauma?: boolean;
638
651
  adjNumber?: string;
652
+ medicalProviderNetworkId?: string | null;
639
653
  claimsAdminId?: string;
640
654
  claimsAdminName?: string;
641
655
  injuryDescription?: string;
@@ -664,6 +678,7 @@ type BillReviewSaveInput = {
664
678
  injuryEndDate?: string;
665
679
  cumulativeTrauma?: boolean;
666
680
  adjNumber?: string;
681
+ medicalProviderNetworkId?: string | null;
667
682
  };
668
683
  dos: string;
669
684
  dosEnd?: string | null;
@@ -1223,6 +1238,7 @@ type BrowserBillCreateInput = {
1223
1238
  externalId?: string;
1224
1239
  claimNumber: string;
1225
1240
  adjNumber?: string;
1241
+ medicalProviderNetworkId?: string | null;
1226
1242
  employer: string;
1227
1243
  dateOfInjury: string;
1228
1244
  injuryState?: string;
@@ -1617,7 +1633,18 @@ type BillFeeQuote = {
1617
1633
  reason: string;
1618
1634
  provenance: BillFeeSource[];
1619
1635
  };
1636
+ /** Public DWC directory record. Only Approved records are selectable. */
1637
+ type MedicalProviderNetwork = {
1638
+ id: string;
1639
+ name: string;
1640
+ applicantName: string;
1641
+ applicantType?: string;
1642
+ status: "Approved" | "Terminated" | "Withdrawn";
1643
+ approvalDate?: string | null;
1644
+ website?: string | null;
1645
+ };
1620
1646
  type BillReferenceClient = {
1647
+ listMedicalProviderNetworks: () => Promise<MedicalProviderNetwork[]>;
1621
1648
  listClaimsAdministrators: (input?: BillReviewPayerListInput) => Promise<BillReviewPayerPage>;
1622
1649
  searchClaimsAdministrators: (query: string, claimNumber?: string) => Promise<BillReviewPayer[]>;
1623
1650
  getClaimsAdministratorDirectory: (id: string, injuryState?: string) => Promise<BillClaimsAdministratorDirectory>;
@@ -1637,6 +1664,7 @@ type BillReferenceClient = {
1637
1664
  type BillLifecycleClient = {
1638
1665
  getBillId: () => string;
1639
1666
  getLifecycle: (signal?: AbortSignal) => Promise<BillLifecycleData>;
1667
+ listMedicalProviderNetworks: () => Promise<MedicalProviderNetwork[]>;
1640
1668
  listClaimsAdministrators: (input?: BillReviewPayerListInput) => Promise<BillReviewPayerPage>;
1641
1669
  searchClaimsAdministrators: (query: string, claimNumber?: string) => Promise<BillReviewPayer[]>;
1642
1670
  getClaimsAdministratorDirectory: (id: string, injuryState?: string) => Promise<BillClaimsAdministratorDirectory>;
@@ -2057,6 +2085,7 @@ type RfaRecord = {
2057
2085
  units: number | null;
2058
2086
  authorizationNumber: string | null;
2059
2087
  decisionReason: string | null;
2088
+ decisionClosure?: RfaTreatmentClosure | null;
2060
2089
  currentDecisionEventId?: string | null;
2061
2090
  currentResponseDocumentId?: string | null;
2062
2091
  currentImrDocumentId?: string | null;
@@ -2103,7 +2132,13 @@ type RfaRecord = {
2103
2132
  text?: string;
2104
2133
  }>;
2105
2134
  };
2135
+ type RfaAgingBucket = "0_5" | "6_14" | "15_30" | "31_plus";
2136
+ type RfaAgingSummary = {
2137
+ byBucket: Record<RfaAgingBucket, number>;
2138
+ byLifecycleStatus: Record<RfaLifecycleStatus, Record<RfaAgingBucket, number>>;
2139
+ };
2106
2140
  type RfaListQuery = {
2141
+ agingBucket?: RfaAgingBucket;
2107
2142
  patientId?: string;
2108
2143
  search?: string;
2109
2144
  sortBy?: "createdAt" | "employeeName" | "providerName" | "submittedAt" | "status" | "lifecycleStatus";
@@ -2123,6 +2158,7 @@ type RfaListResult = {
2123
2158
  summary: {
2124
2159
  total: number;
2125
2160
  byStatus: Record<string, number>;
2161
+ aging?: RfaAgingSummary;
2126
2162
  byLifecycleStatus?: Partial<Record<RfaLifecycleStatus, number>>;
2127
2163
  };
2128
2164
  };
@@ -2236,4 +2272,4 @@ type RfaClient = {
2236
2272
  /** Uses short-lived browser credentials. Never pass a partner API key. */
2237
2273
  declare function createRfaClient({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride }?: OrganizationClientOptions): RfaClient;
2238
2274
 
2239
- export { type AddBillNoteInput, BILL_FEE_QUOTE_BASES, BILL_TASKS_AGING_BUCKETS, type BillActivityRecord, type BillActorInput, type BillAttemptSummary, type BillClaimsAdministratorAuthorizationStatus, type BillClaimsAdministratorContact, type BillClaimsAdministratorDirectory, type BillClaimsAdministratorMailingAddress, type BillClaimsAdministratorPattern, type BillClaimsAdministratorPayer, type BillClaimsAdministratorSource, type BillCourtesyCopyInput, type BillCourtesyCopyPreview, type BillCourtesyCopyResult, type BillDeliveryOption, type BillDeliveryOptions, type BillDeliveryPreviewInput, type BillDiagnosisCode, type BillEorDocument, type BillFeeContext, type BillFeeQuote, type BillFeeQuoteBasis, type BillFeeQuoteInput, type BillFeeSource, type BillFormData, type BillFormValue, type BillHistoryEntry, type BillLifecycleAction, type BillLifecycleActionId, type BillLifecycleClient, type BillLifecycleClientOptions, type BillLifecycleData, type BillLifecycleDelivery, type BillLifecycleSession, type BillLifecycleSessionProvider, type BillLifecycleSessionRequest, type BillLineFeeBreakdown, type BillLineFormData, type BillPaymentRecord, type BillPostalPlace, type BillProcedureCodePage, type BillProcedureCodeSearchInput, type BillReferenceClient, type BillReferenceClientOptions, type BillRejection, type BillRejectionIssue, type BillRemittanceSummary, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClaimPatternStatus, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewFeatures, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewPayerListInput, type BillReviewPayerOption, type BillReviewPayerPage, type BillReviewPayerSuggestion, type BillReviewSaveInput, type BillSubmissionClient, type BillSubmissionClientOptions, type BillSubmissionDetail, type BillSubmissionRoute, type BillTasksAgingBucket, type BillTasksDashboardData, type BillTasksDashboardItem, type BillTasksDashboardRow, type BillTasksDashboardSection, type BillTasksDashboardSectionInput, type BillTasksDashboardTone, type BillTeamNote, type BilledDrug, type BrowserBillAddress, type BrowserBillCreateInput, type BrowserBillSubmissionDocument, type BrowserBillSubmissionInput, type BrowserBillSubmissionResult, type BrowserSubmittedBill, type CaAnesthesiaContext, type CaAnesthesiaEvent, type CaAnesthesiaInterval, type CaAnesthesiaOptionalParticipation, type CaAnesthesiaParticipation, type CaClaimEditFinding, type CaClaimFeeFinding, type CaClaimFeeQuoteInput, type CaClaimFeeQuoteResult, type CaClaimLineQuote, type CaFeeCalculation, type CaFeeCitation, type CaMedicalDirection, type CaMedicalDirectionCase, type CaMonitoredAnesthesiaCare, type CaPadbContext, type CaProfessionalComponentContext, type CaTechnicalComponentContext, type CaTherapyContext, type ClaimForm, type CloseBillInput, type CorrectionDraft, DEFAULT_API_BASE_URL, DEFAULT_SESSION_ENDPOINT, type HistoricalBillReviewData, type OrganizationBillingProviderInput, type OrganizationChecklistItem, type OrganizationClaimsAdministrator, type OrganizationClaimsAdministratorInput, type OrganizationClient, type OrganizationClientOptions, type OrganizationLocationInput, type OrganizationPracticeIdentity, type OrganizationProfileData, type OrganizationRenderingProviderInput, type OrganizationTeam, type OrganizationTeamMember, type OrganizationTeamRole, type PostBillPaymentInput, REPORT_BILL_STATUS_OPTIONS, RFA_LIFECYCLE_LABELS, type ReopenBillInput, type ReportAutofillClient, type ReportAutofillField, type ReportAutofillMatch, type ReportAutofillResult, type ReportBillStatusActionInput, type ReportBillStatusContacts, type ReportBillStatusId, type ReportBillStatusInput, type ReportBillStatusOption, type ResubmitBillInput, type RfaAuthorizationDestinationOption, type RfaClient, type RfaContact, type RfaCreateDraftInput, type RfaCreationClaim, type RfaCreationContext, type RfaCreationContextQuery, type RfaCreationProvider, type RfaDecisionCorrectionInput, type RfaDecisionsInput, type RfaDeliveryPreview, type RfaDeliveryPreviewInput, type RfaDraftActionsClient, type RfaFaxInput, type RfaFollowUp, type RfaFollowUpList, type RfaFollowUpUpdate, type RfaForwardInput, type RfaForwardResult, type RfaHistoryEvent, type RfaInboundFax, type RfaInboundFaxMatch, type RfaInformationRequestInput, type RfaInformationResponseInput, type RfaLifecycleClient, type RfaLifecycleStatus, type RfaListQuery, type RfaListResult, type RfaPacketHistory, type RfaPacketTransmission, type RfaPacketsClient, type RfaProvisionClaimInput, type RfaProvisionClaimResult, type RfaReceiptInput, type RfaRecord, type RfaSavedPacket, type RfaScheduling, type RfaSchedulingInput, type RfaSignInput, type RfaSigningPreview, type RfaSigningPreviewInput, type RfaSubmitInput, type RfaTreatmentDecisionInput, type RfaUpdateDraftInput, type RfaUploadDocumentInput, SECOND_REVIEW_REASON_TEMPLATE, SECOND_REVIEW_WINDOW_DAYS, type SandboxSimulationScenario, type SecondReviewDeadline, type SecondReviewLineInput, type SendDuplicateBillInput, type SimulateSandboxBillInput, type SubmitBillInput, type SubmitNewBillInput, type SubmitSecondReviewInput, billTasksAgingBucketIndex, buildBillTasksDashboard, createBillLifecycleClient, createBillReferenceClient, createBillSubmissionClient, createOrganizationClient, createReportAutofillClient, createRfaClient, createRfaDraftActionsClient, createRfaLifecycleClient, createRfaPacketsClient, defaultBillReviewPayerOption, getRfaLifecycleStatus, normalizeRfaFax, organizationTaxIdWrite, parseSecondReviewCorrection, reportBillStatusContacts, rfaAuthorizationDestinations, rfaAuthorizationGuidance, sanitizeBillReviewSaveInput, secondReviewDeadline };
2275
+ export { type AddBillNoteInput, BILL_FEE_QUOTE_BASES, BILL_TASKS_AGING_BUCKETS, type BillActivityRecord, type BillActorInput, type BillAttemptSummary, type BillClaimsAdministratorAuthorizationStatus, type BillClaimsAdministratorContact, type BillClaimsAdministratorDirectory, type BillClaimsAdministratorMailingAddress, type BillClaimsAdministratorPattern, type BillClaimsAdministratorPayer, type BillClaimsAdministratorSource, type BillCourtesyCopyInput, type BillCourtesyCopyPreview, type BillCourtesyCopyResult, type BillDeliveryOption, type BillDeliveryOptions, type BillDeliveryPreviewInput, type BillDiagnosisCode, type BillEorDocument, type BillFeeContext, type BillFeeQuote, type BillFeeQuoteBasis, type BillFeeQuoteInput, type BillFeeSource, type BillFormData, type BillFormValue, type BillHistoryEntry, type BillLifecycleAction, type BillLifecycleActionId, type BillLifecycleClient, type BillLifecycleClientOptions, type BillLifecycleData, type BillLifecycleDelivery, type BillLifecycleSession, type BillLifecycleSessionProvider, type BillLifecycleSessionRequest, type BillLineFeeBreakdown, type BillLineFormData, type BillPaymentRecord, type BillPostalPlace, type BillProcedureCodePage, type BillProcedureCodeSearchInput, type BillReferenceClient, type BillReferenceClientOptions, type BillRejection, type BillRejectionIssue, type BillRemittanceSummary, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClaimPatternStatus, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewFeatures, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewPayerListInput, type BillReviewPayerOption, type BillReviewPayerPage, type BillReviewPayerSuggestion, type BillReviewSaveInput, type BillSubmissionClient, type BillSubmissionClientOptions, type BillSubmissionDetail, type BillSubmissionRoute, type BillTasksAgingBucket, type BillTasksDashboardData, type BillTasksDashboardItem, type BillTasksDashboardRow, type BillTasksDashboardSection, type BillTasksDashboardSectionInput, type BillTasksDashboardTone, type BillTeamNote, type BilledDrug, type BrowserBillAddress, type BrowserBillCreateInput, type BrowserBillSubmissionDocument, type BrowserBillSubmissionInput, type BrowserBillSubmissionResult, type BrowserSubmittedBill, type CaAnesthesiaContext, type CaAnesthesiaEvent, type CaAnesthesiaInterval, type CaAnesthesiaOptionalParticipation, type CaAnesthesiaParticipation, type CaClaimEditFinding, type CaClaimFeeFinding, type CaClaimFeeQuoteInput, type CaClaimFeeQuoteResult, type CaClaimLineQuote, type CaFeeCalculation, type CaFeeCitation, type CaMedicalDirection, type CaMedicalDirectionCase, type CaMonitoredAnesthesiaCare, type CaPadbContext, type CaProfessionalComponentContext, type CaTechnicalComponentContext, type CaTherapyContext, type ClaimForm, type CloseBillInput, type CorrectionDraft, DEFAULT_API_BASE_URL, DEFAULT_SESSION_ENDPOINT, type HistoricalBillReviewData, type MedicalProviderNetwork, type OrganizationBillingProviderInput, type OrganizationChecklistItem, type OrganizationClaimsAdministrator, type OrganizationClaimsAdministratorInput, type OrganizationClient, type OrganizationClientOptions, type OrganizationLocationInput, type OrganizationPracticeIdentity, type OrganizationProfileData, type OrganizationRenderingProviderInput, type OrganizationTeam, type OrganizationTeamMember, type OrganizationTeamRole, type PostBillPaymentInput, REPORT_BILL_STATUS_OPTIONS, RFA_LIFECYCLE_LABELS, type ReopenBillInput, type ReportAutofillClient, type ReportAutofillField, type ReportAutofillMatch, type ReportAutofillResult, type ReportBillStatusActionInput, type ReportBillStatusContacts, type ReportBillStatusId, type ReportBillStatusInput, type ReportBillStatusOption, type ResubmitBillInput, type RfaAgingBucket, type RfaAgingSummary, type RfaAuthorizationDestinationOption, type RfaClient, type RfaContact, type RfaCreateDraftInput, type RfaCreationClaim, type RfaCreationContext, type RfaCreationContextQuery, type RfaCreationProvider, type RfaDecisionCorrectionInput, type RfaDecisionsInput, type RfaDeliveryPreview, type RfaDeliveryPreviewInput, type RfaDraftActionsClient, type RfaFaxInput, type RfaFollowUp, type RfaFollowUpList, type RfaFollowUpUpdate, type RfaForwardInput, type RfaForwardResult, type RfaHistoryEvent, type RfaInboundFax, type RfaInboundFaxMatch, type RfaInformationRequestInput, type RfaInformationResponseInput, type RfaLifecycleClient, type RfaLifecycleStatus, type RfaListQuery, type RfaListResult, type RfaPacketHistory, type RfaPacketTransmission, type RfaPacketsClient, type RfaProvisionClaimInput, type RfaProvisionClaimResult, type RfaReceiptInput, type RfaRecord, type RfaSavedPacket, type RfaScheduling, type RfaSchedulingInput, type RfaSignInput, type RfaSigningPreview, type RfaSigningPreviewInput, type RfaSubmitInput, type RfaTreatmentClosure, type RfaTreatmentClosureInput, type RfaTreatmentDecisionInput, type RfaUpdateDraftInput, type RfaUploadDocumentInput, SECOND_REVIEW_REASON_TEMPLATE, SECOND_REVIEW_WINDOW_DAYS, type SandboxSimulationScenario, type SecondReviewDeadline, type SecondReviewLineInput, type SendDuplicateBillInput, type SimulateSandboxBillInput, type SubmitBillInput, type SubmitNewBillInput, type SubmitSecondReviewInput, billTasksAgingBucketIndex, buildBillTasksDashboard, createBillLifecycleClient, createBillReferenceClient, createBillSubmissionClient, createOrganizationClient, createReportAutofillClient, createRfaClient, createRfaDraftActionsClient, createRfaLifecycleClient, createRfaPacketsClient, defaultBillReviewPayerOption, getRfaLifecycleStatus, normalizeRfaFax, organizationTaxIdWrite, parseSecondReviewCorrection, reportBillStatusContacts, rfaAuthorizationDestinations, rfaAuthorizationGuidance, sanitizeBillReviewSaveInput, secondReviewDeadline };
package/dist/index.js CHANGED
@@ -170,6 +170,12 @@ function createRfaLifecycleClient({ sessionEndpoint = "/api/mindbill/session", g
170
170
  if (!key.trim()) return Promise.reject(new Error("An idempotency key is required."));
171
171
  return readArray(path(id, `items/${encodeURIComponent(itemId)}/scheduling`), { method: "PATCH", headers: { "idempotency-key": key }, body: JSON.stringify(input) });
172
172
  },
173
+ updateTreatmentClosure: (id, itemId, input, key) => {
174
+ const reason = input.reason.trim();
175
+ if (!reason || reason.length > 2e3) return Promise.reject(new Error("Enter a reason of 1\u20132000 characters."));
176
+ if (!Number.isInteger(input.expectedVersion) || input.expectedVersion < 0) return Promise.reject(new Error("Refresh to load the current treatment version."));
177
+ return mutate(path(id, `items/${encodeURIComponent(itemId)}/closure`), { ...input, reason }, key, "PATCH");
178
+ },
173
179
  correctDecision: (id, input, key) => mutate(path(id, "decision-corrections"), input, key),
174
180
  listHistory: (id) => readArray(path(id, "events")),
175
181
  addNote: (id, text, key) => {
@@ -428,7 +434,8 @@ function sanitizeBillReviewSaveInput(input) {
428
434
  "doi",
429
435
  "injuryEndDate",
430
436
  "cumulativeTrauma",
431
- "adjNumber"
437
+ "adjNumber",
438
+ "medicalProviderNetworkId"
432
439
  ])
433
440
  } : {},
434
441
  dos: input.dos,
@@ -755,6 +762,26 @@ function createBillLifecycleClient({
755
762
  const body = await response.json();
756
763
  return normalizeLifecycle(body.data);
757
764
  };
765
+ const listMedicalProviderNetworks = async () => {
766
+ const response = await request("/partner/v2/medical-provider-networks");
767
+ if (!response.ok) throw await responseError(response, "Medical provider networks could not be loaded.");
768
+ const body = await response.json();
769
+ if (!Array.isArray(body.data)) throw new Error("Medical provider networks returned an invalid response.");
770
+ return body.data.flatMap((value) => {
771
+ if (!value || typeof value !== "object") return [];
772
+ const row = value;
773
+ if (row.status !== "Approved" || typeof row.id !== "string" || typeof row.name !== "string" || typeof row.applicantName !== "string") return [];
774
+ return [{
775
+ id: row.id,
776
+ name: row.name,
777
+ applicantName: row.applicantName,
778
+ status: "Approved",
779
+ ...typeof row.applicantType === "string" ? { applicantType: row.applicantType } : {},
780
+ ...typeof row.approvalDate === "string" ? { approvalDate: row.approvalDate } : {},
781
+ ...typeof row.website === "string" ? { website: row.website } : {}
782
+ }];
783
+ });
784
+ };
758
785
  const listClaimsAdministrators = async (input = {}) => {
759
786
  const params = new URLSearchParams();
760
787
  if (input.query?.trim()) params.set("q", input.query.trim());
@@ -961,6 +988,7 @@ function createBillLifecycleClient({
961
988
  sessionRequest = null;
962
989
  },
963
990
  getLifecycle: loadLifecycle,
991
+ listMedicalProviderNetworks,
964
992
  listClaimsAdministrators,
965
993
  searchClaimsAdministrators,
966
994
  getClaimsAdministratorDirectory,
@@ -1071,6 +1099,7 @@ function createBillReferenceClient(options = {}) {
1071
1099
  billId: "pre-submission-reference-data"
1072
1100
  });
1073
1101
  return {
1102
+ listMedicalProviderNetworks: lifecycle.listMedicalProviderNetworks,
1074
1103
  listClaimsAdministrators: lifecycle.listClaimsAdministrators,
1075
1104
  searchClaimsAdministrators: lifecycle.searchClaimsAdministrators,
1076
1105
  getClaimsAdministratorDirectory: lifecycle.getClaimsAdministratorDirectory,