From dfed5615f5c26004082d24cafe5f18c086064af6 Mon Sep 17 00:00:00 2001 From: itskiprotich Date: Thu, 8 Aug 2024 13:23:41 +0300 Subject: [PATCH] UPD: padrs reports done --- src/Controller/Manager/SadrsController.php | 23 +- src/Controller/PadrsController.php | 45 +- src/Model/Table/NotificationsTable.php | 25 + src/Model/Table/PadrListOfMedicinesTable.php | 6 + src/Model/Table/PadrsTable.php | 2 + templates/Manager/Sadrs/index.php | 205 +----- templates/Padrs/add.php | 117 +--- templates/Padrs/view.php | 604 +--------------- templates/Sadrs/index.php | 202 ------ templates/element/multi/attachments.php | 75 ++ .../element/multi/padr_list_of_medicines.php | 137 ++++ templates/element/padr/padr_edit.php | 653 ++++++++++++++++++ templates/element/padr/padr_view.php | 246 +++++++ webroot/js/padr.js | 35 +- webroot/js/padr_list_of_medicines.js | 143 ++-- 15 files changed, 1345 insertions(+), 1173 deletions(-) create mode 100644 templates/element/multi/attachments.php create mode 100644 templates/element/multi/padr_list_of_medicines.php create mode 100644 templates/element/padr/padr_edit.php create mode 100644 templates/element/padr/padr_view.php diff --git a/src/Controller/Manager/SadrsController.php b/src/Controller/Manager/SadrsController.php index 855332b3d6..e9ba7d6253 100755 --- a/src/Controller/Manager/SadrsController.php +++ b/src/Controller/Manager/SadrsController.php @@ -1,4 +1,5 @@ '25', '50' => '50', '100' => '100'); /** * Index method * * @return \Cake\Http\Response|null|void Renders view */ + public function index() - { + { + $criteria = array(); + $criteria['Sadrs.deleted'] = false; + $criteria['Sadrs.archived'] = false; + $criteria['Sadrs.submitted'] = 2; + $criteria['Sadrs.copied !='] = '1'; $this->paginate = [ - 'contain' => ['Users', 'Pqmps', 'Medications', 'Counties', 'SubCounties', 'Designations'], - ]; - $sadrs = $this->paginate($this->Sadrs); - - $this->set(compact('sadrs')); + 'contain' => array('Users', 'Pqmps', 'Medications', 'Counties', 'SubCounties', 'Designations'), + 'conditions' => $criteria + ]; + $this->set('sadrs', $this->paginate()); + $this->set('page_options', $this->page_options); } + /** * View method * diff --git a/src/Controller/PadrsController.php b/src/Controller/PadrsController.php index 424a7df317..158615896e 100755 --- a/src/Controller/PadrsController.php +++ b/src/Controller/PadrsController.php @@ -1,8 +1,12 @@ loadComponent('Paginator'); + $this->Auth->allow('add'); + } + public function beforeFilter(EventInterface $event): void + { + parent::beforeFilter($event); + $this->Auth->allow([ + 'add','view' + ]); + } /** * Index method * @@ -38,7 +57,7 @@ public function view($id = null) $padr = $this->Padrs->get($id, [ 'contain' => ['Users', 'Counties', 'SubCounties', 'Designations', 'Padrs', 'PadrListOfMedicines'], ]); - +// $this->set(compact('padr')); } @@ -50,13 +69,31 @@ public function view($id = null) public function add() { $padr = $this->Padrs->newEmptyEntity(); - if ($this->request->is('post')) { - $padr = $this->Padrs->patchEntity($padr, $this->request->getData()); + if ($this->request->is('post')) { + // debug($this->request->getData()); + // exit; + $padr = $this->Padrs->patchEntity($padr, $this->request->getData(), [ + 'associated' => ['PadrListOfMedicines'] + ]); if ($this->Padrs->save($padr)) { + + $token = Security::hash(strval($padr['id'])); + $dataTable = $this->getTableLocator()->get('padrs'); + // Update the field using the query builder + $result = $dataTable->query() + ->update() + ->set(['token' => $token]) + ->where(['id' => $padr['id']]) + ->execute(); + $this->Flash->success(__('The padr has been saved.')); - return $this->redirect(['action' => 'index']); + return $this->redirect(['action' => 'view',$padr['id']]); } + // $errors = $padr->getErrors(); + // debug($this->request->getData()); + // debug($errors); + // exit; $this->Flash->error(__('The padr could not be saved. Please, try again.')); } $users = $this->Padrs->Users->find('list', ['limit' => 200])->all(); diff --git a/src/Model/Table/NotificationsTable.php b/src/Model/Table/NotificationsTable.php index 6e806be06c..9f7f73d946 100755 --- a/src/Model/Table/NotificationsTable.php +++ b/src/Model/Table/NotificationsTable.php @@ -120,4 +120,29 @@ public function buildRules(RulesChecker $rules): RulesChecker return $rules; } + + + + public function filter(Query $query, array $filters): Query + { + if (!empty($filters['start_date'])) { + $startDate = \DateTime::createFromFormat('d-m-Y', $filters['start_date']); + if ($startDate) { + $query = $query->where(['Notifications.created >= ' => $startDate->format('Y-m-d')]); + } + } + + if (!empty($filters['end_date'])) { + $endDate = \DateTime::createFromFormat('d-m-Y', $filters['end_date']); + if ($endDate) { + $query = $query->where(['Notifications.created <= ' => $endDate->format('Y-m-d')]); + } + } + + if (!empty($filters['user_id'])) { + $query = $query->where(['Notifications.user_id' => $filters['user_id']]); + } + + return $query; + } } diff --git a/src/Model/Table/PadrListOfMedicinesTable.php b/src/Model/Table/PadrListOfMedicinesTable.php index 027c6eb1a1..742d49593e 100755 --- a/src/Model/Table/PadrListOfMedicinesTable.php +++ b/src/Model/Table/PadrListOfMedicinesTable.php @@ -1,12 +1,17 @@ hasMany('PadrListOfMedicines', [ 'foreignKey' => 'padr_id', + 'cascadeCallbacks' => true, ]); $this->hasMany('Padrs', [ 'foreignKey' => 'padr_id', + 'cascadeCallbacks' => true, ]); } diff --git a/templates/Manager/Sadrs/index.php b/templates/Manager/Sadrs/index.php index 18a2f4e856..126f4590b1 100755 --- a/templates/Manager/Sadrs/index.php +++ b/templates/Manager/Sadrs/index.php @@ -1,202 +1,7 @@ $sadrs - */ + $this->assign('SADR', 'active'); + echo $this->element('sadr/sadr_index'); + // $this->extend('sadr/sadr_index'); ?> -
- Html->link(__('New Sadr'), ['action' => 'add'], ['class' => 'button float-right']) ?> -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Paginator->sort('id') ?>Paginator->sort('sadr_id') ?>Paginator->sort('user_id') ?>Paginator->sort('pqmp_id') ?>Paginator->sort('medication_id') ?>Paginator->sort('county_id') ?>Paginator->sort('sub_county_id') ?>Paginator->sort('designation_id') ?>Paginator->sort('reference_no') ?>Paginator->sort('vigiflow_id') ?>Paginator->sort('report_title') ?>Paginator->sort('report_type') ?>Paginator->sort('report_sadr') ?>Paginator->sort('report_therapeutic') ?>Paginator->sort('report_misuse') ?>Paginator->sort('report_off_label') ?>Paginator->sort('product_category') ?>Paginator->sort('medicinal_product') ?>Paginator->sort('blood_products') ?>Paginator->sort('herbal_product') ?>Paginator->sort('cosmeceuticals') ?>Paginator->sort('product_other') ?>Paginator->sort('product_specify') ?>Paginator->sort('name_of_institution') ?>Paginator->sort('institution_code') ?>Paginator->sort('address') ?>Paginator->sort('contact') ?>Paginator->sort('patient_name') ?>Paginator->sort('ip_no') ?>Paginator->sort('date_of_birth') ?>Paginator->sort('age_group') ?>Paginator->sort('patient_address') ?>Paginator->sort('ward') ?>Paginator->sort('gender') ?>Paginator->sort('known_allergy') ?>Paginator->sort('known_allergy_specify') ?>Paginator->sort('pregnant') ?>Paginator->sort('pregnancy_status') ?>Paginator->sort('weight') ?>Paginator->sort('height') ?>Paginator->sort('reaction') ?>Paginator->sort('date_of_onset_of_reaction') ?>Paginator->sort('reaction_resolve') ?>Paginator->sort('reaction_reappear') ?>Paginator->sort('severity') ?>Paginator->sort('serious') ?>Paginator->sort('serious_reason') ?>Paginator->sort('action_taken') ?>Paginator->sort('outcome') ?>Paginator->sort('causality') ?>Paginator->sort('reporter_name') ?>Paginator->sort('reporter_email') ?>Paginator->sort('reporter_phone') ?>Paginator->sort('submitted') ?>Paginator->sort('emails') ?>Paginator->sort('active') ?>Paginator->sort('device') ?>Paginator->sort('deleted') ?>Paginator->sort('archived') ?>Paginator->sort('archived_date') ?>Paginator->sort('deleted_date') ?>Paginator->sort('notified') ?>Paginator->sort('created') ?>Paginator->sort('modified') ?>Paginator->sort('reporter_date') ?>Paginator->sort('person_submitting') ?>Paginator->sort('reporter_name_diff') ?>Paginator->sort('reporter_designation_diff') ?>Paginator->sort('reporter_email_diff') ?>Paginator->sort('reporter_phone_diff') ?>Paginator->sort('reporter_date_diff') ?>Paginator->sort('assigned_to') ?>Paginator->sort('assigned_by') ?>Paginator->sort('assigned_date') ?>Paginator->sort('vigiflow_ref') ?>Paginator->sort('vigiflow_date') ?>Paginator->sort('webradr_ref') ?>Paginator->sort('webradr_date') ?>Paginator->sort('submitted_date') ?>Paginator->sort('webradr_message') ?>Paginator->sort('copied') ?>
Number->format($sadr->id) ?>sadr_id === null ? '' : $this->Number->format($sadr->sadr_id) ?>has('user') ? $this->Html->link($sadr->user->name, ['controller' => 'Users', 'action' => 'view', $sadr->user->id]) : '' ?>has('pqmp') ? $this->Html->link($sadr->pqmp->id, ['controller' => 'Pqmps', 'action' => 'view', $sadr->pqmp->id]) : '' ?>has('medication') ? $this->Html->link($sadr->medication->id, ['controller' => 'Medications', 'action' => 'view', $sadr->medication->id]) : '' ?>has('county') ? $this->Html->link($sadr->county->id, ['controller' => 'Counties', 'action' => 'view', $sadr->county->id]) : '' ?>has('sub_county') ? $this->Html->link($sadr->sub_county->id, ['controller' => 'SubCounties', 'action' => 'view', $sadr->sub_county->id]) : '' ?>has('designation') ? $this->Html->link($sadr->designation->name, ['controller' => 'Designations', 'action' => 'view', $sadr->designation->id]) : '' ?>reference_no) ?>vigiflow_id) ?>report_title) ?>report_type) ?>report_sadr) ?>report_therapeutic) ?>report_misuse === null ? '' : $this->Number->format($sadr->report_misuse) ?>report_off_label === null ? '' : $this->Number->format($sadr->report_off_label) ?>product_category) ?>medicinal_product) ?>blood_products) ?>herbal_product) ?>cosmeceuticals) ?>product_other) ?>product_specify) ?>name_of_institution) ?>institution_code) ?>address) ?>contact) ?>patient_name) ?>ip_no) ?>date_of_birth) ?>age_group) ?>patient_address) ?>ward) ?>gender) ?>known_allergy) ?>known_allergy_specify) ?>pregnant) ?>pregnancy_status) ?>weight) ?>height) ?>reaction) ?>date_of_onset_of_reaction) ?>reaction_resolve) ?>reaction_reappear) ?>severity) ?>serious) ?>serious_reason) ?>action_taken) ?>outcome) ?>causality) ?>reporter_name) ?>reporter_email) ?>reporter_phone) ?>submitted === null ? '' : $this->Number->format($sadr->submitted) ?>emails === null ? '' : $this->Number->format($sadr->emails) ?>active) ?>device === null ? '' : $this->Number->format($sadr->device) ?>deleted) ?>archived) ?>archived_date) ?>deleted_date) ?>notified === null ? '' : $this->Number->format($sadr->notified) ?>created) ?>modified) ?>reporter_date) ?>person_submitting) ?>reporter_name_diff) ?>reporter_designation_diff === null ? '' : $this->Number->format($sadr->reporter_designation_diff) ?>reporter_email_diff) ?>reporter_phone_diff) ?>reporter_date_diff) ?>assigned_to === null ? '' : $this->Number->format($sadr->assigned_to) ?>assigned_by === null ? '' : $this->Number->format($sadr->assigned_by) ?>assigned_date) ?>vigiflow_ref) ?>vigiflow_date) ?>webradr_ref) ?>webradr_date) ?>submitted_date) ?>webradr_message) ?>copied === null ? '' : $this->Number->format($sadr->copied) ?> - Html->link(__('View'), ['action' => 'view', $sadr->id]) ?> - Html->link(__('Edit'), ['action' => 'edit', $sadr->id]) ?> - Form->postLink(__('Delete'), ['action' => 'delete', $sadr->id], ['confirm' => __('Are you sure you want to delete # {0}?', $sadr->id)]) ?> -
-
-
-
    - Paginator->first('<< ' . __('first')) ?> - Paginator->prev('< ' . __('previous')) ?> - Paginator->numbers() ?> - Paginator->next(__('next') . ' >') ?> - Paginator->last(__('last') . ' >>') ?> -
-

Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?>

-
-
+ + diff --git a/templates/Padrs/add.php b/templates/Padrs/add.php index 41b2053d0a..3e6fd2b05a 100755 --- a/templates/Padrs/add.php +++ b/templates/Padrs/add.php @@ -1,108 +1,15 @@ assign('PADR', 'active'); ?> -
- -
-
- Form->create($padr) ?> -
- - Form->control('padr_id'); - echo $this->Form->control('user_id', ['options' => $users, 'empty' => true]); - echo $this->Form->control('county_id', ['options' => $counties, 'empty' => true]); - echo $this->Form->control('sub_county_id', ['options' => $subCounties, 'empty' => true]); - echo $this->Form->control('designation_id', ['options' => $designations, 'empty' => true]); - echo $this->Form->control('reference_no'); - echo $this->Form->control('token'); - echo $this->Form->control('relation'); - echo $this->Form->control('vigiflow_ref'); - echo $this->Form->control('vigiflow_message'); - echo $this->Form->control('vigiflow_date'); - echo $this->Form->control('report_title'); - echo $this->Form->control('report_type'); - echo $this->Form->control('report_sadr'); - echo $this->Form->control('sadr_vomiting'); - echo $this->Form->control('sadr_dizziness'); - echo $this->Form->control('sadr_headache'); - echo $this->Form->control('sadr_joints'); - echo $this->Form->control('sadr_rash'); - echo $this->Form->control('sadr_mouth'); - echo $this->Form->control('sadr_stomach'); - echo $this->Form->control('sadr_urination'); - echo $this->Form->control('sadr_eyes'); - echo $this->Form->control('sadr_died'); - echo $this->Form->control('pqmp_label'); - echo $this->Form->control('patient_name'); - echo $this->Form->control('pqmp_material'); - echo $this->Form->control('date_of_birth'); - echo $this->Form->control('age_group'); - echo $this->Form->control('patient_address'); - echo $this->Form->control('pqmp_color'); - echo $this->Form->control('gender'); - echo $this->Form->control('pqmp_smell'); - echo $this->Form->control('pqmp_working'); - echo $this->Form->control('pqmp_bottle'); - echo $this->Form->control('pregnancy_status'); - echo $this->Form->control('weight'); - echo $this->Form->control('height'); - echo $this->Form->control('diagnosis'); - echo $this->Form->control('medical_history'); - echo $this->Form->control('date_of_onset_of_reaction'); - echo $this->Form->control('date_of_end_of_reaction'); - echo $this->Form->control('description_of_reaction'); - echo $this->Form->control('reaction_resolve'); - echo $this->Form->control('reaction_reappear'); - echo $this->Form->control('lab_investigation'); - echo $this->Form->control('severity'); - echo $this->Form->control('serious'); - echo $this->Form->control('serious_reason'); - echo $this->Form->control('action_taken'); - echo $this->Form->control('outcome'); - echo $this->Form->control('causality'); - echo $this->Form->control('any_other_comment'); - echo $this->Form->control('reporter_name'); - echo $this->Form->control('reporter_email'); - echo $this->Form->control('reporter_phone'); - echo $this->Form->control('submitted'); - echo $this->Form->control('submitted_date', ['empty' => true]); - echo $this->Form->control('emails'); - echo $this->Form->control('active'); - echo $this->Form->control('device'); - echo $this->Form->control('deleted'); - echo $this->Form->control('deleted_date', ['empty' => true]); - echo $this->Form->control('notified'); - echo $this->Form->control('reporter_date', ['empty' => true]); - echo $this->Form->control('reporter_name_diff'); - echo $this->Form->control('reporter_designation_diff'); - echo $this->Form->control('reporter_email_diff'); - echo $this->Form->control('reporter_phone_diff'); - echo $this->Form->control('reporter_date_diff', ['empty' => true]); - echo $this->Form->control('assigned_to'); - echo $this->Form->control('assigned_by'); - echo $this->Form->control('assigned_date', ['empty' => true]); - echo $this->Form->control('reaction_on'); - echo $this->Form->control('consent'); - echo $this->Form->control('copied'); - echo $this->Form->control('archived'); - echo $this->Form->control('archived_date', ['empty' => true]); - ?> -
- Form->button(__('Submit')) ?> - Form->end() ?> -
-
+ +
+
+
This form is meant for members of the public and patients to report medicine side effects, adverse events following vaccination, incidents involving medical devices or poor quality medicinal products.
+ Health care professionals should register + and submit reports after successfull authentication.
+
+
+element('padr/padr_edit'); +?> diff --git a/templates/Padrs/view.php b/templates/Padrs/view.php index 3c559ef565..ad94292c45 100755 --- a/templates/Padrs/view.php +++ b/templates/Padrs/view.php @@ -1,580 +1,34 @@ assign('PADR', 'active'); ?> -
- -
-
-

id) ?>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
has('user') ? $this->Html->link($padr->user->name, ['controller' => 'Users', 'action' => 'view', $padr->user->id]) : '' ?>
has('county') ? $this->Html->link($padr->county->id, ['controller' => 'Counties', 'action' => 'view', $padr->county->id]) : '' ?>
has('sub_county') ? $this->Html->link($padr->sub_county->id, ['controller' => 'SubCounties', 'action' => 'view', $padr->sub_county->id]) : '' ?>
has('designation') ? $this->Html->link($padr->designation->name, ['controller' => 'Designations', 'action' => 'view', $padr->designation->id]) : '' ?>
reference_no) ?>
relation) ?>
vigiflow_ref) ?>
vigiflow_date) ?>
report_title) ?>
report_type) ?>
report_sadr) ?>
patient_name) ?>
date_of_birth) ?>
age_group) ?>
patient_address) ?>
gender) ?>
pregnancy_status) ?>
weight) ?>
height) ?>
date_of_onset_of_reaction) ?>
date_of_end_of_reaction) ?>
reaction_resolve) ?>
reaction_reappear) ?>
severity) ?>
serious) ?>
serious_reason) ?>
action_taken) ?>
outcome) ?>
causality) ?>
reporter_name) ?>
reporter_email) ?>
reporter_phone) ?>
reporter_name_diff) ?>
reporter_email_diff) ?>
reporter_phone_diff) ?>
reaction_on) ?>
consent) ?>
Number->format($padr->id) ?>
padr_id === null ? '' : $this->Number->format($padr->padr_id) ?>
submitted === null ? '' : $this->Number->format($padr->submitted) ?>
emails === null ? '' : $this->Number->format($padr->emails) ?>
device === null ? '' : $this->Number->format($padr->device) ?>
notified === null ? '' : $this->Number->format($padr->notified) ?>
reporter_designation_diff === null ? '' : $this->Number->format($padr->reporter_designation_diff) ?>
assigned_to === null ? '' : $this->Number->format($padr->assigned_to) ?>
assigned_by === null ? '' : $this->Number->format($padr->assigned_by) ?>
copied === null ? '' : $this->Number->format($padr->copied) ?>
archived === null ? '' : $this->Number->format($padr->archived) ?>
submitted_date) ?>
deleted_date) ?>
created) ?>
modified) ?>
reporter_date) ?>
reporter_date_diff) ?>
assigned_date) ?>
archived_date) ?>
sadr_vomiting ? __('Yes') : __('No'); ?>
sadr_dizziness ? __('Yes') : __('No'); ?>
sadr_headache ? __('Yes') : __('No'); ?>
sadr_joints ? __('Yes') : __('No'); ?>
sadr_rash ? __('Yes') : __('No'); ?>
sadr_mouth ? __('Yes') : __('No'); ?>
sadr_stomach ? __('Yes') : __('No'); ?>
sadr_urination ? __('Yes') : __('No'); ?>
sadr_eyes ? __('Yes') : __('No'); ?>
sadr_died ? __('Yes') : __('No'); ?>
pqmp_label ? __('Yes') : __('No'); ?>
pqmp_material ? __('Yes') : __('No'); ?>
pqmp_color ? __('Yes') : __('No'); ?>
pqmp_smell ? __('Yes') : __('No'); ?>
pqmp_working ? __('Yes') : __('No'); ?>
pqmp_bottle ? __('Yes') : __('No'); ?>
active ? __('Yes') : __('No'); ?>
deleted ? __('Yes') : __('No'); ?>
-
- -
- Text->autoParagraph(h($padr->vigiflow_message)); ?> -
-
-
- -
- Text->autoParagraph(h($padr->diagnosis)); ?> -
-
-
- -
- Text->autoParagraph(h($padr->medical_history)); ?> -
-
-
- -
- Text->autoParagraph(h($padr->description_of_reaction)); ?> -
-
-
- -
- Text->autoParagraph(h($padr->lab_investigation)); ?> -
-
-
- -
- Text->autoParagraph(h($padr->any_other_comment)); ?> -
-
- - +
+ Html->link( + ' Download PDF', + array('controller' => 'padrs', 'action' => 'view', 'ext' => 'pdf', $padr['token']), + array( + 'class' => 'btn btn-primary btn-block mapop', + 'title' => 'Download PDF', + 'escape' => false, + 'data-content' => 'Download the pdf version of the report', + ) + ); + ?> +
+ +

Do you have more information on the reaction?

+ Form->postLink(__('Followup Report'), array('action' => 'followup', $padr['token']), array('escape' => false, 'class' => 'btn btn-block'), __('Are you sure you want to create a follow up report for %s?', $padr['reference_no'])); + } + ?>
-
+ \ No newline at end of file diff --git a/templates/Sadrs/index.php b/templates/Sadrs/index.php index 18a2f4e856..e69de29bb2 100755 --- a/templates/Sadrs/index.php +++ b/templates/Sadrs/index.php @@ -1,202 +0,0 @@ - $sadrs - */ -?> -
- Html->link(__('New Sadr'), ['action' => 'add'], ['class' => 'button float-right']) ?> -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Paginator->sort('id') ?>Paginator->sort('sadr_id') ?>Paginator->sort('user_id') ?>Paginator->sort('pqmp_id') ?>Paginator->sort('medication_id') ?>Paginator->sort('county_id') ?>Paginator->sort('sub_county_id') ?>Paginator->sort('designation_id') ?>Paginator->sort('reference_no') ?>Paginator->sort('vigiflow_id') ?>Paginator->sort('report_title') ?>Paginator->sort('report_type') ?>Paginator->sort('report_sadr') ?>Paginator->sort('report_therapeutic') ?>Paginator->sort('report_misuse') ?>Paginator->sort('report_off_label') ?>Paginator->sort('product_category') ?>Paginator->sort('medicinal_product') ?>Paginator->sort('blood_products') ?>Paginator->sort('herbal_product') ?>Paginator->sort('cosmeceuticals') ?>Paginator->sort('product_other') ?>Paginator->sort('product_specify') ?>Paginator->sort('name_of_institution') ?>Paginator->sort('institution_code') ?>Paginator->sort('address') ?>Paginator->sort('contact') ?>Paginator->sort('patient_name') ?>Paginator->sort('ip_no') ?>Paginator->sort('date_of_birth') ?>Paginator->sort('age_group') ?>Paginator->sort('patient_address') ?>Paginator->sort('ward') ?>Paginator->sort('gender') ?>Paginator->sort('known_allergy') ?>Paginator->sort('known_allergy_specify') ?>Paginator->sort('pregnant') ?>Paginator->sort('pregnancy_status') ?>Paginator->sort('weight') ?>Paginator->sort('height') ?>Paginator->sort('reaction') ?>Paginator->sort('date_of_onset_of_reaction') ?>Paginator->sort('reaction_resolve') ?>Paginator->sort('reaction_reappear') ?>Paginator->sort('severity') ?>Paginator->sort('serious') ?>Paginator->sort('serious_reason') ?>Paginator->sort('action_taken') ?>Paginator->sort('outcome') ?>Paginator->sort('causality') ?>Paginator->sort('reporter_name') ?>Paginator->sort('reporter_email') ?>Paginator->sort('reporter_phone') ?>Paginator->sort('submitted') ?>Paginator->sort('emails') ?>Paginator->sort('active') ?>Paginator->sort('device') ?>Paginator->sort('deleted') ?>Paginator->sort('archived') ?>Paginator->sort('archived_date') ?>Paginator->sort('deleted_date') ?>Paginator->sort('notified') ?>Paginator->sort('created') ?>Paginator->sort('modified') ?>Paginator->sort('reporter_date') ?>Paginator->sort('person_submitting') ?>Paginator->sort('reporter_name_diff') ?>Paginator->sort('reporter_designation_diff') ?>Paginator->sort('reporter_email_diff') ?>Paginator->sort('reporter_phone_diff') ?>Paginator->sort('reporter_date_diff') ?>Paginator->sort('assigned_to') ?>Paginator->sort('assigned_by') ?>Paginator->sort('assigned_date') ?>Paginator->sort('vigiflow_ref') ?>Paginator->sort('vigiflow_date') ?>Paginator->sort('webradr_ref') ?>Paginator->sort('webradr_date') ?>Paginator->sort('submitted_date') ?>Paginator->sort('webradr_message') ?>Paginator->sort('copied') ?>
Number->format($sadr->id) ?>sadr_id === null ? '' : $this->Number->format($sadr->sadr_id) ?>has('user') ? $this->Html->link($sadr->user->name, ['controller' => 'Users', 'action' => 'view', $sadr->user->id]) : '' ?>has('pqmp') ? $this->Html->link($sadr->pqmp->id, ['controller' => 'Pqmps', 'action' => 'view', $sadr->pqmp->id]) : '' ?>has('medication') ? $this->Html->link($sadr->medication->id, ['controller' => 'Medications', 'action' => 'view', $sadr->medication->id]) : '' ?>has('county') ? $this->Html->link($sadr->county->id, ['controller' => 'Counties', 'action' => 'view', $sadr->county->id]) : '' ?>has('sub_county') ? $this->Html->link($sadr->sub_county->id, ['controller' => 'SubCounties', 'action' => 'view', $sadr->sub_county->id]) : '' ?>has('designation') ? $this->Html->link($sadr->designation->name, ['controller' => 'Designations', 'action' => 'view', $sadr->designation->id]) : '' ?>reference_no) ?>vigiflow_id) ?>report_title) ?>report_type) ?>report_sadr) ?>report_therapeutic) ?>report_misuse === null ? '' : $this->Number->format($sadr->report_misuse) ?>report_off_label === null ? '' : $this->Number->format($sadr->report_off_label) ?>product_category) ?>medicinal_product) ?>blood_products) ?>herbal_product) ?>cosmeceuticals) ?>product_other) ?>product_specify) ?>name_of_institution) ?>institution_code) ?>address) ?>contact) ?>patient_name) ?>ip_no) ?>date_of_birth) ?>age_group) ?>patient_address) ?>ward) ?>gender) ?>known_allergy) ?>known_allergy_specify) ?>pregnant) ?>pregnancy_status) ?>weight) ?>height) ?>reaction) ?>date_of_onset_of_reaction) ?>reaction_resolve) ?>reaction_reappear) ?>severity) ?>serious) ?>serious_reason) ?>action_taken) ?>outcome) ?>causality) ?>reporter_name) ?>reporter_email) ?>reporter_phone) ?>submitted === null ? '' : $this->Number->format($sadr->submitted) ?>emails === null ? '' : $this->Number->format($sadr->emails) ?>active) ?>device === null ? '' : $this->Number->format($sadr->device) ?>deleted) ?>archived) ?>archived_date) ?>deleted_date) ?>notified === null ? '' : $this->Number->format($sadr->notified) ?>created) ?>modified) ?>reporter_date) ?>person_submitting) ?>reporter_name_diff) ?>reporter_designation_diff === null ? '' : $this->Number->format($sadr->reporter_designation_diff) ?>reporter_email_diff) ?>reporter_phone_diff) ?>reporter_date_diff) ?>assigned_to === null ? '' : $this->Number->format($sadr->assigned_to) ?>assigned_by === null ? '' : $this->Number->format($sadr->assigned_by) ?>assigned_date) ?>vigiflow_ref) ?>vigiflow_date) ?>webradr_ref) ?>webradr_date) ?>submitted_date) ?>webradr_message) ?>copied === null ? '' : $this->Number->format($sadr->copied) ?> - Html->link(__('View'), ['action' => 'view', $sadr->id]) ?> - Html->link(__('Edit'), ['action' => 'edit', $sadr->id]) ?> - Form->postLink(__('Delete'), ['action' => 'delete', $sadr->id], ['confirm' => __('Are you sure you want to delete # {0}?', $sadr->id)]) ?> -
-
-
-
    - Paginator->first('<< ' . __('first')) ?> - Paginator->prev('< ' . __('previous')) ?> - Paginator->numbers() ?> - Paginator->next(__('next') . ' >') ?> - Paginator->last(__('last') . ' >>') ?> -
-

Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?>

-
-
diff --git a/templates/element/multi/attachments.php b/templates/element/multi/attachments.php new file mode 100644 index 0000000000..158b5a3df1 --- /dev/null +++ b/templates/element/multi/attachments.php @@ -0,0 +1,75 @@ +Html->script('attachments', array('inline' => false)); +?> +
+
+
Do you have pictures or documents that you would like to send to PPB? click on the button to add them:
+ + +
+ data-group= > + + + + + + + + + + request->data['Attachment'])) { + for ($i = 0; $i <= count($this->request->data['Attachment'])-1; $i++) { + ?> + + + + + + + + + +
#FileText Description
+
Form->control('Attachment.'.$i.'.id'); + echo $this->Form->control('Attachment.'.$i.'.model', array('type'=>'hidden', 'value'=> $model)); + echo $this->Form->control('Attachment.'.$i.'.group', array('type'=>'hidden', 'value'=> $group)); + echo $this->Form->control('Attachment.'.$i.'.filesize', array('type' => 'hidden')); + echo $this->Form->control('Attachment.'.$i.'.basename', array('type' => 'hidden')); + echo $this->Form->control('Attachment.'.$i.'.checksum', array('type' => 'hidden')); + if (!empty($this->request->data['Attachment'][$i]['id']) && + !empty($this->request->data['Attachment'][$i]['basename'])) { + echo $this->Html->link(__($this->request->data['Attachment'][$i]['basename']), + array('controller' => 'attachments', 'action' => 'download', + $this->request->data['Attachment'][$i]['id'], 'admin' => false, 'full_base' => true), + array('class' => 'btn btn-info') + ); + + } else { + echo $this->Form->control('Attachment.'.$i.'.file', array( + 'label' => false, 'between' => false, 'after' => false, 'class' => 'span12 control-file', + 'error' => array('escape' => false, 'attributes' => array( 'class' => 'help-block')), + 'type' => 'file', + )); + } + ?> +
+
+ request->data['Attachment'][$i]['id']) && + !empty($this->request->data['Attachment'][$i]['basename'])) { + echo $this->request->data['Attachment'][$i]['description']; + echo $this->Form->control('Attachment.'.$i.'.description', array('type' => 'hidden')); + } else { + echo $this->Form->control('Attachment.'.$i.'.description', array( + 'label' => false, 'between' => false, 'rows' => '1', 'after' => false, 'class' => 'span11',)); + } + ?> + + +
+
+
diff --git a/templates/element/multi/padr_list_of_medicines.php b/templates/element/multi/padr_list_of_medicines.php new file mode 100644 index 0000000000..9fe138d4bf --- /dev/null +++ b/templates/element/multi/padr_list_of_medicines.php @@ -0,0 +1,137 @@ +Html->script('padr_list_of_medicines', array('inline' => false)); +echo $this->Html->css('padr', array('inline' => false)); +?> + +
+
DETAILS OF THE MEDICINE/VACCINE/DEVICE THAT CAUSED THE REACTION
(Include all medications)
+
+ + +
+
+ + + request->getData('padr_list_of_medicines'))) { + $dr = count($this->request->getData('padr_list_of_medicines')) - 1; + } else { + $dr = 0; + } + for ($i = 0; $i <= $dr; $i++) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Form->control('padr_list_of_medicines.' . $i . '.id', array('type' => 'hidden')); + ?> + Name of Medicine/Vaccine/Device + + Form->control('padr_list_of_medicines.' . $i . '.product_name', array( + 'label' => false, + 'between' => false, + 'div' => false, + 'after' => false, + 'class' => 'padr_control-item', + )); + ?> + Manufacturer + Form->control('padr_list_of_medicines.' . $i . '.manufacturer', array( + 'type' => 'text', + 'label' => false, + 'between' => false, + 'div' => false, + 'after' => false, + 'class' => 'padr_control-item', + )); + ?> + + +
When did you start taking/using the medicine/vaccine/device? + Form->control('padr_list_of_medicines.' . $i . '.start_date', array( + 'type' => 'date', + 'label' => false, + 'between' => false, + 'div' => false, + + 'dateFormat' => 'DMY', + // 'class' => 'date-pick-from padr_control-item datepicker', + 'after' => false + )); + ?> + When did you stop taking/using the medicine/vaccine/device? (dd-mm-yyyy) + Form->control('padr_list_of_medicines.' . $i . '.end_date', array( + 'type' => 'date', + 'label' => false, + 'between' => false, + 'dateFormat' => 'DMY', + 'div' => false, + // 'class' => 'date-pick-to padr_control-item datepicker', + 'after' => false + )); + ?> +
Expiry date of the medicine/vaccine/device + Form->control('padr_list_of_medicines.' . $i . '.expiry_date', array( + 'type' => 'date', + 'label' => false, + 'between' => false, + 'div' => false, + + 'dateFormat' => 'DMY', + // 'class' => 'date-pick-field padr_control-item datepicker', + 'after' => false + )); + ?> + Where did you buy the medicine/vaccine/device? Form->control('padr_list_of_medicines.' . $i . '.medicine_source', array( + 'type' => 'text', + 'label' => false, + 'between' => false, + 'div' => false, + 'after' => false, + 'class' => 'padr_control-item', + )); + ?> +
+
+
\ No newline at end of file diff --git a/templates/element/padr/padr_edit.php b/templates/element/padr/padr_edit.php new file mode 100644 index 0000000000..b2d8f7a4db --- /dev/null +++ b/templates/element/padr/padr_edit.php @@ -0,0 +1,653 @@ +assign('PADR', 'active'); +echo $this->Html->script('jquery/combobox', array('inline' => false)); +echo $this->Html->script('padr', array('inline' => false)); +echo $this->Html->css('padr', array('inline' => false)); +?> + + +
+ + Form->create($padr, array( + 'type' => 'file', + 'class' => 'form-vertical' + )); + ?> +
+
+ + Form->control('id', array()); + ?> + +
+
+ Html->image('confidence.png', array('alt' => 'COA')); + ?> +
+
+ +
+
DETAILS OF THE PERSON REPORTING
+
+
+
+ Form->control('reporter_name', array( + 'class' => 'set-control', + 'div' => array('class' => 'control-group required'), + 'label' => array('class' => 'control-label required', 'text' => 'Name of Person Reporting *', 'escape' => false,), + )); + + echo $this->Form->control('county_id', array( + 'class' => 'set-control', + 'label' => array( + 'class' => 'control-label required', + 'text' => 'County *', + 'escape' => false, + + ), + 'empty' => true, + 'between' => '
', + )); + + ?> +
+ +
+ Form->control('relation', array( + 'type' => 'select', + 'empty' => true, + 'class' => 'set-control', + 'label' => array('class' => 'control-label required', 'text' => 'Relation'), + 'options' => array('Self' => 'Self', 'Parent' => 'Parent', 'Guardian' => 'Guardian', 'Other' => 'Other') + )); + echo $this->Form->control('sub_county_id', array( + 'class' => 'set-control', + 'label' => array( + 'class' => 'control-label required', + 'text' => 'Sub County *', + 'escape' => false, + + ), + 'empty' => true, + 'between' => '
', + )); + + + + ?> +
+ +
+ +
+
+
+ Form->control('reporter_email', array( + 'class' => 'set-control', + 'type' => 'email', + 'div' => array('class' => 'control-group required'), + 'required' => false, + 'label' => array('class' => 'control-label required', 'text' => 'Email Address') + )); + + ?> +
+
+
+ Form->control('reporter_phone', array( + 'label' => array('class' => 'control-label required', 'text' => 'Mobile No.*', 'escape' => false,), + 'placeholder' => '', + 'title' => 'Mobile No.', + 'data-content' => 'It is important for follow up by the Pharmacy and Poisons Board and to obtain additional information as well as providing you with the feedback', + 'after' => '

Your phone number is important for follow up by the
Pharmacy and Poisons Board and to obtain
additional information as well as providing you with the feedback

', + 'class' => 'set-control', + )); + ?> + + +
+
+
+ +
+
DETAILS OF THE PATIENT
+
+
+
+ Form->control('patient_name', array( + 'class' => 'span11', + 'label' => array('class' => 'control-label required', 'text' => 'Patient\'s Name *', 'escape' => false,), + 'placeholder' => 'Name or Initials', + 'class' => 'set-control', + )); + ?> +
+ +
+
Gender
+ Form->control('gender', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'error' => false, + 'class' => 'gender', + + 'options' => array('Male' => 'Male'), + )); + echo $this->Form->control('gender', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'class' => 'gender', + 'format' => array('before', 'label', 'between', 'control', 'error', 'after'), + 'error' => array('attributes' => array('wrap' => 'p', 'class' => 'required error')), + + 'options' => array('Female' => 'Female'), + )); + + ?> +
+ +
+ +
+
+ + Form->control('date_of_birth', array( + 'type' => 'date', + 'dateFormat' => 'DMY', + 'minYear' => date('Y') - 100, + 'maxYear' => date('Y'), + 'empty' => array('day' => '(day)', 'month' => '(month)', 'year' => '(year)'), + 'label' => array('class' => 'control-label required', 'text' => 'Date of Birth'), + 'title' => 'select beginning of the month if unsure', + 'data-content' => 'If selected, year is mandatory.', + + 'class' => 'tooltipper set-control', + )); + + ?> +
+
+
+
--OR--
+
+
+
+ Form->control('age_group', array( + 'type' => 'select', + 'empty' => true, + 'options' => array( + 'neonate' => 'neonate [0-1 month]', + 'infant' => 'infant [1 month-1 year]', + 'child' => 'child [1 year - 11 years]', + 'adolescent' => 'adolescent [12-17 years]', + 'adult' => 'adult [18-64 years]', + 'elderly' => 'elderly [>65 years]', + ), + 'label' => array('class' => 'control-label required', 'text' => 'Age Group'), + 'class' => 'set-control', + )); + + ?> +
+
+
+
+ + + + + + + +
+ Form->control('report_sadr', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'error' => false, + 'class' => 'person-submit', + + 'options' => array('Side Effects' => 'Side Effects'), + )); + echo $this->Form->control('report_sadr', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'class' => 'person-submit', + 'format' => array('before', 'label', 'between', 'control', 'error', 'after'), + 'error' => array('attributes' => array('wrap' => 'p', 'class' => 'required error')), + 'options' => array('Poor Quality Medicine' => 'Poor Quality Medicine'), + )); + ?> +
+
+
+ +
+ + +
+
SIDE EFFECT
+
+
+
+
+ Select all side effects experienced"; + echo $this->Form->control('sadr_vomiting', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Vomiting or diarrhoea '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_dizziness', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Dizziness or drowsiness '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_headache', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Headache'), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_joints', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Joints and muscle pain '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_rash', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Rash, itching, swelling on skin'), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_mouth', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Pain or bleeding in the mouth '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_stomach', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Pain in the stomach '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_urination', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Abnormal changes with urination'), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_eyes', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Red, painful eyes '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); + echo $this->Form->control('sadr_died', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Patient died '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + 'between' => ' + ', + )); ?> + + Form->control('description_of_reaction', array( + 'class' => 'span11', + 'rows' => '1', + 'between' => false, + 'div' => false, + 'label' => array('class' => 'required', 'text' => 'Other side effects experienced'), + 'after' => '', + )); + ?> +
+
+ Form->control('date_of_onset_of_reaction', array( + 'type' => 'date', + 'between' => false, + 'div' => false, + 'after' => false, + 'dateFormat' => 'DMY', + 'minYear' => date('Y') - 100, + 'maxYear' => date('Y'), + 'empty' => array('day' => '(day)', 'month' => '(month)', 'year' => '(year)'), + 'label' => array('class' => 'required', 'text' => 'When did the reaction start? '), + 'class' => 'span4', + )); + echo $this->Form->control('reaction_on', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'error' => false, + 'class' => 'reaction_on', + 'before' => '
+
', + 'options' => array('Yes' => 'Yes'), + )); + echo $this->Form->control('reaction_on', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'class' => 'reaction_on', + 'format' => array('before', 'label', 'between', 'control', 'error', 'after'), + 'error' => array('attributes' => array('wrap' => 'p', 'class' => 'required error')), + 'before' => ' + + clear! +
', + 'options' => array('No' => 'No'), + )); + ?> +
+
+ +
+
+ + +
+
+
POOR QUALITY MEDICINE
+
+
+
+ Select all issues with the medicine/device"; + echo $this->Form->control('pqmp_label', array( + 'type' => 'checkbox', + 'label' => array('text'=>'The label looks wrong '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + )); + echo $this->Form->control('pqmp_material', array( + 'type' => 'checkbox', + 'label' => array('text' => 'Has unusual material in it '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + )); + echo $this->Form->control('pqmp_color', array( + 'type' => 'checkbox', + 'label' => array('text'=>'The color is changing'), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + )); + echo $this->Form->control('pqmp_smell', array( + 'type' => 'checkbox', + 'label' => array('text'=>'The smell is unusual'), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + )); + echo $this->Form->control('pqmp_working', array( + 'type' => 'checkbox', + 'label' => array('text'=>'The medicine/device is not working'), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + )); + echo $this->Form->control('pqmp_bottle', array( + 'type' => 'checkbox', + 'label' => array('text'=>'The packet or bottle does not seem to be usual or complete '), + 'div' => false, + 'class' => false, + 'hiddenField' => false, + )); ?> +
+ +
+ Form->control('any_other_comment', array( + 'class' => 'span11', + 'rows' => '2', + 'between' => false, + 'div' => false, + 'label' => array('class' => 'required', 'text' => 'Other wrong things'), + 'after' => 'Additional wrong things?', + )); + ?> +
+
+ +
+ + element('multi/padr_list_of_medicines'); + ?> + + +
+
OUTCOME DETAILS
+
+
+ +

Outcome

+ Form->control('outcome', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'error' => false, + 'class' => 'outcome', + 'before' => '
', + 'options' => array('recovered/resolved' => 'Recovered/resolved'), + )); + + echo $this->Form->control('outcome', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'error' => false, + 'class' => 'outcome', + 'before' => '', + 'options' => array('recovering/resolving' => 'Recovering/resolving'), + )); + echo $this->Form->control('outcome', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'error' => false, + 'class' => 'outcome', + 'before' => '', + 'options' => array('recovered/resolved with sequelae' => 'Recovered/resolved with sequelae'), + )); + echo $this->Form->control('outcome', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'error' => false, + 'class' => 'outcome', + 'before' => '', + 'options' => array('not recovered/not resolved' => 'Not recovered/not resolved'), + )); + echo $this->Form->control('outcome', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'error' => false, + 'class' => 'outcome', + 'before' => '', + 'options' => array('death' => 'Death'), + )); + echo $this->Form->control('outcome', array( + 'type' => 'radio', + 'label' => false, + 'legend' => false, + 'div' => false, + 'hiddenField' => false, + 'class' => 'outcome', + 'format' => array('before', 'label', 'between', 'control', 'error', 'after'), + 'error' => array('attributes' => array('wrap' => 'p', 'class' => 'required error')), + 'before' => ' + + clear! +
', + 'options' => array('Unknown' => 'Unknown'), + )); + + + ?> +
+ + element('multi/attachments', ['model' => 'Padr', 'group' => 'attachment', 'examples' => '']); + ?> +
+ Form->control('consent', array( + 'type' => 'select', + 'empty' => true, + 'options' => array( + 'Yes' => 'Yes', + 'No' => 'No', + ), + 'class' => 'set-control', + 'label' => array('class' => 'control-label required', 'text' => 'If we need further information to help us understand the case do we have your permission to contact you?'), + 'after' => ' + clear!
', + )); + + ?> +
+
+
+ + Captcha->control('Padr', array('label' => false, 'type' => 'number')); + ?> +
+
+ +
+
+ +
+
+
+
+ Form->button(' Submit Report', array( + 'name' => 'saveChanges', + 'escapeTitle' => false, + 'class' => 'btn btn-primary mapop', + 'id' => 'PadrSaveChanges', + 'onclick' => "return confirm('Are you sure you wish to submit the report?');", + 'div' => false, + )); + ?> +
+
+ Html->link( + ' Cancel', + array('controller' => 'pages', 'action' => 'home'), + array('escape' => false, 'class' => 'btn btn-block btn-danger') + ); + ?> +
+
+
+
+ Form->end(); ?> +
\ No newline at end of file diff --git a/templates/element/padr/padr_view.php b/templates/element/padr/padr_view.php new file mode 100644 index 0000000000..037fa933f4 --- /dev/null +++ b/templates/element/padr/padr_view.php @@ -0,0 +1,246 @@ +assign('PADR', 'active'); +$ichecked = "☑"; +$nchecked = "☐"; +?> + + + +
+
+ +
+
+ +
+
+ Html->image('confidence.png', array('alt' => 'COA', 'full_base' => true)); + ?> +
+
+
+ + + + + + + + +
REPORT ID: +

+
+ +
+
DETAILS OF THE PERSON REPORTING
+
+ + + + + + + + + + + + + + + + + + + +
Name of Person Reporting: Relation:
Email Address: Phone No.:
County:
+ +
+
DETAILS OF THE PATIENT
+
+ + + + + + + + + + + +
Patient's Name: Gender:
Date of Birth: +
+ + + + + + + + +
+
+ +
+
SIDE EFFECT
+
+ + + + + +
+ +
Select all side effects experienced
+

Vomiting or diarrhoea

+

Dizziness or drowsiness

+

Headache

+

Joints and muscle pain

+

Rash, itching, swelling on skin

+

Pain or bleeding in the mouth

+

Pain in the stomach

+

Abnormal changes with urination

+

Red, painful eyes

+

Patient died

+

+ Other side effects experienced: +
+

+
+ When did the reaction start? + + Is the reaction still on? + +
When did the reaction stop? + +
+ +
+
DETAILS OF THE MEDICINE THAT CAUSED THE REACTION
(Include all medications)
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name of Medicine * + + + + Manufacturer + + + + +
When did you start taking the medicine? * + + When did you stop taking the medicine? (dd-mm-yyyy) + +
Expiry date of the medicine + + Where did you buy the medicine? + +
+
+
+
OUTCOME DETAILS
+
+ + + + + + + + + + + + + +
Outcome: +
Consent Given: +
+
+ +
+
+
+
\ No newline at end of file diff --git a/webroot/js/padr.js b/webroot/js/padr.js index 1d5dc83db3..99b0ccfb2f 100755 --- a/webroot/js/padr.js +++ b/webroot/js/padr.js @@ -1,6 +1,5 @@ $(document).ready(function() { - - // $( "#PadrCountyId" ).combobox(); + var dates2 = $('.date-pick-from, .date-pick-to').datepicker({ minDate:"-100Y", maxDate:"-0D", dateFormat:'dd-mm-yy', @@ -16,32 +15,32 @@ $(document).ready(function() { }); //If SADR disable Poor-Quality Health Products and Technologies and vice versa - $('#pqmp').hide(); - $('#sadr').hide(); - $('input[name="data[Padr][report_sadr]"]').click(function(){ + $('.pqmp').hide(); + $('.sadr').hide(); + $('input[name="report_sadr"]').click(function(){ if ($(this).val() == 'Side Effects') { - $('#pqmp').hide(); - $('#sadr').show("slow"); + $('.pqmp').hide(); + $('.sadr').show("slow"); } else { - $('#pqmp').show("slow"); - $('#sadr').hide(); + $('.pqmp').show("slow"); + $('.sadr').hide(); } }); - if($('input[name="data[Padr][report_sadr]"][value="Side Effects"]').is(':checked')) { - $('#pqmp').hide(); $('#sadr').show("slow"); + if($('input[name="report_sadr"][value="Side Effects"]').is(':checked')) { + $('.pqmp').hide(); $('.sadr').show("slow"); } - if($('input[name="data[Padr][report_sadr]"][value="Poor Quality Medicine"]').is(':checked')) { - $('#sadr').hide(); $('#pqmp').show("slow"); + if($('input[name="report_sadr"][value="Poor Quality Medicine"]').is(':checked')) { + $('.sadr').hide(); $('.pqmp').show("slow"); } - $('input[name="data[Padr][reaction_on]"]').click(function() { + $('input[name="reaction_on"]').click(function() { if ($(this).val() == 'Yes') { - $('input[name="data[Padr][outcome]"]:first').attr('disabled', this.checked).attr('checked', !this.checked); + $('input[name="outcome"]:first').attr('disabled', this.checked).attr('checked', !this.checked); } else { - $('input[name="data[Padr][outcome]"]').attr('disabled', false); + $('input[name="outcome"]').attr('disabled', false); } }); - if($('input[name="data[Padr][reaction_on]"][value="Yes"]').is(':checked')) { - $('input[name="data[Padr][outcome]"]:first').attr('disabled', this.checked).attr('checked', !this.checked); + if($('input[name="reaction_on"][value="Yes"]').is(':checked')) { + $('input[name="outcome"]:first').attr('disabled', this.checked).attr('checked', !this.checked); } }); diff --git a/webroot/js/padr_list_of_medicines.js b/webroot/js/padr_list_of_medicines.js index 8a6abbe917..7e289bb6b3 100755 --- a/webroot/js/padr_list_of_medicines.js +++ b/webroot/js/padr_list_of_medicines.js @@ -1,56 +1,66 @@ -$(function() { - $(document).on('click', '.remove-padr-product', remove_padr_medicine); - $(document).on('click', '#addPadrListOfMedicine', reloadPublicmediCations); +$(function () { + $(document).on("click", ".remove-padr-product", remove_padr_medicine); + $(document).on("click", ".addPadrListOfMedicine", reloadPublicmediCations); - - //Hapa Kazi tu + //Hapa Kazi tu reloadPublicmediCations(); - function reloadPublicmediCations(){ - var dates2 = $('.date-pick-from, .date-pick-to').datepicker({ - minDate:"-100Y", maxDate:"-0D", - dateFormat:'dd-mm-yy', - showButtonPanel:true, - changeMonth:true, - changeYear:true, - showAnim:'show' - }); + function reloadPublicmediCations() { + var dates2 = $(".date-pick-from, .date-pick-to").datepicker({ + minDate: "-100Y", + maxDate: "-0D", + dateFormat: "dd-mm-yy", + showButtonPanel: true, + changeMonth: true, + changeYear: true, + showAnim: "show", + }); - $('.date-pick-field').datepicker({ - minDate:"-100Y", - dateFormat:'dd-mm-yy' - }); + $(".date-pick-field").datepicker({ + minDate: "-100Y", + dateFormat: "dd-mm-yy", + }); } - + $(".datepicker").datepicker({ + minDate: "-100Y", + dateFormat: "dd-mm-yy" + }); + // incremental development - $("#addPadrListOfMedicine").click(function() { - if ($("#listOfPadrListOfMedicinesTable tbody td.sailor").length > 0) { - var intId = parseInt($("#listOfPadrListOfMedicinesTable td.sailor:last").text()); - } else { - var intId = 0; - } + $("#addPadrListOfMedicine").click(function () { - //var intId = $("#listOfPadrListOfMedicinesTable tr").length - 1; - if ($('#listOfPadrListOfMedicinesTable tbody td.sailor').length < 10) { - trVar = $.parseHTML(constructLPRTr(intId)); - $("#listOfPadrListOfMedicinesTable tbody").append(trVar); - } else { - alert("Sorry, can't add more than "+intId+" Medicines at a time!"); - } + if ($("#listOfPadrListOfMedicinesTable tbody td.sailor").length > 0) { + var intId = parseInt( + $("#listOfPadrListOfMedicinesTable td.sailor:last").text() + ); + } else { + var intId = 0; + } + + //var intId = $("#listOfPadrListOfMedicinesTable tr").length - 1; + if ($("#listOfPadrListOfMedicinesTable tbody td.sailor").length < 10) { + trVar = $.parseHTML(constructLPRTr(intId)); + $("#listOfPadrListOfMedicinesTable tbody").append(trVar); + } else { + alert( + "Sorry, can't add more than " + intId + " Medicines at a time!" + ); + } }); function constructLPRTr(intId) { var intId2 = intId + 1; - - var trWrapper = '\ + + var trWrapper = + '\ \ {i2}\ - Name of Medicine/Vaccine/Device \ + Name of Medicine/Vaccine/Device \ \ - \ + \ Manufacturer \ \ - \ + \ \ \ \ @@ -58,14 +68,14 @@ $(function() { \ When did you start taking/using the medicine/vaccine/device?\ \ - \ + \ When did you stop taking/using the medicine/vaccine/device?\ \ - \ + \ \ \ Expiry date of the medicine/vaccine/device\ - \ + \ \ \ \ @@ -75,30 +85,37 @@ $(function() { } function remove_padr_medicine() { - if ( typeof $(this).val() !== 'undefined' && $(this).val() !== false && $(this).val() !== "") { - $.ajax({ - async:true, type:'POST', - url:'/padr-list-of-medicines/delete.json', - data:{'id': $(this).val(), 'medication_id': $('#medication_pr_id').text()}, //TODO:Use this to ensure the sadr belongs to the user - success : function(data) { - console.log(data); - } - }); - } - updateLPRTr($(this)); + if ( + typeof $(this).val() !== "undefined" && + $(this).val() !== false && + $(this).val() !== "" + ) { + $.ajax({ + async: true, + type: "POST", + url: "/padr-list-of-medicines/delete.json", + data: { + id: $(this).val(), + medication_id: $("#medication_pr_id").text(), + }, //TODO:Use this to ensure the sadr belongs to the user + success: function (data) { + console.log(data); + }, + }); + } + updateLPRTr($(this)); } - function updateLPRTr(myobj){ - // console.log(myobj.closest('tr').remove); - console.log(myobj.closest('td').attr('rowspan')); - rows = parseInt(myobj.closest('td').attr('rowspan')); - $tr = myobj.closest('tr'); - for (var i = 0; i <= rows-2; i++) { - $tr.next().remove(); - } - $tr.slideUp(300, function(){ + function updateLPRTr(myobj) { + // console.log(myobj.closest('tr').remove); + console.log(myobj.closest("td").attr("rowspan")); + rows = parseInt(myobj.closest("td").attr("rowspan")); + $tr = myobj.closest("tr"); + for (var i = 0; i <= rows - 2; i++) { + $tr.next().remove(); + } + $tr.slideUp(300, function () { $(this).remove(); - }); - }; - + }); + } });