@abihealth/goapp-react-native 1.42.0 → 1.43.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.43.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.42.0...goapp-react-native-v1.43.0) (2025-10-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* allow default prescription integration ([#244](https://github.com/abiglobalhealth/react-native-sdk/issues/244)) ([85e02a6](https://github.com/abiglobalhealth/react-native-sdk/commit/85e02a62fdc9a4bd3bf9af4d1111f44174e74006))
|
|
9
|
+
|
|
3
10
|
## [1.42.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.41.0...goapp-react-native-v1.42.0) (2025-09-11)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
36
|
exports.PrescriptionCard = void 0;
|
|
7
37
|
var Card_1 = require("../../../components/AnswerScreen/Card");
|
|
@@ -11,7 +41,8 @@ var useCustomComponents_1 = require("../../../hooks/useCustomComponents");
|
|
|
11
41
|
var useTheme_1 = require("../../../hooks/useTheme");
|
|
12
42
|
var useTranslation_1 = require("../../../hooks/useTranslation");
|
|
13
43
|
var PillsIcon_1 = require("../../../icons/PillsIcon");
|
|
14
|
-
var
|
|
44
|
+
var prescription_1 = require("../../../types/prescription");
|
|
45
|
+
var react_1 = __importStar(require("react"));
|
|
15
46
|
var react_native_1 = require("react-native");
|
|
16
47
|
var PrescriptionCard = function (_a) {
|
|
17
48
|
var _b, _c, _d, _e;
|
|
@@ -20,7 +51,21 @@ var PrescriptionCard = function (_a) {
|
|
|
20
51
|
var theme = (0, useTheme_1.useTheme)();
|
|
21
52
|
var styles = getStyles(theme);
|
|
22
53
|
var screens = (0, useCustomComponents_1.useCustomComponents)().screens;
|
|
23
|
-
var
|
|
54
|
+
var isTree3 = prescription.integration === prescription_1.PRESCRIPTION_INTEGRATION.THREE_TREE;
|
|
55
|
+
var medication = (0, react_1.useMemo)(function () {
|
|
56
|
+
switch (prescription.integration) {
|
|
57
|
+
case prescription_1.PRESCRIPTION_INTEGRATION.THREE_TREE: {
|
|
58
|
+
var data = prescription.data;
|
|
59
|
+
return [data.medication, data.unit].join(', ');
|
|
60
|
+
}
|
|
61
|
+
case prescription_1.PRESCRIPTION_INTEGRATION.DEFAULT: {
|
|
62
|
+
var data = prescription.data;
|
|
63
|
+
return [data.quantity, data.medication, data.frequency, data.duration].join(', ');
|
|
64
|
+
}
|
|
65
|
+
default:
|
|
66
|
+
return 'Prescription format not supported';
|
|
67
|
+
}
|
|
68
|
+
}, [prescription]);
|
|
24
69
|
return (<Card_1.Card type="prescription" style={[styles.container, (_c = (_b = screens === null || screens === void 0 ? void 0 : screens.AnswerScreen) === null || _b === void 0 ? void 0 : _b.prescriptionCard) === null || _c === void 0 ? void 0 : _c.containerStyle]}>
|
|
25
70
|
{((_e = (_d = screens === null || screens === void 0 ? void 0 : screens.AnswerScreen) === null || _d === void 0 ? void 0 : _d.prescriptionCard) === null || _e === void 0 ? void 0 : _e.customComponent) ? (<screens.AnswerScreen.prescriptionCard.customComponent prescription={prescription}/>) : (<react_native_1.View style={styles.innerContainer}>
|
|
26
71
|
<react_native_1.View style={styles.header}>
|
|
@@ -31,7 +76,7 @@ var PrescriptionCard = function (_a) {
|
|
|
31
76
|
<Text_1.Text>{medication}</Text_1.Text>
|
|
32
77
|
</react_native_1.View>)}
|
|
33
78
|
|
|
34
|
-
<DeliveryAddressCard_1.DeliveryAddressCard deliveryAddress={prescription.data.delivery.address}/>
|
|
79
|
+
{isTree3 && <DeliveryAddressCard_1.DeliveryAddressCard deliveryAddress={prescription.data.delivery.address}/>}
|
|
35
80
|
</Card_1.Card>);
|
|
36
81
|
};
|
|
37
82
|
exports.PrescriptionCard = PrescriptionCard;
|
|
@@ -25,20 +25,32 @@ export interface Status {
|
|
|
25
25
|
export interface Delivery {
|
|
26
26
|
address: HKDeliveryAddress;
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
28
|
+
export interface Tree3Data {
|
|
29
29
|
delivery?: Delivery;
|
|
30
30
|
drugId: number;
|
|
31
31
|
dsi: string;
|
|
32
32
|
duration: string;
|
|
33
33
|
frequency: string;
|
|
34
|
-
integration: string;
|
|
35
34
|
medication: string;
|
|
36
35
|
remarks: string;
|
|
37
36
|
unit: string;
|
|
38
37
|
}
|
|
39
|
-
export interface
|
|
40
|
-
|
|
38
|
+
export interface DefaultData {
|
|
39
|
+
duration: string;
|
|
41
40
|
createdAt: string;
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
quantity: string;
|
|
42
|
+
medication: string;
|
|
43
|
+
drugId: number;
|
|
44
|
+
frequency: string;
|
|
45
|
+
instructions?: string;
|
|
44
46
|
}
|
|
47
|
+
export type Prescription = {
|
|
48
|
+
createdAt: string;
|
|
49
|
+
status: Status;
|
|
50
|
+
} & ({
|
|
51
|
+
integration: PRESCRIPTION_INTEGRATION.THREE_TREE;
|
|
52
|
+
data: Tree3Data;
|
|
53
|
+
} | {
|
|
54
|
+
integration: PRESCRIPTION_INTEGRATION.DEFAULT;
|
|
55
|
+
data: DefaultData;
|
|
56
|
+
});
|
|
@@ -9,6 +9,7 @@ var NotValidActiveTypeScreen_1 = require("../../common/screens/NotValidActiveTyp
|
|
|
9
9
|
var PreparingSummaryScreen_1 = require("../../common/screens/PreparingSummaryScreen");
|
|
10
10
|
var utils_1 = require("../../common/screens/utils");
|
|
11
11
|
var consultation_1 = require("../../common/types/consultation");
|
|
12
|
+
var prescription_1 = require("../../common/types/prescription");
|
|
12
13
|
var valid_active_type_1 = require("../../common/utils/valid-active-type");
|
|
13
14
|
var DeliveryAddressScreen_1 = require("../screens/DeliveryAddressScreen");
|
|
14
15
|
var JoinVideoCallScreen_1 = require("../screens/JoinVideoCallScreen");
|
|
@@ -38,7 +39,7 @@ var VideoConsultation = function (_a) {
|
|
|
38
39
|
case consultation_1.CONSULTATION_STATUS.VIDEO_CALL_ENDED:
|
|
39
40
|
return <PreparingSummaryScreen_1.PreparingSummaryScreen professional={professional}/>;
|
|
40
41
|
case consultation_1.CONSULTATION_STATUS.WAITING_FOR_INFO:
|
|
41
|
-
if ((_a = prescription === null || prescription === void 0 ? void 0 : prescription.data.delivery) === null || _a === void 0 ? void 0 : _a.address)
|
|
42
|
+
if (prescription.integration === prescription_1.PRESCRIPTION_INTEGRATION.THREE_TREE && ((_a = prescription === null || prescription === void 0 ? void 0 : prescription.data.delivery) === null || _a === void 0 ? void 0 : _a.address))
|
|
42
43
|
return <ProcessingPrescriptionScreen_1.ProcessingPrescriptionScreen />;
|
|
43
44
|
return <DeliveryAddressScreen_1.DeliveryAddressScreen initialDeliveryAddress={deliveryAddress}/>;
|
|
44
45
|
default:
|