@mindbill/browser 0.49.0 → 0.50.1
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 +17 -1
- package/dist/index.js +52 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -649,6 +649,7 @@ type BillReviewData = {
|
|
|
649
649
|
injuryEndDate?: string;
|
|
650
650
|
cumulativeTrauma?: boolean;
|
|
651
651
|
adjNumber?: string;
|
|
652
|
+
medicalProviderNetworkId?: string | null;
|
|
652
653
|
claimsAdminId?: string;
|
|
653
654
|
claimsAdminName?: string;
|
|
654
655
|
injuryDescription?: string;
|
|
@@ -677,6 +678,7 @@ type BillReviewSaveInput = {
|
|
|
677
678
|
injuryEndDate?: string;
|
|
678
679
|
cumulativeTrauma?: boolean;
|
|
679
680
|
adjNumber?: string;
|
|
681
|
+
medicalProviderNetworkId?: string | null;
|
|
680
682
|
};
|
|
681
683
|
dos: string;
|
|
682
684
|
dosEnd?: string | null;
|
|
@@ -1236,6 +1238,7 @@ type BrowserBillCreateInput = {
|
|
|
1236
1238
|
externalId?: string;
|
|
1237
1239
|
claimNumber: string;
|
|
1238
1240
|
adjNumber?: string;
|
|
1241
|
+
medicalProviderNetworkId?: string | null;
|
|
1239
1242
|
employer: string;
|
|
1240
1243
|
dateOfInjury: string;
|
|
1241
1244
|
injuryState?: string;
|
|
@@ -1345,6 +1348,7 @@ type BillReferenceClientOptions = Omit<BillLifecycleClientOptions, "billId">;
|
|
|
1345
1348
|
/** Browser-session options for an atomic immutable bill submission. */
|
|
1346
1349
|
type BillSubmissionClientOptions = BillReferenceClientOptions;
|
|
1347
1350
|
type BillSubmissionClient = {
|
|
1351
|
+
previewCms1500: (bill: BrowserBillSubmissionInput["bill"]) => Promise<Blob>;
|
|
1348
1352
|
submitBill: (input: BrowserBillSubmissionInput, options?: {
|
|
1349
1353
|
idempotencyKey?: string;
|
|
1350
1354
|
}) => Promise<BrowserBillSubmissionResult>;
|
|
@@ -1630,7 +1634,18 @@ type BillFeeQuote = {
|
|
|
1630
1634
|
reason: string;
|
|
1631
1635
|
provenance: BillFeeSource[];
|
|
1632
1636
|
};
|
|
1637
|
+
/** Public DWC directory record. Only Approved records are selectable. */
|
|
1638
|
+
type MedicalProviderNetwork = {
|
|
1639
|
+
id: string;
|
|
1640
|
+
name: string;
|
|
1641
|
+
applicantName: string;
|
|
1642
|
+
applicantType?: string;
|
|
1643
|
+
status: "Approved" | "Terminated" | "Withdrawn";
|
|
1644
|
+
approvalDate?: string | null;
|
|
1645
|
+
website?: string | null;
|
|
1646
|
+
};
|
|
1633
1647
|
type BillReferenceClient = {
|
|
1648
|
+
listMedicalProviderNetworks: () => Promise<MedicalProviderNetwork[]>;
|
|
1634
1649
|
listClaimsAdministrators: (input?: BillReviewPayerListInput) => Promise<BillReviewPayerPage>;
|
|
1635
1650
|
searchClaimsAdministrators: (query: string, claimNumber?: string) => Promise<BillReviewPayer[]>;
|
|
1636
1651
|
getClaimsAdministratorDirectory: (id: string, injuryState?: string) => Promise<BillClaimsAdministratorDirectory>;
|
|
@@ -1650,6 +1665,7 @@ type BillReferenceClient = {
|
|
|
1650
1665
|
type BillLifecycleClient = {
|
|
1651
1666
|
getBillId: () => string;
|
|
1652
1667
|
getLifecycle: (signal?: AbortSignal) => Promise<BillLifecycleData>;
|
|
1668
|
+
listMedicalProviderNetworks: () => Promise<MedicalProviderNetwork[]>;
|
|
1653
1669
|
listClaimsAdministrators: (input?: BillReviewPayerListInput) => Promise<BillReviewPayerPage>;
|
|
1654
1670
|
searchClaimsAdministrators: (query: string, claimNumber?: string) => Promise<BillReviewPayer[]>;
|
|
1655
1671
|
getClaimsAdministratorDirectory: (id: string, injuryState?: string) => Promise<BillClaimsAdministratorDirectory>;
|
|
@@ -2257,4 +2273,4 @@ type RfaClient = {
|
|
|
2257
2273
|
/** Uses short-lived browser credentials. Never pass a partner API key. */
|
|
2258
2274
|
declare function createRfaClient({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride }?: OrganizationClientOptions): RfaClient;
|
|
2259
2275
|
|
|
2260
|
-
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 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 };
|
|
2276
|
+
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
|
@@ -434,7 +434,8 @@ function sanitizeBillReviewSaveInput(input) {
|
|
|
434
434
|
"doi",
|
|
435
435
|
"injuryEndDate",
|
|
436
436
|
"cumulativeTrauma",
|
|
437
|
-
"adjNumber"
|
|
437
|
+
"adjNumber",
|
|
438
|
+
"medicalProviderNetworkId"
|
|
438
439
|
])
|
|
439
440
|
} : {},
|
|
440
441
|
dos: input.dos,
|
|
@@ -692,7 +693,35 @@ function createBillSubmissionClient({
|
|
|
692
693
|
const bill = envelope;
|
|
693
694
|
return { billId: bill.id, bill };
|
|
694
695
|
};
|
|
696
|
+
const previewCms1500 = async (bill) => {
|
|
697
|
+
const controller = new AbortController();
|
|
698
|
+
let browserSession = await mintSession(controller.signal);
|
|
699
|
+
const perform = (current) => {
|
|
700
|
+
const base = (current.apiBaseUrl ?? apiBaseUrl).replace(/\/$/, "");
|
|
701
|
+
return fetcher(`${base}/partner/v2/bills/preview-cms1500`, {
|
|
702
|
+
method: "POST",
|
|
703
|
+
headers: {
|
|
704
|
+
authorization: `Bearer ${current.token}`,
|
|
705
|
+
"content-type": "application/json"
|
|
706
|
+
},
|
|
707
|
+
body: JSON.stringify(bill),
|
|
708
|
+
signal: controller.signal
|
|
709
|
+
});
|
|
710
|
+
};
|
|
711
|
+
let response = await perform(browserSession);
|
|
712
|
+
if (response.status === 401) {
|
|
713
|
+
session = null;
|
|
714
|
+
browserSession = await mintSession(controller.signal, true);
|
|
715
|
+
response = await perform(browserSession);
|
|
716
|
+
}
|
|
717
|
+
if (!response.ok) throw await responseError(response, "The CMS-1500 preview could not be generated.");
|
|
718
|
+
if (!response.headers.get("content-type")?.includes("application/pdf")) {
|
|
719
|
+
throw new Error("The billing service returned an invalid CMS-1500 preview.");
|
|
720
|
+
}
|
|
721
|
+
return response.blob();
|
|
722
|
+
};
|
|
695
723
|
return {
|
|
724
|
+
previewCms1500,
|
|
696
725
|
submitBill,
|
|
697
726
|
clearSession() {
|
|
698
727
|
session = null;
|
|
@@ -761,6 +790,26 @@ function createBillLifecycleClient({
|
|
|
761
790
|
const body = await response.json();
|
|
762
791
|
return normalizeLifecycle(body.data);
|
|
763
792
|
};
|
|
793
|
+
const listMedicalProviderNetworks = async () => {
|
|
794
|
+
const response = await request("/partner/v2/medical-provider-networks");
|
|
795
|
+
if (!response.ok) throw await responseError(response, "Medical provider networks could not be loaded.");
|
|
796
|
+
const body = await response.json();
|
|
797
|
+
if (!Array.isArray(body.data)) throw new Error("Medical provider networks returned an invalid response.");
|
|
798
|
+
return body.data.flatMap((value) => {
|
|
799
|
+
if (!value || typeof value !== "object") return [];
|
|
800
|
+
const row = value;
|
|
801
|
+
if (row.status !== "Approved" || typeof row.id !== "string" || typeof row.name !== "string" || typeof row.applicantName !== "string") return [];
|
|
802
|
+
return [{
|
|
803
|
+
id: row.id,
|
|
804
|
+
name: row.name,
|
|
805
|
+
applicantName: row.applicantName,
|
|
806
|
+
status: "Approved",
|
|
807
|
+
...typeof row.applicantType === "string" ? { applicantType: row.applicantType } : {},
|
|
808
|
+
...typeof row.approvalDate === "string" ? { approvalDate: row.approvalDate } : {},
|
|
809
|
+
...typeof row.website === "string" ? { website: row.website } : {}
|
|
810
|
+
}];
|
|
811
|
+
});
|
|
812
|
+
};
|
|
764
813
|
const listClaimsAdministrators = async (input = {}) => {
|
|
765
814
|
const params = new URLSearchParams();
|
|
766
815
|
if (input.query?.trim()) params.set("q", input.query.trim());
|
|
@@ -967,6 +1016,7 @@ function createBillLifecycleClient({
|
|
|
967
1016
|
sessionRequest = null;
|
|
968
1017
|
},
|
|
969
1018
|
getLifecycle: loadLifecycle,
|
|
1019
|
+
listMedicalProviderNetworks,
|
|
970
1020
|
listClaimsAdministrators,
|
|
971
1021
|
searchClaimsAdministrators,
|
|
972
1022
|
getClaimsAdministratorDirectory,
|
|
@@ -1077,6 +1127,7 @@ function createBillReferenceClient(options = {}) {
|
|
|
1077
1127
|
billId: "pre-submission-reference-data"
|
|
1078
1128
|
});
|
|
1079
1129
|
return {
|
|
1130
|
+
listMedicalProviderNetworks: lifecycle.listMedicalProviderNetworks,
|
|
1080
1131
|
listClaimsAdministrators: lifecycle.listClaimsAdministrators,
|
|
1081
1132
|
searchClaimsAdministrators: lifecycle.searchClaimsAdministrators,
|
|
1082
1133
|
getClaimsAdministratorDirectory: lifecycle.getClaimsAdministratorDirectory,
|