Consultation OK
This commit is contained in:
parent
26c6de01a6
commit
c90a4f3ad6
|
@ -8,6 +8,7 @@
|
||||||
import InsuranceActions from './insurance.type';
|
import InsuranceActions from './insurance.type';
|
||||||
import {
|
import {
|
||||||
createConsultationUrl,
|
createConsultationUrl,
|
||||||
|
getAmountConsultationUrl,
|
||||||
getDrugAndDevicesUrl,
|
getDrugAndDevicesUrl,
|
||||||
getInsuranceListUrl,
|
getInsuranceListUrl,
|
||||||
getInsurancePrimeAmountUrl,
|
getInsurancePrimeAmountUrl,
|
||||||
|
@ -432,3 +433,33 @@ export const fetchCreateConsultation = (data) => {
|
||||||
onError: fetchCreateConsultationError,
|
onError: fetchCreateConsultationError,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/************************************************************/
|
||||||
|
export const fetchGetAmountConsultationPending = () => ({
|
||||||
|
type: InsuranceActions.GET_AMOUNT_CONSULTATION_PENDING,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetAmountConsultationReset = () => ({
|
||||||
|
type: InsuranceActions.GET_AMOUNT_CONSULTATION_RESET,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetAmountConsultationSuccess = (authkey: any) => ({
|
||||||
|
type: InsuranceActions.GET_AMOUNT_CONSULTATION_SUCCESS,
|
||||||
|
payload: authkey,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetAmountConsultationError = (error: any) => ({
|
||||||
|
type: InsuranceActions.GET_AMOUNT_CONSULTATION_ERROR,
|
||||||
|
payload: error,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetAmountConsultation = (data) => {
|
||||||
|
return ApiAction({
|
||||||
|
url: `${getAmountConsultationUrl}`,
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
onLoading: fetchGetAmountConsultationPending,
|
||||||
|
onSuccess: fetchGetAmountConsultationSuccess,
|
||||||
|
onError: fetchGetAmountConsultationError,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
|
@ -437,3 +437,33 @@ export const createConsultationReducer = (state = INITIAL_STATE, action: Insuran
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getAmountConsultationReducer = (state = INITIAL_STATE, action: InsuranceActions) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case InsuranceActions.GET_AMOUNT_CONSULTATION_PENDING:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case InsuranceActions.GET_AMOUNT_CONSULTATION_SUCCESS:
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
result: action.payload,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case InsuranceActions.GET_AMOUNT_CONSULTATION_ERROR:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.payload
|
||||||
|
}
|
||||||
|
|
||||||
|
case InsuranceActions.GET_AMOUNT_CONSULTATION_RESET:
|
||||||
|
return INITIAL_STATE;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return state
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -21,6 +21,7 @@ const selectAddDrugReducer = (state) => state.addDrugReducer;
|
||||||
const selectGetProviderClassReducer = (state) => state.getProviderClassReducer;
|
const selectGetProviderClassReducer = (state) => state.getProviderClassReducer;
|
||||||
const selectGetNetworkActReducer = (state) => state.getNetworkActReducer;
|
const selectGetNetworkActReducer = (state) => state.getNetworkActReducer;
|
||||||
const selectCreateConsultationReducer = (state) => state.createConsultationReducer;
|
const selectCreateConsultationReducer = (state) => state.createConsultationReducer;
|
||||||
|
const selectGetAmountConsultationReducer = (state) => state.getAmountConsultationReducer;
|
||||||
|
|
||||||
export const selectInsuranceList = createSelector(
|
export const selectInsuranceList = createSelector(
|
||||||
[selectInsuranceListReducer],
|
[selectInsuranceListReducer],
|
||||||
|
@ -85,3 +86,7 @@ export const selectGetNetworkAct = createSelector(
|
||||||
[selectGetNetworkActReducer],
|
[selectGetNetworkActReducer],
|
||||||
(getNetworkActReducer) => getNetworkActReducer
|
(getNetworkActReducer) => getNetworkActReducer
|
||||||
);
|
);
|
||||||
|
export const selectGetAmountConsultation = createSelector(
|
||||||
|
[selectGetAmountConsultationReducer],
|
||||||
|
(getAmountConsultationReducer) => getAmountConsultationReducer
|
||||||
|
);
|
||||||
|
|
|
@ -75,5 +75,10 @@ const InsuranceActions = {
|
||||||
CREATE_CONSULTATION_SUCCESS: 'CREATE_CONSULTATION_SUCCESS',
|
CREATE_CONSULTATION_SUCCESS: 'CREATE_CONSULTATION_SUCCESS',
|
||||||
CREATE_CONSULTATION_ERROR: 'CREATE_CONSULTATION_ERROR',
|
CREATE_CONSULTATION_ERROR: 'CREATE_CONSULTATION_ERROR',
|
||||||
CREATE_CONSULTATION_RESET: 'CREATE_CONSULTATION_RESET',
|
CREATE_CONSULTATION_RESET: 'CREATE_CONSULTATION_RESET',
|
||||||
|
|
||||||
|
GET_AMOUNT_CONSULTATION_PENDING: 'GET_AMOUNT_CONSULTATION_PENDING',
|
||||||
|
GET_AMOUNT_CONSULTATION_SUCCESS: 'GET_AMOUNT_CONSULTATION_SUCCESS',
|
||||||
|
GET_AMOUNT_CONSULTATION_ERROR: 'GET_AMOUNT_CONSULTATION_ERROR',
|
||||||
|
GET_AMOUNT_CONSULTATION_RESET: 'GET_AMOUNT_CONSULTATION_RESET',
|
||||||
}
|
}
|
||||||
export default InsuranceActions;
|
export default InsuranceActions;
|
||||||
|
|
|
@ -54,7 +54,7 @@ import {
|
||||||
activatePaySubscriptionReducer,
|
activatePaySubscriptionReducer,
|
||||||
addBeneficiaryToSubscriptionReducer,
|
addBeneficiaryToSubscriptionReducer,
|
||||||
addDrugReducer,
|
addDrugReducer,
|
||||||
createConsultationReducer,
|
createConsultationReducer, getAmountConsultationReducer,
|
||||||
getDrugAppareilReducer,
|
getDrugAppareilReducer,
|
||||||
getInsurancePrimeAmountReducer,
|
getInsurancePrimeAmountReducer,
|
||||||
getNetworkActReducer,
|
getNetworkActReducer,
|
||||||
|
@ -165,7 +165,8 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
addDrugReducer: addDrugReducer,
|
addDrugReducer: addDrugReducer,
|
||||||
getProviderClassReducer: getProviderClassReducer,
|
getProviderClassReducer: getProviderClassReducer,
|
||||||
getNetworkActReducer: getNetworkActReducer,
|
getNetworkActReducer: getNetworkActReducer,
|
||||||
createConsultationReducer: createConsultationReducer
|
createConsultationReducer: createConsultationReducer,
|
||||||
|
getAmountConsultationReducer: getAmountConsultationReducer
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
||||||
|
|
|
@ -32,8 +32,11 @@ import {
|
||||||
fetchActivePaySubscription,
|
fetchActivePaySubscription,
|
||||||
fetchActivePaySubscriptionReset,
|
fetchActivePaySubscriptionReset,
|
||||||
fetchAddDrug,
|
fetchAddDrug,
|
||||||
|
fetchAddDrugReset,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
fetchCreateConsultationReset,
|
fetchCreateConsultationReset,
|
||||||
|
fetchGetAmountConsultation,
|
||||||
|
fetchGetAmountConsultationReset,
|
||||||
fetchGetDrugAppareil,
|
fetchGetDrugAppareil,
|
||||||
fetchGetDrugAppareilReset,
|
fetchGetDrugAppareilReset,
|
||||||
fetchGetNetworkActs,
|
fetchGetNetworkActs,
|
||||||
|
@ -55,6 +58,7 @@ import {
|
||||||
selectActivatePaySubscription,
|
selectActivatePaySubscription,
|
||||||
selectAddDrug,
|
selectAddDrug,
|
||||||
selectCreateConsultation,
|
selectCreateConsultation,
|
||||||
|
selectGetAmountConsultation,
|
||||||
selectGetDrugAppareil,
|
selectGetDrugAppareil,
|
||||||
selectGetNetworkAct,
|
selectGetNetworkAct,
|
||||||
selectGetProviderClass,
|
selectGetProviderClass,
|
||||||
|
@ -255,6 +259,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
fetchGetProviderClass,
|
fetchGetProviderClass,
|
||||||
fetchGetNetworkActs,
|
fetchGetNetworkActs,
|
||||||
fetchCreateConsultation,
|
fetchCreateConsultation,
|
||||||
|
fetchGetAmountConsultation,
|
||||||
getUserByNameOrNumber,
|
getUserByNameOrNumber,
|
||||||
getUserByIdQRCode,
|
getUserByIdQRCode,
|
||||||
getDrugAppareil,
|
getDrugAppareil,
|
||||||
|
@ -262,10 +267,11 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
addDrug,
|
addDrug,
|
||||||
createConsultation,
|
createConsultation,
|
||||||
getNetworkAct,
|
getNetworkAct,
|
||||||
|
getAmountConsultation,
|
||||||
navigation
|
navigation
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const [datePrestation, setDatePrestation] = useState('' + moment(new Date()).format('YYYY-MM-DD'));
|
const [datePrestation, setDatePrestation] = useState('' + moment(new Date()).format('YYYY-MM-DD HH:mm'));
|
||||||
const [showDatePrestation, setShowDatePrestation] = useState(false);
|
const [showDatePrestation, setShowDatePrestation] = useState(false);
|
||||||
|
|
||||||
const [dateAccident, setDateAccident] = useState(null);
|
const [dateAccident, setDateAccident] = useState(null);
|
||||||
|
@ -276,13 +282,13 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
const [wallet] = useState(store.getState().walletDetailReducer.result.response);
|
const [wallet] = useState(store.getState().walletDetailReducer.result.response);
|
||||||
|
|
||||||
const [isNumeroAssureSearch, setIsNumeroAssureSearch] = useState(true);
|
const [isNumeroAssureSearch, setIsNumeroAssureSearch] = useState(true);
|
||||||
const [isNomAssureSearch, setIsNomAssureSearch] = useState(false);
|
|
||||||
|
|
||||||
const [dateDebutGrossesse, setDateDebutGrossesse] = useState(null);
|
const [dateDebutGrossesse, setDateDebutGrossesse] = useState(null);
|
||||||
const [dateFinGrossesse, setDateFinGrossesse] = useState(null);
|
const [dateFinGrossesse, setDateFinGrossesse] = useState(null);
|
||||||
const [isGrossesse, setIsGrossesse] = useState(false);
|
const [isGrossesse, setIsGrossesse] = useState(false);
|
||||||
const [showDateDebutGrossessePicker, setShowDateDebutGrossessePicker] = useState(false);
|
const [showDateDebutGrossessePicker, setShowDateDebutGrossessePicker] = useState(false);
|
||||||
const [showDateFinGrossessePicker, setShowDateFinGrossessePicker] = useState(false);
|
const [showDateFinGrossessePicker, setShowDateFinGrossessePicker] = useState(false);
|
||||||
|
const [careConditon, setCareCondition] = useState(null);
|
||||||
|
|
||||||
const [user, setUser] = useState(null);
|
const [user, setUser] = useState(null);
|
||||||
const [assure, setAssure] = useState(null);
|
const [assure, setAssure] = useState(null);
|
||||||
|
@ -294,6 +300,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
const [currentStep, setCurrentStep] = useState(1);
|
const [currentStep, setCurrentStep] = useState(1);
|
||||||
const [modalPrestation, setModalPrestation] = useState(false);
|
const [modalPrestation, setModalPrestation] = useState(false);
|
||||||
const [modalMedicament, setModalMedicament] = useState(false);
|
const [modalMedicament, setModalMedicament] = useState(false);
|
||||||
|
const [modalAddMedicament, setModalAddMedicament] = useState(false);
|
||||||
const [modalExamen, setModalExamen] = useState(false);
|
const [modalExamen, setModalExamen] = useState(false);
|
||||||
const [modalListAssure, setModalListAssure] = useState(false);
|
const [modalListAssure, setModalListAssure] = useState(false);
|
||||||
const [modalListMedicament, setModalListMedicament] = useState(false);
|
const [modalListMedicament, setModalListMedicament] = useState(false);
|
||||||
|
@ -333,13 +340,24 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
const [conditionPriseEnChange] = useState([
|
const [conditionPriseEnChange] = useState([
|
||||||
{label: I18n.t('AFFECTION_COURANTE'), value: "CURRENT_AFFECTION"},
|
{label: I18n.t('AFFECTION_COURANTE'), value: "CURRENT_AFFECTION"},
|
||||||
{label: I18n.t('AFFECTION_LONGUE'), value: "LONG_TERM_AFFECTION"},
|
{label: I18n.t('AFFECTION_LONGUE'), value: "LONG_TERM_AFFECTION"},
|
||||||
{label: I18n.t('EXONERE'), value: "EXONERATION"},
|
{
|
||||||
|
label:
|
||||||
|
I18n.t('EXONERE'), value: "EXONERATION"
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const [onPrescription] = useState([
|
||||||
|
{label: I18n.t('COMPRESSED'), value: "COMPRESSED"},
|
||||||
|
{label: I18n.t('SYRUP'), value: "SYRUP"},
|
||||||
|
{label: I18n.t('SOLUTION'), value: "SOLUTION"},
|
||||||
|
{label: I18n.t('SUPPOSITORY'), value: "SUPPOSITORY"},
|
||||||
|
{label: I18n.t('DEVICE'), value: "DEVICE"},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
let dropDownAlertRef: any = null;
|
let dropDownAlertRef: any = null;
|
||||||
let classificationRef = null;
|
let classificationRef = null;
|
||||||
let codeActeRef = null;
|
let codeActeRef = null;
|
||||||
|
let onPrescriptionRef = null;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
|
@ -355,6 +373,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
dispatch(fetchCreateConsultationReset());
|
dispatch(fetchCreateConsultationReset());
|
||||||
dispatch(fetchGetNetworkActsReset());
|
dispatch(fetchGetNetworkActsReset());
|
||||||
dispatch(fetchGetProviderClassReset());
|
dispatch(fetchGetProviderClassReset());
|
||||||
|
dispatch(fetchAddDrugReset());
|
||||||
|
|
||||||
fetchGetProviderClass(wallet.id_network);
|
fetchGetProviderClass(wallet.id_network);
|
||||||
fetchGetNetworkActs(wallet.id_network, '');
|
fetchGetNetworkActs(wallet.id_network, '');
|
||||||
|
@ -397,6 +416,22 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
if (getDrugAppareil.result !== null) {
|
if (getDrugAppareil.result !== null) {
|
||||||
if (getDrugAppareil.result.response.length > 0) {
|
if (getDrugAppareil.result.response.length > 0) {
|
||||||
setModalListMedicament(true);
|
setModalListMedicament(true);
|
||||||
|
} else {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABEL"),
|
||||||
|
I18n.t('NO_DRUG_MATCH_YOU_SEARCH'),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
setModalAddMedicament(true);
|
||||||
|
dispatch(fetchGetDrugAppareilReset());
|
||||||
|
dispatch(fetchAddDrugReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
{cancelable: false}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,6 +445,22 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
}, [getDrugAppareil]);
|
}, [getDrugAppareil]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (addDrug.result !== null) {
|
||||||
|
setModalAddMedicament(false);
|
||||||
|
setMedicament(addDrug.result.response);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addDrug.error) {
|
||||||
|
dropDownAlertRef.alertWithType(
|
||||||
|
'error',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
Utils.getErrorMsg(addDrug),
|
||||||
|
);
|
||||||
|
dispatch(fetchAddDrugReset());
|
||||||
|
}
|
||||||
|
}, [addDrug]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (createConsultation.result !== null) {
|
if (createConsultation.result !== null) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
|
@ -438,8 +489,6 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
}
|
}
|
||||||
}, [createConsultation]);
|
}, [createConsultation]);
|
||||||
|
|
||||||
|
|
||||||
console.log("Date accident", dateAccident);
|
|
||||||
const SaisirFeuilleSoinSchema = Yup.object().shape({
|
const SaisirFeuilleSoinSchema = Yup.object().shape({
|
||||||
numero_assure: Yup.string()
|
numero_assure: Yup.string()
|
||||||
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
||||||
|
@ -471,6 +520,12 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
drug_posologie: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
drug_posologie: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const AddNewMedicamentToDB = Yup.object().shape({
|
||||||
|
code: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
||||||
|
name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
||||||
|
type: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED'))
|
||||||
|
});
|
||||||
|
|
||||||
const onChangeDatePrestation = (event, selectedDate) => {
|
const onChangeDatePrestation = (event, selectedDate) => {
|
||||||
const currentDate = selectedDate || '' + moment(new Date()).format('YYYY-MM-DD');
|
const currentDate = selectedDate || '' + moment(new Date()).format('YYYY-MM-DD');
|
||||||
setShowDatePrestation(Platform.OS === 'ios');
|
setShowDatePrestation(Platform.OS === 'ios');
|
||||||
|
@ -481,7 +536,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
return (<DateTimePicker
|
return (<DateTimePicker
|
||||||
timeZoneOffsetInMinutes={0}
|
timeZoneOffsetInMinutes={0}
|
||||||
is24Hour={true}
|
is24Hour={true}
|
||||||
value={new Date(dateNaissance)}
|
value={new Date(datePrestation)}
|
||||||
mode='date'
|
mode='date'
|
||||||
display="spinner"
|
display="spinner"
|
||||||
onChange={onChangeDatePrestation}
|
onChange={onChangeDatePrestation}
|
||||||
|
@ -581,21 +636,21 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
initialValues={{
|
initialValues={{
|
||||||
amount_prestation: '',
|
amount_prestation: '',
|
||||||
frais_deplacement: '',
|
frais_deplacement: '',
|
||||||
ticker_moderateur: '',
|
|
||||||
date_prestation: '',
|
|
||||||
code_acte: ''
|
code_acte: ''
|
||||||
}}
|
}}
|
||||||
onSubmit={(values) => {
|
onSubmit={(values) => {
|
||||||
if (values.code_acte === '')
|
if (values.code_acte === '')
|
||||||
codeActeRef.shake(200)
|
codeActeRef.shake(200)
|
||||||
else
|
else {
|
||||||
setPrestations([{
|
setPrestations([{
|
||||||
act_id: values.code_acte,
|
act_id: values.code_acte,
|
||||||
amount: values.amount_prestation,
|
amount: values.amount_prestation,
|
||||||
home_visit_fees: values.frais_deplacement
|
home_visit_fees: values.frais_deplacement
|
||||||
}, ...prestations]);
|
}, ...prestations]);
|
||||||
setModalPrestation(false);
|
setModalPrestation(false);
|
||||||
Utils.displayToast(I18n.t('PRESTATION_SUCCESSFULLY_ADD'));
|
Utils.displayToast(I18n.t('PRESTATION_SUCCESSFULLY_ADD'));
|
||||||
|
}
|
||||||
|
|
||||||
}}>
|
}}>
|
||||||
|
|
||||||
{({
|
{({
|
||||||
|
@ -632,16 +687,8 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
<TextInput
|
<TextInput
|
||||||
style={{marginTop: 10}}
|
style={{marginTop: 10}}
|
||||||
placeholder={I18n.t('DATE')}
|
placeholder={I18n.t('DATE')}
|
||||||
value={'' + moment(datePrestation).format('YYYY-MM-DD')}
|
value={'' + moment(datePrestation).format('YYYY-MM-DD HH:mm')}
|
||||||
onChangeText={handleChange('date_prestation')}
|
editable={false}
|
||||||
onBlur={handleBlur('date_prestation')}
|
|
||||||
onFocus={() => {
|
|
||||||
Keyboard.dismiss();
|
|
||||||
setShowDatePrestation(true);
|
|
||||||
}}
|
|
||||||
success={touched.date_prestation && !errors.date_prestation}
|
|
||||||
touched={touched.date_prestation}
|
|
||||||
error={errors.date_prestation}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => {
|
<Animatable.View ref={(comp) => {
|
||||||
|
@ -683,25 +730,27 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
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={() => {
|
||||||
|
fetchGetAmountConsultation({
|
||||||
|
network_id: wallet.id_network,
|
||||||
|
amount: values.amount_prestation,
|
||||||
|
care_condition: careConditon
|
||||||
|
});
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
style={{marginTop: 10}}
|
style={{marginTop: 10}}
|
||||||
placeholder={I18n.t('TICKET_MONDERATEUR')}
|
placeholder={I18n.t('TICKET_MONDERATEUR')}
|
||||||
value={values.ticker_moderateur}
|
editable={false}
|
||||||
onChangeText={handleChange('ticker_moderateur')}
|
value={getAmountConsultation.result !== null ? getAmountConsultation.result.response.moderator_ticket : ''}
|
||||||
onBlur={handleBlur('ticker_moderateur')}
|
|
||||||
success={touched.ticker_moderateur && !errors.ticker_moderateur}
|
|
||||||
touched={touched.ticker_moderateur}
|
|
||||||
error={errors.ticker_moderateur}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<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={getAmountConsultation.result !== null ? getAmountConsultation.result.response.insurance_amount : ''}/>
|
||||||
/>
|
|
||||||
|
|
||||||
<View style={{
|
<View style={{
|
||||||
marginTop: 10,
|
marginTop: 10,
|
||||||
|
@ -811,6 +860,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
success={touched.drug_name && !errors.drug_name}
|
success={touched.drug_name && !errors.drug_name}
|
||||||
touched={touched.drug_name}
|
touched={touched.drug_name}
|
||||||
error={errors.drug_name}
|
error={errors.drug_name}
|
||||||
|
editable={medicament === null}
|
||||||
/>
|
/>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={[
|
style={[
|
||||||
|
@ -879,6 +929,145 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
</Formik>
|
</Formik>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const renderAddNewMedicamentToDB = () => (
|
||||||
|
<Formik validationSchema={AddNewMedicamentToDB}
|
||||||
|
initialValues={{
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
type: '',
|
||||||
|
on_prescription: false
|
||||||
|
}}
|
||||||
|
onSubmit={(values) => {
|
||||||
|
setMedicament(null);
|
||||||
|
fetchAddDrug({
|
||||||
|
network_id: wallet.id_network,
|
||||||
|
code: values.code,
|
||||||
|
name: values.name,
|
||||||
|
type: values.type,
|
||||||
|
on_prescription: values.on_prescription
|
||||||
|
})
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{({
|
||||||
|
values,
|
||||||
|
errors,
|
||||||
|
touched,
|
||||||
|
handleChange,
|
||||||
|
handleBlur,
|
||||||
|
handleSubmit,
|
||||||
|
setFieldValue,
|
||||||
|
|
||||||
|
isSubmitting,
|
||||||
|
}) => (
|
||||||
|
<ScrollView style={{flex: 1}}>
|
||||||
|
<View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
|
||||||
|
<Modal
|
||||||
|
isVisible={modalAddMedicament}
|
||||||
|
onSwipeComplete={() => {
|
||||||
|
setModalAddMedicament(false);
|
||||||
|
}}
|
||||||
|
swipeDirection={['down']}
|
||||||
|
style={styles.bottomModal}>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.contentFilterBottom,
|
||||||
|
{backgroundColor: Color.containerBackgroundColor},
|
||||||
|
]}>
|
||||||
|
<View style={styles.contentSwipeDown}>
|
||||||
|
<View style={styles.lineSwipeDown}/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Text body2 style={{marginTop: 10}}>{I18n.t('AJOUTER_NOUVEAU_MEDICAMENT')}</Text>
|
||||||
|
<TextInput
|
||||||
|
style={{marginTop: 10}}
|
||||||
|
placeholder='Code'
|
||||||
|
value={values.code}
|
||||||
|
onChangeText={handleChange('code')}
|
||||||
|
onBlur={handleBlur('code')}
|
||||||
|
success={touched.code && !errors.code}
|
||||||
|
touched={touched.code}
|
||||||
|
error={errors.code}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={{marginTop: 10}}
|
||||||
|
placeholder={I18n.t('NAME')}
|
||||||
|
value={values.name}
|
||||||
|
onChangeText={handleChange('name')}
|
||||||
|
onBlur={handleBlur('name')}
|
||||||
|
success={touched.name && !errors.name}
|
||||||
|
touched={touched.name}
|
||||||
|
error={errors.name}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<Animatable.View ref={(comp) => {
|
||||||
|
onPrescriptionRef = comp
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
width: responsiveWidth(90),
|
||||||
|
height: 60,
|
||||||
|
alignSelf: 'center',
|
||||||
|
borderRadius: 10,
|
||||||
|
paddingLeft: 20,
|
||||||
|
marginTop: 10,
|
||||||
|
paddingRight: 20,
|
||||||
|
backgroundColor: 'white'
|
||||||
|
}}>
|
||||||
|
<Dropdown
|
||||||
|
label='Type'
|
||||||
|
data={onPrescription}
|
||||||
|
useNativeDriver={true}
|
||||||
|
onChangeText={(value, index, data) => {
|
||||||
|
setFieldValue('type', value.value);
|
||||||
|
}}
|
||||||
|
valueExtractor={(value) => {
|
||||||
|
return value
|
||||||
|
}}
|
||||||
|
labelExtractor={(value) => {
|
||||||
|
return value.label
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Animatable.View>
|
||||||
|
|
||||||
|
<View style={{
|
||||||
|
marginTop: 10,
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: "space-between"
|
||||||
|
}}>
|
||||||
|
<Text body2>{I18n.t('SOUS_ORDONNANCE')}</Text>
|
||||||
|
<View style={{width: responsiveWidth(60)}}>
|
||||||
|
<SwitchSelector options={grossesse}
|
||||||
|
initial={1}
|
||||||
|
buttonColor={Color.accentColor}
|
||||||
|
backgroundColor={Color.primaryDarkColor}
|
||||||
|
textColor='white'
|
||||||
|
bold={true}
|
||||||
|
hasPadding
|
||||||
|
height={32}
|
||||||
|
onPress={(value) => {
|
||||||
|
setFieldValue('on_prescription', value === 'YES');
|
||||||
|
console.log("On Prescription", value);
|
||||||
|
//setGender(value);
|
||||||
|
}}/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style={{marginTop: 20, marginBottom: 20}}
|
||||||
|
full
|
||||||
|
loading={addDrug.loading}
|
||||||
|
onPress={handleSubmit}>
|
||||||
|
{I18n.t('SUBMIT_LABEL')}
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
</Modal>
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
)}
|
||||||
|
</Formik>
|
||||||
|
);
|
||||||
|
|
||||||
const renderAddNewExamen = () => (
|
const renderAddNewExamen = () => (
|
||||||
<Formik validationSchema={AddNewExamen}
|
<Formik validationSchema={AddNewExamen}
|
||||||
initialValues={{
|
initialValues={{
|
||||||
|
@ -1431,6 +1620,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
useNativeDriver={true}
|
useNativeDriver={true}
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
console.log("Value", value);
|
console.log("Value", value);
|
||||||
|
setCareCondition(value);
|
||||||
setFieldTouched('care_condition');
|
setFieldTouched('care_condition');
|
||||||
setFieldValue('care_condition', value);
|
setFieldValue('care_condition', value);
|
||||||
}}
|
}}
|
||||||
|
@ -1582,7 +1772,14 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
onPress={e => {
|
onPress={e => {
|
||||||
setModalPrestation(true);
|
dispatch(fetchGetAmountConsultationReset());
|
||||||
|
if(careConditon === null) {
|
||||||
|
dropDownAlertRef.alertWithType(
|
||||||
|
'warn',
|
||||||
|
I18n.t('ERROR_LABEL'),
|
||||||
|
I18n.t('PLEASE_SELECT_CONDITON_PRISE_CHARGE_FIRST'),
|
||||||
|
);
|
||||||
|
} else setModalPrestation(true);
|
||||||
}}>
|
}}>
|
||||||
<Text whiteColor>{I18n.t('PRESTATION')}</Text>
|
<Text whiteColor>{I18n.t('PRESTATION')}</Text>
|
||||||
<MaterialCommunityIcons
|
<MaterialCommunityIcons
|
||||||
|
@ -1769,6 +1966,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
{showQRCodeScanner && renderDialogQRCodeScanner()}
|
{showQRCodeScanner && renderDialogQRCodeScanner()}
|
||||||
{modalListAssure && renderListAssure()}
|
{modalListAssure && renderListAssure()}
|
||||||
{modalListMedicament && renderListMedicament()}
|
{modalListMedicament && renderListMedicament()}
|
||||||
|
{modalAddMedicament && renderAddNewMedicamentToDB()}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
|
@ -1785,7 +1983,8 @@ const mapStateToProps = createStructuredSelector({
|
||||||
addDrug: selectAddDrug,
|
addDrug: selectAddDrug,
|
||||||
getProviderClass: selectGetProviderClass,
|
getProviderClass: selectGetProviderClass,
|
||||||
createConsultation: selectCreateConsultation,
|
createConsultation: selectCreateConsultation,
|
||||||
getNetworkAct: selectGetNetworkAct
|
getNetworkAct: selectGetNetworkAct,
|
||||||
|
getAmountConsultation: selectGetAmountConsultation
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
export default connect(mapStateToProps, {
|
||||||
|
@ -1797,7 +1996,8 @@ export default connect(mapStateToProps, {
|
||||||
fetchAddDrug,
|
fetchAddDrug,
|
||||||
fetchGetProviderClass,
|
fetchGetProviderClass,
|
||||||
fetchGetNetworkActs,
|
fetchGetNetworkActs,
|
||||||
fetchCreateConsultation
|
fetchCreateConsultation,
|
||||||
|
fetchGetAmountConsultation
|
||||||
})(
|
})(
|
||||||
SaisirFeuilleSoinScreen,
|
SaisirFeuilleSoinScreen,
|
||||||
);
|
);
|
||||||
|
|
|
@ -662,5 +662,14 @@
|
||||||
"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": "Examens ajouté avec succès",
|
||||||
"PRESCRIPTIONS_SUCCESSFULLY_ADD": "Prescription ajouté avec succès",
|
"PRESCRIPTIONS_SUCCESSFULLY_ADD": "Prescription ajouté 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",
|
||||||
|
"NO_DRUG_MATCH_YOU_SEARCH": "Aucun médicament ne correspond à votre rechercher, voulez-vous en ajouter ?",
|
||||||
|
"COMPRESSED": "Comprimé",
|
||||||
|
"SYRUP": "Sirop",
|
||||||
|
"SOLUTION": "Solution",
|
||||||
|
"SUPPOSITORY": "Suppositoire",
|
||||||
|
"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"
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,7 @@ export const subscribeInsuranceUrl = testBaseUrl + '/nanoSanteService/insurances
|
||||||
export const getProviderClassUrl = testBaseUrl + '/nanoSanteService/provider-classes';
|
export const getProviderClassUrl = testBaseUrl + '/nanoSanteService/provider-classes';
|
||||||
export const getNetworkActsUrl = testBaseUrl + '/nanoSanteService/acts';
|
export const getNetworkActsUrl = testBaseUrl + '/nanoSanteService/acts';
|
||||||
export const createConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/consultation';
|
export const createConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/consultation';
|
||||||
|
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 uploadInsuranceImagetUrl = 'https://test.ilink-app.com:8086/insurances/subscriptions/upload-images';
|
export const uploadInsuranceImagetUrl = 'https://test.ilink-app.com:8086/insurances/subscriptions/upload-images';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue