From 23f9ae1882de310f9bbc32fa420c61fb9b399a0b Mon Sep 17 00:00:00 2001 From: biskyt Date: Mon, 21 Dec 2020 18:02:19 +0000 Subject: [PATCH 001/110] update version to 3.6.2n --- protected/config/core/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protected/config/core/common.php b/protected/config/core/common.php index a2ca3e5f19..2df130a4e9 100644 --- a/protected/config/core/common.php +++ b/protected/config/core/common.php @@ -691,7 +691,7 @@ 'exclude_admin_structure_param_list' => array( // 'Worklist', ), - 'oe_version' => '3.6.1', + 'oe_version' => '3.6.2n', // Replace the term "GP" in the UI with whatever is specified in gp_label. E.g, in Australia they are called "Practioners", not "GPs" 'gp_label' => 'GP', // number of days in the future to retrieve worklists for the automatic dashboard render (0 by default in v3) From d840b9c2a7b6827637add2a7f91eebebe4a6d206 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 5 Jan 2021 14:33:15 +1100 Subject: [PATCH 002/110] Fix/oe 10729 (#5343) * OE-10729 Updated model so only active locations are returned for 'locations', and created 'all_locations' to return all related locations. * OE-10729 added support for basic multidemension arrays * OE-10729 made Multiselect change more generic * [CodeFactor] Apply fixes * OE-10729 Swap to array merge * [CodeFactor] Apply fixes Co-authored-by: dwgthomson@gmail.com Co-authored-by: codefactor-io --- .../models/OphDrPrescription_DispenseCondition.php | 7 +++++-- .../controllers/DispenseConditionController.php | 2 +- .../form_OphDrPrescription_DispenseCondition.php | 6 +++--- protected/widgets/MultiSelectList.php | 13 ++++++++++++- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/protected/modules/OphDrPrescription/models/OphDrPrescription_DispenseCondition.php b/protected/modules/OphDrPrescription/models/OphDrPrescription_DispenseCondition.php index e4bc1ab6e9..ccdaa4c948 100644 --- a/protected/modules/OphDrPrescription/models/OphDrPrescription_DispenseCondition.php +++ b/protected/modules/OphDrPrescription/models/OphDrPrescription_DispenseCondition.php @@ -36,7 +36,7 @@ public function rules() array('display_order', 'numerical', 'integerOnly'=>true), array('name', 'length', 'max'=>255), array('created_user_id', 'length', 'max'=>10), - array('created_date, name, display_order, active, created_user_id, last_modified_user_id, last_modified_date, locations', 'safe'), + array('created_date, name, display_order, active, created_user_id, last_modified_user_id, last_modified_date, locations, all_locations', 'safe'), array('id, caption, active', 'safe', 'on'=>'search'), ); } @@ -49,7 +49,10 @@ public function relations() // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return [ - 'locations' => [self::MANY_MANY, 'OphDrPrescription_DispenseLocation', 'ophdrprescription_dispense_condition_assignment(dispense_condition_id, dispense_location_id)'], + 'all_locations' => [self::MANY_MANY,'OphDrPrescription_DispenseLocation','ophdrprescription_dispense_condition_assignment(dispense_condition_id, dispense_location_id)'], + + 'locations' => [self::MANY_MANY, + 'OphDrPrescription_DispenseLocation','ophdrprescription_dispense_condition_assignment(dispense_condition_id, dispense_location_id)','condition'=>'locations.active=1' ], ]; } diff --git a/protected/modules/OphDrPrescription/modules/OphDrPrescriptionAdmin/controllers/DispenseConditionController.php b/protected/modules/OphDrPrescription/modules/OphDrPrescriptionAdmin/controllers/DispenseConditionController.php index 80e41a0fa9..8484048023 100644 --- a/protected/modules/OphDrPrescription/modules/OphDrPrescriptionAdmin/controllers/DispenseConditionController.php +++ b/protected/modules/OphDrPrescription/modules/OphDrPrescriptionAdmin/controllers/DispenseConditionController.php @@ -72,7 +72,7 @@ private function saveModel($model) { if (Yii::app()->request->isPostRequest) { $model->attributes = $_POST['OphDrPrescription_DispenseCondition']; - $model->locations = isset($_POST['OphDrPrescription_DispenseCondition']['locations']) ? $_POST['OphDrPrescription_DispenseCondition']['locations'] : []; + $model->all_locations = isset($_POST['OphDrPrescription_DispenseCondition']['all_locations']) ? $_POST['OphDrPrescription_DispenseCondition']['all_locations'] : []; $model->display_order = isset($model->id) ? $model->display_order : $model->getNextHighestDisplayOrder(1); return $model->save(); diff --git a/protected/modules/OphDrPrescription/modules/OphDrPrescriptionAdmin/views/admin/form_OphDrPrescription_DispenseCondition.php b/protected/modules/OphDrPrescription/modules/OphDrPrescriptionAdmin/views/admin/form_OphDrPrescription_DispenseCondition.php index 4cf3d06bcb..370df0f26b 100644 --- a/protected/modules/OphDrPrescription/modules/OphDrPrescriptionAdmin/views/admin/form_OphDrPrescription_DispenseCondition.php +++ b/protected/modules/OphDrPrescription/modules/OphDrPrescriptionAdmin/views/admin/form_OphDrPrescription_DispenseCondition.php @@ -44,10 +44,10 @@ multiSelectList( $model, - CHtml::modelName($model).'[locations]', - 'locations', + CHtml::modelName($model).'[all_locations]', + 'all_locations', 'id', - CHtml::listData(OphDrPrescription_DispenseLocation::model()->findAll(array('order' => 'display_order')), 'id', 'name'), + CHtml::listData(OphDrPrescription_DispenseLocation::model()->findAll(array('order' => 'display_order')), 'id', 'name', 'active'), null, array('empty' => '- Add -', 'label' => 'Locations', 'nowrapper' => true, 'class' => 'cols-full') ) ?> diff --git a/protected/widgets/MultiSelectList.php b/protected/widgets/MultiSelectList.php index b4cc1fc1f5..19352826af 100644 --- a/protected/widgets/MultiSelectList.php +++ b/protected/widgets/MultiSelectList.php @@ -34,7 +34,18 @@ class MultiSelectList extends BaseFieldWidget public function init() { - $this->filtered_options = $this->options; + // only use array 1 if we get a multidemension array (for example when passing in active, you still want the allocated entries to display but give the active ones the option to be selected) + $lasttval = end($this->options); + $firstval = reset($this->options); + if (isset($firstval)&& is_array($firstval)) { + $safe_options = $this->options; + if (isset($safe_options[1])) { + $this->filtered_options = $safe_options[1]; + } + $this->options = array_merge ( $firstval, $lasttval); + } else { + $this->filtered_options = $this->options; + } if (empty($_POST)) { if ($this->element && $this->element->{$this->relation}) { From 913bcd6b439270ea767b357da3e2d210716fead5 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 6 Jan 2021 11:47:05 +1100 Subject: [PATCH 003/110] OE-10601: Added dockerisation support for more config (#5254) * Added support for env vars for more settings for dockerisation - patient identifiers - demographics content - exclude admin structure param list - contact practice associate model - patient import setting - removed default_country and gp_label so it doesn't override front-end config * [CodeFactor] Apply fixes to commit 0113a03 * Fixing radio button ID to be programmatic * Changed active record to SQL statement in migration * Fixed the indentation in the OE Header. * Added support for more environment variables in settings - added general_practitioner_label - added gp_label - added default_country - set default to null so database can take priority if not set - modified support provider and url to let database value can take priority if not set * OE-10601 - set defaults for tech support provider * remove patient-identifiers section from core * OE-10601 - correction to migrate down * Re-adding patient identifier envs temporarily to allow configuration * Updated version number Co-authored-by: codefactor-io Co-authored-by: Gurpreet Singh Co-authored-by: biskyt --- protected/config/core/common.php | 72 +++++++++++-------- .../m201124_074945_import_patient_config.php | 22 ++++++ ...4956_add_default_tech_support_provider.php | 20 ++++++ 3 files changed, 83 insertions(+), 31 deletions(-) create mode 100644 protected/migrations/m201124_074945_import_patient_config.php create mode 100644 protected/migrations/m201126_104956_add_default_tech_support_provider.php diff --git a/protected/config/core/common.php b/protected/config/core/common.php index 2df130a4e9..99ba32bc18 100644 --- a/protected/config/core/common.php +++ b/protected/config/core/common.php @@ -1,20 +1,20 @@ . - * - * @link http://www.openeyes.org.uk - * - * @author OpenEyes - * @copyright Copyright (c) 2020 Apperta Foundation - * @license http://www.gnu.org/licenses/agpl-3.0.html The GNU Affero General Public License V3.0 - */ +* OpenEyes. +* +* (C) Apperta Foundation, 2020 +* This file is part of OpenEyes. +* OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +* OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. +* You should have received a copy of the GNU Affero General Public License along with OpenEyes in a file titled COPYING. If not, see . +* +* @link http://www.openeyes.org.uk +* +* @author OpenEyes +* @copyright Copyright (c) 2020 Apperta Foundation +* @license http://www.gnu.org/licenses/agpl-3.0.html The GNU Affero General Public License V3.0 +*/ // If the old db.conf file (pre docker) exists, use it. Else read environment variable, else read docker secrets // Note, docker secrets are the recommended approach for docker environments @@ -347,6 +347,11 @@ 'specialty_sort' => array(130, 'SUP'), 'hos_num_regex' => !empty(trim(getenv('OE_HOS_NUM_REGEX'))) ? getenv('OE_HOS_NUM_REGEX') : '/^([0-9]{1,9})$/', 'pad_hos_num' => !empty(trim(getenv('OE_HOS_NUM_PAD'))) ? getenv('OE_HOS_NUM_PAD') : '%07s', + 'nhs_num_label' => !empty(trim(getenv('OE_NHS_NUM_LABEL'))) ? getenv('OE_NHS_NUM_LABEL') : null, + 'hos_num_label' => !empty(trim(getenv('OE_HOS_NUM_LABEL'))) ? getenv('OE_HOS_NUM_LABEL') : null, + // Parameter for short labels in patient panel, or anywhere real estate is at a premium + 'nhs_num_label_short' => !empty(trim(getenv('OE_NHS_NUM_LABEL_SHORT'))) ? getenv('OE_NHS_NUM_LABEL_SHORT') : null, + 'hos_num_label_short' => !empty(trim(getenv('OE_HOS_NUM_LABEL_SHORT'))) ? getenv('OE_HOS_NUM_LABEL_SHORT') : null, 'profile_user_can_edit' => true, 'profile_user_show_menu' => true, 'profile_user_can_change_password' => true, @@ -441,6 +446,13 @@ 'uri' => '/Analytics/analyticsReports', 'position' => 11, ), + 'patient_import' => array( + 'title' => 'Import Patients', + 'uri' => 'csv/upload?context=patients', + 'position' => 47, + 'requires_setting' => array('setting_key' => 'enable_patient_import', 'required_value' => 'on'), + 'restricted' => array('admin'), + ), /* //TODO: not yet implemented 'worklist' => array( @@ -519,7 +531,7 @@ * */ 'docman_filename_format' => getenv('DOCMAN_FILENAME_FORMAT') ?: 'OPENEYES_{prefix}{patient.hos_num}_{event.id}_{random}', - + /** * Set to false to suppress XML generation for electronic correspondence */ @@ -665,43 +677,41 @@ 'nhs_num_status' => 'hidden' ], // Set the parameter below to true if you want to use practitioner praactice associations feature - 'use_contact_practice_associate_model' => false, + 'use_contact_practice_associate_model' => !empty(trim(getenv('OE_USE_CPA_MODEL'))) ? filter_var(getenv('OE_USE_CPA_MODEL'), FILTER_VALIDATE_BOOLEAN) : false, // Set the parameter below to indicate whether PAS is being used or not 'pas_in_use' => true, // List the visibility of elements in the Patient Panel Popup - Demographics. Setting them as true or false 'demographics_content' => [ - 'mobile' => true, - 'next_of_kin' => true, - 'pas' => true, + 'mobile' => !empty(trim(getenv('OE_DEMOGRAPHICS_MOBILE'))) ? filter_var(getenv('OE_DEMOGRAPHICS_MOBILE'), FILTER_VALIDATE_BOOLEAN) : true, + 'next_of_kin' => !empty(trim(getenv('OE_DEMOGRAPHICS_NOK'))) ? filter_var(getenv('OE_DEMOGRAPHICS_NOK'), FILTER_VALIDATE_BOOLEAN) : true, + 'pas' => !empty(trim(getenv('OE_DEMOGRAPHICS_PAS'))) ? filter_var(getenv('OE_DEMOGRAPHICS_PAS'), FILTER_VALIDATE_BOOLEAN) : true, ], // allow null check is to set whether duplicate checks for patient are to be performed on null RVEEh UR number or any further added patient identifiers 'patient_identifiers' => array( 'RVEEH_UR' => array( - 'code' => 'RVEEH_UR', - 'label' => 'Patient Identifier', - 'unique' => true, - 'allow_null_check' => false, + 'code' => !empty(trim(getenv('OE_PATIENT_IDENTIFIER_CODE'))) ? getenv('OE_PATIENT_IDENTIFIER_CODE') : 'RVEEH_UR', + 'label' => !empty(trim(getenv('OE_PATIENT_IDENTIFIER_LABEL'))) ? getenv('OE_PATIENT_IDENTIFIER_LABEL') : 'Patient Identifier', + 'unique' => !empty(trim(getenv('OE_PATIENT_IDENTIFIER_UNIQUE'))) ? filter_var(getenv('OE_PATIENT_IDENTIFIER_UNIQUE'), FILTER_VALIDATE_BOOLEAN) : true, + 'allow_null_check' => !empty(trim(getenv('OE_PATIENT_IDENTIFIER_ALLOW_NULL'))) ? filter_var(getenv('OE_PATIENT_IDENTIFIER_ALLOW_NULL'), FILTER_VALIDATE_BOOLEAN) : false ) ), 'canViewSummary' => true, - 'default_country' => 'United Kingdom', + 'default_country' => !empty(trim(getenv('OE_DEFAULT_COUNTRY'))) ? getenv('OE_DEFAULT_COUNTRY') : null, 'default_patient_import_context' => 'Historic Data Entry', 'default_patient_import_subspecialty' => 'GL', // Add elements that need to be excluded from the admin sidebar in settings - 'exclude_admin_structure_param_list' => array( - // 'Worklist', - ), + 'exclude_admin_structure_param_list' => getenv('OE_EXCLUDE_ADMIN_STRUCT_LIST') ? explode(",", getenv('OE_EXCLUDE_ADMIN_STRUCT_LIST')) : array(''), 'oe_version' => '3.6.2n', - // Replace the term "GP" in the UI with whatever is specified in gp_label. E.g, in Australia they are called "Practioners", not "GPs" - 'gp_label' => 'GP', + 'gp_label' => !empty(trim(getenv('OE_GP_LABEL'))) ? getenv('OE_GP_LABEL') : null, + 'general_practitioner_label' => !empty(trim(getenv('OE_GENERAL_PRAC_LABEL'))) ? getenv('OE_GENERAL_PRAC_LABEL') : null, // number of days in the future to retrieve worklists for the automatic dashboard render (0 by default in v3) 'worklist_dashboard_future_days' => 0, // page size of worklists - recommended to be very large by default, as paging is not generally needed here 'worklist_default_pagination_size' => 1000, //// days of the week to be ignored when determining which worklists to render - Mon, Tue etc 'worklist_dashboard_skip_days' => array('NONE'), - 'tech_support_provider' => !empty(trim(getenv(@'OE_TECH_SUPPORT_PROVIDER'))) ? getenv(@'OE_TECH_SUPPORT_PROVIDER') : 'Apperta Foundation', - 'tech_support_url' => !empty(trim(getenv('OE_TECH_SUPPORT_URL'))) ? getenv('OE_TECH_SUPPORT_URL') : 'http://www.apperta.org', + 'tech_support_provider' => !empty(trim(getenv(@'OE_TECH_SUPPORT_PROVIDER'))) ? htmlspecialchars(getenv(@'OE_TECH_SUPPORT_PROVIDER')) : null, + 'tech_support_url' => !empty(trim(getenv('OE_TECH_SUPPORT_URL'))) ? getenv('OE_TECH_SUPPORT_URL') : null, 'pw_restrictions' => array( 'min_length' => getenv('PW_RES_MIN_LEN') ?: 8, 'min_length_message' => getenv('PW_RES_MIN_LEN_MESS') ? htmlspecialchars(getenv('PW_RES_MIN_LEN_MESS')) : 'Passwords must be at least 8 characters long', diff --git a/protected/migrations/m201124_074945_import_patient_config.php b/protected/migrations/m201124_074945_import_patient_config.php new file mode 100644 index 0000000000..3f603fb627 --- /dev/null +++ b/protected/migrations/m201124_074945_import_patient_config.php @@ -0,0 +1,22 @@ +insert('setting_metadata', array( + 'element_type_id' => null, + 'display_order' => 0, + 'field_type_id' => $this->dbConnection->createCommand('SELECT id FROM setting_field_type WHERE name = "Radio buttons"')->queryScalar(), + 'key' => 'enable_patient_import', + 'name' => 'Enable Users to Import Patients using a CSV', + 'data' => serialize(array('on' => 'On', 'off' => 'Off')), + 'default_value' => 'off', + )); + } + + public function safeDown() + { + $this->delete('setting_metadata', '`key` = \'enable_patient_import\''); + } +} diff --git a/protected/migrations/m201126_104956_add_default_tech_support_provider.php b/protected/migrations/m201126_104956_add_default_tech_support_provider.php new file mode 100644 index 0000000000..3abf340f75 --- /dev/null +++ b/protected/migrations/m201126_104956_add_default_tech_support_provider.php @@ -0,0 +1,20 @@ +createIndex('setting_metadata_key_IDX', 'setting_metadata', array('element_type_id', 'key'), true); + + $this->update('setting_metadata', array('default_value' => 'Apperta Foundation'), '`key` = :key_val', array('key_val' => 'tech_support_provider')); + $this->update('setting_metadata', array('default_value' => 'http://www.apperta.org'), '`key` = :key_val', array('key_val' => 'tech_support_url')); + } + + public function safeDown() + { + $this->update('setting_metadata', array('default_value' => null), '`key` = :key_val', array('key_val' => 'tech_support_provider')); + $this->update('setting_metadata', array('default_value' => null), '`key` = :key_val', array('key_val' => 'tech_support_url')); + } +} From 942d14f8b473927571ebef4698db8762aa9b5fa9 Mon Sep 17 00:00:00 2001 From: stefant29 Date: Wed, 6 Jan 2021 12:13:47 +0200 Subject: [PATCH 004/110] Replace all occurrences of commas in drug tallmanLabel and item dosage to prevent bugs in csv files (#5318) Co-authored-by: Justinas Cepkauskas --- .../models/OphDrPrescription_ReportPrescribedDrugs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protected/modules/OphDrPrescription/models/OphDrPrescription_ReportPrescribedDrugs.php b/protected/modules/OphDrPrescription/models/OphDrPrescription_ReportPrescribedDrugs.php index 8bef6dffd5..a1e901e5af 100644 --- a/protected/modules/OphDrPrescription/models/OphDrPrescription_ReportPrescribedDrugs.php +++ b/protected/modules/OphDrPrescription/models/OphDrPrescription_ReportPrescribedDrugs.php @@ -104,8 +104,8 @@ public function toCSV() $drug = new Drug(); $drug->attributes = $item; $output .= $item['hos_num'] . ', ' . $item['last_name'] . ', ' . $item['first_name'] . ', ' . ($item['dob'] ? date('j M Y', strtotime($item['dob'])) : 'Unknown') . ', ' . $item['postcode'] . ', '; - $output .= (date('j M Y', strtotime($item['created_date'])) . ' ' . (substr($item['created_date'], 11, 5))) . ', ' . $drug->tallmanLabel . ', '; - $output .= $item['dose'] . ', ' . $item['frequency'] . ', ' . $item['duration'] . ' ,' . $item['route'] . ' ,' . $item['dispense_condition'] . ' ,' . $item['dispense_location'] . ' ,' . $item['laterality'] . ' ,'; + $output .= (date('j M Y', strtotime($item['created_date'])) . ' ' . (substr($item['created_date'], 11, 5))) . ', ' . str_replace(',', ';', $drug->tallmanLabel) . ', '; + $output .= str_replace(',', ';', $item['dose']) . ', ' . $item['frequency'] . ', ' . $item['duration'] . ' ,' . $item['route'] . ' ,' . $item['dispense_condition'] . ' ,' . $item['dispense_location'] . ' ,' . $item['laterality'] . ' ,'; $output .= $item['user_first_name'] . ' ' . $item['user_last_name'] . ', ' . $item['role'] . ', ' . (date('j M Y', strtotime($item['event_date'])) . ' ' . (substr($item['event_date'], 11, 5))) . ', '; $output .= $item['preservative_free'] ? 'Yes' : 'No'; $output .= "\n"; From 32bd17041afcf25c1f4aacade7889f36dcc3721d Mon Sep 17 00:00:00 2001 From: AdrianKamulegeya Date: Wed, 6 Jan 2021 10:28:36 +0000 Subject: [PATCH 005/110] OE-10543 fix PatientTicketing QueueSet Admin UI (#5290) * OE-10543 fix PatientTicketing QueueSet Admin UI * [CodeFactor] Apply fixes to commit 0592cc1 * OE-10543 minor code fix * OE-10543 code factor change * OE-10543 use const and add STATUS_ prefix Co-authored-by: @=AdrianKamulegeya <@=adrian.kamulegeya@gmail.com> Co-authored-by: codefactor-io Co-authored-by: Justinas Cepkauskas --- .../PatientTicketing/assets/js/admin.js | 16 +-- .../PatientTicketing/models/QueueSet.php | 4 + .../views/admin/form_queueset.php | 115 +++++++++++++----- .../views/admin/form_queueset_radio.php | 37 ++++++ .../PatientTicketing/views/admin/index.php | 41 +++---- .../views/admin/queue_nav_item.php | 26 ++-- 6 files changed, 163 insertions(+), 76 deletions(-) create mode 100644 protected/modules/PatientTicketing/views/admin/form_queueset_radio.php diff --git a/protected/modules/PatientTicketing/assets/js/admin.js b/protected/modules/PatientTicketing/assets/js/admin.js index c9d5e3ce96..5da80bddae 100644 --- a/protected/modules/PatientTicketing/assets/js/admin.js +++ b/protected/modules/PatientTicketing/assets/js/admin.js @@ -319,13 +319,14 @@ }); $(this).on('click', '.queueset-link', function () { - queueAdmin.displayQueue($(this).parents('li').data('initial-queue-id')); + queueAdmin.displayQueue($(this).parents('tr').data('initial-queue-id')); }); - $(this).on('click', '.queueset-admin .permissions', function () { - var queueSetId = $(this).parents('li').data('queueset-id'); + $(this).on('click', '.queueset-admin .permissions', function (e) { + e.preventDefault(); + var queueSetId = $(this).parents('tr').data('queueset-id'); queueAdmin.editQueueSetPermissions(queueSetId); - queueAdmin.displayQueue($(this).parents('li').data('initial-queue-id')); + queueAdmin.displayQueue($(this).parents('tr').data('initial-queue-id')); }); $(this).on('click', '.add-child', function (e) { @@ -333,10 +334,11 @@ queueAdmin.addQueue(queueId); }); - $(this).on('click', '.queueset-admin .edit', function () { - var queueSetId = $(this).parents('li').data('queueset-id'); + $(this).on('click', '.queueset-admin .edit', function (e) { + e.preventDefault(); + var queueSetId = $(this).parents('tr').data('queueset-id'); queueAdmin.editQueueSet(queueSetId); - queueAdmin.displayQueue($(this).parents('li').data('initial-queue-id')); + queueAdmin.displayQueue($(this).parents('tr').data('initial-queue-id')); }); $(this).on('click', '.queue .edit', function () { diff --git a/protected/modules/PatientTicketing/models/QueueSet.php b/protected/modules/PatientTicketing/models/QueueSet.php index dfe1b5ace3..257f53dbba 100644 --- a/protected/modules/PatientTicketing/models/QueueSet.php +++ b/protected/modules/PatientTicketing/models/QueueSet.php @@ -20,6 +20,10 @@ class QueueSet extends \BaseActiveRecordVersioned { + + const STATUS_YES = '1'; + const STATUS_NO = '2'; + public $auto_update_relations = true; /** diff --git a/protected/modules/PatientTicketing/views/admin/form_queueset.php b/protected/modules/PatientTicketing/views/admin/form_queueset.php index 6fd45d26ed..e9ba17c3ec 100644 --- a/protected/modules/PatientTicketing/views/admin/form_queueset.php +++ b/protected/modules/PatientTicketing/views/admin/form_queueset.php @@ -29,38 +29,91 @@ $this->renderPartial('//elements/form_errors', array('errors' => $errors, 'bottom' => false)); ?> -

Queue Set:

-
- service->getService('PatientTicketing_QueueSet')) { - throw new Exception('Service not found: PatientTicketing_QueueSet'); - } - $queueset_resource = $service->modelToResource($queueset); - ?> - dropdownList($queueset, 'category_id', \CHtml::listData(OEModule\PatientTicketing\models\QueueSetCategory::model()->activeOrPk($queueset->category_id)->findAll(), 'id', 'name')); ?> - textField($queueset, 'name'); ?> - textArea($queueset, 'description'); ?> - radioBoolean($queueset, 'allow_null_priority'); ?> - radioBoolean($queueset, 'summary_link'); ?> - dropDownList($queueset, 'default_queue_id', \CHtml::listData($service->getQueueSetQueues($queueset_resource), 'id', 'name'), array('empty' => '- None -'))?> -
- -
-

Search Filters:

- radioBoolean($queueset, 'filter_priority'); ?> - radioBoolean($queueset, 'filter_subspecialty'); ?> - radioBoolean($queueset, 'filter_firm'); ?> - radioBoolean($queueset, 'filter_closed_tickets'); ?> -
- +

Queue Set

+ service->getService('PatientTicketing_QueueSet')) { + throw new Exception('Service not found: PatientTicketing_QueueSet'); + } + $queueset_resource = $service->modelToResource($queueset); + ?> + + + + + + + + + + + + + + + + + + + renderPartial('form_queueset_radio', ['queueset' => $queueset, 'field' => $field]); + } ?> + + + + + +
getAttributeLabel('category_id') ?> + activeOrPk($queueset->category_id)->findAll(), 'id', 'name'), + ['class' => 'cols-11']); ?> +
getAttributeLabel('name') ?> 'cols-full']); ?>
getAttributeLabel('description') ?> 'cols-full']); ?> +
getAttributeLabel('default_queue_id') ?>getQueueSetQueues($queueset_resource), 'id', 'name'), + ['class' => 'cols-11', 'empty' => '- None -']) ?> +
+

Search Filters

+ + + + + + + renderPartial('form_queueset_radio', ['queueset' => $queueset, 'field' => $field]); + } ?> + +
-

Initial Queue:

-
- textField($queue, 'name'); ?> - textArea($queue, 'description'); ?> - textArea($queue, 'report_definition'); ?> - textArea($queue, 'assignment_fields'); ?> -
+

Initial Queue

+ + + + + + + + + + + + + + + + + +
getAttributeLabel('name') ?> 'cols-full']); ?>
getAttributeLabel($field) ?> 'cols-full']); ?> +
. + * + * @package OpenEyes + * @link http://www.openeyes.org.uk + * @author OpenEyes + * @copyright Copyright (c) 2020, OpenEyes Foundation + * @license http://www.gnu.org/licenses/agpl-3.0.html The GNU Affero General Public License V3.0 + */ +use OEModule\PatientTicketing\models\QueueSet; +?> + + getAttributeLabel($field) ?> + + + + + diff --git a/protected/modules/PatientTicketing/views/admin/index.php b/protected/modules/PatientTicketing/views/admin/index.php index 9037e26e3b..6103199e55 100644 --- a/protected/modules/PatientTicketing/views/admin/index.php +++ b/protected/modules/PatientTicketing/views/admin/index.php @@ -22,36 +22,23 @@ $widgetPath = $assetManager->publish('protected/widgets/js'); Yii::app()->clientScript->registerScriptFile($widgetPath . '/MultiSelectList.js'); ?> - -
- -
- -
- +

+
- - - $set) : ?> - - - - - - - - - - - -
- renderPartial('queue_nav_item', array('queueset' => $set)); ?> -
- -
+
+ + + $set) { + $this->renderPartial('queue_nav_item', array('queueset' => $set)); + } ?> + +
+
+
+ - +
diff --git a/protected/modules/PatientTicketing/views/admin/queue_nav_item.php b/protected/modules/PatientTicketing/views/admin/queue_nav_item.php index a384ddb932..e440b5d654 100644 --- a/protected/modules/PatientTicketing/views/admin/queue_nav_item.php +++ b/protected/modules/PatientTicketing/views/admin/queue_nav_item.php @@ -20,14 +20,18 @@ initial_queue; ?> -
  • - name?> - - - edit - | - permissions - - -
  • + + + + + + + + + + + + + From d291ec62f4c9fdd7f86187fefb40b1e023634b3d Mon Sep 17 00:00:00 2001 From: biskyt Date: Thu, 7 Jan 2021 15:37:13 +0000 Subject: [PATCH 006/110] Set a requirement for php ^7.4 in composer --- composer.json | 1 + composer.lock | 366 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 234 insertions(+), 133 deletions(-) diff --git a/composer.json b/composer.json index 55804511b3..9f07985d0c 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "license": "AGPL-3.0-only", "description": "Electronic Patient Record system for use in Ophthalmology clinics", "require": { + "php": "^7.4", "yiisoft/yii": "1.1.22", "rlanvin/php-rrule": "2.2.0", "endroid/qr-code": "^1.7", diff --git a/composer.lock b/composer.lock index f308bb89d8..f275955cd8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9a3659ca3d4b8bf0d44e16fb29a6d33e", + "content-hash": "a282052ec78d9a3f3268d23ba9d15db4", "packages": [ { "name": "clue/socket-raw", - "version": "v1.4.1", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/clue/php-socket-raw.git", - "reference": "00ab102d061f6cdb895e79dd4d69140c7bda31cc" + "reference": "089ffa05fa75bdc4e919aac44bbc435b3ef640ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/php-socket-raw/zipball/00ab102d061f6cdb895e79dd4d69140c7bda31cc", - "reference": "00ab102d061f6cdb895e79dd4d69140c7bda31cc", + "url": "https://api.github.com/repos/clue/php-socket-raw/zipball/089ffa05fa75bdc4e919aac44bbc435b3ef640ef", + "reference": "089ffa05fa75bdc4e919aac44bbc435b3ef640ef", "shasum": "" }, "require": { @@ -25,7 +25,7 @@ "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.0 || ^5.2 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "type": "library", "autoload": { @@ -43,7 +43,7 @@ "email": "christian@clue.engineering" } ], - "description": "Simple and lightweight OOP wrapper for PHP's low-level sockets extension (ext-sockets)", + "description": "Simple and lightweight OOP wrapper for PHP's low-level sockets extension (ext-sockets).", "homepage": "https://github.com/clue/php-socket-raw", "keywords": [ "Socket", @@ -61,9 +61,19 @@ ], "support": { "issues": "https://github.com/clue/php-socket-raw/issues", - "source": "https://github.com/clue/php-socket-raw/tree/v1.4.1" + "source": "https://github.com/clue/php-socket-raw/tree/v1.5.0" }, - "time": "2019-10-28T12:32:07+00:00" + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-11-27T13:16:18+00:00" }, { "name": "endroid/qr-code", @@ -129,6 +139,60 @@ }, "time": "2017-04-08T09:13:59+00:00" }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.13.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/08e27c97e4c6ed02f37c5b2b20488046c8d90d75", + "reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd" + }, + "type": "library", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ], + "exclude-from-classmap": [ + "/library/HTMLPurifier/Language/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "support": { + "issues": "https://github.com/ezyang/htmlpurifier/issues", + "source": "https://github.com/ezyang/htmlpurifier/tree/master" + }, + "time": "2020-06-29T00:56:53+00:00" + }, { "name": "maennchen/zipstream-php", "version": "2.1.0", @@ -552,16 +616,16 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "1.15.0", + "version": "1.16.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f" + "reference": "76d4323b85129d0c368149c831a07a3e258b2b50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f", - "reference": "a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/76d4323b85129d0c368149c831a07a3e258b2b50", + "reference": "76d4323b85129d0c368149c831a07a3e258b2b50", "shasum": "" }, "require": { @@ -578,10 +642,11 @@ "ext-xmlwriter": "*", "ext-zip": "*", "ext-zlib": "*", + "ezyang/htmlpurifier": "^4.13", "maennchen/zipstream-php": "^2.1", - "markbaker/complex": "^1.5|^2.0", - "markbaker/matrix": "^1.2|^2.0", - "php": "^7.2|^8.0", + "markbaker/complex": "^1.5||^2.0", + "markbaker/matrix": "^1.2||^2.0", + "php": "^7.2||^8.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", "psr/simple-cache": "^1.0" @@ -592,7 +657,7 @@ "jpgraph/jpgraph": "^4.0", "mpdf/mpdf": "^8.0", "phpcompatibility/php-compatibility": "^9.3", - "phpunit/phpunit": "^8.5|^9.3", + "phpunit/phpunit": "^8.5||^9.3", "squizlabs/php_codesniffer": "^3.5", "tecnickcom/tcpdf": "^6.3" }, @@ -646,9 +711,9 @@ ], "support": { "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", - "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.15.0" + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.16.0" }, - "time": "2020-10-11T13:20:59+00:00" + "time": "2020-12-31T18:03:49+00:00" }, { "name": "phpseclib/mcrypt_compat", @@ -709,16 +774,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.29", + "version": "2.0.30", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "497856a8d997f640b4a516062f84228a772a48a8" + "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/497856a8d997f640b4a516062f84228a772a48a8", - "reference": "497856a8d997f640b4a516062f84228a772a48a8", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/136b9ca7eebef78be14abf90d65c5e57b6bc5d36", + "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36", "shasum": "" }, "require": { @@ -726,7 +791,7 @@ }, "require-dev": { "phing/phing": "~2.7", - "phpunit/phpunit": "^4.8.35|^5.7|^6.0", + "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", "squizlabs/php_codesniffer": "~2.0" }, "suggest": { @@ -798,7 +863,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/2.0" + "source": "https://github.com/phpseclib/phpseclib/tree/2.0.30" }, "funding": [ { @@ -814,7 +879,7 @@ "type": "tidelift" } ], - "time": "2020-09-08T04:24:43+00:00" + "time": "2020-12-17T05:42:04+00:00" }, { "name": "psr/http-client", @@ -1170,21 +1235,21 @@ }, { "name": "setasign/fpdi", - "version": "v2.3.4", + "version": "v2.3.5", "source": { "type": "git", "url": "https://github.com/Setasign/FPDI.git", - "reference": "2b5fb811c04f937ef257ef3f798cebeded33c136" + "reference": "f2246c8669bd25834f5c264425eb0e250d7a9312" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDI/zipball/2b5fb811c04f937ef257ef3f798cebeded33c136", - "reference": "2b5fb811c04f937ef257ef3f798cebeded33c136", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/f2246c8669bd25834f5c264425eb0e250d7a9312", + "reference": "f2246c8669bd25834f5c264425eb0e250d7a9312", "shasum": "" }, "require": { "ext-zlib": "*", - "php": "^5.6 || ^7.0" + "php": "^5.6 || ^7.0 || ^8.0" }, "conflict": { "setasign/tfpdf": "<1.31" @@ -1230,7 +1295,7 @@ ], "support": { "issues": "https://github.com/Setasign/FPDI/issues", - "source": "https://github.com/Setasign/FPDI/tree/master" + "source": "https://github.com/Setasign/FPDI/tree/v2.3.5" }, "funding": [ { @@ -1238,11 +1303,11 @@ "type": "tidelift" } ], - "time": "2020-08-27T06:55:47+00:00" + "time": "2020-12-03T13:40:03+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1284,7 +1349,7 @@ "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v3.4.46" + "source": "https://github.com/symfony/filesystem/tree/v3.4.47" }, "funding": [ { @@ -1304,7 +1369,7 @@ }, { "name": "symfony/options-resolver", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -1350,7 +1415,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v3.4.46" + "source": "https://github.com/symfony/options-resolver/tree/v3.4.47" }, "funding": [ { @@ -1529,16 +1594,16 @@ }, { "name": "symfony/process", - "version": "v4.4.16", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2f4b049fb80ca5e9874615a2a85dc2a502090f05" + "reference": "075316ff72233ce3d04a9743414292e834f2cb4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2f4b049fb80ca5e9874615a2a85dc2a502090f05", - "reference": "2f4b049fb80ca5e9874615a2a85dc2a502090f05", + "url": "https://api.github.com/repos/symfony/process/zipball/075316ff72233ce3d04a9743414292e834f2cb4a", + "reference": "075316ff72233ce3d04a9743414292e834f2cb4a", "shasum": "" }, "require": { @@ -1570,7 +1635,7 @@ "description": "Symfony Process Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.16" + "source": "https://github.com/symfony/process/tree/v4.4.18" }, "funding": [ { @@ -1586,7 +1651,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T11:50:19+00:00" + "time": "2020-12-08T16:59:59+00:00" }, { "name": "vierbergenlars/php-semver", @@ -2185,16 +2250,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.16.7", + "version": "v2.17.3", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "4e35806a6d7d8510d6842ae932e8832363d22c87" + "reference": "bd32f5dd72cdfc7b53f54077f980e144bfa2f595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/4e35806a6d7d8510d6842ae932e8832363d22c87", - "reference": "4e35806a6d7d8510d6842ae932e8832363d22c87", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/bd32f5dd72cdfc7b53f54077f980e144bfa2f595", + "reference": "bd32f5dd72cdfc7b53f54077f980e144bfa2f595", "shasum": "" }, "require": { @@ -2203,7 +2268,7 @@ "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "php": "^7.1", + "php": "^5.6 || ^7.0 || ^8.0", "php-cs-fixer/diff": "^1.3", "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", @@ -2220,12 +2285,15 @@ "justinrainbow/json-schema": "^5.0", "keradus/cli-executor": "^1.4", "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.1", + "php-coveralls/php-coveralls": "^2.4.2", "php-cs-fixer/accessible-object": "^1.0", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1", + "phpspec/prophecy-phpunit": "^1.1 || ^2.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.4.4 <9.5", + "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", + "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", "symfony/phpunit-bridge": "^5.1", "symfony/yaml": "^3.0 || ^4.0 || ^5.0" }, @@ -2274,7 +2342,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.16.7" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.17.3" }, "funding": [ { @@ -2282,20 +2350,20 @@ "type": "github" } ], - "time": "2020-10-27T22:44:27+00:00" + "time": "2020-12-24T11:14:44+00:00" }, { "name": "fzaninotto/faker", - "version": "v1.9.1", + "version": "v1.9.2", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" + "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", + "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", "shasum": "" }, "require": { @@ -2334,10 +2402,10 @@ ], "support": { "issues": "https://github.com/fzaninotto/Faker/issues", - "source": "https://github.com/fzaninotto/Faker/tree/v1.9.1" + "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" }, "abandoned": true, - "time": "2019-12-12T13:22:17+00:00" + "time": "2020-12-11T09:56:16+00:00" }, { "name": "myclabs/deep-copy", @@ -3594,23 +3662,23 @@ }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -3637,9 +3705,15 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" }, - "time": "2017-03-04T06:30:41+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:15:22+00:00" }, { "name": "sebastian/comparator", @@ -3821,20 +3895,20 @@ }, { "name": "sebastian/exporter", - "version": "3.1.2", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/6b853149eab67d4da22291d36f5b0631c0fd856e", + "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.0", "sebastian/recursion-context": "^3.0" }, "require-dev": { @@ -3886,9 +3960,15 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3" }, - "time": "2019-09-14T09:02:43+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:47:53+00:00" }, { "name": "sebastian/finder-facade", @@ -3995,20 +4075,20 @@ }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.0", "sebastian/object-reflector": "^1.1.1", "sebastian/recursion-context": "^3.0" }, @@ -4040,26 +4120,32 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" }, - "time": "2017-08-03T12:35:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:40:27+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" @@ -4089,9 +4175,15 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" }, - "time": "2017-03-29T09:07:27+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:37:18+00:00" }, { "name": "sebastian/phpcpd", @@ -4149,20 +4241,20 @@ }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" @@ -4183,14 +4275,14 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" @@ -4200,9 +4292,15 @@ "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" }, - "time": "2017-03-03T06:23:57+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:34:24+00:00" }, { "name": "sebastian/resource-operations", @@ -4355,7 +4453,7 @@ }, { "name": "symfony/config", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -4411,7 +4509,7 @@ "description": "Symfony Config Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v3.4.46" + "source": "https://github.com/symfony/config/tree/v3.4.47" }, "funding": [ { @@ -4431,16 +4529,16 @@ }, { "name": "symfony/console", - "version": "v4.4.16", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5" + "reference": "12e071278e396cc3e1c149857337e9e192deca0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5", - "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5", + "url": "https://api.github.com/repos/symfony/console/zipball/12e071278e396cc3e1c149857337e9e192deca0b", + "reference": "12e071278e396cc3e1c149857337e9e192deca0b", "shasum": "" }, "require": { @@ -4500,7 +4598,7 @@ "description": "Symfony Console Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.16" + "source": "https://github.com/symfony/console/tree/v4.4.18" }, "funding": [ { @@ -4516,11 +4614,11 @@ "type": "tidelift" } ], - "time": "2020-10-24T11:50:19+00:00" + "time": "2020-12-18T07:41:31+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -4583,7 +4681,7 @@ "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v3.4.46" + "source": "https://github.com/symfony/dependency-injection/tree/v3.4.47" }, "funding": [ { @@ -4603,16 +4701,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.16", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "4204f13d2d0b7ad09454f221bb2195fccdf1fe98" + "reference": "5d4c874b0eb1c32d40328a09dbc37307a5a910b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4204f13d2d0b7ad09454f221bb2195fccdf1fe98", - "reference": "4204f13d2d0b7ad09454f221bb2195fccdf1fe98", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5d4c874b0eb1c32d40328a09dbc37307a5a910b0", + "reference": "5d4c874b0eb1c32d40328a09dbc37307a5a910b0", "shasum": "" }, "require": { @@ -4666,7 +4764,7 @@ "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.16" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.18" }, "funding": [ { @@ -4682,7 +4780,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T11:50:19+00:00" + "time": "2020-12-18T07:41:31+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -4765,16 +4863,16 @@ }, { "name": "symfony/finder", - "version": "v5.1.8", + "version": "v5.2.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" + "reference": "0b9231a5922fd7287ba5b411893c0ecd2733e5ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "url": "https://api.github.com/repos/symfony/finder/zipball/0b9231a5922fd7287ba5b411893c0ecd2733e5ba", + "reference": "0b9231a5922fd7287ba5b411893c0ecd2733e5ba", "shasum": "" }, "require": { @@ -4806,7 +4904,7 @@ "description": "Symfony Finder Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.1.8" + "source": "https://github.com/symfony/finder/tree/v5.2.1" }, "funding": [ { @@ -4822,7 +4920,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-12-08T17:02:38+00:00" }, { "name": "symfony/polyfill-php70", @@ -5211,16 +5309,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.1.8", + "version": "v5.2.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5" + "reference": "2b105c0354f39a63038a1d8bf776ee92852813af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/3d9f57c89011f0266e6b1d469e5c0110513859d5", - "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2b105c0354f39a63038a1d8bf776ee92852813af", + "reference": "2b105c0354f39a63038a1d8bf776ee92852813af", "shasum": "" }, "require": { @@ -5253,7 +5351,7 @@ "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.1.8" + "source": "https://github.com/symfony/stopwatch/tree/v5.2.1" }, "funding": [ { @@ -5269,20 +5367,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-01T16:14:45+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.16", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "543cb4dbd45ed803f08a9a65f27fb149b5dd20c2" + "reference": "bbce94f14d73732340740366fcbe63363663a403" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/543cb4dbd45ed803f08a9a65f27fb149b5dd20c2", - "reference": "543cb4dbd45ed803f08a9a65f27fb149b5dd20c2", + "url": "https://api.github.com/repos/symfony/yaml/zipball/bbce94f14d73732340740366fcbe63363663a403", + "reference": "bbce94f14d73732340740366fcbe63363663a403", "shasum": "" }, "require": { @@ -5324,7 +5422,7 @@ "description": "Symfony Yaml Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.16" + "source": "https://github.com/symfony/yaml/tree/v4.4.18" }, "funding": [ { @@ -5340,7 +5438,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T11:50:19+00:00" + "time": "2020-12-08T16:59:59+00:00" }, { "name": "theseer/fdomdocument", @@ -5501,7 +5599,9 @@ }, "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "php": "^7.4" + }, "platform-dev": [], "plugin-api-version": "2.0.0" } From 234d46000bdf98babdbf5fdd08eda3ee81f29a17 Mon Sep 17 00:00:00 2001 From: biskyt Date: Thu, 7 Jan 2021 15:39:59 +0000 Subject: [PATCH 007/110] update version number --- protected/config/core/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protected/config/core/common.php b/protected/config/core/common.php index 06f3e16886..9322aabd87 100644 --- a/protected/config/core/common.php +++ b/protected/config/core/common.php @@ -691,7 +691,7 @@ 'exclude_admin_structure_param_list' => array( // 'Worklist', ), - 'oe_version' => '4.0', + 'oe_version' => '4.0.1n', // Replace the term "GP" in the UI with whatever is specified in gp_label. E.g, in Australia they are called "Practioners", not "GPs" 'gp_label' => 'GP', // number of days in the future to retrieve worklists for the automatic dashboard render (0 by default in v3) From edb454ed364f71078708a8ac5cd0e3eb0da1a4f4 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Sat, 9 Jan 2021 08:59:55 +0000 Subject: [PATCH 008/110] fix to count call for displaying risks in print view (#5371) --- .../OphCiExamination/widgets/views/HistoryRisks_event_print.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protected/modules/OphCiExamination/widgets/views/HistoryRisks_event_print.php b/protected/modules/OphCiExamination/widgets/views/HistoryRisks_event_print.php index ae3a174cfe..0af707ddee 100755 --- a/protected/modules/OphCiExamination/widgets/views/HistoryRisks_event_print.php +++ b/protected/modules/OphCiExamination/widgets/views/HistoryRisks_event_print.php @@ -48,7 +48,7 @@ - 0)) { ?> + 0) { ?> getDisplayRisk() ?> From c10953d02be3f48251cff5b3b0f1e73e2a6d7a33 Mon Sep 17 00:00:00 2001 From: AdrianKamulegeya Date: Tue, 12 Jan 2021 12:13:22 +0000 Subject: [PATCH 009/110] =?UTF-8?q?OE-10598=20no=20systemic/ophthalmic=20m?= =?UTF-8?q?edications=20date=20loads=20from=20previous=20=E2=80=A6=20(#537?= =?UTF-8?q?4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protected/config/core/common.php | 2 +- .../models/HistoryMedications.php | 2 ++ .../views/default/view_summary.php | 8 ++++---- .../widgets/js/HistoryMedications.js | 16 ++++++++-------- .../views/HistoryMedications_patient_mode.php | 4 ++-- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/protected/config/core/common.php b/protected/config/core/common.php index 9322aabd87..bffd2dc09a 100644 --- a/protected/config/core/common.php +++ b/protected/config/core/common.php @@ -112,7 +112,7 @@ ), 'cacheBuster' => array( 'class' => 'CacheBuster', - 'time' => '202101041029', + 'time' => '202101111444', ), 'clientScript' => array( 'class' => 'ClientScript', diff --git a/protected/modules/OphCiExamination/models/HistoryMedications.php b/protected/modules/OphCiExamination/models/HistoryMedications.php index bce7fb830c..bb54de5ae4 100644 --- a/protected/modules/OphCiExamination/models/HistoryMedications.php +++ b/protected/modules/OphCiExamination/models/HistoryMedications.php @@ -133,6 +133,8 @@ public function loadFromExisting($element) $new->is_copied_from_previous_event = true; $entries[] = $new; } + $this->no_systemic_medications_date = $element->no_systemic_medications_date; + $this->no_ophthalmic_medications_date = $element->no_ophthalmic_medications_date; $this->entries = $entries; $this->assortEntries(); $this->originalAttributes = $this->getAttributes(); diff --git a/protected/modules/OphCiExamination/views/default/view_summary.php b/protected/modules/OphCiExamination/views/default/view_summary.php index b5bde8727d..5ead50a6b9 100644 --- a/protected/modules/OphCiExamination/views/default/view_summary.php +++ b/protected/modules/OphCiExamination/views/default/view_summary.php @@ -69,8 +69,8 @@
    Nil recorded this examination
    - no_ophthalmic_medications_date) { ?> -
    + no_ophthalmic_medications_date) { ?> +
    Patient takes no eye medications
    @@ -227,8 +227,8 @@
    Nil recorded this examination
    - no_systemic_medications_date) { ?> -
    + no_systemic_medications_date) { ?> +
    Patient takes no systemic medications
    diff --git a/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js b/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js index 604d8536d2..62f8cff22b 100644 --- a/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js +++ b/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js @@ -144,12 +144,12 @@ HistoryMedicationsController._defaultOptions = { let controller = this; $(document).ready(function () { + controller.hideNoMedications(); if (controller.$noSystemicMedicationsFld.prop('checked') && controller.$noOphthalmicMedicationsFld.prop('checked')) { controller.$table.slice(2).hide(); controller.$popup.hide(); $(controller.options.medicationsOptionsTable).find('thead th:first-child, thead th:nth-child(2), tbody tr td:first-child, tbody tr td:nth-child(2)').hide(); } - controller.hideNoMedications(); }); // removal button for table entries @@ -290,19 +290,19 @@ HistoryMedicationsController._defaultOptions = { HistoryMedicationsController.prototype.hideNoMedications = function() { let controller = this; - if (controller.$table.find('tbody tr').length > 0) { - let $rows = controller.$table.find('tbody tr.js-first-row'); - - let no_sys_meds_checked = controller.$noSystemicMedicationsFld.prop('checked'); - let no_oph_meds_checked = controller.$noOphthalmicMedicationsFld.prop('checked'); + let $table = $('#OEModule_OphCiExamination_models_HistoryMedications_entry_table'); + if ($table.find('tbody tr').length > 0) { + let $rows = $table.find('tbody tr.js-first-row'); - let hideSysMed = controller.medicationTypePresentInTable($rows, 'systemic') && !no_sys_meds_checked; - let hideOphMed = controller.medicationTypePresentInTable($rows, 'ophthalmic') && !no_oph_meds_checked; + let hideSysMed = controller.medicationTypePresentInTable($rows, 'systemic'); + let hideOphMed = controller.medicationTypePresentInTable($rows, 'ophthalmic'); if (hideSysMed) { + controller.$noSystemicMedicationsFld.attr('checked', false); controller.$noSystemicMedicationsWrapper.hide(); } if (hideOphMed) { + controller.$noOphthalmicMedicationsFld.attr('checked', false); controller.$noOphthalmicMedicationsWrapper.hide(); } diff --git a/protected/modules/OphCiExamination/widgets/views/HistoryMedications_patient_mode.php b/protected/modules/OphCiExamination/widgets/views/HistoryMedications_patient_mode.php index 4bc0e4bb00..445d9cdf18 100644 --- a/protected/modules/OphCiExamination/widgets/views/HistoryMedications_patient_mode.php +++ b/protected/modules/OphCiExamination/widgets/views/HistoryMedications_patient_mode.php @@ -60,7 +60,7 @@
    no_systemic_medications_date) { ?>
    Nil recorded
    - no_systemic_medications_date) { ?> + no_systemic_medications_date) { ?>
    Patient has had no previous systemic treatment
    @@ -107,7 +107,7 @@
    no_ophthalmic_medications_date) { ?>
    Nil recorded
    - no_ophthalmic_medications_date) { ?> + no_ophthalmic_medications_date) { ?>
    Patient has had no previous eye surgery or laser treatment
    From 4a713abce5872a94686a34e0ed37752e47e7ba9f Mon Sep 17 00:00:00 2001 From: Andrew Pigram Date: Thu, 14 Jan 2021 11:56:42 +1100 Subject: [PATCH 010/110] Fixed issue where 'Other' risks were not being displayed on the whiteboard. (#5403) --- .../OphTrOperationbooking_Whiteboard.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php b/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php index b10b6e733a..73d866f77a 100644 --- a/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php +++ b/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php @@ -1,5 +1,7 @@ name !== 'Anticoagulants'; }); + $other_risk = OphCiExaminationRisk::model()->findByAttributes(array('name' => 'Other')); + $lines = array_merge( $lines, array_map( - static function ($risk) use ($exam_api, $patient, $whiteboard) { - $exam_risk = $exam_api->getRiskByName($patient, $risk->name); + static function ($risk) use ($exam_api, $patient, $whiteboard, $other_risk) { + $risk_name = $risk->name; + + if ($risk->risk_id === $other_risk->id) { + $risk_name = 'Other'; + } + $exam_risk = $exam_api->getRiskByName($patient, $risk_name); $risk_present = $whiteboard->getDisplayHasRisk($exam_risk); if ($risk->name === 'Alpha blockers') { @@ -432,8 +441,14 @@ static function ($risk) use ($exam_api, $patient, $whiteboard) { } if ($risk->comments !== '') { + if ($exam_risk['name'] === 'Other') { + return array($risk_present, '' . $risk->other . ''); + } return array($risk_present, '' . $exam_risk['name'] . ''); } + if ($exam_risk['name'] === 'Other') { + return array($risk_present, $risk->other); + } return array($risk_present, $exam_risk['name']); }, array_filter( From 9e180dcebf77a7b2def05b8b5908272027e2a5be Mon Sep 17 00:00:00 2001 From: Andrew Pigram Date: Thu, 14 Jan 2021 12:15:00 +1100 Subject: [PATCH 011/110] Fixed issue where 'Other' risks were not being displayed on the whiteboard. (#5404) (cherry picked from commit 89b70041aabd1e3c15c33700de870274165232a1) --- .../OphTrOperationbooking_Whiteboard.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php b/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php index 803eca2d21..d79e8fedee 100644 --- a/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php +++ b/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php @@ -1,5 +1,7 @@ name !== 'Anticoagulants'; }); + $other_risk = OphCiExaminationRisk::model()->findByAttributes(array('name' => 'Other')); + $lines = array_merge( $lines, array_map( - static function ($risk) use ($exam_api, $patient, $whiteboard) { - $exam_risk = $exam_api->getRiskByName($patient, $risk->name); + static function ($risk) use ($exam_api, $patient, $whiteboard, $other_risk) { + $risk_name = $risk->name; + + if ($risk->risk_id === $other_risk->id) { + $risk_name = 'Other'; + } + $exam_risk = $exam_api->getRiskByName($patient, $risk_name); $risk_present = $whiteboard->getDisplayHasRisk($exam_risk); if ($risk->name === 'Alpha blockers') { @@ -434,8 +443,14 @@ static function ($risk) use ($exam_api, $patient, $whiteboard) { } if ($risk->comments !== '') { + if ($exam_risk['name'] === 'Other') { + return array($risk_present, '' . $risk->other . ''); + } return array($risk_present, '' . $exam_risk['name'] . ''); } + if ($exam_risk['name'] === 'Other') { + return array($risk_present, $risk->other); + } return array($risk_present, $exam_risk['name']); }, array_filter( From 5155e69d4ff87986f52ff1baff590a1559c420dd Mon Sep 17 00:00:00 2001 From: stefant29 Date: Thu, 14 Jan 2021 16:20:45 +0200 Subject: [PATCH 012/110] OE-10616 - Modify template generated by Mustache to use values selected by user (#5381) * OE-10616 - Modify template generated by Mustache to use values selected by user * OE-10616 - change variables to snake_case; replace for with foreach * OE-10616 - Replace jquery with a function that converts string to html element * OE-10616 - Move generic function htmlToElement to OpenEyes.Util.js Co-authored-by: Justinas Cepkauskas Co-authored-by: Toby Bisco --- protected/assets/js/OpenEyes.Util.js | 12 ++++++++++ .../widgets/js/HistoryMedications.js | 23 +++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/protected/assets/js/OpenEyes.Util.js b/protected/assets/js/OpenEyes.Util.js index 77627e4cf7..6e98a73506 100644 --- a/protected/assets/js/OpenEyes.Util.js +++ b/protected/assets/js/OpenEyes.Util.js @@ -116,6 +116,18 @@ formData.append(key, data); } } + + /** + * Equivalent of jquery's $(html), only using plain JavaScript + * + @param {String} html representing a single element + @return {Element} + */ + Util.htmlToElement = function(html) { + const template = document.createElement('template'); + template.innerHTML = html.trim(); + return template.content.firstChild; + } exports.Util = Util; }(this.OpenEyes)); diff --git a/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js b/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js index 62f8cff22b..5f6fa1507c 100644 --- a/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js +++ b/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js @@ -540,6 +540,16 @@ HistoryMedicationsController._defaultOptions = { }); }; + HistoryMedicationsController.prototype.markOptionSelected = function(markup, row, selector) + { + const value = parseInt(row.querySelector(selector).value); + markup.querySelectorAll(selector + ' option').forEach(function (option) { + if (parseInt(option.getAttribute('value')) === value) { + option.setAttribute('selected', true); + } + }); + }; + HistoryMedicationsController.prototype.addTaper = function($row) { let row_count = $row.attr("data-key"); @@ -561,6 +571,15 @@ HistoryMedicationsController._defaultOptions = { } ); + const data_row = $row[0].previousElementSibling; + const markup_element = OpenEyes.Util.htmlToElement(markup); + + markup_element.querySelector('.js-dose').setAttribute('value', + data_row.querySelector('.js-dose').value); + + controller.markOptionSelected(markup_element, data_row, '.js-frequency'); + controller.markOptionSelected(markup_element, data_row, '.js-duration'); + let $lastrow; if($tapers.length>0) { @@ -570,7 +589,7 @@ HistoryMedicationsController._defaultOptions = { $lastrow = $row; } - $(markup).insertAfter($lastrow); + $lastrow[0].insertAdjacentElement('afterend', markup_element); }; HistoryMedicationsController.prototype.showStopControls = function($row) @@ -1581,7 +1600,7 @@ HistoryMedicationsController._defaultOptions = { }; exports.HistoryMedicationsController = HistoryMedicationsController; -})(OpenEyes.OphCiExamination); +})(OpenEyes.OphCiExamination, OpenEyes.Util); (function(exports) { function HistoryMedicationsViewController(options) { From a5e0db667838dd4d3899f2de8395702fdd9dcc1b Mon Sep 17 00:00:00 2001 From: AdrianKamulegeya Date: Thu, 14 Jan 2021 15:47:57 +0000 Subject: [PATCH 013/110] OE-10790 previous medications show on event deletion (#5406) --- .../models/BaseMedicationElement.php | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/protected/modules/OphCiExamination/models/BaseMedicationElement.php b/protected/modules/OphCiExamination/models/BaseMedicationElement.php index 02ad7eb30e..68f9458697 100644 --- a/protected/modules/OphCiExamination/models/BaseMedicationElement.php +++ b/protected/modules/OphCiExamination/models/BaseMedicationElement.php @@ -298,7 +298,7 @@ public function getDisplayOrder($action) /** - * merges entries and removes those that have a latest_med_use_id (not the most recent medication) + * merges entries and selects only the latest medication * @param $entries * @param $widget * @return array @@ -306,8 +306,6 @@ public function getDisplayOrder($action) */ public function mergeMedicationEntries($entries, $widget = null) : array { - $merged_entries = []; - $medication_ids = []; $medication_entries = []; $already_converted_ids = []; @@ -322,28 +320,16 @@ public function mergeMedicationEntries($entries, $widget = null) : array $converted_entry = $this->createConvertedHistoryEntry($latest_medication, true, $widget); $converted_entry->event_id = $latest_medication->event_id ?? $latest_medication->copied_from_med_use_id; $converted_entry->is_copied_from_previous_event = true; - if (!$latest_medication->latest_med_use_id) { - if ($latest_medication->isPrescription()) { - $converted_entry->usage_type = 'OphDrPrescription'; - $converted_entry->usage_subtype = ''; - } - $medication_entries[] = $converted_entry; - $already_converted_ids[] = $latest_medication->medication_id; - } - } - } - - foreach ($medication_entries as $entry) { - $medication_is_present = in_array($entry->medication_id, $medication_ids); - if (!$medication_is_present || ($medication_is_present && is_null($entry->latest_med_use_id))) { - $merged_entries[] = $entry; - if (!$medication_is_present) { - $medication_ids[] = $entry->medication_id; + if ($latest_medication->isPrescription()) { + $converted_entry->usage_type = 'OphDrPrescription'; + $converted_entry->usage_subtype = ''; } + $medication_entries[] = $converted_entry; + $already_converted_ids[] = $latest_medication->medication_id; } } - return $merged_entries; + return $medication_entries; } /** From b23e041b43dc6f6b06726b132683c3d6e80fc1e9 Mon Sep 17 00:00:00 2001 From: biskyt Date: Thu, 14 Jan 2021 16:14:10 +0000 Subject: [PATCH 014/110] set pipefail in oe-migrate to stop false positives --- protected/scripts/oe-migrate.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protected/scripts/oe-migrate.sh b/protected/scripts/oe-migrate.sh index 3ad3184004..fc53b4eb3a 100755 --- a/protected/scripts/oe-migrate.sh +++ b/protected/scripts/oe-migrate.sh @@ -1,5 +1,7 @@ #!/bin/bash -l +set -o pipefail + ## NOTE: This script assumes it is in protected/scripts. If you move it then relative paths will not work! # Find fuill folder path where this script is located, then find root folder From be3cea3250bfab453e3537c5c2f777231948ac06 Mon Sep 17 00:00:00 2001 From: AdrianKamulegeya Date: Thu, 14 Jan 2021 16:30:49 +0000 Subject: [PATCH 015/110] OE-10755 lock MH row when stopping medicatiom in MM (#5380) --- .../widgets/js/HistoryMedications.js | 72 +++++++++++++------ .../views/MedicationManagement_event_edit.php | 8 +++ 2 files changed, 59 insertions(+), 21 deletions(-) diff --git a/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js b/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js index 5f6fa1507c..2f5d06ca1c 100644 --- a/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js +++ b/protected/modules/OphCiExamination/widgets/js/HistoryMedications.js @@ -240,14 +240,26 @@ HistoryMedicationsController._defaultOptions = { controller.$element.on('click', '.js-reset-mm', function (e) { e.preventDefault(); let $row = $(this).parents('tr.js-first-row'); - let $broken_bound_entry = controller.getBrokenBoundEntry($row); - if ($broken_bound_entry !== null) { - controller.enableMedicationHistoryRow($broken_bound_entry); - controller.resetStopReason($broken_bound_entry); - controller.toggleStopControls($broken_bound_entry, false); - controller.resetData($broken_bound_entry, $row); - controller.bindEntries($broken_bound_entry, $row); + let $bound_entry = $row.data('bound_entry'); + let bind_broken = false; + if ($bound_entry === undefined) { + bind_broken = true; + $bound_entry = controller.getBrokenBoundEntry($row); + } + if ($bound_entry !== null) { + controller.enableMedicationHistoryRow($bound_entry); + controller.resetStopReason($bound_entry); + controller.toggleStopControls($bound_entry, false); + controller.resetData($bound_entry, $row); controller.disableRemoveButton($row); + if (bind_broken) { + controller.bindEntries($bound_entry, $row); + } + let $second_row = controller.$table.find('tr[data-key=' + $row.data('key') + '].js-second-row'); + $second_row.find(".js-end-date-wrapper").hide(); + $second_row.find(".js-stop-reason-select").hide(); + $second_row.find('.js-meds-stop-btn').show(); + $row.find('input[name*="[is_discontinued]"]').val(0); } $(this).hide(); }); @@ -375,7 +387,11 @@ HistoryMedicationsController._defaultOptions = { }); $second_part_of_row.on("click", ".js-meds-stop-btn", function(){ - controller.showStopControls($full_row); + if (controller.options.modelName.includes('MedicationManagement') && !controller.eyeRouteIsSet($full_row)) { + controller.createLateralityDialog(); + } else { + controller.showStopControls($full_row); + } }); $second_part_of_row.on("click", ".js-start-date-display", function(){ @@ -480,9 +496,7 @@ HistoryMedicationsController._defaultOptions = { $row.find('.js-reset-mm').show(); $row.find('input[name*="[is_discontinued]"]').val('0'); } else { - new OpenEyes.UI.Dialog.Alert({ - content: 'Please set the laterality in Medication History before making changes in Medication Management.' - }).open(); + controller.createLateralityDialog(); controller.resetData($bound_entry, $row); } } @@ -592,21 +606,30 @@ HistoryMedicationsController._defaultOptions = { $lastrow[0].insertAdjacentElement('afterend', markup_element); }; - HistoryMedicationsController.prototype.showStopControls = function($row) + HistoryMedicationsController.prototype.showStopControls = function($row, from_history_entry = false) { let $datepicker_wrapper = $row.find(".js-end-date-wrapper"); - let $stop_reason_select = $row.find(".js-stop-reason-select"); - let $stop_reason_text = $row.find(".js-stop-reason-text"); + let $stop_reason_select = $row.find(".js-stop-reason-select"); + let $stop_reason_text = $row.find(".js-stop-reason-text"); $row.find(".js-meds-stop-btn").hide(); this.setDefaultStopDate($datepicker_wrapper); $datepicker_wrapper.show(); $stop_reason_select.show(); - $stop_reason_text.hide(); + $stop_reason_text.hide(); if(typeof $row.data("bound_entry") !== "undefined" && $row.data("bound_entry").find('.js-meds-stop-btn').attr('style') !== "display: none;") { - let $bound_entry = $row.data("bound_entry"); - - this.boundController.showStopControls($bound_entry.parent().find('tr[data-key=' + $bound_entry.data('key') + '].js-second-row')); + let $bound_entry = $row.data("bound_entry"); + let modelName = this.options.modelName; + + if (modelName.includes('MedicationManagement') && !from_history_entry) { + this.toggleStopControls($bound_entry, true); + let $bound_entry_second_row = $bound_entry.parent().find('tr[data-key=' + $bound_entry.data('key') + '].js-second-row'); + $bound_entry_second_row.find('.js-end-date').val($row.find('.js-end-date').val()); + this.disableMedicationHistoryRow($bound_entry); + $row.find('.js-reset-mm').show(); + } else { + this.boundController.showStopControls($bound_entry.parent().find('tr[data-key=' + $bound_entry.data('key') + '].js-second-row')); + } } let $endDateElement = $row.find('.js-end-date'); @@ -831,6 +854,13 @@ HistoryMedicationsController._defaultOptions = { }); }; + HistoryMedicationsController.prototype.createLateralityDialog = function() + { + return new OpenEyes.UI.Dialog.Alert({ + content: 'Please set the laterality in Medication History before making changes in Medication Management.' + }).open(); + }; + /** * Check if the selected entries are relevant to current allergies * Then add them depending on user choice @@ -1053,7 +1083,7 @@ HistoryMedicationsController._defaultOptions = { this.boundController.setRowData($row, data); this.boundController.initialiseRowEventTriggers($row, data); if(data.end_date !== "") { - this.showStopControls($row); + this.showStopControls($row, true); } this.updateRowRouteOptions($row, false); @@ -1115,7 +1145,7 @@ HistoryMedicationsController._defaultOptions = { // controller.updateRowRouteOptions($bound_entry); if(data.end_date !== "") { - controller.showStopControls($bound_entry); + controller.showStopControls($bound_entry, true); } if(callback !== undefined) { @@ -1474,7 +1504,7 @@ HistoryMedicationsController._defaultOptions = { HistoryMedicationsController.prototype.disableMedicationHistoryRow = function ($row) { let $second_row = $row.parent().find('tr[data-key=' + $row.data('key') + '].js-second-row'); - let tooltip_text = 'This item cannot be changed here as it has been changed in the Medication Management element.'; + let tooltip_text = 'This item cannot be changed here as it has been stopped in the Medication Management element.'; let $td_edit = $row.find('td.text-center'); if ($td_edit.length === 0) { $td_edit = $row.find('td.edit-column'); diff --git a/protected/modules/OphCiExamination/widgets/views/MedicationManagement_event_edit.php b/protected/modules/OphCiExamination/widgets/views/MedicationManagement_event_edit.php index e781c9d879..601705b1f6 100644 --- a/protected/modules/OphCiExamination/widgets/views/MedicationManagement_event_edit.php +++ b/protected/modules/OphCiExamination/widgets/views/MedicationManagement_event_edit.php @@ -491,6 +491,14 @@ window.HMController.toggleStopControls($row); window.HMController.disableMedicationHistoryRow($row); } + } else { + let $row = window.MMController.$table.find('.js-bound-key[value="' + bound_key + '"]').parents('tr.js-first-row'); + if ($row.find('input[name*="[is_discontinued]"]').val() === '1') { + let $history_row = window.HMController.$table.find('.js-bound-key[value="' + bound_key + '"]').parents('tr.js-first-row'); + window.HMController.toggleStopControls($history_row, true); + window.HMController.disableMedicationHistoryRow($history_row); + $row.find('.js-reset-mm').show(); + } } }) } From cf739ff2791436bf711e3dbb9597cd13be4e4d49 Mon Sep 17 00:00:00 2001 From: Piyush Gupta <46304823+piyushgupta95@users.noreply.github.com> Date: Mon, 18 Jan 2021 10:57:44 +1100 Subject: [PATCH 016/110] OE-10207 Update manage elements popup with index search elements (#5413) --- protected/assets/js/OpenEyes.UI.PatientSidebar.js | 1 + protected/views/patient/_patient_manage_elements.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/protected/assets/js/OpenEyes.UI.PatientSidebar.js b/protected/assets/js/OpenEyes.UI.PatientSidebar.js index 5fc071c469..4b6102bf85 100755 --- a/protected/assets/js/OpenEyes.UI.PatientSidebar.js +++ b/protected/assets/js/OpenEyes.UI.PatientSidebar.js @@ -190,6 +190,7 @@ OpenEyes.UI = OpenEyes.UI || {}; }; self.loadElement($container, data, newCallback); $item.addClass('loading'); + manage_elements.updatePopupItem($item); } else { // either has no parent or parent is already loaded. self.moveTo($item); diff --git a/protected/views/patient/_patient_manage_elements.php b/protected/views/patient/_patient_manage_elements.php index e175600a20..bc2b124c1c 100644 --- a/protected/views/patient/_patient_manage_elements.php +++ b/protected/views/patient/_patient_manage_elements.php @@ -15,7 +15,7 @@ node.appendChild(ele); sidebar_header.append(node); - new OpenEyes.UI.ManageElements( + manage_elements = new OpenEyes.UI.ManageElements( $('#js-manage-elements-btn'), $('#episodes-and-events'), { manage_elements_json: 'getElementTree() ?>', From 77e25c8fcde33db5f824e011dcd256e1274aa6bb Mon Sep 17 00:00:00 2001 From: Zhe Wang <46304835+ZheWangJames@users.noreply.github.com> Date: Mon, 18 Jan 2021 16:02:36 +1100 Subject: [PATCH 017/110] OE-10645 reduced font size to improve usability on smaller displays (#5415) --- .../OphDrPrescription/views/default/event_content.php | 2 +- .../OphTrOperationnote/controllers/DefaultController.php | 2 +- protected/views/clinical/episodeSummary.php | 2 +- protected/views/patient/event_content.php | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/protected/modules/OphDrPrescription/views/default/event_content.php b/protected/modules/OphDrPrescription/views/default/event_content.php index 8bf991de49..3ca48f18de 100644 --- a/protected/modules/OphDrPrescription/views/default/event_content.php +++ b/protected/modules/OphDrPrescription/views/default/event_content.php @@ -9,7 +9,7 @@ action->id === 'view') { ?> - + getExtraTitleInfo(); if ($extra_info && $extra_info !== "") : ?> diff --git a/protected/modules/OphTrOperationnote/controllers/DefaultController.php b/protected/modules/OphTrOperationnote/controllers/DefaultController.php index 1bc8fff34d..c32d96aa72 100644 --- a/protected/modules/OphTrOperationnote/controllers/DefaultController.php +++ b/protected/modules/OphTrOperationnote/controllers/DefaultController.php @@ -1361,7 +1361,7 @@ public function getExtraTitleInfo() return null; } - return '
    ' . + return '
    ' . 'Site: ' . $element->site->name . ', ' . ($element->theatre ? $element->theatre->name : 'None') . '' . '
    '; diff --git a/protected/views/clinical/episodeSummary.php b/protected/views/clinical/episodeSummary.php index 826b6f2d5f..359f0143a7 100755 --- a/protected/views/clinical/episodeSummary.php +++ b/protected/views/clinical/episodeSummary.php @@ -30,7 +30,7 @@

    Summary: getSubspecialtyText() ?> -

    + renderPartial('//base/_messages'); ?> diff --git a/protected/views/patient/event_content.php b/protected/views/patient/event_content.php index 2b7401ba34..5b0d0900b9 100644 --- a/protected/views/patient/event_content.php +++ b/protected/views/patient/event_content.php @@ -6,7 +6,7 @@ $this->renderPartial('//patient/event_automated'); } ?> action->id === 'view') { ?> - + @@ -15,11 +15,11 @@ title != 'Please select booking') { ?> event->firm)) : ?> -
    +
    Subspecialty: event->firm->serviceSubspecialtyAssignment->subspecialty->name; ?>
    -
    +
     Context: event->firm->name; ?>
    @@ -71,7 +71,7 @@ }); - event->event_date) ?> + event->event_date) ?> From 7e7656c015eef87d50383b7625c47fe4a862673c Mon Sep 17 00:00:00 2001 From: Gurpreet Singh Date: Mon, 18 Jan 2021 17:12:00 +1100 Subject: [PATCH 018/110] OE-10799 Cannot add examination elements while lightning images are processing in background (#5412) * Reformatted the file. * Refactored code to send the ajax requests only when the event is hovered in the episode sidebar. Also, modified the way the getimageurl requests are being sent - the requests are only sent when there is no pending getimageurl ajax request. * Updated the ajax request - the success and complete functions are moved inside the ajax object. Co-authored-by: Andrew Pigram --- .../assets/js/OpenEyes.UI.EpisodeSidebar.js | 280 +++++++++--------- 1 file changed, 133 insertions(+), 147 deletions(-) diff --git a/protected/assets/js/OpenEyes.UI.EpisodeSidebar.js b/protected/assets/js/OpenEyes.UI.EpisodeSidebar.js index 07d4a6592f..eedc332140 100644 --- a/protected/assets/js/OpenEyes.UI.EpisodeSidebar.js +++ b/protected/assets/js/OpenEyes.UI.EpisodeSidebar.js @@ -27,6 +27,7 @@ OpenEyes.UI = OpenEyes.UI || {}; */ function EpisodeSidebar(element, options) { this.element = $(element); + this.sendImageUrlAjaxRequest = true; this.options = $.extend(true, {}, EpisodeSidebar._defaultOptions, options); this.create(); } @@ -55,13 +56,13 @@ OpenEyes.UI = OpenEyes.UI || {}; /** * Load the previous state of the sidebar from cookie storage - */ - EpisodeSidebar.prototype.loadState = function () { - var self = this; - if (typeof(Storage) !== "undefined") { - state = sessionStorage.getItem(sidebarCookie); - if (state) { - stateObj = JSON.parse(state); + */ + EpisodeSidebar.prototype.loadState = function () { + var self = this; + if (typeof (Storage) !== "undefined") { + state = sessionStorage.getItem(sidebarCookie); + if (state) { + stateObj = JSON.parse(state); if (stateObj.sortOrder) self.sortOrder = stateObj.sortOrder; if (stateObj.grouping) @@ -72,13 +73,13 @@ OpenEyes.UI = OpenEyes.UI || {}; /** * Save the current sidebar state to cookie storage - */ - EpisodeSidebar.prototype.saveState = function () { - var self = this; - if (typeof(Storage) !== "undefined") { - var state = { - sortOrder: self.sortOrder, - grouping: self.grouping + */ + EpisodeSidebar.prototype.saveState = function () { + var self = this; + if (typeof (Storage) !== "undefined") { + var state = { + sortOrder: self.sortOrder, + grouping: self.grouping }; sessionStorage.setItem(sidebarCookie, JSON.stringify(state)); } @@ -87,13 +88,12 @@ OpenEyes.UI = OpenEyes.UI || {}; EpisodeSidebar.prototype.create = function () { let self = this; - if (self.options.default_sort == 'asc') { - self.sortOrder = 'asc'; - } - else { - self.sortOrder = 'desc'; - } - self.grouping = { + if (self.options.default_sort == 'asc') { + self.sortOrder = 'asc'; + } else { + self.sortOrder = 'desc'; + } + self.grouping = { id: groupings[0].id }; @@ -122,33 +122,33 @@ OpenEyes.UI = OpenEyes.UI || {}; e.preventDefault(); }); - self.element.on('click', '.expand-all', function (e) { - self.expandAll(); - e.preventDefault(); - }); + self.element.on('click', '.expand-all', function (e) { + self.expandAll(); + e.preventDefault(); + }); - self.element.on('click', '.collapse-group-icon i.minus', function (e) { - self.collapseGrouping($(e.target).parents('.collapse-group')); - e.preventDefault(); - }); + self.element.on('click', '.collapse-group-icon i.minus', function (e) { + self.collapseGrouping($(e.target).parents('.collapse-group')); + e.preventDefault(); + }); - self.element.on('click', '.collapse-group-icon i.plus', function (e) { - self.expandGrouping($(e.target).parents('.collapse-group')); - e.preventDefault(); - }); + self.element.on('click', '.collapse-group-icon i.plus', function (e) { + self.expandGrouping($(e.target).parents('.collapse-group')); + e.preventDefault(); + }); - let $selected_event = this.element.find(this.options.event_list_selector + '.selected'); - let li_height = $selected_event.height(); - let min_viewport_height = $(window).height() - (li_height*3); + let $selected_event = this.element.find(this.options.event_list_selector + '.selected'); + let li_height = $selected_event.height(); + let min_viewport_height = $(window).height() - (li_height * 3); - if ($selected_event.length) { - let li_offset_top = $selected_event[0].offsetTop; - let height_offset = $('header.oe-header').height() + $('nav.sidebar-header').height(); + if ($selected_event.length) { + let li_offset_top = $selected_event[0].offsetTop; + let height_offset = $('header.oe-header').height() + $('nav.sidebar-header').height(); - if (li_offset_top && li_offset_top >= min_viewport_height) { - this.element[0].scrollTop = (li_offset_top - (height_offset + (li_height*10))); + if (li_offset_top && li_offset_top >= min_viewport_height) { + this.element[0].scrollTop = (li_offset_top - (height_offset + (li_height * 10))); + } } - } self.element.on('click', '.collapse-group-icon i.plus', function (e) { self.expandGrouping($(e.target).parents('.collapse-group')); @@ -156,9 +156,10 @@ OpenEyes.UI = OpenEyes.UI || {}; }); self.element.on('mouseenter', '.event-type', function (e) { - var $iconHover = $(e.target); var $li = $iconHover.parent().parents('li:first'); + let event_id = $li.data('event-id'); + const $eventQuickview = $('.oe-event-quickview'); $li.find('.quicklook').show(); var $screenshots = $('.oe-event-quickview .quickview-screenshots'); @@ -166,10 +167,32 @@ OpenEyes.UI = OpenEyes.UI || {}; $('.oe-event-quickview #js-quickview-data').text($li.data('event-date-display')); $('.oe-event-quickview .event-icon').html($li.data('event-icon')); - $('.oe-event-quickview').stop().fadeTo(50, 100, function () { + $eventQuickview.stop().fadeTo(50, 100, function () { $(this).show(); }); - $('.oe-event-quickview').data('current_event', $li.data('event-id')); + $eventQuickview.data('current_event', $li.data('event-id')); + + const img = $eventQuickview.find('img[data-event-id=' + event_id + ']'); + + if ( (img.attr('src') === undefined) && self.sendImageUrlAjaxRequest) { + $.ajax({ + type: 'GET', + url: '/eventImage/getImageUrl', + data: {'event_id': event_id}, + 'beforeSend': function () { + self.sendImageUrlAjaxRequest = false; + }, + 'success': function (response) { + setEventImageSrc(event_id, response); + setEventImageSrcFromData( + self.element.find('.events').find("li[data-event-id=" + event_id + "]") + ); + }, + 'complete': function () { + self.sendImageUrlAjaxRequest = true; + } + }); + } showCurrentEventImage(); }); @@ -182,13 +205,6 @@ OpenEyes.UI = OpenEyes.UI || {}; }); }); - self.element.find('.events').one('mouseenter',function () { - $(this).find('.event').each(function () { - setEventImageSrcFromData($(this)); - }); - }); - - //Shows the current event image if it's loaded and the quickview is open function showCurrentEventImage() { //First check the parent element is visible @@ -197,7 +213,7 @@ OpenEyes.UI = OpenEyes.UI || {}; let event_id = quickview.data('current_event'); if (quickview.is(':visible') && event_id) { let img = quickview.find('img[data-event-id=' + event_id + ']'); - if (img.data('loaded')){ + if (img.data('loaded')) { img.show(); loader.hide(); } else { @@ -210,70 +226,46 @@ OpenEyes.UI = OpenEyes.UI || {}; let event_id = li_item.data('event-id'); let quickview = $('.oe-event-quickview'); let img = quickview.find('img[data-event-id=' + event_id + ']'); - if (img.attr('src') == undefined){ - img.attr('src',img.data('src')); + if (img.attr('src') === undefined) { + img.attr('src', img.data('src')); } } - function setEventImageSrc(event_id, url){ + function setEventImageSrc(event_id, url) { let img = $('img[data-event-id=' + event_id + ']'); img.data('src', url); } - $(document).ready(function () { - setTimeout(function () { - - let events = []; - $('.event-type').each(function () { - events.push($(this).parents('li:first')); - }); - var event_ids = []; - events.forEach(function (event) { - event_ids.push(event.data('event-id')); - }); + let events = []; + $('.event-type').each(function () { + events.push($(this).parents('li:first')); + }); - let bulkURLFunc = function (response) { - let data = JSON.parse(response); - //Set the event image source urls for events which are already generated - if(data.generated_image_urls){ - for (let event_id in data.generated_image_urls) { - if (data.generated_image_urls.hasOwnProperty(event_id)) { - setEventImageSrc(event_id, data.generated_image_urls[event_id]); - } - } - } + var event_ids = []; + events.forEach(function (event) { + event_ids.push(event.data('event-id')); + }); - //Send a parallel request for each of the remaining events - // In production this would almost never be more than one but demo data would have no images - if (data.remaining_event_ids) { - let remaining_events = data.remaining_event_ids; - for (let event in remaining_events) { - if (remaining_events.hasOwnProperty(event)) { - let event_id = remaining_events[event]; - $.ajax({ - type: 'GET', - url: '/eventImage/getImageUrl', - data: {'event_id': event_id}, - }).success(function(response){ - setEventImageSrc(event_id, response); - setEventImageSrcFromData( - self.element.find('.events').find("li[data-event-id="+event_id+"]") - ); - }); - } + let bulkURLFunc = function (response) { + let data = JSON.parse(response); + //Set the event image source urls for events which are already generated + if (data.generated_image_urls) { + for (let event_id in data.generated_image_urls) { + if (data.generated_image_urls.hasOwnProperty(event_id)) { + setEventImageSrc(event_id, data.generated_image_urls[event_id]); + setEventImageSrcFromData(self.element.find('.events').find("li[data-event-id=" + event_id + "]")); } } + } + }; - }; - - $.ajax({ - type: 'GET', - url: '/eventImage/getImageUrlsBulk', - data: {'event_ids': JSON.stringify(event_ids)}, - }).success(bulkURLFunc); - }, 0); + $.ajax({ + type: 'GET', + url: '/eventImage/getImageUrlsBulk', + data: {'event_ids': JSON.stringify(event_ids)}, + }).success(bulkURLFunc); let $screenshots = $('.oe-event-quickview .quickview-screenshots'); let $loader = $('.oe-event-quickview .spinner'); @@ -299,13 +291,13 @@ OpenEyes.UI = OpenEyes.UI || {}; var $img = $('', { class: 'js-quickview-image', - style: 'display: none;', - 'data-event-id': $(this).data('event-id'), - 'data-src': $(this).data('event-image-url'), - 'data-index': counter , - }); + style: 'display: none;', + 'data-event-id': $(this).data('event-id'), + 'data-src': $(this).data('event-image-url'), + 'data-index': counter, + }); - counter++; + counter++; $img.appendTo($container); }); }; @@ -327,18 +319,16 @@ OpenEyes.UI = OpenEyes.UI || {}; var ret = null; // for some reason am unable to do a chained ternery operator for the comparison, hence the somewhat convoluted // if statements to perform the comparison here. - if (edA === edB) { - if (cdA === cdB) { - ret = 0; - } - else { - ret = cdA < cdB ? -1 : 1; - } - } - else { - ret = edA < edB ? -1 : 1; - } - return ret; + if (edA === edB) { + if (cdA === cdB) { + ret = 0; + } else { + ret = cdA < cdB ? -1 : 1; + } + } else { + ret = edA < edB ? -1 : 1; + } + return ret; } var sorted = items.sort(dateSort); @@ -423,19 +413,17 @@ OpenEyes.UI = OpenEyes.UI || {}; itemsByGrouping = {}; groupingVals = []; self.element.find(self.options.event_list_selector).each(function () { - var groupingVal = $(this).data(self.grouping.id); - if (!groupingVal) { - console.log('ERROR: missing grouping data attribute ' + self.grouping.id); - } - else { - if (!itemsByGrouping[groupingVal]) { - itemsByGrouping[groupingVal] = [this]; - groupingVals.push(groupingVal); - } - else { - itemsByGrouping[groupingVal].push(this); - } - } + var groupingVal = $(this).data(self.grouping.id); + if (!groupingVal) { + console.log('ERROR: missing grouping data attribute ' + self.grouping.id); + } else { + if (!itemsByGrouping[groupingVal]) { + itemsByGrouping[groupingVal] = [this]; + groupingVals.push(groupingVal); + } else { + itemsByGrouping[groupingVal].push(this); + } + } }); var groupingElements = '
    '; @@ -518,19 +506,17 @@ OpenEyes.UI = OpenEyes.UI || {}; }; //TODO: loading is not working, need to verify where we're at!! EpisodeSidebar.prototype.processGroupingState = function () { - var self = this; - if (self.grouping.state == undefined) { - self.expandAll(); - } - else { - self.element.find('.collapse-group').each(function () { - if (self.grouping.state[$(this).data('grouping-val')] == 'collapse') { - self.collapseGrouping($(this), false); - } - else { - self.expandGrouping($(this), false); - } - }); + var self = this; + if (self.grouping.state == undefined) { + self.expandAll(); + } else { + self.element.find('.collapse-group').each(function () { + if (self.grouping.state[$(this).data('grouping-val')] == 'collapse') { + self.collapseGrouping($(this), false); + } else { + self.expandGrouping($(this), false); + } + }); } }; From a081682ec029bd04bb73d709246bbd6af982a9a9 Mon Sep 17 00:00:00 2001 From: AdrianKamulegeya Date: Mon, 18 Jan 2021 17:08:17 +0000 Subject: [PATCH 019/110] OE-10757 change 'Both Eye' to 'Both Eyes' in MH edit mode (#5417) Co-authored-by: @=AdrianKamulegeya <@=adrian.kamulegeya@gmail.com> --- protected/models/EventMedicationUse.php | 4 ++++ protected/models/MedicationLaterality.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/protected/models/EventMedicationUse.php b/protected/models/EventMedicationUse.php index 679a149c84..f8f42bf656 100644 --- a/protected/models/EventMedicationUse.php +++ b/protected/models/EventMedicationUse.php @@ -521,6 +521,10 @@ public function getAdministrationDisplay(bool $include_route = false) foreach ($parts as $k) { if ($this->$k) { + if ($k === 'route') { + $both_laterality = MedicationLaterality::model()->findByPk(MedicationLaterality::BOTH); + $this->$k->term = ($both_laterality && $this->medicationLaterality->name === $both_laterality->name) ? $this->$k->term . 's' : $this->$k->term; + } if ($k !== "dose_unit_term" || $this->dose) { $res[] = $this->$k; } diff --git a/protected/models/MedicationLaterality.php b/protected/models/MedicationLaterality.php index 448c5ca544..779dcc4a7b 100644 --- a/protected/models/MedicationLaterality.php +++ b/protected/models/MedicationLaterality.php @@ -18,6 +18,11 @@ */ class MedicationLaterality extends BaseActiveRecordVersioned { + + const LEFT = 1; + const RIGHT = 2; + const BOTH = 3; + /** * @return string the associated database table name */ From a0b279bfcda13ed34e187bdcb2fd9f517eebd0da Mon Sep 17 00:00:00 2001 From: Maria Laura Bisogno <47662871+MallyDev@users.noreply.github.com> Date: Tue, 19 Jan 2021 10:35:02 +0000 Subject: [PATCH 020/110] OE-10409 fix DocumentOutput status (#5232) Co-authored-by: Justinas Cepkauskas --- protected/models/Document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protected/models/Document.php b/protected/models/Document.php index efc9e01247..88610766c1 100644 --- a/protected/models/Document.php +++ b/protected/models/Document.php @@ -310,9 +310,9 @@ public function createNewDocSet($data) $data['id'] = $document_output['id']; } - if ( $this->is_draft && ($data['output_type'] == 'Docman' || $data['output_type'] == 'Internalreferral') ) { + if ($this->is_draft) { $data['output_status'] = "DRAFT"; - } else if ($this->is_draft == 0 && ( $data['output_type'] == 'Docman' || $data['output_type'] == 'Internalreferral') ) { + } else { $data['output_status'] = "PENDING"; } From e81e67fac8630d311e96980880c4b9658ad8cbd3 Mon Sep 17 00:00:00 2001 From: Maria Laura Bisogno <47662871+MallyDev@users.noreply.github.com> Date: Tue, 19 Jan 2021 13:59:58 +0000 Subject: [PATCH 021/110] OE-10561 use GenericFormJSONConverter in Common Systemic Disorders admin page (#5218) Co-authored-by: AdrianKamulegeya Co-authored-by: Hari Co-authored-by: paulhooperAcross --- .../CommonSystemicDisorderController.php | 96 +++++++++++-------- .../admin/editcommonsystemicdisorder.php | 23 ++++- 2 files changed, 76 insertions(+), 43 deletions(-) diff --git a/protected/controllers/oeadmin/CommonSystemicDisorderController.php b/protected/controllers/oeadmin/CommonSystemicDisorderController.php index 3aaaaffca5..71321eda55 100644 --- a/protected/controllers/oeadmin/CommonSystemicDisorderController.php +++ b/protected/controllers/oeadmin/CommonSystemicDisorderController.php @@ -37,60 +37,74 @@ public function actionList() public function actionSave() { $transaction = Yii::app()->db->beginTransaction(); - $disorders = Yii::app()->request->getPost('CommonSystemicDisorder', array()); + $JSON_string = Yii::app()->request->getPost('CommonSystemicDisorder'); - $ids = array(); - foreach ($disorders as $disorder) { - $common_systemic_disorder = CommonSystemicDisorder::model()->findByPk($disorder['id']); - if (!$common_systemic_disorder) { - $common_systemic_disorder = new CommonSystemicDisorder; - } + $json_error = false; + if (!$JSON_string || !array_key_exists('JSON_string', $JSON_string)) { + $json_error = true; + } + $JSON = json_decode(str_replace("'", '"', $JSON_string['JSON_string']), true); + if (json_last_error() != 0) { + $json_error = true; + } + if (!$json_error) { + $disorders = array_map(function ($entry) { + return $entry['CommonSystemicDisorder']; + }, $JSON); - $common_systemic_disorder->group_id = $disorder['group_id']; - $common_systemic_disorder->disorder_id = $disorder['disorder_id']; - $common_systemic_disorder->display_order = $disorder['display_order']; + $ids = array(); + foreach ($disorders as $disorder) { + $common_systemic_disorder = CommonSystemicDisorder::model()->findByPk($disorder['id']); + if (!$common_systemic_disorder) { + $common_systemic_disorder = new CommonSystemicDisorder; + } - if (!$common_systemic_disorder->save()) { - $errors[] = $common_systemic_disorder->getErrors(); - } + $common_systemic_disorder->group_id = $disorder['group_id']; + $common_systemic_disorder->disorder_id = $disorder['disorder_id']; + $common_systemic_disorder->display_order = $disorder['display_order']; - $ids[$common_systemic_disorder->id] = $common_systemic_disorder->id; - } + if (!$common_systemic_disorder->save()) { + $errors[] = $common_systemic_disorder->getErrors(); + } - if (empty($errors)) { - //Delete items - $criteria = new CDbCriteria(); - if ($ids) { - $criteria->addNotInCondition('id', array_map(function ($id) { - return $id; - }, $ids)); + $ids[$common_systemic_disorder->id] = $common_systemic_disorder->id; } - $to_delete = CommonSystemicDisorder::model()->findAll($criteria); - foreach ($to_delete as $item) { - if (!$item->delete()) { - $errors[] = $item->getErrors(); + if (empty($errors)) { + //Delete items + $criteria = new CDbCriteria(); + if ($ids) { + $criteria->addNotInCondition('id', array_map(function ($id) { + return $id; + }, $ids)); + } + + $to_delete = CommonSystemicDisorder::model()->findAll($criteria); + foreach ($to_delete as $item) { + if (!$item->delete()) { + $errors[] = $item->getErrors(); + } + Audit::add('admin', 'delete', $item->primaryKey, null, array( + 'module' => (is_object($this->module)) ? $this->module->id : 'core', + 'model' => CommonSystemicDisorder::getShortModelName(), + )); } - Audit::add('admin', 'delete', $item->primaryKey, null, array( - 'module' => (is_object($this->module)) ? $this->module->id : 'core', - 'model' => CommonSystemicDisorder::getShortModelName(), - )); - } - $transaction->commit(); + $transaction->commit(); - Yii::app()->user->setFlash('success', 'List updated.'); - } + Yii::app()->user->setFlash('success', 'List updated.'); + } - if (!empty($errors)) { - foreach ($errors as $error) { - foreach ($error as $attribute => $error_array) { - $display_errors = '' . $common_systemic_disorder->getAttributeLabel($attribute) . ': ' . implode(', ', $error_array); - Yii::app()->user->setFlash('warning.failure-' . $attribute, $display_errors); + if (!empty($errors)) { + foreach ($errors as $error) { + foreach ($error as $attribute => $error_array) { + $display_errors = '' . (new CommonOphthalmicDisorder())->getAttributeLabel($attribute) . ': ' . implode(', ', $error_array); + Yii::app()->user->setFlash('warning.failure-' . $attribute, $display_errors); + } } + $transaction->rollback(); } - $transaction->rollback(); + $this->redirect(Yii::app()->request->urlReferrer); } - $this->redirect(Yii::app()->request->urlReferrer); } } diff --git a/protected/views/admin/editcommonsystemicdisorder.php b/protected/views/admin/editcommonsystemicdisorder.php index 2142ac1a85..ae57bc8abf 100644 --- a/protected/views/admin/editcommonsystemicdisorder.php +++ b/protected/views/admin/editcommonsystemicdisorder.php @@ -20,7 +20,9 @@ $this->renderPartial('//base/_messages'); if (isset($errors)) { $this->renderPartial('/admin/_form_errors', $errors); -} ?> +} +Yii::app()->clientScript->registerScriptFile(Yii::app()->assetManager->createUrl('js/OpenEyes.GenericFormJSONConverter.js'), CClientScript::POS_HEAD); +?>
    @@ -94,6 +96,20 @@
    - No params['gp_label'] ?> + No getSetting('gp_label') ?> contact->correspondAddress) { ?> @@ -198,7 +198,7 @@ - 2nd Reminder
  • - - params['gp_label'] ?> Removal + - getSetting('gp_label') ?> Removal