Execution prescription OK
This commit is contained in:
parent
4474f46d4a
commit
2a71c36d1d
2
App.js
2
App.js
|
@ -89,6 +89,7 @@ import ActivateBuySubscriptionScreen from "./screens/wallet/user/ActivateBuySubs
|
|||
import SaisirFeuilleSoinScreen from "./screens/wallet/agent/SaisirFeuilleSoinScreen";
|
||||
import ValidateConsultationScreen from "./screens/wallet/user/ValidateConsultationScreen";
|
||||
import ValidateConsultationDetailScreen from "./screens/wallet/user/ValidateConsultationDetailScreen";
|
||||
import ExecuterPrescriptionScreen from "./screens/wallet/agent/ExecuterPrescriptionScreen";
|
||||
|
||||
|
||||
const instructions = Platform.select({
|
||||
|
@ -256,6 +257,7 @@ const AppAgentStack = createDrawerNavigator({
|
|||
historyItemDetails: HistoryItemDetails,
|
||||
creditrequest: HistoryRequester,
|
||||
saisirFeuilleSoinScreen: SaisirFeuilleSoinScreen,
|
||||
executerPrescriptionScreen: ExecuterPrescriptionScreen,
|
||||
addNetwork: AddNetwork,
|
||||
updateinformation: UpdateInformations,
|
||||
notificationview: Notifications,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -573,7 +573,7 @@
|
|||
"MANAGE_HEALTH": "Gérer ses soins",
|
||||
"DEMAND_AUTORIZATION_HEALTH": "Demande autorisation soin",
|
||||
"HISTORIC_HEALTH": "Consulter historique de ses soins",
|
||||
"VALID_HEALTH": "Valider une feuille de soin ",
|
||||
"VALID_HEALTH": "Valider un soin ",
|
||||
"ACTIVATE_INSSURANCE": "Activer son assurance",
|
||||
"AMOUNT_PER_DURATION": "Montant par durée",
|
||||
"AMOUNT_PRIME": "Montant de la prime",
|
||||
|
@ -671,5 +671,12 @@
|
|||
"DEVICE": "Appareillage",
|
||||
"AJOUTER_NOUVEAU_MEDICAMENT": "Ajouter un nouveau médicament",
|
||||
"SOUS_ORDONNANCE": "Sous ordonnance ?",
|
||||
"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",
|
||||
"STATE": "Etat",
|
||||
"INSTITUTE_NAME": "Nom de l'institut",
|
||||
"ACCEPT": "Accepter",
|
||||
"REJECT": "Rejeter",
|
||||
"DETAIL": "Détail",
|
||||
"NO_CONSULTATION_DEMAND": "Aucune demande de consultation"
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import InsuranceActions from './insurance.type';
|
|||
import {
|
||||
consultationUrl,
|
||||
createConsultationUrl,
|
||||
executionPrescriptionUrl,
|
||||
getAmountConsultationUrl,
|
||||
getDrugAndDevicesUrl,
|
||||
getInsuranceListUrl,
|
||||
|
@ -484,9 +485,9 @@ export const fetchGetConsultationError = (error: any) => ({
|
|||
payload: error,
|
||||
});
|
||||
|
||||
export const fetchGetConsultation = (user_id) => {
|
||||
export const fetchGetConsultation = (user_id, state = 'UNTREATED', typeParam = 'CONSULTATION') => {
|
||||
return ApiAction({
|
||||
url: `${consultationUrl}?user_id=${user_id}`,
|
||||
url: `${consultationUrl}?user_id=${user_id}&state=${state}&type=${typeParam}`,
|
||||
method: 'GET',
|
||||
onLoading: fetchGetConsultationPending,
|
||||
onSuccess: fetchGetConsultationSuccess,
|
||||
|
@ -523,3 +524,33 @@ export const fetchAcceptRejectConsultation = (data) => {
|
|||
onError: fetchAcceptRejectConsultationError,
|
||||
});
|
||||
};
|
||||
|
||||
/************************************************************/
|
||||
export const fetchExecutionPrescriptionPending = () => ({
|
||||
type: InsuranceActions.EXECUTION_PRESCRIPTION_PENDING,
|
||||
});
|
||||
|
||||
export const fetchExecutionPrescriptionReset = () => ({
|
||||
type: InsuranceActions.EXECUTION_PRESCRIPTION_RESET,
|
||||
});
|
||||
|
||||
export const fetchExecutionPrescriptionSuccess = (authkey: any) => ({
|
||||
type: InsuranceActions.EXECUTION_PRESCRIPTION_SUCCESS,
|
||||
payload: authkey,
|
||||
});
|
||||
|
||||
export const fetchExecutionPrescriptionError = (error: any) => ({
|
||||
type: InsuranceActions.EXECUTION_PRESCRIPTION_ERROR,
|
||||
payload: error,
|
||||
});
|
||||
|
||||
export const fetchExecutionPrescription = (data) => {
|
||||
return ApiAction({
|
||||
url: `${executionPrescriptionUrl}`,
|
||||
method: 'POST',
|
||||
data,
|
||||
onLoading: fetchExecutionPrescriptionPending,
|
||||
onSuccess: fetchExecutionPrescriptionSuccess,
|
||||
onError: fetchExecutionPrescriptionError,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -527,3 +527,33 @@ export const acceptOrRejectConsultationReducer = (state = INITIAL_STATE, action:
|
|||
|
||||
}
|
||||
};
|
||||
|
||||
export const executionPrescriptionReducer = (state = INITIAL_STATE, action: InsuranceActions) => {
|
||||
switch (action.type) {
|
||||
case InsuranceActions.EXECUTION_PRESCRIPTION_PENDING:
|
||||
return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case InsuranceActions.EXECUTION_PRESCRIPTION_SUCCESS:
|
||||
return {
|
||||
loading: false,
|
||||
result: action.payload,
|
||||
error: null
|
||||
}
|
||||
case InsuranceActions.EXECUTION_PRESCRIPTION_ERROR:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.payload
|
||||
}
|
||||
|
||||
case InsuranceActions.EXECUTION_PRESCRIPTION_RESET:
|
||||
return INITIAL_STATE;
|
||||
|
||||
default:
|
||||
return state
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -24,6 +24,7 @@ const selectCreateConsultationReducer = (state) => state.createConsultationReduc
|
|||
const selectGetAmountConsultationReducer = (state) => state.getAmountConsultationReducer;
|
||||
const selectGetConsultationReducer = (state) => state.getConsultationReducer;
|
||||
const selectAcceptRefuseConsultationReducer = (state) => state.acceptOrRejectConsultationReducer;
|
||||
const selectExecutionPrescriptionReducerReducer = (state) => state.executionPrescriptionReducer;
|
||||
|
||||
export const selectInsuranceList = createSelector(
|
||||
[selectInsuranceListReducer],
|
||||
|
@ -100,3 +101,7 @@ export const selectAcceptRefuseConsultation = createSelector(
|
|||
[selectAcceptRefuseConsultationReducer],
|
||||
(acceptRejectConsultation) => acceptRejectConsultation
|
||||
);
|
||||
export const selectExecutionPrescription = createSelector(
|
||||
[selectExecutionPrescriptionReducerReducer],
|
||||
(executionPrescription) => executionPrescription
|
||||
);
|
||||
|
|
|
@ -90,5 +90,10 @@ const InsuranceActions = {
|
|||
ACCEPT_REJECT_CONSULTATION_SUCCESS: 'ACCEPT_REJECT_CONSULTATION_SUCCESS',
|
||||
ACCEPT_REJECT_CONSULTATION_ERROR: 'ACCEPT_REJECT_CONSULTATION_ERROR',
|
||||
ACCEPT_REJECT_CONSULTATION_RESET: 'ACCEPT_REJECT_CONSULTATION_RESET',
|
||||
|
||||
EXECUTION_PRESCRIPTION_PENDING: 'EXECUTION_PRESCRIPTION_PENDING',
|
||||
EXECUTION_PRESCRIPTION_SUCCESS: 'EXECUTION_PRESCRIPTION_SUCCESS',
|
||||
EXECUTION_PRESCRIPTION_ERROR: 'EXECUTION_PRESCRIPTION_ERROR',
|
||||
EXECUTION_PRESCRIPTION_RESET: 'EXECUTION_PRESCRIPTION_RESET',
|
||||
}
|
||||
export default InsuranceActions;
|
||||
|
|
|
@ -55,7 +55,7 @@ import {
|
|||
activatePaySubscriptionReducer,
|
||||
addBeneficiaryToSubscriptionReducer,
|
||||
addDrugReducer,
|
||||
createConsultationReducer, getAmountConsultationReducer, getConsultationReducer,
|
||||
createConsultationReducer, executionPrescriptionReducer, getAmountConsultationReducer, getConsultationReducer,
|
||||
getDrugAppareilReducer,
|
||||
getInsurancePrimeAmountReducer,
|
||||
getNetworkActReducer,
|
||||
|
@ -169,7 +169,8 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
|||
createConsultationReducer: createConsultationReducer,
|
||||
getAmountConsultationReducer: getAmountConsultationReducer,
|
||||
getConsultationReducer: getConsultationReducer,
|
||||
acceptOrRejectConsultationReducer: acceptOrRejectConsultationReducer
|
||||
acceptOrRejectConsultationReducer: acceptOrRejectConsultationReducer,
|
||||
executionPrescriptionReducer: executionPrescriptionReducer
|
||||
});
|
||||
|
||||
export default rootReducer;
|
||||
|
|
|
@ -68,5 +68,6 @@
|
|||
"acceptPrestationAgent": "acceptPrestationAgent",
|
||||
"souscrireAssuranceUser": "souscrireAssuranceUser",
|
||||
"askPrestationUser": "askPrestationUser",
|
||||
"saisirFeuilleSoinScreen": "saisirFeuilleSoinScreen"
|
||||
"saisirFeuilleSoinScreen": "saisirFeuilleSoinScreen",
|
||||
"executerPrescriptionScreen": "executerPrescriptionScreen"
|
||||
}
|
||||
|
|
|
@ -272,7 +272,8 @@ export default class OptionsMenu extends Component {
|
|||
|| item === 'envoieCashVersCarteAgent' || item === 'modifyIdentificationUser' || item === 'createGroupNanoCredit' || item === 'groupNanoCredit' || item === 'demandeValidationGroupe'
|
||||
|| item === 'adhererGroupNanoCredit' || item === 'myNanoCreditGroup' || item === 'askNanoCredit' || item === 'refundNanoCreditUser' || item === 'cautionNanoCreditAgent'
|
||||
|| 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') {
|
||||
return null
|
||||
} else {
|
||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -67,7 +67,7 @@ const ValidateConsultationScreen = ({
|
|||
readUser().then((user) => {
|
||||
setUser(user);
|
||||
console.log("User", user);
|
||||
fetchGetConsultation(user.id);
|
||||
fetchGetConsultation(user.id, 'UNTREATED');
|
||||
});
|
||||
dispatch(fetchGetConsultationReset());
|
||||
dispatch(fetchAcceptRejectConsultationReset());
|
||||
|
@ -101,6 +101,8 @@ const ValidateConsultationScreen = ({
|
|||
],
|
||||
{cancelable: false}
|
||||
);
|
||||
if (user !== null)
|
||||
fetchGetConsultation(user.id, 'UNTREATED');
|
||||
}
|
||||
|
||||
if (acceptRefuseConsultation.error) {
|
||||
|
@ -111,6 +113,8 @@ const ValidateConsultationScreen = ({
|
|||
);
|
||||
dispatch(fetchAcceptRejectConsultationReset());
|
||||
setDisplayModalHistory(false);
|
||||
if (user !== null)
|
||||
fetchGetConsultation(user.id, 'UNTREATED');
|
||||
}
|
||||
}, [acceptRefuseConsultation]);
|
||||
|
||||
|
@ -336,6 +340,11 @@ const ValidateConsultationScreen = ({
|
|||
(
|
||||
<FlatList
|
||||
style={{flex: 1}}
|
||||
ListEmptyComponent={() => {
|
||||
return (
|
||||
<Text>{I18n.t('NO_CONSULTATION_DEMAND')}</Text>
|
||||
)
|
||||
}}
|
||||
data={getConsultation.result.response}
|
||||
keyExtractor={(item, index) => item.id}
|
||||
renderItem={({item, index}) => (
|
||||
|
|
|
@ -621,9 +621,9 @@ export const optionNanoSanteAgentScreen = {
|
|||
title: 'SAISIR_FEUILLE_SOIN',
|
||||
},
|
||||
{
|
||||
screen: route.cautionNanoCreditAgent,
|
||||
screen: route.executerPrescriptionScreen,
|
||||
icon: 'edit',
|
||||
title: 'MODIFIER_FEUILLE_SOIN',
|
||||
title: 'EXECUTER_PRESCRIPTION',
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -608,6 +608,7 @@
|
|||
"SELECT_SUBSCRIPTION": "Sélectionner une souscription",
|
||||
"SAISIR_FEUILLE_SOIN": "Créer une consultation",
|
||||
"MODIFIER_FEUILLE_SOIN": "Modifier une feuille de soin",
|
||||
"EXECUTER_PRESCRIPTION": "Exécuter prescription",
|
||||
"FACTURER_FEUILLES_SOINS": "Facturer les feuilles de soins",
|
||||
"FICHE_DE_SOIN": "Fiche de soins",
|
||||
"PATIENT": "Patient",
|
||||
|
@ -678,4 +679,6 @@
|
|||
"ACCEPT": "Accepter",
|
||||
"REJECT": "Rejeter",
|
||||
"DETAIL": "Détail",
|
||||
"NO_CONSULTATION_DEMAND": "Aucune demande de consultation",
|
||||
"LIST_CONSULTATION": "Liste des consultations"
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ export const subscribeInsuranceUrl = testBaseUrl + '/nanoSanteService/insurances
|
|||
export const getProviderClassUrl = testBaseUrl + '/nanoSanteService/provider-classes';
|
||||
export const getNetworkActsUrl = testBaseUrl + '/nanoSanteService/acts';
|
||||
export const createConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/consultation';
|
||||
export const executionPrescriptionUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/execution';
|
||||
export const consultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets';
|
||||
export const getAmountConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/performances-amount';
|
||||
export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount';
|
||||
|
|
Loading…
Reference in New Issue