diff --git a/android/app/src/main/assets/index.android.bundle b/android/app/src/main/assets/index.android.bundle index eb7e9f12..96a12926 100644 --- a/android/app/src/main/assets/index.android.bundle +++ b/android/app/src/main/assets/index.android.bundle @@ -1745,11 +1745,11 @@ __d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__e __d(function(g,r,i,a,m,e,d){var t=r(d[0]),l=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(r(d[2])),o=t(r(d[3])),f=r(d[4]),u=r(d[5]),c=r(d[6]),s=l(r(d[7])),E=r(d[8]),y=r(d[9]),p=l(r(d[10])),w=r(d[11]),C=r(d[12]),x=r(d[13]),T=l(r(d[14])),b=t(r(d[15])),V=l(r(d[16])),h=r(d[17]),A=r(d[18]),_=f.Dimensions.get('window'),I=(_.width,_.height,(0,w.createStructuredSelector)({subscriptionList:C.selectSubscriptionList,activatePaySubscription:C.selectActivatePaySubscription,getConsultation:C.selectGetConsultation,acceptRefuseConsultation:C.selectAcceptRefuseConsultation})),L=(0,u.connect)(I,{fetchActivePaySubscription:y.fetchActivePaySubscription,fetchGetConsultation:y.fetchGetConsultation,fetchAcceptRejectConsultation:y.fetchAcceptRejectConsultation})(function(t){t.navigation;var l=t.fetchGetConsultation,w=t.fetchAcceptRejectConsultation,C=t.getConsultation,_=t.acceptRefuseConsultation,I=(0,u.useDispatch)(),L=(0,o.useState)(null),R=(0,n.default)(L,2),S=R[0],N=R[1],O=(0,o.useState)(!1),P=(0,n.default)(O,2),v=P[0],B=P[1],M=(0,o.useState)({}),U=(0,n.default)(M,2),j=U[0],G=U[1];(0,o.useEffect)(function(){(0,x.readUser)().then(function(t){N(t),console.log("User",t),l(t.id,'UNTREATED_ALL','')}),I((0,y.fetchGetConsultationReset)()),I((0,y.fetchAcceptRejectConsultationReset)())},[]),(0,o.useEffect)(function(){C.error&&f.Alert.alert(s.default.t("ERROR_LABLE"),b.getErrorMsg(C),[{text:s.default.t("OK"),onPress:function(){I((0,y.fetchGetConsultationReset)())}}],{cancelable:!1})},[C]),(0,o.useEffect)(function(){null!==_.result&&(f.Alert.alert(s.default.t("SUCCESS"),_.result.response,[{text:s.default.t("OK"),onPress:function(){I((0,y.fetchAcceptRejectConsultationReset)()),B(!1),null!==S&&l(S.id,'UNTREATED_ALL','')}}],{cancelable:!1}),null!==S&&l(S.id,'UNTREATED_ALL','')),_.error&&f.Alert.alert(s.default.t("ERROR_LABLE"),b.getErrorMsg(_),[{text:s.default.t("OK"),onPress:function(){I((0,y.fetchAcceptRejectConsultationReset)()),B(!1),null!==S&&l(S.id,'UNTREATED_ALL','')}}],{cancelable:!1})},[_]);var k=function(t){return o.default.createElement(f.TouchableOpacity,{style:[D.content,{backgroundColor:c.Color.cardBackgroundColor}],onPress:function(){B(!0),G(t)}},o.default.createElement(f.View,{style:{borderColor:c.Color.borderColor,flexDirection:"row",paddingBottom:10,borderBottomWidth:.5}},o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-start'}},o.default.createElement(T.default,{caption1:!0},s.default.t('NETWORK')+": "+t.network.name))),o.default.createElement(f.View,{style:[D.contentTop,{borderColor:c.Color.borderColor}]},o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-start'}},o.default.createElement(T.default,{caption1:!0},s.default.t('PATIENT')+": "+t.patient_lastname+" "+t.patient_firstname),o.default.createElement(T.default,{footnote:!0,light:!0,numberOfLines:1},s.default.t('SITUATION')+": "+t.patient_situation.toLowerCase())),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{caption1:!0},s.default.t('PRATICIEN')+": "+t.practitioner_lastname+" "+t.practitioner_firstname),o.default.createElement(T.default,{footnote:!0,light:!0,numberOfLines:1},s.default.t('SITUATION')+": "+t.practitioner_provider_class))),o.default.createElement(f.View,{style:D.contentBottom},o.default.createElement(f.View,{style:D.bottomLeft},o.default.createElement(f.View,{style:{marginHorizontal:5}},o.default.createElement(T.default,{caption1:!0,semibold:!0,accentColor:!0},"Type: "+t.type.toLowerCase()))),o.default.createElement(f.View,{style:{flexDirection:'row',alignItems:'flex-end'}},o.default.createElement(T.default,{caption1:!0,semibold:!0,primaryColor:!0},"Date: "+A(t.created_at).format('YYYY-MM-DD')))))};return o.default.createElement(E.ScreenComponent,null,o.default.createElement(p.default,{ref:function(t){return t}}),o.default.createElement(f.View,{style:D.contain},C.loading?o.default.createElement(f.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},'android'===f.Platform.OS?o.default.createElement(o.default.Fragment,null,o.default.createElement(f.ProgressBarAndroid,null),o.default.createElement(T.default,null,s.default.t('LOADING_DOTS'))):o.default.createElement(o.default.Fragment,null,o.default.createElement(f.ActivityIndicator,{size:"large",color:'#ccc'}),o.default.createElement(T.default,null,s.default.t('LOADING_DOTS')))):null!==C.result?o.default.createElement(f.FlatList,{style:{flex:1},ListEmptyComponent:function(){return o.default.createElement(T.default,null,s.default.t('NO_CONSULTATION_DEMAND'))},data:C.result.response,keyExtractor:function(t,l){return t.id},renderItem:function(t){var l=t.item;return t.index,k(l)}}):null,v&&o.default.createElement(V.default.Container,{useNativeDriver:!0,visible:v},o.default.createElement(V.default.Title,null,s.default.t('DETAIL')),o.default.createElement(f.ScrollView,{persistentScrollbar:!0},o.default.createElement(f.View,{style:[D.blockView,{borderBottomColor:c.Color.borderColor}]},o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('NETWORK'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},""+j.network.name))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('PATIENT'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},j.patient_lastname+" "+j.patient_firstname))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},"Situation")),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},j.patient_situation.toLowerCase()))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('PRATICIEN'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},j.practitioner_lastname+" "+j.practitioner_firstname))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('CLASSE_PRESTATAIRE'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},(0,b.uppercaseFirstLetter)(j.practitioner_provider_class.toLowerCase())))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('STATE'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},(0,b.uppercaseFirstLetter)(j.state.toLowerCase())))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},"Type")),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},(0,b.uppercaseFirstLetter)(j.type.toLowerCase())))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('CONDITION_PRISE_CHARGE'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},(0,b.uppercaseFirstLetter)(j.care_condition.toLowerCase())))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('INSTITUTE_NAME'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},(0,b.uppercaseFirstLetter)(j.institution_name.toLowerCase())))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},"Date")),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},A(j.created_at).format('YYYY-MM-DD')))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('EXAMEN'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},j.exams.map(function(t){return o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},t.description+" \n "+t.act.name+" \n")}))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('MEDICAMENT'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},j.prescriptions.map(function(t){return o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},t.drug_or_device.name+" \n "+t.dosage+" \n")}))),o.default.createElement(f.View,{style:{flexDirection:'row',marginTop:10}},o.default.createElement(f.View,{style:{flex:1}},o.default.createElement(T.default,{style:[D.body2]},s.default.t('PRESTATION'))),o.default.createElement(f.View,{style:{flex:1,alignItems:'flex-end'}},j.performances.map(function(t){return o.default.createElement(T.default,{style:[h.Typography.caption1,c.Color.grayColor]},t.act.name+" \n "+t.amount+" \n")}))))),o.default.createElement(V.default.Button,{bold:!0,label:s.default.t('CANCEL_LABEL'),onPress:function(){B(!1)}}),o.default.createElement(V.default.Button,{bold:!0,label:s.default.t('REJECT'),onPress:function(){w({health_care_sheet_id:j.id,user_id:S.id,action:"REJECT"})}}),o.default.createElement(V.default.Button,{bold:!0,label:s.default.t('ACCEPT'),onPress:function(){w({health_care_sheet_id:j.id,user_id:S.id,action:"ACCEPT"})}}))))});e.default=L;var D=f.StyleSheet.create({textInput:{height:46,backgroundColor:c.Color.fieldColor,borderRadius:5,marginTop:10,padding:10,width:'100%'},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:.5}})},1739,[4,1,27,15,18,1049,1034,720,1703,1485,1716,1732,1733,719,1416,1457,1423,1077,1189]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),l=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(r(d[2])),c=t(r(d[3])),o=r(d[4]),u=r(d[5]),f=l(r(d[6])),s=r(d[7]),E=l(r(d[8])),p=r(d[9]),y=r(d[10]),h=r(d[11]),w=r(d[12]),C=t(r(d[13])),T=l(r(d[14])),_=l(r(d[15])),A=r(d[16]),V=l(r(d[17])),R=(0,p.createStructuredSelector)({subscriptionList:y.selectSubscriptionList,activatePaySubscription:y.selectActivatePaySubscription,getConsultation:y.selectGetConsultation,acceptRefuseConsultation:y.selectAcceptRefuseConsultation}),x=(0,h.connect)(R,{fetchActivePaySubscription:w.fetchActivePaySubscription,fetchGetConsultation:w.fetchGetConsultation,fetchAcceptRejectConsultation:w.fetchAcceptRejectConsultation})(function(t){var l=t.navigation,s=t.fetchAcceptRejectConsultation,p=t.acceptRefuseConsultation,y=(0,h.useDispatch)(),R=(0,c.useState)(l.getParam('item')),x=(0,n.default)(R,2),b=x[0],P=(x[1],(0,c.useState)(null)),L=(0,n.default)(P,2),D=L[0],I=L[1];return(0,c.useEffect)(function(){(0,A.readUser)().then(function(t){I(t)}),y((0,w.fetchAcceptRejectConsultationReset)())},[]),(0,c.useEffect)(function(){null!==p.result&&u.Alert.alert(f.default.t("SUCCESS"),p.result.response,[{text:f.default.t("OK"),onPress:function(){y((0,w.fetchAcceptRejectConsultationReset)()),l.goBack()}}],{cancelable:!1}),p.error&&u.Alert.alert(f.default.t("ERROR_LABLE"),C.getErrorMsg(p),[{text:f.default.t("OK"),onPress:function(){y((0,w.fetchAcceptRejectConsultationReset)())}}],{cancelable:!1})},[p]),console.log("Consultation",b),c.default.createElement(u.SafeAreaView,{style:o.BaseStyle.safeAreaView,forceInset:{top:'always'}},c.default.createElement(V.default,{ref:function(t){return t}}),c.default.createElement(u.ScrollView,null,c.default.createElement(u.View,{style:S.contain},c.default.createElement(u.View,{style:[S.contentRow]},c.default.createElement(u.View,{style:S.colCenter},c.default.createElement(E.default,{body1:!0,light:!0},f.default.t('PATIENT')),c.default.createElement(E.default,{body2:!0},b.patient_lastname+" "+b.patient_firstname),c.default.createElement(E.default,{body2:!0},b.patient_situation.toLowerCase())),c.default.createElement(u.View,{style:S.colCenter},c.default.createElement(E.default,{body1:!0,light:!0},f.default.t('PRATICIEN')),c.default.createElement(E.default,{body2:!0},b.practitioner_lastname+" "+b.practitioner_firstname),c.default.createElement(E.default,{body2:!0},(0,C.uppercaseFirstLetter)(b.practitioner_provider_class.toLowerCase())))),c.default.createElement(u.View,{style:S.line}),c.default.createElement(u.View,{style:{flexDirection:'row'}},c.default.createElement(u.View,{style:{flex:1}},c.default.createElement(E.default,{caption1:!0,light:!0},f.default.t('STATE')),c.default.createElement(E.default,{headline:!0,style:{marginTop:5}},(0,C.uppercaseFirstLetter)(b.state.toLowerCase()))),c.default.createElement(u.View,{style:{flex:1}},c.default.createElement(E.default,{caption1:!0,light:!0},"Type"),c.default.createElement(E.default,{headline:!0,style:{marginTop:5}},(0,C.uppercaseFirstLetter)(b.type.toLowerCase())))),c.default.createElement(u.View,{style:{flexDirection:'row',marginTop:25}},c.default.createElement(u.View,{style:{flex:1}},c.default.createElement(E.default,{caption1:!0,light:!0},f.default.t('CONDITION_PRISE_CHARGE')),c.default.createElement(E.default,{headline:!0,style:{marginTop:5}},(0,C.uppercaseFirstLetter)(b.care_condition.toLowerCase()))),c.default.createElement(u.View,{style:{flex:1}},c.default.createElement(E.default,{caption1:!0,light:!0},f.default.t('INSTITUTE_NAME')),c.default.createElement(E.default,{headline:!0,style:{marginTop:5}},(0,C.uppercaseFirstLetter)(b.institution_name.toLowerCase())))),c.default.createElement(u.View,{style:{flexDirection:'row',marginTop:25}},c.default.createElement(u.View,{style:{flex:1}},c.default.createElement(E.default,{caption1:!0,light:!0},"Date"),c.default.createElement(E.default,{headline:!0,style:{marginTop:5}},(0,T.default)(b.created_at).format('YYYY-MM-DD')))),c.default.createElement(u.View,{style:S.line}),c.default.createElement(u.View,{style:{flexDirection:'row',marginTop:25}},c.default.createElement(u.View,{style:{flex:1}},c.default.createElement(E.default,{caption1:!0,light:!0},f.default.t('EXAMEN')),c.default.createElement(E.default,{headline:!0,style:{marginTop:5}},b.exams.length)),c.default.createElement(u.View,{style:{flex:1}},c.default.createElement(E.default,{caption1:!0,light:!0},f.default.t('MEDICAMENT')),c.default.createElement(E.default,{headline:!0,style:{marginTop:5}},b.prescriptions.length))),c.default.createElement(u.View,{style:{flexDirection:'row',marginTop:25}},c.default.createElement(u.View,{style:{flex:1}},c.default.createElement(E.default,{caption1:!0,light:!0},f.default.t('PRESTATION')),c.default.createElement(E.default,{headline:!0,style:{marginTop:5}},b.performances.length))),c.default.createElement(u.View,{style:{flexDirection:'row',justifyContent:'space-between',marginTop:25}},c.default.createElement(_.default,{onPress:function(){s({health_care_sheet_id:b.id,user_id:D.id,action:"ACCEPT"})}},f.default.t("ACCEPT")),c.default.createElement(_.default,{onPress:function(){s({health_care_sheet_id:b.id,user_id:D.id,action:"REJECT"})}},f.default.t("REJECT"))))))});e.default=x;var S=u.StyleSheet.create({contain:{padding:20,width:"100%"},classContent:{flexDirection:"row",justifyContent:"flex-end",marginBottom:15},line:{width:"100%",height:1,borderWidth:.5,borderColor:s.Color.dividerColor,borderStyle:"dashed",marginVertical:20},code:{width:"100%",padding:20,alignItems:"center",justifyContent:"center"},contentRow:{flexDirection:"row"},centerView:{alignItems:"center",justifyContent:"center",marginHorizontal:10},colCenter:{flex:1,alignItems:"flex-start"}})},1740,[4,1,27,15,1741,18,720,1034,1416,1732,1733,1049,1485,1457,1189,1559,719,1716]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStyle=void 0;var t=r(d[0]),o=r(d[1]),n=t.StyleSheet.create({textInput:{height:46,borderRadius:5,paddingHorizontal:10,width:'100%',justifyContent:'space-between',alignItems:'center',flexDirection:'row'},safeAreaView:{flex:1,backgroundColor:o.Color.containerBackgroundColor}});e.BaseStyle=n},1741,[18,1034]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=n(r(d[2])),o=n(r(d[3])),u=t(r(d[4])),c=r(d[5]),s=r(d[6]),f=n(r(d[7])),p=r(d[8]),y=t(r(d[9])),E=r(d[10]),_=n(r(d[11])),C=r(d[12]),h=n(r(d[13])),w=r(d[14]),b=r(d[15]),S=n(r(d[16])),T=r(d[17]),x=n(r(d[18])),I=r(d[19]),R=r(d[20]),N=n(r(d[21])),O=n(r(d[22])),A=n(r(d[23])),v=n(r(d[24])),V=n(r(d[25])),P=n(r(d[26])),D=t(r(d[27])),B=r(d[28]),k=n(r(d[29])),L=n(r(d[30])),U=r(d[31]),M=t(r(d[32])),q=r(d[33]),F=n(r(d[34])),G=r(d[35]);function j(t,n){var l=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),l.push.apply(l,o)}return l}function z(t){for(var n=1;n0?St(!0):Qt.alertWithType('warn',_.default.t('EMPTY_LIST'),_.default.t('NO_ASSURE_MATCH_SEARCH'))),J.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(J),[{text:_.default.t("OK"),onPress:function(){zt((0,b.fetchGetUserByNameOrNumberReset)())}}],{cancelable:!1})},[J]),(0,u.useEffect)(function(){Ct(!1),null!==Y.result&&null!==Y.result.response&&zt((0,b.fetchCheckInsuranceCoverageAmountReset)()),Y.error&&c.Alert.alert(_.default.t("INFORMATION_MESSAGE"),M.getErrorMsg(Y),[{text:_.default.t("OK"),onPress:function(){Ve.examen?$e(z({},Ze,{exams:Ze.exams.map(function(t){return Ve.id===t.id?z({},t,{unit_price:at.exams.filter(function(t){return t.id===Ve.id})[0].unit_price}):t})})):$e(z({},Ze,{prescriptions:Ze.prescriptions.map(function(t){return Ve.id===t.id?z({},t,{quantity:at.exams.filter(function(t){return t.id===Ve.id})[0].quantity,unit_price:at.exams.filter(function(t){return t.id===Ve.id})[0].unit_price}):t})})),zt((0,b.fetchCheckInsuranceCoverageAmountReset)())}}],{cancelable:!1})},[Y]),(0,u.useEffect)(function(){null!==X.result&&We(!0),X.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(X),[{text:_.default.t("OK"),onPress:function(){zt((0,b.fetchGetConsultationReset)())}}],{cancelable:!1})},[X]),(0,u.useEffect)(function(){null!==ee.result&&c.Alert.alert(_.default.t("SUCCESS"),ee.result.response,[{text:_.default.t("OK"),onPress:function(){zt((0,b.fetchExecutionPrescriptionReset)()),te.goBack()}}],{cancelable:!1}),ee.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(ee),[{text:_.default.t("OK"),onPress:function(){zt((0,b.fetchExecutionPrescriptionReset)())}}],{cancelable:!1})},[ee]);var Ht=y.object().shape({numero_assure:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),password:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),practitioner_lastname:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),practitioner_firstname:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED'))}),Kt=y.object().shape({price:y.number().required(_.default.t('THIS_FIELD_IS_REQUIRED')),examen_quantite:y.number(),unit_quantity_condition:y.boolean(),unit_quantity:y.number().when('unit_quantity_condition',{is:!0,then:y.number().required(_.default.t('THIS_FIELD_IS_REQUIRED')),otherwise:y.number()}),code_acte:y.object()});console.log("consultaiton",Ze);var Yt,Wt,Xt,Jt,Zt=(0,p.useFormik)({validationSchema:Ht,initialValues:{numero_assure:'',password:'',firstname_patient:'',lastname_patient:'',practitioner_firstname:'',practitioner_lastname:'',agrement_praticien:null==_e?void 0:_e.code_membre,pregnancy_start_at:null,pregnancy_end_at:null},onSubmit:function(t){H({health_care_sheet_id:Ze.id,network_agent_id:ie.network_agent_id,password:t.password,practitioner_lastname:t.practitioner_lastname,practitioner_firstname:t.practitioner_firstname,practitioner_provider_class_id:t.practitioner_provider_class_id,prescriptions:Ze.prescriptions.filter(function(t){return t.checked}).map(function(t){return{id:t.id,unit_price:t.unit_price,quantity:t.quantity}}),exams:Ze.exams.filter(function(t){return t.checked}).map(function(t){return{id:t.id,unit_price:t.unit_price,quantity:t.quantity,unit_quantity:parseInt(t.unit_quantity)}})})}}),$t=Zt.handleChange,ea=Zt.handleSubmit,ta=Zt.handleBlur,aa=Zt.values,na=Zt.errors,la=Zt.touched,ra=Zt.setFieldValue,oa=Zt.setFieldTouched,ia=(Zt.isValid,function(){switch(console.log("currentStep",ze),ze){case 0:return console.log("values",aa),zt((0,b.fetchGetUserByNameOrNumberReset)()),''!==aa.numero_assure&&null===J.result&&(I(ie.id_network,de?"&insured_id="+aa.numero_assure:pe?"&phone="+aa.numero_assure:"&name="+aa.numero_assure),console.log("errors",na)),!1;default:return!0}}),ua=[{title:_.default.t('ASSURE'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10,width:(0,w.responsiveWidth)(90)},placeholder:de?_.default.t('NUMERO_ASSURE'):pe?_.default.t('PHONE_NUMBER'):_.default.t('NOM_ASSURE'),value:aa.numero_assure,keyboardType:pe?'numeric':'default',onChangeText:$t('numero_assure'),onBlur:ta('numero_assure'),success:la.numero_assure&&!na.numero_assure,touched:la.numero_assure,error:na.numero_assure,icon:u.default.createElement(v.default,{style:{zIndex:10},name:de?'lock':pe?'phone':'user',size:20})}),u.default.createElement(c.View,{style:{flexDirection:'row',position:'absolute',top:22,right:70,justifyContent:'space-between',width:50}},u.default.createElement(A.default,{style:{paddingRight:10},name:"lock",size:20,color:E.Color.primaryColor,onPress:function(){se(!0),ye(!1)}}),u.default.createElement(A.default,{style:{paddingRight:10},name:"phone",size:20,color:E.Color.primaryColor,onPress:function(){se(!1),ye(!0)}}),u.default.createElement(A.default,{style:{paddingRight:10},name:"user",size:20,color:E.Color.primaryColor,onPress:function(){se(!1),ye(!1)}}),u.default.createElement(A.default,{style:{paddingRight:10},name:"qrcode",size:20,color:E.Color.primaryColor,onPress:function(){re(!0)}})))},{title:_.default.t('PATIENT'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('NOM_CLIENT'),value:aa.lastname_patient,onChangeText:$t('lastname_patient'),onBlur:ta('lastname_patient'),success:la.lastname_patient&&!na.lastname_patient,touched:la.lastname_patient,editable:!1,error:na.lastname_patient}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PRENOM_CLIENT'),value:aa.firstname_patient,editable:!1,onChangeText:$t('firstname_patient'),onBlur:ta('firstname_patient'),success:la.firstname_patient&&!na.firstname_patient,touched:la.firstname_patient,error:na.firstname_patient}),u.default.createElement(c.View,{style:{marginTop:10,flexDirection:'row',justifyContent:"space-between"}},u.default.createElement(V.default,{body2:!0},_.default.t('SITUATION')),u.default.createElement(c.View,{style:{width:(0,w.responsiveWidth)(60)}},u.default.createElement(P.default,{options:Ut,disabled:!0,value:Ft,initial:Ft,buttonColor:E.Color.accentColor,backgroundColor:E.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(t){}}))))},{title:_.default.t('PRATICIEN'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('CODE_AGREMENT'),value:aa.agrement_praticien,editable:!1}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('NOM_PRATICIEN'),value:aa.practitioner_lastname,onChangeText:$t('practitioner_lastname'),onBlur:ta('practitioner_lastname'),success:la.practitioner_lastname&&!na.practitioner_lastname,touched:la.practitioner_lastname,error:na.practitioner_lastname}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PRENOM_PRATICIEN'),value:aa.practitioner_firstname,onChangeText:$t('practitioner_firstname'),onBlur:ta('practitioner_firstname'),success:la.practitioner_firstname&&!na.practitioner_firstname,touched:la.practitioner_firstname,error:na.practitioner_firstname}),u.default.createElement(D.View,{ref:function(t){},style:{width:(0,w.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},u.default.createElement(B.Dropdown,{label:_.default.t('CLASSIFICATION'),data:null!==$.result?null==(n=$.result)?void 0:n.response:[],useNativeDriver:!0,onChangeText:function(t,n,l){oa('practitioner_provider_class_id'),ra('practitioner_provider_class_id',t.id),console.log("Value",t)},valueExtractor:function(t){return t},labelExtractor:function(t){return t.name}})),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PASSWORD'),value:aa.password,onChangeText:$t('password'),onBlur:ta('password'),success:la.password&&!na.password,touched:la.password,error:na.password,secureTextEntry:!0}),u.default.createElement(c.View,{style:{marginTop:25}},u.default.createElement(c.View,{style:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'}},null!==Ze?!Ze.prescriptions.filter(function(t){return t.checked}).length>0?u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{borderRadius:5,width:100,height:30,flexDirection:"row",backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){Ze.prescriptions.filter(function(t){return t.checked}).length>0?(0,M.displayToast)("Vous avez deja renseigner les m\xe9dicaments"):yt(!0)}},u.default.createElement(V.default,{whiteColor:!0},_.default.t('EXAMEN')),u.default.createElement(A.default,{name:"file-medical",size:20,color:E.Color.whiteColor})):u.default.createElement(c.View,null):null,null!==Ze?!Ze.exams.filter(function(t){return t.checked}).length>0?u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{borderRadius:5,width:110,height:30,flexDirection:"row",backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){Ze.exams.filter(function(t){return t.checked}).length>0?(0,M.displayToast)("Vous avez deja renseigner les examens"):Rt(!0)}},u.default.createElement(V.default,{whiteColor:!0},_.default.t('MEDICAMENT')),u.default.createElement(F.default,{name:"drug-pack",size:20,color:E.Color.whiteColor})):u.default.createElement(c.View,null):null)))}];return u.default.createElement(C.ScreenComponent,null,u.default.createElement(S.default,{ref:function(t){return Qt=t}}),u.default.createElement(c.KeyboardAvoidingView,{behavior:'android'===c.Platform.OS?'height':'padding',style:{flex:1}},u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:W.contain},u.default.createElement(N.default,{steps:ua,currentStepIndex:ze+1}),u.default.createElement(c.View,{style:{flexDirection:'column',alignItems:'center'}},u.default.createElement(O.default,{ref:De,activeStep:0,steps:ua,useNativeDriver:!0,nextStepAnimation:"slideLeft",prevStepAnimation:"slideRight",isFirstStep:function(t){return Ue(t)},isLastStep:function(t){return Fe(t)},onNext:function(){ia()},onPrev:function(){0===ze&&zt((0,b.fetchGetUserByNameOrNumberReset)())},currentStep:function(t){var n=t.currentStep,l=t.isLastStep,o=t.isFirstStep;Qe(n),Ue(o),Fe(l)}})),u.default.createElement(c.View,{style:W.iconNavigation},Le?u.default.createElement(c.View,null):u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(){return De.current.prev()}},u.default.createElement(A.default,{name:"arrow-left",size:20,color:E.Color.whiteColor})),2===ze?u.default.createElement(h.default,{loading:ee.loading,onPress:ea},_.default.t('SUBMIT_LABEL')):u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){ea(t),ia()&&De.current.next()}},J.loading||Z.loading||X.loading?u.default.createElement(c.ActivityIndicator,{size:"small",color:"#fff"}):u.default.createElement(A.default,{name:"arrow-right",size:24,color:E.Color.whiteColor}))),pt&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:pt,onSwipeComplete:function(){yt(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('EXAMEN')),u.default.createElement(c.FlatList,{data:Ze.exams,extraData:Ze.exams,keyExtractor:function(t,n){return n},renderItem:function(t){var n=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:n.id,onPress:function(){Pe(z({},n,{examen:!0})),$e(z({},Ze,{exams:Ze.exams.map(function(t){return n.id===t.id?z({},t,{checked:!n.checked}):t})})),n.checked||Ct(!0)}},u.default.createElement(V.default,{body2:!0,semibold:!0,numberOfLines:2},(null===n.quantity?'':n.quantity)+" "+n.description+" "+(n.unit_price?' - '+n.unit_price:'')+" \n "+n.act.name),n.checked&&u.default.createElement(A.default,{name:"check",size:14,color:E.Color.primaryColor}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return yt(!1)}},_.default.t('OK')))))),le&&u.default.createElement(f.default.Container,{contentStyle:{width:(0,w.responsiveWidth)(80)},useNativeDriver:!0,visible:le},u.default.createElement(f.default.Title,null,_.default.t('SCAN')),u.default.createElement(c.ScrollView,{style:[W.blockView,{borderBottomColor:E.Color.borderColor,maxHeight:300}]},u.default.createElement(V.default,null,_.default.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')),u.default.createElement(L.default,{onRead:function(t){re(!1),l(t.data)},flashMode:U.RNCamera.Constants.FlashMode.off})),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('CLOSE'),onPress:function(){re(!1)}})),bt&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:bt,onSwipeComplete:function(){St(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('LIST_ASSURE')),u.default.createElement(c.FlatList,{data:null==(Xt=J.result)?void 0:Xt.response,extraData:null==(Jt=J.result)?void 0:Jt.response,ListEmptyComponent:u.default.createElement(V.default,{body2:!0},_.default.t('NO_ASSURE_MATCH_SEARCH')),keyExtractor:function(t,n){return n},renderItem:function(t){var n=t.item;return t.index,u.default.createElement(c.View,{style:{paddingVertical:15,alignItems:'flex-start'}},u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%",flexDirection:'column'}],key:n.id,onPress:function(){'SUSPENDED'===n.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_SUSPENDU'),[{text:_.default.t('OK'),onPress:function(){}}]):'PAID'!==n.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_NON_EN_REGLE'),[{text:_.default.t('OK'),onPress:function(){}}]):(Se(n),Re(null),Gt(1),St(!1),ra('lastname_patient',n.user.lastname),ra('firstname_patient',n.user.firstname),j(n.user.id,'TO_BILL','CONSULTATION'))}},u.default.createElement(V.default,{body2:!0,semibold:!0},(null!==n.user.firstname?n.user.firstname:'')+" "+(null!==n.user.lastname?n.user.lastname:'')),u.default.createElement(V.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+n.insurance_consumed_amount),u.default.createElement(V.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+n.insurance_remaining_amount)),n.beneficiaries.map(function(t){return u.default.createElement(c.TouchableOpacity,{style:W.beneficiarySubSection,onPress:function(){'SUSPENDED'===n.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_PRINCIPAL_SUSPENDU'),[{text:_.default.t('OK'),onPress:function(){}}]):(Se(n),Re(t),Gt(0),St(!1),ra('lastname_patient',t.lastname),ra('firstname_patient',t.firstname),j(n.user.id,'TO_BILL','CONSULTATION',"&beneficiary_id="+t.id))}},u.default.createElement(c.View,{style:{width:10}}),u.default.createElement(c.View,{style:{paddingHorizontal:10,alignItems:'flex-start'}},u.default.createElement(V.default,{subhead:!0,semibold:!0,textAlign:"left"},(null!==t.firstname?t.firstname:'')+" "+(null!==t.lastname?t.lastname:'')+" ("+_.default.t('AYANT_DROITS')+")"),u.default.createElement(V.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+t.insurance_consumed_amount),u.default.createElement(V.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+t.insurance_remaining_amount)))}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return St(!1)}},_.default.t('OK')))))),It&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:It,onSwipeComplete:function(){Rt(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('MEDICAMENTS')),u.default.createElement(c.FlatList,{data:Ze.prescriptions,extraData:Ze.prescriptions,keyExtractor:function(t,n){return n},renderItem:function(t){var n=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:n.id,onPress:function(){Pe(z({},n,{quantity_original:n.quantity,drugs:!0})),$e(z({},Ze,{prescriptions:Ze.prescriptions.map(function(t){return n.id===t.id?z({},t,{checked:!n.checked}):t})})),n.checked||Ct(!0)}},u.default.createElement(V.default,{body2:!0,semibold:!0,numberOfLines:2},n.quantity+" "+n.drug_or_device.name+" "+(n.unit_price?' - '+n.unit_price:'')+" \n "+n.dosage),n.checked&&u.default.createElement(A.default,{name:"check",size:14,color:E.Color.primaryColor}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return Rt(!1)}},_.default.t('OK')))))),Ye&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:Ye,onSwipeComplete:function(){We(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('LIST_CONSULTATION')),u.default.createElement(c.FlatList,{data:null==(Yt=X.result)?void 0:Yt.response,extraData:null==(Wt=X.result)?void 0:Wt.response,ListEmptyComponent:u.default.createElement(V.default,{body2:!0},_.default.t('NO_CONSULTATION')),keyExtractor:function(t,n){return n},renderItem:function(t){var n=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:n.id,onPress:function(){st(n),it(!0)}},u.default.createElement(V.default,{body2:!0,semibold:!0},n.type+" #"+n.health_care_sheet_id+" - "+Q(n.created_at).format('YYYY-MM-DD')))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return We(!1)}},_.default.t('OK')))))),ot&&u.default.createElement(f.default.Container,{useNativeDriver:!0,visible:ot},u.default.createElement(f.default.Title,null,_.default.t('DETAIL')),u.default.createElement(c.ScrollView,{persistentScrollbar:!0},u.default.createElement(c.View,{style:[W.blockView,{borderBottomColor:E.Color.borderColor}]},u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('PATIENT'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},dt.patient_lastname+" "+dt.patient_firstname))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},"Situation")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},dt.patient_situation.toLowerCase()))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('PRATICIEN'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},dt.practitioner_lastname+" "+dt.practitioner_firstname))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('CLASSE_PRESTATAIRE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.practitioner_provider_class.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('STATE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.state.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},"Type")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.type.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('CONDITION_PRISE_CHARGE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.care_condition.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('INSTITUTE_NAME'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.institution_name.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},"Date")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},Q(dt.created_at).format('YYYY-MM-DD')))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('PRESTATION'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},dt.performances.map(function(t){return u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.act.name+" \n "+t.amount+" \n")}))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('EXAMEN'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},dt.exams.map(function(t){return u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.description+" \n "+t.act.name+" \n")}))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('MEDICAMENT'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},dt.prescriptions.map(function(t){return u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.drug_or_device.name+" \n "+t.dosage+" \n")}))))),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('CANCEL_LABEL'),onPress:function(){it(!1)}}),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('OK'),onPress:function(){it(!1),St(!1),We(!1),$e(dt),nt(dt),De.current.next()}})),_t&&u.default.createElement(p.Formik,{validationSchema:Kt,initialValues:{examen_quantity:null!==Ve&&Ve.drugs?parseInt(Ve.quantity)-parseInt(null!==Ve.billed_quantity?Ve.billed_quantity:0):'',unit_quantity:'',unit_quantity_condition:null!==Ve&&!Ve.drugs&&'UNIT_PRICE'===Ve.act.billing_type,code_acte:''+Ve!==null?Ve.drugs?'':Ve.act:'',price:null!==Ve?Ve.drugs?'':Ve.act.amount:''},onSubmit:function(t){if(console.log("Value",Ve),Ve.examen)$e(z({},Ze,{exams:Ze.exams.map(function(n){return Ve.id===n.id?z({},n,{unit_price:t.price,quantity:t.examen_quantity,unit_quantity:''===t.unit_quantity?null:t.unit_quantity}):n})})),K({insurance_id:be.id,beneficiary_id:null!==Ie?Ie.id:null,care_condition:Ze._care_condition,act_action:"INSERT",act_type:"EXAM",exams:[{unit_price:t.price,quantity:t.examen_quantity}],tmp_sheet_id:At});else{var n=dt.prescriptions.filter(function(t){return t.id=Ve.id})[0].quantity;parseInt(t.examen_quantity)>parseInt(n-parseInt(null!==Ve.billed_quantity?Ve.billed_quantity:0))?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('QUANTITY_CANNOT_BE_SUPERIOR')+" "+n,[{text:_.default.t('OK'),onPress:function(){}}]):($e(z({},Ze,{prescriptions:Ze.prescriptions.map(function(n){return Ve.id===n.id?z({},n,{unit_price:t.price,quantity:t.examen_quantity}):n})})),K({insurance_id:be.id,beneficiary_id:null!==Ie?Ie.id:null,care_condition:Ze._care_condition,act_action:"INSERT",act_type:"PRESCRIPTION",tmp_sheet_id:At,prescriptions:[{unit_price:t.price,quantity:t.examen_quantity}]}))}}},function(t){var n=t.values,l=t.errors,o=t.touched,s=t.handleChange,f=(t.setFieldValue,t.setFieldTouched,t.handleBlur),p=t.handleSubmit;return t.isSubmitting,u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:_t,onSwipeComplete:function(){Ct(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),Ve.examen?u.default.createElement(u.default.Fragment,null,u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('EXECUTION')),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('QUANTITE'),value:''+n.examen_quantity,onChangeText:s('examen_quantity'),onBlur:f('examen_quantity'),success:o.examen_quantity&&!l.examen_quantity,touched:o.examen_quantity,error:l.examen_quantity,keyboardType:"numeric"}),"UNIT_PRICE"===Ve.act.billing_type?u.default.createElement(c.View,{style:{flexDirection:'row'}},u.default.createElement(V.default,{style:{marginTop:20,width:40,height:40}},Ve.act.unit_value+" = "),u.default.createElement(c.View,{style:{flexDirection:'row',width:'90%',justifyContent:'space-between'}},u.default.createElement(x.default,{style:{marginTop:10,width:180},editable:"FREE"===Ve.act.billing_type,placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:n.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!l.price,touched:o.price,error:l.price,keyboardType:"numeric"}),u.default.createElement(V.default,{style:{marginTop:20,marginLeft:5,width:40,height:40}}," X "),u.default.createElement(x.default,{style:{marginTop:10,width:180},placeholder:_.default.t('UNIT_QUANTITE'),value:''+n.unit_quantity,onChangeText:s('unit_quantity'),onBlur:f('unit_quantity'),success:o.unit_quantity&&!l.unit_quantity,touched:o.unit_quantity,error:l.unit_quantity,keyboardType:"numeric"}))):u.default.createElement(x.default,{style:{marginTop:10},editable:"FREE"===Ve.act.billing_type,placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:n.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!l.price,touched:o.price,error:l.price,keyboardType:"numeric"})):u.default.createElement(u.default.Fragment,null,u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('EXECUTION')),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('QUANTITE'),value:''+n.examen_quantity,onChangeText:s('examen_quantity'),onBlur:f('examen_quantity'),success:o.examen_quantity&&!l.examen_quantity,touched:o.examen_quantity,error:l.examen_quantity,keyboardType:"numeric"}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:n.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!l.price,touched:o.price,error:l.price,keyboardType:"numeric"})),u.default.createElement(h.default,{loading:Y.loading,full:!0,style:{marginTop:10,marginBottom:20},onPress:p},_.default.t('OK'))))))})))))});e.default=J},1742,[4,1,7,27,15,18,1049,1423,1630,1637,1034,720,1703,1714,535,1485,1716,719,1415,1732,1733,1737,1738,1016,539,1416,772,750,982,1626,1417,1316,1457,1105,1035,1077,1189]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=n(r(d[2])),o=n(r(d[3])),u=t(r(d[4])),c=r(d[5]),s=r(d[6]),f=n(r(d[7])),p=r(d[8]),y=t(r(d[9])),E=r(d[10]),_=n(r(d[11])),C=r(d[12]),h=n(r(d[13])),w=r(d[14]),b=r(d[15]),S=n(r(d[16])),T=r(d[17]),x=n(r(d[18])),I=r(d[19]),R=r(d[20]),N=n(r(d[21])),O=n(r(d[22])),A=n(r(d[23])),v=n(r(d[24])),V=n(r(d[25])),P=n(r(d[26])),D=t(r(d[27])),B=r(d[28]),k=n(r(d[29])),L=n(r(d[30])),U=r(d[31]),M=t(r(d[32])),q=r(d[33]),F=n(r(d[34])),G=r(d[35]);function j(t,n){var l=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),l.push.apply(l,o)}return l}function z(t){for(var n=1;n0?St(!0):Qt.alertWithType('warn',_.default.t('EMPTY_LIST'),_.default.t('NO_ASSURE_MATCH_SEARCH'))),J.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(J),[{text:_.default.t("OK"),onPress:function(){zt((0,b.fetchGetUserByNameOrNumberReset)())}}],{cancelable:!1})},[J]),(0,u.useEffect)(function(){Ct(!1),null!==Y.result&&null!==Y.result.response&&zt((0,b.fetchCheckInsuranceCoverageAmountReset)()),Y.error&&c.Alert.alert(_.default.t("INFORMATION_MESSAGE"),M.getErrorMsg(Y),[{text:_.default.t("OK"),onPress:function(){Ve.examen?$e(z({},Ze,{exams:Ze.exams.map(function(t){return Ve.id===t.id?z({},t,{unit_price:at.exams.filter(function(t){return t.id===Ve.id})[0].unit_price}):t})})):$e(z({},Ze,{prescriptions:Ze.prescriptions.map(function(t){return Ve.id===t.id?z({},t,{quantity:at.exams.filter(function(t){return t.id===Ve.id})[0].quantity,unit_price:at.exams.filter(function(t){return t.id===Ve.id})[0].unit_price}):t})})),zt((0,b.fetchCheckInsuranceCoverageAmountReset)())}}],{cancelable:!1})},[Y]),(0,u.useEffect)(function(){null!==X.result&&We(!0),X.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(X),[{text:_.default.t("OK"),onPress:function(){zt((0,b.fetchGetConsultationReset)())}}],{cancelable:!1})},[X]),(0,u.useEffect)(function(){null!==ee.result&&c.Alert.alert(_.default.t("SUCCESS"),ee.result.response,[{text:_.default.t("OK"),onPress:function(){zt((0,b.fetchExecutionPrescriptionReset)()),te.goBack()}}],{cancelable:!1}),ee.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(ee),[{text:_.default.t("OK"),onPress:function(){zt((0,b.fetchExecutionPrescriptionReset)())}}],{cancelable:!1})},[ee]);var Ht=y.object().shape({numero_assure:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),password:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),practitioner_lastname:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),practitioner_firstname:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED'))}),Kt=y.object().shape({price:y.number().required(_.default.t('THIS_FIELD_IS_REQUIRED')),examen_quantite:y.number(),unit_quantity_condition:y.boolean(),unit_quantity:y.number().when('unit_quantity_condition',{is:!0,then:y.number().required(_.default.t('THIS_FIELD_IS_REQUIRED')),otherwise:y.number()}),code_acte:y.object()});console.log("consultaiton",Ze);var Yt,Wt,Xt,Jt,Zt=(0,p.useFormik)({validationSchema:Ht,initialValues:{numero_assure:'',password:'',firstname_patient:'',lastname_patient:'',practitioner_firstname:'',practitioner_lastname:'',agrement_praticien:null==_e?void 0:_e.code_membre,pregnancy_start_at:null,pregnancy_end_at:null},onSubmit:function(t){H({health_care_sheet_id:Ze.id,network_agent_id:ie.network_agent_id,password:t.password,practitioner_lastname:t.practitioner_lastname,practitioner_firstname:t.practitioner_firstname,practitioner_provider_class_id:t.practitioner_provider_class_id,prescriptions:Ze.prescriptions.filter(function(t){return t.checked}).map(function(t){return{id:t.id,unit_price:t.unit_price,quantity:t.quantity}}),exams:Ze.exams.filter(function(t){return t.checked}).map(function(t){return{id:t.id,unit_price:t.unit_price,quantity:t.quantity,unit_quantity:parseInt(t.unit_quantity)}})})}}),$t=Zt.handleChange,ea=Zt.handleSubmit,ta=Zt.handleBlur,aa=Zt.values,na=Zt.errors,la=Zt.touched,ra=Zt.setFieldValue,oa=Zt.setFieldTouched,ia=(Zt.isValid,function(){switch(console.log("currentStep",ze),ze){case 0:return console.log("values",aa),zt((0,b.fetchGetUserByNameOrNumberReset)()),''!==aa.numero_assure&&null===J.result&&(I(ie.id_network,de?"&insured_id="+aa.numero_assure:pe?"&phone="+aa.numero_assure:"&name="+aa.numero_assure),console.log("errors",na)),!1;default:return!0}}),ua=[{title:_.default.t('ASSURE'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10,width:(0,w.responsiveWidth)(90)},placeholder:de?_.default.t('NUMERO_ASSURE'):pe?_.default.t('PHONE_NUMBER'):_.default.t('NOM_ASSURE'),value:aa.numero_assure,keyboardType:pe?'numeric':'default',onChangeText:$t('numero_assure'),onBlur:ta('numero_assure'),success:la.numero_assure&&!na.numero_assure,touched:la.numero_assure,error:na.numero_assure,icon:u.default.createElement(v.default,{style:{zIndex:10},name:de?'lock':pe?'phone':'user',size:20})}),u.default.createElement(c.View,{style:{flexDirection:'row',position:'absolute',top:22,right:70,justifyContent:'space-between',width:50}},u.default.createElement(A.default,{style:{paddingRight:10},name:"lock",size:20,color:E.Color.primaryColor,onPress:function(){se(!0),ye(!1)}}),u.default.createElement(A.default,{style:{paddingRight:10},name:"phone",size:20,color:E.Color.primaryColor,onPress:function(){se(!1),ye(!0)}}),u.default.createElement(A.default,{style:{paddingRight:10},name:"user",size:20,color:E.Color.primaryColor,onPress:function(){se(!1),ye(!1)}}),u.default.createElement(A.default,{style:{paddingRight:10},name:"qrcode",size:20,color:E.Color.primaryColor,onPress:function(){re(!0)}})))},{title:_.default.t('PATIENT'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('NOM_CLIENT'),value:aa.lastname_patient,onChangeText:$t('lastname_patient'),onBlur:ta('lastname_patient'),success:la.lastname_patient&&!na.lastname_patient,touched:la.lastname_patient,editable:!1,error:na.lastname_patient}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PRENOM_CLIENT'),value:aa.firstname_patient,editable:!1,onChangeText:$t('firstname_patient'),onBlur:ta('firstname_patient'),success:la.firstname_patient&&!na.firstname_patient,touched:la.firstname_patient,error:na.firstname_patient}),u.default.createElement(c.View,{style:{marginTop:10,flexDirection:'row',justifyContent:"space-between"}},u.default.createElement(V.default,{body2:!0},_.default.t('SITUATION')),u.default.createElement(c.View,{style:{width:(0,w.responsiveWidth)(60)}},u.default.createElement(P.default,{options:Ut,disabled:!0,value:Ft,initial:Ft,buttonColor:E.Color.accentColor,backgroundColor:E.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(t){}}))))},{title:_.default.t('PRATICIEN'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('CODE_AGREMENT'),value:aa.agrement_praticien,editable:!1}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('NOM_PRATICIEN'),value:aa.practitioner_lastname,onChangeText:$t('practitioner_lastname'),onBlur:ta('practitioner_lastname'),success:la.practitioner_lastname&&!na.practitioner_lastname,touched:la.practitioner_lastname,error:na.practitioner_lastname}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PRENOM_PRATICIEN'),value:aa.practitioner_firstname,onChangeText:$t('practitioner_firstname'),onBlur:ta('practitioner_firstname'),success:la.practitioner_firstname&&!na.practitioner_firstname,touched:la.practitioner_firstname,error:na.practitioner_firstname}),u.default.createElement(D.View,{ref:function(t){},style:{width:(0,w.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},u.default.createElement(B.Dropdown,{label:_.default.t('CLASSIFICATION'),data:null!==$.result?null==(n=$.result)?void 0:n.response:[],useNativeDriver:!0,onChangeText:function(t,n,l){oa('practitioner_provider_class_id'),ra('practitioner_provider_class_id',t.id),console.log("Value",t)},valueExtractor:function(t){return t},labelExtractor:function(t){return t.name}})),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PASSWORD'),value:aa.password,onChangeText:$t('password'),onBlur:ta('password'),success:la.password&&!na.password,touched:la.password,error:na.password,secureTextEntry:!0}),u.default.createElement(c.View,{style:{marginTop:25}},u.default.createElement(c.View,{style:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'}},null!==Ze?!Ze.prescriptions.filter(function(t){return t.checked}).length>0?u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{borderRadius:5,width:100,height:30,flexDirection:"row",backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){Ze.prescriptions.filter(function(t){return t.checked}).length>0?(0,M.displayToast)("Vous avez deja renseigner les m\xe9dicaments"):yt(!0)}},u.default.createElement(V.default,{whiteColor:!0},_.default.t('EXAMEN')),u.default.createElement(A.default,{name:"file-medical",size:20,color:E.Color.whiteColor})):u.default.createElement(c.View,null):null,null!==Ze?!Ze.exams.filter(function(t){return t.checked}).length>0?u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{borderRadius:5,width:110,height:30,flexDirection:"row",backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){Ze.exams.filter(function(t){return t.checked}).length>0?(0,M.displayToast)("Vous avez deja renseigner les examens"):Rt(!0)}},u.default.createElement(V.default,{whiteColor:!0},_.default.t('MEDICAMENT')),u.default.createElement(F.default,{name:"drug-pack",size:20,color:E.Color.whiteColor})):u.default.createElement(c.View,null):null)))}];return u.default.createElement(C.ScreenComponent,null,u.default.createElement(S.default,{ref:function(t){return Qt=t}}),u.default.createElement(c.KeyboardAvoidingView,{behavior:'android'===c.Platform.OS?'height':'padding',style:{flex:1}},u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:W.contain},u.default.createElement(N.default,{steps:ua,currentStepIndex:ze+1}),u.default.createElement(c.View,{style:{flexDirection:'column',alignItems:'center'}},u.default.createElement(O.default,{ref:De,activeStep:0,steps:ua,useNativeDriver:!0,nextStepAnimation:"slideLeft",prevStepAnimation:"slideRight",isFirstStep:function(t){return Ue(t)},isLastStep:function(t){return Fe(t)},onNext:function(){ia()},onPrev:function(){0===ze&&zt((0,b.fetchGetUserByNameOrNumberReset)())},currentStep:function(t){var n=t.currentStep,l=t.isLastStep,o=t.isFirstStep;Qe(n),Ue(o),Fe(l)}})),u.default.createElement(c.View,{style:W.iconNavigation},Le?u.default.createElement(c.View,null):u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(){return De.current.prev()}},u.default.createElement(A.default,{name:"arrow-left",size:20,color:E.Color.whiteColor})),2===ze?u.default.createElement(h.default,{loading:ee.loading,onPress:ea},_.default.t('SUBMIT_LABEL')):u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){ea(t),ia()&&De.current.next()}},J.loading||Z.loading||X.loading?u.default.createElement(c.ActivityIndicator,{size:"small",color:"#fff"}):u.default.createElement(A.default,{name:"arrow-right",size:24,color:E.Color.whiteColor}))),pt&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:pt,onSwipeComplete:function(){yt(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('EXAMEN')),u.default.createElement(c.FlatList,{data:Ze.exams,extraData:Ze.exams,keyExtractor:function(t,n){return n},renderItem:function(t){var n=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:n.id,onPress:function(){Pe(z({},n,{examen:!0})),$e(z({},Ze,{exams:Ze.exams.map(function(t){return n.id===t.id?z({},t,{checked:!n.checked}):t})})),n.checked||Ct(!0)}},u.default.createElement(V.default,{body2:!0,semibold:!0,numberOfLines:2},(null===n.quantity?'':n.quantity)+" "+n.description+" "+(n.unit_price?' - '+n.unit_price:'')+" \n "+n.act.name),n.checked&&u.default.createElement(A.default,{name:"check",size:14,color:E.Color.primaryColor}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return yt(!1)}},_.default.t('OK')))))),le&&u.default.createElement(f.default.Container,{contentStyle:{width:(0,w.responsiveWidth)(80)},useNativeDriver:!0,visible:le},u.default.createElement(f.default.Title,null,_.default.t('SCAN')),u.default.createElement(c.ScrollView,{style:[W.blockView,{borderBottomColor:E.Color.borderColor,maxHeight:300}]},u.default.createElement(V.default,null,_.default.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')),u.default.createElement(L.default,{onRead:function(t){re(!1),l(t.data)},flashMode:U.RNCamera.Constants.FlashMode.off})),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('CLOSE'),onPress:function(){re(!1)}})),bt&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:bt,onSwipeComplete:function(){St(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('LIST_ASSURE')),u.default.createElement(c.FlatList,{data:null==(Xt=J.result)?void 0:Xt.response,extraData:null==(Jt=J.result)?void 0:Jt.response,ListEmptyComponent:u.default.createElement(V.default,{body2:!0},_.default.t('NO_ASSURE_MATCH_SEARCH')),keyExtractor:function(t,n){return n},renderItem:function(t){var n=t.item;return t.index,u.default.createElement(c.View,{style:{paddingVertical:15,alignItems:'flex-start'}},u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%",flexDirection:'column'}],key:n.id,onPress:function(){'SUSPENDED'===n.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_SUSPENDU'),[{text:_.default.t('OK'),onPress:function(){}}]):'PAID'!==n.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_NON_EN_REGLE'),[{text:_.default.t('OK'),onPress:function(){}}]):(Se(n),Re(null),Gt(1),St(!1),ra('lastname_patient',n.user.lastname),ra('firstname_patient',n.user.firstname),j(n.user.id,'TO_BILL','CONSULTATION'))}},u.default.createElement(V.default,{body2:!0,semibold:!0},(null!==n.user.firstname?n.user.firstname:'')+" "+(null!==n.user.lastname?n.user.lastname:'')),u.default.createElement(V.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+n.insurance_consumed_amount),u.default.createElement(V.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+n.insurance_remaining_amount)),n.beneficiaries.map(function(t){return u.default.createElement(c.TouchableOpacity,{style:W.beneficiarySubSection,onPress:function(){'SUSPENDED'===n.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_PRINCIPAL_SUSPENDU'),[{text:_.default.t('OK'),onPress:function(){}}]):(Se(n),Re(t),Gt(0),St(!1),ra('lastname_patient',t.lastname),ra('firstname_patient',t.firstname),j(n.user.id,'TO_BILL','CONSULTATION',"&beneficiary_id="+t.id))}},u.default.createElement(c.View,{style:{width:10}}),u.default.createElement(c.View,{style:{paddingHorizontal:10,alignItems:'flex-start'}},u.default.createElement(V.default,{subhead:!0,semibold:!0,textAlign:"left"},(null!==t.firstname?t.firstname:'')+" "+(null!==t.lastname?t.lastname:'')+" ("+_.default.t('AYANT_DROITS')+")"),u.default.createElement(V.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+t.insurance_consumed_amount),u.default.createElement(V.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+t.insurance_remaining_amount)))}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return St(!1)}},_.default.t('OK')))))),It&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:It,onSwipeComplete:function(){Rt(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('MEDICAMENTS')),u.default.createElement(c.FlatList,{data:Ze.prescriptions,extraData:Ze.prescriptions,keyExtractor:function(t,n){return n},renderItem:function(t){var n=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:n.id,onPress:function(){Pe(z({},n,{quantity_original:n.quantity,drugs:!0})),$e(z({},Ze,{prescriptions:Ze.prescriptions.map(function(t){return n.id===t.id?z({},t,{checked:!n.checked}):t})})),n.checked||Ct(!0)}},u.default.createElement(V.default,{body2:!0,semibold:!0,numberOfLines:2},parseInt(n.quantity)-parseInt(null!==n.billed_quantity?n.billed_quantity:0)+" "+n.drug_or_device.name+" "+(n.unit_price?' - '+n.unit_price:'')+" \n "+n.dosage),n.checked&&u.default.createElement(A.default,{name:"check",size:14,color:E.Color.primaryColor}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return Rt(!1)}},_.default.t('OK')))))),Ye&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:Ye,onSwipeComplete:function(){We(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('LIST_CONSULTATION')),u.default.createElement(c.FlatList,{data:null==(Yt=X.result)?void 0:Yt.response,extraData:null==(Wt=X.result)?void 0:Wt.response,ListEmptyComponent:u.default.createElement(V.default,{body2:!0},_.default.t('NO_CONSULTATION')),keyExtractor:function(t,n){return n},renderItem:function(t){var n=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:n.id,onPress:function(){st(n),it(!0)}},u.default.createElement(V.default,{body2:!0,semibold:!0},n.type+" #"+n.health_care_sheet_id+" - "+Q(n.created_at).format('YYYY-MM-DD')))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return We(!1)}},_.default.t('OK')))))),ot&&u.default.createElement(f.default.Container,{useNativeDriver:!0,visible:ot},u.default.createElement(f.default.Title,null,_.default.t('DETAIL')),u.default.createElement(c.ScrollView,{persistentScrollbar:!0},u.default.createElement(c.View,{style:[W.blockView,{borderBottomColor:E.Color.borderColor}]},u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('PATIENT'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},dt.patient_lastname+" "+dt.patient_firstname))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},"Situation")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},dt.patient_situation.toLowerCase()))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('PRATICIEN'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},dt.practitioner_lastname+" "+dt.practitioner_firstname))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('CLASSE_PRESTATAIRE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.practitioner_provider_class.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('STATE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.state.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},"Type")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.type.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('CONDITION_PRISE_CHARGE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.care_condition.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('INSTITUTE_NAME'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(dt.institution_name.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},"Date")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},Q(dt.created_at).format('YYYY-MM-DD')))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('PRESTATION'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},dt.performances.map(function(t){return u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.act.name+" \n "+t.amount+" \n")}))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('EXAMEN'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},dt.exams.map(function(t){return u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.description+" \n "+t.act.name+" \n")}))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(V.default,{style:[W.body2]},_.default.t('MEDICAMENT'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},dt.prescriptions.map(function(t){return u.default.createElement(V.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.drug_or_device.name+" \n "+t.dosage+" \n")}))))),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('CANCEL_LABEL'),onPress:function(){it(!1)}}),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('OK'),onPress:function(){it(!1),St(!1),We(!1),$e(dt),nt(dt),De.current.next()}})),_t&&u.default.createElement(p.Formik,{validationSchema:Kt,initialValues:{examen_quantity:null!==Ve&&Ve.drugs?parseInt(Ve.quantity)-parseInt(null!==Ve.billed_quantity?Ve.billed_quantity:0):'',unit_quantity:'',unit_quantity_condition:null!==Ve&&!Ve.drugs&&'UNIT_PRICE'===Ve.act.billing_type,code_acte:''+Ve!==null?Ve.drugs?'':Ve.act:'',price:null!==Ve?Ve.drugs?'':Ve.act.amount:''},onSubmit:function(t){if(console.log("Value",Ve),Ve.examen)$e(z({},Ze,{exams:Ze.exams.map(function(n){return Ve.id===n.id?z({},n,{unit_price:t.price,quantity:t.examen_quantity,unit_quantity:''===t.unit_quantity?null:t.unit_quantity}):n})})),K({insurance_id:be.id,beneficiary_id:null!==Ie?Ie.id:null,care_condition:Ze._care_condition,act_action:"INSERT",act_type:"EXAM",exams:[{unit_price:t.price,quantity:t.examen_quantity}],tmp_sheet_id:At});else{var n=dt.prescriptions.filter(function(t){return t.id=Ve.id})[0].quantity;parseInt(t.examen_quantity)>parseInt(n-parseInt(null!==Ve.billed_quantity?Ve.billed_quantity:0))?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('QUANTITY_CANNOT_BE_SUPERIOR')+" "+n,[{text:_.default.t('OK'),onPress:function(){}}]):($e(z({},Ze,{prescriptions:Ze.prescriptions.map(function(n){return Ve.id===n.id?z({},n,{unit_price:t.price,quantity:t.examen_quantity}):n})})),K({insurance_id:be.id,beneficiary_id:null!==Ie?Ie.id:null,care_condition:Ze._care_condition,act_action:"INSERT",act_type:"PRESCRIPTION",tmp_sheet_id:At,prescriptions:[{unit_price:t.price,quantity:t.examen_quantity}]}))}}},function(t){var n=t.values,l=t.errors,o=t.touched,s=t.handleChange,f=(t.setFieldValue,t.setFieldTouched,t.handleBlur),p=t.handleSubmit;return t.isSubmitting,u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:_t,onSwipeComplete:function(){Ct(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),Ve.examen?u.default.createElement(u.default.Fragment,null,u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('EXECUTION')),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('QUANTITE'),value:''+n.examen_quantity,onChangeText:s('examen_quantity'),onBlur:f('examen_quantity'),success:o.examen_quantity&&!l.examen_quantity,touched:o.examen_quantity,error:l.examen_quantity,keyboardType:"numeric"}),"UNIT_PRICE"===Ve.act.billing_type?u.default.createElement(c.View,{style:{flexDirection:'row'}},u.default.createElement(V.default,{style:{marginTop:20,width:40,height:40}},Ve.act.unit_value+" = "),u.default.createElement(c.View,{style:{flexDirection:'row',width:'90%',justifyContent:'space-between'}},u.default.createElement(x.default,{style:{marginTop:10,width:180},editable:"FREE"===Ve.act.billing_type,placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:n.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!l.price,touched:o.price,error:l.price,keyboardType:"numeric"}),u.default.createElement(V.default,{style:{marginTop:20,marginLeft:5,width:40,height:40}}," X "),u.default.createElement(x.default,{style:{marginTop:10,width:180},placeholder:_.default.t('UNIT_QUANTITE'),value:''+n.unit_quantity,onChangeText:s('unit_quantity'),onBlur:f('unit_quantity'),success:o.unit_quantity&&!l.unit_quantity,touched:o.unit_quantity,error:l.unit_quantity,keyboardType:"numeric"}))):u.default.createElement(x.default,{style:{marginTop:10},editable:"FREE"===Ve.act.billing_type,placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:n.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!l.price,touched:o.price,error:l.price,keyboardType:"numeric"})):u.default.createElement(u.default.Fragment,null,u.default.createElement(V.default,{body2:!0,style:{marginTop:10}},_.default.t('EXECUTION')),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('QUANTITE'),value:''+n.examen_quantity,onChangeText:s('examen_quantity'),onBlur:f('examen_quantity'),success:o.examen_quantity&&!l.examen_quantity,touched:o.examen_quantity,error:l.examen_quantity,keyboardType:"numeric"}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:n.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!l.price,touched:o.price,error:l.price,keyboardType:"numeric"})),u.default.createElement(h.default,{loading:Y.loading,full:!0,style:{marginTop:10,marginBottom:20},onPress:p},_.default.t('OK'))))))})))))});e.default=J},1742,[4,1,7,27,15,18,1049,1423,1630,1637,1034,720,1703,1714,535,1485,1716,719,1415,1732,1733,1737,1738,1016,539,1416,772,750,982,1626,1417,1316,1457,1105,1035,1077,1189]); __d(function(e,t,a,l,n,r,o){var i=t(o[0]),u=t(o[1]);Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=u(t(o[2])),c=u(t(o[3])),s=u(t(o[4])),f=i(t(o[5])),m=t(o[6]),p=t(o[7]),E=u(t(o[8])),_=u(t(o[9])),g=t(o[10]),y=i(t(o[11])),C=t(o[12]),h=u(t(o[13])),w=t(o[14]),S=u(t(o[15])),b=t(o[16]),T=t(o[17]),I=u(t(o[18])),D=t(o[19]),R=u(t(o[20])),x=t(o[21]),v=u(t(o[22])),A=u(t(o[23])),O=u(t(o[24])),N=u(t(o[25])),V=u(t(o[26])),B=u(t(o[27])),M=i(t(o[28])),P=t(o[29]),k=u(t(o[30])),L=u(t(o[31])),U=t(o[32]),F=i(t(o[33])),Y=t(o[34]),G=t(o[35]),q=u(t(o[36])),H=t(o[37]),j=u(t(o[38])),Q=u(t(o[39]));function z(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,l)}return a}function K(e){for(var t=1;t0?Ia(!0):xl.alertWithType('warn',h.default.t('EMPTY_LIST'),h.default.t('NO_ASSURE_MATCH_SEARCH'))),X.error&&m.Alert.alert(h.default.t("ERROR_LABLE"),F.getErrorMsg(X),[{text:h.default.t("OK"),onPress:function(){Rl((0,T.fetchGetUserByNameOrNumberReset)())}}],{cancelable:!1})},[X]),(0,f.useEffect)(function(){console.log("getUserByNameOrNumber.result",Z),null!==Z.result&&(Re(!1),Oe(!0),Zl('numero_assure',Z.result.response.phone),l(be.id_network,"&phone="+Z.result.response.phone)),Z.error&&m.Alert.alert(h.default.t("ERROR_LABLE"),F.getErrorMsg(Z),[{text:h.default.t("OK"),onPress:function(){Rl((0,T.fetchGetUserByIdQRCodeReset)())}}],{cancelable:!1})},[Z]),(0,f.useEffect)(function(){null!==H.result&&null!==H.result.response&&(Xt.performances.length>=1&&(Va(!1),F.displayToast(h.default.t('PRESTATION_SUCCESSFULLY_ADD'))),Rl((0,T.fetchCheckInsuranceCoverageAmountReset)())),H.error&&m.Alert.alert(h.default.t("ERROR_LABLE"),F.getErrorMsg(H),[{text:h.default.t("OK"),onPress:function(){Xt.performances.length>=1&&(Zt(K({},Xt,{performances:(0,d.default)(ea.performances)})),Va(!1)),Rl((0,T.fetchCheckInsuranceCoverageAmountReset)())}}],{cancelable:!1})},[H]),(0,f.useEffect)(function(){null!==z.result&&zt(!0),z.error&&m.Alert.alert(h.default.t("ERROR_LABLE"),F.getErrorMsg(z),[{text:h.default.t("OK"),onPress:function(){Rl((0,T.fetchGetConsultationReset)())}}],{cancelable:!1})},[z]),(0,f.useEffect)(function(){null!==ne.result&&m.Alert.alert(h.default.t("SUCCESS"),ne.result.response,[{text:h.default.t("OK"),onPress:function(){Rl((0,T.fetchModifyPrescriptionReset)()),re.goBack()}}],{cancelable:!1}),ne.error&&m.Alert.alert(h.default.t("ERROR_LABLE"),F.getErrorMsg(ne),[{text:h.default.t("OK"),onPress:function(){Rl((0,T.fetchModifyPrescriptionReset)())}}],{cancelable:!1})},[ne]);var Al=y.object().shape({numero_assure:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),password:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),practitioner_lastname:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),practitioner_firstname:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED'))}),Ol=y.object().shape({price:y.number().required(h.default.t('THIS_FIELD_IS_REQUIRED'))}),Nl=y.object().shape({amount_prestation:y.number().required(h.default.t('THIS_FIELD_IS_REQUIRED')),code_acte:y.number().required(h.default.t('THIS_FIELD_IS_REQUIRED')),frais_deplacement:y.number(),date_prestation:y.date(),ticker_moderateur:y.number()}),Vl=y.object().shape({amount_prestation:y.number().required(h.default.t('THIS_FIELD_IS_REQUIRED')),date_prestation:y.date()}),Bl=(y.object().shape({examen_name:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),code_acte:y.number().required(h.default.t('THIS_FIELD_IS_REQUIRED')),examen_quantite:y.number().required(h.default.t('THIS_FIELD_IS_REQUIRED')),amount:y.number().required(h.default.t('THIS_FIELD_IS_REQUIRED'))}),y.object().shape({examen_name:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),examen_quantite:y.mixed(),amount:y.mixed()})),Ml=y.object().shape({drug_name:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),drug_quantity:y.number().required(h.default.t('THIS_FIELD_IS_REQUIRED')),drug_posologie:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED'))}),Pl=(y.object().shape({code:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),name:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),type:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED'))}),function(e,t){var a=t||new Date;me('ios'===m.Platform.OS),ge(W(a).format('YYYY-MM-DD')),Zl('accident_date',W(a).format('YYYY-MM-DD'))}),kl=function(e,t){var a=t||new Date;nt('ios'===m.Platform.OS),Qe(W(a).format('YYYY-MM-DD')),Zl('pregnancy_start_at',W(a).format('YYYY-MM-DD'))},Ll=function(e,t){var a=t||new Date;ut('ios'===m.Platform.OS),Xe(W(a).format('YYYY-MM-DD')),Zl('pregnancy_end_at',W(a).format('YYYY-MM-DD'))};console.log("consultaiton",Xt);var Ul,Fl,Yl,Gl,ql,Hl=(0,g.useFormik)({validationSchema:Al,initialValues:{numero_assure:'',password:'',firstname_patient:'',lastname_patient:'',practitioner_firstname:'',practitioner_lastname:'',agrement_praticien:null==pt?void 0:pt.code_membre,pregnancy_start_at:null,pregnancy_end_at:null,accident_date:null},onSubmit:function(e){i(Xt.id,{network_agent_id:be.network_agent_id,password:e.password,practitioner_lastname:e.practitioner_lastname,practitioner_firstname:e.practitioner_firstname,practitioner_provider_class_id:e.practitioner_provider_class_id,care_condition:e.care_condition,accident_date:e.accident_date,pregnancy_start_at:e.pregnancy_start_at,pregnancy_end_at:e.pregnancy_end_at,performances:Xt.performances,prescriptions:Xt.prescriptions,exams:Xt.exams})}}),jl=Hl.handleChange,Ql=Hl.handleSubmit,zl=Hl.handleBlur,Kl=Hl.values,Wl=Hl.errors,Xl=Hl.touched,Zl=Hl.setFieldValue,Jl=Hl.setFieldTouched,$l=(Hl.isValid,function(){switch(console.log("currentStep",Gt),Gt){case 0:return console.log("values",Kl),''!==Kl.numero_assure&&null===X.result&&(Rl((0,T.fetchGetUserByNameOrNumberReset)()),l(be.id_network,De?"&insured_id="+Kl.numero_assure:Ae?"&phone="+Kl.numero_assure:"&name="+Kl.numero_assure),console.log("errors",Wl)),!1;default:return!0}}),en=[{title:h.default.t('ASSURE'),content:f.default.createElement(m.View,null,f.default.createElement(R.default,{style:{marginTop:10,width:(0,b.responsiveWidth)(90)},placeholder:De?h.default.t('NUMERO_ASSURE'):Ae?h.default.t('PHONE_NUMBER'):h.default.t('NOM_ASSURE'),value:Kl.numero_assure,keyboardType:Ae?'numeric':'default',onChangeText:jl('numero_assure'),onBlur:zl('numero_assure'),success:Xl.numero_assure&&!Wl.numero_assure,touched:Xl.numero_assure,error:Wl.numero_assure,icon:f.default.createElement(N.default,{style:{zIndex:10},name:De?'lock':Ae?'phone':'user',size:20})}),f.default.createElement(m.View,{style:{flexDirection:'row',position:'absolute',top:22,right:70,justifyContent:'space-between',width:50}},f.default.createElement(O.default,{style:{paddingRight:10},name:"lock",size:20,color:C.Color.primaryColor,onPress:function(){Re(!0),Oe(!1)}}),f.default.createElement(O.default,{style:{paddingRight:10},name:"phone",size:20,color:C.Color.primaryColor,onPress:function(){Re(!1),Oe(!0)}}),f.default.createElement(O.default,{style:{paddingRight:10},name:"user",size:20,color:C.Color.primaryColor,onPress:function(){Re(!1),Oe(!1)}}),f.default.createElement(O.default,{style:{paddingRight:10},name:"qrcode",size:20,color:C.Color.primaryColor,onPress:function(){de(!0)}})))},{title:h.default.t('PATIENT'),content:f.default.createElement(m.View,null,f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('NOM_CLIENT'),value:Kl.lastname_patient,onChangeText:jl('lastname_patient'),onBlur:zl('lastname_patient'),success:Xl.lastname_patient&&!Wl.lastname_patient,touched:Xl.lastname_patient,editable:!1,error:Wl.lastname_patient}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('PRENOM_CLIENT'),value:Kl.firstname_patient,editable:!1,onChangeText:jl('firstname_patient'),onBlur:zl('firstname_patient'),success:Xl.firstname_patient&&!Wl.firstname_patient,touched:Xl.firstname_patient,error:Wl.firstname_patient}),f.default.createElement(m.View,{style:{marginTop:10,flexDirection:'row',justifyContent:"space-between"}},f.default.createElement(V.default,{body2:!0},h.default.t('SITUATION')),f.default.createElement(m.View,{style:{width:(0,b.responsiveWidth)(60)}},f.default.createElement(B.default,{options:dl,disabled:!0,value:fl,initial:fl,buttonColor:C.Color.accentColor,backgroundColor:C.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(e){}}))))},{title:h.default.t('PRATICIEN'),content:f.default.createElement(m.View,null,f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('CODE_AGREMENT'),value:Kl.agrement_praticien,editable:!1}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('NOM_PRATICIEN'),value:Kl.practitioner_lastname,onChangeText:jl('practitioner_lastname'),onBlur:zl('practitioner_lastname'),success:Xl.practitioner_lastname&&!Wl.practitioner_lastname,touched:Xl.practitioner_lastname,error:Wl.practitioner_lastname}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('PRENOM_PRATICIEN'),value:Kl.practitioner_firstname,onChangeText:jl('practitioner_firstname'),onBlur:zl('practitioner_firstname'),success:Xl.practitioner_firstname&&!Wl.practitioner_firstname,touched:Xl.practitioner_firstname,error:Wl.practitioner_firstname}),f.default.createElement(M.View,{ref:function(e){},style:{width:(0,b.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},f.default.createElement(P.Dropdown,{label:h.default.t('CLASSIFICATION'),value:null!==ua?ua.practitioner_provider_class:'',data:null!==J.result?null==(t=J.result)?void 0:t.response:[],useNativeDriver:!0,onChangeText:function(e,t,a){Jl('practitioner_provider_class_id'),Zl('practitioner_provider_class_id',e.id),console.log("Value",e)},valueExtractor:function(e){return e},labelExtractor:function(e){return e.name}})),f.default.createElement(M.View,{ref:function(e){},style:{width:(0,b.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},f.default.createElement(P.Dropdown,{label:h.default.t('CONDITION_PRISE_CHARGE'),value:null!==ua?ua.care_condition:'',data:Il,useNativeDriver:!0,onChangeText:function(e,t,a){console.log("Value",e),st(e),Jl('care_condition'),Zl('care_condition',e)},valueExtractor:function(e){return e.value},labelExtractor:function(e){return e.label}})),f.default.createElement(m.View,{style:{marginTop:10,flexDirection:'row',justifyContent:"space-between"}},f.default.createElement(V.default,{body2:!0},h.default.t('ACCIDENT')),f.default.createElement(m.View,{style:{width:(0,b.responsiveWidth)(40)}},f.default.createElement(B.default,{options:El,initial:null!==ua&&null!==ua.accident_date?0:1,buttonColor:C.Color.accentColor,backgroundColor:C.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(e){console.log(e),we('YES'===e)}}))),he&&f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('DATE_ACCIDENT'),value:null!==_e?_e:'',onChangeText:jl('date_accident'),onBlur:zl('date_accident'),onFocus:function(){Keyboard.dismiss(),me(!0)},success:Xl.date_accident&&!Wl.date_accident,touched:Xl.date_accident,error:Wl.date_accident}),f.default.createElement(m.View,{style:{marginTop:10,flexDirection:'row',justifyContent:"space-between"}},f.default.createElement(V.default,{body2:!0},h.default.t('GROSSESSE')),f.default.createElement(m.View,{style:$.contentSwitch},f.default.createElement(B.default,{options:gl,initial:null!==ua&&null!==ua.pregnancy_start_at?0:1,buttonColor:C.Color.accentColor,backgroundColor:C.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(e){et('YES'===e)}}))),$e&&f.default.createElement(f.default.Fragment,null,f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('DATE_DEBUT_GROSSESSE'),value:null!==je?je:'',onChangeText:jl('date_debut_grossesse'),onBlur:zl('date_debut_grossesse'),onFocus:function(){Keyboard.dismiss(),nt(!0)},success:Xl.date_debut_grossesse&&!Wl.date_debut_grossesse,touched:Xl.date_debut_grossesse,error:Wl.date_debut_grossesse}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('DATE_FIN_GROSSESSE'),value:null!==We?We:'',onChangeText:jl('date_fin_grossesse'),onBlur:zl('date_fin_grossesse'),onFocus:function(){Keyboard.dismiss(),ut(!0)},success:Xl.date_fin_grossesse&&!Wl.date_fin_grossesse,touched:Xl.date_fin_grossesse,error:Wl.date_fin_grossesse})),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('PASSWORD'),value:Kl.password,onChangeText:jl('password'),onBlur:zl('password'),success:Xl.password&&!Wl.password,touched:Xl.password,error:Wl.password,secureTextEntry:!0}),f.default.createElement(m.View,{style:{marginTop:25}},f.default.createElement(m.View,{style:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'}},f.default.createElement(m.TouchableOpacity,{style:[$.iconNavigationButton,{borderRadius:5,width:150,height:30,flexDirection:"row",backgroundColor:C.Color.primaryColor,borderColor:C.Color.primaryColor}],onPress:function(e){ga(!0)}},f.default.createElement(V.default,{whiteColor:!0},h.default.t('CONSULTATION')),f.default.createElement(j.default,{name:"medical-bag",size:20,color:C.Color.whiteColor})),f.default.createElement(m.TouchableOpacity,{style:[$.iconNavigationButton,{borderRadius:5,width:150,height:30,flexDirection:"row",backgroundColor:C.Color.primaryColor,borderColor:C.Color.primaryColor}],onPress:function(e){ma(!0)}},f.default.createElement(V.default,{whiteColor:!0},h.default.t('ACTE_EXAMEN')),f.default.createElement(O.default,{name:"file-medical",size:20,color:C.Color.whiteColor})))),f.default.createElement(m.View,{style:{marginTop:25,flexDirection:"row",alignItems:'center',justifyContent:'center',width:"100%"}},f.default.createElement(m.TouchableOpacity,{style:[$.iconNavigationButton,{borderRadius:5,width:150,height:30,backgroundColor:C.Color.primaryColor,borderColor:C.Color.primaryColor,flexDirection:"row"}],onPress:function(e){Ya(!0),Rt(null)}},f.default.createElement(V.default,{whiteColor:!0},h.default.t('MEDICAMENT')),f.default.createElement(Q.default,{name:"drug-pack",size:20,color:C.Color.whiteColor}))))}];return f.default.createElement(w.ScreenComponent,null,f.default.createElement(I.default,{ref:function(e){return xl=e}}),f.default.createElement(m.KeyboardAvoidingView,{behavior:'android'===m.Platform.OS?'height':'padding',style:{flex:1}},f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:$.contain},f.default.createElement(v.default,{steps:en,currentStepIndex:Gt+1}),f.default.createElement(m.View,{style:{flexDirection:'column',alignItems:'center'}},f.default.createElement(A.default,{ref:Nt,activeStep:0,steps:en,useNativeDriver:!0,nextStepAnimation:"slideLeft",prevStepAnimation:"slideRight",isFirstStep:function(e){return Pt(e)},isLastStep:function(e){return Ut(e)},onNext:function(){$l()},onPrev:function(){0===Gt&&Rl((0,T.fetchGetUserByNameOrNumberReset)())},currentStep:function(e){var t=e.currentStep,a=e.isLastStep,l=e.isFirstStep;qt(t),Pt(l),Ut(a)}})),f.default.createElement(m.View,{style:$.iconNavigation},Mt?f.default.createElement(m.View,null):f.default.createElement(m.TouchableOpacity,{style:[$.iconNavigationButton,{backgroundColor:C.Color.primaryColor,borderColor:C.Color.primaryColor}],onPress:function(){return Nt.current.prev()}},f.default.createElement(O.default,{name:"arrow-left",size:20,color:C.Color.whiteColor})),2===Gt?f.default.createElement(S.default,{loading:le.loading,onPress:Ql},h.default.t('SUBMIT_LABEL')):f.default.createElement(m.TouchableOpacity,{style:[$.iconNavigationButton,{backgroundColor:C.Color.primaryColor,borderColor:C.Color.primaryColor}],onPress:function(e){Ql(e),$l()&&Nt.current.next()}},X.loading||Z.loading||z.loading?f.default.createElement(m.ActivityIndicator,{size:"small",color:"#fff"}):f.default.createElement(O.default,{name:"arrow-right",size:24,color:C.Color.whiteColor}))),Na&&(ql=null!==At&&null===At.drugs?_.default.parseInt(At.amount):'',console.log("AMOUNT",ql),f.default.createElement(g.Formik,{validationSchema:Vl,initialValues:{amount_prestation:''+At!==null&&null===At.drugs?At.amount:'',frais_deplacement:null!==At&&null===At.drugs?At.home_visit_fees:'',code_acte:null!==At&&null===At.drugs?At.act:'',insurance_amount:''+At!==null&&null===At.drugs?At.insurance_amount:'',moderator_ticket:''+At!==null&&null===At.drugs?At.moderator_ticket:''},onSubmit:function(e){console.log("values",e),Zt(K({},Xt,{performances:Xt.performances.map(function(t){return At.id===t.id?K({},t,{act_id:e.code_acte.id,act:e.code_acte,amount:e.amount_prestation,home_visit_fees:e.frais_deplacement,to_delete:!1}):t})})),x({insurance_id:yt.id,beneficiary_id:null!==St?St.id:null,care_condition:Xt._care_condition,act_action:"UPDATE",act_type:"PERFORMANCE",act_id:At.id,tmp_sheet_id:Be,performances:[{amount:e.amount_prestation,home_visit_fees:e.frais_deplacement}]})}},function(e){var t,a=e.values,l=e.errors,n=e.touched,r=e.handleChange,o=e.handleBlur,i=e.setFieldValue,u=e.setFieldTouched,d=e.handleSubmit;return e.isSubmitting,f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:Na,onSwipeComplete:function(){Va(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('MODIFY_PRESTATION')),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('DATE'),value:null!==At&&null===At.drugs?W(At.created_at).format('YYYY-MM-DD HH:mm'):''+W(ke).format('YYYY-MM-DD HH:mm'),editable:!1}),f.default.createElement(M.View,{ref:function(e){vl=e},style:{width:(0,b.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},f.default.createElement(P.Dropdown,{label:h.default.t('CODE_ACTE'),data:null!==te.result?null==(t=te.result)?void 0:t.response.filter(function(e){return'CONSULTATION'===e.type}):[],useNativeDriver:!0,value:"number"!=typeof a.code_acte&&a.code_acte.name,onChangeText:function(e,t,a){u('code_acte'),i('code_acte',e),null!==e.amount&&(i('amount_prestation',e.amount),c({network_id:be.id_network,amount:''+e.amount,care_condition:Xt._care_condition}))},valueExtractor:function(e){return e},labelExtractor:function(e){return e.name}})),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('AMOUNT'),value:a.amount_prestation,onChangeText:function(e){i('amount_prestation',e),c({network_id:be.id_network,amount:''+e,care_condition:Xt._care_condition})},editable:''===a.code_acte||'FREE'===a.code_acte.billing_type,onBlur:o('amount_prestation'),success:n.amount_prestation&&!l.amount_prestation,touched:n.amount_prestation,error:l.amount_prestation}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('TICKET_MONDERATEUR'),editable:!1,value:null!==ae.result?ae.result.response.moderator_ticket:null!==At&&null===At.drugs?a.moderator_ticket:''}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('AMOUNT_PER_INSURANCE'),editable:!1,value:null!==ae.result?ae.result.response.insurance_amount:null!==At&&null===At.drugs?a.insurance_amount:''}),f.default.createElement(m.View,{style:{marginTop:10,width:"100%",flexDirection:'row',justifyContent:"space-between"}},f.default.createElement(V.default,{body2:!0},h.default.t('VISITE_DOMICILE')),f.default.createElement(m.View,{style:$.contentSwitch},f.default.createElement(B.default,{options:Cl,initial:1,buttonColor:C.Color.accentColor,backgroundColor:C.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(e){bl('YES'===e)}}))),Sl&&f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('FRAIS_DEPLACEMENT'),value:a.frais_deplacement,onChangeText:r('frais_deplacement'),onBlur:o('frais_deplacement'),success:n.frais_deplacement&&!l.frais_deplacement,touched:n.frais_deplacement,error:l.frais_deplacement}),f.default.createElement(S.default,{loading:H.loading,style:{marginTop:20,marginBottom:20},full:!0,onPress:function(){d(),console.log("Error",l)}},h.default.t('SUBMIT_LABEL'))))))})),_a&&f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:_a,onSwipeComplete:function(){ga(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('LIST_PRESTATION')),f.default.createElement(m.FlatList,{data:Xt.performances.filter(function(e){return!e.to_delete}),extraData:Xt.performances.filter(function(e){return!e.to_delete}),keyExtractor:function(e,t){return t},renderItem:function(e){var t=e.item;return e.index,f.default.createElement(m.View,{style:[$.contentActionModalBottom,{borderBottomColor:C.Color.borderColor,width:"100%"}],key:t.id},f.default.createElement(V.default,{body2:!0,semibold:!0,numberOfLines:5},(0,F.cutString)(t.act.name,30)+"\n \n "+h.default.t('AMOUNT_LABEL')+": "+t.amount+" \n \n "+h.default.t('AMOUNT_PER_INSURANCE')+": "+t.insurance_amount+" \n \n "+h.default.t('TICKET_MONDERATEUR')+": "+t.moderator_ticket+" "+(null!==t.home_visit_fees?'| '+t.home_visit_fees:'')),f.default.createElement(m.View,{style:$.iconRight},f.default.createElement(m.TouchableOpacity,{onPress:function(){Ot(K({},t,{drugs:null})),Va(!0)}},f.default.createElement(O.default,{name:"edit",size:24,color:C.Color.primaryColor})),f.default.createElement(m.TouchableOpacity,{onPress:function(){Zt(K({},Xt,{performances:Xt.performances.map(function(e){return t.id===e.id?K({},e,{to_delete:!0}):e})}))}},f.default.createElement(O.default,{name:"minus-circle",size:24,color:C.Color.grayColor}))))}}),f.default.createElement(S.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return ga(!1)}},h.default.t('OK')))))),Pa&&f.default.createElement(g.Formik,{validationSchema:Nl,initialValues:{amount_prestation:'',frais_deplacement:'',code_acte:''},onSubmit:function(e){''===e.code_acte?vl.shake(200):(tl([{act_id:e.code_acte.id,act:e.code_acte,amount:e.amount_prestation,home_visit_fees:e.frais_deplacement}].concat((0,d.default)(el))),ka(!1),F.displayToast(h.default.t('PRESTATION_SUCCESSFULLY_MODIFY')))}},function(e){var t,a=e.values,l=e.errors,n=e.touched,r=e.handleChange,o=e.handleBlur,i=e.setFieldValue,u=e.setFieldTouched,d=e.handleSubmit;return e.isSubmitting,f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:Pa,onSwipeComplete:function(){ka(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('MODIFY_PRESTATION')),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('DATE'),value:''+W(ke).format('YYYY-MM-DD HH:mm'),editable:!1}),f.default.createElement(M.View,{ref:function(e){vl=e},style:{width:(0,b.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},f.default.createElement(P.Dropdown,{label:h.default.t('CODE_ACTE'),data:null!==te.result?null==(t=te.result)?void 0:t.response.filter(function(e){return'CONSULTATION'===e.type}):[],useNativeDriver:!0,onChangeText:function(e,t,a){u('code_acte'),i('code_acte',e),'FREE'!==e.billing_type&&(i('amount_prestation',e.amount),c({network_id:be.id_network,amount:''+e.amount,care_condition:Xt._care_condition}))},valueExtractor:function(e){return e},labelExtractor:function(e){return e.name}})),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('AMOUNT'),editable:''===a.code_acte||'FREE'===a.code_acte.billing_type,value:a.amount_prestation,onChangeText:r('amount_prestation'),onBlur:o('amount_prestation'),success:n.amount_prestation&&!l.amount_prestation,touched:n.amount_prestation,error:l.amount_prestation,onChangeText:function(e){i('amount_prestation',e),c({network_id:be.id_network,amount:''+e,care_condition:Xt._care_condition})}}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('TICKET_MONDERATEUR'),editable:!1,value:null!==ae.result?ae.result.response.moderator_ticket:''}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('AMOUNT_PER_INSURANCE'),editable:!1,value:null!==ae.result?ae.result.response.insurance_amount:''}),f.default.createElement(m.View,{style:{marginTop:10,width:"100%",flexDirection:'row',justifyContent:"space-between"}},f.default.createElement(V.default,{body2:!0},h.default.t('VISITE_DOMICILE')),f.default.createElement(m.View,{style:$.contentSwitch},f.default.createElement(B.default,{options:Cl,initial:1,buttonColor:C.Color.accentColor,backgroundColor:C.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(e){bl('YES'===e)}}))),Sl&&f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('FRAIS_DEPLACEMENT'),value:a.frais_deplacement,onChangeText:r('frais_deplacement'),onBlur:o('frais_deplacement'),success:n.frais_deplacement&&!l.frais_deplacement,touched:n.frais_deplacement,error:l.frais_deplacement}),f.default.createElement(S.default,{style:{marginTop:20,marginBottom:20},full:!0,onPress:d},h.default.t('SUBMIT_LABEL'))))))}),Fa&&f.default.createElement(g.Formik,{validationSchema:Ml,initialValues:{drug_name:'',drug_posologie:'',drug_quantity:''},onSubmit:function(e){il([{drug_or_device_id:Dt.id,dosage:e.drug_posologie,quantity:e.drug_quantity}].concat((0,d.default)(ol))),Ya(!1),F.displayToast(h.default.t('PRESCRIPTIONS_SUCCESSFULLY_ADD'))}},function(e){var t=e.values,a=e.errors,l=e.touched,n=e.handleChange,r=e.handleBlur,i=e.handleSubmit;return e.isSubmitting,f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:Fa,onSwipeComplete:function(){Ya(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('AJOUTER_MEDICAMENT')),f.default.createElement(m.View,{style:{flexDirection:'row'}},f.default.createElement(R.default,{style:{marginTop:10,width:"90%"},placeholder:h.default.t('NAME'),value:null!==Dt?Dt.name:t.drug_name,onChangeText:n('drug_name'),onBlur:r('drug_name'),success:l.drug_name&&!a.drug_name,touched:l.drug_name,error:a.drug_name,editable:null===Dt}),f.default.createElement(m.TouchableOpacity,{style:[$.iconNavigationButton,{backgroundColor:C.Color.primaryColor,borderColor:C.Color.primaryColor,marginTop:10,width:40,height:40}],onPress:function(e){o(be.id_network,t.drug_name)}},ee.loading?f.default.createElement(m.ActivityIndicator,{size:"small",color:"#fff"}):f.default.createElement(N.default,{name:"search",size:24,color:C.Color.whiteColor}))),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('POSOLOGIE'),value:t.drug_posologie,onChangeText:n('drug_posologie'),onBlur:r('drug_posologie'),success:l.drug_posologie&&!a.drug_posologie,touched:l.drug_posologie,error:a.drug_posologie}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('QUANTITE'),value:t.drug_quantity,onChangeText:n('drug_quantity'),onBlur:r('drug_quantity'),success:l.drug_quantity&&!a.drug_quantity,touched:l.drug_quantity,error:a.drug_quantity,keyboardType:"numeric"}),f.default.createElement(S.default,{style:{marginTop:20,marginBottom:20},full:!0,onPress:i},h.default.t('SUBMIT_LABEL'))))))}),Ha&&f.default.createElement(g.Formik,{validationSchema:Ml,initialValues:{drug_name:null!==At&&At.drugs?At.drug_or_device.name:'',drug_posologie:null!==At&&At.drugs?At.dosage:'',drug_quantity:null!==At&&At.drugs?At.quantity:''},onSubmit:function(e){Zt(K({},Xt,{prescriptions:Xt.prescriptions.map(function(t){return At.id===t.id?{id:t.id,drug_or_device_id:At.drug_or_device.id,drug_or_device:At.drug_or_device,dosage:e.drug_posologie,quantity:e.drug_quantity,unit_price:t.unit_price,to_delete:!1}:t})})),ja(!1),F.displayToast(h.default.t('PRESCRIPTIONS_SUCCESSFULLY_MODIFY'))}},function(e){var t=e.values,a=e.errors,l=e.touched,n=e.handleChange,r=e.handleBlur,o=e.handleSubmit;return e.isSubmitting,f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:Ha,onSwipeComplete:function(){ja(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('MODIFIER_MEDICAMENT')),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('NAME'),value:t.drug_name,onChangeText:n('drug_name'),onBlur:r('drug_name'),success:l.drug_name&&!a.drug_name,touched:l.drug_name,error:a.drug_name,editable:null===Dt}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('POSOLOGIE'),value:t.drug_posologie,onChangeText:n('drug_posologie'),onBlur:r('drug_posologie'),success:l.drug_posologie&&!a.drug_posologie,touched:l.drug_posologie,error:a.drug_posologie}),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('QUANTITE'),value:''+t.drug_quantity,onChangeText:n('drug_quantity'),onBlur:r('drug_quantity'),success:l.drug_quantity&&!a.drug_quantity,touched:l.drug_quantity,error:a.drug_quantity,keyboardType:"numeric"}),f.default.createElement(S.default,{style:{marginTop:20,marginBottom:20},full:!0,onPress:o},h.default.t('SUBMIT_LABEL'))))))}),Ka&&f.default.createElement(g.Formik,{validationSchema:Bl,initialValues:{examen_name:null!==At?At.drugs?'':At.description:'',examen_quantite:''+At!==null?At.drugs?'':At.quantity:'',code_acte:''+At!==null?At.drugs?'':At.act:'',amount:null!==At?At.drugs?null:At.act.amount:null},onSubmit:function(e){Zt(K({},Xt,{exams:Xt.exams.map(function(t){return At.id===t.id?K({},t,{id:t.id,amount:e.amount,act_id:e.code_acte.id,act:e.code_acte,description:e.examen_name,quantity:null,unit_price:t.unit_price,to_delete:!1}):t})})),Wa(!1),F.displayToast(h.default.t('EXAMENS_SUCCESSFULLY_MODIFY'))}},function(e){var t,a=e.values,l=e.errors,n=e.touched,r=e.handleChange,o=e.setFieldValue,i=e.setFieldTouched,u=e.handleBlur,d=e.handleSubmit;return e.isSubmitting,f.default.createElement(m.ScrollView,{style:{flex:1}},console.log("Errors",l),f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:Ka,onSwipeComplete:function(){Wa(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('MODIFIER_EXAMEN')),f.default.createElement(M.View,{ref:function(e){vl=e},style:{width:(0,b.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},f.default.createElement(P.Dropdown,{label:h.default.t('CODE_ACTE'),data:null!==te.result?null==(t=te.result)?void 0:t.response.filter(function(e){return"EXAM_OR_OTHER"===e.type}):[],useNativeDriver:!0,value:"number"!=typeof a.code_acte&&a.code_acte.name,onChangeText:function(e,t,a){console.log("Value",e),i('code_acte'),o('code_acte',e)},valueExtractor:function(e){return e},labelExtractor:function(e){return e.name}})),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('DESCRIPTION'),value:a.examen_name,onChangeText:r('examen_name'),onBlur:u('examen_name'),success:n.examen_name&&!l.examen_name,touched:n.examen_name,error:l.examen_name}),f.default.createElement(m.View,null,f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('AMOUNT'),value:''!==a.code_acte?'FREE'===a.code_acte.billing_type?h.default.t('AMOUNT_FREE'):a.code_acte.unit_value+" = "+a.code_acte.amount:'',editable:!1,onChangeText:r('amount'),onBlur:u('amount'),success:n.amount&&!l.amount,touched:n.amount,error:l.amount,keyboardType:"numeric"})),f.default.createElement(S.default,{style:{marginTop:20,marginBottom:20},full:!0,loading:ne.loading,onPress:function(){console.log("errors",l),console.log("values",a),d()}},h.default.t('SUBMIT_LABEL'))))))}),Ye&&f.default.createElement(q.default,{timeZoneOffsetInMinutes:0,is24Hour:!0,value:new Date(ke),mode:"date",display:"spinner",onChange:(y.object().shape({code:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),name:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED')),type:y.string().required(h.default.t('THIS_FIELD_IS_REQUIRED'))}),function(e,t){var a=t||''+W(new Date).format('YYYY-MM-DD');Ge('ios'===m.Platform.OS),Le(a)})}),fe&&f.default.createElement(q.default,{timeZoneOffsetInMinutes:0,is24Hour:!0,value:new Date,mode:"date",display:"spinner",onChange:Pl}),lt&&f.default.createElement(q.default,{timeZoneOffsetInMinutes:0,is24Hour:!0,value:new Date,mode:"date",display:"spinner",onChange:kl}),it&&f.default.createElement(q.default,{timeZoneOffsetInMinutes:0,is24Hour:!0,value:new Date,mode:"date",display:"spinner",onChange:Ll}),fa&&f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:fa,onSwipeComplete:function(){ma(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('EXAMEN')),f.default.createElement(m.FlatList,{data:Xt.exams.filter(function(e){return!e.to_delete}),extraData:Xt.exams.filter(function(e){return!e.to_delete}),keyExtractor:function(e,t){return t},renderItem:function(e){var t=e.item;return e.index,f.default.createElement(m.View,{style:[$.contentActionModalBottom,{borderBottomColor:C.Color.borderColor,width:"100%"}],key:t.id},f.default.createElement(V.default,{body2:!0,semibold:!0,numberOfLines:2},t.description+" "+(t.unit_price?' - '+t.unit_price:'')+" \n "+(0,F.cutStringWithoutDot)(t.act.name,50)),f.default.createElement(m.View,{style:$.iconRight},f.default.createElement(m.TouchableOpacity,{onPress:function(){Ot(K({},t,{drugs:!1})),Wa(!0)}},f.default.createElement(O.default,{name:"edit",size:24,color:C.Color.primaryColor})),f.default.createElement(m.TouchableOpacity,{onPress:function(){Zt(K({},Xt,{exams:Xt.exams.map(function(e){return t.id===e.id?K({},e,{to_delete:!0}):e})}))}},f.default.createElement(O.default,{name:"minus-circle",size:24,color:C.Color.grayColor}))))}}),f.default.createElement(S.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return ma(!1)}},h.default.t('OK')))))),ue&&f.default.createElement(E.default.Container,{contentStyle:{width:(0,b.responsiveWidth)(80)},useNativeDriver:!0,visible:ue},f.default.createElement(E.default.Title,null,h.default.t('SCAN')),f.default.createElement(m.ScrollView,{style:[$.blockView,{borderBottomColor:C.Color.borderColor,maxHeight:300}]},f.default.createElement(V.default,null,h.default.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')),f.default.createElement(L.default,{onRead:function(e){de(!1),a(e.data),console.log("result",e.data)},flashMode:U.RNCamera.Constants.FlashMode.off})),f.default.createElement(E.default.Button,{bold:!0,label:h.default.t('CLOSE'),onPress:function(){de(!1)}})),Ta&&f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:Ta,onSwipeComplete:function(){Ia(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('LIST_ASSURE')),f.default.createElement(m.FlatList,{data:null==(Yl=X.result)?void 0:Yl.response,extraData:null==(Gl=X.result)?void 0:Gl.response,ListEmptyComponent:f.default.createElement(V.default,{body2:!0},h.default.t('NO_ASSURE_MATCH_SEARCH')),keyExtractor:function(e,t){return t},renderItem:function(e){var t=e.item;return e.index,f.default.createElement(m.View,{style:{paddingVertical:15,alignItems:'flex-start'}},f.default.createElement(m.TouchableOpacity,{style:[$.contentActionModalBottom,{borderBottomColor:C.Color.borderColor,width:"100%",flexDirection:'column'}],key:t.id,onPress:function(){'SUSPENDED'===t.state?m.Alert.alert(h.default.t('ERROR_LABEL'),h.default.t('ASSURE_SUSPENDU'),[{text:h.default.t('OK'),onPress:function(){}}]):'PAID'!==t.state?m.Alert.alert(h.default.t('ERROR_LABEL'),h.default.t('ASSURE_NON_EN_REGLE'),[{text:h.default.t('OK'),onPress:function(){}}]):(Ct(t),bt(null),ml(1),Ia(!1),Zl('lastname_patient',t.user.lastname),Zl('firstname_patient',t.user.firstname),r(t.user.id,'UNTREATED','CONSULTATION',"&network_agent_id="+be.network_agent_id))}},f.default.createElement(V.default,{body2:!0,semibold:!0},(null!==t.user.firstname?t.user.firstname:'')+" "+(null!==t.user.lastname?t.user.lastname:'')),f.default.createElement(V.default,{footnote:!0},h.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+t.insurance_consumed_amount),f.default.createElement(V.default,{footnote:!0},h.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+t.insurance_remaining_amount)),t.beneficiaries.map(function(e){return f.default.createElement(m.TouchableOpacity,{style:$.beneficiarySubSection,onPress:function(){'SUSPENDED'===t.state?m.Alert.alert(h.default.t('ERROR_LABEL'),h.default.t('ASSURE_PRINCIPAL_SUSPENDU'),[{text:h.default.t('OK'),onPress:function(){}}]):(Ct(t),bt(e),ml(0),Ia(!1),Zl('lastname_patient',e.lastname),Zl('firstname_patient',e.firstname),r(t.user.id,'UNTREATED','CONSULTATION',"&beneficiary_id="+e.id))}},f.default.createElement(m.View,{style:{width:10}}),f.default.createElement(m.View,{style:{paddingHorizontal:10,alignItems:'flex-start'}},f.default.createElement(V.default,{subhead:!0,semibold:!0,textAlign:"left"},(null!==e.firstname?e.firstname:'')+" "+(null!==e.lastname?e.lastname:'')+" ("+h.default.t('AYANT_DROITS')+")"),f.default.createElement(V.default,{footnote:!0},h.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+e.insurance_consumed_amount),f.default.createElement(V.default,{footnote:!0},h.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+e.insurance_remaining_amount)))}))}}),f.default.createElement(S.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return Ia(!1)}},h.default.t('OK')))))),xa&&f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:xa,onSwipeComplete:function(){va(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('MEDICAMENTS')),f.default.createElement(m.FlatList,{data:Xt.prescriptions.filter(function(e){return!e.to_delete}),extraData:Xt.prescriptions.filter(function(e){return!e.to_delete}),keyExtractor:function(e,t){return t},renderItem:function(e){var t=e.item;return e.index,f.default.createElement(m.View,{style:[$.contentActionModalBottom,{borderBottomColor:C.Color.borderColor,width:"100%"}],key:t.id},f.default.createElement(V.default,{body2:!0,semibold:!0,numberOfLines:2},t.quantity+" "+t.drug_or_device.name+" "+(t.unit_price?' - '+t.unit_price:'')+" \n "+t.dosage),f.default.createElement(m.View,{style:$.iconRight},f.default.createElement(m.TouchableOpacity,{onPress:function(){Ot(K({},t,{drugs:!0})),ja(!0)}},f.default.createElement(O.default,{name:"edit",size:24,color:C.Color.primaryColor})),f.default.createElement(m.TouchableOpacity,{onPress:function(){Zt(K({},Xt,{prescriptions:Xt.prescriptions.map(function(e){return t.id===e.id?K({},e,{to_delete:!0}):e})}))}},f.default.createElement(O.default,{name:"minus-circle",size:24,color:C.Color.grayColor}))))}}),f.default.createElement(S.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return va(!1)}},h.default.t('OK')))))),Qt&&f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:Qt,onSwipeComplete:function(){zt(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('LIST_CONSULTATION')),f.default.createElement(m.FlatList,{data:null==(Ul=z.result)?void 0:Ul.response,ListEmptyComponent:f.default.createElement(V.default,{body2:!0},h.default.t('NO_CONSULTATION')),extraData:null==(Fl=z.result)?void 0:Fl.response,keyExtractor:function(e,t){return t},renderItem:function(e){var t=e.item;return e.index,f.default.createElement(m.TouchableOpacity,{style:[$.contentActionModalBottom,{borderBottomColor:C.Color.borderColor,width:"100%"}],key:t.id,onPress:function(){da(t),ra(!0)}},f.default.createElement(V.default,{body2:!0,semibold:!0},t.type+" #"+t.health_care_sheet_id+" - "+W(t.created_at).format('YYYY-MM-DD')))}}),f.default.createElement(S.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return zt(!1)}},h.default.t('OK')))))),na&&f.default.createElement(E.default.Container,{useNativeDriver:!0,visible:na},f.default.createElement(E.default.Title,null,h.default.t('DETAIL')),f.default.createElement(m.ScrollView,{persistentScrollbar:!0},f.default.createElement(m.View,{style:[$.blockView,{borderBottomColor:C.Color.borderColor}]},f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('PATIENT'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},ua.patient_lastname+" "+ua.patient_firstname))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},"Situation")),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},ua.patient_situation.toLowerCase()))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('PRATICIEN'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},ua.practitioner_lastname+" "+ua.practitioner_firstname))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('CLASSE_PRESTATAIRE'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},(0,F.uppercaseFirstLetter)(ua.practitioner_provider_class.toLowerCase())))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('STATE'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},(0,F.uppercaseFirstLetter)(ua.state.toLowerCase())))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},"Type")),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},(0,F.uppercaseFirstLetter)(ua.type.toLowerCase())))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('CONDITION_PRISE_CHARGE'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},(0,F.uppercaseFirstLetter)(ua.care_condition.toLowerCase())))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('INSTITUTE_NAME'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},(0,F.uppercaseFirstLetter)(ua.institution_name.toLowerCase())))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},"Date")),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},W(ua.created_at).format('YYYY-MM-DD')))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('PRESTATION'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},ua.performances.map(function(e){return f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},e.act.name+" \n "+e.amount+" \n")}))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('EXAMEN'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},ua.exams.map(function(e){return f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},e.description+" \n "+e.act.name+" \n")}))),f.default.createElement(m.View,{style:{flexDirection:'row',marginTop:10}},f.default.createElement(m.View,{style:{flex:1}},f.default.createElement(V.default,{style:[$.body2]},h.default.t('MEDICAMENT'))),f.default.createElement(m.View,{style:{flex:1,alignItems:'flex-end'}},ua.prescriptions.map(function(e){return f.default.createElement(V.default,{style:[G.Typography.caption1,C.Color.grayColor]},e.drug_or_device.name+" \n "+e.dosage+" \n")}))))),f.default.createElement(E.default.Button,{bold:!0,label:h.default.t('CANCEL_LABEL'),onPress:function(){ra(!1)}}),f.default.createElement(E.default.Button,{bold:!0,label:h.default.t('OK'),onPress:function(){ra(!1),Ia(!1),zt(!1),Zt(K({},ua,{exams:ua.exams.map(function(e){return K({},e,{to_delete:!1})}),performances:ua.performances.map(function(e){return K({},e,{to_delete:!1})}),prescriptions:ua.prescriptions.map(function(e){return K({},e,{to_delete:!1})})})),ta(K({},ua,{exams:ua.exams.map(function(e){return K({},e,{to_delete:!1})}),performances:ua.performances.map(function(e){return K({},e,{to_delete:!1})}),prescriptions:ua.prescriptions.map(function(e){return K({},e,{to_delete:!1})})})),st(ua.care_condition),Zl('practitioner_firstname',ua.practitioner_firstname),Zl('practitioner_lastname',ua.practitioner_lastname),Zl('pregnancy_start_at',ua.pregnancy_start_at),Zl('accident_date',ua.accident_date),we(null!==ua.accident_date),et(null!==ua.pregnancy_start_at),Nt.current.next()}})),ha&&f.default.createElement(g.Formik,{validationSchema:Ol,initialValues:{price:''},onSubmit:function(e){console.log("Value",At),At.examen?Zt(K({},Xt,{exams:Xt.exams.map(function(t){return At.id===t.id?K({},t,{unit_price:e.price}):t})})):Zt(K({},Xt,{prescriptions:Xt.prescriptions.map(function(t){return At.id===t.id?K({},t,{unit_price:e.price}):t})})),wa(!1)}},function(e){var t=e.values,a=e.errors,l=e.touched,n=e.handleChange,r=(e.setFieldValue,e.setFieldTouched,e.handleBlur),o=e.handleSubmit;return e.isSubmitting,f.default.createElement(m.ScrollView,{style:{flex:1}},f.default.createElement(m.View,{style:[$.containModal,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(k.default,{isVisible:ha,onSwipeComplete:function(){wa(!1)},swipeDirection:['down'],style:$.bottomModal},f.default.createElement(m.View,{style:[$.contentFilterBottom,{backgroundColor:C.Color.containerBackgroundColor}]},f.default.createElement(m.View,{style:$.contentSwipeDown},f.default.createElement(m.View,{style:$.lineSwipeDown})),f.default.createElement(V.default,{body2:!0,style:{marginTop:10}},h.default.t('AMOUNT_LABEL')),f.default.createElement(R.default,{style:{marginTop:10},placeholder:h.default.t('AMOUNT_LABEL_DESCRIPTION'),value:t.price,onChangeText:n('price'),onBlur:r('price'),success:l.price&&!a.price,touched:l.price,error:a.price,keyboardType:"numeric"}),f.default.createElement(S.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:o},h.default.t('OK'))))))})))))});r.default=te},1743,[4,1,35,7,27,15,18,1049,1423,941,1630,1637,1034,720,1703,1714,535,1485,1716,719,1415,1733,1737,1738,1016,539,1416,772,750,982,1626,1417,1316,1457,1105,1077,1566,1732,882,1035,1189]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),l=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(r(d[2])),o=l(r(d[3])),u=t(r(d[4])),c=r(d[5]),s=r(d[6]),f=l(r(d[7])),p=r(d[8]),y=t(r(d[9])),E=r(d[10]),_=l(r(d[11])),C=r(d[12]),h=l(r(d[13])),w=r(d[14]),b=r(d[15]),S=l(r(d[16])),T=r(d[17]),x=l(r(d[18])),I=r(d[19]),R=r(d[20]),A=l(r(d[21])),O=l(r(d[22])),N=l(r(d[23])),v=l(r(d[24])),P=l(r(d[25])),V=l(r(d[26])),D=t(r(d[27])),B=r(d[28]),k=l(r(d[29])),U=l(r(d[30])),L=r(d[31]),M=t(r(d[32])),q=r(d[33]),F=l(r(d[34])),G=r(d[35]);function j(t,l){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);l&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function z(t){for(var l=1;l0?Rt(!0):Yt.alertWithType('warn',_.default.t('EMPTY_LIST'),_.default.t('NO_ASSURE_MATCH_SEARCH'))),Z.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(Z),[{text:_.default.t("OK"),onPress:function(){Qt((0,b.fetchGetUserByNameOrNumberReset)())}}],{cancelable:!1})},[Z]),(0,u.useEffect)(function(){null!==J.result&&$e(!0),J.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(J),[{text:_.default.t("OK"),onPress:function(){Qt((0,b.fetchGetConsultationReset)())}}],{cancelable:!1})},[J]),(0,u.useEffect)(function(){null!==X.result&&c.Alert.alert(_.default.t("SUCCESS"),X.result.response,[{text:_.default.t("OK"),onPress:function(){Qt((0,b.fetchModifyPrescriptionReset)()),ae.goBack()}}],{cancelable:!1}),X.error&&c.Alert.alert(_.default.t("ERROR_LABLE"),M.getErrorMsg(X),[{text:_.default.t("OK"),onPress:function(){Qt((0,b.fetchModifyPrescriptionReset)())}}],{cancelable:!1})},[X]),(0,u.useEffect)(function(){St(!1),null!==K.result&&null!==K.result.response&&Qt((0,b.fetchCheckInsuranceCoverageAmountReset)()),K.error&&c.Alert.alert(_.default.t("INFORMATION_MESSAGE"),M.getErrorMsg(K),[{text:_.default.t("OK"),onPress:function(){Ve.examen?lt(z({},at,{exams:at.exams.map(function(t){return Ve.id===t.id?z({},t,{unit_price:ot.exams.filter(function(t){return t.id===Ve.id})[0].unit_price}):t})})):lt(z({},at,{prestations:at.prestations.map(function(t){return Ve.id===t.id?z({},t,{quantity:ot.exams.filter(function(t){return t.id===Ve.id})[0].quantity,unit_price:ot.exams.filter(function(t){return t.id===Ve.id})[0].unit_price}):t})})),Qt((0,b.fetchCheckInsuranceCoverageAmountReset)())}}],{cancelable:!1})},[K]);var Ht=y.object().shape({numero_assure:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),password:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),practitioner_lastname:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED')),practitioner_firstname:y.string().required(_.default.t('THIS_FIELD_IS_REQUIRED'))}),Kt=y.object().shape({price:y.number().required(_.default.t('THIS_FIELD_IS_REQUIRED')),examen_quantite:y.number(),unit_quantity_condition:y.boolean(),unit_quantity:y.number().when('unit_quantity_condition',{is:!0,then:y.number().required(_.default.t('THIS_FIELD_IS_REQUIRED')),otherwise:y.number()})});console.log("consultaiton",at);var Wt,Xt,Jt,Zt,$t=(0,p.useFormik)({validationSchema:Ht,initialValues:{numero_assure:'',password:'',firstname_patient:'',lastname_patient:'',practitioner_firstname:'',practitioner_lastname:'',agrement_praticien:null==Ce?void 0:Ce.code_membre,pregnancy_start_at:null,pregnancy_end_at:null},onSubmit:function(t){Y(at.id,{network_agent_id:ue.network_agent_id,password:t.password,practitioner_lastname:t.practitioner_lastname,practitioner_firstname:t.practitioner_firstname,practitioner_provider_class_id:t.practitioner_provider_class_id,performances:at.performances,prescriptions:at.prescriptions})}}),ea=$t.handleChange,ta=$t.handleSubmit,aa=$t.handleBlur,la=$t.values,na=$t.errors,ra=$t.touched,oa=$t.setFieldValue,ia=$t.setFieldTouched,ua=($t.isValid,function(){switch(console.log("currentStep",Ke),Ke){case 0:return console.log("values",la),''!==la.numero_assure&&null===Z.result&&(Qt((0,b.fetchGetUserByNameOrNumberReset)()),I(ue.id_network,se?"&insured_id="+la.numero_assure:ye?"&phone="+la.numero_assure:"&name="+la.numero_assure),console.log("errors",na)),!1;default:return!0}}),ca=[{title:_.default.t('ASSURE'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10,width:(0,w.responsiveWidth)(90)},placeholder:se?_.default.t('NUMERO_ASSURE'):ye?_.default.t('PHONE_NUMBER'):_.default.t('NOM_ASSURE'),value:la.numero_assure,keyboardType:ye?'numeric':'default',onChangeText:ea('numero_assure'),onBlur:aa('numero_assure'),success:ra.numero_assure&&!na.numero_assure,touched:ra.numero_assure,error:na.numero_assure,icon:u.default.createElement(v.default,{style:{zIndex:10},name:se?'lock':ye?'phone':'user',size:20})}),u.default.createElement(c.View,{style:{flexDirection:'row',position:'absolute',top:22,right:70,justifyContent:'space-between',width:50}},u.default.createElement(N.default,{style:{paddingRight:10},name:"lock",size:20,color:E.Color.primaryColor,onPress:function(){fe(!0),Ee(!1)}}),u.default.createElement(N.default,{style:{paddingRight:10},name:"phone",size:20,color:E.Color.primaryColor,onPress:function(){fe(!1),Ee(!0)}}),u.default.createElement(N.default,{style:{paddingRight:10},name:"user",size:20,color:E.Color.primaryColor,onPress:function(){fe(!1),Ee(!1)}}),u.default.createElement(N.default,{style:{paddingRight:10},name:"qrcode",size:20,color:E.Color.primaryColor,onPress:function(){oe(!0)}})))},{title:_.default.t('PATIENT'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('NOM_CLIENT'),value:la.lastname_patient,onChangeText:ea('lastname_patient'),onBlur:aa('lastname_patient'),success:ra.lastname_patient&&!na.lastname_patient,touched:ra.lastname_patient,editable:!1,error:na.lastname_patient}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PRENOM_CLIENT'),value:la.firstname_patient,editable:!1,onChangeText:ea('firstname_patient'),onBlur:aa('firstname_patient'),success:ra.firstname_patient&&!na.firstname_patient,touched:ra.firstname_patient,error:na.firstname_patient}),u.default.createElement(c.View,{style:{marginTop:10,flexDirection:'row',justifyContent:"space-between"}},u.default.createElement(P.default,{body2:!0},_.default.t('SITUATION')),u.default.createElement(c.View,{style:{width:(0,w.responsiveWidth)(60)}},u.default.createElement(V.default,{options:Mt,disabled:!0,value:Gt,initial:Gt,buttonColor:E.Color.accentColor,backgroundColor:E.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(t){}}))))},{title:_.default.t('PRATICIEN'),content:u.default.createElement(c.View,null,u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('CODE_AGREMENT'),value:la.agrement_praticien,editable:!1}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('NOM_PRATICIEN'),value:la.practitioner_lastname,onChangeText:ea('practitioner_lastname'),onBlur:aa('practitioner_lastname'),success:ra.practitioner_lastname&&!na.practitioner_lastname,touched:ra.practitioner_lastname,error:na.practitioner_lastname}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PRENOM_PRATICIEN'),value:la.practitioner_firstname,onChangeText:ea('practitioner_firstname'),onBlur:aa('practitioner_firstname'),success:ra.practitioner_firstname&&!na.practitioner_firstname,touched:ra.practitioner_firstname,error:na.practitioner_firstname}),u.default.createElement(D.View,{ref:function(t){},style:{width:(0,w.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},u.default.createElement(B.Dropdown,{label:_.default.t('CLASSIFICATION'),value:null!==pt?pt.practitioner_provider_class:'',data:null!==ee.result?null==(l=ee.result)?void 0:l.response:[],useNativeDriver:!0,onChangeText:function(t,l,n){ia('practitioner_provider_class_id'),oa('practitioner_provider_class_id',t.id),console.log("Value",t)},valueExtractor:function(t){return t},labelExtractor:function(t){return t.name}})),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('PASSWORD'),value:la.password,onChangeText:ea('password'),onBlur:aa('password'),success:ra.password&&!na.password,touched:ra.password,error:na.password,secureTextEntry:!0}),u.default.createElement(c.View,{style:{marginTop:25}},u.default.createElement(c.View,{style:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'}},null!==at?!at.prescriptions.length>0?u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{borderRadius:5,width:100,height:30,flexDirection:"row",backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){at.prescriptions.filter(function(t){return t.checked}).length>0?(0,M.displayToast)("Vous avez deja renseigner les m\xe9dicaments"):Ct(!0)}},u.default.createElement(P.default,{whiteColor:!0},_.default.t('EXAMEN')),u.default.createElement(N.default,{name:"file-medical",size:20,color:E.Color.whiteColor})):u.default.createElement(c.View,null):null,null!==at?!at.exams.length>0?u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{borderRadius:5,width:110,height:30,flexDirection:"row",backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){at.exams.filter(function(t){return t.checked}).length>0?(0,M.displayToast)("Vous avez deja renseigner les examens"):vt(!0)}},u.default.createElement(P.default,{whiteColor:!0},_.default.t('MEDICAMENT')),u.default.createElement(F.default,{name:"drug-pack",size:20,color:E.Color.whiteColor})):u.default.createElement(c.View,null):null)))}];return u.default.createElement(C.ScreenComponent,null,u.default.createElement(S.default,{ref:function(t){return Yt=t}}),u.default.createElement(c.KeyboardAvoidingView,{behavior:'android'===c.Platform.OS?'height':'padding',style:{flex:1}},u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:W.contain},u.default.createElement(A.default,{steps:ca,currentStepIndex:Ke+1}),u.default.createElement(c.View,{style:{flexDirection:'column',alignItems:'center'}},u.default.createElement(O.default,{ref:Le,activeStep:0,steps:ca,useNativeDriver:!0,nextStepAnimation:"slideLeft",prevStepAnimation:"slideRight",isFirstStep:function(t){return Ge(t)},isLastStep:function(t){return Qe(t)},onNext:function(){ua()},onPrev:function(){0===Ke&&Qt((0,b.fetchGetUserByNameOrNumberReset)())},currentStep:function(t){var l=t.currentStep,n=t.isLastStep,o=t.isFirstStep;We(l),Ge(o),Qe(n)}})),u.default.createElement(c.View,{style:W.iconNavigation},Fe?u.default.createElement(c.View,null):u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(){return Le.current.prev()}},u.default.createElement(N.default,{name:"arrow-left",size:20,color:E.Color.whiteColor})),2===Ke?u.default.createElement(h.default,{loading:X.loading,onPress:ta},_.default.t('SUBMIT_LABEL')):u.default.createElement(c.TouchableOpacity,{style:[W.iconNavigationButton,{backgroundColor:E.Color.primaryColor,borderColor:E.Color.primaryColor}],onPress:function(t){ta(t),ua()&&Le.current.next()}},Z.loading||$.loading||J.loading?u.default.createElement(c.ActivityIndicator,{size:"small",color:"#fff"}):u.default.createElement(N.default,{name:"arrow-right",size:24,color:E.Color.whiteColor}))),_t&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:_t,onSwipeComplete:function(){Ct(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(P.default,{body2:!0,style:{marginTop:10}},_.default.t('EXAMEN')),u.default.createElement(c.FlatList,{data:at.exams,extraData:at.exams,keyExtractor:function(t,l){return l},renderItem:function(t){var l=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:l.id,onPress:function(){De(z({},l,{examen:!0})),lt(z({},at,{exams:at.exams.map(function(t){return l.id===t.id?z({},t,{checked:!l.checked}):t})})),l.checked||St(!0)}},u.default.createElement(P.default,{body2:!0,semibold:!0,numberOfLines:2},l.quantity+" "+l.description+" "+(l.unit_price?' - '+l.unit_price+(null!==l.unit_quantity?' X '+l.unit_quantity:''):'')+" \n "+l.act.name),l.checked&&u.default.createElement(N.default,{name:"check",size:14,color:E.Color.primaryColor}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return Ct(!1)}},_.default.t('OK')))))),re&&u.default.createElement(f.default.Container,{contentStyle:{width:(0,w.responsiveWidth)(80)},useNativeDriver:!0,visible:re},u.default.createElement(f.default.Title,null,_.default.t('SCAN')),u.default.createElement(c.ScrollView,{style:[W.blockView,{borderBottomColor:E.Color.borderColor,maxHeight:300}]},u.default.createElement(P.default,null,_.default.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')),u.default.createElement(U.default,{onRead:function(t){oe(!1),n(t.data),console.log("result",t.data)},flashMode:L.RNCamera.Constants.FlashMode.off})),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('CLOSE'),onPress:function(){oe(!1)}})),It&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:It,onSwipeComplete:function(){Rt(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(P.default,{body2:!0,style:{marginTop:10}},_.default.t('LIST_ASSURE')),u.default.createElement(c.FlatList,{data:null==(Jt=Z.result)?void 0:Jt.response,extraData:null==(Zt=Z.result)?void 0:Zt.response,ListEmptyComponent:u.default.createElement(P.default,{body2:!0},_.default.t('NO_ASSURE_MATCH_SEARCH')),keyExtractor:function(t,l){return l},renderItem:function(t){var l=t.item;return t.index,u.default.createElement(c.View,{style:{paddingVertical:15,alignItems:'flex-start'}},u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%",flexDirection:'column'}],key:l.id,onPress:function(){'SUSPENDED'===l.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_SUSPENDU'),[{text:_.default.t('OK'),onPress:function(){}}]):'PAID'!==l.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_NON_EN_REGLE'),[{text:_.default.t('OK'),onPress:function(){}}]):(Te(l),Ae(null),jt(1),Rt(!1),oa('lastname_patient',l.user.lastname),oa('firstname_patient',l.user.firstname),j(l.user.id,'UNTREATED','EXECUTION',"&network_agent_id="+ue.network_agent_id))}},u.default.createElement(P.default,{body2:!0,semibold:!0},(null!==l.user.firstname?l.user.firstname:'')+" "+(null!==l.user.lastname?l.user.lastname:'')),u.default.createElement(P.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+l.insurance_consumed_amount),u.default.createElement(P.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+l.insurance_remaining_amount)),l.beneficiaries.map(function(t){return u.default.createElement(c.TouchableOpacity,{style:W.beneficiarySubSection,onPress:function(){'SUSPENDED'===l.state?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('ASSURE_PRINCIPAL_SUSPENDU'),[{text:_.default.t('OK'),onPress:function(){}}]):(Te(l),Ae(t),jt(0),Rt(!1),oa('lastname_patient',t.lastname),oa('firstname_patient',t.firstname),j(l.user.id,'UNTREATED','EXECUTION',"&beneficiary_id="+t.id+"&network_agent_id="+ue.network_agent_id))}},u.default.createElement(c.View,{style:{width:10}}),u.default.createElement(c.View,{style:{paddingHorizontal:10,alignItems:'flex-start'}},u.default.createElement(P.default,{subhead:!0,semibold:!0,textAlign:"left"},(null!==t.firstname?t.firstname:'')+" "+(null!==t.lastname?t.lastname:'')+" ("+_.default.t('AYANT_DROITS')+")"),u.default.createElement(P.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+t.insurance_consumed_amount),u.default.createElement(P.default,{footnote:!0},_.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+t.insurance_remaining_amount)))}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return Rt(!1)}},_.default.t('OK')))))),Nt&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:Nt,onSwipeComplete:function(){vt(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(P.default,{body2:!0,style:{marginTop:10}},_.default.t('MEDICAMENTS')),u.default.createElement(c.FlatList,{data:at.prescriptions,extraData:at.prescriptions,keyExtractor:function(t,l){return l},renderItem:function(t){var l=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:l.id,onPress:function(){De(z({},l,{drugs:!0})),lt(z({},at,{prescriptions:at.prescriptions.map(function(t){return l.id===t.id?z({},t,{checked:!l.checked}):t})})),l.checked||St(!0)}},u.default.createElement(P.default,{body2:!0,semibold:!0,numberOfLines:2},l.quantity+" "+l.drug_or_device.name+" "+(l.unit_price?' - '+l.unit_price:'')+" \n "+l.dosage),l.checked&&u.default.createElement(N.default,{name:"check",size:14,color:E.Color.primaryColor}))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return vt(!1)}},_.default.t('OK')))))),Ze&&u.default.createElement(c.ScrollView,{style:{flex:1}},u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:Ze,onSwipeComplete:function(){$e(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),u.default.createElement(P.default,{body2:!0,style:{marginTop:10}},_.default.t('LIST_EXECUTION')),u.default.createElement(c.FlatList,{data:null==(Wt=J.result)?void 0:Wt.response,extraData:null==(Xt=J.result)?void 0:Xt.response,ListEmptyComponent:u.default.createElement(P.default,{body2:!0},_.default.t('NO_EXECUTION')),keyExtractor:function(t,l){return l},renderItem:function(t){var l=t.item;return t.index,u.default.createElement(c.TouchableOpacity,{style:[W.contentActionModalBottom,{borderBottomColor:E.Color.borderColor,width:"100%"}],key:l.id,onPress:function(){yt(l),st(!0)}},u.default.createElement(P.default,{body2:!0,semibold:!0},l.type+" #"+l.health_care_sheet_id+" - "+Q(l.created_at).format('YYYY-MM-DD')))}}),u.default.createElement(h.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return $e(!1)}},_.default.t('OK')))))),dt&&u.default.createElement(f.default.Container,{useNativeDriver:!0,visible:dt},u.default.createElement(f.default.Title,null,_.default.t('DETAIL')),u.default.createElement(c.ScrollView,{persistentScrollbar:!0},u.default.createElement(c.View,{style:[W.blockView,{borderBottomColor:E.Color.borderColor}]},u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('PATIENT'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},pt.patient_lastname+" "+pt.patient_firstname))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},"Situation")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},pt.patient_situation.toLowerCase()))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('PRATICIEN'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},pt.practitioner_lastname+" "+pt.practitioner_firstname))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('CLASSE_PRESTATAIRE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(pt.practitioner_provider_class.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('STATE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(pt.state.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},"Type")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(pt.type.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('CONDITION_PRISE_CHARGE'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(pt.care_condition.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('INSTITUTE_NAME'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},(0,M.uppercaseFirstLetter)(pt.institution_name.toLowerCase())))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},"Date")),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},Q(pt.created_at).format('YYYY-MM-DD')))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('PRESTATION'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},pt.performances.map(function(t){return u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.act.name+" \n "+t.amount+" \n")}))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('EXAMEN'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},pt.exams.map(function(t){return u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.description+" \n "+t.act.name+" \n")}))),u.default.createElement(c.View,{style:{flexDirection:'row',marginTop:10}},u.default.createElement(c.View,{style:{flex:1}},u.default.createElement(P.default,{style:[W.body2]},_.default.t('MEDICAMENT'))),u.default.createElement(c.View,{style:{flex:1,alignItems:'flex-end'}},pt.prescriptions.map(function(t){return u.default.createElement(P.default,{style:[G.Typography.caption1,E.Color.grayColor]},t.drug_or_device.name+" \n "+t.dosage+" \n")}))))),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('CANCEL_LABEL'),onPress:function(){st(!1)}}),u.default.createElement(f.default.Button,{bold:!0,label:_.default.t('OK'),onPress:function(){st(!1),Rt(!1),$e(!1),lt(pt),it(pt),oa('practitioner_firstname',pt.practitioner_firstname),oa('practitioner_lastname',pt.practitioner_lastname),Le.current.next()}})),bt&&u.default.createElement(p.Formik,{validationSchema:Kt,initialValues:{examen_quantity:null!==Ve&&Ve.drugs?parseInt(Ve.quantity)-parseInt(null!==Ve.billed_quantity?Ve.billed_quantity:0):'',price:Ve.unit_price,unit_quantity:null!==Ve.unit_quantity?Ve.unit_quantity:'',unit_quantity_condition:null!==Ve&&!!Ve.hasOwnProperty('act')&&"UNIT_PRICE"===Ve.act.billing_type,code_acte:''+Ve!==null?Ve.drugs?'':Ve.act:''},onSubmit:function(t){if(console.log("Value",Ve),Ve.examen)lt(z({},at,{exams:at.exams.map(function(l){return Ve.id===l.id?z({},l,{unit_price:t.price,quantity:t.examen_quantity,unit_quantity:''===t.unit_quantity?null:t.unit_quantity}):l})})),H({insurance_id:Se.id,beneficiary_id:null!==Re?Re.id:null,care_condition:at._care_condition,act_id:at.exams.filter(function(t){return Ve.id===t.id})[0].act_id,act_action:"UPDATE",act_type:"EXAM",exams:[{unit_price:t.price,quantity:t.examen_quantity}],tmp_sheet_id:Ue});else{var l=pt.prescriptions.filter(function(t){return t.id=Ve.id})[0].quantity;parseInt(t.examen_quantity)>parseInt(l-parseInt(null!==Ve.billed_quantity?Ve.billed_quantity:0))?c.Alert.alert(_.default.t('ERROR_LABEL'),_.default.t('QUANTITY_CANNOT_BE_SUPERIOR')+" "+l,[{text:_.default.t('OK'),onPress:function(){}}]):(lt(z({},at,{prescriptions:at.prescriptions.map(function(l){return Ve.id===l.id?z({},l,{unit_price:t.price,quantity:t.examen_quantity}):l})})),H({insurance_id:Se.id,beneficiary_id:null!==Re?Re.id:null,care_condition:at._care_condition,act_id:Ve.id,act_action:"UPDATE",act_type:"PRESCRIPTION",prescriptions:[{unit_price:t.price,quantity:t.examen_quantity}],tmp_sheet_id:Ue}))}}},function(t){var l=t.values,n=t.errors,o=t.touched,s=t.handleChange,f=(t.setFieldValue,t.setFieldTouched,t.handleBlur),p=t.handleSubmit;return t.isSubmitting,u.default.createElement(c.ScrollView,{style:{flex:1}},console.log("Errors",n),u.default.createElement(c.View,{style:[W.containModal,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(k.default,{isVisible:bt,onSwipeComplete:function(){St(!1)},swipeDirection:['down'],style:W.bottomModal},u.default.createElement(c.View,{style:[W.contentFilterBottom,{backgroundColor:E.Color.containerBackgroundColor}]},u.default.createElement(c.View,{style:W.contentSwipeDown},u.default.createElement(c.View,{style:W.lineSwipeDown})),Ve.examen?u.default.createElement(u.default.Fragment,null,u.default.createElement(P.default,{body2:!0,style:{marginTop:10}},_.default.t('MODIFY_EXECUTION')),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('QUANTITE'),value:''+l.examen_quantity,onChangeText:s('examen_quantity'),onBlur:f('examen_quantity'),success:o.examen_quantity&&!n.examen_quantity,touched:o.examen_quantity,error:n.examen_quantity,keyboardType:"numeric"}),"UNIT_PRICE"===Ve.act.billing_type?u.default.createElement(c.View,{style:{flexDirection:'row'}},u.default.createElement(P.default,{style:{marginTop:20,width:40,height:40}},Ve.act.unit_value+" = "),u.default.createElement(c.View,{style:{flexDirection:'row',width:'90%',justifyContent:'space-between'}},u.default.createElement(x.default,{style:{marginTop:10,width:180},editable:"FREE"===Ve.act.billing_type,placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:l.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!n.price,touched:o.price,error:n.price,keyboardType:"numeric"}),u.default.createElement(P.default,{style:{marginTop:20,marginLeft:5,width:40,height:40}}," X "),u.default.createElement(x.default,{style:{marginTop:10,width:180},placeholder:_.default.t('UNIT_QUANTITE'),value:''+l.unit_quantity,onChangeText:s('unit_quantity'),onBlur:f('unit_quantity'),success:o.unit_quantity&&!n.unit_quantity,touched:o.unit_quantity,error:n.unit_quantity,keyboardType:"numeric"}))):u.default.createElement(x.default,{style:{marginTop:10},editable:!Ve.hasOwnProperty('act')||"FREE"===Ve.act.billing_type,placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:l.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!n.price,touched:o.price,error:n.price,keyboardType:"numeric"})):u.default.createElement(u.default.Fragment,null,u.default.createElement(P.default,{body2:!0,style:{marginTop:10}},_.default.t('EXECUTION')),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('QUANTITE'),value:''+l.examen_quantity,onChangeText:s('examen_quantity'),onBlur:f('examen_quantity'),success:o.examen_quantity&&!n.examen_quantity,touched:o.examen_quantity,error:n.examen_quantity,keyboardType:"numeric"}),u.default.createElement(x.default,{style:{marginTop:10},placeholder:_.default.t('AMOUNT_LABEL_DESCRIPTION'),value:l.price,onChangeText:s('price'),onBlur:f('price'),success:o.price&&!n.price,touched:o.price,error:n.price,keyboardType:"numeric"})),u.default.createElement(h.default,{loading:K.loading,full:!0,style:{marginTop:10,marginBottom:20},onPress:p},_.default.t('OK'))))))})))))});e.default=J},1744,[4,1,7,27,15,18,1049,1423,1630,1637,1034,720,1703,1714,535,1485,1716,719,1415,1732,1733,1737,1738,1016,539,1416,772,750,982,1626,1417,1316,1457,1105,1035,1077,1189]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),l=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(r(d[2])),o=t(r(d[3])),f=r(d[4]),u=l(r(d[5])),c=r(d[6]),s=r(d[7]),y=l(r(d[8])),E=r(d[9]),p=r(d[10]),w=l(r(d[11])),C=r(d[12]),x=r(d[13]),T=r(d[14]),V=l(r(d[15])),b=t(r(d[16])),_=l(r(d[17])),h=r(d[18]),I=l(r(d[19])),D=l(r(d[20])),S=l(r(d[21])),R=r(d[22]),A=f.Dimensions.get('window'),L=(A.width,A.height,(0,C.createStructuredSelector)({subscriptionList:x.selectSubscriptionList,activatePaySubscription:x.selectActivatePaySubscription,getConsultation:x.selectGetConsultation,acceptRefuseConsultation:x.selectAcceptRefuseConsultation})),O=(0,c.connect)(L,{fetchActivePaySubscription:p.fetchActivePaySubscription,fetchGetConsultation:p.fetchGetConsultation,fetchAcceptRejectConsultation:p.fetchAcceptRejectConsultation,fetchGetSubscription:p.fetchGetSubscription,fetchGetDemandeAutorisationSoin:p.fetchGetDemandeAutorisationSoin})(function(t){t.navigation;var l=t.fetchGetConsultation,C=t.fetchGetSubscription,x=t.fetchGetDemandeAutorisationSoin,A=(t.fetchAcceptRejectConsultation,t.acceptRefuseConsultation,t.getConsultation),L=(0,c.useDispatch)(),O=(0,o.useState)(null),P=(0,n.default)(O,2),v=P[0],B=P[1],M=(0,o.useState)(!1),U=(0,n.default)(M,2),G=U[0],k=U[1],Y=(0,o.useState)({}),F=(0,n.default)(Y,2),W=F[0],j=F[1],z=(0,o.useState)(1),H=(0,n.default)(z,2),K=H[0],q=H[1],X=(0,o.useState)(y.default.t('SOINS')),J=(0,n.default)(X,2),Q=J[0],Z=J[1],$=(0,o.useState)(!1),ee=(0,n.default)($,2),te=ee[0],le=ee[1],ae=(0,o.useState)([]),re=(0,n.default)(ae,2),ne=re[0],oe=re[1];var ie,fe;ie=(0,o.useState)(0),(fe=(0,n.default)(ie,2))[0],fe[1];(0,o.useEffect)(function(){L((0,p.fetchGetConsultationReset)()),L((0,p.fetchAcceptRejectConsultationReset)()),(0,T.readUser)().then(function(t){B(t),console.log("User",t),l(t.id,'ALL','','&pagination=true&page=1')})},[]),(0,o.useEffect)(function(){null!==A.result&&(K0?St(!0):(Ct.alertWithType('warn',p.default.t('EMPTY_LIST'),p.default.t('NO_ASSURE_MATCH_SEARCH')),te((0,h.fetchGetUserByNameOrNumberReset)()))),q.error&&s.Alert.alert(p.default.t("ERROR_LABLE"),b.getErrorMsg(q),[{text:p.default.t("OK"),onPress:function(){te((0,h.fetchGetUserByNameOrNumberReset)())}}],{cancelable:!1})},[q]);var wt=function(){var t,n;return u.default.createElement(s.ScrollView,{style:{flex:1}},u.default.createElement(s.View,{style:[K.containModal,{backgroundColor:f.Color.containerBackgroundColor}]},u.default.createElement(I.default,{isVisible:ht,onSwipeComplete:function(){St(!1)},swipeDirection:['down'],style:K.bottomModal},u.default.createElement(s.View,{style:[K.contentFilterBottom,{backgroundColor:f.Color.containerBackgroundColor}]},u.default.createElement(s.View,{style:K.contentSwipeDown},u.default.createElement(s.View,{style:K.lineSwipeDown})),u.default.createElement(w.default,{body2:!0,style:{marginTop:10}},p.default.t('LIST_ASSURE')),u.default.createElement(s.FlatList,{data:null==(t=q.result)?void 0:t.response,extraData:null==(n=q.result)?void 0:n.response,keyExtractor:function(t,n){return n},ListEmptyComponent:u.default.createElement(w.default,{body2:!0},p.default.t('NO_ASSURE_MATCH_SEARCH')),renderItem:function(t){var n=t.item;return t.index,u.default.createElement(s.View,{style:{paddingVertical:15,alignItems:'flex-start'}},u.default.createElement(s.TouchableOpacity,{style:[K.contentActionModalBottom,{borderBottomColor:f.Color.borderColor,width:"100%",flexDirection:'column'}],key:n.id,onPress:function(){'SUSPENDED'===n.state?s.Alert.alert(p.default.t('ERROR_LABEL'),p.default.t('ASSURE_SUSPENDU'),[{text:p.default.t('OK'),onPress:function(){}}]):'PAID'!==n.state?s.Alert.alert(p.default.t('ERROR_LABEL'),p.default.t('ASSURE_NON_EN_REGLE'),[{text:p.default.t('OK'),onPress:function(){}}]):(je(n),He(null),ct(1),St(!1),Bt('lastname_patient',n.user.lastname),Bt('firstname_patient',n.user.firstname),_(ce.id_network,'',"&user_id="+n.user.id),te((0,h.fetchGetUserByNameOrNumberReset)()),Ye.current.next(),z("?user_id="+n.user.id))}},u.default.createElement(w.default,{body2:!0,semibold:!0},(null!==n.user.firstname?n.user.firstname:'')+" "+(null!==n.user.lastname?n.user.lastname:'')),u.default.createElement(w.default,{footnote:!0},p.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+n.insurance_consumed_amount),u.default.createElement(w.default,{footnote:!0},p.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+n.insurance_remaining_amount)),n.beneficiaries.map(function(t){return u.default.createElement(s.TouchableOpacity,{style:K.beneficiarySubSection,onPress:function(){'SUSPENDED'===n.state?s.Alert.alert(p.default.t('ERROR_LABEL'),p.default.t('ASSURE_PRINCIPAL_SUSPENDU'),[{text:p.default.t('OK'),onPress:function(){}}]):(je(n),He(t),ct(0),St(!1),Bt('lastname_patient',t.lastname),Bt('firstname_patient',t.firstname),_(ce.id_network,'',"&user_id="+n.user.id+"&beneficiary_id="+t.id),te((0,h.fetchGetUserByNameOrNumberReset)()),Ye.current.next(),z("?user_id="+n.user.id+"&beneficiary_id="+t.id))}},u.default.createElement(s.View,{style:{width:10}}),u.default.createElement(s.View,{style:{paddingHorizontal:10,alignItems:'flex-start'}},u.default.createElement(w.default,{subhead:!0,semibold:!0,textAlign:"left"},(null!==t.firstname?t.firstname:'')+" "+(null!==t.lastname?t.lastname:'')+" ("+p.default.t('AYANT_DROITS')+")"),u.default.createElement(w.default,{footnote:!0},p.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+t.insurance_consumed_amount),u.default.createElement(w.default,{footnote:!0},p.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+t.insurance_remaining_amount)))}))}}),u.default.createElement(D.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return St(!1)}},p.default.t('OK'))))))},bt=(0,A.useFormik)({validationSchema:_t,initialValues:{password:'',code_acte:'',firstname_patient:'',lastname_patient:''},onSubmit:function(t){null===Ge&&null===Fe||(null===be?mt.shake(800):''===t.code_acte?pt.shake(200):(F({act_id:t.code_acte,insurance_id:be.id,issuer_network_agent_id:le.agentId,beneficiary_id:null!==Ge?Ge.id:Fe.id,password:t.password}),console.log(le),console.log("insurance",be)))}}),yt=bt.handleChange,Rt=bt.handleSubmit,At=bt.handleBlur,Nt=bt.values,Tt=bt.errors,Ot=bt.touched,Bt=bt.setFieldValue,vt=bt.setFieldTouched,Dt=(bt.isValid,function(){switch(console.log("currentStep",lt),lt){case 0:return console.log("values",Nt),te((0,h.fetchGetUserByNameOrNumberReset)()),''!==Nt.numero_assure&&null===q.result&&(Q(ce.id_network,xe?"&insured_id="+Nt.numero_assure:Pe?"&phone="+Nt.numero_assure:"&name="+Nt.numero_assure),console.log("errors",Tt)),!1;default:return!0}}),xt=[{title:p.default.t('ASSURE'),content:u.default.createElement(s.View,null,u.default.createElement(k.default,{style:{marginTop:10,width:(0,T.responsiveWidth)(90)},placeholder:xe?p.default.t('NUMERO_ASSURE'):Pe?p.default.t('PHONE_NUMBER'):p.default.t('NOM_ASSURE'),value:Nt.numero_assure,keyboardType:Pe?'numeric':'default',onChangeText:yt('numero_assure'),onBlur:At('numero_assure'),success:Ot.numero_assure&&!Tt.numero_assure,touched:Ot.numero_assure,error:Tt.numero_assure,icon:u.default.createElement(v.default,{style:{zIndex:10},name:xe?'lock':Pe?'phone':'user',size:20})}),u.default.createElement(s.View,{style:{flexDirection:'row',position:'absolute',top:22,right:70,justifyContent:'space-between',width:50}},u.default.createElement(V.default,{style:{paddingRight:10},name:"lock",size:20,color:f.Color.primaryColor,onPress:function(){Le(!0),ke(!1)}}),u.default.createElement(V.default,{style:{paddingRight:10},name:"phone",size:20,color:f.Color.primaryColor,onPress:function(){Le(!1),ke(!0)}}),u.default.createElement(V.default,{style:{paddingRight:10},name:"user",size:20,color:f.Color.primaryColor,onPress:function(){Le(!1),ke(!1)}}),u.default.createElement(V.default,{style:{paddingRight:10},name:"qrcode",size:20,color:f.Color.primaryColor,onPress:function(){Te(!0)}})))},{title:p.default.t('PATIENT'),content:u.default.createElement(s.View,null,u.default.createElement(k.default,{style:{marginTop:10},placeholder:p.default.t('NOM_CLIENT'),value:Nt.lastname_patient,onChangeText:yt('lastname_patient'),onBlur:At('lastname_patient'),success:Ot.lastname_patient&&!Tt.lastname_patient,touched:Ot.lastname_patient,editable:!1,error:Tt.lastname_patient}),u.default.createElement(k.default,{style:{marginTop:10},placeholder:p.default.t('PRENOM_CLIENT'),value:Nt.firstname_patient,editable:!1,onChangeText:yt('firstname_patient'),onBlur:At('firstname_patient'),success:Ot.firstname_patient&&!Tt.firstname_patient,touched:Ot.firstname_patient,error:Tt.firstname_patient}),u.default.createElement(s.View,{style:{marginTop:10,flexDirection:'row',justifyContent:"space-between"}},u.default.createElement(w.default,{body2:!0},p.default.t('SITUATION')),u.default.createElement(s.View,{style:{width:(0,T.responsiveWidth)(60)}},u.default.createElement(M.default,{options:it,disabled:!0,value:dt,initial:dt,buttonColor:f.Color.accentColor,backgroundColor:f.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(t){}}))))},{title:p.default.t('DEMAND_DETAIL'),content:u.default.createElement(s.View,null,X.loading?u.default.createElement(s.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},'android'===s.Platform.OS?u.default.createElement(u.default.Fragment,null,u.default.createElement(s.ProgressBarAndroid,null),u.default.createElement(w.default,null,p.default.t('LOADING_DOTS'))):u.default.createElement(u.default.Fragment,null,u.default.createElement(s.ActivityIndicator,{size:"large",color:'#ccc'}),u.default.createElement(w.default,null,p.default.t('LOADING_DOTS')))):X.result?u.default.createElement(s.View,{style:K.contain},u.default.createElement(N.View,{ref:function(t){mt=t},style:{width:(0,T.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},u.default.createElement(O.Dropdown,{label:p.default.t('SELECT_INSURANCE'),data:X.result.response,useNativeDriver:!0,onChangeText:function(t,n,o){console.log("Value",t),ye(t),he([].concat((0,l.default)(t.beneficiaries),[{id:null!==Ge?Ge.id:Fe.id,firstname:null!==Ge?Ge.firstname:Fe.firstname,lastname:null!==Ge?Ge.lastname:Fe.lastname}])),_(t.network.id,'','&authorization_type=PRIOR')},valueExtractor:function(t){return t},labelExtractor:function(t){return t.network.name}})),u.default.createElement(N.View,{ref:function(t){pt=t},style:{width:(0,T.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},u.default.createElement(O.Dropdown,{label:p.default.t('CODE_ACTE'),data:null!==Z.result?null==(n=Z.result)?void 0:n.response:[],useNativeDriver:!0,onChangeText:function(t,n,l){vt('code_acte'),Bt('code_acte',t.id)},valueExtractor:function(t){return t},labelExtractor:function(t){return t.name}})),u.default.createElement(B.default,{style:{marginTop:10,width:(0,T.responsiveWidth)(90)},onChangeText:yt('password'),placeholder:p.default.t('PASSWORD'),secureTextEntry:!0,icon:u.default.createElement(v.default,{name:"lock",size:20}),value:Nt.password,onBlur:At('password'),success:Ot.password&&!Tt.password,touched:Ot.password,error:Tt.password}),u.default.createElement(D.default,{style:{marginTop:20},full:!0,loading:ee.loading,onPress:Rt},p.default.t('SUBMIT_LABEL'))):null)}];return u.default.createElement(E.ScreenComponent,null,u.default.createElement(S.default,{ref:function(t){return Ct=t}}),u.default.createElement(L.default,{show:Z.loading}),u.default.createElement(s.KeyboardAvoidingView,{behavior:'android'===s.Platform.OS?'height':'padding',style:{flex:1}},u.default.createElement(s.ScrollView,{style:{flex:1}},u.default.createElement(s.View,{style:K.contain},u.default.createElement(G.default,{steps:xt,currentStepIndex:lt+1}),u.default.createElement(s.View,{style:{flexDirection:'column',alignItems:'center'}},u.default.createElement(j.default,{ref:Ye,activeStep:0,steps:xt,useNativeDriver:!0,nextStepAnimation:"slideLeft",prevStepAnimation:"slideRight",isFirstStep:function(t){return Ze(t)},isLastStep:function(t){return tt(t)},onNext:function(){Dt()},onPrev:function(){},currentStep:function(t){var n=t.currentStep,l=t.isLastStep,o=t.isFirstStep;rt(n),Ze(o),tt(l)}})),u.default.createElement(s.View,{style:K.iconNavigation},Xe?u.default.createElement(s.View,null):u.default.createElement(s.TouchableOpacity,{style:[K.iconNavigationButton,{backgroundColor:f.Color.primaryColor,borderColor:f.Color.primaryColor}],onPress:function(){return Ye.current.prev()}},u.default.createElement(V.default,{name:"arrow-left",size:20,color:f.Color.whiteColor})),2===lt?u.default.createElement(D.default,{loading:ee.loading,onPress:Rt},p.default.t('SUBMIT_LABEL')):u.default.createElement(s.TouchableOpacity,{style:[K.iconNavigationButton,{backgroundColor:f.Color.primaryColor,borderColor:f.Color.primaryColor}],onPress:function(t){Rt(t),Dt()&&Ye.current.next()}},$.loading||q.loading||J.loading?u.default.createElement(s.ActivityIndicator,{size:"small",color:"#fff"}):u.default.createElement(V.default,{name:"arrow-right",size:24,color:f.Color.whiteColor}))),ht&&wt(),Ne&&u.default.createElement(y.default.Container,{contentStyle:{width:(0,T.responsiveWidth)(80)},useNativeDriver:!0,visible:Ne},u.default.createElement(y.default.Title,null,p.default.t('SCAN')),u.default.createElement(s.ScrollView,{style:[K.blockView,{borderBottomColor:f.Color.borderColor,maxHeight:300}]},u.default.createElement(w.default,null,p.default.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')),u.default.createElement(U.default,{onRead:function(t){Te(!1),H(t.data)},flashMode:P.RNCamera.Constants.FlashMode.off})),u.default.createElement(y.default.Button,{bold:!0,label:p.default.t('CLOSE'),onPress:function(){Te(!1)}})),ht&&wt()))))});e.default=H;var K=s.StyleSheet.create({textInput:{height:46,backgroundColor:f.Color.fieldColor,borderRadius:5,marginTop:10,padding:10,width:'100%'},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:.5},ineSeparator:{borderWidth:1,width:'40%',height:1,alignSelf:'center'},line:{width:1,height:14,backgroundColor:f.Color.grayColor,marginLeft:10},contentModeView:{width:30,height:'100%',alignItems:'flex-end',justifyContent:'center'},contentFilter:{flexDirection:'row',alignItems:'center',marginLeft:10},bottomModal:{justifyContent:'flex-end',margin:0},contentFilterBottom:{width:"100%",borderTopLeftRadius:8,borderTopRightRadius:8,paddingHorizontal:20},contentSwipeDown:{paddingTop:10,alignItems:'center'},lineSwipeDown:{width:30,height:2.5,backgroundColor:f.Color.dividerColor},contentActionModalBottom:{flexDirection:"row",paddingVertical:10,marginBottom:10,justifyContent:"space-between",borderBottomWidth:1},containModal:{paddingVertical:10,paddingHorizontal:20,flexDirection:'row',justifyContent:'space-between'},iconNavigation:{width:'100%',flexDirection:'row',marginTop:20,justifyContent:'space-between',alignItems:'center'},iconNavigationButton:{borderWidth:1,borderRadius:25,width:50,height:50,alignItems:'center',justifyContent:'center'},beneficiarySubSection:{marginTop:10,flexDirection:'row',width:'100%'}})},1746,[4,1,35,27,15,18,1049,1034,720,1703,1485,1716,1732,1733,1416,1457,1423,1105,1630,750,535,982,1713,539,1714,1637,1580,1626,1417,1316,1415,1016,772,1737,1738,719,1189]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=n(r(d[2])),o=n(r(d[3])),u=t(r(d[4])),s=r(d[5]),c=r(d[6]),f=r(d[7]),p=n(r(d[8])),E=r(d[9]),h=r(d[10]),S=n(r(d[11])),_=r(d[12]),C=r(d[13]),w=n(r(d[14])),b=t(r(d[15])),y=n(r(d[16])),R=r(d[17]),A=r(d[18]),N=t(r(d[19])),T=r(d[20]),O=r(d[21]),B=n(r(d[22])),v=n(r(d[23])),D=n(r(d[24])),x=t(r(d[25])),L=n(r(d[26])),I=n(r(d[27])),U=n(r(d[28])),P=r(d[29]),k=n(r(d[30])),V=n(r(d[31])),M=n(r(d[32])),G=n(r(d[33])),j=n(r(d[34])),W=r(d[35]),z=(r(d[36]),s.Dimensions.get('window')),F=(z.width,z.height,(0,_.createStructuredSelector)({subscriptionList:C.selectSubscriptionList,insuranceList:C.selectInsuranceList,activatePaySubscription:C.selectActivatePaySubscription,getConsultation:C.selectGetConsultation,getNetworkAct:C.selectGetNetworkAct,demandeAutorisationSoin:C.selectDemandeAutorisationSoin,getUserByNameOrNumber:C.selectGetUserByNameOrNumber,getUserByIdQRCode:C.selectGetUserByIdQRCode})),H=(0,c.connect)(F,{fetchActivePaySubscription:h.fetchActivePaySubscription,fetchGetNetworkActs:h.fetchGetNetworkActs,fetchAcceptRejectConsultation:h.fetchAcceptRejectConsultation,fetchGetListInsuranceWithBeneficiaries:h.fetchGetListInsuranceWithBeneficiaries,fetchDemaneAutorisationSoin:h.fetchDemaneAutorisationSoin,fetchGetUserByIdQRCode:h.fetchGetUserByIdQRCode,fetchGetUserByNameOrNumber:h.fetchGetUserByNameOrNumber})(function(t){var n,_=t.navigation,C=t.fetchGetNetworkActs,z=(t.fetchAcceptRejectConsultation,t.fetchGetListInsuranceWithBeneficiaries),F=t.fetchDemaneAutorisationSoin,H=t.fetchGetUserByIdQRCode,Q=t.fetchGetUserByNameOrNumber,Y=t.getConsultation,q=t.getUserByNameOrNumber,J=t.getUserByIdQRCode,X=t.insuranceList,Z=t.getNetworkAct,$=t.subscriptionList,ee=t.demandeAutorisationSoin,te=(0,c.useDispatch)(),ae=(0,u.useState)(null),ne=(0,o.default)(ae,2),le=ne[0],re=ne[1],oe=(0,u.useState)(!1),ie=(0,o.default)(oe,2),ue=(ie[0],ie[1],(0,u.useState)({})),se=(0,o.default)(ue,2),de=(se[0],se[1],(0,u.useState)(R.store.getState().walletDetailReducer.result.response)),ce=(0,o.default)(de,1)[0],fe=(0,u.useState)([]),me=(0,o.default)(fe,2),pe=(me[0],me[1]),Ee=(0,u.useState)([]),ge=(0,o.default)(Ee,2),he=(ge[0],ge[1]),Se=(0,u.useState)(null),_e=(0,o.default)(Se,2),Ce=(_e[0],_e[1],(0,u.useState)(null)),we=(0,o.default)(Ce,2),be=we[0],ye=we[1],Re=(0,u.useState)(!1),Ae=(0,o.default)(Re,2),Ne=Ae[0],Te=Ae[1],Oe=(0,u.useState)(!1),Be=(0,o.default)(Oe,2),ve=(Be[0],Be[1],(0,u.useState)(!1)),De=(0,o.default)(ve,2),xe=De[0],Le=De[1],Ie=(0,u.useState)(!1),Ue=(0,o.default)(Ie,2),Pe=Ue[0],ke=Ue[1],Ve=(0,u.useState)(null),Me=(0,o.default)(Ve,2),Ge=Me[0],je=Me[1],We=(0,u.useState)(null),ze=(0,o.default)(We,2),Fe=ze[0],He=ze[1],Ke=(0,u.useState)(null),Qe=(0,o.default)(Ke,2),Ye=(Qe[0],Qe[1],(0,u.useRef)()),qe=(0,u.useState)(!0),Je=(0,o.default)(qe,2),Xe=Je[0],Ze=Je[1],$e=(0,u.useState)(!1),et=(0,o.default)($e,2),tt=(et[0],et[1]),at=(0,u.useState)(1),nt=(0,o.default)(at,2),lt=nt[0],rt=nt[1],ot=(0,u.useState)([{label:p.default.t('AYANT_DROITS'),value:"M"},{label:p.default.t('ASSURE'),value:"F"}]),it=(0,o.default)(ot,1)[0],ut=(0,u.useState)(1),st=(0,o.default)(ut,2),dt=st[0],ct=st[1],ft=(0,u.useState)([{label:p.default.t('YES'),value:"YES"},{label:p.default.t('NO'),value:"NO"}]),mt=((0,o.default)(ft,1)[0],null),pt=null,Et=(0,u.useState)(!1),gt=(0,o.default)(Et,2),ht=gt[0],St=gt[1],_t=null,Ct=x.object().shape({password:x.string().required(p.default.t('THIS_FIELD_IS_REQUIRED'))});(0,u.useEffect)(function(){te((0,h.fetchGetConsultationReset)()),te((0,h.fetchGetListInsuranceReset)()),te((0,h.fetchAcceptRejectConsultationReset)()),te((0,h.fetchGetUserByNameOrNumberReset)()),te((0,h.fetchGetUserByIdQRCodeReset)()),(0,W.readUser)().then(function(t){re(t)})},[]),(0,u.useEffect)(function(){Y.error&&s.Alert.alert(p.default.t("ERROR_LABLE"),b.getErrorMsg(Y),[{text:p.default.t("OK"),onPress:function(){te((0,h.fetchGetConsultationReset)())}}],{cancelable:!1})},[Y]),(0,u.useEffect)(function(){if(null!==X.result){var t=[];X.result.response.map(function(n,l){t.push(n.network)}),pe(t),console.log("beneficiariesListTemp",[])}X.error&&s.Alert.alert(p.default.t("ERROR_LABLE"),b.getErrorMsg(X),[{text:p.default.t("OK"),onPress:function(){te((0,h.fetchGetListInsuranceReset)())}}],{cancelable:!1})},[X]),(0,u.useEffect)(function(){null!==ee.result&&s.Alert.alert(p.default.t("SUCCESS"),ee.result.response,[{text:p.default.t("OK"),onPress:function(){te((0,h.fetchDemaneAutorisationSoinReset)()),_.goBack()}}],{cancelable:!1}),ee.error&&s.Alert.alert(p.default.t("ERROR_LABLE"),b.getErrorMsg(ee),[{text:p.default.t("OK"),onPress:function(){te((0,h.fetchDemaneAutorisationSoinReset)())}}],{cancelable:!1})},[ee]),(0,u.useEffect)(function(){console.log("getUserByNameOrNumber.result",q),null!==q.result&&(q.result.response.length>0?St(!0):(_t.alertWithType('warn',p.default.t('EMPTY_LIST'),p.default.t('NO_ASSURE_MATCH_SEARCH')),te((0,h.fetchGetUserByNameOrNumberReset)()))),q.error&&s.Alert.alert(p.default.t("ERROR_LABLE"),b.getErrorMsg(q),[{text:p.default.t("OK"),onPress:function(){te((0,h.fetchGetUserByNameOrNumberReset)())}}],{cancelable:!1})},[q]);var wt=function(){var t,n;return u.default.createElement(s.ScrollView,{style:{flex:1}},u.default.createElement(s.View,{style:[K.containModal,{backgroundColor:f.Color.containerBackgroundColor}]},u.default.createElement(I.default,{isVisible:ht,onSwipeComplete:function(){St(!1)},swipeDirection:['down'],style:K.bottomModal},u.default.createElement(s.View,{style:[K.contentFilterBottom,{backgroundColor:f.Color.containerBackgroundColor}]},u.default.createElement(s.View,{style:K.contentSwipeDown},u.default.createElement(s.View,{style:K.lineSwipeDown})),u.default.createElement(w.default,{body2:!0,style:{marginTop:10}},p.default.t('LIST_ASSURE')),u.default.createElement(s.FlatList,{data:null==(t=q.result)?void 0:t.response,extraData:null==(n=q.result)?void 0:n.response,keyExtractor:function(t,n){return n},ListEmptyComponent:u.default.createElement(w.default,{body2:!0},p.default.t('NO_ASSURE_MATCH_SEARCH')),renderItem:function(t){var n=t.item;return t.index,u.default.createElement(s.View,{style:{paddingVertical:15,alignItems:'flex-start'}},u.default.createElement(s.TouchableOpacity,{style:[K.contentActionModalBottom,{borderBottomColor:f.Color.borderColor,width:"100%",flexDirection:'column'}],key:n.id,onPress:function(){'SUSPENDED'===n.state?s.Alert.alert(p.default.t('ERROR_LABEL'),p.default.t('ASSURE_SUSPENDU'),[{text:p.default.t('OK'),onPress:function(){}}]):'PAID'!==n.state?s.Alert.alert(p.default.t('ERROR_LABEL'),p.default.t('ASSURE_NON_EN_REGLE'),[{text:p.default.t('OK'),onPress:function(){}}]):(je(n),He(null),ct(1),St(!1),Bt('lastname_patient',n.user.lastname),Bt('firstname_patient',n.user.firstname),C(ce.id_network,'',"&user_id="+n.user.id),te((0,h.fetchGetUserByNameOrNumberReset)()),Ye.current.next(),z("?user_id="+n.user.id))}},u.default.createElement(w.default,{body2:!0,semibold:!0},(null!==n.user.firstname?n.user.firstname:'')+" "+(null!==n.user.lastname?n.user.lastname:'')),u.default.createElement(w.default,{footnote:!0},p.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+n.insurance_consumed_amount),u.default.createElement(w.default,{footnote:!0},p.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+n.insurance_remaining_amount)),n.beneficiaries.map(function(t){return u.default.createElement(s.TouchableOpacity,{style:K.beneficiarySubSection,onPress:function(){'SUSPENDED'===n.state?s.Alert.alert(p.default.t('ERROR_LABEL'),p.default.t('ASSURE_PRINCIPAL_SUSPENDU'),[{text:p.default.t('OK'),onPress:function(){}}]):(je(n),He(t),ct(0),St(!1),Bt('lastname_patient',t.lastname),Bt('firstname_patient',t.firstname),C(ce.id_network,'',"&user_id="+n.user.id+"&beneficiary_id="+t.id),te((0,h.fetchGetUserByNameOrNumberReset)()),Ye.current.next(),z("?user_id="+n.user.id+"&beneficiary_id="+t.id))}},u.default.createElement(s.View,{style:{width:10}}),u.default.createElement(s.View,{style:{paddingHorizontal:10,alignItems:'flex-start'}},u.default.createElement(w.default,{subhead:!0,semibold:!0,textAlign:"left"},(null!==t.firstname?t.firstname:'')+" "+(null!==t.lastname?t.lastname:'')+" ("+p.default.t('AYANT_DROITS')+")"),u.default.createElement(w.default,{footnote:!0},p.default.t('MONTANT_ASSURANCE_CONSOMME')+": "+t.insurance_consumed_amount),u.default.createElement(w.default,{footnote:!0},p.default.t('MONTANT_ASSURANCE_RESTANTE')+": "+t.insurance_remaining_amount)))}))}}),u.default.createElement(D.default,{full:!0,style:{marginTop:10,marginBottom:20},onPress:function(){return St(!1)}},p.default.t('OK'))))))},bt=(0,A.useFormik)({validationSchema:Ct,initialValues:{password:'',code_acte:'',firstname_patient:'',lastname_patient:''},onSubmit:function(t){null===Ge&&null===Fe||(null===be?mt.shake(800):''===t.code_acte?pt.shake(200):(F({act_id:t.code_acte,insurance_id:Ge.id,issuer_network_agent_id:ce.network_agent_id,beneficiary_id:null!==Fe?Fe.id:null,password:t.password}),console.log(le),console.log("insurance",be)))}}),yt=bt.handleChange,Rt=bt.handleSubmit,At=bt.handleBlur,Nt=bt.values,Tt=bt.errors,Ot=bt.touched,Bt=bt.setFieldValue,vt=bt.setFieldTouched,Dt=(bt.isValid,function(){switch(console.log("currentStep",lt),lt){case 0:return console.log("values",Nt),te((0,h.fetchGetUserByNameOrNumberReset)()),''!==Nt.numero_assure&&null===q.result&&(Q(ce.id_network,xe?"&insured_id="+Nt.numero_assure:Pe?"&phone="+Nt.numero_assure:"&name="+Nt.numero_assure),console.log("errors",Tt)),!1;default:return!0}}),xt=[{title:p.default.t('ASSURE'),content:u.default.createElement(s.View,null,u.default.createElement(k.default,{style:{marginTop:10,width:(0,T.responsiveWidth)(90)},placeholder:xe?p.default.t('NUMERO_ASSURE'):Pe?p.default.t('PHONE_NUMBER'):p.default.t('NOM_ASSURE'),value:Nt.numero_assure,keyboardType:Pe?'numeric':'default',onChangeText:yt('numero_assure'),onBlur:At('numero_assure'),success:Ot.numero_assure&&!Tt.numero_assure,touched:Ot.numero_assure,error:Tt.numero_assure,icon:u.default.createElement(v.default,{style:{zIndex:10},name:xe?'lock':Pe?'phone':'user',size:20})}),u.default.createElement(s.View,{style:{flexDirection:'row',position:'absolute',top:22,right:70,justifyContent:'space-between',width:50}},u.default.createElement(V.default,{style:{paddingRight:10},name:"lock",size:20,color:f.Color.primaryColor,onPress:function(){Le(!0),ke(!1)}}),u.default.createElement(V.default,{style:{paddingRight:10},name:"phone",size:20,color:f.Color.primaryColor,onPress:function(){Le(!1),ke(!0)}}),u.default.createElement(V.default,{style:{paddingRight:10},name:"user",size:20,color:f.Color.primaryColor,onPress:function(){Le(!1),ke(!1)}}),u.default.createElement(V.default,{style:{paddingRight:10},name:"qrcode",size:20,color:f.Color.primaryColor,onPress:function(){Te(!0)}})))},{title:p.default.t('PATIENT'),content:u.default.createElement(s.View,null,u.default.createElement(k.default,{style:{marginTop:10},placeholder:p.default.t('NOM_CLIENT'),value:Nt.lastname_patient,onChangeText:yt('lastname_patient'),onBlur:At('lastname_patient'),success:Ot.lastname_patient&&!Tt.lastname_patient,touched:Ot.lastname_patient,editable:!1,error:Tt.lastname_patient}),u.default.createElement(k.default,{style:{marginTop:10},placeholder:p.default.t('PRENOM_CLIENT'),value:Nt.firstname_patient,editable:!1,onChangeText:yt('firstname_patient'),onBlur:At('firstname_patient'),success:Ot.firstname_patient&&!Tt.firstname_patient,touched:Ot.firstname_patient,error:Tt.firstname_patient}),u.default.createElement(s.View,{style:{marginTop:10,flexDirection:'row',justifyContent:"space-between"}},u.default.createElement(w.default,{body2:!0},p.default.t('SITUATION')),u.default.createElement(s.View,{style:{width:(0,T.responsiveWidth)(60)}},u.default.createElement(M.default,{options:it,disabled:!0,value:dt,initial:dt,buttonColor:f.Color.accentColor,backgroundColor:f.Color.primaryDarkColor,textColor:"white",bold:!0,hasPadding:!0,height:32,onPress:function(t){}}))))},{title:p.default.t('DEMAND_DETAIL'),content:u.default.createElement(s.View,null,X.loading?u.default.createElement(s.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},'android'===s.Platform.OS?u.default.createElement(u.default.Fragment,null,u.default.createElement(s.ProgressBarAndroid,null),u.default.createElement(w.default,null,p.default.t('LOADING_DOTS'))):u.default.createElement(u.default.Fragment,null,u.default.createElement(s.ActivityIndicator,{size:"large",color:'#ccc'}),u.default.createElement(w.default,null,p.default.t('LOADING_DOTS')))):X.result?u.default.createElement(s.View,{style:K.contain},u.default.createElement(N.View,{ref:function(t){mt=t},style:{width:(0,T.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},u.default.createElement(O.Dropdown,{label:p.default.t('SELECT_INSURANCE'),data:X.result.response,useNativeDriver:!0,onChangeText:function(t,n,o){console.log("Value",t),ye(t),he([].concat((0,l.default)(t.beneficiaries),[{id:null!==Ge?Ge.id:Fe.id,firstname:null!==Ge?Ge.firstname:Fe.firstname,lastname:null!==Ge?Ge.lastname:Fe.lastname}])),C(t.network.id,'','&authorization_type=PRIOR')},valueExtractor:function(t){return t},labelExtractor:function(t){return t.network.name}})),u.default.createElement(N.View,{ref:function(t){pt=t},style:{width:(0,T.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,marginTop:10,paddingRight:20,backgroundColor:'white'}},u.default.createElement(O.Dropdown,{label:p.default.t('CODE_ACTE'),data:null!==Z.result?null==(n=Z.result)?void 0:n.response:[],useNativeDriver:!0,onChangeText:function(t,n,l){vt('code_acte'),Bt('code_acte',t.id)},valueExtractor:function(t){return t},labelExtractor:function(t){return t.name}})),u.default.createElement(B.default,{style:{marginTop:10,width:(0,T.responsiveWidth)(90)},onChangeText:yt('password'),placeholder:p.default.t('PASSWORD'),secureTextEntry:!0,icon:u.default.createElement(v.default,{name:"lock",size:20}),value:Nt.password,onBlur:At('password'),success:Ot.password&&!Tt.password,touched:Ot.password,error:Tt.password}),u.default.createElement(D.default,{style:{marginTop:20},full:!0,loading:ee.loading,onPress:Rt},p.default.t('SUBMIT_LABEL'))):null)}];return u.default.createElement(E.ScreenComponent,null,u.default.createElement(S.default,{ref:function(t){return _t=t}}),u.default.createElement(L.default,{show:Z.loading}),u.default.createElement(s.KeyboardAvoidingView,{behavior:'android'===s.Platform.OS?'height':'padding',style:{flex:1}},u.default.createElement(s.ScrollView,{style:{flex:1}},u.default.createElement(s.View,{style:K.contain},u.default.createElement(G.default,{steps:xt,currentStepIndex:lt+1}),u.default.createElement(s.View,{style:{flexDirection:'column',alignItems:'center'}},u.default.createElement(j.default,{ref:Ye,activeStep:0,steps:xt,useNativeDriver:!0,nextStepAnimation:"slideLeft",prevStepAnimation:"slideRight",isFirstStep:function(t){return Ze(t)},isLastStep:function(t){return tt(t)},onNext:function(){Dt()},onPrev:function(){},currentStep:function(t){var n=t.currentStep,l=t.isLastStep,o=t.isFirstStep;rt(n),Ze(o),tt(l)}})),u.default.createElement(s.View,{style:K.iconNavigation},Xe?u.default.createElement(s.View,null):u.default.createElement(s.TouchableOpacity,{style:[K.iconNavigationButton,{backgroundColor:f.Color.primaryColor,borderColor:f.Color.primaryColor}],onPress:function(){return Ye.current.prev()}},u.default.createElement(V.default,{name:"arrow-left",size:20,color:f.Color.whiteColor})),2===lt?u.default.createElement(D.default,{loading:ee.loading,onPress:Rt},p.default.t('SUBMIT_LABEL')):u.default.createElement(s.TouchableOpacity,{style:[K.iconNavigationButton,{backgroundColor:f.Color.primaryColor,borderColor:f.Color.primaryColor}],onPress:function(t){Rt(t),Dt()&&Ye.current.next()}},$.loading||q.loading||J.loading?u.default.createElement(s.ActivityIndicator,{size:"small",color:"#fff"}):u.default.createElement(V.default,{name:"arrow-right",size:24,color:f.Color.whiteColor}))),ht&&wt(),Ne&&u.default.createElement(y.default.Container,{contentStyle:{width:(0,T.responsiveWidth)(80)},useNativeDriver:!0,visible:Ne},u.default.createElement(y.default.Title,null,p.default.t('SCAN')),u.default.createElement(s.ScrollView,{style:[K.blockView,{borderBottomColor:f.Color.borderColor,maxHeight:300}]},u.default.createElement(w.default,null,p.default.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')),u.default.createElement(U.default,{onRead:function(t){Te(!1),H(t.data)},flashMode:P.RNCamera.Constants.FlashMode.off})),u.default.createElement(y.default.Button,{bold:!0,label:p.default.t('CLOSE'),onPress:function(){Te(!1)}})),ht&&wt()))))});e.default=H;var K=s.StyleSheet.create({textInput:{height:46,backgroundColor:f.Color.fieldColor,borderRadius:5,marginTop:10,padding:10,width:'100%'},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:.5},ineSeparator:{borderWidth:1,width:'40%',height:1,alignSelf:'center'},line:{width:1,height:14,backgroundColor:f.Color.grayColor,marginLeft:10},contentModeView:{width:30,height:'100%',alignItems:'flex-end',justifyContent:'center'},contentFilter:{flexDirection:'row',alignItems:'center',marginLeft:10},bottomModal:{justifyContent:'flex-end',margin:0},contentFilterBottom:{width:"100%",borderTopLeftRadius:8,borderTopRightRadius:8,paddingHorizontal:20},contentSwipeDown:{paddingTop:10,alignItems:'center'},lineSwipeDown:{width:30,height:2.5,backgroundColor:f.Color.dividerColor},contentActionModalBottom:{flexDirection:"row",paddingVertical:10,marginBottom:10,justifyContent:"space-between",borderBottomWidth:1},containModal:{paddingVertical:10,paddingHorizontal:20,flexDirection:'row',justifyContent:'space-between'},iconNavigation:{width:'100%',flexDirection:'row',marginTop:20,justifyContent:'space-between',alignItems:'center'},iconNavigationButton:{borderWidth:1,borderRadius:25,width:50,height:50,alignItems:'center',justifyContent:'center'},beneficiarySubSection:{marginTop:10,flexDirection:'row',width:'100%'}})},1746,[4,1,35,27,15,18,1049,1034,720,1703,1485,1716,1732,1733,1416,1457,1423,1105,1630,750,535,982,1713,539,1714,1637,1580,1626,1417,1316,1415,1016,772,1737,1738,719,1189]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(d[2])),l=n(r(d[3])),c=t(r(d[4])),u=r(d[5]),s=r(d[6]),f=n(r(d[7])),h=r(d[8]),p=t(r(d[9])),b=t(r(d[10])),w=r(d[11]),E=n(r(d[12])),S=r(d[13]),C=n(r(d[14])),y=n(r(d[15])),I=n(r(d[16])),T=n(r(d[17])),B=r(d[18]),L=r(d[19]),R=n(r(d[20])),A=r(d[21]),D=t(r(d[22])),_=r(d[23]),x=r(d[24]),O=r(d[25]),P=n(r(d[26])),v=(r(d[27]),u.Dimensions.get('window')),V=v.width,N=(v.height,.5*V),k=u.StyleSheet.create({textInput:{height:46,backgroundColor:w.Color.fieldColor,borderRadius:5,marginTop:10,padding:10,width:'100%'},lineRow:{flexDirection:'row',justifyContent:'space-between',paddingBottom:20},contain:{alignItems:'center',marginTop:40,paddingBottom:20,paddingLeft:20,paddingRight:20,flex:1},circle:{width:N,height:N,borderRadius:N/2,position:'absolute',top:'15%'},circleContainer:{alignItems:'flex-end',right:-N/3,top:-N/1.5},lineSeparator:{borderWidth:1,width:'40%',height:1,alignSelf:'center'},line:{width:1,height:14,backgroundColor:w.Color.grayColor,marginLeft:10},contentModeView:{width:30,height:'100%',alignItems:'flex-end',justifyContent:'center'},contentFilter:{flexDirection:'row',alignItems:'center',marginLeft:10},bottomModal:{justifyContent:'flex-end',margin:0},contentFilterBottom:{width:"100%",borderTopLeftRadius:8,borderTopRightRadius:8,paddingHorizontal:20},contentSwipeDown:{paddingTop:10,alignItems:'center'},lineSwipeDown:{width:30,height:2.5,backgroundColor:w.Color.dividerColor},contentActionModalBottom:{flexDirection:'row',paddingVertical:15,justifyContent:'space-between',borderBottomWidth:1},containModal:{paddingVertical:10,paddingHorizontal:20,flexDirection:'row',justifyContent:'space-between'},floatingButtonAdd:{backgroundColor:w.Color.accentColor,position:"absolute",width:25,bottom:0,zIndex:1e3,right:20,top:35,height:25,borderRadius:12.5,alignItems:'center',justifyContent:'center'},contentSwitch:{width:(0,B.responsiveWidth)(40)},switch:{},choosePhotoBtn:{marginTop:10,marginBottom:10,width:"auto",height:"auto",padding:5,alignItems:'center',borderColor:w.Color.borderColor,marginRight:10,elevation:2},checkbox:{alignSelf:"center",color:"white"},itemAmountPerMonth:{paddingLeft:10,marginTop:10,flexDirection:'row'},dot:{width:12,height:12,borderRadius:6},blockView:{paddingVertical:10,borderBottomWidth:.5}}),M=(0,_.createStructuredSelector)({insuranceList:x.selectInsuranceList,subscribeInsurance:x.selectSubscribeInsurance,uploadInsuranceImages:x.selectUploadInsuranceImages,insurancePrimeAmount:x.selectInsurancePrimeAmount,addBeneficiaryToSubscription:x.selectAddBeneficiaryToSubscription,subscriptionList:x.selectSubscriptionList,deleteBeneficiary:x.selectDeleteBeneficiary}),F=(0,s.connect)(M,{fetchGetListInsurance:L.fetchGetListInsurance,fetchSubscribeInsurance:L.fetchSubscribeInsurance,fetchGetInsurancePrimeAmount:L.fetchGetInsurancePrimeAmount,fetchUploadInsurance:L.fetchUploadInsurance,fetchAddBeneficiaryToSubscription:L.fetchAddBeneficiaryToSubscription,fetchGetSubscriptionList:L.fetchGetSubscriptionList,fetchDeleteBeneficiary:L.fetchDeleteBeneficiary})(function(t){t.fetchAddBeneficiaryToSubscription,t.addBeneficiaryToSubscription;var n=t.fetchGetSubscriptionList,_=t.fetchDeleteBeneficiary,x=t.subscriptionList,v=t.deleteBeneficiary,V=t.navigation,N=(0,c.useState)(null),M=(0,l.default)(N,2),F=M[0],U=M[1],G=(0,c.useState)(null),j=(0,l.default)(G,2),W=j[0],K=(j[1],(0,c.useState)(null)),z=(0,l.default)(K,2),H=(z[0],z[1]),Y=(0,s.useDispatch)(),q=(0,c.useState)(!1),J=(0,l.default)(q,2),Q=J[0],X=J[1],Z=(0,c.useState)(null),$=(0,l.default)(Z,2),ee=$[0],te=$[1],ne=(0,c.useState)([]),oe=(0,l.default)(ne,2),ie=oe[0],ae=oe[1],re=(0,c.useState)([]),le=(0,l.default)(re,2),ce=le[0],de=le[1],ue=(0,c.useState)([]),se=(0,l.default)(ue,2),fe=se[0],me=se[1],he=null;(0,c.useEffect)(function(){(0,A.readUser)().then(function(t){console.log("user",t),U(t)}),Y((0,L.fetchAddBeneficiaryToSubscriptionReset)()),Y((0,L.fetchGetSubscriptionListReset)())},[]),(0,c.useEffect)(function(){null!==F&&n(F.id,'EDITABLE',!1)},[F]);(0,c.useEffect)(function(){if(null!==x.result){var t=[];x.result.response.map(function(n,o){t.push(n)}),ae(t)}x.error&&u.Alert.alert(E.default.t("ERROR_LABLE"),b.getErrorMsg(x),[{text:E.default.t("OK"),onPress:function(){Y((0,L.fetchGetListInsuranceReset)())}}],{cancelable:!1})},[x]),(0,c.useEffect)(function(){null!==v.result&&u.Alert.alert(E.default.t("SUCCESS"),v.result.response,[{text:E.default.t("OK"),onPress:function(){Y((0,L.fetchDeleteBeneficiaryReset)()),V.goBack()}}],{cancelable:!1}),v.error&&u.Alert.alert(E.default.t("ERROR_LABLE"),b.getErrorMsg(v),[{text:E.default.t("OK"),onPress:function(){Y((0,L.fetchDeleteBeneficiaryReset)())}}],{cancelable:!1})},[v]);var ge=p.object().shape({password:p.string().required(E.default.t('THIS_FIELD_IS_REQUIRED'))});return c.default.createElement(S.ScreenComponent,null,c.default.createElement(R.default,{ref:function(t){return t}}),c.default.createElement(u.KeyboardAvoidingView,{behavior:'android'===u.Platform.OS?'height':'padding',style:{flex:1}},c.default.createElement(u.ScrollView,{style:{flex:1}},c.default.createElement(h.Formik,{validationSchema:ge,initialValues:{password:''},onSubmit:function(t){null!==F&&(null===ee?he.shake(800):(console.log(F),console.log("insurance",W),H(t.password),_(ee.id,{password:t.password,beneficiaries_ids:fe})))}},function(t){var n=t.values,o=t.errors,l=t.touched,s=t.handleChange,f=t.handleBlur,h=t.handleSubmit;return t.isSubmitting,c.default.createElement(u.View,{style:k.contain},c.default.createElement(D.View,{ref:function(t){he=t},style:{width:(0,B.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},c.default.createElement(O.Dropdown,{label:E.default.t('SELECT_SUBSCRIPTION'),data:ie,useNativeDriver:!0,onChangeText:function(t,n,o){console.log("Value",t),de(t.beneficiaries),te({id:t.id,insured_id:t.insured_id,subscription:t.subscription,beneficiaries:t.beneficiaries}),X(!0)},valueExtractor:function(t){return t},labelExtractor:function(t){return t.network.name+" | "+E.default.t('ETAT')+": "+t.state+" | "+E.default.t('AMOUNT_LABEL')+": "+t.total_bonus_amount}})),c.default.createElement(y.default,{style:{marginTop:10},onChangeText:s('password'),placeholder:E.default.t('PASSWORD'),secureTextEntry:!0,icon:c.default.createElement(T.default,{name:"lock",size:20}),value:n.password,onBlur:f('password'),success:l.password&&!o.password,touched:l.password,error:o.password}),c.default.createElement(I.default,{style:{marginTop:20},full:!0,loading:v.loading,onPress:h},E.default.t('SUBMIT_LABEL')))}))),Q&&c.default.createElement(f.default,{isVisible:Q,onSwipeComplete:function(){return X(!1)},swipeDirection:['down'],style:k.bottomModal},c.default.createElement(u.View,{style:[k.contentFilterBottom,{backgroundColor:w.Color.cardBackgroundColor}]},c.default.createElement(u.View,{style:k.contentSwipeDown},c.default.createElement(u.View,{style:k.lineSwipeDown})),c.default.createElement(u.View,{style:[k.contentActionModalBottom,{borderBottomColor:w.Color.borderColor}]}),c.default.createElement(u.View,{style:[{marginBottom:40}]},c.default.createElement(u.FlatList,{data:ce,extraData:ce,keyExtractor:function(t,n){return n},ListEmptyComponent:function(){return c.default.createElement(C.default,null,E.default.t('NO_WALLET_HISTORY'))},renderItem:function(t){var n=t.item;return t.index,console.log("Item",n),c.default.createElement(u.View,{style:k.lineRow},c.default.createElement(u.View,{style:{alignItems:'flex-start'}},c.default.createElement(C.default,{body1:!0},E.default.t('NOM_ASSURE')),c.default.createElement(C.default,{caption1:!0,grayColor:!0},n.firstname+" "+n.lastname)),c.default.createElement(u.View,{style:{alignItems:'flex-start'}},c.default.createElement(C.default,{body1:!0},E.default.t('AFFILIATION')),c.default.createElement(C.default,{caption1:!0,grayColor:!0},'CHILD'===n.affiliation?E.default.t('ENFANT'):E.default.t('CONJOINT'))),c.default.createElement(u.View,{style:k.iconRight},c.default.createElement(u.TouchableOpacity,{onPress:function(){u.Alert.alert(E.default.t("TITLE_SUPPRESS_CONFIRM"),E.default.t("TEXT_SUPPRESS_CONFIRM_BENEFICIARY"),[{text:E.default.t("OK"),onPress:function(){me([].concat((0,o.default)(fe),[n.id])),de(ce.filter(function(t){return t.id!==n.id}))}},{text:E.default.t("CANCEL_LABEL"),onPress:function(){}}],{cancelable:!1})}},c.default.createElement(P.default,{name:"minus-circle",size:24,color:w.Color.grayColor}))))}})),c.default.createElement(I.default,{style:{marginTop:20,marginBottom:20},full:!0,onPress:function(){ce.length>=1&&fe.length>0&&(0,b.displayToast)(E.default.t('ENTER_PASSWORD_TO_VALID_MODIFICATION')),X(!1)}},E.default.t('OK')))),null!==ee&&c.default.createElement(u.TouchableOpacity,{style:{alignItems:'center',flexDirection:'row',width:60,position:'absolute',bottom:10,right:10,height:60,padding:3,backgroundColor:w.Color.primaryColor,borderRadius:100},onPress:function(){return X(!0)}},c.default.createElement(C.default,{whiteColor:!0,title2:!0},ce.length),c.default.createElement(C.default,{whiteColor:!0,caption2:!0},E.default.t('AYANT_DROIT'))))});e.default=F},1747,[4,1,35,27,15,18,1049,1626,1630,1637,1457,1034,720,1703,1416,1713,1714,539,535,1485,1716,719,750,1732,1733,982,1016,1189]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(d[2])),l=t(r(d[3])),s=r(d[4]),u=r(d[5]),c=r(d[6]),f=t(r(d[7])),h=t(r(d[8])),p=r(d[9]),b=n(r(d[10])),w=r(d[11]),S=n(r(d[12])),_=n(r(d[13])),E=n(r(d[14])),C=r(d[15]),L=r(d[16]),R=n(r(d[17])),x=r(d[18]),v=t(r(d[19])),B=r(d[20]),I=r(d[21]),T=r(d[22]),y=(r(d[23]),s.Dimensions.get('window')),k=y.width,A=(y.height,.5*k),D=s.StyleSheet.create({textInput:{height:46,backgroundColor:p.Color.fieldColor,borderRadius:5,marginTop:10,padding:10,width:'100%'},lineRow:{flexDirection:'row',justifyContent:'space-between',paddingBottom:20},contain:{alignItems:'center',marginTop:40,paddingBottom:20,paddingLeft:20,paddingRight:20,flex:1},circle:{width:A,height:A,borderRadius:A/2,position:'absolute',top:'15%'},circleContainer:{alignItems:'flex-end',right:-A/3,top:-A/1.5},lineSeparator:{borderWidth:1,width:'40%',height:1,alignSelf:'center'},line:{width:1,height:14,backgroundColor:p.Color.grayColor,marginLeft:10},contentModeView:{width:30,height:'100%',alignItems:'flex-end',justifyContent:'center'},contentFilter:{flexDirection:'row',alignItems:'center',marginLeft:10},bottomModal:{justifyContent:'flex-end',margin:0},contentFilterBottom:{width:"100%",borderTopLeftRadius:8,borderTopRightRadius:8,paddingHorizontal:20},contentSwipeDown:{paddingTop:10,alignItems:'center'},lineSwipeDown:{width:30,height:2.5,backgroundColor:p.Color.dividerColor},contentActionModalBottom:{flexDirection:'row',paddingVertical:15,justifyContent:'space-between',borderBottomWidth:1},containModal:{paddingVertical:10,paddingHorizontal:20,flexDirection:'row',justifyContent:'space-between'},floatingButtonAdd:{backgroundColor:p.Color.accentColor,position:"absolute",width:25,bottom:0,zIndex:1e3,right:20,top:35,height:25,borderRadius:12.5,alignItems:'center',justifyContent:'center'},contentSwitch:{width:(0,C.responsiveWidth)(40)},switch:{},choosePhotoBtn:{marginTop:10,marginBottom:10,width:"auto",height:"auto",padding:5,alignItems:'center',borderColor:p.Color.borderColor,marginRight:10,elevation:2},checkbox:{alignSelf:"center",color:"white"},itemAmountPerMonth:{paddingLeft:10,marginTop:10,flexDirection:'row'},dot:{width:12,height:12,borderRadius:6},blockView:{paddingVertical:10,borderBottomWidth:.5}}),V=(0,B.createStructuredSelector)({insuranceList:I.selectInsuranceList,stopSubscription:I.selectStopSubscription}),M=(0,u.connect)(V,{fetchStopSubscription:L.fetchStopSubscription,fetchGetListInsuranceWithBeneficiaries:L.fetchGetListInsuranceWithBeneficiaries,fetchGetSubscriptionList:L.fetchGetSubscriptionList})(function(t){var n=t.stopSubscription,p=(t.fetchGetSubscriptionList,t.fetchGetListInsuranceWithBeneficiaries),B=t.insuranceList,I=t.fetchStopSubscription,y=t.navigation,k=(0,l.useState)(null),A=(0,o.default)(k,2),V=A[0],M=A[1],G=(0,l.useState)(null),O=(0,o.default)(G,2),P=(O[0],O[1],(0,l.useState)([])),W=(0,o.default)(P,2),j=W[0],U=W[1],z=(0,l.useState)(null),F=(0,o.default)(z,2),K=F[0],N=F[1],H=(0,u.useDispatch)(),q=null;(0,l.useEffect)(function(){(0,x.readUser)().then(function(t){M(t)}),H((0,L.fetchGetListInsuranceReset)()),H((0,L.fetchGetSubscriptionListReset)()),H((0,L.fetchStopSubscriptionReset)())},[]),(0,l.useEffect)(function(){null!==V&&(console.log("user",V.id),p("?user_id="+V.id+"&type=EDITABLE"))},[V]),(0,l.useEffect)(function(){if(null!==B.result){var t=[];B.result.response.map(function(n,o){t.push(n)}),U(t)}B.error&&s.Alert.alert(b.default.t("ERROR_LABLE"),h.getErrorMsg(B),[{text:b.default.t("OK"),onPress:function(){H((0,L.fetchGetSubscriptionListReset)())}}],{cancelable:!1})},[B]),(0,l.useEffect)(function(){null!==n.result&&s.Alert.alert(b.default.t("SUCCESS"),n.result.response,[{text:b.default.t("OK"),onPress:function(){H((0,L.fetchStopSubscriptionReset)()),y.goBack()}}],{cancelable:!1}),n.error&&s.Alert.alert(b.default.t("ERROR_LABLE"),h.getErrorMsg(n),[{text:b.default.t("OK"),onPress:function(){H((0,L.fetchStopSubscriptionReset)())}}],{cancelable:!1})},[n]);var Q=f.object().shape({password:f.string().required(b.default.t('THIS_FIELD_IS_REQUIRED'))});return l.default.createElement(w.ScreenComponent,null,l.default.createElement(R.default,{ref:function(t){return t}}),l.default.createElement(s.KeyboardAvoidingView,{behavior:'android'===s.Platform.OS?'height':'padding',style:{flex:1}},l.default.createElement(s.ScrollView,{style:{flex:1}},l.default.createElement(c.Formik,{validationSchema:Q,initialValues:{password:''},onSubmit:function(t){null!==V&&(null===K?q.shake(800):(console.log("subscription",K),I(K.id,{password:t.password})))}},function(t){var o=t.values,u=t.errors,c=t.touched,f=t.handleChange,h=t.handleBlur,p=t.handleSubmit;return t.isSubmitting,l.default.createElement(s.View,{style:D.contain},l.default.createElement(v.View,{ref:function(t){q=t},style:{width:(0,C.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},l.default.createElement(T.Dropdown,{label:b.default.t('SELECT_INSURANCE'),data:j,useNativeDriver:!0,onChangeText:function(t,n,o){console.log("Value",t),N({id:t.id,insurance_subscription_id:t.insurance_subscription_id,network_id:t.network_id,user_id:t.user_id,number_of_months:t.number_of_months,bonus_amount:t.bonus_amount,number_of_beneficiaries:t.number_of_beneficiaries,total_bonus_amount:t.total_bonus_amount,state:t.state,created_at:t.created_at,updated_at:t.updated_at,start_at:t.start_at,end_at:t.end_at,reason:t.reason,network:t.network,beneficiaries:t.beneficiaries})},valueExtractor:function(t){return t},labelExtractor:function(t){return t.network.name+" | "+b.default.t('ETAT')+": "+t.state+" | "+b.default.t('AMOUNT_LABEL')+": "+t.total_bonus_amount}})),l.default.createElement(S.default,{style:{marginTop:10},onChangeText:f('password'),placeholder:b.default.t('PASSWORD'),secureTextEntry:!0,icon:l.default.createElement(E.default,{name:"lock",size:20}),value:o.password,onBlur:h('password'),success:c.password&&!u.password,touched:c.password,error:u.password}),l.default.createElement(_.default,{style:{marginTop:20},full:!0,loading:n.loading,onPress:p},b.default.t('SUBMIT_LABEL')))}))))});e.default=M},1748,[4,1,27,15,18,1049,1630,1637,1457,1034,720,1703,1713,1714,539,535,1485,1716,719,750,1732,1733,982,1189]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(d[2])),l=t(r(d[3])),s=r(d[4]),u=r(d[5]),c=r(d[6]),f=t(r(d[7])),h=t(r(d[8])),p=r(d[9]),b=n(r(d[10])),w=r(d[11]),S=n(r(d[12])),_=n(r(d[13])),E=n(r(d[14])),C=r(d[15]),R=r(d[16]),L=n(r(d[17])),x=r(d[18]),v=t(r(d[19])),B=r(d[20]),I=r(d[21]),T=r(d[22]),y=(r(d[23]),s.Dimensions.get('window')),k=y.width,A=(y.height,.5*k),D=s.StyleSheet.create({textInput:{height:46,backgroundColor:p.Color.fieldColor,borderRadius:5,marginTop:10,padding:10,width:'100%'},lineRow:{flexDirection:'row',justifyContent:'space-between',paddingBottom:20},contain:{alignItems:'center',marginTop:40,paddingBottom:20,paddingLeft:20,paddingRight:20,flex:1},circle:{width:A,height:A,borderRadius:A/2,position:'absolute',top:'15%'},circleContainer:{alignItems:'flex-end',right:-A/3,top:-A/1.5},lineSeparator:{borderWidth:1,width:'40%',height:1,alignSelf:'center'},line:{width:1,height:14,backgroundColor:p.Color.grayColor,marginLeft:10},contentModeView:{width:30,height:'100%',alignItems:'flex-end',justifyContent:'center'},contentFilter:{flexDirection:'row',alignItems:'center',marginLeft:10},bottomModal:{justifyContent:'flex-end',margin:0},contentFilterBottom:{width:"100%",borderTopLeftRadius:8,borderTopRightRadius:8,paddingHorizontal:20},contentSwipeDown:{paddingTop:10,alignItems:'center'},lineSwipeDown:{width:30,height:2.5,backgroundColor:p.Color.dividerColor},contentActionModalBottom:{flexDirection:'row',paddingVertical:15,justifyContent:'space-between',borderBottomWidth:1},containModal:{paddingVertical:10,paddingHorizontal:20,flexDirection:'row',justifyContent:'space-between'},floatingButtonAdd:{backgroundColor:p.Color.accentColor,position:"absolute",width:25,bottom:0,zIndex:1e3,right:20,top:35,height:25,borderRadius:12.5,alignItems:'center',justifyContent:'center'},contentSwitch:{width:(0,C.responsiveWidth)(40)},switch:{},choosePhotoBtn:{marginTop:10,marginBottom:10,width:"auto",height:"auto",padding:5,alignItems:'center',borderColor:p.Color.borderColor,marginRight:10,elevation:2},checkbox:{alignSelf:"center",color:"white"},itemAmountPerMonth:{paddingLeft:10,marginTop:10,flexDirection:'row'},dot:{width:12,height:12,borderRadius:6},blockView:{paddingVertical:10,borderBottomWidth:.5}}),P=(0,B.createStructuredSelector)({insuranceList:I.selectInsuranceList,stopSubscription:I.selectStopSubscription}),V=(0,u.connect)(P,{fetchRenewSubscription:R.fetchRenewSubscription,fetchGetListInsuranceWithBeneficiaries:R.fetchGetListInsuranceWithBeneficiaries,fetchGetSubscriptionList:R.fetchGetSubscriptionList})(function(t){var n=t.stopSubscription,p=(t.fetchGetSubscriptionList,t.fetchGetListInsuranceWithBeneficiaries),B=t.insuranceList,I=t.fetchRenewSubscription,y=t.navigation,k=(0,l.useState)(null),A=(0,o.default)(k,2),P=A[0],V=A[1],M=(0,l.useState)(null),O=(0,o.default)(M,2),G=(O[0],O[1],(0,l.useState)([])),W=(0,o.default)(G,2),j=W[0],U=W[1],z=(0,l.useState)(null),F=(0,o.default)(z,2),K=F[0],N=F[1],H=(0,u.useDispatch)(),q=null;(0,l.useEffect)(function(){(0,x.readUser)().then(function(t){V(t)}),H((0,R.fetchGetListInsuranceReset)()),H((0,R.fetchGetSubscriptionListReset)()),H((0,R.fetchStopSubscriptionReset)())},[]),(0,l.useEffect)(function(){null!==P&&(console.log("user",P.id),p("?user_id="+P.id+"&type=STOPPED"))},[P]),(0,l.useEffect)(function(){if(null!==B.result){var t=[];B.result.response.map(function(n,o){t.push(n)}),U(t)}B.error&&s.Alert.alert(b.default.t("ERROR_LABLE"),h.getErrorMsg(B),[{text:b.default.t("OK"),onPress:function(){H((0,R.fetchGetSubscriptionListReset)())}}],{cancelable:!1})},[B]),(0,l.useEffect)(function(){null!==n.result&&s.Alert.alert(b.default.t("SUCCESS"),n.result.response,[{text:b.default.t("OK"),onPress:function(){H((0,R.fetchStopSubscriptionReset)()),y.goBack()}}],{cancelable:!1}),n.error&&s.Alert.alert(b.default.t("ERROR_LABLE"),h.getErrorMsg(n),[{text:b.default.t("OK"),onPress:function(){H((0,R.fetchStopSubscriptionReset)())}}],{cancelable:!1})},[n]);var Q=f.object().shape({password:f.string().required(b.default.t('THIS_FIELD_IS_REQUIRED'))});return l.default.createElement(w.ScreenComponent,null,l.default.createElement(L.default,{ref:function(t){return t}}),l.default.createElement(s.KeyboardAvoidingView,{behavior:'android'===s.Platform.OS?'height':'padding',style:{flex:1}},l.default.createElement(s.ScrollView,{style:{flex:1}},l.default.createElement(c.Formik,{validationSchema:Q,initialValues:{password:''},onSubmit:function(t){null!==P&&(null===K?q.shake(800):(console.log("subscription",K),I(K.id,{password:t.password})))}},function(t){var o=t.values,u=t.errors,c=t.touched,f=t.handleChange,h=t.handleBlur,p=t.handleSubmit;return t.isSubmitting,l.default.createElement(s.View,{style:D.contain},l.default.createElement(v.View,{ref:function(t){q=t},style:{width:(0,C.responsiveWidth)(90),height:60,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},l.default.createElement(T.Dropdown,{label:b.default.t('SELECT_INSURANCE'),data:j,useNativeDriver:!0,onChangeText:function(t,n,o){console.log("Value",t),N({id:t.id,insurance_subscription_id:t.insurance_subscription_id,network_id:t.network_id,user_id:t.user_id,number_of_months:t.number_of_months,bonus_amount:t.bonus_amount,number_of_beneficiaries:t.number_of_beneficiaries,total_bonus_amount:t.total_bonus_amount,state:t.state,created_at:t.created_at,updated_at:t.updated_at,start_at:t.start_at,end_at:t.end_at,reason:t.reason,network:t.network,beneficiaries:t.beneficiaries})},valueExtractor:function(t){return t},labelExtractor:function(t){return t.network.name+" | "+b.default.t('ETAT')+": "+t.state+" | "+b.default.t('AMOUNT_LABEL')+": "+t.total_bonus_amount}})),l.default.createElement(S.default,{style:{marginTop:10},onChangeText:f('password'),placeholder:b.default.t('PASSWORD'),secureTextEntry:!0,icon:l.default.createElement(E.default,{name:"lock",size:20}),value:o.password,onBlur:h('password'),success:c.password&&!u.password,touched:c.password,error:u.password}),l.default.createElement(_.default,{style:{marginTop:20},full:!0,loading:n.loading,onPress:p},b.default.t('SUBMIT_LABEL')))}))))});e.default=V},1749,[4,1,27,15,18,1049,1630,1637,1457,1034,720,1703,1713,1714,539,535,1485,1716,719,750,1732,1733,982,1189]); diff --git a/screens/wallet/user/DemandeAutorisationSoinScreen.js b/screens/wallet/user/DemandeAutorisationSoinScreen.js index be45e487..d72195cd 100644 --- a/screens/wallet/user/DemandeAutorisationSoinScreen.js +++ b/screens/wallet/user/DemandeAutorisationSoinScreen.js @@ -507,9 +507,10 @@ const DemandeAutorisationSoinScreen = ({ else { fetchDemaneAutorisationSoin({ act_id: values.code_acte, - insurance_id: insurance.id, - issuer_network_agent_id: user.agentId, - beneficiary_id: assure !== null ? assure.id : beneficiary.id, + /*insurance_id: insurance.id,*/ + insurance_id: assure.id, + issuer_network_agent_id: wallet.network_agent_id, + beneficiary_id: beneficiary !== null ? beneficiary.id : null, password: values.password }); console.log(user);