@abihealth/goapp-react-native 1.18.0 → 1.19.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 +19 -0
- package/dist/common/api/consultation.d.ts +4 -6
- package/dist/common/api/consultation.js +28 -70
- package/dist/common/api/models/auth.d.ts +0 -8
- package/dist/common/api/models/consultation.d.ts +0 -1
- package/dist/common/api/models/partner.d.ts +3 -0
- package/dist/common/api/models/partner.js +2 -0
- package/dist/common/api/partner.d.ts +2 -0
- package/dist/common/api/partner.js +10 -0
- package/dist/common/api/user.d.ts +3 -0
- package/dist/common/api/user.js +7 -1
- package/dist/common/components/Header/ConsultationHeader.d.ts +3 -0
- package/dist/common/components/Header/ConsultationHeader.js +28 -0
- package/dist/common/components/{Header.d.ts → Header/index.d.ts} +1 -2
- package/dist/common/components/{Header.js → Header/index.js} +2 -2
- package/dist/common/components/Input.d.ts +2 -1
- package/dist/common/components/Input.js +14 -3
- package/dist/common/components/SlideUp.js +1 -4
- package/dist/common/contexts/ConsultationContext.js +50 -81
- package/dist/common/contexts/LoaderContext.d.ts +8 -0
- package/dist/common/contexts/LoaderContext.js +86 -0
- package/dist/common/hooks/useConsultation.js +24 -8
- package/dist/common/hooks/useLoader.d.ts +8 -0
- package/dist/common/hooks/useLoader.js +15 -0
- package/dist/common/icons/CaseFolderIcon.d.ts +3 -0
- package/dist/common/icons/CaseFolderIcon.js +55 -0
- package/dist/common/icons/NoCaseFoundIcon.js +1 -1
- package/dist/common/locale/translations/en.base.json +3 -0
- package/dist/common/screens/AnswerScreen.js +2 -5
- package/dist/common/screens/MatchScreen.js +2 -3
- package/dist/common/screens/MatchingScreen.js +2 -3
- package/dist/common/screens/NotValidActiveTypeScreen.d.ts +7 -0
- package/dist/common/screens/NotValidActiveTypeScreen.js +35 -0
- package/dist/common/screens/PreparingSummaryScreen.js +2 -3
- package/dist/common/screens/RatingScreen.js +2 -3
- package/dist/common/types/components.d.ts +15 -0
- package/dist/form-prescriptions/api/models/prescription.d.ts +5 -0
- package/dist/form-prescriptions/api/prescription.d.ts +3 -1
- package/dist/form-prescriptions/api/prescription.js +8 -3
- package/dist/form-prescriptions/components/FormPrescription.js +5 -4
- package/dist/form-prescriptions/components/IndicationCategory.js +12 -8
- package/dist/form-prescriptions/components/IndicationSurveyButton.js +5 -2
- package/dist/form-prescriptions/components/Questionnaire/QuestionnaireQuestion/OpenEnded.js +1 -1
- package/dist/form-prescriptions/components/SearchableDropdown.d.ts +1 -1
- package/dist/form-prescriptions/components/SearchableDropdown.js +2 -2
- package/dist/form-prescriptions/components/loaders/HomeLoader.d.ts +1 -0
- package/dist/form-prescriptions/components/loaders/HomeLoader.js +35 -0
- package/dist/form-prescriptions/components/loaders/QuestionnaireLoader.d.ts +1 -0
- package/dist/form-prescriptions/components/loaders/QuestionnaireLoader.js +68 -0
- package/dist/form-prescriptions/contexts/IndicationSurveyContext.js +2 -3
- package/dist/form-prescriptions/hooks/useIndicationSurvey.js +10 -6
- package/dist/form-prescriptions/hooks/useIndicationSurveyAnswers.js +6 -1
- package/dist/form-prescriptions/hooks/useScreens.js +2 -1
- package/dist/form-prescriptions/screens/HomeScreen.js +50 -8
- package/dist/form-prescriptions/screens/QuestionnaireScreen.js +12 -10
- package/dist/form-prescriptions/screens/ReasonScreen.d.ts +2 -0
- package/dist/form-prescriptions/screens/ReasonScreen.js +161 -0
- package/dist/form-prescriptions/types/screens.d.ts +4 -3
- package/dist/form-prescriptions/types/screens.js +4 -3
- package/dist/video-consultations/api/video.d.ts +2 -1
- package/dist/video-consultations/api/video.js +10 -5
- package/dist/video-consultations/components/VideoConsultation.js +2 -2
- package/dist/video-consultations/screens/ProcessingPrescriptionScreen.js +3 -2
- package/package.json +1 -3
- package/dist/common/screens/NotValidActiveType.d.ts +0 -2
- package/dist/common/screens/NotValidActiveType.js +0 -13
|
@@ -2,20 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IndicationSurveyButton = void 0;
|
|
4
4
|
var Text_1 = require("../../common/components/Text");
|
|
5
|
+
var useCustomComponents_1 = require("../../common/hooks/useCustomComponents");
|
|
5
6
|
var useTheme_1 = require("../../common/hooks/useTheme");
|
|
6
7
|
var useIndicationSurvey_1 = require("../hooks/useIndicationSurvey");
|
|
7
8
|
var react_i18next_1 = require("react-i18next");
|
|
8
9
|
var react_native_1 = require("react-native");
|
|
9
10
|
var react_native_svg_1 = require("react-native-svg");
|
|
10
11
|
var IndicationSurveyButton = function (_a) {
|
|
12
|
+
var _b, _c, _d, _e;
|
|
11
13
|
var iconUrl = _a.iconUrl, id = _a.id, textKey = _a.textKey;
|
|
12
14
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
13
15
|
var theme = (0, useTheme_1.useTheme)();
|
|
14
16
|
var styles = getStyles(theme);
|
|
15
17
|
var onSelectIndication = (0, useIndicationSurvey_1.useIndicationSurvey)().onSelectIndication;
|
|
16
|
-
|
|
18
|
+
var screens = (0, useCustomComponents_1.useCustomComponents)().screens;
|
|
19
|
+
return (<react_native_1.TouchableOpacity style={[styles.container, theme.shadows.soft, (_c = (_b = screens === null || screens === void 0 ? void 0 : screens.PrescriptionHomeScreen) === null || _b === void 0 ? void 0 : _b.indicationSurveyButton) === null || _c === void 0 ? void 0 : _c.containerStyle]} onPress={function () { return onSelectIndication(id.toString()); }}>
|
|
17
20
|
<react_native_svg_1.SvgUri uri={iconUrl} style={styles.icon} accessibilityLabel={t(textKey)} width={16} height={16}/>
|
|
18
|
-
<Text_1.Text>{t(textKey)}</Text_1.Text>
|
|
21
|
+
<Text_1.Text style={[(_e = (_d = screens === null || screens === void 0 ? void 0 : screens.PrescriptionHomeScreen) === null || _d === void 0 ? void 0 : _d.indicationSurveyButton) === null || _e === void 0 ? void 0 : _e.textStyle]}>{t(textKey)}</Text_1.Text>
|
|
19
22
|
</react_native_1.TouchableOpacity>);
|
|
20
23
|
};
|
|
21
24
|
exports.IndicationSurveyButton = IndicationSurveyButton;
|
|
@@ -67,7 +67,7 @@ var OpenEnded = function () {
|
|
|
67
67
|
});
|
|
68
68
|
}); }
|
|
69
69
|
}}>
|
|
70
|
-
<Input_1.default multiline placeholder={t('general.prescriptionRequest.question.placeholder')} id="answer"/>
|
|
70
|
+
<Input_1.default multiline placeholder={t('general.prescriptionRequest.question.placeholder')} id="answer" style={{ height: 160 }}/>
|
|
71
71
|
</FormWrapper_1.FormWrapper>);
|
|
72
72
|
};
|
|
73
73
|
exports.OpenEnded = OpenEnded;
|
|
@@ -7,11 +7,11 @@ export type Item = {
|
|
|
7
7
|
};
|
|
8
8
|
interface SearchableDropDownProps {
|
|
9
9
|
items?: Item[];
|
|
10
|
-
defaultIndex?: number;
|
|
11
10
|
placeholder?: string;
|
|
12
11
|
placeholderTextColor?: string;
|
|
13
12
|
underlineColorAndroid?: string;
|
|
14
13
|
loading?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
15
|
onTextChange?: (_: string) => void;
|
|
16
16
|
onItemSelect?: (_?: any) => void;
|
|
17
17
|
onFocus?: () => void;
|
|
@@ -60,7 +60,7 @@ var react_1 = __importStar(require("react"));
|
|
|
60
60
|
var react_i18next_1 = require("react-i18next");
|
|
61
61
|
var react_native_1 = require("react-native");
|
|
62
62
|
var SearchableDropDown = function (props) {
|
|
63
|
-
var _a = props.items, items = _a === void 0 ? [] : _a,
|
|
63
|
+
var _a = props.items, items = _a === void 0 ? [] : _a, _b = props.placeholder, placeholder = _b === void 0 ? 'Search...' : _b, placeholderTextColor = props.placeholderTextColor, _c = props.underlineColorAndroid, underlineColorAndroid = _c === void 0 ? 'transparent' : _c, disabled = props.disabled, onTextChange = props.onTextChange, onItemSelect = props.onItemSelect, onFocus = props.onFocus;
|
|
64
64
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
65
65
|
var theme = (0, useTheme_1.useTheme)();
|
|
66
66
|
var styles = (0, exports.getStyles)(theme);
|
|
@@ -105,7 +105,7 @@ var SearchableDropDown = function (props) {
|
|
|
105
105
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
106
106
|
}, 500);
|
|
107
107
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
108
|
-
}}>
|
|
108
|
+
}} disabled={disabled}>
|
|
109
109
|
<SearchGlassIcon_1.default />
|
|
110
110
|
<react_native_1.Text style={[styles.input, { color: (item === null || item === void 0 ? void 0 : item.label) ? theme.palette.black : placeholderTextColor }]}>{(item === null || item === void 0 ? void 0 : item.label) || placeholder}</react_native_1.Text>
|
|
111
111
|
<DropdownIcon_1.default />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HomeLoader: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HomeLoader = void 0;
|
|
4
|
+
var LoaderContext_1 = require("../../../common/contexts/LoaderContext");
|
|
5
|
+
var useLoader_1 = require("../../../common/hooks/useLoader");
|
|
6
|
+
var useTheme_1 = require("../../../common/hooks/useTheme");
|
|
7
|
+
var react_native_1 = require("react-native");
|
|
8
|
+
var AnimatedBody = function () {
|
|
9
|
+
var theme = (0, useTheme_1.useTheme)();
|
|
10
|
+
var styles = getStyles(theme);
|
|
11
|
+
var AnimatedItem = (0, useLoader_1.useLoader)().AnimatedItem;
|
|
12
|
+
return (<>
|
|
13
|
+
<AnimatedItem customStyle={styles.item}/>
|
|
14
|
+
<AnimatedItem customStyle={styles.item}/>
|
|
15
|
+
<AnimatedItem customStyle={styles.item}/>
|
|
16
|
+
<AnimatedItem customStyle={styles.item}/>
|
|
17
|
+
<AnimatedItem customStyle={styles.item}/>
|
|
18
|
+
</>);
|
|
19
|
+
};
|
|
20
|
+
var HomeLoader = function () {
|
|
21
|
+
return (<LoaderContext_1.LoaderProvider>
|
|
22
|
+
<AnimatedBody />
|
|
23
|
+
</LoaderContext_1.LoaderProvider>);
|
|
24
|
+
};
|
|
25
|
+
exports.HomeLoader = HomeLoader;
|
|
26
|
+
var getStyles = function (_a) {
|
|
27
|
+
var borderRadius = _a.borderRadius;
|
|
28
|
+
return react_native_1.StyleSheet.create({
|
|
29
|
+
item: {
|
|
30
|
+
width: '100%',
|
|
31
|
+
height: 72,
|
|
32
|
+
borderRadius: borderRadius.md
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const QuestionnaireLoader: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionnaireLoader = void 0;
|
|
4
|
+
var LoaderContext_1 = require("../../../common/contexts/LoaderContext");
|
|
5
|
+
var useLoader_1 = require("../../../common/hooks/useLoader");
|
|
6
|
+
var useTheme_1 = require("../../../common/hooks/useTheme");
|
|
7
|
+
var react_native_1 = require("react-native");
|
|
8
|
+
var AnimatedBody = function () {
|
|
9
|
+
var theme = (0, useTheme_1.useTheme)();
|
|
10
|
+
var styles = getStyles(theme);
|
|
11
|
+
var AnimatedItem = (0, useLoader_1.useLoader)().AnimatedItem;
|
|
12
|
+
return (<react_native_1.View>
|
|
13
|
+
<react_native_1.View style={styles.titleContainer}>
|
|
14
|
+
<AnimatedItem customStyle={styles.title}/>
|
|
15
|
+
<AnimatedItem customStyle={styles.step}/>
|
|
16
|
+
</react_native_1.View>
|
|
17
|
+
<AnimatedItem customStyle={styles.progress}/>
|
|
18
|
+
<AnimatedItem customStyle={styles.body}/>
|
|
19
|
+
<AnimatedItem customStyle={styles.option}/>
|
|
20
|
+
<AnimatedItem customStyle={styles.option}/>
|
|
21
|
+
</react_native_1.View>);
|
|
22
|
+
};
|
|
23
|
+
var QuestionnaireLoader = function () {
|
|
24
|
+
return (<LoaderContext_1.LoaderProvider>
|
|
25
|
+
<AnimatedBody />
|
|
26
|
+
</LoaderContext_1.LoaderProvider>);
|
|
27
|
+
};
|
|
28
|
+
exports.QuestionnaireLoader = QuestionnaireLoader;
|
|
29
|
+
var getStyles = function (_a) {
|
|
30
|
+
var borderRadius = _a.borderRadius, spacing = _a.spacing;
|
|
31
|
+
return react_native_1.StyleSheet.create({
|
|
32
|
+
titleContainer: {
|
|
33
|
+
width: '100%',
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
justifyContent: 'space-between',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
height: 26
|
|
38
|
+
},
|
|
39
|
+
title: {
|
|
40
|
+
width: '50%',
|
|
41
|
+
height: 26,
|
|
42
|
+
borderRadius: borderRadius.sm
|
|
43
|
+
},
|
|
44
|
+
step: {
|
|
45
|
+
width: 26,
|
|
46
|
+
height: 26,
|
|
47
|
+
borderRadius: borderRadius.sm
|
|
48
|
+
},
|
|
49
|
+
progress: {
|
|
50
|
+
marginTop: spacing.xxs,
|
|
51
|
+
marginBottom: spacing.md,
|
|
52
|
+
width: '100%',
|
|
53
|
+
height: 10,
|
|
54
|
+
borderRadius: borderRadius.sm
|
|
55
|
+
},
|
|
56
|
+
body: {
|
|
57
|
+
width: '100%',
|
|
58
|
+
height: 200,
|
|
59
|
+
borderRadius: borderRadius.sm
|
|
60
|
+
},
|
|
61
|
+
option: {
|
|
62
|
+
marginTop: spacing.sm,
|
|
63
|
+
width: '100%',
|
|
64
|
+
height: 53,
|
|
65
|
+
borderRadius: borderRadius.full
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IndicationSurveyProvider = exports.IndicationSurveyContext = void 0;
|
|
4
4
|
var useTranslation_1 = require("../../common/hooks/useTranslation");
|
|
5
5
|
var prescription_1 = require("../api/prescription");
|
|
6
|
-
var indication_survey_1 = require("../mocks/indication-survey");
|
|
7
6
|
var screens_1 = require("../types/screens");
|
|
8
7
|
var react_1 = require("react");
|
|
9
8
|
// eslint-disable-next-line react-refresh/only-export-components
|
|
@@ -26,7 +25,7 @@ var IndicationSurveyProvider = function (_a) {
|
|
|
26
25
|
var _b = (0, react_1.useState)(screens_1.FORM_PRESCRIPTION_SCREENS.HOME), currentScreen = _b[0], setCurrentScreen = _b[1];
|
|
27
26
|
var _c = (0, react_1.useState)([]), indicationCategories = _c[0], setIndicationCategories = _c[1];
|
|
28
27
|
var _d = (0, react_1.useState)(1), questionnaireStep = _d[0], setQuestionnaireStep = _d[1];
|
|
29
|
-
var _e = (0, react_1.useState)(
|
|
28
|
+
var _e = (0, react_1.useState)(null), indicationSurvey = _e[0], setIndicationSurvey = _e[1];
|
|
30
29
|
var _f = (0, react_1.useState)(null), indicationSurveyAnswers = _f[0], setIndicationSurveyAnswers = _f[1];
|
|
31
30
|
(0, react_1.useEffect)(function () {
|
|
32
31
|
(0, prescription_1.getIndicationSurveyList)().then(function (response) {
|
|
@@ -54,7 +53,7 @@ var IndicationSurveyProvider = function (_a) {
|
|
|
54
53
|
setCurrentScreen: setCurrentScreen,
|
|
55
54
|
indicationSurveyAnswers: indicationSurveyAnswers,
|
|
56
55
|
setIndicationSurveyAnswers: setIndicationSurveyAnswers,
|
|
57
|
-
currentQuestion: indicationSurvey.indications[questionnaireStep - 1]
|
|
56
|
+
currentQuestion: (indicationSurvey === null || indicationSurvey === void 0 ? void 0 : indicationSurvey.indications[questionnaireStep - 1]) || null
|
|
58
57
|
};
|
|
59
58
|
return <exports.IndicationSurveyContext.Provider value={value}>{children}</exports.IndicationSurveyContext.Provider>;
|
|
60
59
|
};
|
|
@@ -9,7 +9,7 @@ var useIndicationSurveyAnswers_1 = require("./useIndicationSurveyAnswers");
|
|
|
9
9
|
var useScreens_1 = require("./useScreens");
|
|
10
10
|
var useIndicationSurvey = function () {
|
|
11
11
|
var _a = (0, react_1.useContext)(IndicationSurveyContext_1.IndicationSurveyContext), indicationCategories = _a.indicationCategories, setIndicationCategories = _a.setIndicationCategories, questionnaireStep = _a.questionnaireStep, setQuestionnaireStep = _a.setQuestionnaireStep, indicationSurvey = _a.indicationSurvey, setIndicationSurvey = _a.setIndicationSurvey, setCurrentScreen = _a.setCurrentScreen, currentQuestion = _a.currentQuestion;
|
|
12
|
-
var
|
|
12
|
+
var nextScreen = (0, useScreens_1.useScreens)().nextScreen;
|
|
13
13
|
var removeLastAnswer = (0, useIndicationSurveyAnswers_1.useIndicationSurveyAnswers)().removeLastAnswer;
|
|
14
14
|
var resetIndicationSurvey = function () {
|
|
15
15
|
setCurrentScreen(screens_1.FORM_PRESCRIPTION_SCREENS.HOME);
|
|
@@ -17,21 +17,25 @@ var useIndicationSurvey = function () {
|
|
|
17
17
|
setIndicationSurvey(null);
|
|
18
18
|
};
|
|
19
19
|
var nextStep = function () {
|
|
20
|
-
|
|
20
|
+
var _a;
|
|
21
|
+
if (questionnaireStep === ((_a = indicationSurvey === null || indicationSurvey === void 0 ? void 0 : indicationSurvey.indications) === null || _a === void 0 ? void 0 : _a.length))
|
|
21
22
|
return nextScreen();
|
|
22
23
|
setQuestionnaireStep(function (prev) { return prev + 1; });
|
|
23
24
|
};
|
|
24
25
|
var previousStep = function () {
|
|
25
|
-
if (questionnaireStep === 1)
|
|
26
|
-
|
|
26
|
+
if (questionnaireStep === 1) {
|
|
27
|
+
resetIndicationSurvey();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
setQuestionnaireStep(function (prev) { return prev - 1; });
|
|
31
|
+
}
|
|
27
32
|
removeLastAnswer();
|
|
28
|
-
setQuestionnaireStep(function (prev) { return prev - 1; });
|
|
29
33
|
};
|
|
30
34
|
var onSelectIndication = function (indicationId) {
|
|
31
35
|
(0, prescription_1.getIndicationSurvey)(indicationId).then(function (response) {
|
|
32
36
|
setIndicationSurvey(response);
|
|
33
|
-
setCurrentScreen(screens_1.FORM_PRESCRIPTION_SCREENS.QUESTIONNAIRE);
|
|
34
37
|
});
|
|
38
|
+
setCurrentScreen(screens_1.FORM_PRESCRIPTION_SCREENS.QUESTIONNAIRE);
|
|
35
39
|
};
|
|
36
40
|
return {
|
|
37
41
|
indicationCategories: indicationCategories,
|
|
@@ -30,7 +30,12 @@ var useIndicationSurveyAnswers = function () {
|
|
|
30
30
|
var resetIndicationSurveyAnswers = function () { return setIndicationSurveyAnswers(null); };
|
|
31
31
|
var addAnswer = function (indicationAnswer) {
|
|
32
32
|
setIndicationSurveyAnswers(function (prev) { return (__assign(__assign({}, prev), { indications: __spreadArray(__spreadArray([], prev.indications, true), [
|
|
33
|
-
{
|
|
33
|
+
{
|
|
34
|
+
id: currentQuestion.id,
|
|
35
|
+
question: t("".concat(currentQuestion.questionKey, ".title")),
|
|
36
|
+
questionKey: currentQuestion.questionKey,
|
|
37
|
+
answers: [indicationAnswer]
|
|
38
|
+
}
|
|
34
39
|
], false) })); });
|
|
35
40
|
};
|
|
36
41
|
var removeLastAnswer = function () {
|
|
@@ -7,7 +7,8 @@ var react_1 = require("react");
|
|
|
7
7
|
var SCREENS_ORDER = [
|
|
8
8
|
screens_1.FORM_PRESCRIPTION_SCREENS.HOME,
|
|
9
9
|
screens_1.FORM_PRESCRIPTION_SCREENS.QUESTIONNAIRE,
|
|
10
|
-
screens_1.FORM_PRESCRIPTION_SCREENS.FORM
|
|
10
|
+
screens_1.FORM_PRESCRIPTION_SCREENS.FORM,
|
|
11
|
+
screens_1.FORM_PRESCRIPTION_SCREENS.REASON
|
|
11
12
|
];
|
|
12
13
|
var useScreens = function () {
|
|
13
14
|
var _a = (0, react_1.useContext)(IndicationSurveyContext_1.IndicationSurveyContext), currentScreen = _a.currentScreen, setCurrentScreen = _a.setCurrentScreen;
|
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
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
|
+
})();
|
|
2
35
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
36
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
37
|
if (ar || !(i in from)) {
|
|
@@ -15,27 +48,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
48
|
exports.HomeScreen = void 0;
|
|
16
49
|
var Header_1 = require("../../common/components/Header");
|
|
17
50
|
var ScreenWrapper_1 = require("../../common/components/ScreenWrapper");
|
|
51
|
+
var useCustomComponents_1 = require("../../common/hooks/useCustomComponents");
|
|
18
52
|
var useTheme_1 = require("../../common/hooks/useTheme");
|
|
19
53
|
var useTranslation_1 = require("../../common/hooks/useTranslation");
|
|
20
54
|
var IndicationCategory_1 = __importDefault(require("../components/IndicationCategory"));
|
|
55
|
+
var HomeLoader_1 = require("../components/loaders/HomeLoader");
|
|
21
56
|
var SearchableDropdown_1 = require("../components/SearchableDropdown");
|
|
22
57
|
var useIndicationSurvey_1 = require("../hooks/useIndicationSurvey");
|
|
23
58
|
var FormPrescriptionIcon_1 = require("../icons/FormPrescriptionIcon");
|
|
24
|
-
var react_1 =
|
|
59
|
+
var react_1 = __importStar(require("react"));
|
|
25
60
|
var react_native_1 = require("react-native");
|
|
26
61
|
var HomeScreen = function () {
|
|
27
62
|
var t = (0, useTranslation_1.useTranslation)().t;
|
|
28
63
|
var theme = (0, useTheme_1.useTheme)();
|
|
29
64
|
var styles = getStyles(theme);
|
|
30
65
|
var indicationCategories = (0, useIndicationSurvey_1.useIndicationSurvey)().indicationCategories;
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
66
|
+
var screens = (0, useCustomComponents_1.useCustomComponents)().screens;
|
|
67
|
+
var _a = (0, react_1.useState)([]), searchableItems = _a[0], setSearchableItems = _a[1];
|
|
68
|
+
(0, react_1.useEffect)(function () {
|
|
69
|
+
setSearchableItems(indicationCategories.reduce(function (acc, indicationCategory) { return __spreadArray(__spreadArray([], acc, true), indicationCategory.indications.map(function (indication) { return ({
|
|
70
|
+
label: t(indication.textKey),
|
|
71
|
+
value: indication.id,
|
|
72
|
+
category: t(indicationCategory.textKey)
|
|
73
|
+
}); }), true); }, []));
|
|
74
|
+
}, [indicationCategories]);
|
|
36
75
|
return (<ScreenWrapper_1.ScreenWrapper header={<Header_1.Header title={t('general.consultation.prescriptionRequest.title')} leftIcon={<FormPrescriptionIcon_1.FormPrescriptionIcon />}/>} containerStyle={styles.container}>
|
|
37
|
-
<SearchableDropdown_1.SearchableDropDown items={searchableItems} placeholder={t('prescription.categories.searchbar')}/>
|
|
38
|
-
{indicationCategories.map(function (indicationCategory) {
|
|
76
|
+
<SearchableDropdown_1.SearchableDropDown items={searchableItems} placeholder={t('prescription.categories.searchbar')} disabled={!!indicationCategories.length}/>
|
|
77
|
+
{indicationCategories.length ? (indicationCategories.map(function (indicationCategory) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
return ((_b = (_a = screens === null || screens === void 0 ? void 0 : screens.PrescriptionHomeScreen) === null || _a === void 0 ? void 0 : _a.indicationCategoryAccordion) === null || _b === void 0 ? void 0 : _b.customComponent) ? (<screens.PrescriptionHomeScreen.indicationCategoryAccordion.customComponent key={indicationCategory.id} {...indicationCategory}/>) : (<IndicationCategory_1.default key={indicationCategory.id} {...indicationCategory}/>);
|
|
80
|
+
})) : (<HomeLoader_1.HomeLoader />)}
|
|
39
81
|
</ScreenWrapper_1.ScreenWrapper>);
|
|
40
82
|
};
|
|
41
83
|
exports.HomeScreen = HomeScreen;
|
|
@@ -12,6 +12,7 @@ var useTranslation_1 = require("../../common/hooks/useTranslation");
|
|
|
12
12
|
var BackArrowIcon_1 = require("../../common/icons/BackArrowIcon");
|
|
13
13
|
var CloseIcon_1 = require("../../common/icons/CloseIcon");
|
|
14
14
|
var i18n_1 = __importDefault(require("../../common/locale/i18n"));
|
|
15
|
+
var QuestionnaireLoader_1 = require("../components/loaders/QuestionnaireLoader");
|
|
15
16
|
var QuestionnaireHeader_1 = require("../components/Questionnaire/QuestionnaireHeader");
|
|
16
17
|
var QuestionnaireQuestion_1 = require("../components/Questionnaire/QuestionnaireQuestion");
|
|
17
18
|
var useIndicationSurvey_1 = require("../hooks/useIndicationSurvey");
|
|
@@ -19,7 +20,7 @@ var react_1 = __importDefault(require("react"));
|
|
|
19
20
|
var react_native_1 = require("react-native");
|
|
20
21
|
var QuestionnaireScreen = function () {
|
|
21
22
|
var t = (0, useTranslation_1.useTranslation)().t;
|
|
22
|
-
var _a = (0, useIndicationSurvey_1.useIndicationSurvey)(), currentQuestion = _a.currentQuestion, previousStep = _a.previousStep, resetIndicationSurvey = _a.resetIndicationSurvey;
|
|
23
|
+
var _a = (0, useIndicationSurvey_1.useIndicationSurvey)(), currentQuestion = _a.currentQuestion, previousStep = _a.previousStep, resetIndicationSurvey = _a.resetIndicationSurvey, indicationSurvey = _a.indicationSurvey;
|
|
23
24
|
var theme = (0, useTheme_1.useTheme)();
|
|
24
25
|
var styles = getStyles(theme);
|
|
25
26
|
var titleKey = "".concat(currentQuestion === null || currentQuestion === void 0 ? void 0 : currentQuestion.questionKey, ".title");
|
|
@@ -29,15 +30,16 @@ var QuestionnaireScreen = function () {
|
|
|
29
30
|
</react_native_1.TouchableOpacity>} rightIcon={<react_native_1.TouchableOpacity activeOpacity={0.6} onPress={resetIndicationSurvey}>
|
|
30
31
|
<CloseIcon_1.CloseIcon />
|
|
31
32
|
</react_native_1.TouchableOpacity>}/>} containerStyle={styles.container}>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
{indicationSurvey ? (<>
|
|
34
|
+
<QuestionnaireHeader_1.QuestionnaireHeader />
|
|
35
|
+
<react_native_1.ScrollView style={styles.container}>
|
|
36
|
+
<react_native_1.View style={styles.container}>
|
|
37
|
+
<Text_1.Text style={styles.questionText}>{t(titleKey)}</Text_1.Text>
|
|
38
|
+
{i18n_1.default.exists(descriptionKey) && <Text_1.Text style={styles.questionText}>{t(descriptionKey)}</Text_1.Text>}
|
|
39
|
+
<QuestionnaireQuestion_1.QuestionnaireQuestion />
|
|
40
|
+
</react_native_1.View>
|
|
41
|
+
</react_native_1.ScrollView>
|
|
42
|
+
</>) : (<QuestionnaireLoader_1.QuestionnaireLoader />)}
|
|
41
43
|
</ScreenWrapper_1.ScreenWrapper>);
|
|
42
44
|
};
|
|
43
45
|
exports.QuestionnaireScreen = QuestionnaireScreen;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
+
function step(op) {
|
|
49
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
+
switch (op[0]) {
|
|
54
|
+
case 0: case 1: t = op; break;
|
|
55
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
+
default:
|
|
59
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
+
if (t[2]) _.ops.pop();
|
|
64
|
+
_.trys.pop(); continue;
|
|
65
|
+
}
|
|
66
|
+
op = body.call(thisArg, _);
|
|
67
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
72
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
73
|
+
};
|
|
74
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
+
exports.ReasonScreen = void 0;
|
|
76
|
+
var Button_1 = require("../../common/components/Button");
|
|
77
|
+
var FormWrapper_1 = require("../../common/components/FormWrapper");
|
|
78
|
+
var Header_1 = require("../../common/components/Header");
|
|
79
|
+
var Input_1 = __importDefault(require("../../common/components/Input"));
|
|
80
|
+
var ScreenWrapper_1 = require("../../common/components/ScreenWrapper");
|
|
81
|
+
var Text_1 = require("../../common/components/Text");
|
|
82
|
+
var useConsultation_1 = require("../../common/hooks/useConsultation");
|
|
83
|
+
var useTheme_1 = require("../../common/hooks/useTheme");
|
|
84
|
+
var useTranslation_1 = require("../../common/hooks/useTranslation");
|
|
85
|
+
var useUser_1 = require("../../common/hooks/useUser");
|
|
86
|
+
var BackArrowIcon_1 = require("../../common/icons/BackArrowIcon");
|
|
87
|
+
var CloseIcon_1 = require("../../common/icons/CloseIcon");
|
|
88
|
+
var prescription_1 = require("../api/prescription");
|
|
89
|
+
var useIndicationSurvey_1 = require("../hooks/useIndicationSurvey");
|
|
90
|
+
var useIndicationSurveyAnswers_1 = require("../hooks/useIndicationSurveyAnswers");
|
|
91
|
+
var useScreens_1 = require("../hooks/useScreens");
|
|
92
|
+
var react_1 = __importStar(require("react"));
|
|
93
|
+
var react_native_1 = require("react-native");
|
|
94
|
+
var zod_1 = require("zod");
|
|
95
|
+
var schema = zod_1.z.object({
|
|
96
|
+
reason: zod_1.z.string().min(50)
|
|
97
|
+
});
|
|
98
|
+
var ReasonScreen = function () {
|
|
99
|
+
var t = (0, useTranslation_1.useTranslation)().t;
|
|
100
|
+
var resetIndicationSurvey = (0, useIndicationSurvey_1.useIndicationSurvey)().resetIndicationSurvey;
|
|
101
|
+
var previousScreen = (0, useScreens_1.useScreens)().previousScreen;
|
|
102
|
+
var indicationSurveyAnswers = (0, useIndicationSurveyAnswers_1.useIndicationSurveyAnswers)().indicationSurveyAnswers;
|
|
103
|
+
var user = (0, useUser_1.useUser)().user;
|
|
104
|
+
var updateConsultation = (0, useConsultation_1.useConsultation)().updateConsultation;
|
|
105
|
+
var theme = (0, useTheme_1.useTheme)();
|
|
106
|
+
var styles = getStyles(theme);
|
|
107
|
+
var _a = (0, react_1.useState)(false), loading = _a[0], setLoading = _a[1];
|
|
108
|
+
var handleSubmit = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
109
|
+
var payload;
|
|
110
|
+
return __generator(this, function (_a) {
|
|
111
|
+
setLoading(true);
|
|
112
|
+
payload = {
|
|
113
|
+
userId: user === null || user === void 0 ? void 0 : user.partnerUserId,
|
|
114
|
+
indicationSurvey: indicationSurveyAnswers,
|
|
115
|
+
question: data.reason
|
|
116
|
+
};
|
|
117
|
+
(0, prescription_1.createPrescription)(payload)
|
|
118
|
+
.then(function (consultation) {
|
|
119
|
+
resetIndicationSurvey();
|
|
120
|
+
updateConsultation(consultation);
|
|
121
|
+
})
|
|
122
|
+
.catch(function (error) {
|
|
123
|
+
console.error('Failed to create prescription', error);
|
|
124
|
+
})
|
|
125
|
+
.finally(function () {
|
|
126
|
+
setLoading(false);
|
|
127
|
+
});
|
|
128
|
+
return [2 /*return*/];
|
|
129
|
+
});
|
|
130
|
+
}); };
|
|
131
|
+
return (<ScreenWrapper_1.ScreenWrapper scrollEnabled={false} header={<Header_1.Header title={t('general.consultation.prescription.title')} leftIcon={<react_native_1.TouchableOpacity onPress={previousScreen}>
|
|
132
|
+
<BackArrowIcon_1.BackArrowIcon />
|
|
133
|
+
</react_native_1.TouchableOpacity>} rightIcon={<react_native_1.TouchableOpacity activeOpacity={0.6} onPress={resetIndicationSurvey}>
|
|
134
|
+
<CloseIcon_1.CloseIcon />
|
|
135
|
+
</react_native_1.TouchableOpacity>}/>} containerStyle={styles.container}>
|
|
136
|
+
<Text_1.Text style={styles.text}>{t('general.prescriptionRequest.question.title')}</Text_1.Text>
|
|
137
|
+
<Text_1.Text style={styles.text}>{t('general.prescriptionRequest.question.hint')}</Text_1.Text>
|
|
138
|
+
<FormWrapper_1.FormWrapper schema={schema} submitButton={<Button_1.Button submit loading={loading}>
|
|
139
|
+
{t('button.submit_request')}
|
|
140
|
+
</Button_1.Button>} onSubmit={{
|
|
141
|
+
onSuccess: handleSubmit
|
|
142
|
+
}}>
|
|
143
|
+
<Input_1.default id="reason" multiline placeholder={t('general.prescriptionRequest.question.placeholder')} style={{
|
|
144
|
+
height: 160
|
|
145
|
+
}} minLength={50}/>
|
|
146
|
+
</FormWrapper_1.FormWrapper>
|
|
147
|
+
</ScreenWrapper_1.ScreenWrapper>);
|
|
148
|
+
};
|
|
149
|
+
exports.ReasonScreen = ReasonScreen;
|
|
150
|
+
var getStyles = function (_a) {
|
|
151
|
+
var spacing = _a.spacing;
|
|
152
|
+
return react_native_1.StyleSheet.create({
|
|
153
|
+
container: {
|
|
154
|
+
rowGap: spacing.sm,
|
|
155
|
+
width: '100%'
|
|
156
|
+
},
|
|
157
|
+
text: {
|
|
158
|
+
width: '100%'
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
};
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FORM_PRESCRIPTION_SCREENS = void 0;
|
|
4
4
|
var FORM_PRESCRIPTION_SCREENS;
|
|
5
5
|
(function (FORM_PRESCRIPTION_SCREENS) {
|
|
6
|
-
FORM_PRESCRIPTION_SCREENS[
|
|
7
|
-
FORM_PRESCRIPTION_SCREENS[
|
|
8
|
-
FORM_PRESCRIPTION_SCREENS[
|
|
6
|
+
FORM_PRESCRIPTION_SCREENS["HOME"] = "HOME";
|
|
7
|
+
FORM_PRESCRIPTION_SCREENS["QUESTIONNAIRE"] = "QUESTIONNAIRE";
|
|
8
|
+
FORM_PRESCRIPTION_SCREENS["FORM"] = "FORM";
|
|
9
|
+
FORM_PRESCRIPTION_SCREENS["REASON"] = "REASON";
|
|
9
10
|
})(FORM_PRESCRIPTION_SCREENS || (exports.FORM_PRESCRIPTION_SCREENS = FORM_PRESCRIPTION_SCREENS = {}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ConsultationResponse } from '../../common/api/models/consultation';
|
|
1
|
+
import { ConsultationResponse, CreateConsultationRequest } from '../../common/api/models/consultation';
|
|
2
2
|
import { Consultation } from '../../common/types/consultation';
|
|
3
3
|
import { HKDeliveryAddress } from '../../common/types/deliveryAddress';
|
|
4
4
|
import { HangOutRequest } from './models/video';
|
|
5
5
|
export declare const hangOutVideocall: (body: HangOutRequest) => Promise<ConsultationResponse>;
|
|
6
6
|
export declare const updateDeliveryAddress: (consultationId: string, address: HKDeliveryAddress) => Promise<Consultation>;
|
|
7
|
+
export declare const createVideoConsultation: (_: CreateConsultationRequest) => Promise<ConsultationResponse>;
|
|
@@ -3,15 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.updateDeliveryAddress = exports.hangOutVideocall = void 0;
|
|
6
|
+
exports.createVideoConsultation = exports.updateDeliveryAddress = exports.hangOutVideocall = void 0;
|
|
7
7
|
var axios_1 = __importDefault(require("axios"));
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var VIDEO_CONSULTATION_URL = '/video-consultation';
|
|
9
|
+
var HANGOUT_URL = '/hangout';
|
|
10
|
+
var DELIVERY_ADDRESS_URL = '/update-delivery-address';
|
|
10
11
|
var hangOutVideocall = function (body) {
|
|
11
|
-
return axios_1.default.patch(HANGOUT_URL, body).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
|
|
12
|
+
return axios_1.default.patch("".concat(VIDEO_CONSULTATION_URL).concat(HANGOUT_URL), body).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
|
|
12
13
|
};
|
|
13
14
|
exports.hangOutVideocall = hangOutVideocall;
|
|
14
15
|
var updateDeliveryAddress = function (consultationId, address) {
|
|
15
|
-
return axios_1.default.post(
|
|
16
|
+
return axios_1.default.post("".concat(VIDEO_CONSULTATION_URL, "/").concat(consultationId).concat(DELIVERY_ADDRESS_URL), { address: address }).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
|
|
16
17
|
};
|
|
17
18
|
exports.updateDeliveryAddress = updateDeliveryAddress;
|
|
19
|
+
var createVideoConsultation = function (body) {
|
|
20
|
+
return axios_1.default.post(VIDEO_CONSULTATION_URL, body).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
|
|
21
|
+
};
|
|
22
|
+
exports.createVideoConsultation = createVideoConsultation;
|