function followup() { $crud = new grocery_CRUD(); //verifica daca get este setata sa previn eroarea "undefine index variable" si verifica daca are valoare if (isset($_GET["p_id"]) != NULL) { // setez o variabila sesiune $this->session->set_userdata('patient_id', $_GET['p_id']); $pid = $this->session->userdata('patient_id'); //print_r("ID_pacient: ".$pid); //echo $_GET['pacient_id'].' sesiune settata'; } else { $pid = $this->session->userdata('patient_id'); //echo "hau".$pid."nu are"; //print_r("ID_pacient: ".$pid); } //aici fac filtrarea pentru pacient a spitalizarilor dupa variabila sesiune $crud->where('patient_id', $pid); // Configurez modelul pentru afisare $crud->set_theme('datatables'); $crud->set_table('follow_up'); $crud->set_subject('PCI Follow-Up'); //Configurare coloane $crud->columns('date', 'survival_status', 'date_of_death', 'status', 'signature'); $crud->required_fields('signature', 'status'); // Formatare cod $crud->field_type('patient_id', 'hidden', $pid); // $crud->field_type('user_id', 'hidden'); // $crud->field_type('edit_user', 'hidden'); // $crud->field_type('edit_time', 'hidden'); $crud->set_relation('signature', 'user', 'user_name'); // User Level Unset $drp = $this->session->userdata('user_type'); //print_r($drp); if ($drp == "user") { $crud->unset_delete(); $crud->unset_export(); $crud->unset_print(); } // log- user activities $crud->callback_after_insert(array($this, 'log_user_after_insert_followup')); $crud->callback_after_update(array($this, 'log_user_after_update_followup')); $crud->callback_after_delete(array($this, 'log_user_after_delete_followup')); // Afisare nume formular follow-up //-- 1. Follow Up (30 days and 12 months) $crud->display_as('date', 'Date of follow up'); $crud->field_tip('date', 'Indicate the date of last follow up alive. This may be the date of follow up or the date the patient is last seen alive by verifiable sources'); $crud->display_as('survival_status', 'Survival status at folow up'); $crud->field_tip('survival_status', 'Indicate vital status at follow up'); $crud->display_as('death_cause', 'Primary cause of death'); $crud->field_tip('death_cause', 'If the patient died indicate the cause of death'); $crud->display_as('anginal_status', 'Anginal status'); $crud->field_tip('anginal_status', 'Indicate the patients anginal status at the time of follow-up'); $crud->display_as('date_readmission', 'Date of first hospital readmission since discharge'); $crud->field_tip('date_readmission', 'If the patient is readmitted to hospital for a cardiovascular cause, indicate the date'); $crud->field_tip('dyspnoea', 'Grade breathing status according to the New York Heart Association (NYHA) functional classification.'); $crud->display_as('mi', 'Myocardial infarction [MI]'); $crud->field_tip('mi', 'Indicate if the patient was diagnosed as having an MI since discharge'); $crud->display_as('mi_date', 'Myocardial infarction date [MI]'); $crud->field_tip('mi_date', 'Indicate the date the patient had the myocardial infarction'); $crud->display_as('stroke', 'Stroke'); $crud->field_tip('stroke', 'Indicate if the patient was diagnosed as having a stroke since discharge, as evidenced by persistent loss of neurological function caused by an ischaemic event.'); $crud->field_tip('stroke_date', 'Indicate the date of stroke'); $crud->display_as('pci', 'Percutaneous coronary intervention date [PCI]'); $crud->field_tip('pci', 'Indicate if the patient had a percutaneous coronary intervention since the date of discharge'); $crud->display_as('pci_date', 'Percutaneous coronary intervention date [PCI] date'); $crud->field_tip('pci_date', 'Indicate the date of PCI'); $crud->display_as('coronary_bypass', 'Coronary artery bypass graft [CABG]'); $crud->field_tip('coronary_bypass', 'Indicate if the patient had a coronary artery bypass graft [CABG] since the date of discharge'); $crud->display_as('coronary_bypass_date', 'Coronary artery bypass graft [CABG] date'); $crud->field_tip('coronary_bypass_date', 'Indicate the date of CABG'); $crud->display_as('cardiac_rehabilitation', 'Cardiac rehabilitation program'); $crud->field_tip('cardiac_rehabilitation', 'Indicate if the patient attended or is attending a cardiac rehabilitation programme since discharge'); //-- 1. Follow Up (30 days and 12 months) $crud->field_tip('aspirin', 'On follow-up indicate if the patient is taking aspirin regularly'); $crud->field_tip('other_antiplatelet', 'On follow-up indicate if the patient is taking antiplatelet medication (other than aspirin) regularly '); $crud->field_tip('anticoagulants', 'On follow-up indicate if the patient is taking anticoagulant medication regularly'); $crud->field_tip('beta_blockers', 'On follow-up indicate if the patient is taking Beta-blockers regularly'); $crud->field_tip('ace_inhibitors', 'On follow-up indicate if the patient is taking ACE inhibitors regularly'); $crud->display_as('angiotensin', 'Angiotensin II receptor blockers'); $crud->field_tip('angiotensin', 'On follow-up indicate if the patient is taking angiotensin II receptor blockers regularly'); $crud->field_tip('diabetic_control', 'On follow-up indicate the main method of diabetic control the patient is regularly receiving'); $crud->field_tip('statins', 'On follow-up indicate if the patient is taking statins regularly'); $crud->display_as('non_statin', 'Non statin lipid lowering agents'); $crud->field_tip('non_statin', 'On follow-up indicate if the patient is non-statin lipid lowering agents regularly'); $crud->field_tip('status', 'Indicate status of intervention insert data process'); $crud->field_tip('notes', 'Indicate notes of intervention insert data process'); // Dropdown menu // -- 1. Follow Up (30 days and 12 months) $crud->field_type('survival_status', 'dropdown', array('Alive' => 'Alive', 'Dead' => 'Dead', 'Unknown' => 'Unknown')); $crud->field_type('death_cause', 'dropdown', array('Cardiovascular' => 'Cardiovascular', 'Non-Cardiovascular' => 'Non-Cardiovascular', 'Unknown' => 'Unknown')); $crud->field_type('anginal_status', 'dropdown', array('CCS 0' => 'CCS 0', 'CCS I' => 'CCS I', 'CCS II' => 'CCS II', 'CCS III' => 'CCS III', 'CCS IV' => 'CCS IV', 'Unknown' => 'Unknown')); $crud->field_type('dyspnoea', 'dropdown', array('NYHA I' => 'NYHA I', 'NYHA II' => 'NYHA II', 'NYHA III' => 'NYHA III', 'NYHA IV' => 'NYHA IV', 'Unknown' => 'Unknown')); $crud->field_type('mi', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown')); $crud->field_type('stroke', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown')); $crud->field_type('pci', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown')); $crud->field_type('coronary_bypass', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown')); $crud->field_type('cardiac_rehabilitation', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown')); // -- 2. Medication at follow Up (30 days and 12 months) $crud->field_type('aspirin', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown')); $crud->field_type('other_antiplatelet', 'dropdown', array('No' => 'No', 'Clopidogrel' => 'Clopidogrel', 'Ticagrelor' => 'Ticagrelor', 'Prasugrel' => 'Prasugrel', 'Other antiplatelet agent' => 'Other antiplatelet agent', 'Unknown' => 'Unknown')); $crud->field_type('anticoagulants', 'dropdown', array('No' => 'No', 'Vit. K antagonists' => 'Vit. K antagonists', 'Oral throbin inhibitors' => 'Oral throbin inhibitors', 'Oral factor Xa inhibitors' => 'Oral factor Xa inhibitors', 'Other anticoagulants agents' => 'Other anticoagulant agent', 'Unknown' => 'Unknown')); $crud->field_type('beta_blockers', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown ')); $crud->field_type('ace_inhibitors', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown ')); $crud->field_type('angiotensin', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown ')); $crud->field_type('statins', 'dropdown', array('No' => 'No', 'Yes' => 'Yes', 'Unknown' => 'Unknown ')); $crud->field_type('diabetic_control', 'dropdown', array('None' => 'None', 'Insulin and oral agent' => 'Insulin and oral agent', 'Insulin' => 'Insulin', 'Oral agent' => 'Oral Agent', 'Diet only' => 'Diet only', 'Unknown' => 'Unknown')); $crud->field_type('non_statin', 'dropdown', array('None' => 'None', 'Ezetimibe' => 'Ezetimibe', 'Fibrates' => 'Fibrates', 'Unknown' => 'Unknown ')); $crud->field_type('status', 'dropdown', array('In progress' => 'In progress', 'Finished' => 'Finished', 'Delete' => 'Delete')); $output = $crud->render(); $nume = ""; $prenume = ""; // aduc din baza de date prin model tabela pacient if (!empty($_GET["p_id"])) { $result = $this->patient_model->get(['id' => $pid]); $nume = $result[0]['first_name']; $prenume = $result[0]['last_name']; } // extrag din array nume si prenume // trimit prin variabila extra din obiect in view $output->extra = $nume . " " . $prenume; $this->_admin_output($output); }
function patients() { $drp = $this->session->userdata('user_type'); //primesc data din calendar $day_get = $_GET["day"]; // setez data din calendar variabila sesiune // $this->session->set_userdata('data_cal',$_GET['data']); $ids_ui_ses = $this->session->userdata('ids_ui'); $date_cal = array(96, 95, 89); // var_dump($date_cal); // echo "<br>"; // var_dump($ids_ui_ses); // print_r($day_get); //die(); $crud = new grocery_CRUD(); $crud->set_theme('datatables'); //nu merge cu asta //$crud->or_where('productName','Car'); //$id = 95; $crud->set_table('patients'); $crud->set_subject('Patient'); foreach ($ids_ui_ses as $key => $id) { $pat_fup = $this->date_followup($id); $zi_fup = $this->day($pat_fup); // extrag luna si anul din data follow-up-lui pentru cumparare $luna_fup = $this->month($pat_fup); // formatez ziua pentru afisare in calendar $zi_fup = $this->good_day($zi_fup); if ($zi_fup == $day_get) { $crud->or_where('patients.id', $id); } } //$crud->or_where('patients.id', $id); // aici pun filtrele pt admin //$crud->where('admin',1); $crud->display_as('fo_nr', 'Medical Record number'); $crud->field_tip('fo_nr', 'eg: 1234/2016'); $crud->display_as('city', 'City or Locality'); $crud->display_as('gp_phone', 'GP Phone'); $crud->display_as('GP_info', 'Notes'); // User Level Unset if ($drp == "user") { $crud->unset_delete(); $crud->unset_export(); $crud->unset_print(); // afisare fara statistici // data 24.01.2017 $crud->columns('id', 'fo_nr', 'cnp', 'last_name', 'first_name', 'follow_up_date', 'status', 'signature'); } // afisare in admin coloane cu statistici // data 24.01.2017 $crud->columns('id', 'cnp', 'last_name', 'first_name', 'No_of_PCIs', 'Completed_FU_events', 'follow_up_date', 'status', 'signature', 'admin'); $crud->field_tip('cnp', 'Personal ID No.'); $crud->field_tip('gender', 'The gender of the patient'); $crud->field_tip('height', 'Height in cm'); $crud->field_tip('weight', 'Weight in kg'); $crud->required_fields('cnp', 'first_name', 'last_name', 'admin', 'status'); $crud->field_type('gender', 'dropdown', array('Male' => 'Male', 'Female' => 'Female')); $crud->field_type('country', 'dropdown', array('Romania' => 'Romania', 'Other' => 'Other', 'Unknown' => 'Unknown')); $crud->set_relation('county', 'county', 'county'); $crud->set_relation('signature', 'user', 'user_name'); $crud->set_relation('admin', 'user', 'user_name'); $crud->add_action('Interventions', '', '', 'ui-icon-heart', array($this, 'go_intervention')); $crud->add_action('Follow-Up', '', '', 'ui-icon-calculator', array($this, 'go_followup')); $crud->callback_column('follow_up_date', array($this, '_followup')); $crud->callback_column('Completed_FU_events', array($this, '_nofollowup')); $crud->callback_column('No_of_PCIs', array($this, '_nointerv')); /*// log- user activities $crud->callback_after_insert(array($this, 'log_user_after_insert_patient')); $crud->callback_after_update(array($this, 'log_user_after_update_patient')); $crud->callback_after_delete(array($this, 'log_user_after_delete_patient')); */ $crud->unique_fields('cnp'); $crud->field_type('status', 'dropdown', array('New' => 'New', 'In progress' => 'In progress', 'Finished' => 'Finished', 'Delete' => 'Delete')); $crud->unset_add(); $crud->unset_edit(); $crud->unset_delete(); //$extra = "info"; //$output = $crud->render($extra); $output = $crud->render(); // $output->extra = '<h3>Pacient</h3>'; Adauga valori extra pentru view $this->_admin_output($output); }