Demande de prise en charge

This commit is contained in:
Brice Zele 2022-04-12 08:24:31 +01:00
parent 0273273b8a
commit 52e69106b8
10 changed files with 787 additions and 281 deletions

2
App.js
View File

@ -151,7 +151,6 @@ const AppStack = createDrawerNavigator({
addBeneficiaryScreen: AddBeneficiaryScreen,
insuranceSubscriptionScreen: InsuranceSubscriptionScreen,
validateConsultationScreen: ValidateConsultationScreen,
demandeAutorisationSoinScreen: DemandeAutorisationSoinScreen,
validateConsultationDetailScreen: ValidateConsultationDetailScreen,
activateBuySubscriptionScreen: ActivateBuySubscriptionScreen,
stopSubscriptionScreen: StopSubscriptionScreen,
@ -243,6 +242,7 @@ const AppAgentStack = createDrawerNavigator({
walletSelect: WalletSelect,
createIdentification: CreateIdentification,
validateIdentification: ValidateIdentification,
demandeAutorisationSoinScreen: DemandeAutorisationSoinScreen,
Historique:
{
screen: createBottomTabNavigator({myDemand: MyHistory}, {

File diff suppressed because one or more lines are too long

View File

@ -571,7 +571,7 @@
"RENEW_INSSURANCE": "Renouveler son assurance ",
"MANAGE_ASSURANCE": "Gérer son assurance",
"MANAGE_HEALTH": "Gérer ses soins",
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
"DEMAND_AUTORIZATION_HEALTH": "Demande de prise en charge",
"HISTORIC_HEALTH": "Historique",
"VALID_HEALTH": "Valider un soin ",
"ACTIVATE_INSSURANCE": "Activer son assurance",
@ -727,7 +727,7 @@
"ASSURE_SUSPENDU": "Cet assuré est suspendu",
"ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu",
"CONSULTATION": "Consultation",
"ACTE_EXAMEN": "Autre acte et examen",
"ACTE_EXAMEN": "Acte et examen",
"AMOUNT_FREE": "Montant libre",
"DESCRIPTION": "Description",
"EXECUTION": "Execution",

View File

@ -1419,7 +1419,7 @@ const ExecuterPrescriptionScreen = ({
content: (
<View>
<TextInput
style={{marginTop: 10}}
style={{marginTop: 10, width: responsiveWidth(90)}}
placeholder={isNumeroAssureSearch ? I18n.t('NUMERO_ASSURE') : isPhoneAssureSearch ? I18n.t('PHONE_NUMBER') : I18n.t('NOM_ASSURE')}
value={values.numero_assure}
keyboardType={isPhoneAssureSearch ? 'numeric' : 'default'}
@ -1440,12 +1440,12 @@ const ExecuterPrescriptionScreen = ({
flexDirection: 'row',
position: 'absolute',
top: 22,
right: 50,
right: 70,
justifyContent: 'space-between',
width: 50
}}>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='lock'
size={20}
color={Color.primaryColor}
@ -1455,7 +1455,7 @@ const ExecuterPrescriptionScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='phone'
size={20}
color={Color.primaryColor}
@ -1465,7 +1465,7 @@ const ExecuterPrescriptionScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='user'
size={20}
color={Color.primaryColor}
@ -1475,7 +1475,7 @@ const ExecuterPrescriptionScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name="qrcode"
size={20}
color={Color.primaryColor}
@ -1484,8 +1484,7 @@ const ExecuterPrescriptionScreen = ({
}}
/>
</View>
</View>
),
</View>),
},
{
title: I18n.t('PATIENT'),

View File

@ -1409,7 +1409,7 @@ const ModifierExecutionPrescriptionScreen = ({
content: (
<View>
<TextInput
style={{marginTop: 10}}
style={{marginTop: 10, width: responsiveWidth(90)}}
placeholder={isNumeroAssureSearch ? I18n.t('NUMERO_ASSURE') : isPhoneAssureSearch ? I18n.t('PHONE_NUMBER') : I18n.t('NOM_ASSURE')}
value={values.numero_assure}
keyboardType={isPhoneAssureSearch ? 'numeric' : 'default'}
@ -1430,12 +1430,12 @@ const ModifierExecutionPrescriptionScreen = ({
flexDirection: 'row',
position: 'absolute',
top: 22,
right: 50,
right: 70,
justifyContent: 'space-between',
width: 50
}}>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='lock'
size={20}
color={Color.primaryColor}
@ -1445,7 +1445,7 @@ const ModifierExecutionPrescriptionScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='phone'
size={20}
color={Color.primaryColor}
@ -1455,7 +1455,7 @@ const ModifierExecutionPrescriptionScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='user'
size={20}
color={Color.primaryColor}
@ -1465,7 +1465,7 @@ const ModifierExecutionPrescriptionScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name="qrcode"
size={20}
color={Color.primaryColor}
@ -1474,8 +1474,7 @@ const ModifierExecutionPrescriptionScreen = ({
}}
/>
</View>
</View>
),
</View>),
},
{
title: I18n.t('PATIENT'),

View File

@ -2630,7 +2630,7 @@ const ModifierFeuilleSoinScreen = ({
content: (
<View>
<TextInput
style={{marginTop: 10}}
style={{marginTop: 10, width: responsiveWidth(90)}}
placeholder={isNumeroAssureSearch ? I18n.t('NUMERO_ASSURE') : isPhoneAssureSearch ? I18n.t('PHONE_NUMBER') : I18n.t('NOM_ASSURE')}
value={values.numero_assure}
keyboardType={isPhoneAssureSearch ? 'numeric' : 'default'}
@ -2651,12 +2651,12 @@ const ModifierFeuilleSoinScreen = ({
flexDirection: 'row',
position: 'absolute',
top: 22,
right: 50,
right: 70,
justifyContent: 'space-between',
width: 50
}}>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='lock'
size={20}
color={Color.primaryColor}
@ -2666,7 +2666,7 @@ const ModifierFeuilleSoinScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='phone'
size={20}
color={Color.primaryColor}
@ -2676,7 +2676,7 @@ const ModifierFeuilleSoinScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='user'
size={20}
color={Color.primaryColor}
@ -2686,7 +2686,7 @@ const ModifierFeuilleSoinScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name="qrcode"
size={20}
color={Color.primaryColor}
@ -3003,7 +3003,7 @@ const ModifierFeuilleSoinScreen = ({
styles.iconNavigationButton,
{
borderRadius: 5,
width: 170,
width: 150,
height: 30,
flexDirection: "row",
backgroundColor:
@ -3022,24 +3022,31 @@ const ModifierFeuilleSoinScreen = ({
color={Color.whiteColor}
/>
</TouchableOpacity>
</View>
</View>
<View style={{
marginTop: 25,
flexDirection: "row",
alignItems: 'center',
justifyContent: 'center',
width: "100%"
}}>
<TouchableOpacity
style={[
styles.iconNavigationButton,
{
borderRadius: 5,
width: 120,
width: 150,
height: 30,
backgroundColor: Color.primaryColor,
borderColor: Color.primaryColor,
flexDirection: "row",
backgroundColor:
Color.primaryColor,
borderColor:
Color.primaryColor,
},
]}
onPress={e => {
setModalListMedicament(true);
//setModalMedicament(true);
setModalMedicament(true);
setMedicament(null);
}}>
<Text whiteColor>{I18n.t('MEDICAMENT')}</Text>
@ -3049,8 +3056,6 @@ const ModifierFeuilleSoinScreen = ({
color={Color.whiteColor}
/>
</TouchableOpacity>
</View>
</View>
</View>

View File

@ -430,6 +430,7 @@ const SaisirFeuilleSoinScreen = ({
dispatch(fetchGetUserByNameOrNumberReset());*/
}
}, [getUserByNameOrNumber]);
useEffect(() => {
console.log("getUserByNameOrNumber.result", getUserByNameOrNumber);
if (getUserByNameOrNumber.result !== null) {
@ -1684,7 +1685,7 @@ const SaisirFeuilleSoinScreen = ({
content: (
<View>
<TextInput
style={{marginTop: 10}}
style={{marginTop: 10, width: responsiveWidth(90)}}
placeholder={isNumeroAssureSearch ? I18n.t('NUMERO_ASSURE') : isPhoneAssureSearch ? I18n.t('PHONE_NUMBER') : I18n.t('NOM_ASSURE')}
value={values.numero_assure}
keyboardType={isPhoneAssureSearch ? 'numeric' : 'default'}
@ -1705,12 +1706,12 @@ const SaisirFeuilleSoinScreen = ({
flexDirection: 'row',
position: 'absolute',
top: 22,
right: 50,
right: 70,
justifyContent: 'space-between',
width: 50
}}>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='lock'
size={20}
color={Color.primaryColor}
@ -1720,7 +1721,7 @@ const SaisirFeuilleSoinScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='phone'
size={20}
color={Color.primaryColor}
@ -1730,7 +1731,7 @@ const SaisirFeuilleSoinScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name='user'
size={20}
color={Color.primaryColor}
@ -1740,7 +1741,7 @@ const SaisirFeuilleSoinScreen = ({
}}
/>
<Icon
style={{paddingRight: 5}}
style={{paddingRight: 10}}
name="qrcode"
size={20}
color={Color.primaryColor}
@ -2063,7 +2064,7 @@ const SaisirFeuilleSoinScreen = ({
styles.iconNavigationButton,
{
borderRadius: 5,
width: 170,
width: 150,
height: 30,
flexDirection: "row",
backgroundColor:
@ -2083,18 +2084,27 @@ const SaisirFeuilleSoinScreen = ({
/>
</TouchableOpacity>
</View>
</View>
<View style={{
marginTop: 25,
flexDirection: "row",
alignItems: 'center',
justifyContent: 'center',
width: "100%"
}}>
<TouchableOpacity
style={[
styles.iconNavigationButton,
{
borderRadius: 5,
width: 120,
width: 150,
height: 30,
backgroundColor: Color.primaryColor,
borderColor: Color.primaryColor,
flexDirection: "row",
backgroundColor:
Color.primaryColor,
borderColor:
Color.primaryColor,
},
]}
onPress={e => {
@ -2108,8 +2118,6 @@ const SaisirFeuilleSoinScreen = ({
color={Color.whiteColor}
/>
</TouchableOpacity>
</View>
</View>
</View>

View File

@ -5,11 +5,12 @@
* Created by BRICE ZELE
* Date: 01/02/2022
*/
import React, {useEffect, useState} from 'react';
import React, {useEffect, useRef, useState} from 'react';
import {
ActivityIndicator,
Alert,
Dimensions, FlatList,
Dimensions,
FlatList,
KeyboardAvoidingView,
Platform,
ProgressBarAndroid,
@ -26,33 +27,34 @@ import {
fetchAcceptRejectConsultation,
fetchAcceptRejectConsultationReset,
fetchActivePaySubscription,
fetchDeleteBeneficiaryReset,
fetchDemaneAutorisationSoin,
fetchDemaneAutorisationSoinReset,
fetchGetConsultation,
fetchGetConsultationReset,
fetchGetListInsurance,
fetchGetListInsuranceReset,
fetchGetListInsuranceWithBeneficiaries,
fetchGetNetworkActs
fetchGetNetworkActs,
fetchGetUserByIdQRCode,
fetchGetUserByIdQRCodeReset,
fetchGetUserByNameOrNumber,
fetchGetUserByNameOrNumberReset
} from "../../../redux/insurance/insurance.actions";
import DropdownAlert from "react-native-dropdownalert";
import {createStructuredSelector} from "reselect";
import {
selectAcceptRefuseConsultation,
selectActivatePaySubscription, selectDemandeAutorisationSoin,
selectGetConsultation, selectGetNetworkAct,
selectActivatePaySubscription,
selectDemandeAutorisationSoin,
selectGetConsultation,
selectGetNetworkAct,
selectGetUserByIdQRCode,
selectGetUserByNameOrNumber,
selectInsuranceList,
selectSubscriptionList
} from "../../../redux/insurance/insurance.selector";
import {readUser} from "../../../webservice/AuthApi";
import Text from '../../../components/Text';
import * as Utils from "../../../utils/UtilsFunction";
import {displayToast, uppercaseFirstLetter} from "../../../utils/UtilsFunction";
import Dialog from "react-native-dialog";
import {Typography} from "../../../config/typography";
import {store} from "../../../redux/store";
import {Formik} from "formik";
import {useFormik} from "formik";
import * as Animatable from "react-native-animatable";
import {responsiveWidth} from "react-native-responsive-dimensions";
import {Dropdown} from "react-native-material-dropdown";
@ -62,6 +64,13 @@ import Button from "../../../components/Button";
import * as Yup from "yup";
import SpinnerOverlay from "../../../components/SpinnerOverlayComponent";
import Modal from "react-native-modal";
import QRCodeScanner from "react-native-qrcode-scanner";
import {RNCamera} from "react-native-camera";
import TextInput from "../../../components/TextInput";
import Icon from "react-native-vector-icons/FontAwesome5";
import SwitchSelector from "react-native-switch-selector";
import StepHeader from "../../../components/StepHeaderComponent";
import Wizard from "react-native-wizard";
let moment = require('moment-timezone');
@ -74,9 +83,14 @@ const DemandeAutorisationSoinScreen = ({
fetchAcceptRejectConsultation,
fetchGetListInsuranceWithBeneficiaries,
fetchDemaneAutorisationSoin,
fetchGetUserByIdQRCode,
fetchGetUserByNameOrNumber,
getConsultation,
getUserByNameOrNumber,
getUserByIdQRCode,
insuranceList,
getNetworkAct,
subscriptionList,
demandeAutorisationSoin
}) => {
const dispatch = useDispatch();
@ -89,6 +103,31 @@ const DemandeAutorisationSoinScreen = ({
const [beneficiaryId, setBeneficiaryId] = useState(null);
const [insurance, setInsurance] = useState(null);
const [showQRCodeScanner, setShowQRCodeScanner] = useState(false);
const [showDateAccidentPicker, setShowDateAccidentPicker] = useState(false);
const [isNumeroAssureSearch, setIsNumeroAssureSearch] = useState(false);
const [isPhoneAssureSearch, setIsPhoneAssureSearch] = useState(false);
const [assure, setAssure] = useState(null);
const [beneficiary, setBeneficiary] = useState(null);
const [medicament, setMedicament] = useState(null);
const wizard = useRef();
const [isFirstStep, setIsFirstStep] = useState(true);
const [isLastStep, setIsLastStep] = useState(false);
const [currentStep, setCurrentStep] = useState(1);
const [statutPatientOption] = useState([
{label: I18n.t('AYANT_DROITS'), value: "M"},
{label: I18n.t('ASSURE'), value: "F"},
]);
const [statutPatient, setStatutPatient] = useState(1);
const [accident] = useState([
{label: I18n.t('YES'), value: "YES"},
{label: I18n.t('NO'), value: "NO"},
]);
let insurancesRef = null;
let codeActeRef = null;
const [modalListAssure, setModalListAssure] = useState(false);
@ -104,12 +143,13 @@ const DemandeAutorisationSoinScreen = ({
dispatch(fetchGetConsultationReset());
dispatch(fetchGetListInsuranceReset());
dispatch(fetchAcceptRejectConsultationReset());
readUser().then((user) => {
dispatch(fetchGetUserByNameOrNumberReset());
dispatch(fetchGetUserByIdQRCodeReset());
/* readUser().then((user) => {
setUser(user);
console.log("User", user);
fetchGetListInsuranceWithBeneficiaries(`?user_id=${user.id}`);
//fetchGetConsultation(user.id, 'ACCEPTED', '');
});
});*/
//fetchGetNetworkActs(wallet.idNetwork, '', '&authorization_type=PRIOR');
}, []);
@ -125,9 +165,9 @@ const DemandeAutorisationSoinScreen = ({
}
}
],
{ cancelable: false }
{cancelable: false}
);
/* dropDownAlertRef.alertWithType(
/* dropDownAlertRef.alertWithType(
'error',
I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getConsultation),
@ -144,7 +184,7 @@ const DemandeAutorisationSoinScreen = ({
insuranceListTemp.push(insuranceItem.network);
});
setInsurances(insuranceListTemp);
console.log("beneficiariesListTemp",beneficiariesListTemp);
console.log("beneficiariesListTemp", beneficiariesListTemp);
}
if (insuranceList.error) {
@ -158,9 +198,9 @@ const DemandeAutorisationSoinScreen = ({
}
}
],
{ cancelable: false }
{cancelable: false}
);
/* dropDownAlertRef.alertWithType(
/* dropDownAlertRef.alertWithType(
'error',
I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(insuranceList),
@ -198,9 +238,9 @@ const DemandeAutorisationSoinScreen = ({
}
}
],
{ cancelable: false }
{cancelable: false}
);
/* dropDownAlertRef.alertWithType(
/* dropDownAlertRef.alertWithType(
'error',
I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(demandeAutorisationSoin),
@ -209,6 +249,45 @@ const DemandeAutorisationSoinScreen = ({
}
}, [demandeAutorisationSoin]);
useEffect(() => {
console.log("getUserByNameOrNumber.result", getUserByNameOrNumber);
if (getUserByNameOrNumber.result !== null) {
if (getUserByNameOrNumber.result.response.length > 0) {
setModalListAssure(true);
//wizard.current.next();
} else {
dropDownAlertRef.alertWithType(
'warn',
I18n.t('EMPTY_LIST'),
I18n.t('NO_ASSURE_MATCH_SEARCH'),
);
dispatch(fetchGetUserByNameOrNumberReset());
}
}
if (getUserByNameOrNumber.error) {
Alert.alert(
I18n.t("ERROR_LABLE"),
Utils.getErrorMsg(getUserByNameOrNumber),
[
{
text: I18n.t("OK"), onPress: () => {
dispatch(fetchGetUserByNameOrNumberReset());
}
}
],
{cancelable: false}
);
/* dropDownAlertRef.alertWithType(
'error',
I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getUserByNameOrNumber),
);
dispatch(fetchGetUserByNameOrNumberReset());*/
}
}, [getUserByNameOrNumber]);
const renderLoader = () => (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{Platform.OS === 'android'
@ -227,6 +306,8 @@ const DemandeAutorisationSoinScreen = ({
}
</View>
);
const renderListAssure = () => (
<ScrollView style={{flex: 1}}>
<View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
@ -248,32 +329,125 @@ const DemandeAutorisationSoinScreen = ({
<Text body2 style={{marginTop: 10}}>{I18n.t('LIST_ASSURE')}</Text>
<FlatList data={beneficiaries}
ListEmptyComponent={<Text body2>{I18n.t('NO_ASSURE')}</Text>}
<FlatList data={getUserByNameOrNumber.result?.response}
extraData={getUserByNameOrNumber.result?.response}
keyExtractor={(item, index) => index}
ListEmptyComponent={<Text body2>{I18n.t('NO_ASSURE_MATCH_SEARCH')}</Text>}
renderItem={({item, index}) => {
return (
<View style={{
paddingVertical: 0,
paddingVertical: 15,
alignItems: 'flex-start',
}}>
<TouchableOpacity
style={[
styles.contentActionModalBottom,
{borderBottomColor: Color.borderColor, width: "100%"},
{
borderBottomColor: Color.borderColor,
width: "100%",
flexDirection: 'column',
},
]}
key={item.id}
onPress={() => {
if(item.id === user.id)
setBeneficiaryId(null);
else
setBeneficiaryId(item.id);
setAssure(item);
setBeneficiary(null);
setStatutPatient(1);
setModalListAssure(false);
setFieldValue(
'lastname_patient',
item.user.lastname,
);
setFieldValue(
'firstname_patient',
item.user.firstname,
);
fetchGetNetworkActs(wallet.id_network, '', `&user_id=${item.user.id}`);
dispatch(fetchGetUserByNameOrNumberReset());
wizard.current.next();
fetchGetListInsuranceWithBeneficiaries(`?user_id=${item.user.id}`);
/* if (item.state === 'SUSPENDED') {
Alert.alert(I18n.t('ERROR_LABEL'), I18n.t('ASSURE_SUSPENDU'),
[{
text: I18n.t('OK'), onPress: () => {
}
}]);
} else if (item.state !== 'PAID') {
Alert.alert(I18n.t('ERROR_LABEL'), I18n.t('ASSURE_NON_EN_REGLE'),
[{
text: I18n.t('OK'), onPress: () => {
}
}]);
} else {
setAssure(item);
setBeneficiary(null);
setStatutPatient(1);
setModalListAssure(false);
setFieldValue(
'lastname_patient',
item.user.lastname,
);
setFieldValue(
'firstname_patient',
item.user.firstname,
);
fetchGetNetworkActs(wallet.id_network, '', `&user_id=${item.user.id}`);
dispatch(fetchGetUserByNameOrNumberReset());
wizard.current.next();
}*/
}}>
<Text body2 semibold>
{`${item.firstname} ${item.lastname} ${item.id === user.id ? '('+I18n.t('MY_ACCOUNT')+')' : ''}`}
{`${item.user.firstname !== null ? item.user.firstname : ''} ${item.user.lastname !== null ? item.user.lastname : ''}`}
</Text>
<Text footnote>
{`${I18n.t('MONTANT_ASSURANCE_CONSOMME')}: ${item.insurance_consumed_amount}`}
</Text>
<Text footnote>
{`${I18n.t('MONTANT_ASSURANCE_RESTANTE')}: ${item.insurance_remaining_amount}`}
</Text>
</TouchableOpacity>
{item.beneficiaries.map((beneficiary) => (
<TouchableOpacity style={styles.beneficiarySubSection}
onPress={() => {
if (item.state === 'SUSPENDED') {
Alert.alert(I18n.t('ERROR_LABEL'), I18n.t('ASSURE_PRINCIPAL_SUSPENDU'),
[{
text: I18n.t('OK'), onPress: () => {
}
}]);
} else {
setAssure(item);
setBeneficiary(beneficiary);
setStatutPatient(0);
setModalListAssure(false);
setFieldValue(
'lastname_patient',
beneficiary.lastname,
);
setFieldValue(
'firstname_patient',
beneficiary.firstname,
);
fetchGetNetworkActs(wallet.id_network, '', `&user_id=${item.user.id}&beneficiary_id=${beneficiary.id}`);
dispatch(fetchGetUserByNameOrNumberReset());
wizard.current.next();
}
}}>
<View style={{width: 10}}/>
<View style={{paddingHorizontal: 10, alignItems: 'flex-start'}}>
<Text subhead semibold textAlign="left">
{`${beneficiary.firstname !== null ? beneficiary.firstname : ''} ${beneficiary.lastname !== null ? beneficiary.lastname : ''} (${I18n.t('AYANT_DROITS')})`}
</Text>
<Text footnote>
{`${I18n.t('MONTANT_ASSURANCE_CONSOMME')}: ${beneficiary.insurance_consumed_amount}`}
</Text>
<Text footnote>
{`${I18n.t('MONTANT_ASSURANCE_RESTANTE')}: ${beneficiary.insurance_remaining_amount}`}
</Text>
</View>
</TouchableOpacity>
))}
</View>
)
}}/>
@ -289,24 +463,57 @@ const DemandeAutorisationSoinScreen = ({
</Modal>
</View>
</ScrollView>
);
)
const renderDialogQRCodeScanner = () => {
return (
<ScreenComponent>
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
<SpinnerOverlay show={getNetworkAct.loading} />
<KeyboardAvoidingView
behavior={Platform.OS === 'android' ? 'height' : 'padding'}
style={{flex: 1}}>
<Dialog.Container contentStyle={{width: responsiveWidth(80)}} useNativeDriver={true}
visible={showQRCodeScanner}>
<ScrollView style={{flex: 1}}>
<Formik validationSchema={RegisterSchema}
initialValues={{
password: '',
code_acte: ''
<Dialog.Title>{I18n.t('SCAN')}</Dialog.Title>
<ScrollView style={[styles.blockView, {borderBottomColor: Color.borderColor, maxHeight: 300}]}>
<Text>
{I18n.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')}
</Text>
<QRCodeScanner
onRead={(result) => {
setShowQRCodeScanner(false);
fetchGetUserByIdQRCode(result.data);
}}
onSubmit={(values) => {
if (user !== null) {
flashMode={RNCamera.Constants.FlashMode.off}
/>
</ScrollView>
<Dialog.Button bold={true} label={I18n.t('CLOSE')} onPress={() => {
setShowQRCodeScanner(false);
}}/>
</Dialog.Container>
)
}
const {
handleChange,
handleSubmit,
handleBlur,
values,
errors,
touched,
setFieldValue,
setFieldTouched,
isValid,
} = useFormik({
validationSchema: RegisterSchema,
initialValues: {
password: '',
code_acte: '',
firstname_patient: '',
lastname_patient: '',
},
onSubmit: values => {
if (assure !== null || beneficiary !== null) {
if (insurance === null) {
insurancesRef.shake(800);
} else if (values.code_acte === '')
@ -315,26 +522,171 @@ const DemandeAutorisationSoinScreen = ({
fetchDemaneAutorisationSoin({
act_id: values.code_acte,
insurance_id: insurance.id,
beneficiary_id: beneficiaryId,
beneficiary_id: assure !== null ? assure.id : beneficiary.id,
password: values.password
});
console.log(user);
console.log("insurance", insurance);
}
}
}}>
},
});
{({
values,
errors,
touched,
handleChange,
handleBlur,
setFieldValue,
setFieldTouched,
handleSubmit,
isSubmitting,
}) => (<>
const onNext = () => {
console.log("currentStep", currentStep);
switch (currentStep) {
case 0:
console.log("values", values);
dispatch(fetchGetUserByNameOrNumberReset());
if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) {
if (isNumeroAssureSearch)
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
else if (isPhoneAssureSearch)
fetchGetUserByNameOrNumber(wallet.id_network, `&phone=${values.numero_assure}`);
else
fetchGetUserByNameOrNumber(wallet.id_network, `&name=${values.numero_assure}`)
console.log("errors", errors);
}
return false;
break;
default:
return true;
}
};
const stepList = [
{
title: I18n.t('ASSURE'),
content: (
<View>
<TextInput
style={{marginTop: 10, width: responsiveWidth(90)}}
placeholder={isNumeroAssureSearch ? I18n.t('NUMERO_ASSURE') : isPhoneAssureSearch ? I18n.t('PHONE_NUMBER') : I18n.t('NOM_ASSURE')}
value={values.numero_assure}
keyboardType={isPhoneAssureSearch ? 'numeric' : 'default'}
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={isNumeroAssureSearch ? 'lock' : isPhoneAssureSearch ? 'phone' : 'user'}
size={20}
/>
}
/>
<View style={{
flexDirection: 'row',
position: 'absolute',
top: 22,
right: 70,
justifyContent: 'space-between',
width: 50
}}>
<Icon
style={{paddingRight: 10}}
name='lock'
size={20}
color={Color.primaryColor}
onPress={() => {
setIsNumeroAssureSearch(true);
setIsPhoneAssureSearch(false);
}}
/>
<Icon
style={{paddingRight: 10}}
name='phone'
size={20}
color={Color.primaryColor}
onPress={() => {
setIsNumeroAssureSearch(false);
setIsPhoneAssureSearch(true);
}}
/>
<Icon
style={{paddingRight: 10}}
name='user'
size={20}
color={Color.primaryColor}
onPress={() => {
setIsNumeroAssureSearch(false);
setIsPhoneAssureSearch(false);
}}
/>
<Icon
style={{paddingRight: 10}}
name="qrcode"
size={20}
color={Color.primaryColor}
onPress={() => {
setShowQRCodeScanner(true);
}}
/>
</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}
editable={false}
error={errors.lastname_patient}
/>
<TextInput
style={{marginTop: 10}}
placeholder={I18n.t('PRENOM_CLIENT')}
value={values.firstname_patient}
editable={false}
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}
disabled={true}
value={statutPatient}
initial={statutPatient}
buttonColor={Color.accentColor}
backgroundColor={Color.primaryDarkColor}
textColor='white'
bold={true}
hasPadding
height={32}
onPress={(value) => {
//setGender(value);
}}/>
</View>
</View>
</View>
),
},
{
title: I18n.t('DEMAND_DETAIL'),
content: (
<View>
{
insuranceList.loading
? renderLoader()
@ -359,7 +711,11 @@ const DemandeAutorisationSoinScreen = ({
onChangeText={(value, index, data) => {
console.log("Value", value);
setInsurance(value);
setBeneficiaries([...value.beneficiaries, {id: user.id, firstname: user.firstname, lastname: user.lastname}]);
setBeneficiaries([...value.beneficiaries, {
id: assure !== null ? assure.id : beneficiary.id,
firstname: assure !== null ? assure.firstname : beneficiary.firstname,
lastname: assure !== null ? assure.lastname : beneficiary.lastname
}]);
fetchGetNetworkActs(value.network.id, '', '&authorization_type=PRIOR')
}}
valueExtractor={(value) => {
@ -391,7 +747,6 @@ const DemandeAutorisationSoinScreen = ({
onChangeText={(value, index, data) => {
setFieldTouched('code_acte');
setFieldValue('code_acte', value.id);
setModalListAssure(true);
}}
valueExtractor={(value) => {
return value
@ -403,7 +758,7 @@ const DemandeAutorisationSoinScreen = ({
</Animatable.View>
<PasswordInput
style={{marginTop: 10}}
style={{marginTop: 10, width: responsiveWidth(90)}}
onChangeText={handleChange('password')}
placeholder={I18n.t('PASSWORD')}
secureTextEntry
@ -424,9 +779,126 @@ const DemandeAutorisationSoinScreen = ({
</Button>
</View>
: null}
</>)}
</Formik>
</View>
),
}
]
return (
<ScreenComponent>
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
<SpinnerOverlay show={getNetworkAct.loading}/>
<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 === 2 ? (
<Button
loading={demandeAutorisationSoin.loading}
onPress={handleSubmit}>
{I18n.t('SUBMIT_LABEL')}
</Button>
) : (
<TouchableOpacity
style={[
styles.iconNavigationButton,
{
backgroundColor:
Color.primaryColor,
borderColor:
Color.primaryColor,
},
]}
onPress={e => {
handleSubmit(e);
if (onNext())
wizard.current.next();
}}>
{(subscriptionList.loading || getUserByNameOrNumber.loading || getUserByIdQRCode.loading) ?
<ActivityIndicator
size="small"
color="#fff"
/>
: <Icon
name="arrow-right"
size={24}
color={Color.whiteColor}
/>}
</TouchableOpacity>
)}
</View>
{modalListAssure && renderListAssure()}
{showQRCodeScanner && renderDialogQRCodeScanner()}
{modalListAssure && renderListAssure()}
</View>
</ScrollView>
</KeyboardAvoidingView>
@ -459,7 +931,9 @@ const mapStateToProps = createStructuredSelector({
activatePaySubscription: selectActivatePaySubscription,
getConsultation: selectGetConsultation,
getNetworkAct: selectGetNetworkAct,
demandeAutorisationSoin: selectDemandeAutorisationSoin
demandeAutorisationSoin: selectDemandeAutorisationSoin,
getUserByNameOrNumber: selectGetUserByNameOrNumber,
getUserByIdQRCode: selectGetUserByIdQRCode,
});
export default connect(mapStateToProps, {
@ -467,7 +941,9 @@ export default connect(mapStateToProps, {
fetchGetNetworkActs,
fetchAcceptRejectConsultation,
fetchGetListInsuranceWithBeneficiaries,
fetchDemaneAutorisationSoin
fetchDemaneAutorisationSoin,
fetchGetUserByIdQRCode,
fetchGetUserByNameOrNumber,
})(
DemandeAutorisationSoinScreen,
);
@ -569,4 +1045,24 @@ const styles = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'space-between',
},
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'
},
beneficiarySubSection: {
marginTop: 10,
flexDirection: 'row',
width: '100%',
}
});

View File

@ -547,12 +547,6 @@ export const optionNanoSanteUserScreen = {
{
title: 'MANAGE_HEALTH',
options: [
{
icon: 'book-medical',
title: 'DEMAND_AUTORIZATION_HEALTH',
screen: 'demandeAutorisationSoinScreen',
iconType: "FontAwesome5"
},
{
title: 'HISTORIC_HEALTH',
screen: 'historiqueNanoSanteUserScreen',
@ -669,13 +663,18 @@ export const optionNanoSanteAgentScreen = {
title: 'MODIFY_EXECUTION',
iconType: "FontAwesome5"
},
{
icon: 'book-medical',
title: 'DEMAND_AUTORIZATION_HEALTH',
screen: 'demandeAutorisationSoinScreen',
iconType: "FontAwesome5"
},
{
screen: route.historiqueNanoSanteAgentScreen,
icon: 'history',
title: 'HISTORY',
iconType: "FontAwesome5"
},
{}
}
]
}

View File

@ -571,7 +571,7 @@
"RENEW_INSSURANCE": "Renouveler son assurance ",
"MANAGE_ASSURANCE": "Gérer son assurance",
"MANAGE_HEALTH": "Gérer ses soins",
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
"DEMAND_AUTORIZATION_HEALTH": "Demande de prise en charge",
"HISTORIC_HEALTH": "Historique",
"VALID_HEALTH": "Valider un soin ",
"ACTIVATE_INSSURANCE": "Activer son assurance",
@ -727,7 +727,7 @@
"ASSURE_SUSPENDU": "Cet assuré est suspendu",
"ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu",
"CONSULTATION": "Consultation",
"ACTE_EXAMEN": "Autre acte et examen",
"ACTE_EXAMEN": "Acte et examen",
"AMOUNT_FREE": "Montant libre",
"DESCRIPTION": "Description",
"EXECUTION": "Execution",