@medipass/utils 11.68.0 → 11.68.2
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/CHANGELOG.md +22 -0
- package/billable-items-01050ba2.js +27 -0
- package/blah.js +2 -0
- package/build-validation-schema.js +1282 -0
- package/businesses-e3a20604.js +53 -0
- package/chart.js +45 -0
- package/claim-payment-status-formatted.js +12 -0
- package/claim-payment-status-icons.js +10 -0
- package/claim-payment-status-text-classes.js +10 -0
- package/constants.js +460 -0
- package/countries.js +1011 -0
- package/datetime.js +36 -0
- package/document-types-formatted.js +13 -0
- package/document-types-icons.js +10 -0
- package/document-types-text-classes.js +10 -0
- package/documents/workflow-state-formatted-text-classes.js +12 -0
- package/documents/workflow-state-formatted.js +15 -0
- package/documents/workflow-state-icons.js +10 -0
- package/form-applications/assign-values-to-sections.js +29 -0
- package/forms-f06ca97e.js +51 -0
- package/funders.js +122 -0
- package/get-env.js +196 -0
- package/get-select-options.js +65 -0
- package/get-staff-type-display-name.js +12 -0
- package/google-addresses.js +127 -0
- package/health-fund-accounts-3cd8650f.js +20 -0
- package/health-fund-settings-43327826.js +22 -0
- package/health-funds-300facef.js +194 -0
- package/i18n/index.js +59 -0
- package/i18n/translations.js +36 -0
- package/index.js +56 -0
- package/intercom.js +101 -0
- package/members-cb4f73a9.js +53 -0
- package/modalities-b360d521.js +19 -0
- package/normalise-abn.js +22 -0
- package/package.json +2 -2
- package/parse-health-fund-card-fields.js +12 -0
- package/patients-2083dd9c.js +46 -0
- package/payment-methods-4fa2d01f.js +26 -0
- package/payment-options.js +52 -0
- package/practices-3e703f22.js +87 -0
- package/products-bd313cb4.js +83 -0
- package/products.js +31 -0
- package/professional-categories-e2e5284b.js +19 -0
- package/redux-actions.js +161 -0
- package/redux-reducer.js +112 -0
- package/sanitise-url.js +17 -0
- package/scroll.js +9 -0
- package/sensitive-keys.js +9 -0
- package/sentry.js +112 -0
- package/service-items.js +230 -0
- package/services-2e25cdac.js +127 -0
- package/specialties-7640b7e3.js +20 -0
- package/staff-990794cd.js +161 -0
- package/status-icons.js +10 -0
- package/status-text-classes.js +10 -0
- package/subscriptions-45c1321a.js +160 -0
- package/test-framework/fixtures/accounts.js +34 -0
- package/test-framework/fixtures/billable-items.js +9 -0
- package/test-framework/fixtures/businesses.js +9 -0
- package/test-framework/fixtures/documents.js +121 -0
- package/test-framework/fixtures/form-application-templates.js +74 -0
- package/test-framework/fixtures/form-applications.js +39 -0
- package/test-framework/fixtures/forms.js +9 -0
- package/test-framework/fixtures/health-fund-accounts.js +9 -0
- package/test-framework/fixtures/health-fund-settings.js +9 -0
- package/test-framework/fixtures/health-funds.js +10 -0
- package/test-framework/fixtures/index.js +45 -0
- package/test-framework/fixtures/members.js +9 -0
- package/test-framework/fixtures/message-mappings.js +61 -0
- package/test-framework/fixtures/modalities.js +9 -0
- package/test-framework/fixtures/patients.js +9 -0
- package/test-framework/fixtures/payment-methods.js +9 -0
- package/test-framework/fixtures/practices.js +11 -0
- package/test-framework/fixtures/products.js +10 -0
- package/test-framework/fixtures/professional-categories.js +9 -0
- package/test-framework/fixtures/services.js +11 -0
- package/test-framework/fixtures/specialties.js +9 -0
- package/test-framework/fixtures/staff.js +12 -0
- package/test-framework/fixtures/subscriptions.js +13 -0
- package/test-framework/fixtures/transaction-reports.js +204 -0
- package/test-framework/fixtures/transactions.js +22 -0
- package/test-framework/fixtures/workflow-exceptions.js +32 -0
- package/test-framework/react.js +38 -0
- package/transaction-details-by-funder.js +81 -0
- package/transaction-status-formatted.js +13 -0
- package/transaction-status-helpers.js +77 -0
- package/transaction-status-icons.js +10 -0
- package/transaction-status-text-classes.js +10 -0
- package/transaction-status.js +42 -0
- package/transactions-6e5fd92d.js +1883 -0
- package/validate-form.js +388 -0
- package/validate.js +37 -0
- package/webpack-config.js +27 -0
- package/workflow-state-formatted-text-classes.js +12 -0
- package/workflow-state-formatted.js +13 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var practices = require('../../practices-3e703f22.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.defaultPractice = practices.defaultPractice;
|
|
10
|
+
exports.defaultPractice2 = practices.defaultPractice2;
|
|
11
|
+
exports.practices = practices.practices;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var professionalCategories = require('../../professional-categories-e2e5284b.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.defaultProfessionalCategory = professionalCategories.defaultProfessionalCategory;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var services = require('../../services-2e25cdac.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.defaultService = services.defaultService;
|
|
10
|
+
exports.defaultServiceItems = services.defaultServiceItems;
|
|
11
|
+
exports.serviceWithMultipleClaimItems = services.serviceWithMultipleClaimItems;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var staff = require('../../staff-990794cd.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.defaultPractitioner = staff.defaultPractitioner;
|
|
10
|
+
exports.defaultPractitioner2 = staff.defaultPractitioner2;
|
|
11
|
+
exports.practitionerWithActivePendingProviderSet = staff.practitionerWithActivePendingProviderSet;
|
|
12
|
+
exports.practitionerWithPendingProviderSet = staff.practitionerWithPendingProviderSet;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var subscriptions = require('../../subscriptions-45c1321a.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.subscriptionBasic = subscriptions.subscriptionBasic;
|
|
10
|
+
exports.subscriptionPro = subscriptions.subscriptionPro;
|
|
11
|
+
exports.subscriptionProEnded = subscriptions.subscriptionProEnded;
|
|
12
|
+
exports.subscriptionProUpcoming = subscriptions.subscriptionProUpcoming;
|
|
13
|
+
exports.subscriptionProWithoutPaymentMethod = subscriptions.subscriptionProWithoutPaymentMethod;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var processingReportDefault = {
|
|
6
|
+
reportResult: 0,
|
|
7
|
+
sessionId: 788881339,
|
|
8
|
+
claimId: 'E8227@',
|
|
9
|
+
serviceId: 'A001',
|
|
10
|
+
amountChargedString: '$37.60',
|
|
11
|
+
amountBenefitPaidString: '$43.50',
|
|
12
|
+
providerNumber: '2429581T',
|
|
13
|
+
healthFundAccount: {
|
|
14
|
+
membershipNumber: '6950507481',
|
|
15
|
+
cardRank: '1'
|
|
16
|
+
},
|
|
17
|
+
patient: {
|
|
18
|
+
firstName: 'CLAUDIA',
|
|
19
|
+
lastName: 'CONNOR'
|
|
20
|
+
},
|
|
21
|
+
cardFlag: 'Y',
|
|
22
|
+
claimItems: [{
|
|
23
|
+
serviceDateString: '2018-09-07',
|
|
24
|
+
itemCode: '00023',
|
|
25
|
+
amountChargedString: '$10.00',
|
|
26
|
+
amountBenefitString: '$37.60',
|
|
27
|
+
gatewayCode: null,
|
|
28
|
+
serviceId: 'A001',
|
|
29
|
+
voucherId: '01',
|
|
30
|
+
numberOfPatientsSeen: 1
|
|
31
|
+
}, {
|
|
32
|
+
serviceDateString: '2018-09-07',
|
|
33
|
+
itemCode: '73810',
|
|
34
|
+
amountChargedString: '$1.00',
|
|
35
|
+
amountBenefitString: '$5.90',
|
|
36
|
+
gatewayCode: null,
|
|
37
|
+
serviceId: 'A002',
|
|
38
|
+
voucherId: '02',
|
|
39
|
+
numberOfPatientsSeen: 3
|
|
40
|
+
}]
|
|
41
|
+
};
|
|
42
|
+
var paymentReportDefault = {
|
|
43
|
+
reportResult: 0,
|
|
44
|
+
sessionId: 492869302,
|
|
45
|
+
paymentRunDateString: '2019-02-06',
|
|
46
|
+
paymentRunNumber: '0008',
|
|
47
|
+
amountBenefitPaidString: '$37.60',
|
|
48
|
+
bankAccount: {
|
|
49
|
+
bsb: '062290',
|
|
50
|
+
accountNumber: '122112212',
|
|
51
|
+
accountName: 'DR HAN'
|
|
52
|
+
},
|
|
53
|
+
payments: [{
|
|
54
|
+
claimId: 'D3446@',
|
|
55
|
+
claimDateString: '2019-02-05',
|
|
56
|
+
amountChargedString: '$71.00',
|
|
57
|
+
amountBenefitPaidString: '$37.60',
|
|
58
|
+
amountDepositedString: '$10.00'
|
|
59
|
+
}, {
|
|
60
|
+
claimId: 'E8227@',
|
|
61
|
+
claimDateString: '2019-02-05',
|
|
62
|
+
amountChargedString: '$43.50',
|
|
63
|
+
amountBenefitPaidString: '$43.50',
|
|
64
|
+
amountDepositedString: '$12.50'
|
|
65
|
+
}]
|
|
66
|
+
}; // Eclipse
|
|
67
|
+
|
|
68
|
+
var processingReportEclipseDefault = {
|
|
69
|
+
transactionId: 'PAO00000J4aw564Wtde1UeJe',
|
|
70
|
+
status: 'SUCCESS',
|
|
71
|
+
report: {
|
|
72
|
+
status: 'COMPLETE',
|
|
73
|
+
claimSummary: {
|
|
74
|
+
accountReferenceId: '1234'
|
|
75
|
+
},
|
|
76
|
+
medicareStatus: {
|
|
77
|
+
status: {
|
|
78
|
+
code: 0,
|
|
79
|
+
text: 'Patient is eligible to claim for Medicare with details provided.'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
healthFundStatus: {
|
|
83
|
+
status: {
|
|
84
|
+
code: 0,
|
|
85
|
+
text: 'Patient is known to the Health Fund specified in the request.'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
healthFundAssessment: {
|
|
89
|
+
medicalEvent: [{
|
|
90
|
+
id: '01',
|
|
91
|
+
service: [{
|
|
92
|
+
explanation: [{
|
|
93
|
+
code: 2013,
|
|
94
|
+
text: 'Charge is equal to or less than MBS fee'
|
|
95
|
+
}],
|
|
96
|
+
assessmentCode: 'A',
|
|
97
|
+
benefit: 592,
|
|
98
|
+
chargeAmount: 23680,
|
|
99
|
+
dateOfService: '2022-07-01',
|
|
100
|
+
id: '0101',
|
|
101
|
+
itemNumber: '11018',
|
|
102
|
+
scheduleFee: 23680,
|
|
103
|
+
benefitString: '$5.92',
|
|
104
|
+
chargeAmountString: '$236.80',
|
|
105
|
+
scheduleFeeString: '$236.80'
|
|
106
|
+
}, {
|
|
107
|
+
explanation: [{
|
|
108
|
+
code: 2013,
|
|
109
|
+
text: 'Charge is equal to or less than MBS fee'
|
|
110
|
+
}],
|
|
111
|
+
assessmentCode: 'A',
|
|
112
|
+
benefit: 324,
|
|
113
|
+
chargeAmount: 12975,
|
|
114
|
+
dateOfService: '2022-07-08',
|
|
115
|
+
id: '0102',
|
|
116
|
+
itemNumber: '11235',
|
|
117
|
+
scheduleFee: 12975,
|
|
118
|
+
benefitString: '$3.24',
|
|
119
|
+
chargeAmountString: '$129.75',
|
|
120
|
+
scheduleFeeString: '$129.75'
|
|
121
|
+
}]
|
|
122
|
+
}],
|
|
123
|
+
explanation: [{
|
|
124
|
+
code: 0,
|
|
125
|
+
text: 'Claim has been successfully assessed'
|
|
126
|
+
}],
|
|
127
|
+
assessmentCode: 'A',
|
|
128
|
+
authorityToPayInd: 'Y'
|
|
129
|
+
},
|
|
130
|
+
medicareAssessment: {
|
|
131
|
+
currentPatient: {
|
|
132
|
+
currentMembership: {}
|
|
133
|
+
},
|
|
134
|
+
medicalEvent: [{
|
|
135
|
+
service: [{
|
|
136
|
+
id: '0101',
|
|
137
|
+
benefit: 17760,
|
|
138
|
+
chargeAmount: 23680,
|
|
139
|
+
dateOfService: '2022-07-01',
|
|
140
|
+
explanationCode: '0',
|
|
141
|
+
itemNumber: '11018',
|
|
142
|
+
scheduleFee: 23680,
|
|
143
|
+
benefitString: '$177.60',
|
|
144
|
+
chargeAmountString: '$236.80',
|
|
145
|
+
scheduleFeeString: '$236.80'
|
|
146
|
+
}, {
|
|
147
|
+
id: '0102',
|
|
148
|
+
benefit: 9735,
|
|
149
|
+
chargeAmount: 12975,
|
|
150
|
+
dateOfService: '2022-07-08',
|
|
151
|
+
explanationCode: '0',
|
|
152
|
+
itemNumber: '11235',
|
|
153
|
+
scheduleFee: 12975,
|
|
154
|
+
benefitString: '$97.35',
|
|
155
|
+
chargeAmountString: '$129.75',
|
|
156
|
+
scheduleFeeString: '$129.75'
|
|
157
|
+
}],
|
|
158
|
+
id: '01',
|
|
159
|
+
cardFlagCode: ' '
|
|
160
|
+
}],
|
|
161
|
+
claimId: '30670',
|
|
162
|
+
fundLocationId: 'AAA99556',
|
|
163
|
+
lodgementDate: '2022-07-08'
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
var paymentReportEclipseDefault = {
|
|
168
|
+
transactionId: 'AAA99556ffff62c76f48e700',
|
|
169
|
+
status: 'SUCCESS',
|
|
170
|
+
report: {
|
|
171
|
+
partNumber: 1,
|
|
172
|
+
partTotal: 1,
|
|
173
|
+
payeeLocationId: 'PAO00000',
|
|
174
|
+
remittanceAdviceId: 'TSTADV123',
|
|
175
|
+
paymentInfo: {
|
|
176
|
+
accountInfo: {
|
|
177
|
+
accountName: 'Dummy Health Fund Account',
|
|
178
|
+
accountNumber: '*****6789',
|
|
179
|
+
bsbCode: '002913'
|
|
180
|
+
},
|
|
181
|
+
depositAmount: 28411,
|
|
182
|
+
paymentReference: 'HHF00041012NAB2004REMADVA99967',
|
|
183
|
+
depositAmountString: '$284.11'
|
|
184
|
+
},
|
|
185
|
+
paymentRun: {
|
|
186
|
+
payerName: 'Mock Health Fund Pty Ltd',
|
|
187
|
+
runDate: '2022-07-08'
|
|
188
|
+
},
|
|
189
|
+
claimSummary: [{
|
|
190
|
+
accountReferenceId: '1234',
|
|
191
|
+
benefit: 28411,
|
|
192
|
+
channelCode: 'SB4',
|
|
193
|
+
claimId: '30670',
|
|
194
|
+
lodgementDate: '2022-07-08',
|
|
195
|
+
transactionId: 'PAO00000J4aw564Wtde1UeJe',
|
|
196
|
+
benefitString: '$284.11'
|
|
197
|
+
}]
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
exports.paymentReportDefault = paymentReportDefault;
|
|
202
|
+
exports.paymentReportEclipseDefault = paymentReportEclipseDefault;
|
|
203
|
+
exports.processingReportDefault = processingReportDefault;
|
|
204
|
+
exports.processingReportEclipseDefault = processingReportEclipseDefault;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var transactions = require('../../transactions-6e5fd92d.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.defaultTransaction = transactions.defaultTransaction;
|
|
10
|
+
exports.ghsTransactionCompleted = transactions.ghsTransactionCompleted;
|
|
11
|
+
exports.transactionForMemberRequestQuote = transactions.transactionForMemberRequestQuote;
|
|
12
|
+
exports.transactionForMemberRequestQuoteComplete = transactions.transactionForMemberRequestQuoteComplete;
|
|
13
|
+
exports.transactionQuoteDefault = transactions.transactionQuoteDefault;
|
|
14
|
+
exports.transactionWithApprovedInPersonPayment = transactions.transactionWithApprovedInPersonPayment;
|
|
15
|
+
exports.transactionWithApprovedPayment = transactions.transactionWithApprovedPayment;
|
|
16
|
+
exports.transactionWithClaim = transactions.transactionWithClaim;
|
|
17
|
+
exports.transactionWithMedicareClaim = transactions.transactionWithMedicareClaim;
|
|
18
|
+
exports.transactionWithMultipleRefundedPayments = transactions.transactionWithMultipleRefundedPayments;
|
|
19
|
+
exports.transactionWithOtherItems = transactions.transactionWithOtherItems;
|
|
20
|
+
exports.transactionWithPendingMedicareClaim = transactions.transactionWithPendingMedicareClaim;
|
|
21
|
+
exports.transactionWithPendingMedicareClaimAndClaimant = transactions.transactionWithPendingMedicareClaimAndClaimant;
|
|
22
|
+
exports.transactionWithRefundedPayment = transactions.transactionWithRefundedPayment;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var defaultWorkflowException = {
|
|
6
|
+
_id: 'workflowExceptionDefaultId',
|
|
7
|
+
funderId: 'funderDefaultId',
|
|
8
|
+
healthFundId: 'healthFundDefaultId',
|
|
9
|
+
code: '01',
|
|
10
|
+
fullName: 'Scanning error',
|
|
11
|
+
displayName: 'Scanning error',
|
|
12
|
+
description: 'Unable to scan invoice.',
|
|
13
|
+
searchWords: ['scanning error', '01'],
|
|
14
|
+
created: new Date('2018-01-01T00:00:00Z'),
|
|
15
|
+
modified: new Date('2018-02-02T00:00:00Z')
|
|
16
|
+
};
|
|
17
|
+
var anotherWorkflowException = {
|
|
18
|
+
_id: 'workflowDuplicateExceptionId',
|
|
19
|
+
funderId: 'funderDefaultId',
|
|
20
|
+
healthFundId: 'healthFundDefaultId',
|
|
21
|
+
code: '24',
|
|
22
|
+
fullName: 'Duplicate',
|
|
23
|
+
displayName: 'Duplicate',
|
|
24
|
+
description: 'Duplicate invoice detected.',
|
|
25
|
+
searchWords: ['duplicate', '24'],
|
|
26
|
+
omittableCodes: ['48'],
|
|
27
|
+
created: new Date('2018-01-01T00:00:00Z'),
|
|
28
|
+
modified: new Date('2018-02-02T00:00:00Z')
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.anotherWorkflowException = anotherWorkflowException;
|
|
32
|
+
exports.defaultWorkflowException = defaultWorkflowException;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
+
|
|
7
|
+
var React = _interopDefault(require('react'));
|
|
8
|
+
var enzyme = require('enzyme');
|
|
9
|
+
var Adapter = _interopDefault(require('enzyme-adapter-react-16'));
|
|
10
|
+
var toJSON = _interopDefault(require('enzyme-to-json'));
|
|
11
|
+
var _isEmpty = _interopDefault(require('lodash/isEmpty'));
|
|
12
|
+
|
|
13
|
+
var setupTestEnvironment = function setupTestEnvironment() {
|
|
14
|
+
enzyme.configure({
|
|
15
|
+
adapter: new Adapter()
|
|
16
|
+
});
|
|
17
|
+
}; // Setup component using Enzyme
|
|
18
|
+
|
|
19
|
+
var setupComponent = function setupComponent(component, initialProps, initialState) {
|
|
20
|
+
var wrapper = enzyme.shallow(React.createElement(component, initialProps));
|
|
21
|
+
|
|
22
|
+
if (!_isEmpty(initialState)) {
|
|
23
|
+
wrapper.setState(initialState);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var wrapperJSON = toJSON(wrapper);
|
|
27
|
+
var wrapperInstance = wrapper.instance();
|
|
28
|
+
return {
|
|
29
|
+
wrapper: wrapper,
|
|
30
|
+
wrapperInstance: wrapperInstance,
|
|
31
|
+
wrapperJSON: wrapperJSON
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
var react = {};
|
|
35
|
+
|
|
36
|
+
exports.default = react;
|
|
37
|
+
exports.setupComponent = setupComponent;
|
|
38
|
+
exports.setupTestEnvironment = setupTestEnvironment;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var INVOICE_SECTION = Object.freeze({
|
|
6
|
+
BANK_DETAILS: 'BankDetails',
|
|
7
|
+
BILLED_TO: 'BilledTo',
|
|
8
|
+
BOTTOM_ACTION: 'BottomAction',
|
|
9
|
+
CLAIMANT: 'Patient',
|
|
10
|
+
DOCUMENTS: 'Documents',
|
|
11
|
+
INSTALMENT_PLAN_SCHEDULE: 'InstalmentPlanSchedule',
|
|
12
|
+
INVOICE_OVERVIEW: 'InvoiceOverview',
|
|
13
|
+
MESSAGES: 'Messages',
|
|
14
|
+
NOTES: 'Notes',
|
|
15
|
+
PATIENT: 'Patient',
|
|
16
|
+
PAYEE_PROVIDER: 'PayeeProvider',
|
|
17
|
+
PAYMENTS: 'Payments',
|
|
18
|
+
PRACTICE: 'Practice',
|
|
19
|
+
PROVIDER: 'Provider',
|
|
20
|
+
REFERRAL: 'Referral',
|
|
21
|
+
SERVICE_ITEMS: 'ServiceItems',
|
|
22
|
+
SERVICE_TOTALS: 'ServiceTotals',
|
|
23
|
+
STATEMENT: 'Statement',
|
|
24
|
+
SETTLEMENT_BANK_DETAILS: 'SettlementBankDetails',
|
|
25
|
+
TOP_ACTION: 'TopAction',
|
|
26
|
+
TRANSACTION_PAYMENT_CARD_FORM: 'TransactionPaymentCardForm',
|
|
27
|
+
TRANSACTION_REPORTS_BUTTONS: 'TransactionReportsButtons',
|
|
28
|
+
WSQ_TRANSACTION_DETAILS_MESSAGE: 'TransactionDetailsMessage'
|
|
29
|
+
});
|
|
30
|
+
var ADF_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
31
|
+
var COMCARE_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.DOCUMENTS, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.NOTES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
32
|
+
var DVA_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.REFERRAL, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.STATEMENT, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM, INVOICE_SECTION.TRANSACTION_REPORTS_BUTTONS]);
|
|
33
|
+
var ECLIPSE_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
34
|
+
var GARRISON_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
35
|
+
var HBF_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
36
|
+
var HEALTHPOINT_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
37
|
+
var HICAPS_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
38
|
+
var ICARE_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.DOCUMENTS, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.NOTES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
39
|
+
var MEDICARE_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.CLAIMANT, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.REFERRAL, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.STATEMENT, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM, INVOICE_SECTION.TRANSACTION_REPORTS_BUTTONS]);
|
|
40
|
+
var NIB_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.REFERRAL, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
41
|
+
var NDIS_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
42
|
+
var OHC_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
43
|
+
var PATIENT_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
44
|
+
var WCQ_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM, INVOICE_SECTION.WSQ_TRANSACTION_DETAILS_MESSAGE]);
|
|
45
|
+
var WSV_SECTIONS = Object.freeze([INVOICE_SECTION.BILLED_TO, INVOICE_SECTION.INSTALMENT_PLAN_SCHEDULE, INVOICE_SECTION.INVOICE_OVERVIEW, INVOICE_SECTION.MESSAGES, INVOICE_SECTION.PATIENT, INVOICE_SECTION.PAYEE_PROVIDER, INVOICE_SECTION.PAYMENTS, INVOICE_SECTION.PRACTICE, INVOICE_SECTION.PROVIDER, INVOICE_SECTION.SERVICE_ITEMS, INVOICE_SECTION.SERVICE_TOTALS, INVOICE_SECTION.TOP_ACTION, INVOICE_SECTION.TRANSACTION_PAYMENT_CARD_FORM]);
|
|
46
|
+
var funderSections = Object.freeze({
|
|
47
|
+
adf: ADF_SECTIONS,
|
|
48
|
+
comcare: COMCARE_SECTIONS,
|
|
49
|
+
dva: DVA_SECTIONS,
|
|
50
|
+
eclipse: ECLIPSE_SECTIONS,
|
|
51
|
+
ghs: GARRISON_SECTIONS,
|
|
52
|
+
hbf: HBF_SECTIONS,
|
|
53
|
+
healthpoint: HEALTHPOINT_SECTIONS,
|
|
54
|
+
nab: HICAPS_SECTIONS,
|
|
55
|
+
icare: ICARE_SECTIONS,
|
|
56
|
+
medicare: MEDICARE_SECTIONS,
|
|
57
|
+
nib: NIB_SECTIONS,
|
|
58
|
+
ndis: NDIS_SECTIONS,
|
|
59
|
+
ohc: OHC_SECTIONS,
|
|
60
|
+
'patient-funded': PATIENT_SECTIONS,
|
|
61
|
+
wcq: WCQ_SECTIONS,
|
|
62
|
+
wsv: WSV_SECTIONS
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* Returns whether the funder with the provided `funderCode` has a transaction details section
|
|
66
|
+
* enabled. `section` must be one of the supported `INVOICE_SECTION` sections.
|
|
67
|
+
*
|
|
68
|
+
* Default to section support if no funder code is provided, to allow patient claims to be
|
|
69
|
+
* supported for all sections.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
var isFunderSectionSupported = function isFunderSectionSupported(funderCode, section) {
|
|
73
|
+
if (!funderCode || !funderSections[funderCode]) {
|
|
74
|
+
return PATIENT_SECTIONS.includes(section);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return funderSections[funderCode].includes(section);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.INVOICE_SECTION = INVOICE_SECTION;
|
|
81
|
+
exports.isFunderSectionSupported = isFunderSectionSupported;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var constants = require('./constants.js');
|
|
6
|
+
|
|
7
|
+
var _CONSUMER, _PROVIDER;
|
|
8
|
+
var transactionStatusFormatted = {
|
|
9
|
+
CONSUMER: (_CONSUMER = {}, _CONSUMER[constants.TRANSACTION_STATUSES.COMPLETED] = 'Paid', _CONSUMER[constants.TRANSACTION_STATUSES.CANCELLED] = 'Cancelled', _CONSUMER[constants.TRANSACTION_STATUSES.PENDING] = 'Requested', _CONSUMER[constants.TRANSACTION_STATUSES.ERRORED] = 'Error', _CONSUMER[constants.TRANSACTION_STATUSES.REFUNDED] = 'Refunded', _CONSUMER[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED] = 'Paid', _CONSUMER),
|
|
10
|
+
PROVIDER: (_PROVIDER = {}, _PROVIDER[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED] = 'Partial refund', _PROVIDER[constants.TRANSACTION_STATUSES.UNDER_REVIEW] = 'Under review', _PROVIDER[constants.TRANSACTION_STATUSES.ERRORED] = 'Errored', _PROVIDER)
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.default = transactionStatusFormatted;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
+
|
|
7
|
+
var constants = require('./constants.js');
|
|
8
|
+
var _capitalize = _interopDefault(require('lodash/capitalize'));
|
|
9
|
+
var claimPaymentStatusIcons = require('./claim-payment-status-icons.js');
|
|
10
|
+
var claimPaymentStatusTextClasses = require('./claim-payment-status-text-classes.js');
|
|
11
|
+
|
|
12
|
+
var getPaymentStatus = function getPaymentStatus(_ref) {
|
|
13
|
+
var paymentStatus = _ref.paymentStatus,
|
|
14
|
+
transactionStatus = _ref.transactionStatus,
|
|
15
|
+
hasNoGap = _ref.hasNoGap,
|
|
16
|
+
paidInPerson = _ref.paidInPerson;
|
|
17
|
+
|
|
18
|
+
if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
|
|
19
|
+
return 'Voided';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (hasNoGap) {
|
|
23
|
+
return 'Not needed';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (paidInPerson) {
|
|
27
|
+
return 'Paid in person';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return paymentStatus ? _capitalize(paymentStatus) : 'Pending';
|
|
31
|
+
};
|
|
32
|
+
var getPaymentTextClass = function getPaymentTextClass(_ref2) {
|
|
33
|
+
var paymentStatus = _ref2.paymentStatus,
|
|
34
|
+
transactionStatus = _ref2.transactionStatus,
|
|
35
|
+
hasNoGap = _ref2.hasNoGap,
|
|
36
|
+
paidInPerson = _ref2.paidInPerson;
|
|
37
|
+
|
|
38
|
+
if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
|
|
39
|
+
return 'danger';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (hasNoGap) {
|
|
43
|
+
return 'success';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (paidInPerson) {
|
|
47
|
+
return 'gray';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return claimPaymentStatusTextClasses.default[paymentStatus] || 'warning';
|
|
51
|
+
};
|
|
52
|
+
var getPaymentIcon = function getPaymentIcon(_ref3) {
|
|
53
|
+
var paymentStatus = _ref3.paymentStatus,
|
|
54
|
+
transactionStatus = _ref3.transactionStatus,
|
|
55
|
+
hasNoGap = _ref3.hasNoGap,
|
|
56
|
+
paidInPerson = _ref3.paidInPerson;
|
|
57
|
+
|
|
58
|
+
if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
|
|
59
|
+
return 'fa-times-circle';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (hasNoGap) {
|
|
63
|
+
return 'fa-check-circle';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (paidInPerson) {
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return claimPaymentStatusIcons.default[paymentStatus] || 'fa-clock';
|
|
71
|
+
};
|
|
72
|
+
var transactionStatusHelpers = {};
|
|
73
|
+
|
|
74
|
+
exports.default = transactionStatusHelpers;
|
|
75
|
+
exports.getPaymentIcon = getPaymentIcon;
|
|
76
|
+
exports.getPaymentStatus = getPaymentStatus;
|
|
77
|
+
exports.getPaymentTextClass = getPaymentTextClass;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var constants = require('./constants.js');
|
|
6
|
+
|
|
7
|
+
var _TRANSACTION_STATUSES;
|
|
8
|
+
var transactionStatusIcons = (_TRANSACTION_STATUSES = {}, _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.COMPLETED] = 'fas fa-check', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.CANCELLED] = 'fas fa-times', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.PENDING] = 'fas fa-clock', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.UNDER_REVIEW] = 'fas fa-clock', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED] = 'fas fa-check', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.REFUNDED] = 'fas fa-undo', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.ERRORED] = 'fa fa-exclamation-triangle', _TRANSACTION_STATUSES);
|
|
9
|
+
|
|
10
|
+
exports.default = transactionStatusIcons;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var constants = require('./constants.js');
|
|
6
|
+
|
|
7
|
+
var _TRANSACTION_STATUSES;
|
|
8
|
+
var transactionStatusTextClasses = (_TRANSACTION_STATUSES = {}, _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.NEW] = 'primary', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.PENDING] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.REQUESTED] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.COMPLETED] = 'success', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.CANCELLED] = 'danger', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.REFUNDED] = '', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED] = 'success', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.UNDER_REVIEW] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.ERRORED] = 'danger', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.SUBMITTED] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.OUTSTANDING] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.DECLINED] = 'danger', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.APPROVED] = 'success', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.ARCHIVED] = '', _TRANSACTION_STATUSES);
|
|
9
|
+
|
|
10
|
+
exports.default = transactionStatusTextClasses;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
+
|
|
7
|
+
var _get = _interopDefault(require('lodash/get'));
|
|
8
|
+
var constants = require('@medipass/utils/constants');
|
|
9
|
+
var funders = require('@medipass/utils/funders');
|
|
10
|
+
|
|
11
|
+
function getOverrideStatus(transaction, defaultStatus) {
|
|
12
|
+
var status = defaultStatus;
|
|
13
|
+
|
|
14
|
+
if (funders.isMedicare(_get(transaction, 'claims[0].funder.code'))) {
|
|
15
|
+
var isClaimRejected = _get(transaction, 'claims[0].status') === constants.TRANSACTION_STATUSES.REJECTED;
|
|
16
|
+
var isTransactionCompleted = transaction.status === constants.TRANSACTION_STATUSES.COMPLETED;
|
|
17
|
+
|
|
18
|
+
var hasMedicareErrored = _get(transaction, 'medicare.hasFatalError');
|
|
19
|
+
|
|
20
|
+
if (isClaimRejected && isTransactionCompleted && !hasMedicareErrored) {
|
|
21
|
+
status = constants.TRANSACTION_STATUSES.UNDER_REVIEW;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var isClaimPending = _get(transaction, 'claims[0].status') === constants.TRANSACTION_STATUSES.PENDING && transaction.status !== constants.TRANSACTION_STATUSES.CANCELLED;
|
|
25
|
+
|
|
26
|
+
if (isClaimPending) {
|
|
27
|
+
status = constants.TRANSACTION_STATUSES.PENDING;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (funders.isIcare(_get(transaction, 'claims[0].funder.code')) && _get(transaction, '_schemaVersion') === '2') {
|
|
32
|
+
var _isClaimPending = _get(transaction, 'status') === constants.TRANSACTION_STATUSES.PENDING;
|
|
33
|
+
|
|
34
|
+
if (_isClaimPending) {
|
|
35
|
+
status = constants.TRANSACTION_STATUSES.SUBMITTED;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return status;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.getOverrideStatus = getOverrideStatus;
|