@medipass/utils 11.81.2 → 11.81.4-feature-qbe.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/constants.d.ts +3 -0
- package/constants.js +4 -2
- package/funders.d.ts +4 -3
- package/funders.js +8 -2
- package/google-addresses.d.ts +13 -8
- package/google-addresses.js +13 -25
- package/package.json +4 -3
package/constants.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export declare const FUNDERS: {
|
|
|
76
76
|
readonly NDIS: "ndis";
|
|
77
77
|
readonly OHC: "ohc";
|
|
78
78
|
readonly PATIENT: "patient-funded";
|
|
79
|
+
readonly QBE: "qbe";
|
|
79
80
|
readonly WCQ: "wcq";
|
|
80
81
|
readonly WSV: "wsv";
|
|
81
82
|
};
|
|
@@ -91,6 +92,7 @@ export declare const FUNDERS_FORMATTED: {
|
|
|
91
92
|
readonly nib: "NIB";
|
|
92
93
|
readonly ohc: "Overseas health cover";
|
|
93
94
|
readonly "patient-funded": "Patient funded";
|
|
95
|
+
readonly qbe: "QBE";
|
|
94
96
|
readonly wcq: "Workcover Queensland";
|
|
95
97
|
readonly wsv: "WorkSafe Victoria";
|
|
96
98
|
};
|
|
@@ -277,6 +279,7 @@ export declare const INVOICE_ORIGINATING_FLOW: {
|
|
|
277
279
|
readonly VIRTUAL_TERMINAL: "virtual-terminal";
|
|
278
280
|
readonly WORK_COVER_QUEENSLAND: "wcq";
|
|
279
281
|
readonly WORKSAFE_VICTORIA: "wsv";
|
|
282
|
+
readonly QBE: "qbe";
|
|
280
283
|
};
|
|
281
284
|
export declare const STAFF_TYPES: {
|
|
282
285
|
readonly LOCATION: "location";
|
package/constants.js
CHANGED
|
@@ -100,10 +100,11 @@ var FUNDERS = {
|
|
|
100
100
|
NDIS: 'ndis',
|
|
101
101
|
OHC: 'ohc',
|
|
102
102
|
PATIENT: 'patient-funded',
|
|
103
|
+
QBE: 'qbe',
|
|
103
104
|
WCQ: 'wcq',
|
|
104
105
|
WSV: 'wsv'
|
|
105
106
|
};
|
|
106
|
-
var FUNDERS_FORMATTED = (_FUNDERS_FORMATTED = {}, _FUNDERS_FORMATTED[FUNDERS.COMCARE] = 'Comcare', _FUNDERS_FORMATTED[FUNDERS.ECLIPSE] = 'Eclipse', _FUNDERS_FORMATTED[FUNDERS.HBF] = 'HBF', _FUNDERS_FORMATTED[FUNDERS.HEALTHPOINT] = 'HEALTHPOINT', _FUNDERS_FORMATTED[FUNDERS.HICAPS] = 'HICAPS', _FUNDERS_FORMATTED[FUNDERS.ICARE] = 'icare', _FUNDERS_FORMATTED[FUNDERS.MEDICARE] = 'Medicare', _FUNDERS_FORMATTED[FUNDERS.NDIS] = 'NDIS', _FUNDERS_FORMATTED[FUNDERS.NIB] = 'NIB', _FUNDERS_FORMATTED[FUNDERS.OHC] = 'Overseas health cover', _FUNDERS_FORMATTED[FUNDERS.PATIENT] = 'Patient funded', _FUNDERS_FORMATTED[FUNDERS.WCQ] = 'Workcover Queensland', _FUNDERS_FORMATTED[FUNDERS.WSV] = 'WorkSafe Victoria', _FUNDERS_FORMATTED);
|
|
107
|
+
var FUNDERS_FORMATTED = (_FUNDERS_FORMATTED = {}, _FUNDERS_FORMATTED[FUNDERS.COMCARE] = 'Comcare', _FUNDERS_FORMATTED[FUNDERS.ECLIPSE] = 'Eclipse', _FUNDERS_FORMATTED[FUNDERS.HBF] = 'HBF', _FUNDERS_FORMATTED[FUNDERS.HEALTHPOINT] = 'HEALTHPOINT', _FUNDERS_FORMATTED[FUNDERS.HICAPS] = 'HICAPS', _FUNDERS_FORMATTED[FUNDERS.ICARE] = 'icare', _FUNDERS_FORMATTED[FUNDERS.MEDICARE] = 'Medicare', _FUNDERS_FORMATTED[FUNDERS.NDIS] = 'NDIS', _FUNDERS_FORMATTED[FUNDERS.NIB] = 'NIB', _FUNDERS_FORMATTED[FUNDERS.OHC] = 'Overseas health cover', _FUNDERS_FORMATTED[FUNDERS.PATIENT] = 'Patient funded', _FUNDERS_FORMATTED[FUNDERS.QBE] = 'QBE', _FUNDERS_FORMATTED[FUNDERS.WCQ] = 'Workcover Queensland', _FUNDERS_FORMATTED[FUNDERS.WSV] = 'WorkSafe Victoria', _FUNDERS_FORMATTED);
|
|
107
108
|
/* ====== END: FUNDERS ======= */
|
|
108
109
|
|
|
109
110
|
/* ====== START: FUTURES ======= */
|
|
@@ -346,7 +347,8 @@ var INVOICE_ORIGINATING_FLOW = {
|
|
|
346
347
|
PATIENT_FUNDED: 'patient-funded',
|
|
347
348
|
VIRTUAL_TERMINAL: 'virtual-terminal',
|
|
348
349
|
WORK_COVER_QUEENSLAND: 'wcq',
|
|
349
|
-
WORKSAFE_VICTORIA: 'wsv'
|
|
350
|
+
WORKSAFE_VICTORIA: 'wsv',
|
|
351
|
+
QBE: 'qbe'
|
|
350
352
|
};
|
|
351
353
|
/* ====== END: INVOICE_ORIGINATING_FLOW ======= */
|
|
352
354
|
|
package/funders.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const FUNDERS_WITH_ONBOARDING: readonly ["nab", "medicare", "icare", "wcq", "comcare", "wsv", "nib"];
|
|
2
|
-
export declare const CLAIMABLE_FUNDERS: readonly ["comcare", "dva", "eclipse", "healthpoint", "nab", "icare", "medicare", "nib", "ohc", "wcq", "wsv"];
|
|
3
|
-
export declare const getFunderCodeFromTransaction: (transaction: Record<string, any>, funderCode?: string) => "comcare" | "dva" | "eclipse" | "hbf" | "healthpoint" | "nab" | "icare" | "medicare" | "nib" | "ndis" | "ohc" | "patient-funded" | "wcq" | "wsv";
|
|
1
|
+
export declare const FUNDERS_WITH_ONBOARDING: readonly ["nab", "medicare", "icare", "wcq", "comcare", "wsv", "nib", "qbe"];
|
|
2
|
+
export declare const CLAIMABLE_FUNDERS: readonly ["comcare", "dva", "eclipse", "healthpoint", "nab", "icare", "medicare", "nib", "ohc", "qbe", "wcq", "wsv"];
|
|
3
|
+
export declare const getFunderCodeFromTransaction: (transaction: Record<string, any>, funderCode?: string) => "comcare" | "dva" | "eclipse" | "hbf" | "healthpoint" | "nab" | "icare" | "medicare" | "nib" | "ndis" | "ohc" | "patient-funded" | "qbe" | "wcq" | "wsv";
|
|
4
4
|
export declare const isComcare: (funderCode: string) => boolean;
|
|
5
5
|
export declare const isDVA: (funderCode: string) => boolean;
|
|
6
6
|
export declare const isEclipse: (funderCode: string) => boolean;
|
|
@@ -13,6 +13,7 @@ export declare const isNDIS: (funderCode: string) => boolean;
|
|
|
13
13
|
export declare const isNib: (funderCode: string) => boolean;
|
|
14
14
|
export declare const isOHC: (funderCode: string) => boolean;
|
|
15
15
|
export declare const isPatientFunded: (funderCode: string) => boolean;
|
|
16
|
+
export declare const isQBE: (funderCode: string) => boolean;
|
|
16
17
|
export declare const isWCQ: (funderCode: string) => boolean;
|
|
17
18
|
export declare const isWSV: (funderCode: string) => boolean;
|
|
18
19
|
export declare const isFunderClaimable: (funderCode: string) => boolean;
|
package/funders.js
CHANGED
|
@@ -9,8 +9,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var _get__default = /*#__PURE__*/_interopDefaultLegacy(_get);
|
|
11
11
|
|
|
12
|
-
var FUNDERS_WITH_ONBOARDING = [constants.FUNDERS.HICAPS, constants.FUNDERS.MEDICARE, constants.FUNDERS.ICARE, constants.FUNDERS.WCQ, constants.FUNDERS.COMCARE, constants.FUNDERS.WSV, constants.FUNDERS.NIB];
|
|
13
|
-
var CLAIMABLE_FUNDERS = [constants.FUNDERS.COMCARE, constants.FUNDERS.DVA, constants.FUNDERS.ECLIPSE, constants.FUNDERS.HEALTHPOINT, constants.FUNDERS.HICAPS, constants.FUNDERS.ICARE, constants.FUNDERS.MEDICARE, constants.FUNDERS.NIB, constants.FUNDERS.OHC, constants.FUNDERS.WCQ, constants.FUNDERS.WSV];
|
|
12
|
+
var FUNDERS_WITH_ONBOARDING = [constants.FUNDERS.HICAPS, constants.FUNDERS.MEDICARE, constants.FUNDERS.ICARE, constants.FUNDERS.WCQ, constants.FUNDERS.COMCARE, constants.FUNDERS.WSV, constants.FUNDERS.NIB, constants.FUNDERS.QBE];
|
|
13
|
+
var CLAIMABLE_FUNDERS = [constants.FUNDERS.COMCARE, constants.FUNDERS.DVA, constants.FUNDERS.ECLIPSE, constants.FUNDERS.HEALTHPOINT, constants.FUNDERS.HICAPS, constants.FUNDERS.ICARE, constants.FUNDERS.MEDICARE, constants.FUNDERS.NIB, constants.FUNDERS.OHC, constants.FUNDERS.QBE, constants.FUNDERS.WCQ, constants.FUNDERS.WSV];
|
|
14
14
|
var getFunderCodeFromTransaction = function getFunderCodeFromTransaction(transaction, funderCode) {
|
|
15
15
|
if (transaction.isPatientFunded || _get__default["default"](transaction, 'claims[0].isPatientFunded')) {
|
|
16
16
|
return constants.FUNDERS.PATIENT;
|
|
@@ -42,6 +42,8 @@ var getFunderCodeFromTransaction = function getFunderCodeFromTransaction(transac
|
|
|
42
42
|
return constants.FUNDERS.NIB;
|
|
43
43
|
} else if (funderCode === constants.FUNDERS.ECLIPSE) {
|
|
44
44
|
return constants.FUNDERS.ECLIPSE;
|
|
45
|
+
} else if (funderCode === constants.FUNDERS.QBE) {
|
|
46
|
+
return constants.FUNDERS.QBE;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
return constants.FUNDERS.PATIENT;
|
|
@@ -82,6 +84,9 @@ var isOHC = function isOHC(funderCode) {
|
|
|
82
84
|
var isPatientFunded = function isPatientFunded(funderCode) {
|
|
83
85
|
return funderCode === constants.FUNDERS.PATIENT;
|
|
84
86
|
};
|
|
87
|
+
var isQBE = function isQBE(funderCode) {
|
|
88
|
+
return funderCode === constants.FUNDERS.QBE;
|
|
89
|
+
};
|
|
85
90
|
var isWCQ = function isWCQ(funderCode) {
|
|
86
91
|
return funderCode === constants.FUNDERS.WCQ;
|
|
87
92
|
};
|
|
@@ -109,5 +114,6 @@ exports.isNDIS = isNDIS;
|
|
|
109
114
|
exports.isNib = isNib;
|
|
110
115
|
exports.isOHC = isOHC;
|
|
111
116
|
exports.isPatientFunded = isPatientFunded;
|
|
117
|
+
exports.isQBE = isQBE;
|
|
112
118
|
exports.isWCQ = isWCQ;
|
|
113
119
|
exports.isWSV = isWSV;
|
package/google-addresses.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
lat: number;
|
|
6
|
-
};
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
export declare function geocodeAddress(address: string): Promise<{
|
|
3
|
+
results: google.maps.GeocoderResult[];
|
|
4
|
+
latLng: google.maps.LatLngLiteral;
|
|
7
5
|
}>;
|
|
8
|
-
export declare const mapAddressComponents: (addressComponents:
|
|
9
|
-
export declare const parseAddress: (addressComponents:
|
|
6
|
+
export declare const mapAddressComponents: (addressComponents: google.maps.GeocoderAddressComponent[]) => Record<string, any>;
|
|
7
|
+
export declare const parseAddress: (addressComponents: google.maps.GeocoderAddressComponent[]) => {
|
|
8
|
+
address?: string | undefined;
|
|
9
|
+
countryCode?: string | undefined;
|
|
10
|
+
country?: string | undefined;
|
|
11
|
+
state?: string | undefined;
|
|
12
|
+
city?: string | undefined;
|
|
13
|
+
postcode?: string | undefined;
|
|
14
|
+
};
|
package/google-addresses.js
CHANGED
|
@@ -23,8 +23,7 @@ var ADDRESS_COMPONENT_MAPPINGS = {
|
|
|
23
23
|
state: 'administrative_area_level_1',
|
|
24
24
|
city: 'locality',
|
|
25
25
|
postcode: 'postal_code'
|
|
26
|
-
};
|
|
27
|
-
|
|
26
|
+
};
|
|
28
27
|
function geocodeAddress(address) {
|
|
29
28
|
return new Promise( /*#__PURE__*/function () {
|
|
30
29
|
var _ref = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(res, rej) {
|
|
@@ -88,15 +87,15 @@ function geocodeAddress(address) {
|
|
|
88
87
|
return _ref.apply(this, arguments);
|
|
89
88
|
};
|
|
90
89
|
}());
|
|
91
|
-
}
|
|
92
|
-
|
|
90
|
+
}
|
|
93
91
|
var mapAddressComponents = function mapAddressComponents(addressComponents) {
|
|
94
92
|
var components = {};
|
|
95
93
|
|
|
96
94
|
_forEach__default["default"](addressComponents, function (component) {
|
|
97
95
|
_forOwn__default["default"](ADDRESS_COMPONENT_MAPPINGS, function (mapping, key) {
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
var _component$types;
|
|
97
|
+
|
|
98
|
+
if ((component == null ? void 0 : (_component$types = component.types) == null ? void 0 : _component$types[0]) === mapping) {
|
|
100
99
|
components[key] = {
|
|
101
100
|
longName: component.long_name,
|
|
102
101
|
shortName: component.short_name
|
|
@@ -106,35 +105,24 @@ var mapAddressComponents = function mapAddressComponents(addressComponents) {
|
|
|
106
105
|
});
|
|
107
106
|
|
|
108
107
|
return components;
|
|
109
|
-
};
|
|
110
|
-
|
|
108
|
+
};
|
|
111
109
|
var parseAddress = function parseAddress(addressComponents) {
|
|
112
110
|
var requestData = {};
|
|
113
111
|
|
|
114
112
|
if (addressComponents) {
|
|
115
|
-
var address = mapAddressComponents(addressComponents);
|
|
113
|
+
var address = mapAddressComponents(addressComponents);
|
|
116
114
|
|
|
117
115
|
if (address.route) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"" + (address.subpremise ? address.subpremise.longName + "/" : '') + ( // @ts-expect-error
|
|
121
|
-
(address.streetNumber ? address.streetNumber.longName : '') + " ") + ( // @ts-expect-error
|
|
122
|
-
"" + address.route.longName);
|
|
123
|
-
} // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
|
|
124
|
-
|
|
116
|
+
requestData.address = "" + (address.subpremise ? address.subpremise.longName + "/" : '') + ((address.streetNumber ? address.streetNumber.longName : '') + " ") + ("" + address.route.longName);
|
|
117
|
+
}
|
|
125
118
|
|
|
126
119
|
if (address.country) {
|
|
127
|
-
|
|
128
|
-
requestData.countryCode = address.country.shortName; // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
|
|
129
|
-
|
|
120
|
+
requestData.countryCode = address.country.shortName;
|
|
130
121
|
requestData.country = address.country.longName;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
requestData.state = address.state ? address.state.longName : null; // @ts-expect-error TS(2339): Property 'city' does not exist on type '{}'.
|
|
135
|
-
|
|
136
|
-
requestData.city = address.city ? address.city.longName : null; // @ts-expect-error TS(2339): Property 'postcode' does not exist on type '{}'.
|
|
122
|
+
}
|
|
137
123
|
|
|
124
|
+
requestData.state = address.state ? address.state.longName : null;
|
|
125
|
+
requestData.city = address.city ? address.city.longName : null;
|
|
138
126
|
requestData.postcode = address.postcode ? address.postcode.longName : null;
|
|
139
127
|
}
|
|
140
128
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medipass/utils",
|
|
3
|
-
"version": "11.81.
|
|
3
|
+
"version": "11.81.4-feature-qbe.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"lodash": "4.17.21",
|
|
36
36
|
"moment": "2.22.2",
|
|
37
37
|
"react-i18next": "11.7.0",
|
|
38
|
-
"react-places-autocomplete": "
|
|
38
|
+
"react-places-autocomplete": "7.3.0",
|
|
39
39
|
"react-redux": "8.0.5",
|
|
40
40
|
"redux": "4.2.1",
|
|
41
41
|
"redux-sentry-middleware": "0.1.3",
|
|
@@ -45,10 +45,11 @@
|
|
|
45
45
|
"@babel/plugin-transform-runtime": "7.8.3",
|
|
46
46
|
"@types/jest": "29.1.2",
|
|
47
47
|
"@types/node": "18.11.18",
|
|
48
|
+
"@types/react-places-autocomplete": "7.2.9",
|
|
48
49
|
"redux-mock-store": "^1.3.0",
|
|
49
50
|
"redux-thunk": "^2.2.0",
|
|
50
51
|
"rimraf": "^2.6.2",
|
|
51
52
|
"typescript": "4.8.4"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "145c5aa7a1150fba3612f3ae8515eaef1a44b003"
|
|
54
55
|
}
|