2021-11-11 11:43:33 +00:00
|
|
|
/**
|
|
|
|
* Project iLinkWorld
|
|
|
|
* File SaisirFeuilleSoinScreen
|
|
|
|
* Path screens/wallet/agent
|
|
|
|
* Created by BRICE ZELE
|
|
|
|
* Date: 11/11/2021
|
|
|
|
*/
|
2021-11-15 20:15:24 +00:00
|
|
|
import React, {useEffect, useRef, useState} from 'react';
|
|
|
|
import {
|
|
|
|
ActivityIndicator,
|
|
|
|
Dimensions,
|
|
|
|
Keyboard,
|
|
|
|
KeyboardAvoidingView,
|
|
|
|
Platform,
|
|
|
|
ScrollView,
|
|
|
|
StyleSheet,
|
|
|
|
TouchableOpacity,
|
|
|
|
View,
|
|
|
|
} from 'react-native';
|
2021-11-11 11:43:33 +00:00
|
|
|
import {connect, useDispatch} from 'react-redux';
|
2021-11-15 20:15:24 +00:00
|
|
|
import {Formik, useFormik} from 'formik';
|
2021-11-11 11:43:33 +00:00
|
|
|
import * as Yup from 'yup';
|
|
|
|
import {Color} from "../../../config/Color";
|
|
|
|
import I18n from 'react-native-i18n';
|
|
|
|
import {ScreenComponent} from "../../../components/ScreenComponent";
|
|
|
|
import Button from "../../../components/Button";
|
|
|
|
import {responsiveWidth} from "react-native-responsive-dimensions";
|
|
|
|
import {
|
|
|
|
fetchActivePaySubscription,
|
|
|
|
fetchActivePaySubscriptionReset,
|
|
|
|
fetchGetSubscriptionList,
|
|
|
|
fetchGetSubscriptionListReset
|
|
|
|
} from "../../../redux/insurance/insurance.actions";
|
|
|
|
import DropdownAlert from "react-native-dropdownalert";
|
|
|
|
import {readUser} from "../../../webservice/AuthApi";
|
2021-11-15 20:15:24 +00:00
|
|
|
import TextInput from "../../../components/TextInput";
|
2021-11-11 11:43:33 +00:00
|
|
|
import {createStructuredSelector} from "reselect";
|
|
|
|
import {selectActivatePaySubscription, selectSubscriptionList} from "../../../redux/insurance/insurance.selector";
|
2021-11-15 20:15:24 +00:00
|
|
|
import StepHeader from "../../../components/StepHeaderComponent";
|
|
|
|
import Wizard from "react-native-wizard";
|
|
|
|
import Icon from "react-native-vector-icons/FontAwesome5";
|
|
|
|
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
|
|
|
import Text from "../../../components/Text";
|
|
|
|
import SwitchSelector from "react-native-switch-selector";
|
|
|
|
import * as Animatable from "react-native-animatable";
|
2021-11-11 11:43:33 +00:00
|
|
|
import {Dropdown} from "react-native-material-dropdown";
|
2021-11-15 20:15:24 +00:00
|
|
|
import Modal from "react-native-modal";
|
|
|
|
import DateTimePicker from "@react-native-community/datetimepicker";
|
2021-11-11 11:43:33 +00:00
|
|
|
|
|
|
|
let moment = require('moment-timezone');
|
|
|
|
|
|
|
|
const {width, height} = Dimensions.get('window');
|
|
|
|
const CIRCLE_SIZE = width * 0.5;
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
textInput: {
|
|
|
|
height: 46,
|
|
|
|
backgroundColor: Color.fieldColor,
|
|
|
|
borderRadius: 5,
|
|
|
|
marginTop: 10,
|
|
|
|
padding: 10,
|
|
|
|
width: '100%',
|
|
|
|
},
|
|
|
|
lineRow: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
paddingBottom: 20,
|
|
|
|
},
|
|
|
|
contain: {
|
|
|
|
alignItems: 'center',
|
|
|
|
marginTop: 40,
|
|
|
|
paddingBottom: 20,
|
|
|
|
paddingLeft: 20,
|
|
|
|
paddingRight: 20,
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
circle: {
|
|
|
|
width: CIRCLE_SIZE,
|
|
|
|
height: CIRCLE_SIZE,
|
|
|
|
borderRadius: CIRCLE_SIZE / 2,
|
|
|
|
position: 'absolute',
|
|
|
|
top: '15%',
|
|
|
|
},
|
|
|
|
circleContainer: {
|
|
|
|
alignItems: 'flex-end',
|
|
|
|
right: -(CIRCLE_SIZE / 3),
|
|
|
|
top: -(CIRCLE_SIZE / 1.5),
|
|
|
|
},
|
|
|
|
lineSeparator: {
|
|
|
|
borderWidth: 1,
|
|
|
|
width: '40%',
|
|
|
|
height: 1,
|
|
|
|
alignSelf: 'center',
|
|
|
|
},
|
|
|
|
line: {
|
|
|
|
width: 1,
|
|
|
|
height: 14,
|
|
|
|
backgroundColor: Color.grayColor,
|
|
|
|
marginLeft: 10,
|
|
|
|
},
|
|
|
|
contentModeView: {
|
|
|
|
width: 30,
|
|
|
|
height: '100%',
|
|
|
|
alignItems: 'flex-end',
|
|
|
|
justifyContent: 'center',
|
|
|
|
},
|
|
|
|
contentFilter: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'center',
|
|
|
|
marginLeft: 10,
|
|
|
|
},
|
|
|
|
bottomModal: {
|
|
|
|
justifyContent: 'flex-end',
|
|
|
|
margin: 0,
|
|
|
|
},
|
|
|
|
contentFilterBottom: {
|
|
|
|
width: "100%",
|
|
|
|
borderTopLeftRadius: 8,
|
|
|
|
borderTopRightRadius: 8,
|
|
|
|
paddingHorizontal: 20
|
|
|
|
},
|
|
|
|
contentSwipeDown: {
|
|
|
|
paddingTop: 10,
|
|
|
|
alignItems: 'center',
|
|
|
|
},
|
|
|
|
lineSwipeDown: {
|
|
|
|
width: 30,
|
|
|
|
height: 2.5,
|
|
|
|
backgroundColor: Color.dividerColor,
|
|
|
|
},
|
|
|
|
contentActionModalBottom: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
paddingVertical: 15,
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
borderBottomWidth: 1,
|
|
|
|
},
|
|
|
|
containModal: {
|
|
|
|
paddingVertical: 10,
|
|
|
|
paddingHorizontal: 20,
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
},
|
|
|
|
floatingButtonAdd: {
|
|
|
|
backgroundColor: Color.accentColor,
|
|
|
|
position: "absolute",
|
|
|
|
width: 25,
|
|
|
|
bottom: 0,
|
|
|
|
zIndex: 1000,
|
|
|
|
right: 20,
|
|
|
|
top: 35,
|
|
|
|
height: 25,
|
|
|
|
borderRadius: 12.5,
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center',
|
|
|
|
},
|
|
|
|
contentSwitch: {
|
|
|
|
width: responsiveWidth(40),
|
|
|
|
},
|
|
|
|
switch: {},
|
|
|
|
choosePhotoBtn: {
|
|
|
|
marginTop: 10,
|
|
|
|
marginBottom: 10,
|
|
|
|
width: "auto",
|
|
|
|
height: "auto",
|
|
|
|
padding: 5,
|
|
|
|
alignItems: 'center',
|
|
|
|
borderColor: Color.borderColor,
|
|
|
|
marginRight: 10,
|
|
|
|
elevation: 2,
|
|
|
|
},
|
|
|
|
checkbox: {
|
|
|
|
alignSelf: "center",
|
|
|
|
color: "white"
|
|
|
|
},
|
|
|
|
itemAmountPerMonth: {
|
|
|
|
paddingLeft: 10,
|
|
|
|
marginTop: 10,
|
|
|
|
flexDirection: 'row',
|
|
|
|
},
|
|
|
|
dot: {
|
|
|
|
width: 12,
|
|
|
|
height: 12,
|
|
|
|
borderRadius: 6
|
|
|
|
},
|
|
|
|
blockView: {
|
|
|
|
paddingVertical: 10,
|
|
|
|
borderBottomWidth: 0.5,
|
|
|
|
},
|
2021-11-15 20:15:24 +00:00
|
|
|
iconNavigation: {
|
|
|
|
width: '100%',
|
|
|
|
flexDirection: 'row',
|
|
|
|
marginTop: 20,
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
alignItems: 'center',
|
|
|
|
},
|
|
|
|
iconNavigationButton: {
|
|
|
|
borderWidth: 1,
|
|
|
|
borderRadius: 25,
|
|
|
|
width: 50,
|
|
|
|
height: 50,
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center',
|
|
|
|
},
|
2021-11-11 11:43:33 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const SaisirFeuilleSoinScreen = ({
|
|
|
|
activatePaySubscription,
|
|
|
|
fetchGetSubscriptionList,
|
|
|
|
subscriptionList,
|
|
|
|
fetchActivePaySubscription,
|
|
|
|
navigation
|
|
|
|
}) => {
|
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
const [datePrestation, setDatePrestation] = useState('' + moment(new Date()).format('YYYY-MM-DD'));
|
|
|
|
const [showDatePrestation, setShowDatePrestation] = useState(false);
|
|
|
|
|
|
|
|
const [dateAccident, setDateAccident] = useState(null);
|
|
|
|
const [isAccident, setIsAccident] = useState(false);
|
|
|
|
const [showDateAccidentPicker, setShowDateAccidentPicker] = useState(false);
|
|
|
|
|
|
|
|
const [dateDebutGrossesse, setDateDebutGrossesse] = useState(null);
|
|
|
|
const [dateFinGrossesse, setDateFinGrossesse] = useState(null);
|
|
|
|
const [isGrossesse, setIsGrossesse] = useState(false);
|
|
|
|
const [showDateDebutGrossessePicker, setShowDateDebutGrossessePicker] = useState(false);
|
|
|
|
const [showDateFinGrossessePicker, setShowDateFinGrossessePicker] = useState(false);
|
|
|
|
|
2021-11-11 11:43:33 +00:00
|
|
|
const [user, setUser] = useState(null);
|
2021-11-15 20:15:24 +00:00
|
|
|
const wizard = useRef();
|
|
|
|
const [isFirstStep, setIsFirstStep] = useState(true);
|
|
|
|
const [isLastStep, setIsLastStep] = useState(false);
|
|
|
|
const [currentStep, setCurrentStep] = useState(1);
|
|
|
|
const [modalPrestation, setModalPrestation] = useState(false);
|
|
|
|
const [modalPrescription, setModalPrescription] = useState(false);
|
|
|
|
|
|
|
|
const [statutPatientOption] = useState([
|
|
|
|
{label: I18n.t('AYANT_DROITS'), value: "M"},
|
|
|
|
{label: I18n.t('ASSURE'), value: "F"},
|
|
|
|
]);
|
|
|
|
const [accident] = useState([
|
|
|
|
{label: I18n.t('YES'), value: "YES"},
|
|
|
|
{label: I18n.t('NO'), value: "NO"},
|
|
|
|
]);
|
|
|
|
const [grossesse] = useState([
|
|
|
|
{label: I18n.t('YES'), value: "YES"},
|
|
|
|
{label: I18n.t('NO'), value: "NO"},
|
|
|
|
]);
|
|
|
|
const [visiteDomicile] = useState([
|
|
|
|
{label: I18n.t('YES'), value: "YES"},
|
|
|
|
{label: I18n.t('NO'), value: "NO"},
|
|
|
|
]);
|
|
|
|
|
|
|
|
const [conditionPriseEnChange] = useState([
|
|
|
|
{label: I18n.t('AFFECTION_COURANTE'), value: "AFFECTION_COURANTE"},
|
|
|
|
{label: I18n.t('AFFECTION_LONGUE'), value: "AFFECTION_LONGUE"},
|
|
|
|
{label: I18n.t('EXONERE'), value: "EXONERE"},
|
|
|
|
]);
|
2021-11-11 11:43:33 +00:00
|
|
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
let dropDownAlertRef: any = null;
|
2021-11-15 20:15:24 +00:00
|
|
|
let classificationRef = null;
|
|
|
|
let codeActeRef = null;
|
2021-11-11 11:43:33 +00:00
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
readUser().then((user) => {
|
|
|
|
setUser(user)
|
|
|
|
});
|
|
|
|
dispatch(fetchGetSubscriptionListReset());
|
|
|
|
dispatch(fetchActivePaySubscriptionReset());
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (user !== null) {
|
|
|
|
console.log("user", user.id);
|
|
|
|
}
|
|
|
|
}, [user]);
|
|
|
|
|
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
console.log("Date accident", dateAccident);
|
|
|
|
const SaisirFeuilleSoinSchema = Yup.object().shape({
|
|
|
|
numero_assure: Yup.string()
|
|
|
|
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
|
|
|
password: Yup.string()
|
|
|
|
.required(I18n.t('THIS_FIELD_IS_REQUIRED'))
|
|
|
|
});
|
2021-11-11 11:43:33 +00:00
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
const AddBeneficiarySchema = Yup.object().shape({
|
|
|
|
lastname: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
|
|
|
firstname: Yup.string(),
|
|
|
|
});
|
2021-11-11 11:43:33 +00:00
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
const onChangeDatePrestation = (event, selectedDate) => {
|
|
|
|
const currentDate = selectedDate || '' + moment(new Date()).format('YYYY-MM-DD');
|
|
|
|
setShowDatePrestation(Platform.OS === 'ios');
|
|
|
|
setDatePrestation(currentDate);
|
|
|
|
};
|
2021-11-11 11:43:33 +00:00
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
const renderDatePrestationPicker = () => {
|
|
|
|
return (<DateTimePicker
|
|
|
|
timeZoneOffsetInMinutes={0}
|
|
|
|
is24Hour={true}
|
|
|
|
value={new Date(dateNaissance)}
|
|
|
|
mode='date'
|
|
|
|
display="spinner"
|
|
|
|
onChange={onChangeDatePrestation}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
2021-11-11 11:43:33 +00:00
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
const onChangeDateAccident = (event, selectedDate) => {
|
|
|
|
const currentDate = selectedDate || new Date();
|
|
|
|
setShowDateAccidentPicker(Platform.OS === 'ios');
|
|
|
|
setDateAccident(moment(currentDate).format('YYYY-MM-DD'));
|
|
|
|
};
|
2021-11-11 11:43:33 +00:00
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
const renderDateAccidentPicker = () => {
|
|
|
|
return (<DateTimePicker
|
|
|
|
timeZoneOffsetInMinutes={0}
|
|
|
|
is24Hour={true}
|
|
|
|
value={new Date()}
|
|
|
|
mode='date'
|
|
|
|
display="spinner"
|
|
|
|
onChange={onChangeDateAccident}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
const onChangeDateDebutGrossesse = (event, selectedDate) => {
|
|
|
|
const currentDate = selectedDate || new Date();
|
|
|
|
setShowDateDebutGrossessePicker(Platform.OS === 'ios');
|
|
|
|
setDateDebutGrossesse(moment(currentDate).format('YYYY-MM-DD'));
|
|
|
|
};
|
|
|
|
|
|
|
|
const renderDateDebutGrossessePicker = () => {
|
|
|
|
return (<DateTimePicker
|
|
|
|
timeZoneOffsetInMinutes={0}
|
|
|
|
is24Hour={true}
|
|
|
|
value={new Date()}
|
|
|
|
mode='date'
|
|
|
|
display="spinner"
|
|
|
|
onChange={onChangeDateDebutGrossesse}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
const onChangeDateFinGrossesse = (event, selectedDate) => {
|
|
|
|
const currentDate = selectedDate || new Date();
|
|
|
|
setShowDateFinGrossessePicker(Platform.OS === 'ios');
|
|
|
|
setDateFinGrossesse(moment(currentDate).format('YYYY-MM-DD'));
|
|
|
|
};
|
|
|
|
|
|
|
|
const renderDateFinGrossessePicker = () => {
|
|
|
|
return (<DateTimePicker
|
|
|
|
timeZoneOffsetInMinutes={0}
|
|
|
|
is24Hour={true}
|
|
|
|
value={new Date()}
|
|
|
|
mode='date'
|
|
|
|
display="spinner"
|
|
|
|
onChange={onChangeDateFinGrossesse}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
2021-11-11 11:43:33 +00:00
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
const renderAddNewPrestation = () => (
|
|
|
|
<Formik validationSchema={AddBeneficiarySchema}
|
|
|
|
initialValues={{
|
|
|
|
amount_prestation: '',
|
|
|
|
lastname: '',
|
|
|
|
}}
|
|
|
|
onSubmit={(values) => {
|
|
|
|
}}>
|
|
|
|
|
|
|
|
{({
|
|
|
|
values,
|
|
|
|
errors,
|
|
|
|
touched,
|
|
|
|
handleChange,
|
|
|
|
handleBlur,
|
|
|
|
handleSubmit,
|
|
|
|
isSubmitting,
|
|
|
|
}) => (
|
2021-11-11 11:43:33 +00:00
|
|
|
<ScrollView style={{flex: 1}}>
|
2021-11-15 20:15:24 +00:00
|
|
|
<View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
|
|
|
|
<Modal
|
|
|
|
isVisible={modalPrestation}
|
|
|
|
onSwipeComplete={() => {
|
|
|
|
setModalPrestation(false);
|
2021-11-11 11:43:33 +00:00
|
|
|
}}
|
2021-11-15 20:15:24 +00:00
|
|
|
swipeDirection={['down']}
|
|
|
|
style={styles.bottomModal}>
|
|
|
|
<View
|
|
|
|
style={[
|
|
|
|
styles.contentFilterBottom,
|
|
|
|
{backgroundColor: Color.containerBackgroundColor},
|
|
|
|
]}>
|
|
|
|
<View style={styles.contentSwipeDown}>
|
|
|
|
<View style={styles.lineSwipeDown}/>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<Text body2 style={{marginTop: 10}}>{I18n.t('ADD_PRESTATION')}</Text>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('DATE_NAISSANCE')}
|
|
|
|
value={'' + moment(datePrestation).format('YYYY-MM-DD')}
|
|
|
|
onChangeText={handleChange('birthdate')}
|
|
|
|
onBlur={handleBlur('birthdate')}
|
|
|
|
onFocus={() => {
|
|
|
|
Keyboard.dismiss();
|
|
|
|
setShowDatePrestation(true);
|
|
|
|
}}
|
|
|
|
success={touched.birthdate && !errors.birthdate}
|
|
|
|
touched={touched.birthdate}
|
|
|
|
error={errors.birthdate}
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<Animatable.View ref={(comp) => {
|
|
|
|
codeActeRef = comp
|
|
|
|
}}
|
|
|
|
style={{
|
|
|
|
width: responsiveWidth(90),
|
|
|
|
height: 60,
|
|
|
|
alignSelf: 'center',
|
|
|
|
borderRadius: 10,
|
|
|
|
paddingLeft: 20,
|
|
|
|
marginTop: 10,
|
|
|
|
paddingRight: 20,
|
|
|
|
backgroundColor: 'white'
|
|
|
|
}}>
|
|
|
|
<Dropdown
|
|
|
|
label={I18n.t('CODE_ACTE')}
|
|
|
|
data={[]}
|
|
|
|
useNativeDriver={true}
|
|
|
|
onChangeText={(value, index, data) => {
|
|
|
|
console.log("Value", value);
|
|
|
|
}}
|
|
|
|
valueExtractor={(value) => {
|
|
|
|
return value
|
|
|
|
}}
|
|
|
|
labelExtractor={(value) => {
|
|
|
|
return value.name
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Animatable.View>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('AMOUNT')}
|
|
|
|
value={values.amount_prestation}
|
|
|
|
onChangeText={handleChange('amount_prestation')}
|
|
|
|
onBlur={handleBlur('amount_prestation')}
|
|
|
|
success={touched.amount_prestation && !errors.amount_prestation}
|
|
|
|
touched={touched.amount_prestation}
|
|
|
|
error={errors.amount_prestation}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('TICKET_MONDERATEUR')}
|
|
|
|
value={values.amount_prestation}
|
|
|
|
onChangeText={handleChange('amount_prestation')}
|
|
|
|
onBlur={handleBlur('amount_prestation')}
|
|
|
|
success={touched.amount_prestation && !errors.amount_prestation}
|
|
|
|
touched={touched.amount_prestation}
|
|
|
|
error={errors.amount_prestation}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('AMOUNT_PER_INSURANCE')}
|
|
|
|
value={values.amount_prestation}
|
|
|
|
onChangeText={handleChange('amount_prestation')}
|
|
|
|
onBlur={handleBlur('amount_prestation')}
|
|
|
|
success={touched.amount_prestation && !errors.amount_prestation}
|
|
|
|
touched={touched.amount_prestation}
|
|
|
|
error={errors.amount_prestation}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<View style={{
|
|
|
|
marginTop: 10,
|
|
|
|
width: "100%",
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: "space-between"
|
|
|
|
}}>
|
|
|
|
<Text body2>{I18n.t('VISITE_DOMICILE')}</Text>
|
|
|
|
<View style={styles.contentSwitch}>
|
|
|
|
<SwitchSelector options={visiteDomicile}
|
|
|
|
initial={0}
|
|
|
|
buttonColor={Color.accentColor}
|
|
|
|
backgroundColor={Color.primaryDarkColor}
|
|
|
|
textColor='white'
|
|
|
|
bold={true}
|
|
|
|
hasPadding
|
|
|
|
height={32}
|
|
|
|
onPress={(value) => {
|
|
|
|
//setGender(value);
|
|
|
|
}}/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<Button
|
|
|
|
style={{marginTop: 20, marginBottom: 20}}
|
|
|
|
full
|
|
|
|
onPress={handleSubmit}>
|
|
|
|
{I18n.t('SUBMIT_LABEL')}
|
|
|
|
</Button>
|
|
|
|
</View>
|
|
|
|
</Modal>
|
|
|
|
</View>
|
|
|
|
</ScrollView>
|
|
|
|
)}
|
|
|
|
</Formik>
|
|
|
|
);
|
|
|
|
|
|
|
|
const renderAddNewPrescription = () => (
|
|
|
|
<Formik validationSchema={AddBeneficiarySchema}
|
|
|
|
initialValues={{
|
|
|
|
amount_prestation: '',
|
|
|
|
lastname: '',
|
|
|
|
}}
|
|
|
|
onSubmit={(values) => {
|
|
|
|
}}>
|
|
|
|
|
|
|
|
{({
|
|
|
|
values,
|
|
|
|
errors,
|
|
|
|
touched,
|
|
|
|
handleChange,
|
|
|
|
handleBlur,
|
|
|
|
handleSubmit,
|
|
|
|
isSubmitting,
|
|
|
|
}) => (
|
|
|
|
<ScrollView style={{flex: 1}}>
|
|
|
|
<View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
|
|
|
|
<Modal
|
|
|
|
isVisible={modalPrescription}
|
|
|
|
onSwipeComplete={() => {
|
|
|
|
setModalPrescription(false);
|
|
|
|
}}
|
|
|
|
swipeDirection={['down']}
|
|
|
|
style={styles.bottomModal}>
|
|
|
|
<View
|
|
|
|
style={[
|
|
|
|
styles.contentFilterBottom,
|
|
|
|
{backgroundColor: Color.containerBackgroundColor},
|
|
|
|
]}>
|
|
|
|
<View style={styles.contentSwipeDown}>
|
|
|
|
<View style={styles.lineSwipeDown}/>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<Text body2 style={{marginTop: 10}}>{I18n.t('ADD_PRESCRIPTION')}</Text>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('DATE_PRESTATION')}
|
|
|
|
value={'' + moment(dateAccident).format('YYYY-MM-DD')}
|
|
|
|
onChangeText={handleChange('birthdate')}
|
|
|
|
onBlur={handleBlur('birthdate')}
|
|
|
|
onFocus={() => {
|
|
|
|
Keyboard.dismiss();
|
|
|
|
setShowDatePrestation(true);
|
|
|
|
}}
|
|
|
|
success={touched.birthdate && !errors.birthdate}
|
|
|
|
touched={touched.birthdate}
|
|
|
|
error={errors.birthdate}
|
|
|
|
/>
|
|
|
|
|
2021-11-11 11:43:33 +00:00
|
|
|
|
|
|
|
<Animatable.View ref={(comp) => {
|
2021-11-15 20:15:24 +00:00
|
|
|
codeActeRef = comp
|
2021-11-11 11:43:33 +00:00
|
|
|
}}
|
|
|
|
style={{
|
|
|
|
width: responsiveWidth(90),
|
|
|
|
height: 60,
|
|
|
|
alignSelf: 'center',
|
|
|
|
borderRadius: 10,
|
|
|
|
paddingLeft: 20,
|
2021-11-15 20:15:24 +00:00
|
|
|
marginTop: 10,
|
2021-11-11 11:43:33 +00:00
|
|
|
paddingRight: 20,
|
|
|
|
backgroundColor: 'white'
|
|
|
|
}}>
|
|
|
|
<Dropdown
|
2021-11-15 20:15:24 +00:00
|
|
|
label={I18n.t('CODE_ACTE')}
|
|
|
|
data={[]}
|
2021-11-11 11:43:33 +00:00
|
|
|
useNativeDriver={true}
|
|
|
|
onChangeText={(value, index, data) => {
|
|
|
|
console.log("Value", value);
|
|
|
|
}}
|
|
|
|
valueExtractor={(value) => {
|
|
|
|
return value
|
|
|
|
}}
|
|
|
|
labelExtractor={(value) => {
|
2021-11-15 20:15:24 +00:00
|
|
|
return value.name
|
2021-11-11 11:43:33 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Animatable.View>
|
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('AMOUNT')}
|
|
|
|
value={values.amount_prestation}
|
|
|
|
onChangeText={handleChange('amount_prestation')}
|
|
|
|
onBlur={handleBlur('amount_prestation')}
|
|
|
|
success={touched.amount_prestation && !errors.amount_prestation}
|
|
|
|
touched={touched.amount_prestation}
|
|
|
|
error={errors.amount_prestation}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('TICKET_MONDERATEUR')}
|
|
|
|
value={values.amount_prestation}
|
|
|
|
onChangeText={handleChange('amount_prestation')}
|
|
|
|
onBlur={handleBlur('amount_prestation')}
|
|
|
|
success={touched.amount_prestation && !errors.amount_prestation}
|
|
|
|
touched={touched.amount_prestation}
|
|
|
|
error={errors.amount_prestation}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<TextInput
|
2021-11-11 11:43:33 +00:00
|
|
|
style={{marginTop: 10}}
|
2021-11-15 20:15:24 +00:00
|
|
|
placeholder={I18n.t('AMOUNT_PER_INSURANCE')}
|
|
|
|
value={values.amount_prestation}
|
|
|
|
onChangeText={handleChange('amount_prestation')}
|
|
|
|
onBlur={handleBlur('amount_prestation')}
|
|
|
|
success={touched.amount_prestation && !errors.amount_prestation}
|
|
|
|
touched={touched.amount_prestation}
|
|
|
|
error={errors.amount_prestation}
|
2021-11-11 11:43:33 +00:00
|
|
|
/>
|
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
<View style={{
|
|
|
|
marginTop: 10,
|
|
|
|
width: "100%",
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: "space-between"
|
|
|
|
}}>
|
|
|
|
<Text body2>{I18n.t('VISITE_DOMICILE')}</Text>
|
|
|
|
<View style={styles.contentSwitch}>
|
|
|
|
<SwitchSelector options={visiteDomicile}
|
|
|
|
initial={0}
|
|
|
|
buttonColor={Color.accentColor}
|
|
|
|
backgroundColor={Color.primaryDarkColor}
|
|
|
|
textColor='white'
|
|
|
|
bold={true}
|
|
|
|
hasPadding
|
|
|
|
height={32}
|
|
|
|
onPress={(value) => {
|
|
|
|
//setGender(value);
|
|
|
|
}}/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
|
2021-11-11 11:43:33 +00:00
|
|
|
<Button
|
2021-11-15 20:15:24 +00:00
|
|
|
style={{marginTop: 20, marginBottom: 20}}
|
2021-11-11 11:43:33 +00:00
|
|
|
full
|
|
|
|
onPress={handleSubmit}>
|
|
|
|
{I18n.t('SUBMIT_LABEL')}
|
|
|
|
</Button>
|
|
|
|
</View>
|
2021-11-15 20:15:24 +00:00
|
|
|
</Modal>
|
|
|
|
</View>
|
|
|
|
</ScrollView>
|
|
|
|
)}
|
|
|
|
</Formik>
|
|
|
|
);
|
|
|
|
|
|
|
|
const {
|
|
|
|
handleChange,
|
|
|
|
handleSubmit,
|
|
|
|
handleBlur,
|
|
|
|
values,
|
|
|
|
errors,
|
|
|
|
touched,
|
|
|
|
setFieldValue,
|
|
|
|
setFieldTouched,
|
|
|
|
isValid,
|
|
|
|
} = useFormik({
|
|
|
|
validationSchema: SaisirFeuilleSoinSchema,
|
|
|
|
initialValues: {
|
|
|
|
numero_assure: '',
|
|
|
|
password: '',
|
|
|
|
firstname_patient: '',
|
|
|
|
lastname_patient: '',
|
|
|
|
firstname_praticien: '',
|
|
|
|
lastname_praticien: '',
|
|
|
|
agrement_praticien: ''
|
|
|
|
},
|
|
|
|
onSubmit: values => {
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const onNext = () => {
|
|
|
|
switch (currentStep) {
|
|
|
|
case 1:
|
|
|
|
return (
|
|
|
|
errors.numero_assure
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const stepList = [
|
|
|
|
{
|
|
|
|
title: I18n.t('ASSURE'),
|
|
|
|
content: (
|
|
|
|
<View>
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('NUMERO_ASSURE')}
|
|
|
|
value={values.numero_assure}
|
|
|
|
onChangeText={handleChange('numero_assure')}
|
|
|
|
onBlur={handleBlur('numero_assure')}
|
|
|
|
success={touched.numero_assure && !errors.numero_assure}
|
|
|
|
touched={touched.numero_assure}
|
|
|
|
error={errors.numero_assure}
|
|
|
|
icon={
|
|
|
|
<FontAwesome
|
|
|
|
style={{zIndex: 10}}
|
|
|
|
name="lock"
|
|
|
|
size={20}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
<View style={{
|
|
|
|
flexDirection: 'row',
|
|
|
|
position: 'absolute',
|
|
|
|
top: 22,
|
|
|
|
right: 10,
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
width: 50
|
|
|
|
}}>
|
|
|
|
<Icon
|
|
|
|
style={{paddingRight: 5}}
|
|
|
|
name='user'
|
|
|
|
size={20}
|
|
|
|
color={Color.primaryColor}
|
|
|
|
onPress={() => {
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Icon
|
|
|
|
style={{paddingRight: 5}}
|
|
|
|
name="qrcode"
|
|
|
|
size={20}
|
|
|
|
color={Color.primaryColor}
|
|
|
|
onPress={() => {
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: I18n.t('PATIENT'),
|
|
|
|
content: (
|
|
|
|
<View>
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('NOM_CLIENT')}
|
|
|
|
value={values.lastname_patient}
|
|
|
|
onChangeText={handleChange('lastname_patient')}
|
|
|
|
onBlur={handleBlur('lastname_patient')}
|
|
|
|
success={touched.lastname_patient && !errors.lastname_patient}
|
|
|
|
touched={touched.lastname_patient}
|
|
|
|
error={errors.lastname_patient}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('PRENOM_CLIENT')}
|
|
|
|
value={values.firstname_patient}
|
|
|
|
onChangeText={handleChange('firstname_patient')}
|
|
|
|
onBlur={handleBlur('firstname_patient')}
|
|
|
|
success={touched.firstname_patient && !errors.firstname_patient}
|
|
|
|
touched={touched.firstname_patient}
|
|
|
|
error={errors.firstname_patient}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<View style={{
|
|
|
|
marginTop: 10,
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: "space-between"
|
|
|
|
}}>
|
|
|
|
<Text body2>{I18n.t('SITUATION')}</Text>
|
|
|
|
<View style={{width: responsiveWidth(60)}}>
|
|
|
|
<SwitchSelector options={statutPatientOption}
|
|
|
|
initial={0}
|
|
|
|
buttonColor={Color.accentColor}
|
|
|
|
backgroundColor={Color.primaryDarkColor}
|
|
|
|
textColor='white'
|
|
|
|
bold={true}
|
|
|
|
hasPadding
|
|
|
|
height={32}
|
|
|
|
onPress={(value) => {
|
|
|
|
//setGender(value);
|
|
|
|
}}/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: I18n.t('PRATICIEN'),
|
|
|
|
content: (
|
|
|
|
<View>
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('CODE_AGREMENT')}
|
|
|
|
value={values.agrement_praticien}
|
|
|
|
onChangeText={handleChange('agrement_praticien')}
|
|
|
|
onBlur={handleBlur('agrement_praticien')}
|
|
|
|
success={touched.agrement_praticien && !errors.agrement_praticien}
|
|
|
|
touched={touched.agrement_praticien}
|
|
|
|
error={errors.agrement_praticien}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('NOM_PRATICIEN')}
|
|
|
|
value={values.lastname_praticien}
|
|
|
|
onChangeText={handleChange('lastname_praticien')}
|
|
|
|
onBlur={handleBlur('lastname_praticien')}
|
|
|
|
success={touched.lastname_praticien && !errors.lastname_praticien}
|
|
|
|
touched={touched.lastname_praticien}
|
|
|
|
error={errors.lastname_praticien}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('PRENOM_PRATICIEN')}
|
|
|
|
value={values.firstname_praticien}
|
|
|
|
onChangeText={handleChange('firstname_praticien')}
|
|
|
|
onBlur={handleBlur('firstname_praticien')}
|
|
|
|
success={touched.firstname_praticien && !errors.firstname_praticien}
|
|
|
|
touched={touched.firstname_praticien}
|
|
|
|
error={errors.firstname_praticien}
|
|
|
|
/>
|
2021-11-11 11:43:33 +00:00
|
|
|
|
2021-11-15 20:15:24 +00:00
|
|
|
<Animatable.View ref={(comp) => {
|
|
|
|
classificationRef = comp
|
|
|
|
}}
|
|
|
|
style={{
|
|
|
|
width: responsiveWidth(90),
|
|
|
|
height: 60,
|
|
|
|
alignSelf: 'center',
|
|
|
|
borderRadius: 10,
|
|
|
|
paddingLeft: 20,
|
|
|
|
marginTop: 10,
|
|
|
|
paddingRight: 20,
|
|
|
|
backgroundColor: 'white'
|
|
|
|
}}>
|
|
|
|
<Dropdown
|
|
|
|
label={I18n.t('CLASSIFICATION')}
|
|
|
|
data={[]}
|
|
|
|
useNativeDriver={true}
|
|
|
|
onChangeText={(value, index, data) => {
|
|
|
|
console.log("Value", value);
|
|
|
|
}}
|
|
|
|
valueExtractor={(value) => {
|
|
|
|
return value
|
|
|
|
}}
|
|
|
|
labelExtractor={(value) => {
|
|
|
|
return value.name
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Animatable.View>
|
|
|
|
|
|
|
|
<Animatable.View ref={(comp) => {
|
|
|
|
classificationRef = comp
|
|
|
|
}}
|
|
|
|
style={{
|
|
|
|
width: responsiveWidth(90),
|
|
|
|
height: 60,
|
|
|
|
alignSelf: 'center',
|
|
|
|
borderRadius: 10,
|
|
|
|
paddingLeft: 20,
|
|
|
|
marginTop: 10,
|
|
|
|
paddingRight: 20,
|
|
|
|
backgroundColor: 'white'
|
|
|
|
}}>
|
|
|
|
<Dropdown
|
|
|
|
label={I18n.t('CONDITION_PRISE_CHARGE')}
|
|
|
|
data={conditionPriseEnChange}
|
|
|
|
useNativeDriver={true}
|
|
|
|
onChangeText={(value, index, data) => {
|
|
|
|
console.log("Value", value);
|
|
|
|
}}
|
|
|
|
valueExtractor={(value) => {
|
|
|
|
return value
|
|
|
|
}}
|
|
|
|
labelExtractor={(value) => {
|
|
|
|
return value.label
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Animatable.View>
|
|
|
|
|
|
|
|
|
|
|
|
<View style={{
|
|
|
|
marginTop: 10,
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: "space-between"
|
|
|
|
}}>
|
|
|
|
<Text body2>{I18n.t('ACCIDENT')}</Text>
|
|
|
|
<View style={{width: responsiveWidth(40)}}>
|
|
|
|
<SwitchSelector options={accident}
|
|
|
|
initial={1}
|
|
|
|
buttonColor={Color.accentColor}
|
|
|
|
backgroundColor={Color.primaryDarkColor}
|
|
|
|
textColor='white'
|
|
|
|
bold={true}
|
|
|
|
hasPadding
|
|
|
|
height={32}
|
|
|
|
onPress={(value) => {
|
|
|
|
console.log(value);
|
|
|
|
setIsAccident(value === 'YES');
|
|
|
|
}}/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
{
|
|
|
|
isAccident && (
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('DATE_ACCIDENT')}
|
|
|
|
value={dateAccident !== null ? dateAccident : ''}
|
|
|
|
onChangeText={handleChange('date_accident')}
|
|
|
|
onBlur={handleBlur('date_accident')}
|
|
|
|
onFocus={() => {
|
|
|
|
Keyboard.dismiss();
|
|
|
|
//setDateAccident('' + moment(new Date()).format('YYYY-MM-DD'));
|
|
|
|
setShowDateAccidentPicker(true);
|
|
|
|
}}
|
|
|
|
success={touched.date_accident && !errors.date_accident}
|
|
|
|
touched={touched.date_accident}
|
|
|
|
error={errors.date_accident}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
<View style={{
|
|
|
|
marginTop: 10,
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: "space-between"
|
|
|
|
}}>
|
|
|
|
<Text body2>{I18n.t('GROSSESSE')}</Text>
|
|
|
|
<View style={styles.contentSwitch}>
|
|
|
|
<SwitchSelector options={grossesse}
|
|
|
|
initial={1}
|
|
|
|
buttonColor={Color.accentColor}
|
|
|
|
backgroundColor={Color.primaryDarkColor}
|
|
|
|
textColor='white'
|
|
|
|
bold={true}
|
|
|
|
hasPadding
|
|
|
|
height={32}
|
|
|
|
onPress={(value) => {
|
|
|
|
setIsGrossesse(value === 'YES');
|
|
|
|
}}/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
{
|
|
|
|
isGrossesse && (
|
|
|
|
<>
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('DATE_DEBUT_GROSSESSE')}
|
|
|
|
value={dateDebutGrossesse !== null ? dateDebutGrossesse : ''}
|
|
|
|
onChangeText={handleChange('date_debut_grossesse')}
|
|
|
|
onBlur={handleBlur('date_debut_grossesse')}
|
|
|
|
onFocus={() => {
|
|
|
|
Keyboard.dismiss();
|
|
|
|
//setDateAccident('' + moment(new Date()).format('YYYY-MM-DD'));
|
|
|
|
setShowDateDebutGrossessePicker(true);
|
|
|
|
}}
|
|
|
|
success={touched.date_debut_grossesse && !errors.date_debut_grossesse}
|
|
|
|
touched={touched.date_debut_grossesse}
|
|
|
|
error={errors.date_debut_grossesse}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<TextInput
|
|
|
|
style={{marginTop: 10}}
|
|
|
|
placeholder={I18n.t('DATE_FIN_GROSSESSE')}
|
|
|
|
value={dateFinGrossesse !== null ? dateFinGrossesse : ''}
|
|
|
|
onChangeText={handleChange('date_fin_grossesse')}
|
|
|
|
onBlur={handleBlur('date_fin_grossesse')}
|
|
|
|
onFocus={() => {
|
|
|
|
Keyboard.dismiss();
|
|
|
|
//setDateAccident('' + moment(new Date()).format('YYYY-MM-DD'));
|
|
|
|
setShowDateFinGrossessePicker(true);
|
|
|
|
}}
|
|
|
|
success={touched.date_fin_grossesse && !errors.date_fin_grossesse}
|
|
|
|
touched={touched.date_fin_grossesse}
|
|
|
|
error={errors.date_fin_grossesse}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
<View
|
|
|
|
style={{
|
|
|
|
flexDirection: 'column',
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
marginTop: 25,
|
|
|
|
}}>
|
|
|
|
<TouchableOpacity
|
|
|
|
onPress={() => {
|
|
|
|
setModalPrestation(true);
|
|
|
|
}}>
|
|
|
|
<Text body1 primaryColor bold>
|
|
|
|
{I18n.t('ADD_PRESTATION')}
|
|
|
|
</Text>
|
|
|
|
</TouchableOpacity>
|
|
|
|
<TouchableOpacity
|
|
|
|
onPress={() => {
|
|
|
|
setModalPrescription(true);
|
|
|
|
}}>
|
|
|
|
<Text body1 primaryColor bold>
|
|
|
|
{I18n.t('ADD_PRESCRIPTION')}
|
|
|
|
</Text>
|
|
|
|
</TouchableOpacity>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ScreenComponent>
|
|
|
|
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
|
|
|
|
<KeyboardAvoidingView
|
|
|
|
behavior={Platform.OS === 'android' ? 'height' : 'padding'}
|
|
|
|
style={{flex: 1}}>
|
|
|
|
|
|
|
|
<ScrollView style={{flex: 1}}>
|
|
|
|
<View style={styles.contain}>
|
|
|
|
|
|
|
|
<StepHeader
|
|
|
|
steps={stepList}
|
|
|
|
currentStepIndex={currentStep + 1}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<View
|
|
|
|
style={{
|
|
|
|
flexDirection: 'column',
|
|
|
|
alignItems: 'center',
|
|
|
|
}}>
|
|
|
|
<Wizard
|
|
|
|
ref={wizard}
|
|
|
|
activeStep={0}
|
|
|
|
steps={stepList}
|
|
|
|
useNativeDriver
|
|
|
|
nextStepAnimation="slideLeft"
|
|
|
|
prevStepAnimation="slideRight"
|
|
|
|
isFirstStep={val =>
|
|
|
|
setIsFirstStep(val)
|
|
|
|
}
|
|
|
|
isLastStep={val =>
|
|
|
|
setIsLastStep(val)
|
|
|
|
}
|
|
|
|
onNext={() => {
|
|
|
|
onNext();
|
|
|
|
}}
|
|
|
|
onPrev={() => {
|
|
|
|
}}
|
|
|
|
currentStep={({
|
|
|
|
currentStep,
|
|
|
|
isLastStep,
|
|
|
|
isFirstStep,
|
|
|
|
}) => {
|
|
|
|
setCurrentStep(currentStep);
|
|
|
|
setIsFirstStep(isFirstStep);
|
|
|
|
setIsLastStep(isLastStep);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={styles.iconNavigation}>
|
|
|
|
{!isFirstStep ? (
|
|
|
|
<TouchableOpacity
|
|
|
|
style={[
|
|
|
|
styles.iconNavigationButton,
|
|
|
|
{
|
|
|
|
backgroundColor:
|
|
|
|
Color.primaryColor,
|
|
|
|
borderColor:
|
|
|
|
Color.primaryColor,
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
onPress={() =>
|
|
|
|
wizard.current.prev()
|
|
|
|
}>
|
|
|
|
<Icon
|
|
|
|
name="arrow-left"
|
|
|
|
size={20}
|
|
|
|
color={Color.whiteColor}
|
|
|
|
/>
|
|
|
|
</TouchableOpacity>
|
|
|
|
) : (
|
|
|
|
<View/>
|
|
|
|
)}
|
|
|
|
{currentStep === 3 ? (
|
|
|
|
<Button
|
|
|
|
onPress={() => {
|
|
|
|
}}>
|
|
|
|
{I18n.t('SUBMIT_LABEL')}
|
|
|
|
</Button>
|
|
|
|
) : (
|
|
|
|
<TouchableOpacity
|
|
|
|
style={[
|
|
|
|
styles.iconNavigationButton,
|
|
|
|
{
|
|
|
|
backgroundColor:
|
|
|
|
Color.primaryColor,
|
|
|
|
borderColor:
|
|
|
|
Color.primaryColor,
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
onPress={e => {
|
|
|
|
handleSubmit(e);
|
|
|
|
wizard.current.next();
|
|
|
|
}}>
|
|
|
|
{subscriptionList.loading ?
|
|
|
|
<ActivityIndicator
|
|
|
|
size="small"
|
|
|
|
color={colors.primary}
|
|
|
|
/>
|
|
|
|
: <Icon
|
|
|
|
name="arrow-right"
|
|
|
|
size={24}
|
|
|
|
color={Color.whiteColor}
|
|
|
|
/>}
|
|
|
|
</TouchableOpacity>
|
|
|
|
)}
|
|
|
|
</View>
|
|
|
|
{modalPrestation && renderAddNewPrestation()}
|
|
|
|
{modalPrescription && renderAddNewPrescription()}
|
|
|
|
{showDatePrestation && renderDatePrestationPicker()}
|
|
|
|
{showDateAccidentPicker && renderDateAccidentPicker()}
|
|
|
|
{showDateDebutGrossessePicker && renderDateDebutGrossessePicker()}
|
|
|
|
{showDateFinGrossessePicker && renderDateFinGrossessePicker()}
|
|
|
|
</View>
|
2021-11-11 11:43:33 +00:00
|
|
|
</ScrollView>
|
|
|
|
</KeyboardAvoidingView>
|
|
|
|
</ScreenComponent>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
|
|
|
subscriptionList: selectSubscriptionList,
|
|
|
|
activatePaySubscription: selectActivatePaySubscription
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, {
|
|
|
|
fetchActivePaySubscription,
|
|
|
|
fetchGetSubscriptionList,
|
|
|
|
})(
|
|
|
|
SaisirFeuilleSoinScreen,
|
|
|
|
);
|