"use strict";angular.module("absApp.Common.Currency",["ngResource","ngSanitize","satellizer","ngAnimate","ui.router"]);angular.module('absApp').requires.push('absApp.Common.Currency');"use strict";angular.module("absApp.Common.Pages",["ui.router","ngResource","angulartics","angulartics.google.analytics","angulartics.facebook.pixel"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("pages",{url:"/page/{slug}",templateUrl:"scripts/plugins/Common/Pages/views/default/pages.html",controller:"PagesController",resolve:getToken})}),angular.module("absApp.Common.Pages").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Common/Pages/views/default/page_links.html",""),$templateCache.put("scripts/plugins/Common/Pages/views/default/pages.html",'

{{page.title}}

')}]);angular.module('absApp').requires.push('absApp.Common.Pages');"use strict";angular.module("absApp.Common.Translations",["ngResource","pascalprecht.translate","tmh.dynamicLocale","ngSanitize","ngCookies"]);angular.module('absApp').requires.push('absApp.Common.Translations');"use strict";angular.module("absApp.Common.UserEducations",["ui.router","ngResource","mgcrea.ngStrap","oitozero.ngSweetAlert","mwl.calendar","ui.bootstrap"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("user_educations",{url:"/user/education",templateUrl:"scripts/plugins/Common/UserEducations/views/default/user_educations.html",controller:"UserEducationsController",resolve:getToken})}),angular.module("absApp").controller("UserEducationsController",function($scope,$rootScope,$filter,$state,$timeout,flash,SweetAlert,$anchorScroll,UserEducations,UserEducationAdd,UserEducationEditFactory){function flashMessage(message,classname){flash.set($filter("translate")(message),classname,!0)}function getUserEducations(params){UserEducations.get(params).$promise.then(function(response){angular.isDefined(response.data)&&($scope.typeid="1",$scope.noRecords=response.data.length>0?!0:!1,$scope.my_educations=response.data,$scope._metadata=response._metadata,$scope.currentPage=response._metadata.current_page,$scope.maxSize=5)})}if($scope.noRecords=!1,$scope.typeid="1",$scope.user_educations=[],$scope.dateBlockeBefore=$filter("date")(new Date,"yyyy-MM-dd"),$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("My Educations")},"user_educations"===$state.current.name){$scope.currentPage=void 0!==$scope.currentPage?parseInt($scope.currentPage):1;var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+"}}",getUserEducations(params)}$scope.paginate=function(currentPage){var param={page:currentPage};getUserEducations(param),$("html, body").stop(!0,!0).animate({scrollTop:1200},600)},$scope.userEducation=function(isvalid,data){if(isvalid){var userProfileData={};if(userProfileData.user_id=$rootScope.auth.id,userProfileData.education=data.education,userProfileData.location=data.location,userProfileData.organization=data.organization,userProfileData.certification_date=$filter("date")(new Date(data.certification_date),"yyyy-MM-dd"),userProfileData.is_active=1,"1"===$scope.typeid)UserEducations.post(userProfileData).$promise.then(function(response){angular.isDefined(response)&&(0===parseInt(response.error.code)?($timeout(function(){$state.go("user_educations",{},{reload:!0})},500),flashMessage("Educations added successfully","success")):flashMessage("Please try again","error"))});else{var params={};params.id=$scope.data.educationId,UserEducationEditFactory.put($scope.data).$promise.then(function(response){angular.isDefined(response)&&(0===parseInt(response.error.code)?($timeout(function(){$state.go("user_educations",{},{reload:!0})},500),flashMessage("Educations updated successfully","success")):flashMessage("Please try again","error"))})}}},$scope.editUsereducation=function(value){var params={};params.id=value,UserEducationEditFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.data=response.data,$scope.typeid="2",$scope.data.educationId=value,$anchorScroll("friendtop"))})},$scope.removeUsereducation=function(id){SweetAlert.swal({title:"Are you sure want to delete?",text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes",cancelButtonText:"No",closeOnConfirm:!0,closeOnCancel:!0},function(isConfirm){if(isConfirm){var params={};params.id=id,UserEducationEditFactory["delete"](params).$promise.then(function(response){flash.set($filter("translate")("Education deleted successfully"),"success",!0),$state.reload()},function(error){flash.set($filter("translate")("Education could not be deleted"),"error",!1)})}})},$scope.index()}),angular.module("absApp").factory("UserEducations",["$resource",function($resource){return $resource("/api/v1/user_educations",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("UserEducationAdd",["$resource",function($resource){return $resource("/api/v1/user_profiles",{},{update:{method:"PUT"},get:{method:"GET"}})}]).factory("UserEducationEditFactory",["$resource",function($resource){return $resource("/api/v1/user_educations/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},"delete":{method:"DELETE"}})}]),angular.module("absApp.Common.UserEducations").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Common/UserEducations/views/default/user_educations.html",'

{{"Add Education" | translate }}

{{"Required" | translate }} {{"Minimum 3 character required" | translate }} {{"Maximum 25 Character" | translate }} {{"Enter a valid name without numbers" | translate }}
{{"Required" | translate }} {{"Minimum 1 Character" | translate }} {{"Maximum 100 Character" | translate }}
{{"Required" | translate }} {{"Minimum 1 Character" | translate }} {{"Maximum 200 Character" | translate }}
{{"Required" | translate }}

{{"My Educations" | translate }}

{{my_education.education}}

{{my_education.location | capitalize}}

{{my_education.organization | capitalize}}

{{my_education.certification_date}}

{{"No Records Found" | translate }}

')}]);angular.module('absApp').requires.push('absApp.Common.UserEducations');"use strict";angular.module("absApp.Common.UserFavorites",["ui.router","ngResource","oitozero.ngSweetAlert"]).config(function($stateProvider,$urlRouterProvider){}),angular.module("absApp.Common.UserFavorites").directive("userFavorite",function($timeout){return{restrict:"E",scope:{favorite:"@favorite",provideruser:"@provideruser",clinicuser:"@clinicuser",favoritetype:"@favoritetype"},controller:"UserFavoriteController",templateUrl:"scripts/plugins/Common/UserFavorites/views/default/favorite.html"}}).controller("UserFavoriteController",function($scope,$http,$filter,$state,$rootScope,$location,$timeout,flash,SweetAlert,UserFavorites,FavoriteDelete,MyUsers){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("My Doctors")},$scope.isFavorite=$scope.favorite,$scope.favorite_type=$scope.favoritetype,$scope.clinic_user_id=$scope.clinicuser,$scope.provider_user_id=parseInt($scope.provideruser),$scope.add_favorite=function(id,clinic_user_id,favorite_type){var data={};data.foreign_id=id,"branchFav"===favorite_type?(data["class"]="Branch",data.branch_id=id,data.clinic_user_id=clinic_user_id):data["class"]="User",UserFavorites.post(data).$promise.then(function(response){0===response.error.code?($state.go("my_favorites"),flash.set($filter("translate")("Favorite added successfully"),"success",!1)):flash.set($filter("translate")("Favorite added failed"),"error",!1)})},$scope.index()}),angular.module("absApp").factory("MyUsers",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("UserFavorites",["$resource",function($resource){return $resource("/api/v1/user_favorites",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("GetUserFavorite",["$resource",function($resource){return $resource("/api/v1/user_favorites",{id:"@id"},{get:{method:"GET"}})}]),angular.module("absApp.Common.UserFavorites").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Common/UserFavorites/views/default/favorite.html",'
'),$templateCache.put("scripts/plugins/Common/UserFavorites/views/default/favorite_add.html",' {{\'Add My Doctor\'| translate}} '),$templateCache.put("scripts/plugins/Common/UserFavorites/views/default/user_favorites.html",'

{{\'My Doctors\'| translate}}

{{doctor.user.user_profile.dr_title}} {{doctor.user.user_profile.first_name}} {{doctor.user.user_profile.last_name}}

{{doctor.user.user_profile.practice_name}}

{{doctor.user.user_profile.phone}}

{{\'No Favorite Added\' | translate}}

')}]);angular.module('absApp').requires.push('absApp.Common.UserFavorites');"use strict";angular.module("absApp.Common.Withdrawal",["ui.router","ngResource","angulartics","angulartics.google.analytics","angulartics.facebook.pixel"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("user_cash_withdrawals",{url:"/users/cash_withdrawals",templateUrl:"scripts/plugins/Common/Withdrawal/views/default/cash_withdrawals.html",resolve:getToken})}),angular.module("absApp.Common.Withdrawal").controller("CashWithdrawalsController",["$rootScope","$scope","cashWithdrawals","moneyTransferAccount","flash","$filter","$state","UserMeFactory","$location","myUserFactory",function($rootScope,$scope,cashWithdrawals,moneyTransferAccount,flash,$filter,$state,UserMeFactory,$location,myUserFactory){$rootScope.url_split=$location.path().split("/")[2],$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Cash Withdrawals"),$scope.minimum_withdraw_amount=$rootScope.settings.USER_MINIMUM_WITHDRAW_AMOUNT,$scope.maximum_withdraw_amount=$rootScope.settings.USER_MAXIMUM_WITHDRAW_AMOUNT,$scope.user_available_balance=$rootScope.user.available_wallet_amount,$scope.withDrawAmount=200,$scope.mul=$scope.withDrawAmount*$rootScope.settings.WITHDRAW_REQUEST_FEE,$scope.ExampleAmount=$scope.withDrawAmount-$rootScope.settings.WITHDRAW_REQUEST_FEE,$scope.total=$scope.mul/100,$scope.account_error=!1;var params={},cashparams={};params.user_id=$rootScope.user.id,cashparams.user_id=$rootScope.user.id,$scope.index=function(){$scope.loader=!0,UserMeFactory.get({},function(response){$scope.user_available_balance=response.data.available_wallet_amount,$scope.getMyuser(),0===parseInt($scope.user_available_balance)?$scope.is_show_wallet_paybtn=!1:$scope.is_show_wallet_paybtn=!0}),cashparams.filter='{"include":{"0":"money_transfer_account","1":"withdrawal_status"}}',cashWithdrawals.get(cashparams,function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.totalItems=response._metadata.total,$scope.itemsPerPage=response._metadata.per_page,$scope.noOfPages=response._metadata.last_page),angular.isDefined(response.data)&&($scope.cashWithdrawalsList=response.data),$scope.loader=!1}),moneyTransferAccount.get(params,function(response){angular.isDefined(response.data)&&($scope.moneyTransferList=response.data)})},$scope.selectedAcc=function(id){$scope.account_id=id,$scope.account_error=!1},$scope.getMyuser=function(){$rootScope.isAuth&&myUserFactory.get(function(response){$scope.my_user=response.data})},$scope.userCashWithdrawSubmit=function($valid){void 0===$scope.account_id?$scope.account_error=!0:$scope.account_error=!1,$valid&&$scope.account_error===!1&&($scope.amount=parseFloat($("#amount").val()),parseFloat($scope.user_available_balance)>$scope.amount?(params.amount=$scope.amount,params.money_transfer_account_id=$scope.account_id,params.remark="",cashWithdrawals.save(params,function(response){0===response.error.code&&($scope.my_user.available_wallet_amount=$scope.my_user.available_wallet_amount-parseInt($scope.amount),flash.set($filter("translate")("Your request submitted successfully."),"success",!0),$state.reload())},function(){flash.set($filter("translate")("Withdraw request could not be added"),"error",!1)})):flash.set("You Dont have sufficient amount in your wallet.","error",!1))},$scope.paginate=function(currentpg){$scope.currentPage=parseInt(currentpg),$scope.index()},$scope.index()}]),angular.module("absApp.Common.Withdrawal").factory("cashWithdrawals",["$resource",function($resource){return $resource("/api/v1/users/:user_id/user_cash_withdrawals",{},{get:{method:"GET",params:{user_id:"@user_id"}},save:{method:"POST",params:{user_id:"@user_id"}}})}]),angular.module("absApp.Common.Withdrawal").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Common/Withdrawal/views/default/cash_withdrawals.html",'
')}]);angular.module('absApp').requires.push('absApp.Common.Withdrawal');"use strict";angular.module("absApp.Common.Wallet",["ui.router","ngResource","angulartics","angulartics.google.analytics","angulartics.facebook.pixel"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("wallets",{url:"/wallets",templateUrl:"scripts/plugins/Common/Wallet/views/default/wallet.html",resolve:getToken})}),angular.module("absApp.Common.Wallet").controller("WalletController",function($rootScope,$scope,$window,Country,wallet,flash,$location,$filter,$state,paymentGateways,ConstPaymentGateways,UserMeFactory){$rootScope.url_split=$location.path().split("/")[1],$rootScope.header=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add to wallet"),$scope.minimum_wallet_amount=$rootScope.settings.WALLET_MIN_WALLET_AMOUNT,$scope.maximum_wallet_amount=$rootScope.settings.WALLET_MAX_WALLET_AMOUNT,$scope.buyer={},$scope.paynow_is_disabled=!1,$scope.payment_note_enabled=!1,$scope.payer_form_enabled=!0,$scope.is_wallet_page=!0,$scope.existing_new_address=1,$scope.user_address_id="",$scope.user_address_add={},$scope.save_btn=!1,$scope.first_gateway_id="",$scope.gatewayError="",$scope.index=function(){UserMeFactory.get({},function(response){$scope.user_available_balance=response.data.available_wallet_amount||0,0===parseInt($scope.user_available_balance)?$scope.is_show_wallet_paybtn=!1:$scope.is_show_wallet_paybtn=!0});var payment_gateways=[];paymentGateways.get({},function(payment_response){if(payment_response.PayPalREST){var response=payment_response.PayPalREST;response.paypalrest_enabled&&($scope.paypal_enabled=!0)}$scope.group_gateway_id="",0===payment_response.error.code&&void 0!==payment_response.zazpay&&(angular.forEach(payment_response.zazpay.gateways,function(gateway_group_value,gateway_group_key){0===gateway_group_key&&($scope.group_gateway_id=gateway_group_value.id,$scope.first_gateway_id=gateway_group_value.id),angular.forEach(gateway_group_value.gateways,function(payment_geteway_value,payment_geteway_key){var payment_gateway={},suffix="sp_";0===gateway_group_key&&($scope.sel_payment_gateway="sp_"+payment_geteway_value.id),suffix+=payment_geteway_value.id,payment_gateway.id=payment_geteway_value.id,payment_gateway.payment_id=suffix,payment_gateway.group_id=gateway_group_value.id,payment_gateway.display_name=payment_geteway_value.display_name,payment_gateway.thumb_url=payment_geteway_value.thumb_url,payment_gateway.suffix=payment_geteway_value._form_fields._extends_tpl.join(),payment_gateway.form_fields=payment_geteway_value._form_fields._extends_tpl.join(),payment_gateway.instruction_for_manual=payment_geteway_value.instruction_for_manual,payment_gateways.push(payment_gateway)})}),$scope.gateway_groups=payment_response.zazpay.gateways,$scope.payment_gateways=payment_gateways,$scope.form_fields_tpls=payment_response.zazpay._form_fields_tpls,$scope.show_form=[],$scope.form_fields=[],angular.forEach($scope.form_fields_tpls,function(key,value){"buyer"===value&&($scope.form_fields[value]="scripts/plugins/Wallet/views/default/buyer.html"),"credit_card"===value&&($scope.form_fields[value]="scripts/plugins/Wallet/views/default/credit_card.html"),"manual"===value&&($scope.form_fields[value]="scripts/plugins/Wallet/views/default/manual.html"),$scope.show_form[value]=!0}),$scope.gateway_id=ConstPaymentGateways.ZazPay)})},$scope.paneChanged=function(pane){"Manual / Offline"===pane&&($scope.payment_note_enabled=!0),"paypal"===pane&&($scope.gateway_id=ConstPaymentGateways.PayPal),$scope.defaultselect(pane);var keepGoing=!0;$scope.buyer={},$scope.PaymentForm.$setPristine(),$scope.PaymentForm.$setUntouched(),angular.forEach($scope.form_fields_tpls,function(key,value){$scope.show_form[value]=!1}),$scope.gateway_id=ConstPaymentGateways.ZazPay,angular.forEach($scope.gateway_groups,function(res){if(res.display_name===pane&&"Wallet"!==pane){var selPayment="";angular.forEach($scope.payment_gateways,function(response){keepGoing&&response.group_id===res.id&&(selPayment=response,keepGoing=!1,$scope.rdoclick(selPayment.id,selPayment.form_fields))}),$scope.sel_payment_gateway="sp_"+selPayment.id,$scope.group_gateway_id=selPayment.group_id}})},$scope.defaultselect=function(pane){var selectedTab,selectedPayment;$scope.gateways=[];var keepGoing=!0;angular.forEach($scope.gateway_groups,function(res){keepGoing&&res.display_name==pane&&(selectedTab=res,$scope.selectedTab=res,keepGoing=!1)}),keepGoing=!0,angular.forEach($scope.payment_gateways,function(res){keepGoing&&res.group_id==selectedTab.id&&(selectedPayment=res,keepGoing=!1,$scope.rdoclick(selectedPayment.id,selectedPayment.form_fields))}),$scope.gateways="sp_"+selectedPayment.id},$scope.rdoclick=function(res,res1){$scope.paynow_is_disabled=!1,$scope.sel_payment_gateway="sp_"+res,$scope.array=res1.split(","),angular.forEach($scope.array,function(value){$scope.show_form[value]=!0})},$scope.WalletFormSubmit=function(form){var payment_id="";if($scope.sel_payment_gateway&&$scope.gateway_id===ConstPaymentGateways.ZazPay&&(payment_id=$scope.sel_payment_gateway.split("_")[1]),$scope.buyer.user_id=$rootScope.user.id,$scope.buyer.amount=$scope.amount,$scope.buyer.payment_gateway_id=$scope.gateway_id,$scope.buyer.gateway_id=payment_id,angular.isDefined($scope.buyer.credit_card_expired)&&($scope.buyer.credit_card_expired.month||$scope.buyer.credit_card_expired.year)&&($scope.buyer.credit_card_expired.month>0&&$scope.buyer.credit_card_expired.month<10&&($scope.buyer.credit_card_expired.month="0"+$scope.buyer.credit_card_expired.month),$scope.buyer.credit_card_expire=$scope.buyer.credit_card_expired.month+"/"+$scope.buyer.credit_card_expired.year),form){$scope.paynow_is_disabled=!0;var flashMessage;wallet.create($scope.buyer,function(response){0===response.error.code?void 0!==response.redirect_url?$window.location.href=response.redirect_url:void 0!==response.payment_response.gateway_callback_url?$window.location.href=response.payment_response.gateway_callback_url:"Pending"===response.payment_response.status?(flashMessage=$filter("translate")("Your request is in pending."),flash.set(flashMessage,"error",!1),$state.reload()):"Captured"===response.payment_response.status?(flashMessage=$filter("translate")("Amount added successfully."),flash.set(flashMessage,"success",!1),$state.reload()):0===response.payment_response.error.code?(flashMessage=$filter("translate")("Payment successfully completed."),flash.set(flashMessage,"success",!1),$state.reload()):512===response.payment_response.error.code&&(flashMessage=$filter("translate")("Process Failed. Please, try again."),flash.set(flashMessage,"error",!1)):($scope.gatewayError=$filter("translate")(response.payment_response.error.message),flashMessage=$filter("translate")("Payment could not be completed.Please try again..."),flash.set(flashMessage,"error",!1)),$scope.paynow_is_disabled=!1},function(error){(angular.isDefined(error.payment_response.error.message)||null!==error.data.error.message)&&flash.set($filter("translate")(error.payment_response.error.message),"error",!1),$scope.paynow_is_disabled=!1})}},$scope.site_url=$location.absUrl().split("?")[1];var flashMessage;"error_code=0"===$scope.site_url&&(flashMessage=$filter("translate")("Payment successfully completed."),flash.set(flashMessage,"success",!1)),$scope.payNowPayPalClick=function(){var flashMessage;angular.isDefined($scope.amount)?($scope.buyer.user_id=$rootScope.user.id,$scope.buyer.amount=$scope.amount,$scope.buyer.payment_gateway_id=ConstPaymentGateways.PayPal,$scope.buyer.gateway_id=$scope.buyer.payment_gateway_id,$scope.paynow_is_disabled=!0,wallet.create($scope.buyer,function(response){0===response.error.code?void 0!==response.redirect_url?$window.location.href=response.redirect_url:void 0!==response.payment_response.gateway_callback_url?$window.location.href=response.payment_response.gateway_callback_url:"Pending"===response.payment_response.status?(flashMessage=$filter("translate")("Your request is in pending."),flash.set(flashMessage,"error",!1),$state.reload()):"Captured"===response.payment_response.status?(flashMessage=$filter("translate")("Amount added successfully."),flash.set(flashMessage,"success",!1),$state.reload()):0===response.payment_response.error.code?(flashMessage=$filter("translate")("Payment successfully completed."),flash.set(flashMessage,"success",!1),$state.reload()):512===response.payment_response.error.code&&(flashMessage=$filter("translate")("Process Failed. Please, try again."),flash.set(flashMessage,"error",!1)):($scope.gatewayError=$filter("translate")(response.payment_response.error.message),flashMessage=$filter("translate")("Payment could not be completed.Please try again..."),flash.set(flashMessage,"error",!1)),$scope.paynow_is_disabled=!1},function(error){(angular.isDefined(error.payment_response.error.message)||null!==error.data.error.message)&&flash.set($filter("translate")(error.payment_response.error.message),"error",!1),$scope.paynow_is_disabled=!1})):(flashMessage=$filter("translate")("please enter the valid amount."),flash.set(flashMessage,"error",!1))},Country.get({limit:"all"},function(response){angular.isDefined(response.data)&&($scope.countries=response.data)}),$scope.index()}).directive("amountDisplay",function(){return{templateUrl:"views/dynamic_currency.html",restrict:"EA",replace:"true",scope:"true",link:function(scope,element,attr){scope.amount=attr.amount}}}),angular.module("absApp.Common.Wallet").factory("wallet",["$resource",function($resource){return $resource("/api/v1/wallets",{},{create:{method:"POST"}})}]).factory("UserMeFactory",["$resource",function($resource){return $resource("/api/v1/me",{},{get:{method:"GET"}})}]).factory("paymentGateways",["$resource",function($resource){return $resource("/api/v1/payment_gateways/list",{},{get:{method:"GET"}})}]),angular.module("absApp.Common.Wallet").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Common/Wallet/views/default/buyer.html",'
{{\'Required\'|translate}}
{{\'Enter Valid Email\'|translate}}
{{\'Required\'|translate}}
{{\'Required\'|translate}}
{{\'Required\'|translate}}
{{\'Required\'|translate}}
{{\'Required\'|translate}}
{{\'Required\'|translate}}
'),$templateCache.put("scripts/plugins/Common/Wallet/views/default/credit_card.html",'
{{\'Required\'|translate}}
{{\'Required\'|translate}}
{{\'Please enter a future date\'|translate}}
{{\'Required\'|translate}}
{{\'Required\'|translate}}
'),$templateCache.put("scripts/plugins/Common/Wallet/views/default/gateway.html",'
{{gatewayError}}
  • {{\'Please enter your credit card details below\'|translate}}.

'),$templateCache.put("scripts/plugins/Common/Wallet/views/default/manual.html",'
{{\'Required\'|translate}}
'),$templateCache.put("scripts/plugins/Common/Wallet/views/default/wallet.html",'
')}]);angular.module('absApp').requires.push('absApp.Common.Wallet');"use strict";angular.module("absApp.Common.Contacts",["ui.router","ngResource","angulartics","angulartics.google.analytics","angulartics.facebook.pixel"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("clinic_contact",{url:"/contactus",templateUrl:"scripts/plugins/Common/Contacts/views/default/contacts.html",controller:"ContactUsController",resolve:getToken})}),angular.module("absApp").directive("contactLinks",function(){var linker=function(scope,element,attrs){};return{restrict:"A",replace:!0,templateUrl:"scripts/plugins/Common/Contacts/views/default/contact_links.html",link:linker,controller:"ContactUsController",bindToController:!0}}).controller("ContactUsController",function($scope,$rootScope,ContactsFactory,$filter,flash,$state,$location,vcRecaptchaService){$scope.init=function(){$rootScope.pageTitle=$rootScope.settings["site.name"]+" | "+$filter("translate")("Contact Us")},$scope.init(),$scope.contactFormSubmit=function(){$scope.emailErr="",$scope.captchaErr="",""===vcRecaptchaService.getResponse()?$scope.captchaErr=$filter("translate")("Please resolve the captcha and submit"):($scope.contactForm.recaptcha_response=vcRecaptchaService.getResponse(),ContactsFactory.post($scope.contactForm).$promise.then(function(response){flash.set($filter("translate")("Thank you for contacting us."),"success",!0),$scope.contactForm={},$scope.contactFormAdd.$setPristine(),$scope.contactFormAdd.$setUntouched()},function(error){var errMsg=error.data.errors;errMsg.email&&($scope.emailErr=$filter("translate")(errMsg.email[0])),flash.set($filter("translate")("Please try again later"),"error",!1)}))}}),angular.module("absApp").factory("ContactsFactory",["$resource",function($resource){return $resource("/api/v1/contacts",{},{post:{method:"POST"}})}]),angular.module("absApp.Common.Contacts").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Common/Contacts/views/default/contact_links.html","
  • {{'Contact Us' | translate}}
  • "),$templateCache.put("scripts/plugins/Common/Contacts/views/default/contacts.html",'
    ')}]);angular.module('absApp').requires.push('absApp.Common.Contacts');"use strict";angular.module("absApp.Common.Subscriptions",["ngResource"]).config(function($stateProvider,$urlRouterProvider){$urlRouterProvider.otherwise("/"),$stateProvider.state("SubscribePlans",{url:"/subscribe/plans?error_code",controller:"SubscribePlansController",templateUrl:"scripts/plugins/Common/Subscriptions/views/default/subscribe_plans.html"}).state("my_subscriptions",{url:"/subscriptions/all?error_code",controller:"SubscribePlansController",templateUrl:"scripts/plugins/Common/Subscriptions/views/default/subscribe_plans.html"})}),angular.module("absApp").controller("SubscribePlansController",function($scope,$state,$rootScope,$filter){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Plans")}).controller("subscriptionsPlanController",function($state,SubscriptionsPlans,$window,$scope,$rootScope,flash,$filter,GetSubscriptionDetail,paymentGateways,PaymentGatewayList,RaveSubscriptionCheckoutFactory,UserSubscriptionFactory,ConstSubscriptionStatuses,MyUserSubscription,SweetAlert,UpdateUserSubscription,$cookies,ConstPaymentGateways){function getGatewaysList(){$scope.loading=!1;var params={};params.filter='{"limit":"all", "skip":0}',PaymentGatewayList.get(params,function(payment_response){new Array;if($scope.gateway_count=0,payment_response.wallet&&($scope.wallet_enabled=!0,0===parseInt($scope.user_available_balance)?$scope.is_show_wallet_paybtn=!1:$scope.is_show_wallet_paybtn=!0,$scope.gateway_count=$scope.gateway_count+1),payment_response.PayPalREST){var response=payment_response.PayPalREST;response.paypalrest_enabled&&($scope.paypal_plugin_enabled=!0),$scope.gateway_count=$scope.gateway_count+1}if(payment_response.RaveByFlutterwave){var response=payment_response.RaveByFlutterwave;response.rave_enabled&&($scope.rave_plugin_enabled=!0,$scope.is_test_mode=response.is_test_mode,$scope.public_key=response.public_key),$scope.gateway_count=$scope.gateway_count+1}})}function getSubscriptionsPlans(){SubscriptionsPlans.get().$promise.then(function(response){$scope.subscription_plans=response,getGatewaysList(),$scope.subscription_loader=!1})}function getCurrentPlan(){var params={};params.filter={},params.filter.where={},params.filter.where.subscription_status_id=ConstSubscriptionStatuses.Active,MyUserSubscription.get(params).$promise.then(function(response){$scope.current_subscription_plans=response.data})}$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Subscriptions"),$scope.subscription_plans={},$scope.subscription_loader=!0,$scope.ConstSubscriptionStatuses=ConstSubscriptionStatuses,$scope.plan_selected=!1,0===parseInt($state.params.error_code)?flash.set($filter("translate")("Your subscription successfully completed."),"success",!1):1===parseInt($state.params.error_code)&&flash.set($filter("translate")("Unable to process your request. Please try again later."),"error",!1),getSubscriptionsPlans(),getCurrentPlan(),$scope.getSubscribePlan=function(plan_id){$scope.plan_selected=!0,$scope.loader=!0,GetSubscriptionDetail.get({id:plan_id}).$promise.then(function(response){$scope.subscriptions=response.data,$scope.selected_plan=plan_id,$scope.loader=!1})},$scope.rePlan=function(){$scope.plan_selected=!1},$scope.cancelPlan=function(user_subscription_id){SweetAlert.swal({title:$filter("translate")("Are you sure to cancel this subscription?"),text:"",type:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Confirm",cancelButtonText:"No",closeOnConfirm:!0,closeOnCancel:!0},function(isConfirm){if(isConfirm){var params={};params.id=user_subscription_id,params.subscription_status_id=ConstSubscriptionStatuses.Canceled,UpdateUserSubscription.put(params).$promise.then(function(response){0===response.error.code?(flash.set($filter("translate")("Subscription canceled successfully."),"success",!0),getCurrentPlan()):flash.set($filter("translate")("Subscription could not be canceled. Please try again."),"success",!0)})}})},$scope.paypal_paynow=function(need_to_pay){$scope.paynow_is_disabled=!0;var params={};params["class"]="Subscription",params.subscription_id=$scope.subscriptions.id,params.subscription_status_id=1,need_to_pay===!0&&(params.payment_gateway_id=ConstPaymentGateways.PayPal),UserSubscriptionFactory.post(params,function(response){var flashMessage;0===response.error.code?void 0!==response.redirect_url?$window.location.href=response.redirect_url:void 0!==response.gateway_callback_url?$window.location.href=response.gateway_callback_url:void 0!==response.status?"Pending"===response.status&&(flashMessage=$filter("translate")("Your request is in pending."),flash.set(flashMessage,"error",!1),$state.reload()):void 0!==response.status?"Captured"===response.status&&(flashMessage=$filter("translate")("Amount added successfully."),flash.set(flashMessage,"success",!1),$state.reload()):0===response.error.code?(void 0!==response.payment_response&&"Captured"===response.payment_response.status&&($scope.my_user.available_wallet_amount=$scope.my_user.available_wallet_amount-parseInt(response.total_listing_fee)),flashMessage=$filter("translate")("Booking successfully completed."),flash.set(flashMessage,"success",!1),$state.reload(),$state.go("user_dashboard"),$rootScope.AuthUserGet()):512===response.error.code&&(flashMessage=$filter("translate")("Process Failed. Please, try again."),flash.set(flashMessage,"error",!1)):(flashMessage=$filter("translate")("We are unable to process your request. Please try again."+response.error.message),flash.set(flashMessage,"error",!1)),$scope.paynow_is_disabled=!1})},$scope.payWithRave=function(){$scope.paynow_is_disabled=!0;var params={};params.subscription_id=$scope.subscriptions.id,params.subscription_status_id=1,UserSubscriptionFactory.post(params,function(user_subscription_response){$scope.user_subscription=user_subscription_response.data;var x=getpaidSetup({PBFPubKey:$scope.public_key,customer_email:$rootScope.auth.email,amount:$scope.subscriptions.price,customer_phone:$rootScope.auth.mobile,currency:$rootScope.settings.SITE_CURRENCY_CODE,country:"GH",txref:"user_subscription_id-"+$scope.user_subscription.id,payment_plan:$scope.subscriptions.rave_plan_id,payment_options:"card,mobilemoneyghana",onclose:function(){$scope.paynow_is_disabled=!1},callback:function(response){response.tx.txRef;"00"==response.tx.chargeResponseCode||"0"==response.tx.chargeResponseCode?$scope.paySuccess(response):$scope.payFailed(response),x.close(),$scope.plan_selected=!1}});$scope.paynow_is_disabled=!1})},$scope.paySuccess=function(payment_response){$scope.rave_data={},$scope.rave_data.user_subscription_id=$scope.user_subscription.id,$scope.rave_data.id=payment_response.tx.id,$scope.rave_data.txRef=payment_response.tx.txRef,$scope.rave_data.flwRef=payment_response.tx.flwRef,$scope.rave_data.response=JSON.stringify(payment_response);var flashMessage;RaveSubscriptionCheckoutFactory.post($scope.rave_data,function(response){$scope.paynow_is_disabled=!1,$scope.auth_user_detail=$cookies.getObject("auth"),$scope.auth_user_detail.is_plan_subscribed=1,$cookies.put("auth",JSON.stringify($scope.auth_user_detail),{path:"/"}),0===response.error.code?(flash.set($filter("translate")("Your subscription has been completed successfully."),"success",!0,8e3),angular.isDefined(response.data.id)&&getCurrentPlan()):512===response.error.code?flash.set($filter("translate")("Payment Failed. Please, try again."),"error",!1):(flashMessage=$filter("translate")("We are unable to place your order. Please try again."),""!==response.error.message&&(flashMessage=flashMessage+" Error: "+response.error.message),flash.set(flashMessage,"error",!1))},function(error){$scope.paynow_is_disabled=!1,flash.set($filter("translate")("We are unable to place your order. Please try again."),"error",!1)})},$scope.payFailed=function(payment_response){$scope.paynow_is_disabled=!1,flash.set($filter("translate")("Payment Failed. Please, try again."),"error",!1)},$scope.paymentGatewayUpdate=function(pane){$scope.payment_tab=pane}}),angular.module("absApp.Common.Subscriptions").directive("subscriptionsPlans",function(){var linker=function(){};return{restrict:"E",templateUrl:"scripts/plugins/Common/Subscriptions/views/default/subscriptions_plans.html",link:linker,controller:"",bindToController:!0}}),angular.module("absApp").factory("SubscriptionsPlans",["$resource",function($resource){return $resource("/api/v1/subscriptions",{},{get:{method:"GET"}})}]).factory("GetSubscriptionDetail",["$resource",function($resource){return $resource("/api/v1/subscriptions/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("subscribePayNow",["$resource",function($resource){return $resource("/api/v1/subscriptions/payment",{},{create:{method:"POST"}})}]).factory("UserSubscriptionFactory",["$resource",function($resource){return $resource("/api/v1/user_subscriptions",{},{post:{method:"POST"}})}]).factory("Countries",["$resource",function($resource){return $resource("/api/v1/countries",{},{get:{method:"GET"}})}]).factory("MeSubscriptions",["$resource",function($resource){return $resource("/api/v1/me/subscriptions",{},{get:{method:"GET"}})}]).factory("UserSubscriptionsDetail",["$resource",function($resource){return $resource("/api/v1/users/:id/user_subscription_logs",{},{get:{method:"GET"}})}]).factory("UpdateUserSubscriptions",["$resource",function($resource){return $resource("/api/v1/user_subscriptions/:id",{id:"@id"},{update:{method:"PUT"}})}]).factory("CCCardData",["$resource",function($resource){return $resource("/api/v1/users/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("UserSubscriptionsPayment",["$resource",function($resource){return $resource("/api/v1/user_subscriptions",{},{create:{method:"POST"}})}]).factory("MyUserSubscription",["$resource",function($resource){return $resource("/api/v1/me/user_subscriptions",{},{get:{method:"GET"}})}]).factory("UpdateUserSubscription",["$resource",function($resource){return $resource("/api/v1/user_subscriptions/:id/update_status",{id:"@id"},{put:{method:"PUT"}})}]),angular.module("absApp.Common.Subscriptions").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Common/Subscriptions/views/default/my_subscription.html",'

    {{\'My Subscriptions\'|translate}}

    '),$templateCache.put("scripts/plugins/Common/Subscriptions/views/default/subscribe_plans.html",'
    '),$templateCache.put("scripts/plugins/Common/Subscriptions/views/default/subscriptions_payment.html",'
    {{\'Confirm Your Subscription Payment\'|translate}}
    '),$templateCache.put("scripts/plugins/Common/Subscriptions/views/default/subscriptions_plans.html",'

    {{\'You have accessing free membership subscription now.\' | translate}}

    {{\'It will expired on:\' | translate}} {{current_subscription_plans[0].expiry_date | dateFormat}}

    {{\'After plan expiry, your profile will not list in website until you renewal.\' | translate}} {{current_subscription_plans[0].expiry_date | dateFormat}}

    {{\'You currently don\\\'t have subscribe any membership plan. So your listing will not display in website until you subscribe.\' | translate}}

    {{plan.name}} - {{plan.interval_period}} {{plan.interval_unit}}

    {{\'Select\'| translate}} {{\'Cancel this Subscription\' | translate}}

    {{\'Confirm your Payment\'| translate}}

    {{subscriptions.name}}

    {{subscriptions.price | currency : $root.settings.CURRENCY_SYMBOL : 2}} / {{subscriptions.interval_unit}}

    ')}]);angular.module('absApp').requires.push('absApp.Common.Subscriptions');"use strict";angular.module("absApp.Common.Payment",["ngResource","ngSanitize","satellizer","ngAnimate","ui.router"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("AppointmentPayment",{url:"/appointments/order/:id",templateUrl:"scripts/plugins/Common/Payment/views/appointment_payment.html",controller:"AppointmentPaymentController",resolve:getToken})}),angular.module("absApp").controller("AppointmentPaymentController",function($scope,$state,$window,$filter,$rootScope,$location,AppointmentView,flash,ConstUserType,ConstAppointmentStatus,Slug,ConstPaymentGateways,PaymentGatewayList,PaymentOrder){$scope.maxSize=5,$scope.user={},$scope.paynow_is_disabled=!1,$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Pay Appointment Fee");var params={};params.filter='{"include":{"0":"user.user_profile","1":"provider_user.user_profile.city","2":"provider_user.user_profile.state","3":"clinic_user","4":"book_by_user.user_profile","5":"branch.city"}}',params.id=$state.params.id,AppointmentView.get(params).$promise.then(function(response){$scope.appointment=response.data});var params={};params.filter='{"limit":"all", "skip":0}',PaymentGatewayList.get(params,function(payment_response){new Array;if($scope.gateway_count=0,payment_response.wallet&&($scope.wallet_enabled=!0,0===parseInt($scope.user_available_balance)?$scope.is_show_wallet_paybtn=!1:$scope.is_show_wallet_paybtn=!0,$scope.gateway_count=$scope.gateway_count+1),payment_response.PayPalREST){var response=payment_response.PayPalREST;response.paypalrest_enabled&&($scope.paypal_plugin_enabled=!0),$scope.gateway_count=$scope.gateway_count+1}})},$scope.paypal_paynow=function(need_to_pay){$scope.paynow_is_disabled=!0;var params={};params["class"]="Appointment",params.foreign_id=$state.params.id,params.amount=$scope.appointment.consultation_fee,need_to_pay===!0&&(params.payment_gateway_id=ConstPaymentGateways.PayPal),PaymentOrder.post(params,function(response){var flashMessage;0===response.error.code?void 0!==response.redirect_url?$window.location.href=response.redirect_url:void 0!==response.gateway_callback_url?$window.location.href=response.gateway_callback_url:void 0!==response.status?"Pending"===response.status&&(flashMessage=$filter("translate")("Your request is in pending."),flash.set(flashMessage,"error",!1),$state.reload()):void 0!==response.status?"Captured"===response.status&&(flashMessage=$filter("translate")("Amount added successfully."),flash.set(flashMessage,"success",!1),$state.reload()):0===response.error.code?(void 0!==response.payment_response&&"Captured"===response.payment_response.status&&($scope.my_user.available_wallet_amount=$scope.my_user.available_wallet_amount-parseInt(response.total_listing_fee)),flashMessage=$filter("translate")("Booking successfully completed."),flash.set(flashMessage,"success",!1),$state.reload(),$state.go("user_dashboard"),$rootScope.AuthUserGet()):512===response.error.code&&(flashMessage=$filter("translate")("Process Failed. Please, try again."),flash.set(flashMessage,"error",!1)):(flashMessage=$filter("translate")("We are unable to process your request. Please try again."+response.error.message),flash.set(flashMessage,"error",!1)),$scope.paynow_is_disabled=!1})},$scope.payWithRave=function(){$scope.paynow_is_disabled=!0;var x=getpaidSetup({PBFPubKey:$scope.public_key,customer_email:$rootScope.auth.email,amount:$scope.appointment.consultation_fee,customer_phone:$rootScope.auth.mobile,currency:$rootScope.settings.SITE_CURRENCY_CODE,country:"GH",txref:"appointment_id-"+$state.params.id,payment_options:"card,mobilemoneyghana",onclose:function(){$scope.paynow_is_disabled=!1},callback:function(response){response.tx.txRef;"00"==response.tx.chargeResponseCode||"0"==response.tx.chargeResponseCode?$scope.paySuccess(response):$scope.payFailed(response),x.close()}});$scope.paynow_is_disabled=!1},$scope.paySuccess=function(payment_response){$scope.rave_data={},$scope.rave_data.id=$state.params.id,$scope.rave_data.txRef=payment_response.tx.txRef,$scope.rave_data.flwRef=payment_response.tx.flwRef,$scope.rave_data.response=JSON.stringify(payment_response);var flashMessage;RaveSuccessCheckoutFactory.put($scope.rave_data,function(response){$scope.paynow_is_disabled=!1,0===response.error.code?(flash.set($filter("translate")("Your payment has been completed successfully."),"success",!0,8e3),angular.isDefined(response.data.id)&&$location.path("/appointment/"+response.data.id+"/"+response.data.appointment_token)):512===response.error.code?flash.set($filter("translate")("Payment Failed. Please, try again."),"error",!1):(flashMessage=$filter("translate")("We are unable to place your order. Please try again."),""!==response.error.message&&(flashMessage=flashMessage+" Error: "+response.error.message),flash.set(flashMessage,"error",!1))},function(error){$scope.paynow_is_disabled=!1,flash.set($filter("translate")("We are unable to place your order. Please try again."),"error",!1)})},$scope.payFailed=function(payment_response){$scope.paynow_is_disabled=!1,flash.set($filter("translate")("Payment Failed. Please, try again."),"error",!1)},$scope.index()}),angular.module("absApp").factory("PaymentGatewaySingle",["$resource",function($resource){return $resource("/api/v1/payment_gateway_settings/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("PaymentGatewayList",["$resource",function($resource){return $resource("/api/v1/payment_gateways/list",{},{get:{method:"GET"}})}]).factory("PaymentOrder",["$resource",function($resource){return $resource("/api/v1/order",{},{post:{method:"POST"}})}]),angular.module("absApp.Common.Payment").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Common/Payment/views/appointment_payment.html",'

    {{\'Pay Appointment Fee\' | translate}}

    {{\'Appointment Requested On\' | translate}} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_time}}
    {{\'Doctor Name\' | translate}} {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}}
    {{\'Where\' | translate}} {{appointment.clinic_user.user_profile.display_name}}, {{appointment.branch.name}}, {{appointment.branch.city.name}} {{appointment.provider_user.user_profile.address}}, {{appointment.provider_user.user_profile.city.name}}, {{appointment.provider_user.user_profile.state.name}}
    {{\'Consultation Fee\' | translate}} {{$root.settings.CURRENCY_SYMBOL}}{{appointment.consultation_fee}}
    ')}]);angular.module('absApp').requires.push('absApp.Common.Payment');"use strict";angular.module("absApp.Common.PayPal",["ngResource","ngSanitize","satellizer","ngAnimate","ui.router"]).config(function($stateProvider,$urlRouterProvider){$urlRouterProvider.otherwise("/")});angular.module('absApp').requires.push('absApp.Common.PayPal');"use strict";angular.module("absApp.Common.RaveByFlutterwave",["ngResource","ngSanitize","satellizer","ngAnimate","ui.router"]),angular.module("absApp.Common.RaveByFlutterwave").directive("loadSandboxScript",function(){return function(scope,element,attrs){angular.element('').appendTo(element)}}).directive("loadLiveScript",function(){return function(scope,element,attrs){angular.element('').appendTo(element)}}),angular.module("absApp").factory("RaveSuccessCheckoutFactory",["$resource",function($resource){return $resource("/api/v1/appointments/rave_payment_success/:id",{id:"@id"},{put:{method:"PUT"}})}]).factory("RaveSuccessCheckoutFactoryForDiagnostic",["$resource",function($resource){return $resource("/api/v1/patient_diagnostic_tests/rave_payment_success/:id",{id:"@id"},{put:{method:"PUT"}})}]).factory("RaveSubscriptionCheckoutFactory",["$resource",function($resource){return $resource("/api/v1/user_subscription_logs/rave_payment_success",{},{post:{method:"POST"}})}]);angular.module('absApp').requires.push('absApp.Common.RaveByFlutterwave');"use strict";angular.module("absApp.Clinic.Clinic",["ngResource","ngSanitize","satellizer","ngAnimate","ui.bootstrap","ui.router","angular-growl","google.places","ngCookies","angular-md5","ui.select","angulartics","pascalprecht.translate","angulartics.google.analytics","tmh.dynamicLocale","ngMap","chieffancypants.loadingBar","angularMoment","ngFileUpload","slugifier","ngTagsInput"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("clinic_profile",{url:"/clinic/:id/:slug",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/clinic_profile.html",controller:"ClinicController",resolve:getToken}).state("branches",{url:"/branches?page",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branches.html",controller:"BranchesController",resolve:getToken}).state("my_branches",{url:"/doctor/branches?page",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/my_branches.html",controller:"BranchesController",resolve:getToken}).state("branch_add",{url:"/branch/add",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_add.html",controller:"BranchesAddController",resolve:getToken}).state("branch_edit",{url:"/branch/edit/:id",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_edit.html",controller:"BranchesEditController",resolve:getToken}).state("branch_view",{url:"/branches/:id/:slug",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_profile.html",resolve:getToken}).state("branch_doctors",{url:"/branch/doctors/:branch_id?page",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_doctors.html",controller:"BranchesDoctorsController",resolve:getToken}).state("branch_doctor_add",{url:"/doctors/add/:branch_id",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_doctors_add.html",controller:"BranchesDoctorsAddController",resolve:getToken}).state("branch_doctor_edit",{url:"/doctors/edit/:id",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_doctors_edit.html",controller:"BranchesDoctorsEditController",resolve:getToken}).state("appointment_setting",{url:"/branch/doctor/:branch_id/:user_id/:apt_set_id/appoinmentsettings",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/appoinment_settings.html",controller:"BranchesDoctorsController",resolve:getToken}).state("appointment_modification",{url:"/branch/doctor/:branch_id/:user_id/:apt_set_id/appoinmentmodification",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/appointment_modification.html",controller:"BranchesDoctorsController",resolve:getToken}).state("appointment_modification_add",{url:"/branch/doctor/:branch_id/:user_id/:apt_set_id/appoinmentmodification/add",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/appointment_modification_add.html",controller:"BranchesDoctorsController",resolve:getToken}).state("appointment_modification_edit",{url:"/branch/doctor/:id/:branch_id/:user_id/:apt_set_id/appoinmentmodification/update",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/appointment_modification_edit.html",controller:"BranchesDoctorsController",resolve:getToken}).state("AppointmentView",{url:"/clinic/appointment/{id}",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/appointment_view.html",controller:"ClinicAppointmentsController",resolve:getToken}).state("branch_users",{url:"/branch/users/:branch_id",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_users.html",controller:"BranchesUsersController",resolve:getToken}).state("branch_user_add",{url:"/users/add/:branch_id",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_users_add.html",controller:"BranchesUsersAddController",resolve:getToken}).state("branch_user_edit",{url:"/users/edit/:id",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branch_users_edit.html",controller:"BranchesUsersEditController",resolve:getToken}).state("clinic_dashboard",{url:"/clinic/dashboard",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/clinic_dashboard.html",controller:"ClinicDashboardController",resolve:getToken}).state("my_doctors",{url:"/clinic/doctors?page",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/my_doctors.html",controller:"BranchesDoctorsController",resolve:getToken}).state("my_users",{url:"/clinic/users?page",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/my_users.html",controller:"BranchesUsersController",resolve:getToken}).state("account_info",{url:"/account_info",templateUrl:"views/account_info.html",controller:"PaymentAccountsController",resolve:getToken}).state("news_feeds",{url:"/clinic/news_feeds?page",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/news_feeds.html",controller:"NewsFeedsController",resolve:getToken}).state("news_feeds_add",{url:"/news_feeds/add",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/news_feeds_add.html",controller:"NewsFeedsController",resolve:getToken}).state("news_feeds_edit",{url:"/news_feeds/edit/:id",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/news_feeds_edit.html",controller:"NewsFeedsController",resolve:getToken}).state("news_feeds_view",{url:"/news_feeds/:id/:slug",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/news_feeds_view.html",controller:"NewsFeedsController",resolve:getToken})}),angular.module("absApp").controller("BranchesDoctorsController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,MyDoctorsFactory,SweetAlert,RemoveDoctor,BranchesEdit,UserById,AppoinmentSettingsService,AppoinmentModificationService,splitedTimeSlot,AppoinmentModifications){function getAppoinmentModification(branch_id,user_id){var params={};params.filter='{"where":{"branch_id":'+branch_id+',"user_id":'+user_id+"}}",AppoinmentModificationService.get(params).$promise.then(function(response){$scope.appoinmentModification=response.data,$scope.dataLength=response.data.length>0?!0:!1})}function addAppoinmentModification(data){AppoinmentModificationService.post(data).$promise.then(function(response){angular.isDefined(response)&&(0===response.error.code?($timeout(function(){$state.go("appointment_modification",{branch_id:$state.params.branch_id,user_id:$state.params.user_id,apt_set_id:$state.params.apt_set_id},{reload:!0})},500),flash.set($filter("translate")("Appoinment modification added successfully."),"success",!0)):response.Failed?flash.set($filter("translate")("Please try again."),"error",!1):flash.set($filter("translate")("Please try again."),"error",!1))})}function fnDeleteWorkPlace(id){SweetAlert.swal({title:$filter("translate")("Are you sure to want to delete?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Confirm",cancelButtonText:"No",closeOnConfirm:!0,closeOnCancel:!0},function(isConfirm){AppoinmentModifications["delete"]({id:id}).$promise.then(function(response){flash.set($filter("translate")("Appoinment modification deleted successfully."),"success",!0),$timeout(function(){$state.reload()},500)},function(error){flash.set($filter("translate")("Appoinment modification could not be deleted, Please try again."),"error",!1)})})}function getTimeSlot(apt_settings_id){params.apt_settings_id=apt_settings_id,splitedTimeSlot.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.timeSlot=response.data,$scope.timeSlotLength=response.data.length>0?!0:!1)})}function getBranchById(id){var params={};params.id=id,params.filter='{"fields":{"id":true,"name":true}}',BranchesEdit.get(params).$promise.then(function(response){angular.isDefined(response)&&(response.Failed?flashMessage(response.Failed,"error"):$scope.branch=response.data)})}function getDoctorById(id){var params={};params.id=id,params.filter='{"fields":{"id":true,"username":true}}',UserById.get(params).$promise.then(function(response){angular.isDefined(response)&&(response.Failed?flashMessage(response.Failed,"error"):$scope.user=response.data)})}function calendarSlots(){$scope.calendarSlots=[],$scope.calendarSlots.push({id:5,name:"5 minutes"},{id:10,name:"10 minutes"},{id:15,name:"15 minutes"},{id:20,name:"20 minutes"},{id:25,name:"25 minutes"},{id:30,name:"30 minutes"},{id:35,name:"35 minutes"},{id:40,name:"40 minutes"},{id:45,name:"45 minutes"},{id:50,name:"50 minutes"},{id:55,name:"55 minutes"},{id:60,name:"60 minutes"})}function checkASettingsResponse(value){return 1===parseInt(value)?!0:!1}function changeTimeFormat(value){return value?"1970-01-01T"+$filter("date")(value,"HH:mm"):null}function updateTimeFormat(value){return value?$filter("date")(value,"HH:mm:ss"):null}function getAppointmentSettingsData(branchid,userid,apt_set_id){params.filter='{"where":{"branch_id":'+branchid+',"user_id":'+userid+',"id":'+apt_set_id+"}}",AppoinmentSettingsService.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.settingValue=response.data[0],$scope.settingValue.calendar_slot_id=parseInt(response.data[0].calendar_slot_id),$scope.settingValue.is_today_first_day=checkASettingsResponse(response.data[0].is_today_first_day),$scope.settingValue.is_two_session=checkASettingsResponse(response.data[0].is_two_session),$scope.settingValue.practice_open=changeTimeFormat(response.data[0].practice_open),$scope.settingValue.practice_close=changeTimeFormat(response.data[0].practice_close),$scope.settingValue.lunch_at=changeTimeFormat(response.data[0].lunch_at),$scope.settingValue.resume_at=changeTimeFormat(response.data[0].resume_at),$scope.settingValue.sunday_practice_open=changeTimeFormat(response.data[0].sunday_practice_open),$scope.settingValue.sunday_practice_close=changeTimeFormat(response.data[0].sunday_practice_close),$scope.settingValue.sunday_lunch_at=changeTimeFormat(response.data[0].sunday_lunch_at),$scope.settingValue.sunday_resume_at=changeTimeFormat(response.data[0].sunday_resume_at),$scope.settingValue.monday_practice_open=changeTimeFormat(response.data[0].monday_practice_open),$scope.settingValue.monday_practice_close=changeTimeFormat(response.data[0].monday_practice_close),$scope.settingValue.monday_lunch_at=changeTimeFormat(response.data[0].monday_lunch_at),$scope.settingValue.monday_resume_at=changeTimeFormat(response.data[0].monday_resume_at),$scope.settingValue.tuesday_practice_open=changeTimeFormat(response.data[0].tuesday_practice_open),$scope.settingValue.tuesday_practice_close=changeTimeFormat(response.data[0].tuesday_practice_close),$scope.settingValue.tuesday_lunch_at=changeTimeFormat(response.data[0].tuesday_lunch_at),$scope.settingValue.tuesday_resume_at=changeTimeFormat(response.data[0].tuesday_resume_at),$scope.settingValue.wednesday_practice_open=changeTimeFormat(response.data[0].wednesday_practice_open),$scope.settingValue.wednesday_practice_close=changeTimeFormat(response.data[0].wednesday_practice_close),$scope.settingValue.wednesday_lunch_at=changeTimeFormat(response.data[0].wednesday_lunch_at),$scope.settingValue.wednesday_resume_at=changeTimeFormat(response.data[0].wednesday_resume_at),$scope.settingValue.thursday_practice_open=changeTimeFormat(response.data[0].thursday_practice_open),$scope.settingValue.thursday_practice_close=changeTimeFormat(response.data[0].thursday_practice_close),$scope.settingValue.thursday_lunch_at=changeTimeFormat(response.data[0].thursday_lunch_at),$scope.settingValue.thursday_resume_at=changeTimeFormat(response.data[0].thursday_resume_at),$scope.settingValue.friday_practice_open=changeTimeFormat(response.data[0].friday_practice_open),$scope.settingValue.friday_practice_close=changeTimeFormat(response.data[0].friday_practice_close),$scope.settingValue.friday_lunch_at=changeTimeFormat(response.data[0].friday_lunch_at),$scope.settingValue.friday_resume_at=changeTimeFormat(response.data[0].friday_resume_at),$scope.settingValue.saturday_practice_open=changeTimeFormat(response.data[0].saturday_practice_open),$scope.settingValue.saturday_practice_close=changeTimeFormat(response.data[0].saturday_practice_close),$scope.settingValue.saturday_lunch_at=changeTimeFormat(response.data[0].saturday_lunch_at),$scope.settingValue.saturday_resume_at=changeTimeFormat(response.data[0].saturday_resume_at),$scope.settingValue.type=checkASettingsResponse(response.data[0].type),$scope.settingValue.is_sunday_open=checkASettingsResponse(response.data[0].is_sunday_open),$scope.settingValue.sunday_two_session=checkASettingsResponse(response.data[0].sunday_two_session),$scope.settingValue.is_monday_open=checkASettingsResponse(response.data[0].is_monday_open),$scope.settingValue.monday_two_session=checkASettingsResponse(response.data[0].monday_two_session),$scope.settingValue.is_tuesday_open=checkASettingsResponse(response.data[0].is_tuesday_open),$scope.settingValue.tuesday_two_session=checkASettingsResponse(response.data[0].tuesday_two_session),$scope.settingValue.is_wednesday_open=checkASettingsResponse(response.data[0].is_wednesday_open),$scope.settingValue.wednesday_two_session=checkASettingsResponse(response.data[0].wednesday_two_session),$scope.settingValue.is_thursday_open=checkASettingsResponse(response.data[0].is_thursday_open),$scope.settingValue.thursday_two_session=checkASettingsResponse(response.data[0].thursday_two_session),$scope.settingValue.is_friday_open=checkASettingsResponse(response.data[0].is_friday_open),$scope.settingValue.friday_two_session=checkASettingsResponse(response.data[0].friday_two_session),$scope.settingValue.is_saturday_open=checkASettingsResponse(response.data[0].is_saturday_open),$scope.settingValue.saturday_two_session=checkASettingsResponse(response.data[0].saturday_two_session),$scope.settingValue.is_active=checkASettingsResponse(response.data[0].is_active))})}function updateAppointmnetSettings(data){delete data.created_at,delete data.updated_at,data.practice_open=updateTimeFormat(data.practice_open),data.practice_close=updateTimeFormat(data.practice_close),data.lunch_at=updateTimeFormat(data.lunch_at),data.resume_at=updateTimeFormat(data.resume_at),data.sunday_practice_open=updateTimeFormat(data.sunday_practice_open),data.sunday_practice_close=updateTimeFormat(data.sunday_practice_close),data.sunday_lunch_at=updateTimeFormat(data.sunday_lunch_at),data.sunday_resume_at=updateTimeFormat(data.sunday_resume_at),data.monday_practice_open=updateTimeFormat(data.monday_practice_open),data.monday_practice_close=updateTimeFormat(data.monday_practice_close),data.monday_lunch_at=updateTimeFormat(data.monday_lunch_at),data.monday_resume_at=updateTimeFormat(data.monday_resume_at),data.tuesday_practice_open=updateTimeFormat(data.tuesday_practice_open),data.tuesday_practice_close=updateTimeFormat(data.tuesday_practice_close),data.tuesday_lunch_at=updateTimeFormat(data.tuesday_lunch_at),data.tuesday_resume_at=updateTimeFormat(data.tuesday_resume_at),data.wednesday_practice_open=updateTimeFormat(data.wednesday_practice_open),data.wednesday_practice_close=updateTimeFormat(data.wednesday_practice_close),data.wednesday_lunch_at=updateTimeFormat(data.wednesday_lunch_at),data.wednesday_resume_at=updateTimeFormat(data.wednesday_resume_at),data.thursday_practice_open=updateTimeFormat(data.thursday_practice_open),data.thursday_practice_close=updateTimeFormat(data.thursday_practice_close),data.thursday_lunch_at=updateTimeFormat(data.thursday_lunch_at),data.thursday_resume_at=updateTimeFormat(data.thursday_resume_at),data.friday_practice_open=updateTimeFormat(data.friday_practice_open),data.friday_practice_close=updateTimeFormat(data.friday_practice_close),data.friday_lunch_at=updateTimeFormat(data.friday_lunch_at),data.friday_resume_at=updateTimeFormat(data.friday_resume_at),data.saturday_practice_open=updateTimeFormat(data.saturday_practice_open),data.saturday_practice_close=updateTimeFormat(data.saturday_practice_close),data.saturday_lunch_at=updateTimeFormat(data.saturday_lunch_at),data.saturday_resume_at=updateTimeFormat(data.saturday_resume_at),AppoinmentSettingsService.put(data).$promise.then(function(response){0===parseInt(response.error.code)?($scope.open_lunch=$scope.resume_close=$scope.lunch_resume=$scope.open_close=$scope.sunday_open_lunch=$scope.sunday_resume_close=$scope.sunday_lunch_resume=$scope.sunday_open_close=$scope.monday_open_lunch=$scope.monday_resume_close=$scope.monday_lunch_resume=$scope.monday_open_close=$scope.tuesday_open_lunch=$scope.tuesday_resume_close=$scope.tuesday_lunch_resume=$scope.tuesday_open_close=$scope.wednesday_open_lunch=$scope.wednesday_resume_close=$scope.wednesday_lunch_resume=$scope.wednesday_open_close=$scope.thursday_open_lunch=$scope.thursday_resume_close=$scope.thursday_lunch_resume=$scope.thursday_open_close=$scope.friday_open_lunch=$scope.friday_resume_close=$scope.friday_lunch_resume=$scope.friday_open_close=$scope.saturday_open_lunch=$scope.saturday_resume_close=$scope.saturday_lunch_resume=$scope.saturday_open_close=!1,$timeout(function(){$state.go("branch_doctors",{branch_id:response.data.branch.id},{reload:!0})},500),flash.set($filter("translate")("Appoinment Settings updated successfully."),"success",!0)):flash.set($filter("translate")(response.error.message),"error",!1)},function(response){$scope.settingValue.practice_open=changeTimeFormat($scope.settingValue.practice_open),$scope.settingValue.practice_close=changeTimeFormat($scope.settingValue.practice_close),$scope.error=response.data.error.fields,$scope.settingValue.type?($scope.settingValue.is_sunday_open&&($scope.settingValue.sunday_two_session?(void 0!==$scope.error.sunday_open_lunch?$scope.sunday_open_lunch=$filter("translate")($scope.error.sunday_open_lunch):$scope.sunday_open_lunch=!1,void 0!==$scope.error.sunday_lunch_resume?$scope.sunday_lunch_resume=$filter("translate")($scope.error.sunday_lunch_resume):$scope.sunday_lunch_resume=!1,void 0!==$scope.error.sunday_resume_close?$scope.sunday_resume_close=$filter("translate")($scope.error.sunday_resume_close):$scope.sunday_resume_close=!1):($scope.sunday_resume_close=!1,void 0!==$scope.error.sunday_open_close?$scope.sunday_open_close=$filter("translate")($scope.error.sunday_open_close):$scope.sunday_open_close=!1)),$scope.settingValue.is_monday_open&&($scope.settingValue.monday_two_session?(void 0!==$scope.error.monday_open_lunch?$scope.monday_open_lunch=$filter("translate")($scope.error.sunday_open_lunch):$scope.monday_open_lunch=!1,void 0!==$scope.error.monday_lunch_resume?$scope.monday_lunch_resume=$filter("translate")($scope.error.monday_lunch_resume):$scope.monday_lunch_resume=!1,void 0!==$scope.error.monday_resume_close?$scope.monday_resume_close=$filter("translate")($scope.error.monday_resume_close):$scope.monday_resume_close=!1):($scope.monday_resume_close=!1,void 0!==$scope.error.monday_open_close?$scope.monday_open_close=$filter("translate")($scope.error.monday_open_close):$scope.monday_open_close=!1)),$scope.settingValue.is_tuesday_open&&($scope.settingValue.tuesday_two_session?(void 0!==$scope.error.tuesday_open_lunch?$scope.tuesday_open_lunch=$filter("translate")($scope.error.tuesday_open_lunch):$scope.tuesday_open_lunch=!1,void 0!==$scope.error.tuesday_lunch_resume?$scope.tuesday_lunch_resume=$filter("translate")($scope.error.tuesday_lunch_resume):$scope.tuesday_lunch_resume=!1,void 0!==$scope.error.tuesday_resume_close?$scope.tuesday_resume_close=$filter("translate")($scope.error.tuesday_resume_close):$scope.tuesday_resume_close=!1):($scope.tuesday_resume_close=!1,void 0!==$scope.error.tuesday_open_close?$scope.tuesday_open_close=$filter("translate")($scope.error.tuesday_open_close):$scope.tuesday_open_close=!1)),$scope.settingValue.is_wednesday_open&&($scope.settingValue.wednesday_two_session?(void 0!==$scope.error.wednesday_open_lunch?$scope.wednesday_open_lunch=$filter("translate")($scope.error.wednesday_open_lunch):$scope.wednesday_open_lunch=!1,void 0!==$scope.error.wednesday_lunch_resume?$scope.wednesday_lunch_resume=$filter("translate")($scope.error.wednesday_lunch_resume):$scope.wednesday_lunch_resume=!1,void 0!==$scope.error.wednesday_resume_close?$scope.wednesday_resume_close=$filter("translate")($scope.error.wednesday_resume_close):$scope.wednesday_resume_close=!1):($scope.wednesday_resume_close=!1,void 0!==$scope.error.wednesday_open_close?$scope.wednesday_open_close=$filter("translate")($scope.error.wednesday_open_close):$scope.wednesday_open_close=!1)),$scope.settingValue.is_thursday_open&&($scope.settingValue.thursday_two_session?(void 0!==$scope.error.thursday_open_lunch?$scope.thursday_open_lunch=$filter("translate")($scope.error.thursday_open_lunch):$scope.thursday_open_lunch=!1,void 0!==$scope.error.thursday_lunch_resume?$scope.thursday_lunch_resume=$filter("translate")($scope.error.thursday_lunch_resume):$scope.thursday_lunch_resume=!1,void 0!==$scope.error.thursday_resume_close?$scope.thursday_resume_close=$filter("translate")($scope.error.thursday_resume_close):$scope.thursday_resume_close=!1):($scope.thursday_resume_close=!1,void 0!==$scope.error.thursday_open_close?$scope.thursday_open_close=$filter("translate")($scope.error.thursday_open_close):$scope.thursday_open_close=!1)),$scope.settingValue.is_friday_open&&($scope.settingValue.friday_two_session?(void 0!==$scope.error.friday_open_lunch?$scope.friday_open_lunch=$filter("translate")($scope.error.friday_open_lunch):$scope.friday_open_lunch=!1,void 0!==$scope.error.friday_lunch_resume?$scope.friday_lunch_resume=$filter("translate")($scope.error.friday_lunch_resume):$scope.friday_lunch_resume=!1,void 0!==$scope.error.friday_resume_close?$scope.friday_resume_close=$filter("translate")($scope.error.friday_resume_close):$scope.friday_resume_close=!1):($scope.friday_resume_close=!1,void 0!==$scope.error.friday_open_close?$scope.friday_open_close=$filter("translate")($scope.error.friday_open_close):$scope.friday_open_close=!1)),$scope.settingValue.is_saturday_open&&($scope.settingValue.saturday_two_session?(void 0!==$scope.error.saturday_open_lunch?$scope.saturday_open_lunch=$filter("translate")($scope.error.saturday_open_lunch):$scope.saturday_open_lunch=!1,void 0!==$scope.error.saturday_lunch_resume?$scope.saturday_lunch_resume=$filter("translate")($scope.error.saturday_lunch_resume):$scope.saturday_lunch_resume=!1,void 0!==$scope.error.saturday_resume_close?$scope.saturday_resume_close=$filter("translate")($scope.error.saturday_resume_close):$scope.saturday_resume_close=!1):($scope.saturday_resume_close=!1,void 0!==$scope.error.saturday_open_close?$scope.saturday_open_close=$filter("translate")($scope.error.saturday_open_close):$scope.saturday_open_close=!1))):$scope.settingValue.is_two_session?(void 0!==$scope.error.open_lunch?$scope.open_lunch=$filter("translate")($scope.error.open_lunch):$scope.open_lunch=!1,void 0!==$scope.error.lunch_resume?$scope.lunch_resume=$filter("translate")($scope.error.lunch_resume):$scope.lunch_resume=!1,void 0!==$scope.error.resume_close?$scope.resume_close=$filter("translate")($scope.error.resume_close):$scope.resume_close=!1):($scope.resume_close=!1,void 0!==$scope.error.open_close?$scope.open_close=$filter("translate")($scope.error.open_close):$scope.open_close=!1),flash.set($filter("translate")("Settings could not be added. Please, try again"),"error",!1)})}$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("My Doctors"),$scope.branch_id=$state.params.branch_id,$scope.user_id=$state.params.user_id,getDoctorById($state.params.user_id),$timeout(function(){$scope.text_box=!0},1e3)},$scope.index();var params={};$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$scope.loader=!0,$scope.mydoctors=function(){var params={};$scope.branch_id=$state.params.branch_id,$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,"my_doctors"===$state.current.name?params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+'},"include":{"0":"branch","1":"user","2":"user.user_profile","3":"user.attachment","4":"user.user_profile.city","5":"user.user_profile.country","6":"appointment_settings","7":"appointment_modifications", "8":"branch.country","9":"branch.city"},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}":params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+', "branch_id":'+$scope.branch_id+'},"include":{"0":"branch","1":"user","2":"user.user_profile","3":"user.attachment","4":"user.user_profile.city","5":"user.user_profile.country","6":"appointment_settings","7":"appointment_modifications","8":"branch.country","9":"branch.city"},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}",void 0===$state.params.page?params.page=1:params.page=$state.params.page,MyDoctorsFactory.get(params,function(response){response._metadata&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),angular.isDefined(response.data)&&($scope.doctors=response.data,$scope.dataLength=response.data.length>0?!0:!1),$scope.loader=!1}),getBranchById($scope.branch_id)},$scope.mydoctors(),$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){$scope.mydoctors()},1e3)},$scope.removeDoctor=function(branch_doctor_id){SweetAlert.swal({title:$filter("translate")("Are you sure you want to remove the doctor from branch list?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&RemoveDoctor["delete"]({id:branch_doctor_id},function(response){0===response.error.code?(flash.set($filter("translate")("Your doctor has been deleted successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your doctor couldn't deleted. Please try again."),"error",!1),$state.reload())})})},"appointment_setting"===$state.current.name?angular.isDefined($state.params.branch_id)&&angular.isDefined($state.params.user_id)?($scope.branch_id=$state.params.branch_id,$scope.user_id=$state.params.user_id,$scope.apt_set_id=$state.params.apt_set_id,getBranchById($scope.branch_id,$scope.user_id),calendarSlots(),getAppointmentSettingsData($scope.branch_id,$scope.user_id,$scope.apt_set_id),$scope.settingUpdate=function($valid){$valid&&($scope.is_disable=!0,$scope.settingValue.id=$scope.apt_set_id,updateAppointmnetSettings($scope.settingValue))},$scope.deleteWorkPlace=function(id){angular.isDefined(id)&&fnDeleteWorkPlace(id)}):$state.go("branch_doctors"):"appointment_modification"===$state.current.name?angular.isDefined($state.params.branch_id)&&angular.isDefined($state.params.user_id)?($scope.branch_id=$state.params.branch_id,$scope.user_id=$state.params.user_id,$scope.apt_set_id=$state.params.apt_set_id,getBranchById($scope.branch_id,$scope.user_id),getAppoinmentModification($scope.branch_id,$scope.user_id),$scope.deleteWorkPlace=function(id){angular.isDefined(id)&&fnDeleteWorkPlace(id)}):$state.go(ConstantWorkPlaces.state_WorkPlace):"appointment_modification_add"===$state.current.name?angular.isDefined($state.params.branch_id)&&angular.isDefined($state.params.user_id)&&($scope.branch_id=$state.params.branch_id,$scope.user_id=$state.params.user_id,$scope.apt_set_id=$state.params.apt_set_id,getTimeSlot($scope.apt_set_id),$scope.type=!1,$scope.saveAppoinmentModification=function(data){$scope.settingValue={},$scope.settingValue.user_id=$scope.user_id,$scope.settingValue.branch_id=$scope.branch_id,$scope.settingValue.appoint_date=$filter("date")(data.appoint_date,"yyyy-MM-dd"),$scope.settingValue.appoint_date_end=$filter("date")(data.appoint_date_end,"yyyy-MM-dd"),$scope.type||($scope.settingValue.practice_open=data.appt_time.toString()),$scope.settingValue.type=$scope.type,addAppoinmentModification($scope.settingValue)}):"appointment_modification_edit"==$state.current.name&&($rootScope.pageTitle=$rootScope.settings["site.name"]+" | "+$filter("translate")("Edit Modification Details"),AppoinmentModifications.get({id:$state.params.id}).$promise.then(function(response){if($scope.data=response.data,$scope.data.country_id=parseInt(response.data.country_id),$scope.data.type=response.data.type?!0:!1,""!==response.data.practice_open){var practiceOpen=response.data.practice_open;$scope.data.appt_time=practiceOpen.split(",")}else $scope.data.appt_time="";getTimeSlot($state.params.apt_set_id)}),$scope.updateAppoinmentModification=function(data){$scope.modifyValue={},$scope.modifyValue.id=data.id,$scope.modifyValue.branch_id=$state.params.branch_id,$scope.modifyValue.user_id=$state.params.user_id,$scope.modifyValue.appoint_date=$filter("date")(data.appoint_date,"yyyy-MM-dd"),$scope.modifyValue.appoint_date_end=$filter("date")(data.appoint_date_end,"yyyy-MM-dd"),$scope.modifyValue.type=data.type,$scope.modifyValue.is_active=data.is_active,data.type||($scope.modifyValue.practice_open=data.appt_time.toString()),AppoinmentModifications.put($scope.modifyValue).$promise.then(function(response){flash.set($filter("translate")("Appoinment modification added successfully."),"success",!0),$state.go("appointment_modification",{branch_id:$state.params.branch_id,user_id:$state.params.user_id,apt_set_id:$state.params.apt_set_id},{reload:!0})})}),$scope.changeType=function(value){$scope.type=value?!1:!0}}),angular.module("absApp").controller("BranchesDoctorsAddController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,CountriesFactory,DoctorsFactory,SpecialtiesFactory,LanguagesFactory,SearchDoctors,ConstUserType,md5,InsurancesFactory){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add Branch"),$scope.data={},$scope.branch_id=$state.params.branch_id,$scope.ConstUserType=ConstUserType,$scope.branchinfo=$rootScope.branchinfo,$scope.findDoctor=!1,$scope.data={},$scope.data.country_id=84},$scope.index();var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.countries=response.data)}),params.filter='{"order":"name asc","limit":500,"skip":0}',SpecialtiesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.specialties=response.data,$scope.branchSpecialty=[],angular.forEach($scope.specialties,function(value){$scope.branchSpecialty.push({id:value.id,text:value.name}),void 0!==$scope.branchSpecialtiesList&&-1!=$scope.branchSpecialtiesList.indexOf(value.id)&&$scope.data.specialty_select.push({id:value.id,text:value.name})})):console.log("Specialties Error")},function(error){console.log("BranchSpecialty Error",error)}),$scope.loadSpecialties=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchSpecialty,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},params.filter='{"order":"name asc","limit":500,"skip":0}',LanguagesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.languages=response.data,$scope.branchLanguage=[],angular.forEach($scope.languages,function(value){$scope.branchLanguage.push({id:value.id,text:value.name}),void 0!==$scope.branchLanguagesList&&-1!=$scope.branchLanguagesList.indexOf(value.id)&&$scope.data.language_select.push({id:value.id,text:value.name})})):console.log("Languages Error")},function(error){console.log("BranchLanguage Error",error)}),params.filter='{"order":"name asc","limit":500,"skip":0}',InsurancesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.insurances=response.data,$scope.branchInsurance=[],angular.forEach($scope.insurances,function(value){$scope.branchInsurance.push({ id:value.id,text:value.name}),void 0!==$scope.branchInsurancesList&&-1!=$scope.branchInsurancesList.indexOf(value.id)&&$scope.data.insurance_select.push({id:value.id,text:value.name})})):console.log("Insurances Error")},function(error){console.log("BranchInsurance Error",error)}),$scope.loadLanguages=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchLanguage,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},$scope.loadInsurances=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchInsurance,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},$scope.addDoctor=function($valid,data){$valid&&!$scope.error_message?($scope.save_btn=!0,angular.isDefined($scope.data.specialty_select)&&Object.keys($scope.data.specialty_select).length>0&&($scope.data.specialties_users=[],angular.forEach($scope.data.specialty_select,function(value){$scope.data.specialties_users.push({specialty_id:value.id})}),delete $scope.data.specialty_select),angular.isDefined($scope.data.insurance_select)&&Object.keys($scope.data.insurance_select).length>0&&($scope.data.insurances_users=[],angular.forEach($scope.data.insurance_select,function(value){$scope.data.insurances_users.push({insurance_id:value.id})}),delete $scope.data.insurance_select),angular.isDefined($scope.data.language_select)&&Object.keys($scope.data.language_select).length>0&&($scope.data.languages_users=[],angular.forEach($scope.data.language_select,function(value){$scope.data.languages_users.push({language_id:value.id})}),delete $scope.data.language_select),angular.isDefined($scope.user_educations)&&Object.keys($scope.user_educations).length>0&&($scope.data.user_educations=[],angular.forEach($scope.user_educations,function(value){$scope.data.user_educations.push({education:value.education,location:value.location,organization:value.organization,certification_date:$filter("date")(new Date(value.certification_date),"yyyy-MM-dd")})})),$scope.data.clinic_user_id=$rootScope.auth.role_id===$scope.ConstUserType.SubAccount?$rootScope.branchinfo.clinic_user_id:$rootScope.auth.id,$scope.data.branch_id=$state.params.branch_id,console.log($scope.data,"data"),DoctorsFactory.post($scope.data,function(response){0===parseInt(response.error.code)?($timeout(function(){$rootScope.auth.role_id===ConstUserType.SubAccount?$state.go("ManageDoctors",{branch_id:$state.params.branch_id,clinic_user_id:response.data.clinic_user_id,slug:"manage"},{reload:!0}):$state.go("branch_doctors",{branch_id:$state.params.branch_id},{reload:!0})},500),flash.set($filter("translate")("Doctor added successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("Doctor added failed."),"error",!1))},function(response){console.log(response,"errorres"),"Unprocessable Entity"===response.statusText&&flash.set($filter("translate")("Withdraw request could not be added "+response.data.error.raw_message.mobile),"error",!1)})):$timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})},$scope.showDoctors=!1,$scope.addDoctors=!1,$scope.data={},$scope.searchDoctor=function($valid,data){""!==data&&void 0!==data&&($scope.data.mobile=data.mobile_number,params.filter='{"where":{"mobile": "'+$scope.data.mobile+'"},"include":{"0":"attachment","1":"user_profile.gender","2":"branches_doctor"}}',SearchDoctors.get(params,function(response){$scope.doctors=response.data,console.log($scope.doctors),$scope.dataLength=response.data.length>0?!0:!1,$scope.addDoctors=response.data.length>0?!1:!0,$scope.showDoctors=!0,angular.forEach($scope.doctors,function(doctor){if($scope.show_add=!0,angular.isDefined(doctor.attachment)&&null!==doctor.attachment){var hash=md5.createHash(doctor.attachment["class"]+doctor.attachment.id+"pngbig_thumb");doctor.image="images/big_thumb/"+doctor.attachment["class"]+"/"+doctor.attachment.id+"."+hash+".png"}else doctor.image="images/default.png";angular.forEach(doctor.branches_doctor,function(value){angular.isDefined(value)&&null!==value?parseInt(doctor.id)===parseInt(value.user_id)&&parseInt($scope.branch_id)===parseInt(value.branch_id)&&($scope.show_add=!1):$scope.show_add=!0})})}))},$scope.addBranchDoctor=function(user_id,branch_id){$scope.data={},$scope.data.clinic_user_id=$rootScope.auth.id,$scope.data.branch_id=branch_id,$scope.data.user_id=user_id,DoctorsFactory.post($scope.data,function(response){0===parseInt(response.error.code)?($timeout(function(){$rootScope.auth.role_id===$scope.ConstUserType.SubAccount?$location.path("doctors/"+$state.params.branch_id+"/"+response.data.clinic_user_id+"/manage"):$state.go("branch_doctors",{branch_id:$state.params.branch_id},{reload:!0})},500),flash.set($filter("translate")("Doctor added successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("Doctor added failed."),"error",!1))},function(response){flash.set($filter("translate")(response.data.error.message),"error",!1)})},$scope.findFrm=function(){$scope.findDoctor=!0}}),angular.module("absApp").controller("BranchesDoctorsEditController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,CountriesFactory,DoctorsEdit,SpecialtiesFactory,LanguagesFactory,InsurancesFactory){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Edit Doctor")},$scope.index();var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.countries=response.data)}),params.filter='{"order":"name asc","limit":500,"skip":0}',SpecialtiesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.specialties=response.data,$scope.branchSpecialty=[],angular.forEach($scope.specialties,function(value){$scope.branchSpecialty.push({id:value.id,text:value.name}),void 0!==$scope.branchSpecialtiesList&&-1!=$scope.branchSpecialtiesList.indexOf(value.id)&&$scope.data.specialty_select.push({id:value.id,text:value.name})})):console.log("Specialties Error")},function(error){console.log("BranchSpecialty Error",error)}),$scope.loadSpecialties=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchSpecialty,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},params.filter='{"order":"name asc","limit":500,"skip":0}',InsurancesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.insurances=response.data,$scope.branchInsurance=[],angular.forEach($scope.insurances,function(value){$scope.branchInsurance.push({id:value.id,text:value.name}),void 0!==$scope.branchInsurancesList&&-1!=$scope.branchInsurancesList.indexOf(value.id)&&$scope.data.insurance_select.push({id:value.id,text:value.name})})):console.log("Insurances Error")},function(error){console.log("BranchInsurance Error",error)}),$scope.loadInsurances=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchInsurance,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},params.filter='{"order":"name asc","limit":500,"skip":0}',LanguagesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.languages=response.data,$scope.branchLanguage=[],angular.forEach($scope.languages,function(value){$scope.branchLanguage.push({id:value.id,text:value.name}),void 0!==$scope.branchLanguagesList&&-1!=$scope.branchLanguagesList.indexOf(value.id)&&$scope.data.language_select.push({id:value.id,text:value.name})})):console.log("Languages Error")},function(error){console.log("BranchLanguage Error",error)}),$scope.loadLanguages=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchLanguage,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items};var selectedSpecialty=[],selectedLanguage=[],selectedInsurance=[];params.id=$state.params.id,params.filter='{"include":{"0":"branch","1":"user","2":"user.user_profile","3":"user.attachment","4":"user.user_profile.city","5":"user.user_profile.country","6":"specialties_user.specialty","7":"languages_user.language", "8":"insurances_user.insurance_company"}}',$scope.doctorEdit=function(){DoctorsEdit.get(params,function(response){$scope.data=response.data,$scope.data.name=response.data.user.username,$scope.data.mobile=response.data.user.mobile,$scope.data.email=response.data.user.email,$scope.data.country_id=response.data.user.user_profile.country.id,angular.forEach(response.data.specialties_user,function(value){selectedSpecialty.push(value.specialty_id)}),$scope.data.specialty_select=[],angular.forEach(response.data.specialties_user,function(value){$scope.data.specialty_select.push({id:value.specialty.id,text:value.specialty.name})}),angular.forEach(response.data.languages_user,function(value){selectedLanguage.push(value.language_id)}),$scope.data.language_select=[],angular.forEach(response.data.languages_user,function(value){$scope.data.language_select.push({id:value.language.id,text:value.language.name})}),angular.forEach(response.data.insurances_user,function(value){selectedInsurance.push(value.insurance_id)}),$scope.data.insurance_select=[],angular.forEach(response.data.insurances_user,function(value){$scope.data.insurance_select.push({id:value.insurance_company.id,text:value.insurance_company.name})})})},$scope.doctorEdit(),$scope.save_btn=!1,$scope.updateDoctor=function($valid,data){if($valid&&!$scope.error_message){$scope.save_btn=!0,angular.isDefined(data.specialty_select)&&Object.keys(data.specialty_select).length>0&&(data.specialties_users=[],angular.forEach(data.specialty_select,function(value){data.specialties_users.push({specialty_id:value.id})})),angular.isDefined(data.language_select)&&Object.keys(data.language_select).length>0&&(data.languages_users=[],angular.forEach(data.language_select,function(value){data.languages_users.push({language_id:value.id})})),angular.isDefined(data.insurance_select)&&Object.keys(data.insurance_select).length>0&&(data.insurances_users=[],angular.forEach(data.insurance_select,function(value){data.insurances_users.push({insurance_id:value.id})}));var doctorData={};doctorData.id=data.id,doctorData.name=data.name,doctorData.email=data.email,doctorData.country_id=data.country_id,doctorData.room_number=data.room_number,doctorData.specialties_users=data.specialties_users,doctorData.languages_users=data.languages_users,doctorData.insurances_users=data.insurances_users,DoctorsEdit.put(doctorData,function(response){$scope.save_btn=!1,$scope.response=response,0===parseInt(response.error.code)?($timeout(function(){$state.go("branch_doctors",{branch_id:data.branch_id},{reload:!0})},500),flash.set($filter("translate")("Doctor updated successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("Doctor updated failed."),"error",!1))},function(response){flash.set($filter("translate")(response.data.error.message),"error",!1)})}else $timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("BranchesUsersController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,UsersFactory,SweetAlert,RemoveUser,BranchesEdit){function getBranchById(id){var params={};params.id=id,params.filter='{"fields":{"id":true,"name":true}}',BranchesEdit.get(params).$promise.then(function(response){angular.isDefined(response)&&(response.Failed?flashMessage(response.Failed,"error"):$scope.branch=response.data)})}$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Manage Users"),$scope.branch_id=$state.params.branch_id,$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$scope.loader=!0,$scope.myusers=function(){var params={};$scope.branch_id=$state.params.branch_id,$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,"my_users"===$state.current.name?params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+'},"include":{"0":"branch","1":"user.user_profile","2":"user.user_profile.city"},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}":params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+', "branch_id":'+$scope.branch_id+'},"include":{"0":"branch","1":"user","2":"user.user_profile","3":"user.attachment","4":"user.user_profile.city","5":"user.user_profile.country"}, "limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}",void 0===$state.params.page?params.page=1:params.page=$state.params.page,UsersFactory.get(params,function(response){response._metadata&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),angular.isDefined(response.data)&&($scope.users=response.data,$scope.dataLength=response.data.length>0?!0:!1),$scope.loader=!1})},$scope.myusers(),$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){$scope.myusers()},1e3)},$scope.removeUser=function(branch_user_id){SweetAlert.swal({title:$filter("translate")("Are you sure you want to remove the user from branch list?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&RemoveUser["delete"]({id:branch_user_id},function(response){0===response.error.code?(flash.set($filter("translate")("Your user has been deleted successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your user couldn't deleted. Please try again."),"error",!1),$state.reload())})})},getBranchById($scope.branch_id)}),angular.module("absApp").controller("BranchesUsersAddController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,CountriesFactory,UsersFactory,PermissionsFactory,SearchUsers,ConstUserType){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add User"),$scope.data={},$scope.ConstUserType=ConstUserType},$scope.index(),$scope.branch_id=$state.params.branch_id;var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.countries=response.data)}),PermissionsFactory.get().$promise.then(function(response){angular.isDefined(response)&&($scope.permissions=response.data)}),$scope.permission_select=[],$scope.check=function(value,checked){var idx=$scope.permission_select.indexOf(value);idx>=0&&!checked&&$scope.permission_select.splice(idx,1),0>idx&&checked&&$scope.permission_select.push(value)},$scope.save_btn=!1,$scope.addUser=function($valid,data){$valid&&!$scope.error_message?($scope.save_btn=!0,$scope.data.clinic_user_id=$rootScope.auth.id,$scope.data.branch_id=$state.params.branch_id,$scope.data.permissions=[],angular.isDefined($scope.permission_select)&&Object.keys($scope.permission_select).length>0?angular.forEach($scope.permission_select,function(value){$scope.data.permissions.push({name:value})}):($scope.save_btn=!0,flash.set($filter("translate")("Please select atleast one permission for Sub Accounts"),"error",!1)),delete $scope.data.user_permissions,UsersFactory.post($scope.data,function(response){0===parseInt(response.error.code)?($timeout(function(){$state.go("branch_users",{branch_id:$state.params.branch_id},{reload:!0})},500),flash.set($filter("translate")("User added successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("User added failed."),"error",!1))},function(response){if($scope.save_btn=!0,""===response.data.error.raw_message||null===response.data.error.raw_message||void 0===response.data.error.raw_message)flash.set($filter("translate")(response.data.error.message),"error",!1);else{var keys=Object.keys(response.data.error.raw_message);keys.length>0?flash.set($filter("translate")(response.data.error.raw_message.mobile),"error",!1):flash.set($filter("translate")(response.data.error.raw_message),"error",!1)}})):$timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})},$scope.showUsers=!1,$scope.addUsers=!1,$scope.data={},$scope.searchUser=function($valid,data){""!==data&&void 0!==data&&($scope.data.mobile=data.mobile_number,params.filter='{"where":{"mobile": "'+$scope.data.mobile+'"},"include":{"0":"attachment","1":"user_profile","2":"branches_user"}}',SearchUsers.get(params,function(response){$scope.users=response.data,$scope.dataLength=response.data.length>0?!0:!1,$scope.addUsers=response.data.length>0?!1:!0,0!==response.data.length&&($scope.BranchUserAlreadyAdded=response.data[0].branches_user.length>0?!0:!1,response.data[0].branches_user.length>0?$scope.BranchUser=parseInt(response.data[0].branches_user[0].branch_id)===parseInt($state.params.branch_id)?!0:!1:$scope.BranchUser=!1),$scope.showUsers=!0,angular.forEach($scope.users,function(user){if($scope.show_add=!1,angular.isDefined(user.attachment)&&null!==user.attachment){var hash=md5.createHash(user.attachment["class"]+user.attachment.id+"pngmedium_thumb");user.image="images/medium_thumb/"+user.attachment["class"]+"/"+user.attachment.id+"."+hash+".png"}else user.image="images/default.png";parseInt(user.role_id)!==ConstUserType.SubAccount||0!==parseInt(user.parent_id)&&parseInt(user.parent_id)!==$rootScope.auth.id||($scope.show_add=!0)})}))},$scope.addBranchUser=function(user_id,branch_id){$scope.data={},$scope.data.clinic_user_id=$rootScope.auth.id,$scope.data.branch_id=branch_id,$scope.data.user_id=user_id,UsersFactory.post($scope.data,function(response){0===parseInt(response.error.code)?($timeout(function(){$state.go("branch_users",{branch_id:$state.params.branch_id},{reload:!0})},500),flash.set($filter("translate")("User added successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("User added failed."),"error",!1))},function(response){if(""===response.data.error.raw_message||null===response.data.error.raw_message||void 0===response.data.error.raw_message)flash.set($filter("translate")(response.data.error.message),"error",!1);else{var keysvalue=Object.keys(response.data.error.raw_message);keysvalue.length>0?flash.set($filter("translate")(response.data.error.raw_message.mobile),"error",!1):flash.set($filter("translate")(response.data.error.raw_message),"error",!1)}})}}),angular.module("absApp").controller("BranchesUsersEditController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,CountriesFactory,UsersFactory,UsersEdit,PermissionsFactory){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add User")},$scope.index();var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.countries=response.data)}),PermissionsFactory.get().$promise.then(function(response){angular.isDefined(response)&&($scope.permissions=response.data)}),$scope.permission_select=[],$scope.check=function(value,checked){var idx=$scope.permission_select.indexOf(value);idx>=0&&!checked&&$scope.permission_select.splice(idx,1),0>idx&&checked&&$scope.permission_select.push(value)},$scope.save_btn=!1,$scope.userData={},params={},params.id=$state.params.id,params.filter='{"include":{"0":"branch","1":"user.user_profile","2":"user.user_profile.city","3":"user.user_profile.country"}}',$scope.userEdit=function(){UsersEdit.get(params,function(response){$scope.userData=response.data;var selected_permissions=[];if(null!==response.data.permissions)for(var sel_permissions=response.data.permissions.split(", "),i=0;i0?angular.forEach(data.user_permissions,function(value){$scope.permissions.push({name:value})}):($scope.save_btn=!0,flash.set($filter("translate")("Please select atleast one permission for Sub Accounts"),"error",!1)),userData.id=data.id,userData.name=data.name,userData.email=data.email,userData.country_id=data.country_id,userData.permissions=$scope.permissions,UsersEdit.put(userData,function(response){$scope.save_btn=!1,$scope.response=response,0===parseInt(response.error.code)?($timeout(function(){$state.go("branch_users",{branch_id:data.branch_id},{reload:!0})},500),flash.set($filter("translate")("User updated successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("User updated failed."),"error",!1))},function(response){flash.set($filter("translate")(response.data.error.message),"error",!1)})):$timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("BranchesController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,BranchesFactory,BranchesEdit,MyDoctorsFactory){$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Branches"),$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,$scope.myBranches=function(){if("my_branches"===$state.current.name){var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+',"include":{"0":"branch.city","1":"branch.country","2":"clinic_user.user_profile"}}',$scope.loader=!0,void 0===$state.params.page?params.page=1:params.page=$state.params.page,MyDoctorsFactory.get(params,function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),angular.isDefined(response.data)&&($scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1),$scope.loader=!1})}},"my_branches"===$state.current.name&&$scope.myBranches(),$scope.loader=!0,$scope.mybranch=function(){var params={};params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+',"include":{"0":"city","1":"country"},"order":"id desc"}',void 0===$state.params.page?params.page=1:params.page=$state.params.page,BranchesFactory.get(params,function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),angular.isDefined(response.data)&&($scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1),$scope.loader=!1})},"my_branches"!==$state.current.name&&$scope.mybranch(),$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){"my_branches"!==$state.current.name&&$scope.mybranch(),"my_branches"===$state.current.name&&$scope.myBranches()},1e3)},$scope.changeStatus=function(branch_id,status){var branchData={};branchData.id=branch_id,branchData.is_active=status,SweetAlert.swal({title:$filter("translate")("Are you sure you want to change the status?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&BranchesEdit.put(branchData,function(response){0===response.error.code?(flash.set($filter("translate")("Your doctor has been deleted successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your doctor couldn't deleted. Please try again."),"error",!1),$state.reload())})})}}).controller("BranchViewController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,BranchesEdit,md5,Slug,ConstGenders){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Branches");var params={};params.id=$state.params.id,params.filter='{"include":{"0":"clinic_user","1":"branch_doctor.user.primary_speciality","2":"branches_specialty.specialty","3":"branches_insurance.insurance","4":"attachment","5":"branch_doctor.user.user_profile","6":"branch_doctor.user.attachment", "user_favorites":{"where":{"user_id":'+$state.params.id+"}}}}",$scope.loader=!0,BranchesEdit.get(params,function(response){angular.isDefined(response.data)&&($scope.branch=response.data,$scope.isShown=response.data.branch_doctor.length>0?!0:!1,$scope.loader=!1,$scope.images=[],$scope.doctors=[],$scope.isFavorite=$scope.branch.user_favorites.length>0?1:0,angular.isDefined($scope.branch.branch_doctor)&&Object.keys($scope.branch.branch_doctor).length>0&&angular.forEach($scope.branch.branch_doctor,function(branchDoctor,key){var provider_user=branchDoctor;provider_user.user_image=provider_user.user.user_profile.gender_id===ConstGenders.Female?"images/femaledoctor.jpg":"images/maledoctor.jpg",angular.isDefined(provider_user.user.attachment)&&null!==provider_user.user.attachment&&(provider_user.user_image="images/big_thumb/UserAvatar/"+provider_user.user.attachment.id+"."+md5.createHash("UserAvatar"+provider_user.user.attachment.id+"pngbig_thumb")+".png"),$scope.branch.branch_doctor[key].user.user_image=provider_user.user_image}),angular.isDefined(response.data.attachment)&&Object.keys(response.data.attachment).length>0&&angular.forEach(response.data.attachment,function(value,key){var small_hash=md5.createHash(value["class"]+value.id+"pngsmall_thumb"),small_thumb="images/small_thumb/"+value["class"]+"/"+value.id+"."+small_hash+".png",medium_hash=md5.createHash(value["class"]+value.id+"pngmedium_thumb"),medium_thumb="images/medium_thumb/"+value["class"]+"/"+value.id+"."+medium_hash+".png";$scope.images.push({thumb:small_thumb,img:medium_thumb})}),$scope.branchImages=$scope.images)}),$scope.allPhotos=function(){$scope.showPhoto=!0}}).directive("owlCarouselBranch",function(){return{restrict:"E",transclude:!1,link:function(scope){scope.initCarousel=function(element){var defaultOptions={responsiveClass:!0,margin:10,responsive:{0:{items:1,nav:!0,dots:!1},600:{items:2,nav:!0,dots:!1},1e3:{items:5,nav:!0,loop:!1,dots:!1}}};$("#branchDoctor").owlCarouselBranch({loop:!0,margin:2,responsiveClass:!0,responsive:{0:{items:1,nav:!0,dots:!1},600:{items:3,nav:!0,dots:!1},1e3:{items:5,nav:!0,loop:!1,dots:!1}}}),$(element).owlCarouselBranch(defaultOptions)}}}}).directive("owlCarouselDoc",[function(){return{restrict:"A",transclude:!1,link:function(scope,element){scope.$last&&scope.initCarousel(element.parent())}}}]),angular.module("absApp").controller("BranchesAddController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,BranchesFactory,LocationsFactory,SpecialtiesFactory,InsurancesFactory,LanguagesFactory,CountriesFactory){function getLocations(){var params={};params.filter='{"order":"location asc","limit":500,"skip":0}',LocationsFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.locations=response.data)})}$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add Branch"),getLocations(),$timeout(function(){$scope.text_box=!0},1e3)},$scope.index();var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($rootScope.countries=response.data)}),params={},params.filter='{"order":"name asc","limit":500,"skip":0}',SpecialtiesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.specialties=response.data,$scope.branchSpecialty=[],angular.forEach($scope.specialties,function(value){$scope.branchSpecialty.push({id:value.id,text:value.name}),void 0!==$scope.branchSpecialtiesList&&-1!=$scope.branchSpecialtiesList.indexOf(value.id)&&$scope.data.specialty_select.push({id:value.id,text:value.name})})):console.log("Specialties Error")},function(error){console.log("BranchSpecialty Error",error)}),params={},params.filter='{"order":"name asc","limit":500,"skip":0}',InsurancesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.insurances=response.data,$scope.branchInsurance=[],angular.forEach($scope.insurances,function(value){$scope.branchInsurance.push({id:value.id,text:value.name}),void 0!==$scope.branchInsurancesList&&-1!=$scope.branchInsurancesList.indexOf(value.id)&&$scope.data.insurance_select.push({id:value.id,text:value.name})})):console.log("Insurances Error")},function(error){console.log("BranchInsurance Error",error)}),params={},params.filter='{"order":"name asc","limit":500,"skip":0}',LanguagesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.languages=response.data,$scope.branchLanguage=[],angular.forEach($scope.languages,function(value){$scope.branchLanguage.push({id:value.id,text:value.name}),void 0!==$scope.branchLanguagesList&&-1!=$scope.branchLanguagesList.indexOf(value.id)&&$scope.data.language_select.push({id:value.id,text:value.name})})):console.log("Languages Error")},function(error){console.log("BranchLanguage Error",error)}),$scope.getCountryPhoneCode=function(id){angular.forEach($rootScope.countries,function(country){id===country.iso2&&(""!==$scope.data.phone_number&&null!==$scope.data.phone_number&&$scope.data.phone_number||($scope.data.phone_number_code=country.phone))})},$scope.addresslocation=function(){$scope.IsAddressPlaceChange=!1,void 0!==$scope.data.address?(angular.forEach($scope.data.address.address_components,function(value){("locality"===value.types[0]||"administrative_area_level_2"===value.types[0])&&($scope.data.city={},$scope.data.city.name=value.long_name),"administrative_area_level_1"===value.types[0]&&($scope.data.state={},$scope.data.state.name=value.long_name),"country"===value.types[0]&&($scope.data.country={},$scope.data.country.iso2=value.short_name, $scope.selectedCountry=value.short_name,$scope.getCountryPhoneCode(value.short_name)),"postal_code"===value.types[0]&&($scope.data.postal_code=parseInt(value.long_name))}),$scope.data.address.address_components&&($scope.IsAddressPlaceChange=!0,$scope.data.latitude=$scope.data.address.geometry.location.lat(),$scope.data.longitude=$scope.data.address.geometry.location.lng(),$scope.data.full_address=$scope.data.address.name+" "+$scope.data.address.vicinity,$scope.data.address=$scope.data.address.formatted_address)):$scope.IsAddressPlaceChange=!0},$scope.loadSpecialties=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchSpecialty,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},$scope.loadInsurances=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchInsurance,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},$scope.loadLanguages=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchLanguage,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},$scope.$on("MulitpleUploader",function(event,data){$scope.imagedata=data,$scope.image=[]}),$scope.save_btn=!1,$scope.postBranch=function($valid,data){$valid&&!$scope.error_message?($scope.save_btn=!0,angular.isDefined($scope.data.specialty_select)&&Object.keys($scope.data.specialty_select).length>0&&($scope.data.branches_specialties=[],angular.forEach($scope.data.specialty_select,function(value){$scope.data.branches_specialties.push({specialty_id:value.id})})),angular.isDefined($scope.data.insurance_select)&&Object.keys($scope.data.insurance_select).length>0&&($scope.data.branches_insurances=[],angular.forEach($scope.data.insurance_select,function(value){$scope.data.branches_insurances.push({insurance_id:value.id})})),angular.isDefined($scope.data.language_select)&&Object.keys($scope.data.language_select).length>0&&($scope.data.branches_languages=[],angular.forEach($scope.data.language_select,function(value){$scope.data.branches_languages.push({language_id:value.id})})),angular.isDefined($scope.imagedata)&&Object.keys($scope.imagedata).length>0&&($scope.data.branch_images=[],angular.forEach($scope.imagedata,function(img){angular.forEach(img,function(branchImage){void 0!==branchImage.attachment&&$scope.data.branch_images.push({image:branchImage.attachment})})})),$scope.data.clinic_user_id=$rootScope.auth.id,$scope.data.is_active=1,$scope.data.city=$scope.data.city,$scope.data.state=$scope.data.state,$scope.data.country=$scope.data.country,$scope.data.postal_code=$scope.data.postal_code,BranchesFactory.post($scope.data,function(response){var flashMessage;0===parseInt(response.error.code)?(flashMessage=$filter("translate")("Branch added successfully."),$state.go("branches"),flash.set(flashMessage,"success",!1)):($scope.save_btn=!1,flashMessage=$filter("translate")("Branch added failed."),flash.set(flashMessage,"error",!1))},function(error){console.log("postBranch Error",error)})):$timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("BranchesEditController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,CountriesFactory,BranchesEdit,LocationsFactory,SpecialtiesFactory,InsurancesFactory,md5,AttachementDelete){var params={};$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Edit Branch"),$timeout(function(){$scope.text_box=!0},1e3),params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($rootScope.countries=response.data)}),$scope.getCountryPhoneCode=function(id){angular.forEach($rootScope.countries,function(country){id===country.id&&($scope.country_phone_code=country.phone_code)})},params={},params.filter='{"order":"name asc","limit":500,"skip":0}',SpecialtiesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.specialties=response.data,$scope.branchSpecialty=[],angular.forEach($scope.specialties,function(value){$scope.branchSpecialty.push({id:value.id,text:value.name}),void 0!==$scope.branchSpecialtiesList&&-1!=$scope.branchSpecialtiesList.indexOf(value.id)&&$scope.data.specialty_select.push({id:value.id,text:value.name})})):console.log("Specialties Error")},function(error){console.log("BranchSpecialty Error",error)}),params.filter='{"order":"name asc","limit":500,"skip":0}',InsurancesFactory.get(params).$promise.then(function(response){0===parseInt(response.error.code)?($scope.insurances=response.data,$scope.branchInsurance=[],angular.forEach($scope.insurances,function(value){$scope.branchInsurance.push({id:value.id,text:value.name}),void 0!==$scope.branchInsurancesList&&-1!=$scope.branchInsurancesList.indexOf(value.id)&&$scope.data.insurance_select.push({id:value.id,text:value.name})})):console.log("Insurances Error")},function(error){console.log("BranchInsurance Error",error)})},$scope.index(),$scope.addresslocation=function(){$scope.IsAddressPlaceChange=!1,void 0!==$scope.data.address?(angular.forEach($scope.data.address.address_components,function(value){("locality"===value.types[0]||"administrative_area_level_2"===value.types[0])&&($scope.data.city={},$scope.data.city.name=value.long_name),"administrative_area_level_1"===value.types[0]&&($scope.data.state={},$scope.data.state.name=value.long_name),"country"===value.types[0]&&($scope.data.country={},$scope.data.country.iso2=value.short_name,$scope.selectedCountry=value.short_name,$scope.getCountryPhoneCode(value.short_name)),"postal_code"===value.types[0]&&($scope.data.postal_code=parseInt(value.long_name))}),$scope.data.address.address_components&&($scope.IsAddressPlaceChange=!0,$scope.data.latitude=$scope.data.address.geometry.location.lat(),$scope.data.longitude=$scope.data.address.geometry.location.lng(),$scope.data.full_address=$scope.data.address.name+" "+$scope.data.address.vicinity,$scope.data.address=$scope.data.address.formatted_address)):$scope.IsAddressPlaceChange=!0},$scope.getLocations=function(){var params={};params.filter='{"order":"location asc","limit":500,"skip":0}',LocationsFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.locations=response.data)})},$scope.getLocations(),$scope.loadSpecialties=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchSpecialty,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},$scope.loadInsurances=function(qstr){qstr=qstr.toLowerCase();var items=[];return angular.forEach($scope.branchInsurance,function(value){name=value.text.toLowerCase(),name.indexOf(qstr)>=0&&items.push({id:value.id,text:value.text})}),items},$scope.$on("MulitpleUploader",function(event,data){$scope.imagedata=data,$scope.image=[]});var selectedSpecialty=[],selectedInsurance=[];$scope.branchEdit=function(){params.id=$state.params.id,params.filter='{"include":{"0":"branches_specialty.specialty","1":"branches_insurance.insurance","2":"city","3":"state","4":"country","5":"attachment"}}',BranchesEdit.get(params,function(response){angular.isDefined(response.data)&&($scope.data=response.data,response.data.country_id&&($scope.selectedCountry=response.data.country.iso2),0!==response.data.attachment.length&&angular.forEach(response.data.attachment,function(branchimage){branchimage.image="images/normal_thumb/Branch/"+branchimage.id+"."+md5.createHash("Branch"+branchimage.id+"pngnormal_thumb")+".png"})),angular.forEach(response.data.branches_specialty,function(value){selectedSpecialty.push(value.specialty_id)}),$scope.data.specialty_select=[],angular.forEach(response.data.branches_specialty,function(value){$scope.data.specialty_select.push({id:value.specialty.id,text:value.specialty.name})}),angular.forEach(response.data.branches_insurance,function(value){selectedInsurance.push(value.insurance_id)}),$scope.data.insurance_select=[],angular.forEach(response.data.branches_insurance,function(value){$scope.data.insurance_select.push({id:value.insurance.id,text:value.insurance.name})})})},$scope.branchEdit(),$scope.save_btn=!1,$scope.updateBranch=function($valid,data){if($valid&&!$scope.error_message){$scope.save_btn=!0,angular.isDefined(data.specialty_select)&&Object.keys(data.specialty_select).length>0&&(data.branch_specialties=[],angular.forEach(data.specialty_select,function(value){data.branch_specialties.push({specialty_id:value.id})})),angular.isDefined(data.insurance_select)&&Object.keys(data.insurance_select).length>0&&(data.branch_insurances=[],angular.forEach(data.insurance_select,function(value){data.branch_insurances.push({insurance_id:value.id})})),angular.isDefined($scope.imagedata)&&Object.keys($scope.imagedata).length>0&&(data.branch_images=[],angular.forEach($scope.imagedata,function(img){angular.forEach(img,function(branchImage){void 0!==branchImage.attachment&&data.branch_images.push({image:branchImage.attachment})})}));var branchData={};branchData.id=data.id,branchData.name=data.name,branchData.description=data.description,branchData.phone_number=data.phone_number,branchData.consultation_fee=data.consultation_fee,branchData.location_id=data.location_id,branchData.branch_specialties=data.branch_specialties,branchData.branch_insurances=data.branch_insurances,branchData.branch_images=data.branch_images,branchData.address=$scope.data.address,branchData.full_address=$scope.data.full_address,branchData.city=$scope.data.city,branchData.state=$scope.data.state,branchData.country=$scope.data.country,branchData.postal_code=$scope.data.postal_code,BranchesEdit.put(branchData,function(response){$scope.save_btn=!1,$scope.response=response,0===response.error.code?($state.go("branches"),flash.set($filter("translate")("Branch updated successfully."),"success",!0)):(flash.set($filter("translate")(response.error.message),"error",!1),$scope.save_btn=!1)})}else $timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})},$scope.RemoveBranchImages=function(attachmentId){SweetAlert.swal({title:$filter("translate")("Are you sure you want to remove this image?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&AttachementDelete["delete"]({attachmentId:attachmentId},function(response){0===response.error.code?(flash.set($filter("translate")("Your branch image has been deleted successfully."),"success",!1),$scope.branchEdit(),$scope.index()):(flash.set($filter("translate")("Your branch image couldn't deleted. Please try again."),"error",!1),$scope.branchEdit(),$scope.index())})})}}),angular.module("absApp").controller("ClinicAppointmentsController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,BranchesFactory,ClinicAppointmentFactory,ConstAppointmentStatus,AppointmentView,ConstUserType,Slug,ConstStatusColor){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Appointments"),$scope.ConstAppointmentStatus=ConstAppointmentStatus,$scope.ConstUserType=ConstUserType,$scope.ConstStatusColor=ConstStatusColor,$scope.maxSize=5,$scope.user={},$scope.user.role_id=parseInt($rootScope.auth.role_id);var params={};$scope.lastPage=1,$scope.itemsPerPage=20,$scope.branch_id="all",$scope.appoinment_statuses=[],$scope.appoinment_statuses.push({id:2,name:$filter("translate")("Approved")},{id:7,name:$filter("translate")("Present")},{id:4,name:$filter("translate")("Cancelled")},{id:3,name:$filter("translate")("Closed")},{id:0,name:$filter("translate")("All Status")}),$scope.appointment_status_id=ConstAppointmentStatus.Approved,$scope.index=function(){$scope.currentPage=void 0!==$scope.currentPage?parseInt($scope.currentPage):1,$state.params.type=void 0!==$state.params.type?$state.params.type:"approved",$scope.paramsType=$state.params.type,"Appointments"===$state.current.name?($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("My Appointments"),$scope.mybranches(),$scope.getAppointmentList($scope.paramsType,$scope.branch_id)):"AppointmentView"===$state.current.name&&($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Appointment Detail"),params.id=$state.params.id,params.filter='{"include":{"0":"user.user_profile","1":"provider_user.user_profile","2":"clinic_user","3":"book_by_user.user_profile","4":"branch","5":"appointment_type","6":"appointment_status","7":"specialty_disease"}}',AppointmentView.get(params).$promise.then(function(response){$scope.appointment=response.data;var name=$scope.appointment.provider_user.user_profile.first_name+" "+$scope.appointment.provider_user.user_profile.last_name;$scope.doctorSlug=Slug.slugify(name),$scope.todayDateTime=$filter("date")(new Date,"yyyy-MM-dd HH:mm")})),$scope.changeappointstatus=function(status){"confirm"==status?titleText="Are you sure to Confirm this Appointment?":"decline"==status?titleText="Are you sure to Decline this Appointment?":"cancel"==status?titleText="Are you sure to Cancel this Appointment?":"present"==status?titleText="Are you sure to change Present this Appointment?":"close"==status?titleText="Are you sure to Closed this Appointment?":"expiry"==status&&(titleText="Are you sure to Expired this Appointment?"),SweetAlert.swal({title:titleText,text:"",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Confirm",cancelButtonText:"No",closeOnConfirm:!0,closeOnCancel:!0},function(isConfirm){isConfirm&&ChangeStatus.get({id:$state.params.id,apt_status:status}).$promise.then(function(response){flash.set($filter("translate")(response.Success),"success",!0),$location.path("/appointments/approved")})})}},$scope.loader=!0,$scope.getAppointmentList=function(param_type,branch_id){var Where=[],api_filter={},Filter=[];Where.push({where:{},include:{}}),Filter.push({where:{},include:{}}),api_filter.clinic_user_id=$rootScope.auth.id,"approved"===param_type?api_filter.appointment_status_id=ConstAppointmentStatus.Approved:"present"===param_type?api_filter.appointment_status_id=ConstAppointmentStatus.Present:"closed"===param_type?api_filter.appointment_status_id=ConstAppointmentStatus.Closed:"cancelled"===param_type?api_filter.appointment_status_id=ConstAppointmentStatus.Cancelled:(api_filter.appointment_status_id={},api_filter.appointment_status_id.nin=[ConstAppointmentStatus.PaymentPending]),"all"!==branch_id&&(api_filter.branch_id=branch_id,$scope.branch_id=branch_id),$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,Where[0].include[0]="user.user_profile",Where[0].include[1]="provider_user.user_profile",Where[0].include[2]="clinic_user",Where[0].include[3]="book_by_user.user_profile",Where[0].include[4]="branch",Where[0].include[5]="appointment_type",Where[0].include[6]="appointment_status",Where[0].include[7]="specialty_disease",Where[0].include[8]="prescription",Where[0].where=api_filter,Where[0].skip=$scope.skipvalue,Where[0].limit=$scope.itemsPerPage,params.filter=JSON.stringify(Where[0]),params.type=$state.params.type,ClinicAppointmentFactory.get(params).$promise.then(function(response){response._metadata&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),$timeout(function(){$scope.appointments=response.data,$scope.isShown=response.data.length>0?!0:!1,$scope._metadata=response._metadata,$scope.loader=!1},500)})},$scope.mybranches=function(){params.filter='{"where":{"is_active": 1,"clinic_user_id":'+$rootScope.auth.id+"}}",BranchesFactory.get(params,function(response){angular.isDefined(response.data)&&($scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1)})},$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){$scope.getAppointmentList()},1e3)},$scope.changeStatus=function(branch_id,status){var branchData={};branchData.id=branch_id,branchData.is_active=status,SweetAlert.swal({title:$filter("translate")("Are you sure you want to change the status?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&BranchesEdit.put(branchData,function(response){0===response.error.code?(flash.set($filter("translate")("Your doctor has been deleted successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your doctor couldn't deleted. Please try again."),"error",!1),$state.reload())})})},$scope.today=function(){$scope.dt=new Date},$scope.today(),$scope.clear=function(){$scope.dt=null},$scope.open1=function(){$scope.popup1.opened=!0},$scope.open2=function(){$scope.popup2.opened=!0},$scope.formats=["yyyy-MM-dd","yyyy/MM/dd","dd.MM.yyyy","shortDate"],$scope.format=$scope.formats[1],$scope.altInputFormats=$scope.formats[1],$scope.popup1={opened:!1},$scope.popup2={opened:!1},$scope.BookingDate=function(bookingdate){$scope.appointment_date_search=$filter("date")(new Date(bookingdate),"yyyy-MM-dd"),$state.go("Appointments",{type:$state.params.type,page:$state.params.page,appointment_date:$scope.appointment_date_search})},$scope.reset_date_filter=function(){$state.go("Appointments",{type:$state.params.type,appointment_date:"",page:$state.params.page})},$scope.appointment_date_search=$state.params.appointment_date,$scope.appointment_date=new Date($state.params.appointment_date),$scope.appoinment_type=function(type){$state.go("Appointments",{type:type,page:$state.params.page})},$scope.index()}),angular.module("absApp").controller("ClinicDashboardController",function($scope,$state,$rootScope,$filter,$location,$auth,flash,$anchorScroll,$timeout,md5,ConstUserType,$uibModal,$uibModalStack,$cookies,SearchPatients,DoctorsFactory,AppointmentWeekList,BookingAppointmentDetails,ClinicAppointmentBookingAdd,ConstGenders){function daysAdd(slot_index){return{today:$scope.dateAddFunction(0,$scope.appointment_timeslots[slot_index].viewslot),day2:$scope.dateAddFunction(1,$scope.appointment_timeslots[slot_index].viewslot),day3:$scope.dateAddFunction(2,$scope.appointment_timeslots[slot_index].viewslot),day4:$scope.dateAddFunction(3,$scope.appointment_timeslots[slot_index].viewslot),day5:$scope.dateAddFunction(4,$scope.appointment_timeslots[slot_index].viewslot),day6:$scope.dateAddFunction(5,$scope.appointment_timeslots[slot_index].viewslot),day7:$scope.dateAddFunction(6,$scope.appointment_timeslots[slot_index].viewslot)}}function daysAddIntially(){return{today:$scope.dateAddFunction(0,$scope.viewslot),day2:$scope.dateAddFunction(1,$scope.viewslot),day3:$scope.dateAddFunction(2,$scope.viewslot),day4:$scope.dateAddFunction(3,$scope.viewslot),day5:$scope.dateAddFunction(4,$scope.viewslot),day6:$scope.dateAddFunction(5,$scope.viewslot),day7:$scope.dateAddFunction(6,$scope.viewslot)}}function addDays(theDate,days){return new Date(theDate.getTime()+24*days*60*60*1e3)}$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Dashboard")+" | "+$state.params.slug;var params={},appointmetHide="",lessShow="",moreShow="";$scope.maxSize=5,$scope.appointment_timeslots=[],$scope.ConstUserType=ConstUserType,$scope.gotoAnchor=function(x){$anchorScroll(x)},$scope.showDetail=function(e,doctorInfo){$scope.map={},$scope.doctorInfo=doctorInfo,$scope.map.showInfoWindow("doctor-info",doctorInfo.id)},$scope.init=function(){$scope.currentPage=void 0!==$scope.currentPage?parseInt($scope.currentPage):1},$scope.GetAppointmentSlots=function(appointment_settings_id,branch_id,doctor_user_id){$scope.loadMore=function(){appointmetHide=angular.element(document.getElementsByClassName("showmore")),appointmetHide.hasClass("hide")&&(appointmetHide.removeClass("hide"),appointmetHide.addClass("show"));var moreShow=angular.element(document.getElementsByClassName("showmore_btn"));moreShow.hasClass("show")&&(moreShow.removeClass("show"),moreShow.addClass("hide"));var lessShow=angular.element(document.getElementsByClassName("showless_btn"));lessShow.hasClass("hide")&&(lessShow.addClass("show"),lessShow.removeClass("hide"))},$scope.showLess=function(){appointmetHide=angular.element(document.getElementsByClassName("showmore")),appointmetHide.hasClass("show")&&(appointmetHide.removeClass("show"),appointmetHide.addClass("hide")),moreShow=angular.element(document.getElementsByClassName("showmore_btn")),moreShow.hasClass("hide")&&(moreShow.removeClass("hide"),moreShow.addClass("show")),lessShow=angular.element(document.getElementsByClassName("showless_btn")),lessShow.hasClass("show")&&(lessShow.addClass("hide"),lessShow.removeClass("show"))},$scope.active_id=appointment_settings_id,$scope.ViewSlot=1,$scope.userLoadMore=5;var slot_index=0,time_slot_set_id=0;angular.isDefined(appointment_settings_id)&&null!==appointment_settings_id&&(params={},params.apt_set_id=appointment_settings_id,params.view_slot_week=$scope.ViewSlot,$scope.loader=!0,AppointmentWeekList.get(params).$promise.then(function(response){$scope.appointment_timeslots.push({days:daysAddIntially(),slotIndex:slot_index,viewslot:response.viewslot,appointmentLoadMore:$scope.userLoadMore,timeslots:response.data,show_button:response.data.show_button,apt_set_id:appointment_settings_id,branch_id:branch_id,doctor_user_id:doctor_user_id}),angular.forEach($scope.appointment_timeslots,function(timeslot,value){timeslot.apt_set_id===appointment_settings_id&&(time_slot_set_id=value)}),$timeout(function(){$scope.loader=!1,$scope.appointmentlists=$scope.appointment_timeslots[time_slot_set_id]},500)}))},$scope.dateAddFunction=function(days,multipleCount){var dateValue={};$scope.positions=[],parseInt(multipleCount)>1?$scope.addDays=7*(parseInt(multipleCount)-1)+parseInt(days):$scope.addDays=parseInt(days);var displayDate="",monthShortNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return"0"===parseInt(days)&&"1"===parseInt(multipleCount)?(displayDate=new Date,dateValue={day:$filter("date")(displayDate,"EEE"),date:displayDate.getDate()+"-"+monthShortNames[parseInt(displayDate.getMonth())]+"-"+displayDate.getFullYear(),dayE:moment(displayDate).format("ddd")}):"0"===parseInt(days)&&parseInt(multipleCount)>1?(days=7*(parseInt(multipleCount)-1),displayDate=addDays(new Date,days),dateValue={day:$filter("date")(displayDate,"EEE"),date:displayDate.getDate()+"-"+monthShortNames[parseInt(displayDate.getMonth())]+"-"+displayDate.getFullYear(),dayE:moment(new Date).add(days,"days").format("ddd")}):(displayDate=addDays(new Date,$scope.addDays),dateValue={day:$filter("date")(displayDate,"EEE"),date:displayDate.getDate()+"-"+monthShortNames[parseInt(displayDate.getMonth())]+"-"+displayDate.getFullYear(),dayE:moment(new Date).add($scope.addDays,"days").format("ddd")})},$scope.init(),$scope.nextWeek=function(value,slot_index){slot_index=0,$scope.appointment_timeslots[slot_index].viewslot=parseInt($scope.appointment_timeslots[slot_index].viewslot)+1,params={},params.apt_set_id=value,params.view_slot_week=$scope.appointment_timeslots[slot_index].viewslot,AppointmentWeekList.get(params).$promise.then(function(response){$scope.appointment_timeslots[slot_index].timeslots=response.data,$scope.appointment_timeslots[slot_index].days=daysAdd(slot_index),$scope.appointment_timeslots[slot_index].viewslot=response.viewslot,$scope.appointment_timeslots[slot_index].show_button=response.data.show_button})},$scope.prevWeek=function(value,slot_index){slot_index=0,"1"===$scope.appointment_timeslots[slot_index].viewslot?$scope.appointment_timeslots[slot_index].viewslot=1:($scope.appointment_timeslots[slot_index].viewslot=parseInt($scope.appointment_timeslots[slot_index].viewslot)-1,params={},params.apt_set_id=value,params.view_slot_week=$scope.appointment_timeslots[slot_index].viewslot,AppointmentWeekList.get(params).$promise.then(function(response){$scope.appointment_timeslots[slot_index].timeslots=response.data,$scope.appointment_timeslots[slot_index].days=daysAdd(slot_index),$scope.appointment_timeslots[slot_index].viewslot=response.viewslot,$scope.appointment_timeslots[slot_index].show_button=response.data.show_button}))},$scope.isAuthenticated=function(){return $auth.isAuthenticated()},$scope.GetAllDoctors=function(){var Where=[],api_filter={};Where.push({where:{},include:{}}),api_filter.clinic_user_id=$rootScope.auth.id,Where[0].include[0]="user.user_profile",Where[0].include[1]="user.attachment",Where[0].include[2]="branch",Where[0].include[3]="branch.city",Where[0].include[4]="appointment_settings",Where[0].include[5]="user.primary_speciality",Where[0].where=api_filter,params.filter=JSON.stringify(Where[0]),params.is_slot_need=1,params.view_slot_week=1,DoctorsFactory.get(params,function(response){$scope.doctors=response.data,$scope.dataLength=response.data.length>0?!0:!1,angular.forEach($scope.doctors,function(doctoruser,key){var provider_user=doctoruser;provider_user.user.user_image=provider_user.user.user_profile.gender_id===ConstGenders.Female?"images/femaledoctor.jpg":"images/maledoctor.jpg",angular.isDefined(provider_user.user.attachment)&&null!==provider_user.user.attachment&&(provider_user.user.user_image="images/medium_thumb/UserAvatar/"+provider_user.user.attachment.id+"."+md5.createHash("UserAvatar"+provider_user.user.attachment.id+"pngmedium_thumb")+".png"),$scope.doctors[key].user.user_image=provider_user.user.user_image}),$scope.doctors.length>0&&$scope.GetAppointmentSlots($scope.doctors[0].appointment_settings.id,$scope.doctors[0].branch_id,$scope.doctors[0].user_id)})},$scope.GetAllDoctors(),$scope.ClinicbookNow=function(branch_id,doctor_user_id,apt_date,apt_time){$scope.modalInstance=$uibModal.open({templateUrl:"scripts/plugins/Clinic/Clinic/views/default/appointment_booking.html",animation:!0,controller:function($scope,$rootScope,$window,$stateParams,$filter,md5,$state,$timeout,$uibModal,$uibModalStack){$rootScope.closemodel=function(){$uibModalStack.dismissAll()},$scope.data={},$scope.branch_id=branch_id,$scope.doctor_user_id=doctor_user_id,$scope.apt_date=apt_date,$scope.apt_time=apt_time,$scope.appointmentTypes=[],$scope.appointmentTypes.push({id:2,name:$filter("translate")("Phone")},{id:3,name:$filter("translate")("Walking")});var params={};params.filter='{"where":{"user_id":'+doctor_user_id+', "branch_id":'+branch_id+'},"include":{"0":"branch","1":"user","2":"user.user_profile","3":"user.attachment","4":"branch.city","7":"branch.country","8":"user.primary_speciality"}}',BookingAppointmentDetails.get(params,function(response){$scope.doctor=response.data[0],$scope.doctor.user.user_image="images/maledoctor.jpg",angular.isDefined($scope.doctor.user.attachment)&&null!==$scope.doctor.user.attachment&&($scope.doctor.user.user_image="images/big_thumb/UserAvatar/"+$scope.doctor.user.attachment.id+"."+md5.createHash("UserAvatar"+$scope.doctor.user.attachment.id+"pngbig_thumb")+".png")}),$scope.AptBookNow=function(appointment){var appointmentData={};appointmentData.provider_user_id=$scope.doctor_user_id,appointmentData.branch_id=$scope.branch_id,appointmentData.appointment_date=$filter("date")(new Date($scope.apt_date),"yyyy-MM-dd"),appointmentData.appointment_time=$scope.apt_time,appointmentData.appointment_type_id=appointment.appointment_type_id,appointmentData.first_name=appointment.first_name,appointmentData.last_name=appointment.last_name,appointmentData.email=appointment.email,appointmentData.phone=appointment.phone,appointmentData.appointment_status_id=2,appointmentData.country_id="102",ClinicAppointmentBookingAdd.post(appointmentData,function(response){$scope.closemodel();var flashMessage;0===parseInt(response.error.code)?($state.reload(),flashMessage=$filter("translate")("Appointment added successfully with date "+response.data.appointment_date+" and time "+response.data.appointment_time),flash.set(flashMessage,"success",!0)):($scope.save_btn=!1,flashMessage=$filter("translate")("Appointment added failed."),flash.set(flashMessage,"error",!1))},function(error){$scope.mobileErr=error.data.error.raw_message.mobile,flash.set($filter("translate")(error.data.error.raw_message.mobile),"error",!1)})},$scope.already_added=!1,$scope.searchPatient=function(mobile_number){""!==mobile_number&&void 0!==mobile_number&&($scope.data.phone=mobile_number,params.filter='{"where":{"mobile": "'+$scope.data.phone+'"}}',SearchPatients.get(params,function(response){$scope.patients=response.data,$scope.already_added=response.data.length>0?!0:!1,$scope.addPatients=response.data.length>0?!1:!0,$scope.showPatients=!0}))}},size:"lg"})}}),angular.module("absApp").controller("ClinicController",function($scope,$state,$rootScope,$filter,$location,$auth,$timeout,flash,$anchorScroll,ConstUserType,BranchesFactory,UserViewProfileFactory,MyDoctorsFactory,UserReviews,UserAppointment,md5,ConstGenders,NgMap){$scope.init=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("View Profile")+" | "+$state.params.slug,$scope.currentPage=void 0!==$scope.currentPage?parseInt($scope.currentPage):1};var params={};params.id=$state.params.id,params.filter='{"include":{"0":"attachment","1":"user_profile","2":"user_profile.city","3":"user_profile.country"}}',UserViewProfileFactory.get(params).$promise.then(function(response){if($scope.user=response.data,angular.isDefined($scope.user.attachment)&&null!==$scope.user.attachment){var hash=md5.createHash($scope.user.attachment["class"]+$scope.user.attachment.id+"pngsmall_thumb");$scope.user.user_image="images/small_thumb/"+$scope.user.attachment["class"]+"/"+$scope.user.attachment.id+"."+hash+".png"}else $scope.user.user_image="images/default.png";$rootScope.settings.SITE_ENABLED_PLUGINS.indexOf("Clinic/Review")>-1==!0&&$auth.isAuthenticated()&&($rootScope.auth.role_id===ConstUserType.Patient?UserAppointment.get({doctor_id:$scope.userId,user_id:$rootScope.auth.id}).$promise.then(function(Appointmentresponse){$scope.isAlreadyVisted=Appointmentresponse.data.is_visited,$scope.isAlreadyVisted===!0?($scope.isvisited=!0,UserReviews.get({doctor_id:$scope.userId,user_id:$rootScope.auth.id}).$promise.then(function(reviewResponse){$scope.authUserAddedReview=reviewResponse.data,$scope.userReviewData=reviewResponse.status,$scope.userReviewData===!0?($scope.reviewEnable=!1,$scope.alreadyadded=!0):($scope.reviewEnable=!0,$scope.alreadyadded=!1)})):($scope.reviewEnable=!1,$scope.isvisited=!1)}):$scope.reviewEnable=!1)}),$scope.init(),$scope.isAuthenticated=function(){return $auth.isAuthenticated()},$scope.getReviewsList=function(){params={doctor_id:$scope.userId,page:$scope.currentPage},UserReviews.get(params).$promise.then(function(response){$scope.doctorReviews=response.data,$scope._metadata=response.meta.pagination,$scope.metadata=response.meta.pagination})},$scope.paginate=function(){$scope.currentPage=parseInt($scope.currentPage),$scope.getReviewsList()},$scope.mapDisplay=function(branchData){angular.forEach(branchData,function(value,key){var cityValue="";if("undefined"!=typeof value){"undefined"!=typeof value.city&&(cityValue=","+value.city.name+",");var postal_codeValue="";"undefined"!=typeof value.postal_code&&(postal_codeValue=","+value.postal_code+","); var countryValue="";if("undefined"!=typeof value.country&&(countryValue=","+value.country.name+","),"undefined"!=typeof value.latitude&&"undefined"!=typeof value.longitude&&null!==value.latitude&&null!==value.longitude){var formattedAddress=postal_codeValue+cityValue+countryValue,formattedAddressResult=formattedAddress.substring(1,formattedAddress.length-1).replace(/,,/g,",");$scope.positions.push({id:value.id,branch:value.name,address1:value.address,address2:formattedAddressResult,city:cityValue,country:countryValue,postal_code:value.postal_code,lat:value.latitude,lon:value.longitude})}}})},NgMap.getMap().then(function(map){$scope.map=map}),$scope.showDetail=function(e,branchInfo){$scope.branchInfo=branchInfo,$scope.map.showInfoWindow("branch-info",branchInfo.id)},$scope.GetDoctors=function(branch_id,clinic_user_id){$scope.loader=!0,$scope.active_id=branch_id;var params={};params.filter='{"where":{"clinic_user_id":'+clinic_user_id+', "branch_id":'+branch_id+'},"include":{"0":"branch","1":"user","2":"user.user_profile","3":"user.attachment","4":"user.user_profile.city","5":"user.user_profile.country","6":"branch.branches_specialty.specialty","7":"branch.branches_insurance.insurance","8":"user.primary_speciality"}}',MyDoctorsFactory.get(params,function(response){$timeout(function(){$scope.loader=!1,$scope.doctors=response.data,$scope.doctorLength=response.data.length>0?!0:!1,angular.forEach($scope.doctors,function(doctoruser,key){var provider_user=doctoruser;provider_user.user.user_image=provider_user.user.user_profile.gender_id===ConstGenders.Female?"images/femaledoctor.jpg":"images/maledoctor.jpg",angular.isDefined(provider_user.user.attachment)&&null!==provider_user.user.attachment&&(provider_user.user.user_image="images/normal_thumb/UserAvatar/"+provider_user.user.attachment.id+"."+md5.createHash("UserAvatar"+provider_user.user.attachment.id+"pngnormal_thumb")+".png"),$scope.doctors[key].user.user_image=provider_user.user.user_image})},500)})},$scope.GetAllBranches=function(){var params={};params.filter='{"where":{"clinic_user_id":'+$state.params.id+', "is_active":"1"},"include":{"0":"city","1":"country"},"limit":50,"skip":0}',$scope.positions=[],$scope.mapCenter="",BranchesFactory.get(params,function(response){$scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1,$scope.mapDisplay($scope.branches),$scope.mappositions=$scope.positions,$scope.mapCenter=[$scope.positions[0].lat,$scope.positions[0].lon],$scope.branches.length>0&&$scope.GetDoctors($scope.branches[0].id,$scope.branches[0].clinic_user_id)})},$scope.GetAllBranches()}),angular.module("absApp").controller("NewsFeedsController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,ConstUserType,SweetAlert,NewsFeedsFactory,NewsFeedsActionsFactory){function getNewsFeeds(params){NewsFeedsFactory.get(params).$promise.then(function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),angular.isDefined(response.data)&&($scope.dataLength=response.data.length>0?!0:!1,$scope.newsfeeds=response.data,$scope.maxSize=5),$scope.loader=!1})}if($scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("News Feeds"),$timeout(function(){$scope.text_box=!0},1e3)},$scope.index(),$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$scope.loader=!0,"news_feeds"===$state.current.name){$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0;var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}",getNewsFeeds(params)}else"news_feeds_add"===$state.current.name?($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add News Feeds"),$scope.newsFeedsAdd=function($valid,data){if(angular.isDefined(data.content)||($scope.content_error=!0,$scope.content_info="Required"),$valid){var newsFeedsData={};newsFeedsData.user_id=$rootScope.auth.id,newsFeedsData.title=data.title,newsFeedsData.content=data.content,NewsFeedsFactory.post(newsFeedsData).$promise.then(function(response){0===response.error.code?($state.go("news_feeds"),flash.set($filter("translate")("News Feeds added successfully."),"success",!1)):flash.set($filter("translate")("FavorNews Feeds failure."),"error",!1)})}}):"news_feeds_edit"===$state.current.name?($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Edit News Feeds"),NewsFeedsActionsFactory.get({id:$state.params.id}).$promise.then(function(response){$scope.data=response.data}),$scope.newsFeedsEdit=function($valid,data){null===data.content&&($scope.content_error=!0,$scope.content_info="Required"),$valid&&NewsFeedsActionsFactory.put(data).$promise.then(function(response){0===response.error.code?($state.go("news_feeds"),flash.set($filter("translate")("News Feeds updated successfully."),"success",!1)):flash.set($filter("translate")("FavorNews Feeds failure."),"error",!1)})}):"news_feeds_view"===$state.current.name&&($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("View News Feeds"),NewsFeedsActionsFactory.get({id:$state.params.id}).$promise.then(function(response){$scope.newsfeed=response.data}));$scope.remove_newsfeeds=function(id){SweetAlert.swal({title:$filter("translate")("Are you sure want to remove your news feeds?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes",cancelButtonText:"No",closeOnConfirm:!0,closeOnCancel:!0},function(isConfirm){isConfirm&&NewsFeedsActionsFactory["delete"]({id:id}).$promise.then(function(response){0===response.error.code?($timeout(function(){$state.go("news_feeds",{},{reload:!0})},500),flash.set($filter("translate")("News Feeds deleted successfully."),"success",!1)):flash.set($filter("translate")("News Feeds deleted failure."),"error",!1)})})},$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){getNewsFeeds(params)},1e3)}}).filter("removeHTMLTags",function(){return function(text){return text?String(text).replace(/<[^>]+>/gm,""):""}}),angular.module("absApp.Common.UserEducations").directive("userEducations",function(){return{restrict:"E",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/educations.html",controller:function($scope){$scope.index=function(){$scope.user_educations=[],$scope.usereducation=$scope.user_educations;$scope.user_educations=[{education:"",organization:"",location:"",certification_date:new Date}]},$scope.addUserEducation=function(){$scope.user_educations.push({education:"",organization:"",location:"",certification_date:new Date})},$scope.deleteUserEducation=function(education_id,index){$scope.user_educations.splice(index,1)},$scope.index()}}}),angular.module("absApp").factory("BranchesFactory",["$resource",function($resource){return $resource("/api/v1/branches",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("BranchesEdit",["$resource",function($resource){return $resource("/api/v1/branches/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("BranchesTimeSlot",["$resource",function($resource){return $resource("/api/v1/branches/:id/timeslot",{id:"@id"},{get:{method:"GET"}})}]).factory("DoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("DoctorsEdit",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveDoctor",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("MyDoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"}})}]).factory("SearchDoctors",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("SearchUsers",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("SearchPatients",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("UsersFactory",["$resource",function($resource){return $resource("/api/v1/branch_users",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("UsersEdit",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveUser",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("UserById",["$resource",function($resource){return $resource("/api/v1/users/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("AppoinmentSettingsService",["$resource",function($resource){return $resource("/api/v1/appointment_settings/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("AppoinmentModificationService",["$resource",function($resource){return $resource("/api/v1/appointment_modifications",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("AppoinmentModifications",["$resource",function($resource){return $resource("/api/v1/appointment_modifications/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},getbyid:{method:"GET"},"delete":{method:"DELETE"}})}]).factory("ClinicAppointmentFactory",["$resource",function($resource){return $resource("/api/v1/appointments",{},{get:{method:"GET"}})}]).factory("ClinicAppointmentBookingAdd",["$resource",function($resource){return $resource("/api/v1/appointments",{},{post:{method:"POST"}})}]).factory("AppointmentView",["$resource",function($resource){return $resource("/api/v1/appointments/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("PermissionsFactory",["$resource",function($resource){return $resource("/api/v1/permissions",{},{get:{method:"GET"}})}]).factory("LocationsFactory",["$resource",function($resource){return $resource("/api/v1/locations",{},{get:{method:"GET"}})}]).factory("SpecialtiesFactory",["$resource",function($resource){return $resource("/api/v1/specialties",{},{get:{method:"GET"}})}]).factory("InsurancesFactory",["$resource",function($resource){return $resource("/api/v1/insurances",{},{get:{method:"GET"}})}]).factory("LanguagesFactory",["$resource",function($resource){return $resource("/api/v1/languages",{},{get:{method:"GET"}})}]).factory("CountriesFactory",["$resource",function($resource){return $resource("/api/v1/countries",{},{get:{method:"GET"}})}]).factory("NewsFeedsFactory",["$resource",function($resource){return $resource("/api/v1/news_feeds",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("NewsFeedsActionsFactory",["$resource",function($resource){return $resource("/api/v1/news_feeds/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},"delete":{method:"DELETE"}})}]).factory("AttachementDelete",["$resource",function($resource){return $resource("/api/v1/attachments/:attachmentId",{attachmentId:"@attachmentId"},{"delete":{method:"DELETE"}})}]),angular.module("absApp.Clinic.Clinic").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/appoinment_settings.html",'

    Dr. {{user.username}}{{\' \\\'s Consultation Settings\'| translate}}

    {{\'Branch:\' | translate}}{{branch.name |translate}}

    {{open_lunch}}
    {{lunch_resume}}
    {{resume_close}} {{open_close}}
    {{sunday_resume_close}} {{sunday_open_close}}
    {{sunday_open_lunch}}
    {{sunday_lunch_resume}}
    {{monday_resume_close}} {{monday_open_close}}
    {{monday_open_lunch}}
    {{monday_lunch_resume}}
    {{tuesday_resume_close}} {{tuesday_open_close}}
    {{tuesday_open_lunch}}
    {{tuesday_lunch_resume}}
    {{wednesday_resume_close}} {{wednesday_open_close}}
    {{wednesday_open_lunch}}
    {{wednesday_lunch_resume}}
    {{thursday_resume_close}} {{thursday_open_close}}
    {{thursday_open_lunch}}
    {{thursday_lunch_resume}}
    {{friday_resume_close}} {{friday_open_close}}
    {{friday_open_lunch}}
    {{friday_lunch_resume}}
    {{saturday_resume_close}} {{saturday_open_close}}
    {{saturday_open_lunch}}
    {{saturday_lunch_resume}}
    '), $templateCache.put("scripts/plugins/Clinic/Clinic/views/default/appointment_booking.html",'
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/appointment_modification.html",'

    {{\'Unavailable Days\'| translate}} {{\'Add\'|translate}}

    {{\'Date\'| translate}} {{\'Type\'| translate}} {{\'Slot\'| translate}} {{\'Status\'| translate}} {{\'Action\'| translate}}
    {{modifyValue.appoint_date | dateFormat}} {{\'Day Off\'| translate}} {{\'Schedule Change\'| translate}} --
    {{\'Edit\' | translate}} {{\'Delete\' | translate}}

    {{\'No Records Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/appointment_modification_add.html",'

    {{\'Specify non availability days & timeslots\'| translate}}

    {{"Go and Update Your Appointment Setttings Until Not able to modifiied your Settings" | translate }}

    {{\'Specify non availability days & timeslots\'| translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/appointment_modification_edit.html",'

    {{\'Specify non availability days & timeslots\'| translate}}

    {{"Go and Update Your Appointment Setttings Until Not able to modifiied your Settings" | translate }}

    {{\'Specify non availability days & timeslots\'| translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/appointment_view.html",'

    {{\'Appointment Details\' | translate }}

    {{\'The appointment is scheduled at\' | translate }} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_time}}
    {{\'Branch\' | translate }} {{appointment.branch.name}}
    {{\'Doctor\' | translate }} {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}}
    {{\'Patient Name\' | translate }} {{appointment.user.user_profile.first_name}} {{appointment.user.user_profile.last_name}}
    {{\'Patient Address\' | translate }} {{appointment.user.user_profile.address}}
    {{\'Email\'| translate}} {{appointment.user.email}}
    {{\'Phone\'| translate}} {{appointment.user.user_profile.phone}}
    {{\'Gender\' | translate }} {{appointment.user.user_profile.gender.name}}
    {{\'Where\' | translate }} {{appointment.user.user_profile.address}} {{appointment.user.user_profile.city.name}}, {{appointment.user.user_profile.country.name}}, {{appointment.user.user_profile.postal_code}}
    {{\'Patient Note\' | translate }} {{appointment.customer_note}} --
    {{\'Doctor Note\' | translate }} {{appointment.provider_note}} --
    {{\'Patient Status\' | translate }} {{\'Already Seen\' | translate }} {{\'New Patient\' | translate }}
    {{\'Reason for visit\' | translate }} {{appointment.specialty_disease.name}}
    {{\'Service Duration\' | translate }} {{appointment.specialty_disease.service_duration}} --
    {{\'Appointment Status\' | translate }} {{appointment.appointment_status.name}}
    {{\'Appointment Cancel\' | translate }} {{appointment.appointment_status.name}}
    {{\'Patient Medical History\' | translate }} {{\'Click Here\' | translate}}
    {{\'Guest Patient Details\' | translate }}
    {{\'Guest name\' | translate }} {{appointment.guest_first_name}} {{appointment.guest_last_name}}
    {{\'Guest email\' | translate }} {{appointment.guest_email}}
    {{\'Guest Dob\' | translate }} {{appointment.guest_dob}}
    {{\'Guest Gender\' | translate }} {{\'Male\' | translate }} {{\'Female\' | translate }}
    {{\'Patient Speciality Details\' | translate }}
    {{data.FormField.data[0].name}} {{data.response}} {{data.attachments.thumb[0].url}}










    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_add.html",'

    {{\'Add Branch\'|translate}}

    {{\'Branch Info\'| translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{ \'Enter Valid Fee\' | translate }}
    {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Branch Images\'| translate}}
    {{\'Allowed extensions: jpg, jpeg, gif, png\'|translate}}
    {{\'Address Info\'| translate}}

    {{\'Address Line 1\'| translate}}*

    {{\'Please select address from autocomplete\'| translate}} {{\'Please enter your address\'| translate }}
    {{\'Please choose address from autocomplete.\' | translate}}

    {{\'City\'| translate}}*

    {{\'Required\'| translate }}

    {{\'State\'| translate}}*

    {{\'Required\'| translate }}

    {{\'Country\'| translate}}*

    {{\'Please choose your country of residence\'| translate }}

    {{\'Postal Code\'| translate}}

    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_doctors.html",'

    {{"Kindly update the doctor\'s profile and Consultation settings details otherwise these doctors will not display while patient searching the doctors." | translate}}

    {{branch.name}}: {{\'My Branch Doctors\'|translate}} {{\'My Branches\'|translate}} {{\'Add Doctor\'|translate}}

    {{\'Doctor\'|translate}} {{\'Phone\'|translate}} {{\'E-Mail\'|translate}} {{\'Action\'|translate}}
    {{doctor.user.user_profile.first_name |translate}} {{doctor.user.user_profile.last_name |translate}} {{doctor.user.mobile_code |translate}} {{doctor.user.mobile |translate}} {{doctor.user.email |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}} {{\'Consultation Settings\' | translate}} {{\'Availability\' | translate}}

    {{\'No Records Found\'|translate}}

    '), $templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_doctors_add.html",'
    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'The mobile number is already registered with some other users. Please try with other number.\'| translate}}
    {{\'VERIFIED DOCTOR\'| translate}}
    {{doctor.username}}

    {{doctor.username}}

    {{doctor.user_profile.gender.name}}

    {{doctor.user_profile.gender.name}}

    {{doctor.user_profile.address}}

    {{doctor.mobile_code}} {{doctor.mobile}} (Personal)

    {{doctor.email}}

    {{\'View Profile\' | translate}}

    {{\'The mobile number is not used by users. Please add new doctor with following fields.\'| translate}}

    {{\'Add Doctor\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{ \'Maximum length is 5\' | translate }} {{ \'Minimum length is 1\' | translate }} {{\'Enter Valid Room Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_doctors_edit.html",'

    {{\'Edit Doctor\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Required\'| translate }}
    {{ \'Maximum length is 5\' | translate }} {{ \'Minimum length is 1\' | translate }} {{\'Enter Valid Room Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_edit.html",'

    {{\'Edit Branch\'|translate}} - {{data.name}}
    {{\'Branch Info\'| translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    * {{ \'Required\' | translate }} {{ \'Enter Valid Fee\' | translate }}
    * {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Branch Images\'| translate}}
    {{\'Allowed extensions: jpg, jpeg, gif, png\'|translate}}
    {{\'Address Info\'| translate}}

    {{\'Address Line 1\'| translate}}*

    {{\'Please select address from autocomplete\'| translate}} {{\'Please enter your address\'| translate }}
    {{\'Please choose address from autocomplete.\' | translate}}

    {{\'City\'| translate}}*

    {{\'Required\'| translate }}

    {{\'State\'| translate}}*

    {{\'Required\'| translate }}

    {{\'Country\'| translate}}*

    {{\'Please choose your country of residence\'| translate }}

    {{\'Postal Code\'| translate}}

    {{\'Cancel\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_profile.html",'

    {{branch.name}}

    {{branch.address}},

    {{branch.postal_code}} {{branch.city.name}}, {{branch.country.name}}

    {{\'Specialist Doctors\'| translate}}

    {{\'No Doctors Available\'|translate}}
    • {{branchSpecialty.specialty.name}}
    • {{branchInsurance.insurance.name}}
    '), $templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_users.html",'

    {{branch.name}}:{{\'My Branch Users\'|translate}} {{\'My Branches\'|translate}} {{\'Add User\'|translate}}

    {{\'Sub Account\'|translate}} {{\'Permission\'|translate}} {{\'Action\'|translate}}
    {{branchUser.user.user_profile.first_name |translate}} {{branchUser.user.user_profile.last_name |translate}} {{branchUser.permissions |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_users_add.html",'

    {{\'Add User\'|translate}}

    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Cancel\'|translate}}
    {{\'The mobile number is already registered with some other users. Please try with other number.\'| translate}}

    {{user.user_profile.first_name}} {{user.user_profile.last_name}}

    {{\'The mobile number is not used by users. Please add new user with following fields.\'| translate}}

    {{\'Add User\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}

    {{\'Appoinment Permissions\'| translate}}: {{\'AppointmentList\'| translate}}, {{\'AppointmentAdd\'| translate}}, {{\'AppointmentEdit\'| translate}}, {{\'AppointmentCancel\'| translate}}.

    {{\'Doctors Permissions\'| translate}}: {{\'DoctorsList\'| translate}}, {{\'DoctorsAdd\'| translate}}, {{\'DoctorsEdit\'| translate}}, {{\'DoctorsAppointmentSetting\'| translate}}, {{\'DoctorsAppointmentModification\'| translate}}.

    {{\'Account Permissions\'| translate}}: {{\'AccountInfo\'| translate}}, {{\'AccountPayment\'| translate}}.

    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Add your sub-account"|translate}}

    • {{\'Sub Account\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branch_users_edit.html",'

    {{\'Edit User\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Required\'| translate }} {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Add your doctor"|translate}}

    • {{\'Branch Doctor\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/branches.html",'

    {{\'My Branches\'|translate}} {{\'Add Branch\'|translate}}

    {{\'Branch\'|translate}} {{\'Phone\'|translate}} {{\'Address\'|translate}} {{\'City\'|translate}} {{\'Consultation Fee\'|translate}} {{\'Status\'|translate}} {{\'Action\'|translate}}
    {{branch.name |translate}} {{branch.phone_number |translate}} {{branch.address |translate}} {{branch.city.name |translate}} {{branch.consultation_fee}} {{\'Edit\' | translate}} {{\'Manage Doctors\' | translate}} {{\'Manage Users\' | translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/clinic_appointments.html",'
    {{\'Appointment.No\' | translate}}
    {{\'Branch\' | translate}} {{\'Doctor Name\' | translate}} {{\'Patient Name\'| translate}} {{\'Appointment\' | translate}} {{\'Date & Time\' | translate}} {{\'Appointment Via\'| translate}} {{\'Booked by others\' | translate}} {{\'Status\' | translate}} {{\'Prescription\' | translate}}
    {{appointment.appointment_token}} {{appointment.branch.name}} {{\'Dr\' | translate}}. {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}} {{appointment.user.user_profile.first_name}} {{appointment.user.user_profile.last_name}} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_type.name}} {{appointment.book_by_user.user_profile.first_name}} {{appointment.book_by_user.user_profile.last_name}} -- {{appointment.appointment_status.name}} {{\'At Present\'| translate}} {{\'Reschedule/Cancel\'| translate}} {{\'Mark as Arrived\'| translate}} {{\'Mark as Closed\'| translate}} {{\'View\'| translate}} {{\'Not yet\'| translate}}

    {{\'No Records Found\' |translate}}

    {{\'No Records Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/clinic_dashboard.html",'

    {{\'Book Appointment\' | translate}}

    {{\'Doctors\' | translate}}

    • {{\'Dr.\' | translate}} {{doctor.user.user_profile.first_name}} {{doctor.user.user_profile.last_name}}
      {{\'Dr.\' | translate}} {{doctor.user.user_profile.first_name}} {{doctor.user.user_profile.last_name}}

      {{doctor.user.primary_speciality.name}}

      {{doctor.branch.name}}

    {{ \'Book appointment\' | translate }}

      • {{appointmentlists.days.today.day}}
      • {{appointmentlists.days.today.date}}
      • {{appointmentlists.days.day2.day}}
      • {{appointmentlists.days.day2.date}}
      • {{appointmentlists.days.day3.day}}
      • {{appointmentlists.days.day3.date}}
      • {{appointmentlists.days.day4.day}}
      • {{appointmentlists.days.day4.date}}
      • {{appointmentlists.days.day5.day}}
      • {{appointmentlists.days.day5.date}}
      • {{appointmentlists.days.day6.day}}
      • {{appointmentlists.days.day6.date}}
      • {{appointmentlists.days.day7.day}}
      • {{appointmentlists.days.day7.date}}
    '), $templateCache.put("scripts/plugins/Clinic/Clinic/views/default/clinic_profile.html",'

    {{branchInfo.branch}}

    {{branchInfo.address1}},

    {{branchInfo.city}}, {{branchInfo.country}}

    • {{branch.name}}

    {{\'No Branches Found\'|translate}}

    • {{branchSpecialty.specialty.name}}
    • {{branchInsurance.insurance.name}}

    {{\'Specialist Doctors\'| translate}}

    {{\'No Doctors Found\'|translate}}

    • Image

      {{\'Dr\'|translate}}. {{doctor.user.user_profile.first_name}} {{doctor.user.user_profile.last_name}}

      {{doctor.user.primary_speciality.name}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/educations.html",'
    # Education Organization Location Certification Date
    {{user_educations.indexOf(user_education) + 1}}
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/my_branches.html",'

    {{\'My Branches\'|translate}}

    {{\'Clinic\'|translate}} {{\'Branch\'|translate}} {{\'Address\'|translate}} {{\'Phone\'|translate}} {{\'Country\'|translate}} {{\'City\'|translate}} {{\'Status\'|translate}}
    {{my_branch.clinic_user.user_profile.display_name}} {{my_branch.branch.name |translate}} {{my_branch.branch.address |translate}} {{my_branch.branch.phone_number |translate}} {{my_branch.branch.country.name |translate}} {{my_branch.branch.city.name |translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/my_doctors.html",'

    {{\'My Doctors\'|translate}}

    {{\'Branch\'|translate}} {{\'Address\'|translate}} {{\'Phone\'|translate}} {{\'Country\'|translate}} {{\'City\'|translate}} {{\'Status\'|translate}} {{\'Action\'|translate}}
    {{my_doctor.branch.name |translate}} {{my_doctor.branch.address |translate}} {{my_doctor.branch.phone_number |translate}} {{my_doctor.branch.country.name |translate}} {{my_doctor.branch.city.name |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}} {{\'Consultation Settings\' | translate}} {{\'Availability\' | translate}}

    {{\'No Record Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/my_users.html",'

    {{\'My Users\'|translate}}

    {{\'Branch\'|translate}} {{\'Sub Account\'|translate}} {{\'Permission\'|translate}} {{\'Action\'|translate}}
    {{branchUser.branch.name |translate}} {{branchUser.user.user_profile.first_name |translate}} {{branchUser.user.user_profile.last_name |translate}} {{branchUser.permissions |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/news_feeds.html",'

    {{\'News Feeds\'|translate}}

    {{\'No News Feeds Found\' |translate}}


    {{"News Feeds"|translate}}

    • {{\'Clinic News Feeds\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/news_feeds_add.html",'

    {{\'Add News Feeds\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"News Feeds"|translate}}

    • {{\'Clinic News Feeds\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/news_feeds_edit.html",'

    {{\'Edit News Feeds\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"News Feeds"|translate}}

    • {{\'Clinic News Feeds\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Clinic/views/default/news_feeds_view.html",'

    {{\'News Feeds\'|translate}}

    {{newsfeed.title}}

    ')}]);angular.module('absApp').requires.push('absApp.Clinic.Clinic');"use strict";angular.module("absApp.Clinic.QuestionAnswer",["ngResource","ngSanitize","satellizer","ngAnimate","ui.router","oitozero.ngSweetAlert","uiSwitch"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("QuestionList",{url:"/questions?page",templateUrl:"scripts/plugins/Clinic/QuestionAnswer/views/default/questions.html",controller:"QuestionsController",resolve:getToken}).state("QuestionAdd",{url:"/questions/add",templateUrl:"scripts/plugins/Clinic/QuestionAnswer/views/default/questions_add.html",controller:"QuestionsController",resolve:getToken}).state("QuestionEdit",{url:"/questions/edit/:id",templateUrl:"scripts/plugins/Clinic/QuestionAnswer/views/default/questions_edit.html",controller:"QuestionsController",resolve:getToken}).state("QuestionView",{url:"/questions/:id/:slug",templateUrl:"scripts/plugins/Clinic/QuestionAnswer/views/default/question_with_answer_view.html",controller:"QuestionsController",resolve:getToken}).state("AnswersList",{url:"/answers?page",templateUrl:"scripts/plugins/Clinic/QuestionAnswer/views/default/answers.html",controller:"AnswersController",resolve:getToken}).state("AnswerAdd",{url:"/answers/add/:question_id",templateUrl:"scripts/plugins/Clinic/QuestionAnswer/views/default/answer_add.html",controller:"AnswersController",resolve:getToken}).state("AnswerEdit",{url:"/answers/edit/:id",templateUrl:"scripts/plugins/Clinic/QuestionAnswer/views/default/answer_edit.html",controller:"AnswersController",resolve:getToken}).state("AnswerQuestions",{url:"/doctors/answers?page",templateUrl:"scripts/plugins/Clinic/QuestionAnswer/views/default/doctor_questions.html",controller:"AnswersController",resolve:getToken})}),angular.module("absApp").controller("AnswersController",function($scope,$http,$filter,$state,$rootScope,$location,$timeout,flash,SweetAlert,AnswerFactory,AnswerActionsFactory,QuestionActionsFactory,QuestionFactory,SpecialtyUsers){function getAnswers(){var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+',"include":{"0":"question.specialty"}}',AnswerFactory.get(params).$promise.then(function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),$scope.answers=response.data,$scope.loader=!1,$scope.dataLength=response.data.length>0?!0:!1,$scope._metadata=response._metadata,$scope.currentPage=response._metadata.current_page})}function getQuestions(){if("AnswerQuestions"==$state.current.name){var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}}",SpecialtyUsers.get(params).$promise.then(function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),$scope.specialty_users=response.data,$scope.inq={};var i=0;angular.isDefined($scope.specialty_users)&&Object.keys($scope.specialty_users).length>0&&angular.forEach($scope.specialty_users,function(value){$scope.inq[i]=value.id,i+=1}),$scope.inq[i]=$rootScope.auth.primary_speciality_id,$scope.temp=JSON.stringify($scope.inq),params={},params.filter='{"where":{"specialty_id":{"inq":'+$scope.temp+'}},"include":{"0":"specialty"},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}",QuestionFactory.get(params).$promise.then(function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),$scope.answers=response.data,$scope.loader=!1,$scope.dataLength=response.data.length>0?!0:!1,$scope._metadata=response._metadata,$scope.currentPage=response._metadata.current_page})})}}var params={};if($scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,$scope.loader=!0,$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Answers"),$timeout(function(){$scope.text_box=!0},1e3)},"AnswersList"==$state.current.name&&getAnswers(),"AnswerQuestions"==$state.current.name&&getQuestions(),"AnswerAdd"==$state.current.name){var params={};params.id=$state.params.question_id,params.filter='{"include":{"0":"specialty"}}',QuestionActionsFactory.get(params).$promise.then(function(response){$scope.data=response.data})}if("AnswerEdit"==$state.current.name){var params={};params.id=$state.params.id,params.filter='{"include":{"0":"question.specialty"}}',AnswerActionsFactory.get(params).$promise.then(function(response){$scope.data=response.data})}$scope.index(),$scope.answerAdd=function($valid,data){var answerData={};answerData.question_id=$state.params.question_id,answerData.answer=data.answer,AnswerFactory.post(answerData).$promise.then(function(response){0===response.error.code?($state.go("AnswersList"),flash.set($filter("translate")("Answer added successfully."),"success",!1)):flash.set($filter("translate")("Answer added failure."),"error",!1)})},$scope.answerUpdate=function($valid,data){var answerData={};answerData.id=$state.params.id,answerData.answer=data.answer,AnswerActionsFactory.put(answerData).$promise.then(function(response){0===response.error.code?($state.go("AnswersList"),flash.set($filter("translate")("Answer updated successfully."),"success",!1)):flash.set($filter("translate")("Answer updated failure."),"error",!1)})},$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){"AnswerQuestions"==$state.current.name&&getQuestions(),"AnswersList"==$state.current.name&&getAnswers()},1e3)}}),angular.module("absApp").controller("QuestionsController",function($scope,$http,$filter,$state,$rootScope,$location,$timeout,ConstUserType,flash,QuestionFactory,QuestionActionsFactory,SpecialtyList,AnswerFactory,ConstGenders,md5){function getQuestions(params){QuestionFactory.get(params).$promise.then(function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),$scope.dataLength=response.data.length>0?!0:!1,$scope.questions=response.data,$scope.loader=!1,$scope._metadata=response._metadata})}function getSpecialties(){var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',SpecialtyList.get(params).$promise.then(function(response){$scope.specialties=response.data,$scope.loader=!1})}if($scope.ConstUserType=ConstUserType,$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,$scope.loader=!0,$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Questions"),$timeout(function(){$scope.text_box=!0},1e3)},"QuestionList"==$state.current.name){var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+',"include":{"0":"specialty"}}',getQuestions(params)}if("QuestionAdd"==$state.current.name&&getSpecialties(),"QuestionEdit"==$state.current.name&&QuestionActionsFactory.get({id:$state.params.id}).$promise.then(function(response){$scope.data=response.data,$scope.loader=!1,getSpecialties()}),"QuestionView"==$state.current.name){var params={};params.filter='{"where":{"question_id":'+$state.params.id+'},"include":{"0":"question","1":"user.attachment","2":"user.user_profile"}}',AnswerFactory.get(params).$promise.then(function(response){$scope.answers=response.data,$scope.dataLength=response.data.length>0?!0:!1,$scope.loader=!1,angular.isDefined($scope.answers)&&Object.keys($scope.answers).length>0&&angular.forEach($scope.answers,function(provider_user,key){provider_user.user.user_image=provider_user.user.user_profile.gender_id===ConstGenders.Female?"images/femaledoctor.jpg":"images/maledoctor.jpg",angular.isDefined(provider_user.user.attachment)&&null!==provider_user.user.attachment&&(provider_user.user.user_image="images/small_thumb/UserAvatar/"+provider_user.user.attachment.id+"."+md5.createHash("UserAvatar"+provider_user.user.attachment.id+"pngsmall_thumb")+".png"),$scope.answers[key].user.user_image=provider_user.user.user_image})})}$scope.index(),$scope.questionAdd=function($valid,data){$valid&&(data.is_active=1,QuestionFactory.post(data).$promise.then(function(response){0===response.error.code?($state.go("QuestionList"),flash.set($filter("translate")("Questions added successfully."),"success",!1)):flash.set($filter("translate")("Questions added failure."),"error",!1)}))},$scope.questionUpdate=function($valid,data){if($valid){var questionData={};questionData.id=$state.params.id,questionData.specialty_id=data.specialty_id,questionData.question=data.question,questionData.is_active=1,QuestionActionsFactory.put(questionData).$promise.then(function(response){0===response.error.code?($state.go("QuestionList"),flash.set($filter("translate")("Questions updated successfully."),"success",!1)):flash.set($filter("translate")("Questions updated failure."),"error",!1)})}},$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){getQuestions(params)},1e3)}}).directive("convertToNumber",function(){return{require:"ngModel",link:function(scope,element,attrs,ngModel){ngModel.$parsers.push(function(val){return val?parseInt(val,10):null}),ngModel.$formatters.push(function(val){return val?""+val:""})}}}),angular.module("absApp").factory("QuestionFactory",["$resource",function($resource){return $resource("/api/v1/questions",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("QuestionActionsFactory",["$resource",function($resource){return $resource("/api/v1/questions/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},"delete":{method:"DELETE"}})}]).factory("AnswerFactory",["$resource",function($resource){return $resource("/api/v1/answers",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("AnswerActionsFactory",["$resource",function($resource){return $resource("/api/v1/answers/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},"delete":{method:"DELETE"}})}]).factory("SpecialtyList",["$resource",function($resource){return $resource("/api/v1/specialties",{},{get:{method:"GET"}})}]).factory("SpecialtyUsers",["$resource",function($resource){return $resource("/api/v1/specialties_users",{},{get:{method:"GET"}})}]),angular.module("absApp.Clinic.QuestionAnswer").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Clinic/QuestionAnswer/views/default/answer_add.html",'

    {{\'Add Answer\'|translate}}

    {{data.question}}
    : {{data.specialty.name}}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Doctor Answers"|translate}}

    • {{\'Add your answer\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/QuestionAnswer/views/default/answer_edit.html",'

    {{\'Edit Answer\'|translate}}

    : {{data.question.question}}
    : {{data.question.specialty.name}}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Doctor Answers"|translate}}

    • {{\'Edit your answer\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/QuestionAnswer/views/default/answers.html",'
    {{\'Specialty\'| translate}} {{\'Question\'| translate}} {{\'Answer\'| translate}} {{\'Action\'| translate}}
    {{answerR.question.specialty.name}} {{answerR.question.question}} {{answerR.answer}} Edit

    {{\'No Answers Added\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/QuestionAnswer/views/default/doctor_questions.html",'
    {{\'S.No\'| translate}} {{\'Questions\'| translate}} {{\'Specialty\'| translate}} {{\'Action\'| translate}}
    {{$index+1}} {{questionR.question}} {{questionR.answer_count}} {{questionR.specialty.name}} {{\'Add Answer\'| translate}} {{\'View Answer\'| translate}}

    {{\'No Questions Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/QuestionAnswer/views/default/question_with_answer_view.html",'

    {{\'Question with Answers\' | translate }}

    {{\'Back\' | translate }} {{\'Back\' | translate }}

    Q.{{answers[0].question.question}}

    '),$templateCache.put("scripts/plugins/Clinic/QuestionAnswer/views/default/questions.html",'

    {{\'My Questions\'| translate}}

    {{\'S.No\'| translate}} {{\'Questions\'| translate}} {{\'Specialty\'| translate}} {{\'Action\'| translate}}
    {{$index+1}} {{pat_question.question}} {{pat_question.answer_count}} {{pat_question.specialty.name}} {{\'Edit\'| translate}} {{\'View Answer\'| translate}}

    {{\'No Questions Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/QuestionAnswer/views/default/questions_add.html",'

    {{\'Add Question\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Patient Questions"|translate}}

    • {{\'Ask a Question?\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/QuestionAnswer/views/default/questions_edit.html",'

    {{\'Add Question\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Patient Questions"|translate}}

    • {{\'Ask a Question?\'|translate}}
    ')}]);angular.module('absApp').requires.push('absApp.Clinic.QuestionAnswer');"use strict";angular.module("absApp.Clinic.Review",["ngResource","ngSanitize","satellizer","ngAnimate","ui.router"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("WriteReview",{url:"/reviews/{apt_id}/{provider_user_id}/{branch_id}/{clinic_user_id}/add/{type}",templateUrl:"scripts/plugins/Clinic/Review/views/default/review_booking.html",controller:"ReviewsController",resolve:getToken}).state("DoctorReview",{url:"/reviews/{apt_id}/{provider_user_id}/add/{type}",templateUrl:"scripts/plugins/Clinic/Review/views/default/review_booking.html",controller:"ReviewsController",resolve:getToken}).state("Reviews",{url:"/reviews",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/branches.html",controller:"BranchesController",resolve:getToken})}),angular.module("absApp").controller("ReviewsController",function($state,$scope,$rootScope,$filter,$location,flash,ReviewPost,ReviewsFactory){function getDoctorReview(to_user_id){var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+',"to_user_id":'+to_user_id+', "foreign_type":"Appointment"}}',ReviewsFactory.get(params).$promise.then(function(response){$scope.review=response.data[0],$scope.isAlreadyReviewed=response.data.length>0?!0:!1})}function getBranchReview(clinic_user_id){var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+', "clinic_user_id":'+clinic_user_id+', "foreign_type":"Branch"}}',ReviewsFactory.get(params).$promise.then(function(response){$scope.branch_review=response.data[0],response.data.length>0&&($scope.branch_bedside_rate=$scope.branch_review.bedside_rate,$scope.branch_waittime_rate=$scope.branch_review.waittime_rate,$scope.branch_message=$scope.branch_review.message),$scope.isBranchReviewed=response.data.length>0?!0:!1})}$scope.branch_review={},$scope.init=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Review & Rating"),"branch"===$state.params.type?(getDoctorReview($state.params.provider_user_id),getBranchReview($state.params.clinic_user_id)):"doctor"===$state.params.type&&getDoctorReview($state.params.provider_user_id),$scope.review_type=$state.params.type},$scope.init(),$scope.postDoctorReviewRating=function($valid,form){if($valid){$scope.disableButton=!0;var reviewData={};reviewData.foreign_id=$state.params.apt_id,reviewData.user_id=$rootScope.auth.id,reviewData.to_user_id=$state.params.provider_user_id,reviewData.branch_id=$state.params.branch_id,reviewData.clinic_user_id=$state.params.clinic_user_id,reviewData.foreign_type="Appointment",reviewData.bedside_rate=form.bedside_rate.$modelValue,reviewData.waittime_rate=form.waittime_rate.$modelValue,reviewData.message=form.message.$modelValue,ReviewPost.post(reviewData).$promise.then(function(response){0===response.error.code?(flash.set($filter("translate")("Doctor rate & review added successfully."),"success",!0),$scope.disableButton=!1,$state.go("MyAppointments")):(flash.set($filter("translate")(response.error.message),"error",!1),$scope.disableButton=!1)})}},$scope.postBranchReviewRating=function($valid,form,review_type){if($valid){$scope.disableButton=!0;var reviewData={};reviewData.foreign_id=$state.params.branch_id,reviewData.user_id=$rootScope.auth.id,reviewData.branch_id=$state.params.branch_id,reviewData.clinic_user_id=$state.params.clinic_user_id,reviewData.to_user_id="diagnostic"===review_type?$state.params.clinic_user_id:$state.params.provider_user_id,reviewData.foreign_type="Branch",reviewData.bedside_rate=form.branch_bedside_rate.$modelValue,reviewData.waittime_rate=form.branch_waittime_rate.$modelValue,reviewData.message=form.branch_message.$modelValue,ReviewPost.post(reviewData).$promise.then(function(response){0===response.error.code?(flash.set($filter("translate")("Branch rate & review added successfully."),"success",!0),$scope.disableButton=!1,$state.go("MyAppointments")):(flash.set($filter("translate")(response.error.message),"error",!1),$scope.disableButton=!1)})}}}),angular.module("absApp").directive("reviewPost",function($filter){return{restrict:"E",templateUrl:"scripts/plugins/Clinic/Review/views/default/review_booking.html",scope:!0,controller:"ReviewsController"}}).directive("reviewShow",function($filter){return{restrict:"E",templateUrl:"scripts/plugins/Clinic/Review/views/default/reviews.html",scope:{showreview:"@"},controller:function($scope,$rootScope,UserViewProfileFactory,UserReviews,$state,$window,$timeout,$location,ConstUserType){$scope.reviews=[],$scope.ConstUserType=ConstUserType;var params={};params.id=$state.params.id,params.filter='{"include": {"0":"user_profile"}}',UserViewProfileFactory.get(params).$promise.then(function(response){$scope.doctor=response.data,$scope.name=$scope.doctor.role_id===$scope.ConstUserType.Doctor?$filter("translate")("Dr")+". "+$scope.doctor.user_profile.first_name+" "+$scope.doctor.user_profile.last_name:$scope.doctor.user_profile.display_name}),$scope.skip=0,$scope.getReviews=function(){$scope.loader=!0,$scope.limit=4,params={};var api_filter={},Where=[];Where.push({where:{},include:{}}),api_filter="doctor"===$scope.showreview?{to_user_id:$state.params.id,foreign_type:"Appointment"}:{clinic_user_id:$state.params.id,foreign_type:"Branch"},Where[0].include[0]="user",Where[0].include[1]="user.attachment",Where[0].include[2]="user.user_profile",Where[0].include[3]="to_user.user_profile",Where[0].where=api_filter,Where[0].limit=$scope.limit,Where[0].skip=$scope.skip,params.filter=JSON.stringify(Where[0]),UserReviews.get(params).$promise.then(function(response){angular.isDefined(response._metadata)&&($scope.lastpage=response._metadata.last_page,$scope.currentpage=response._metadata.current_page),$scope.dataLength=response.data.length>0?!0:!1,$timeout(function(){angular.isDefined(response.data)&&(angular.forEach(response.data,function(review){$scope.reviews.push(review)}),$scope.loader=!1)},500)})},$scope.index=function(){$scope.getReviews()},$scope.loadMore=function(){$scope.skip+=4,$scope.getReviews()},$scope.index()}}}),angular.module("absApp").factory("UserReviewsFactory",["$resource",function($resource){return $resource("/api/v1/reviews/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("ReviewsFactory",["$resource",function($resource){return $resource("/api/v1/reviews",{},{get:{method:"GET"}})}]).factory("ReviewPost",["$resource",function($resource){return $resource("/api/v1/reviews",{},{post:{method:"POST"}})}]),angular.module("absApp.Clinic.Review").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Clinic/Review/views/default/rating_stars.html",'
    {{\'Please Enter Your Review\'| translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Review/views/default/review_booking.html",'

    {{"Rating & Reviews" | translate }}

    {{"For Doctors" | translate }}
    {{\'Required\' | translate }}
    {{\'Required\' | translate }}
    {{\'Required\'| translate }}

    {{"Doctor" | translate }}

    {{review.rating}}

    {{review.message}}

    {{"Branch" | translate }}

    {{branch_review.rating}}

    {{branch_review.message}}

    {{"For Branch" | translate }}

    {{\'Required\' | translate }}
    {{\'Required\' | translate }}
    {{\'Required\'| translate }}
    '),$templateCache.put("scripts/plugins/Clinic/Review/views/default/reviews.html",'
    {{\'Patient Reviews For\'| translate}} {{name}}

    {{review.created_at | dateFormat}}

    {{\'by\' | translate}} {{review.user.user_profile.first_name}} {{review.user.user_profile.last_name}} {{\'(Verified Patient)\' | translate}}

    {{\'Overall Rating\' | translate}}

    {{\'Bedside Manner\' | translate}}

    {{\'Wait Time\' | translate}}

    {{review.message}}


    {{\'No reviews added yet\'|translate}}

    ')}]);angular.module('absApp').requires.push('absApp.Clinic.Review');"use strict";angular.module("absApp.Clinic.Pharmacy",["ngResource","ngSanitize","satellizer","ngAnimate","ui.bootstrap","ui.router","angular-growl","google.places","ngCookies","angular-md5","ui.select","angulartics","pascalprecht.translate","angulartics.google.analytics","tmh.dynamicLocale","ngMap","chieffancypants.loadingBar","angularMoment","ngFileUpload","slugifier","ngTagsInput"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("prescriptions",{url:"/prescriptions",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/clinic_profile.html",controller:"ClinicController",resolve:getToken})}),angular.module("absApp").controller("PharmacyController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,BranchesFactory,BranchesEdit,MyDoctorsFactory){$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Branches"),$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,$scope.myBranches=function(){if("my_branches"===$state.current.name){var params={};params.filter='{"where":{"user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+',"include":{"0":"branch.city","1":"branch.country","2":"clinic_user.user_profile"}}',$scope.loader=!0,void 0===$state.params.page?params.page=1:params.page=$state.params.page,MyDoctorsFactory.get(params,function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),angular.isDefined(response.data)&&($scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1),$scope.loader=!1})}},"my_branches"===$state.current.name&&$scope.myBranches(),$scope.loader=!0,$scope.mybranch=function(){var params={};params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+',"include":{"0":"city","1":"country"},"order":"id desc"}',void 0===$state.params.page?params.page=1:params.page=$state.params.page,BranchesFactory.get(params,function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),angular.isDefined(response.data)&&($scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1),$scope.loader=!1})},"my_branches"!==$state.current.name&&$scope.mybranch(),$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){"my_branches"!==$state.current.name&&$scope.mybranch(),"my_branches"===$state.current.name&&$scope.myBranches()},1e3)},$scope.changeStatus=function(branch_id,status){var branchData={};branchData.id=branch_id,branchData.is_active=status,SweetAlert.swal({title:$filter("translate")("Are you sure you want to change the status?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&BranchesEdit.put(branchData,function(response){0===response.error.code?(flash.set($filter("translate")("Your doctor has been deleted successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your doctor couldn't deleted. Please try again."),"error",!1),$state.reload())})})}}),angular.module("absApp").factory("BranchesFactory",["$resource",function($resource){return $resource("/api/v1/branches",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("BranchesEdit",["$resource",function($resource){return $resource("/api/v1/branches/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("BranchesTimeSlot",["$resource",function($resource){return $resource("/api/v1/branches/:id/timeslot",{id:"@id"},{get:{method:"GET"}})}]).factory("DoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("DoctorsEdit",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveDoctor",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("MyDoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"}})}]).factory("SearchDoctors",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("SearchUsers",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("SearchPatients",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("UsersFactory",["$resource",function($resource){return $resource("/api/v1/branch_users",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("UsersEdit",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveUser",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("UserById",["$resource",function($resource){return $resource("/api/v1/users/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("AppoinmentSettingsService",["$resource",function($resource){return $resource("/api/v1/appointment_settings/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("AppoinmentModificationService",["$resource",function($resource){return $resource("/api/v1/appointment_modifications",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("AppoinmentModifications",["$resource",function($resource){return $resource("/api/v1/appointment_modifications/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},getbyid:{method:"GET"},"delete":{method:"DELETE"}})}]).factory("ClinicAppointmentFactory",["$resource",function($resource){return $resource("/api/v1/appointments",{},{get:{method:"GET"}})}]).factory("ClinicAppointmentBookingAdd",["$resource",function($resource){return $resource("/api/v1/appointments",{},{post:{method:"POST"}})}]).factory("AppointmentView",["$resource",function($resource){return $resource("/api/v1/appointments/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("PermissionsFactory",["$resource",function($resource){return $resource("/api/v1/permissions",{},{get:{method:"GET"}})}]).factory("LocationsFactory",["$resource",function($resource){return $resource("/api/v1/locations",{},{get:{method:"GET"}})}]).factory("SpecialtiesFactory",["$resource",function($resource){return $resource("/api/v1/specialties",{},{get:{method:"GET"}})}]).factory("InsurancesFactory",["$resource",function($resource){return $resource("/api/v1/insurances",{},{get:{method:"GET"}})}]).factory("LanguagesFactory",["$resource",function($resource){return $resource("/api/v1/languages",{},{get:{method:"GET"}})}]).factory("CountriesFactory",["$resource",function($resource){return $resource("/api/v1/countries",{},{get:{method:"GET"}})}]).factory("NewsFeedsFactory",["$resource",function($resource){return $resource("/api/v1/news_feeds",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("NewsFeedsActionsFactory",["$resource",function($resource){return $resource("/api/v1/news_feeds/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},"delete":{method:"DELETE"}})}]).factory("AttachementDelete",["$resource",function($resource){return $resource("/api/v1/attachments/:attachmentId",{attachmentId:"@attachmentId"},{"delete":{method:"DELETE"}})}]),angular.module("absApp.Clinic.Pharmacy").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Clinic/Pharmacy/views/default/branches.html",'

    {{\'My Branches\'|translate}} {{\'Add Branch\'|translate}}

    {{\'Branch\'|translate}} {{\'Address\'|translate}} {{\'Phone\'|translate}} {{\'Country\'|translate}} {{\'City\'|translate}} {{\'Status\'|translate}} {{\'Action\'|translate}}
    {{branch.name |translate}} {{branch.address |translate}} {{branch.phone_number |translate}} {{branch.country.name |translate}} {{branch.city.name |translate}} {{\'Edit\' | translate}} {{\'Manage Doctors\' | translate}} {{\'Manage Users\' | translate}}

    {{\'No Records Found\'|translate}}

    ')}]);angular.module('absApp').requires.push('absApp.Clinic.Pharmacy');"use strict";angular.module("absApp.Clinic.Prescription",["ngResource","ngSanitize","satellizer","ngAnimate","ui.bootstrap","ui.router","angular-growl","google.places","ngCookies","angular-md5","ui.select","angulartics","pascalprecht.translate","angulartics.google.analytics","tmh.dynamicLocale","ngMap","chieffancypants.loadingBar","angularMoment","ngFileUpload","slugifier","ngTagsInput"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("PrescriptionAdd",{url:"/appointment/{id}/prescription/add",templateUrl:"scripts/plugins/Clinic/Prescription/views/default/prescription_add.html",controller:"PrescriptionController",resolve:getToken}).state("prescription_view",{url:"/prescription/:id/:appointment_token",templateUrl:"scripts/plugins/Clinic/Prescription/views/default/prescription_view.html",controller:"PrescriptionController",resolve:getToken}).state("me_prescriptions",{url:"/me/prescriptions",templateUrl:"scripts/plugins/Clinic/Prescription/views/default/prescriptions.html",controller:"PrescriptionController",resolve:getToken})}),angular.module("absApp").controller("PrescriptionController",function($state,$rootScope,$scope,$filter,$timeout,flash,$location,Prescriptions,AppointmentAction,PrescriptionAction,MedicineTypes,MyAppointments,ConstGenderType){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Prescriptions"),$scope.ConstGenderType=ConstGenderType,$timeout(function(){$scope.text_box=!0},1e3);var params={};$scope.deleteMedicineArray=function(index){$scope.added_medicines.splice(index,1)},$scope.AddMedicines=function(){$scope.added_medicines.push({medicine_type_id:1,name:"",dosage_unit:"",dosage:"",usage_days:"",description:"",is_before_food:"",is_after_food:"",is_morning:"",is_noon:"",is_night:""})},$scope.deleteTestArray=function(index){$scope.added_tests.splice(index,1)},$scope.AddTests=function(){$scope.added_tests.push({name:"",description:""})},$scope.deleteAdviceArray=function(index){$scope.added_advices.splice(index,1)},$scope.AddAdvices=function(){$scope.added_advices.push({description:""})},$scope.index=function(){$scope.data={},$scope.added_medicines=[],$scope.added_tests=[],$scope.added_advices=[],$scope.todayDateTime=$filter("date")(new Date,"yyyy-MM-dd HH:mm"),$scope.AddMedicines(),$scope.AddTests(),$scope.AddAdvices(),$scope.getAppointmentDeail(),"prescription_view"===$state.current.name&&$scope.getPrescription(),"PrescriptionAdd"===$state.current.name&&$scope.getMedicineTypes(),"me_prescriptions"===$state.current.name&&$scope.meAppointments(),console.log($state.current.name)},$scope.prescriptionAdd=function($valid,formname){return formname.$valid?void($valid&&($scope.presData={},$scope.presData.medicines=[],$scope.presData.tests=[],$scope.presData.advices=[],$scope.presData.user_id=$scope.appointment.user_id,$scope.presData.doctor_user_id=$scope.appointment.provider_user_id,$scope.presData.clinic_user_id=$scope.appointment.clinic_user_id,$scope.presData.appointment_id=$state.params.id,$scope.presData.patient_condition=$scope.data.patient_condition,$scope.presData.weight=$scope.data.weight,$scope.presData.blood_pressure=$scope.data.blood_pressure,$scope.presData.rx_number=$scope.data.rx_number,$scope.added_medicines.length>0&&angular.forEach($scope.added_medicines,function(medicine){$scope.presData.medicines.push({name:medicine.name,medicine_type_id:medicine.medicine_type_id,dosage_unit:medicine.dosage_unit,dosage:medicine.dosage,usage_days:medicine.usage_days,description:medicine.description,is_before_food:"before_food"===medicine.presDay?1:0,is_after_food:"after_food"===medicine.presDay?1:0,is_morning:medicine.is_morning?1:0,is_noon:medicine.is_noon?1:0,is_night:medicine.is_night?1:0})}),$scope.added_tests.length>0&&angular.forEach($scope.added_tests,function(test){$scope.presData.tests.push({name:test.name,description:test.description})}),$scope.added_advices.length>0&&angular.forEach($scope.added_advices,function(advice){$scope.presData.advices.push({description:advice.description})}),console.log($scope.data,"presDay"),console.log($scope.presData),Prescriptions.create($scope.presData,function(response){0===response.error.code?(flash.set($filter("translate")("Prescription added successfully."),"success",!1),$location.path("/appointments/approved")):flash.set($filter("translate")(response.error.message),"error",!1)}))):(angular.element("[name='"+formname.$name+"']").find(".ng-invalid:visible:first").focus(),!1)},$scope.getAppointmentDeail=function(){params={},params.id=$state.params.id,params.filter={},params.filter.include={},params.filter.include[0]="user.user_profile",params.filter.include[1]="provider_user",params.filter.include[2]="clinic_user",AppointmentAction.get(params).$promise.then(function(response){$scope.appointment=response.data})},$scope.getPrescription=function(){params={},params.id=$state.params.id,params.filter={},params.filter.include={},params.filter.include[0]="user.user_profile",params.filter.include[1]="doctor_user.user_profile.city.state.country",params.filter.include[2]="clinic_user.user_profile.city.state.country",params.filter.include[3]="appointment.user.user_profile",params.filter.include[4]="prescription_medicine.medicine_type",params.filter.include[5]="prescription_test",params.filter.include[6]="prescription_note",PrescriptionAction.get(params).$promise.then(function(response){$scope.prescription=response.data,console.log($scope.prescription)})},$scope.getMedicineTypes=function(){params={},MedicineTypes.get(params).$promise.then(function(response){$scope.medicine_types=response.data})},$scope.meAppointments=function(){params={},$scope.loader=!0;var Where=[],api_filter={};Where.push({where:{},include:{}}),api_filter.user_id=$rootScope.auth.id,Where[0].include[0]="user.user_profile",Where[0].include[1]="provider_user.user_profile",Where[0].include[2]="clinic_user.user_profile",Where[0].include[3]="appointment_status",Where[0].include[4]="prescription",Where[0].where=api_filter,Where[0].skip=$scope.skipvalue,Where[0].limit=$scope.itemsPerPage,Where[0].order="id desc",params.filter=JSON.stringify(Where[0]),MyAppointments.get(params).$promise.then(function(response){$scope.appointments=response.data,$scope.isShown=response.data.length>0?!0:!1})},$scope.printView=function(){window.print()},$scope.printToPrescription=function(printSectionId){var innerContents=document.getElementById(printSectionId).innerHTML,popupWinindow=window.open("","_blank","width=700,height=800,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,titlebar=no");popupWinindow.document.open(),popupWinindow.document.write(''+innerContents+""),popupWinindow.document.close()},$scope.index()}),angular.module("absApp").factory("Prescriptions",["$resource",function($resource){return $resource("/api/v1/prescriptions",{},{get:{method:"GET"},create:{method:"POST"}})}]).factory("PrescriptionAction",["$resource",function($resource){return $resource("/api/v1/prescriptions/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("MedicineTypes",["$resource",function($resource){return $resource("/api/v1/medicine_types",{},{get:{method:"GET"}})}]).factory("MyAppointments",["$resource",function($resource){return $resource("/api/v1/appointments",{},{get:{method:"GET"}})}]).factory("meUser",["$resource",function($resource){return $resource("/api/v1/me/users",{},{get:{method:"GET"}})}]).factory("DoctorsEdit",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveDoctor",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("MyDoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"}})}]).factory("SearchDoctors",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("SearchUsers",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("SearchPatients",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("UsersFactory",["$resource",function($resource){return $resource("/api/v1/branch_users",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("UsersEdit",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveUser",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("UserById",["$resource",function($resource){return $resource("/api/v1/users/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("AppoinmentSettingsService",["$resource",function($resource){return $resource("/api/v1/appointment_settings/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("AppoinmentModificationService",["$resource",function($resource){return $resource("/api/v1/appointment_modifications",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("AppoinmentModifications",["$resource",function($resource){return $resource("/api/v1/appointment_modifications/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},getbyid:{method:"GET"},"delete":{method:"DELETE"}})}]).factory("ClinicAppointmentFactory",["$resource",function($resource){return $resource("/api/v1/appointments",{},{get:{method:"GET"}})}]).factory("ClinicAppointmentBookingAdd",["$resource",function($resource){return $resource("/api/v1/appointments",{},{post:{method:"POST"}})}]).factory("AppointmentAction",["$resource",function($resource){return $resource("/api/v1/appointments/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("PermissionsFactory",["$resource",function($resource){return $resource("/api/v1/permissions",{},{get:{method:"GET"}})}]).factory("LocationsFactory",["$resource",function($resource){return $resource("/api/v1/locations",{},{get:{method:"GET"}})}]).factory("SpecialtiesFactory",["$resource",function($resource){return $resource("/api/v1/specialties",{},{get:{method:"GET"}})}]).factory("InsurancesFactory",["$resource",function($resource){return $resource("/api/v1/insurances",{},{get:{method:"GET"}})}]).factory("LanguagesFactory",["$resource",function($resource){return $resource("/api/v1/languages",{},{get:{method:"GET"}})}]).factory("CountriesFactory",["$resource",function($resource){return $resource("/api/v1/countries",{},{get:{method:"GET"}})}]).factory("NewsFeedsFactory",["$resource",function($resource){return $resource("/api/v1/news_feeds",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("NewsFeedsActionsFactory",["$resource",function($resource){return $resource("/api/v1/news_feeds/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},"delete":{method:"DELETE"}})}]).factory("AttachementDelete",["$resource",function($resource){return $resource("/api/v1/attachments/:attachmentId",{attachmentId:"@attachmentId"},{"delete":{method:"DELETE"}})}]),angular.module("absApp.Clinic.Prescription").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/appoinment_settings.html",'

    Dr. {{user.username}}{{\' \\\'s Consultation Settings\'| translate}}

    {{\'Branch:\' | translate}}{{branch.name |translate}}

    {{open_lunch}}
    {{lunch_resume}}
    {{resume_close}} {{open_close}}
    {{sunday_resume_close}} {{sunday_open_close}}
    {{sunday_open_lunch}}
    {{sunday_lunch_resume}}
    {{monday_resume_close}} {{monday_open_close}}
    {{monday_open_lunch}}
    {{monday_lunch_resume}}
    {{tuesday_resume_close}} {{tuesday_open_close}}
    {{tuesday_open_lunch}}
    {{tuesday_lunch_resume}}
    {{wednesday_resume_close}} {{wednesday_open_close}}
    {{wednesday_open_lunch}}
    {{wednesday_lunch_resume}}
    {{thursday_resume_close}} {{thursday_open_close}}
    {{thursday_open_lunch}}
    {{thursday_lunch_resume}}
    {{friday_resume_close}} {{friday_open_close}}
    {{friday_open_lunch}}
    {{friday_lunch_resume}}
    {{saturday_resume_close}} {{saturday_open_close}}
    {{saturday_open_lunch}}
    {{saturday_lunch_resume}}
    '), $templateCache.put("scripts/plugins/Clinic/Prescription/views/default/appointment_booking.html",'
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/appointment_modification.html",'

    {{\'Unavailable Days\'| translate}} {{\'Add\'|translate}}

    {{\'Date\'| translate}} {{\'Type\'| translate}} {{\'Slot\'| translate}} {{\'Status\'| translate}} {{\'Action\'| translate}}
    {{modifyValue.appoint_date | dateFormat}} {{\'Day Off\'| translate}} {{\'Schedule Change\'| translate}} --
    {{\'Edit\' | translate}} {{\'Delete\' | translate}}

    {{\'No Records Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/appointment_modification_add.html",'

    {{\'Specify non availability days & timeslots\'| translate}}

    {{"Go and Update Your Appointment Setttings Until Not able to modifiied your Settings" | translate }}

    {{\'Specify non availability days & timeslots\'| translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/appointment_modification_edit.html",'

    {{\'Specify non availability days & timeslots\'| translate}}

    {{"Go and Update Your Appointment Setttings Until Not able to modifiied your Settings" | translate }}

    {{\'Specify non availability days & timeslots\'| translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/appointment_view.html",'

    {{\'Appointment Details\' | translate }}

    {{\'The appointment is scheduled at\' | translate }} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_time}}
    {{\'Branch\' | translate }} {{appointment.branch.name}}
    {{\'Doctor\' | translate }} {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}}
    {{\'Patient Name\' | translate }} {{appointment.user.user_profile.first_name}} {{appointment.user.user_profile.last_name}}
    {{\'Patient Address\' | translate }} {{appointment.user.user_profile.address}}
    {{\'Email\'| translate}} {{appointment.user.email}}
    {{\'Phone\'| translate}} {{appointment.user.user_profile.phone}}
    {{\'Gender\' | translate }} {{appointment.user.user_profile.gender.name}}
    {{\'Where\' | translate }} {{appointment.user.user_profile.address}} {{appointment.user.user_profile.city.name}}, {{appointment.user.user_profile.country.name}}, {{appointment.user.user_profile.postal_code}}
    {{\'Patient Note\' | translate }} {{appointment.customer_note}} --
    {{\'Doctor Note\' | translate }} {{appointment.provider_note}} --
    {{\'Patient Status\' | translate }} {{\'Already Seen\' | translate }} {{\'New Patient\' | translate }}
    {{\'Reason for visit\' | translate }} {{appointment.specialty_disease.name}}
    {{\'Service Duration\' | translate }} {{appointment.specialty_disease.service_duration}} --
    {{\'Appointment Status\' | translate }} {{appointment.appointment_status.name}}
    {{\'Appointment Cancel\' | translate }} {{appointment.appointment_status.name}}
    {{\'Patient Medical History\' | translate }} {{\'Click Here\' | translate}}
    {{\'Guest Patient Details\' | translate }}
    {{\'Guest name\' | translate }} {{appointment.guest_first_name}} {{appointment.guest_last_name}}
    {{\'Guest email\' | translate }} {{appointment.guest_email}}
    {{\'Guest Dob\' | translate }} {{appointment.guest_dob}}
    {{\'Guest Gender\' | translate }} {{\'Male\' | translate }} {{\'Female\' | translate }}
    {{\'Patient Speciality Details\' | translate }}
    {{data.FormField.data[0].name}} {{data.response}} {{data.attachments.thumb[0].url}}










    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_add.html",'

    {{\'Add Branch\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    * {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Allowed extensions: jpg, jpeg, gif, png\'|translate}}
    {{\'Please select address from autocomplete\'| translate}} {{\' Required\'| translate }} {{\'You must select address from autocomplete\'|translate}} {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Add your branch"|translate}}

    • {{\'Add branch for the clinic\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_doctors.html",'

    {{branch.name}}: {{\'My Branch Doctors\'|translate}} {{\'My Branches\'|translate}} {{\'Add Doctor\'|translate}}

    {{\'Doctor\'|translate}} {{\'Phone\'|translate}} {{\'Country\'|translate}} {{\'City\'|translate}} {{\'Action\'|translate}}
    {{doctor.user.user_profile.first_name |translate}} {{doctor.user.user_profile.last_name |translate}} {{doctor.user.mobile |translate}} {{doctor.user.user_profile.country.name |translate}} {{doctor.user.user_profile.city.name |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}} {{\'Consultation Settings\' | translate}} {{\'Availability\' | translate}}

    {{\'No Records Found\'|translate}}

    '), $templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_doctors_add.html",'

    {{\'Add Doctor\'|translate}}

    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Cancel\'|translate}}
    {{\'The mobile number is already registered with some other users. Please try with other number.\'| translate}}
    [Image: {{doctor.first_name}}]

    Dr.{{doctor.user_profile.first_name}} {{doctor.user_profile.last_name}} (Denist,General Sugergy)

    {{doctor.user_profile.address}}
    English, Tamil

    {{doctor.user_profile.about_me}}

    {{\'The mobile number is not used by users. Please add new doctor with following fields.\'| translate}}

    {{\'Add Doctor\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{ \'Maximum length is 5\' | translate }} {{ \'Minimum length is 1\' | translate }} {{\'Enter Valid Room Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Add your doctor"|translate}}

    • {{\'Branch Doctor\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_doctors_edit.html",'

    {{\'Edit Doctor\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Required\'| translate }}
    {{ \'Maximum length is 5\' | translate }} {{ \'Minimum length is 1\' | translate }} {{\'Enter Valid Room Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Add your doctor"|translate}}

    • {{\'Branch Doctor\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_edit.html",'

    {{\'Edit Branch\'|translate}} - {{data.name}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Allowed extensions: jpg, jpeg, gif, png\'|translate}}
    {{\'Please select address from autocomplete\'| translate}} {{\' Required\'| translate }} {{\'You must select address from autocomplete\'|translate}} {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}

    {{"Add your branch"|translate}}

    • {{\'Get bid from skilled freelancer in minutes\'|translate}}.
    • {{\'View freelancer profiles and feedback and choose best freelancer\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_profile.html",'

    {{branch.name}}

    {{branch.address}},

    {{branch.postal_code}} {{branch.city.name}}, {{branch.country.name}}

    {{\'Specialist Doctors\'| translate}}

    {{\'No Doctors Available\'|translate}}
    • {{branchSpecialty.specialty.name}}
    • {{branchInsurance.insurance.name}}
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_users.html",'

    {{branch.name}}:{{\'My Branch Users\'|translate}} {{\'My Branches\'|translate}} {{\'Add User\'|translate}}

    {{\'Sub Account\'|translate}} {{\'Permission\'|translate}} {{\'Action\'|translate}}
    {{branchUser.user.user_profile.first_name |translate}} {{branchUser.user.user_profile.last_name |translate}} {{branchUser.permissions |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_users_add.html",'

    {{\'Add User\'|translate}}

    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Cancel\'|translate}}
    {{\'The mobile number is already registered with some other users. Please try with other number.\'| translate}}
    {{\'The mobile number is not used by users. Please add new user with following fields.\'| translate}}

    {{\'Add User\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}

    {{\'Appoinment Permissions\'| translate}}: {{\'AppointmentList\'| translate}}, {{\'AppointmentAdd\'| translate}}, {{\'AppointmentEdit\'| translate}}, {{\'AppointmentCancel\'| translate}}.

    {{\'Doctors Permissions\'| translate}}: {{\'DoctorsList\'| translate}}, {{\'DoctorsAdd\'| translate}}, {{\'DoctorsEdit\'| translate}}, {{\'DoctorsAppointmentSetting\'| translate}}, {{\'DoctorsAppointmentModification\'| translate}}.

    {{\'Account Permissions\'| translate}}: {{\'AccountInfo\'| translate}}, {{\'AccountPayment\'| translate}}.

    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Add your sub-account"|translate}}

    • {{\'Sub Account\'|translate}}.
    '), $templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branch_users_edit.html",'

    {{\'Edit User\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Required\'| translate }} {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"Add your doctor"|translate}}

    • {{\'Branch Doctor\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/branches.html",'

    {{\'My Branches\'|translate}} {{\'Add Branch\'|translate}}

    {{\'Branch\'|translate}} {{\'Address\'|translate}} {{\'Phone\'|translate}} {{\'Country\'|translate}} {{\'City\'|translate}} {{\'Status\'|translate}} {{\'Action\'|translate}}
    {{branch.name |translate}} {{branch.address |translate}} {{branch.phone_number |translate}} {{branch.country.name |translate}} {{branch.city.name |translate}} {{\'Edit\' | translate}} {{\'Manage Doctors\' | translate}} {{\'Manage Users\' | translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/clinic_appointments.html",'
    {{\'Appointment.No\' | translate}}
    {{\'Branch\' | translate}} {{\'Doctor Name\' | translate}} {{\'Patient Name\'| translate}} {{\'Appointment\' | translate}} {{\'Date & Time\' | translate}} {{\'Appointment Via\'| translate}} {{\'Booked by others\' | translate}} {{\'Status\' | translate}}
    {{appointment.appointment_token}} {{appointment.branch.name}} {{\'Dr\' | translate}}. {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}} {{appointment.user.user_profile.first_name}} {{appointment.user.user_profile.last_name}} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_type.name}} {{appointment.book_by_user.user_profile.first_name}} {{appointment.book_by_user.user_profile.last_name}} -- {{appointment.appointment_status.name}} {{\'At Present\'| translate}} {{\'Reschedule/Cancel\'| translate}} {{\'Mark as Arrived\'| translate}} {{\'Mark as Closed\'| translate}}

    {{\'No Records Found\' |translate}}

    {{\'No Records Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/clinic_dashboard.html",'

    {{\'Book Appointment\' | translate}}

    {{\'Doctors\' | translate}}

    • {{\'Dr.\' | translate}} {{doctor.user.user_profile.first_name}} {{doctor.user.user_profile.last_name}}
      {{\'Dr.\' | translate}} {{doctor.user.user_profile.first_name}} {{doctor.user.user_profile.last_name}}

      {{doctor.user.primary_speciality.name}}

      {{doctor.branch.name}}

    {{ \'Book appointment\' | translate }}

      • {{appointmentlists.days.today.day}}
      • {{appointmentlists.days.today.date}}
      • {{appointmentlists.days.day2.day}}
      • {{appointmentlists.days.day2.date}}
      • {{appointmentlists.days.day3.day}}
      • {{appointmentlists.days.day3.date}}
      • {{appointmentlists.days.day4.day}}
      • {{appointmentlists.days.day4.date}}
      • {{appointmentlists.days.day5.day}}
      • {{appointmentlists.days.day5.date}}
      • {{appointmentlists.days.day6.day}}
      • {{appointmentlists.days.day6.date}}
      • {{appointmentlists.days.day7.day}}
      • {{appointmentlists.days.day7.date}}
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/clinic_profile.html",'

    {{branchInfo.branch}}

    {{branchInfo.address1}},

    {{branchInfo.city}}, {{branchInfo.country}}

    • {{branch.name}}

    {{\'No Branches Found\'|translate}}

    • {{branchSpecialty.specialty.name}}
    • {{branchInsurance.insurance.name}}

    {{\'Specialist Doctors\'| translate}}

    {{\'No Doctors Found\'|translate}}

    • Image

      {{\'Dr\'|translate}}. {{doctor.user.user_profile.first_name}} {{doctor.user.user_profile.last_name}}

      {{doctor.user.primary_speciality.name}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/educations.html",'
    # Education Organization Location Certification Date
    {{user_educations.indexOf(user_education) + 1}}
    '), $templateCache.put("scripts/plugins/Clinic/Prescription/views/default/my_branches.html",'

    {{\'My Branches\'|translate}}

    {{\'Clinic\'|translate}} {{\'Branch\'|translate}} {{\'Address\'|translate}} {{\'Phone\'|translate}} {{\'Country\'|translate}} {{\'City\'|translate}} {{\'Status\'|translate}}
    {{my_branch.clinic_user.user_profile.display_name}} {{my_branch.branch.name |translate}} {{my_branch.branch.address |translate}} {{my_branch.branch.phone_number |translate}} {{my_branch.branch.country.name |translate}} {{my_branch.branch.city.name |translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/my_doctors.html",'

    {{\'My Doctors\'|translate}}

    {{\'Branch\'|translate}} {{\'Address\'|translate}} {{\'Phone\'|translate}} {{\'Country\'|translate}} {{\'City\'|translate}} {{\'Status\'|translate}} {{\'Action\'|translate}}
    {{my_doctor.branch.name |translate}} {{my_doctor.branch.address |translate}} {{my_doctor.branch.phone_number |translate}} {{my_doctor.branch.country.name |translate}} {{my_doctor.branch.city.name |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}} {{\'Consultation Settings\' | translate}} {{\'Availability\' | translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/my_users.html",'

    {{\'My Users\'|translate}}

    {{\'Branch\'|translate}} {{\'Sub Account\'|translate}} {{\'Permission\'|translate}} {{\'Action\'|translate}}
    {{branchUser.branch.name |translate}} {{branchUser.user.user_profile.first_name |translate}} {{branchUser.user.user_profile.last_name |translate}} {{branchUser.permissions |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/news_feeds.html",'

    {{\'News Feeds\'|translate}}

    {{\'No News Feeds Found\' |translate}}


    {{"News Feeds"|translate}}

    • {{\'Clinic News Feeds\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/news_feeds_add.html",'

    {{\'Add News Feeds\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"News Feeds"|translate}}

    • {{\'Clinic News Feeds\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/news_feeds_edit.html",'

    {{\'Edit News Feeds\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}

    {{"News Feeds"|translate}}

    • {{\'Clinic News Feeds\'|translate}}.
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/news_feeds_view.html",'

    {{\'News Feeds\'|translate}}

    {{newsfeed.title}}

    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/prescription_add.html",'

    {{\'Create Prescription\'|translate}}

    {{\'Required\'| translate }}
    {{ \'Minimum length is 2\' | translate }} {{ \'Enter valid name without number\' | translate }}
    {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 1\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}

    Medicine

    {{\'Medicine\'|translate}} #{{$index+1}}
    {{\'Required\'| translate }}

    Test

    {{\'Test\'|translate}} #{{$index+1}}
    {{\'Required\'| translate }}

    Advice

    {{\'Advice\'|translate}} #{{$index+1}}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/prescription_view.html",'

    {{\'Prescription\' | translate}} - {{prescription.user.user_profile.display_name}}

    {{\'Date\'|translate}}: {{prescription.appointment.appointment_date}} - {{prescription.appointment.appointment_time}}

    {{prescription.doctor_user.user_profile.first_name}} {{prescription.doctor_user.user_profile.last_name}}

    {{prescription.doctor_user.user_profile.dr_title}}

    {{\'Email\' | translate}}: {{prescription.doctor_user.email}}

    {{\'Phone\' | translate}}: {{prescription.doctor_user.mobile_code}} {{prescription.doctor_user.mobile}}

    {{prescription.clinic_user.user_profile.display_name}}

    {{prescription.clinic_user.user_profile.address}}

    {{prescription.clinic_user.user_profile.city.name}}, {{prescription.clinic_user.user_profile.city.state.name}}, {{prescription.clinic_user.user_profile.city.state.country.name}}

    {{\'Phone\' | translate}}: {{prescription.clinic_user.mobile_code}} {{prescription.clinic_user.mobile}}

    {{\'Name\'|translate}}: {{prescription.appointment.user.user_profile.first_name}} {{prescription.appointment.user.user_profile.last_name}}
    {{\'Age\'|translate}}: {{prescription.appointment.user.user_profile.age}}
    {{\'Sex\'|translate}}: {{ConstGenderType[prescription.user.user_profile.gender_id]}}
    {{\'ID\'|translate}}: {{prescription.appointment.appointment_token}}
    {{\'Date\'|translate}}: {{todayDateTime}}

    Medicines

    {{\'Type\' | translate}} {{\'Name\' | translate}} {{\'Mg/Ml\' | translate}} {{\'Dosage\' | translate}} {{\'Days\' | translate}} {{\'Notes\' | translate}} {{\'Usage\' | translate}}
    {{medicine.medicine_type.name}} {{medicine.name}} {{medicine.dosage_unit}} {{medicine.dosage}} {{medicine.usage_days}} {{medicine.description}} {{medicine.is_morning}} - {{medicine.is_noon}} - {{medicine.is_night}} ( {{\'Before Food\'}} {{\'After Food\'}})

    Tests

    Name Notes
    {{test.name}} {{test.description}}

    Advices

    Notes
    {{advice.description}}
    ------------------------------------
    {{\'Signature\' | translate}}
    '),$templateCache.put("scripts/plugins/Clinic/Prescription/views/default/prescriptions.html",'

    {{\'My Prescriptions and Medical Records\' | translate}}

    {{\'Appointment.No\' | translate}}
    {{\'Doctor\' | translate}}
    {{\'Clinic\'| translate}}
    {{\'Appointment\' | translate}} {{\'Date & Time\' | translate}} {{\'Prescription\' | translate}} {{\'Medical Records\' | translate}} {{\'Status\' | translate}}
    {{appointment.appointment_token}} {{\'Dr\' | translate}}. {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}} {{appointment.clinic_user.user_profile.display_name}} {{appointment.appointment_date | dateFormat}} {{\'Not yet\'| translate}} {{\'Not yet\'| translate}} {{appointment.appointment_status.name}}

    {{\'No Records Found\' |translate}}

    {{\'No Records Found\' |translate}}

    '); }]);angular.module('absApp').requires.push('absApp.Clinic.Prescription');"use strict";angular.module("absApp.Clinic.MedicalHistory",["ngResource","ngSanitize","satellizer","ngAnimate","ui.router","oitozero.ngSweetAlert","uiSwitch"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("ManageConsultations",{url:"/manage_consultations?page",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/manage_consultations.html",controller:"MedicalHistoryController",resolve:getToken}).state("MedicalHistory",{url:"/medical_history/:id/:slug?info",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/medical_history.html",controller:"MedicalHistoryController",resolve:getToken}).state("MedicalHistoryAdd",{url:"/medical_history/add/:id/:slug?info",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/medical_history_add.html",controller:"MedicalHistoryController",resolve:getToken}).state("MedicalHistoryEdit",{url:"/medical_history/edit/:id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/medical_history_edit.html",controller:"MedicalHistoryController",resolve:getToken}).state("MedicalHistoryView",{url:"/medical_history/view/:user_id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/medical_history_view.html",controller:"MedicalHistoryController",resolve:getToken}).state("MedicalRecords",{url:"/users/medical_records",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/medical_records.html",controller:"MedicalHistoryController",resolve:getToken}).state("MedicalRecordView",{url:"/users/medical_record/view/:user_id/:specialty_id/:appointment_id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/medical_record_view.html",controller:"MedicalHistoryController",resolve:getToken}).state("FormFieldGroupList",{url:"/forms/list",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_list.html",controller:"FormFieldGroupsController",resolve:getToken}).state("FormFieldGroupAdd",{url:"/form_field_groups/add",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_add.html",controller:"FormFieldGroupsController",resolve:getToken}).state("FormFieldGroupEdit",{url:"/form_field_groups/edit/:id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_edit.html",controller:"FormFieldGroupsController",resolve:getToken}).state("FormFieldGroupView",{url:"/form_field_groups/view/:id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_view.html",controller:"FormFieldGroupsController",resolve:getToken}).state("FormFieldGroupFormView",{url:"/form_field_groups/form_view/:id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_form_view.html",controller:"FormFieldGroupsController",resolve:getToken}).state("UserFormList",{url:"/users/form/list",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/user_form_list.html",controller:"FormFieldGroupsController",resolve:getToken}).state("UserFormEdit",{url:"/user_form_fields/:form_id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/user_form_edit.html",controller:"FormFieldGroupsController",resolve:getToken}).state("UserFormSubmissionList",{url:"/user_form_view/:form_id/:user_id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/user_form_submission.html",controller:"FormFieldGroupsController",resolve:getToken}).state("DoctorForms",{url:"/doctor_form_lists/:user_id",templateUrl:"scripts/plugins/Clinic/MedicalHistory/views/default/doctor_form_lists.html",controller:"FormFieldGroupsController",resolve:getToken})}),angular.module("absApp").controller("FormFieldGroupsController",function($scope,$state,$rootScope,$filter,$location,$auth,flash,$anchorScroll,FormFieldGroup,FormFieldTypes,GetDoctorSpeciality,FormFieldTypeAdd,FormFieldTypeAction,UserFormList,UserFormFieldAction,UserFormEntryList,ConstUserType,FormFieldGroupAction,DeleteSubmissionImage,UserSubmissionList,DoctorFormList,GetDoctorSpecialityEdit){moment.locale("en"),$scope.page_id=$state.params.id,$scope.form_id=$state.params.form_id,$scope.user_id=$state.params.user_id;var params={};$scope.added_choices=[],$scope.index=function(){$rootScope.pageTitle=$rootScope.settings["site.name"]+" | "+$filter("translate")("FormFieldGroups")+":"+$state.params.username,$scope.getFormFieldGroups(),$scope.AddChoices()},$scope.getFormFieldGroups=function(){params.filter='{"include":{"0":"specialty"}}',FormFieldGroup.get(params,function(response){$scope.formFieldGroups=response.data})},$scope.AddChoices=function(){$scope.added_choices.push({name:"",label:"",info:"",options:"",form_field_group_id:1,form_field_type_id:"1",is_required:0,display_order:1,is_active:1})},$scope.index(),$scope.delChoice=function(item){$scope.added_choices.splice(item,1)},parseInt($rootScope.auth.role_id)===parseInt(ConstUserType.Doctor)&&(FormFieldTypes.get(function(response){$scope.formFieldTypes=response.data}),angular.isDefined($state.params.id)?GetDoctorSpecialityEdit.get({form_id:$state.params.id},function(response){$scope.specialities=response.data}):GetDoctorSpeciality.get(function(response){$scope.specialities=response.data})),parseInt($rootScope.auth.role_id)===parseInt(ConstUserType.Patient)&&(UserFormList.get(function(response){$scope.userFormLists=response.users}),angular.isDefined($scope.user_id)&&DoctorFormList.get({user_id:$scope.user_id},function(response){$scope.doctorFormFieldGroups=response.form_field_groups})),parseInt($rootScope.auth.role_id)===parseInt(ConstUserType.Doctor)&&angular.isDefined($scope.form_id)&&angular.isDefined($scope.user_id)&&UserSubmissionList.get({form_id:$scope.form_id,user_id:$scope.user_id},function(response){$scope.userSubmissionLists=response.form_field_submissions}),$scope.deleteFormFieldGroup=function(group_id,status){var params={};params.id=group_id,params.status=status,FormFieldGroupAction.put(params,function(response){0===response.error.code?(flash.set($filter("translate")("Form field group status has been updated successfully."),"success",!0),$state.go("FormFieldGroupList")):flash.set($filter("translate")("Form field group status could not be updated. Please, try again."),"error",!1)})},$scope.submissionDelete=function(group_id){var params={};params.id=group_id,DeleteSubmissionImage["delete"](params,function(response){response.Success?($scope.attachments_show=!1,flash.set($filter("translate")(response.Success),"success",!0),$location.path("/user_form_fields/"+$scope.form_id)):flash.set($filter("translate")(response.Failed),"error",!0)})},parseInt($rootScope.auth.role_id)===parseInt(ConstUserType.Doctor)&&angular.isDefined($scope.page_id)&&FormFieldTypeAction.get({id:$scope.page_id},function(response){$scope.formData=response[0],$scope.editFormDatas=response[0].form_field}),angular.isDefined($scope.form_id)&&UserFormFieldAction.get({form_id:$scope.form_id},function(response){$scope.userFormDatas=response.form_fields,$scope.userEditFormDatas=response.form_fields.form_field_submission,angular.isDefined(response.form_fields.attachments)&&($scope.attachments_show=!0,$scope.downloadFileThumbUrl=response.form_fields.attachments,$scope.downloadFileId=response.form_fields.attachmentable_id)}),$scope.formEditText=function(){var formdata=[];angular.forEach($scope.formData.form_field,function(values,keys){formdata.push({parent_id:{id:$scope.formData.specialty_diseas_id,is_active:$scope.formData.is_active,child_id:{keys:values}}})}),FormFieldTypeAction.update({id:$scope.formData.id,data:formdata},function(response){response.Success?(flash.set($filter("translate")(response.Success),"success",!0),$location.path("/form_field_groups/edit/"+$scope.formData.id)):flash.set($filter("translate")(response.Failed),"error",!0)})},$scope.postFieldGroup=function(){$scope.formdata={},$scope.formdata.fieldGroups=[],$scope.added_choices.length>0&&angular.forEach($scope.added_choices,function(formValue){console.log(formValue,"fv"),$scope.formdata.fieldGroups.push({specialty_id:$scope.formFieldGroupAdd.id,display_order:formValue.display_order,form_field_type_id:formValue.form_field_type_id,info:formValue.info,label:formValue.label,name:formValue.name,is_required:formValue.is_required,is_active:formValue.is_active,options:formValue.options})}),FormFieldTypeAdd.post($scope.formdata,function(response){0===response.error.code?(flash.set($filter("translate")("Form field group has been added successfully."),"success",!0),$state.go("FormFieldGroupList")):flash.set($filter("translate")("Form field group could not be added. Please, try again."),"error",!1)})},$scope.userFormAdd=function(){UserFormFieldAction.post({form_id:$scope.form_id,data:$scope.userFormDatain},function(response){response.Success?(flash.set($filter("translate")(response.Success),"success",!0),$location.path("/user_form_fields/"+$scope.form_id)):flash.set($filter("translate")(response.Failed),"error",!0)})},$scope.addNewEditField=function(){var newItemNo=parseInt(Object.keys($scope.editFormDatas).length+1);$scope.editFormDatas[newItemNo]={id:newItemNo,name:"",label:"",info:"",options:null,form_field_group_id:$scope.page_id,form_field_type_id:1,is_required:0,display_order:newItemNo,is_active:1}},$scope.deleteEditField=function(value){value++,delete $scope.editFormDatas[value]},$scope.inputTypeChange=function(value){4==$scope.formFieldGroupAdd[value].form_field_type_id||5==$scope.formFieldGroupAdd[value].form_field_type_id?$scope.optionShow=!0:$scope.optionShow=!1}}),function(module){module.controller("MedicalHistoryAddController",function($state,$scope,Flash,$filter,MedicalHistoryAddFactory,SpecialtiesFactory){var model=this;$scope.year={start:"1975",end:(new Date).getFullYear()},SpecialtiesFactory.get().$promise.then(function(response){$scope.specialities=response.specialties}),$scope.MedicalHistory=function(){MedicalHistoryAddFactory.save(model.medical_history).$promise.then(function(response){Flash.set($filter("translate")(response.Success),"success",!0),$state.go("MedicalHistory",{})})}})}(angular.module("absApp.Clinic.MedicalHistory")),function(module){module.controller("MedicalHistoryEditController",function($state,$filter,$scope,$rootScope,Flash,MedicalHistoryEditFactory,SpecialtiesFactory,AttDeleteFactory){var model=this;$scope.year={start:"1975",end:(new Date).getFullYear()},model.init=function(){$rootScope.pageTitle=$rootScope.settings["site.name"]+" | "+$filter("translate")("Edit Medical History")},SpecialtiesFactory.get().$promise.then(function(response){$scope.specialities=response.specialties}),MedicalHistoryEditFactory.get({id:$state.params.id}).$promise.then(function(response){model.medical_history=response.data[0],model.medical_history.attachments_show=!1,angular.isDefined(model.medical_history.attachments.data[0])&&(model.medical_history.attachments=model.medical_history.attachments.data,model.medical_history.attachments_show=!0)}),model.MedicalHistoryEdit=function($valid){$valid&&MedicalHistoryEditFactory.update({id:$state.params.id},model.medical_history).$promise.then(function(response){Flash.set($filter("translate")(response.Success),"success",!0),$state.go("MedicalHistory")})},$scope.AttDelete=function(id){AttDeleteFactory["delete"]({id:id}).$promise.then(function(response){response.Success?Flash.set($filter("translate")(response.Success),"success",!0):Flash.set($filter("translate")(response.Failed),"error",!1),MedicalHistoryEditFactory.get({id:$state.params.id}).$promise.then(function(response){model.medical_history=response.data[0],model.medical_history.attachments=model.medical_history.attachments.data})})},model.init()})}(angular.module("absApp.Clinic.MedicalHistory")),function(module){module.controller("MedicalHistoryViewController",function($scope,$filter,$rootScope,$state,Flash,SweetAlert,MedicalHistory){var model=this;model.init=function(){$rootScope.pageTitle=$rootScope.settings["site.name"]+" | "+$filter("translate")("My Diseases"),$scope.aside={title:"Title",content:"Hello Aside
    This is a multiline message!"},$scope.currentPage=void 0!==$scope.currentPage?parseInt($scope.currentPage):1,$scope.getMedicalHistory()},$scope.getMedicalHistory=function(){var param={page:$scope.currentPage};MedicalHistory.get(param).$promise.then(function(response){$scope.histories=response.data,$scope._metadata=response.meta.pagination,$scope.currentPage=param.page,$scope.maxSize=5})},$scope.paginate=function(){$scope.currentPage=parseInt($scope.currentPage),$scope.getMedicalHistory(),$("html, body").stop(!0,!0).animate({scrollTop:0},600)},model.init()})}(angular.module("absApp.Clinic.MedicalHistory")),angular.module("absApp").controller("MedicalHistoryController",function($scope,$filter,$rootScope,$state,flash,SweetAlert,$timeout,$location,DateFormat,Upload,MedicalHistory,MedicalHistoryAction,AttachmentDelete,SpecialtiesFactory,MedicalHistoryView,AppointmentFactory,UserSpecialty,FormFieldGroupForm,ClinicAppointmentFactory,FormFieldSubmissionForm,AppointmentView,ConstMAX_UPLOAD_SIZE){function getMedicalHistory(params){MedicalHistory.get(params).$promise.then(function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),$scope.dataLength=response.data.length>0?!0:!1,$scope.medicalHistories=response.data,$scope.loader=!1,$scope._metadata=response._metadata})}function getSpecialties(user_id){params={},"0"!==user_id?($scope.specialties=[],params.filter='{"where":{"user_id":'+user_id+'},"include":{"0":"specialty"}}',UserSpecialty.get(params).$promise.then(function(response){console.log(response.data),angular.isDefined(response.data)&&Object.keys(response.data).length>0&&angular.forEach(response.data,function(value){$scope.specialties.push({id:value.specialty.id,name:value.specialty.name})})})):(params.filter='{"order":"name asc","limit":500,"skip":0}',SpecialtiesFactory.get(params).$promise.then(function(response){$scope.specialties=response.data}))}function getSpecialtyFormData(user_id,specialty_id){var api_filter={},Where=[];Where.push({where:{},include:{}}),api_filter.user_id=user_id,api_filter.specialty_id=specialty_id,Where[0].include[0]="specialty",Where[0].where=api_filter,params.filter=JSON.stringify(Where[0]),FormFieldGroupForm.get({user_id:user_id,specialty_id:specialty_id}).$promise.then(function(response){Object.keys(response.data).length>0?$rootScope.userFormDatas=response.data[0].form_field:$rootScope.userFormDatas=""})}function getPatientFormData(appointment_id){var api_filter={},Where=[];Where.push({where:{},include:{}}),api_filter.user_id=appointment_id,Where[0].include[0]="form_field",Where[0].where=api_filter,params.filter=JSON.stringify(Where[0]),FormFieldSubmissionForm.get(params).$promise.then(function(response){$scope.form_submissions=response.data})}function getAppointments(){$scope.patients=[];var patientCount=1;$scope.loader=!0;var Where=[],api_filter={};Where.push({where:{},include:{}}),api_filter.provider_user_id=$rootScope.auth.id,Where[0].include[0]="user.user_profile",Where[0].include[1]="provider_user.user_profile",Where[0].include[2]="clinic_user.user_profile",Where[0].include[4]="branch.city",Where[0].include[5]="appointment_type",Where[0].include[6]="appointment_status",Where[0].include[7]="specialty_disease",Where[0].include[8]="prescription",Where[0].where=api_filter,Where[0].skip=$scope.skipvalue,Where[0].limit=$scope.itemsPerPage,params.filter=JSON.stringify(Where[0]),params.type=$state.params.type,ClinicAppointmentFactory.get(params).$promise.then(function(response){response._metadata&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),$timeout(function(){$scope.appointments=response.data,$scope.isShown=response.data.length>0?!0:!1,$scope._metadata=response._metadata,$scope.loader=!1,angular.isDefined($scope.appointments)&&Object.keys($scope.appointments).length>0&&angular.forEach($scope.appointments,function(value){$scope.patients.push({id:value.id,user_id:value.user.id,patient_id:value.user.patient_id,specialty_id:value.specialty_id,name:value.user.user_profile.display_name+" - "+value.user.patient_id}),patientCount+=1}),console.log($scope.patients)},500)})}function getPatientAppointment(){params.id=$state.params.appointment_id,params.filter='{"include":{"0":"user.user_profile","1":"provider_user.user_profile","2":"clinic_user","3":"book_by_user.user_profile","4":"branch","5":"appointment_type","6":"appointment_status","7":"specialty_disease"}}',AppointmentView.get(params).$promise.then(function(response){$scope.appointment=response.data,$scope.todayDateTime=$filter("date")(new Date,"yyyy-MM-dd HH:mm")})}$rootScope.url_split=$location.path().split("/")[1],$rootScope.state_params=$state.params,$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$scope.DateFormat=DateFormat,$scope.attachments={images:[]},$scope.tmp_added_img=[],$scope.data={},$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0;var params={};$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Manage Consultations"),$timeout(function(){$scope.text_box=!0},1e3)},"ManageConsultations"===$state.current.name&&(params={},params.filter='{"where":{"user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+',"include":{"0":"specialty"}}'),"MedicalHistory"===$state.current.name&&(params={},params.filter='{"where":{"user_id":'+$rootScope.auth.id+'},"limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+',"include":{"0":"attachment"}}',getMedicalHistory(params)),"MedicalHistoryAdd"===$state.current.name&&($scope.year={start:"1975",end:(new Date).getFullYear()},$scope.show=!1,$scope.formFieldData=!1),"MedicalHistoryEdit"==$state.current.name&&($scope.year={start:"1975",end:(new Date).getFullYear()},params={},params.id=$state.params.id,params.filter='{"include":{"0":"attachment"}}',MedicalHistoryAction.get(params).$promise.then(function(response){$scope.data=response.data,getSpecialties($rootScope.auth.id)})),"MedicalHistoryView"===$state.current.name&&(params={},params.filter='{"where":{"user_id":'+$state.params.user_id+'},"include":{"0":"specialty","1":"attachment", "2": "user"}}',MedicalHistoryView.get(params).$promise.then(function(response){$scope.histories=response.data})),"MedicalRecords"===$state.current.name&&($scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,getAppointments()),"MedicalRecordView"===$state.current.name&&(params={},params.filter='{"where":{"user_id":'+$state.params.user_id+', "specialty_id":'+$state.params.specialty_id+'},"include":{"0":"specialty", "1":"attachment", "2": "user.user_profile"}}',MedicalHistory.get(params).$promise.then(function(response){$scope.medical_history=response.data[0]}),getPatientFormData($state.params.appointment_id),getPatientAppointment()),$scope.paginate=function(){$scope.currentPage=parseInt($scope.currentPage),$scope.getMedicalHistory(),$("html, body").stop(!0,!0).animate({scrollTop:0},600)},$scope.index(),$scope.upload=function(files){if(void 0!==files&&files.length>0){angular.forEach(files,function(file){var id=Math.random();$scope.attachments.images.push({id:id,file:file,percentage:0,error:null,triggered:!1})});var overall_images=Object.assign([],$scope.attachments.images);$scope.addAttachement(overall_images)}},$scope.addAttachement=function(files){var checkedFile,fileuploadindex,file=files.shift();checkedFile=$filter("filter")($scope.attachments.images,{id:file.id}),fileuploadindex=$scope.attachments.images.indexOf(checkedFile[0]),0==file.triggered?($scope.attachments.images[fileuploadindex].triggered=!0,Upload.upload({url:"/api/v1/attachments?class=MedicalHistory",data:{file:file.file}}).then(function(response){0!==response.data.error.code?$scope.attachments.images[fileuploadindex].error="Image could not be added. Image size should be less than "+ConstMAX_UPLOAD_SIZE:($scope.tmp_added_img.push(response.data.attachment),$scope.attachments.images[fileuploadindex].attachment=response.data.attachment,$scope.attachments.images[fileuploadindex].percentage=100),files.length>0&&$scope.addAttachement(files)},function(resp){"Request Entity Too Large"===resp.statusText?flash.set($filter("translate")("Attachment could not be added. Image size should be less than "+ConstMAX_UPLOAD_SIZE),"error",!1):$scope.attachments.images[fileuploadindex].error="Image could not be updated. Please, try again using this extensions jpg, jpeg, gif, png",i,files.length>0&&$scope.addAttachement(files)},function(evt){$scope.attachments.images[fileuploadindex].percentage=parseInt(100*evt.loaded/evt.total)},function(error){"Request Entity Too Large"===error.statusText?flash.set($filter("translate")("Image size exceed the"+ConstMAX_UPLOAD_SIZE),"error",!1):flash.set($filter("translate")("Attachment could not be added. Please try again later"),"error",!1)})):files.length>0&&$scope.addAttachement(files)},$scope.attachementremoval=function(index){var attachement_index;$scope.attachments.images.length>0&&($scope.tmp_added_img.length&&(attachement_index=$scope.tmp_added_img.indexOf($scope.attachments.images[index].attachment),$scope.tmp_added_img.splice(attachement_index,1)),$scope.attachments.images.splice(index,1))},$scope.$on("MulitpleUploader",function(event,data){$scope.imagedata=data,$scope.image=[]}),$scope.medicalHistoryAdd=function($valid){$scope.error=!1,$valid?($scope.data.user_id=$rootScope.auth.id,angular.isDefined($scope.tmp_added_img)&&Object.keys($scope.tmp_added_img).length>0&&($scope.data.medical_history_image=[],angular.forEach($scope.tmp_added_img,function(img){$scope.data.medical_history_image.push({image:img})})),MedicalHistory.post($scope.data).$promise.then(function(response){0===response.error.code?($state.go("MedicalHistory"),flash.set($filter("translate")("Medical History added successfully."),"success",!1)):flash.set($filter("translate")("Medical History added failure."),"error",!1)})):$scope.error=!0},$scope.medicalHistoryUpdate=function($valid,data){if(console.log($scope.data.attachment.length),$scope.error=!1,!$valid||void 0===$scope.imagedata&&0===$scope.data.attachment.length)$scope.error=!0;else{angular.isDefined($scope.imagedata)&&Object.keys($scope.imagedata).length>0&&($scope.data.medical_history_image=[],angular.forEach($scope.imagedata,function(img){angular.forEach(img,function(report){void 0!==report.attachment&&$scope.data.medical_history_image.push({image:report.attachment})})}));var medicalHistoryData={};medicalHistoryData.id=$state.params.id,medicalHistoryData.specialty_id=data.specialty_id,medicalHistoryData.years=data.years,medicalHistoryData.description=data.description,medicalHistoryData.medical_history_image=$scope.data.medical_history_image,medicalHistoryData.is_active=1,MedicalHistoryAction.put(medicalHistoryData).$promise.then(function(response){0===response.error.code?($state.go("MedicalHistory"),flash.set($filter("translate")("Medical History updated successfully."),"success",!1)):flash.set($filter("translate")("Medical History updated failure."),"error",!1)})}},$scope.MedicalHistoryDelete=function(id){SweetAlert.swal({title:$filter("translate")("Are you sure you want to delete this report?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&MedicalHistoryAction["delete"]({id:id},function(response){0===response.error.code?($state.go("MedicalHistory",{reload:!0}),$state.reload(),flash.set($filter("translate")("Your medical report has been deleted successfully."),"success",!1)):flash.set($filter("translate")("Your medical report couldn't deleted. Please try again."),"error",!1)})})},$scope.RemoveMedicalReport=function(attachmentId){SweetAlert.swal({title:$filter("translate")("Are you sure you want to remove this report?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&AttachmentDelete["delete"]({attachmentId:attachmentId},function(response){0===response.error.code?(flash.set($filter("translate")("Your medical report has been deleted successfully."),"success",!1),$scope.index()):(flash.set($filter("translate")("Your medical report couldn't deleted. Please try again."),"error",!1),$scope.index())})})},$scope.setDoctor=function(user_id){$scope.show=!0;var userId=user_id.split("/");"0"!==userId[0]?$rootScope.appointment_id=userId[1]:$rootScope.appointment_id="",getSpecialties(userId[0])},$scope.setSpecialty=function(user_id,specialty_id){if(""!==user_id&&""!==specialty_id){$scope.formFieldData=!0;var userId=user_id.split("/");"0"!==userId[0]?$rootScope.appointment_id=userId[1]:$rootScope.appointment_id="",getSpecialtyFormData(userId[0],specialty_id)}else $scope.formFieldData=!1},$scope.getMedicalHistory=function(medicalhistory){var medical_history=medicalhistory.split("/");$state.go("MedicalRecordView",{user_id:medical_history[0],specialty_id:medical_history[1],appointment_id:medical_history[2]})}}),angular.module("absApp").factory("FormFieldGroup",["$resource",function($resource){return $resource("/api/v1/form_field_groups",{},{get:{method:"GET"}})}]).factory("FormFieldGroupForm",["$resource",function($resource){return $resource("/api/v1/form_fields/:user_id/:specialty_id/specialty_form",{},{get:{method:"GET"}})}]).factory("FormFieldTypes",["$resource",function($resource){return $resource("/api/v1/form_field_types",{},{get:{method:"GET"}})}]).factory("GetDoctorSpeciality",["$resource",function($resource){return $resource("/api/v1/user/specialities",{},{get:{method:"GET"}})}]).factory("GetDoctorSpecialityEdit",["$resource",function($resource){return $resource("/api/v1/form_field_groups/get_doctor_specialities/:form_id",{},{get:{method:"GET",params:{form_id:"@form_id"}}})}]).factory("FormFieldTypeAdd",["$resource",function($resource){return $resource("/api/v1/form_field_groups",{},{post:{method:"POST"}})}]).factory("FormFieldTypeAction",["$resource",function($resource){return $resource("/api/v1/form_field_groups/:id",{},{edit:{method:"GET",params:{id:"@id"}},update:{method:"PUT",params:{id:"@id"}}})}]).factory("FormFieldGroupAction",["$resource",function($resource){return $resource("/api/v1/form_field_groups/:id/:status",{},{put:{method:"PUT",params:{id:"@id",status:"@status"}}})}]).factory("DeleteSubmissionImage",["$resource",function($resource){return $resource("/api/v1/form_field_submissions/:id",{"delete":{method:"DELETE",params:{id:"@id"}}})}]).factory("FormFieldSubmissionForm",["$resource",function($resource){return $resource("/api/v1/form_field_submissions",{get:{method:"GET"}})}]).factory("UserFormList",["$resource",function($resource){return $resource("/api/v1/user_form_list",{},{get:{method:"GET"}})}]).factory("UserFormEntryList",["$resource",function($resource){return $resource("/api/v1/user_form_entry_list/:form_id",{},{get:{method:"GET",params:{form_id:"@form_id"}}})}]).factory("UserFormFieldAction",["$resource",function($resource){return $resource("/api/v1/user_form_fields/:form_id",{},{get:{method:"GET",params:{form_id:"@form_id"}},post:{method:"POST",params:{form_id:"@form_id"}},update:{method:"PUT",params:{form_id:"@form_id"}}})}]).factory("DoctorList",["$resource",function($resource){return $resource("/api/v1/doctor_user_list/:id",{},{get:{method:"GET",params:{id:"@id"}}})}]).factory("UserSubmissionList",["$resource",function($resource){return $resource("/api/v1/user_form_view/:form_id/:user_id",{},{get:{method:"GET",params:{form_id:"@form_id",user_id:"@user_id"}}})}]).factory("DoctorFormList",["$resource",function($resource){return $resource("/api/v1/doctor_form_lists/:user_id",{},{get:{method:"GET",params:{user_id:"@user_id"}}})}]),angular.module("absApp").factory("MedicalHistory",["$resource",function($resource){return $resource("/api/v1/medical_history",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("SpecialtiesFactory",["$resource",function($resource){return $resource("/api/v1/specialties",{},{get:{method:"GET"}})}]).factory("MedicalHistoryAction",["$resource",function($resource){return $resource("/api/v1/medical_history/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"},"delete":{method:"DELETE"}})}]).factory("MedicalHistoryView",["$resource",function($resource){return $resource("/api/v1/medical_history/:user_id",{user_id:"@user_id"},{get:{method:"GET"}})}]).factory("MedicalRecordView",["$resource",function($resource){return $resource("/api/v1/medical_history/:user_id/:specialty_id",{user_id:"@user_id",specialty_id:"@specialty_id"},{get:{method:"GET"}})}]).factory("AttachmentDelete",["$resource",function($resource){return $resource("/api/v1/attachments/:attachmentId",{attachmentId:"@attachmentId"},{"delete":{method:"DELETE"}})}]).factory("UserSpecialty",["$resource",function($resource){return $resource("/api/v1/specialties_users",{},{get:{method:"GET"}})}]),angular.module("absApp.Clinic.MedicalHistory").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/doctor_form_lists.html",'

    {{\'Doctor Form list\'| translate}}

    {{\'Form Name\'| translate}} {{\'Action\'| translate}}
    {{formFieldGroup.name}}

    No records Found.

    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_add.html",'

    {{\'Add Form Field Groups\'|translate}} {{\'Back\'| translate}}

    {{\'Speciality Info\'| translate}}
    {{\'Form Fields Info\'| translate}}
    {{\'Form\'|translate}} #{{$index+1}}
    {{\'Required\'| translate }}

    Option value should be seperated by comma\'s
    '), $templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_edit.html",'

    {{\'Form Edit\'| translate}}


    Option value should be seperated by comma\'s
    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_form_view.html",'

    {{\'Form View\'| translate}}

    {{formData.specialty_diseas.name}}

    Active : {{(formData.is_active == 1) ? \'yes\' : \'No\'}}

    {{userFormData.info}}

    {{userFormData.info}}
    {{formField.info}}
    {{formField.info}}
    {{obj}}
    {{formField.info}}
    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_list.html",'

    {{\'Medical Forms\'|translate}} {{\'Add New From Group\'| translate}}

    {{\'Form Field Group Name\'| translate}} {{\'Actions\'| translate}}
    {{formFieldGroup.specialty.name}} {{\'De-activate\' | translate}}

    {{\'No Records Found\'| translate}}

    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/form_field_group_view.html",'

    {{\'User Form Entry list\'| translate}}

    No records Found.

    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/manage_consultations.html",'

    {{\'Manage Consultations\' | translate}} - {{\'Patients\' | translate}}

    {{\'Name\' | translate}}
    {{\'Age\' | translate}}
    {{\'Gender\'| translate}}
    {{\'Status\' | translate}} {{\'Consultation\' | translate}}
    {{appointment.appointment_token}} {{\'Dr\' | translate}}. {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}} {{appointment.clinic_user.user_profile.display_name}} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_status.name}} {{\'Cancelled\'| translate}} {{\'Reschedule/Cancel\'| translate}} {{\'Rating and Review\'| translate}} {{\'Not yet\'| translate}}

    {{\'No Records Found\' |translate}}

    {{\'No Records Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/medical_history.html",'

    {{\'Patient Info\'| translate}} - {{user.username}}

    {{\'Medical Records \'| translate}}

    {{\'Add Medical Record\'| translate}}
    {{\'Treatment Year\'| translate}} {{\'Reports\'| translate}} {{\'Info\'| translate}} {{\'Action\'| translate}}
    {{history.years}}
    {{history.description}}

    {{\'No Records Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/medical_history_add.html",'

    {{\'Patient Info\'| translate}} - {{user.username}}

    {{\'Add Medical Record\'| translate}}

    {{\'Medical Info\'| translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{attachment_image.error}}
    {{attachment_image.percentage}}% of 100 {{attachment_image.percentage}}% {{\'Finalizing\'|translate}}..
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/medical_history_edit.html",'

    {{\'Update Medical History\'|translate}}

    {{\'Medical Info\'| translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Allowed extensions: jpg, jpeg, gif, png\'|translate}}
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/medical_history_left_side_menu.html",''),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/medical_history_view.html",'

    {{\'Medical History Details\'| translate}}

    {{\'Back\'| translate}}
    {{\'S.No\'| translate}} {{\'Created\'| translate}} {{\'Speciality\'| translate}} {{\'Year\'| translate}} {{\'Description\'| translate}} {{\'Attachments\'| translate}}
    {{$index + 1}} {{history.created_at}} {{history.specialty.name}} {{history.years}} {{history.description}}
    {{\'No medical report added\'| translate}}

    {{\'No Medical history added\'| translate}}

    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/medical_record_view.html",'

    {{medical_history.user.user_profile.display_name}} - {{\'Medical Record\'| translate}}

    {{\'Back\'| translate}}
    {{\'Medical Data\'| translate}}
    {{\'The record is created at\' | translate}} {{medical_history.created_at | dateFormat}}
    {{\'Specialty\' | translate}} {{medical_history.specialty.name}}
    {{\'Treatment Year\' | translate}} {{medical_history.years}}
    {{\'Patient Speciality Details\' | translate }}
    {{form_submission.form_field.name}} {{form_submission.response}} {{form_submission.attachments.thumb[0].url}}
    {{\'Details\'| translate}}

    {{\'Report\'| translate}}
    {{\'No medical report added\'| translate}}
    {{\'Appointment Details\'| translate}}
    {{\'The appointment is scheduled at\' | translate}} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_time}}
    {{\'Appointment Token\' | translate}} {{appointment.appointment_token}}
    {{\'Where\' | translate}} {{appointment.clinic_user.user_profile.display_name}}, {{appointment.branch.name}}, {{appointment.branch.city.name}}
    {{\'Doctor Name\' | translate}} {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}}
    {{\'Room Number\' | translate}} {{appointment.provider_user.branches_doctor[0].doctor_room}} --
    {{\'Patient Name\' | translate}} {{appointment.user.user_profile.first_name}} {{appointment.user.user_profile.last_name}}
    {{\'Email\' | translate}} {{appointment.user.email}}
    {{\'Phone\' | translate}} {{appointment.user.mobile_code}}{{appointment.user.mobile}}
    {{\'Gender\' | translate}} {{\'Male\' | translate }} {{\'Female\' | translate }}
    {{\'Patient Status\' | translate}} {{\'Already Seen\' | translate}} {{\'New Patient\' | translate}}
    {{\'Reason for visit\' | translate}} {{appointment.provider_user.primary_speciality.name}}
    {{\'Appointment Status\' | translate}} {{appointment.appointment_status.name}}
    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/medical_records.html",'
    {{\'Patient ID\' | translate}}
    {{\'Appointment Token\' | translate}}
    {{\'Patient\\\'s Name\' | translate}}
    {{\'Clinic Name\'| translate}}
    {{\'Branch\'| translate}}
    {{\'Appointment\' | translate}} {{\'Date & Time\' | translate}} {{\'Records\' | translate}}
    {{appointment.user.patient_id}} {{appointment.appointment_token}} {{appointment.user.user_profile.first_name}} {{appointment.user.user_profile.last_name}} {{appointment.clinic_user.user_profile.display_name}} {{appointment.branch.name}}, {{appointment.branch.city.name}} {{appointment.appointment_date | dateFormat}} {{\'View\'| translate}}

    {{\'No Records Found\' |translate}}

    {{\'No Records Found\' |translate}}

    '), $templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/user_form_add.html",'

    {{\'User Form Add\'| translate}}

    {{userFormData.info}}
    {{userFormData.info}}
    {{userFormData.info}}
    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/user_form_edit.html",'

    {{\'User Form Add\'| translate}}

    {{userFormData.info}}
    {{userFormData.info}}
    {{userFormData.info}}
    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/user_form_field.html",'

    {{\'Doctor List\'| translate}}

    {{\'S.No\'| translate}} {{\'Doctor name\'| translate}}
    {{$index + 1}} {{doctorList.name}}

    {{\'No Doctor List\'| translate}}

    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/user_form_list.html",'

    {{\'User Form list\'| translate}}

    UserList
    {{User.username}}

    No records Found.

    '),$templateCache.put("scripts/plugins/Clinic/MedicalHistory/views/default/user_form_submission.html",'

    {{\'User Form Entry Page\'| translate}}

    {{$index+1}}. {{userSubmission.form_field.name}} - {{userSubmission.response}}
    {{userSubmission.attachments}}

    No records Found.

    ')}]);angular.module('absApp').requires.push('absApp.Clinic.MedicalHistory');"use strict";angular.module("absApp.Clinic.DiagnosticCenter",["ngResource","ngSanitize","satellizer","ngAnimate","ui.bootstrap","ui.router","angular-growl","google.places","ngCookies","angular-md5","ui.select","angulartics","pascalprecht.translate","angulartics.google.analytics","tmh.dynamicLocale","ngMap","chieffancypants.loadingBar","angularMoment","ngFileUpload","slugifier","ngTagsInput"]).config(function($stateProvider,$urlRouterProvider){var getToken={TokenServiceData:function(TokenService,$q){return $q.all({AuthServiceData:TokenService.promise,SettingServiceData:TokenService.promiseSettings})}};$urlRouterProvider.otherwise("/"),$stateProvider.state("diagnostic_profile",{url:"/diagnostic/:id/:slug",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_profile.html",controller:"DiagnosticController",resolve:getToken}).state("diagnostic_branches",{url:"/diagnostic/branches?page",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/branches.html",controller:"DiagnosticBranchesController",resolve:getToken}).state("diagnostic_branch_add",{url:"/diagnostic_center/branch/add",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_add.html",controller:"DiagnosticBranchesAddController",resolve:getToken}).state("diagnostic_branch_edit",{url:"/diagnostic/branch/edit/:id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_edit.html",controller:"DiagnosticBranchesEditController",resolve:getToken}).state("diagnostic_branch_view",{url:"/diagnostic/branches/:id/:slug",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_profile.html",controller:"DiagnosticBranchViewController",resolve:getToken}).state("diagnostic_lab_tests",{url:"/diagnostic/branch/lab_tests/:branch_id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/lab_tests.html",controller:"DiagnosticCenterTestsController",resolve:getToken}).state("diagnostic_lab_test_add",{url:"/diagnostic/lab_tests/add/:branch_id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/lab_test_add.html",controller:"DiagnosticCenterTestsAddController",resolve:getToken}).state("diagnostic_lab_test_edit",{url:"/diagnostic/lab_tests/edit/:id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/lab_test_edit.html",controller:"DiagnosticCenterTestsEditController",resolve:getToken}).state("diagnostic_branch_users",{url:"/diagnostic/branch/users/:branch_id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_users.html",controller:"DiagnosticUsersController",resolve:getToken}).state("diagnostic_branch_user_add",{url:"/diagnostic/branch/users/add/:branch_id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_users_add.html",controller:"DiagnosticUsersAddController",resolve:getToken}).state("diagnostic_branch_user_edit",{url:"/diagnostic/branch/users/edit/:id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_users_edit.html",controller:"DiagnosticUsersEditController",resolve:getToken}).state("diagnostic_dashboard",{url:"/labtests/{type}?page&appointment_date",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_labtests.html",controller:"DiagnosticLabTestsController",resolve:getToken}).state("MyDiagnosticLabTests",{url:"/labtests/all?page",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_labtests.html",controller:"DiagnosticLabTestsController",resolve:getToken}).state("choose_tests",{url:"/labtests/:diagnostic_center_user_id/:branch_id/choose-tests/:labtest_id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/choose_tests.html",controller:"ChooseTestsController",resolve:getToken}).state("diagnostic_labtest_view",{url:"/labtest/report/:id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_labtest_view.html",controller:"DiagnosticLabTestsController",resolve:getToken}).state("MyLabBooking",{url:"/lab_booking/all?error_code",templateUrl:"views/my_labtests.html",controller:"LabTestsController",resolve:getToken}).state("diagnostic_payment",{url:"/pay/diagnostic/payment/:id",templateUrl:"scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_payment.html",controller:"DiagnosticPaymentController",resolve:getToken})}),angular.module("absApp").controller("DiagnosticUsersController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,UsersFactory,SweetAlert,RemoveUser,BranchesEdit){function getBranchById(id){var params={};params.id=id,params.filter='{"fields":{"id":true,"name":true}}',BranchesEdit.get(params).$promise.then(function(response){angular.isDefined(response)&&(response.Failed?flashMessage(response.Failed,"error"):$scope.branch=response.data)})}$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Manage Users"),$scope.branch_id=$state.params.branch_id,$scope.myusers=function(){var params={};$scope.branch_id=$state.params.branch_id,params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+', "branch_id":'+$scope.branch_id+'},"include":{"0":"branch","1":"user","2":"user.user_profile","3":"user.attachment","4":"user.user_profile.city","5":"user.user_profile.country"}}',$scope.loader=!0,void 0===$state.params.page?params.page=1:params.page=$state.params.page,UsersFactory.get(params,function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.totalItems=response._metadata.total,$scope.itemsPerPage=response._metadata.per_page,$scope.noOfPages=response._metadata.last_page),angular.isDefined(response.data)&&($scope.users=response.data,$scope.dataLength=response.data.length>0?!0:!1)})},$scope.myusers(),$scope.paginate=function(){$scope.currentPage=parseInt($scope.currentPage),$state.go("branch_doctors",{page:$scope.currentPage}),$scope.myusers()},$scope.removeUser=function(branch_user_id){SweetAlert.swal({title:$filter("translate")("Are you sure you want to remove the user from branch list?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&RemoveUser["delete"]({id:branch_user_id},function(response){0===response.error.code?(flash.set($filter("translate")("Your user has been deleted successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your user couldn't deleted. Please try again."),"error",!1),$state.reload())})})},getBranchById($scope.branch_id)}),angular.module("absApp").controller("DiagnosticUsersAddController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,CountriesFactory,UsersFactory,PermissionsFactory){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add User"),$scope.data={},$scope.branch_id=$state.params.branch_id},$scope.index();var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.countries=response.data)}),PermissionsFactory.get().$promise.then(function(response){angular.isDefined(response)&&($scope.permissions=response.data)}),$scope.permission_select=[],$scope.check=function(value,checked){var idx=$scope.permission_select.indexOf(value);idx>=0&&!checked&&$scope.permission_select.splice(idx,1),0>idx&&checked&&$scope.permission_select.push(value)},$scope.save_btn=!1,$scope.addUser=function($valid,data){$valid&&!$scope.error_message?($scope.save_btn=!0,$scope.data.clinic_user_id=$rootScope.auth.id,$scope.data.branch_id=$state.params.branch_id,$scope.data.permissions=[],angular.isDefined($scope.permission_select)&&Object.keys($scope.permission_select).length>0?angular.forEach($scope.permission_select,function(value){$scope.data.permissions.push({name:value})}):($scope.save_btn=!0,flash.set($filter("translate")("Please select atleast one permission for Sub Accounts"),"error",!1)),delete $scope.data.user_permissions,UsersFactory.post($scope.data,function(response){0===parseInt(response.error.code)?($timeout(function(){$state.go("diagnostic_branch_users",{branch_id:$state.params.branch_id},{reload:!0})},500),flash.set($filter("translate")("User added successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("User added failed."),"error",!1))},function(response){$scope.save_btn=!0;var keysvalue=Object.keys(response.data.error.raw_message);keysvalue.length>0?flash.set($filter("translate")(response.data.error.raw_message.mobile),"error",!1):flash.set($filter("translate")(response.data.error.raw_message),"error",!1)})):$timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("DiagnosticUsersEditController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,CountriesFactory,UsersFactory,UsersEdit,PermissionsFactory){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add User")},$scope.index();var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.countries=response.data)}),PermissionsFactory.get().$promise.then(function(response){angular.isDefined(response)&&($scope.permissions=response.data)}),$scope.permission_select=[],$scope.check=function(value,checked){var idx=$scope.permission_select.indexOf(value);idx>=0&&!checked&&$scope.permission_select.splice(idx,1),0>idx&&checked&&$scope.permission_select.push(value)},$scope.save_btn=!1,$scope.userData={},params.id=$state.params.id,params.filter='{"include":{"0":"branch","1":"user.user_profile","2":"user.attachment","3":"user.user_profile.city","4":"user.user_profile.country"}}',$scope.userEdit=function(){UsersEdit.get(params,function(response){$scope.userData=response.data;for(var selected_permissions=[],sel_permissions=response.data.permissions.split(", "),i=0;i0?angular.forEach(data.user_permissions,function(value){$scope.permissions.push({name:value})}):($scope.save_btn=!0,flash.set($filter("translate")("Please select atleast one permission for Sub Accounts"),"error",!1));var userData={};userData.id=data.id,userData.name=data.name,userData.email=data.email,userData.country_id=data.country_id,userData.permissions=$scope.permissions,UsersEdit.put(userData,function(response){$scope.save_btn=!1,$scope.response=response,0===parseInt(response.error.code)?($timeout(function(){$state.go("diagnostic_branch_users",{branch_id:data.branch_id},{reload:!0})},500),flash.set($filter("translate")("User updated successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("User updated failed."),"error",!1))},function(response){flash.set($filter("translate")(response.data.error.message),"error",!1)})}else $timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("DiagnosticBranchesController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,BranchesFactory,BranchesEdit){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Branches"),$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,$scope.loader=!0,$scope.mybranch=function(){var params={};params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+'},"include":{"0":"city","1":"state","2":"country"},"order":"id desc", "limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}",void 0===$state.params.page?params.page=1:params.page=$state.params.page,BranchesFactory.get(params,function(response){response._metadata&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),angular.isDefined(response.data)&&($scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1),$scope.loader=!1})},$scope.mybranch(),$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){$scope.mybranch()},1e3)},$scope.changeStatus=function(branch_id,status){var branchData={};branchData.id=branch_id,branchData.is_active=status,SweetAlert.swal({title:$filter("translate")("Are you sure you want to change the status?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&BranchesEdit.put(branchData,function(response){0===response.error.code?(flash.set($filter("translate")("Your doctor has been deleted successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your doctor couldn't deleted. Please try again."),"error",!1),$state.reload())})})}}).controller("DiagnosticBranchViewController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,BranchesEdit,md5,Slug,DiagnosticCenterTestsFactory){function createSlug(input){return Slug.slugify(input)}$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Branches");var params={};params.id=$state.params.id,params.filter='{"include":{"0":"clinic_user","1":"branch_doctor","2":"branches_specialty.specialty","3":"branches_insurance.insurance","4":"attachment","5":"branch_doctor.user.user_profile","6":"branch_doctor.user.attachment"}}',$scope.loader=!0,BranchesEdit.get(params,function(response){angular.isDefined(response.data)&&($scope.branch=response.data,$scope.isShown=response.data.branch_doctor.length>0?!0:!1,$scope.loader=!1,$scope.images=[],$scope.doctors=[],angular.isDefined($scope.branch.branch_doctor)&&Object.keys($scope.branch.branch_doctor).length>0&&angular.forEach($scope.branch.branch_doctor,function(branchDoctor,key){var name=$scope.branch.branch_doctor[key].user.user_profile.first_name+" "+$scope.branch.branch_doctor[key].user.user_profile.last_name;$scope.branch.branch_doctor[key].user.drname=createSlug(name),null!==$scope.branch.branch_doctor[key].user.attachment?$scope.branch.branch_doctor[key].user.users_avatar_url="images/normal_thumb/UserAvatar/"+branchDoctor.user.user_id+"."+md5.createHash("UserAvatar"+branchDoctor.user.user_id+"pngnormal_thumb")+".png":$scope.branch.branch_doctor[key].user.users_avatar_url="images/default.png",$scope.branch.branch_doctor.push(branchDoctor)}),angular.isDefined(response.data.attachment)&&Object.keys(response.data.attachment).length>0&&angular.forEach(response.data.attachment,function(value,key){var small_hash=md5.createHash(value["class"]+value.id+"pngsmall_thumb"),small_thumb="images/small_thumb/"+value["class"]+"/"+value.id+"."+small_hash+".png",medium_hash=md5.createHash(value["class"]+value.id+"pngmedium_thumb"),medium_thumb="images/medium_thumb/"+value["class"]+"/"+value.id+"."+medium_hash+".png";$scope.images.push({thumb:small_thumb,img:medium_thumb})}),$scope.branchImages=$scope.images),$scope.GetLabTests($scope.branch.id,$scope.branch.clinic_user_id)}),$scope.allPhotos=function(){$scope.showPhoto=!0},$scope.GetLabTests=function(branch_id,diagnostic_center_user_id){var params={};params.filter='{"where":{"diagnostic_center_user_id":'+diagnostic_center_user_id+', "branch_id":'+branch_id+'},"include":{"0":"diagonostic_test_image","1":"lab_test"}}',DiagnosticCenterTestsFactory.get(params,function(response){angular.isDefined(response.data)&&($scope.labtests=response.data,$scope.testLength=response.data.length>0?!0:!1),angular.forEach($scope.labtests,function(lab,key){null!==$scope.labtests[key].diagonostic_test_image?$scope.labtests[key].lab_image="images/big_thumb/DiagonosticTest/"+lab.diagonostic_test_image.id+"."+md5.createHash("DiagonosticTest"+lab.diagonostic_test_image.id+"pngbig_thumb")+".png":$scope.labtests[key].lab_image="images/diagnostic_image.jpg"})})}}),angular.module("absApp").controller("DiagnosticBranchesAddController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,BranchesFactory,LocationsFactory,SpecialtiesFactory,InsurancesFactory,CountriesFactory){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add Branch"),$timeout(function(){$scope.text_box=!0},1e3)};var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($rootScope.countries=response.data)}),$scope.calendarSlots=[],$scope.calendarSlots.push({id:5,name:"5 mins"},{id:10,name:"10 mins"},{id:15,name:"15 mins"},{id:20,name:"20 mins"},{id:25,name:"25 mins"},{id:30,name:"30 mins"},{id:35,name:"35 mins"},{id:40,name:"40 mins"},{id:45,name:"45 mins"},{id:50,name:"50 mins"},{id:55,name:"55 mins"},{id:60,name:"60 mins"}),$scope.index(),$scope.getCountryPhoneCode=function(id){angular.forEach($rootScope.countries,function(country){id===country.iso2&&(""!==$scope.data.phone_number&&null!==$scope.data.phone_number&&$scope.data.phone_number||($scope.data.phone_number_code=country.phone))})},$scope.addresslocation=function(){$scope.IsAddressPlaceChange=!1,void 0!==$scope.data.address?(angular.forEach($scope.data.address.address_components,function(value){("locality"===value.types[0]||"administrative_area_level_2"===value.types[0])&&($scope.data.city={},$scope.data.city.name=value.long_name),"administrative_area_level_1"===value.types[0]&&($scope.data.state={},$scope.data.state.name=value.long_name),"country"===value.types[0]&&($scope.data.country={},$scope.data.country.iso2=value.short_name,$scope.selectedCountry=value.short_name,$scope.getCountryPhoneCode(value.short_name)),"postal_code"===value.types[0]&&($scope.data.postal_code=parseInt(value.long_name))}),$scope.data.address.address_components&&($scope.IsAddressPlaceChange=!0,$scope.data.latitude=$scope.data.address.geometry.location.lat(),$scope.data.longitude=$scope.data.address.geometry.location.lng(),$scope.data.full_address=$scope.data.address.name+" "+$scope.data.address.vicinity,$scope.data.address=$scope.data.address.formatted_address)):$scope.IsAddressPlaceChange=!0},$scope.save_btn=!1,$scope.postBranch=function($valid,formname){if($valid){$scope.save_btn=!0,$scope.data.clinic_user_id=$rootScope.auth.id,$scope.data.is_active=1,$scope.data.city=$scope.data.city,$scope.data.state=$scope.data.state,$scope.data.country=$scope.data.country,$scope.data.open_time=moment($scope.data.open_time).format("HH:mm:ss"),$scope.data.lunch_at=moment($scope.data.lunch_at).format("HH:mm:ss"),"Invalid date"===$scope.data.lunch_at&&($scope.data.lunch_at="00:00:00"),$scope.data.resume_at=moment($scope.data.resume_at).format("HH:mm:ss"),"Invalid date"===$scope.data.resume_at&&($scope.data.resume_at="00:00:00"),$scope.data.close_time=moment($scope.data.close_time).format("HH:mm:ss");var timeStart=new Date("01/01/2007 "+$scope.data.open_time).getHours(),timeEnd=new Date("01/01/2007 "+$scope.data.close_time).getHours(),hourDiff=timeEnd-timeStart;if(0>=hourDiff)return flash.set($filter("translate")("Close time should be greater then Open time."),"error",!1),!1;BranchesFactory.post($scope.data,function(response){var flashMessage;0===parseInt(response.error.code)?(flashMessage=$filter("translate")("Branch added successfully."),$state.go("diagnostic_branches"),flash.set(flashMessage,"success",!1)):($scope.save_btn=!1,flashMessage=$filter("translate")("Branch added failed."),flash.set(flashMessage,"error",!1))},function(error){console.log("postBranch Error",error)})}else $timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("DiagnosticBranchesEditController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,BranchesFactory,BranchesEdit,LocationsFactory,SpecialtiesFactory,CountriesFactory){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Edit Branch"),$timeout(function(){$scope.text_box=!0},1e3)};var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',CountriesFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($rootScope.countries=response.data)}),$scope.getCountryPhoneCode=function(id){angular.forEach($rootScope.countries,function(country){id===country.id&&($scope.country_phone_code=country.phone_code)})},$scope.calendarSlots=[],$scope.calendarSlots.push({id:5,name:"5 mins"},{id:10,name:"10 mins"},{id:15,name:"15 mins"},{id:20,name:"20 mins"},{id:25,name:"25 mins"},{id:30,name:"30 mins"},{id:35,name:"35 mins"},{id:40,name:"40 mins"},{id:45,name:"45 mins"},{id:50,name:"50 mins"},{id:55,name:"55 mins"},{id:60,name:"60 mins"}),$scope.index();var params={};$scope.addresslocation=function(){$scope.IsAddressPlaceChange=!1,void 0!==$scope.data.address?(angular.forEach($scope.data.address.address_components,function(value){("locality"===value.types[0]||"administrative_area_level_2"===value.types[0])&&($scope.data.city={},$scope.data.city.name=value.long_name),"administrative_area_level_1"===value.types[0]&&($scope.data.state={},$scope.data.state.name=value.long_name),"country"===value.types[0]&&($scope.data.country={},$scope.data.country.iso2=value.short_name,$scope.selectedCountry=value.short_name,$scope.getCountryPhoneCode(value.short_name)),"postal_code"===value.types[0]&&($scope.data.postal_code=parseInt(value.long_name))}),$scope.data.address.address_components&&($scope.IsAddressPlaceChange=!0,$scope.data.latitude=$scope.data.address.geometry.location.lat(),$scope.data.longitude=$scope.data.address.geometry.location.lng(),$scope.data.full_address=$scope.data.address.name+" "+$scope.data.address.vicinity,$scope.data.address=$scope.data.address.formatted_address)):$scope.IsAddressPlaceChange=!0},params.id=$state.params.id,params.filter='{"include":{"1":"city","2":"state","3":"country","4":"location"}}',$scope.branchEdit=function(){BranchesEdit.get(params,function(response){$scope.data=response.data,$scope.data.open_time=moment($scope.data.open_time,"HH:mm:ss"),$scope.data.close_time=moment($scope.data.close_time,"HH:mm:ss"),$scope.data.lunch_at=moment($scope.data.lunch_at,"HH:mm:ss"),$scope.data.resume_at=moment($scope.data.resume_at,"HH:mm:ss"),$scope.data.country=response.data.country,response.data.country_id&&($scope.selectedCountry=response.data.country.iso2),response.data.interval&&($scope.data.interval=parseInt(response.data.interval))})},$scope.branchEdit(),$scope.save_btn=!1,$scope.updateBranch=function($valid,formname){if($valid){$scope.save_btn=!0;var branchData={};branchData.id=$state.params.id,branchData.name=$scope.data.name,branchData.description=$scope.data.description,branchData.consultation_fee=$scope.data.consultation_fee,branchData.phone_number=$scope.data.phone_number,branchData.address=$scope.data.address,branchData.full_address=$scope.data.full_address,branchData.city=$scope.data.city,branchData.state=$scope.data.state,branchData.country=$scope.data.country,branchData.postal_code=$scope.data.postal_code,branchData.open_time=moment($scope.data.open_time).format("HH:mm:ss"),branchData.lunch_at=moment($scope.data.lunch_at).format("HH:mm:ss"),"Invalid date"===branchData.lunch_at&&(branchData.lunch_at="00:00:00"),branchData.resume_at=moment($scope.data.resume_at).format("HH:mm:ss"),"Invalid date"===branchData.resume_at&&(branchData.resume_at="00:00:00"),branchData.close_time=moment($scope.data.close_time).format("HH:mm:ss");var timeStart=new Date("01/01/2007 "+branchData.open_time).getHours(),timeEnd=new Date("01/01/2007 "+branchData.close_time).getHours(),hourDiff=timeEnd-timeStart;if(0>=hourDiff)return flash.set($filter("translate")("Close time should be greater then Open time."),"error",!1),!1;BranchesEdit.put(branchData,function(response){$scope.save_btn=!1,$scope.response=response,0===$scope.response.error.code?($timeout(function(){$state.go("diagnostic_branches",{reload:!0})},500),flash.set($filter("translate")("Branch updated successfully."),"success",!0)):(flash.set($filter("translate")("Branch updated failed."),"error",!1),$scope.save_btn=!1)})}else $timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("ChooseTestsController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,DiagnosticCenterTestsFactory,SweetAlert,RemoveTest,DiagnosticCenterTestsEdit,BranchesTimeSlot,md5,LabTestsGetFactory,FamilyFriends,FamilyFriendsEdit,UserViewProfileFactory,DiagnosticBookingAdd,ConstUserType,ConstAppointmentStatus,AppointmentTypes){function getBranchById(id){var params={};$scope.images=[],params.id=id,params.filter='{"include":{"0":"attachment","1":"city","2":"country"}}',BranchesTimeSlot.get(params).$promise.then(function(response){$scope.branch=response.data,angular.isDefined(response.data.attachment)&&Object.keys(response.data.attachment).length>0&&angular.forEach(response.data.attachment,function(value,key){var small_hash=md5.createHash(value["class"]+value.id+"pngsmall_thumb"),small_thumb="images/small_thumb/"+value["class"]+"/"+value.id+"."+small_hash+".png",medium_hash=md5.createHash(value["class"]+value.id+"pngmedium_thumb"),medium_thumb="images/medium_thumb/"+value["class"]+"/"+value.id+"."+medium_hash+".png";$scope.images.push({thumb:small_thumb,img:medium_thumb})}),$scope.branchImages=$scope.images})}function getDiagnosticById(id){var params={};params.id=id,params.filter='{"where":{"diagnostic_center_user_id":'+$state.params.diagnostic_center_user_id+', "branch_id":'+$scope.branch_id+', "lab_test_id":'+$scope.labtest_id+'},"include":{"0":"diagonostic_test_image","1":"user.user_profile"}}',DiagnosticCenterTestsFactory.get(params).$promise.then(function(response){$scope.diagonostic=response.data[0]})}$scope.totalcost=0,$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Choose Lab Tests"),$scope.branch_id=$state.params.branch_id,$scope.labtest_id=$state.params.labtest_id,$scope.addedTests={},$scope.Tests={},$scope.labtestmark={},$scope.dateBlockeBefore=$filter("date")(new Date,"yyyy-MM-ddTHH:mm:ss.sssZ"),$scope.ConstUserType=ConstUserType,$scope.ConstAppointmentStatus=ConstAppointmentStatus};var count=0;$scope.index(),getBranchById($scope.branch_id),getDiagnosticById($scope.branch_id);var params={};$scope.loader=!0,$scope.mybranchlabtests=function(){var params={};params.filter='{"where":{"diagnostic_center_user_id":'+$state.params.diagnostic_center_user_id+', "branch_id":'+$scope.branch_id+'},"include":{"0":"diagonostic_test_image","1":"lab_test"}}',$scope.loader=!0,void 0===$state.params.page?params.page=1:params.page=$state.params.page,DiagnosticCenterTestsFactory.get(params,function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.totalItems=response._metadata.total,$scope.itemsPerPage=response._metadata.per_page,$scope.noOfPages=response._metadata.last_page),angular.isDefined(response.data)&&($scope.labtests=response.data,$scope.dataLength=response.data.length>0?!0:!1),$scope.booking_type="me",$scope.radioSelected=function(value){$scope.booking_type=value,$scope.checkFamily=!1},params={},params.id=$rootScope.auth.id,params.filter='{"include":{"1":"user_profile"}}',UserViewProfileFactory.get(params,function(response){$scope.patient=response.data}),params={},params.filter='{"where":{"user_id":'+$rootScope.auth.id+"}}",FamilyFriends.get(params,function(response){$scope.family_friends=response.data,$scope.familyLength=response.data.length>0?!0:!1}),$scope.changeFamilyList=function(id){params={},params.id=id,$scope.checkFamily=!1,FamilyFriendsEdit.get(params,function(response){$scope.familydata=response.data,$scope.checkFamily=!0})};var checkedKey="";angular.forEach($scope.labtests,function(lab,key){if(null!==lab.diagonostic_test_image?lab.lab_image="images/big_thumb/DiagonosticTest/"+lab.diagonostic_test_image.id+"."+md5.createHash("DiagonosticTest"+lab.diagonostic_test_image.id+"pngbig_thumb")+".png":lab.lab_image="images/diagnostic_image.jpg",$scope.labtests[key].checked=!1,parseInt($scope.labtest_id)===parseInt(lab.lab_test.id)){var labtests={};labtests.id=lab.id,labtests.price=lab.price,labtests.lab_id=lab.lab_test.id,labtests.lab_test_name=lab.lab_test.name,$scope.addedTests[count]={},$scope.addedTests[count].id=lab.lab_test.id,$scope.addedTests[count].lab_test_name=lab.lab_test.name,$scope.addedTests[count].price=lab.price,$scope.addedTests[count].lab_image=$scope.labtests[key].lab_image,$scope.addedTests[count].data=labtests,$scope.totalcost=$scope.totalcost+lab.price,checkedKey=key}}),$scope.labtests.splice(checkedKey,1),$scope.loader=!1})},$scope.mybranchlabtests(),$scope.addLabTestToCart=function($event,diagnostic_center_test_id,lab_id,lab_test_name,price){var isExist=!1,labtests={};$scope.labtestmark[lab_id]?(angular.forEach($scope.addedTests,function(lab,key){parseInt(lab.id)!==parseInt(lab_id)&&(isExist=!0)}),isExist&&(count+=1,labtests.id=diagnostic_center_test_id,labtests.price=price,labtests.lab_id=lab_id,labtests.lab_test_name=lab_test_name,$scope.Tests[count]={},$scope.addedTests[count]={},$scope.addedTests[count].id=lab_id,$scope.addedTests[count].lab_test_name=lab_test_name,$scope.addedTests[count].price=labtests.price,$scope.addedTests[count].data=labtests,$scope.totalcost=$scope.totalcost+price,count++)):$scope.labtestmark[lab_id]||angular.forEach($scope.addedTests,function(lab,key){lab.id===lab_id&&($scope.totalcost=$scope.totalcost-price,$("#labtest_row_"+key).remove(),delete $scope.addedTests[key])})},$scope.removeAddedTest=function(event,index,price){$scope.totalcost=$scope.totalcost-price,$("#labtest_row_"+index).remove(),$scope.labtestmark[$scope.addedTests[index].id]=!1,delete $scope.addedTests[index]},$scope.guestName=function(gtname){$scope.guest_name=gtname},params={},params.filter='{"where":{"is_active": 1},"order":"name asc","limit":"all","skip":0}',AppointmentTypes.get(params,function(response){$scope.appointmentTypes=response.data}),$scope.data={},$scope.data.appointment_type_id=2,$scope.UserDetails=function(details){$scope.data=details},$scope.BookNow=function($valid,form,type){if("me"!==$scope.booking_type&&void 0===$scope.guest_name&&($scope.guest_name_required=!0), $valid){$scope.disableButton=!0;var bookingData={};bookingData.patient_id=$rootScope.auth.id,bookingData.diagnostic_center_user_id=$state.params.diagnostic_center_user_id,bookingData.branch_id=$state.params.branch_id,bookingData.appointment_date=$filter("date")(new Date(form.appointment_date.$modelValue),"yyyy-MM-dd"),bookingData.appointment_time=form.appointment_time.$modelValue,bookingData.appointment_type_id=1,parseInt($rootScope.user.role_id)===parseInt($scope.ConstUserType.Diagnostic)&&(bookingData.first_name=$scope.data.first_name,bookingData.last_name=$scope.data.last_name,bookingData.phone=$scope.data.phone,bookingData.email=$scope.data.email,bookingData.appointment_type_id=$scope.data.appointment_type_id),parseInt($rootScope.user.role_id)===parseInt($scope.ConstUserType.Patient)&&("me"===$scope.booking_type?bookingData.user_id=$rootScope.user.id:bookingData.guest_name=$scope.guest_name),$scope.diagnostic_center_tests=[],angular.forEach($scope.addedTests,function(value){$scope.diagnostic_center_tests.push({diagnostic_center_test_id:value.data.id,diagnostic_center_lab_test_id:value.id})}),bookingData.diagnostic_center_tests=$scope.diagnostic_center_tests,"some_one_else"===$scope.booking_type&&(bookingData.family_friend_id=$scope.family_friend_id),bookingData.appointment_status_id=$scope.ConstAppointmentStatus.Approved,DiagnosticBookingAdd.post(bookingData,function(response){var flashMessage;0===parseInt(response.error.code)?"pay-now"===type?(flashMessage=$filter("translate")("Appointment added successfully with date "+response.data.appointment_date+" and time "+response.data.appointment_time+". Please complete your payment."),flash.set(flashMessage,"success",!1),$state.go("diagnostic_payment",{id:response.data.id})):(flashMessage=$filter("translate")("Appointment added successfully with date "+response.data.appointment_date+" and time "+response.data.appointment_time),flash.set(flashMessage,"success",!1),$state.go("diagnostic_branch_view",{id:$scope.branch.id,slug:$scope.branch.name})):($scope.save_btn=!1,flashMessage=$filter("translate")("Appointment added failed."),flash.set(flashMessage,"error",!1))},function(error){flash.set($filter("translate")("Already you have booked this slot. Please try with other slots."),"error",!1)})}}}),angular.module("absApp").controller("DiagnosticAppointmentsController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,SweetAlert,BranchesFactory,ClinicAppointmentFactory,ConstAppointmentStatus,AppointmentView,ConstUserType,Slug){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Appointments"),$scope.ConstAppointmentStatus=ConstAppointmentStatus,$scope.ConstUserType=ConstUserType,$scope.maxSize=5,$scope.user={},$scope.user.role_id=parseInt($rootScope.auth.role_id);var params={};$scope.index=function(){$scope.currentPage=void 0!==$scope.currentPage?parseInt($scope.currentPage):1,$state.params.type=void 0!==$state.params.type?$state.params.type:"all",$scope.paramsType=$state.params.type,"Appointments"===$state.current.name?($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("My Appointments"),$scope.mybranches(),$scope.branch_id="all",$scope.getAppointmentList($scope.branch_id)):"AppointmentView"===$state.current.name&&($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Appointment Detail"),params.id=$state.params.id,params.filter='{"include":{"0":"user.user_profile","1":"provider_user.user_profile","2":"clinic_user","3":"book_by_user.user_profile","4":"branch","5":"appointment_type","6":"appointment_status","7":"specialty_disease"}}',AppointmentView.get(params).$promise.then(function(response){$scope.appointment=response.data;var name=$scope.appointment.provider_user.user_profile.first_name+" "+$scope.appointment.provider_user.user_profile.last_name;$scope.doctorSlug=Slug.slugify(name),$scope.todayDateTime=$filter("date")(new Date,"yyyy-MM-dd HH:mm")})),$scope.changeappointstatus=function(status){"confirm"==status?titleText="Are you sure to Confirm this Appointment?":"decline"==status?titleText="Are you sure to Decline this Appointment?":"cancel"==status?titleText="Are you sure to Cancel this Appointment?":"present"==status?titleText="Are you sure to change Present this Appointment?":"close"==status?titleText="Are you sure to Closed this Appointment?":"expiry"==status&&(titleText="Are you sure to Expired this Appointment?"),SweetAlert.swal({title:titleText,text:"",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Confirm",cancelButtonText:"No",closeOnConfirm:!0,closeOnCancel:!0},function(isConfirm){isConfirm&&ChangeStatus.get({id:$state.params.id,apt_status:status}).$promise.then(function(response){flash.set($filter("translate")(response.Success),"success",!0),$location.path("/appointments/all")})})}},$scope.getAppointmentList=function(id){$scope.branch_id=id;var Where=[],api_filter={};Where.push({where:{},include:{}}),api_filter.clinic_user_id=$rootScope.auth.id,"all"!==id&&(api_filter.branch_id=id),api_filter.appointment_status_id={},api_filter.appointment_status_id.nin=[ConstAppointmentStatus.PaymentPending],Where[0].include[0]="user.user_profile",Where[0].include[1]="provider_user.user_profile",Where[0].include[2]="clinic_user",Where[0].include[3]="book_by_user.user_profile",Where[0].include[4]="branch",Where[0].include[5]="appointment_type",Where[0].include[6]="appointment_status",Where[0].include[7]="specialty_disease",Where[0].where=api_filter,params.filter=JSON.stringify(Where[0]),params.type=$state.params.type,ClinicAppointmentFactory.get(params).$promise.then(function(response){$scope.appointments=response.data,$scope.isShown=response.data.length>0?!0:!1,$scope._metadata=response._metadata})},$scope.mybranches=function(){params.filter='{"where":{"is_active": 1,"clinic_user_id":'+$rootScope.auth.id+"}}",BranchesFactory.get(params,function(response){angular.isDefined(response.data)&&($scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1)})},$scope.paginate=function(){$scope.currentPage=parseInt($scope.currentPage),$scope.getAppointmentList()},$scope.changeStatus=function(branch_id,status){var branchData={};branchData.id=branch_id,branchData.is_active=status,SweetAlert.swal({title:$filter("translate")("Are you sure you want to change the status?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&BranchesEdit.put(branchData,function(response){0===response.error.code?(flash.set($filter("translate")("Your doctor has been deleted successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your doctor couldn't deleted. Please try again."),"error",!1),$state.reload())})})},$scope.index()}),angular.module("absApp").controller("DiagnosticLabTestsController",function($scope,$state,$filter,$rootScope,$location,$timeout,DiagnosticLabTestsFactory,flash,ConstUserType,ConstAppointmentStatus,Slug,BranchesFactory,LabTestAppointmentView,Upload,LabTestReport,PatientBookingLogs){$scope.ConstUserType=ConstUserType,$scope.ConstAppointmentStatus=ConstAppointmentStatus,$scope.maxSize=5,$scope.lastPage=1,$scope.itemsPerPage=20,$scope.data=[];var params={};$scope.currentPage=angular.isDefined($state.params.page)?parseInt($state.params.page):1,$scope.skipvalue=void 0!==$scope.itemsPerPage?($scope.currentPage-1)*$scope.itemsPerPage:0,$scope.itemsPerPage=void 0!==$scope.itemsPerPage?$scope.itemsPerPage:0,$scope.index=function(){$scope.paramsType=$state.params.type,"diagnostic_dashboard"===$state.current.name?($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("My Lab Tests"),$scope.mybranches(),$scope.branch_id="all",$scope.getPatientBookLogs(),$scope.getLabTestList($scope.branch_id)):"diagnostic_labtest_view"===$state.current.name&&($rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Lab Test Detail"),params.id=$state.params.id,params.filter='{"include":{"0":"patient.user_profile","1":"diagnostic_center_tests_patient_diagnostic_test.diagnostic_center_test.lab_test","2":"book_by_user.user_profile","3":"branch.city","4":"appointment_type","5":"appointment_status","6":"diagnostic_center_user.user_profile","7":"diagnostic_center_tests_patient_diagnostic_test.attachment"}, "limit":'+$scope.itemsPerPage+',"skip":'+$scope.skipvalue+"}",LabTestAppointmentView.get(params).$promise.then(function(response){$scope.appointment=response.data}))},$scope.mybranches=function(){params.filter='{"where":{"is_active": 1,"clinic_user_id":'+$rootScope.auth.id+"}}",BranchesFactory.get(params,function(response){angular.isDefined(response.data)&&($scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1)})},$scope.getLabTestList=function(id){$scope.loader=!0,$scope.branch_id=id;var Where=[],api_filter={};Where.push({where:{},include:{}}),api_filter.diagnostic_center_user_id=$rootScope.auth.id,"all"!==id&&(api_filter.branch_id=id),Where[0].include[0]="patient.user_profile",Where[0].include[1]="branch.city",Where[0].include[2]="book_by_user.user_profile",Where[0].include[3]="appointment_type",Where[0].include[4]="appointment_status",Where[0].where=api_filter,Where[0].skip=$scope.skipvalue,Where[0].limit=$scope.itemsPerPage,params.filter=JSON.stringify(Where[0]),params.type=$state.params.type,DiagnosticLabTestsFactory.get(params).$promise.then(function(response){response._metadata&&($scope.currentPage=response._metadata.current_page,$scope.lastPage=response._metadata.last_page,$scope.itemsPerPage=20,$scope.totalRecords=response._metadata.total,$scope.Perpage=response._metadata.per_page),$timeout(function(){$scope.labtests=response.data,$scope.isShown=response.data.length>0?!0:!1,$scope._metadata=response._metadata,$scope.loader=!1},500)})},$scope.getPatientBookLogs=function(){var Where=[],api_filter={};Where.push({where:{}}),api_filter.clinic_user_id=$rootScope.auth.id,Where[0].where=api_filter,params.filter=JSON.stringify(Where[0]),PatientBookingLogs.get(params).$promise.then(function(response){$scope.bookingLogs=response.data,$scope.logLength=response.data.length>0?!0:!1})},$scope.paginate_search=function(element,currentPage){$scope.currentPage=currentPage,$location.search("page",currentPage),$("html, body").stop().animate({scrollTop:0},1e3,"swing",!1),$timeout(function(){$scope.getLabTestList()},1e3)},$scope.index(),$scope.upload=function(file){Upload.upload({url:"/api/v1/attachments?class=DiagnosticCenterTestPatientDiagnosticTest",data:{file:file}}).then(function(response){0===response.data.error.code?($scope.data.attachment=response.data.attachment,$scope.error_message=""):$scope.error_message=response.data.error.message})},$scope.$on("MulitpleUploader",function(event,data){$scope.imagedata=data.image_uploaded,$scope.image=[]}),$scope.save_btn=!1,$scope.uploadReport=function($valid,diagnostic_center_tests_patient_diagnostic_test_id){if($scope.error=!1,$valid&&void 0!==$scope.imagedata){$scope.save_btn=!0;var labtestData={};labtestData.id=diagnostic_center_tests_patient_diagnostic_test_id,labtestData.is_report_uploaded=1,labtestData.attachment=[],angular.isDefined($scope.imagedata)&&Object.keys($scope.imagedata).length>0&&angular.forEach($scope.imagedata,function(img){void 0!==img.attachment&&labtestData.attachment.push({image:img.attachment})}),LabTestReport.put(labtestData,function(response){0===parseInt(response.error.code)?($timeout(function(){$state.go("MyDiagnosticLabTests",{},{reload:!0})},500),flash.set($filter("translate")("Lab Test report added successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("Lab Test report added failed."),"error",!1))},function(response){flash.set($filter("translate")(response.data.error.message),"error",!1)})}else $timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.error=!0,$scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})},$scope.today=function(){$scope.dt=new Date},$scope.today(),$scope.clear=function(){$scope.dt=null},$scope.open1=function(){$scope.popup1.opened=!0},$scope.open2=function(){$scope.popup2.opened=!0},$scope.formats=["yyyy-MM-dd","yyyy/MM/dd","dd.MM.yyyy","shortDate"],$scope.format=$scope.formats[1],$scope.altInputFormats=$scope.formats[1],$scope.popup1={opened:!1},$scope.popup2={opened:!1},$scope.BookingDate=function(bookingdate){$scope.appointment_date_search=$filter("date")(new Date(bookingdate),"yyyy-MM-dd"),$state.go("diagnostic_dashboard",{type:$state.params.type,page:$state.params.page,appointment_date:$scope.appointment_date_search})},$scope.reset_date_filter=function(){$state.go("diagnostic_dashboard",{type:$state.params.type,page:$state.params.page,appointment_date:""})},$scope.appointment_date_search=$state.params.appointment_date,$scope.appointment_date=new Date($state.params.appointment_date),$scope.appoinment_type=function(type){$state.go("diagnostic_dashboard",{type:type,page:$state.params.page})},$scope.updatePayment=function(paid){var labtestData={};labtestData.id=$state.params.id,labtestData.is_paid=paid?1:0,LabTestAppointmentView.put(labtestData,function(response){0===parseInt(response.error.code)?flash.set($filter("translate")("Payment status updated successfully."),"success",!0):flash.set($filter("translate")("Payment status updated failed."),"error",!1)},function(response){flash.set($filter("translate")(response.data.error.message),"error",!1)})}}),angular.module("absApp").controller("DiagnosticPaymentController",function($scope,$state,$filter,$rootScope,$window,$location,AppointmentView,flash,ConstUserType,ConstAppointmentStatus,Slug,PaymentGatewayList,RaveSuccessCheckoutFactoryForDiagnostic,LabTestAppointmentView,ConstPaymentGateways,PaymentOrder){$scope.maxSize=5,$scope.user={},$scope.paynow_is_disabled=!1,$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Lab Test Payment");var params={};params.id=$state.params.id,params.filter='{"include":{"0":"patient.user_profile","1":"diagnostic_center_tests_patient_diagnostic_test.diagnostic_center_test.lab_test","2":"book_by_user.user_profile","3":"branch.city","4":"appointment_type","5":"appointment_status","6":"diagnostic_center_user.user_profile","7":"diagnostic_center_tests_patient_diagnostic_test.attachment"}}',LabTestAppointmentView.get(params).$promise.then(function(response){$scope.appointment=response.data});var params={};params.filter='{"limit":"all", "skip":0}',PaymentGatewayList.get(params,function(payment_response){new Array;if($scope.gateway_count=0,payment_response.wallet&&($scope.wallet_enabled=!0,0===parseInt($scope.user_available_balance)?$scope.is_show_wallet_paybtn=!1:$scope.is_show_wallet_paybtn=!0,$scope.gateway_count=$scope.gateway_count+1),payment_response.PayPalREST){var response=payment_response.PayPalREST;response.paypalrest_enabled&&($scope.paypal_plugin_enabled=!0),$scope.gateway_count=$scope.gateway_count+1}if(payment_response.RaveByFlutterwave){var response=payment_response.RaveByFlutterwave;response.rave_enabled&&($scope.rave_plugin_enabled=!0,$scope.is_test_mode=response.is_test_mode,$scope.public_key=response.public_key),$scope.gateway_count=$scope.gateway_count+1}})},$scope.paypal_paynow=function(need_to_pay){$scope.paynow_is_disabled=!0;var params={};params["class"]="PatientDiagnosticTest",params.foreign_id=$state.params.id,need_to_pay===!0&&(params.payment_gateway_id=ConstPaymentGateways.PayPal),PaymentOrder.post(params,function(response){var flashMessage;0===response.error.code?void 0!==response.redirect_url?$window.location.href=response.redirect_url:void 0!==response.gateway_callback_url?$window.location.href=response.gateway_callback_url:void 0!==response.status?"Pending"===response.status&&(flashMessage=$filter("translate")("Your request is in pending."),flash.set(flashMessage,"error",!1),$state.reload()):void 0!==response.status?"Captured"===response.status&&(flashMessage=$filter("translate")("Amount added successfully."),flash.set(flashMessage,"success",!1),$state.reload()):0===response.error.code?(void 0!==response.payment_response&&"Captured"===response.payment_response.status&&($scope.my_user.available_wallet_amount=$scope.my_user.available_wallet_amount-parseInt(response.total_listing_fee)),flashMessage=$filter("translate")("Booking successfully completed."),flash.set(flashMessage,"success",!1),$state.reload(),$state.go("diagnostic_labtest_view",{id:response.data.id})):512===response.error.code&&(flashMessage=$filter("translate")("Process Failed. Please, try again."),flash.set(flashMessage,"error",!1)):(flashMessage=$filter("translate")("We are unable to process your request. Please try again."+response.error.message),flash.set(flashMessage,"error",!1)),$scope.paynow_is_disabled=!1})},$scope.payWithRave=function(){$scope.paynow_is_disabled=!0;var x=getpaidSetup({PBFPubKey:$scope.public_key,customer_email:$rootScope.auth.email,amount:$scope.appointment.fee,customer_phone:$rootScope.auth.mobile,currency:$rootScope.settings.SITE_CURRENCY_CODE,country:"GH",txref:"diagnostic_test-"+$state.params.id,payment_options:"card,mobilemoneyghana",onclose:function(){$scope.paynow_is_disabled=!1},callback:function(response){response.tx.txRef;"00"==response.tx.chargeResponseCode||"0"==response.tx.chargeResponseCode?$scope.paySuccess(response):$scope.payFailed(response),x.close()}})},$scope.paySuccess=function(payment_response){$scope.rave_data={},$scope.rave_data.id=$state.params.id,$scope.rave_data.txRef=payment_response.tx.txRef,$scope.rave_data.flwRef=payment_response.tx.flwRef,$scope.rave_data.response=JSON.stringify(payment_response);var flashMessage;RaveSuccessCheckoutFactoryForDiagnostic.put($scope.rave_data,function(response){$scope.paynow_is_disabled=!1,0===response.error.code?(flash.set($filter("translate")("Your payment has been completed successfully."),"success",!0,8e3),angular.isDefined(response.data.id)&&$state.go("diagnostic_labtest_view",{id:response.data.id})):512===response.error.code?flash.set($filter("translate")("Payment Failed. Please, try again."),"error",!1):(flashMessage=$filter("translate")("We are unable to place your order. Please try again."),""!==response.error.message&&(flashMessage=flashMessage+" Error: "+response.error.message),flash.set(flashMessage,"error",!1))},function(error){$scope.paynow_is_disabled=!1,flash.set($filter("translate")("We are unable to place your order. Please try again."),"error",!1)})},$scope.payFailed=function(payment_response){$scope.paynow_is_disabled=!1,flash.set($filter("translate")("Payment Failed. Please, try again."),"error",!1)},$scope.index()}),angular.module("absApp").controller("DiagnosticController",function($scope,$state,$rootScope,$filter,$location,$auth,flash,$anchorScroll,ConstUserType,BranchesFactory,UserViewProfileFactory,DiagnosticCenterTestsFactory,UserReviews,UserAppointment,md5,NgMap,$timeout){$scope.positions=[],$scope.labMap=function(userData){var cityValue="";if("undefined"!=typeof userData){"undefined"!=typeof userData.city&&(cityValue=","+userData.city.name+",");var postal_codeValue="";"undefined"!=typeof userData.postal_code&&(postal_codeValue=","+userData.postal_code+",");var countryValue="";if("undefined"!=typeof userData.country&&(countryValue=","+userData.country.iso2+","),"undefined"!=typeof userData.latitude&&"undefined"!=typeof userData.longitude&&null!==userData.latitude&&null!==userData.longitude){var formattedAddress=postal_codeValue+cityValue+countryValue,formattedAddressResult=formattedAddress.substring(1,formattedAddress.length-1).replace(/,,/g,",");$scope.positions.push({id:userData.user_id,branch:userData.display_name,address1:userData.address,address2:formattedAddressResult,lat:userData.latitude,lon:userData.longitude})}}},$scope.init=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("View Profile")+" | "+$state.params.slug,$scope.currentPage=void 0!==$scope.currentPage?parseInt($scope.currentPage):1,NgMap.getMap().then(function(map){$scope.map=map})};var params={};params.id=$state.params.id,params.filter='{"include":{"0":"attachment","1":"user_profile"}}',UserViewProfileFactory.get(params).$promise.then(function(response){if($scope.user=response.data,console.log($scope.user),angular.isDefined($scope.user.attachment)&&null!==$scope.user.attachment){var hash=md5.createHash($scope.user.attachment["class"]+$scope.user.attachment.id+"pnglarge_thumb");$scope.user.user_image="images/large_thumb/"+$scope.user.attachment["class"]+"/"+$scope.user.attachment.id+"."+hash+".png"}else $scope.user.user_image="images/default.png";$scope.labMap($scope.user.user_profile)}),$scope.init(),$scope.isAuthenticated=function(){return $auth.isAuthenticated()},$scope.getReviewsList=function(){params={doctor_id:$scope.userId,page:$scope.currentPage},UserReviews.get(params).$promise.then(function(response){$scope.doctorReviews=response.data,$scope._metadata=response.meta.pagination,$scope.metadata=response.meta.pagination})},$scope.paginate=function(){$scope.currentPage=parseInt($scope.currentPage),$scope.getReviewsList()},$scope.mapDisplay=function(branchData){angular.forEach(branchData,function(value,key){var cityValue="";if("undefined"!=typeof value){"undefined"!=typeof value.city&&(cityValue=","+value.city.name+",");var postal_codeValue="";"undefined"!=typeof value.postal_code&&(postal_codeValue=","+value.postal_code+",");var countryValue="";if("undefined"!=typeof value.country&&(countryValue=","+value.country.name+","),"undefined"!=typeof value.latitude&&"undefined"!=typeof value.longitude&&null!==value.latitude&&null!==value.longitude){var formattedAddress=postal_codeValue+cityValue+countryValue,formattedAddressResult=formattedAddress.substring(1,formattedAddress.length-1).replace(/,,/g,",");$scope.positions.push({id:value.id,branch:value.name,address1:value.address,address2:formattedAddressResult,lat:value.latitude,lon:value.longitude})}}})},NgMap.getMap().then(function(map){$scope.map=map}),$scope.showDetail=function(e,branchInfo){$scope.branchInfo=branchInfo,console.log(branchInfo.id),$scope.map.showInfoWindow("branch-info",branchInfo.id)},$scope.GetLabTests=function(branch_id,diagnostic_center_user_id){$scope.loader=!0;var params={};$scope.active_id=branch_id,params.filter='{"where":{"diagnostic_center_user_id":'+diagnostic_center_user_id+', "branch_id":'+branch_id+'},"include":{"0":"diagonostic_test_image","1":"lab_test"}}',DiagnosticCenterTestsFactory.get(params,function(response){$timeout(function(){$scope.loader=!1,$scope.labtests=response.data,$scope.testLength=response.data.length>0?!0:!1,angular.forEach($scope.labtests,function(lab,key){null!==$scope.labtests[key].diagonostic_test_image?$scope.labtests[key].lab_image="images/big_thumb/DiagonosticTest/"+lab.diagonostic_test_image.id+"."+md5.createHash("DiagonosticTest"+lab.diagonostic_test_image.id+"pngbig_thumb")+".png":$scope.labtests[key].lab_image="images/diagnostic_image.jpg"})},500)})},$scope.GetAllBranches=function(){var params={};params.filter='{"where":{"clinic_user_id":'+$rootScope.auth.id+', "is_active":"1"},"include":{"0":"city","1":"country"}}',BranchesFactory.get(params,function(response){$scope.branches=response.data,$scope.dataLength=response.data.length>0?!0:!1,$scope.mapDisplay($scope.branches),$scope.mappositions=$scope.positions,$scope.mapCenter=[$scope.mappositions[0].lat,$scope.mappositions[0].lon],$scope.branches.length>0&&$scope.GetLabTests($scope.branches[0].id,$scope.branches[0].clinic_user_id)})},$scope.GetAllBranches()}),angular.module("absApp").controller("DiagnosticCenterTestsAddController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,LabTestsFactory,DiagnosticCenterTestsFactory,ConstUserType,md5,Upload){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Add Branch"),$scope.branch_id=$state.params.branch_id,$scope.ConstUserType=ConstUserType},$scope.index();var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',LabTestsFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.labtests=response.data)}),$scope.upload=function(file){Upload.upload({url:"/api/v1/attachments?class=LabTest",data:{file:file}}).then(function(response){0===response.data.error.code?($scope.data.diagonostic_test_image=response.data.attachment,$scope.error_message=""):$scope.error_message=response.data.error.message})},$scope.save_btn=!1,$scope.addLabTest=function($valid,data){$valid&&!$scope.error_message?($scope.save_btn=!0,$scope.data.diagnostic_center_user_id=$rootScope.auth.id,$scope.data.branch_id=$state.params.branch_id,DiagnosticCenterTestsFactory.post($scope.data,function(response){0===parseInt(response.error.code)?($timeout(function(){$state.go("diagnostic_lab_tests",{branch_id:$state.params.branch_id},{reload:!0})},500),flash.set($filter("translate")("Lab Test added successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("Lab Test added failed."),"error",!1))},function(response){flash.set($filter("translate")(response.data.error.message),"error",!1)})):$timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("DiagnosticCenterTestsEditController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,LabTestsFactory,DiagnosticCenterTestsEdit,Upload,md5){$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("Edit Doctor")},$scope.index();var params={};params.filter='{"order":"name asc","limit":500,"skip":0}',LabTestsFactory.get(params).$promise.then(function(response){angular.isDefined(response)&&($scope.labtests=response.data)}),params.id=$state.params.id,params.filter='{"include":{"0":"lab_test", "1":"diagonostic_test_image"}}',$scope.DiagnosticCenterEdit=function(){DiagnosticCenterTestsEdit.get(params,function(response){$scope.data=response.data,$scope.data.lab_test_id=response.data.lab_test.id,angular.isDefined(response.data.diagonostic_test_image)&&null!==response.data.diagonostic_test_image&&($scope.labtest_image="images/big_thumb/DiagonosticTest/"+response.data.diagonostic_test_image.id+"."+md5.createHash("DiagonosticTest"+response.data.diagonostic_test_image.id+"pngbig_thumb")+".png")})},$scope.DiagnosticCenterEdit(),$scope.upload=function(file){Upload.upload({url:"/api/v1/attachments?class=LabTest",data:{file:file}}).then(function(response){0===response.data.error.code?($scope.data.diagonostic_test_image=response.data.attachment,$scope.error_message=""):$scope.error_message=response.data.error.message})},$scope.save_btn=!1,$scope.updateLabTest=function($valid,data){if($valid&&!$scope.error_message){$scope.save_btn=!0;var labtestData={};labtestData.id=data.id,labtestData.lab_test_id=data.lab_test_id,labtestData.price=data.price,labtestData.diagonostic_test_image=$scope.data.diagonostic_test_image,DiagnosticCenterTestsEdit.put(labtestData,function(response){$scope.save_btn=!1,0===parseInt(response.error.code)?($timeout(function(){$state.go("diagnostic_lab_tests",{branch_id:data.branch_id},{reload:!0})},500),flash.set($filter("translate")("Lab Test updated successfully."),"success",!0)):($scope.save_btn=!1,flash.set($filter("translate")("Lab Test updated failed."),"error",!1))},function(response){flash.set($filter("translate")(response.data.error.message),"error",!1)})}else $timeout(function(){$(".error").each(function(){return $(this).hasClass("ng-hide")?void 0:($scope.scrollvalidate($(this).offset().top-140),!1)})},100)},$scope.scrollvalidate=function(topvalue){$("html, body").animate({scrollTop:topvalue})}}),angular.module("absApp").controller("DiagnosticCenterTestsController",function($state,$rootScope,$scope,$filter,$location,$timeout,flash,DiagnosticCenterTestsFactory,SweetAlert,RemoveTest,DiagnosticCenterTestsEdit,BranchesEdit,md5){function getBranchById(id){var params={};params.id=id,params.filter='{"fields":{"id":true,"name":true}}',BranchesEdit.get(params).$promise.then(function(response){angular.isDefined(response)&&(response.Failed?flashMessage(response.Failed,"error"):$scope.branch=response.data)})}$scope.index=function(){$rootScope.pageTitle=$rootScope.settings.SITE_NAME+" | "+$filter("translate")("My Lab Tests"),$timeout(function(){$scope.text_box=!0},1e3)},$scope.index();$scope.mylabtests=function(){var params={};$scope.branch_id=$state.params.branch_id,params.filter='{"where":{"diagnostic_center_user_id":'+$rootScope.auth.id+', "branch_id":'+$scope.branch_id+'},"include":{"0":"lab_test", "1":"diagonostic_test_image"}}',$scope.loader=!0,void 0===$state.params.page?params.page=1:params.page=$state.params.page,DiagnosticCenterTestsFactory.get(params,function(response){angular.isDefined(response._metadata)&&($scope.currentPage=response._metadata.current_page,$scope.totalItems=response._metadata.total,$scope.itemsPerPage=response._metadata.per_page,$scope.noOfPages=response._metadata.last_page),angular.isDefined(response.data)&&($scope.labtests=response.data,$scope.dataLength=response.data.length>0?!0:!1),angular.forEach($scope.labtests,function(labtest){if(angular.isDefined(labtest.diagonostic_test_image)&&null!==labtest.diagonostic_test_image){var hash=md5.createHash(labtest.diagonostic_test_image["class"]+labtest.diagonostic_test_image.id+"pngbig_thumb");labtest.image="images/big_thumb/"+labtest.diagonostic_test_image["class"]+"/"+labtest.diagonostic_test_image.id+"."+hash+".png"}else labtest.image="images/diagnostic_image.jpg"})}),getBranchById($scope.branch_id)},$scope.mylabtests(),$scope.paginate=function(){$scope.currentPage=parseInt($scope.currentPage),$state.go("branch_doctors",{page:$scope.currentPage}),$scope.mydoctors()},$scope.removeTest=function(labtest_id){SweetAlert.swal({title:$filter("translate")("Are you sure you want to remove the lab test from branch list?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&RemoveTest["delete"]({id:labtest_id},function(response){0===response.error.code?($timeout(function(){flash.set($filter("translate")("Your lab test has been deleted successfully."),"success",!1)},500),$state.reload()):($timeout(function(){flash.set($filter("translate")("Your lab test couldn't deleted. Please try again."),"error",!1)},500),$state.reload())})})},$scope.changeStatus=function(lab_test_id,status){var labTestData={};labTestData.id=lab_test_id,labTestData.is_enable=status,SweetAlert.swal({title:$filter("translate")("Are you sure you want to change the status?"),text:"",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"OK",cancelButtonText:"Cancel!",closeOnConfirm:!0,animation:!1},function(isConfirm){isConfirm===!0&&DiagnosticCenterTestsEdit.put(labTestData,function(response){0===response.error.code?(flash.set($filter("translate")("Your lab test status has been changed successfully."),"success",!1),$state.reload()):(flash.set($filter("translate")("Your lab test status couldn't updated. Please try again."),"error",!1),$state.reload())})})}}),angular.module("absApp.Clinic.Clinic").directive("userEducations",function(){return{restrict:"E",templateUrl:"scripts/plugins/Clinic/Clinic/views/default/educations.html",controller:function($scope){$scope.index=function(){$scope.user_educations=[],$scope.usereducation=$scope.user_educations;$scope.user_educations=[{education:"",organization:"",location:"",certification_date:new Date}]},$scope.addUserEducation=function(){$scope.user_educations.push({education:"",organization:"",location:"",certification_date:new Date})}, $scope.deleteUserEducation=function(education_id,index){$scope.user_educations.splice(index,1)},$scope.index()}}}),angular.module("absApp").factory("BranchesFactory",["$resource",function($resource){return $resource("/api/v1/branches",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("BranchesEdit",["$resource",function($resource){return $resource("/api/v1/branches/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("DoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("DoctorsEdit",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveDoctor",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("MyDoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"}})}]).factory("SearchDoctors",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("UsersFactory",["$resource",function($resource){return $resource("/api/v1/branch_users",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("UsersEdit",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveUser",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("UserById",["$resource",function($resource){return $resource("/api/v1/users/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("PermissionsFactory",["$resource",function($resource){return $resource("/api/v1/permissions",{},{get:{method:"GET"}})}]).factory("LocationsFactory",["$resource",function($resource){return $resource("/api/v1/locations",{},{get:{method:"GET"}})}]).factory("LanguagesFactory",["$resource",function($resource){return $resource("/api/v1/languages",{},{get:{method:"GET"}})}]).factory("CountriesFactory",["$resource",function($resource){return $resource("/api/v1/countries",{},{get:{method:"GET"}})}]),angular.module("absApp").factory("LabTestsFactory",["$resource",function($resource){return $resource("/api/v1/lab_tests",{},{get:{method:"GET"}})}]).factory("LabTestsGetFactory",["$resource",function($resource){return $resource("/api/v1/lab_tests/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("DiagnosticCenterTestsFactory",["$resource",function($resource){return $resource("/api/v1/diagnostic_center_tests",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("LabTestReport",["$resource",function($resource){return $resource("/api/v1/diagnostic_center_tests_patient_diagnostic_tests/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("LabTestAppointmentView",["$resource",function($resource){return $resource("/api/v1/patient_diagnostic_tests/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("DiagnosticCenterTestsEdit",["$resource",function($resource){return $resource("/api/v1/diagnostic_center_tests/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveTest",["$resource",function($resource){return $resource("/api/v1/diagnostic_center_tests/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("BranchesEdit",["$resource",function($resource){return $resource("/api/v1/branches/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("DoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("DoctorsEdit",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveDoctor",["$resource",function($resource){return $resource("/api/v1/branch_doctors/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("MyDoctorsFactory",["$resource",function($resource){return $resource("/api/v1/branch_doctors",{},{get:{method:"GET"}})}]).factory("SearchDoctors",["$resource",function($resource){return $resource("/api/v1/users",{},{get:{method:"GET"}})}]).factory("UsersFactory",["$resource",function($resource){return $resource("/api/v1/branch_users",{},{get:{method:"GET"},post:{method:"POST"}})}]).factory("UsersEdit",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{get:{method:"GET"},put:{method:"PUT"}})}]).factory("RemoveUser",["$resource",function($resource){return $resource("/api/v1/branch_users/:id",{id:"@id"},{"delete":{method:"DELETE"}})}]).factory("UserById",["$resource",function($resource){return $resource("/api/v1/users/:id",{id:"@id"},{get:{method:"GET"}})}]).factory("DiagnosticLabTestsFactory",["$resource",function($resource){return $resource("/api/v1/patient_diagnostic_tests",{},{get:{method:"GET"}})}]).factory("PermissionsFactory",["$resource",function($resource){return $resource("/api/v1/permissions",{},{get:{method:"GET"}})}]).factory("LocationsFactory",["$resource",function($resource){return $resource("/api/v1/locations",{},{get:{method:"GET"}})}]).factory("SpecialtiesFactory",["$resource",function($resource){return $resource("/api/v1/specialties",{},{get:{method:"GET"}})}]).factory("InsurancesFactory",["$resource",function($resource){return $resource("/api/v1/insurances",{},{get:{method:"GET"}})}]).factory("LanguagesFactory",["$resource",function($resource){return $resource("/api/v1/languages",{},{get:{method:"GET"}})}]).factory("CountriesFactory",["$resource",function($resource){return $resource("/api/v1/countries",{},{get:{method:"GET"}})}]).factory("DiagnosticBookingAdd",["$resource",function($resource){return $resource("/api/v1/patient_diagnostic_tests",{},{post:{method:"POST"}})}]).factory("PatientBookingLogs",["$resource",function($resource){return $resource("/api/v1/patients_booking_log",{},{get:{method:"GET"}})}]),angular.module("absApp.Clinic.DiagnosticCenter").run(["$templateCache",function($templateCache){$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_add.html",'

    {{\'Add Branch\'|translate}}

    {{\'Branch Info\'| translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{ \'Enter Valid Fee\' | translate }}
    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Contact Info\'| translate}}
    {{\'Please select address from autocomplete\'| translate}} {{\'Please enter your address\'| translate }}
    {{\'Please choose address from autocomplete.\' | translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Consultation Settings\'| translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_edit.html",'

    {{\'Edit Branch\'|translate}}

    {{\'Branch Info\'| translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{ \'Enter Valid Fee\' | translate }}
    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Contact Info\'| translate}}
    {{\'Please select address from autocomplete\'| translate}} {{\'Please enter your address\'| translate }}
    {{\'Please choose address from autocomplete.\' | translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Consultation Settings\'| translate}}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_profile.html",'

    {{branch.name}}

    {{branch.address}},

    {{branch.postal_code}} {{branch.city.name}}, {{branch.country.name}}

    {{\'Lab Tests\' | translate}}

    • {{labtest.lab_test.name}}

      {{labtest.lab_test.name}}

      {{labtest.lab_test.description}}

      {{$root.settings.CURRENCY_SYMBOL}}{{labtest.price}} {{$root.settings.SITE_CURRENCY_CODE}}{{labtest.price}} {{\'Book Now\'|translate}}
    • {{\'No Record Found\'|translate}}

    '), $templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_users.html",'

    {{branch.name}}:{{\'My Branch Users\'|translate}} {{\'My Branches\'|translate}} {{\'Add User\'|translate}}

    {{\'Sub Account\'|translate}} {{\'Permission\'|translate}} {{\'Action\'|translate}}
    {{branchUser.user.user_profile.first_name |translate}} {{branchUser.user.user_profile.last_name |translate}} {{branchUser.permissions |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}}

    {{\'No Record Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_users_add.html",'

    {{\'Add User\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Required\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Phone Number Without Character\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/branch_users_edit.html",'

    {{\'Edit User\'|translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }} {{\'Please enter your email\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Required\'| translate }}
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/branches.html",'

    {{\'My Branches\'|translate}} {{\'Add Branch\'|translate}}

    {{\'Branch\'|translate}} {{\'Open\'|translate}} {{\'Close\'|translate}} {{\'Address\'|translate}} {{\'Phone\'|translate}} {{\'State\'|translate}} {{\'City\'|translate}} {{\'Consultation Fee\'|translate}} {{\'Status\'|translate}} {{\'Action\'|translate}}
    {{branch.name |translate}} {{branch.open_time |translate}} {{branch.close_time |translate}} {{branch.address |translate}} {{branch.phone_number |translate}} {{branch.state.name |translate}} {{branch.city.name |translate}} {{branch.consultation_fee}} {{\'Edit\' | translate}} {{\'Manage Lab Tests\' | translate}} {{\'Manage Users\' | translate}}

    {{\'No Records Found\'|translate}}

    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/choose_tests.html",'

    {{diagonostic.user.user_profile.display_name}}

    Labtest Price
    {{addedTests[0].lab_test_name}} {{addedTests[0].lab_test_name}}

    {{$root.settings.CURRENCY_SYMBOL}}{{addedTests[0].price}} {{$root.settings.SITE_CURRENCY_CODE}}{{addedTests[0].price}}

    {{\'Patient Name\' | translate }} {{patient.user_profile.first_name}} {{patient.user_profile.last_name}}
    {{\'Email\'| translate}} {{patient.email}}
    {{\'Phone\'| translate}} {{patient.mobile_code}}{{patient.mobile}}
    {{\'Branch\' | translate }} {{branch.name}}
    {{\'Required\'| translate}}
    {{\'Branch\' | translate }} {{branch.name}}
    {{\'Diagonistic Center\' | translate }} {{diagonostic.user.user_profile.display_name}}
    {{\'Name\' | translate }} {{familydata.name}}
    {{\'Relationship\' | translate }} {{familydata.relationship}}
    {{\'Email\'| translate}} {{familydata.email}}
    {{\'Phone\'| translate}} {{patient.mobile_code}}{{patient.mobile}}

    {{\'Add Patient Details\'|translate}}

    {{\'Please enter your last name\'| translate }} {{ \'Minimum length is 3\' | translate }} {{ \'Enter Valid name without number\' | translate }}
    {{\'Please enter your last name\'| translate }} {{ \'Minimum length is 3\' | translate }} {{ \'Enter Valid name without number\' | translate }}
    {{\'Please enter your mail id\'| translate }} {{\'Enter valid email\'| translate }}
    {{\'Enter Mobile Number\'| translate }} {{ \'Maximum length is 12\' | translate }} {{ \'Minimum length is 8\' | translate }} {{\'Enter Valid Mobile Number Without Character\'| translate }} {{mobileErr}}
    {{\'Other Lab Tests\' | translate}} {{\'Price\' | translate}}
    {{labtest.lab_test.name}}

    {{labtest.lab_test.name}}

    {{labtest.lab_test.description}}

    {{$root.settings.CURRENCY_SYMBOL}}{{labtest.price}} {{$root.settings.SITE_CURRENCY_CODE}}{{labtest.price}}

    [lab-text]

    {{diagonostic.user.user_profile.display_name}}

    {{\'Overall Tests\' | translate}}

    {{value.data.lab_test_name}}

    {{$root.settings.CURRENCY_SYMBOL}}{{value.data.price}}

    {{$root.settings.SITE_CURRENCY_CODE}}{{value.data.price}}

    {{\'Total\' | translate}}

    {{$root.settings.CURRENCY_SYMBOL}}{{totalcost}} {{$root.settings.SITE_CURRENCY_CODE}}{{totalcost}}

    {{\'Book Now\' | translate}}

    {{\'Required\'| translate }}
    {{\'Required\'| translate }}

    {{\'You are unable to make an appointment with another patients\'| translate}}.

    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_appointments.html",'
    • [default-user]
    • {{\'Total Count\' | translate}}

    • 585

    • [app-mail]
    • {{\'SMS Sent\' | translate}}

    • 1,283

    • [app-wallet]
    • {{\'As on\' | translate}}

      {{\'November\' | translate}}

    • $150

    • {{\'Pay Now\' | translate}}
    {{\'Appointment.No\' | translate}}
    {{\'Branch\' | translate}} {{\'Doctor Name\' | translate}} {{\'Patient Name\'| translate}} {{\'Appointment\' | translate}} {{\'Date & Time\' | translate}} {{\'Appointment Via\'| translate}} {{\'Paid Via Online?\' | translate}} {{\'Booked by others\' | translate}} {{\'Status\' | translate}}
    {{appointment.appointment_token}} {{appointment.branch.name}} {{\'Dr\' | translate}}. {{appointment.provider_user.user_profile.first_name}} {{appointment.provider_user.user_profile.last_name}} {{appointment.user.user_profile.first_name}} {{appointment.user.user_profile.last_name}} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_type.name}} {{\'Yes\' | translate}} {{\'No\' | translate}} {{appointment.book_by_user.user_profile.first_name}} {{appointment.book_by_user.user_profile.last_name}} -- {{appointment.appointment_status.name}} {{\'At Present\'| translate}} {{\'Reschedule/Cancel\'| translate}} {{\'Mark as Arrived\'| translate}} {{\'Mark as Closed\'| translate}}

    {{\'No Records Found\' |translate}}

    '), $templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_labtest_view.html",'

    {{\'Lab Test Detail\' | translate}}

    {{\'The appointment is scheduled at\' | translate}} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_time}}
    {{\'Appointment Type\' | translate}} {{appointment.appointment_type.name}}
    {{\'Where\' | translate}} {{appointment.diagnostic_center_user.user_profile.display_name}}, {{appointment.branch.name}}, {{appointment.branch.city.name}}
    {{\'Patient Name\' | translate}} {{appointment.guest_name}} {{appointment.patient.user_profile.first_name}} {{appointment.patient.user_profile.last_name}}
    {{\'Email\' | translate}} {{appointment.patient.email}}
    {{\'Phone\' | translate}} {{appointment.patient.mobile_code}}{{appointment.patient.mobile}}
    {{\'Gender\' | translate}} {{\'Male\' | translate }} {{\'Female\' | translate }}
    {{\'Appointment Status\' | translate}} {{appointment.appointment_status.name}}
    {{\'Lab Tests\'| translate}}
    {{\'Name\' | translate}} {{\'Price\' | translate}} {{\'Reason for visit\' | translate}}
    {{mylabtest.diagnostic_center_test.lab_test.name}} {{$root.settings.CURRENCY_SYMBOL}}{{mylabtest.diagnostic_center_test.price}} {{$root.settings.SITE_CURRENCY_CODE}}{{mylabtest.diagnostic_center_test.price}} {{mylabtest.diagnostic_center_test.lab_test.description}}
    {{\'Update Payment Status\'| translate}}
    {{\'Payment Status(Is Paid?)\' | translate}}
    {{\'Reports\'| translate}}
    [Image: Group]
    {{\'Required\'| translate }}

    {{\'View Reports\' | translate}}

    {{\'View Reports\' | translate}}

    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_labtests.html",'
    • [default-user]
    • {{\'Total Count\' | translate}}

    • {{bookingLog.total_booking_count}}

    • [app-mail]
    • {{\'SMS Sent\' | translate}}

    • {{bookingLog.sms_count}}

    • [app-wallet]
    • {{\'As on\' | translate}}

      {{ bookingLog.start_date | date : \'MMMM\'}}

    • {{$root.settings.CURRENCY_SYMBOL}}{{bookingLog.amount}} {{$root.settings.SITE_CURRENCY_CODE}}{{bookingLog.amount}}

    • {{\'Pay Now\' | translate}}

    {{\'Diagnostic Dashboard\'|translate}}

    {{\'Patient Name\' | translate}} {{\'Branches\' | translate}} {{\'Appointment\' | translate}} {{\'Date & Time\' | translate}} {{\'Appointment Via\'| translate}} {{\'Paid Via Online?\' | translate}} {{\'Booked by others\' | translate}} {{\'Status\' | translate}}
    {{labtest.patient.user_profile.first_name}} {{labtest.patient.user_profile.last_name}} {{labtest.branch.name}}, {{labtest.branch.city.name}} {{labtest.appointment_date | dateFormat}} {{labtest.appointment_type.name}} {{\'Yes\' | translate}} {{\'No\' | translate}} {{labtest.book_by_user.user_profile.first_name}} {{labtest.book_by_user.user_profile.last_name}} -- {{labtest.appointment_status.name}} {{\'Upload Report\'| translate}}

    {{\'No Records Found\' |translate}}

    {{\'No Records Found\' |translate}}

    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_payment.html",'

    {{\'Pay Appointment Fee\' | translate}}

    {{\'The appointment is scheduled at\' | translate}} {{appointment.appointment_date | dateFormat}} {{appointment.appointment_time}}
    {{\'Appointment Type\' | translate}} {{appointment.appointment_type.name}}
    {{\'Where\' | translate}} {{appointment.diagnostic_center_user.user_profile.display_name}}, {{appointment.branch.name}}, {{appointment.branch.city.name}}
    {{\'Patient Name\' | translate}} {{appointment.patient.user_profile.first_name}} {{appointment.patient.user_profile.last_name}}
    {{\'Email\' | translate}} {{appointment.patient.email}}
    {{\'Phone\' | translate}} {{appointment.patient.mobile_code}}{{appointment.patient.mobile}}
    {{\'Gender\' | translate}} {{\'Male\' | translate}}
    {{\'Reason for visit\' | translate}}

    {{labtest.diagnostic_center_test.lab_test.name}} - {{labtest.diagnostic_center_test.lab_test.description}}

    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/diagnostic_profile.html",'

    {{\'Diagnostic Center Info\'| translate}}

    {{\'Edit Profile\' | translate}}
    {{branchInfo.name}}
    {{branchInfo.address1}}
    {{branchInfo.address2}}
    {{user.username}}

    {{user.user_profile.display_name}}

    {{user.user_profile.full_address}}

    +{{user.mobile_code}} {{user.mobile}} (Personal)

    +{{user.user_profile.mobile_code}} {{user.user_profile.work_number}} (Work Number)

    +{{user.user_profile.mobile_code}} {{user.user_profile.home_number}} (Home Number)

    • {{branch.name}}

    {{\'No branches found\'|translate}}

    {{\'Lab Tests\'| translate}}

    {{\'No labtests found\'|translate}}

    {{labtest.lab_test.name}}

    {{labtest.lab_test.name}}

    {{labtest.lab_test.description}}

    {{$root.settings.CURRENCY_SYMBOL}}{{labtest.price}} {{$root.settings.SITE_CURRENCY_CODE}}{{labtest.price}} {{\'Book Now\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/educations.html",'
    # Education Organization Location Certification Date
    {{user_educations.indexOf(user_education) + 1}}
    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/lab_test_add.html",'

    {{\'Add Lab Test\'|translate}}

    {{\'Lab Test Info\'| translate}}
    {{\'Required\'| translate }}
    {{settings.CURRENCY_SYMBOL}} {{settings.SITE_CURRENCY_CODE}}
    {{\'Required\'|translate}} {{\'Enter the valid amount\'|translate}}
    {{\'Allowed extensions: jpg,jpeg,gif,png\'|translate}} {{error_message}}
    {{\'Required\'| translate }} [Image: Group]
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/lab_test_edit.html",'

    {{\'Edit Lab Test\'|translate}}

    {{\'Lab Test Info\'| translate}}
    {{\'Required\'| translate }}
    {{settings.CURRENCY_SYMBOL}} {{settings.SITE_CURRENCY_CODE}}
    {{\'Required\'|translate}} {{\'Enter the valid amount\'|translate}}
    {{\'Allowed extensions: jpg,jpeg,gif,png\'|translate}} {{error_message}} {{\'Required\'| translate }}

    [Image: {{labtest_image}}]

    [Image: Group]
    {{\'Cancel\'|translate}}
    '),$templateCache.put("scripts/plugins/Clinic/DiagnosticCenter/views/default/lab_tests.html",'

    {{branch.name}}: {{\'My Lab Tests\'|translate}} {{\'My Branches\'|translate}} {{\'Add Lab Test\'|translate}}

    {{\'Test\'|translate}} {{\'Price\'|translate}}({{$root.settings.CURRENCY_SYMBOL}}) {{\'Status\'|translate}} {{\'Action\'|translate}}
    [Image: {{labtest.lab_test.name}}]{{labtest.lab_test.name |translate}} {{labtest.price |translate}} {{\'Edit\' | translate}} {{\'Remove\' | translate}}

    {{\'No Record Found\'|translate}}

    ')}]);angular.module('absApp').requires.push('absApp.Clinic.DiagnosticCenter');