Création et modification des consultations

This commit is contained in:
Brice Zele 2022-04-07 14:48:10 +01:00
parent 66fbbe0bf4
commit 6b053091a3
7 changed files with 352 additions and 232 deletions

View File

@ -25,7 +25,7 @@
<meta-data <meta-data
android:name="com.google.android.geo.API_KEY" android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCz4B9uUu3gkuu78Sf72gPWZ3t_qKqf5zg"/> android:value="AIzaSyBUQoQYY31-S3DPp7aRRIAjEda8T2pZvJE"/>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"

View File

@ -5,179 +5,178 @@ import {Animated, Easing, Image, Platform, StyleSheet, View,} from 'react-native
const userposi = require('./../../datas/img/png/user_place.png'); const userposi = require('./../../datas/img/png/user_place.png');
const mnetwork = require('./../../datas/img/png/home_network.png'); const mnetwork = require('./../../datas/img/png/home_network.png');
const othernetwork = require('./../../datas/img/png/other_net.png'); const othernetwork = require('./../../datas/img/png/other_net.png');
class IMarker extends PureComponent { class IMarker extends PureComponent {
constructor(props) { constructor(props) {
super(props) super(props)
const data = this.props.data const data = this.props.data
this.state = { this.state = {
animation: new Animated.Value(0), animation: new Animated.Value(0),
subanimation: new Animated.Value(0), subanimation: new Animated.Value(0),
coordinate: { coordinate: {
longitude: parseFloat(data.longitude), longitude: parseFloat(data.longitude),
latitude: parseFloat(data.latitude), latitude: parseFloat(data.latitude),
} }
} }
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const duration = 500 const duration = 500
const oldCoord = { const oldCoord = {
longitude: parseFloat(this.props.data.longitude), longitude: parseFloat(this.props.data.longitude),
latitude: parseFloat(this.props.data.latitude), latitude: parseFloat(this.props.data.latitude),
} }
const coord = { const coord = {
longitude: parseFloat(nextProps.data.longitude), longitude: parseFloat(nextProps.data.longitude),
latitude: parseFloat(nextProps.data.latitude), latitude: parseFloat(nextProps.data.latitude),
} }
if (oldCoord.longitude !== coord.longitude || oldCoord.latitude !== coord.latitude) { if (oldCoord.longitude !== coord.longitude || oldCoord.latitude !== coord.latitude) {
if (Platform.OS === 'android') { if (Platform.OS === 'android') {
if (this.markerRef) { if (this.markerRef) {
this.markerRef._component.animateMarkerToCoordinate( this.markerRef._component.animateMarkerToCoordinate(
coord, coord,
duration duration
); );
}
} else {
/*this.state.coordinate.timing({
cord,
duration
}).start();
*/
}
}
}
startAnimation() {
const initialValue = 0
const finalValue = 1
this.state.animation.setValue(initialValue); //Step 3
Animated.timing( //Step 4
this.state.animation,
{
toValue: finalValue,
duration: 500,
easing: Easing.linear(),
useNativeDriver: true
}
).start();
}
handleViewRef = ref => this.view = ref;
render() {
const {data, network, isSelected} = this.props;
const color = isSelected ? "#F48FB1A0" : "transparent"
const colorSup = isSelected ? "#F06292A0" : "transparent"
const display = isSelected ? "block" : "none";
if (data.longitude && data.latitude) {
return (
<Marker.Animated
coordinate={this.state.coordinate.longitude ? this.state.coordinate : {
longitude: data.longitude,
latitude: data.latitude
}}
id={data.id}
title={this.props.title}
ref={(re) => {
this.markerRef = re
}}
onPress={e => {
if (!this.props.isUser)
this.props.onPress(data)
}}
image={this.getImage(data)}
/>
);
}
return (<View/>)
}
error(erro) {
console.log("on error render image");
console.log(erro);
}
componentDidMount() {
}
componentDidUpdate(prevProps, prevState, snapshot) {
if (this.props.isUser)
if (this.markerRef && this.props.isNeedFocus) {
this.markerRef._component.showCallout()
}
}
getImage(data) {
const {isUser, network} = this.props;
if (isUser) {
return userposi
} else if (network && data.network === network.name) {
return mnetwork
}
return othernetwork
}
getIcon(data) {
const {isSelected} = this.props
return isSelected ? (
<Animated.View style={{
width: 32,
height: 32,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 16,
backgroundColor: isSelected ? "#81D4FAA0" : "transparent",
transform: [
{
scaleX: this.animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [1, 32]
})
},
{
scaleY: this.animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [1, 32]
})
} }
] } else {
}}> /*this.state.coordinate.timing({
<Image style={{alignSelf: 'center'}} source={this.getImage(data)}/> cord,
</Animated.View> duration
) : (<Image style={{alignSelf: 'center'}} source={this.getImage(data)}/>); }).start();
*/
}
}
}
} startAnimation() {
const initialValue = 0
const finalValue = 1
this.state.animation.setValue(initialValue); //Step 3
Animated.timing( //Step 4
this.state.animation,
{
toValue: finalValue,
duration: 500,
easing: Easing.linear(),
useNativeDriver: true
}
).start();
}
startLoopSelectedAnimation() { handleViewRef = ref => this.view = ref;
const initialValue = 0
const finalValue = 1 render() {
this.state.animation.setValue(initialValue); //Step 3 const {data, network, isSelected} = this.props;
Animated.loop(Animated.timing( //Step 4 const color = isSelected ? "#F48FB1A0" : "transparent"
this.state.subanimation, const colorSup = isSelected ? "#F06292A0" : "transparent"
{ const display = isSelected ? "block" : "none";
toValue: finalValue, if (data.longitude && data.latitude) {
duration: 1000,
easing: Easing.linear(), return (
useNativeDriver: true <Marker.Animated
} coordinate={this.state.coordinate.longitude ? this.state.coordinate : {
), {iteration: -1}).start(); longitude: data.longitude,
} latitude: data.latitude
}}
id={data.id}
title={this.props.title}
ref={(re) => {
this.markerRef = re
}}
onPress={e => {
if (!this.props.isUser)
this.props.onPress(data)
}}
image={this.getImage(data)}
/>
);
}
return (<View/>)
}
error(erro) {
console.log("on error render image");
console.log(erro);
}
componentDidMount() {
}
componentDidUpdate(prevProps, prevState, snapshot) {
if (this.props.isUser)
if (this.markerRef && this.props.isNeedFocus) {
this.markerRef._component.showCallout()
}
}
getImage(data) {
const {isUser, network} = this.props;
if (isUser) {
return userposi
} else if (network && data.network === network.name) {
return mnetwork
}
return othernetwork
}
getIcon(data) {
const {isSelected} = this.props
return isSelected ? (
<Animated.View style={{
width: 32,
height: 32,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 16,
backgroundColor: isSelected ? "#81D4FAA0" : "transparent",
transform: [
{
scaleX: this.animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [1, 32]
})
},
{
scaleY: this.animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [1, 32]
})
}
]
}}>
<Image style={{alignSelf: 'center'}} source={this.getImage(data)}/>
</Animated.View>
) : (<Image style={{alignSelf: 'center'}} source={this.getImage(data)}/>);
}
startLoopSelectedAnimation() {
const initialValue = 0
const finalValue = 1
this.state.animation.setValue(initialValue); //Step 3
Animated.loop(Animated.timing( //Step 4
this.state.subanimation,
{
toValue: finalValue,
duration: 1000,
easing: Easing.linear(),
useNativeDriver: true
}
), {iteration: -1}).start();
}
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
width: 52, width: 52,
height: 52 height: 52
}, },
ring: {} ring: {}
}); });
export default IMarker; export default IMarker;

View File

@ -78,7 +78,7 @@ import * as Utils from "../../../utils/UtilsFunction";
import {displayToast, uppercaseFirstLetter} from "../../../utils/UtilsFunction"; import {displayToast, uppercaseFirstLetter} from "../../../utils/UtilsFunction";
import {store} from "../../../redux/store"; import {store} from "../../../redux/store";
import Fontisto from "react-native-vector-icons/Fontisto"; import Fontisto from "react-native-vector-icons/Fontisto";
import {Typography} from "../../../config/typography"; import {FontWeight, Typography} from "../../../config/typography";
let moment = require('moment-timezone'); let moment = require('moment-timezone');
@ -530,6 +530,8 @@ const ExecuterPrescriptionScreen = ({
const PriceModal = Yup.object().shape({ const PriceModal = Yup.object().shape({
price: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')), price: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
examen_quantite: Yup.number(),
code_acte: Yup.object()
}); });
const renderDialogQRCodeScanner = () => { const renderDialogQRCodeScanner = () => {
@ -564,7 +566,9 @@ const ExecuterPrescriptionScreen = ({
const renderPriceModal = () => ( const renderPriceModal = () => (
<Formik validationSchema={PriceModal} <Formik validationSchema={PriceModal}
initialValues={{ initialValues={{
price: '', examen_quantite: '' + elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.quantity : '' : '',
code_acte: '' + elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.act : '' : '',
price: elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.act.amount : '' : ''
}} }}
onSubmit={(values) => { onSubmit={(values) => {
console.log("Value", elementToSetPrice); console.log("Value", elementToSetPrice);
@ -664,6 +668,53 @@ const ExecuterPrescriptionScreen = ({
keyboardType='numeric' keyboardType='numeric'
/> />
{values.code_acte !== '' ?
values.code_acte.billing_type === 'UNIT_PRICE' && (<TextInput
style={{marginTop: 10}}
placeholder={I18n.t('QUANTITE')}
value={'' + values.examen_quantite}
onChangeText={handleChange('examen_quantite')}
onBlur={handleBlur('examen_quantite')}
success={touched.examen_quantite && !errors.examen_quantite}
touched={touched.examen_quantite}
error={errors.examen_quantite}
keyboardType='numeric'
/>) : null}
<View>
<TextInput
style={{marginTop: 10}}
placeholder={I18n.t('AMOUNT')}
value={'' + ((values.code_acte.amount !== null) ? parseFloat(values.examen_quantite) * parseFloat(values.price) : values.price)}
editable={values.code_acte.amount === null}
onChangeText={handleChange('price')}
onBlur={handleBlur('price')}
success={touched.price && !errors.price}
touched={touched.price}
error={errors.price}
keyboardType='numeric'
/>
<View style={{
position: 'absolute',
left: responsiveWidth(82),
top: 20,
flexDirection: 'row'
}}>
<View
style={{
width: 1,
borderLeftColor: '#f0f0f0',
height: 40,
left: -8,
borderLeftWidth: 1,
}}
/>
<Text style={[Typography.body1, FontWeight.bold]}>{values.code_acte.code}</Text>
</View>
</View>
<Button <Button
loading={checkInsuranceCoverageAmount.loading} loading={checkInsuranceCoverageAmount.loading}
full full

View File

@ -540,6 +540,7 @@ const ModifierExecutionPrescriptionScreen = ({
const PriceModal = Yup.object().shape({ const PriceModal = Yup.object().shape({
price: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')), price: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
examen_quantite: Yup.number(),
}); });
const renderDialogQRCodeScanner = () => { const renderDialogQRCodeScanner = () => {

View File

@ -616,13 +616,15 @@ const ModifierFeuilleSoinScreen = ({
const AddNewExamen = Yup.object().shape({ const AddNewExamen = Yup.object().shape({
examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')), examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
code_acte: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')), code_acte: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
examen_quantite: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')) examen_quantite: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
amount: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED'))
}); });
const ModifyNewExamen = Yup.object().shape({ const ModifyNewExamen = Yup.object().shape({
examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')), examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
examen_quantite: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')) examen_quantite: Yup.number(),
amount: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED'))
}); });
const AddNewMedicament = Yup.object().shape({ const AddNewMedicament = Yup.object().shape({
@ -779,7 +781,7 @@ const ModifierFeuilleSoinScreen = ({
care_condition: consultation._care_condition, care_condition: consultation._care_condition,
act_action: "UPDATE", act_action: "UPDATE",
act_type: "PERFORMANCE", act_type: "PERFORMANCE",
act_id: values.code_acte.id, act_id: elementToSetPrice.id,
tmp_sheet_id: tmpSheetId, tmp_sheet_id: tmpSheetId,
performances: [ performances: [
{ {
@ -846,12 +848,20 @@ const ModifierFeuilleSoinScreen = ({
}}> }}>
<Dropdown <Dropdown
label={I18n.t('CODE_ACTE')} label={I18n.t('CODE_ACTE')}
data={getNetworkAct.result !== null ? getNetworkAct.result?.response : []} data={getNetworkAct.result !== null ? getNetworkAct.result?.response.filter(act => act.type === 'CONSULTATION') : []}
useNativeDriver={true} useNativeDriver={true}
value={typeof values.code_acte !== "number" && values.code_acte.name} value={typeof values.code_acte !== "number" && values.code_acte.name}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
setFieldTouched('code_acte'); setFieldTouched('code_acte');
setFieldValue('code_acte', value); setFieldValue('code_acte', value);
if (value.amount !== null) {
setFieldValue('amount_prestation', value.amount);
fetchGetAmountConsultation({
network_id: wallet.id_network,
amount: '' + value.amount,
care_condition: consultation._care_condition
});
}
}} }}
valueExtractor={(value) => { valueExtractor={(value) => {
return value return value
@ -868,17 +878,13 @@ 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,
care_condition: consultation._care_condition care_condition: consultation._care_condition
}); });
}} }}
editable={false}
onBlur={handleBlur('amount_prestation')} onBlur={handleBlur('amount_prestation')}
success={touched.amount_prestation && !errors.amount_prestation} success={touched.amount_prestation && !errors.amount_prestation}
touched={touched.amount_prestation} touched={touched.amount_prestation}
@ -901,7 +907,7 @@ const ModifierFeuilleSoinScreen = ({
editable={false} editable={false}
value={getAmountConsultation.result !== null ? getAmountConsultation.result.response.insurance_amount : value={getAmountConsultation.result !== null ? getAmountConsultation.result.response.insurance_amount :
elementToSetPrice !== null ? elementToSetPrice.drugs === null elementToSetPrice !== null ? elementToSetPrice.drugs === null
? values.moderator_ticket ? values.insurance_amount
: '' : ''}/> : '' : ''}/>
<View style={{ <View style={{
@ -1036,11 +1042,20 @@ const ModifierFeuilleSoinScreen = ({
}}> }}>
<Dropdown <Dropdown
label={I18n.t('CODE_ACTE')} label={I18n.t('CODE_ACTE')}
data={getNetworkAct.result !== null ? getNetworkAct.result?.response : []} data={getNetworkAct.result !== null ? getNetworkAct.result?.response.filter(act => act.type === 'CONSULTATION') : []}
useNativeDriver={true} useNativeDriver={true}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
setFieldTouched('code_acte'); setFieldTouched('code_acte');
setFieldValue('code_acte', value); setFieldValue('code_acte', value);
if (value.billing_type !== 'FREE') {
setFieldValue('amount_prestation', value.amount);
fetchGetAmountConsultation({
network_id: wallet.id_network,
amount: '' + value.amount,
care_condition: consultation._care_condition
});
}
}} }}
valueExtractor={(value) => { valueExtractor={(value) => {
return value return value
@ -1054,6 +1069,7 @@ const ModifierFeuilleSoinScreen = ({
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('AMOUNT')} placeholder={I18n.t('AMOUNT')}
editable={values.code_acte !== '' ? values.code_acte.billing_type === 'FREE' : true}
value={values.amount_prestation} value={values.amount_prestation}
onChangeText={handleChange('amount_prestation')} onChangeText={handleChange('amount_prestation')}
onBlur={handleBlur('amount_prestation')} onBlur={handleBlur('amount_prestation')}
@ -1574,7 +1590,7 @@ const ModifierFeuilleSoinScreen = ({
}}> }}>
<Dropdown <Dropdown
label={I18n.t('CODE_ACTE')} label={I18n.t('CODE_ACTE')}
data={getNetworkAct.result !== null ? getNetworkAct.result?.response : []} data={getNetworkAct.result !== null ? getNetworkAct.result?.response.filter(act => act.type === 'EXAM') : []}
useNativeDriver={true} useNativeDriver={true}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
console.log("Value", value); console.log("Value", value);
@ -1636,7 +1652,8 @@ const ModifierFeuilleSoinScreen = ({
initialValues={{ initialValues={{
examen_name: elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.description : '' : '', examen_name: elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.description : '' : '',
examen_quantite: '' + elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.quantity : '' : '', examen_quantite: '' + elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.quantity : '' : '',
code_acte: '' + elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.act : '' : '' code_acte: '' + elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.act : '' : '',
amount: elementToSetPrice !== null ? !elementToSetPrice.drugs ? elementToSetPrice.act.amount : null : null
}} }}
onSubmit={(values) => { onSubmit={(values) => {
@ -1646,10 +1663,11 @@ const ModifierFeuilleSoinScreen = ({
return elementToSetPrice.id === exam.id ? { return elementToSetPrice.id === exam.id ? {
...exam, ...exam,
id: exam.id, id: exam.id,
amount: values.amount,
act_id: values.code_acte.id, act_id: values.code_acte.id,
act: values.code_acte, act: values.code_acte,
description: values.examen_name, description: values.examen_name,
quantity: values.examen_quantite, quantity: null,
unit_price: exam.unit_price, unit_price: exam.unit_price,
to_delete: false to_delete: false
} : exam; } : exam;
@ -1708,7 +1726,7 @@ const ModifierFeuilleSoinScreen = ({
}}> }}>
<Dropdown <Dropdown
label={I18n.t('CODE_ACTE')} label={I18n.t('CODE_ACTE')}
data={getNetworkAct.result !== null ? getNetworkAct.result?.response : []} data={getNetworkAct.result !== null ? getNetworkAct.result?.response.filter(act => (act.type === "EXAM_OR_OTHER")) : []}
useNativeDriver={true} useNativeDriver={true}
value={typeof values.code_acte !== "number" && values.code_acte.name} value={typeof values.code_acte !== "number" && values.code_acte.name}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
@ -1727,7 +1745,7 @@ const ModifierFeuilleSoinScreen = ({
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('NAME')} placeholder={I18n.t('DESCRIPTION')}
value={values.examen_name} value={values.examen_name}
onChangeText={handleChange('examen_name')} onChangeText={handleChange('examen_name')}
onBlur={handleBlur('examen_name')} onBlur={handleBlur('examen_name')}
@ -1736,17 +1754,52 @@ const ModifierFeuilleSoinScreen = ({
error={errors.examen_name} error={errors.examen_name}
/> />
<TextInput {/* {values.code_acte !== '' ?
style={{marginTop: 10}} values.code_acte.billing_type === 'UNIT_PRICE' && (<TextInput
placeholder={I18n.t('QUANTITE')} style={{marginTop: 10}}
value={'' + values.examen_quantite} placeholder={I18n.t('QUANTITE')}
onChangeText={handleChange('examen_quantite')} value={'' + values.examen_quantite}
onBlur={handleBlur('examen_quantite')} onChangeText={handleChange('examen_quantite')}
success={touched.examen_quantite && !errors.examen_quantite} onBlur={handleBlur('examen_quantite')}
touched={touched.examen_quantite} success={touched.examen_quantite && !errors.examen_quantite}
error={errors.examen_quantite} touched={touched.examen_quantite}
keyboardType='numeric' error={errors.examen_quantite}
/> keyboardType='numeric'
/>) : null}*/}
<View>
<TextInput
style={{marginTop: 10}}
placeholder={I18n.t('AMOUNT')}
value={values.code_acte !== '' ? values.code_acte.billing_type === 'FREE' ? I18n.t('AMOUNT_FREE') : `${values.code_acte.unit_value} = ${values.code_acte.amount}` : ''}
editable={false}
onChangeText={handleChange('amount')}
onBlur={handleBlur('amount')}
success={touched.amount && !errors.amount}
touched={touched.amount}
error={errors.amount}
keyboardType='numeric'
/>
{/* <View style={{
position: 'absolute',
left: responsiveWidth(82),
top: 20,
flexDirection: 'row'
}}>
<View
style={{
width: 1,
borderLeftColor: '#f0f0f0',
height: 40,
left: -8,
borderLeftWidth: 1,
}}
/>
<Text
style={[Typography.body1, FontWeight.bold]}>{values.code_acte.unit_value}</Text>
</View>*/}
</View>
<Button <Button
style={{marginTop: 20, marginBottom: 20}} style={{marginTop: 20, marginBottom: 20}}
@ -1984,7 +2037,7 @@ const ModifierFeuilleSoinScreen = ({
]} ]}
key={item.id}> key={item.id}>
<Text body2 semibold numberOfLines={2}> <Text body2 semibold numberOfLines={2}>
{`${item.quantity} ${item.description} ${item.unit_price ? ' - ' + item.unit_price : ''} \n ${item.act.name}`} {`${item.description} ${item.unit_price ? ' - ' + item.unit_price : ''} \n ${item.act.name}`}
</Text> </Text>
<View style={styles.iconRight}> <View style={styles.iconRight}>
<TouchableOpacity onPress={() => { <TouchableOpacity onPress={() => {
@ -2924,7 +2977,7 @@ const ModifierFeuilleSoinScreen = ({
styles.iconNavigationButton, styles.iconNavigationButton,
{ {
borderRadius: 5, borderRadius: 5,
width: 100, width: 150,
height: 30, height: 30,
flexDirection: "row", flexDirection: "row",
backgroundColor: backgroundColor:
@ -2936,7 +2989,7 @@ const ModifierFeuilleSoinScreen = ({
onPress={e => { onPress={e => {
setModalListPrestation(true); setModalListPrestation(true);
}}> }}>
<Text whiteColor>{I18n.t('PRESTATION')}</Text> <Text whiteColor>{I18n.t('CONSULTATION')}</Text>
<MaterialCommunityIcons <MaterialCommunityIcons
name="medical-bag" name="medical-bag"
size={20} size={20}
@ -2949,7 +3002,7 @@ const ModifierFeuilleSoinScreen = ({
styles.iconNavigationButton, styles.iconNavigationButton,
{ {
borderRadius: 5, borderRadius: 5,
width: 100, width: 170,
height: 30, height: 30,
flexDirection: "row", flexDirection: "row",
backgroundColor: backgroundColor:
@ -2961,7 +3014,7 @@ const ModifierFeuilleSoinScreen = ({
onPress={e => { onPress={e => {
setModalExamen(true); setModalExamen(true);
}}> }}>
<Text whiteColor>{I18n.t('EXAMEN')}</Text> <Text whiteColor>{I18n.t('ACTE_EXAMEN')}</Text>
<FontAwesome5 <FontAwesome5
name="file-medical" name="file-medical"
size={20} size={20}
@ -2974,7 +3027,7 @@ const ModifierFeuilleSoinScreen = ({
styles.iconNavigationButton, styles.iconNavigationButton,
{ {
borderRadius: 5, borderRadius: 5,
width: 110, width: 120,
height: 30, height: 30,
flexDirection: "row", flexDirection: "row",
backgroundColor: backgroundColor:

View File

@ -677,7 +677,7 @@ const SaisirFeuilleSoinScreen = ({
const AddNewPrestation = Yup.object().shape({ const AddNewPrestation = Yup.object().shape({
amount_prestation: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')), amount_prestation: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
code_acte: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')), code_acte: Yup.object().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
frais_deplacement: Yup.number(), frais_deplacement: Yup.number(),
date_prestation: Yup.date(), date_prestation: Yup.date(),
ticker_moderateur: Yup.number(), ticker_moderateur: Yup.number(),
@ -685,8 +685,8 @@ const SaisirFeuilleSoinScreen = ({
const AddNewExamen = Yup.object().shape({ const AddNewExamen = Yup.object().shape({
examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')), examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
code_acte: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')), code_acte: Yup.object().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
examen_quantite: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED')) amount: Yup.number(),
}); });
const AddNewMedicament = Yup.object().shape({ const AddNewMedicament = Yup.object().shape({
@ -818,7 +818,7 @@ const SaisirFeuilleSoinScreen = ({
codeActeRef.shake(200) codeActeRef.shake(200)
else { else {
setPrestations([{ setPrestations([{
act_id: values.code_acte, act_id: values.code_acte.id,
amount: values.amount_prestation, amount: values.amount_prestation,
home_visit_fees: values.frais_deplacement home_visit_fees: values.frais_deplacement
}, ...prestations]); }, ...prestations]);
@ -852,6 +852,7 @@ const SaisirFeuilleSoinScreen = ({
isSubmitting, isSubmitting,
}) => ( }) => (
<ScrollView style={{flex: 1}}> <ScrollView style={{flex: 1}}>
{console.log("Errors", errors)}
<View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}> <View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
<Modal <Modal
isVisible={modalPrestation} isVisible={modalPrestation}
@ -893,11 +894,20 @@ const SaisirFeuilleSoinScreen = ({
}}> }}>
<Dropdown <Dropdown
label={I18n.t('CODE_ACTE')} label={I18n.t('CODE_ACTE')}
data={getNetworkAct.result !== null ? getNetworkAct.result?.response : []} data={getNetworkAct.result !== null ? getNetworkAct.result?.response.filter(act => act.type === 'CONSULTATION') : []}
useNativeDriver={true} useNativeDriver={true}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
setFieldTouched('code_acte'); setFieldTouched('code_acte');
setFieldValue('code_acte', value.id); console.log("Value", value);
setFieldValue('code_acte', value);
if (value.billing_type !== 'FREE') {
setFieldValue('amount_prestation', value.amount);
fetchGetAmountConsultation({
network_id: wallet.id_network,
amount: '' + value.amount,
care_condition: careConditon
});
}
}} }}
valueExtractor={(value) => { valueExtractor={(value) => {
return value return value
@ -910,6 +920,7 @@ const SaisirFeuilleSoinScreen = ({
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
editable={values.code_acte !== '' ? values.code_acte.billing_type === 'FREE' : true}
placeholder={I18n.t('AMOUNT')} placeholder={I18n.t('AMOUNT')}
value={values.amount_prestation} value={values.amount_prestation}
onChangeText={(text) => { onChangeText={(text) => {
@ -922,7 +933,7 @@ const SaisirFeuilleSoinScreen = ({
}} }}
onBlur={handleBlur('amount_prestation')} onBlur={handleBlur('amount_prestation')}
success={touched.amount_prestation && !errors.amount_prestation} success={touched.amount_prestation && !errors.amount_prestation}
touched={touched.amount_prestation} A touched={touched.amount_prestation}
error={errors.amount_prestation} error={errors.amount_prestation}
/> />
@ -1261,15 +1272,15 @@ const SaisirFeuilleSoinScreen = ({
<Formik validationSchema={AddNewExamen} <Formik validationSchema={AddNewExamen}
initialValues={{ initialValues={{
examen_name: '', examen_name: '',
examen_quantite: '', code_acte: '',
code_acte: '' amount: ''
}} }}
onSubmit={(values) => { onSubmit={(values) => {
console.log("Value", values); console.log("Value", values);
setExamens([{ setExamens([{
act_id: values.code_acte, act_id: values.code_acte.id,
description: values.examen_name, description: values.examen_name,
quantity: values.examen_quantite quantity: null
}, ...examens]); }, ...examens]);
setModalExamen(false); setModalExamen(false);
Utils.displayToast(I18n.t('EXAMENS_SUCCESSFULLY_ADD')); Utils.displayToast(I18n.t('EXAMENS_SUCCESSFULLY_ADD'));
@ -1321,12 +1332,12 @@ const SaisirFeuilleSoinScreen = ({
}}> }}>
<Dropdown <Dropdown
label={I18n.t('CODE_ACTE')} label={I18n.t('CODE_ACTE')}
data={getNetworkAct.result !== null ? getNetworkAct.result?.response : []} data={getNetworkAct.result !== null ? getNetworkAct.result?.response.filter(act => (act.type === "EXAM_OR_OTHER")) : []}
useNativeDriver={true} useNativeDriver={true}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
console.log("Value", value); console.log("Value", value);
setFieldTouched('code_acte'); setFieldTouched('code_acte');
setFieldValue('code_acte', value.id); setFieldValue('code_acte', value);
}} }}
valueExtractor={(value) => { valueExtractor={(value) => {
return value return value
@ -1339,7 +1350,7 @@ const SaisirFeuilleSoinScreen = ({
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('NAME')} placeholder={I18n.t('DESCRIPTION')}
value={values.examen_name} value={values.examen_name}
onChangeText={handleChange('examen_name')} onChangeText={handleChange('examen_name')}
onBlur={handleBlur('examen_name')} onBlur={handleBlur('examen_name')}
@ -1350,13 +1361,14 @@ const SaisirFeuilleSoinScreen = ({
<TextInput <TextInput
style={{marginTop: 10}} style={{marginTop: 10}}
placeholder={I18n.t('QUANTITE')} placeholder={I18n.t('AMOUNT')}
value={values.examen_quantite} value={values.code_acte !== '' ? values.code_acte.billing_type === 'FREE' ? I18n.t('AMOUNT_FREE') : `${values.code_acte.unit_value} = ${values.code_acte.amount}` : ''}
onChangeText={handleChange('examen_quantite')} editable={false}
onBlur={handleBlur('examen_quantite')} onChangeText={handleChange('amount')}
success={touched.examen_quantite && !errors.examen_quantite} onBlur={handleBlur('amount')}
touched={touched.examen_quantite} success={touched.amount && !errors.amount}
error={errors.examen_quantite} touched={touched.amount}
error={errors.amount}
keyboardType='numeric' keyboardType='numeric'
/> />
@ -2018,7 +2030,7 @@ const SaisirFeuilleSoinScreen = ({
styles.iconNavigationButton, styles.iconNavigationButton,
{ {
borderRadius: 5, borderRadius: 5,
width: 100, width: 150,
height: 30, height: 30,
flexDirection: "row", flexDirection: "row",
backgroundColor: backgroundColor:
@ -2038,7 +2050,7 @@ const SaisirFeuilleSoinScreen = ({
); );
} else setModalPrestation(true); } else setModalPrestation(true);
}}> }}>
<Text whiteColor>{I18n.t('PRESTATION')}</Text> <Text whiteColor>{I18n.t('CONSULTATION')}</Text>
<MaterialCommunityIcons <MaterialCommunityIcons
name="medical-bag" name="medical-bag"
size={20} size={20}
@ -2051,7 +2063,7 @@ const SaisirFeuilleSoinScreen = ({
styles.iconNavigationButton, styles.iconNavigationButton,
{ {
borderRadius: 5, borderRadius: 5,
width: 100, width: 170,
height: 30, height: 30,
flexDirection: "row", flexDirection: "row",
backgroundColor: backgroundColor:
@ -2063,7 +2075,7 @@ const SaisirFeuilleSoinScreen = ({
onPress={e => { onPress={e => {
setModalExamen(true); setModalExamen(true);
}}> }}>
<Text whiteColor>{I18n.t('EXAMEN')}</Text> <Text whiteColor>{I18n.t('ACTE_EXAMEN')}</Text>
<FontAwesome5 <FontAwesome5
name="file-medical" name="file-medical"
size={20} size={20}
@ -2076,7 +2088,7 @@ const SaisirFeuilleSoinScreen = ({
styles.iconNavigationButton, styles.iconNavigationButton,
{ {
borderRadius: 5, borderRadius: 5,
width: 110, width: 120,
height: 30, height: 30,
flexDirection: "row", flexDirection: "row",
backgroundColor: backgroundColor:

View File

@ -628,7 +628,7 @@
"LONGUE": "Longue", "LONGUE": "Longue",
"ACCIDENT": "Accident", "ACCIDENT": "Accident",
"GROSSESSE": "Grossesse", "GROSSESSE": "Grossesse",
"ADD_PRESTATION": "Ajouter une prestation", "ADD_PRESTATION": "Ajouter une consultation",
"ADD_PRESCRIPTION": "Ajouter une prescription", "ADD_PRESCRIPTION": "Ajouter une prescription",
"VISITE_DOMICILE": "Visite domicile ", "VISITE_DOMICILE": "Visite domicile ",
"CODE_ACTE": "Code acte ", "CODE_ACTE": "Code acte ",
@ -689,8 +689,8 @@
"MODIFIER_EXAMEN": "Modifier examen", "MODIFIER_EXAMEN": "Modifier examen",
"EXAMENS_SUCCESSFULLY_MODIFY": "Examen modifié avec succès", "EXAMENS_SUCCESSFULLY_MODIFY": "Examen modifié avec succès",
"PRESTATION_SUCCESSFULLY_MODIFY": "Prestation modifié avec succès", "PRESTATION_SUCCESSFULLY_MODIFY": "Prestation modifié avec succès",
"MODIFY_PRESTATION": "Modifier une prestation", "MODIFY_PRESTATION": "Modifier une consultation",
"LIST_PRESTATION": "Liste des prestations", "LIST_PRESTATION": "Liste des consultations",
"NO_CONSULTATION": "Aucune consultation", "NO_CONSULTATION": "Aucune consultation",
"NO_EXECUTION": "Aucune exécution", "NO_EXECUTION": "Aucune exécution",
"LISTE_CONSULTATION": "Liste des consultations", "LISTE_CONSULTATION": "Liste des consultations",
@ -725,5 +725,9 @@
"ECH": "Ech.", "ECH": "Ech.",
"PER": "Per.", "PER": "Per.",
"ASSURE_SUSPENDU": "Cet assuré est suspendu", "ASSURE_SUSPENDU": "Cet assuré est suspendu",
"ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu" "ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu",
"CONSULTATION": "Consultation",
"ACTE_EXAMEN": "Autre acte et examen",
"AMOUNT_FREE": "Montant libre",
"DESCRIPTION": "Description"
} }