@medipass/utils 11.79.2-chore-environment-variables.0 → 11.79.2-chore-environment-variables.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/abn.js +87 -0
- package/billable-items-f8291b1e.js +27 -0
- package/build-validation-schema.js +1284 -0
- package/businesses-2633ab9b.js +53 -0
- package/chart.js +50 -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 +443 -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/env.d.ts +0 -1
- package/env.js +40 -0
- package/form-applications/assign-values-to-sections.js +33 -0
- package/forms-e1c51a53.js +51 -0
- package/funders.js +110 -0
- package/get-env.js +189 -0
- package/get-select-options.js +66 -0
- package/get-staff-type-display-name.js +13 -0
- package/google-addresses.js +132 -0
- package/health-fund-accounts-88eac93c.js +20 -0
- package/health-fund-settings-e7a0f2ec.js +22 -0
- package/health-funds-7fea63a0.js +194 -0
- package/i18n/index.js +57 -0
- package/i18n/translations.js +36 -0
- package/index.js +58 -0
- package/intercom.js +110 -0
- package/members-8eb8d8d0.js +53 -0
- package/modalities-2dfbea63.js +19 -0
- package/package.json +2 -2
- package/parse-health-fund-card-fields.js +16 -0
- package/patients-dd3709c1.js +46 -0
- package/payment-methods-d36bc018.js +26 -0
- package/payment-options.js +63 -0
- package/practices-d6c480f1.js +87 -0
- package/products-0a392564.js +83 -0
- package/products.js +30 -0
- package/professional-categories-157d1767.js +19 -0
- package/redux-actions.js +172 -0
- package/redux-reducer.js +116 -0
- package/sanitise-url.js +19 -0
- package/scroll.js +14 -0
- package/sensitive-keys.js +9 -0
- package/sentry.js +110 -0
- package/service-items.js +208 -0
- package/services-f8480eba.js +127 -0
- package/specialties-25fbb171.js +20 -0
- package/staff-646053b7.js +161 -0
- package/status-icons.js +10 -0
- package/status-text-classes.js +10 -0
- package/subscriptions-aef302aa.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 +118 -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 +241 -0
- package/test-framework/fixtures/transactions.js +21 -0
- package/test-framework/fixtures/workflow-exceptions.js +32 -0
- package/test-framework/react.js +37 -0
- package/transaction-details-by-funder.js +80 -0
- package/transaction-status-formatted.js +13 -0
- package/transaction-status-helpers.js +72 -0
- package/transaction-status-icons.js +10 -0
- package/transaction-status-text-classes.js +10 -0
- package/transaction-status.js +35 -0
- package/transactions-de03f65c.js +1757 -0
- package/validate-form.js +421 -0
- package/validate.js +63 -0
- package/webpack-config.js +29 -0
- package/workflow-state-formatted-text-classes.js +12 -0
- package/workflow-state-formatted.js +13 -0
package/abn.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var ABN_LENGTH = 11;
|
|
6
|
+
var ACN_LENGTH = 9;
|
|
7
|
+
var normaliseAbn = function normaliseAbn(abn) {
|
|
8
|
+
var trimmedABN = abn == null ? void 0 : abn.replace(/\s/g, '');
|
|
9
|
+
|
|
10
|
+
// The input is an ABN, in which case the format should be 99 999 999 999
|
|
11
|
+
if (trimmedABN.length === ABN_LENGTH) {
|
|
12
|
+
return trimmedABN.substring(0, 2) + ' ' + trimmedABN.substring(2, 5) + ' ' + trimmedABN.substring(5, 8) + ' ' + trimmedABN.substring(8);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//The input is an ACN, in which case the format should be 999 999 999
|
|
16
|
+
if (trimmedABN.length === ACN_LENGTH) {
|
|
17
|
+
return trimmedABN.substring(0, 3) + ' ' + trimmedABN.substring(3, 6) + ' ' + trimmedABN.substring(6);
|
|
18
|
+
}
|
|
19
|
+
return abn;
|
|
20
|
+
};
|
|
21
|
+
var isValidAbn = function isValidAbn(abn) {
|
|
22
|
+
var VALID_ABN_LENGTH = 11;
|
|
23
|
+
|
|
24
|
+
// strip whitespace from value
|
|
25
|
+
abn = String(abn).replace(/\s+/g, '');
|
|
26
|
+
if (abn.length === VALID_ABN_LENGTH) {
|
|
27
|
+
var weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19];
|
|
28
|
+
var abnArray = [];
|
|
29
|
+
for (var i = 0; i < abn.length; i++) {
|
|
30
|
+
abnArray[i] = abn.charAt(i);
|
|
31
|
+
}
|
|
32
|
+
// subtract 1 from the left-most digit
|
|
33
|
+
// @ts-expect-error TS(2362): The left-hand side of an arithmetic operation must... Remove this comment to see the full error message
|
|
34
|
+
abnArray[0] -= 1;
|
|
35
|
+
// multiply each of the digits by its weighting factor
|
|
36
|
+
for (var _i = 0; _i < abnArray.length; _i++) {
|
|
37
|
+
// @ts-expect-error TS(2362): The left-hand side of an arithmetic operation must... Remove this comment to see the full error message
|
|
38
|
+
abnArray[_i] *= weights[_i];
|
|
39
|
+
}
|
|
40
|
+
// sum all the digits
|
|
41
|
+
var abnSum = 0;
|
|
42
|
+
for (var _i2 = 0; _i2 < abnArray.length; _i2++) {
|
|
43
|
+
// @ts-expect-error TS(2322): Type 'string' is not assignable to type 'number'.
|
|
44
|
+
abnSum += abnArray[_i2];
|
|
45
|
+
}
|
|
46
|
+
return abnSum % 89 === 0;
|
|
47
|
+
} else {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var isValidAcn = function isValidAcn(acn) {
|
|
52
|
+
var VALID_ACN_LENGTH = 9;
|
|
53
|
+
|
|
54
|
+
// strip whitespace from value
|
|
55
|
+
acn = String(acn).replace(/\s+/g, '');
|
|
56
|
+
if (acn.length === VALID_ACN_LENGTH) {
|
|
57
|
+
var weights = [8, 7, 6, 5, 4, 3, 2, 1];
|
|
58
|
+
var acnArray = [];
|
|
59
|
+
for (var i = 0; i < acn.length; i++) {
|
|
60
|
+
acnArray[i] = parseInt(acn.charAt(i));
|
|
61
|
+
}
|
|
62
|
+
var acnSum = 0;
|
|
63
|
+
|
|
64
|
+
// sum the digits 1-8
|
|
65
|
+
for (var _i3 = 0; _i3 < weights.length; _i3++) {
|
|
66
|
+
acnSum = acnSum + acnArray[_i3] * weights[_i3];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// divide by 10 and take remainder
|
|
70
|
+
var remainder = acnSum % 10;
|
|
71
|
+
|
|
72
|
+
// complement the remainder to 10
|
|
73
|
+
var complement = 10 - remainder;
|
|
74
|
+
|
|
75
|
+
// if the complement equals 10, set it to 0
|
|
76
|
+
if (complement === 10) {
|
|
77
|
+
complement = 0;
|
|
78
|
+
}
|
|
79
|
+
return acnArray[8] === complement;
|
|
80
|
+
} else {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.isValidAbn = isValidAbn;
|
|
86
|
+
exports.isValidAcn = isValidAcn;
|
|
87
|
+
exports.normaliseAbn = normaliseAbn;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultBillableItem = {
|
|
4
|
+
_id: 'billableItemDefaultId',
|
|
5
|
+
organisationId: 'organisationDefaultId',
|
|
6
|
+
businessId: 'businessDefaultId',
|
|
7
|
+
practiceId: 'practiceDefaultId',
|
|
8
|
+
modalityId: 'modalityDefaultId',
|
|
9
|
+
staffId: 'staffPractitionerDefaultId',
|
|
10
|
+
itemCode: 'mockItemCode',
|
|
11
|
+
fullName: 'mockFullName',
|
|
12
|
+
displayName: 'mockDisplayName',
|
|
13
|
+
description: 'mockDescription',
|
|
14
|
+
price: 4000,
|
|
15
|
+
searchWords: ['mockitemcode', 'mockfullname', 'mockdisplayname'],
|
|
16
|
+
status: 'ACTIVE',
|
|
17
|
+
created: new Date('2015-01-01T00:00:00'),
|
|
18
|
+
modified: new Date('2015-01-02T00:00:00Z')
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var billableItems = /*#__PURE__*/Object.freeze({
|
|
22
|
+
__proto__: null,
|
|
23
|
+
defaultBillableItem: defaultBillableItem
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
exports.billableItems = billableItems;
|
|
27
|
+
exports.defaultBillableItem = defaultBillableItem;
|