diff --git a/src/Controller/Reporter/TransfusionsController.php b/src/Controller/Reporter/TransfusionsController.php index 8ea0bd9ff..5f2bbccdf 100755 --- a/src/Controller/Reporter/TransfusionsController.php +++ b/src/Controller/Reporter/TransfusionsController.php @@ -1,4 +1,5 @@ '25', '50' => '50', '100' => '100'); /** * Index method * @@ -20,11 +23,15 @@ class TransfusionsController extends AppController */ public function index() { + $criteria = array(); + $criteria['Transfusions.user_id'] = $this->Auth->user('id'); $this->paginate = [ 'contain' => ['Users', 'Pqmps', 'Counties', 'Designations'], + 'conditions' => $criteria ]; $transfusions = $this->paginate($this->Transfusions); + $this->set('page_options', $this->page_options); $this->set(compact('transfusions')); } @@ -49,23 +56,29 @@ public function view($id = null) * * @return \Cake\Http\Response|null|void Redirects on successful add, renders view otherwise. */ - public function add() + public function add($id=null) { $transfusion = $this->Transfusions->newEmptyEntity(); - if ($this->request->is('post')) { - $transfusion = $this->Transfusions->patchEntity($transfusion, $this->request->getData()); - if ($this->Transfusions->save($transfusion)) { - $this->Flash->success(__('The transfusion has been saved.')); - - return $this->redirect(['action' => 'index']); - } - $this->Flash->error(__('The transfusion could not be saved. Please, try again.')); + $data = [ + 'user_id' => $this->Auth->User('id'), + 'reference_no' => 'new', //'BT/'.date('Y').'/'.$count, + 'report_type' => 'Initial', + 'pqmp_id' => $id, + 'designation_id' => $this->Auth->User('designation_id'), + 'county_id' => $this->Auth->User('county_id'), + 'institution_code' => $this->Auth->User('institution_code'), + 'address' => $this->Auth->User('institution_address'), + 'reporter_name' => $this->Auth->User('name'), + 'reporter_email' => $this->Auth->User('email'), + 'reporter_phone' => $this->Auth->User('phone_no'), + 'contact' => $this->Auth->User('institution_contact'), + 'name_of_institution' => $this->Auth->User('name_of_institution') + ]; + $transfusion = $this->Transfusions->patchEntity($transfusion, $data); + if ($this->Transfusions->save($transfusion)) { + $this->Flash->success(__('The Blood Transfusion Reaction has been saved.')); + $this->redirect(array('action' => 'edit', $transfusion->id)); } - $users = $this->Transfusions->Users->find('list', ['limit' => 200])->all(); - $pqmps = $this->Transfusions->Pqmps->find('list', ['limit' => 200])->all(); - $counties = $this->Transfusions->Counties->find('list', ['limit' => 200])->all(); - $designations = $this->Transfusions->Designations->find('list', ['limit' => 200])->all(); - $this->set(compact('transfusion', 'users', 'pqmps', 'counties', 'designations')); } /** diff --git a/templates/Reporter/Transfusions/index.php b/templates/Reporter/Transfusions/index.php index 92b9d8385..bdd53e6c6 100755 --- a/templates/Reporter/Transfusions/index.php +++ b/templates/Reporter/Transfusions/index.php @@ -1,274 +1,8 @@ $transfusions - */ + $this->assign('TRN', 'active'); ?> -
= $this->Paginator->sort('id') ?> | -= $this->Paginator->sort('user_id') ?> | -= $this->Paginator->sort('pqmp_id') ?> | -= $this->Paginator->sort('transfusion_id') ?> | -= $this->Paginator->sort('reference_no') ?> | -= $this->Paginator->sort('county_id') ?> | -= $this->Paginator->sort('designation_id') ?> | -= $this->Paginator->sort('form_type') ?> | -= $this->Paginator->sort('patient_name') ?> | -= $this->Paginator->sort('gender') ?> | -= $this->Paginator->sort('patient_address') ?> | -= $this->Paginator->sort('patient_phone') ?> | -= $this->Paginator->sort('date_of_birth') ?> | -= $this->Paginator->sort('age_years') ?> | -= $this->Paginator->sort('diagnosis') ?> | -= $this->Paginator->sort('ward') ?> | -= $this->Paginator->sort('pre_hb') ?> | -= $this->Paginator->sort('transfusion_reason') ?> | -= $this->Paginator->sort('obstetric_history') ?> | -= $this->Paginator->sort('previous_transfusion') ?> | -= $this->Paginator->sort('previous_reactions') ?> | -= $this->Paginator->sort('reaction_general') ?> | -= $this->Paginator->sort('reaction_fever') ?> | -= $this->Paginator->sort('reaction_chills') ?> | -= $this->Paginator->sort('reaction_flushing') ?> | -= $this->Paginator->sort('reaction_vomiting') ?> | -= $this->Paginator->sort('reaction_dermatological') ?> | -= $this->Paginator->sort('reaction_cardiac') ?> | -= $this->Paginator->sort('reaction_chest') ?> | -= $this->Paginator->sort('reaction_dyspnoea') ?> | -= $this->Paginator->sort('reaction_hypotension') ?> | -= $this->Paginator->sort('reaction_tachycardia') ?> | -= $this->Paginator->sort('reaction_renal') ?> | -= $this->Paginator->sort('reaction_anuria') ?> | -= $this->Paginator->sort('reaction_oliguria') ?> | -= $this->Paginator->sort('reaction_dark') ?> | -= $this->Paginator->sort('reaction_haematological') ?> | -= $this->Paginator->sort('vital_start_bp') ?> | -= $this->Paginator->sort('vital_start_t') ?> | -= $this->Paginator->sort('vital_start_p') ?> | -= $this->Paginator->sort('vital_start_r') ?> | -= $this->Paginator->sort('vital_during_bp') ?> | -= $this->Paginator->sort('vital_during_t') ?> | -= $this->Paginator->sort('vital_during_p') ?> | -= $this->Paginator->sort('vital_during_r') ?> | -= $this->Paginator->sort('vital_stop_bp') ?> | -= $this->Paginator->sort('vital_stop_t') ?> | -= $this->Paginator->sort('vital_stop_p') ?> | -= $this->Paginator->sort('vital_stop_r') ?> | -= $this->Paginator->sort('nurse_name') ?> | -= $this->Paginator->sort('lab_hemolysis') ?> | -= $this->Paginator->sort('lab_hemolysis_present') ?> | -= $this->Paginator->sort('recipient_blood') ?> | -= $this->Paginator->sort('hae_wbc') ?> | -= $this->Paginator->sort('hae_hb') ?> | -= $this->Paginator->sort('hae_rbc') ?> | -= $this->Paginator->sort('hae_hct') ?> | -= $this->Paginator->sort('hae_mcv') ?> | -= $this->Paginator->sort('hae_mch') ?> | -= $this->Paginator->sort('hae_mchc') ?> | -= $this->Paginator->sort('hae_plt') ?> | -= $this->Paginator->sort('film_rbc') ?> | -= $this->Paginator->sort('film_wbc') ?> | -= $this->Paginator->sort('film_plt') ?> | -= $this->Paginator->sort('donor_hemolysis') ?> | -= $this->Paginator->sort('donor_age') ?> | -= $this->Paginator->sort('compatible_saline_rt') ?> | -= $this->Paginator->sort('compatible_saline_ii') ?> | -= $this->Paginator->sort('compatible_ahg') ?> | -= $this->Paginator->sort('compatible_albumin') ?> | -= $this->Paginator->sort('anti_a') ?> | -= $this->Paginator->sort('anti_b') ?> | -= $this->Paginator->sort('urinalysis') ?> | -= $this->Paginator->sort('evaluation') ?> | -= $this->Paginator->sort('adverse_reaction') ?> | -= $this->Paginator->sort('reporter_name') ?> | -= $this->Paginator->sort('reporter_email') ?> | -= $this->Paginator->sort('reporter_phone') ?> | -= $this->Paginator->sort('report_type') ?> | -= $this->Paginator->sort('submitted') ?> | -= $this->Paginator->sort('submitted_date') ?> | -= $this->Paginator->sort('copied') ?> | -= $this->Paginator->sort('archived') ?> | -= $this->Paginator->sort('archived_date') ?> | -= $this->Paginator->sort('active') ?> | -= $this->Paginator->sort('created') ?> | -= $this->Paginator->sort('modified') ?> | -= $this->Paginator->sort('reporter_date') ?> | -= $this->Paginator->sort('person_submitting') ?> | -= $this->Paginator->sort('reporter_name_diff') ?> | -= $this->Paginator->sort('reporter_designation_diff') ?> | -= $this->Paginator->sort('reporter_email_diff') ?> | -= $this->Paginator->sort('reporter_phone_diff') ?> | -= $this->Paginator->sort('reporter_date_diff') ?> | -= $this->Paginator->sort('assigned_to') ?> | -= $this->Paginator->sort('assigned_by') ?> | -= $this->Paginator->sort('assigned_date') ?> | -= $this->Paginator->sort('clinic_venue') ?> | -= $this->Paginator->sort('specimens_post_transfusion') ?> | -= $this->Paginator->sort('specimens_edta_blood') ?> | -= $this->Paginator->sort('specimens_void_urine') ?> | -= $this->Paginator->sort('specimens_blood_reacted') ?> | -= $this->Paginator->sort('specimens_blood_bags') ?> | -= $this->Paginator->sort('clinic_code') ?> | -= $this->Paginator->sort('donor_number') ?> | -= $this->Paginator->sort('national_number') ?> | -= $this->Paginator->sort('home_phone') ?> | -= $this->Paginator->sort('cell_phone') ?> | -= $this->Paginator->sort('email_address') ?> | -= $this->Paginator->sort('residence') ?> | -= $this->Paginator->sort('nurse_date') ?> | -= $this->Paginator->sort('low_volume') ?> | -= $this->Paginator->sort('venepuncture') ?> | -= $this->Paginator->sort('hematoma') ?> | -= $this->Paginator->sort('faint') ?> | -= $this->Paginator->sort('deleted') ?> | -= $this->Paginator->sort('deleted_date') ?> | -= __('Actions') ?> | -
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
= $this->Number->format($transfusion->id) ?> | -= $transfusion->has('user') ? $this->Html->link($transfusion->user->name, ['controller' => 'Users', 'action' => 'view', $transfusion->user->id]) : '' ?> | -= $transfusion->has('pqmp') ? $this->Html->link($transfusion->pqmp->id, ['controller' => 'Pqmps', 'action' => 'view', $transfusion->pqmp->id]) : '' ?> | -= $transfusion->transfusion_id === null ? '' : $this->Number->format($transfusion->transfusion_id) ?> | -= h($transfusion->reference_no) ?> | -= $transfusion->has('county') ? $this->Html->link($transfusion->county->id, ['controller' => 'Counties', 'action' => 'view', $transfusion->county->id]) : '' ?> | -= $transfusion->has('designation') ? $this->Html->link($transfusion->designation->name, ['controller' => 'Designations', 'action' => 'view', $transfusion->designation->id]) : '' ?> | -= h($transfusion->form_type) ?> | -= h($transfusion->patient_name) ?> | -= h($transfusion->gender) ?> | -= h($transfusion->patient_address) ?> | -= h($transfusion->patient_phone) ?> | -= h($transfusion->date_of_birth) ?> | -= h($transfusion->age_years) ?> | -= h($transfusion->diagnosis) ?> | -= h($transfusion->ward) ?> | -= h($transfusion->pre_hb) ?> | -= h($transfusion->transfusion_reason) ?> | -= h($transfusion->obstetric_history) ?> | -= h($transfusion->previous_transfusion) ?> | -= h($transfusion->previous_reactions) ?> | -= h($transfusion->reaction_general) ?> | -= h($transfusion->reaction_fever) ?> | -= h($transfusion->reaction_chills) ?> | -= h($transfusion->reaction_flushing) ?> | -= h($transfusion->reaction_vomiting) ?> | -= h($transfusion->reaction_dermatological) ?> | -= h($transfusion->reaction_cardiac) ?> | -= h($transfusion->reaction_chest) ?> | -= h($transfusion->reaction_dyspnoea) ?> | -= h($transfusion->reaction_hypotension) ?> | -= h($transfusion->reaction_tachycardia) ?> | -= h($transfusion->reaction_renal) ?> | -= h($transfusion->reaction_anuria) ?> | -= h($transfusion->reaction_oliguria) ?> | -= h($transfusion->reaction_dark) ?> | -= h($transfusion->reaction_haematological) ?> | -= h($transfusion->vital_start_bp) ?> | -= h($transfusion->vital_start_t) ?> | -= h($transfusion->vital_start_p) ?> | -= h($transfusion->vital_start_r) ?> | -= h($transfusion->vital_during_bp) ?> | -= h($transfusion->vital_during_t) ?> | -= h($transfusion->vital_during_p) ?> | -= h($transfusion->vital_during_r) ?> | -= h($transfusion->vital_stop_bp) ?> | -= h($transfusion->vital_stop_t) ?> | -= h($transfusion->vital_stop_p) ?> | -= h($transfusion->vital_stop_r) ?> | -= h($transfusion->nurse_name) ?> | -= h($transfusion->lab_hemolysis) ?> | -= h($transfusion->lab_hemolysis_present) ?> | -= h($transfusion->recipient_blood) ?> | -= h($transfusion->hae_wbc) ?> | -= h($transfusion->hae_hb) ?> | -= h($transfusion->hae_rbc) ?> | -= h($transfusion->hae_hct) ?> | -= h($transfusion->hae_mcv) ?> | -= h($transfusion->hae_mch) ?> | -= h($transfusion->hae_mchc) ?> | -= h($transfusion->hae_plt) ?> | -= h($transfusion->film_rbc) ?> | -= h($transfusion->film_wbc) ?> | -= h($transfusion->film_plt) ?> | -= h($transfusion->donor_hemolysis) ?> | -= h($transfusion->donor_age) ?> | -= h($transfusion->compatible_saline_rt) ?> | -= h($transfusion->compatible_saline_ii) ?> | -= h($transfusion->compatible_ahg) ?> | -= h($transfusion->compatible_albumin) ?> | -= h($transfusion->anti_a) ?> | -= h($transfusion->anti_b) ?> | -= h($transfusion->urinalysis) ?> | -= h($transfusion->evaluation) ?> | -= h($transfusion->adverse_reaction) ?> | -= h($transfusion->reporter_name) ?> | -= h($transfusion->reporter_email) ?> | -= h($transfusion->reporter_phone) ?> | -= h($transfusion->report_type) ?> | -= $transfusion->submitted === null ? '' : $this->Number->format($transfusion->submitted) ?> | -= h($transfusion->submitted_date) ?> | -= $transfusion->copied === null ? '' : $this->Number->format($transfusion->copied) ?> | -= $transfusion->archived === null ? '' : $this->Number->format($transfusion->archived) ?> | -= h($transfusion->archived_date) ?> | -= h($transfusion->active) ?> | -= h($transfusion->created) ?> | -= h($transfusion->modified) ?> | -= h($transfusion->reporter_date) ?> | -= h($transfusion->person_submitting) ?> | -= h($transfusion->reporter_name_diff) ?> | -= $transfusion->reporter_designation_diff === null ? '' : $this->Number->format($transfusion->reporter_designation_diff) ?> | -= h($transfusion->reporter_email_diff) ?> | -= h($transfusion->reporter_phone_diff) ?> | -= h($transfusion->reporter_date_diff) ?> | -= $transfusion->assigned_to === null ? '' : $this->Number->format($transfusion->assigned_to) ?> | -= $transfusion->assigned_by === null ? '' : $this->Number->format($transfusion->assigned_by) ?> | -= h($transfusion->assigned_date) ?> | -= h($transfusion->clinic_venue) ?> | -= $transfusion->specimens_post_transfusion === null ? '' : $this->Number->format($transfusion->specimens_post_transfusion) ?> | -= $transfusion->specimens_edta_blood === null ? '' : $this->Number->format($transfusion->specimens_edta_blood) ?> | -= $transfusion->specimens_void_urine === null ? '' : $this->Number->format($transfusion->specimens_void_urine) ?> | -= $transfusion->specimens_blood_reacted === null ? '' : $this->Number->format($transfusion->specimens_blood_reacted) ?> | -= $transfusion->specimens_blood_bags === null ? '' : $this->Number->format($transfusion->specimens_blood_bags) ?> | -= h($transfusion->clinic_code) ?> | -= h($transfusion->donor_number) ?> | -= h($transfusion->national_number) ?> | -= h($transfusion->home_phone) ?> | -= h($transfusion->cell_phone) ?> | -= h($transfusion->email_address) ?> | -= h($transfusion->residence) ?> | -= h($transfusion->nurse_date) ?> | -= h($transfusion->low_volume) ?> | -= h($transfusion->venepuncture) ?> | -= h($transfusion->hematoma) ?> | -= h($transfusion->faint) ?> | -= $transfusion->deleted === null ? '' : $this->Number->format($transfusion->deleted) ?> | -= h($transfusion->deleted_date) ?> | -- = $this->Html->link(__('View'), ['action' => 'view', $transfusion->id]) ?> - = $this->Html->link(__('Edit'), ['action' => 'edit', $transfusion->id]) ?> - = $this->Form->postLink(__('Delete'), ['action' => 'delete', $transfusion->id], ['confirm' => __('Are you sure you want to delete # {0}?', $transfusion->id)]) ?> - | -
= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?>
-+ Form->control( + 'reference_no', + array( + 'div' => false, + 'placeholder' => 'trn/2020', + 'class' => 'span12', 'label' => array('class' => 'required', 'text' => 'Reference No.') + ) + ); + ?> + | ++ Form->control( + 'diagnosis', + array( + 'div' => false, + 'placeholder' => 'diagnosis', + 'class' => 'unauthorized_index span10', 'label' => array('class' => 'required', 'text' => 'Diagnosis') + ) + ); + ?> + | ++ Form->control( + 'start_date', + array( + 'div' => false, 'type' => 'text', 'class' => 'control-small unauthorized_index', 'after' => '-to-', + 'label' => array('class' => 'required', 'text' => 'Report Dates'), 'placeHolder' => 'Start Date' + ) + ); + echo $this->Form->control( + 'end_date', + array( + 'div' => false, 'type' => 'text', 'class' => 'control-small unauthorized_index', + 'after' => ' + clear!', + 'label' => false, 'placeHolder' => 'End Date' + ) + ); + ?> + | +
+ Previous transfusion+ Form->control('previous_transfusion', array( + 'options' => array('Yes' => 'Yes', 'No' => 'No'), 'legend' => false, + 'type' => 'radio' + )); + ?> + |
+
+ Previous reactions?+ Form->control('previous_reactions', array( + 'options' => array('Yes' => 'Yes', 'No' => 'No'), 'legend' => false, + 'type' => 'radio' + )); + ?> + |
+ + Form->control( + 'ward', + array( + 'div' => false, + 'placeholder' => 'ward', + 'class' => 'control-small', 'label' => array('class' => 'required', 'text' => 'Ward') + ) + ); + ?> + | +|
+ Form->control('reaction_general', array( + 'type' => 'select', + 'empty' => true, 'class' => 'span12', + 'options' => array( + 'Fever' => 'Fever', + 'Chills/Rigors' => 'Chills/Rigors', + 'Flushing' => 'Flushing', + 'Nausea/ Vomiting' => 'Nausea/ Vomiting' + ), + 'label' => array('class' => 'required', 'text' => 'General') + )); + ?> + | ++ Form->control('reaction_dermatological', array( + 'type' => 'select', + 'empty' => true, 'class' => 'control-small', + 'options' => array( + 'Urticaria' => 'Urticaria', + 'Other skin rash' => 'Other skin rash' + ), + 'label' => array('class' => 'required', 'text' => 'Dermatological') + )); + ?> + | ++ Form->control('reaction_cardiac', array( + 'type' => 'select', + 'empty' => true, 'class' => 'control-small', + 'options' => array( + 'Chest pain' => 'Chest pain', + 'Dyspnoea' => 'Dyspnoea', + 'Hypotension' => 'Hypotension', + 'Tachycardia' => 'Tachycardia' + ), + 'label' => array('class' => 'required', 'text' => 'Cardiac/Respiratory') + )); + ?> + | ++ Form->control('reaction_renal', array( + 'type' => 'select', + 'empty' => true, 'class' => 'control-small', + 'options' => array( + 'Haemoglobinuria- Dark urine' => 'Haemoglobinuria- Dark urine', + 'Oliguria' => 'Oliguria', + 'Anuria' => 'Anuria' + ), + 'label' => array('class' => 'required', 'text' => 'Renal') + )); + ?> + | +
+ Task and technology+ Form->control('reaction_haematological', array( + 'type' => 'select', + 'empty' => true, 'class' => 'control-small', + 'options' => array( + 'Unexplained bleeding' => 'Unexplained bleeding' + ), + 'label' => array('class' => 'required', 'text' => 'Renal') + )); + ?> + |
+ + Form->control('lab_hemolysis', array( + 'type' => 'select', + 'empty' => true, 'class' => 'control-small', + 'options' => array( + 'Present' => 'Present', + 'Absent' => 'Absent', + 'Equivocal' => 'Equivocal' + ), + 'label' => array('class' => 'required', 'text' => 'Hemolysis') + )); + ?> + | ++ Form->control('lab_hemolysis_present', array( + 'type' => 'select', + 'empty' => true, 'class' => 'control-small', + 'options' => array( + 'Mild' => 'Mild', + 'Moderate' => 'Moderate', + 'Marked' => 'Marked' + ), + 'label' => array('class' => 'required', 'text' => 'Supernatant: if present') + )); + ?> + | +
+ Form->control('recipient_blood', array( + 'type' => 'select', + 'empty' => true, 'class' => 'control', + 'options' => array( + 'Present' => 'Present', + 'Absent' => 'Absent' + ), + 'label' => array('class' => 'required', 'text' => 'Recipient: Agglutination') + )); + ?> + | ++ Form->control('donor_hemolysis', array( + 'type' => 'select', + 'empty' => true, 'class' => 'control-small', + 'options' => array( + 'Present' => 'Present', + 'Absent' => 'Absent' + ), + 'label' => array('class' => 'required', 'text' => 'Donor: Agglutination') + )); + ?> + | ++ Form->control( + 'component', + array( + 'div' => false, + 'placeholder' => 'component', + 'class' => 'control-small', 'label' => array('class' => 'required', 'text' => 'Component') + ) + ); + ?> + | ++ Form->control( + 'patient_name', + array( + 'div' => false, 'placeholder' => 'Patient name', + 'class' => 'span12 unauthorized_index', 'label' => array('class' => 'required', 'text' => 'Patient Name') + ) + ); + + ?> + | ++ Form->control( + 'reporter', + array('div' => false, 'class' => 'span12 unauthorized_index', 'label' => array('class' => 'required', 'text' => 'Reporter'), 'placeholder' => 'Name/Email') + ); + ?> + | ++ Form->control( + 'designation_id', + array( + 'div' => false, 'empty' => true, + 'class' => 'control-small', 'label' => array('class' => 'required', 'text' => 'Designation') + ) + ); + ?> + | +
+ Gender+ Form->control('gender', array( + 'options' => array('Male' => 'Male', 'Female' => 'Female'), 'legend' => false, + 'type' => 'radio' + )); + ?> + |
+
+ Form->control('submitted', array( + 'type' => 'select', + 'empty' => true, + 'options' => array( + '0' => 'Submitted', + '1' => 'Unsubmitted' + ), + 'label' => array('class' => 'required', 'text' => 'Report Status') + )); + ?> + | ++ Form->control('sending_device', array( + 'type' => 'select', 'options' => [ + '1' => 'Web', + '2' => 'Mobile', + ], 'empty' => true, + 'label' => array('class' => 'control-label', 'text' => 'Sending Device'), + 'class' => 'control-xlarge' + )); ?> + | +Form->control('mah', array( + 'type' => 'select', + 'options' => [ + '0' => 'MAH', + '1' => 'Non MAH', + ], + 'empty' => true, + 'label' => array('class' => 'control-label', 'text' => 'Reporter Role'), + 'class' => 'control-xlarge' + )); + ?> | ++ | + | + | + + + | + | + Form->control('pages', array( + 'type' => 'select', 'div' => false, 'class' => 'control-small', + // 'selected' => $this->request->params['paging']['limit'], + 'empty' => true, + 'options' => $page_options, + 'label' => false, + )); + ?> + | ++ + | ++ | + Form->button(' Search', array( + 'class' => 'btn btn-primary', 'div' => 'control-group', 'div' => false, + 'formnovalidate' => 'formnovalidate', + 'escapeTitle'=>false, + 'style' => array('margin-bottom: 5px') + )); + ?> + | ++ Html->link(' Clear', array('action' => 'index'), array('class' => 'btn', 'escape' => false, 'style' => array('margin-bottom: 5px'))); + ?> + | ++ Html->link(' Excel', array('action' => 'index', 'ext' => 'csv', '?' => $this->request->query), array('class' => 'btn btn-success', 'escape' => false)); + ?> + | + + +
+ + Paginator->counter( + __('Page {{page}} of {{pages}}, +showing {{current}} Blood Transfussions out of {{count}} total, starting on record {{start}}, +ending on {{end}}') +); +?> + +
+Form->end(); ?> +Paginator->sort('id'); ?> | +Paginator->sort('reference_no'); ?> | +Paginator->sort('patient_name'); ?> | +Paginator->sort('reporter_date', 'Date reported'); ?> | +Paginator->sort('created', 'Date created'); ?> | +Paginator->sort('submitted_date', 'Date Submitted'); ?> | ++ |
---|---|---|---|---|---|---|
+ | + 1) { + echo $this->Html->link($transfusion['reference_no'], array('action' => 'view', $transfusion['id']), array('escape' => false)); + } else { + echo $this->Html->link($transfusion['reference_no'], array('action' => (($prefix == 'reporter') ? 'edit' : 'view'), $transfusion['id']), array('escape' => false)); + } + ?> + | ++ | + | + | + | + 1) { + echo $this->Html->link( + ' View ', + array('controller' => 'transfusions', 'action' => 'view', $transfusion['id']), + array('escape' => false) + ); + echo " "; + if ($prefix == 'reporter') echo $this->Form->postLink(' Followup ', array('controller' => 'transfusions', 'action' => 'followup', $transfusion['id']), array('escape' => false), __('Add a followup report?')); + echo " "; + if (($prefix == 'manager' || $prefix == 'reviewer') && $transfusion['copied'] == 2) echo $this->Html->link( + ' Edit ', + array('controller' => 'transfusions', 'action' => 'edit', $transfusion['id']), + array('escape' => false) + ); + echo " "; + if (($prefix == 'manager' || $prefix == 'reviewer') && $transfusion['copied'] == 0) echo $this->Form->postLink(' Copy ', array('controller' => 'transfusions', 'action' => 'copy', $transfusion['id']), array('escape' => false), __('Create a clean copy to edit?')); + + if (($prefix == 'manager' || $prefix == 'reviewer')) echo $this->Html->link( + ' Archive ', + array('controller' => 'transfusions', 'action' => 'archive', $transfusion['id']), + array('escape' => false), + __('Are you sure you want to archive the report?') + ); + } else { + if ($prefix == 'reporter') echo $this->Html->link( + ' Edit ', + array('controller' => 'transfusions', 'action' => 'edit', $transfusion['id']), + array('escape' => false) + ); + } + echo " "; + echo $this->Html->link( + ' PDF ', + array('action' => 'view', 'ext' => 'pdf', $transfusion['id']), + array('escape' => false) + ); + echo " "; + + // check if report has not been submitted and user is reporter + + if (($prefix == 'reporter' || $prefix == 'manager') && $transfusion['submitted'] == 0 && $this->request->getSession()->read('Auth.User.user_type') != 'Public Health Program') { + echo $this->Form->postLink(' Delete ', array('controller' => 'transfusions', 'action' => 'delete', $transfusion['id']), array('escape' => false), __('Are you sure you want to delete # %s?', $transfusion['id'] . '? + Note: This action cannot be undone.')); + } + + ?> + | +