EVOLUTION-NINJA
Edit File: anaesthesia_logbook.php
<?php namespace App\Controllers\logbook; use App\Controllers\BaseController; use CodeIgniter\RESTful\ResourceController; use CodeIgniter\API\ResponseTrait; use App\Models\LogModel; class anaesthesia_logbook extends BaseController { use ResponseTrait; public function __construct() { helper(['form', 'url']); } public function index() { $dr_id = session()->get('dr_id'); if ($dr_id) { return view('logBook/an_main'); } else { return view('login'); } } public function add_new_case() { $dr_id = session()->get('dr_id'); if ($dr_id) { return view('logBook/add_new_case'); } else { return view('login'); } } public function add_logbook() { $dr_id = session()->get('dr_id'); if($dr_id){ // first tab $caseno = $this->request->getVar('case_num'); $dop = $this->request->getVar('date_of_operate'); $top = $this->request->getVar('time_of_operate'); $reference = $this->request->getVar('reference'); // second tab $age =$this->request->getVar('age'); $gender =$this->request->getVar('gender'); $asa =$this->request->getVar('asa'); $height =$this->request->getVar('height'); $height_feet =$this->request->getVar('height_feet'); $height_inch =$this->request->getVar('height_inch'); $weight =$this->request->getVar('weight'); $BMI =$this->request->getVar('BMI'); $hospital =$this->request->getVar('hospital'); // 3rd tab $speciality =$this->request->getVar('speciality'); $obstetrics_specialty =$this->request->getVar('obstetrics_specialty'); $other_1_sp =$this->request->getVar('other_1_sp'); $surgery_location =$this->request->getVar('surgery_location'); if($surgery_location==='headneck'){ $sr_location='Head Neck'; }elseif ($surgery_location==='Thorax') { $sr_location='Thorax'; } elseif ($surgery_location==='SpineSpinalCord') { $sr_location='Spine SpinalCord'; } elseif ($surgery_location==='UpperAbdomen') { $sr_location='Upper Abdomen'; } elseif ($surgery_location==='LowerAbdomen') { $sr_location='Lower Abdomen'; } elseif ($surgery_location==='Perineum') { $sr_location='Perineum'; } elseif ($surgery_location==='Pelvis_ExceptHip') { $sr_location='Pelvis ExceptHip'; } elseif ($surgery_location==='UpperLeg_Except_Knee') { $sr_location='UpperLeg Except Knee'; } elseif ($surgery_location==='Knee_and_Popliteal_Area') { $sr_location='Knee and Popliteal Area'; } elseif ($surgery_location==='Lower_Leg_Below_Knee') { $sr_location='Lower Leg Below Knee'; } elseif ($surgery_location==='Shoulder_and_Axilla') { $sr_location='Shoulder and Axilla'; } elseif ($surgery_location==='Upper_Arm_Elbow') { $sr_location='Upper Arm Elbow'; } elseif ($surgery_location==='Forearm Wrist Hand') { $sr_location='Forearm Wrist Hand'; } elseif ($surgery_location==='Others_Unlisted') { $sr_location='Others Unlisted'; }else { $sr_location=''; } $surgery_procedure =$this->request->getVar('surgery_procedure'); //4th tab $category = $this->request->getVar('category'); $c1=''; $c2=''; if ($category === 'emergency') { $c1='Emergency'; } elseif ($category === 'elective') { $c2="Elective"; } $Invasive =$this->request->getVar('Invasive'); $In_1=''; $In_2=''; if ($Invasive === 'on') { $In_1='Yes'; } else { $In_2="No"; } $done_by_1 =$this->request->getVar('done_by_1'); $done_by_2 =$this->request->getVar('done_by_2'); $supervision =$this->request->getVar('supervision'); $anaesthesia_mon =$this->request->getVar('anaesthesia_mon'); $a_mon=''; if ($anaesthesia_mon==='on') { $a_mon='Monitoring only'; } $anaesthesia_ga =$this->request->getVar('anaesthesia_ga'); $a_ga=''; if ($anaesthesia_ga==='on') { $a_ga='GA'; } $anaesthesia_cnb =$this->request->getVar('anaesthesia_cnb'); $a_cnb=""; if ($anaesthesia_cnb==='on') { $a_cnb="CNB"; } $anaesthesia_pnb =$this->request->getVar('anaesthesia_pnb'); $a_pnb=""; if ($anaesthesia_pnb==="on") { $a_pnb="PNB"; } $anaesthesia_sed =$this->request->getVar('anaesthesia_sed'); $a_sed=""; if ($anaesthesia_sed==="on") { $a_sed="Sedation"; } $anaesthesia_other =$this->request->getVar('anaesthesia_other'); $a_other=""; if ($anaesthesia_other) { $a_other="Other"; } $special_procedures_av =$this->request->getVar('special_procedures_av'); $sp_av=''; if ($special_procedures_av==='on') { $sp_av='Airway and Ventilation'; } $special_procedures_cvs =$this->request->getVar('special_procedures_cvs'); $sp_cvs=''; if ($special_procedures_cvs==='on') { $sp_cvs='CVS'; } $special_procedures_cns =$this->request->getVar('special_procedures_cns'); $sp_cns=''; if ($special_procedures_cns==='on') { $sp_cns='CNS'; } $special_procedures_other =$this->request->getVar('special_procedures_other'); $sp_other=''; if ($special_procedures_other==='on') { $sp_other='Other'; } $sp_other_1 =$this->request->getVar('sp_other'); //av $sp_airway_ventilation_it =$this->request->getVar('sp_airway_ventilation_it'); $av1=''; if ($sp_airway_ventilation_it==='on') { $av1='Intubation through LMA/igel'; } $sp_airway_ventilation_video =$this->request->getVar('sp_airway_ventilation_video'); $av2=''; if ($sp_airway_ventilation_video==='on') { $av2='Video Laryngoscopy'; } $sp_airway_ventilation_bn =$this->request->getVar('sp_airway_ventilation_bn'); $av3=''; if ($sp_airway_ventilation_bn==='on') { $av3='Blind Nasal Intubation'; } $sp_airway_ventilation_bb =$this->request->getVar('sp_airway_ventilation_bb'); $av4=''; if ($sp_airway_ventilation_bb==='on') { $av4='Bronchial blocker'; } $sp_airway_ventilation_bron =$this->request->getVar('sp_airway_ventilation_bron'); $av5=''; if ($sp_airway_ventilation_bron==='on') { $av5='Bronchoscopy'; } $sp_airway_ventilation_dl =$this->request->getVar('sp_airway_ventilation_dl'); $av6=''; if ($sp_airway_ventilation_dl==='on') { $av6='Double lumen Tube'; } // Initialize all variables to default or empty values $av7 = ''; $av8 = ''; $av9 = ''; $av10 = ''; $av11 = ''; $av12 = ''; $av13 = ''; $av14 = ''; $av15 = ''; $av_others = ''; $cv1 = ''; $cv2 = ''; $cv3 = ''; $cv4 = ''; $cv5 = ''; $cv6 = ''; $cv7 = ''; $cv8 = ''; $cn1 = ''; $cn2 = ''; $cn3 = ''; $oth1 = ''; $oth2 = ''; $oth3 = ''; $oth4 = ''; $oth5 = ''; $oth6 = ''; $oth7 = ''; $oth8 = ''; $sp_airway_ventilation_foi =$this->request->getVar('sp_airway_ventilation_foi'); if ($sp_airway_ventilation_foi==='on') { $av7='FOI Awake/Asleep'; } $sp_airway_ventilation_fon =$this->request->getVar('sp_airway_ventilation_fon'); if ($sp_airway_ventilation_fon==='on') { $av8='FONA'; } $sp_airway_ventilation_jet =$this->request->getVar('sp_airway_ventilation_jet'); if ($sp_airway_ventilation_jet==='on') { $av9='Jet ventilation'; } $sp_airway_ventilation_ri =$this->request->getVar('sp_airway_ventilation_ri'); if ($sp_airway_ventilation_ri==='on') { $av10='Retrograde intubation'; } $sp_airway_ventilation_sub =$this->request->getVar('sp_airway_ventilation_sub'); if ($sp_airway_ventilation_sub==='on') { $av11='Submental intubation'; } $sp_airway_ventilation_surg =$this->request->getVar('sp_airway_ventilation_surg'); if ($sp_airway_ventilation_surg==='on') { $av12='Surgical tracheostomy'; } $sp_airway_ventilation_to =$this->request->getVar('sp_airway_ventilation_to'); if ($sp_airway_ventilation_to==='on') { $av13='Thrive Optiflow'; } $sp_airway_ventilation_ao =$this->request->getVar('sp_airway_ventilation_ao'); if ($sp_airway_ventilation_ao==='on') { $av14='Apnoeic oxygenation'; } $sp_airway_ventilation_other =$this->request->getVar('sp_airway_ventilation_other'); if ($sp_airway_ventilation_other==='on') { $av15='Other'; } $av_others =$this->request->getVar('av_others'); //cvs $ssp_cvs_cpet =$this->request->getVar('ssp_cvs_cpet'); if ($ssp_cvs_cpet==='on') { $cv1='CPET (cardio-pulmonary exercise testing)'; } $ssp_cvs_central =$this->request->getVar('ssp_cvs_central'); if ($ssp_cvs_central==='on') { $cv2='CVC (Central Venous Catheter line)'; } $ssp_cvs_cardiac =$this->request->getVar('ssp_cvs_cardiac'); if ($ssp_cvs_cardiac==='on') { $cv3='Cardiac output monitoring-Non-invasive'; } $ssp_cvs_al =$this->request->getVar('ssp_cvs_al'); if ($ssp_cvs_al==='on') { $cv4='Arterial Line'; } $ssp_cvs_com =$this->request->getVar('ssp_cvs_com'); if ($ssp_cvs_com==='on') { $cv5='Cardiac output monitoring- invasive including PA catheter'; } $ssp_cvs_te =$this->request->getVar('ssp_cvs_te'); if ($ssp_cvs_te==='on') { $cv6='TOE:Transoesophageal Echocardiography'; } $ssp_cvs_dhca =$this->request->getVar('ssp_cvs_dhca'); if ($ssp_cvs_dhca==='on') { $cv7='DHCA: Deep Hypothermic Cardiac Arrest'; } $ssp_cvs_te =$this->request->getVar('ssp_cvs_te'); if ($ssp_cvs_te==='on') { $cv8='TTE: Transthoracic Echocardiography'; } //cns $sp_cns_boa =$this->request->getVar('sp_cns_boa'); if ($sp_cns_boa==='on') { $cn1='Depth of Anaesthesia Monitoring (BIS and Entropy etc)'; } $sp_cns_bsm =$this->request->getVar('sp_cns_bsm'); if ($sp_cns_bsm==='on') { $cn2='Brain-stem monitoring/SSEPs and MEPs'; } $sp_cns_nirs =$this->request->getVar('sp_cns_nirs'); if ($sp_cns_nirs==='on') { $cn3='NIRS (Near Infra-red spectrometry) Cerebral Oximetry'; } //others $sp_others_ebp =$this->request->getVar('sp_others_ebp'); if ($sp_others_ebp==='on') { $oth1='Epidural Blood Patch'; } $sp_others_cdi =$this->request->getVar('sp_others_cdi'); if ($sp_others_cdi==='on') { $oth2='Chest Drain Insertion'; } $sp_others_lp =$this->request->getVar('sp_others_lp'); if ($sp_others_lp==='on') { $oth3='Lumbar Puncture'; } $sp_others_fau =$this->request->getVar('sp_others_fau'); if ($sp_others_fau==='on') { $oth4='FAST /Abdominal ultrasound'; } $sp_others_mt =$this->request->getVar('sp_others_mt'); if ($sp_others_mt==='on') { $oth5='Massive transfusion'; } $sp_others_io =$this->request->getVar('sp_others_io'); if ($sp_others_io==='on') { $oth6='Intra-osseus'; } $sp_others_ld =$this->request->getVar('sp_others_ld'); if ($sp_others_ld==='on') { $oth7='Lumbar drain'; } $sp_others_gu =$this->request->getVar('sp_others_gu'); if ($sp_others_gu==='on') { $oth8='Gastric Ultrasound'; } //5th tab $ga_technique =$this->request->getVar('ga_technique'); $ga1 = ''; $ga2 = ''; $ga3 = ''; $ga4 = ''; $ga_airway_management_eet =$this->request->getVar('ga_airway_management_eet'); if ($ga_airway_management_eet==='on') { $ga1='GA ETT'; } $ga_airway_management_lma =$this->request->getVar('ga_airway_management_lma'); if ($ga_airway_management_lma==='on') { $ga2='GA LMA'; } $ga_airway_management_mask =$this->request->getVar('ga_airway_management_mask'); if ($ga_airway_management_mask==='on') { $ga3='GA MASK'; } $ga_airway_management_other =$this->request->getVar('ga_airway_management_other'); if ($ga_airway_management_other==='on') { $ga4='GA other'; } $cnb1 = ''; $cnb2 = ''; $cnb3 = ''; $cnb4 = ''; $cnb_technique_sp =$this->request->getVar('cnb_technique_sp'); if ($cnb_technique_sp==='on') { $cnb1='Spinal'; } $cnb_technique_ep =$this->request->getVar('cnb_technique_ep'); if ($cnb_technique_ep==='on') { $cnb2='Epidural'; } $cnb_technique_cse =$this->request->getVar('cnb_technique_cse'); if ($cnb_technique_cse==='on') { $cnb3='CSE'; } $cnb_technique_csa =$this->request->getVar('cnb_technique_csa'); if ($cnb_technique_csa==='on') { $cnb4='CSA'; } $cnb_catheter =$this->request->getVar('cnb_catheter'); $pnb_1 = ''; $pnb_2 = ''; if ($cnb_catheter ==='on') { $pnb_1='Yes'; } else { $pnb_2="No"; } $cnb_outcome =$this->request->getVar('cnb_outcome'); $pnb_block_site =$this->request->getVar('pnb_block_site'); $pnb_block_location_capp =$this->request->getVar('pnb_block_location_capp'); $pnb_block_location_hn =$this->request->getVar('pnb_block_location_hn'); $pnb_block_location_ll =$this->request->getVar('pnb_block_location_ll'); $pnb_block_location_ul =$this->request->getVar('pnb_block_location_ul'); //uday $pnbl_capppnbl_ct =$this->request->getVar('pnbl_capppnbl_ct'); $pnbl_capppnbl_iib =$this->request->getVar('pnbl_capppnbl_iib'); $pnbl_capppnbl_esb =$this->request->getVar('pnbl_capppnbl_esb'); $pnbl_capppnbl_inb =$this->request->getVar('pnbl_capppnbl_inb'); $pnbl_capppnbl_esb_l =$this->request->getVar('pnbl_capppnbl_esb_l'); $pnbl_capppnbl_pl =$this->request->getVar('pnbl_capppnbl_pl'); $pnbl_capppnbl_pt =$this->request->getVar('pnbl_capppnbl_pt'); $pnbl_capppnbl_p1 =$this->request->getVar('pnbl_capppnbl_p1'); $pnbl_capppnbl_p2 =$this->request->getVar('pnbl_capppnbl_p2'); $pnbl_capppnbl_pb =$this->request->getVar('pnbl_capppnbl_pb'); $pnbl_capppnbl_qlb1 =$this->request->getVar('pnbl_capppnbl_qlb1'); $pnbl_capppnbl_qlb2 =$this->request->getVar('pnbl_capppnbl_qlb2'); $pnbl_capppnbl_qlb3 =$this->request->getVar('pnbl_capppnbl_qlb3'); $pnbl_capppnbl_pab =$this->request->getVar('pnbl_capppnbl_pab'); $pnbl_capppnbl_rs =$this->request->getVar('pnbl_capppnbl_rs'); $pnbl_capppnbl_spb =$this->request->getVar('pnbl_capppnbl_spb'); $pnbl_capppnbl_st =$this->request->getVar('pnbl_capppnbl_st'); $pnbl_capppnbl_tfb =$this->request->getVar('pnbl_capppnbl_tfb'); $other_1 =$this->request->getVar('other_1'); $pnbl_capppnbl_other =$this->request->getVar('pnbl_capppnbl_other'); $pnbl_headneck_cpb =$this->request->getVar('pnbl_headneck_cpb'); $pnbl_headneck_cpi =$this->request->getVar('pnbl_headneck_cpi'); $pnbl_headneck_cps =$this->request->getVar('pnbl_headneck_cps'); $pnbl_headneck_ebp =$this->request->getVar('pnbl_headneck_ebp'); $pnbl_headneck_ebr =$this->request->getVar('pnbl_headneck_ebr'); $pnbl_headneck_ebs =$this->request->getVar('pnbl_headneck_ebs'); $pnbl_headneck_mrnb =$this->request->getVar('pnbl_headneck_mrnb'); $pnbl_headneck_mnb =$this->request->getVar('pnbl_headneck_mnb'); $pnbl_headneck_onb =$this->request->getVar('pnbl_headneck_onb'); $pnbl_headneck_sb =$this->request->getVar('pnbl_headneck_sb'); $pnbl_headneck_sgb =$this->request->getVar('pnbl_headneck_sgb'); $pnbl_headneck_tgb =$this->request->getVar('pnbl_headneck_tgb'); $other2 =$this->request->getVar('other2'); $pnbl_headneck_other =$this->request->getVar('pnbl_headneck_other'); $pnbl_lowerlimb_acb =$this->request->getVar('pnbl_lowerlimb_acb'); $pnbl_lowerlimb_a =$this->request->getVar('pnbl_lowerlimb_a'); $pnbl_lowerlimb_bb =$this->request->getVar('pnbl_lowerlimb_bb'); $pnbl_lowerlimb_fi =$this->request->getVar('pnbl_lowerlimb_fi'); $pnbl_lowerlimb_cp =$this->request->getVar('pnbl_lowerlimb_cp'); $pnbl_lowerlimb_fn =$this->request->getVar('pnbl_lowerlimb_fn'); $pnbl_lowerlimb_ip =$this->request->getVar('pnbl_lowerlimb_ip'); $pnbl_lowerlimb_lpb =$this->request->getVar('pnbl_lowerlimb_lpb'); $pnbl_lowerlimb_ob =$this->request->getVar('pnbl_lowerlimb_ob'); $pnbl_lowerlimb_lcn =$this->request->getVar('pnbl_lowerlimb_lcn'); $pnbl_lowerlimb_spb =$this->request->getVar('pnbl_lowerlimb_spb'); $pnbl_lowerlimb_snb =$this->request->getVar('pnbl_lowerlimb_snb'); $pnbl_lowerlimb_snp =$this->request->getVar('pnbl_lowerlimb_snp'); $pnbl_lowerlimb_snu =$this->request->getVar('pnbl_lowerlimb_snu'); // $pnbl_lowerlimb_tmt =$this->request->getVar('pnbl_lowerlimb_tmt'); $pnbl_lowerlimb_stn =$this->request->getVar('pnbl_lowerlimb_stn'); $pnbl_lowerlimb_other =$this->request->getVar('pnbl_lowerlimb_other'); $pnbl_lowerlimb_other1 =$this->request->getVar('pnbl_lowerlimb_other1'); $pnbl_upperlimb_ax =$this->request->getVar('pnbl_upperlimb_ax'); $pnbl_upperlimb_bb =$this->request->getVar('pnbl_upperlimb_bb'); $pnbl_upperlimb_dr =$this->request->getVar('pnbl_upperlimb_dr'); $pnbl_upperlimb_block =$this->request->getVar('pnbl_upperlimb_block'); $pnbl_upperlimb_dn =$this->request->getVar('pnbl_upperlimb_dn'); $pnbl_upperlimb_inf =$this->request->getVar('pnbl_upperlimb_inf'); $pnbl_upperlimb_int =$this->request->getVar('pnbl_upperlimb_int'); $pnbl_upperlimb_sup =$this->request->getVar('pnbl_upperlimb_sup'); $pnbl_upperlimb_wb =$this->request->getVar('pnbl_upperlimb_wb'); $pmb_technique_l =$this->request->getVar('pmb_technique_l'); $pmb_technique_pns =$this->request->getVar('pmb_technique_pns'); $pmb_technique_ultra =$this->request->getVar('pmb_technique_ultra'); $pmb_technique_dual =$this->request->getVar('pmb_technique_dual'); $pnb_catheter =$this->request->getVar('pnb_catheter'); $pnb_catheter_1=''; $pnb_catheter_2=''; if ($pnb_catheter ==='on') { $pnb_catheter_1='Yes'; } else { $pnb_catheter_2="No"; } $success_com =$this->request->getVar('optradio2'); $success_com1 =$this->request->getVar('comp1'); $success_par =$this->request->getVar('part'); $success_par1 =$this->request->getVar('part_1'); $success_fail =$this->request->getVar('fail'); $pain_review_type =$this->request->getVar('pain_review_type'); $case_tags =$this->request->getVar('case_tags'); $notes= $this->request->getVar('notes'); $upperlimb_others1= $this->request->getVar('upperlimb_other1'); $upperlimb_others2= $this->request->getVar('upperlimb_other2'); //new addition $Jugular= $this->request->getVar('Jugular'); $Subclavian= $this->request->getVar('Subclavian'); $Femoral= $this->request->getVar('Femoral'); $other_cvc= $this->request->getVar('other'); //----------co-morbid----------------// $Cardiovascular = $this->request->getVar('Cardiovascular'); $Endocrine_and_Metabolic = $this->request->getVar('Endocrine_and_Metabolic'); $Respiratory = $this->request->getVar('Respiratory'); $Renal_and_Hepatic = $this->request->getVar('Renal_and_Hepatic'); $Neurological = $this->request->getVar('Neurological'); $Hematologic = $this->request->getVar('Hematologic'); $Mental_Heath = $this->request->getVar('Mental_Heath'); $Allergies = $this->request->getVar('Allergies'); $Other_Considerations = $this->request->getVar('Other_Considerations'); //----co-morbid checks-------------// $Cardiovascular_check= $this->request->getVar('Cardiovascular_check[]'); if(!empty($Cardiovascular_check)){ $Cardiovascular_check_data = implode(",", $Cardiovascular_check); }else{ $Cardiovascular_check_data='' ; $Cardiovascular ='No'; }; $Cardiovascular_other= $this->request->getVar('Cardiovascular_other'); $Endocrine_check= $this->request->getVar('Endocrine_check[]'); if(!empty($Endocrine_check)){ $Endocrine_check_data = implode(",", $Endocrine_check); }else{ $Endocrine_check_data=''; $Endocrine_and_Metabolic='No'; }; $Endocrine_other= $this->request->getVar('Endocrine_other'); $Respiratory_check= $this->request->getVar('Respiratory_check[]'); if(!empty($Respiratory_check)){ $Respiratory_check_data = implode(",", $Respiratory_check); }else{ $Respiratory_check_data=''; $Respiratory ='No'; }; $Respiratory_other= $this->request->getVar('Respiratory_other'); $Renal_check= $this->request->getVar('Renal_check[]'); if(!empty($Renal_check)){ $Renal_check_data = implode(",", $Renal_check); }else{ $Renal_check_data=''; $Renal_and_Hepatic ='No'; }; $Renal_other= $this->request->getVar('Renal_other'); $Neurological_check= $this->request->getVar('Neurological_check[]'); if(!empty($Neurological_check)){ $Neurological_check_data = implode(",", $Neurological_check); }else{ $Neurological_check_data = ''; $Neurological ='No'; }; $Neurological_other= $this->request->getVar('Neurological_other'); $Hematologic_check= $this->request->getVar('Hematologic_check[]'); if(!empty($Hematologic_check)){ $Hematologic_check_data = implode(",", $Hematologic_check); }else{ $Hematologic_check_data = ''; $Hematologic ='No'; }; $Hematologic_other= $this->request->getVar('Hematologic_other'); $Mental_check= $this->request->getVar('Mental_check[]'); if(!empty($Mental_check)){ $Mental_check_data = implode(",", $Mental_check); }else{ $Mental_check_data = ''; $Mental_Heath ='No'; }; $Mental_other= $this->request->getVar('Mental_other'); $Allergies_check= $this->request->getVar('Allergies_check[]'); if(!empty($Allergies_check)){ $Allergies_check_data = implode(",", $Allergies_check); }else{ $Allergies_check_data = ''; $Allergies ='No'; }; $Allergies_other= $this->request->getVar('Allergies_other'); $Considerations_check= $this->request->getVar('Considerations_check[]'); if(!empty($Considerations_check)){ $Considerations_check_data = implode(",", $Considerations_check); }else{ $Considerations_check_data = ''; $Other_Considerations ='No'; }; $Considerations_other= $this->request->getVar('Considerations_other'); //supervising $supervising=$this->request->getVar('supervising'); //------------------Anaesthesia Management Tool Kit for the surgery-----------// $toolkit_All = $this->request->getVar('toolkit_All'); $toolkit_gender_age = $this->request->getVar('toolkit_gender_age'); $toolkit_bmi = $this->request->getVar('toolkit_bmi'); $toolkit_Comorbidies = $this->request->getVar('toolkit_Comorbidies'); $toolkit_asa_status = $this->request->getVar('toolkit_asa_status'); $toolkit_others = $this->request->getVar('toolkit_others'); $toolkit_others_input = $this->request->getVar('toolkit_others_input'); $logData = [ 'case_num' => $caseno, 'date_of_operate' => $dop, 'time_of_operate' => $top, 'reference' => $reference, 'age'=>$age, 'gender'=>$gender, 'asa'=>$asa, 'height'=>''.$height.','.$height_feet.','.$height_inch, 'weight'=>$weight, 'BMI'=>$BMI, 'hospital'=>$hospital, 'speciality'=>$speciality, 'obstetrics_specialty'=>$obstetrics_specialty, 'other_speciality'=>$other_1_sp, 'surgery_location'=>$sr_location, 'surgery_procedure'=>$surgery_procedure, 'category'=>$c1."".$c2, 'Invasive'=>$In_1."".$In_2, 'done_by'=>$done_by_1.",".$done_by_2, 'supervision'=>$supervision, 'anaesthesia'=>$a_mon.",".$a_cnb.",".$a_ga.",".$a_pnb.",".$a_sed.",".$a_other, 'special_procedures'=>$sp_av.",".$sp_cvs.",".$sp_cns.",". $sp_other, 'others_specialprocedure'=>$sp_other_1, 'sp_airway_ventilation'=>$av1.",".$av2.",".$av3.",".$av4.",".$av5.",".$av6.",".$av7.",".$av8.",".$av9.",".$av10.",".$av11.",".$av12.",".$av13.",".$av14.",".$av15, 'others_av'=>$av_others, 'sp_cvs'=>$cv1.",".$cv2.",".$cv3.",".$cv4.",".$cv5.",".$cv6.",".$cv7.",".$cv8, 'sp_cns'=>$cn1.",".$cn2.",".$cn3, 'sp_others'=>$oth1.",".$oth2.",".$oth3.",".$oth4.",".$oth5.",".$oth6.",".$oth7.",".$oth8, 'ga_technique'=>$ga_technique, 'ga_airway_management'=>$ga1.",".$ga2.",".$ga3.",".$ga4, 'cnb_technique'=>$cnb1.",".$cnb2.",".$cnb3.",".$cnb4, 'cnb_catheter'=>$pnb_1."".$pnb_2, 'cnb_outcome'=>$cnb_outcome.",".$success_com1."".$success_par1, 'pnb_block_site'=>$pnb_block_site, 'pnb_block_location'=> $pnb_block_location_capp.",".$pnb_block_location_hn.",".$pnb_block_location_ll.",".$pnb_block_location_ul, 'pnbl_capppnbl'=>$pnbl_capppnbl_ct.",".$pnbl_capppnbl_iib.",".$pnbl_capppnbl_esb.",".$pnbl_capppnbl_inb.",".$pnbl_capppnbl_esb_l.",".$pnbl_capppnbl_pl.",".$pnbl_capppnbl_pt.",".$pnbl_capppnbl_p1.",".$pnbl_capppnbl_p2.",".$pnbl_capppnbl_pb.",".$pnbl_capppnbl_qlb1.",".$pnbl_capppnbl_qlb2.",".$pnbl_capppnbl_qlb3.",".$pnbl_capppnbl_pab.",".$pnbl_capppnbl_rs.",".$pnbl_capppnbl_spb.",".$pnbl_capppnbl_st.",".$pnbl_capppnbl_tfb.",".$other_1, 'others_chest'=>$pnbl_capppnbl_other, 'pnbl_headneck'=>$pnbl_headneck_cpb.",".$pnbl_headneck_cpi.",".$pnbl_headneck_cps.",".$pnbl_headneck_ebp.",".$pnbl_headneck_ebr.",".$pnbl_headneck_ebs.",".$pnbl_headneck_mrnb.",".$pnbl_headneck_mnb.",".$pnbl_headneck_onb.",".$pnbl_headneck_sb.",".$pnbl_headneck_sgb.",".$pnbl_headneck_tgb.",".$other2, 'others_headneck'=>$pnbl_headneck_other, 'pnbl_lowerlimb'=>$pnbl_lowerlimb_acb.",".$pnbl_lowerlimb_a.",".$pnbl_lowerlimb_bb.",".$pnbl_lowerlimb_fi.",".$pnbl_lowerlimb_cp.",".$pnbl_lowerlimb_fn.",".$pnbl_lowerlimb_ip.",".$pnbl_lowerlimb_lpb.",".$pnbl_lowerlimb_ob.",".$pnbl_lowerlimb_lcn.",".$pnbl_lowerlimb_spb.",".$pnbl_lowerlimb_snb.",".$pnbl_lowerlimb_snp.",".$pnbl_lowerlimb_snu.",".$pnbl_lowerlimb_stn.",".$pnbl_lowerlimb_other, 'others_lowerlimb'=>$pnbl_lowerlimb_other1, 'pnbl_upperlimb'=>$pnbl_upperlimb_ax.",".$pnbl_upperlimb_bb.",".$pnbl_upperlimb_dr.",".$pnbl_upperlimb_block.",".$pnbl_upperlimb_dn.",".$pnbl_upperlimb_inf.",".$pnbl_upperlimb_int.",".$pnbl_upperlimb_sup.",".$pnbl_upperlimb_wb.",".$upperlimb_others1, 'other_upperlimb'=>$upperlimb_others2, 'pmb_technique'=>$pmb_technique_l.",".$pmb_technique_pns.",".$pmb_technique_ultra.",".$pmb_technique_dual, 'pnb_catheter'=>$pnb_catheter_1."".$pnb_catheter_2, 'success'=>$success_com."".$success_par."".$success_fail, 'pain_review_type'=>$pain_review_type, 'case_tags'=>$case_tags, 'notes'=>$notes, 'dr_id'=>$dr_id, 'cvc'=>$Jugular.",".$Subclavian.",".$Femoral.",".$other_cvc, 'Cardiovascular'=> $Cardiovascular, 'Endocrine_and_Metabolic' => $Endocrine_and_Metabolic, 'Respiratory'=> $Respiratory, 'Renal_and_Hepatic'=> $Renal_and_Hepatic, 'Neurological'=> $Neurological, 'Hematologic'=> $Hematologic, 'Mental_Heath'=> $Mental_Heath, 'Allergies'=> $Allergies, 'Other_Considerations'=>$Other_Considerations, 'toolkit_All'=>$toolkit_All, 'toolkit_gender_age'=>$toolkit_gender_age, 'toolkit_bmi'=>$toolkit_bmi, 'toolkit_Comorbidies'=>$toolkit_Comorbidies, 'toolkit_asa_status'=>$toolkit_asa_status, 'toolkit_others'=>$toolkit_others, 'toolkit_others_input'=>$toolkit_others_input, 'Cardiovascular_check'=>$Cardiovascular_check_data, 'Cardiovascular_other'=>$Cardiovascular_other, 'Endocrine_check'=>$Endocrine_check_data, 'Endocrine_other'=>$Endocrine_other, 'Respiratory_check'=>$Respiratory_check_data, 'Respiratory_other'=>$Respiratory_other, 'Renal_check'=>$Renal_check_data, 'Renal_other'=>$Renal_other, 'Neurological_check'=>$Neurological_check_data, 'Neurological_other'=>$Neurological_other, 'Hematologic_check'=>$Hematologic_check_data, 'Hematologic_other'=>$Hematologic_other, 'Mental_check'=>$Mental_check_data, 'Mental_other'=>$Mental_other, 'Allergies_check'=>$Allergies_check_data, 'Allergies_other'=>$Allergies_other, 'Considerations_check'=>$Considerations_check_data, 'Considerations_other'=>$Considerations_other, 'supervising'=>$supervising ]; $logModel = new LogModel(); // $insert=$logModel->save($logData); // print_r($insert); // die(); $caseno = $this->request->getVar('case_num'); if ($logModel->where('case_num', $caseno)->first() === null) { if ($logModel->save($logData)) { $insertedID = $logModel->insertID(); return json_encode([ 'result' => 1, 'message' => 'Logbook data Successfully.....', 'msg' => $insertedID, ]); } else { return json_encode([ 'result' => 0, 'message' => 'Something went wrong.....', ]); } } else { return json_encode([ 'result' => 0, 'message' => 'Case number already exists.', ]); } } else { return json_encode([ 'result' => 2, 'message' => 'dr id not found', ]); } } public function logbook_edit() { $dr_id = session()->get('dr_id'); if ($dr_id) { return view('logBook/edit_existcase'); } else { return view('login'); } } // public function logbook_data() { // $db = \Config\Database::connect(); // $tableName = 'anaesthesia_logbook'; // $dr_id = session()->get('dr_id'); // $startDate = $this->request->getVar('start_date'); // $endDate = $this->request->getVar('end_date'); // $query = $db->table($tableName)->where('dr_id', $dr_id); // $data = $query->get()->getResultArray(); // if ($data) { // return $this->response->setJSON($data); // } else { // return $this->response->setJSON("No data found"); // } // } public function logbook_data() { $dr_id = session()->get('dr_id'); $db = \Config\Database::connect(); // Get parameters from jqGrid $page = $this->request->getVar('page'); $limit = $this->request->getVar('rows'); $sidx = $this->request->getVar('sidx'); $sord = $this->request->getVar('sord'); $start_date = $this->request->getVar('start_date'); $end_date = $this->request->getVar('end_date'); $searchField = $this->request->getVar('searchField'); $searchString = $this->request->getVar('searchString'); $caseId = $this->request->getVar('case_id'); $page = $page ? $page : 1; $limit = $limit ? $limit : 10; $sidx = $sidx ? $sidx : 'date_of_operate'; $sord = $sord ? $sord : 'asc'; // Convert the date format from "dd-mm-yyyy" to "yyyy-mm-dd" if ($start_date) { $start_date = date('Y-m-d', strtotime($start_date)); } if ($end_date) { $end_date = date('Y-m-d', strtotime($end_date)); } $offset = ($page - 1) * $limit; $builder = $db->table('anaesthesia_logbook'); if ($start_date && $end_date) { $builder->where("date_of_operate BETWEEN '$start_date' AND '$end_date'"); } if ($searchField && $searchString) { $builder->like($searchField, $searchString); } if ($caseId) { $builder->where('case_num', $caseId); } if ($dr_id) { $builder->where("dr_id",$dr_id); } $builder->orderBy($sidx, $sord); $builder->limit($limit, $offset); $query = $builder->get(); $data = $query->getResultArray(); $totalRecords = $db->table('anaesthesia_logbook')->countAllResults(); $totalPages = ceil($totalRecords / $limit); $response = [ 'page' => $page, 'total' => $totalPages, 'records' => $totalRecords, 'rows' => $data, ]; return $this->response->setJSON($response); } public function logbook_delete() { $dr_id = session()->get('dr_id'); if($dr_id){ $id = $this->request->getVar('id'); $db = \Config\Database::connect(); $tableName = 'anaesthesia_logbook'; $query = $db->table($tableName)->where('id', $id); $query->delete(); $affectedRows = $db->affectedRows(); if ($affectedRows > 0) { return json_encode(['result'=>1,'success' => true ,'message'=>'Data deleted successfully']); } else { return json_encode(['result'=>0,'success' => false, 'message' => 'Product not found or already deleted']); } } } public function edit_form() { $id = $this->request->getVar('id'); $db = \Config\Database::connect(); $tableName = 'anaesthesia_logbook'; $query = $db->table($tableName)->where('id', $id)->get(); if ($query->getNumRows() > 0) { $data['record'] = $query->getRowArray(); return view('logBook/logbook_update', $data); } else { error_log('Record not found for ID ' . $id); } } public function update_logbook(){ $caseno = $this->request->getVar('case_num'); $dop = $this->request->getVar('date_of_operate'); $top = $this->request->getVar('time_of_operate'); $reference = $this->request->getVar('reference'); // second tab $age =$this->request->getVar('age'); $gender =$this->request->getVar('gender'); $asa =$this->request->getVar('asa'); $height =$this->request->getVar('height'); $height_feet =$this->request->getVar('height_feet'); $height_inch =$this->request->getVar('height_inch'); $weight =$this->request->getVar('weight'); $BMI =$this->request->getVar('BMI'); $hospital =$this->request->getVar('hospital'); // 3rd tab $speciality =$this->request->getVar('speciality'); $obstetrics_specialty =$this->request->getVar('obstetrics_specialty'); $other_1_sp =$this->request->getVar('other_1_sp'); $surgery_location =$this->request->getVar('surgery_location'); if($surgery_location==='headneck'){ $sr_location='Head Neck'; }elseif ($surgery_location==='Thorax') { $sr_location='Thorax'; } elseif ($surgery_location==='SpineSpinalCord') { $sr_location='Spine SpinalCord'; } elseif ($surgery_location==='UpperAbdomen') { $sr_location='Upper Abdomen'; } elseif ($surgery_location==='LowerAbdomen') { $sr_location='Lower Abdomen'; } elseif ($surgery_location==='Perineum') { $sr_location='Perineum'; } elseif ($surgery_location==='Pelvis_ExceptHip') { $sr_location='Pelvis ExceptHip'; } elseif ($surgery_location==='UpperLeg_Except_Knee') { $sr_location='UpperLeg Except Knee'; } elseif ($surgery_location==='Knee_and_Popliteal_Area') { $sr_location='Knee and Popliteal Area'; } elseif ($surgery_location==='Lower_Leg_Below_Knee') { $sr_location='Lower Leg Below Knee'; } elseif ($surgery_location==='Shoulder_and_Axilla') { $sr_location='Shoulder and Axilla'; } elseif ($surgery_location==='Upper_Arm_Elbow') { $sr_location='Upper Arm Elbow'; } elseif ($surgery_location==='Forearm Wrist Hand') { $sr_location='Forearm Wrist Hand'; } elseif ($surgery_location==='Others_Unlisted') { $sr_location='Others Unlisted'; }else { $sr_location=''; } $surgery_procedure =$this->request->getVar('surgery_procedure'); //4th tab $category = $this->request->getVar('category'); $c1=''; $c2=''; if ($category === 'emergency') { $c1='Emergency'; } elseif ($category === 'elective') { $c2="Elective"; } $Invasive =$this->request->getVar('Invasive'); $In_1=''; $In_2=''; if ($Invasive === 'on') { $In_1='Yes'; } else { $In_2="No"; } $done_by_1 =$this->request->getVar('done_by_1'); $done_by_2 =$this->request->getVar('done_by_2'); $supervision =$this->request->getVar('supervision'); $anaesthesia_mon =$this->request->getVar('anaesthesia_mon'); $a_mon=''; if ($anaesthesia_mon==='on') { $a_mon='Monitoring only'; } $anaesthesia_ga =$this->request->getVar('anaesthesia_ga'); $a_ga=''; if ($anaesthesia_ga==='on') { $a_ga='GA'; } $anaesthesia_cnb =$this->request->getVar('anaesthesia_cnb'); $a_cnb=""; if ($anaesthesia_cnb==='on') { $a_cnb="CNB"; } $anaesthesia_pnb =$this->request->getVar('anaesthesia_pnb'); $a_pnb=""; if ($anaesthesia_pnb==="on") { $a_pnb="PNB"; } $anaesthesia_sed =$this->request->getVar('anaesthesia_sed'); $a_sed=""; if ($anaesthesia_sed==="on") { $a_sed="Sedation"; } $anaesthesia_other =$this->request->getVar('anaesthesia_other'); $a_other=""; if ($anaesthesia_other) { $a_other="Other"; } $special_procedures_av =$this->request->getVar('special_procedures_av'); $sp_av=''; if ($special_procedures_av==='on') { $sp_av='Airway and Ventilation'; } $special_procedures_cvs =$this->request->getVar('special_procedures_cvs'); $sp_cvs=''; if ($special_procedures_cvs==='on') { $sp_cvs='CVS'; } $special_procedures_cns =$this->request->getVar('special_procedures_cns'); $sp_cns=''; if ($special_procedures_cns==='on') { $sp_cns='CNS'; } $special_procedures_other =$this->request->getVar('special_procedures_other'); $sp_other=''; if ($special_procedures_other==='on') { $sp_other='Other'; } $sp_other_1 =$this->request->getVar('sp_other'); //av $sp_airway_ventilation_it =$this->request->getVar('sp_airway_ventilation_it'); $av1=''; if ($sp_airway_ventilation_it==='on') { $av1='Intubation through LMA/igel'; } $sp_airway_ventilation_video =$this->request->getVar('sp_airway_ventilation_video'); $av2=''; if ($sp_airway_ventilation_video==='on') { $av2='Video Laryngoscopy'; } $sp_airway_ventilation_bn =$this->request->getVar('sp_airway_ventilation_bn'); $av3=''; if ($sp_airway_ventilation_bn==='on') { $av3='Blind Nasal Intubation'; } $sp_airway_ventilation_bb =$this->request->getVar('sp_airway_ventilation_bb'); $av4=''; if ($sp_airway_ventilation_bb==='on') { $av4='Bronchial blocker'; } $sp_airway_ventilation_bron =$this->request->getVar('sp_airway_ventilation_bron'); $av5=''; if ($sp_airway_ventilation_bron==='on') { $av5='Bronchoscopy'; } $sp_airway_ventilation_dl =$this->request->getVar('sp_airway_ventilation_dl'); $av6=''; if ($sp_airway_ventilation_dl==='on') { $av6='Double lumen Tube'; } // Initialize all variables to default or empty values $av7 = ''; $av8 = ''; $av9 = ''; $av10 = ''; $av11 = ''; $av12 = ''; $av13 = ''; $av14 = ''; $av15 = ''; $av_others = ''; $cv1 = ''; $cv2 = ''; $cv3 = ''; $cv4 = ''; $cv5 = ''; $cv6 = ''; $cv7 = ''; $cv8 = ''; $cn1 = ''; $cn2 = ''; $cn3 = ''; $oth1 = ''; $oth2 = ''; $oth3 = ''; $oth4 = ''; $oth5 = ''; $oth6 = ''; $oth7 = ''; $oth8 = ''; $sp_airway_ventilation_foi =$this->request->getVar('sp_airway_ventilation_foi'); if ($sp_airway_ventilation_foi==='on') { $av7='FOI Awake/Asleep'; } $sp_airway_ventilation_fon =$this->request->getVar('sp_airway_ventilation_fon'); if ($sp_airway_ventilation_fon==='on') { $av8='FONA'; } $sp_airway_ventilation_jet =$this->request->getVar('sp_airway_ventilation_jet'); if ($sp_airway_ventilation_jet==='on') { $av9='Jet ventilation'; } $sp_airway_ventilation_ri =$this->request->getVar('sp_airway_ventilation_ri'); if ($sp_airway_ventilation_ri==='on') { $av10='Retrograde intubation'; } $sp_airway_ventilation_sub =$this->request->getVar('sp_airway_ventilation_sub'); if ($sp_airway_ventilation_sub==='on') { $av11='Submental intubation'; } $sp_airway_ventilation_surg =$this->request->getVar('sp_airway_ventilation_surg'); if ($sp_airway_ventilation_surg==='on') { $av12='Surgical tracheostomy'; } $sp_airway_ventilation_to =$this->request->getVar('sp_airway_ventilation_to'); if ($sp_airway_ventilation_to==='on') { $av13='Thrive Optiflow'; } $sp_airway_ventilation_ao =$this->request->getVar('sp_airway_ventilation_ao'); if ($sp_airway_ventilation_ao==='on') { $av14='Apnoeic oxygenation'; } $sp_airway_ventilation_other =$this->request->getVar('sp_airway_ventilation_other'); if ($sp_airway_ventilation_other==='on') { $av15='Other'; } $av_others =$this->request->getVar('av_others'); //cvs $ssp_cvs_cpet =$this->request->getVar('ssp_cvs_cpet'); if ($ssp_cvs_cpet==='on') { $cv1='CPET (cardio-pulmonary exercise testing)'; } $ssp_cvs_central =$this->request->getVar('ssp_cvs_central'); if ($ssp_cvs_central==='on') { $cv2='CVC (Central Venous Catheter line)'; } $ssp_cvs_cardiac =$this->request->getVar('ssp_cvs_cardiac'); if ($ssp_cvs_cardiac==='on') { $cv3='Cardiac output monitoring-Non-invasive'; } $ssp_cvs_al =$this->request->getVar('ssp_cvs_al'); if ($ssp_cvs_al==='on') { $cv4='Arterial Line'; } $ssp_cvs_com =$this->request->getVar('ssp_cvs_com'); if ($ssp_cvs_com==='on') { $cv5='Cardiac output monitoring- invasive including PA catheter'; } $ssp_cvs_te =$this->request->getVar('ssp_cvs_te'); if ($ssp_cvs_te==='on') { $cv6='TOE:Transoesophageal Echocardiography'; } $ssp_cvs_dhca =$this->request->getVar('ssp_cvs_dhca'); if ($ssp_cvs_dhca==='on') { $cv7='DHCA: Deep Hypothermic Cardiac Arrest'; } $ssp_cvs_te =$this->request->getVar('ssp_cvs_te'); if ($ssp_cvs_te==='on') { $cv8='TTE: Transthoracic Echocardiography'; } //cns $sp_cns_boa =$this->request->getVar('sp_cns_boa'); if ($sp_cns_boa==='on') { $cn1='Depth of Anaesthesia Monitoring (BIS and Entropy etc)'; } $sp_cns_bsm =$this->request->getVar('sp_cns_bsm'); if ($sp_cns_bsm==='on') { $cn2='Brain-stem monitoring/SSEPs and MEPs'; } $sp_cns_nirs =$this->request->getVar('sp_cns_nirs'); if ($sp_cns_nirs==='on') { $cn3='NIRS (Near Infra-red spectrometry) Cerebral Oximetry'; } //others $sp_others_ebp =$this->request->getVar('sp_others_ebp'); if ($sp_others_ebp==='on') { $oth1='Epidural Blood Patch'; } $sp_others_cdi =$this->request->getVar('sp_others_cdi'); if ($sp_others_cdi==='on') { $oth2='Chest Drain Insertion'; } $sp_others_lp =$this->request->getVar('sp_others_lp'); if ($sp_others_lp==='on') { $oth3='Lumbar Puncture'; } $sp_others_fau =$this->request->getVar('sp_others_fau'); if ($sp_others_fau==='on') { $oth4='FAST /Abdominal ultrasound'; } $sp_others_mt =$this->request->getVar('sp_others_mt'); if ($sp_others_mt==='on') { $oth5='Massive transfusion'; } $sp_others_io =$this->request->getVar('sp_others_io'); if ($sp_others_io==='on') { $oth6='Intra-osseus'; } $sp_others_ld =$this->request->getVar('sp_others_ld'); if ($sp_others_ld==='on') { $oth7='Lumbar drain'; } $sp_others_gu =$this->request->getVar('sp_others_gu'); if ($sp_others_gu==='on') { $oth8='Gastric Ultrasound'; } //5th tab $ga_technique =$this->request->getVar('ga_technique'); $ga1 = ''; $ga2 = ''; $ga3 = ''; $ga4 = ''; $ga_airway_management_eet =$this->request->getVar('ga_airway_management_eet'); if ($ga_airway_management_eet==='on') { $ga1='GA ETT'; } $ga_airway_management_lma =$this->request->getVar('ga_airway_management_lma'); if ($ga_airway_management_lma==='on') { $ga2='GA LMA'; } $ga_airway_management_mask =$this->request->getVar('ga_airway_management_mask'); if ($ga_airway_management_mask==='on') { $ga3='GA MASK'; } $ga_airway_management_other =$this->request->getVar('ga_airway_management_other'); if ($ga_airway_management_other==='on') { $ga4='GA other'; } $cnb1 = ''; $cnb2 = ''; $cnb3 = ''; $cnb4 = ''; $cnb_technique_sp =$this->request->getVar('cnb_technique_sp'); if ($cnb_technique_sp==='on') { $cnb1='Spinal'; } $cnb_technique_ep =$this->request->getVar('cnb_technique_ep'); if ($cnb_technique_ep==='on') { $cnb2='Epidural'; } $cnb_technique_cse =$this->request->getVar('cnb_technique_cse'); if ($cnb_technique_cse==='on') { $cnb3='CSE'; } $cnb_technique_csa =$this->request->getVar('cnb_technique_csa'); if ($cnb_technique_csa==='on') { $cnb4='CSA'; } $cnb_catheter =$this->request->getVar('cnb_catheter'); $pnb_1 = ''; $pnb_2 = ''; if ($cnb_catheter ==='on') { $pnb_1='Yes'; } else { $pnb_2="No"; } $cnb_outcome =$this->request->getVar('cnb_outcome'); $pnb_block_site =$this->request->getVar('pnb_block_site'); $pnb_block_location_capp =$this->request->getVar('pnb_block_location_capp'); $pnb_block_location_hn =$this->request->getVar('pnb_block_location_hn'); $pnb_block_location_ll =$this->request->getVar('pnb_block_location_ll'); $pnb_block_location_ul =$this->request->getVar('pnb_block_location_ul'); //uday $pnbl_capppnbl_ct =$this->request->getVar('pnbl_capppnbl_ct'); $pnbl_capppnbl_iib =$this->request->getVar('pnbl_capppnbl_iib'); $pnbl_capppnbl_esb =$this->request->getVar('pnbl_capppnbl_esb'); $pnbl_capppnbl_inb =$this->request->getVar('pnbl_capppnbl_inb'); $pnbl_capppnbl_esb_l =$this->request->getVar('pnbl_capppnbl_esb_l'); $pnbl_capppnbl_pl =$this->request->getVar('pnbl_capppnbl_pl'); $pnbl_capppnbl_pt =$this->request->getVar('pnbl_capppnbl_pt'); $pnbl_capppnbl_p1 =$this->request->getVar('pnbl_capppnbl_p1'); $pnbl_capppnbl_p2 =$this->request->getVar('pnbl_capppnbl_p2'); $pnbl_capppnbl_pb =$this->request->getVar('pnbl_capppnbl_pb'); $pnbl_capppnbl_qlb1 =$this->request->getVar('pnbl_capppnbl_qlb1'); $pnbl_capppnbl_qlb2 =$this->request->getVar('pnbl_capppnbl_qlb2'); $pnbl_capppnbl_qlb3 =$this->request->getVar('pnbl_capppnbl_qlb3'); $pnbl_capppnbl_pab =$this->request->getVar('pnbl_capppnbl_pab'); $pnbl_capppnbl_rs =$this->request->getVar('pnbl_capppnbl_rs'); $pnbl_capppnbl_spb =$this->request->getVar('pnbl_capppnbl_spb'); $pnbl_capppnbl_st =$this->request->getVar('pnbl_capppnbl_st'); $pnbl_capppnbl_tfb =$this->request->getVar('pnbl_capppnbl_tfb'); $other_1 =$this->request->getVar('other_1'); $pnbl_capppnbl_other =$this->request->getVar('pnbl_capppnbl_other'); $pnbl_headneck_cpb =$this->request->getVar('pnbl_headneck_cpb'); $pnbl_headneck_cpi =$this->request->getVar('pnbl_headneck_cpi'); $pnbl_headneck_cps =$this->request->getVar('pnbl_headneck_cps'); $pnbl_headneck_ebp =$this->request->getVar('pnbl_headneck_ebp'); $pnbl_headneck_ebr =$this->request->getVar('pnbl_headneck_ebr'); $pnbl_headneck_ebs =$this->request->getVar('pnbl_headneck_ebs'); $pnbl_headneck_mrnb =$this->request->getVar('pnbl_headneck_mrnb'); $pnbl_headneck_mnb =$this->request->getVar('pnbl_headneck_mnb'); $pnbl_headneck_onb =$this->request->getVar('pnbl_headneck_onb'); $pnbl_headneck_sb =$this->request->getVar('pnbl_headneck_sb'); $pnbl_headneck_sgb =$this->request->getVar('pnbl_headneck_sgb'); $pnbl_headneck_tgb =$this->request->getVar('pnbl_headneck_tgb'); $other2 =$this->request->getVar('other2'); $pnbl_headneck_other =$this->request->getVar('pnbl_headneck_other'); $pnbl_lowerlimb_acb =$this->request->getVar('pnbl_lowerlimb_acb'); $pnbl_lowerlimb_a =$this->request->getVar('pnbl_lowerlimb_a'); $pnbl_lowerlimb_bb =$this->request->getVar('pnbl_lowerlimb_bb'); $pnbl_lowerlimb_fi =$this->request->getVar('pnbl_lowerlimb_fi'); $pnbl_lowerlimb_cp =$this->request->getVar('pnbl_lowerlimb_cp'); $pnbl_lowerlimb_fn =$this->request->getVar('pnbl_lowerlimb_fn'); $pnbl_lowerlimb_ip =$this->request->getVar('pnbl_lowerlimb_ip'); $pnbl_lowerlimb_lpb =$this->request->getVar('pnbl_lowerlimb_lpb'); $pnbl_lowerlimb_ob =$this->request->getVar('pnbl_lowerlimb_ob'); $pnbl_lowerlimb_lcn =$this->request->getVar('pnbl_lowerlimb_lcn'); $pnbl_lowerlimb_spb =$this->request->getVar('pnbl_lowerlimb_spb'); $pnbl_lowerlimb_snb =$this->request->getVar('pnbl_lowerlimb_snb'); $pnbl_lowerlimb_snp =$this->request->getVar('pnbl_lowerlimb_snp'); $pnbl_lowerlimb_snu =$this->request->getVar('pnbl_lowerlimb_snu'); // $pnbl_lowerlimb_tmt =$this->request->getVar('pnbl_lowerlimb_tmt'); $pnbl_lowerlimb_stn =$this->request->getVar('pnbl_lowerlimb_stn'); $pnbl_lowerlimb_other =$this->request->getVar('pnbl_lowerlimb_other'); $pnbl_lowerlimb_other1 =$this->request->getVar('pnbl_lowerlimb_other1'); $pnbl_upperlimb_ax =$this->request->getVar('pnbl_upperlimb_ax'); $pnbl_upperlimb_bb =$this->request->getVar('pnbl_upperlimb_bb'); $pnbl_upperlimb_dr =$this->request->getVar('pnbl_upperlimb_dr'); $pnbl_upperlimb_block =$this->request->getVar('pnbl_upperlimb_block'); $pnbl_upperlimb_dn =$this->request->getVar('pnbl_upperlimb_dn'); $pnbl_upperlimb_inf =$this->request->getVar('pnbl_upperlimb_inf'); $pnbl_upperlimb_int =$this->request->getVar('pnbl_upperlimb_int'); $pnbl_upperlimb_sup =$this->request->getVar('pnbl_upperlimb_sup'); $pnbl_upperlimb_wb =$this->request->getVar('pnbl_upperlimb_wb'); $pmb_technique_l =$this->request->getVar('pmb_technique_l'); $pmb_technique_pns =$this->request->getVar('pmb_technique_pns'); $pmb_technique_ultra =$this->request->getVar('pmb_technique_ultra'); $pmb_technique_dual =$this->request->getVar('pmb_technique_dual'); $pnb_catheter =$this->request->getVar('pnb_catheter'); $pnb_catheter_1=''; $pnb_catheter_2=''; if ($pnb_catheter ==='on') { $pnb_catheter_1='Yes'; } else { $pnb_catheter_2="No"; } $success_com =$this->request->getVar('optradio2'); $success_com1 =$this->request->getVar('comp1'); $success_par =$this->request->getVar('part'); $success_par1 =$this->request->getVar('part_1'); $success_fail =$this->request->getVar('fail'); $pain_review_type =$this->request->getVar('pain_review_type'); $case_tags =$this->request->getVar('case_tags'); $notes= $this->request->getVar('notes'); $upperlimb_others1= $this->request->getVar('upperlimb_other1'); $upperlimb_others2= $this->request->getVar('upperlimb_other2'); $dr_id = session()->get('dr_id'); //new addition $Jugular= $this->request->getVar('Jugular'); $Subclavian= $this->request->getVar('Subclavian'); $Femoral= $this->request->getVar('Femoral'); $other_cvc= $this->request->getVar('other'); //----------co-morbid----------------// $Cardiovascular = $this->request->getVar('Cardiovascular'); $Endocrine_and_Metabolic = $this->request->getVar('Endocrine_and_Metabolic'); $Respiratory = $this->request->getVar('Respiratory'); $Renal_and_Hepatic = $this->request->getVar('Renal_and_Hepatic'); $Neurological = $this->request->getVar('Neurological'); $Hematologic = $this->request->getVar('Hematologic'); $Mental_Heath = $this->request->getVar('Mental_Heath'); $Allergies = $this->request->getVar('Allergies'); $Other_Considerations = $this->request->getVar('Other_Considerations'); //----co-morbid checks-------------// $Cardiovascular_check= $this->request->getVar('Cardiovascular_check[]'); if(!empty($Cardiovascular_check)){ $Cardiovascular_check_data = implode(",", $Cardiovascular_check); }else{ $Cardiovascular_check_data='' ; $Cardiovascular ='No'; }; $Cardiovascular_other= $this->request->getVar('Cardiovascular_other'); $Endocrine_check= $this->request->getVar('Endocrine_check[]'); if(!empty($Endocrine_check)){ $Endocrine_check_data = implode(",", $Endocrine_check); }else{ $Endocrine_check_data=''; $Endocrine_and_Metabolic='No'; }; $Endocrine_other= $this->request->getVar('Endocrine_other'); $Respiratory_check= $this->request->getVar('Respiratory_check[]'); if(!empty($Respiratory_check)){ $Respiratory_check_data = implode(",", $Respiratory_check); }else{ $Respiratory_check_data=''; $Respiratory ='No'; }; $Respiratory_other= $this->request->getVar('Respiratory_other'); $Renal_check= $this->request->getVar('Renal_check[]'); if(!empty($Renal_check)){ $Renal_check_data = implode(",", $Renal_check); }else{ $Renal_check_data=''; $Renal_and_Hepatic ='No'; }; $Renal_other= $this->request->getVar('Renal_other'); $Neurological_check= $this->request->getVar('Neurological_check[]'); if(!empty($Neurological_check)){ $Neurological_check_data = implode(",", $Neurological_check); }else{ $Neurological_check_data = ''; $Neurological ='No'; }; $Neurological_other= $this->request->getVar('Neurological_other'); $Hematologic_check= $this->request->getVar('Hematologic_check[]'); if(!empty($Hematologic_check)){ $Hematologic_check_data = implode(",", $Hematologic_check); }else{ $Hematologic_check_data = ''; $Hematologic ='No'; }; $Hematologic_other= $this->request->getVar('Hematologic_other'); $Mental_check= $this->request->getVar('Mental_check[]'); if(!empty($Mental_check)){ $Mental_check_data = implode(",", $Mental_check); }else{ $Mental_check_data = ''; $Mental_Heath ='No'; }; $Mental_other= $this->request->getVar('Mental_other'); $Allergies_check= $this->request->getVar('Allergies_check[]'); if(!empty($Allergies_check)){ $Allergies_check_data = implode(",", $Allergies_check); }else{ $Allergies_check_data = ''; $Allergies ='No'; }; $Allergies_other= $this->request->getVar('Allergies_other'); $Considerations_check= $this->request->getVar('Considerations_check[]'); if(!empty($Considerations_check)){ $Considerations_check_data = implode(",", $Considerations_check); }else{ $Considerations_check_data = ''; $Other_Considerations ='No'; }; $Considerations_other= $this->request->getVar('Considerations_other'); $supervising=$this->request->getVar('supervising'); //------------------Anaesthesia Management Tool Kit for the surgery-----------// $toolkit_All = $this->request->getVar('toolkit_All'); $toolkit_gender_age = $this->request->getVar('toolkit_gender_age'); $toolkit_bmi = $this->request->getVar('toolkit_bmi'); $toolkit_Comorbidies = $this->request->getVar('toolkit_Comorbidies'); $toolkit_asa_status = $this->request->getVar('toolkit_asa_status'); $toolkit_others = $this->request->getVar('toolkit_others'); $toolkit_others_input = $this->request->getVar('toolkit_others_input'); $logData = [ 'case_num' => $caseno, 'date_of_operate' => $dop, 'time_of_operate' => $top, 'reference' => $reference, 'age'=>$age, 'gender'=>$gender, 'asa'=>$asa, 'height'=>''.$height.','.$height_feet.','.$height_inch, 'weight'=>$weight, 'BMI'=>$BMI, 'hospital'=>$hospital, 'speciality'=>$speciality, 'obstetrics_specialty'=>$obstetrics_specialty, 'other_speciality'=>$other_1_sp, 'surgery_location'=>$sr_location, 'surgery_procedure'=>$surgery_procedure, 'category'=>$c1."".$c2, 'Invasive'=>$In_1."".$In_2, 'done_by'=>$done_by_1.",".$done_by_2, 'supervision'=>$supervision, 'anaesthesia'=>$a_mon.",".$a_cnb.",".$a_ga.",".$a_pnb.",".$a_sed.",".$a_other, 'special_procedures'=>$sp_av.",".$sp_cvs.",".$sp_cns.",". $sp_other, 'others_specialprocedure'=>$sp_other_1, 'sp_airway_ventilation'=>$av1.",".$av2.",".$av3.",".$av4.",".$av5.",".$av6.",".$av7.",".$av8.",".$av9.",".$av10.",".$av11.",".$av12.",".$av13.",".$av14.",".$av15, 'others_av'=>$av_others, 'sp_cvs'=>$cv1.",".$cv2.",".$cv3.",".$cv4.",".$cv5.",".$cv6.",".$cv7.",".$cv8, 'sp_cns'=>$cn1.",".$cn2.",".$cn3, 'sp_others'=>$oth1.",".$oth2.",".$oth3.",".$oth4.",".$oth5.",".$oth6.",".$oth7.",".$oth8, 'ga_technique'=>$ga_technique, 'ga_airway_management'=>$ga1.",".$ga2.",".$ga3.",".$ga4, 'cnb_technique'=>$cnb1.",".$cnb2.",".$cnb3.",".$cnb4, 'cnb_catheter'=>$pnb_1."".$pnb_2, 'cnb_outcome'=>$cnb_outcome.",".$success_com1."".$success_par1, 'pnb_block_site'=>$pnb_block_site, 'pnb_block_location'=> $pnb_block_location_capp.",".$pnb_block_location_hn.",".$pnb_block_location_ll.",".$pnb_block_location_ul, 'pnbl_capppnbl'=>$pnbl_capppnbl_ct.",".$pnbl_capppnbl_iib.",".$pnbl_capppnbl_esb.",".$pnbl_capppnbl_inb.",".$pnbl_capppnbl_esb_l.",".$pnbl_capppnbl_pl.",".$pnbl_capppnbl_pt.",".$pnbl_capppnbl_p1.",".$pnbl_capppnbl_p2.",".$pnbl_capppnbl_pb.",".$pnbl_capppnbl_qlb1.",".$pnbl_capppnbl_qlb2.",".$pnbl_capppnbl_qlb3.",".$pnbl_capppnbl_pab.",".$pnbl_capppnbl_rs.",".$pnbl_capppnbl_spb.",".$pnbl_capppnbl_st.",".$pnbl_capppnbl_tfb.",".$other_1, 'others_chest'=>$pnbl_capppnbl_other, 'pnbl_headneck'=>$pnbl_headneck_cpb.",".$pnbl_headneck_cpi.",".$pnbl_headneck_cps.",".$pnbl_headneck_ebp.",".$pnbl_headneck_ebr.",".$pnbl_headneck_ebs.",".$pnbl_headneck_mrnb.",".$pnbl_headneck_mnb.",".$pnbl_headneck_onb.",".$pnbl_headneck_sb.",".$pnbl_headneck_sgb.",".$pnbl_headneck_tgb.",".$other2, 'others_headneck'=>$pnbl_headneck_other, 'pnbl_lowerlimb'=>$pnbl_lowerlimb_acb.",".$pnbl_lowerlimb_a.",".$pnbl_lowerlimb_bb.",".$pnbl_lowerlimb_fi.",".$pnbl_lowerlimb_cp.",".$pnbl_lowerlimb_fn.",".$pnbl_lowerlimb_ip.",".$pnbl_lowerlimb_lpb.",".$pnbl_lowerlimb_ob.",".$pnbl_lowerlimb_lcn.",".$pnbl_lowerlimb_spb.",".$pnbl_lowerlimb_snb.",".$pnbl_lowerlimb_snp.",".$pnbl_lowerlimb_snu.",".$pnbl_lowerlimb_stn.",".$pnbl_lowerlimb_other, 'others_lowerlimb'=>$pnbl_lowerlimb_other1, 'pnbl_upperlimb'=>$pnbl_upperlimb_ax.",".$pnbl_upperlimb_bb.",".$pnbl_upperlimb_dr.",".$pnbl_upperlimb_block.",".$pnbl_upperlimb_dn.",".$pnbl_upperlimb_inf.",".$pnbl_upperlimb_int.",".$pnbl_upperlimb_sup.",".$pnbl_upperlimb_wb.",".$upperlimb_others1, 'other_upperlimb'=>$upperlimb_others2, 'pmb_technique'=>$pmb_technique_l.",".$pmb_technique_pns.",".$pmb_technique_ultra.",".$pmb_technique_dual, 'pnb_catheter'=>$pnb_catheter_1."".$pnb_catheter_2, 'success'=>$success_com."".$success_par."".$success_fail, 'pain_review_type'=>$pain_review_type, 'case_tags'=>$case_tags, 'notes'=>$notes, 'dr_id'=>$dr_id, 'cvc'=>$Jugular.",".$Subclavian.",".$Femoral.",".$other_cvc, 'Cardiovascular'=> $Cardiovascular, 'Endocrine_and_Metabolic' => $Endocrine_and_Metabolic, 'Respiratory'=> $Respiratory, 'Renal_and_Hepatic'=> $Renal_and_Hepatic, 'Neurological'=> $Neurological, 'Hematologic'=> $Hematologic, 'Mental_Heath'=> $Mental_Heath, 'Allergies'=> $Allergies, 'Other_Considerations'=>$Other_Considerations, 'toolkit_All'=>$toolkit_All, 'toolkit_gender_age'=>$toolkit_gender_age, 'toolkit_bmi'=>$toolkit_bmi, 'toolkit_asa_status'=>$toolkit_asa_status, 'toolkit_others'=>$toolkit_others, 'toolkit_others_input'=>$toolkit_others_input, 'Cardiovascular_check'=>$Cardiovascular_check_data, 'Cardiovascular_other'=>$Cardiovascular_other, 'Endocrine_check'=>$Endocrine_check_data, 'Endocrine_other'=>$Endocrine_other, 'Respiratory_check'=>$Respiratory_check_data, 'Respiratory_other'=>$Respiratory_other, 'Renal_check'=>$Renal_check_data, 'Renal_other'=>$Renal_other, 'Neurological_check'=>$Neurological_check_data, 'Neurological_other'=>$Neurological_other, 'Hematologic_check'=>$Hematologic_check_data, 'Hematologic_other'=>$Hematologic_other, 'Mental_check'=>$Mental_check_data, 'Mental_other'=>$Mental_other, 'Allergies_check'=>$Allergies_check_data, 'Allergies_other'=>$Allergies_other, 'Considerations_check'=>$Considerations_check_data, 'Considerations_other'=>$Considerations_other, 'supervising'=>$supervising ]; $model = new LogModel(); $model->select('id'); // Select the ID column $model->where('case_num', $caseno); $record = $model->get()->getRow(); if ($record) { $updatedId = $record->id; $model->set($logData); $model->where('case_num', $caseno); $update = $model->update(); if ($update) { return json_encode(array( 'result' => 1, 'message' => 'Logbook updated successfully....', 'id' => $updatedId )); } else { return json_encode(array( 'result' => 0, 'message' => 'Something went wrong.....' )); } } else { return json_encode(array( 'result' => 0, 'message' => 'Record not found' )); } } public function show_addlogbook() { $dr_id = session()->get('dr_id'); if($dr_id){ $id = $this->request->getVar('id'); // Get the "id" parameter from the URL $db = \Config\Database::connect(); $tableName = 'anaesthesia_logbook'; $query = $db->table($tableName)->where('id', $id)->get(); if ($query->getNumRows() > 0) { $data['record'] = $query->getRowArray(); return view('logBook/show_addlogbook', $data); } else { echo "<h1>Something Went Wroung"; } }else{ return view('login'); } } public function view_report(){ $dr_id = session()->get('dr_id'); if($dr_id){ $fdate = $this->request->getVar('fromDate'); $tdate = $this->request->getVar('toDate'); $fage = $this->request->getVar('fromAge'); $tage = $this->request->getVar('toAge'); $speciality_where = $this->request->getVar('speciality'); $case_tags = $this->request->getVar('case_tags'); $an = $this->request->getVar('anaesthesia_rec'); $report = new LogModel(); $report->where('dr_id', $dr_id); if ($fdate && $tdate) { $report->where("date_of_operate BETWEEN '$fdate' AND '$tdate'"); $formattedFromDate = date("d-m-Y", strtotime($fdate)); $formattedToDate = date("d-m-Y", strtotime($tdate)); session()->set('fromDate', $formattedFromDate); session()->set('toDate', $formattedToDate); } else { session()->remove('fromDate'); session()->remove('toDate'); } if ($fage && $tage) { $report->where("age BETWEEN '$fage' AND '$tage'"); session()->set('fromAge', $fage); session()->set('toAge', $tage); }else { session()->remove('fromAge'); session()->remove('toAge'); } //speciality if($speciality_where==='All'){ session()->set('speciality', $speciality_where); } elseif($speciality_where){ $report->where('speciality', $speciality_where); session()->set('speciality', $speciality_where); } else { session()->remove('speciality'); } //case tags if($case_tags==='All'){ session()->set('case_tags', $case_tags); } elseif($case_tags){ $report->where('case_tags', $case_tags); session()->set('case_tags', $case_tags); } else { session()->remove('case_tags'); } //anaesthesia if($an==='All'){ session()->set('anaesthesia', $an); } elseif($an) { $report->like('anaesthesia', $an); session()->set('anaesthesia', $an); }else{ session()->remove('anaesthesia'); } $record = $report->get()->getResult(); // print_r($record); // $lastQuery=$report->getLastQuery(); // echo $lastQuery; // exit(); $count=0; if($record){ foreach($record as $row){ if($row){ $count++; } } } //timeofoperate $Morning=0;$Afernoon=0;$Evening=0;$Night=0;$top=[]; if($record){ foreach ($record as $row) { if (strpos($row->time_of_operate, "Morning (8:00-13:00)") !== false) { $Morning++; } if (strpos($row->time_of_operate, "Afternoon (13:00-18:00)") !== false) { $Afernoon++; } if (strpos($row->time_of_operate, "Evening (18:00-22:00)") !== false) { $Evening++; } if (strpos($row->time_of_operate, "Night (22:00- 08:00)") !== false) { $Night++; } } } $top[]=array( 'row1'=>'Morning (8:00-13:00)', 'row2'=>$Morning ); $top[]=array( 'row1'=>'Afternoon (13:00-18:00)', 'row2'=>$Afernoon ); $top[]=array( 'row1'=>'Evening (18:00-22:00)', 'row2'=>$Evening ); $top[]=array( 'row1'=>'Night (22:00- 08:00)', 'row2'=>$Night ); $data['top'] = ($top); $data['top_total']=$Morning+$Afernoon+$Evening+$Night; // age $less_one=0;$one_to_six=0;$seven_to_eighteen=0;$eighteen_to_seventy=0;$greater_seventy=0;$age=[]; if($record){ foreach ($record as $row) { if ($row->age < 1) { $less_one++; } if ($row->age >=1 && $row->age<=6) { $one_to_six++; } if ($row->age >=7 && $row->age <=18) { $seven_to_eighteen++; } if ($row->age >=18 && $row->age <=70) { $eighteen_to_seventy++; } if ($row->age >=71) { $greater_seventy++; } } } $age[]=array( 'row1'=>'< 1', 'row2'=>$less_one ); $age[]=array( 'row1'=>'1 to 6', 'row2'=>$one_to_six ); $age[]=array( 'row1'=>'7 to 17', 'row2'=>$seven_to_eighteen ); $age[]=array( 'row1'=>'18 to 70', 'row2'=>$eighteen_to_seventy ); $age[]=array( 'row1'=>'> 70', 'row2'=>$greater_seventy ); $data['age'] = ($age); $data['age_total']=$less_one+$one_to_six+$seven_to_eighteen+$eighteen_to_seventy+$greater_seventy; // gender $male=0;$female=0;$gender=[]; if($record){ foreach ($record as $row) { // if (strpos($row->gender, "male") !== false) { // $male++; // } // if (strpos($row->gender, "female") !== false) { // $female++; // } if ($row->gender === 'male') { $male++; } if ($row->gender === 'female') { $female++; } // if (substr($row->gender, 0, 5) == "Heavy") { // $male = $male + 1; // } // if (substr($row->gender, 0, 13) == 'Iso/Hypobaric') { // $la_ropivacaine1 = $la_ropivacaine1 + 1; // } } } $gender[]=array( 'row1'=>'Male', 'row2'=>$male ); $gender[]=array( 'row1'=>'Female', 'row2'=>$female ); // print_r($gender); $data['gender'] = ($gender); $data['gender_total']=$male+$female; //asa $ASA1=0;$ASA2=0;$ASA3=0;$ASA4=0;$ASA5=0;$ASA6=0;$ASA=[]; if($record){ foreach ($record as $row) { if (strpos($row->asa, "ASA1") !== false) { $ASA1++; } if (strpos($row->asa, "ASA2") !== false) { $ASA2++; } if (strpos($row->asa, "ASA3") !== false) { $ASA3++; } if (strpos($row->asa, "ASA4") !== false) { $ASA4++; } if (strpos($row->asa, "ASA5") !== false) { $ASA5++; } if (strpos($row->asa, "ASA6") !== false) { $ASA6++; } } } $ASA[]=array( 'row1'=>'ASA1', 'row2'=>$ASA1 ); $ASA[]=array( 'row1'=>'ASA2', 'row2'=>$ASA2 ); $ASA[]=array( 'row1'=>'ASA3', 'row2'=>$ASA3 ); $ASA[]=array( 'row1'=>'ASA4', 'row2'=>$ASA4 ); $ASA[]=array( 'row1'=>'ASA5', 'row2'=>$ASA5 ); $ASA[]=array( 'row1'=>'ASA6', 'row2'=>$ASA6 ); $data['ASA'] = ($ASA); $data['ASA_total']=$ASA1+$ASA2+$ASA3+$ASA4+$ASA5+$ASA6; //---------co-morbis-----------------// $co_morbit=[]; $diabetes_mellitus=0;$cvs_disease=0;$respiratory_disease=0;$neurological_disorder=0;$renal_disorder=0; $spin_back_problem=0;$fever_infection=0;$bleeding_disorder=0;$anaemia=0;$malignancy=0;$other_co_morbid=0; if($record){ foreach ($record as $row) { if($row->diabetes_mellitus=='Yes'){ $diabetes_mellitus++; } if($row->cvs_disease=='Yes'){ $cvs_disease++; } if($row->respiratory_disease=='Yes'){ $respiratory_disease++; } if($row->neurological_disorder=='Yes'){ $neurological_disorder++; } if($row->renal_disorder=='Yes'){ $renal_disorder++; } if($row->spin_back_problem=='Yes'){ $spin_back_problem++; } if($row->fever_infection=='Yes'){ $fever_infection++; } if($row->bleeding_disorder=='Yes'){ $bleeding_disorder++; } if($row->anaemia=='Yes'){ $anaemia++; } if($row->malignancy=='Yes'){ $malignancy++; } if($row->other_co_morbid!=''){ $other_co_morbid++; } } } $co_morbit[]=array( 'row1'=>'Diabetes Mellitus', 'row2'=>$diabetes_mellitus ); $co_morbit[]=array( 'row1'=>'CVS disease', 'row2'=>$cvs_disease ); $co_morbit[]=array( 'row1'=>'Respiratory disease', 'row2'=>$respiratory_disease ); $co_morbit[]=array( 'row1'=>'Neurological disorders', 'row2'=>$neurological_disorder ); $co_morbit[]=array( 'row1'=>'Renal Disorders', 'row2'=>$renal_disorder ); $co_morbit[]=array( 'row1'=>'Spine/back deformities', 'row2'=>$spin_back_problem ); $co_morbit[]=array( 'row1'=>'Fever / Infection', 'row2'=>$fever_infection ); $co_morbit[]=array( 'row1'=>'Bleeding disorder ', 'row2'=>$bleeding_disorder ); $co_morbit[]=array( 'row1'=>'Anaemia', 'row2'=>$anaemia ); $co_morbit[]=array( 'row1'=>'Malignancy', 'row2'=>$malignancy ); $co_morbit[]=array( 'row1'=>'Other', 'row2'=>$other_co_morbid ); $data['co_morbid']=($co_morbit); $data['co_morbid_total']=$diabetes_mellitus+$cvs_disease+$respiratory_disease+$neurological_disorder+$renal_disorder+ $spin_back_problem+$fever_infection+$bleeding_disorder+$anaemia+$malignancy+$other_co_morbid; //---------co-morbis-----------------// // BMI $one_bmi=0;$two_bmi=0;$three_bmi=0;$bmi=[]; if($record){ foreach ($record as $row) { if ($row->BMI >=30 && $row->BMI<=34.99) { $one_bmi++; } if ($row->BMI >=35 && $row->BMI<=39.99) { $two_bmi++; } if ($row->BMI > 40) { $three_bmi++; } } } $bmi[]=array( 'row1'=>'Class I obese(BMI 30-34.99)', 'row2'=>$one_bmi ); $bmi[]=array( 'row1'=>'Class II obese(BMI 35-39.99)', 'row2'=>$two_bmi ); $bmi[]=array( 'row1'=>'Class III obese(BMI>40)', 'row2'=>$three_bmi ); $data['bmi'] = ($bmi); $data['bmi_total']=$one_bmi+$two_bmi+$three_bmi; //speciality $General=0;$Gynaecology=0;$Orthopaedics=0;$Plastic=0;$Cardiothoracic=0;$Vascular=0;$Neuro=0;$Urology=0;$Dental=0;$ENT=0;$Maxillo=0;$Paediatric=0;$Obstetrics=0;$Ophthalmology=0; $Radiology=0;$others=0; $speciality_table=[]; if($record){ foreach ($record as $row) { if (strpos($row->speciality, "General Surgery") !== false) { $General = $General + 1; } if (strpos($row->speciality, "Gynaecology") !== false) { $Gynaecology = $Gynaecology + 1; } if (strpos($row->speciality, "Orthopaedics") !== false) { $Orthopaedics = $Orthopaedics + 1; } if (strpos($row->speciality, "Plastic surgery") !== false) { $Plastic = $Plastic + 1; } if (strpos($row->speciality, "Cardiothoracic surgery") !== false) { $Cardiothoracic = $Cardiothoracic + 1; } if (strpos($row->speciality, "Vascular Surgery") !== false) { $Vascular = $Vascular + 1; } if (strpos($row->speciality, "Neuro-spine") !== false) { $Neuro = $Neuro + 1; } if (strpos($row->speciality, "Urology") !== false) { $Urology = $Urology + 1; } if (strpos($row->speciality, "Dental") !== false) { $Dental = $Dental + 1; } if (strpos($row->speciality, "ENT") !== false) { $ENT = $ENT + 1; } if (strpos($row->speciality, "Maxillo facial") !== false) { $Maxillo = $Maxillo + 1; } if (strpos($row->speciality, "Paediatric and neonatology") !== false) { $Paediatric = $Paediatric + 1; } if (strpos($row->speciality, "Obstetrics") !== false) { $Obstetrics = $Obstetrics + 1; } if (strpos($row->speciality, "Ophthalmology") !== false) { $Ophthalmology = $Ophthalmology + 1; } if (strpos($row->speciality, "Radiology") !== false) { $Radiology = $Radiology + 1; } if (strpos($row->speciality, "others") !== false) { $others = $others + 1; } } } $speciality_table[]=array( 'col'=>'General Surgery', 'dat'=>$General ); $speciality_table[]=array( 'col'=>'Gynaecology', 'dat'=>$Gynaecology ); $speciality_table[]=array( 'col'=>'Orthopaedics', 'dat'=>$Orthopaedics ); $speciality_table[]=array( 'col'=>'Plastic surgery', 'dat'=>$Plastic ); $speciality_table[]=array( 'col'=>'Cardiothoracic surgery', 'dat'=>$Cardiothoracic ); $speciality_table[]=array( 'col'=>'Vascular Surgery', 'dat'=>$Vascular ); $speciality_table[]=array( 'col'=>'Neuro-spine', 'dat'=>$Neuro ); $speciality_table[]=array( 'col'=>'Urology', 'dat'=>$Urology ); $speciality_table[]=array( 'col'=>'Dental', 'dat'=>$Dental ); $speciality_table[]=array( 'col'=>'ENT', 'dat'=>$ENT ); $speciality_table[]=array( 'col'=>'Maxillo facial', 'dat'=>$Maxillo ); $speciality_table[]=array( 'col'=>'Paediatric and neonatology', 'dat'=>$Paediatric ); $speciality_table[]=array( 'col'=>'Obstetrics', 'dat'=>$Obstetrics ); $speciality_table[]=array( 'col'=>'Ophthalmology', 'dat'=>$Ophthalmology ); $speciality_table[]=array( 'col'=>'Radiology', 'dat'=>$Radiology ); $speciality_table[]=array( 'col'=>'others', 'dat'=>$others ); $data['speciality_table'] = ($speciality_table); $data['total_spe']= $General+$Gynaecology+$Orthopaedics+$Plastic+$Cardiothoracic+$Vascular+$Neuro+$Urology+$Dental+$ENT+$Maxillo+$Paediatric+$Obstetrics+$Ophthalmology+$Radiology+$others; //Surgery Location $headneck=0;$Thorax=0;$SpineSpinalCord=0;$UpperAbdomen=0;$LowerAbdomen=0;$Perineum=0;$Pelvis_ExceptHip=0;$UpperLeg_Except_Knee=0;$Knee_and_Popliteal_Area=0;$Lower_Leg_Below_Knee=0; $Shoulder_and_Axilla=0;$Upper_Arm_Elbow=0;$Forearm_Wrist_Hand=0;$Others_Unlisted=0; $Surgery=[]; if($record){ foreach ($record as $row) { if (strpos($row->surgery_location, "Head Neck") !== false) { $headneck++; } if (strpos($row->surgery_location, "Thorax") !== false) { $Thorax++; } if (strpos($row->surgery_location, "Spine SpinalCord") !== false) { $SpineSpinalCord++; } if (strpos($row->surgery_location, "Upper Abdomen") !== false) { $UpperAbdomen++; } if (strpos($row->surgery_location, "Lower Abdomen") !== false) { $LowerAbdomen++; } if (strpos($row->surgery_location, "Perineum") !== false) { $Perineum++; } if (strpos($row->surgery_location, "Pelvis ExceptHip") !== false) { $Pelvis_ExceptHip++; } if (strpos($row->surgery_location, "UpperLeg Except Knee") !== false) { $UpperLeg_Except_Knee++; } if (strpos($row->surgery_location, "Knee and Popliteal Area") !== false) { $Knee_and_Popliteal_Area++; } if (strpos($row->surgery_location, "Lower Leg Below Knee") !== false) { $Lower_Leg_Below_Knee++; } if (strpos($row->specsurgery_locationiality, "Shoulder and Axilla") !== false) { $Shoulder_and_Axilla++; } if (strpos($row->surgery_location, "Upper Arm Elbow") !== false) { $Upper_Arm_Elbow++; } if (strpos($row->surgery_location, "Forearm Wrist Hand") !== false) { $Forearm_Wrist_Hand++; } if (strpos($row->surgery_location, "Others Unlisted") !== false) { $Others_Unlisted++; } } } $Surgery[]=array( 'col'=>'Head & Neck', 'dat'=>$headneck ); $Surgery[]=array( 'col'=>'Thorax', 'dat'=>$Thorax ); $Surgery[]=array( 'col'=>'Spine and Spinal Cord', 'dat'=>$SpineSpinalCord ); $Surgery[]=array( 'col'=>'Upper Abdomen', 'dat'=>$UpperAbdomen ); $Surgery[]=array( 'col'=>'Lower Abdomen', 'dat'=>$LowerAbdomen ); $Surgery[]=array( 'col'=>'Perineum', 'dat'=>$Perineum ); $Surgery[]=array( 'col'=>'Pelvis (Except Hip)', 'dat'=>$Pelvis_ExceptHip ); $Surgery[]=array( 'col'=>'Upper Leg (Except Knee)', 'dat'=>$UpperLeg_Except_Knee ); $Surgery[]=array( 'col'=>'Knee and Popliteal Area', 'dat'=>$Knee_and_Popliteal_Area ); $Surgery[]=array( 'col'=>'Lower Leg (Below Knee)', 'dat'=>$Lower_Leg_Below_Knee ); $Surgery[]=array( 'col'=>'Shoulder and Axilla', 'dat'=>$Shoulder_and_Axilla ); $Surgery[]=array( 'col'=>'Upper Arm and Elbow', 'dat'=>$Upper_Arm_Elbow ); $Surgery[]=array( 'col'=>'Forearm Wrist and Hand', 'dat'=>$Forearm_Wrist_Hand ); $Surgery[]=array( 'col'=>'Others/Unlisted', 'dat'=>$Others_Unlisted ); $data['surgery'] = ($Surgery); $data['surgery_total']= $headneck+$Thorax+$SpineSpinalCord+$UpperAbdomen+$LowerAbdomen+$Perineum+$Pelvis_ExceptHip+$UpperLeg_Except_Knee+$Knee_and_Popliteal_Area+$Lower_Leg_Below_Knee+$Shoulder_and_Axilla+$Upper_Arm_Elbow+$Forearm_Wrist_Hand+$Others_Unlisted; //category $Emergency=0;$Elective=0;$Category=[]; if($record){ foreach ($record as $row) { if (strpos($row->category, "Emergency") !== false) { $Emergency++; } if (strpos($row->category, "Elective") !== false) { $Elective++; } } } $Category[]=array( 'row1'=>'Emergency', 'row2'=>$Emergency ); $Category[]=array( 'row1'=>'Elective', 'row2'=>$Elective ); $data['Category'] = ($Category); $data['Category_total']=$Emergency+$Elective; //minimal imnamasive $Yes=0;$No=0;$MinimallyInvasive=[]; if($record){ foreach ($record as $row) { if (strpos($row->Invasive, "Yes") !== false) { $Yes++; } if (strpos($row->Invasive, "No") !== false) { $No++; } } } $MinimallyInvasive[]=array( 'row1'=>'Yes', 'row2'=>$Yes ); $MinimallyInvasive[]=array( 'row1'=>'No', 'row2'=>$No ); $data['MinimallyInvasive'] = ($MinimallyInvasive); $data['MinimallyInvasive_total']=$Yes+$No; //experience level $Consultant=0;$Trainee=0;$c_senior=0;$c_junior=0;$experience=[]; if($record){ foreach ($record as $row) { if (strpos($row->done_by, "Senior Consultant") !== false) { $Consultant++; } elseif (strpos($row->done_by, "Junior Consultant") !== false) { $Trainee++; } elseif (strpos($row->done_by, "Senior Trainee") !== false) { $c_senior++; } else { $c_junior++; } } } $experience[]=array( 'row1'=>'Senior Consultant', 'row2'=>$Consultant ); $experience[]=array( 'row1'=>'Junior Consultant', 'row2'=>$Trainee ); $experience[]=array( 'row1'=>'Senior Trainee', 'row2'=>$c_senior ); $experience[]=array( 'row1'=>'Junior Trainee', 'row2'=>$c_junior ); $data['experience'] = ($experience); $data['experience_total']=$Consultant+$Trainee+$c_senior+$c_junior; //Supervision $Under =0;$Independent=0;$Supervision=[]; if($record){ foreach ($record as $row) { if (strpos($row->supervision, "Direct Supervision") !== false) { $Under++; } if (strpos($row->supervision, "Independent Supervision") !== false) { $Independent++; } } } $Supervision[]=array( 'row1'=>'Direct Supervision', 'row2'=>$Under ); $Supervision[]=array( 'row1'=>'Independent Supervision', 'row2'=>$Independent ); $data['supervision'] = ($Supervision); $data['supervision_total']=$Under+$Independent; // anaesthesia $Monitoring=0;$CNB=0;$GA=0;$PNB=0;$Sedation=0;$Other=0; $anaesthesia_table=[]; if($record){ foreach($record as $row){ //anaesthesia if (strpos($row->anaesthesia, "Monitoring only") !== false) { $Monitoring = $Monitoring + 1; } if (strpos($row->anaesthesia, "CNB") !== false) { $CNB = $CNB + 1; } if (strpos($row->anaesthesia, "GA") !== false) { $GA = $GA + 1; } if (strpos($row->anaesthesia, "PNB") !== false) { $PNB = $PNB + 1; } if (strpos($row->anaesthesia, "Sedation") !== false) { $Sedation = $Sedation + 1; } if (strpos($row->anaesthesia, "Other") !== false) { $Other = $Other + 1; } } } $anaesthesia_table[]=array( 'day'=>'Monitoring only', 'sell'=>$Monitoring ); $anaesthesia_table[]=array( 'day'=>'CNB', 'sell'=>$CNB ); $anaesthesia_table[]=array( 'day'=>'GA', 'sell'=>$GA ); $anaesthesia_table[]=array( 'day'=>'PNB', 'sell'=>$PNB ); $anaesthesia_table[]=array( 'day'=>'Sedation', 'sell'=>$Sedation ); $anaesthesia_table[]=array( 'day'=>'Other', 'sell'=>$Other ); $data['anaesthesia_table'] = ($anaesthesia_table); $data['total_an']=$Monitoring+$CNB+$GA+$PNB+$Sedation+$Other; //ga_technique $Inhalational =0;$TIVA=0;$ga_technique=[]; if($record){ foreach ($record as $row) { if (strpos($row->ga_technique, "Inhalational") !== false) { $Inhalational++; } if (strpos($row->ga_technique, "TIVA") !== false) { $TIVA++; } } } $ga_technique[]=array( 'row1'=>'Inhalational', 'row2'=>$Inhalational ); $ga_technique[]=array( 'row1'=>'TIVA', 'row2'=>$TIVA ); $data['ga_technique'] = ($ga_technique); $data['ga_technique_total']=$Inhalational+$TIVA; //ga av $eet=0;$lma=0;$mask=0;$other=0;$ga_av=[]; if($record){ foreach ($record as $row) { if(strpos($row->ga_airway_management, "GA ETT") !== false) { $eet++; } if(strpos($row->ga_airway_management, "GA LMA") !== false) { $lma++; } if(strpos($row->ga_airway_management, "GA MASK") !== false) { $c_senior++; } if(strpos($row->ga_airway_management, "GA other") !== false) { $c_junior++; } } } $ga_av[]=array( 'row1'=>'GA ETT', 'row2'=>$eet ); $ga_av[]=array( 'row1'=>'GA LMA', 'row2'=>$lma ); $ga_av[]=array( 'row1'=>'GA MASK', 'row2'=>$mask ); $ga_av[]=array( 'row1'=>'GA other', 'row2'=>$other ); $data['ga_av'] = ($ga_av); $data['ga_av_total']=$eet+$lma+$mask+$other; // cnb_technique $Spinal=0;$Epidural=0;$CSE=0;$CSA=0;$CNBTechnique=[]; if($record){ foreach ($record as $row) { if (strpos($row->cnb_technique, "Spinal") !== false) { $Spinal++; } if (strpos($row->cnb_technique, "Epidural") !== false) { $Epidural++; } if (strpos($row->cnb_technique, "CSE") !== false) { $CSE++; } if (strpos($row->cnb_technique, "CSA") !== false) { $CSA++; } } } $CNBTechnique[]=array( 'row1'=>'Spinal', 'row2'=>$Spinal ); $CNBTechnique[]=array( 'row1'=>'Epidural', 'row2'=>$Epidural ); $CNBTechnique[]=array( 'row1'=>'CSE', 'row2'=>$CSE ); $CNBTechnique[]=array( 'row1'=>'CSA', 'row2'=>$CSA ); // $data['CNBTechnique'] = ($CNBTechnique); $data['CNBTechnique_total']=$Spinal+$Epidural+$CSE+$CSA; //cnb outcome $Complete =0;$Partial=0;$Failure=0;$cnb_outcome=[]; if($record){ foreach ($record as $row) { if (strpos($row->cnb_outcome, "Complete Success") !== false) { $Complete++; } if (strpos($row->cnb_outcome, "Partial Success") !== false) { $Partial++; } if (strpos($row->cnb_outcome, "Failure") !== false) { $Failure++; } } } $cnb_outcome[]=array( 'row1'=>'Complete Success', 'row2'=>$Complete ); $cnb_outcome[]=array( 'row1'=>'Partial Success', 'row2'=>$Partial ); $cnb_outcome[]=array( 'row1'=>'Failure', 'row2'=>$Failure ); $data['cnb_outcome'] = ($cnb_outcome); $data['cnb_outcome_total']=$Complete+$Partial+$Failure; //cnbcatheter $Yes_cnb=0;$No_cnb=0;$CNBCatheter=[]; if($record){ foreach ($record as $row) { if (strpos($row->anaesthesia, "CNB") !== false) { if (strpos($row->cnb_catheter, "Yes") !== false) { $Yes_cnb++; } if (strpos($row->cnb_catheter, "No") !== false) { $No_cnb++; } } } } $CNBCatheter[]=array( 'row1'=>'Yes', 'row2'=>$Yes_cnb ); $CNBCatheter[]=array( 'row1'=>'No', 'row2'=>$No_cnb ); // $data['CNBCatheter'] = ($CNBCatheter); $data['CNBCatheter_total']=$Yes_cnb+$No_cnb; $ChestAbdomen=0;$HeadandNeck=0;$LowerLimb=0;$UpperLimb=0;$PNBBlockLocation=[]; if($record){ foreach ($record as $row) { if (strpos($row->pnb_block_location, "Chest Abdomen Perineum and Pelvis") !== false) { $ChestAbdomen++; } if (strpos($row->pnb_block_location, "Head and Neck") !== false) { $HeadandNeck++; } if (strpos($row->pnb_block_location, "Lower Limb") !== false) { $LowerLimb++; } if (strpos($row->pnb_block_location, "Upper Limb") !== false) { $UpperLimb++; } } } $PNBBlockLocation[]=array( 'row1'=>'Chest Abdomen Perineum and Pelvis', 'row2'=>$ChestAbdomen ); $PNBBlockLocation[]=array( 'row1'=>'Head and Neck', 'row2'=>$HeadandNeck ); $PNBBlockLocation[]=array( 'row1'=>'Lower Limb', 'row2'=>$LowerLimb ); $PNBBlockLocation[]=array( 'row1'=>'Upper Limb', 'row2'=>$UpperLimb ); $data['PNBBlockLocation'] = ($PNBBlockLocation); $data['PNBBlockLocation_total']=$ChestAbdomen+$HeadandNeck+$LowerLimb+$UpperLimb; //pnbcatheter $Yes_pnb=0;$No_pnb=0;$PNBCatheter=[]; if($record){ foreach ($record as $row) { if (strpos($row->anaesthesia, "PNB") !== false) { if (strpos($row->pnb_catheter, "Yes") !== false) { $Yes_pnb++; } if (strpos($row->pnb_catheter, "No") !== false) { $No_pnb++; } } } } $PNBCatheter[]=array( 'row1'=>'Yes', 'row2'=>$Yes_pnb ); $PNBCatheter[]=array( 'row1'=>'No', 'row2'=>$No_pnb ); // $data['PNBCatheter'] = ($PNBCatheter); $data['PNBCatheter_total']=$Yes_pnb+$No_pnb; //specialprocedure start $Intubation=0;$Video=0;$Blind=0;$Bronchial=0;$Bronchoscopy=0;$Double=0;$FOI=0;$FONA=0;$Jet=0;$Retrograde=0;$Submental=0;$Surgical=0;$Thrive=0;$Apnoeic=0;$Other_av=0; $sp_1=[]; if($record){ foreach ($record as $row) { if (strpos($row->sp_airway_ventilation, "Intubation through LMA/igel") !== false) { $Intubation++; } if (strpos($row->sp_airway_ventilation, "Video Laryngoscopy") !== false) { $Video++; } if (strpos($row->sp_airway_ventilation, "Blind Nasal Intubation") !== false) { $Blind++; } if (strpos($row->sp_airway_ventilation, "Bronchial blocker") !== false) { $Bronchial++; } if (strpos($row->sp_airway_ventilation, "Bronchoscopy") !== false) { $Bronchoscopy++; } if (strpos($row->sp_airway_ventilation, "Double lumen Tube") !== false) { $Double++; } if (strpos($row->sp_airway_ventilation, "FOI Awake/Asleep") !== false) { $FOI++; } if (strpos($row->sp_airway_ventilation, "FONA") !== false) { $FONA++; } if (strpos($row->sp_airway_ventilation, "Jet ventilation") !== false) { $Jet++; } if (strpos($row->sp_airway_ventilation, "Retrograde intubation") !== false) { $Retrograde++; } if (strpos($row->sp_airway_ventilation, "Submental intubation") !== false) { $Submental++; } if (strpos($row->sp_airway_ventilation, "Surgical tracheostomy") !== false) { $Surgical++; } if (strpos($row->sp_airway_ventilation, "Thrive Optiflow") !== false) { $Thrive++; } if (strpos($row->sp_airway_ventilation, "Apnoeic oxygenation") !== false) { $Apnoeic++; } if (strpos($row->sp_airway_ventilation, "Other") !== false) { $Other_av++; } } } $sp_1[]=array( 'row1'=>'Intubation through LMA/igel', 'row2'=>$Intubation ); $sp_1[]=array( 'row1'=>'Video Laryngoscopy', 'row2'=>$Video ); $sp_1[]=array( 'row1'=>'Blind Nasal Intubation', 'row2'=>$Blind ); $sp_1[]=array( 'row1'=>'Bronchial blocker', 'row2'=>$Bronchial ); $sp_1[]=array( 'row1'=>'Bronchoscopy', 'row2'=>$Bronchoscopy ); $sp_1[]=array( 'row1'=>'Double lumen Tube', 'row2'=>$Double ); $sp_1[]=array( 'row1'=>'FOI Awake/Asleep', 'row2'=>$FOI ); $sp_1[]=array( 'row1'=>'FONA', 'row2'=>$FONA ); $sp_1[]=array( 'row1'=>'Jet ventilation', 'row2'=>$Jet ); $sp_1[]=array( 'row1'=>'Retrograde intubation', 'row2'=>$Retrograde ); $sp_1[]=array( 'row1'=>'Submental intubation', 'row2'=>$Submental ); $sp_1[]=array( 'row1'=>'Surgical tracheostomy', 'row2'=>$Surgical ); $sp_1[]=array( 'row1'=>'Thrive Optiflow', 'row2'=>$Thrive ); $sp_1[]=array( 'row1'=>'Apnoeic oxygenation', 'row2'=>$Apnoeic ); $sp_1[]=array( 'row1'=>'Other', 'row2'=>$Other_av ); // print_r($sp_1); // exit(); $data['sp_1'] = ($sp_1); $data['sp_1_total']=$Intubation+$Video+$Blind+$Bronchial+$Bronchoscopy+$Double+$FOI+$FONA+$Jet+$Retrograde+$Submental+$Surgical+$Thrive+$Apnoeic+$Other_av; // $Yes_pnb=0;$No_pnb=0;$PNBCatheter=[]; // if($record){ // foreach ($record as $row) { // if (strpos($row->pnb_catheter, "Yes") !== false) { // $Yes_pnb++; // } // if (strpos($row->pnb_catheter, "No") !== false) { // $No_pnb++; // } // } // } // $PNBCatheter[]=array( // 'row1'=>'Yes', // 'row2'=>$Yes_pnb // ); // $PNBCatheter[]=array( // 'row1'=>'No', // 'row2'=>$No_pnb // ); // // // $data['PNBCatheter'] = ($PNBCatheter); // $data['PNBCatheter_total']=$Yes_pnb+$No_pnb; //pnb tecgnique $Landmark=0;$PNS=0;$Ultrasound=0;$Dual=0;$PNBTechnique=[]; if($record){ foreach ($record as $row) { if (strpos($row->pmb_technique, "Landmark") !== false) { $Landmark++; } if (strpos($row->pmb_technique, "PNS") !== false) { $PNS++; } if (strpos($row->pmb_technique, "Ultrasound") !== false) { $Ultrasound++; } if (strpos($row->pmb_technique, "Dual") !== false) { $Dual++; } } } $PNBTechnique[]=array( 'row1'=>'Landmark', 'row2'=>$Landmark ); $PNBTechnique[]=array( 'row1'=>'PNS', 'row2'=>$PNS ); $PNBTechnique[]=array( 'row1'=>'Ultrasound', 'row2'=>$Ultrasound ); $PNBTechnique[]=array( 'row1'=>'Dual', 'row2'=>$Dual ); // $data['PNBTechnique'] = ($PNBTechnique); $data['PNBTechnique_total']=$Landmark+$PNS+$Ultrasound+$Dual; //pnb outcome $Complete_pnb=0;$Partial_pnb=0;$Failure_pnb=0;$pnb_outcome=[]; if($record){ foreach ($record as $row) { if (strpos($row->success, "Complete Success") !== false) { $Complete_pnb++; } if (strpos($row->success, "Partial Success") !== false) { $Partial_pnb++; } if (strpos($row->success, "Failure") !== false) { $Failure_pnb++; } } } $pnb_outcome[]=array( 'row1'=>'Complete Success', 'row2'=>$Complete_pnb ); $pnb_outcome[]=array( 'row1'=>'Partial Success', 'row2'=>$Partial_pnb ); $pnb_outcome[]=array( 'row1'=>'Failure', 'row2'=>$Failure_pnb ); $data['pnb_outcome'] = ($pnb_outcome); $data['pnb_outcome_total']=$Complete_pnb+$Partial_pnb+$Failure_pnb; //SpecialProcedures $Airway=0;$CVS=0;$CNS=0;$Other_SP=0;$SpecialProcedures=[]; if($record){ foreach ($record as $row) { if (strpos($row->special_procedures, "Airway and Ventilation") !== false) { $Airway++; } if (strpos($row->special_procedures, "CVS") !== false) { $CVS++; } if (strpos($row->special_procedures, "CNS") !== false) { $CNS++; } if (strpos($row->special_procedures, "Other") !== false) { $Other_SP++; } } } $SpecialProcedures[]=array( 'row1'=>'Airway and Ventilation', 'row2'=>$Airway ); $SpecialProcedures[]=array( 'row1'=>'CVS', 'row2'=>$CVS ); $SpecialProcedures[]=array( 'row1'=>'CNS', 'row2'=>$CNS ); $SpecialProcedures[]=array( 'row1'=>'Other', 'row2'=>$Other_SP ); // $data['SpecialProcedures'] = ($SpecialProcedures); $data['SpecialProcedures_total']=$Airway+$CVS+$CNS+$Other_SP; //PainReviewType $Postop=0;$PostopEpidural=0;$PostopReview=0;$Acute=0;$Trauma=0;$Simple=0;$Complex=0;$Regional=0;$Chronic=0;$Cancer=0;$PainReviewType=[]; if($record){ foreach ($record as $row) { if (strpos($row->pain_review_type, "Postop PCA Review") !== false) { $Postop++; } if (strpos($row->pain_review_type, "Postop Epidural Review") !== false) { $PostopEpidural++; } if (strpos($row->pain_review_type, "Postop Review (general)") !== false) { $PostopReview++; } if (strpos($row->pain_review_type, "Acute on chronic pain review") !== false) { $Acute++; } if (strpos($row->pain_review_type, "Trauma review") !== false) { $Trauma++; } if (strpos($row->pain_review_type, "Simple pain plan") !== false) { $Simple++; } if (strpos($row->pain_review_type, "Complex pain plan") !== false) { $Complex++; } if (strpos($row->pain_review_type, "Regional block top-up") !== false) { $Regional++; } if (strpos($row->pain_review_type, "Chronic Pain review") !== false) { $Chronic++; } if (strpos($row->pain_review_type, "Cancer Pain review") !== false) { $Cancer++; } } } $PainReviewType[]=array( 'row1'=>'Postop PCA Review', 'row2'=>$Postop ); $PainReviewType[]=array( 'row1'=>'Postop Epidural Review', 'row2'=>$PostopEpidural ); $PainReviewType[]=array( 'row1'=>'Postop Review (general)', 'row2'=>$PostopReview ); $PainReviewType[]=array( 'row1'=>'Acute on chronic pain review', 'row2'=>$Acute ); $PainReviewType[]=array( 'row1'=>'Trauma review', 'row2'=>$Trauma ); $PainReviewType[]=array( 'row1'=>'Simple pain plan', 'row2'=>$Simple ); $PainReviewType[]=array( 'row1'=>'Complex pain plan', 'row2'=>$Complex ); $PainReviewType[]=array( 'row1'=>'Regional block top-up', 'row2'=>$Regional ); $PainReviewType[]=array( 'row1'=>'Chronic Pain review', 'row2'=>$Chronic ); $PainReviewType[]=array( 'row1'=>'Cancer Pain review', 'row2'=>$Cancer ); // $data['PainReviewType'] = ($PainReviewType); $data['PainReviewType_total']=$Postop+$PostopEpidural+$PostopReview+$Acute+$Trauma+$Simple+$Complex+$Regional+$Chronic+$Cancer; //sp cvs $CPET=0;$Arterial=0;$Central=0;$Cardiac_i=0;$Cardiac_n=0;$DHCA=0;$TOE=0;$TTE=0; $Jugular=0;$Subclavian=0;$Femoral=0;$other_cvc=0; $sp_cvs=[]; if($record){ foreach($record as $row){ if (strpos($row->sp_cvs, "CPET (cardio-pulmonary exercise testing)") !== false) { $CPET++; } if (strpos($row->sp_cvs, "CVC (Central Venous Catheter line)") !== false) { $Arterial++; } if (strpos($row->sp_cvs, "Cardiac output monitoring-Non-invasive") !== false) { $Central++; } if (strpos($row->sp_cvs, "Arterial Line") !== false) { $Cardiac_n++; } if (strpos($row->sp_cvs, "Cardiac output monitoring- invasive including PA catheter") !== false) { $Cardiac_i++; } if (strpos($row->sp_cvs, "TOE:Transoesophageal Echocardiography") !== false) { $DHCA++; } if (strpos($row->sp_cvs, "DHCA: Deep Hypothermic Cardiac Arrest") !== false) { $TOE++; } if (strpos($row->sp_cvs, "TTE: Transthoracic Echocardiography") !== false) { $TTE++; } if(strpos($row->cvc,"Jugular")!== false){ $Jugular++; } if(strpos($row->cvc,"Subclavian")!== false){ $Subclavian++; } if(strpos($row->cvc,"Femoral")!== false){ $Femoral++; } if(strpos($row->cvc,"other")!== false){ $other_cvc++; } } } $sp_cvs[]=array( 'row1'=>'CPET (cardio-pulmonary exercise testing)', 'row2'=>$CPET ); $sp_cvs[]=array( 'row1'=>'CVC (Central Venous Catheter line)', 'row2'=>$Arterial ); $sp_cvs[]=array( 'row1'=>'(Central Venous Catheter line) Jugular', 'row2'=>$Jugular ); $sp_cvs[]=array( 'row1'=>'(Central Venous Catheter line) Subclavian', 'row2'=>$Subclavian ); $sp_cvs[]=array( 'row1'=>'(Central Venous Catheter line) Femoral', 'row2'=>$Femoral ); $sp_cvs[]=array( 'row1'=>'(Central Venous Catheter line) Other', 'row2'=>$other_cvc ); $sp_cvs[]=array( 'row1'=>'Cardiac output monitoring-Non-invasive', 'row2'=>$Central ); $sp_cvs[]=array( 'row1'=>'Arterial Line', 'row2'=>$Cardiac_n ); $sp_cvs[]=array( 'row1'=>'Cardiac output monitoring- invasive including PA catheter', 'row2'=>$Cardiac_i ); $sp_cvs[]=array( 'row1'=>'TOE:Transoesophageal Echocardiography', 'row2'=>$DHCA ); $sp_cvs[]=array( 'row1'=>'DHCA: Deep Hypothermic Cardiac Arrest', 'row2'=>$TOE ); $sp_cvs[]=array( 'row1'=>'TTE: Transthoracic Echocardiography', 'row2'=>$TTE ); $data['sp_cvs'] = ($sp_cvs); $data['sp_cvs_total']=$CPET+$Arterial+$Central+$Cardiac_n+$Cardiac_i+$DHCA+$TOE+$TTE+$Jugular+$Subclavian+$Femoral+$other; //CNS $Depth=0;$NIRS=0;$Brain_stem=0;$CNS=[]; if($record){ foreach ($record as $row) { if (strpos($row->sp_cns, "Depth of Anaesthesia Monitoring (BIS,Entropy, etc)") !== false) { $Depth++; } if (strpos($row->sp_cns, "NIRS (Near Infra-red spectrometry) Cerebral Oximetry") !== false) { $NIRS++; } if (strpos($row->sp_cns, "Brain-stem monitoring/SSEPs, MEPs") !== false) { $Brain_stem++; } } } $CNS[]=array( 'row1'=>'Depth of Anaesthesia Monitoring (BIS,Entropy, etc)', 'row2'=>$Depth ); $CNS[]=array( 'row1'=>'NIRS (Near Infra-red spectrometry) Cerebral Oximetry', 'row2'=>$NIRS ); $CNS[]=array( 'row1'=>'Brain-stem monitoring/SSEPs, MEPs', 'row2'=>$Brain_stem ); // $data['CNS'] = ($CNS); $data['CNS_total']=$Depth+$NIRS+$Brain_stem; //special procedure others $Epidural_sp=0;$ChestDrain_sp=0;$LumbarPuncture_sp=0;$Abdominal_sp=0;$Massive_sp=0;$Intraosseus_sp=0;$Lumbardrain_sp=0;$Gastric=0;$Anaesthesia_other_sp=[]; if($record){ foreach ($record as $row) { if (strpos($row->sp_others, "Epidural Blood Patch") !== false) { $Epidural_sp++; } if (strpos($row->sp_others, "Chest Drain Insertion") !== false) { $ChestDrain_sp++; } if (strpos($row->sp_others, "Lumbar Puncture") !== false) { $LumbarPuncture_sp++; } if (strpos($row->sp_others, "FAST /Abdominal ultrasound") !== false) { $Abdominal_sp++; } if (strpos($row->sp_others, "Massive transfusion") !== false) { $Massive_sp++; } if (strpos($row->sp_others, "Intra-osseus") !== false) { $Intraosseus_sp++; } if (strpos($row->sp_others, "Lumbar drain") !== false) { $Lumbardrain_sp++; } if (strpos($row->sp_others, "Gastric Ultrasound") !== false) { $Gastric_sp++; } } } $Anaesthesia_other[]=array( 'row1'=>'Epidural Blood Patch', 'row2'=>$Epidural_sp ); $Anaesthesia_other[]=array( 'row1'=>'Chest Drain Insertion', 'row2'=>$ChestDrain_sp ); $Anaesthesia_other[]=array( 'row1'=>'Lumbar Puncture', 'row2'=>$LumbarPuncture_sp ); $Anaesthesia_other[]=array( 'row1'=>'FAST /Abdominal ultrasound', 'row2'=>$Abdominal_sp ); $Anaesthesia_other[]=array( 'row1'=>'Massive transfusion', 'row2'=>$Massive_sp ); $Anaesthesia_other[]=array( 'row1'=>'Intra-osseus', 'row2'=>$Intraosseus_sp ); $Anaesthesia_other[]=array( 'row1'=>'Lumbar drain', 'row2'=>$Lumbardrain_sp ); $Anaesthesia_other[]=array( 'row1'=>'Gastric Ultrasound', 'row2'=>$Gastric_sp ); // $data['Anaesthesia_other'] = ($Anaesthesia_other); $data['Anaesthesia_other_total']=$Epidural_sp+$ChestDrain_sp+$LumbarPuncture_sp+$Abdominal_sp+$Massive_sp+$Intraosseus_sp+$Lumbardrain_sp+$Gastric_sp; //PNBL chest and obdoman $Classic=0;$Thoracic=0;$Lumbar=0;$Paravertebral=0;$PECS=0;$Quadratus=0;$Quadratus_3=0; $Rectus=0;$Subcostal=0;$Ilionguinal=0;$Intercostal=0;$Paravertebral_1=0;$PECS_1=0;$Penile=0; $Quadratus_2=0;$Peri_anal=0;$Serratus=0;$Transversalis=0;$Other_CHEST=0; $PNB_HEADNECK=[]; if($record){ foreach($record as $row){ if (strpos($row->pnbl_capppnbl, "Classic TAP") !== false) { $Classic++; } if (strpos($row->pnbl_capppnbl, "Erector Spinae Block - Thoracic") !== false) { $Thoracic++; } if (strpos($row->pnbl_capppnbl, "Erector Spinae Block - Lumbar") !== false) { $Lumbar++; } if (strpos($row->pnbl_capppnbl, "Paravertebral Thoracic") !== false) { $Paravertebral++; } if (strpos($row->pnbl_capppnbl, "PECS 2") !== false) { $PECS++; } if (strpos($row->pnbl_capppnbl, "Quadratus Lumborum Block 1") !== false) { $Quadratus++; } if (strpos($row->pnbl_capppnbl, "Quadratus Lumborum Block 3") !== false) { $Quadratus_3++; } if (strpos($row->pnbl_capppnbl, "Rectus Sheath") !== false) { $Rectus++; } if (strpos($row->pnbl_capppnbl, "Subcostal TAP") !== false) { $Subcostal++; } if (strpos($row->pnbl_capppnbl, "Ilionguinal Iliohypogastric Block (Hernia Block)") !== false) { $Ilionguinal++; } if (strpos($row->pnbl_capppnbl, "Intercostal Nerve Block") !== false) { $Intercostal++; } if (strpos($row->pnbl_capppnbl, "PECS 1") !== false) { $PECS_1++; } if (strpos($row->pnbl_capppnbl, "Paravertebral Lumbar") !== false) { $Paravertebral_1++; } if (strpos($row->pnbl_capppnbl, "Penile Block") !== false) { $Penile++; } if (strpos($row->pnbl_capppnbl, "Quadratus Lumborum Block 2") !== false) { $Quadratus_2++; } if (strpos($row->pnbl_capppnbl, "Peri-anal Block") !== false) { $Peri_anal++; } if (strpos($row->pnbl_capppnbl, "Serratus Plane Block") !== false) { $Serratus++; } if (strpos($row->pnbl_capppnbl, "Transversalis Fascia Block") !== false) { $Transversalis++; } if (strpos($row->pnbl_capppnbl, "other") !== false) { $Other_CHEST++; } } } $PNB_HEADNECK[]=array( 'row1'=>'Classic TAP', 'row2'=>$Classic ); $PNB_HEADNECK[]=array( 'row1'=>'Ilionguinal Iliohypogastric Block (Hernia Block)', 'row2'=>$Ilionguinal ); $PNB_HEADNECK[]=array( 'row1'=>'Erector Spinae Block - Thoracic', 'row2'=>$Thoracic ); $PNB_HEADNECK[]=array( 'row1'=>'Intercostal Nerve Block', 'row2'=>$Intercostal ); $PNB_HEADNECK[]=array( 'row1'=>'Erector Spinae Block - Lumbar', 'row2'=>$Lumbar ); $PNB_HEADNECK[]=array( 'row1'=>'Paravertebral Lumbar', 'row2'=>$Paravertebral_1 ); $PNB_HEADNECK[]=array( 'row1'=>'Paravertebral Thoracic', 'row2'=>$Paravertebral ); $PNB_HEADNECK[]=array( 'row1'=>'PECS 1', 'row2'=>$PECS_1 ); $PNB_HEADNECK[]=array( 'row1'=>'PECS 2', 'row2'=>$PECS ); $PNB_HEADNECK[]=array( 'row1'=>'Penile Block', 'row2'=>$Penile ); $PNB_HEADNECK[]=array( 'row1'=>'Quadratus Lumborum Block 1', 'row2'=>$Quadratus ); $PNB_HEADNECK[]=array( 'row1'=>'Quadratus Lumborum Block 2', 'row2'=>$Quadratus_2 ); $PNB_HEADNECK[]=array( 'row1'=>'Quadratus Lumborum Block 3', 'row2'=>$Quadratus_3 ); $PNB_HEADNECK[]=array( 'row1'=>'Peri-anal Block', 'row2'=>$Peri_anal ); $PNB_HEADNECK[]=array( 'row1'=>'Rectus Sheath', 'row2'=>$Rectus ); $PNB_HEADNECK[]=array( 'row1'=>'Serratus Plane Block', 'row2'=>$Serratus ); $PNB_HEADNECK[]=array( 'row1'=>'Subcostal TAP', 'row2'=>$Subcostal ); $PNB_HEADNECK[]=array( 'row1'=>'Transversalis Fascia Block', 'row2'=>$Transversalis ); $PNB_HEADNECK[]=array( 'row1'=>'Other', 'row2'=>$Other_CHEST ); $data['PNB_HEADNECK'] = ($PNB_HEADNECK); $data['PNB_HEADNECK_total']=$Classic+$Thoracic+$Lumbar+$Paravertebral+$PECS+$Quadratus+$Quadratus_3+$Rectus+$Subcostal+$Ilionguinal+$Intercostal+$PECS_1+$Paravertebral_1+$Penile+ $Quadratus_2+$Peri_anal+$Serratus+$Transversalis+$Other_CHEST; //pnb h a n $Cervicalplexus=0;$plexusintermediate=0;$plexussuperficial=0;$Peribulbar=0; $Retrobulbar=0;$Subtenon=0;$MandibularNerve=0;$MaxillaryNerve=0; $OccipitalNerve=0;$ScalpBlock=0;$Sphenopalatine=0;$Trigeminal=0;$head_other=0; $PNB_HeadandNeck=[]; if($record){ foreach ($record as $row) { if (strpos($row->pnbl_headneck, "Cervical plexus deep") !== false) { $Cervicalplexus++; } if (strpos($row->pnbl_headneck, "Cervical plexus intermediate") !== false) { $plexusintermediate++; } if (strpos($row->pnbl_headneck, "Cervical plexus superficial") !== false) { $plexussuperficial++; } if (strpos($row->pnbl_headneck, "Eye block - Peribulbar") !== false) { $Peribulbar++; } if (strpos($row->pnbl_headneck, "Eye block -Retrobulbar") !== false) { $Retrobulbar++; } if (strpos($row->pnbl_headneck, "Eye block -Subtenon") !== false) { $Subtenon++; } if (strpos($row->pnbl_headneck, "Mandibular Nerve Block") !== false) { $MandibularNerve++; } if (strpos($row->pnbl_headneck, "Maxillary Nerve Block") !== false) { $MaxillaryNerve++; } if (strpos($row->pnbl_headneck, "Occipital Nerve Block") !== false) { $OccipitalNerve++; } if (strpos($row->pnbl_headneck, "Scalp Block") !== false) { $ScalpBlock++; } if (strpos($row->pnbl_headneck, "Sphenopalatine Ganglion Block") !== false) { $Sphenopalatine++; } if (strpos($row->pnbl_headneck, "Trigeminal Ganglion Block") !== false) { $Trigeminal++; } if (strpos($row->pnbl_headneck, "other") !== false) { $head_other++; } } } $PNB_HeadandNeck[]=array( 'row1'=>'Cervical plexus deep', 'row2'=>$Cervicalplexus ); $PNB_HeadandNeck[]=array( 'row1'=>'Cervical plexus intermediate', 'row2'=>$plexusintermediate ); $PNB_HeadandNeck[]=array( 'row1'=>'Cervical plexus superficial', 'row2'=>$plexussuperficial ); $PNB_HeadandNeck[]=array( 'row1'=>'Eye block - Peribulbar', 'row2'=>$Peribulbar ); $PNB_HeadandNeck[]=array( 'row1'=>'Eye block -Retrobulbar', 'row2'=>$Retrobulbar ); $PNB_HeadandNeck[]=array( 'row1'=>'Eye block -Subtenon', 'row2'=>$Subtenon ); $PNB_HeadandNeck[]=array( 'row1'=>'Mandibular Nerve Block', 'row2'=>$MandibularNerve ); $PNB_HeadandNeck[]=array( 'row1'=>'Maxillary Nerve Block', 'row2'=>$MaxillaryNerve ); $PNB_HeadandNeck[]=array( 'row1'=>'Occipital Nerve Block', 'row2'=>$OccipitalNerve ); $PNB_HeadandNeck[]=array( 'row1'=>'Scalp Block', 'row2'=>$ScalpBlock ); $PNB_HeadandNeck[]=array( 'row1'=>'Sphenopalatine Ganglion Block', 'row2'=>$Sphenopalatine ); $PNB_HeadandNeck[]=array( 'row1'=>'Trigeminal Ganglion Block', 'row2'=>$Trigeminal ); $PNB_HeadandNeck[]=array( 'row1'=>'Other', 'row2'=>$head_other ); $data['PNB_HeadandNeck'] = ($PNB_HeadandNeck); $data['PNB_HeadandNeck_total']=$Cervicalplexus+$plexusintermediate+$plexussuperficial+$Peribulbar+$Retrobulbar+$Subtenon+$MandibularNerve +$MaxillaryNerve+$OccipitalNerve+$ScalpBlock+$Sphenopalatine+$Trigeminal+$head_other; //pnb upper limb $Axillary=0;$Biers_Block=0;$Digital_Ring=0;$Distal=0;$Infraclavicular=0;$Interscalene=0;$Supraclavicular=0;$WristBlock=0;$other_upperlimb=0;$upper_limb_report=[]; if($record){ foreach ($record as $row) { if (strpos($row->pnbl_upperlimb, "Axillary") !== false) { $Axillary++; } if (strpos($row->pnbl_upperlimb, "Biers Block") !== false) { $Biers_Block++; } if (strpos($row->pnbl_upperlimb, "Digital Ring Block") !== false) { $Digital_Ring++; } if (strpos($row->pnbl_upperlimb, "Distal Nerves") !== false) { $Distal++; } if (strpos($row->pnbl_upperlimb, "Infraclavicular") !== false) { $Infraclavicular++; } if (strpos($row->pnbl_upperlimb, "Interscalene") !== false) { $Interscalene++; } if (strpos($row->pnbl_upperlimb, "Supraclavicular") !== false) { $Supraclavicular++; } if (strpos($row->pnbl_upperlimb, "Wrist Block") !== false) { $WristBlock++; } if (strpos($row->pnbl_upperlimb, "other") !== false) { $other_upperlimb++; } } } $upper_limb_report[]=array( 'row1'=>'Axillary', 'row2'=>$Axillary ); $upper_limb_report[]=array( 'row1'=>'Biers Block', 'row2'=>$Biers_Block ); $upper_limb_report[]=array( 'row1'=>'Digital Ring Block', 'row2'=>$Digital_Ring ); $upper_limb_report[]=array( 'row1'=>'Distal Nerves', 'row2'=>$Distal ); $upper_limb_report[]=array( 'row1'=>'Infraclavicular', 'row2'=>$Infraclavicular ); $upper_limb_report[]=array( 'row1'=>'Interscalene', 'row2'=>$Interscalene ); $upper_limb_report[]=array( 'row1'=>'Supraclavicular', 'row2'=>$Supraclavicular ); $upper_limb_report[]=array( 'row1'=>'Wrist Block', 'row2'=>$WristBlock ); $upper_limb_report[]=array( 'row1'=>'Other', 'row2'=>$other_upperlimb ); // $data['upper_limb_report'] = ($upper_limb_report); $data['upper_limb_report_total']=$Axillary+$Biers_Block+$Digital_Ring+$Distal+$Infraclavicular+$Interscalene+$Supraclavicular+$WristBlock+$other_upperlimb; //pnb lowerlimb $Adductor=0;$Ankle=0;$Biers=0;$Fascial=0; $Peroneal=0;$Femoral=0;$iPACK=0;$plexus=0; $Obturator=0;$Lateral=0;$Sacral=0;$Saphaneous=0;$Popliteal=0;$SciaticNerve=0;$Tibial=0;$lower_other=0; $PNB_LowerLimb=[]; if($record){ foreach ($record as $row) { if (strpos($row->pnbl_lowerlimb, "Adductor Canal Block") !== false) { $Adductor++; } if (strpos($row->pnbl_lowerlimb, "Ankle") !== false) { $Ankle++; } if (strpos($row->pnbl_lowerlimb, "Biers Block") !== false) { $Biers++; } if (strpos($row->pnbl_lowerlimb, "Fascial Iliaca") !== false) { $Fascial++; } if (strpos($row->pnbl_lowerlimb, "Common Peroneal Nerve") !== false) { $Peroneal++; } if (strpos($row->pnbl_lowerlimb, "Femoral Nerve") !== false) { $Femoral++; } if (strpos($row->pnbl_lowerlimb, "iPACK") !== false) { $iPACK++; } if (strpos($row->pnbl_lowerlimb, "Lumbar plexus Block") !== false) { $plexus++; } if (strpos($row->pnbl_lowerlimb, "Obturator Nerve") !== false) { $Obturator++; } if (strpos($row->pnbl_lowerlimb, "Lateral Cutaneous Nerve") !== false) { $Lateral++; } if (strpos($row->pnbl_lowerlimb, "Sacral Plexus Block") !== false) { $Sacral++; } if (strpos($row->pnbl_lowerlimb, "Saphaneous Nerve Block") !== false) { $Saphaneous++; } if (strpos($row->pnbl_lowerlimb, "Sciatic Nerve - Popliteal") !== false) { $Popliteal++; } if (strpos($row->pnbl_lowerlimb, "Sciatic Nerve - Upper Thigh and Mid Thigh") !== false) { $SciaticNerve++; } // if (strpos($row->pnbl_lowerlimb, "Thigh Mid Thigh") !== false) { // $Thigh++; // } if (strpos($row->pnbl_lowerlimb, "Selective Tibial Nerve") !== false) { $Tibial++; } if (strpos($row->pnbl_lowerlimb, "other") !== false) { $lower_other++; } } } $PNB_LowerLimb[]=array( 'row1'=>'Adductor Canal Block', 'row2'=>$Adductor ); $PNB_LowerLimb[]=array( 'row1'=>'Ankle', 'row2'=>$Ankle ); $PNB_LowerLimb[]=array( 'row1'=>'Biers Block', 'row2'=>$Biers ); $PNB_LowerLimb[]=array( 'row1'=>'Fascial Iliaca', 'row2'=>$Fascial ); $PNB_LowerLimb[]=array( 'row1'=>'Common Peroneal Nerve', 'row2'=>$Peroneal ); $PNB_LowerLimb[]=array( 'row1'=>'Femoral Nerve', 'row2'=>$Femoral ); $PNB_LowerLimb[]=array( 'row1'=>'iPACK', 'row2'=>$iPACK ); $PNB_LowerLimb[]=array( 'row1'=>'Lumbar plexus Block', 'row2'=>$plexus ); $PNB_LowerLimb[]=array( 'row1'=>'Obturator Nerve', 'row2'=>$Obturator ); $PNB_LowerLimb[]=array( 'row1'=>'Lateral Cutaneous Nerve of Thigh', 'row2'=>$Lateral ); $PNB_LowerLimb[]=array( 'row1'=>'Sacral Plexus Block', 'row2'=>$Sacral ); $PNB_LowerLimb[]=array( 'row1'=>'Saphaneous Nerve Block', 'row2'=>$Saphaneous ); $PNB_LowerLimb[]=array( 'row1'=>'Sciatic Nerve - Popliteal', 'row2'=>$Popliteal ); $PNB_LowerLimb[]=array('row1'=>'Sciatic Nerve - Upper Thigh and Mid Thigh', 'row2'=>$SciaticNerve ); // $PNB_LowerLimb[]=array( // 'row1'=>'Thigh Mid Thigh', // 'row2'=>$Thigh // ); $PNB_LowerLimb[]=array( 'row1'=>'Selective Tibial Nerve', 'row2'=>$Tibial ); $PNB_LowerLimb[]=array( 'row1'=>'Other', 'row2'=>$lower_other ); // $data['PNB_LowerLimb'] = ($PNB_LowerLimb); $data['PNB_LowerLimb_total']=$Adductor+$Ankle+$Biers+$Fascial+$Peroneal+$Femoral+$iPACK+$plexus+$Obturator+$Lateral+$Sacral+$Saphaneous+$Popliteal+$SciaticNerve+$Tibial+$lower_other; $pnb_right=0;$pnb_left=0;$both=0;$pnb_block_site=[]; if($record){ foreach ($record as $row) { if (strpos($row->pnb_block_site, "Right") !== false) { $pnb_right++; } if (strpos($row->pnb_block_site, "Left") !== false) { $pnb_left++; } if (strpos($row->pnb_block_site, "Both") !== false) { $both++; } } } $pnb_block_site[]=array( 'row1'=>'Right', 'row2'=>$pnb_right ); $pnb_block_site[]=array( 'row1'=>'Left', 'row2'=>$pnb_left ); $pnb_block_site[]=array( 'row1'=>'Both', 'row2'=>$both ); // $data['pnb_block_site'] = ($pnb_block_site); $data['pnb_block_site_total']=$pnb_right+$pnb_left+$both; $data['total_cases']=$count; return view('logBook/fulllogreport', $data); }else{ return view('login'); } } } ?>