gestion du qr code

This commit is contained in:
Brice Zele 2022-03-18 11:58:47 +01:00
parent 4fb3b5bae0
commit 9ef4ebf19f
14 changed files with 578 additions and 266 deletions

File diff suppressed because one or more lines are too long

View File

@ -560,8 +560,160 @@
"TITLE_HELP_SOON": "Help not available!", "TITLE_HELP_SOON": "Help not available!",
"YOUR_NETWORK": "Select your network", "YOUR_NETWORK": "Select your network",
"HELP_SOON": "A tutorial helping you in understanding the features of the application will soon be available.", "HELP_SOON": "A tutorial helping you in understanding the features of the application will soon be available.",
"ATTACH_ASSURANCE_CARD": "Attached an insurance card",
"SUBSCRIBE_ASSURANCE": "Taking out insurance",
"ADD_SUBSCRIBE": "Add a beneficiary",
"DELETE_SUBSCRIBE": "Delete beneficiary",
"STOP_SUBSCRIBE": "Stop my insurance",
"RENEW_INSSURANCE": "Renew my insurance ",
"MANAGE_ASSURANCE": "Manage my insurance",
"MANAGE_HEALTH": "Manage my care",
"DEMAND_AUTORIZATION_HEALTH": "Request for care authorisation",
"HISTORIC_HEALTH": "Historic",
"VALID_HEALTH": "Validate a treatment ",
"ACTIVATE_INSSURANCE": "Activate my insurance",
"AMOUNT_PER_DURATION": "Amount per duration",
"AMOUNT_PRIME": "Amount of the premium",
"ASSURE": "Insured",
"NUMERO_ASSURE": "Insured person's number",
"NOM_ASSURE": "Insured first name",
"PRENOM_ASSURE": "Insured last name",
"DATE_NAISSANCE": "Date of birth",
"SEXE": "Sex",
"MASCULIN": "Male",
"FEMININ": "Female",
"AFFILIATION": "Affiliation",
"ENFANT": "Child",
"CONJOINT": "Spouse",
"ADD_AYANT_DROIT": "Add a beneficiary",
"AYANT_DROITS": "Beneficiary",
"SELECT_INSURANCE": "Select an insurance",
"COPIE_LEGALISE_ACTE_NAISSANCE_CERTIFICAT_NAISSANCE": "Birth \n certificate",
"DOCUMENT_JUSTICE_ENFANT_ADOPTE": "Adoption document \n or guardianship (optional) ",
"ACTE_MARIAGE": "Marriage certificate",
"CNI_FRONT_FACE": "Front side identity",
"CNI_BACK_FACE": "Rear side identity",
"CLASSE_PRESTATAIRE": "Provider class", "CLASSE_PRESTATAIRE": "Provider class",
"PLEASE_SELECT_INSURANCE_BEFORE": "Please select insurance first", "PLEASE_SELECT_INSURANCE_BEFORE": "Please select insurance first",
"NUMBER_MAX_BENEFICIARY": "Maximum number of beneficiaries reached", "NUMBER_MAX_BENEFICIARY": "Maximum number of beneficiaries reached",
"BENEFICIARY_SUCCESSFULLY_ADDED": "The beneficiary has been correctly added" "BENEFICIARY_SUCCESSFULLY_ADDED": "The beneficiary has been correctly added",
"NUMBER_OF_MONTHS": "Number of months",
"MINIMUM_AMOUNT": "Min. amount",
"AMOUNT_PER_MONTH": "Amount per duration of cover",
"DETAIL": "Detail",
"PRIME_AMOUNT": "Amount of the premium",
"AYANT_DROIT": "Beneficiaries",
"SELECT_SUBSCRIPTION": "Select a subscription",
"SAISIR_FEUILLE_SOIN": "Create a consultation",
"MODIFIER_FEUILLE_SOIN": "Modifying a care sheet",
"EXECUTER_PRESCRIPTION": "Execute prescription",
"FACTURER_FEUILLES_SOINS": "Invoice the health care sheets",
"FICHE_DE_SOIN": "Care sheet",
"PATIENT": "Patient",
"PRATICIEN": "Practitioner",
"PRESCRIPTION_MEDICALE": "Prescription",
"ADD_PRESCRIPTION_MEDICALE": "Add prescription",
"SITUATION": "Situation",
"CODE_AGREMENT_ETS": "Approval code",
"SITUATION": "Situation",
"NOM_PRATICIEN": "Practitioner firstname",
"PRENOM_PRATICIEN": "Practitioner lastname",
"NOM_CLIENT": "Customer first name",
"PRENOM_CLIENT": "Customer last name",
"CODE_AGREMENT": "Approval code",
"CLASSIFICATION": "Classification",
"COURANTE": "Current",
"LONGUE": "Long",
"ACCIDENT": "Accident",
"GROSSESSE": "Pregnancy",
"ADD_PRESTATION": "Add a service",
"ADD_PRESCRIPTION": "Add a prescription",
"VISITE_DOMICILE": "Home visit",
"CODE_ACTE": "Act code ",
"TICKET_MONDERATEUR": "Co-payment",
"AMOUNT_PER_INSURANCE": "Amount per insurance",
"VISITE_DOMICILE": "Home visit",
"CONDITION_PRISE_CHARGE": "Condition of coverage",
"AFFECTION_COURANTE": "Current condition",
"AFFECTION_LONGUE": "Long-term condition",
"EXONERE": "Exempt",
"DATE_ACCIDENT": "Accident date",
"DATE_DEBUT_GROSSESSE": "Start date of pregnancy",
"DATE_FIN_GROSSESSE": "End date of pregnancy",
"SCAN": "Scanner",
"BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE": "Move your camera close to the QR code to scan it",
"CLOSE": "Close",
"EMPTY_LIST": "Empty list",
"NO_ASSURE_MATCH_SEARCH": "No policyholders match the search",
"NO_ASSURE": "No insured",
"LIST_ASSURE": "List of insured persons",
"ASSURE_NON_EN_REGLE": "Insured not in good standing",
"CLASSE_PRESTATAIRE": "Provider class",
"FRAIS_DEPLACEMENT": "Travel costs",
"AJOUTER_MEDICAMENT": "Add drug/device",
"AJOUTER_EXAMEN": "Add exam",
"NAME": "Name",
"POSOLOGIE": "Dosage",
"QUANTITE": "Quantity",
"LISTE_MEDICAMENT": "Drugs list",
"PRESTATION": "Prestation",
"MEDICAMENT": "Drug",
"EXAMEN": "Exam",
"PRESTATION_SUCCESSFULLY_ADD": "Service successfully added",
"EXAMENS_SUCCESSFULLY_ADD": "Exam successfully added",
"PRESCRIPTIONS_SUCCESSFULLY_ADD": "Prescription successfully added",
"PRESCRIPTIONS_SUCCESSFULLY_MODIFY": "Prescription successfully modified",
"YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION": "You must add at least one benefit",
"NO_DRUG_MATCH_YOU_SEARCH": "There are no drugs that match your search, do you want to add any?",
"COMPRESSED": "Tablet",
"SYRUP": "Syrup",
"SOLUTION": "Solution",
"SUPPOSITORY": "Suppository",
"DEVICE": "Equipment",
"AJOUTER_NOUVEAU_MEDICAMENT": "Add new drug",
"SOUS_ORDONNANCE": "On prescription",
"PLEASE_SELECT_CONDITON_PRISE_CHARGE_FIRST": "Please select the support condition first",
"CONSULTATION": "Consultation",
"STATE": "State",
"INSTITUTE_NAME": "Institution name",
"ACCEPT": "Accept",
"REJECT": "Reject",
"DETAIL": "Detail",
"NO_CONSULTATION_DEMAND": "No consultation request",
"LIST_CONSULTATION": "List of consultations",
"MODIFY_CONSULTATION": "Modify consultation",
"MEDICAMENTS": "Drugs",
"MODIFIER_MEDICAMENT": "Modify drug",
"MODIFIER_EXAMEN": "Modify exam",
"EXAMENS_SUCCESSFULLY_MODIFY": "Exam successfully modified",
"PRESTATION_SUCCESSFULLY_MODIFY": "Successfully modified service",
"MODIFY_PRESTATION": "Modifying a service",
"LIST_PRESTATION": "List of services",
"NO_CONSULTATION": "No consultation",
"NO_EXECUTION": "No execution",
"LISTE_CONSULTATION": "List of consultations",
"LIST_EXECUTION": "List of executions",
"MODIFY_EXECUTION": "Modify execution",
"SOUSCRIPTION": "Subscriptions",
"FEUILLE_SOIN": "Care sheet",
"SOINS": "Care",
"NETWORK": "Network",
"TOTAL_BONUS_AMOUNT": "Total prime",
"BONUS_AMOUNT": "Amount of the basic premium",
"MONTANT_ASSURANCE": "Amount of insurance",
"MONTANT_ASSURE": "Amount of the insured",
"DEMANDES": "Requests",
"ACTE": "Act",
"AGENT_VALIDEUR": "Validating agent",
"TEXT_SUPPRESS_CONFIRM_BENEFICIARY": "Do you really want to remove this rightful claimant?",
"ENTER_PASSWORD_TO_VALID_MODIFICATION": "Enter your password and validate the deletion of the account to delete it permanently",
"PLEASE_SELECT_AT_LEAST_ASSURE": "Please select at least one beneficiary",
"ID": "ID",
"INVOICE_ID": "Bill ID",
"INVOICE": "Bill",
"HISTORY": "Historic",
"INFORMATION_MESSAGE": "Information message",
"MONTANT_ASSURANCE_CONSOMME": "Amount of insurance consumed",
"MONTANT_ASSURANCE_RESTANTE": "Amount of remaining insurance",
"NO_BENEFICIARY": "No beneficiary"
} }

View File

@ -634,7 +634,7 @@
"CODE_ACTE": "Code acte ", "CODE_ACTE": "Code acte ",
"TICKET_MONDERATEUR": "Ticket modérateur", "TICKET_MONDERATEUR": "Ticket modérateur",
"AMOUNT_PER_INSURANCE": "Montant par assurance", "AMOUNT_PER_INSURANCE": "Montant par assurance",
"VISITE_DOMICILE": "Visible domicile", "VISITE_DOMICILE": "Visite domicile",
"CONDITION_PRISE_CHARGE": "Condition de prise en charge", "CONDITION_PRISE_CHARGE": "Condition de prise en charge",
"AFFECTION_COURANTE": "Affection courante", "AFFECTION_COURANTE": "Affection courante",
"AFFECTION_LONGUE": "Affection longue durée", "AFFECTION_LONGUE": "Affection longue durée",
@ -716,5 +716,6 @@
"HISTORY": "Historique", "HISTORY": "Historique",
"INFORMATION_MESSAGE": "Message d'information", "INFORMATION_MESSAGE": "Message d'information",
"MONTANT_ASSURANCE_CONSOMME": "Montant de l'assurance consommé", "MONTANT_ASSURANCE_CONSOMME": "Montant de l'assurance consommé",
"MONTANT_ASSURANCE_RESTANTE": "Montant de l'assurance restante" "MONTANT_ASSURANCE_RESTANTE": "Montant de l'assurance restante",
"NO_BENEFICIARY": "Aucun ayant droit"
} }

View File

@ -7,7 +7,8 @@
*/ */
import InsuranceActions from './insurance.type'; import InsuranceActions from './insurance.type';
import { import {
autorisationCareRequestUrl, checkInsuranceCoverageAmountUrl, autorisationCareRequestUrl,
checkInsuranceCoverageAmountUrl,
consultationUrl, consultationUrl,
createConsultationUrl, createConsultationUrl,
executionPrescriptionUrl, executionPrescriptionUrl,
@ -18,7 +19,8 @@ import {
getNetworkActsUrl, getNetworkActsUrl,
getProviderClassUrl, getProviderClassUrl,
getUserByIdQRCodeUrl, getUserByIdQRCodeUrl,
getUserByNameOrNumberUrl, invoiceUrl, getUserByNameOrNumberUrl,
invoiceUrl,
subscribeInsuranceUrl, subscribeInsuranceUrl,
uploadInsuranceImagetUrl uploadInsuranceImagetUrl
} from "../../webservice/IlinkConstants"; } from "../../webservice/IlinkConstants";
@ -302,9 +304,9 @@ export const fetchGetUserByIdQRCodeError = (error: any) => ({
payload: error, payload: error,
}); });
export const fetchGetUserByIdQRCode = (network_id, id) => { export const fetchGetUserByIdQRCode = (id) => {
return ApiAction({ return ApiAction({
url: `${getUserByIdQRCodeUrl}?network_id=${network_id}&${id}`, url: `${getUserByIdQRCodeUrl}?${id}`,
method: 'GET', method: 'GET',
onLoading: fetchGetUserByIdQRCodePending, onLoading: fetchGetUserByIdQRCodePending,
onSuccess: fetchGetUserByIdQRCodeSuccess, onSuccess: fetchGetUserByIdQRCodeSuccess,

View File

@ -62,13 +62,14 @@ import {
import {resetCommissionReducer, transferCommissionAction} from '../../webservice/WalletTransferCommission'; import {resetCommissionReducer, transferCommissionAction} from '../../webservice/WalletTransferCommission';
import {readUser} from '../../webservice/AuthApi'; import {readUser} from '../../webservice/AuthApi';
import chunk from "lodash/chunk"; import chunk from "lodash/chunk";
import _ from "lodash";
import FontAwesome from "react-native-vector-icons/FontAwesome";
import FontAwesome5 from "react-native-vector-icons/FontAwesome5"; import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
import { import {
fetchGetConsultationReset, fetchGetConsultationReset,
fetchGetDrugAppareilReset, fetchGetNetworkActsReset, fetchGetProviderClassReset, fetchGetDrugAppareilReset,
fetchGetSubscriptionListReset, fetchGetUserByIdQRCodeReset, fetchGetNetworkActsReset,
fetchGetProviderClassReset,
fetchGetSubscriptionListReset,
fetchGetUserByIdQRCodeReset,
fetchGetUserByNameOrNumberReset fetchGetUserByNameOrNumberReset
} from "../../redux/insurance/insurance.actions"; } from "../../redux/insurance/insurance.actions";
import {facturerSoinReset} from "../../webservice/NanoCreditApi"; import {facturerSoinReset} from "../../webservice/NanoCreditApi";
@ -1288,43 +1289,43 @@ class WalletDetail extends Component {
} }
</View> </View>
) : (wallet.type === "ilink_sante") ? ) : (wallet.type === "ilink_sante") ?
<View style={styles.transactionContainer}> <View style={styles.transactionContainer}>
<View style={[styles.containerTouch]}> <View style={[styles.containerTouch]}>
<TouchableOpacity style={styles.contain} <TouchableOpacity style={styles.contain}
onPress={() => { onPress={() => {
this.props.navigation.push(route.historiqueNanoSanteSuperHyperScreen); this.props.navigation.push(route.historiqueNanoSanteSuperHyperScreen);
}} }}
activeOpacity={0.9}> activeOpacity={0.9}>
<Icon name='clock' <Icon name='clock'
color={Color.primaryColor} color={Color.primaryColor}
size={30} size={30}
style={styles.imageBanner}/> style={styles.imageBanner}/>
<View style={[styles.content]}> <View style={[styles.content]}>
<View style={{paddingTop: 20,}}>
<Text
style={[Typography.headline, Typography.semibold]}>
{I18n.t('HISTORY')}
</Text>
</View>
<View style={{paddingTop: 20,}}>
<Text
style={[Typography.headline, Typography.semibold]}>
{I18n.t('HISTORY')}
</Text>
</View> </View>
</TouchableOpacity>
</View>
</View> </View> :
</TouchableOpacity> <>
</View> <View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
<Text
style={[Typography.title3, Typography.semibold]}>
{I18n.t('TRANSACTION_HISTORY')}
</Text>
</View>
</View> : {this.renderSuperHyperHistoryTransactionList()}
<> </>
<View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
<Text
style={[Typography.title3, Typography.semibold]}>
{I18n.t('TRANSACTION_HISTORY')}
</Text>
</View>
{this.renderSuperHyperHistoryTransactionList()}
</>
} }
</> </>
) )
@ -1474,21 +1475,71 @@ class WalletDetail extends Component {
</Text> </Text>
</View> </View>
{(wallet.type === "ilink_sante") && {(wallet.type === "ilink_sante") &&
chunk(optionNanoSanteAgentScreen.options, 2).map((item, index) => ( chunk(optionNanoSanteAgentScreen.options, 2).map((item, index) => {
<View key={index} style={styles.transactionContainer}> if (index <= 1)
{ return (
item.length === 1 ?
item.map((wallet, i) => ( <View key={index} style={styles.transactionContainer}>
this.renderItem(wallet, true, i) {
)) : item.length === 1 ?
item.map((wallet, i) => (
this.renderItem(wallet, false, i) item.map((wallet, i) => (
)) this.renderItem(wallet, true, i)
} )) :
</View> item.map((wallet, i) => (
)) this.renderItem(wallet, false, i)
))
}
</View>
)
else {
return (
<View key={index} style={styles.transactionContainer}>
{this.renderItem(item[0], false, 0)}
<>
<View style={[styles.containerTouch]}>
<TouchableOpacity style={styles.contain}
onPress={() => {
this.props.navigation.push(route.walletOptionSelect, {
optionSelect: optionIdentificationScreen,
lottie: {
source: require("./../../datas/json/identification.json"),
loop: true
}
})
}}
activeOpacity={0.9}>
<Icon name='pencil-plus'
color={Color.primaryColor}
size={30}
style={styles.imageBanner}/>
<View style={[styles.content]}>
<View style={styles.contentTitle}>
<Text
style={[Typography.headline, Typography.semibold]}>
{I18n.t('CREATION_IDENTIFICATION_DESCRIPTION')}
</Text>
</View>
<View style={{flex: 1}}>
<Text
style={[Typography.overline, Color.grayColor], {paddingVertical: 5}}
numberOfLines={5}>
</Text>
</View>
</View>
</TouchableOpacity>
</View>
</>
</View>
)
}
})
} }
{(wallet.type === "ilink-world" || wallet.type === "ilink" || wallet.type === "visa") && {(wallet.type === "ilink-world" || wallet.type === "ilink" || wallet.type === "visa") &&
@ -1729,7 +1780,7 @@ class WalletDetail extends Component {
{!this.isHomeRootView && (wallet.type === 'ilink_sante' && wallet.category !== 'geolocated') ? {!this.isHomeRootView && (wallet.type === 'ilink_sante' && wallet.category !== 'geolocated') ?
this.renderHistoryTransaction(wallet) this.renderHistoryTransaction(wallet)
: !this.isHomeRootView && this.renderHistoryTransaction(wallet) } : !this.isHomeRootView && this.renderHistoryTransaction(wallet)}
{this.isHomeRootView && this.renderSuperHyperHistoryTransaction(wallet)} {this.isHomeRootView && this.renderSuperHyperHistoryTransaction(wallet)}
</View> </View>

View File

@ -28,8 +28,9 @@ import {ScreenComponent} from "../../../components/ScreenComponent";
import Button from "../../../components/Button"; import Button from "../../../components/Button";
import {responsiveWidth} from "react-native-responsive-dimensions"; import {responsiveWidth} from "react-native-responsive-dimensions";
import { import {
fetchAcceptRejectConsultationReset, fetchActivePaySubscription,
fetchActivePaySubscription, fetchCheckInsuranceCoverageAmount, fetchCheckInsuranceCoverageAmountReset, fetchCheckInsuranceCoverageAmount,
fetchCheckInsuranceCoverageAmountReset,
fetchCreateConsultation, fetchCreateConsultation,
fetchCreateConsultationReset, fetchCreateConsultationReset,
fetchExecutionPrescription, fetchExecutionPrescription,
@ -50,7 +51,8 @@ import {readUser} from "../../../webservice/AuthApi";
import TextInput from "../../../components/TextInput"; import TextInput from "../../../components/TextInput";
import {createStructuredSelector} from "reselect"; import {createStructuredSelector} from "reselect";
import { import {
selectActivatePaySubscription, selectCheckInsuranceCoverageAmount, selectActivatePaySubscription,
selectCheckInsuranceCoverageAmount,
selectExecutionPrescription, selectExecutionPrescription,
selectGetAmountConsultation, selectGetAmountConsultation,
selectGetConsultation, selectGetConsultation,
@ -291,7 +293,7 @@ const ExecuterPrescriptionScreen = ({
const [modalPrice, setModalPrice] = useState(false); const [modalPrice, setModalPrice] = useState(false);
const [modalListAssure, setModalListAssure] = useState(false); const [modalListAssure, setModalListAssure] = useState(false);
const [modalListMedicament, setModalListMedicament] = useState(false); const [modalListMedicament, setModalListMedicament] = useState(false);
const [tmpSheetId, setTmpSheetId] = useState(''+Date.now()); const [tmpSheetId, setTmpSheetId] = useState('' + Date.now());
const [prestations, setPrestations] = useState([]); const [prestations, setPrestations] = useState([]);
@ -346,7 +348,30 @@ const ExecuterPrescriptionScreen = ({
} }
}, [user]); }, [user]);
useEffect(() => {
console.log("getUserByNameOrNumber.result", getUserByIdQRCode);
if (getUserByIdQRCode.result !== null) {
setIsNumeroAssureSearch(false);
setIsPhoneAssureSearch(true);
setFieldValue('numero_assure', getUserByIdQRCode.result.response.phone);
fetchGetUserByNameOrNumber(wallet.id_network, `&phone=${getUserByIdQRCode.result.response.phone}`);
}
if (getUserByIdQRCode.error) {
Alert.alert(
I18n.t("ERROR_LABLE"),
Utils.getErrorMsg(getUserByIdQRCode),
[
{
text: I18n.t("OK"), onPress: () => {
dispatch(fetchGetUserByIdQRCodeReset());
}
}
],
{cancelable: false}
);
}
}, [getUserByIdQRCode]);
useEffect(() => { useEffect(() => {
console.log("getUserByNameOrNumber.result", getUserByNameOrNumber); console.log("getUserByNameOrNumber.result", getUserByNameOrNumber);
@ -376,14 +401,8 @@ const ExecuterPrescriptionScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType(
'error',
I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getUserByNameOrNumber),
);
dispatch(fetchGetUserByNameOrNumberReset());*/
} }
}, [getUserByNameOrNumber]); }, [getUserByNameOrNumber]);
@ -402,7 +421,7 @@ const ExecuterPrescriptionScreen = ({
[ [
{ {
text: I18n.t("OK"), onPress: () => { text: I18n.t("OK"), onPress: () => {
if(elementToSetPrice.examen) { if (elementToSetPrice.examen) {
setConsultation({ setConsultation({
...consultation, ...consultation,
exams: consultation.exams.map(exam => { exams: consultation.exams.map(exam => {
@ -427,7 +446,7 @@ const ExecuterPrescriptionScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
} }
}, [checkInsuranceCoverageAmount]); }, [checkInsuranceCoverageAmount]);
@ -447,14 +466,14 @@ const ExecuterPrescriptionScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getConsultation), Utils.getErrorMsg(getConsultation),
); );
dispatch(fetchGetConsultationReset());*/ dispatch(fetchGetConsultationReset());*/
} }
}, [getConsultation]); }, [getConsultation]);
@ -487,14 +506,14 @@ const ExecuterPrescriptionScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(executionPrescription), Utils.getErrorMsg(executionPrescription),
); );
dispatch(fetchExecutionPrescriptionReset());*/ dispatch(fetchExecutionPrescriptionReset());*/
} }
}, [executionPrescription]); }, [executionPrescription]);
@ -528,7 +547,7 @@ const ExecuterPrescriptionScreen = ({
<QRCodeScanner <QRCodeScanner
onRead={(result) => { onRead={(result) => {
setShowQRCodeScanner(false); setShowQRCodeScanner(false);
console.log("result", result.data); fetchGetUserByIdQRCode(result.data);
}} }}
flashMode={RNCamera.Constants.FlashMode.off} flashMode={RNCamera.Constants.FlashMode.off}
/> />
@ -569,10 +588,10 @@ const ExecuterPrescriptionScreen = ({
exams: [ exams: [
{ {
unit_price: values.price, unit_price: values.price,
quantity: consultation.exams.filter(exam => elementToSetPrice.id === exam.id)[0].quantity quantity: consultation.exams.filter(exam => elementToSetPrice.id === exam.id)[0].quantity
} }
], ],
tmp_sheet_id:tmpSheetId, tmp_sheet_id: tmpSheetId,
}); });
} else { } else {
setConsultation({ setConsultation({
@ -590,11 +609,11 @@ const ExecuterPrescriptionScreen = ({
care_condition: consultation._care_condition, care_condition: consultation._care_condition,
act_action: "INSERT", act_action: "INSERT",
act_type: "PRESCRIPTION", act_type: "PRESCRIPTION",
tmp_sheet_id:tmpSheetId, tmp_sheet_id: tmpSheetId,
prescriptions: [ prescriptions: [
{ {
unit_price: values.price, unit_price: values.price,
quantity: consultation.prescriptions.filter(prescription => elementToSetPrice.id === prescription.id)[0].quantity quantity: consultation.prescriptions.filter(prescription => elementToSetPrice.id === prescription.id)[0].quantity
} }
], ],
}); });
@ -770,7 +789,11 @@ const ExecuterPrescriptionScreen = ({
<TouchableOpacity <TouchableOpacity
style={[ style={[
styles.contentActionModalBottom, styles.contentActionModalBottom,
{borderBottomColor: Color.borderColor, width: "100%",flexDirection: 'column',}, {
borderBottomColor: Color.borderColor,
width: "100%",
flexDirection: 'column',
},
]} ]}
key={item.id} key={item.id}
onPress={() => { onPress={() => {
@ -834,7 +857,7 @@ const ExecuterPrescriptionScreen = ({
{`${I18n.t('MONTANT_ASSURANCE_CONSOMME')}: ${beneficiary.insurance_consumed_amount}`} {`${I18n.t('MONTANT_ASSURANCE_CONSOMME')}: ${beneficiary.insurance_consumed_amount}`}
</Text> </Text>
<Text footnote> <Text footnote>
{`${I18n.t('MONTANT_ASSURANCE_RESTANTE')}: ${beneficiary.insurance_remaining_amount}`} {`${I18n.t('MONTANT_ASSURANCE_RESTANTE')}: ${beneficiary.insurance_remaining_amount}`}
</Text> </Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
@ -1180,7 +1203,7 @@ const ExecuterPrescriptionScreen = ({
case 0: case 0:
console.log("values", values); console.log("values", values);
dispatch(fetchGetUserByNameOrNumberReset()); dispatch(fetchGetUserByNameOrNumberReset());
if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) { if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) {
if (isNumeroAssureSearch) if (isNumeroAssureSearch)
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`); fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
else if (isPhoneAssureSearch) else if (isPhoneAssureSearch)
@ -1195,7 +1218,8 @@ const ExecuterPrescriptionScreen = ({
default: default:
return true; return true;
} }
};; };
;
const renderBtnExamen = () => ( const renderBtnExamen = () => (

View File

@ -348,6 +348,31 @@ const ModifierExecutionPrescriptionScreen = ({
} }
}, [user]); }, [user]);
useEffect(() => {
console.log("getUserByNameOrNumber.result", getUserByIdQRCode);
if (getUserByIdQRCode.result !== null) {
setIsNumeroAssureSearch(false);
setIsPhoneAssureSearch(true);
setFieldValue('numero_assure', getUserByIdQRCode.result.response.phone);
fetchGetUserByNameOrNumber(wallet.id_network, `&phone=${getUserByIdQRCode.result.response.phone}`);
}
if (getUserByIdQRCode.error) {
Alert.alert(
I18n.t("ERROR_LABLE"),
Utils.getErrorMsg(getUserByIdQRCode),
[
{
text: I18n.t("OK"), onPress: () => {
dispatch(fetchGetUserByIdQRCodeReset());
}
}
],
{cancelable: false}
);
}
}, [getUserByIdQRCode]);
useEffect(() => { useEffect(() => {
console.log("getUserByNameOrNumber.result", getUserByNameOrNumber); console.log("getUserByNameOrNumber.result", getUserByNameOrNumber);
if (getUserByNameOrNumber.result !== null) { if (getUserByNameOrNumber.result !== null) {
@ -529,6 +554,7 @@ const ModifierExecutionPrescriptionScreen = ({
<QRCodeScanner <QRCodeScanner
onRead={(result) => { onRead={(result) => {
setShowQRCodeScanner(false); setShowQRCodeScanner(false);
fetchGetUserByIdQRCode(result.data);
console.log("result", result.data); console.log("result", result.data);
}} }}
flashMode={RNCamera.Constants.FlashMode.off} flashMode={RNCamera.Constants.FlashMode.off}

View File

@ -457,6 +457,31 @@ const ModifierFeuilleSoinScreen = ({
} }
}, [getUserByNameOrNumber]); }, [getUserByNameOrNumber]);
useEffect(() => {
console.log("getUserByNameOrNumber.result", getUserByIdQRCode);
if (getUserByIdQRCode.result !== null) {
setIsNumeroAssureSearch(false);
setIsPhoneAssureSearch(true);
setFieldValue('numero_assure', getUserByIdQRCode.result.response.phone);
fetchGetUserByNameOrNumber(wallet.id_network, `&phone=${getUserByIdQRCode.result.response.phone}`);
}
if (getUserByIdQRCode.error) {
Alert.alert(
I18n.t("ERROR_LABLE"),
Utils.getErrorMsg(getUserByIdQRCode),
[
{
text: I18n.t("OK"), onPress: () => {
dispatch(fetchGetUserByIdQRCodeReset());
}
}
],
{cancelable: false}
);
}
}, [getUserByIdQRCode]);
useEffect(() => { useEffect(() => {
if (checkInsuranceCoverageAmount.result !== null) { if (checkInsuranceCoverageAmount.result !== null) {
if (checkInsuranceCoverageAmount.result.response !== null) { if (checkInsuranceCoverageAmount.result.response !== null) {
@ -700,6 +725,7 @@ const ModifierFeuilleSoinScreen = ({
<QRCodeScanner <QRCodeScanner
onRead={(result) => { onRead={(result) => {
setShowQRCodeScanner(false); setShowQRCodeScanner(false);
fetchGetUserByIdQRCode(result.data);
console.log("result", result.data); console.log("result", result.data);
}} }}
flashMode={RNCamera.Constants.FlashMode.off} flashMode={RNCamera.Constants.FlashMode.off}

View File

@ -32,7 +32,9 @@ import {
fetchActivePaySubscription, fetchActivePaySubscription,
fetchActivePaySubscriptionReset, fetchActivePaySubscriptionReset,
fetchAddDrug, fetchAddDrug,
fetchAddDrugReset, fetchCheckInsuranceCoverageAmount, fetchCheckInsuranceCoverageAmountReset, fetchAddDrugReset,
fetchCheckInsuranceCoverageAmount,
fetchCheckInsuranceCoverageAmountReset,
fetchCreateConsultation, fetchCreateConsultation,
fetchCreateConsultationReset, fetchCreateConsultationReset,
fetchGetAmountConsultation, fetchGetAmountConsultation,
@ -48,7 +50,7 @@ import {
fetchGetUserByIdQRCode, fetchGetUserByIdQRCode,
fetchGetUserByIdQRCodeReset, fetchGetUserByIdQRCodeReset,
fetchGetUserByNameOrNumber, fetchGetUserByNameOrNumber,
fetchGetUserByNameOrNumberReset, fetchModifyPrescriptionReset fetchGetUserByNameOrNumberReset
} from "../../../redux/insurance/insurance.actions"; } from "../../../redux/insurance/insurance.actions";
import DropdownAlert from "react-native-dropdownalert"; import DropdownAlert from "react-native-dropdownalert";
import {readUser} from "../../../webservice/AuthApi"; import {readUser} from "../../../webservice/AuthApi";
@ -56,7 +58,8 @@ import TextInput from "../../../components/TextInput";
import {createStructuredSelector} from "reselect"; import {createStructuredSelector} from "reselect";
import { import {
selectActivatePaySubscription, selectActivatePaySubscription,
selectAddDrug, selectCheckInsuranceCoverageAmount, selectAddDrug,
selectCheckInsuranceCoverageAmount,
selectCreateConsultation, selectCreateConsultation,
selectGetAmountConsultation, selectGetAmountConsultation,
selectGetDrugAppareil, selectGetDrugAppareil,
@ -292,7 +295,7 @@ const SaisirFeuilleSoinScreen = ({
const [showDateDebutGrossessePicker, setShowDateDebutGrossessePicker] = useState(false); const [showDateDebutGrossessePicker, setShowDateDebutGrossessePicker] = useState(false);
const [showDateFinGrossessePicker, setShowDateFinGrossessePicker] = useState(false); const [showDateFinGrossessePicker, setShowDateFinGrossessePicker] = useState(false);
const [careConditon, setCareCondition] = useState(null); const [careConditon, setCareCondition] = useState(null);
const [tmpSheetId, setTmpSheetId] = useState(''+Date.now()); const [tmpSheetId, setTmpSheetId] = useState('' + Date.now());
const [user, setUser] = useState(null); const [user, setUser] = useState(null);
const [assure, setAssure] = useState(null); const [assure, setAssure] = useState(null);
@ -417,14 +420,14 @@ const SaisirFeuilleSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getUserByNameOrNumber), Utils.getErrorMsg(getUserByNameOrNumber),
); );
dispatch(fetchGetUserByNameOrNumberReset());*/ dispatch(fetchGetUserByNameOrNumberReset());*/
} }
}, [getUserByNameOrNumber]); }, [getUserByNameOrNumber]);
useEffect(() => { useEffect(() => {
@ -455,14 +458,14 @@ const SaisirFeuilleSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getUserByNameOrNumber), Utils.getErrorMsg(getUserByNameOrNumber),
); );
dispatch(fetchGetUserByNameOrNumberReset());*/ dispatch(fetchGetUserByNameOrNumberReset());*/
} }
}, [getUserByNameOrNumber]); }, [getUserByNameOrNumber]);
@ -471,18 +474,18 @@ const SaisirFeuilleSoinScreen = ({
console.log("Prestations", prestations); console.log("Prestations", prestations);
if (checkInsuranceCoverageAmount.result !== null) { if (checkInsuranceCoverageAmount.result !== null) {
if (checkInsuranceCoverageAmount.result.response !== null) { if (checkInsuranceCoverageAmount.result.response !== null) {
if(prestations !== null) { if (prestations !== null) {
setModalPrestation(false); setModalPrestation(false);
Utils.displayToast(I18n.t('PRESTATION_SUCCESSFULLY_ADD')); Utils.displayToast(I18n.t('PRESTATION_SUCCESSFULLY_ADD'));
} }
/* if(examens !== null) { /* if(examens !== null) {
setModalExamen(false); setModalExamen(false);
Utils.displayToast(I18n.t('EXAMENS_SUCCESSFULLY_ADD')); Utils.displayToast(I18n.t('EXAMENS_SUCCESSFULLY_ADD'));
} }
if(prescriptions !== null) { if(prescriptions !== null) {
setModalMedicament(false); setModalMedicament(false);
Utils.displayToast(I18n.t('PRESCRIPTIONS_SUCCESSFULLY_ADD')); Utils.displayToast(I18n.t('PRESCRIPTIONS_SUCCESSFULLY_ADD'));
}*/ }*/
dispatch(fetchCheckInsuranceCoverageAmountReset()); dispatch(fetchCheckInsuranceCoverageAmountReset());
} }
@ -496,30 +499,30 @@ const SaisirFeuilleSoinScreen = ({
[ [
{ {
text: I18n.t("OK"), onPress: () => { text: I18n.t("OK"), onPress: () => {
if(prestations !== null) { if (prestations !== null) {
let newPrestation = [...prestations]; let newPrestation = [...prestations];
newPrestation.shift(); newPrestation.shift();
setPrestations(newPrestation); setPrestations(newPrestation);
setModalPrestation(false); setModalPrestation(false);
} }
/* if(examens !== null) { /* if(examens !== null) {
setModalExamen(false); setModalExamen(false);
} }
if(prescriptions !== null) { if(prescriptions !== null) {
setModalMedicament(false); setModalMedicament(false);
}*/ }*/
dispatch(fetchCheckInsuranceCoverageAmountReset()); dispatch(fetchCheckInsuranceCoverageAmountReset());
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getUserByNameOrNumber), Utils.getErrorMsg(getUserByNameOrNumber),
); );
dispatch(fetchGetUserByNameOrNumberReset());*/ dispatch(fetchGetUserByNameOrNumberReset());*/
} }
}, [checkInsuranceCoverageAmount]); }, [checkInsuranceCoverageAmount]);
@ -557,14 +560,14 @@ const SaisirFeuilleSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(getDrugAppareil), Utils.getErrorMsg(getDrugAppareil),
); );
dispatch(fetchGetDrugAppareilReset());*/ dispatch(fetchGetDrugAppareilReset());*/
} }
}, [getDrugAppareil]); }, [getDrugAppareil]);
@ -585,14 +588,14 @@ const SaisirFeuilleSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(addDrug), Utils.getErrorMsg(addDrug),
); );
dispatch(fetchAddDrugReset());*/ dispatch(fetchAddDrugReset());*/
} }
}, [addDrug]); }, [addDrug]);
@ -625,17 +628,42 @@ const SaisirFeuilleSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(createConsultation), Utils.getErrorMsg(createConsultation),
); );
dispatch(fetchCreateConsultationReset());*/ dispatch(fetchCreateConsultationReset());*/
} }
}, [createConsultation]); }, [createConsultation]);
useEffect(() => {
console.log("getUserByNameOrNumber.result", getUserByIdQRCode);
if (getUserByIdQRCode.result !== null) {
setIsNumeroAssureSearch(false);
setIsPhoneAssureSearch(true);
setFieldValue('numero_assure', getUserByIdQRCode.result.response.phone);
fetchGetUserByNameOrNumber(wallet.id_network, `&phone=${getUserByIdQRCode.result.response.phone}`);
}
if (getUserByIdQRCode.error) {
Alert.alert(
I18n.t("ERROR_LABLE"),
Utils.getErrorMsg(getUserByIdQRCode),
[
{
text: I18n.t("OK"), onPress: () => {
dispatch(fetchGetUserByIdQRCodeReset());
}
}
],
{cancelable: false}
);
}
}, [getUserByIdQRCode]);
const SaisirFeuilleSoinSchema = Yup.object().shape({ const SaisirFeuilleSoinSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
@ -764,7 +792,7 @@ const SaisirFeuilleSoinScreen = ({
<QRCodeScanner <QRCodeScanner
onRead={(result) => { onRead={(result) => {
setShowQRCodeScanner(false); setShowQRCodeScanner(false);
console.log("result", result.data); fetchGetUserByIdQRCode(result.data);
}} }}
flashMode={RNCamera.Constants.FlashMode.off} flashMode={RNCamera.Constants.FlashMode.off}
/> />
@ -800,7 +828,7 @@ const SaisirFeuilleSoinScreen = ({
care_condition: careConditon, care_condition: careConditon,
act_action: "INSERT", act_action: "INSERT",
act_type: "PERFORMANCE", act_type: "PERFORMANCE",
tmp_sheet_id:tmpSheetId, tmp_sheet_id: tmpSheetId,
performances: [ performances: [
{ {
amount: values.amount_prestation, amount: values.amount_prestation,
@ -884,7 +912,7 @@ const SaisirFeuilleSoinScreen = ({
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('AMOUNT')} placeholder={I18n.t('AMOUNT')}
value={values.amount_prestation} value={values.amount_prestation}
onChangeText={(text)=> { onChangeText={(text) => {
setFieldValue('amount_prestation', text); setFieldValue('amount_prestation', text);
fetchGetAmountConsultation({ fetchGetAmountConsultation({
network_id: wallet.id_network, network_id: wallet.id_network,
@ -894,7 +922,7 @@ const SaisirFeuilleSoinScreen = ({
}} }}
onBlur={handleBlur('amount_prestation')} onBlur={handleBlur('amount_prestation')}
success={touched.amount_prestation && !errors.amount_prestation} success={touched.amount_prestation && !errors.amount_prestation}
touched={touched.amount_prestation}A touched={touched.amount_prestation} A
error={errors.amount_prestation} error={errors.amount_prestation}
/> />
@ -1384,7 +1412,11 @@ const SaisirFeuilleSoinScreen = ({
<TouchableOpacity <TouchableOpacity
style={[ style={[
styles.contentActionModalBottom, styles.contentActionModalBottom,
{borderBottomColor: Color.borderColor, width: "100%",flexDirection: 'column',}, {
borderBottomColor: Color.borderColor,
width: "100%",
flexDirection: 'column',
},
]} ]}
key={item.id} key={item.id}
onPress={() => { onPress={() => {
@ -1569,13 +1601,13 @@ const SaisirFeuilleSoinScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
I18n.t('YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION'), I18n.t('YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION'),
);*/ );*/
} else { } else {
fetchCreateConsultation({ fetchCreateConsultation({
insured_id: assure.insured_id, insured_id: assure.insured_id,
@ -1603,7 +1635,7 @@ const SaisirFeuilleSoinScreen = ({
case 0: case 0:
console.log("values", values); console.log("values", values);
dispatch(fetchGetUserByNameOrNumberReset()); dispatch(fetchGetUserByNameOrNumberReset());
if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) { if (values.numero_assure !== '' && getUserByNameOrNumber.result === null) {
if (isNumeroAssureSearch) if (isNumeroAssureSearch)
fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`); fetchGetUserByNameOrNumber(wallet.id_network, `&insured_id=${values.numero_assure}`);
else if (isPhoneAssureSearch) else if (isPhoneAssureSearch)

View File

@ -3,8 +3,6 @@ import {
Alert, Alert,
Dimensions, Dimensions,
FlatList, FlatList,
Image,
Keyboard,
KeyboardAvoidingView, KeyboardAvoidingView,
Platform, Platform,
ScrollView, ScrollView,
@ -17,38 +15,35 @@ import Modal from 'react-native-modal';
import {Formik} from 'formik'; import {Formik} from 'formik';
import * as Yup from 'yup'; import * as Yup from 'yup';
import * as Utils from '../../../utils/UtilsFunction'; import * as Utils from '../../../utils/UtilsFunction';
import {displayToast} from '../../../utils/UtilsFunction';
import {Color} from "../../../config/Color"; import {Color} from "../../../config/Color";
import I18n from 'react-native-i18n'; import I18n from 'react-native-i18n';
import {ScreenComponent} from "../../../components/ScreenComponent"; import {ScreenComponent} from "../../../components/ScreenComponent";
import TextInput from '../../../components/TextInput';
import Text from '../../../components/Text'; import Text from '../../../components/Text';
import PasswordInput from '../../../components/PasswordInput'; import PasswordInput from '../../../components/PasswordInput';
import Button from "../../../components/Button"; import Button from "../../../components/Button";
import FontAwesome from "react-native-vector-icons/FontAwesome"; import FontAwesome from "react-native-vector-icons/FontAwesome";
import {responsiveWidth} from "react-native-responsive-dimensions"; import {responsiveWidth} from "react-native-responsive-dimensions";
import SwitchSelector from "react-native-switch-selector";
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
import { import {
fetchAddBeneficiaryToSubscription, fetchAddBeneficiaryToSubscription,
fetchAddBeneficiaryToSubscriptionReset, fetchDeleteBeneficiary, fetchDeleteBeneficiaryReset, fetchAddBeneficiaryToSubscriptionReset,
fetchDeleteBeneficiary,
fetchDeleteBeneficiaryReset,
fetchGetInsurancePrimeAmount, fetchGetInsurancePrimeAmount,
fetchGetListInsurance, fetchGetListInsurance,
fetchGetListInsuranceReset, fetchGetListInsuranceReset,
fetchGetSubscriptionList, fetchGetSubscriptionList,
fetchGetSubscriptionListReset, fetchGetSubscriptionListReset,
fetchSubscribeInsurance, fetchSubscribeInsurance,
fetchSubscribeInsuranceReset, fetchUploadInsurance
fetchUploadInsurance,
fetchUploadInsuranceReset
} from "../../../redux/insurance/insurance.actions"; } from "../../../redux/insurance/insurance.actions";
import DropdownAlert from "react-native-dropdownalert"; import DropdownAlert from "react-native-dropdownalert";
import {readUser} from "../../../webservice/AuthApi"; import {readUser} from "../../../webservice/AuthApi";
import ImagePicker from "react-native-image-crop-picker";
import DateTimePicker from "@react-native-community/datetimepicker";
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import {createStructuredSelector} from "reselect"; import {createStructuredSelector} from "reselect";
import { import {
selectAddBeneficiaryToSubscription, selectDeleteBeneficiary, selectAddBeneficiaryToSubscription,
selectDeleteBeneficiary,
selectInsuranceList, selectInsuranceList,
selectInsurancePrimeAmount, selectInsurancePrimeAmount,
selectSubscribeInsurance, selectSubscribeInsurance,
@ -58,7 +53,6 @@ import {
import {Dropdown} from "react-native-material-dropdown"; import {Dropdown} from "react-native-material-dropdown";
import Icon from "react-native-vector-icons/FontAwesome5"; import Icon from "react-native-vector-icons/FontAwesome5";
import {displayToast} from "../../../utils/UtilsFunction";
let moment = require('moment-timezone'); let moment = require('moment-timezone');
@ -202,14 +196,14 @@ const styles = StyleSheet.create({
}); });
const DeleteBeneficiaryScreen = ({ const DeleteBeneficiaryScreen = ({
fetchAddBeneficiaryToSubscription, fetchAddBeneficiaryToSubscription,
addBeneficiaryToSubscription, addBeneficiaryToSubscription,
fetchGetSubscriptionList, fetchGetSubscriptionList,
fetchDeleteBeneficiary, fetchDeleteBeneficiary,
subscriptionList, subscriptionList,
deleteBeneficiary, deleteBeneficiary,
navigation navigation
}) => { }) => {
const [user, setUser] = useState(null); const [user, setUser] = useState(null);
const [insurance, setInsurance] = useState(null); const [insurance, setInsurance] = useState(null);
@ -260,14 +254,14 @@ const DeleteBeneficiaryScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(subscriptionList), Utils.getErrorMsg(subscriptionList),
); );
dispatch(fetchGetListInsuranceReset());*/ dispatch(fetchGetListInsuranceReset());*/
} }
}, [subscriptionList]); }, [subscriptionList]);
@ -300,14 +294,14 @@ const DeleteBeneficiaryScreen = ({
} }
} }
], ],
{ cancelable: false } {cancelable: false}
); );
/* dropDownAlertRef.alertWithType( /* dropDownAlertRef.alertWithType(
'error', 'error',
I18n.t('ERROR_LABEL'), I18n.t('ERROR_LABEL'),
Utils.getErrorMsg(deleteBeneficiary), Utils.getErrorMsg(deleteBeneficiary),
); );
dispatch(fetchDeleteBeneficiaryReset());*/ dispatch(fetchDeleteBeneficiaryReset());*/
} }
}, [deleteBeneficiary]); }, [deleteBeneficiary]);
@ -339,6 +333,11 @@ const DeleteBeneficiaryScreen = ({
data={beneficiaries} data={beneficiaries}
extraData={beneficiaries} extraData={beneficiaries}
keyExtractor={(item, index) => index} keyExtractor={(item, index) => index}
ListEmptyComponent={() => {
return (
<Text>{I18n.t('NO_WALLET_HISTORY')}</Text>
)
}}
renderItem={({item, index}) => { renderItem={({item, index}) => {
console.log("Item", item); console.log("Item", item);
return ( return (
@ -356,34 +355,34 @@ const DeleteBeneficiaryScreen = ({
</Text> </Text>
</View> </View>
<View style={styles.iconRight}> <View style={styles.iconRight}>
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
Alert.alert( Alert.alert(
I18n.t("TITLE_SUPPRESS_CONFIRM"), I18n.t("TITLE_SUPPRESS_CONFIRM"),
I18n.t("TEXT_SUPPRESS_CONFIRM_BENEFICIARY"), I18n.t("TEXT_SUPPRESS_CONFIRM_BENEFICIARY"),
[ [
{ {
text: I18n.t("OK"), onPress: () => { text: I18n.t("OK"), onPress: () => {
setBeneficiariesToDelete([...beneficiariesToDelete, item.id]); setBeneficiariesToDelete([...beneficiariesToDelete, item.id]);
setBeneficiaries(beneficiaries.filter(beneficiary => beneficiary.id !== item.id)); setBeneficiaries(beneficiaries.filter(beneficiary => beneficiary.id !== item.id));
}
},
{
text: I18n.t("CANCEL_LABEL"), onPress: () => {
}
} }
], },
{cancelable: false} {
) text: I18n.t("CANCEL_LABEL"), onPress: () => {
}}>
<Icon }
name="minus-circle" }
size={24} ],
color={Color.grayColor} {cancelable: false}
/> )
</TouchableOpacity> }}>
<Icon
name="minus-circle"
size={24}
color={Color.grayColor}
/>
</TouchableOpacity>
</View> </View>
</View> </View>
); );
@ -394,7 +393,9 @@ const DeleteBeneficiaryScreen = ({
style={{marginTop: 20, marginBottom: 20}} style={{marginTop: 20, marginBottom: 20}}
full full
onPress={() => { onPress={() => {
displayToast(I18n.t('ENTER_PASSWORD_TO_VALID_MODIFICATION')); if (beneficiaries.length >= 1 && beneficiariesToDelete.length > 0)
displayToast(I18n.t('ENTER_PASSWORD_TO_VALID_MODIFICATION'));
setModalViewBeneficiariesVisible(false) setModalViewBeneficiariesVisible(false)
}}> }}>
{I18n.t('OK')} {I18n.t('OK')}
@ -551,4 +552,4 @@ export default connect(mapStateToProps, {
fetchDeleteBeneficiary fetchDeleteBeneficiary
})( })(
DeleteBeneficiaryScreen, DeleteBeneficiaryScreen,
); );

View File

@ -506,40 +506,40 @@ export const optionNanoSanteUserScreen = {
title: 'SUBSCRIBE_ASSURANCE', title: 'SUBSCRIBE_ASSURANCE',
screen: 'insuranceSubscriptionScreen', screen: 'insuranceSubscriptionScreen',
icon: 'file-medical', icon: 'file-medical',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
title: 'ADD_SUBSCRIBE', title: 'ADD_SUBSCRIBE',
screen: 'addBeneficiaryScreen', screen: 'addBeneficiaryScreen',
icon: "user-plus", icon: "user-plus",
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
title: 'ACTIVATE_INSSURANCE', title: 'ACTIVATE_INSSURANCE',
screen: 'activateBuySubscriptionScreen', screen: 'activateBuySubscriptionScreen',
icon: "check-circle", icon: "check-circle",
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
title: 'RENEW_INSSURANCE', title: 'RENEW_INSSURANCE',
screen: 'renewAssuranceScreen', screen: 'renewAssuranceScreen',
icon: "sync", icon: "sync",
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
screen: 'deleteBeneficiaryScreen', screen: 'deleteBeneficiaryScreen',
icon: 'user-minus', icon: 'user-minus',
title: 'DELETE_SUBSCRIBE', title: 'DELETE_SUBSCRIBE',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
screen: 'stopSubscriptionScreen', screen: 'stopSubscriptionScreen',
icon: 'hand-spock', icon: 'hand-spock',
title: 'STOP_SUBSCRIBE', title: 'STOP_SUBSCRIBE',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
] ]
@ -551,20 +551,20 @@ export const optionNanoSanteUserScreen = {
icon: 'book-medical', icon: 'book-medical',
title: 'DEMAND_AUTORIZATION_HEALTH', title: 'DEMAND_AUTORIZATION_HEALTH',
screen: 'demandeAutorisationSoinScreen', screen: 'demandeAutorisationSoinScreen',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
title: 'HISTORIC_HEALTH', title: 'HISTORIC_HEALTH',
screen: 'historiqueNanoSanteUserScreen', screen: 'historiqueNanoSanteUserScreen',
icon: 'history', icon: 'history',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
title: 'VALID_HEALTH', title: 'VALID_HEALTH',
screen: 'validateConsultationScreen', screen: 'validateConsultationScreen',
icon: 'check-circle', icon: 'check-circle',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
] ]
}, },
@ -649,38 +649,33 @@ export const optionNanoSanteAgentScreen = {
screen: route.saisirFeuilleSoinScreen, screen: route.saisirFeuilleSoinScreen,
icon: 'file-medical', icon: 'file-medical',
title: 'SAISIR_FEUILLE_SOIN', title: 'SAISIR_FEUILLE_SOIN',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
screen: route.executerPrescriptionScreen, screen: route.executerPrescriptionScreen,
icon: 'check-circle', icon: 'check-circle',
title: 'EXECUTER_PRESCRIPTION', title: 'EXECUTER_PRESCRIPTION',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
screen: route.modifierFeuilleSoinScreen, screen: route.modifierFeuilleSoinScreen,
icon: 'edit', icon: 'edit',
title: 'MODIFY_CONSULTATION', title: 'MODIFY_CONSULTATION',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
screen: route.modifierExecutionPrescriptionScreen, screen: route.modifierExecutionPrescriptionScreen,
icon: 'edit', icon: 'edit',
title: 'MODIFY_EXECUTION', title: 'MODIFY_EXECUTION',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {
screen: route.historiqueNanoSanteAgentScreen, screen: route.historiqueNanoSanteAgentScreen,
icon: 'history', icon: 'history',
title: 'HISTORY', title: 'HISTORY',
iconType:"FontAwesome5" iconType: "FontAwesome5"
}, },
{ {}
screen: route.createIdentification,
icon: 'user',
iconType:"FontAwesome5",
title: 'CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN',
}
] ]
} }

View File

@ -714,5 +714,6 @@
"HISTORY": "Historic", "HISTORY": "Historic",
"INFORMATION_MESSAGE": "Information message", "INFORMATION_MESSAGE": "Information message",
"MONTANT_ASSURANCE_CONSOMME": "Amount of insurance consumed", "MONTANT_ASSURANCE_CONSOMME": "Amount of insurance consumed",
"MONTANT_ASSURANCE_RESTANTE": "Amount of remaining insurance" "MONTANT_ASSURANCE_RESTANTE": "Amount of remaining insurance",
"NO_BENEFICIARY": "No beneficiary"
} }

View File

@ -716,5 +716,6 @@
"HISTORY": "Historique", "HISTORY": "Historique",
"INFORMATION_MESSAGE": "Message d'information", "INFORMATION_MESSAGE": "Message d'information",
"MONTANT_ASSURANCE_CONSOMME": "Montant de l'assurance consommé", "MONTANT_ASSURANCE_CONSOMME": "Montant de l'assurance consommé",
"MONTANT_ASSURANCE_RESTANTE": "Montant de l'assurance restante" "MONTANT_ASSURANCE_RESTANTE": "Montant de l'assurance restante",
"NO_BENEFICIARY": "Aucun ayant droit"
} }

View File

@ -88,7 +88,7 @@ export const facturerSoinUrl = testBaseUrl + '/nanoSanteService/generate-invoice
export const invoiceUrl = testBaseUrl + '/nanoSanteService/invoices'; export const invoiceUrl = testBaseUrl + '/nanoSanteService/invoices';
export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances'; export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances';
export const checkInsuranceCoverageAmountUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/check-insurance-coverage-amount'; export const checkInsuranceCoverageAmountUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/check-insurance-coverage-amount';
export const getUserByIdQRCodeUrl = testBaseUrl + '/nanoSanteService/qrcode/read'; export const getUserByIdQRCodeUrl = testBaseUrl + '/walletService/qrcode/read';
export const getUserByNameOrNumberUrl = testBaseUrl + '/nanoSanteService/insured'; export const getUserByNameOrNumberUrl = testBaseUrl + '/nanoSanteService/insured';
export const getDrugAndDevicesUrl = testBaseUrl + '/nanoSanteService/drugs-and-devices'; export const getDrugAndDevicesUrl = testBaseUrl + '/nanoSanteService/drugs-and-devices';
export const subscribeInsuranceUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions'; export const subscribeInsuranceUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions';