@abihealth/goapp-react-native 1.32.0 → 1.34.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 +14 -0
- package/README.md +33 -1
- package/dist/common/api/base.js +2 -0
- package/dist/common/api/logger.d.ts +2 -0
- package/dist/common/api/logger.js +18 -0
- package/dist/common/api/models/logger.d.ts +13 -0
- package/dist/common/api/models/logger.js +10 -0
- package/dist/common/api/sslPinning.js +5 -4
- package/dist/common/api/websocket.js +8 -4
- package/dist/common/contexts/ConsultationContext.js +19 -20
- package/dist/common/helpers/eventHandler.d.ts +2 -2
- package/dist/common/helpers/eventHandler.js +3 -2
- package/dist/common/hooks/useConsultation.js +2 -1
- package/dist/common/locale/translations/en.base.json +30 -25
- package/dist/common/locale/translations/en.prescriptionSurveys.json +129 -0
- package/dist/common/locale/translations/it.base.json +1 -1
- package/dist/common/types/deliveryAddress.d.ts +10 -1
- package/dist/common/types/deliveryAddress.js +28 -2
- package/dist/common/utils/logger.d.ts +3 -0
- package/dist/common/utils/logger.js +49 -0
- package/dist/form-prescriptions/screens/ReasonScreen.js +2 -3
- package/dist/video-consultations/components/VideoConsultation.d.ts +1 -1
- package/dist/video-consultations/components/agora/AgoraWrapper.js +35 -10
- package/dist/video-consultations/hooks/useInitRtcEngine.js +13 -5
- package/dist/video-consultations/screens/DeliveryAddressScreen.js +85 -26
- package/dist/video-consultations/screens/VideoCallScreen.js +2 -1
- package/package.json +3 -2
- package/prettier.config.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.34.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.33.0...goapp-react-native-v1.34.0) (2025-06-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* districts dropdown ([#210](https://github.com/abiglobalhealth/react-native-sdk/issues/210)) ([d4fb6bf](https://github.com/abiglobalhealth/react-native-sdk/commit/d4fb6bf93c785b340f008d47e03d7ff1bbe3167b))
|
|
9
|
+
|
|
10
|
+
## [1.33.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.32.0...goapp-react-native-v1.33.0) (2025-06-02)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* error tracking ([#207](https://github.com/abiglobalhealth/react-native-sdk/issues/207)) ([543a375](https://github.com/abiglobalhealth/react-native-sdk/commit/543a375e31c6bac75bcfafbdb2f8484e72378131))
|
|
16
|
+
|
|
3
17
|
## [1.32.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.31.1...goapp-react-native-v1.32.0) (2025-05-29)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -221,12 +221,16 @@ const options = {
|
|
|
221
221
|
/* Video call options */
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
const deliveryAddress = {
|
|
225
|
+
/* Delivery address for the consultation */
|
|
226
|
+
}
|
|
227
|
+
|
|
224
228
|
const ConsultationScreen = () => {
|
|
225
229
|
const eventHandlers = {
|
|
226
230
|
/* Callbacks for events */
|
|
227
231
|
}
|
|
228
232
|
|
|
229
|
-
return <VideoConsultation options={options} eventHandlers={eventHandlers} />
|
|
233
|
+
return <VideoConsultation options={options} eventHandlers={eventHandlers} deliveryAddress={deliveryAddress} />
|
|
230
234
|
}
|
|
231
235
|
|
|
232
236
|
export default ConsultationScreen
|
|
@@ -236,6 +240,34 @@ export default ConsultationScreen
|
|
|
236
240
|
|
|
237
241
|
- `options` (object, optional): Video call appearance/behavior config
|
|
238
242
|
- `eventHandlers` (object, optional): Callbacks for video call events
|
|
243
|
+
- `deliveryAddress` (object, optional): Address for prefilling delivery info
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
type DeliveryAddress = {
|
|
247
|
+
house?: string
|
|
248
|
+
building?: string
|
|
249
|
+
street?: string
|
|
250
|
+
district?:
|
|
251
|
+
| 'central_and_western'
|
|
252
|
+
| 'eastern'
|
|
253
|
+
| 'southern'
|
|
254
|
+
| 'wan_chai'
|
|
255
|
+
| 'kowloon_city'
|
|
256
|
+
| 'yau_tsim_mong'
|
|
257
|
+
| 'sham_shui_po'
|
|
258
|
+
| 'wong_tai_sin'
|
|
259
|
+
| 'kwun_tong'
|
|
260
|
+
| 'kwai_tsing'
|
|
261
|
+
| 'tsuen_wan'
|
|
262
|
+
| 'tuen_mun'
|
|
263
|
+
| 'yuen_long'
|
|
264
|
+
| 'north'
|
|
265
|
+
| 'tai_po'
|
|
266
|
+
| 'sha_tin'
|
|
267
|
+
| 'sai_kung'
|
|
268
|
+
| 'islands'
|
|
269
|
+
}
|
|
270
|
+
```
|
|
239
271
|
|
|
240
272
|
### 4. Use the useConsultation hook
|
|
241
273
|
|
package/dist/common/api/base.js
CHANGED
|
@@ -4,5 +4,7 @@ exports.getBaseUrl = void 0;
|
|
|
4
4
|
var getBaseUrl = function (region) { return ({
|
|
5
5
|
sdk: "https://".concat(region, ".sdk.abi.ai"),
|
|
6
6
|
ws: "wss://".concat(region, ".sdk-ws.abi.ai")
|
|
7
|
+
// sdk: `https://mwolts3h85.execute-api.eu-west-1.amazonaws.com/dev`, // Dev
|
|
8
|
+
// ws: `wss://g4lfnxt2hf.execute-api.eu-west-1.amazonaws.com/dev`, // Dev
|
|
7
9
|
}); };
|
|
8
10
|
exports.getBaseUrl = getBaseUrl;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sendLog = void 0;
|
|
7
|
+
var axios_1 = __importDefault(require("axios"));
|
|
8
|
+
var LOGGER_URL = '/log';
|
|
9
|
+
var sendLog = function (log) {
|
|
10
|
+
return axios_1.default
|
|
11
|
+
.post(LOGGER_URL, log)
|
|
12
|
+
.then(function (response) { return response === null || response === void 0 ? void 0 : response.data; })
|
|
13
|
+
.catch(function (error) {
|
|
14
|
+
console.error('Error sending log', error);
|
|
15
|
+
throw error;
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.sendLog = sendLog;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogLevel = void 0;
|
|
4
|
+
var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
|
|
7
|
+
LogLevel[LogLevel["INFO"] = 1] = "INFO";
|
|
8
|
+
LogLevel[LogLevel["WARN"] = 2] = "WARN";
|
|
9
|
+
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
10
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.initializeSslPinning = void 0;
|
|
40
|
+
var logger_1 = require("../utils/logger");
|
|
40
41
|
var react_native_ssl_public_key_pinning_1 = require("react-native-ssl-public-key-pinning");
|
|
41
42
|
var initializeSslPinning = function (disableSslPinning) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
43
|
return __generator(this, function (_a) {
|
|
@@ -46,18 +47,18 @@ var initializeSslPinning = function (disableSslPinning) { return __awaiter(void
|
|
|
46
47
|
return [4 /*yield*/, (0, react_native_ssl_public_key_pinning_1.disableSslPinning)()];
|
|
47
48
|
case 1:
|
|
48
49
|
_a.sent();
|
|
49
|
-
return [2 /*return*/,
|
|
50
|
+
return [2 /*return*/, logger_1.Logger.log('🔒🚫 SSL pinning disabled')];
|
|
50
51
|
case 2: return [4 /*yield*/, (0, react_native_ssl_public_key_pinning_1.initializeSslPinning)({
|
|
51
52
|
'ape1.sdk.abi.ai': {
|
|
52
|
-
publicKeyHashes: ['
|
|
53
|
+
publicKeyHashes: ['icBPOfkhP5i8sxpBVNZ+n1cmj0nQUQMa7tdNFcK/92I=', 'rCP1qN5ZVPcLqR+Qq+ZaJtXM+xPKSSZnNYoyfnWl59A=']
|
|
53
54
|
},
|
|
54
55
|
'euw1.sdk.abi.ai': {
|
|
55
|
-
publicKeyHashes: ['
|
|
56
|
+
publicKeyHashes: ['s6aPU9McY7zd2dMtKzeUO2BrkhbOjFaliBBjDoK1goI=', 'wMHv+sHI5TCIvpVNmzNrzEzra+18o+kB9fiOvtAjM1I=']
|
|
56
57
|
}
|
|
57
58
|
})];
|
|
58
59
|
case 3:
|
|
59
60
|
_a.sent();
|
|
60
|
-
return [2 /*return*/,
|
|
61
|
+
return [2 /*return*/, logger_1.Logger.log('🔒 SSL pinning initialized')];
|
|
61
62
|
}
|
|
62
63
|
});
|
|
63
64
|
}); };
|
|
@@ -37,21 +37,25 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.connectWebsocket = void 0;
|
|
40
|
+
var logger_1 = require("../utils/logger");
|
|
40
41
|
var base_1 = require("./base");
|
|
41
42
|
var connectWebsocket = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
42
43
|
var token = _b.token, region = _b.region;
|
|
43
44
|
return __generator(this, function (_c) {
|
|
44
45
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
45
|
-
|
|
46
|
+
logger_1.Logger.log('❔ Connecting to WS...', { token: token, region: region });
|
|
46
47
|
try {
|
|
47
48
|
var websocket_1 = new WebSocket("".concat((0, base_1.getBaseUrl)(region).ws, "?eventType=CONNECT"), null);
|
|
48
49
|
websocket_1.onopen = function () {
|
|
49
|
-
|
|
50
|
-
websocket_1.send(JSON.stringify({
|
|
50
|
+
logger_1.Logger.log('🟢 WS connected');
|
|
51
|
+
websocket_1.send(JSON.stringify({
|
|
52
|
+
action: 'connect',
|
|
53
|
+
payload: { token: "Bearer ".concat(token) }
|
|
54
|
+
}));
|
|
51
55
|
resolve(websocket_1);
|
|
52
56
|
};
|
|
53
57
|
websocket_1.onerror = function (e) {
|
|
54
|
-
|
|
58
|
+
logger_1.Logger.error('🔴 WS error', JSON.stringify(e, null, 2));
|
|
55
59
|
};
|
|
56
60
|
}
|
|
57
61
|
catch (e) {
|
|
@@ -47,6 +47,7 @@ var user_1 = require("../api/user");
|
|
|
47
47
|
var websocket_1 = require("../api/websocket");
|
|
48
48
|
var i18n_1 = __importDefault(require("../locale/i18n"));
|
|
49
49
|
var theme_1 = require("../types/theme");
|
|
50
|
+
var logger_1 = require("../utils/logger");
|
|
50
51
|
var axios_1 = require("axios");
|
|
51
52
|
var react_1 = require("react");
|
|
52
53
|
var react_i18next_1 = require("react-i18next");
|
|
@@ -73,7 +74,7 @@ var ConsultationProvider = function (_a) {
|
|
|
73
74
|
var _g = (0, react_1.useState)(null), slug = _g[0], setSlug = _g[1];
|
|
74
75
|
var _h = (0, react_1.useState)(false), initialised = _h[0], setInitialised = _h[1];
|
|
75
76
|
var handleError = function (e) {
|
|
76
|
-
|
|
77
|
+
logger_1.Logger.error('🚨 Error caught on handler', e);
|
|
77
78
|
onError(e);
|
|
78
79
|
};
|
|
79
80
|
var initialise = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -88,7 +89,7 @@ var ConsultationProvider = function (_a) {
|
|
|
88
89
|
return [3 /*break*/, 3];
|
|
89
90
|
case 2:
|
|
90
91
|
e_1 = _a.sent();
|
|
91
|
-
|
|
92
|
+
logger_1.Logger.error('Error initializing SSL pinning', e_1);
|
|
92
93
|
throw e_1;
|
|
93
94
|
case 3:
|
|
94
95
|
_a.trys.push([3, 5, , 6]);
|
|
@@ -99,7 +100,7 @@ var ConsultationProvider = function (_a) {
|
|
|
99
100
|
return [3 /*break*/, 6];
|
|
100
101
|
case 5:
|
|
101
102
|
e_2 = _a.sent();
|
|
102
|
-
|
|
103
|
+
logger_1.Logger.error('Error getting partner info', e_2);
|
|
103
104
|
throw e_2;
|
|
104
105
|
case 6:
|
|
105
106
|
_a.trys.push([6, 8, , 9]);
|
|
@@ -110,14 +111,14 @@ var ConsultationProvider = function (_a) {
|
|
|
110
111
|
return [3 /*break*/, 9];
|
|
111
112
|
case 8:
|
|
112
113
|
e_3 = _a.sent();
|
|
113
|
-
|
|
114
|
+
logger_1.Logger.error('Error getting user', e_3);
|
|
114
115
|
throw e_3;
|
|
115
116
|
case 9:
|
|
116
117
|
_a.trys.push([9, 11, , 12]);
|
|
117
118
|
return [4 /*yield*/, (0, user_1.getActiveConsultation)()];
|
|
118
119
|
case 10:
|
|
119
120
|
activeConsultation = _a.sent();
|
|
120
|
-
|
|
121
|
+
logger_1.Logger.log('⏮️ Active:', activeConsultation.consultation);
|
|
121
122
|
setConsultation(activeConsultation === null || activeConsultation === void 0 ? void 0 : activeConsultation.consultation);
|
|
122
123
|
return [3 /*break*/, 12];
|
|
123
124
|
case 11:
|
|
@@ -126,7 +127,7 @@ var ConsultationProvider = function (_a) {
|
|
|
126
127
|
setConsultation(null);
|
|
127
128
|
}
|
|
128
129
|
else {
|
|
129
|
-
|
|
130
|
+
logger_1.Logger.error('Error getting active consultation', e_4);
|
|
130
131
|
throw e_4;
|
|
131
132
|
}
|
|
132
133
|
return [3 /*break*/, 12];
|
|
@@ -139,7 +140,7 @@ var ConsultationProvider = function (_a) {
|
|
|
139
140
|
return [3 /*break*/, 15];
|
|
140
141
|
case 14:
|
|
141
142
|
e_5 = _a.sent();
|
|
142
|
-
|
|
143
|
+
logger_1.Logger.error('Error connecting to websocket', e_5);
|
|
143
144
|
throw e_5;
|
|
144
145
|
case 15: return [2 /*return*/];
|
|
145
146
|
}
|
|
@@ -152,56 +153,54 @@ var ConsultationProvider = function (_a) {
|
|
|
152
153
|
(0, config_1.configureAxios)({ token: token, region: region });
|
|
153
154
|
(_a = config_1.axios === null || config_1.axios === void 0 ? void 0 : config_1.axios.interceptors) === null || _a === void 0 ? void 0 : _a.request.use(function (config) {
|
|
154
155
|
var method = config.method, url = config.url, data = config.data;
|
|
155
|
-
|
|
156
|
-
service: 'API Rest',
|
|
156
|
+
logger_1.Logger.log('API Rest request', {
|
|
157
157
|
message: "".concat(method === null || method === void 0 ? void 0 : method.toUpperCase(), " ").concat(url, " ").concat(data !== undefined ? "- body: ".concat(JSON.stringify(data)) : ' '),
|
|
158
158
|
headers: config.headers
|
|
159
159
|
});
|
|
160
160
|
return config;
|
|
161
161
|
});
|
|
162
162
|
(_b = config_1.axios === null || config_1.axios === void 0 ? void 0 : config_1.axios.interceptors) === null || _b === void 0 ? void 0 : _b.response.use(function (response) {
|
|
163
|
-
|
|
164
|
-
service: 'API Rest Response',
|
|
163
|
+
logger_1.Logger.log('API Rest Response', {
|
|
165
164
|
message: JSON.stringify(response === null || response === void 0 ? void 0 : response.data)
|
|
166
165
|
});
|
|
167
166
|
return response;
|
|
168
167
|
});
|
|
169
168
|
initialise().catch(function (e) {
|
|
170
|
-
|
|
169
|
+
logger_1.Logger.error('Error initialising', e);
|
|
171
170
|
// Alert.alert('Error initialising', `${e.message}\n${JSON.stringify(e)}`)
|
|
172
171
|
handleError(e);
|
|
173
172
|
});
|
|
174
173
|
return function () {
|
|
175
|
-
|
|
174
|
+
logger_1.Logger.log('Authorization cleanup', { token: token });
|
|
176
175
|
delete config_1.axios.defaults.headers.common.Authorization;
|
|
177
176
|
websocket === null || websocket === void 0 ? void 0 : websocket.close();
|
|
178
177
|
};
|
|
179
178
|
}, [token, region]);
|
|
180
179
|
(0, react_1.useEffect)(function () {
|
|
181
|
-
|
|
180
|
+
logger_1.Logger.log('WS changed', websocket);
|
|
182
181
|
if (!websocket)
|
|
183
182
|
return;
|
|
184
|
-
|
|
183
|
+
logger_1.Logger.log('👂 Connecting onMessage...');
|
|
185
184
|
websocket.onmessage = function (event) {
|
|
186
185
|
var data = JSON.parse(event.data);
|
|
187
|
-
|
|
186
|
+
logger_1.Logger.log('👀 Websocket message', { eventData: event.data, data: data });
|
|
188
187
|
if (data.consultation)
|
|
189
188
|
setConsultation(data.consultation);
|
|
190
189
|
if (data.event === 'websocketError')
|
|
191
190
|
handleError(new Error('Websocket error'));
|
|
192
191
|
if (data.event === 'websocketConnected') {
|
|
193
|
-
|
|
192
|
+
logger_1.Logger.log('🟢🟢 Websocket connected');
|
|
194
193
|
setInitialised(true);
|
|
195
194
|
}
|
|
196
195
|
};
|
|
197
196
|
websocket.onclose = function (e) {
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
logger_1.Logger.log('❌ WS closed', JSON.stringify(e, null, 2));
|
|
198
|
+
logger_1.Logger.log('🔄 Reconnecting...');
|
|
200
199
|
(0, websocket_1.connectWebsocket)({ token: token, region: region }).then(setWebsocket).catch(handleError);
|
|
201
200
|
};
|
|
202
201
|
}, [websocket]);
|
|
203
202
|
(0, react_1.useEffect)(function () {
|
|
204
|
-
var subscription = (0, react_native_ssl_public_key_pinning_1.addSslPinningErrorListener)(
|
|
203
|
+
var subscription = (0, react_native_ssl_public_key_pinning_1.addSslPinningErrorListener)(function (e) { return logger_1.Logger.error('SSL Pinning error', e); });
|
|
205
204
|
return function () { return subscription.remove(); };
|
|
206
205
|
}, []);
|
|
207
206
|
var value = {
|
|
@@ -2,7 +2,7 @@ import { ConsultationContextProps } from '../contexts/ConsultationContext';
|
|
|
2
2
|
import { Consultation } from '../types/consultation';
|
|
3
3
|
import { CONSULTATION_EVENT, EventCallback } from '../types/events';
|
|
4
4
|
export interface EventHandlers {
|
|
5
|
-
|
|
5
|
+
onCanceled?: EventCallback;
|
|
6
6
|
onClosed?: EventCallback;
|
|
7
7
|
onSubmitted?: EventCallback;
|
|
8
8
|
onClaimed?: EventCallback;
|
|
@@ -16,4 +16,4 @@ export interface EventHandlers {
|
|
|
16
16
|
onVideoCallLeft?: () => void;
|
|
17
17
|
}
|
|
18
18
|
export declare const mapConsultationStatusToEvent: (consultation: Consultation) => CONSULTATION_EVENT;
|
|
19
|
-
export declare const handleEvent: (consultation: ConsultationContextProps["consultation"], eventHandlers?: EventHandlers) => void
|
|
19
|
+
export declare const handleEvent: (consultation: ConsultationContextProps["consultation"], eventHandlers?: EventHandlers) => Promise<void>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.handleEvent = exports.mapConsultationStatusToEvent = void 0;
|
|
4
4
|
var consultation_1 = require("../types/consultation");
|
|
5
5
|
var events_1 = require("../types/events");
|
|
6
|
+
var logger_1 = require("../utils/logger");
|
|
6
7
|
var mapConsultationStatusToEvent = function (consultation) {
|
|
7
8
|
var status = consultation.status, professional = consultation.professional;
|
|
8
9
|
switch (status) {
|
|
@@ -29,11 +30,11 @@ var handleEvent = function (consultation, eventHandlers) {
|
|
|
29
30
|
if (!eventHandlers)
|
|
30
31
|
return;
|
|
31
32
|
if (!consultation)
|
|
32
|
-
return
|
|
33
|
+
return logger_1.Logger.warn('Skipping event handling -> no consultation found');
|
|
33
34
|
var consultationEvent = (0, exports.mapConsultationStatusToEvent)(consultation);
|
|
34
35
|
switch (consultationEvent) {
|
|
35
36
|
case events_1.CONSULTATION_EVENT.CANCELED:
|
|
36
|
-
(_a = eventHandlers.
|
|
37
|
+
(_a = eventHandlers.onCanceled) === null || _a === void 0 ? void 0 : _a.call(eventHandlers, consultation);
|
|
37
38
|
break;
|
|
38
39
|
case events_1.CONSULTATION_EVENT.CLOSED:
|
|
39
40
|
(_b = eventHandlers.onClosed) === null || _b === void 0 ? void 0 : _b.call(eventHandlers, consultation);
|
|
@@ -45,6 +45,7 @@ var consultation_2 = require("../api/models/consultation");
|
|
|
45
45
|
var ConsultationContext_1 = require("../contexts/ConsultationContext");
|
|
46
46
|
var i18n_1 = __importDefault(require("../locale/i18n"));
|
|
47
47
|
var consultation_3 = require("../types/consultation");
|
|
48
|
+
var logger_1 = require("../utils/logger");
|
|
48
49
|
var video_1 = require("../../video-consultations/api/video");
|
|
49
50
|
var react_1 = require("react");
|
|
50
51
|
var useUser_1 = require("./useUser");
|
|
@@ -80,7 +81,7 @@ var useConsultation = function () {
|
|
|
80
81
|
return [2 /*return*/, response.consultation];
|
|
81
82
|
case 2:
|
|
82
83
|
e_1 = _a.sent();
|
|
83
|
-
|
|
84
|
+
logger_1.Logger.error('Error on consultation action', e_1);
|
|
84
85
|
onError(e_1);
|
|
85
86
|
throw e_1;
|
|
86
87
|
case 3: return [2 /*return*/];
|
|
@@ -65,8 +65,10 @@
|
|
|
65
65
|
"choice.type_2_diabetes": "Type 2 diabetes",
|
|
66
66
|
"close.subtitle": "Before closing this consultation, we recommend downloading the summary PDF for future reference.",
|
|
67
67
|
"close.title": "Are you sure you want to close?",
|
|
68
|
-
"condition_symptom.
|
|
69
|
-
"condition_symptom.
|
|
68
|
+
"condition_symptom.allergies": "allergy-related conditions",
|
|
69
|
+
"condition_symptom.chest_bronchial": "chest or bronchial conditions",
|
|
70
|
+
"condition_symptom.pain_management": "pain-related conditions",
|
|
71
|
+
"condition_symptom.sicknote": "sick note requests",
|
|
70
72
|
"condition_symptom.uti": "female urological conditions",
|
|
71
73
|
"consultation.summary_being_prepared": "is preparing a summary of your consultation.",
|
|
72
74
|
"contact.enter_message_below": "Please enter your message below.",
|
|
@@ -165,6 +167,27 @@
|
|
|
165
167
|
"country.gw": "Guinea-Bissau",
|
|
166
168
|
"country.gy": "Guyana",
|
|
167
169
|
"country.hk": "Hong Kong",
|
|
170
|
+
"country.hk.area.island": "Hong Kong Island",
|
|
171
|
+
"country.hk.area.island.district.central": "Central and Western",
|
|
172
|
+
"country.hk.area.island.district.eastern": "Eastern",
|
|
173
|
+
"country.hk.area.island.district.southern": "Southern",
|
|
174
|
+
"country.hk.area.island.district.wan_chai": "Wan Chai",
|
|
175
|
+
"country.hk.area.kowloon": "Kowloon",
|
|
176
|
+
"country.hk.area.kowloon.district.city": "Kowloon City",
|
|
177
|
+
"country.hk.area.kowloon.district.kwun_tong": "Kwun Tong",
|
|
178
|
+
"country.hk.area.kowloon.district.sham_shui_po": "Sham Shui Po",
|
|
179
|
+
"country.hk.area.kowloon.district.wong_tai_sin": "Wong Tai Sin",
|
|
180
|
+
"country.hk.area.kowloon.district.yau_tsim_mong": "Yau Tsim Mong",
|
|
181
|
+
"country.hk.area.new_territories": "New Territories",
|
|
182
|
+
"country.hk.area.new_territories.district.islands": "Islands",
|
|
183
|
+
"country.hk.area.new_territories.district.kwai_tsing": "Kwai Tsing",
|
|
184
|
+
"country.hk.area.new_territories.district.north": "North",
|
|
185
|
+
"country.hk.area.new_territories.district.sai_kung": "Sai Kung",
|
|
186
|
+
"country.hk.area.new_territories.district.sha_tin": "Sha Tin",
|
|
187
|
+
"country.hk.area.new_territories.district.tai_po": "Tai Po",
|
|
188
|
+
"country.hk.area.new_territories.district.tsuen_wan": "Tsuen Wan",
|
|
189
|
+
"country.hk.area.new_territories.district.tuen_mun": "Tuen Mun",
|
|
190
|
+
"country.hk.area.new_territories.district.yuen_long": "Yuen Long",
|
|
168
191
|
"country.hm": "Heard Island and McDonald Islands",
|
|
169
192
|
"country.hn": "Honduras",
|
|
170
193
|
"country.hr": "Croatia",
|
|
@@ -385,24 +408,6 @@
|
|
|
385
408
|
"delivery.address.country.placeholder": "Please select...",
|
|
386
409
|
"delivery.address.description": "A prescription has been issued. Please provide your full address for delivery.",
|
|
387
410
|
"delivery.address.district": "District",
|
|
388
|
-
"delivery.address.district.hk.central_and_western": "Hong Kong Island - Central and Western",
|
|
389
|
-
"delivery.address.district.hk.eastern": "Hong Kong Island - Eastern",
|
|
390
|
-
"delivery.address.district.hk.islands": "New Territories - Islands",
|
|
391
|
-
"delivery.address.district.hk.kowloon_city": "Kowloon - Kowloon City",
|
|
392
|
-
"delivery.address.district.hk.kwai_tsing": "New Territories - Kwai Tsing",
|
|
393
|
-
"delivery.address.district.hk.kwun_tong": "Kowloon - Kwun Tong",
|
|
394
|
-
"delivery.address.district.hk.north": "New Territories - North",
|
|
395
|
-
"delivery.address.district.hk.sai_kung": "New Territories - Sai Kung",
|
|
396
|
-
"delivery.address.district.hk.sha_tin": "New Territories - Sha Tin",
|
|
397
|
-
"delivery.address.district.hk.sham_shui_po": "Kowloon - Sham Shui Po",
|
|
398
|
-
"delivery.address.district.hk.southern": "Hong Kong Island - Southern",
|
|
399
|
-
"delivery.address.district.hk.tai_po": "New Territories - Tai Po",
|
|
400
|
-
"delivery.address.district.hk.tsuen_wan": "New Territories - Tsuen Wan",
|
|
401
|
-
"delivery.address.district.hk.tuen_mun": "New Territories - Tuen Mun",
|
|
402
|
-
"delivery.address.district.hk.wan_chai": "Hong Kong Island - Wan Chai",
|
|
403
|
-
"delivery.address.district.hk.wong_tai_sin": "Kowloon - Wong Tai Sin",
|
|
404
|
-
"delivery.address.district.hk.yau_tsim_mong": "Kowloon - Yau Tsim Mong",
|
|
405
|
-
"delivery.address.district.hk.yuen_long": "New Territories - Yuen Long",
|
|
406
411
|
"delivery.address.district.placeholder": "Please select...",
|
|
407
412
|
"delivery.address.mobile": "Mobile number",
|
|
408
413
|
"delivery.address.number_and_floor": "House or apartment number and floor",
|
|
@@ -420,10 +425,10 @@
|
|
|
420
425
|
"download.summary_getting_ready": "The summary is getting ready.",
|
|
421
426
|
"download.usually_takes": "This usually takes less than 1 min.",
|
|
422
427
|
"error.address": "There is a problem with your address. Please check it and try again.",
|
|
423
|
-
"error.camera_microphone.browser.chrome": "1. Click the lock icon in the address bar (next to the URL).\n2. Select Site settings.\n3. Set Microphone and Camera to \"Allow\".\n4. Refresh
|
|
424
|
-
"error.camera_microphone.browser.edge": "1.
|
|
425
|
-
"error.camera_microphone.browser.firefox": "1. Click the camera or microphone icon in the address bar.\n2. Click \"Retry Permissions\" or manually allow access in settings.\n3. Refresh
|
|
426
|
-
"error.camera_microphone.browser.safari": "1. Click Safari in the top menu bar > Settings for This Website.\n2. Change Camera and Microphone to \"Allow\".\n3. Refresh
|
|
428
|
+
"error.camera_microphone.browser.chrome": "1. Click the lock icon in the address bar (next to the URL).\n2. Select Site settings.\n3. Set Microphone and Camera to \"Allow\".\n4. Refresh this page.",
|
|
429
|
+
"error.camera_microphone.browser.edge": "1. Open your phone’s Settings app.\n2. Locate and select Edge (may be in Apps).\n3. Select Permissions and enable camera and microphone.\n4. Refresh this page.",
|
|
430
|
+
"error.camera_microphone.browser.firefox": "1. Click the camera or microphone icon in the address bar.\n2. Click \"Retry Permissions\" or manually allow access in settings.\n3. Refresh this page.",
|
|
431
|
+
"error.camera_microphone.browser.safari": "1. Click Safari in the top menu bar > Settings for This Website.\n2. Change Camera and Microphone to \"Allow\".\n3. Refresh this page.",
|
|
427
432
|
"error.camera_microphone.client_app": "Please check your permissions settings. Alternatively, you may join the call with the following link: {{url}}",
|
|
428
433
|
"error.camera_microphone.no_camera_no_microphone": "Error: Please enable your camera and your microphone to join the call.",
|
|
429
434
|
"error.camera_microphone.to_enable": "To enable:",
|
|
@@ -514,7 +519,7 @@
|
|
|
514
519
|
"general.consultation.text.description.enfa": "Ask a medical question by text and get a discreet answer from a qualified nurse in just a few minutes.",
|
|
515
520
|
"general.consultation.text.description.enfa_test": "Ask a medical question by text and get a discreet answer from a qualified nurse in just a few minutes.",
|
|
516
521
|
"general.consultation.text.title": "Text Consultation",
|
|
517
|
-
"general.consultation.videoConsultation.description": "
|
|
522
|
+
"general.consultation.videoConsultation.description": "Call a registered, local doctor. Be matched within 5 minutes. They can diagnose and issue prescriptions, if they deem it appropriate.",
|
|
518
523
|
"general.consultation.videoConsultation.ending": "is ending the video consultation.",
|
|
519
524
|
"general.consultation.videoConsultation.hcpCanRecall": "This usually takes less than 5 minutes.\nIf necessary, the doctor may call you again to ask for more information.",
|
|
520
525
|
"general.consultation.videoConsultation.isPreparingSummary": "The summary is getting ready.",
|
|
@@ -1,24 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
+
"choice.1to5": "Between 1 and 5 years ago",
|
|
3
|
+
"choice.3more": "Three or more",
|
|
2
4
|
"choice.all": "All",
|
|
3
5
|
"choice.always": "Always",
|
|
6
|
+
"choice.anal": "Around anal area",
|
|
7
|
+
"choice.back": "Back",
|
|
8
|
+
"choice.chest": "Chest",
|
|
9
|
+
"choice.confirm": "Yes, I confirm",
|
|
10
|
+
"choice.current_outbreak": "To treat a current outbreak",
|
|
11
|
+
"choice.do_not_confirm": "No, I do not confirm",
|
|
12
|
+
"choice.doctor_nurse": "Doctor/ nurse in the sexual health clinic",
|
|
4
13
|
"choice.doxycycline": "Doxycycline",
|
|
14
|
+
"choice.face": "Face",
|
|
5
15
|
"choice.frontline": "Front line",
|
|
16
|
+
"choice.genitals": "Genitals",
|
|
17
|
+
"choice.gp": "GP",
|
|
6
18
|
"choice.lariam": "Mefloquine (Lariam)",
|
|
19
|
+
"choice.less_5days": "Less than 5 days",
|
|
7
20
|
"choice.less_month": "Less than a month ago.",
|
|
21
|
+
"choice.less1": "Less than 1 year ago",
|
|
22
|
+
"choice.less6": "Less than 6 episodes",
|
|
8
23
|
"choice.malarone": "Atovaquone/proguanil (Malarone)",
|
|
9
24
|
"choice.middlehead": "Middle head (center)",
|
|
10
25
|
"choice.middlehead2": "Middle head (front to back)",
|
|
26
|
+
"choice.more_5days": "More than 5 days",
|
|
11
27
|
"choice.more_six_months": "More than 6 months.",
|
|
28
|
+
"choice.more5": "Over 5 years ago",
|
|
29
|
+
"choice.more6": "More than 6 episodes",
|
|
12
30
|
"choice.multiplegaps": "Multiple Gaps",
|
|
31
|
+
"choice.neck": "Neck",
|
|
13
32
|
"choice.never": "Never",
|
|
14
33
|
"choice.no": "No",
|
|
15
34
|
"choice.not_understand_not_agree": "I do not understand or do not agree",
|
|
35
|
+
"choice.notsure": "Not sure",
|
|
16
36
|
"choice.often": "Often",
|
|
37
|
+
"choice.one": "One",
|
|
17
38
|
"choice.one_six_months": "1-6 months.",
|
|
39
|
+
"choice.other": "Other",
|
|
40
|
+
"choice.possible_outbreak": "To treat a possible future outbreak",
|
|
18
41
|
"choice.rarely": "Rarely",
|
|
42
|
+
"choice.soft_fine": "Soft & fine",
|
|
19
43
|
"choice.sometimes": "Sometimes",
|
|
44
|
+
"choice.thick_coarse": "Thick & Coarse",
|
|
45
|
+
"choice.two": "Two",
|
|
46
|
+
"choice.type1": "Type 1",
|
|
47
|
+
"choice.type1_2": "Type 1 & 2",
|
|
48
|
+
"choice.type2": "Type 2",
|
|
20
49
|
"choice.understand_agree": "I understand and agree",
|
|
50
|
+
"choice.urethra": "Urethra (opening where urine passes out of body)",
|
|
21
51
|
"choice.yes": "Yes",
|
|
52
|
+
"choice.yourself": "Yourself",
|
|
22
53
|
"indication.category.eyecare": "Eye Care",
|
|
23
54
|
"indication.category.generalhealth": "General Health",
|
|
24
55
|
"indication.category.menshealth": "Men's Health",
|
|
@@ -46,6 +77,7 @@
|
|
|
46
77
|
"indication.title.314316147": "Premature Ejaculation (Refill)",
|
|
47
78
|
"indication.title.314316306": "Thrush",
|
|
48
79
|
"indication.title.acne": "Acne",
|
|
80
|
+
"indication.title.adrenaline_pen": "Adrenaline Pen",
|
|
49
81
|
"indication.title.alcohol": "Alcohol Overuse",
|
|
50
82
|
"indication.title.allergic_conjunctivitis": "Allergic Conjunctivitis",
|
|
51
83
|
"indication.title.allergic_skin_reaction": "Allergic Skin Reaction",
|
|
@@ -58,7 +90,9 @@
|
|
|
58
90
|
"indication.title.depression": "Depression",
|
|
59
91
|
"indication.title.dry_eyes": "Dry Eyes",
|
|
60
92
|
"indication.title.eczema": "Eczema",
|
|
93
|
+
"indication.title.excess_facial_hair": "Excess Female Facial Hair",
|
|
61
94
|
"indication.title.fungal_infections": "Fungal Infections",
|
|
95
|
+
"indication.title.genital_herpes": "Episodic Genital Herpes",
|
|
62
96
|
"indication.title.hair_loss": "Male Hair Loss",
|
|
63
97
|
"indication.title.hypothyroidism": "Hypothyroidism (Refill)",
|
|
64
98
|
"indication.title.MalariaTablets": "Malaria Tablets",
|
|
@@ -113,6 +147,27 @@
|
|
|
113
147
|
"survey.acne.8.title": "Do you agree to the following?",
|
|
114
148
|
"survey.acne.9.description": "You confirm that you have answered all the above questions accurately and truthfully. \n\nYou acknowledge that providing incorrect or incomplete information can be hazardous to your health. \n\nYou agree to read the patient information leaflet supplied with your medication. \n\nYou will contact a doctor or pharmacist if any side effects bother you or do not go away.",
|
|
115
149
|
"survey.acne.9.title": "Do you agree to the following?",
|
|
150
|
+
"survey.adrenalinepen.1.title": "Have you been diagnosed by a doctor in the past with an anaphylactic allergy that requires you to carry a prefilled adrenaline injectable pen at all times for emergency use?",
|
|
151
|
+
"survey.adrenalinepen.10.title": "What severe allergy or allergies have you been diagnosed with in the past and that you need your Adrenaline Pen for?",
|
|
152
|
+
"survey.adrenalinepen.11.title": "How many times have you had to use your adrenaline pen in the past year?",
|
|
153
|
+
"survey.adrenalinepen.12.title": "At any time in the past, have you ever had to go to the Accident & Emergency due to an anaphylactic reaction or have you ever been admitted to hospital after a severe allergy episode?",
|
|
154
|
+
"survey.adrenalinepen.13.title": "When did you first get prescribed an adrenaline pen?",
|
|
155
|
+
"survey.adrenalinepen.14.title": "Do you have any history of asthma?",
|
|
156
|
+
"survey.adrenalinepen.15.title": "Do you have any history of heart disease/ stroke?",
|
|
157
|
+
"survey.adrenalinepen.16.description": "If so, please provide more details. If not, skip to the next question.",
|
|
158
|
+
"survey.adrenalinepen.16.title": "Are you being treated for any other medical conditions that your doctor should know about?",
|
|
159
|
+
"survey.adrenalinepen.17.description": "If so, please provide more details. If not, skip to the next question.",
|
|
160
|
+
"survey.adrenalinepen.17.title": "Are you currently taking any prescribed medications, inhalers or creams?",
|
|
161
|
+
"survey.adrenalinepen.18.description": "You confirm that you have answered all the above questions accurately and truthfully. \nYou acknowledge that providing incorrect or incomplete information can be hazardous to your health. \nYou agree to read the patient information leaflet supplied with your medication. \nYou will contact a doctor or pharmacist if any side effects bother you or do not go away. \nYou will visit a doctor urgently if you experience any mood changes or seizures.",
|
|
162
|
+
"survey.adrenalinepen.18.title": "Do you agree to the following?",
|
|
163
|
+
"survey.adrenalinepen.2.title": "Please confirm that you have been trained on how to use a prefilled adrenaline injectable pen and that you agree to carry the device at all times.",
|
|
164
|
+
"survey.adrenalinepen.3.title": "Are you aware of the potential signs and symptoms of an anaphylactic reaction?",
|
|
165
|
+
"survey.adrenalinepen.4.title": "This device is only for use in an emergency situation. Are you confident you know how and when to use an adrenaline device?",
|
|
166
|
+
"survey.adrenalinepen.5.title": "Are you breastfeeding or pregnant or might you be pregnant?",
|
|
167
|
+
"survey.adrenalinepen.6.title": "Please enter your height (specify if it is in centimeters, feet, or inches).",
|
|
168
|
+
"survey.adrenalinepen.7.title": "Please enter your weight (specify if it is in pounds, stones, or kilograms).",
|
|
169
|
+
"survey.adrenalinepen.8.title": "Please provide the full name of the doctor (or other healthcare professional) who issued your prescription. ",
|
|
170
|
+
"survey.adrenalinepen.9.title": "What is the exact name and dosage of the medication you were prescribed?",
|
|
116
171
|
"survey.alcohol.1.description": "I spent too much time drinking.",
|
|
117
172
|
"survey.alcohol.1.title": "In the past thirty (30) days...",
|
|
118
173
|
"survey.alcohol.2.description": "I drank heavily at a single sitting.",
|
|
@@ -378,6 +433,43 @@
|
|
|
378
433
|
"survey.erectile_dysfunction.7.title": "Do have a rare inherited eye disease, such as retinitis pigmentosa?",
|
|
379
434
|
"survey.erectile_dysfunction.8.title": "Do you have sickle cell anaemia (an abnormality of red blood cells), leukaemia (cancer of blood cells) or multiple myeloma (cancer of bone marrow)?",
|
|
380
435
|
"survey.erectile_dysfunction.9.title": "Do you have a deformity of your penis or Peyronie's Disease (curved penis)?",
|
|
436
|
+
"survey.excesshair.1.title": "Were you assigned female at birth, and are you over 18 years old?",
|
|
437
|
+
"survey.excesshair.10.title": "Have you experienced any unusual or rapid hair growth in the past few months?",
|
|
438
|
+
"survey.excesshair.11.title": "Which part of your body is affected?",
|
|
439
|
+
"survey.excesshair.12.title": "How would you describe the appearance of the hair?",
|
|
440
|
+
"survey.excesshair.13.description": "If yes, please specify if they are regular. If not, skip to the next question.",
|
|
441
|
+
"survey.excesshair.13.title": "Do you have periods?",
|
|
442
|
+
"survey.excesshair.14.description": "If yes, please specify which type of hormonal contraception. If not, skip to the next question.",
|
|
443
|
+
"survey.excesshair.14.title": "Are you using hormonal contraception?",
|
|
444
|
+
"survey.excesshair.15.description": "If yes, please provide more details. If not, skip to the next question.",
|
|
445
|
+
"survey.excesshair.15.title": "Are you using Hormonal Replacement Therapy (HRT)?",
|
|
446
|
+
"survey.excesshair.16.title": "Do you have any history of liver or kidney problems?",
|
|
447
|
+
"survey.excesshair.17.description": "If yes, please state if you are on any treatment for this. If not, skip to the next question.",
|
|
448
|
+
"survey.excesshair.17.title": "Have you ever been diagnosed with Polycystic Ovarian Syndrome (PCOS)?",
|
|
449
|
+
"survey.excesshair.18.description": "If yes, please provide more details. If not, skip to the next question.",
|
|
450
|
+
"survey.excesshair.18.title": "Are you being treated for any other medical conditions that your doctor should know about?",
|
|
451
|
+
"survey.excesshair.19.description": "If yes, please provide more details. If not, skip to the next question.",
|
|
452
|
+
"survey.excesshair.19.title": "Are you currently taking any prescribed medications, inhalers or creams?",
|
|
453
|
+
"survey.excesshair.2.title": "Do you suffer from unwanted facial hair?",
|
|
454
|
+
"survey.excesshair.20.description": "If yes, please specify duration of the treatment, and type (steroid inhalers, oral steroid tablets, steroid creams) . If not, skip to the next question.",
|
|
455
|
+
"survey.excesshair.20.title": "Are you currently taking regular steroid medication?",
|
|
456
|
+
"survey.excesshair.21.description": "If yes, please provide more details. If not, skip to the next question.",
|
|
457
|
+
"survey.excesshair.21.title": "Do you have an allergy or hypersensitivity to medications?",
|
|
458
|
+
"survey.excesshair.22.description": "Vaniqa works by slowing facial hair growth, it is not a hair removal cream.\nThe results of using Vaniqa are normally seen in 4-8 weeks but can take up to 4 months to work.\nVaniqa is for long term use and if stopped, original hair growth will return.\nVaniqa use should be strictly limited to the face and adjacent involved areas under the chin only.",
|
|
459
|
+
"survey.excesshair.22.title": "Do you confirm you understand the following?",
|
|
460
|
+
"survey.excesshair.23.description": "You confirm that you have answered all the above questions accurately and truthfully. \nYou acknowledge that providing incorrect or incomplete information can be hazardous to your health. \nYou agree to read the patient information leaflet supplied with your medication. \nYou will contact a doctor or pharmacist if any side effects bother you or do not go away. \nYou will visit a doctor urgently if you experience any mood changes or seizures.",
|
|
461
|
+
"survey.excesshair.23.title": "Do you agree to the following?",
|
|
462
|
+
"survey.excesshair.24.title": "Please note this service provides prescriptions for Vaniqa treatment, are you happy to proceed?",
|
|
463
|
+
"survey.excesshair.3.title": "Please enter your height (specify if it is in centimeters, feet, or inches).",
|
|
464
|
+
"survey.excesshair.4.title": "Please enter your weight (specify if it is in pounds, stones, or kilograms).",
|
|
465
|
+
"survey.excesshair.5.title": "Are you breastfeeding or pregnant or might you be pregnant?",
|
|
466
|
+
"survey.excesshair.6.description": "Cyclosporine\nLong term oral steroids (more than 3 months)\nMinoxidil\nPhenobarbitone\nPhenytoin\nDanazol",
|
|
467
|
+
"survey.excesshair.6.title": "Are you taking any of the following medications?",
|
|
468
|
+
"survey.excesshair.7.description": "Cushing’s syndrome\nCongenital Adrenal Hyperplasia \nHormone producing tumors of the ovary or adrenal glands",
|
|
469
|
+
"survey.excesshair.7.title": "Have you been diagnosed with any of the following?",
|
|
470
|
+
"survey.excesshair.8.description": "Irregular periods.\nSudden and rapid hair growth.\nSignificant acne.\nWeight gain of the upper back, torso or face.\nNew stretch marks (unrelated to pregnancy).\nDevelopment of masculine characteristics (voice deepening, increased muscle bulk or hair loss affecting the scalp).",
|
|
471
|
+
"survey.excesshair.8.title": "Are you experiencing any of the following symptoms?",
|
|
472
|
+
"survey.excesshair.9.title": "Are you currently using Vaniqa?",
|
|
381
473
|
"survey.fungal_infections.1.description": "• Athlete's foot.\n• Dandruff or Seborrheic dermatitis.\n• Pityriasis Versicolor.\n• Sweat rash (Intertrigo).\n• Jock itch.",
|
|
382
474
|
"survey.fungal_infections.1.title": "Have you been diagnosed for any of the following by your GP or a dermatologist?\n",
|
|
383
475
|
"survey.fungal_infections.2.title": "Have you ever had an allergic reaction or intolerance to clotrimazole, ketoconazole, miconazole, fluconazole or other antifungal medicine?",
|
|
@@ -388,6 +480,43 @@
|
|
|
388
480
|
"survey.fungal_infections.5.title": "Please contact your GP if any of these occur:",
|
|
389
481
|
"survey.fungal_infections.6.description": "You confirm that you have answered all the above questions accurately and truthfully. \n\nYou acknowledge that providing incorrect or incomplete information can be hazardous to your health. \n\nYou agree to read the patient information leaflet supplied with your medication. \n\nYou will contact a doctor or pharmacist if any side effects bother you or do not go away.",
|
|
390
482
|
"survey.fungal_infections.6.title": "Please read carefully:",
|
|
483
|
+
"survey.genitalherpes.1.description": "If you have genital sores you MUST have an in-person medical assessment to confirm the diagnosis and arrange appropriate management before obtaining further medical treatment online. This service is not suitable if you have not been diagnosed by a healthcare professional.",
|
|
484
|
+
"survey.genitalherpes.1.title": "Have you previously been diagnosed with genital herpes by a healthcare professional?",
|
|
485
|
+
"survey.genitalherpes.10.title": "Have you ever had a swab, urine or blood test to confirm this diagnosis?",
|
|
486
|
+
"survey.genitalherpes.11.title": "Do you know what type of herpes simplex infection you have?",
|
|
487
|
+
"survey.genitalherpes.12.title": "Where do the herpes lesions affect you during a flare?",
|
|
488
|
+
"survey.genitalherpes.13.title": "When was the last time you had an outbreak of genital herpes?",
|
|
489
|
+
"survey.genitalherpes.14.title": "Did your symptoms resolve completely?",
|
|
490
|
+
"survey.genitalherpes.15.description": "If you are having more than 6 significant episodes per year, you should arrange a review with your doctor for assessment to exclude problems with your immune system and to discuss suppression treatment (medication taken for 3-12 months with the aim of reducing the frequency & severity of episodes ongoing).",
|
|
491
|
+
"survey.genitalherpes.15.title": "How often have you experienced outbreaks of genital herpes in the past year?",
|
|
492
|
+
"survey.genitalherpes.16.title": "Why are you requesting treatment?",
|
|
493
|
+
"survey.genitalherpes.17.title": "When did your current symptoms start?",
|
|
494
|
+
"survey.genitalherpes.18.title": "Are new lesions still appearing?",
|
|
495
|
+
"survey.genitalherpes.19.description": "If the answer is yes, please provide more details (what treatment you are using, and how long you have been using this). If not, skip to the next question.",
|
|
496
|
+
"survey.genitalherpes.19.title": "Are you currently using any treatments for genital herpes?",
|
|
497
|
+
"survey.genitalherpes.2.description": "We are unable to provide prescriptions for extended courses of treatment (suppression treatment). A more detailed clinical history would be necessary to arrange this. Please contact your local GP or sexual health clinic to discuss this further. Are you happy to proceed?",
|
|
498
|
+
"survey.genitalherpes.2.title": "This service provides prescriptions for up to 5 days of aciclovir or valaciclovir medication, to treat a significant acute flare of genital herpes or in preparation for a future significant flare.",
|
|
499
|
+
"survey.genitalherpes.20.description": "If yes, please provide more details. If not, skip to the next question.",
|
|
500
|
+
"survey.genitalherpes.20.title": "Have you used any prescribed medication for genital herpes before?",
|
|
501
|
+
"survey.genitalherpes.21.description": "If yes, please provide more details. If not, skip to the next question.",
|
|
502
|
+
"survey.genitalherpes.21.title": "Do you take any prescribed medication or over the counter products?",
|
|
503
|
+
"survey.genitalherpes.22.description": "If yes, please provide more details. If not, skip to the next question.",
|
|
504
|
+
"survey.genitalherpes.22.title": "Do you have an allergy or hypersensitivity to medications?",
|
|
505
|
+
"survey.genitalherpes.23.description": "Please seek medical advice if:\n\nThe genital herpes lesions are getting worse, even if you are taking the prescribed medication (e.g. increased number of lesions, lesions getting bigger, increased pain, pus).\nYou start to feel unwell, or develop a temperature at any time.\nThe herpes lesions are not healing /starting to heal by the end of your treatment (5 days).\nNew lesions start to appear after day 3 of your treatment, or after your treatment is completed.\nYou develop lesions inside your anal area.\nYou develop lesions at new locations (areas where they do not usually appear).\nYou are concerned you are developing an allergic reaction to this medication (stop the medication until you speak with a doctor for advice).",
|
|
506
|
+
"survey.genitalherpes.23.title": "Please confirm you have read and understood this information:",
|
|
507
|
+
"survey.genitalherpes.24.description": "You confirm that you have answered all the above questions accurately and truthfully. \nYou acknowledge that providing incorrect or incomplete information can be hazardous to your health. \nYou agree to read the patient information leaflet supplied with your medication. \nYou will contact a doctor or pharmacist if any side effects bother you or do not go away. \nYou will visit a doctor urgently if you experience any mood changes or seizures.",
|
|
508
|
+
"survey.genitalherpes.24.title": "Do you agree to the following?",
|
|
509
|
+
"survey.genitalherpes.3.description": "Temperature/ shivering\nMuscles aches & pains\nDifficulty or pain passing urine\nUnable to pass urine\nUnable to pass a bowel motion or pain/ bleeding from the back passage\nVomiting\nHeadache/ neck stiffness",
|
|
510
|
+
"survey.genitalherpes.3.title": "Do you have any of the following symptoms?",
|
|
511
|
+
"survey.genitalherpes.4.title": "Are you breastfeeding or pregnant or might you be pregnant?",
|
|
512
|
+
"survey.genitalherpes.5.description": "This refers to any significant decrease in your kidney function and does not relate to urine infections.",
|
|
513
|
+
"survey.genitalherpes.5.title": "Do you have significant kidney disease?",
|
|
514
|
+
"survey.genitalherpes.6.description": "This can be due to illnesses such as cancer, HIV or autoimmune conditions, or because of treatment you are receiving such as chemotherapy/ radiotherapy, or drugs such as methotrexate, ciclosporin or regular/ prolonged use of oral steroids.",
|
|
515
|
+
"survey.genitalherpes.6.title": "Do you have a weak immune system (immunocompromised)?",
|
|
516
|
+
"survey.genitalherpes.7.title": "This service is to treat herpes lesions on/ around your genitals. Are all your lesions located in this areas ONLY?",
|
|
517
|
+
"survey.genitalherpes.8.description": "If yes, please provide more details. If not, skip to the next question.",
|
|
518
|
+
"survey.genitalherpes.8.title": "Do you have any other medical conditions?",
|
|
519
|
+
"survey.genitalherpes.9.title": "Who diagnosed you with genital herpes?",
|
|
391
520
|
"survey.hairloss.1.title": "Please select the pattern of hair loss that most closely matches your hair loss from the options below.",
|
|
392
521
|
"survey.hairloss.10.title": "Please list any and all medications you are currently taking.\nIf none, skip to the next question.",
|
|
393
522
|
"survey.hairloss.11.description": "If so, please specify the name of the medication. If not, skip to the next question.",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"choice.type_2_diabetes": "Diabete di tipo 2",
|
|
51
51
|
"close.subtitle": "Prima di chiudere la consultazione, si consiglia di scaricare il PDF riassuntivo per una futura revisione.",
|
|
52
52
|
"close.title": "Sei sicuro/a di voler chiudere?",
|
|
53
|
-
"condition_symptom.uti": "
|
|
53
|
+
"condition_symptom.uti": "Condizioni urologiche femminili",
|
|
54
54
|
"consultation.summary_being_prepared": "sta preparando un riepilogo della tua consulenza.",
|
|
55
55
|
"contact.enter_message_below": "Inserisci il tuo messaggio qui sotto.",
|
|
56
56
|
"contact.hi": "Ciao",
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
interface Area {
|
|
3
|
+
key: string;
|
|
4
|
+
}
|
|
5
|
+
export interface District {
|
|
6
|
+
key: string;
|
|
7
|
+
areas: Area[];
|
|
8
|
+
}
|
|
9
|
+
export declare const DISTRICT_AREAS: District[];
|
|
2
10
|
export declare const HKDeliveryAddressSchema: z.ZodObject<{
|
|
3
11
|
house: z.ZodString;
|
|
4
12
|
building: z.ZodString;
|
|
5
13
|
street: z.ZodString;
|
|
6
|
-
district: z.
|
|
14
|
+
district: z.ZodEnum<[string, ...string[]]>;
|
|
7
15
|
country: z.ZodOptional<z.ZodString>;
|
|
8
16
|
}, "strip", z.ZodTypeAny, {
|
|
9
17
|
house?: string;
|
|
@@ -19,3 +27,4 @@ export declare const HKDeliveryAddressSchema: z.ZodObject<{
|
|
|
19
27
|
country?: string;
|
|
20
28
|
}>;
|
|
21
29
|
export type HKDeliveryAddress = z.infer<typeof HKDeliveryAddressSchema>;
|
|
30
|
+
export {};
|
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HKDeliveryAddressSchema = void 0;
|
|
3
|
+
exports.HKDeliveryAddressSchema = exports.DISTRICT_AREAS = void 0;
|
|
4
4
|
var zod_1 = require("../utils/zod");
|
|
5
5
|
var zod_2 = require("zod");
|
|
6
|
+
exports.DISTRICT_AREAS = [
|
|
7
|
+
{
|
|
8
|
+
key: 'island',
|
|
9
|
+
areas: [{ key: 'central' }, { key: 'eastern' }, { key: 'southern' }, { key: 'wan_chai' }]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
key: 'kowloon',
|
|
13
|
+
areas: [{ key: 'city' }, { key: 'kwun_tong' }, { key: 'sham_shui_po' }, { key: 'wong_tai_sin' }, { key: 'yau_tsim_mong' }]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: 'new_territories',
|
|
17
|
+
areas: [
|
|
18
|
+
{ key: 'islands' },
|
|
19
|
+
{ key: 'kwai_tsing' },
|
|
20
|
+
{ key: 'north' },
|
|
21
|
+
{ key: 'sai_kung' },
|
|
22
|
+
{ key: 'sha_tin' },
|
|
23
|
+
{ key: 'tai_po' },
|
|
24
|
+
{ key: 'tsuen_wan' },
|
|
25
|
+
{ key: 'tuen_mun' },
|
|
26
|
+
{ key: 'yuen_long' }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
var DISTRICTS = exports.DISTRICT_AREAS.flatMap(function (d) { return d.areas.map(function (a) { return a.key; }); });
|
|
31
|
+
console.log({ DISTRICTS: DISTRICTS });
|
|
6
32
|
exports.HKDeliveryAddressSchema = zod_2.z.object({
|
|
7
33
|
house: zod_1.requiredString,
|
|
8
34
|
building: zod_1.requiredString,
|
|
9
35
|
street: zod_1.requiredString,
|
|
10
|
-
district:
|
|
36
|
+
district: zod_2.z.enum(DISTRICTS),
|
|
11
37
|
country: zod_2.z.string().optional()
|
|
12
38
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
var logger_1 = require("../api/logger");
|
|
5
|
+
var logger_2 = require("../api/models/logger");
|
|
6
|
+
var react_native_1 = require("react-native");
|
|
7
|
+
exports.Logger = {
|
|
8
|
+
debug: function (message, data) {
|
|
9
|
+
var log = {
|
|
10
|
+
level: logger_2.LogLevel.DEBUG,
|
|
11
|
+
message: message,
|
|
12
|
+
data: data,
|
|
13
|
+
platform: react_native_1.Platform
|
|
14
|
+
};
|
|
15
|
+
console.log('🟣', log);
|
|
16
|
+
return new Promise(function (resolve) { return resolve(); });
|
|
17
|
+
},
|
|
18
|
+
log: function (message, data) {
|
|
19
|
+
var log = {
|
|
20
|
+
level: logger_2.LogLevel.INFO,
|
|
21
|
+
message: message,
|
|
22
|
+
data: data,
|
|
23
|
+
platform: react_native_1.Platform
|
|
24
|
+
};
|
|
25
|
+
console.log('⚪', log);
|
|
26
|
+
// return sendLog(log)
|
|
27
|
+
return new Promise(function (resolve) { return resolve(); });
|
|
28
|
+
},
|
|
29
|
+
error: function (message, data) {
|
|
30
|
+
var log = {
|
|
31
|
+
level: logger_2.LogLevel.ERROR,
|
|
32
|
+
message: message,
|
|
33
|
+
data: data,
|
|
34
|
+
platform: react_native_1.Platform
|
|
35
|
+
};
|
|
36
|
+
console.error('🔴', log);
|
|
37
|
+
return (0, logger_1.sendLog)(log);
|
|
38
|
+
},
|
|
39
|
+
warn: function (message, data) {
|
|
40
|
+
var log = {
|
|
41
|
+
level: logger_2.LogLevel.WARN,
|
|
42
|
+
message: message,
|
|
43
|
+
data: data,
|
|
44
|
+
platform: react_native_1.Platform
|
|
45
|
+
};
|
|
46
|
+
console.warn('🟡', log);
|
|
47
|
+
return (0, logger_1.sendLog)(log);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -82,9 +82,9 @@ var Text_1 = require("../../common/components/Text");
|
|
|
82
82
|
var useConsultation_1 = require("../../common/hooks/useConsultation");
|
|
83
83
|
var useTheme_1 = require("../../common/hooks/useTheme");
|
|
84
84
|
var useTranslation_1 = require("../../common/hooks/useTranslation");
|
|
85
|
-
var useUser_1 = require("../../common/hooks/useUser");
|
|
86
85
|
var BackArrowIcon_1 = require("../../common/icons/BackArrowIcon");
|
|
87
86
|
var CloseIcon_1 = require("../../common/icons/CloseIcon");
|
|
87
|
+
var logger_1 = require("../../common/utils/logger");
|
|
88
88
|
var prescription_1 = require("../api/prescription");
|
|
89
89
|
var useIndicationSurvey_1 = require("../hooks/useIndicationSurvey");
|
|
90
90
|
var useIndicationSurveyAnswers_1 = require("../hooks/useIndicationSurveyAnswers");
|
|
@@ -100,7 +100,6 @@ var ReasonScreen = function () {
|
|
|
100
100
|
var resetIndicationSurvey = (0, useIndicationSurvey_1.useIndicationSurvey)().resetIndicationSurvey;
|
|
101
101
|
var previousScreen = (0, useScreens_1.useScreens)().previousScreen;
|
|
102
102
|
var indicationSurveyAnswers = (0, useIndicationSurveyAnswers_1.useIndicationSurveyAnswers)().indicationSurveyAnswers;
|
|
103
|
-
var user = (0, useUser_1.useUser)().user;
|
|
104
103
|
var updateConsultation = (0, useConsultation_1.useConsultation)().updateConsultation;
|
|
105
104
|
var theme = (0, useTheme_1.useTheme)();
|
|
106
105
|
var styles = getStyles(theme);
|
|
@@ -119,7 +118,7 @@ var ReasonScreen = function () {
|
|
|
119
118
|
updateConsultation(consultation);
|
|
120
119
|
})
|
|
121
120
|
.catch(function (error) {
|
|
122
|
-
|
|
121
|
+
logger_1.Logger.error('Failed to create prescription', error);
|
|
123
122
|
})
|
|
124
123
|
.finally(function () {
|
|
125
124
|
setLoading(false);
|
|
@@ -2,6 +2,6 @@ import { EventHandlers } from '../../common/helpers/eventHandler';
|
|
|
2
2
|
import { HKDeliveryAddress } from '../../common/types/deliveryAddress';
|
|
3
3
|
export interface VideoConsultationProps {
|
|
4
4
|
eventHandlers?: EventHandlers;
|
|
5
|
-
deliveryAddress?: HKDeliveryAddress
|
|
5
|
+
deliveryAddress?: Omit<HKDeliveryAddress, 'country'>;
|
|
6
6
|
}
|
|
7
7
|
export declare const VideoConsultation: ({ eventHandlers, deliveryAddress }: VideoConsultationProps) => import("react").JSX.Element;
|
|
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.AgoraWrapper = void 0;
|
|
40
|
+
var logger_1 = require("../../../common/utils/logger");
|
|
40
41
|
var platform_1 = require("../../../common/utils/platform");
|
|
41
42
|
var useInitRtcEngine_1 = __importDefault(require("../../hooks/useInitRtcEngine"));
|
|
42
43
|
var react_1 = __importStar(require("react"));
|
|
@@ -53,11 +54,11 @@ var AgoraWrapper = function (_a) {
|
|
|
53
54
|
var _f = (0, useInitRtcEngine_1.default)(rtcProps, true), channelId = _f.channelId, token = _f.token, uid = _f.uid, joinChannelSuccess = _f.joinChannelSuccess, remoteUsers = _f.remoteUsers, startPreview = _f.startPreview, engine = _f.engine, setRemoteUsers = _f.setRemoteUsers;
|
|
54
55
|
var joinChannel = function () {
|
|
55
56
|
if (!channelId) {
|
|
56
|
-
|
|
57
|
+
logger_1.Logger.error('channelId is invalid');
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
60
|
if (uid < 0) {
|
|
60
|
-
|
|
61
|
+
logger_1.Logger.error('uid is invalid');
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
64
|
engine.current.joinChannel(token, channelId, uid, {
|
|
@@ -87,7 +88,11 @@ var AgoraWrapper = function (_a) {
|
|
|
87
88
|
engine.current.leaveChannel();
|
|
88
89
|
};
|
|
89
90
|
var onUserOffline = (0, react_1.useCallback)(function (connection, remoteUid, reason) {
|
|
90
|
-
|
|
91
|
+
logger_1.Logger.debug('AgoraWrapper:onUserOffline', {
|
|
92
|
+
connection: connection,
|
|
93
|
+
remoteUid: remoteUid,
|
|
94
|
+
reason: reason
|
|
95
|
+
});
|
|
91
96
|
setRemoteVideoMuted(true);
|
|
92
97
|
if (connection.channelId === channelId && (connection.localUid === uid || uid === 0)) {
|
|
93
98
|
setRemoteUsers(function (prev) {
|
|
@@ -99,20 +104,40 @@ var AgoraWrapper = function (_a) {
|
|
|
99
104
|
}, [channelId, uid]);
|
|
100
105
|
(0, react_1.useEffect)(function () {
|
|
101
106
|
engine.current.addListener('onVideoDeviceStateChanged', function (deviceId, deviceType, deviceState) {
|
|
102
|
-
|
|
107
|
+
logger_1.Logger.debug('AgoraWrapper:onVideoDeviceStateChanged', {
|
|
108
|
+
deviceId: deviceId,
|
|
109
|
+
deviceType: deviceType,
|
|
110
|
+
deviceState: deviceState
|
|
111
|
+
});
|
|
103
112
|
});
|
|
104
113
|
engine.current.addListener('onLocalVideoStateChanged', function (source, state, error) {
|
|
105
|
-
|
|
114
|
+
logger_1.Logger.debug('AgoraWrapper:onLocalVideoStateChanged', {
|
|
115
|
+
source: source,
|
|
116
|
+
state: state,
|
|
117
|
+
error: error
|
|
118
|
+
});
|
|
106
119
|
});
|
|
107
120
|
engine.current.addListener('onLocalAudioStateChanged', function (connection, state, error) {
|
|
108
|
-
|
|
121
|
+
logger_1.Logger.debug('AgoraWrapper:onLocalAudioStateChanged', {
|
|
122
|
+
connection: connection,
|
|
123
|
+
state: state,
|
|
124
|
+
error: error
|
|
125
|
+
});
|
|
109
126
|
});
|
|
110
127
|
engine.current.addListener('onUserMuteVideo', function (connection, remoteUid, muted) {
|
|
111
|
-
|
|
128
|
+
logger_1.Logger.debug('AgoraWrapper:onUserMuteVideo', {
|
|
129
|
+
connection: connection,
|
|
130
|
+
remoteUid: remoteUid,
|
|
131
|
+
muted: muted
|
|
132
|
+
});
|
|
112
133
|
setRemoteVideoMuted(muted);
|
|
113
134
|
});
|
|
114
135
|
engine.current.addListener('onUserMuteAudio', function (connection, remoteUid, muted) {
|
|
115
|
-
|
|
136
|
+
logger_1.Logger.debug('AgoraWrapper:onUserMuteAudio', {
|
|
137
|
+
connection: connection,
|
|
138
|
+
remoteUid: remoteUid,
|
|
139
|
+
muted: muted
|
|
140
|
+
});
|
|
116
141
|
setRemoteAudioMuted(muted);
|
|
117
142
|
});
|
|
118
143
|
engine.current.addListener('onUserJoined', function () {
|
|
@@ -126,9 +151,9 @@ var AgoraWrapper = function (_a) {
|
|
|
126
151
|
};
|
|
127
152
|
}, [engine, onUserOffline]);
|
|
128
153
|
(0, react_1.useEffect)(function () {
|
|
129
|
-
|
|
154
|
+
logger_1.Logger.debug('AgoraWrapper:startPreview', { startPreview: startPreview, channelId: channelId });
|
|
130
155
|
if (startPreview && channelId) {
|
|
131
|
-
|
|
156
|
+
logger_1.Logger.debug('AgoraWrapper:joinChannel');
|
|
132
157
|
joinChannel();
|
|
133
158
|
}
|
|
134
159
|
}, [startPreview, channelId]);
|
|
@@ -78,6 +78,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
78
78
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
79
79
|
};
|
|
80
80
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
81
|
+
var logger_1 = require("../../common/utils/logger");
|
|
81
82
|
var permission_1 = require("../utils/permission");
|
|
82
83
|
var react_1 = require("react");
|
|
83
84
|
var react_native_agora_1 = __importStar(require("react-native-agora"));
|
|
@@ -93,7 +94,7 @@ var useInitRtcEngine = function (rtcProps, enableVideo, listenUserJoinOrLeave) {
|
|
|
93
94
|
switch (_a.label) {
|
|
94
95
|
case 0:
|
|
95
96
|
if (!appId) {
|
|
96
|
-
|
|
97
|
+
logger_1.Logger.error("appId is invalid");
|
|
97
98
|
throw new Error('appId is invalid');
|
|
98
99
|
}
|
|
99
100
|
engine.current.initialize({
|
|
@@ -117,23 +118,30 @@ var useInitRtcEngine = function (rtcProps, enableVideo, listenUserJoinOrLeave) {
|
|
|
117
118
|
});
|
|
118
119
|
}); }, [appId, enableVideo]);
|
|
119
120
|
var onError = (0, react_1.useCallback)(function (err, msg) {
|
|
120
|
-
|
|
121
|
+
logger_1.Logger.debug('useInitRtcEngine:onError', { err: err, msg: msg });
|
|
121
122
|
}, []);
|
|
122
123
|
var onJoinChannelSuccess = (0, react_1.useCallback)(function (connection, elapsed) {
|
|
123
|
-
|
|
124
|
+
logger_1.Logger.debug('useInitRtcEngine:onJoinChannelSuccess', {
|
|
125
|
+
connection: connection,
|
|
126
|
+
elapsed: elapsed
|
|
127
|
+
});
|
|
124
128
|
if (connection.channelId === channelId && (connection.localUid === uid || uid === 0)) {
|
|
125
129
|
setJoinChannelSuccess(true);
|
|
126
130
|
}
|
|
127
131
|
}, [channelId, uid]);
|
|
128
132
|
var onLeaveChannel = (0, react_1.useCallback)(function (connection, stats) {
|
|
129
|
-
|
|
133
|
+
logger_1.Logger.debug('useInitRtcEngine:onLeaveChannel', { connection: connection, stats: stats });
|
|
130
134
|
if (connection.channelId === channelId && (connection.localUid === uid || uid === 0)) {
|
|
131
135
|
setJoinChannelSuccess(false);
|
|
132
136
|
setRemoteUsers([]);
|
|
133
137
|
}
|
|
134
138
|
}, [channelId, uid]);
|
|
135
139
|
var onUserJoined = (0, react_1.useCallback)(function (connection, remoteUid, elapsed) {
|
|
136
|
-
|
|
140
|
+
logger_1.Logger.debug('useInitRtcEngine:onUserJoined', {
|
|
141
|
+
connection: connection,
|
|
142
|
+
remoteUid: remoteUid,
|
|
143
|
+
elapsed: elapsed
|
|
144
|
+
});
|
|
137
145
|
if (connection.channelId === channelId && (connection.localUid === uid || uid === 0)) {
|
|
138
146
|
setRemoteUsers(function (prev) {
|
|
139
147
|
if (prev === undefined)
|
|
@@ -85,41 +85,103 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
85
85
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86
86
|
exports.DeliveryAddressScreen = void 0;
|
|
87
87
|
var Button_1 = require("../../common/components/Button");
|
|
88
|
+
var FormControl_1 = __importDefault(require("../../common/components/FormControl"));
|
|
88
89
|
var FormWrapper_1 = require("../../common/components/FormWrapper");
|
|
89
90
|
var Header_1 = require("../../common/components/headers/Header");
|
|
90
91
|
var Input_1 = __importDefault(require("../../common/components/Input"));
|
|
91
92
|
var ScreenWrapper_1 = require("../../common/components/ScreenWrapper");
|
|
92
|
-
var Select_1 = __importDefault(require("../../common/components/Select"));
|
|
93
93
|
var Text_1 = require("../../common/components/Text");
|
|
94
94
|
var useConsultation_1 = require("../../common/hooks/useConsultation");
|
|
95
|
+
var useForm_1 = require("../../common/hooks/useForm");
|
|
95
96
|
var useTheme_1 = require("../../common/hooks/useTheme");
|
|
96
97
|
var useTranslation_1 = require("../../common/hooks/useTranslation");
|
|
97
98
|
var WarningIcon_1 = __importDefault(require("../../common/icons/WarningIcon"));
|
|
98
99
|
var deliveryAddress_1 = require("../../common/types/deliveryAddress");
|
|
100
|
+
var logger_1 = require("../../common/utils/logger");
|
|
99
101
|
var video_1 = require("../api/video");
|
|
100
102
|
var VideoConsultationIcon_1 = require("../icons/VideoConsultationIcon");
|
|
101
103
|
var react_1 = __importStar(require("react"));
|
|
102
104
|
var react_native_1 = require("react-native");
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
'
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
105
|
+
var CategorySelect = function (_a) {
|
|
106
|
+
var id = _a.id, label = _a.label, placeholder = _a.placeholder, options = _a.options;
|
|
107
|
+
var _b = (0, useForm_1.useForm)(), data = _b.data, updateData = _b.updateData, errors = _b.errors, clearError = _b.clearError, loading = _b.loading;
|
|
108
|
+
var theme = (0, useTheme_1.useTheme)();
|
|
109
|
+
var t = (0, useTranslation_1.useTranslation)().t;
|
|
110
|
+
var _c = (0, react_1.useState)(false), modalVisible = _c[0], setModalVisible = _c[1];
|
|
111
|
+
var value = (data === null || data === void 0 ? void 0 : data[id]) || '';
|
|
112
|
+
var error = errors === null || errors === void 0 ? void 0 : errors[id];
|
|
113
|
+
var styles = react_native_1.StyleSheet.create({
|
|
114
|
+
containerSelect: {
|
|
115
|
+
flexDirection: 'row',
|
|
116
|
+
justifyContent: 'space-between',
|
|
117
|
+
alignItems: 'center',
|
|
118
|
+
padding: theme.spacing.sm,
|
|
119
|
+
borderWidth: 1,
|
|
120
|
+
borderColor: error ? theme.palette.error : theme.palette.grey.base,
|
|
121
|
+
borderRadius: theme.borderRadius.md,
|
|
122
|
+
width: '100%',
|
|
123
|
+
backgroundColor: theme.palette.white
|
|
124
|
+
},
|
|
125
|
+
placeholder: {
|
|
126
|
+
color: theme.palette.grey.base
|
|
127
|
+
},
|
|
128
|
+
selected: {
|
|
129
|
+
color: theme.font.base.color
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
var selectedLabel = (function () {
|
|
133
|
+
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
134
|
+
var group = options_1[_i];
|
|
135
|
+
var found = group.areas.find(function (a) { return a.key === value; });
|
|
136
|
+
if (found)
|
|
137
|
+
return t("country.hk.area.".concat(group.key, ".district.").concat(found.key));
|
|
138
|
+
}
|
|
139
|
+
return '';
|
|
140
|
+
})();
|
|
141
|
+
return (<FormControl_1.default label={label} error={error} name={id} type="select">
|
|
142
|
+
<react_native_1.TouchableOpacity style={styles.containerSelect} onPress={function () {
|
|
143
|
+
if (!loading) {
|
|
144
|
+
clearError === null || clearError === void 0 ? void 0 : clearError(id);
|
|
145
|
+
setModalVisible(true);
|
|
146
|
+
}
|
|
147
|
+
}} disabled={loading} accessibilityRole="button" accessibilityLabel={label}>
|
|
148
|
+
<Text_1.Text style={selectedLabel ? styles.selected : styles.placeholder}>{selectedLabel || placeholder}</Text_1.Text>
|
|
149
|
+
</react_native_1.TouchableOpacity>
|
|
150
|
+
<react_native_1.Modal visible={modalVisible} animationType="slide" transparent={true} onRequestClose={function () { return setModalVisible(false); }}>
|
|
151
|
+
<react_native_1.Pressable style={{
|
|
152
|
+
flex: 1,
|
|
153
|
+
backgroundColor: 'rgba(0,0,0,0.3)',
|
|
154
|
+
justifyContent: 'center',
|
|
155
|
+
padding: theme.spacing.md
|
|
156
|
+
}} onPress={function () { return setModalVisible(false); }}>
|
|
157
|
+
<react_native_1.Pressable style={{
|
|
158
|
+
backgroundColor: 'white',
|
|
159
|
+
borderRadius: theme.borderRadius.md,
|
|
160
|
+
padding: theme.spacing.md,
|
|
161
|
+
maxHeight: '90%',
|
|
162
|
+
minHeight: 300
|
|
163
|
+
}} onPress={function (e) { return e.stopPropagation && e.stopPropagation(); }}>
|
|
164
|
+
<react_native_1.FlatList data={options} keyExtractor={function (item) { return item.key; }} renderItem={function (_a) {
|
|
165
|
+
var group = _a.item;
|
|
166
|
+
return (<react_native_1.View style={{ marginBottom: theme.spacing.xs }}>
|
|
167
|
+
<Text_1.Text style={{ fontWeight: 'bold', marginBottom: theme.spacing.xxs }}>{t("country.hk.area.".concat(group.key))}</Text_1.Text>
|
|
168
|
+
{group.areas.map(function (area) { return (<react_native_1.Pressable key={area.key} onPress={function () {
|
|
169
|
+
updateData === null || updateData === void 0 ? void 0 : updateData(id)(area.key);
|
|
170
|
+
setModalVisible(false);
|
|
171
|
+
}} style={{ paddingVertical: theme.spacing.xs, paddingLeft: theme.spacing.sm }}>
|
|
172
|
+
<Text_1.Text style={{
|
|
173
|
+
color: value === area.key && theme.palette.primary.dark
|
|
174
|
+
}}>
|
|
175
|
+
{t("country.hk.area.".concat(group.key, ".district.").concat(area.key))}
|
|
176
|
+
</Text_1.Text>
|
|
177
|
+
</react_native_1.Pressable>); })}
|
|
178
|
+
</react_native_1.View>);
|
|
179
|
+
}}/>
|
|
180
|
+
</react_native_1.Pressable>
|
|
181
|
+
</react_native_1.Pressable>
|
|
182
|
+
</react_native_1.Modal>
|
|
183
|
+
</FormControl_1.default>);
|
|
184
|
+
};
|
|
123
185
|
var DeliveryAddressScreen = function (_a) {
|
|
124
186
|
var initialDeliveryAddress = _a.initialDeliveryAddress;
|
|
125
187
|
var t = (0, useTranslation_1.useTranslation)().t;
|
|
@@ -142,7 +204,7 @@ var DeliveryAddressScreen = function (_a) {
|
|
|
142
204
|
return [3 /*break*/, 3];
|
|
143
205
|
case 2:
|
|
144
206
|
e_1 = _a.sent();
|
|
145
|
-
|
|
207
|
+
logger_1.Logger.error('DeliveryAddressScreen:onSubmit', e_1);
|
|
146
208
|
setError(true);
|
|
147
209
|
setLoading(false);
|
|
148
210
|
return [3 /*break*/, 3];
|
|
@@ -170,10 +232,7 @@ var DeliveryAddressScreen = function (_a) {
|
|
|
170
232
|
<Input_1.default id="house" label={t('delivery.address.number_and_floor')} placeholder={t('delivery.address.number_and_floor.placeholder')}/>
|
|
171
233
|
<Input_1.default id="street" label={t('delivery.address.street')} placeholder={t('delivery.address.street.placeholder')}/>
|
|
172
234
|
<Input_1.default id="building" label={t('delivery.address.building_name_number')} placeholder={t('delivery.address.building_name_number.placeholder')}/>
|
|
173
|
-
<
|
|
174
|
-
label: t("delivery.address.district.hk.".concat(district)),
|
|
175
|
-
value: district
|
|
176
|
-
}); }).sort(function (a, z) { return a.label.localeCompare(z.label); })}/>
|
|
235
|
+
<CategorySelect id="district" label={t('delivery.address.district')} placeholder={t('delivery.address.district.placeholder')} options={deliveryAddress_1.DISTRICT_AREAS}/>
|
|
177
236
|
</FormWrapper_1.FormWrapper>
|
|
178
237
|
</ScreenWrapper_1.ScreenWrapper>);
|
|
179
238
|
};
|
|
@@ -80,6 +80,7 @@ var Text_1 = require("../../common/components/Text");
|
|
|
80
80
|
var useConsultation_1 = require("../../common/hooks/useConsultation");
|
|
81
81
|
var useTheme_1 = require("../../common/hooks/useTheme");
|
|
82
82
|
var useTranslation_1 = require("../../common/hooks/useTranslation");
|
|
83
|
+
var logger_1 = require("../../common/utils/logger");
|
|
83
84
|
var video_1 = require("../api/video");
|
|
84
85
|
var AgoraWrapper_1 = __importDefault(require("../components/agora/AgoraWrapper"));
|
|
85
86
|
var VideoConsultationIcon_1 = require("../icons/VideoConsultationIcon");
|
|
@@ -104,7 +105,7 @@ var VideoCallScreen = function (_a) {
|
|
|
104
105
|
setIsHangOut(true);
|
|
105
106
|
onVideoCallLeft === null || onVideoCallLeft === void 0 ? void 0 : onVideoCallLeft();
|
|
106
107
|
return [4 /*yield*/, (0, video_1.hangOutVideoCall)({ consultationId: consultation.id, room: room }).catch(function (error) {
|
|
107
|
-
|
|
108
|
+
logger_1.Logger.error('Error ending video call:', error);
|
|
108
109
|
setIsHangOut(false);
|
|
109
110
|
})];
|
|
110
111
|
case 1:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abihealth/goapp-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
"react-native-bouncy-checkbox": "4.1.2",
|
|
24
24
|
"react-native-date-picker": "5.0.1",
|
|
25
25
|
"react-native-phone-input": "1.3.7",
|
|
26
|
-
"react-native-svg": "^15.11.1",
|
|
27
26
|
"react-native-ssl-public-key-pinning": "^1.2.5",
|
|
27
|
+
"react-native-svg": "^15.11.1",
|
|
28
28
|
"zod": "3.24.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
+
"@abiglobalhealth/prettier-config": "1.4.2",
|
|
31
32
|
"@abiglobalhealth/ts-config": "1.3.0",
|
|
32
33
|
"@tsconfig/react-native": "3.0.5",
|
|
33
34
|
"@types/jest": "29.5.12",
|