historique nano sante
This commit is contained in:
parent
d133d51b9f
commit
f76fd07ab8
2
App.js
2
App.js
|
@ -92,6 +92,7 @@ import ValidateConsultationDetailScreen from "./screens/wallet/user/ValidateCons
|
||||||
import ExecuterPrescriptionScreen from "./screens/wallet/agent/ExecuterPrescriptionScreen";
|
import ExecuterPrescriptionScreen from "./screens/wallet/agent/ExecuterPrescriptionScreen";
|
||||||
import ModifierFeuilleSoinScreen from "./screens/wallet/agent/ModifierFeuilleSoinScreen";
|
import ModifierFeuilleSoinScreen from "./screens/wallet/agent/ModifierFeuilleSoinScreen";
|
||||||
import ModifierExecutionPrescriptionScreen from "./screens/wallet/agent/ModifierExecutionPrescriptionScreen";
|
import ModifierExecutionPrescriptionScreen from "./screens/wallet/agent/ModifierExecutionPrescriptionScreen";
|
||||||
|
import HistoriqueNanoSanteUserScreen from "./screens/wallet/user/HistoriqueNanoSanteUserScreen";
|
||||||
|
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
|
@ -144,6 +145,7 @@ const AppStack = createDrawerNavigator({
|
||||||
validateConsultationScreen: ValidateConsultationScreen,
|
validateConsultationScreen: ValidateConsultationScreen,
|
||||||
validateConsultationDetailScreen: ValidateConsultationDetailScreen,
|
validateConsultationDetailScreen: ValidateConsultationDetailScreen,
|
||||||
activateBuySubscriptionScreen: ActivateBuySubscriptionScreen,
|
activateBuySubscriptionScreen: ActivateBuySubscriptionScreen,
|
||||||
|
historiqueNanoSanteUserScreen: HistoriqueNanoSanteUserScreen,
|
||||||
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
||||||
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
||||||
retraitCarteVersWalletUser: RetraitCarteVersWalletUser,
|
retraitCarteVersWalletUser: RetraitCarteVersWalletUser,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -572,7 +572,7 @@
|
||||||
"MANAGE_ASSURANCE": "Gérer son assurance",
|
"MANAGE_ASSURANCE": "Gérer son assurance",
|
||||||
"MANAGE_HEALTH": "Gérer ses soins",
|
"MANAGE_HEALTH": "Gérer ses soins",
|
||||||
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
|
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
|
||||||
"HISTORIC_HEALTH": "Consulter historique de ses soins",
|
"HISTORIC_HEALTH": "Consulter historique souscriptions et soins",
|
||||||
"VALID_HEALTH": "Valider un soin ",
|
"VALID_HEALTH": "Valider un soin ",
|
||||||
"ACTIVATE_INSSURANCE": "Activer son assurance",
|
"ACTIVATE_INSSURANCE": "Activer son assurance",
|
||||||
"AMOUNT_PER_DURATION": "Montant par durée",
|
"AMOUNT_PER_DURATION": "Montant par durée",
|
||||||
|
@ -694,5 +694,8 @@
|
||||||
"NO_EXECUTION": "Aucune exécution",
|
"NO_EXECUTION": "Aucune exécution",
|
||||||
"LISTE_CONSULTATION": "Liste des consultations",
|
"LISTE_CONSULTATION": "Liste des consultations",
|
||||||
"LIST_EXECUTION": "Liste des exécutions",
|
"LIST_EXECUTION": "Liste des exécutions",
|
||||||
"MODIFY_EXECUTION": "Modifier une exécution"
|
"MODIFY_EXECUTION": "Modifier une exécution",
|
||||||
|
"SOUSCRIPTION": "Souscriptions",
|
||||||
|
"FEUILLE_SOIN": "Feuille de soins",
|
||||||
|
"SOINS": "Soins"
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,7 +488,18 @@ 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}?user_id=${user_id}&state=${state}${otherParam}`,
|
||||||
|
method: 'GET',
|
||||||
|
onLoading: fetchGetConsultationPending,
|
||||||
|
onSuccess: fetchGetConsultationSuccess,
|
||||||
|
onError: fetchGetConsultationError,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const fetchGetSubscription = (user_id, typeParam = 'ALL', otherParam = '') => {
|
||||||
|
console.log("user_id", user_id);
|
||||||
|
return ApiAction({
|
||||||
|
url: `${subscribeInsuranceUrl}?user_id=${user_id}&type=${typeParam}${otherParam}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
onLoading: fetchGetConsultationPending,
|
onLoading: fetchGetConsultationPending,
|
||||||
onSuccess: fetchGetConsultationSuccess,
|
onSuccess: fetchGetConsultationSuccess,
|
||||||
|
|
|
@ -273,7 +273,7 @@ export default class OptionsMenu extends Component {
|
||||||
|| item === 'adhererGroupNanoCredit' || item === 'myNanoCreditGroup' || item === 'askNanoCredit' || item === 'refundNanoCreditUser' || item === 'cautionNanoCreditAgent'
|
|| item === 'adhererGroupNanoCredit' || item === 'myNanoCreditGroup' || item === 'askNanoCredit' || item === 'refundNanoCreditUser' || item === 'cautionNanoCreditAgent'
|
||||||
|| 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 === 'executerPrescriptionScreen' || item === 'modifierFeuilleSoinScreen' || item === 'modifierExecutionPrescriptionScreen' || item === 'historiqueNanoSanteUserScreen') {
|
||||||
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"
|
||||||
|
|
|
@ -1239,12 +1239,12 @@ class WalletOptionSelect extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{/* {
|
||||||
isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_CREDIT')
|
isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_CREDIT')
|
||||||
|| isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_SANTE') ?
|
|| isEqual(this.props.navigation.state.params.optionSelect.type, 'NANO_SANTE') ?
|
||||||
this.renderHistory()
|
this.renderHistory()
|
||||||
: <View style={{flex: 1}}/>
|
: <View style={{flex: 1}}/>
|
||||||
}
|
}*/}
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,635 @@
|
||||||
|
/**
|
||||||
|
* Project iLinkWorld
|
||||||
|
* File HistoricNanoSanteUserScreen
|
||||||
|
* Path screens/wallet/user
|
||||||
|
* Created by BRICE ZELE
|
||||||
|
* Date: 26/01/2022
|
||||||
|
*/
|
||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Dimensions,
|
||||||
|
FlatList,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
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,
|
||||||
|
fetchGetConsultation,
|
||||||
|
fetchGetConsultationReset,
|
||||||
|
fetchGetSubscription
|
||||||
|
} from "../../../redux/insurance/insurance.actions";
|
||||||
|
import DropdownAlert from "react-native-dropdownalert";
|
||||||
|
import {createStructuredSelector} from "reselect";
|
||||||
|
import {
|
||||||
|
selectAcceptRefuseConsultation,
|
||||||
|
selectActivatePaySubscription,
|
||||||
|
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";
|
||||||
|
|
||||||
|
|
||||||
|
let moment = require('moment-timezone');
|
||||||
|
|
||||||
|
const {width, height} = Dimensions.get('window');
|
||||||
|
|
||||||
|
const HistoriqueNanoSanteUserScreen = ({
|
||||||
|
navigation,
|
||||||
|
fetchGetConsultation,
|
||||||
|
fetchGetSubscription,
|
||||||
|
fetchAcceptRejectConsultation,
|
||||||
|
getConsultation,
|
||||||
|
acceptRefuseConsultation
|
||||||
|
}) => {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const [user, setUser] = useState(null);
|
||||||
|
const [displayModalHistory, setDisplayModalHistory] = useState(false);
|
||||||
|
const [historyItemDetail, setHistoryItemDetail] = useState({});
|
||||||
|
const [page, setPage] = useState(1);
|
||||||
|
const [loadMore, setLoadMore] = useState(false);
|
||||||
|
const [historyResult, setHistoryResult] = useState([]);
|
||||||
|
|
||||||
|
let dropDownAlertRef: any = null;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
dispatch(fetchAcceptRejectConsultationReset());
|
||||||
|
readUser().then((user) => {
|
||||||
|
setUser(user);
|
||||||
|
console.log("User", user);
|
||||||
|
fetchGetConsultation(user.id, 'UNTREATED', '', '&pagination=true&page=1');
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
if (getConsultation.result !== null) {
|
||||||
|
console.log("Page", page);
|
||||||
|
|
||||||
|
if (page < getConsultation.result.response.last_page)
|
||||||
|
setHistoryResult(historyResult.concat(getConsultation.result.response.data));
|
||||||
|
|
||||||
|
if (page === getConsultation.result.response.last_page) {
|
||||||
|
setPage(page + 1);
|
||||||
|
setHistoryResult(historyResult.concat(getConsultation.result.response.data));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getConsultation.error) {
|
||||||
|
dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(getConsultation),
|
||||||
|
);
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
}
|
||||||
|
}, [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(user.id, 'UNTREATED', '', `&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')}</Dialog.Title>
|
||||||
|
|
||||||
|
{historyItemDetail.hasOwnProperty('beneficiaries') ?
|
||||||
|
|
||||||
|
<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('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]}>{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]}>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 style={[styles.body2]}>{I18n.t('BONUS_AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.to}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.total_bonus_amount}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('NUMBER_OF_MONTHS')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{historyItemDetail.number_of_months}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</ScrollView>
|
||||||
|
:
|
||||||
|
<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('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('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('EXAMEN')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
{historyItemDetail.exams.map(exam => (
|
||||||
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${exam.description} \n ${exam.act.name} \n`}</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.drug_or_device.name} \n ${prescription.dosage} \n`}</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} \n`}</Text>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</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('beneficiaries') ?
|
||||||
|
<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('AMOUNT')}: ${item.bonus_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.number_of_beneficiaries}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View style={styles.contentBottom}>
|
||||||
|
<View style={styles.bottomLeft}>
|
||||||
|
<View style={{marginHorizontal: 5}}>
|
||||||
|
<Text caption1 semibold accentColor>
|
||||||
|
{`Type: ${item.insurance_action.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={[styles.contentTop, {borderColor: Color.borderColor}]}>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-start'}}>
|
||||||
|
<Text
|
||||||
|
caption1>{`${I18n.t('PATIENT')}: ${item.patient_lastname} ${item.patient_firstname}`}</Text>
|
||||||
|
<Text footnote light numberOfLines={1}>
|
||||||
|
{`${I18n.t('SITUATION')}: ${item.patient_situation.toLowerCase()}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<Text
|
||||||
|
caption1>{`${I18n.t('PRATICIEN')}: ${item.practitioner_lastname} ${item.practitioner_firstname}`}</Text>
|
||||||
|
<Text footnote light numberOfLines={1}>
|
||||||
|
{`${I18n.t('SITUATION')}: ${item.practitioner_provider_class}`}
|
||||||
|
</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>
|
||||||
|
);
|
||||||
|
|
||||||
|
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([]);
|
||||||
|
fetchGetConsultation(user.id, 'UNTREATED', '', '&pagination=true&page=1');
|
||||||
|
|
||||||
|
}}>
|
||||||
|
{I18n.t('SOINS')}
|
||||||
|
</Tag>
|
||||||
|
<Tag icon={<MaterialCommunityIcons name='medical-bag' size={20} color={Color.whiteColor}
|
||||||
|
style={{marginLeft: -15}}/>}
|
||||||
|
style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}}
|
||||||
|
primary
|
||||||
|
onPress={() => {
|
||||||
|
dispatch(fetchGetConsultationReset());
|
||||||
|
setPage(1);
|
||||||
|
setLoadMore(false);
|
||||||
|
setHistoryResult([]);
|
||||||
|
fetchGetSubscription(user.id, 'ALL', '&pagination=true&page=1');
|
||||||
|
}}>
|
||||||
|
{I18n.t('SOUSCRIPTION')}
|
||||||
|
</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
|
||||||
|
|
||||||
|
})(
|
||||||
|
HistoriqueNanoSanteUserScreen,
|
||||||
|
);
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
});
|
|
@ -67,7 +67,7 @@ const ValidateConsultationScreen = ({
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
setUser(user);
|
setUser(user);
|
||||||
console.log("User", user);
|
console.log("User", user);
|
||||||
fetchGetConsultation(user.id, 'UNTREATED');
|
fetchGetConsultation(user.id, 'UNTREATED', '');
|
||||||
});
|
});
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());
|
||||||
dispatch(fetchAcceptRejectConsultationReset());
|
dispatch(fetchAcceptRejectConsultationReset());
|
||||||
|
|
|
@ -528,7 +528,7 @@ export const optionNanoSanteUserScreen = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'HISTORIC_HEALTH',
|
title: 'HISTORIC_HEALTH',
|
||||||
screen: '',
|
screen: 'historiqueNanoSanteUserScreen',
|
||||||
icon: 'cash'
|
icon: 'cash'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -572,7 +572,7 @@
|
||||||
"MANAGE_ASSURANCE": "Gérer son assurance",
|
"MANAGE_ASSURANCE": "Gérer son assurance",
|
||||||
"MANAGE_HEALTH": "Gérer ses soins",
|
"MANAGE_HEALTH": "Gérer ses soins",
|
||||||
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
|
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
|
||||||
"HISTORIC_HEALTH": "Consulter historique de ses soins",
|
"HISTORIC_HEALTH": "Historique souscriptions et soins",
|
||||||
"VALID_HEALTH": "Valider un soin ",
|
"VALID_HEALTH": "Valider un soin ",
|
||||||
"ACTIVATE_INSSURANCE": "Activer son assurance",
|
"ACTIVATE_INSSURANCE": "Activer son assurance",
|
||||||
"AMOUNT_PER_DURATION": "Montant par durée",
|
"AMOUNT_PER_DURATION": "Montant par durée",
|
||||||
|
@ -694,5 +694,10 @@
|
||||||
"NO_EXECUTION": "Aucune exécution",
|
"NO_EXECUTION": "Aucune exécution",
|
||||||
"LISTE_CONSULTATION": "Liste des consultations",
|
"LISTE_CONSULTATION": "Liste des consultations",
|
||||||
"LIST_EXECUTION": "Liste des exécutions",
|
"LIST_EXECUTION": "Liste des exécutions",
|
||||||
"MODIFY_EXECUTION": "Modifier une exécution"
|
"MODIFY_EXECUTION": "Modifier une exécution",
|
||||||
|
"SOUSCRIPTION": "Souscriptions",
|
||||||
|
"FEUILLE_SOIN": "Feuille de soins",
|
||||||
|
"SOINS": "Soins",
|
||||||
|
"NETWORK": "Réseau",
|
||||||
|
"BONUS_AMOUNT": "Montant bonus"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue