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, addBeneficiaryScreen: AddBeneficiaryScreen,
insuranceSubscriptionScreen: InsuranceSubscriptionScreen, insuranceSubscriptionScreen: InsuranceSubscriptionScreen,
validateConsultationScreen: ValidateConsultationScreen, validateConsultationScreen: ValidateConsultationScreen,
demandeAutorisationSoinScreen: DemandeAutorisationSoinScreen,
validateConsultationDetailScreen: ValidateConsultationDetailScreen, validateConsultationDetailScreen: ValidateConsultationDetailScreen,
activateBuySubscriptionScreen: ActivateBuySubscriptionScreen, activateBuySubscriptionScreen: ActivateBuySubscriptionScreen,
stopSubscriptionScreen: StopSubscriptionScreen, stopSubscriptionScreen: StopSubscriptionScreen,
@ -243,6 +242,7 @@ const AppAgentStack = createDrawerNavigator({
walletSelect: WalletSelect, walletSelect: WalletSelect,
createIdentification: CreateIdentification, createIdentification: CreateIdentification,
validateIdentification: ValidateIdentification, validateIdentification: ValidateIdentification,
demandeAutorisationSoinScreen: DemandeAutorisationSoinScreen,
Historique: Historique:
{ {
screen: createBottomTabNavigator({myDemand: MyHistory}, { 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 ", "RENEW_INSSURANCE": "Renouveler son assurance ",
"MANAGE_ASSURANCE": "Gérer son assurance", "MANAGE_ASSURANCE": "Gérer son assurance",
"MANAGE_HEALTH": "Gérer ses soins", "MANAGE_HEALTH": "Gérer ses soins",
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin", "DEMAND_AUTORIZATION_HEALTH": "Demande de prise en charge",
"HISTORIC_HEALTH": "Historique", "HISTORIC_HEALTH": "Historique",
"VALID_HEALTH": "Valider un soin ", "VALID_HEALTH": "Valider un soin ",
"ACTIVATE_INSSURANCE": "Activer son assurance", "ACTIVATE_INSSURANCE": "Activer son assurance",
@ -727,7 +727,7 @@
"ASSURE_SUSPENDU": "Cet assuré est suspendu", "ASSURE_SUSPENDU": "Cet assuré est suspendu",
"ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu", "ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu",
"CONSULTATION": "Consultation", "CONSULTATION": "Consultation",
"ACTE_EXAMEN": "Autre acte et examen", "ACTE_EXAMEN": "Acte et examen",
"AMOUNT_FREE": "Montant libre", "AMOUNT_FREE": "Montant libre",
"DESCRIPTION": "Description", "DESCRIPTION": "Description",
"EXECUTION": "Execution", "EXECUTION": "Execution",

View File

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

View File

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

View File

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

View File

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

View File

@ -5,11 +5,12 @@
* Created by BRICE ZELE * Created by BRICE ZELE
* Date: 01/02/2022 * Date: 01/02/2022
*/ */
import React, {useEffect, useState} from 'react'; import React, {useEffect, useRef, useState} from 'react';
import { import {
ActivityIndicator, ActivityIndicator,
Alert, Alert,
Dimensions, FlatList, Dimensions,
FlatList,
KeyboardAvoidingView, KeyboardAvoidingView,
Platform, Platform,
ProgressBarAndroid, ProgressBarAndroid,
@ -26,33 +27,34 @@ import {
fetchAcceptRejectConsultation, fetchAcceptRejectConsultation,
fetchAcceptRejectConsultationReset, fetchAcceptRejectConsultationReset,
fetchActivePaySubscription, fetchActivePaySubscription,
fetchDeleteBeneficiaryReset,
fetchDemaneAutorisationSoin, fetchDemaneAutorisationSoin,
fetchDemaneAutorisationSoinReset, fetchDemaneAutorisationSoinReset,
fetchGetConsultation,
fetchGetConsultationReset, fetchGetConsultationReset,
fetchGetListInsurance,
fetchGetListInsuranceReset, fetchGetListInsuranceReset,
fetchGetListInsuranceWithBeneficiaries, fetchGetListInsuranceWithBeneficiaries,
fetchGetNetworkActs fetchGetNetworkActs,
fetchGetUserByIdQRCode,
fetchGetUserByIdQRCodeReset,
fetchGetUserByNameOrNumber,
fetchGetUserByNameOrNumberReset
} from "../../../redux/insurance/insurance.actions"; } from "../../../redux/insurance/insurance.actions";
import DropdownAlert from "react-native-dropdownalert"; import DropdownAlert from "react-native-dropdownalert";
import {createStructuredSelector} from "reselect"; import {createStructuredSelector} from "reselect";
import { import {
selectAcceptRefuseConsultation, selectActivatePaySubscription,
selectActivatePaySubscription, selectDemandeAutorisationSoin, selectDemandeAutorisationSoin,
selectGetConsultation, selectGetNetworkAct, selectGetConsultation,
selectGetNetworkAct,
selectGetUserByIdQRCode,
selectGetUserByNameOrNumber,
selectInsuranceList, selectInsuranceList,
selectSubscriptionList selectSubscriptionList
} from "../../../redux/insurance/insurance.selector"; } from "../../../redux/insurance/insurance.selector";
import {readUser} from "../../../webservice/AuthApi";
import Text from '../../../components/Text'; import Text from '../../../components/Text';
import * as Utils from "../../../utils/UtilsFunction"; import * as Utils from "../../../utils/UtilsFunction";
import {displayToast, uppercaseFirstLetter} from "../../../utils/UtilsFunction";
import Dialog from "react-native-dialog"; import Dialog from "react-native-dialog";
import {Typography} from "../../../config/typography";
import {store} from "../../../redux/store"; import {store} from "../../../redux/store";
import {Formik} from "formik"; import {useFormik} from "formik";
import * as Animatable from "react-native-animatable"; import * as Animatable from "react-native-animatable";
import {responsiveWidth} from "react-native-responsive-dimensions"; import {responsiveWidth} from "react-native-responsive-dimensions";
import {Dropdown} from "react-native-material-dropdown"; import {Dropdown} from "react-native-material-dropdown";
@ -62,6 +64,13 @@ import Button from "../../../components/Button";
import * as Yup from "yup"; import * as Yup from "yup";
import SpinnerOverlay from "../../../components/SpinnerOverlayComponent"; import SpinnerOverlay from "../../../components/SpinnerOverlayComponent";
import Modal from "react-native-modal"; 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'); let moment = require('moment-timezone');
@ -74,9 +83,14 @@ const DemandeAutorisationSoinScreen = ({
fetchAcceptRejectConsultation, fetchAcceptRejectConsultation,
fetchGetListInsuranceWithBeneficiaries, fetchGetListInsuranceWithBeneficiaries,
fetchDemaneAutorisationSoin, fetchDemaneAutorisationSoin,
fetchGetUserByIdQRCode,
fetchGetUserByNameOrNumber,
getConsultation, getConsultation,
getUserByNameOrNumber,
getUserByIdQRCode,
insuranceList, insuranceList,
getNetworkAct, getNetworkAct,
subscriptionList,
demandeAutorisationSoin demandeAutorisationSoin
}) => { }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
@ -89,6 +103,31 @@ const DemandeAutorisationSoinScreen = ({
const [beneficiaryId, setBeneficiaryId] = useState(null); const [beneficiaryId, setBeneficiaryId] = useState(null);
const [insurance, setInsurance] = 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 insurancesRef = null;
let codeActeRef = null; let codeActeRef = null;
const [modalListAssure, setModalListAssure] = useState(false); const [modalListAssure, setModalListAssure] = useState(false);
@ -104,12 +143,13 @@ const DemandeAutorisationSoinScreen = ({
dispatch(fetchGetConsultationReset()); dispatch(fetchGetConsultationReset());
dispatch(fetchGetListInsuranceReset()); dispatch(fetchGetListInsuranceReset());
dispatch(fetchAcceptRejectConsultationReset()); dispatch(fetchAcceptRejectConsultationReset());
readUser().then((user) => { dispatch(fetchGetUserByNameOrNumberReset());
dispatch(fetchGetUserByIdQRCodeReset());
/* readUser().then((user) => {
setUser(user); setUser(user);
console.log("User", user); console.log("User", user);
fetchGetListInsuranceWithBeneficiaries(`?user_id=${user.id}`); fetchGetListInsuranceWithBeneficiaries(`?user_id=${user.id}`);
//fetchGetConsultation(user.id, 'ACCEPTED', ''); });*/
});
//fetchGetNetworkActs(wallet.idNetwork, '', '&authorization_type=PRIOR'); //fetchGetNetworkActs(wallet.idNetwork, '', '&authorization_type=PRIOR');
}, []); }, []);
@ -125,9 +165,9 @@ const DemandeAutorisationSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getConsultation), Utils.getErrorMsg(getConsultation),
@ -144,7 +184,7 @@ const DemandeAutorisationSoinScreen = ({
insuranceListTemp.push(insuranceItem.network); insuranceListTemp.push(insuranceItem.network);
}); });
setInsurances(insuranceListTemp); setInsurances(insuranceListTemp);
console.log("beneficiariesListTemp",beneficiariesListTemp); console.log("beneficiariesListTemp", beneficiariesListTemp);
} }
if (insuranceList.error) { if (insuranceList.error) {
@ -158,9 +198,9 @@ const DemandeAutorisationSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(insuranceList), Utils.getErrorMsg(insuranceList),
@ -198,9 +238,9 @@ const DemandeAutorisationSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(demandeAutorisationSoin), Utils.getErrorMsg(demandeAutorisationSoin),
@ -209,6 +249,45 @@ const DemandeAutorisationSoinScreen = ({
} }
}, [demandeAutorisationSoin]); }, [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 = () => ( const renderLoader = () => (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{Platform.OS === 'android' {Platform.OS === 'android'
@ -227,6 +306,8 @@ const DemandeAutorisationSoinScreen = ({
} }
</View> </View>
); );
const renderListAssure = () => ( const renderListAssure = () => (
<ScrollView style={{flex: 1}}> <ScrollView style={{flex: 1}}>
<View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}> <View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
@ -248,32 +329,125 @@ const DemandeAutorisationSoinScreen = ({
<Text body2 style={{marginTop: 10}}>{I18n.t('LIST_ASSURE')}</Text> <Text body2 style={{marginTop: 10}}>{I18n.t('LIST_ASSURE')}</Text>
<FlatList data={beneficiaries} <FlatList data={getUserByNameOrNumber.result?.response}
ListEmptyComponent={<Text body2>{I18n.t('NO_ASSURE')}</Text>} extraData={getUserByNameOrNumber.result?.response}
keyExtractor={(item, index) => index} keyExtractor={(item, index) => index}
ListEmptyComponent={<Text body2>{I18n.t('NO_ASSURE_MATCH_SEARCH')}</Text>}
renderItem={({item, index}) => { renderItem={({item, index}) => {
return ( return (
<View style={{ <View style={{
paddingVertical: 0, paddingVertical: 15,
alignItems: 'flex-start', alignItems: 'flex-start',
}}> }}>
<TouchableOpacity <TouchableOpacity
style={[ style={[
styles.contentActionModalBottom, styles.contentActionModalBottom,
{borderBottomColor: Color.borderColor, width: "100%"}, {
borderBottomColor: Color.borderColor,
width: "100%",
flexDirection: 'column',
},
]} ]}
key={item.id} key={item.id}
onPress={() => { onPress={() => {
if(item.id === user.id) setAssure(item);
setBeneficiaryId(null); setBeneficiary(null);
else setStatutPatient(1);
setBeneficiaryId(item.id);
setModalListAssure(false); 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> <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> </Text>
</TouchableOpacity> </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> </View>
) )
}}/> }}/>
@ -289,24 +463,57 @@ const DemandeAutorisationSoinScreen = ({
</Modal> </Modal>
</View> </View>
</ScrollView> </ScrollView>
); )
const renderDialogQRCodeScanner = () => {
return ( return (
<ScreenComponent> <Dialog.Container contentStyle={{width: responsiveWidth(80)}} useNativeDriver={true}
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/> visible={showQRCodeScanner}>
<SpinnerOverlay show={getNetworkAct.loading} />
<KeyboardAvoidingView
behavior={Platform.OS === 'android' ? 'height' : 'padding'}
style={{flex: 1}}>
<ScrollView style={{flex: 1}}> <Dialog.Title>{I18n.t('SCAN')}</Dialog.Title>
<Formik validationSchema={RegisterSchema}
initialValues={{ <ScrollView style={[styles.blockView, {borderBottomColor: Color.borderColor, maxHeight: 300}]}>
password: '', <Text>
code_acte: '' {I18n.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')}
</Text>
<QRCodeScanner
onRead={(result) => {
setShowQRCodeScanner(false);
fetchGetUserByIdQRCode(result.data);
}} }}
onSubmit={(values) => { flashMode={RNCamera.Constants.FlashMode.off}
if (user !== null) { />
</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) { if (insurance === null) {
insurancesRef.shake(800); insurancesRef.shake(800);
} else if (values.code_acte === '') } else if (values.code_acte === '')
@ -315,26 +522,171 @@ const DemandeAutorisationSoinScreen = ({
fetchDemaneAutorisationSoin({ fetchDemaneAutorisationSoin({
act_id: values.code_acte, act_id: values.code_acte,
insurance_id: insurance.id, insurance_id: insurance.id,
beneficiary_id: beneficiaryId, beneficiary_id: assure !== null ? assure.id : beneficiary.id,
password: values.password password: values.password
}); });
console.log(user); console.log(user);
console.log("insurance", insurance); console.log("insurance", insurance);
} }
} }
}}> },
});
{({
values, const onNext = () => {
errors, console.log("currentStep", currentStep);
touched, switch (currentStep) {
handleChange, case 0:
handleBlur, console.log("values", values);
setFieldValue, dispatch(fetchGetUserByNameOrNumberReset());
setFieldTouched, if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) {
handleSubmit, if (isNumeroAssureSearch)
isSubmitting, 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 insuranceList.loading
? renderLoader() ? renderLoader()
@ -359,7 +711,11 @@ const DemandeAutorisationSoinScreen = ({
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
console.log("Value", value); console.log("Value", value);
setInsurance(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') fetchGetNetworkActs(value.network.id, '', '&authorization_type=PRIOR')
}} }}
valueExtractor={(value) => { valueExtractor={(value) => {
@ -391,7 +747,6 @@ const DemandeAutorisationSoinScreen = ({
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
setFieldTouched('code_acte'); setFieldTouched('code_acte');
setFieldValue('code_acte', value.id); setFieldValue('code_acte', value.id);
setModalListAssure(true);
}} }}
valueExtractor={(value) => { valueExtractor={(value) => {
return value return value
@ -403,7 +758,7 @@ const DemandeAutorisationSoinScreen = ({
</Animatable.View> </Animatable.View>
<PasswordInput <PasswordInput
style={{marginTop: 10}} style={{marginTop: 10, width: responsiveWidth(90)}}
onChangeText={handleChange('password')} onChangeText={handleChange('password')}
placeholder={I18n.t('PASSWORD')} placeholder={I18n.t('PASSWORD')}
secureTextEntry secureTextEntry
@ -424,9 +779,126 @@ const DemandeAutorisationSoinScreen = ({
</Button> </Button>
</View> </View>
: null} : null}
</>)} </View>
</Formik> ),
}
]
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()} {modalListAssure && renderListAssure()}
{showQRCodeScanner && renderDialogQRCodeScanner()}
{modalListAssure && renderListAssure()}
</View>
</ScrollView> </ScrollView>
</KeyboardAvoidingView> </KeyboardAvoidingView>
@ -459,7 +931,9 @@ const mapStateToProps = createStructuredSelector({
activatePaySubscription: selectActivatePaySubscription, activatePaySubscription: selectActivatePaySubscription,
getConsultation: selectGetConsultation, getConsultation: selectGetConsultation,
getNetworkAct: selectGetNetworkAct, getNetworkAct: selectGetNetworkAct,
demandeAutorisationSoin: selectDemandeAutorisationSoin demandeAutorisationSoin: selectDemandeAutorisationSoin,
getUserByNameOrNumber: selectGetUserByNameOrNumber,
getUserByIdQRCode: selectGetUserByIdQRCode,
}); });
export default connect(mapStateToProps, { export default connect(mapStateToProps, {
@ -467,7 +941,9 @@ export default connect(mapStateToProps, {
fetchGetNetworkActs, fetchGetNetworkActs,
fetchAcceptRejectConsultation, fetchAcceptRejectConsultation,
fetchGetListInsuranceWithBeneficiaries, fetchGetListInsuranceWithBeneficiaries,
fetchDemaneAutorisationSoin fetchDemaneAutorisationSoin,
fetchGetUserByIdQRCode,
fetchGetUserByNameOrNumber,
})( })(
DemandeAutorisationSoinScreen, DemandeAutorisationSoinScreen,
); );
@ -569,4 +1045,24 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', 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', title: 'MANAGE_HEALTH',
options: [ options: [
{
icon: 'book-medical',
title: 'DEMAND_AUTORIZATION_HEALTH',
screen: 'demandeAutorisationSoinScreen',
iconType: "FontAwesome5"
},
{ {
title: 'HISTORIC_HEALTH', title: 'HISTORIC_HEALTH',
screen: 'historiqueNanoSanteUserScreen', screen: 'historiqueNanoSanteUserScreen',
@ -669,13 +663,18 @@ export const optionNanoSanteAgentScreen = {
title: 'MODIFY_EXECUTION', title: 'MODIFY_EXECUTION',
iconType: "FontAwesome5" iconType: "FontAwesome5"
}, },
{
icon: 'book-medical',
title: 'DEMAND_AUTORIZATION_HEALTH',
screen: 'demandeAutorisationSoinScreen',
iconType: "FontAwesome5"
},
{ {
screen: route.historiqueNanoSanteAgentScreen, screen: route.historiqueNanoSanteAgentScreen,
icon: 'history', icon: 'history',
title: 'HISTORY', title: 'HISTORY',
iconType: "FontAwesome5" iconType: "FontAwesome5"
}, }
{}
] ]
} }

View File

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