check coverage amount okÃ
This commit is contained in:
parent
7c73883e84
commit
38868291b8
22
App.js
22
App.js
|
@ -97,6 +97,10 @@ import DemandeAutorisationSoinScreen from "./screens/wallet/user/DemandeAutorisa
|
||||||
import DeleteBeneficiaryScreen from "./screens/wallet/user/DeleteBeneficiaryScreen";
|
import DeleteBeneficiaryScreen from "./screens/wallet/user/DeleteBeneficiaryScreen";
|
||||||
import StopSubscriptionScreen from "./screens/wallet/user/StopSubscriptionScreen";
|
import StopSubscriptionScreen from "./screens/wallet/user/StopSubscriptionScreen";
|
||||||
import RenewAssuranceScreen from "./screens/wallet/user/RenewAssuranceScreen";
|
import RenewAssuranceScreen from "./screens/wallet/user/RenewAssuranceScreen";
|
||||||
|
import WebviewScreen from "./screens/WebviewScreen";
|
||||||
|
import HistoriqueNanoSanteAgentScreen from "./screens/wallet/agent/HistoriqueNanoSanteAgentScreen";
|
||||||
|
import HistoriqueNanoSanteSuperHyperScreen from "./screens/wallet/agent/HistoriqueNanoSanteSuperHyperScreen";
|
||||||
|
import PDFViewerScreen from "./screens/PdfViewerScreen";
|
||||||
|
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
|
@ -220,7 +224,9 @@ const AppStack = createDrawerNavigator({
|
||||||
adhererGroupNanoCredit: AdhererGroupNanoCredit,
|
adhererGroupNanoCredit: AdhererGroupNanoCredit,
|
||||||
askNanoCredit: AskNanoCredit,
|
askNanoCredit: AskNanoCredit,
|
||||||
refundNanoCreditUser: RefundNanoCreditUser,
|
refundNanoCreditUser: RefundNanoCreditUser,
|
||||||
casserEpargneUser: CasserEpargneUser
|
casserEpargneUser: CasserEpargneUser,
|
||||||
|
webviewScreen: WebviewScreen,
|
||||||
|
PDFViewerScreen: PDFViewerScreen,
|
||||||
|
|
||||||
})
|
})
|
||||||
}, {
|
}, {
|
||||||
|
@ -233,6 +239,7 @@ const AppAgentStack = createDrawerNavigator({
|
||||||
sta: createStackNavigator({
|
sta: createStackNavigator({
|
||||||
home: Home,
|
home: Home,
|
||||||
useraccount: UserAccount,
|
useraccount: UserAccount,
|
||||||
|
webviewScreen: WebviewScreen,
|
||||||
walletSelect: WalletSelect,
|
walletSelect: WalletSelect,
|
||||||
createIdentification: CreateIdentification,
|
createIdentification: CreateIdentification,
|
||||||
validateIdentification: ValidateIdentification,
|
validateIdentification: ValidateIdentification,
|
||||||
|
@ -292,6 +299,8 @@ const AppAgentStack = createDrawerNavigator({
|
||||||
envoieWalletToBankAgent: EnvoieWalletToBankAgent,
|
envoieWalletToBankAgent: EnvoieWalletToBankAgent,
|
||||||
createGroupNanoCredit: CreateGroupNanoCredit,
|
createGroupNanoCredit: CreateGroupNanoCredit,
|
||||||
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
||||||
|
historiqueNanoSanteAgentScreen: HistoriqueNanoSanteAgentScreen,
|
||||||
|
PDFViewerScreen: PDFViewerScreen,
|
||||||
})
|
})
|
||||||
}, {
|
}, {
|
||||||
contentComponent: OptionsMenu,
|
contentComponent: OptionsMenu,
|
||||||
|
@ -344,7 +353,10 @@ const AppAdministratorStack = createDrawerNavigator({
|
||||||
about: About,
|
about: About,
|
||||||
walletDetail: WalletDetail,
|
walletDetail: WalletDetail,
|
||||||
walletDepot: WalletDepot,
|
walletDepot: WalletDepot,
|
||||||
walletRetrait: WalletRetrait
|
walletRetrait: WalletRetrait,
|
||||||
|
historiqueNanoSanteSuperHyperScreen: HistoriqueNanoSanteSuperHyperScreen,
|
||||||
|
webviewScreen: WebviewScreen,
|
||||||
|
PDFViewerScreen: PDFViewerScreen,
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -392,7 +404,11 @@ const AppSuperAdministrator = createDrawerNavigator({
|
||||||
about: About,
|
about: About,
|
||||||
walletDetail: WalletDetail,
|
walletDetail: WalletDetail,
|
||||||
walletDepot: WalletDepot,
|
walletDepot: WalletDepot,
|
||||||
walletRetrait: WalletRetrait
|
walletRetrait: WalletRetrait,
|
||||||
|
historiqueNanoSanteSuperHyperScreen: HistoriqueNanoSanteSuperHyperScreen,
|
||||||
|
webviewScreen: WebviewScreen,
|
||||||
|
PDFViewerScreen: PDFViewerScreen,
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}, {
|
}, {
|
||||||
|
|
|
@ -120,6 +120,14 @@ def jscFlavor = 'org.webkit:android-jsc:+'
|
||||||
def enableHermes = project.ext.react.get("enableHermes", false);
|
def enableHermes = project.ext.react.get("enableHermes", false);
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
packagingOptions {
|
||||||
|
pickFirst 'lib/x86/libc++_shared.so'
|
||||||
|
pickFirst 'lib/x86_64/libjsc.so'
|
||||||
|
pickFirst 'lib/arm64-v8a/libjsc.so'
|
||||||
|
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
||||||
|
pickFirst 'lib/x86_64/libc++_shared.so'
|
||||||
|
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
||||||
|
}
|
||||||
lintOptions { checkReleaseBuilds false }
|
lintOptions { checkReleaseBuilds false }
|
||||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -72,4 +72,6 @@
|
||||||
"executerPrescriptionScreen": "executerPrescriptionScreen",
|
"executerPrescriptionScreen": "executerPrescriptionScreen",
|
||||||
"modifierFeuilleSoinScreen": "modifierFeuilleSoinScreen",
|
"modifierFeuilleSoinScreen": "modifierFeuilleSoinScreen",
|
||||||
"modifierExecutionPrescriptionScreen": "modifierExecutionPrescriptionScreen",
|
"modifierExecutionPrescriptionScreen": "modifierExecutionPrescriptionScreen",
|
||||||
|
"historiqueNanoSanteAgentScreen": "historiqueNanoSanteAgentScreen",
|
||||||
|
"historiqueNanoSanteSuperHyperScreen": "historiqueNanoSanteSuperHyperScreen",
|
||||||
}
|
}
|
||||||
|
|
|
@ -662,7 +662,7 @@
|
||||||
"MEDICAMENT": "Médicament",
|
"MEDICAMENT": "Médicament",
|
||||||
"EXAMEN": "Examen",
|
"EXAMEN": "Examen",
|
||||||
"PRESTATION_SUCCESSFULLY_ADD": "Prestation ajouté avec succès",
|
"PRESTATION_SUCCESSFULLY_ADD": "Prestation ajouté avec succès",
|
||||||
"EXAMENS_SUCCESSFULLY_ADD": "Examens ajouté avec succès",
|
"EXAMENS_SUCCESSFULLY_ADD": "Examen ajouté avec succès",
|
||||||
"PRESCRIPTIONS_SUCCESSFULLY_ADD": "Prescription ajouté avec succès",
|
"PRESCRIPTIONS_SUCCESSFULLY_ADD": "Prescription ajouté avec succès",
|
||||||
"PRESCRIPTIONS_SUCCESSFULLY_MODIFY": "Prescription modifié avec succès",
|
"PRESCRIPTIONS_SUCCESSFULLY_MODIFY": "Prescription modifié avec succès",
|
||||||
"YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION": "Vous devez ajouter au moins une prestation",
|
"YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION": "Vous devez ajouter au moins une prestation",
|
||||||
|
@ -677,7 +677,7 @@
|
||||||
"PLEASE_SELECT_CONDITON_PRISE_CHARGE_FIRST": "Veuillez d'abord sélectionner la conditon de prise en charge",
|
"PLEASE_SELECT_CONDITON_PRISE_CHARGE_FIRST": "Veuillez d'abord sélectionner la conditon de prise en charge",
|
||||||
"CONSULTATION": "Consultation",
|
"CONSULTATION": "Consultation",
|
||||||
"STATE": "Etat",
|
"STATE": "Etat",
|
||||||
"INSTITUTE_NAME": "Nom de l'institut",
|
"INSTITUTE_NAME": "Nom de l'institution",
|
||||||
"ACCEPT": "Accepter",
|
"ACCEPT": "Accepter",
|
||||||
"REJECT": "Rejeter",
|
"REJECT": "Rejeter",
|
||||||
"DETAIL": "Détail",
|
"DETAIL": "Détail",
|
||||||
|
@ -709,5 +709,10 @@
|
||||||
"AGENT_VALIDEUR": "Agent valideur",
|
"AGENT_VALIDEUR": "Agent valideur",
|
||||||
"TEXT_SUPPRESS_CONFIRM_BENEFICIARY": "Voulez vous vraiment supprimer cet ayant droit ?",
|
"TEXT_SUPPRESS_CONFIRM_BENEFICIARY": "Voulez vous vraiment supprimer cet ayant droit ?",
|
||||||
"ENTER_PASSWORD_TO_VALID_MODIFICATION": "Renseigner votre mot de passe et valider la suppression de l'ayant pour le supprimé définitivement",
|
"ENTER_PASSWORD_TO_VALID_MODIFICATION": "Renseigner votre mot de passe et valider la suppression de l'ayant pour le supprimé définitivement",
|
||||||
"PLEASE_SELECT_AT_LEAST_ASSURE": "Veuillez sélectionner au moins un ayant droit"
|
"PLEASE_SELECT_AT_LEAST_ASSURE": "Veuillez sélectionner au moins un ayant droit",
|
||||||
|
"ID": "ID",
|
||||||
|
"INVOICE_ID": "ID facture",
|
||||||
|
"INVOICE": "Facture",
|
||||||
|
"HISTORY": "Historique",
|
||||||
|
"INFORMATION_MESSAGE": "Message d'information"
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {
|
||||||
|
LayoutAnimation,
|
||||||
|
Platform,
|
||||||
|
StyleProp,
|
||||||
|
StyleSheet,
|
||||||
|
TouchableOpacity,
|
||||||
|
UIManager,
|
||||||
|
View,
|
||||||
|
ViewStyle,
|
||||||
|
} from 'react-native';
|
||||||
|
import Text from './Text';
|
||||||
|
import Icon from './Icon';
|
||||||
|
|
||||||
|
interface AccordionItemComponentProps {
|
||||||
|
style?: StyleProp<ViewStyle> | undefined;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
open?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const AccordionItem = ({
|
||||||
|
title = '',
|
||||||
|
description = '',
|
||||||
|
open = false,
|
||||||
|
style = {},
|
||||||
|
...rest
|
||||||
|
}: AccordionItemComponentProps) => {
|
||||||
|
const [expanded, setExpanded] = useState(open);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
UIManager.setLayoutAnimationEnabledExperimental(true);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const toggleExpand = () => {
|
||||||
|
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
||||||
|
setExpanded(!expanded);
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderPackage = () => (
|
||||||
|
<View style={[styles.contain, {}, style]}>
|
||||||
|
<TouchableOpacity style={styles.packageTitleContent} onPress={toggleExpand} activeOpacity={0.9}>
|
||||||
|
<Text>
|
||||||
|
{title}
|
||||||
|
</Text>
|
||||||
|
<Icon
|
||||||
|
name={!expanded ? 'angle-down' : 'angle-up'}
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
{expanded && (
|
||||||
|
<Text body2 grayColor style={{marginTop: 10}}>
|
||||||
|
{description}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
return renderPackage();
|
||||||
|
};
|
||||||
|
export default AccordionItem;
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
contain: {
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
packageTitleContent: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
containItem: {
|
||||||
|
padding: 10,
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
serviceContentIcon: {
|
||||||
|
flexDirection: 'column',
|
||||||
|
alignItems: 'center',
|
||||||
|
paddingTop: 20,
|
||||||
|
},
|
||||||
|
});
|
File diff suppressed because it is too large
Load Diff
|
@ -34,6 +34,7 @@
|
||||||
"react-native-action-button": "^2.8.5",
|
"react-native-action-button": "^2.8.5",
|
||||||
"react-native-animatable": "^1.3.2",
|
"react-native-animatable": "^1.3.2",
|
||||||
"react-native-best-viewpager": "^1.0.4",
|
"react-native-best-viewpager": "^1.0.4",
|
||||||
|
"react-native-blob-util": "^0.14.0",
|
||||||
"react-native-blur-overlay": "^1.0.6",
|
"react-native-blur-overlay": "^1.0.6",
|
||||||
"react-native-bottom-sheet-behavior": "^2.0.0",
|
"react-native-bottom-sheet-behavior": "^2.0.0",
|
||||||
"react-native-calendario": "^0.2.10",
|
"react-native-calendario": "^0.2.10",
|
||||||
|
@ -66,6 +67,7 @@
|
||||||
"react-native-modal-datetime-picker": "^10.2.0",
|
"react-native-modal-datetime-picker": "^10.2.0",
|
||||||
"react-native-onesignal": "^3.9.0",
|
"react-native-onesignal": "^3.9.0",
|
||||||
"react-native-paper": "^2.16.0",
|
"react-native-paper": "^2.16.0",
|
||||||
|
"react-native-pdf": "^6.4.0",
|
||||||
"react-native-permissions": "^3.0.5",
|
"react-native-permissions": "^3.0.5",
|
||||||
"react-native-phone-call": "^1.0.9",
|
"react-native-phone-call": "^1.0.9",
|
||||||
"react-native-popup-dialog": "^0.18.3",
|
"react-native-popup-dialog": "^0.18.3",
|
||||||
|
|
|
@ -72,6 +72,7 @@ import {
|
||||||
TREAT_DEMAND_GROUP_RESET,
|
TREAT_DEMAND_GROUP_RESET,
|
||||||
TREAT_DEMAND_GROUP_SUCCESS
|
TREAT_DEMAND_GROUP_SUCCESS
|
||||||
} from "../types/NanoCreditType";
|
} from "../types/NanoCreditType";
|
||||||
|
import InsuranceActions from "../insurance/insurance.type";
|
||||||
|
|
||||||
export const fetchCreateGroupPending = () => ({
|
export const fetchCreateGroupPending = () => ({
|
||||||
type: CREATE_GROUP_PENDING
|
type: CREATE_GROUP_PENDING
|
||||||
|
@ -396,17 +397,46 @@ export const fetchGetNanoCreditUserHistoryInProgressReset = () => ({
|
||||||
export const fetchGetEpargneInProgressPending = () => ({
|
export const fetchGetEpargneInProgressPending = () => ({
|
||||||
type: GET_EPARGNE_HISTORY_PENDING_USER_PENDING
|
type: GET_EPARGNE_HISTORY_PENDING_USER_PENDING
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchGetEpargneInProgressSuccess = (res) => ({
|
export const fetchGetEpargneInProgressSuccess = (res) => ({
|
||||||
type: GET_EPARGNE_HISTORY_PENDING_USER_SUCCESS,
|
type: GET_EPARGNE_HISTORY_PENDING_USER_SUCCESS,
|
||||||
result: res,
|
result: res,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchGetEpargneInProgressError = (error) => ({
|
export const fetchGetEpargneInProgressError = (error) => ({
|
||||||
type: GET_EPARGNE_HISTORY_PENDING_USER_ERROR,
|
type: GET_EPARGNE_HISTORY_PENDING_USER_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchGetEpargneInProgressReset = () => ({
|
export const fetchGetEpargneInProgressReset = () => ({
|
||||||
type: GET_EPARGNE_HISTORY_PENDING_USER_RESET
|
type: GET_EPARGNE_HISTORY_PENDING_USER_RESET
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
export const fetchFacturerSoinPending = () => ({
|
||||||
|
type: InsuranceActions.FACTURER_SOINS_PENDING
|
||||||
|
});
|
||||||
|
export const fetchFacturerSoinSuccess = (res) => ({
|
||||||
|
type: InsuranceActions.FACTURER_SOINS_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
export const fetchFacturerSoinError = (error) => ({
|
||||||
|
type: InsuranceActions.FACTURER_SOINS_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
|
export const fetchFacturerSoinReset = () => ({
|
||||||
|
type: InsuranceActions.FACTURER_SOINS_RESET
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
export const fetchInvoiceHistoryPending = () => ({
|
||||||
|
type: InsuranceActions.INVOICE_HISTORY_PENDING
|
||||||
|
});
|
||||||
|
export const fetchInvoiceHistorySuccess = (res) => ({
|
||||||
|
type: InsuranceActions.INVOICE_HISTORY_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
export const fetchInvoiceHistoryError = (error) => ({
|
||||||
|
type: InsuranceActions.INVOICE_HISTORY_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
|
export const fetchInvoiceHistoryReset = () => ({
|
||||||
|
type: InsuranceActions.INVOICE_HISTORY_RESET
|
||||||
|
});
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
import InsuranceActions from './insurance.type';
|
import InsuranceActions from './insurance.type';
|
||||||
import {
|
import {
|
||||||
autorisationCareRequestUrl,
|
autorisationCareRequestUrl, checkInsuranceCoverageAmountUrl,
|
||||||
consultationUrl,
|
consultationUrl,
|
||||||
createConsultationUrl,
|
createConsultationUrl,
|
||||||
executionPrescriptionUrl,
|
executionPrescriptionUrl,
|
||||||
|
@ -18,7 +18,7 @@ import {
|
||||||
getNetworkActsUrl,
|
getNetworkActsUrl,
|
||||||
getProviderClassUrl,
|
getProviderClassUrl,
|
||||||
getUserByIdQRCodeUrl,
|
getUserByIdQRCodeUrl,
|
||||||
getUserByNameOrNumberUrl,
|
getUserByNameOrNumberUrl, invoiceUrl,
|
||||||
subscribeInsuranceUrl,
|
subscribeInsuranceUrl,
|
||||||
uploadInsuranceImagetUrl
|
uploadInsuranceImagetUrl
|
||||||
} from "../../webservice/IlinkConstants";
|
} from "../../webservice/IlinkConstants";
|
||||||
|
@ -540,7 +540,17 @@ export const fetchGetConsultationError = (error: any) => ({
|
||||||
export const fetchGetConsultation = (user_id, state = 'UNTREATED', typeParam = 'CONSULTATION', otherParam = '') => {
|
export const fetchGetConsultation = (user_id, state = 'UNTREATED', typeParam = 'CONSULTATION', otherParam = '') => {
|
||||||
console.log("user_id", user_id);
|
console.log("user_id", user_id);
|
||||||
return ApiAction({
|
return ApiAction({
|
||||||
url: `${consultationUrl}?user_id=${user_id}&state=${state}&type=${typeParam}${otherParam}`,
|
url: `${consultationUrl}?state=${state}&type=${typeParam}${user_id !== '' ? '&user_id=' + user_id : ''}${otherParam}`,
|
||||||
|
method: 'GET',
|
||||||
|
onLoading: fetchGetConsultationPending,
|
||||||
|
onSuccess: fetchGetConsultationSuccess,
|
||||||
|
onError: fetchGetConsultationError,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const fetchGetInvoiceHistory = (otherParam) => {
|
||||||
|
return ApiAction({
|
||||||
|
url: `${invoiceUrl}${otherParam}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
onLoading: fetchGetConsultationPending,
|
onLoading: fetchGetConsultationPending,
|
||||||
onSuccess: fetchGetConsultationSuccess,
|
onSuccess: fetchGetConsultationSuccess,
|
||||||
|
@ -719,3 +729,33 @@ export const fetchDeleteBeneficiary = (id, data) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/************************************************************/
|
||||||
|
export const fetchCheckInsuranceCoverageAmountPending = () => ({
|
||||||
|
type: InsuranceActions.CHECK_HEALTH_CARE_SHEET_PENDING,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchCheckInsuranceCoverageAmountReset = () => ({
|
||||||
|
type: InsuranceActions.CHECK_HEALTH_CARE_SHEET_RESET,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchCheckInsuranceCoverageAmountSuccess = (authkey: any) => ({
|
||||||
|
type: InsuranceActions.CHECK_HEALTH_CARE_SHEET_SUCCESS,
|
||||||
|
payload: authkey,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchCheckInsuranceCoverageAmountError = (error: any) => ({
|
||||||
|
type: InsuranceActions.CHECK_HEALTH_CARE_SHEET_ERROR,
|
||||||
|
payload: error,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchCheckInsuranceCoverageAmount = (data) => {
|
||||||
|
return ApiAction({
|
||||||
|
url: checkInsuranceCoverageAmountUrl,
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
onLoading: fetchCheckInsuranceCoverageAmountPending,
|
||||||
|
onSuccess: fetchCheckInsuranceCoverageAmountSuccess,
|
||||||
|
onError: fetchCheckInsuranceCoverageAmountError,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
|
@ -677,3 +677,94 @@ export const deleteBeneficiaryeducer = (state = INITIAL_STATE, action: Insurance
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const facturerSoinReducer = (state = INITIAL_STATE, action: InsuranceActions) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case InsuranceActions.FACTURER_SOINS_PENDING:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case InsuranceActions.FACTURER_SOINS_SUCCESS:
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case InsuranceActions.FACTURER_SOINS_ERROR:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
|
||||||
|
case InsuranceActions.FACTURER_SOINS_RESET:
|
||||||
|
return INITIAL_STATE;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return state
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const insuranceHistoryReducer = (state = INITIAL_STATE, action: InsuranceActions) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case InsuranceActions.INVOICE_HISTORY_PENDING:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case InsuranceActions.INVOICE_HISTORY_SUCCESS:
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case InsuranceActions.INVOICE_HISTORY_ERROR:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
|
||||||
|
case InsuranceActions.INVOICE_HISTORY_RESET:
|
||||||
|
return INITIAL_STATE;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return state
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const checkInsuranceCoverageAmountReducer = (state = INITIAL_STATE, action: InsuranceActions) => {
|
||||||
|
console.log("ACTION", action);
|
||||||
|
switch (action.type) {
|
||||||
|
case InsuranceActions.CHECK_HEALTH_CARE_SHEET_PENDING:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case InsuranceActions.CHECK_HEALTH_CARE_SHEET_SUCCESS:
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
result: action.payload.response,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case InsuranceActions.CHECK_HEALTH_CARE_SHEET_ERROR:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.payload
|
||||||
|
}
|
||||||
|
|
||||||
|
case InsuranceActions.CHECK_HEALTH_CARE_SHEET_RESET:
|
||||||
|
return INITIAL_STATE;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return state
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* Date: 13/09/2021
|
* Date: 13/09/2021
|
||||||
*/
|
*/
|
||||||
import {createSelector} from "reselect";
|
import {createSelector} from "reselect";
|
||||||
import {deleteBeneficiaryeducer} from "./insurance.reducer";
|
import {checkInsuranceCoverageAmountReducer, deleteBeneficiaryeducer, facturerSoinReducer} from "./insurance.reducer";
|
||||||
|
|
||||||
const selectInsuranceListReducer = (state) => state.insuranceList;
|
const selectInsuranceListReducer = (state) => state.insuranceList;
|
||||||
const selectSubscribeInsuranceReducer = (state) => state.subscribeInsurance;
|
const selectSubscribeInsuranceReducer = (state) => state.subscribeInsurance;
|
||||||
|
@ -30,6 +30,8 @@ const selectExecutionPrescriptionReducerReducer = (state) => state.executionPres
|
||||||
const selectModifyPrescriptionReducer = (state) => state.modifyPrescriptionReducer;
|
const selectModifyPrescriptionReducer = (state) => state.modifyPrescriptionReducer;
|
||||||
const selectDemandeAutorisationSoinReducer = (state) => state.demandeAutorisationSoinReducer;
|
const selectDemandeAutorisationSoinReducer = (state) => state.demandeAutorisationSoinReducer;
|
||||||
const selectDeleteBeneficiaryeducerReducer = (state) => state.deleteBeneficiaryeducer;
|
const selectDeleteBeneficiaryeducerReducer = (state) => state.deleteBeneficiaryeducer;
|
||||||
|
const selectFacturerSoinReducer = (state) => state.facturerSoinReducer;
|
||||||
|
const selectCheckInsuranceCoverageAmountReducer = (state) => state.checkInsuranceCoverageAmountReducer;
|
||||||
|
|
||||||
export const selectInsuranceList = createSelector(
|
export const selectInsuranceList = createSelector(
|
||||||
[selectInsuranceListReducer],
|
[selectInsuranceListReducer],
|
||||||
|
@ -130,3 +132,13 @@ export const selectDeleteBeneficiary = createSelector(
|
||||||
[selectDeleteBeneficiaryeducerReducer],
|
[selectDeleteBeneficiaryeducerReducer],
|
||||||
(deleteBeneficiary) => deleteBeneficiary
|
(deleteBeneficiary) => deleteBeneficiary
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const selectFacturerSoin = createSelector(
|
||||||
|
[selectFacturerSoinReducer],
|
||||||
|
(facturerSoin) => facturerSoin
|
||||||
|
);
|
||||||
|
|
||||||
|
export const selectCheckInsuranceCoverageAmount = createSelector(
|
||||||
|
[selectCheckInsuranceCoverageAmountReducer],
|
||||||
|
(checkInsuranceCoverageAmount) => checkInsuranceCoverageAmount
|
||||||
|
);
|
||||||
|
|
|
@ -115,5 +115,20 @@ const InsuranceActions = {
|
||||||
DELETE_BENEFICIARY_SUCCESS: 'DELETE_BENEFICIARY_SUCCESS',
|
DELETE_BENEFICIARY_SUCCESS: 'DELETE_BENEFICIARY_SUCCESS',
|
||||||
DELETE_BENEFICIARY_ERROR: 'DELETE_BENEFICIARY_ERROR',
|
DELETE_BENEFICIARY_ERROR: 'DELETE_BENEFICIARY_ERROR',
|
||||||
DELETE_BENEFICIARY_RESET: 'DELETE_BENEFICIARY_RESET',
|
DELETE_BENEFICIARY_RESET: 'DELETE_BENEFICIARY_RESET',
|
||||||
|
|
||||||
|
FACTURER_SOINS_PENDING: 'FACTURER_SOINS_PENDING',
|
||||||
|
FACTURER_SOINS_SUCCESS: 'FACTURER_SOINS_SUCCESS',
|
||||||
|
FACTURER_SOINS_ERROR: 'FACTURER_SOINS_ERROR',
|
||||||
|
FACTURER_SOINS_RESET: 'FACTURER_SOINS_RESET',
|
||||||
|
|
||||||
|
INVOICE_HISTORY_PENDING: 'INVOICE_HISTORY_PENDING',
|
||||||
|
INVOICE_HISTORY_SUCCESS: 'INVOICE_HISTORY_SUCCESS',
|
||||||
|
INVOICE_HISTORY_ERROR: 'INVOICE_HISTORY_ERROR',
|
||||||
|
INVOICE_HISTORY_RESET: 'INVOICE_HISTORY_RESET',
|
||||||
|
|
||||||
|
CHECK_HEALTH_CARE_SHEET_PENDING: 'CHECK_HEALTH_CARE_SHEET_PENDING',
|
||||||
|
CHECK_HEALTH_CARE_SHEET_SUCCESS: 'CHECK_HEALTH_CARE_SHEET_SUCCESS',
|
||||||
|
CHECK_HEALTH_CARE_SHEET_ERROR: 'CHECK_HEALTH_CARE_SHEET_ERROR',
|
||||||
|
CHECK_HEALTH_CARE_SHEET_RESET: 'CHECK_HEALTH_CARE_SHEET_RESET',
|
||||||
}
|
}
|
||||||
export default InsuranceActions;
|
export default InsuranceActions;
|
||||||
|
|
|
@ -54,10 +54,10 @@ import {
|
||||||
acceptOrRejectConsultationReducer,
|
acceptOrRejectConsultationReducer,
|
||||||
activatePaySubscriptionReducer,
|
activatePaySubscriptionReducer,
|
||||||
addBeneficiaryToSubscriptionReducer,
|
addBeneficiaryToSubscriptionReducer,
|
||||||
addDrugReducer,
|
addDrugReducer, checkInsuranceCoverageAmountReducer,
|
||||||
createConsultationReducer, deleteBeneficiaryeducer,
|
createConsultationReducer, deleteBeneficiaryeducer,
|
||||||
demandeAutorisationSoinReducer,
|
demandeAutorisationSoinReducer,
|
||||||
executionPrescriptionReducer,
|
executionPrescriptionReducer, facturerSoinReducer,
|
||||||
getAmountConsultationReducer,
|
getAmountConsultationReducer,
|
||||||
getConsultationReducer,
|
getConsultationReducer,
|
||||||
getDrugAppareilReducer,
|
getDrugAppareilReducer,
|
||||||
|
@ -66,7 +66,7 @@ import {
|
||||||
getProviderClassReducer,
|
getProviderClassReducer,
|
||||||
getSubscriptionListReducer,
|
getSubscriptionListReducer,
|
||||||
getUserByIdQRCodeReducer,
|
getUserByIdQRCodeReducer,
|
||||||
getUserByNameOrNumberReducer,
|
getUserByNameOrNumberReducer, insuranceHistoryReducer,
|
||||||
insuranceListReducer,
|
insuranceListReducer,
|
||||||
modifyPrescriptionReducer, stopSubscriptionReducer,
|
modifyPrescriptionReducer, stopSubscriptionReducer,
|
||||||
subscribeInsuranceReducer,
|
subscribeInsuranceReducer,
|
||||||
|
@ -179,7 +179,10 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
executionPrescriptionReducer: executionPrescriptionReducer,
|
executionPrescriptionReducer: executionPrescriptionReducer,
|
||||||
modifyPrescriptionReducer: modifyPrescriptionReducer,
|
modifyPrescriptionReducer: modifyPrescriptionReducer,
|
||||||
demandeAutorisationSoinReducer: demandeAutorisationSoinReducer,
|
demandeAutorisationSoinReducer: demandeAutorisationSoinReducer,
|
||||||
deleteBeneficiaryeducer: deleteBeneficiaryeducer
|
deleteBeneficiaryeducer: deleteBeneficiaryeducer,
|
||||||
|
facturerSoinReducer: facturerSoinReducer,
|
||||||
|
insuranceHistoryReducer: insuranceHistoryReducer,
|
||||||
|
checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
||||||
|
|
|
@ -72,4 +72,6 @@
|
||||||
"executerPrescriptionScreen": "executerPrescriptionScreen",
|
"executerPrescriptionScreen": "executerPrescriptionScreen",
|
||||||
"modifierFeuilleSoinScreen": "modifierFeuilleSoinScreen",
|
"modifierFeuilleSoinScreen": "modifierFeuilleSoinScreen",
|
||||||
"modifierExecutionPrescriptionScreen": "modifierExecutionPrescriptionScreen",
|
"modifierExecutionPrescriptionScreen": "modifierExecutionPrescriptionScreen",
|
||||||
|
"historiqueNanoSanteAgentScreen": "historiqueNanoSanteAgentScreen",
|
||||||
|
"historiqueNanoSanteSuperHyperScreen": "historiqueNanoSanteSuperHyperScreen",
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,100 @@
|
||||||
|
|
||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {ActivityIndicator, Dimensions, StyleSheet, View,} from 'react-native';
|
||||||
|
import WebView from 'react-native-webview';
|
||||||
|
import {connect, useDispatch} from 'react-redux';
|
||||||
|
import {createStructuredSelector} from 'reselect';
|
||||||
|
import {ScreenComponent} from "../components/ScreenComponent";
|
||||||
|
import Pdf from "react-native-pdf";
|
||||||
|
|
||||||
|
const PDFViewerScreen = ({
|
||||||
|
navigation,
|
||||||
|
route,
|
||||||
|
paypalValidPayment,
|
||||||
|
fetchPaypalValidPayment,
|
||||||
|
}: any) => {
|
||||||
|
let webviewRef = null;
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const [backButtonEnabled, setBackButtonEnabled] = useState(false);
|
||||||
|
const {url, title} = navigation.state.params;
|
||||||
|
|
||||||
|
console.log("URL loaded", url);
|
||||||
|
|
||||||
|
/* useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
const onBackPress = () => {
|
||||||
|
if (backButtonEnabled) {
|
||||||
|
webviewRef?.goBack();
|
||||||
|
} else {
|
||||||
|
navigation.goBack();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
BackHandler.addEventListener('hardwareBackPress', onBackPress);
|
||||||
|
return () =>
|
||||||
|
BackHandler.removeEventListener(
|
||||||
|
'hardwareBackPress',
|
||||||
|
onBackPress,
|
||||||
|
);
|
||||||
|
}, []),
|
||||||
|
);*/
|
||||||
|
|
||||||
|
|
||||||
|
const renderLoader = () => (
|
||||||
|
<ActivityIndicator size="small" />
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ScreenComponent>
|
||||||
|
<View style={styles.contain}>
|
||||||
|
<Pdf
|
||||||
|
source={{uri: url}}
|
||||||
|
onLoadComplete={(numberOfPages,filePath) => {
|
||||||
|
console.log(`Number of pages: ${numberOfPages}`);
|
||||||
|
}}
|
||||||
|
onPageChanged={(page,numberOfPages) => {
|
||||||
|
console.log(`Current page: ${page}`);
|
||||||
|
}}
|
||||||
|
onError={(error) => {
|
||||||
|
console.log(error);
|
||||||
|
}}
|
||||||
|
onPressLink={(uri) => {
|
||||||
|
console.log(`Link pressed: ${uri}`);
|
||||||
|
}}
|
||||||
|
style={styles.webview}/>
|
||||||
|
</View>
|
||||||
|
</ScreenComponent>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, null)(PDFViewerScreen);
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
contain: {
|
||||||
|
flex: 1,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
paddingLeft: 20,
|
||||||
|
paddingRight: 20,
|
||||||
|
},
|
||||||
|
contentModal: {
|
||||||
|
width: '100%',
|
||||||
|
borderRadius: 8,
|
||||||
|
padding: 8,
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
paddingVertical: 20,
|
||||||
|
},
|
||||||
|
contentAction: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
paddingTop: 24,
|
||||||
|
},
|
||||||
|
webview: {
|
||||||
|
height: Dimensions.get('window').height,
|
||||||
|
width: Dimensions.get('window').width,
|
||||||
|
},
|
||||||
|
});
|
|
@ -0,0 +1,98 @@
|
||||||
|
|
||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {ActivityIndicator, Dimensions, StyleSheet, View,} from 'react-native';
|
||||||
|
import WebView from 'react-native-webview';
|
||||||
|
import {connect, useDispatch} from 'react-redux';
|
||||||
|
import {createStructuredSelector} from 'reselect';
|
||||||
|
import {ScreenComponent} from "../components/ScreenComponent";
|
||||||
|
|
||||||
|
const WebviewScreen = ({
|
||||||
|
navigation,
|
||||||
|
route,
|
||||||
|
paypalValidPayment,
|
||||||
|
fetchPaypalValidPayment,
|
||||||
|
}: any) => {
|
||||||
|
let webviewRef = null;
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const [backButtonEnabled, setBackButtonEnabled] = useState(false);
|
||||||
|
const {url, title} = navigation.state.params;
|
||||||
|
|
||||||
|
console.log("URL loaded", url);
|
||||||
|
|
||||||
|
/* useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
const onBackPress = () => {
|
||||||
|
if (backButtonEnabled) {
|
||||||
|
webviewRef?.goBack();
|
||||||
|
} else {
|
||||||
|
navigation.goBack();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
BackHandler.addEventListener('hardwareBackPress', onBackPress);
|
||||||
|
return () =>
|
||||||
|
BackHandler.removeEventListener(
|
||||||
|
'hardwareBackPress',
|
||||||
|
onBackPress,
|
||||||
|
);
|
||||||
|
}, []),
|
||||||
|
);*/
|
||||||
|
|
||||||
|
|
||||||
|
const renderLoader = () => (
|
||||||
|
<ActivityIndicator size="small" />
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ScreenComponent>
|
||||||
|
<View style={styles.contain}>
|
||||||
|
<WebView
|
||||||
|
source={{uri: url}}
|
||||||
|
style={styles.webview}
|
||||||
|
ref={ref => {
|
||||||
|
webviewRef = ref;
|
||||||
|
}}
|
||||||
|
javaScriptEnabled
|
||||||
|
domStorageEnabled
|
||||||
|
onNavigationStateChange={webViewState => {
|
||||||
|
setBackButtonEnabled(true);
|
||||||
|
}}
|
||||||
|
renderLoading={renderLoader}
|
||||||
|
startInLoadingState
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</ScreenComponent>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, null)(WebviewScreen);
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
contain: {
|
||||||
|
flex: 1,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
paddingLeft: 20,
|
||||||
|
paddingRight: 20,
|
||||||
|
},
|
||||||
|
contentModal: {
|
||||||
|
width: '100%',
|
||||||
|
borderRadius: 8,
|
||||||
|
padding: 8,
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
paddingVertical: 20,
|
||||||
|
},
|
||||||
|
contentAction: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
paddingTop: 24,
|
||||||
|
},
|
||||||
|
webview: {
|
||||||
|
height: Dimensions.get('window').height,
|
||||||
|
width: Dimensions.get('window').width,
|
||||||
|
},
|
||||||
|
});
|
|
@ -688,6 +688,9 @@ class CreateIdentification extends Component {
|
||||||
<View style={styles.contentSwitch}>
|
<View style={styles.contentSwitch}>
|
||||||
<SwitchSelector options={this.state.sexe}
|
<SwitchSelector options={this.state.sexe}
|
||||||
initial={0}
|
initial={0}
|
||||||
|
style={{
|
||||||
|
width: responsiveWidth(40),
|
||||||
|
}}
|
||||||
buttonColor={Color.accentColor}
|
buttonColor={Color.accentColor}
|
||||||
backgroundColor={Color.primaryDarkColor}
|
backgroundColor={Color.primaryDarkColor}
|
||||||
textColor='white'
|
textColor='white'
|
||||||
|
|
|
@ -274,7 +274,8 @@ export default class OptionsMenu extends Component {
|
||||||
|| item === 'epargnerArgentUser' || item === 'askNanoCredit' || item === 'casserEpargneUser' || item === 'envoieWalletToBankAgent' || item === 'reattachAccountUser' || item === 'insuranceSubscriptionScreen'
|
|| item === 'epargnerArgentUser' || item === 'askNanoCredit' || item === 'casserEpargneUser' || item === 'envoieWalletToBankAgent' || item === 'reattachAccountUser' || item === 'insuranceSubscriptionScreen'
|
||||||
|| item === 'addBeneficiaryScreen' || item === 'activateBuySubscriptionScreen' || item === 'saisirFeuilleSoinScreen' || item === 'validateConsultationScreen' || item === 'validateConsultationDetailScreen'
|
|| item === 'addBeneficiaryScreen' || item === 'activateBuySubscriptionScreen' || item === 'saisirFeuilleSoinScreen' || item === 'validateConsultationScreen' || item === 'validateConsultationDetailScreen'
|
||||||
|| item === 'executerPrescriptionScreen' || item === 'modifierFeuilleSoinScreen' || item === 'modifierExecutionPrescriptionScreen' || item === 'historiqueNanoSanteUserScreen'
|
|| item === 'executerPrescriptionScreen' || item === 'modifierFeuilleSoinScreen' || item === 'modifierExecutionPrescriptionScreen' || item === 'historiqueNanoSanteUserScreen'
|
||||||
|| item === 'demandeAutorisationSoinScreen' || item === 'deleteBeneficiaryScreen' || item === 'StopSubscriptionScreen' || item === 'stopSubscriptionScreen' || item === 'renewAssuranceScreen') {
|
|| item === 'demandeAutorisationSoinScreen' || item === 'deleteBeneficiaryScreen' || item === 'StopSubscriptionScreen' || item === 'stopSubscriptionScreen' || item === 'renewAssuranceScreen'
|
||||||
|
|| item === 'webviewScreen' || item === 'historiqueNanoSanteAgentScreen' || item === 'historiqueNanoSanteSuperHyperScreen' || item === 'PDFViewerScreen') {
|
||||||
return null
|
return null
|
||||||
} else {
|
} else {
|
||||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||||
|
|
|
@ -61,6 +61,10 @@ import {
|
||||||
} from '../../webservice/WalletTransactionHistoryApi';
|
} from '../../webservice/WalletTransactionHistoryApi';
|
||||||
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 _ from "lodash";
|
||||||
|
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||||
|
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
|
||||||
|
|
||||||
let moment = require('moment-timezone');
|
let moment = require('moment-timezone');
|
||||||
const thousands = require('thousands');
|
const thousands = require('thousands');
|
||||||
|
@ -89,6 +93,7 @@ class WalletDetail extends Component {
|
||||||
displayModalHistory: false,
|
displayModalHistory: false,
|
||||||
displaySuperHyperModalHistory: false,
|
displaySuperHyperModalHistory: false,
|
||||||
historyItemDetail: null,
|
historyItemDetail: null,
|
||||||
|
user: null
|
||||||
};
|
};
|
||||||
|
|
||||||
this.renderContent = null;
|
this.renderContent = null;
|
||||||
|
@ -170,7 +175,7 @@ class WalletDetail extends Component {
|
||||||
this.props.getHyperSuperTransactionHistoryAction(user.network_id, true);
|
this.props.getHyperSuperTransactionHistoryAction(user.network_id, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.setState({});
|
this.setState({user});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -471,7 +476,7 @@ class WalletDetail extends Component {
|
||||||
justifyContent: 'flex-end'
|
justifyContent: 'flex-end'
|
||||||
}}>
|
}}>
|
||||||
<Text style={[Typography.headline, Typography.semibold]} numberOfLines={1}>{wallet.network}</Text>
|
<Text style={[Typography.headline, Typography.semibold]} numberOfLines={1}>{wallet.network}</Text>
|
||||||
<View style={{flexDirection: 'row'}}>
|
{!(wallet.type === "ilink_sante") && <View style={{flexDirection: 'row'}}>
|
||||||
|
|
||||||
<Tag primary
|
<Tag primary
|
||||||
icon={<Icon name='swap-horizontal' size={20} color={Color.whiteColor}
|
icon={<Icon name='swap-horizontal' size={20} color={Color.whiteColor}
|
||||||
|
@ -539,7 +544,7 @@ class WalletDetail extends Component {
|
||||||
{I18n.t('HISTORY')}
|
{I18n.t('HISTORY')}
|
||||||
|
|
||||||
</Tag>
|
</Tag>
|
||||||
</View>
|
</View>}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.contentLeftItem}>
|
<View style={styles.contentLeftItem}>
|
||||||
|
@ -1236,7 +1241,7 @@ class WalletDetail extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderSuperHyperHistoryTransaction = () => {
|
renderSuperHyperHistoryTransaction = (wallet) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -1259,7 +1264,34 @@ class WalletDetail extends Component {
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
) :
|
) : (wallet.type === "ilink_sante") ?
|
||||||
|
<View style={styles.transactionContainer}>
|
||||||
|
|
||||||
|
<View style={[styles.containerTouch]}>
|
||||||
|
<TouchableOpacity style={styles.contain}
|
||||||
|
onPress={() => {
|
||||||
|
this.props.navigation.push(route.historiqueNanoSanteSuperHyperScreen);
|
||||||
|
}}
|
||||||
|
activeOpacity={0.9}>
|
||||||
|
<Icon name='clock'
|
||||||
|
color={Color.primaryColor}
|
||||||
|
size={30}
|
||||||
|
style={styles.imageBanner}/>
|
||||||
|
|
||||||
|
<View style={[styles.content]}>
|
||||||
|
|
||||||
|
<View style={{paddingTop: 20,}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.headline, Typography.semibold]}>
|
||||||
|
{I18n.t('HISTORY')}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View> :
|
||||||
<>
|
<>
|
||||||
<View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
|
<View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
|
||||||
<Text
|
<Text
|
||||||
|
@ -1275,6 +1307,69 @@ class WalletDetail extends Component {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderItem = (options, isOneElement, index) => (
|
||||||
|
isOneElement ?
|
||||||
|
<>
|
||||||
|
<View key={index} style={[styles.containerTouch]}>
|
||||||
|
|
||||||
|
<TouchableOpacity style={styles.contain}
|
||||||
|
onPress={() => {
|
||||||
|
this.props.navigation.push(options.screen)
|
||||||
|
}}
|
||||||
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
|
<FontAwesome5 name={options.icon}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
size={24}
|
||||||
|
style={styles.imageBanner}/>
|
||||||
|
|
||||||
|
<View style={[styles.content]}>
|
||||||
|
|
||||||
|
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
|
||||||
|
<Text style={[Typography.headline, Typography.semibold]}>
|
||||||
|
{I18n.t(options.title)}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flex: 1}}/>
|
||||||
|
</> :
|
||||||
|
<>
|
||||||
|
<View style={[styles.containerTouch]}>
|
||||||
|
|
||||||
|
<TouchableOpacity style={styles.contain}
|
||||||
|
onPress={() => {
|
||||||
|
this.props.navigation.push(options.screen)
|
||||||
|
}}
|
||||||
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
|
<FontAwesome5 name={options.icon}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
size={24}
|
||||||
|
style={styles.imageBanner}/>
|
||||||
|
|
||||||
|
|
||||||
|
<View style={[styles.content]}>
|
||||||
|
|
||||||
|
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
|
||||||
|
<Text style={[Typography.headline, Typography.semibold]}>
|
||||||
|
{I18n.t(options.title)}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
renderDetailWallet = (wallet) => {
|
renderDetailWallet = (wallet) => {
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
@ -1326,7 +1421,7 @@ class WalletDetail extends Component {
|
||||||
<View
|
<View
|
||||||
style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
|
||||||
{this.renderAccountDetail(wallet)}
|
{!(wallet.type === "ilink_sante") && this.renderAccountDetail(wallet)}
|
||||||
|
|
||||||
{!this.isHomeRootView && (
|
{!this.isHomeRootView && (
|
||||||
<>
|
<>
|
||||||
|
@ -1337,41 +1432,22 @@ class WalletDetail extends Component {
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
{(wallet.type === "ilink_sante") &&
|
{(wallet.type === "ilink_sante") &&
|
||||||
<View style={styles.transactionContainer}>
|
chunk(optionNanoSanteAgentScreen.options, 2).map((item, index) => (
|
||||||
|
|
||||||
<View style={[styles.containerTouch]}>
|
<View key={index} style={styles.transactionContainer}>
|
||||||
<TouchableOpacity style={styles.contain}
|
{
|
||||||
onPress={() => {
|
item.length === 1 ?
|
||||||
this.props.navigation.push(route.walletOptionSelect, {
|
|
||||||
optionSelect: optionNanoSanteAgentScreen,
|
|
||||||
wallet,
|
|
||||||
lottie: {
|
|
||||||
source: require("./../../datas/json/cedit-cards.json"),
|
|
||||||
loop: true
|
|
||||||
},
|
|
||||||
isNanoSanteAgent: true
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
activeOpacity={0.9}>
|
|
||||||
<Icon name='heart-multiple'
|
|
||||||
color={Color.primaryColor}
|
|
||||||
size={30}
|
|
||||||
style={styles.imageBanner}/>
|
|
||||||
|
|
||||||
<View style={[styles.content]}>
|
item.map((wallet, i) => (
|
||||||
|
this.renderItem(wallet, true, i)
|
||||||
<View style={{paddingTop: 20,}}>
|
)) :
|
||||||
<Text
|
item.map((wallet, i) => (
|
||||||
style={[Typography.headline, Typography.semibold]}>
|
this.renderItem(wallet, false, i)
|
||||||
{I18n.t('NANO_SANTE')}
|
))
|
||||||
</Text>
|
}
|
||||||
</View>
|
</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") &&
|
||||||
<View style={styles.transactionContainer}>
|
<View style={styles.transactionContainer}>
|
||||||
|
@ -1609,8 +1685,10 @@ class WalletDetail extends Component {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!this.isHomeRootView && this.renderHistoryTransaction(wallet)}
|
{!this.isHomeRootView && (wallet.type === 'ilink_sante' && wallet.category !== 'geolocated') ?
|
||||||
{this.isHomeRootView && this.renderSuperHyperHistoryTransaction()}
|
this.renderHistoryTransaction(wallet)
|
||||||
|
: !this.isHomeRootView && this.renderHistoryTransaction(wallet) }
|
||||||
|
{this.isHomeRootView && this.renderSuperHyperHistoryTransaction(wallet)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1767,6 +1845,9 @@ class WalletDetail extends Component {
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
) :
|
) :
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
wallet.type !== 'ilink_sante' && (
|
||||||
<>
|
<>
|
||||||
<View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
|
<View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
|
||||||
<Text
|
<Text
|
||||||
|
@ -1777,6 +1858,9 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
{this.renderHistoryTransactionList(wallet)}
|
{this.renderHistoryTransactionList(wallet)}
|
||||||
</>
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator, Alert, FlatList,
|
||||||
Platform,
|
Platform,
|
||||||
ProgressBarAndroid,
|
ProgressBarAndroid,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
|
@ -35,7 +35,7 @@ import {
|
||||||
cutString,
|
cutString,
|
||||||
cutStringWithoutDot,
|
cutStringWithoutDot,
|
||||||
displayToast,
|
displayToast,
|
||||||
displayTransactionType,
|
displayTransactionType, nanoCreditHistoryLabel, nanoSanteHistoryLabel,
|
||||||
transactionHistoryIlinkLabel
|
transactionHistoryIlinkLabel
|
||||||
} from '../../utils/UtilsFunction';
|
} from '../../utils/UtilsFunction';
|
||||||
import chunk from 'lodash/chunk';
|
import chunk from 'lodash/chunk';
|
||||||
|
@ -52,7 +52,7 @@ import {store} from "../../redux/store";
|
||||||
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
|
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
|
||||||
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||||
import {
|
import {
|
||||||
fetchGetAmountConsultationReset,
|
fetchGetAmountConsultationReset, fetchGetConsultation,
|
||||||
fetchGetConsultationReset,
|
fetchGetConsultationReset,
|
||||||
fetchGetDrugAppareilReset,
|
fetchGetDrugAppareilReset,
|
||||||
fetchGetNetworkActsReset,
|
fetchGetNetworkActsReset,
|
||||||
|
@ -61,6 +61,17 @@ import {
|
||||||
fetchGetUserByIdQRCodeReset,
|
fetchGetUserByIdQRCodeReset,
|
||||||
fetchGetUserByNameOrNumberReset
|
fetchGetUserByNameOrNumberReset
|
||||||
} from "../../redux/insurance/insurance.actions";
|
} from "../../redux/insurance/insurance.actions";
|
||||||
|
import {
|
||||||
|
facturerSoinAction,
|
||||||
|
facturerSoinReset,
|
||||||
|
getInvoiceHistoryAction,
|
||||||
|
getInvoiceHistoryReset, getSoinHistoryAction
|
||||||
|
} from "../../webservice/NanoCreditApi";
|
||||||
|
import {facturerSoinReducer} from "../../redux/insurance/insurance.reducer";
|
||||||
|
import SpinnerOverlay from "../../components/SpinnerOverlayComponent";
|
||||||
|
import AccordionComponent from "../../components/AccordionComponent";
|
||||||
|
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||||
|
import {pdfViewerUrl} from "../../webservice/IlinkConstants";
|
||||||
|
|
||||||
const route = require('./../../route.json');
|
const route = require('./../../route.json');
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
|
@ -84,13 +95,21 @@ class WalletOptionSelect extends Component {
|
||||||
user: null,
|
user: null,
|
||||||
displayModalHistory: false,
|
displayModalHistory: false,
|
||||||
historyItemDetail: null,
|
historyItemDetail: null,
|
||||||
isDataHasLoaded: false
|
isDataHasLoaded: false,
|
||||||
|
historyResult: [],
|
||||||
|
page: 1,
|
||||||
|
loadMore: false,
|
||||||
|
historiqueDetailLabel: I18n.t('INVOICE')
|
||||||
}
|
}
|
||||||
console.log("WALLET OPTION PROPS", this.props);
|
console.log("WALLET OPTION PROPS", this.props);
|
||||||
|
console.log("WALLET OPTION STATE", this.state);
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||||
|
|
||||||
|
|
||||||
this.props.getNanoCreditAccountReset();
|
this.props.getNanoCreditAccountReset();
|
||||||
|
this.props.facturerSoinReset();
|
||||||
this.props.getNanoCreditUserHistoryReset();
|
this.props.getNanoCreditUserHistoryReset();
|
||||||
|
this.props.getInvoiceHistoryReset();
|
||||||
|
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
|
@ -99,8 +118,13 @@ class WalletOptionSelect extends Component {
|
||||||
this.props.getNanoCreditAccountAction(user.id);
|
this.props.getNanoCreditAccountAction(user.id);
|
||||||
this.props.getNanoCreditUserHistoryAction(user.id, true);
|
this.props.getNanoCreditUserHistoryAction(user.id, true);
|
||||||
} else {
|
} else {
|
||||||
if (user.category === 'geolocated')
|
if (user.category === 'geolocated') {
|
||||||
this.props.getNanoCreditUserHistoryAction(this.state.wallet.id, false);
|
this.props.getNanoCreditUserHistoryAction(this.state.wallet.id, false);
|
||||||
|
|
||||||
|
if(this.state.isNanoSanteAgent) {
|
||||||
|
this.props.getInvoiceHistoryAction(`?network_id=${user.network_id}&network_agent_id=${this.state.wallet.network_agent_id}&page=1&perPage=20`);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.setState({user});
|
this.setState({user});
|
||||||
}
|
}
|
||||||
|
@ -135,7 +159,7 @@ class WalletOptionSelect extends Component {
|
||||||
this.props.fetchGetProviderClassReset();
|
this.props.fetchGetProviderClassReset();
|
||||||
this.props.fetchGetConsultationReset();
|
this.props.fetchGetConsultationReset();
|
||||||
this.props.fetchGetNetworkActsReset();
|
this.props.fetchGetNetworkActsReset();
|
||||||
|
this.props.facturerSoinReset();
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -174,7 +198,43 @@ class WalletOptionSelect extends Component {
|
||||||
});
|
});
|
||||||
console.log("AFTER", this.props);
|
console.log("AFTER", this.props);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
const {resultInsuranceHistory, errorInsuranceHistory} = this.props;
|
||||||
|
|
||||||
|
if (errorInsuranceHistory !== null) {
|
||||||
|
if (typeof errorInsuranceHistory.data !== 'undefined') {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABEL"),
|
||||||
|
errorInsuranceHistory.data.error,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.getInvoiceHistoryReset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{cancelable: false}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resultInsuranceHistory !== null) {
|
||||||
|
if (resultInsuranceHistory.response !== null) {
|
||||||
|
if(this.state.page < resultInsuranceHistory.response.last_page) {
|
||||||
|
this.setState({
|
||||||
|
historyResult: this.state.historyResult.concat(resultInsuranceHistory.response.data)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(this.state.page === resultInsuranceHistory.response.last_page) {
|
||||||
|
this.setState({
|
||||||
|
page: this.state.page + 1,
|
||||||
|
historyResult: this.state.historyResult.concat(resultInsuranceHistory.response.data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,6 +338,19 @@ class WalletOptionSelect extends Component {
|
||||||
size={30}
|
size={30}
|
||||||
style={styles.imageBanner}/>
|
style={styles.imageBanner}/>
|
||||||
|
|
||||||
|
{
|
||||||
|
options.hasOwnProperty('iconType') ?
|
||||||
|
<FontAwesome5 name={options.icon}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
size={24}
|
||||||
|
style={styles.imageBanner}/>
|
||||||
|
: <Icon name={options.icon}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
size={24}
|
||||||
|
style={styles.imageBanner}/>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
<View style={[styles.content]}>
|
<View style={[styles.content]}>
|
||||||
|
|
||||||
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
|
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
|
||||||
|
@ -320,15 +393,16 @@ class WalletOptionSelect extends Component {
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
{
|
{
|
||||||
this.state.isNanoSanteAgent
|
options.hasOwnProperty('iconType') ?
|
||||||
? <FontAwesome name={options.icon}
|
<FontAwesome5 name={options.icon}
|
||||||
color={Color.primaryColor}
|
color={Color.primaryColor}
|
||||||
size={30}
|
size={24}
|
||||||
style={styles.imageBanner}/>
|
style={styles.imageBanner}/>
|
||||||
: <Icon name={options.icon}
|
: <Icon name={options.icon}
|
||||||
color={Color.primaryColor}
|
color={Color.primaryColor}
|
||||||
size={30}
|
size={24}
|
||||||
style={styles.imageBanner}/>
|
style={styles.imageBanner}/>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<View style={[styles.content]}>
|
<View style={[styles.content]}>
|
||||||
|
@ -436,7 +510,7 @@ class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
renderNanoSanteAccountDetail = (options) => (
|
renderNanoSanteAccountDetail = (options) => (
|
||||||
<>
|
<>
|
||||||
<View
|
{/* <View
|
||||||
style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
|
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
|
||||||
|
|
||||||
|
@ -509,7 +583,7 @@ class WalletOptionSelect extends Component {
|
||||||
}}>{I18n.t('ATTACH_ASSURANCE_CARD')}
|
}}>{I18n.t('ATTACH_ASSURANCE_CARD')}
|
||||||
</Tag>
|
</Tag>
|
||||||
|
|
||||||
</View>
|
</View>*/}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -590,6 +664,7 @@ class WalletOptionSelect extends Component {
|
||||||
}}
|
}}
|
||||||
primary
|
primary
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
this.props.facturerSoinAction(`?network_agent_id=${this.state.wallet.network_agent_id}`);
|
||||||
//this._scrollView.scrollToEnd();
|
//this._scrollView.scrollToEnd();
|
||||||
}}>{' ' + I18n.t('FACTURER_FEUILLES_SOINS')}
|
}}>{' ' + I18n.t('FACTURER_FEUILLES_SOINS')}
|
||||||
</Tag>
|
</Tag>
|
||||||
|
@ -616,7 +691,6 @@ class WalletOptionSelect extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (resultHistory !== null) {
|
if (resultHistory !== null) {
|
||||||
if (resultHistory.response !== null) {
|
if (resultHistory.response !== null) {
|
||||||
return (
|
return (
|
||||||
|
@ -695,6 +769,147 @@ class WalletOptionSelect extends Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderNanoSanteHistoryItem = (item, index) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TouchableOpacity onPress={() => {
|
||||||
|
this.setState({displayModalHistory: true, historyItemDetail: item})
|
||||||
|
}} style={[styles.contentService, {borderBottomColor: Color.primaryColor}]}>
|
||||||
|
{
|
||||||
|
Object.keys(omit(item, ['created_at', 'currency_code', 'file_url', 'health_care_sheets', 'institution_code', 'institutation_name', 'insured_amount', 'insurer_amount', 'invoice_id',
|
||||||
|
'network_agent_id', 'network_id', 'period_end_at','period_start_at','updated_at'])).map((element, i) => (
|
||||||
|
<View style={{alignItems: 'center'}} key={i}>
|
||||||
|
|
||||||
|
<Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
|
||||||
|
{item[element]}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleLoadMore = () => {
|
||||||
|
this.props.getInvoiceHistoryReset();
|
||||||
|
this.props.getInvoiceHistoryAction(`?network_id=${user.network_id}&insured_id=${user.agentId}&page=${this.state.page + 1}&perPage=20`);
|
||||||
|
this.setState({
|
||||||
|
page: this.state.page + 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
renderFooterLoader = () => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}
|
||||||
|
>
|
||||||
|
{Platform.OS === 'android'
|
||||||
|
?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<ProgressBarAndroid/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<ActivityIndicator size="small" color={'#ccc'}/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
renderNanoSanteHistoryList = () => {
|
||||||
|
|
||||||
|
const {loadingInsuranceHistory, errorInsuranceHistory, resultInsuranceHistory} = this.props;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.title3, Typography.semibold]}>
|
||||||
|
{`${I18n.t('HISTORY')} ${this.state.historiqueDetailLabel}`}
|
||||||
|
</Text>
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingBottom: 10}}>
|
||||||
|
<Tag primary
|
||||||
|
icon={<FontAwesome5 name='book-medical' size={20} color={Color.whiteColor}
|
||||||
|
style={{marginLeft: 15}}/>}
|
||||||
|
style={{
|
||||||
|
paddingRight: 10,
|
||||||
|
borderTopRightRadius: 0,
|
||||||
|
borderBottomRightRadius: 0,
|
||||||
|
borderRightWidth: 1,
|
||||||
|
borderRightColor: Color.whiteColor
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
this.setState({historiqueDetailLabel: I18n.t('INVOICE')});
|
||||||
|
readUser().then((user) => {
|
||||||
|
if (user) {
|
||||||
|
if (user !== undefined) {
|
||||||
|
if (user.category === 'geolocated')
|
||||||
|
this.props.getInvoiceHistoryAction(`?network_id=${user.network_id}&network_agent_id=${this.state.wallet.network_agent_id}&page=1&perPage=20`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}}/>
|
||||||
|
<Tag icon={<MaterialCommunityIcons name='medical-bag' size={20} color={Color.whiteColor}/>}
|
||||||
|
style={{ borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}}
|
||||||
|
primary
|
||||||
|
onPress={() => {
|
||||||
|
this.setState({historiqueDetailLabel: I18n.t('SOINS')});
|
||||||
|
this.props.getSoinHistoryAction(this.state.wallet.network_agent_id, 'ALL', '', '&pagination=true&page=1');
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
loadingInsuranceHistory ?
|
||||||
|
this.renderLoader() :
|
||||||
|
(<>
|
||||||
|
<View style={[styles.contentService, {borderBottomColor: Color.primaryColor}]}>
|
||||||
|
{
|
||||||
|
nanoSanteHistoryLabel().map((item, index) => (
|
||||||
|
<View style={{alignItems: 'center'}} key={index}>
|
||||||
|
<Icon name={item.icon} size={24} color={Color.primaryColor}/>
|
||||||
|
<Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
|
||||||
|
{I18n.t(item.label)}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<FlatList
|
||||||
|
style={{flex: 1}}
|
||||||
|
ListEmptyComponent={() => {
|
||||||
|
return (
|
||||||
|
<Text>{I18n.t('NO_WALLET_HISTORY')}</Text>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
data={this.state.historyResult}
|
||||||
|
keyExtractor={(item, index) => item.id}
|
||||||
|
renderItem={({item, index}) => (
|
||||||
|
this.renderNanoSanteHistoryItem(item)
|
||||||
|
)}
|
||||||
|
onEndReached={() => {
|
||||||
|
if (resultInsuranceHistory !== null) {
|
||||||
|
if (this.state.page < resultInsuranceHistory.response.last_page) {
|
||||||
|
this.setState({loadMore: true});
|
||||||
|
this.handleLoadMore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onEndReachedThreshold={0.5}
|
||||||
|
ListFooterComponent={resultInsuranceHistory !== null ? this.state.page < resultInsuranceHistory.response.last_page ? this.renderFooterLoader() : null : null}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
renderModalHistoryDetail = () => {
|
renderModalHistoryDetail = () => {
|
||||||
const {historyItemDetail} = this.state;
|
const {historyItemDetail} = this.state;
|
||||||
|
|
||||||
|
@ -957,6 +1172,101 @@ class WalletOptionSelect extends Component {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
: historyItemDetail.hasOwnProperty('insured_amount') ?
|
||||||
|
<ScrollView persistentScrollbar={true}>
|
||||||
|
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('INVOICE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<TouchableOpacity onPress={()=>{
|
||||||
|
this.setState({
|
||||||
|
displayModalHistory: !this.state.displayModalHistory,
|
||||||
|
});
|
||||||
|
navigation.push('PDFViewerScreen', {url: `${historyItemDetail.file_url}`, title: ''});
|
||||||
|
}}>
|
||||||
|
<Text style={{color: "blue", textDecorationLine: 'underline', fontWeight: 'bold'}}>Facture.PDF</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('INVOICE_ID')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.invoice_id}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Date</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.created_at}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('MONTANT_ASSURANCE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.insured_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('MONTANT_ASSURE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.insurer_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('INSTITUTE_NAME')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.institution_name}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
this.state.historyItemDetail.health_care_sheets.map((history_care) => (
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<AccordionComponent
|
||||||
|
title={I18n.t('FEUILLE_SOIN')}
|
||||||
|
description={`${I18n.t('ID')}: ${history_care.health_care_sheet_id}\
|
||||||
|
${I18n.t('AMOUNT')}: ${history_care.amount}\
|
||||||
|
${I18n.t('MONTANT_ASSURANCE')}: ${history_care.insuredAmount}\
|
||||||
|
${I18n.t('MONTANT_ASSURE')}: ${history_care.insurerAmount}\
|
||||||
|
${I18n.t('PATIENT')}: ${history_care.patient_firstname} ${history_care.patient_lastname}\
|
||||||
|
${I18n.t('PRATICIEN')}: ${history_care.practitioner_firstname} ${history_care.practitioner_lastname}\
|
||||||
|
`}
|
||||||
|
open
|
||||||
|
style={{marginTop: 20, marginBottom: 10}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
: <ScrollView persistentScrollbar={true}>
|
: <ScrollView persistentScrollbar={true}>
|
||||||
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
@ -1108,6 +1418,32 @@ class WalletOptionSelect extends Component {
|
||||||
style={[Typography.title3, Typography.semibold]}>
|
style={[Typography.title3, Typography.semibold]}>
|
||||||
{I18n.t('TRANSACTION_HISTORY')}
|
{I18n.t('TRANSACTION_HISTORY')}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'flex-end', justifyContent: 'flex-end', paddingBottom: 10}}>
|
||||||
|
<Tag primary
|
||||||
|
icon={<FontAwesome5 name='book-medical' size={20} color={Color.whiteColor}
|
||||||
|
style={{marginLeft: 15}}/>}
|
||||||
|
style={{
|
||||||
|
paddingRight: 10,
|
||||||
|
width: 120,
|
||||||
|
borderTopRightRadius: 0,
|
||||||
|
borderBottomRightRadius: 0,
|
||||||
|
borderRightWidth: 1,
|
||||||
|
borderRightColor: Color.whiteColor
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
}}>
|
||||||
|
{` ${I18n.t('SOINS')}`}
|
||||||
|
</Tag>
|
||||||
|
<Tag icon={<MaterialCommunityIcons name='medical-bag' size={20} color={Color.whiteColor}/>}
|
||||||
|
style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}}
|
||||||
|
primary
|
||||||
|
onPress={() => {
|
||||||
|
}}>
|
||||||
|
{` ${I18n.t('SOUSCRIPTION')}`}
|
||||||
|
</Tag>
|
||||||
|
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1137,12 +1473,73 @@ class WalletOptionSelect extends Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderLoader = () => {
|
||||||
|
return (
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
{Platform.OS === 'android'
|
||||||
|
?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<ProgressBarAndroid/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<ActivityIndicator size="large" color={'#ccc'}/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDialogFacturerSoin = () => {
|
||||||
|
const {resultFacturerSoin, errorFacturerSoin} = this.props;
|
||||||
|
|
||||||
|
if (errorFacturerSoin !== null) {
|
||||||
|
if (typeof errorFacturerSoin.data !== 'undefined') {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("INFORMATION_MESSAGE"),
|
||||||
|
errorFacturerSoin.data.error,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.facturerSoinReset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{cancelable: false}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resultFacturerSoin !== null) {
|
||||||
|
if (resultFacturerSoin.response !== null) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("SUCCESS"),
|
||||||
|
resultFacturerSoin.response,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.facturerSoinReset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
{cancelable: false}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
!this.state.isDataHasLoaded && this.renderResultGetNanoCreditAccount();
|
!this.state.isDataHasLoaded && this.renderResultGetNanoCreditAccount();
|
||||||
return (
|
return (
|
||||||
<Provider>
|
<Provider>
|
||||||
<View style={{flex: 1}}>
|
<View style={{flex: 1}}>
|
||||||
|
<SpinnerOverlay show={this.props.loadingFacturerSoin} />
|
||||||
|
{(this.props.resultFacturerSoin !== null || this.props.errorFacturerSoin !== null) && this.renderDialogFacturerSoin()}
|
||||||
<StatusBar
|
<StatusBar
|
||||||
backgroundColor={Color.primaryDarkColor}
|
backgroundColor={Color.primaryDarkColor}
|
||||||
barStyle="light-content"
|
barStyle="light-content"
|
||||||
|
@ -1187,7 +1584,6 @@ class WalletOptionSelect extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{
|
{
|
||||||
this.state.isNanoSante ?
|
this.state.isNanoSante ?
|
||||||
this.state.options.map((item) => (
|
this.state.options.map((item) => (
|
||||||
|
@ -1215,6 +1611,7 @@ class WalletOptionSelect extends Component {
|
||||||
</View>
|
</View>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
</>
|
</>
|
||||||
)) :
|
)) :
|
||||||
(<>
|
(<>
|
||||||
|
@ -1243,7 +1640,7 @@ class WalletOptionSelect extends Component {
|
||||||
}
|
}
|
||||||
</>)
|
</>)
|
||||||
}
|
}
|
||||||
|
{/*this.state.isNanoSanteAgent && this.renderNanoSanteHistoryList()*/}
|
||||||
|
|
||||||
{/* {
|
{/* {
|
||||||
isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_CREDIT')
|
isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_CREDIT')
|
||||||
|
@ -1253,7 +1650,6 @@ class WalletOptionSelect extends Component {
|
||||||
}*/}
|
}*/}
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
|
@ -1268,6 +1664,14 @@ const mapStateToProps = state => ({
|
||||||
loadingHistory: state.getNanoCreditHistoryUserReducer.loading,
|
loadingHistory: state.getNanoCreditHistoryUserReducer.loading,
|
||||||
resultHistory: state.getNanoCreditHistoryUserReducer.result,
|
resultHistory: state.getNanoCreditHistoryUserReducer.result,
|
||||||
errorHistory: state.getNanoCreditHistoryUserReducer.error,
|
errorHistory: state.getNanoCreditHistoryUserReducer.error,
|
||||||
|
|
||||||
|
loadingFacturerSoin: state.facturerSoinReducer.loading,
|
||||||
|
resultFacturerSoin: state.facturerSoinReducer.result,
|
||||||
|
errorFacturerSoin: state.facturerSoinReducer.error,
|
||||||
|
|
||||||
|
loadingInsuranceHistory: state.insuranceHistoryReducer.loading,
|
||||||
|
resultInsuranceHistory: state.insuranceHistoryReducer.result,
|
||||||
|
errorInsuranceHistory: state.insuranceHistoryReducer.error,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
@ -1285,6 +1689,14 @@ const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
fetchGetConsultationReset,
|
fetchGetConsultationReset,
|
||||||
fetchGetNetworkActsReset,
|
fetchGetNetworkActsReset,
|
||||||
|
|
||||||
|
facturerSoinReset,
|
||||||
|
facturerSoinAction,
|
||||||
|
|
||||||
|
getInvoiceHistoryAction,
|
||||||
|
getInvoiceHistoryReset,
|
||||||
|
|
||||||
|
getSoinHistoryAction,
|
||||||
|
|
||||||
getWalletDetailActivated,
|
getWalletDetailActivated,
|
||||||
getUserIdentificationAction,
|
getUserIdentificationAction,
|
||||||
getWalletTransactionHistoryUser
|
getWalletTransactionHistoryUser
|
||||||
|
|
|
@ -29,7 +29,7 @@ import Button from "../../../components/Button";
|
||||||
import {responsiveWidth} from "react-native-responsive-dimensions";
|
import {responsiveWidth} from "react-native-responsive-dimensions";
|
||||||
import {
|
import {
|
||||||
fetchAcceptRejectConsultationReset,
|
fetchAcceptRejectConsultationReset,
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription, fetchCheckInsuranceCoverageAmount, fetchCheckInsuranceCoverageAmountReset,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchCreateConsultationReset,
|
fetchCreateConsultationReset,
|
||||||
fetchExecutionPrescription,
|
fetchExecutionPrescription,
|
||||||
|
@ -50,7 +50,7 @@ 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,
|
selectActivatePaySubscription, selectCheckInsuranceCoverageAmount,
|
||||||
selectExecutionPrescription,
|
selectExecutionPrescription,
|
||||||
selectGetAmountConsultation,
|
selectGetAmountConsultation,
|
||||||
selectGetConsultation,
|
selectGetConsultation,
|
||||||
|
@ -247,6 +247,8 @@ const ExecuterPrescriptionScreen = ({
|
||||||
fetchGetProviderClass,
|
fetchGetProviderClass,
|
||||||
fetchGetConsultation,
|
fetchGetConsultation,
|
||||||
fetchExecutionPrescription,
|
fetchExecutionPrescription,
|
||||||
|
fetchCheckInsuranceCoverageAmount,
|
||||||
|
checkInsuranceCoverageAmount,
|
||||||
getConsultation,
|
getConsultation,
|
||||||
getUserByNameOrNumber,
|
getUserByNameOrNumber,
|
||||||
getUserByIdQRCode,
|
getUserByIdQRCode,
|
||||||
|
@ -279,6 +281,8 @@ const ExecuterPrescriptionScreen = ({
|
||||||
|
|
||||||
const [modalConsultation, setModalConsultation] = useState(false);
|
const [modalConsultation, setModalConsultation] = useState(false);
|
||||||
const [consultation, setConsultation] = useState(null);
|
const [consultation, setConsultation] = useState(null);
|
||||||
|
const [consultationClone, setConsultationClone] = useState(null);
|
||||||
|
|
||||||
|
|
||||||
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
||||||
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
||||||
|
@ -330,6 +334,7 @@ const ExecuterPrescriptionScreen = ({
|
||||||
dispatch(fetchGetProviderClassReset());
|
dispatch(fetchGetProviderClassReset());
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());
|
||||||
dispatch(fetchExecutionPrescriptionReset());
|
dispatch(fetchExecutionPrescriptionReset());
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
|
||||||
fetchGetProviderClass(wallet.id_network);
|
fetchGetProviderClass(wallet.id_network);
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -340,6 +345,8 @@ const ExecuterPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
}, [user]);
|
}, [user]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("getUserByNameOrNumber.result", getUserByNameOrNumber);
|
console.log("getUserByNameOrNumber.result", getUserByNameOrNumber);
|
||||||
if (getUserByNameOrNumber.result !== null) {
|
if (getUserByNameOrNumber.result !== null) {
|
||||||
|
@ -379,6 +386,50 @@ const ExecuterPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
}, [getUserByNameOrNumber]);
|
}, [getUserByNameOrNumber]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setModalPrice(false);
|
||||||
|
if (checkInsuranceCoverageAmount.result !== null) {
|
||||||
|
if (checkInsuranceCoverageAmount.result.response !== null) {
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkInsuranceCoverageAmount.error) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("INFORMATION_MESSAGE"),
|
||||||
|
Utils.getErrorMsg(checkInsuranceCoverageAmount),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
if(elementToSetPrice.examen) {
|
||||||
|
setConsultation({
|
||||||
|
...consultation,
|
||||||
|
exams: consultation.exams.map(exam => {
|
||||||
|
return elementToSetPrice.id === exam.id ? {
|
||||||
|
...exam,
|
||||||
|
unit_price: consultationClone.exams.filter(examen => examen.id === elementToSetPrice.id)[0].unit_price
|
||||||
|
} : exam;
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setConsultation({
|
||||||
|
...consultation,
|
||||||
|
prestations: consultation.prestations.map(presta => {
|
||||||
|
return elementToSetPrice.id === presta.id ? {
|
||||||
|
...presta,
|
||||||
|
unit_price: consultationClone.exams.filter(prestation => prestation.id === elementToSetPrice.id)[0].unit_price
|
||||||
|
} : presta;
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [checkInsuranceCoverageAmount]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (getConsultation.result !== null)
|
if (getConsultation.result !== null)
|
||||||
|
@ -498,6 +549,7 @@ const ExecuterPrescriptionScreen = ({
|
||||||
onSubmit={(values) => {
|
onSubmit={(values) => {
|
||||||
console.log("Value", elementToSetPrice);
|
console.log("Value", elementToSetPrice);
|
||||||
if (elementToSetPrice.examen) {
|
if (elementToSetPrice.examen) {
|
||||||
|
|
||||||
setConsultation({
|
setConsultation({
|
||||||
...consultation,
|
...consultation,
|
||||||
exams: consultation.exams.map(exam => {
|
exams: consultation.exams.map(exam => {
|
||||||
|
@ -507,19 +559,44 @@ const ExecuterPrescriptionScreen = ({
|
||||||
} : exam;
|
} : exam;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
fetchCheckInsuranceCoverageAmount({
|
||||||
|
insurance_id: assure.id,
|
||||||
|
beneficiary_id: beneficiary !== null ? beneficiary.id : null,
|
||||||
|
care_condition: consultation._care_condition,
|
||||||
|
act_action: "INSERT",
|
||||||
|
act_type: "EXAM",
|
||||||
|
exams: [
|
||||||
|
{
|
||||||
|
unit_price: values.price,
|
||||||
|
quantity: consultation.exams.filter(exam => elementToSetPrice.id === exam.id)[0].quantity
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setConsultation({
|
setConsultation({
|
||||||
...consultation,
|
...consultation,
|
||||||
prescriptions: consultation.prescriptions.map(exam => {
|
prescriptions: consultation.prescriptions.map(prescription => {
|
||||||
return elementToSetPrice.id === exam.id ? {
|
return elementToSetPrice.id === prescription.id ? {
|
||||||
...exam,
|
...prescription,
|
||||||
unit_price: values.price
|
unit_price: values.price
|
||||||
} : exam;
|
} : prescription;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
fetchCheckInsuranceCoverageAmount({
|
||||||
|
insurance_id: assure.id,
|
||||||
|
beneficiary_id: beneficiary !== null ? beneficiary.id : null,
|
||||||
|
care_condition: consultation._care_condition,
|
||||||
|
act_action: "INSERT",
|
||||||
|
act_type: "PRESCRIPTION",
|
||||||
|
prescriptions: [
|
||||||
|
{
|
||||||
|
unit_price: values.price,
|
||||||
|
quantity: consultation.prescriptions.filter(prescription => elementToSetPrice.id === prescription.id)[0].quantity
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setModalPrice(false);
|
|
||||||
}}>
|
}}>
|
||||||
|
|
||||||
{({
|
{({
|
||||||
|
@ -566,6 +643,7 @@ const ExecuterPrescriptionScreen = ({
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
loading={checkInsuranceCoverageAmount.loading}
|
||||||
full
|
full
|
||||||
style={{marginTop: 10, marginBottom: 20}}
|
style={{marginTop: 10, marginBottom: 20}}
|
||||||
onPress={handleSubmit}>
|
onPress={handleSubmit}>
|
||||||
|
@ -956,6 +1034,7 @@ const ExecuterPrescriptionScreen = ({
|
||||||
setModalListAssure(false);
|
setModalListAssure(false);
|
||||||
setModalConsultation(false);
|
setModalConsultation(false);
|
||||||
setConsultation(historyItemDetail);
|
setConsultation(historyItemDetail);
|
||||||
|
setConsultationClone(historyItemDetail);
|
||||||
//dispatch(fetchGetUserByNameOrNumberReset());
|
//dispatch(fetchGetUserByNameOrNumberReset());
|
||||||
wizard.current.next();
|
wizard.current.next();
|
||||||
}}/>
|
}}/>
|
||||||
|
@ -1527,6 +1606,7 @@ const mapStateToProps = createStructuredSelector({
|
||||||
getAmountConsultation: selectGetAmountConsultation,
|
getAmountConsultation: selectGetAmountConsultation,
|
||||||
executionPrescription: selectExecutionPrescription,
|
executionPrescription: selectExecutionPrescription,
|
||||||
getConsultation: selectGetConsultation,
|
getConsultation: selectGetConsultation,
|
||||||
|
checkInsuranceCoverageAmount: selectCheckInsuranceCoverageAmount
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
export default connect(mapStateToProps, {
|
||||||
|
@ -1537,7 +1617,8 @@ export default connect(mapStateToProps, {
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchGetAmountConsultation,
|
fetchGetAmountConsultation,
|
||||||
fetchGetConsultation,
|
fetchGetConsultation,
|
||||||
fetchExecutionPrescription
|
fetchExecutionPrescription,
|
||||||
|
fetchCheckInsuranceCoverageAmount
|
||||||
})(
|
})(
|
||||||
ExecuterPrescriptionScreen,
|
ExecuterPrescriptionScreen,
|
||||||
);
|
);
|
||||||
|
|
|
@ -0,0 +1,708 @@
|
||||||
|
/**
|
||||||
|
* Project iLinkWorld
|
||||||
|
* File HistoricNanoSanteUserScreen
|
||||||
|
* Path screens/wallet/user
|
||||||
|
* Created by BRICE ZELE
|
||||||
|
* Date: 26/01/2022
|
||||||
|
*/
|
||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {
|
||||||
|
ActivityIndicator, Alert,
|
||||||
|
Dimensions,
|
||||||
|
FlatList,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
import isNil from 'lodash/isNil';
|
||||||
|
import {connect, useDispatch} from 'react-redux';
|
||||||
|
import {Color} from "../../../config/Color";
|
||||||
|
import I18n from 'react-native-i18n';
|
||||||
|
import {ScreenComponent} from "../../../components/ScreenComponent";
|
||||||
|
import {
|
||||||
|
fetchAcceptRejectConsultation,
|
||||||
|
fetchAcceptRejectConsultationReset,
|
||||||
|
fetchActivePaySubscription, fetchDemaneAutorisationSoinReset,
|
||||||
|
fetchGetConsultation,
|
||||||
|
fetchGetConsultationReset, fetchGetDemandeAutorisationSoin, fetchGetInvoiceHistory,
|
||||||
|
fetchGetSubscription
|
||||||
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
|
import DropdownAlert from "react-native-dropdownalert";
|
||||||
|
import {createStructuredSelector} from "reselect";
|
||||||
|
import {
|
||||||
|
selectAcceptRefuseConsultation,
|
||||||
|
selectActivatePaySubscription, selectDemandeAutorisationSoin,
|
||||||
|
selectGetConsultation,
|
||||||
|
selectSubscriptionList
|
||||||
|
} from "../../../redux/insurance/insurance.selector";
|
||||||
|
import {readUser} from "../../../webservice/AuthApi";
|
||||||
|
import Text from '../../../components/Text';
|
||||||
|
import * as Utils from "../../../utils/UtilsFunction";
|
||||||
|
import {uppercaseFirstLetter} from "../../../utils/UtilsFunction";
|
||||||
|
import Dialog from "react-native-dialog";
|
||||||
|
import {Typography} from "../../../config/typography";
|
||||||
|
import Tag from "../../../components/Tag";
|
||||||
|
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
|
||||||
|
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||||
|
import {store} from "../../../redux/store";
|
||||||
|
import AccordionComponent from "../../../components/AccordionComponent";
|
||||||
|
import {pdfViewerUrl} from "../../../webservice/IlinkConstants";
|
||||||
|
|
||||||
|
|
||||||
|
let moment = require('moment-timezone');
|
||||||
|
|
||||||
|
const {width, height} = Dimensions.get('window');
|
||||||
|
|
||||||
|
const HistoriqueNanoSanteAgentScreen = ({
|
||||||
|
navigation,
|
||||||
|
fetchGetConsultation,
|
||||||
|
fetchGetSubscription,
|
||||||
|
fetchGetInvoiceHistory,
|
||||||
|
fetchGetDemandeAutorisationSoin,
|
||||||
|
fetchAcceptRejectConsultation,
|
||||||
|
acceptRefuseConsultation,
|
||||||
|
getConsultation
|
||||||
|
}) => {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const [user, setUser] = useState(null);
|
||||||
|
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
||||||
|
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
||||||
|
const [page, setPage] = useState(1);
|
||||||
|
const [historiqueDetailLabel, setHistoriqueDetailLabel] = useState(I18n.t('SOINS'));
|
||||||
|
const [loadMore, setLoadMore] = useState(false);
|
||||||
|
const [historyResult, setHistoryResult] = useState([]);
|
||||||
|
const [wallet] = useState(store.getState().walletDetailReducer.result.response);
|
||||||
|
|
||||||
|
|
||||||
|
let dropDownAlertRef: any = null;
|
||||||
|
|
||||||
|
function useForceUpdate() {
|
||||||
|
const [value, setValue] = useState(0); // integer state
|
||||||
|
return () => setValue(value => value + 1); // update the state to force render
|
||||||
|
}
|
||||||
|
const forceUpdate = useForceUpdate();
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
dispatch(fetchAcceptRejectConsultationReset());
|
||||||
|
readUser().then((user) => {
|
||||||
|
setUser(user);
|
||||||
|
console.log("User", user);
|
||||||
|
fetchGetConsultation('', 'ALL', '', `&network_id=${wallet.id_network}&network_agent_id=${wallet.network_agent_id}&pagination=true&page=1`);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
if (getConsultation.result !== null) {
|
||||||
|
|
||||||
|
if (page < getConsultation.result.response.last_page)
|
||||||
|
setHistoryResult(historyResult.concat(getConsultation.result.response.data));
|
||||||
|
|
||||||
|
if (page === getConsultation.result.response.last_page) {
|
||||||
|
console.log("Page", page === getConsultation.result.response.last_page);
|
||||||
|
setPage(page + 1);
|
||||||
|
console.log("historyResult.concat", historyResult.concat(getConsultation.result.response.data));
|
||||||
|
setHistoryResult(historyResult.concat(getConsultation.result.response.data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getConsultation.error) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
);
|
||||||
|
dispatch(fetchGetConsultationReset());*/
|
||||||
|
}
|
||||||
|
//forceUpdate();
|
||||||
|
}, [getConsultation]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log("historyResult", historyResult);
|
||||||
|
}, [historyResult]);
|
||||||
|
|
||||||
|
/* useEffect(() => {
|
||||||
|
if (acceptRefuseConsultation.result !== null) {
|
||||||
|
if(loadMore)
|
||||||
|
setHistoryResult(historyResult.concat(acceptRefuseConsultation.result.data.data.content));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (acceptRefuseConsultation.error) {
|
||||||
|
dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(acceptRefuseConsultation),
|
||||||
|
);
|
||||||
|
dispatch(fetchAcceptRejectConsultationReset());
|
||||||
|
setDisplayModalHistory(false);
|
||||||
|
if (user !== null)
|
||||||
|
fetchGetConsultation(user.id, 'UNTREATED');
|
||||||
|
}
|
||||||
|
}, [acceptRefuseConsultation]);*/
|
||||||
|
|
||||||
|
const handleLoadMore = () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
fetchGetConsultation('', 'ALL', '', `&network_id=${wallet.id_network}&network_agent_id=${wallet.network_agent_id}&pagination=true&pagination=true&page=${page + 1}`);
|
||||||
|
setPage(page + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const renderLoader = () => (
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
{Platform.OS === 'android'
|
||||||
|
?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<ProgressBarAndroid/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<ActivityIndicator size="large" color={'#ccc'}/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
|
||||||
|
const renderFooterLoader = () => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}
|
||||||
|
>
|
||||||
|
{Platform.OS === 'android'
|
||||||
|
?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<ProgressBarAndroid/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<ActivityIndicator size="small" color={'#ccc'}/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderModalHistoryDetail = () => (
|
||||||
|
<Dialog.Container useNativeDriver={true} visible={displayModalHistory}>
|
||||||
|
|
||||||
|
<Dialog.Title>{I18n.t('DETAIL') + ' ' + historiqueDetailLabel}</Dialog.Title>
|
||||||
|
|
||||||
|
{historyItemDetail.hasOwnProperty('exams') ?
|
||||||
|
|
||||||
|
<ScrollView persistentScrollbar={true}>
|
||||||
|
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('NETWORK')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.network.name}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('PATIENT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${historyItemDetail.patient_lastname} ${historyItemDetail.patient_firstname}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Situation</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.patient_situation.toLowerCase()}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('PRATICIEN')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${historyItemDetail.practitioner_lastname} ${historyItemDetail.practitioner_firstname}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('MONTANT_ASSURANCE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.insurance_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('MONTANT_ASSURE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.insured_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('CLASSE_PRESTATAIRE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.practitioner_provider_class.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('STATE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.state.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.type.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('CONDITION_PRISE_CHARGE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.care_condition.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('INSTITUTE_NAME')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.institution_name.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Date</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{moment(historyItemDetail.created_at).format('YYYY-MM-DD')}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('PRESTATION')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
{historyItemDetail.performances.map(performance => (
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${performance.act.name} \n ${performance.amount_formatted} ${!isNil(performance.home_visit_fees_formatted) ? '\n' + I18n.t('FRAIS_DEPLACEMENT')+': ' + performance.home_visit_fees_formatted : ''} \n${!isNil(performance.unit_price_formatted) ? 'P.U: ' + performance.unit_price_formatted + '\n P.T: ' +performance.total_price : ''}`}</Text>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('EXAMEN')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
{historyItemDetail.exams.map(exam => (
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${exam.quantity} ${exam.description} \n ${exam.act.name} \n ${!isNil(exam.unit_price_formatted) ? 'P.U: ' + exam.unit_price_formatted + '\n P.T: ' + exam.total_price : ''}`}</Text>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('MEDICAMENT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
{historyItemDetail.prescriptions.map(prescription => (
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${prescription.quantity} ${prescription.drug_or_device.name} \n ${prescription.dosage} \n ${!isNil(prescription.unit_price_formatted) ? 'P.U: ' + prescription.unit_price_formatted + '\n P.T: ' + prescription.total_price : ''}`}</Text>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
: <ScrollView persistentScrollbar={true}>
|
||||||
|
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('INVOICE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<TouchableOpacity onPress={()=>{
|
||||||
|
setDisplayModalHistory(!displayModalHistory);
|
||||||
|
navigation.push('PDFViewerScreen', {url: `${historyItemDetail.file_url}`, title: ''});
|
||||||
|
}}>
|
||||||
|
<Text style={{color: "blue", textDecorationLine: 'underline', fontWeight: 'bold'}}>Facture.PDF</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('INVOICE_ID')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.invoice_id}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Date</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.created_at}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('MONTANT_ASSURANCE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.insured_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('MONTANT_ASSURE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.insurer_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('INSTITUTE_NAME')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.institution_name}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
historyItemDetail.health_care_sheets.map((history_care) => (
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<AccordionComponent
|
||||||
|
title={I18n.t('FEUILLE_SOIN')}
|
||||||
|
description={`${I18n.t('ID')}: ${history_care.health_care_sheet_id}\
|
||||||
|
${I18n.t('AMOUNT')}: ${history_care.amount}\
|
||||||
|
${I18n.t('MONTANT_ASSURANCE')}: ${history_care.insuredAmount}\
|
||||||
|
${I18n.t('MONTANT_ASSURE')}: ${history_care.insurerAmount}\
|
||||||
|
${I18n.t('PATIENT')}: ${history_care.patient_firstname} ${history_care.patient_lastname}\
|
||||||
|
${I18n.t('PRATICIEN')}: ${history_care.practitioner_firstname} ${history_care.practitioner_lastname}\
|
||||||
|
`}
|
||||||
|
open
|
||||||
|
style={{marginTop: 20, marginBottom: 10}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
</ScrollView>}
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('OK')} onPress={() => {
|
||||||
|
setDisplayModalHistory(false);
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
{/* <Dialog.Button bold={true} label={I18n.t('REJECT')} onPress={() => {
|
||||||
|
fetchAcceptRejectConsultation({
|
||||||
|
health_care_sheet_id: historyItemDetail.id,
|
||||||
|
user_id: user.id,
|
||||||
|
action: "REJECT"
|
||||||
|
});
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('ACCEPT')} onPress={() => {
|
||||||
|
fetchAcceptRejectConsultation({
|
||||||
|
health_care_sheet_id: historyItemDetail.id,
|
||||||
|
user_id: user.id,
|
||||||
|
action: "ACCEPT"
|
||||||
|
});
|
||||||
|
}}/>*/}
|
||||||
|
|
||||||
|
</Dialog.Container>
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
const renderItem = (item) => (
|
||||||
|
item.hasOwnProperty('exams') ?
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[styles.content, {backgroundColor: Color.cardBackgroundColor}]}
|
||||||
|
onPress={() => {
|
||||||
|
setDisplayModalHistory(true);
|
||||||
|
setHistoryItemDetail(item);
|
||||||
|
/*navigation.navigate('validateConsultationDetailScreen', {
|
||||||
|
item
|
||||||
|
});*/
|
||||||
|
}}>
|
||||||
|
<View style={[styles.contentTop, {borderColor: Color.borderColor}]}>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-start'}}>
|
||||||
|
<Text caption1>{`${I18n.t('MONTANT_ASSURANCE')}: ${item.insured_amount}`}</Text>
|
||||||
|
<Text footnote light numberOfLines={1}>
|
||||||
|
{`${I18n.t('STATE')}: ${item.state.toLowerCase()}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
caption1>{`${I18n.t('NETWORK')}: ${item.network.name}`}</Text>
|
||||||
|
<Text footnote light numberOfLines={1}>
|
||||||
|
{`${I18n.t('AYANT_DROIT')}: ${item.patient_firstname} ${item.patient_lastname}\ (${item.patient_situation.toLowerCase()})`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View style={styles.contentBottom}>
|
||||||
|
<View style={styles.bottomLeft}>
|
||||||
|
<View style={{marginHorizontal: 5}}>
|
||||||
|
<Text caption1 semibold accentColor>
|
||||||
|
{`Type: ${item.type.toLowerCase()}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'flex-end'}}>
|
||||||
|
<Text caption1 semibold primaryColor>
|
||||||
|
{`Date: ${moment(item.created_at).format('YYYY-MM-DD')}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
:
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[styles.content, {backgroundColor: Color.cardBackgroundColor}]}
|
||||||
|
onPress={() => {
|
||||||
|
setDisplayModalHistory(true);
|
||||||
|
setHistoryItemDetail(item);
|
||||||
|
/*navigation.navigate('validateConsultationDetailScreen', {
|
||||||
|
item
|
||||||
|
});*/
|
||||||
|
}}>
|
||||||
|
<View style={{borderColor: Color.borderColor, flexDirection: "row",paddingBottom: 10, borderBottomWidth: 0.5}}>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-start'}}>
|
||||||
|
<Text caption1>{`${I18n.t('AMOUNT')}: ${item.amount}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[styles.contentTop, {borderColor: Color.borderColor}]}>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-start'}}>
|
||||||
|
<Text
|
||||||
|
caption1>{`${I18n.t('MONTANT_ASSURANCE')}: ${item.insured_amount}`}</Text>
|
||||||
|
<Text footnote light numberOfLines={1}>
|
||||||
|
{`${I18n.t('MONTANT_ASSURE')}: ${item.insurer_amount}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View style={styles.contentBottom}>
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'flex-start'}}>
|
||||||
|
<Text caption1 semibold primaryColor>
|
||||||
|
{`Date: ${moment(item.created_at).format('YYYY-MM-DD')}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ScreenComponent>
|
||||||
|
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
|
||||||
|
<View style={styles.contain}>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingBottom: 10}}>
|
||||||
|
<Tag primary
|
||||||
|
icon={<FontAwesome5 name='book-medical' size={20} color={Color.whiteColor}
|
||||||
|
style={{marginLeft: 15}}/>}
|
||||||
|
style={{
|
||||||
|
paddingRight: 10,
|
||||||
|
width: 120,
|
||||||
|
borderTopRightRadius: 0,
|
||||||
|
borderBottomRightRadius: 0,
|
||||||
|
borderRightWidth: 1,
|
||||||
|
borderRightColor: Color.whiteColor
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
setPage(1);
|
||||||
|
setLoadMore(false);
|
||||||
|
setHistoryResult([]);
|
||||||
|
setHistoriqueDetailLabel(I18n.t('SOINS'));
|
||||||
|
fetchGetConsultation('', 'ALL', '', `&network_id=${wallet.id_network}&network_agent_id=${wallet.network_agent_id}&pagination=true&page=1`);
|
||||||
|
|
||||||
|
}}>
|
||||||
|
{` ${I18n.t('SOINS')}`}
|
||||||
|
</Tag>
|
||||||
|
<Tag icon={<MaterialCommunityIcons name='file' size={20} color={Color.whiteColor}/>}
|
||||||
|
style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}}
|
||||||
|
primary
|
||||||
|
onPress={() => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
setPage(1);
|
||||||
|
setLoadMore(false);
|
||||||
|
setHistoryResult([]);
|
||||||
|
setHistoriqueDetailLabel(I18n.t('INVOICE'));
|
||||||
|
fetchGetInvoiceHistory(`?network_id=${wallet.id_network}&network_agent_id=${wallet.network_agent_id}&page=1&perPage=20`);
|
||||||
|
}}>
|
||||||
|
{` ${I18n.t('INVOICE')}`}
|
||||||
|
</Tag>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
|
||||||
|
|
||||||
|
{getConsultation.loading && !loadMore
|
||||||
|
? renderLoader()
|
||||||
|
: (
|
||||||
|
<FlatList
|
||||||
|
style={{flex: 1}}
|
||||||
|
ListEmptyComponent={() => {
|
||||||
|
return (
|
||||||
|
<Text>{I18n.t('NO_WALLET_HISTORY')}</Text>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
data={historyResult}
|
||||||
|
keyExtractor={(item, index) => item.id}
|
||||||
|
renderItem={({item, index}) => (
|
||||||
|
renderItem(item)
|
||||||
|
)}
|
||||||
|
onEndReached={() => {
|
||||||
|
if (getConsultation.result !== null) {
|
||||||
|
if (page < getConsultation.result.response.last_page) {
|
||||||
|
setLoadMore(true);
|
||||||
|
handleLoadMore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onEndReachedThreshold={0.5}
|
||||||
|
ListFooterComponent={getConsultation.result !== null ? page < getConsultation.result.response.last_page ? renderFooterLoader() : null : null}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{displayModalHistory && renderModalHistoryDetail()}
|
||||||
|
</View>
|
||||||
|
</ScreenComponent>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
subscriptionList: selectSubscriptionList,
|
||||||
|
activatePaySubscription: selectActivatePaySubscription,
|
||||||
|
getConsultation: selectGetConsultation,
|
||||||
|
acceptRefuseConsultation: selectAcceptRefuseConsultation
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, {
|
||||||
|
fetchActivePaySubscription,
|
||||||
|
fetchGetConsultation,
|
||||||
|
fetchAcceptRejectConsultation,
|
||||||
|
fetchGetSubscription,
|
||||||
|
fetchGetDemandeAutorisationSoin,
|
||||||
|
fetchGetInvoiceHistory
|
||||||
|
|
||||||
|
})(
|
||||||
|
HistoriqueNanoSanteAgentScreen,
|
||||||
|
);
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
textInput: {
|
||||||
|
height: 46,
|
||||||
|
backgroundColor: Color.fieldColor,
|
||||||
|
borderRadius: 5,
|
||||||
|
marginTop: 10,
|
||||||
|
padding: 10,
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
contentService: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
lineRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
paddingBottom: 20,
|
||||||
|
},
|
||||||
|
contain: {
|
||||||
|
marginTop: 20,
|
||||||
|
paddingBottom: 20,
|
||||||
|
paddingLeft: 10,
|
||||||
|
paddingRight: 10,
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
padding: 10,
|
||||||
|
marginBottom: 10,
|
||||||
|
borderRadius: 8
|
||||||
|
},
|
||||||
|
contentTop: {
|
||||||
|
flexDirection: "row",
|
||||||
|
paddingBottom: 10,
|
||||||
|
borderBottomWidth: 1
|
||||||
|
},
|
||||||
|
|
||||||
|
contentBottom: {
|
||||||
|
flexDirection: "row",
|
||||||
|
marginTop: 10,
|
||||||
|
justifyContent: "space-between"
|
||||||
|
},
|
||||||
|
bottomLeft: {flexDirection: "row", alignItems: "center"},
|
||||||
|
image: {width: 32, height: 32, marginRight: 10, borderRadius: 16},
|
||||||
|
blockView: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
},
|
||||||
|
});
|
|
@ -0,0 +1,709 @@
|
||||||
|
/**
|
||||||
|
* Project iLinkWorld
|
||||||
|
* File HistoricNanoSanteUserScreen
|
||||||
|
* Path screens/wallet/user
|
||||||
|
* Created by BRICE ZELE
|
||||||
|
* Date: 26/01/2022
|
||||||
|
*/
|
||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {
|
||||||
|
ActivityIndicator, Alert,
|
||||||
|
Dimensions,
|
||||||
|
FlatList,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
import isNil from 'lodash/isNil';
|
||||||
|
import {connect, useDispatch} from 'react-redux';
|
||||||
|
import {Color} from "../../../config/Color";
|
||||||
|
import I18n from 'react-native-i18n';
|
||||||
|
import {ScreenComponent} from "../../../components/ScreenComponent";
|
||||||
|
import {
|
||||||
|
fetchAcceptRejectConsultation,
|
||||||
|
fetchAcceptRejectConsultationReset,
|
||||||
|
fetchActivePaySubscription, fetchDemaneAutorisationSoinReset,
|
||||||
|
fetchGetConsultation,
|
||||||
|
fetchGetConsultationReset, fetchGetDemandeAutorisationSoin, fetchGetInvoiceHistory,
|
||||||
|
fetchGetSubscription
|
||||||
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
|
import DropdownAlert from "react-native-dropdownalert";
|
||||||
|
import {createStructuredSelector} from "reselect";
|
||||||
|
import {
|
||||||
|
selectAcceptRefuseConsultation,
|
||||||
|
selectActivatePaySubscription, selectDemandeAutorisationSoin,
|
||||||
|
selectGetConsultation,
|
||||||
|
selectSubscriptionList
|
||||||
|
} from "../../../redux/insurance/insurance.selector";
|
||||||
|
import {readUser} from "../../../webservice/AuthApi";
|
||||||
|
import Text from '../../../components/Text';
|
||||||
|
import * as Utils from "../../../utils/UtilsFunction";
|
||||||
|
import {uppercaseFirstLetter} from "../../../utils/UtilsFunction";
|
||||||
|
import Dialog from "react-native-dialog";
|
||||||
|
import {Typography} from "../../../config/typography";
|
||||||
|
import Tag from "../../../components/Tag";
|
||||||
|
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
|
||||||
|
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||||
|
import {store} from "../../../redux/store";
|
||||||
|
import AccordionComponent from "../../../components/AccordionComponent";
|
||||||
|
import {pdfViewerUrl} from "../../../webservice/IlinkConstants";
|
||||||
|
|
||||||
|
|
||||||
|
let moment = require('moment-timezone');
|
||||||
|
|
||||||
|
const {width, height} = Dimensions.get('window');
|
||||||
|
|
||||||
|
const HistoriqueNanoSanteSuperHyperScreen = ({
|
||||||
|
navigation,
|
||||||
|
fetchGetConsultation,
|
||||||
|
fetchGetSubscription,
|
||||||
|
fetchGetInvoiceHistory,
|
||||||
|
fetchGetDemandeAutorisationSoin,
|
||||||
|
fetchAcceptRejectConsultation,
|
||||||
|
acceptRefuseConsultation,
|
||||||
|
getConsultation
|
||||||
|
}) => {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const [user, setUser] = useState(null);
|
||||||
|
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
||||||
|
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
||||||
|
const [page, setPage] = useState(1);
|
||||||
|
const [historiqueDetailLabel, setHistoriqueDetailLabel] = useState(I18n.t('SOINS'));
|
||||||
|
const [loadMore, setLoadMore] = useState(false);
|
||||||
|
const [historyResult, setHistoryResult] = useState([]);
|
||||||
|
const [wallet] = useState(store.getState().walletDetailReducer.result.response);
|
||||||
|
|
||||||
|
|
||||||
|
let dropDownAlertRef: any = null;
|
||||||
|
|
||||||
|
function useForceUpdate() {
|
||||||
|
const [value, setValue] = useState(0); // integer state
|
||||||
|
return () => setValue(value => value + 1); // update the state to force render
|
||||||
|
}
|
||||||
|
const forceUpdate = useForceUpdate();
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
dispatch(fetchAcceptRejectConsultationReset());
|
||||||
|
readUser().then((user) => {
|
||||||
|
setUser(user);
|
||||||
|
console.log("User", user);
|
||||||
|
fetchGetConsultation('', 'ALL', '', `&network_id=${wallet.id_network}&pagination=true&page=1`);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
if (getConsultation.result !== null) {
|
||||||
|
|
||||||
|
if (page < getConsultation.result.response.last_page)
|
||||||
|
setHistoryResult(historyResult.concat(getConsultation.result.response.data));
|
||||||
|
|
||||||
|
if (page === getConsultation.result.response.last_page) {
|
||||||
|
console.log("Page", page === getConsultation.result.response.last_page);
|
||||||
|
setPage(page + 1);
|
||||||
|
console.log("historyResult.concat", historyResult.concat(getConsultation.result.response.data));
|
||||||
|
setHistoryResult(historyResult.concat(getConsultation.result.response.data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getConsultation.error) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
);
|
||||||
|
dispatch(fetchGetConsultationReset());*/
|
||||||
|
}
|
||||||
|
//forceUpdate();
|
||||||
|
}, [getConsultation]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log("historyResult", historyResult);
|
||||||
|
}, [historyResult]);
|
||||||
|
|
||||||
|
/* useEffect(() => {
|
||||||
|
if (acceptRefuseConsultation.result !== null) {
|
||||||
|
if(loadMore)
|
||||||
|
setHistoryResult(historyResult.concat(acceptRefuseConsultation.result.data.data.content));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (acceptRefuseConsultation.error) {
|
||||||
|
dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(acceptRefuseConsultation),
|
||||||
|
);
|
||||||
|
dispatch(fetchAcceptRejectConsultationReset());
|
||||||
|
setDisplayModalHistory(false);
|
||||||
|
if (user !== null)
|
||||||
|
fetchGetConsultation(user.id, 'UNTREATED');
|
||||||
|
}
|
||||||
|
}, [acceptRefuseConsultation]);*/
|
||||||
|
|
||||||
|
const handleLoadMore = () => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
fetchGetConsultation('', 'ALL', '', `&network_id=${wallet.id_network}&pagination=true&pagination=true&page=${page + 1}`);
|
||||||
|
|
||||||
|
setPage(page + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const renderLoader = () => (
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
{Platform.OS === 'android'
|
||||||
|
?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<ProgressBarAndroid/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<ActivityIndicator size="large" color={'#ccc'}/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
|
||||||
|
const renderFooterLoader = () => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}
|
||||||
|
>
|
||||||
|
{Platform.OS === 'android'
|
||||||
|
?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<ProgressBarAndroid/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<ActivityIndicator size="small" color={'#ccc'}/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderModalHistoryDetail = () => (
|
||||||
|
<Dialog.Container useNativeDriver={true} visible={displayModalHistory}>
|
||||||
|
|
||||||
|
<Dialog.Title>{I18n.t('DETAIL') + ' ' + historiqueDetailLabel}</Dialog.Title>
|
||||||
|
|
||||||
|
{historyItemDetail.hasOwnProperty('exams') ?
|
||||||
|
|
||||||
|
<ScrollView persistentScrollbar={true}>
|
||||||
|
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('NETWORK')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.network.name}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('PATIENT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${historyItemDetail.patient_lastname} ${historyItemDetail.patient_firstname}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Situation</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.patient_situation.toLowerCase()}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('PRATICIEN')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${historyItemDetail.practitioner_lastname} ${historyItemDetail.practitioner_firstname}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('MONTANT_ASSURANCE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.insurance_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('MONTANT_ASSURE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.insured_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('CLASSE_PRESTATAIRE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.practitioner_provider_class.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('STATE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.state.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.type.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('CONDITION_PRISE_CHARGE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.care_condition.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('INSTITUTE_NAME')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{uppercaseFirstLetter(historyItemDetail.institution_name.toLowerCase())}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Date</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{moment(historyItemDetail.created_at).format('YYYY-MM-DD')}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('PRESTATION')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
{historyItemDetail.performances.map(performance => (
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${performance.act.name} \n ${performance.amount_formatted} ${!isNil(performance.home_visit_fees_formatted) ? '\n' + I18n.t('FRAIS_DEPLACEMENT')+': ' + performance.home_visit_fees_formatted : ''} \n${!isNil(performance.unit_price_formatted) ? 'P.U: ' + performance.unit_price_formatted + '\n P.T: ' +performance.total_price : ''}`}</Text>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('EXAMEN')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
{historyItemDetail.exams.map(exam => (
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${exam.quantity} ${exam.description} \n ${exam.act.name} \n ${!isNil(exam.unit_price_formatted) ? 'P.U: ' + exam.unit_price_formatted + '\n P.T: ' + exam.total_price : ''}`}</Text>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('MEDICAMENT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
{historyItemDetail.prescriptions.map(prescription => (
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${prescription.quantity} ${prescription.drug_or_device.name} \n ${prescription.dosage} \n ${!isNil(prescription.unit_price_formatted) ? 'P.U: ' + prescription.unit_price_formatted + '\n P.T: ' + prescription.total_price : ''}`}</Text>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
: <ScrollView persistentScrollbar={true}>
|
||||||
|
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('INVOICE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<TouchableOpacity onPress={()=>{
|
||||||
|
setDisplayModalHistory(!displayModalHistory);
|
||||||
|
navigation.push('PDFViewerScreen', {url: `${historyItemDetail.file_url}`, title: ''});
|
||||||
|
}}>
|
||||||
|
<Text style={{color: "blue", textDecorationLine: 'underline', fontWeight: 'bold'}}>Facture.PDF</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('INVOICE_ID')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.invoice_id}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>Date</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.created_at}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('MONTANT_ASSURANCE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.insured_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('MONTANT_ASSURE')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.insurer_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('INSTITUTE_NAME')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.institution_name}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
historyItemDetail.health_care_sheets.map((history_care) => (
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<AccordionComponent
|
||||||
|
title={I18n.t('FEUILLE_SOIN')}
|
||||||
|
description={`${I18n.t('ID')}: ${history_care.health_care_sheet_id}\
|
||||||
|
${I18n.t('AMOUNT')}: ${history_care.amount}\
|
||||||
|
${I18n.t('MONTANT_ASSURANCE')}: ${history_care.insuredAmount}\
|
||||||
|
${I18n.t('MONTANT_ASSURE')}: ${history_care.insurerAmount}\
|
||||||
|
${I18n.t('PATIENT')}: ${history_care.patient_firstname} ${history_care.patient_lastname}\
|
||||||
|
${I18n.t('PRATICIEN')}: ${history_care.practitioner_firstname} ${history_care.practitioner_lastname}\
|
||||||
|
`}
|
||||||
|
open
|
||||||
|
style={{marginTop: 20, marginBottom: 10}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
</ScrollView>}
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('OK')} onPress={() => {
|
||||||
|
setDisplayModalHistory(false);
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
{/* <Dialog.Button bold={true} label={I18n.t('REJECT')} onPress={() => {
|
||||||
|
fetchAcceptRejectConsultation({
|
||||||
|
health_care_sheet_id: historyItemDetail.id,
|
||||||
|
user_id: user.id,
|
||||||
|
action: "REJECT"
|
||||||
|
});
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('ACCEPT')} onPress={() => {
|
||||||
|
fetchAcceptRejectConsultation({
|
||||||
|
health_care_sheet_id: historyItemDetail.id,
|
||||||
|
user_id: user.id,
|
||||||
|
action: "ACCEPT"
|
||||||
|
});
|
||||||
|
}}/>*/}
|
||||||
|
|
||||||
|
</Dialog.Container>
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
const renderItem = (item) => (
|
||||||
|
item.hasOwnProperty('exams') ?
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[styles.content, {backgroundColor: Color.cardBackgroundColor}]}
|
||||||
|
onPress={() => {
|
||||||
|
setDisplayModalHistory(true);
|
||||||
|
setHistoryItemDetail(item);
|
||||||
|
/*navigation.navigate('validateConsultationDetailScreen', {
|
||||||
|
item
|
||||||
|
});*/
|
||||||
|
}}>
|
||||||
|
<View style={[styles.contentTop, {borderColor: Color.borderColor}]}>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-start'}}>
|
||||||
|
<Text caption1>{`${I18n.t('MONTANT_ASSURANCE')}: ${item.insured_amount}`}</Text>
|
||||||
|
<Text footnote light numberOfLines={1}>
|
||||||
|
{`${I18n.t('STATE')}: ${item.state.toLowerCase()}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
caption1>{`${I18n.t('NETWORK')}: ${item.network.name}`}</Text>
|
||||||
|
<Text footnote light numberOfLines={1}>
|
||||||
|
{`${I18n.t('AYANT_DROIT')}: ${item.patient_firstname} ${item.patient_lastname}\ (${item.patient_situation.toLowerCase()})`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View style={styles.contentBottom}>
|
||||||
|
<View style={styles.bottomLeft}>
|
||||||
|
<View style={{marginHorizontal: 5}}>
|
||||||
|
<Text caption1 semibold accentColor>
|
||||||
|
{`Type: ${item.type.toLowerCase()}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'flex-end'}}>
|
||||||
|
<Text caption1 semibold primaryColor>
|
||||||
|
{`Date: ${moment(item.created_at).format('YYYY-MM-DD')}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
:
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[styles.content, {backgroundColor: Color.cardBackgroundColor}]}
|
||||||
|
onPress={() => {
|
||||||
|
setDisplayModalHistory(true);
|
||||||
|
setHistoryItemDetail(item);
|
||||||
|
/*navigation.navigate('validateConsultationDetailScreen', {
|
||||||
|
item
|
||||||
|
});*/
|
||||||
|
}}>
|
||||||
|
<View style={{borderColor: Color.borderColor, flexDirection: "row",paddingBottom: 10, borderBottomWidth: 0.5}}>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-start'}}>
|
||||||
|
<Text caption1>{`${I18n.t('AMOUNT')}: ${item.amount}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[styles.contentTop, {borderColor: Color.borderColor}]}>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-start'}}>
|
||||||
|
<Text
|
||||||
|
caption1>{`${I18n.t('MONTANT_ASSURANCE')}: ${item.insured_amount}`}</Text>
|
||||||
|
<Text footnote light numberOfLines={1}>
|
||||||
|
{`${I18n.t('MONTANT_ASSURE')}: ${item.insurer_amount}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View style={styles.contentBottom}>
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'flex-start'}}>
|
||||||
|
<Text caption1 semibold primaryColor>
|
||||||
|
{`Date: ${moment(item.created_at).format('YYYY-MM-DD')}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ScreenComponent>
|
||||||
|
<DropdownAlert ref={ref => (dropDownAlertRef = ref)}/>
|
||||||
|
<View style={styles.contain}>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingBottom: 10}}>
|
||||||
|
<Tag primary
|
||||||
|
icon={<FontAwesome5 name='book-medical' size={20} color={Color.whiteColor}
|
||||||
|
style={{marginLeft: 15}}/>}
|
||||||
|
style={{
|
||||||
|
paddingRight: 10,
|
||||||
|
width: 120,
|
||||||
|
borderTopRightRadius: 0,
|
||||||
|
borderBottomRightRadius: 0,
|
||||||
|
borderRightWidth: 1,
|
||||||
|
borderRightColor: Color.whiteColor
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
setPage(1);
|
||||||
|
setLoadMore(false);
|
||||||
|
setHistoryResult([]);
|
||||||
|
setHistoriqueDetailLabel(I18n.t('SOINS'));
|
||||||
|
fetchGetConsultation('', 'ALL', '', `&network_id=${wallet.id_network}&pagination=true&page=1`);
|
||||||
|
|
||||||
|
}}>
|
||||||
|
{` ${I18n.t('SOINS')}`}
|
||||||
|
</Tag>
|
||||||
|
<Tag icon={<MaterialCommunityIcons name='file' size={20} color={Color.whiteColor}/>}
|
||||||
|
style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}}
|
||||||
|
primary
|
||||||
|
onPress={() => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
setPage(1);
|
||||||
|
setLoadMore(false);
|
||||||
|
setHistoryResult([]);
|
||||||
|
setHistoriqueDetailLabel(I18n.t('INVOICE'));
|
||||||
|
fetchGetInvoiceHistory(`?network_id=${wallet.id_network}&page=1&perPage=20`);
|
||||||
|
}}>
|
||||||
|
{` ${I18n.t('INVOICE')}`}
|
||||||
|
</Tag>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
|
||||||
|
|
||||||
|
{getConsultation.loading && !loadMore
|
||||||
|
? renderLoader()
|
||||||
|
: (
|
||||||
|
<FlatList
|
||||||
|
style={{flex: 1}}
|
||||||
|
ListEmptyComponent={() => {
|
||||||
|
return (
|
||||||
|
<Text>{I18n.t('NO_WALLET_HISTORY')}</Text>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
data={historyResult}
|
||||||
|
keyExtractor={(item, index) => item.id}
|
||||||
|
renderItem={({item, index}) => (
|
||||||
|
renderItem(item)
|
||||||
|
)}
|
||||||
|
onEndReached={() => {
|
||||||
|
if (getConsultation.result !== null) {
|
||||||
|
if (page < getConsultation.result.response.last_page) {
|
||||||
|
setLoadMore(true);
|
||||||
|
handleLoadMore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onEndReachedThreshold={0.5}
|
||||||
|
ListFooterComponent={getConsultation.result !== null ? page < getConsultation.result.response.last_page ? renderFooterLoader() : null : null}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{displayModalHistory && renderModalHistoryDetail()}
|
||||||
|
</View>
|
||||||
|
</ScreenComponent>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
subscriptionList: selectSubscriptionList,
|
||||||
|
activatePaySubscription: selectActivatePaySubscription,
|
||||||
|
getConsultation: selectGetConsultation,
|
||||||
|
acceptRefuseConsultation: selectAcceptRefuseConsultation
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, {
|
||||||
|
fetchActivePaySubscription,
|
||||||
|
fetchGetConsultation,
|
||||||
|
fetchAcceptRejectConsultation,
|
||||||
|
fetchGetSubscription,
|
||||||
|
fetchGetDemandeAutorisationSoin,
|
||||||
|
fetchGetInvoiceHistory
|
||||||
|
|
||||||
|
})(
|
||||||
|
HistoriqueNanoSanteSuperHyperScreen,
|
||||||
|
);
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
textInput: {
|
||||||
|
height: 46,
|
||||||
|
backgroundColor: Color.fieldColor,
|
||||||
|
borderRadius: 5,
|
||||||
|
marginTop: 10,
|
||||||
|
padding: 10,
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
contentService: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
lineRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
paddingBottom: 20,
|
||||||
|
},
|
||||||
|
contain: {
|
||||||
|
marginTop: 20,
|
||||||
|
paddingBottom: 20,
|
||||||
|
paddingLeft: 10,
|
||||||
|
paddingRight: 10,
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
padding: 10,
|
||||||
|
marginBottom: 10,
|
||||||
|
borderRadius: 8
|
||||||
|
},
|
||||||
|
contentTop: {
|
||||||
|
flexDirection: "row",
|
||||||
|
paddingBottom: 10,
|
||||||
|
borderBottomWidth: 1
|
||||||
|
},
|
||||||
|
|
||||||
|
contentBottom: {
|
||||||
|
flexDirection: "row",
|
||||||
|
marginTop: 10,
|
||||||
|
justifyContent: "space-between"
|
||||||
|
},
|
||||||
|
bottomLeft: {flexDirection: "row", alignItems: "center"},
|
||||||
|
image: {width: 32, height: 32, marginRight: 10, borderRadius: 16},
|
||||||
|
blockView: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
},
|
||||||
|
});
|
|
@ -28,7 +28,7 @@ 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 {
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription, fetchCheckInsuranceCoverageAmount, fetchCheckInsuranceCoverageAmountReset,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchCreateConsultationReset,
|
fetchCreateConsultationReset,
|
||||||
fetchExecutionPrescription,
|
fetchExecutionPrescription,
|
||||||
|
@ -51,7 +51,7 @@ 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,
|
selectActivatePaySubscription, selectCheckInsuranceCoverageAmount,
|
||||||
selectExecutionPrescription,
|
selectExecutionPrescription,
|
||||||
selectGetAmountConsultation,
|
selectGetAmountConsultation,
|
||||||
selectGetConsultation,
|
selectGetConsultation,
|
||||||
|
@ -250,6 +250,8 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
fetchGetConsultation,
|
fetchGetConsultation,
|
||||||
fetchExecutionPrescription,
|
fetchExecutionPrescription,
|
||||||
fetchModifyPrescription,
|
fetchModifyPrescription,
|
||||||
|
fetchCheckInsuranceCoverageAmount,
|
||||||
|
checkInsuranceCoverageAmount,
|
||||||
modifyPrescription,
|
modifyPrescription,
|
||||||
getConsultation,
|
getConsultation,
|
||||||
getUserByNameOrNumber,
|
getUserByNameOrNumber,
|
||||||
|
@ -283,6 +285,7 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
|
|
||||||
const [modalConsultation, setModalConsultation] = useState(false);
|
const [modalConsultation, setModalConsultation] = useState(false);
|
||||||
const [consultation, setConsultation] = useState(null);
|
const [consultation, setConsultation] = useState(null);
|
||||||
|
const [consultationClone, setConsultationClone] = useState(null);
|
||||||
|
|
||||||
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
||||||
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
||||||
|
@ -450,6 +453,51 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
}
|
}
|
||||||
}, [modifyPrescription]);
|
}, [modifyPrescription]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setModalPrice(false);
|
||||||
|
if (checkInsuranceCoverageAmount.result !== null) {
|
||||||
|
if (checkInsuranceCoverageAmount.result.response !== null) {
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkInsuranceCoverageAmount.error) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("INFORMATION_MESSAGE"),
|
||||||
|
Utils.getErrorMsg(checkInsuranceCoverageAmount),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
if(elementToSetPrice.examen) {
|
||||||
|
setConsultation({
|
||||||
|
...consultation,
|
||||||
|
exams: consultation.exams.map(exam => {
|
||||||
|
return elementToSetPrice.id === exam.id ? {
|
||||||
|
...exam,
|
||||||
|
unit_price: consultationClone.exams.filter(examen => examen.id === elementToSetPrice.id)[0].unit_price
|
||||||
|
} : exam;
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setConsultation({
|
||||||
|
...consultation,
|
||||||
|
prestations: consultation.prestations.map(presta => {
|
||||||
|
return elementToSetPrice.id === presta.id ? {
|
||||||
|
...presta,
|
||||||
|
unit_price: consultationClone.exams.filter(prestation => prestation.id === elementToSetPrice.id)[0].unit_price
|
||||||
|
} : presta;
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [checkInsuranceCoverageAmount]);
|
||||||
|
|
||||||
const ExecuterPrescriptionSchema = Yup.object().shape({
|
const ExecuterPrescriptionSchema = 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')),
|
||||||
|
@ -511,6 +559,20 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
} : exam;
|
} : exam;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
fetchCheckInsuranceCoverageAmount({
|
||||||
|
insurance_id: assure.id,
|
||||||
|
beneficiary_id: beneficiary !== null ? beneficiary.id : null,
|
||||||
|
care_condition: consultation._care_condition,
|
||||||
|
act_id: consultation.exams.filter(exam => elementToSetPrice.id === exam.id)[0].act_id,
|
||||||
|
act_action: "UPDATE",
|
||||||
|
act_type: "EXAM",
|
||||||
|
exams: [
|
||||||
|
{
|
||||||
|
unit_price: values.price,
|
||||||
|
quantity: consultation.exams.filter(exam => elementToSetPrice.id === exam.id)[0].quantity
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setConsultation({
|
setConsultation({
|
||||||
...consultation,
|
...consultation,
|
||||||
|
@ -521,9 +583,21 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
} : exam;
|
} : exam;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
fetchCheckInsuranceCoverageAmount({
|
||||||
|
insurance_id: assure.id,
|
||||||
|
beneficiary_id: beneficiary !== null ? beneficiary.id : null,
|
||||||
|
care_condition: consultation._care_condition,
|
||||||
|
act_id: consultation.prescriptions.filter(prescription => elementToSetPrice.id === prescription.id)[0].act_id,
|
||||||
|
act_action: "UPDATE",
|
||||||
|
act_type: "PRESCRIPTION",
|
||||||
|
prescriptions: [
|
||||||
|
{
|
||||||
|
unit_price: values.price,
|
||||||
|
quantity: consultation.prescriptions.filter(prescription => elementToSetPrice.id === prescription.id)[0].quantity
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setModalPrice(false);
|
|
||||||
}}>
|
}}>
|
||||||
|
|
||||||
{({
|
{({
|
||||||
|
@ -570,6 +644,7 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
loading={checkInsuranceCoverageAmount.loading}
|
||||||
full
|
full
|
||||||
style={{marginTop: 10, marginBottom: 20}}
|
style={{marginTop: 10, marginBottom: 20}}
|
||||||
onPress={handleSubmit}>
|
onPress={handleSubmit}>
|
||||||
|
@ -960,6 +1035,7 @@ const ModifierExecutionPrescriptionScreen = ({
|
||||||
setModalListAssure(false);
|
setModalListAssure(false);
|
||||||
setModalConsultation(false);
|
setModalConsultation(false);
|
||||||
setConsultation(historyItemDetail);
|
setConsultation(historyItemDetail);
|
||||||
|
setConsultationClone(historyItemDetail);
|
||||||
setFieldValue(
|
setFieldValue(
|
||||||
'practitioner_firstname',
|
'practitioner_firstname',
|
||||||
historyItemDetail.practitioner_firstname,
|
historyItemDetail.practitioner_firstname,
|
||||||
|
@ -1533,8 +1609,8 @@ const mapStateToProps = createStructuredSelector({
|
||||||
getAmountConsultation: selectGetAmountConsultation,
|
getAmountConsultation: selectGetAmountConsultation,
|
||||||
executionPrescription: selectExecutionPrescription,
|
executionPrescription: selectExecutionPrescription,
|
||||||
getConsultation: selectGetConsultation,
|
getConsultation: selectGetConsultation,
|
||||||
modifyPrescription: selectModifyPrescription
|
modifyPrescription: selectModifyPrescription,
|
||||||
|
checkInsuranceCoverageAmount: selectCheckInsuranceCoverageAmount
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
export default connect(mapStateToProps, {
|
||||||
|
@ -1546,7 +1622,8 @@ export default connect(mapStateToProps, {
|
||||||
fetchGetAmountConsultation,
|
fetchGetAmountConsultation,
|
||||||
fetchGetConsultation,
|
fetchGetConsultation,
|
||||||
fetchExecutionPrescription,
|
fetchExecutionPrescription,
|
||||||
fetchModifyPrescription
|
fetchModifyPrescription,
|
||||||
|
fetchCheckInsuranceCoverageAmount
|
||||||
})(
|
})(
|
||||||
ModifierExecutionPrescriptionScreen,
|
ModifierExecutionPrescriptionScreen,
|
||||||
);
|
);
|
||||||
|
|
|
@ -29,7 +29,7 @@ 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 {
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription, fetchCheckInsuranceCoverageAmount, fetchCheckInsuranceCoverageAmountReset,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchCreateConsultationReset,
|
fetchCreateConsultationReset,
|
||||||
fetchExecutionPrescription,
|
fetchExecutionPrescription,
|
||||||
|
@ -55,7 +55,7 @@ import DropdownAlert from "react-native-dropdownalert";
|
||||||
import {readUser} from "../../../webservice/AuthApi";
|
import {readUser} from "../../../webservice/AuthApi";
|
||||||
import TextInput from "../../../components/TextInput";
|
import TextInput from "../../../components/TextInput";
|
||||||
import {
|
import {
|
||||||
selectActivatePaySubscription,
|
selectActivatePaySubscription, selectCheckInsuranceCoverageAmount,
|
||||||
selectExecutionPrescription,
|
selectExecutionPrescription,
|
||||||
selectGetAmountConsultation,
|
selectGetAmountConsultation,
|
||||||
selectGetConsultation,
|
selectGetConsultation,
|
||||||
|
@ -266,6 +266,9 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
fetchGetDrugAppareil,
|
fetchGetDrugAppareil,
|
||||||
fetchModifyPrescription,
|
fetchModifyPrescription,
|
||||||
fetchGetNetworkActs,
|
fetchGetNetworkActs,
|
||||||
|
fetchGetAmountConsultation,
|
||||||
|
fetchCheckInsuranceCoverageAmount,
|
||||||
|
checkInsuranceCoverageAmount,
|
||||||
getConsultation,
|
getConsultation,
|
||||||
getUserByNameOrNumber,
|
getUserByNameOrNumber,
|
||||||
getUserByIdQRCode,
|
getUserByIdQRCode,
|
||||||
|
@ -313,6 +316,7 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
|
|
||||||
const [modalConsultation, setModalConsultation] = useState(false);
|
const [modalConsultation, setModalConsultation] = useState(false);
|
||||||
const [consultation, setConsultation] = useState(null);
|
const [consultation, setConsultation] = useState(null);
|
||||||
|
const [consultationClone, setConsultationClone] = useState(null);
|
||||||
|
|
||||||
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
||||||
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
||||||
|
@ -398,6 +402,8 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
dispatch(fetchGetNetworkActsReset());
|
dispatch(fetchGetNetworkActsReset());
|
||||||
dispatch(fetchExecutionPrescriptionReset());
|
dispatch(fetchExecutionPrescriptionReset());
|
||||||
dispatch(fetchModifyPrescriptionReset());
|
dispatch(fetchModifyPrescriptionReset());
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
|
||||||
|
|
||||||
fetchGetProviderClass(wallet.id_network);
|
fetchGetProviderClass(wallet.id_network);
|
||||||
fetchGetNetworkActs(wallet.id_network, '');
|
fetchGetNetworkActs(wallet.id_network, '');
|
||||||
|
@ -450,6 +456,8 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
}, [getUserByNameOrNumber]);
|
}, [getUserByNameOrNumber]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (getConsultation.result !== null)
|
if (getConsultation.result !== null)
|
||||||
setModalConsultation(true);
|
setModalConsultation(true);
|
||||||
|
@ -697,12 +705,26 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
act: values.code_acte,
|
act: values.code_acte,
|
||||||
amount: values.amount_prestation,
|
amount: values.amount_prestation,
|
||||||
home_visit_fees: values.frais_deplacement,
|
home_visit_fees: values.frais_deplacement,
|
||||||
to_delete: false
|
to_delete: false,
|
||||||
|
|
||||||
} : performance;
|
} : performance;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setModalPrestation(false);
|
fetchCheckInsuranceCoverageAmount({
|
||||||
|
insurance_id: assure.id,
|
||||||
|
beneficiary_id: beneficiary !== null ? beneficiary.id : null,
|
||||||
|
care_condition: careConditon,
|
||||||
|
act_action: "UPDATE",
|
||||||
|
act_type: "PERFORMANCE",
|
||||||
|
act_id: values.code_acte.id,
|
||||||
|
performances: [
|
||||||
|
{
|
||||||
|
amount: values.amount_prestation,
|
||||||
|
home_visit_fees: values.frais_deplacement
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
||||||
}}>
|
}}>
|
||||||
|
|
||||||
{({
|
{({
|
||||||
|
@ -783,6 +805,11 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
value={values.amount_prestation}
|
value={values.amount_prestation}
|
||||||
onChangeText={(value) => {
|
onChangeText={(value) => {
|
||||||
setFieldValue('amount_prestation', value);
|
setFieldValue('amount_prestation', value);
|
||||||
|
console.log({
|
||||||
|
network_id: wallet.id_network,
|
||||||
|
amount: '' + value,
|
||||||
|
care_condition: careConditon
|
||||||
|
});
|
||||||
fetchGetAmountConsultation({
|
fetchGetAmountConsultation({
|
||||||
network_id: wallet.id_network,
|
network_id: wallet.id_network,
|
||||||
amount: '' + value,
|
amount: '' + value,
|
||||||
|
@ -799,20 +826,20 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
style={{marginTop: 10}}
|
style={{marginTop: 10}}
|
||||||
placeholder={I18n.t('TICKET_MONDERATEUR')}
|
placeholder={I18n.t('TICKET_MONDERATEUR')}
|
||||||
editable={false}
|
editable={false}
|
||||||
value={elementToSetPrice !== null ? elementToSetPrice.drugs === null
|
value={getAmountConsultation.result !== null ? getAmountConsultation.result.response.moderator_ticket :
|
||||||
|
elementToSetPrice !== null ? elementToSetPrice.drugs === null
|
||||||
? values.moderator_ticket
|
? values.moderator_ticket
|
||||||
: getAmountConsultation.result !== null ? getAmountConsultation.result.response.moderator_ticket : ''
|
: '' : ''}
|
||||||
: getAmountConsultation.result !== null ? getAmountConsultation.result.response.moderator_ticket : ''}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
style={{marginTop: 10}}
|
style={{marginTop: 10}}
|
||||||
placeholder={I18n.t('AMOUNT_PER_INSURANCE')}
|
placeholder={I18n.t('AMOUNT_PER_INSURANCE')}
|
||||||
editable={false}
|
editable={false}
|
||||||
value={elementToSetPrice !== null ? elementToSetPrice.drugs === null
|
value={getAmountConsultation.result !== null ? getAmountConsultation.result.response.insurance_amount :
|
||||||
? values.insurance_amount
|
elementToSetPrice !== null ? elementToSetPrice.drugs === null
|
||||||
: getAmountConsultation.result !== null ? getAmountConsultation.result.response.insurance_amount : ''
|
? values.moderator_ticket
|
||||||
: getAmountConsultation.result !== null ? getAmountConsultation.result.response.insurance_amount : ''}/>
|
: '' : ''}/>
|
||||||
|
|
||||||
<View style={{
|
<View style={{
|
||||||
marginTop: 10,
|
marginTop: 10,
|
||||||
|
@ -852,6 +879,7 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
loading={checkInsuranceCoverageAmount.loading}
|
||||||
style={{marginTop: 20, marginBottom: 20}}
|
style={{marginTop: 20, marginBottom: 20}}
|
||||||
full
|
full
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
@ -969,10 +997,11 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
success={touched.amount_prestation && !errors.amount_prestation}
|
success={touched.amount_prestation && !errors.amount_prestation}
|
||||||
touched={touched.amount_prestation}
|
touched={touched.amount_prestation}
|
||||||
error={errors.amount_prestation}
|
error={errors.amount_prestation}
|
||||||
onKeyPress={() => {
|
onChangeText={(text)=> {
|
||||||
|
setFieldValue('amount_prestation', text);
|
||||||
fetchGetAmountConsultation({
|
fetchGetAmountConsultation({
|
||||||
network_id: wallet.id_network,
|
network_id: wallet.id_network,
|
||||||
amount: values.amount_prestation,
|
amount: '' + text,
|
||||||
care_condition: careConditon
|
care_condition: careConditon
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
@ -2260,6 +2289,18 @@ const ModifierFeuilleSoinScreen = ({
|
||||||
return {...prescription, to_delete: false}
|
return {...prescription, to_delete: false}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
setConsultationClone({
|
||||||
|
...historyItemDetail,
|
||||||
|
exams: historyItemDetail.exams.map(exam => {
|
||||||
|
return {...exam, to_delete: false}
|
||||||
|
}),
|
||||||
|
performances: historyItemDetail.performances.map(performance => {
|
||||||
|
return {...performance, to_delete: false}
|
||||||
|
}),
|
||||||
|
prescriptions: historyItemDetail.prescriptions.map(prescription => {
|
||||||
|
return {...prescription, to_delete: false}
|
||||||
|
})
|
||||||
|
});
|
||||||
setCareCondition(historyItemDetail.care_condition);
|
setCareCondition(historyItemDetail.care_condition);
|
||||||
setFieldValue(
|
setFieldValue(
|
||||||
'practitioner_firstname',
|
'practitioner_firstname',
|
||||||
|
@ -3017,7 +3058,8 @@ const mapStateToProps = createStructuredSelector({
|
||||||
executionPrescription: selectExecutionPrescription,
|
executionPrescription: selectExecutionPrescription,
|
||||||
getConsultation: selectGetConsultation,
|
getConsultation: selectGetConsultation,
|
||||||
getNetworkAct: selectGetNetworkAct,
|
getNetworkAct: selectGetNetworkAct,
|
||||||
modifyPrescription: selectModifyPrescription
|
modifyPrescription: selectModifyPrescription,
|
||||||
|
checkInsuranceCoverageAmount: selectCheckInsuranceCoverageAmount
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
export default connect(mapStateToProps, {
|
||||||
|
@ -3031,7 +3073,8 @@ export default connect(mapStateToProps, {
|
||||||
fetchGetAmountConsultation,
|
fetchGetAmountConsultation,
|
||||||
fetchGetConsultation,
|
fetchGetConsultation,
|
||||||
fetchExecutionPrescription,
|
fetchExecutionPrescription,
|
||||||
fetchModifyPrescription
|
fetchModifyPrescription,
|
||||||
|
fetchCheckInsuranceCoverageAmount
|
||||||
})(
|
})(
|
||||||
ModifierFeuilleSoinScreen,
|
ModifierFeuilleSoinScreen,
|
||||||
);
|
);
|
||||||
|
|
|
@ -32,7 +32,7 @@ import {
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription,
|
||||||
fetchActivePaySubscriptionReset,
|
fetchActivePaySubscriptionReset,
|
||||||
fetchAddDrug,
|
fetchAddDrug,
|
||||||
fetchAddDrugReset,
|
fetchAddDrugReset, fetchCheckInsuranceCoverageAmount, fetchCheckInsuranceCoverageAmountReset,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchCreateConsultationReset,
|
fetchCreateConsultationReset,
|
||||||
fetchGetAmountConsultation,
|
fetchGetAmountConsultation,
|
||||||
|
@ -56,7 +56,7 @@ import TextInput from "../../../components/TextInput";
|
||||||
import {createStructuredSelector} from "reselect";
|
import {createStructuredSelector} from "reselect";
|
||||||
import {
|
import {
|
||||||
selectActivatePaySubscription,
|
selectActivatePaySubscription,
|
||||||
selectAddDrug,
|
selectAddDrug, selectCheckInsuranceCoverageAmount,
|
||||||
selectCreateConsultation,
|
selectCreateConsultation,
|
||||||
selectGetAmountConsultation,
|
selectGetAmountConsultation,
|
||||||
selectGetDrugAppareil,
|
selectGetDrugAppareil,
|
||||||
|
@ -260,11 +260,13 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
fetchGetNetworkActs,
|
fetchGetNetworkActs,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchGetAmountConsultation,
|
fetchGetAmountConsultation,
|
||||||
|
fetchCheckInsuranceCoverageAmount,
|
||||||
getUserByNameOrNumber,
|
getUserByNameOrNumber,
|
||||||
getUserByIdQRCode,
|
getUserByIdQRCode,
|
||||||
getDrugAppareil,
|
getDrugAppareil,
|
||||||
getProviderClass,
|
getProviderClass,
|
||||||
addDrug,
|
addDrug,
|
||||||
|
checkInsuranceCoverageAmount,
|
||||||
createConsultation,
|
createConsultation,
|
||||||
getNetworkAct,
|
getNetworkAct,
|
||||||
getAmountConsultation,
|
getAmountConsultation,
|
||||||
|
@ -375,6 +377,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
dispatch(fetchGetNetworkActsReset());
|
dispatch(fetchGetNetworkActsReset());
|
||||||
dispatch(fetchGetProviderClassReset());
|
dispatch(fetchGetProviderClassReset());
|
||||||
dispatch(fetchAddDrugReset());
|
dispatch(fetchAddDrugReset());
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
|
||||||
fetchGetProviderClass(wallet.id_network);
|
fetchGetProviderClass(wallet.id_network);
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -423,6 +426,101 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
dispatch(fetchGetUserByNameOrNumberReset());*/
|
dispatch(fetchGetUserByNameOrNumberReset());*/
|
||||||
}
|
}
|
||||||
}, [getUserByNameOrNumber]);
|
}, [getUserByNameOrNumber]);
|
||||||
|
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]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log("checkInsuranceCoverageAmount.result", checkInsuranceCoverageAmount);
|
||||||
|
console.log("Prestations", prestations);
|
||||||
|
if (checkInsuranceCoverageAmount.result !== null) {
|
||||||
|
if (checkInsuranceCoverageAmount.result.response !== null) {
|
||||||
|
if(prestations !== null) {
|
||||||
|
setModalPrestation(false);
|
||||||
|
Utils.displayToast(I18n.t('PRESTATION_SUCCESSFULLY_ADD'));
|
||||||
|
}
|
||||||
|
/* if(examens !== null) {
|
||||||
|
setModalExamen(false);
|
||||||
|
Utils.displayToast(I18n.t('EXAMENS_SUCCESSFULLY_ADD'));
|
||||||
|
}
|
||||||
|
if(prescriptions !== null) {
|
||||||
|
setModalMedicament(false);
|
||||||
|
Utils.displayToast(I18n.t('PRESCRIPTIONS_SUCCESSFULLY_ADD'));
|
||||||
|
}*/
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkInsuranceCoverageAmount.error) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("INFORMATION_MESSAGE"),
|
||||||
|
Utils.getErrorMsg(checkInsuranceCoverageAmount),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
if(prestations !== null) {
|
||||||
|
let newPrestation = [...prestations];
|
||||||
|
newPrestation.shift();
|
||||||
|
setPrestations(newPrestation);
|
||||||
|
setModalPrestation(false);
|
||||||
|
}
|
||||||
|
/* if(examens !== null) {
|
||||||
|
setModalExamen(false);
|
||||||
|
}
|
||||||
|
if(prescriptions !== null) {
|
||||||
|
setModalMedicament(false);
|
||||||
|
}*/
|
||||||
|
dispatch(fetchCheckInsuranceCoverageAmountReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
/* dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(getUserByNameOrNumber),
|
||||||
|
);
|
||||||
|
dispatch(fetchGetUserByNameOrNumberReset());*/
|
||||||
|
}
|
||||||
|
}, [checkInsuranceCoverageAmount]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (getDrugAppareil.result !== null) {
|
if (getDrugAppareil.result !== null) {
|
||||||
|
@ -695,8 +793,19 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
amount: values.amount_prestation,
|
amount: values.amount_prestation,
|
||||||
home_visit_fees: values.frais_deplacement
|
home_visit_fees: values.frais_deplacement
|
||||||
}, ...prestations]);
|
}, ...prestations]);
|
||||||
setModalPrestation(false);
|
fetchCheckInsuranceCoverageAmount({
|
||||||
Utils.displayToast(I18n.t('PRESTATION_SUCCESSFULLY_ADD'));
|
insurance_id: assure.id,
|
||||||
|
beneficiary_id: beneficiary !== null ? beneficiary.id : null,
|
||||||
|
care_condition: careConditon,
|
||||||
|
act_action: "INSERT",
|
||||||
|
act_type: "PERFORMANCE",
|
||||||
|
performances: [
|
||||||
|
{
|
||||||
|
amount: values.amount_prestation,
|
||||||
|
home_visit_fees: values.frais_deplacement
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}}>
|
}}>
|
||||||
|
@ -773,18 +882,19 @@ 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={handleChange('amount_prestation')}
|
onChangeText={(text)=> {
|
||||||
onBlur={handleBlur('amount_prestation')}
|
setFieldValue('amount_prestation', text);
|
||||||
success={touched.amount_prestation && !errors.amount_prestation}
|
|
||||||
touched={touched.amount_prestation}
|
|
||||||
error={errors.amount_prestation}
|
|
||||||
onKeyPress={() => {
|
|
||||||
fetchGetAmountConsultation({
|
fetchGetAmountConsultation({
|
||||||
network_id: wallet.id_network,
|
network_id: wallet.id_network,
|
||||||
amount: values.amount_prestation,
|
amount: '' + text,
|
||||||
care_condition: careConditon
|
care_condition: careConditon
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
onBlur={handleBlur('amount_prestation')}
|
||||||
|
success={touched.amount_prestation && !errors.amount_prestation}
|
||||||
|
touched={touched.amount_prestation}A
|
||||||
|
error={errors.amount_prestation}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
|
@ -840,6 +950,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
<Button
|
<Button
|
||||||
style={{marginTop: 20, marginBottom: 20}}
|
style={{marginTop: 20, marginBottom: 20}}
|
||||||
full
|
full
|
||||||
|
loading={checkInsuranceCoverageAmount.loading}
|
||||||
onPress={handleSubmit}>
|
onPress={handleSubmit}>
|
||||||
{I18n.t('SUBMIT_LABEL')}
|
{I18n.t('SUBMIT_LABEL')}
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -864,8 +975,8 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
dosage: values.drug_posologie,
|
dosage: values.drug_posologie,
|
||||||
quantity: values.drug_quantity
|
quantity: values.drug_quantity
|
||||||
}, ...prescriptions]);
|
}, ...prescriptions]);
|
||||||
setModalMedicament(false);
|
|
||||||
Utils.displayToast(I18n.t('PRESCRIPTIONS_SUCCESSFULLY_ADD'));
|
Utils.displayToast(I18n.t('PRESCRIPTIONS_SUCCESSFULLY_ADD'));
|
||||||
|
setModalMedicament(false);
|
||||||
}}>
|
}}>
|
||||||
|
|
||||||
{({
|
{({
|
||||||
|
@ -2071,7 +2182,8 @@ const mapStateToProps = createStructuredSelector({
|
||||||
getProviderClass: selectGetProviderClass,
|
getProviderClass: selectGetProviderClass,
|
||||||
createConsultation: selectCreateConsultation,
|
createConsultation: selectCreateConsultation,
|
||||||
getNetworkAct: selectGetNetworkAct,
|
getNetworkAct: selectGetNetworkAct,
|
||||||
getAmountConsultation: selectGetAmountConsultation
|
getAmountConsultation: selectGetAmountConsultation,
|
||||||
|
checkInsuranceCoverageAmount: selectCheckInsuranceCoverageAmount
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
export default connect(mapStateToProps, {
|
||||||
|
@ -2084,7 +2196,8 @@ export default connect(mapStateToProps, {
|
||||||
fetchGetProviderClass,
|
fetchGetProviderClass,
|
||||||
fetchGetNetworkActs,
|
fetchGetNetworkActs,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchGetAmountConsultation
|
fetchGetAmountConsultation,
|
||||||
|
fetchCheckInsuranceCoverageAmount
|
||||||
})(
|
})(
|
||||||
SaisirFeuilleSoinScreen,
|
SaisirFeuilleSoinScreen,
|
||||||
);
|
);
|
||||||
|
|
|
@ -260,6 +260,22 @@ export const nanoCreditHistoryLabel = () => {
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
export const nanoSanteHistoryLabel = () => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
icon: 'inbox-arrow-up',
|
||||||
|
label: 'ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'cash',
|
||||||
|
label: 'AMOUNT_LABEL'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'account',
|
||||||
|
label: 'INSTITUTE_NAME'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
export const transactionHistoryNanoCreditLabel = () => {
|
export const transactionHistoryNanoCreditLabel = () => {
|
||||||
return [
|
return [
|
||||||
/*{
|
/*{
|
||||||
|
@ -489,32 +505,42 @@ export const optionNanoSanteUserScreen = {
|
||||||
{
|
{
|
||||||
title: 'SUBSCRIBE_ASSURANCE',
|
title: 'SUBSCRIBE_ASSURANCE',
|
||||||
screen: 'insuranceSubscriptionScreen',
|
screen: 'insuranceSubscriptionScreen',
|
||||||
icon: 'cash'
|
icon: 'file-medical',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ADD_SUBSCRIBE',
|
title: 'ADD_SUBSCRIBE',
|
||||||
screen: 'addBeneficiaryScreen',
|
screen: 'addBeneficiaryScreen',
|
||||||
icon: "cash-refund"
|
icon: "user-plus",
|
||||||
|
iconType:"FontAwesome5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ACTIVATE_INSSURANCE',
|
title: 'ACTIVATE_INSSURANCE',
|
||||||
screen: 'activateBuySubscriptionScreen',
|
screen: 'activateBuySubscriptionScreen',
|
||||||
icon: "cash-refund"
|
icon: "check-circle",
|
||||||
|
iconType:"FontAwesome5"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'RENEW_INSSURANCE',
|
title: 'RENEW_INSSURANCE',
|
||||||
screen: 'renewAssuranceScreen',
|
screen: 'renewAssuranceScreen',
|
||||||
icon: "cash-refund"
|
icon: "sync",
|
||||||
|
iconType:"FontAwesome5"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: 'deleteBeneficiaryScreen',
|
screen: 'deleteBeneficiaryScreen',
|
||||||
icon: 'cash-register',
|
icon: 'user-minus',
|
||||||
title: 'DELETE_SUBSCRIBE',
|
title: 'DELETE_SUBSCRIBE',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: 'stopSubscriptionScreen',
|
screen: 'stopSubscriptionScreen',
|
||||||
icon: 'cash-multiple',
|
icon: 'hand-spock',
|
||||||
title: 'STOP_SUBSCRIBE',
|
title: 'STOP_SUBSCRIBE',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -522,19 +548,23 @@ export const optionNanoSanteUserScreen = {
|
||||||
title: 'MANAGE_HEALTH',
|
title: 'MANAGE_HEALTH',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
icon: 'account-multiple',
|
icon: 'book-medical',
|
||||||
title: 'DEMAND_AUTORIZATION_HEALTH',
|
title: 'DEMAND_AUTORIZATION_HEALTH',
|
||||||
screen: 'demandeAutorisationSoinScreen'
|
screen: 'demandeAutorisationSoinScreen',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'HISTORIC_HEALTH',
|
title: 'HISTORIC_HEALTH',
|
||||||
screen: 'historiqueNanoSanteUserScreen',
|
screen: 'historiqueNanoSanteUserScreen',
|
||||||
icon: 'cash'
|
icon: 'history',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'VALID_HEALTH',
|
title: 'VALID_HEALTH',
|
||||||
screen: 'validateConsultationScreen',
|
screen: 'validateConsultationScreen',
|
||||||
icon: 'cash'
|
icon: 'check-circle',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -617,23 +647,33 @@ export const optionNanoSanteAgentScreen = {
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.saisirFeuilleSoinScreen,
|
screen: route.saisirFeuilleSoinScreen,
|
||||||
icon: 'user-plus',
|
icon: 'file-medical',
|
||||||
title: 'SAISIR_FEUILLE_SOIN',
|
title: 'SAISIR_FEUILLE_SOIN',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.executerPrescriptionScreen,
|
screen: route.executerPrescriptionScreen,
|
||||||
icon: 'edit',
|
icon: 'check-circle',
|
||||||
title: 'EXECUTER_PRESCRIPTION',
|
title: 'EXECUTER_PRESCRIPTION',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.modifierFeuilleSoinScreen,
|
screen: route.modifierFeuilleSoinScreen,
|
||||||
icon: 'edit',
|
icon: 'edit',
|
||||||
title: 'MODIFY_CONSULTATION',
|
title: 'MODIFY_CONSULTATION',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.modifierExecutionPrescriptionScreen,
|
screen: route.modifierExecutionPrescriptionScreen,
|
||||||
icon: 'edit',
|
icon: 'edit',
|
||||||
title: 'MODIFY_EXECUTION',
|
title: 'MODIFY_EXECUTION',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
screen: route.historiqueNanoSanteAgentScreen,
|
||||||
|
icon: 'history',
|
||||||
|
title: 'HISTORY',
|
||||||
|
iconType:"FontAwesome5"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -662,7 +662,7 @@
|
||||||
"MEDICAMENT": "Médicament",
|
"MEDICAMENT": "Médicament",
|
||||||
"EXAMEN": "Examen",
|
"EXAMEN": "Examen",
|
||||||
"PRESTATION_SUCCESSFULLY_ADD": "Prestation ajouté avec succès",
|
"PRESTATION_SUCCESSFULLY_ADD": "Prestation ajouté avec succès",
|
||||||
"EXAMENS_SUCCESSFULLY_ADD": "Examens ajouté avec succès",
|
"EXAMENS_SUCCESSFULLY_ADD": "Examen ajouté avec succès",
|
||||||
"PRESCRIPTIONS_SUCCESSFULLY_ADD": "Prescription ajouté avec succès",
|
"PRESCRIPTIONS_SUCCESSFULLY_ADD": "Prescription ajouté avec succès",
|
||||||
"PRESCRIPTIONS_SUCCESSFULLY_MODIFY": "Prescription modifié avec succès",
|
"PRESCRIPTIONS_SUCCESSFULLY_MODIFY": "Prescription modifié avec succès",
|
||||||
"YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION": "Vous devez ajouter au moins une prestation",
|
"YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION": "Vous devez ajouter au moins une prestation",
|
||||||
|
@ -677,7 +677,7 @@
|
||||||
"PLEASE_SELECT_CONDITON_PRISE_CHARGE_FIRST": "Veuillez d'abord sélectionner la conditon de prise en charge",
|
"PLEASE_SELECT_CONDITON_PRISE_CHARGE_FIRST": "Veuillez d'abord sélectionner la conditon de prise en charge",
|
||||||
"CONSULTATION": "Consultation",
|
"CONSULTATION": "Consultation",
|
||||||
"STATE": "Etat",
|
"STATE": "Etat",
|
||||||
"INSTITUTE_NAME": "Nom de l'institut",
|
"INSTITUTE_NAME": "Nom de l'institution",
|
||||||
"ACCEPT": "Accepter",
|
"ACCEPT": "Accepter",
|
||||||
"REJECT": "Rejeter",
|
"REJECT": "Rejeter",
|
||||||
"DETAIL": "Détail",
|
"DETAIL": "Détail",
|
||||||
|
@ -709,5 +709,10 @@
|
||||||
"AGENT_VALIDEUR": "Agent valideur",
|
"AGENT_VALIDEUR": "Agent valideur",
|
||||||
"TEXT_SUPPRESS_CONFIRM_BENEFICIARY": "Voulez vous vraiment supprimer cet ayant droit ?",
|
"TEXT_SUPPRESS_CONFIRM_BENEFICIARY": "Voulez vous vraiment supprimer cet ayant droit ?",
|
||||||
"ENTER_PASSWORD_TO_VALID_MODIFICATION": "Renseigner votre mot de passe et valider la suppression de l'ayant pour le supprimé définitivement",
|
"ENTER_PASSWORD_TO_VALID_MODIFICATION": "Renseigner votre mot de passe et valider la suppression de l'ayant pour le supprimé définitivement",
|
||||||
"PLEASE_SELECT_AT_LEAST_ASSURE": "Veuillez sélectionner au moins un ayant droit"
|
"PLEASE_SELECT_AT_LEAST_ASSURE": "Veuillez sélectionner au moins un ayant droit",
|
||||||
|
"ID": "ID",
|
||||||
|
"INVOICE_ID": "ID facture",
|
||||||
|
"INVOICE": "Facture",
|
||||||
|
"HISTORY": "Historique",
|
||||||
|
"INFORMATION_MESSAGE": "Message d'information"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import {fetchCheckInsuranceCoverageAmountPending} from "../redux/insurance/insurance.actions";
|
||||||
|
|
||||||
export const isDebugMode = false
|
export const isDebugMode = false
|
||||||
//base url test
|
//base url test
|
||||||
//export const baseUrl = "https://ilink-app.com/mobilebackendbeta"
|
//export const baseUrl = "https://ilink-app.com/mobilebackendbeta"
|
||||||
|
@ -9,6 +11,7 @@ export const isDebugMode = false
|
||||||
|
|
||||||
export const baseUrl = "http://test.ilink-app.com:8080/mobilebackend";
|
export const baseUrl = "http://test.ilink-app.com:8080/mobilebackend";
|
||||||
export const testBaseUrl = "https://test.ilink-app.com";
|
export const testBaseUrl = "https://test.ilink-app.com";
|
||||||
|
export const testBaseUrlWithPort = "https://test.ilink-app.com:8086";
|
||||||
|
|
||||||
/*export const baseUrl = "https://ilink-app.com/mobilebackend";
|
/*export const baseUrl = "https://ilink-app.com/mobilebackend";
|
||||||
export const testBaseUrl = "https://ilink-app.com:8080";*/
|
export const testBaseUrl = "https://ilink-app.com:8080";*/
|
||||||
|
@ -81,7 +84,10 @@ export const getIlinkBankListUrl = testBaseUrl + '/walletService/wallets/users/b
|
||||||
export const linkBankAccountUrl = testBaseUrl + '/walletService/wallets/users/link_bank_account';
|
export const linkBankAccountUrl = testBaseUrl + '/walletService/wallets/users/link_bank_account';
|
||||||
export const payBillUrl = testBaseUrl + '/walletService/transactions/ilink';
|
export const payBillUrl = testBaseUrl + '/walletService/transactions/ilink';
|
||||||
|
|
||||||
|
export const facturerSoinUrl = testBaseUrl + '/nanoSanteService/generate-invoice';
|
||||||
|
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 getUserByIdQRCodeUrl = testBaseUrl + '/nanoSanteService/qrcode/read';
|
export const getUserByIdQRCodeUrl = testBaseUrl + '/nanoSanteService/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';
|
||||||
|
@ -94,7 +100,8 @@ export const consultationUrl = testBaseUrl + '/nanoSanteService/health-care-shee
|
||||||
export const getAmountConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/performances-amount';
|
export const getAmountConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/performances-amount';
|
||||||
export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount';
|
export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount';
|
||||||
export const autorisationCareRequestUrl = testBaseUrl + '/nanoSanteService/authorizations-care-requests';
|
export const autorisationCareRequestUrl = testBaseUrl + '/nanoSanteService/authorizations-care-requests';
|
||||||
export const uploadInsuranceImagetUrl = 'https://test.ilink-app.com:8086/insurances/subscriptions/upload-images';
|
export const uploadInsuranceImagetUrl = testBaseUrlWithPort + '/insurances/subscriptions/upload-images';
|
||||||
|
export const pdfViewerUrl = testBaseUrlWithPort + '/pdf-viewer';
|
||||||
|
|
||||||
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
||||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||||
|
|
|
@ -9,6 +9,10 @@ import {
|
||||||
fetchCreateGroupPending,
|
fetchCreateGroupPending,
|
||||||
fetchCreateGroupReset,
|
fetchCreateGroupReset,
|
||||||
fetchCreateGroupSuccess,
|
fetchCreateGroupSuccess,
|
||||||
|
fetchFacturerSoinError,
|
||||||
|
fetchFacturerSoinPending,
|
||||||
|
fetchFacturerSoinReset,
|
||||||
|
fetchFacturerSoinSuccess,
|
||||||
fetchGetEpargneInProgressError,
|
fetchGetEpargneInProgressError,
|
||||||
fetchGetEpargneInProgressPending,
|
fetchGetEpargneInProgressPending,
|
||||||
fetchGetEpargneInProgressReset,
|
fetchGetEpargneInProgressReset,
|
||||||
|
@ -21,6 +25,9 @@ import {
|
||||||
fetchGetNanoCreditUserHistoryInProgressPending,
|
fetchGetNanoCreditUserHistoryInProgressPending,
|
||||||
fetchGetNanoCreditUserHistoryInProgressReset,
|
fetchGetNanoCreditUserHistoryInProgressReset,
|
||||||
fetchGetNanoCreditUserHistoryInProgressSuccess,
|
fetchGetNanoCreditUserHistoryInProgressSuccess,
|
||||||
|
fetchInvoiceHistoryError,
|
||||||
|
fetchInvoiceHistoryPending, fetchInvoiceHistoryReset,
|
||||||
|
fetchInvoiceHistorySuccess,
|
||||||
fetchJoinGroupError,
|
fetchJoinGroupError,
|
||||||
fetchJoinGroupPending,
|
fetchJoinGroupPending,
|
||||||
fetchJoinGroupReset,
|
fetchJoinGroupReset,
|
||||||
|
@ -33,10 +40,10 @@ import {
|
||||||
import {store} from "../redux/store";
|
import {store} from "../redux/store";
|
||||||
import {
|
import {
|
||||||
askNanoCreditUrl,
|
askNanoCreditUrl,
|
||||||
cancelDemandUrl, getHistoryEpargnePendingUrl,
|
cancelDemandUrl, consultationUrl, facturerSoinUrl, getHistoryEpargnePendingUrl,
|
||||||
getHistoryNanoPendingCreditUrl,
|
getHistoryNanoPendingCreditUrl,
|
||||||
getNanoCreditDemandDureationUrl,
|
getNanoCreditDemandDureationUrl,
|
||||||
groupUrl,
|
groupUrl, invoiceUrl,
|
||||||
joinGroupUrl,
|
joinGroupUrl,
|
||||||
treatDemandUrl
|
treatDemandUrl
|
||||||
} from "./IlinkConstants";
|
} from "./IlinkConstants";
|
||||||
|
@ -310,6 +317,8 @@ export const getEpargneInProgressReset = () => {
|
||||||
dispatch(fetchGetEpargneInProgressReset());
|
dispatch(fetchGetEpargneInProgressReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const getNanoCreditUserHistoryInProgressAction = (data) => {
|
export const getNanoCreditUserHistoryInProgressAction = (data) => {
|
||||||
|
|
||||||
const auth = store.getState().authKeyReducer;
|
const auth = store.getState().authKeyReducer;
|
||||||
|
@ -340,9 +349,106 @@ export const getNanoCreditUserHistoryInProgressAction = (data) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getNanoCreditUserHistoryInProgressReset = () => {
|
export const getNanoCreditUserHistoryInProgressReset = () => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchGetNanoCreditUserHistoryInProgressReset());
|
dispatch(fetchGetNanoCreditUserHistoryInProgressReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const facturerSoinAction = (otherParam) => {
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchFacturerSoinPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${facturerSoinUrl}${otherParam}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchFacturerSoinSuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchFacturerSoinError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchFacturerSoinError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchFacturerSoinError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const facturerSoinReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchFacturerSoinReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const getInvoiceHistoryAction = (otherParam) => {
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchInvoiceHistoryPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${invoiceUrl}${otherParam}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchInvoiceHistorySuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchInvoiceHistoryError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchInvoiceHistoryError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchInvoiceHistoryError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const getInvoiceHistoryReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchInvoiceHistoryReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSoinHistoryAction = (user_id, state = 'UNTREATED', typeParam = 'CONSULTATION', otherParam = '') => {
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchInvoiceHistoryPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${consultationUrl}?network_agent_id=${user_id}&state=${state}&type=${typeParam}${otherParam}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchInvoiceHistorySuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchInvoiceHistoryError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchInvoiceHistoryError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchInvoiceHistoryError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
27
yarn.lock
27
yarn.lock
|
@ -2224,6 +2224,11 @@
|
||||||
"resolved" "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz"
|
"resolved" "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz"
|
||||||
"version" "1.0.0"
|
"version" "1.0.0"
|
||||||
|
|
||||||
|
"base-64@0.1.0":
|
||||||
|
"integrity" "sha1-eAqZyE59YAJgNhURxId2E78k9rs="
|
||||||
|
"resolved" "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz"
|
||||||
|
"version" "0.1.0"
|
||||||
|
|
||||||
"base@^0.11.1":
|
"base@^0.11.1":
|
||||||
"integrity" "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg=="
|
"integrity" "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg=="
|
||||||
"resolved" "https://registry.npmjs.org/base/-/base-0.11.2.tgz"
|
"resolved" "https://registry.npmjs.org/base/-/base-0.11.2.tgz"
|
||||||
|
@ -2882,6 +2887,11 @@
|
||||||
"shebang-command" "^1.2.0"
|
"shebang-command" "^1.2.0"
|
||||||
"which" "^1.2.9"
|
"which" "^1.2.9"
|
||||||
|
|
||||||
|
"crypto-js@^3.2.0":
|
||||||
|
"integrity" "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q=="
|
||||||
|
"resolved" "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz"
|
||||||
|
"version" "3.3.0"
|
||||||
|
|
||||||
"css-select-base-adapter@^0.1.1":
|
"css-select-base-adapter@^0.1.1":
|
||||||
"integrity" "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w=="
|
"integrity" "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w=="
|
||||||
"version" "0.1.1"
|
"version" "0.1.1"
|
||||||
|
@ -4013,7 +4023,7 @@
|
||||||
"is-glob" "^3.1.0"
|
"is-glob" "^3.1.0"
|
||||||
"path-dirname" "^1.0.0"
|
"path-dirname" "^1.0.0"
|
||||||
|
|
||||||
"glob@^7.0.0", "glob@^7.1.1", "glob@^7.1.2", "glob@^7.1.3":
|
"glob@^7.0.0", "glob@^7.1.1", "glob@^7.1.2", "glob@^7.1.3", "glob@^7.1.6":
|
||||||
"integrity" "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA=="
|
"integrity" "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA=="
|
||||||
"resolved" "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz"
|
"resolved" "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz"
|
||||||
"version" "7.1.6"
|
"version" "7.1.6"
|
||||||
|
@ -6900,6 +6910,14 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@react-native-community/viewpager" "^3.3.0"
|
"@react-native-community/viewpager" "^3.3.0"
|
||||||
|
|
||||||
|
"react-native-blob-util@^0.14.0":
|
||||||
|
"integrity" "sha512-cr2Tw5VdvUijreMdnBYmsBVQvxwiLWKe37UG8dPnPJ8sQ8rZJQo9IfpfPho+w/8fWrKqCJAoTSLpHI1ar059ew=="
|
||||||
|
"resolved" "https://registry.npmjs.org/react-native-blob-util/-/react-native-blob-util-0.14.0.tgz"
|
||||||
|
"version" "0.14.0"
|
||||||
|
dependencies:
|
||||||
|
"base-64" "0.1.0"
|
||||||
|
"glob" "^7.1.6"
|
||||||
|
|
||||||
"react-native-blur-overlay@^1.0.6":
|
"react-native-blur-overlay@^1.0.6":
|
||||||
"integrity" "sha512-2RuyMoy1ZZzY+3Li2wBwAfn6Z46oNG7/zgVCTF77v2/ttmKzEJivUpcNvysYE1vzrwIdnuz4GZu9kC4FQ4qyEg=="
|
"integrity" "sha512-2RuyMoy1ZZzY+3Li2wBwAfn6Z46oNG7/zgVCTF77v2/ttmKzEJivUpcNvysYE1vzrwIdnuz4GZu9kC4FQ4qyEg=="
|
||||||
"resolved" "https://registry.npmjs.org/react-native-blur-overlay/-/react-native-blur-overlay-1.0.7.tgz"
|
"resolved" "https://registry.npmjs.org/react-native-blur-overlay/-/react-native-blur-overlay-1.0.7.tgz"
|
||||||
|
@ -7186,6 +7204,13 @@
|
||||||
"react-lifecycles-compat" "^3.0.4"
|
"react-lifecycles-compat" "^3.0.4"
|
||||||
"react-native-safe-area-view" "^0.12.0"
|
"react-native-safe-area-view" "^0.12.0"
|
||||||
|
|
||||||
|
"react-native-pdf@^6.4.0":
|
||||||
|
"integrity" "sha512-pfrCvHg4dqAPzl2FtRmGGl/D2dHec4w8+wGAKv7L97wxz5oF/QNvQ6q0KdfXdFlIZ22sS+BOwsRMzbB2mHPs2w=="
|
||||||
|
"resolved" "https://registry.npmjs.org/react-native-pdf/-/react-native-pdf-6.4.0.tgz"
|
||||||
|
"version" "6.4.0"
|
||||||
|
dependencies:
|
||||||
|
"crypto-js" "^3.2.0"
|
||||||
|
|
||||||
"react-native-permissions@^2.0.2":
|
"react-native-permissions@^2.0.2":
|
||||||
"integrity" "sha512-ihf4shQDSX5Oo9ChQXb9kr13mmyyNem5MaEvOpr3dCjhBOBWyEMztXm9/uPK1Qg5PsNpaYLa1KpcPZDCw87LXg=="
|
"integrity" "sha512-ihf4shQDSX5Oo9ChQXb9kr13mmyyNem5MaEvOpr3dCjhBOBWyEMztXm9/uPK1Qg5PsNpaYLa1KpcPZDCw87LXg=="
|
||||||
"resolved" "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-2.2.2.tgz"
|
"resolved" "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-2.2.2.tgz"
|
||||||
|
|
Loading…
Reference in New Issue