<commit_before><?php

/**
 * OpenEyes
 *
 * (C) OpenEyes Foundation, 2016
 * This file is part of OpenEyes.
 * OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details.
 * You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package OpenEyes
 * @link http://www.openeyes.org.uk
 * @author OpenEyes <<EMAIL>>
 * @copyright Copyright (c) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */

/**
 * This component class is intended to encaspulate the logic of interacting with the Worklists
 *
 * Class WorklistManager
 */
class WorklistManager extends CComponent
{
    public static $AUDIT_TARGET_MANUAL = "Manual Worklist";
    public static $AUDIT_TARGET_AUTO = "Automatic Worklists";
    /**
     * @var string
     */
    protected static $DEFAULT_WORKLIST_START_TIME = '08:00';
    /**
     * @var string
     */
    protected static $DEFAULT_WORKLIST_END_TIME = '17:00';

    /**
     * @var string
     */
    protected static $DEFAULT_GENERATION_LIMIT = '1 month';

    /**
     * @var int
     */
    protected static $DEFAULT_WORKLIST_PAGE_SIZE = 10;

    /**
     * The interval between now and the future used for determining which Automatic Worklists
     * should be rendered on the dashboard
     *
     * @var string
     */
    protected static $DEFAULT_DASHBOARD_FUTURE_DAYS = 1;

    /**
     * Array of 3 letter days of the week that should be skipped for picking dates to render
     * worklist dashboards for.

     * @TODO: leverage for day or week selection for definition setup
     * @var array
     */
    protected static $DEFAULT_DASHBOARD_SKIP_DAYS = ['Sun'];

    /**
     * Whether worklists with no patient assignments should be displayed or not
     *
     * @var bool
     */
    protected static $DEFAULT_SHOW_EMPTY = true;

    /**
     * Whether patients can be added to the same automatic worklist more than once
     *
     * @var bool
     */
    protected static $DEFAULT_DUPLICATE_PATIENTS = false;

    /**
     * Internal store of error messages
     *
     * @var array
     */
    protected $errors = [];

    /**
     * Flag to turn off auditing
     *
     * @var bool
     */
    protected $do_audit = true;

    /**
     * @var CApplication
     */
    protected $yii;

    public function __construct(CApplication $yii = null)
    {
        if (is_null($yii)) {
            $yii = Yii::app();
        }<commit_msg>change array declarations in WorklistManager for 5.3 compatibility - #394<commit_after><?php

/**
 * OpenEyes
 *
 * (C) OpenEyes Foundation, 2016
 * This file is part of OpenEyes.
 * OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details.
 * You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package OpenEyes
 * @link http://www.openeyes.org.uk
 * @author OpenEyes <<EMAIL>>
 * @copyright Copyright (c) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */

/**
 * This component class is intended to encaspulate the logic of interacting with the Worklists
 *
 * Class WorklistManager
 */
class WorklistManager extends CComponent
{
    public static $AUDIT_TARGET_MANUAL = "Manual Worklist";
    public static $AUDIT_TARGET_AUTO = "Automatic Worklists";
    /**
     * @var string
     */
    protected static $DEFAULT_WORKLIST_START_TIME = '08:00';
    /**
     * @var string
     */
    protected static $DEFAULT_WORKLIST_END_TIME = '17:00';

    /**
     * @var string
     */
    protected static $DEFAULT_GENERATION_LIMIT = '1 month';

    /**
     * @var int
     */
    protected static $DEFAULT_WORKLIST_PAGE_SIZE = 10;

    /**
     * The interval between now and the future used for determining which Automatic Worklists
     * should be rendered on the dashboard
     *
     * @var string
     */
    protected static $DEFAULT_DASHBOARD_FUTURE_DAYS = 1;

    /**
     * Array of 3 letter days of the week that should be skipped for picking dates to render
     * worklist dashboards for.

     * @TODO: leverage for day or week selection for definition setup
     * @var array
     */
    protected static $DEFAULT_DASHBOARD_SKIP_DAYS = array('Sun');

    /**
     * Whether worklists with no patient assignments should be displayed or not
     *
     * @var bool
     */
    protected static $DEFAULT_SHOW_EMPTY = true;

    /**
     * Whether patients can be added to the same automatic worklist more than once
     *
     * @var bool
     */
    protected static $DEFAULT_DUPLICATE_PATIENTS = false;

    /**
     * Internal store of error messages
     *
     * @var array
     */
    protected $errors = array();

    /**
     * Flag to turn off auditing
     *
     * @var bool
     */
    protected $do_audit = true;

    /**
     * @var CApplication
     */
    protected $yii;

    public function __construct(CApplication $yii = null)
    {
        if (is_null($yii)) {
            $yii = Yii::app();
        }
{'fraction_non_alphanumeric': 0.08657066309444073, 'fraction_numerical': 0.009544541192230409, 'mean_word_length': 2.700743494423792, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3420105', 'n_tokens_mistral': 1735, 'n_tokens_neox': 1665, 'n_words': 645}