diff --git a/ansible/tasks/init-debian.yml b/ansible/tasks/init-debian.yml index c28ffc13fc..463aad1cbd 100644 --- a/ansible/tasks/init-debian.yml +++ b/ansible/tasks/init-debian.yml @@ -16,14 +16,6 @@ apt_repository: repo='ppa:ondrej/apache2' when: ansible_distribution_release == "precise" and ansible_distribution == "Ubuntu" -- name: Add repository for PHP 5.6. - apt_repository: repo='ppa:ondrej/php5-5.6' - when: php_version == "5.6" and ansible_distribution == "Ubuntu" - -- name: Add repository for PHP 7.0. - apt_repository: repo='ppa:ondrej/php' - when: php_version == "7.0" and ansible_distribution == "Ubuntu" - - name: Define php_xhprof_html_dir. set_fact: php_xhprof_html_dir: "/usr/share/php/xhprof_html" diff --git a/index.php b/index.php index f398ed32a5..7fa4ab973e 100644 --- a/index.php +++ b/index.php @@ -17,8 +17,9 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 */ $dirname = dirname(__FILE__); -if (file_exists($dirname . '/vendor/autoload.php')) +if (file_exists($dirname . '/vendor/autoload.php')){ require_once($dirname . '/vendor/autoload.php'); +} if (file_exists($dirname . '/vendor/yiisoft/yii/framework/yii.php')) { $yii = $dirname . '/vendor/yiisoft/yii/framework/yii.php'; diff --git a/protected/assets/css/style.css b/protected/assets/css/style.css index c62d714c56..74ca70cfdb 100644 --- a/protected/assets/css/style.css +++ b/protected/assets/css/style.css @@ -21,7 +21,7 @@ * 2. Prevent iOS text size adjust after orientation change, without disabling * user zoom. */ -/* line 9, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 9, ../components/foundation/scss/normalize.scss */ html { font-family: sans-serif; /* 1 */ @@ -34,7 +34,7 @@ html { /** * Remove default margin. */ -/* line 19, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 19, ../components/foundation/scss/normalize.scss */ body { margin: 0; } @@ -47,7 +47,7 @@ body { * and Firefox. * Correct `block` display not defined for `main` in IE 11. */ -/* line 33, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 33, ../components/foundation/scss/normalize.scss */ article, aside, details, @@ -68,7 +68,7 @@ summary { * 1. Correct `inline-block` display not defined in IE 8/9. * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. */ -/* line 54, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 54, ../components/foundation/scss/normalize.scss */ audio, canvas, progress, @@ -83,7 +83,7 @@ video { * Prevent modern browsers from displaying `audio` without controls. * Remove excess height in iOS 5 devices. */ -/* line 67, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 67, ../components/foundation/scss/normalize.scss */ audio:not([controls]) { display: none; height: 0; @@ -93,7 +93,7 @@ audio:not([controls]) { * Address `[hidden]` styling not present in IE 8/9/10. * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. */ -/* line 77, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 77, ../components/foundation/scss/normalize.scss */ [hidden], template { display: none; @@ -104,7 +104,7 @@ template { /** * Remove the gray background color from active links in IE 10. */ -/* line 89, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 89, ../components/foundation/scss/normalize.scss */ a { background-color: transparent; } @@ -112,7 +112,7 @@ a { /** * Improve readability when focused and also mouse hovered in all browsers. */ -/* line 97, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 97, ../components/foundation/scss/normalize.scss */ a:active, a:hover { outline: 0; @@ -123,7 +123,7 @@ a:hover { /** * Address styling not present in IE 8/9/10/11, Safari, and Chrome. */ -/* line 109, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 109, ../components/foundation/scss/normalize.scss */ abbr[title] { border-bottom: 1px dotted; } @@ -131,7 +131,7 @@ abbr[title] { /** * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. */ -/* line 117, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 117, ../components/foundation/scss/normalize.scss */ b, strong { font-weight: bold; @@ -140,7 +140,7 @@ strong { /** * Address styling not present in Safari and Chrome. */ -/* line 126, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 126, ../components/foundation/scss/normalize.scss */ dfn { font-style: italic; } @@ -149,7 +149,7 @@ dfn { * Address variable `h1` font-size and margin within `section` and `article` * contexts in Firefox 4+, Safari, and Chrome. */ -/* line 135, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 135, ../components/foundation/scss/normalize.scss */ h1 { font-size: 2em; margin: 0.67em 0; @@ -158,7 +158,7 @@ h1 { /** * Address styling not present in IE 8/9. */ -/* line 144, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 144, ../components/foundation/scss/normalize.scss */ mark { background: #ff0; color: #000; @@ -167,7 +167,7 @@ mark { /** * Address inconsistent and variable font size in all browsers. */ -/* line 153, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 153, ../components/foundation/scss/normalize.scss */ small { font-size: 80%; } @@ -175,7 +175,7 @@ small { /** * Prevent `sub` and `sup` affecting `line-height` in all browsers. */ -/* line 161, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 161, ../components/foundation/scss/normalize.scss */ sub, sup { font-size: 75%; @@ -184,12 +184,12 @@ sup { vertical-align: baseline; } -/* line 169, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 169, ../components/foundation/scss/normalize.scss */ sup { top: -0.5em; } -/* line 173, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 173, ../components/foundation/scss/normalize.scss */ sub { bottom: -0.25em; } @@ -199,7 +199,7 @@ sub { /** * Remove border when inside `a` element in IE 8/9/10. */ -/* line 184, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 184, ../components/foundation/scss/normalize.scss */ img { border: 0; } @@ -207,7 +207,7 @@ img { /** * Correct overflow not hidden in IE 9/10/11. */ -/* line 192, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 192, ../components/foundation/scss/normalize.scss */ svg:not(:root) { overflow: hidden; } @@ -217,7 +217,7 @@ svg:not(:root) { /** * Address margin not present in IE 8/9 and Safari. */ -/* line 203, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 203, ../components/foundation/scss/normalize.scss */ figure { margin: 1em 40px; } @@ -225,7 +225,7 @@ figure { /** * Address differences between Firefox and other browsers. */ -/* line 211, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 211, ../components/foundation/scss/normalize.scss */ hr { -moz-box-sizing: content-box; box-sizing: content-box; @@ -235,7 +235,7 @@ hr { /** * Contain overflow in all browsers. */ -/* line 221, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 221, ../components/foundation/scss/normalize.scss */ pre { overflow: auto; } @@ -243,7 +243,7 @@ pre { /** * Address odd `em`-unit font size rendering in all browsers. */ -/* line 229, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 229, ../components/foundation/scss/normalize.scss */ code, kbd, pre, @@ -264,7 +264,7 @@ samp { * 2. Correct font properties not being inherited. * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. */ -/* line 252, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 252, ../components/foundation/scss/normalize.scss */ button, input, optgroup, @@ -281,7 +281,7 @@ textarea { /** * Address `overflow` set to `hidden` in IE 8/9/10/11. */ -/* line 266, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 266, ../components/foundation/scss/normalize.scss */ button { overflow: visible; } @@ -292,7 +292,7 @@ button { * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. * Correct `select` style inheritance in Firefox. */ -/* line 277, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 277, ../components/foundation/scss/normalize.scss */ button, select { text-transform: none; @@ -305,7 +305,7 @@ select { * 3. Improve usability and consistency of cursor style between image-type * `input` and others. */ -/* line 290, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 290, ../components/foundation/scss/normalize.scss */ button, html input[type="button"], input[type="reset"], @@ -319,7 +319,7 @@ input[type="submit"] { /** * Re-set default cursor for disabled elements. */ -/* line 302, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 302, ../components/foundation/scss/normalize.scss */ button[disabled], html input[disabled] { cursor: default; @@ -328,7 +328,7 @@ html input[disabled] { /** * Remove inner padding and border in Firefox 4+. */ -/* line 311, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 311, ../components/foundation/scss/normalize.scss */ button::-moz-focus-inner, input::-moz-focus-inner { border: 0; @@ -339,7 +339,7 @@ input::-moz-focus-inner { * Address Firefox 4+ setting `line-height` on `input` using `!important` in * the UA stylesheet. */ -/* line 322, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 322, ../components/foundation/scss/normalize.scss */ input { line-height: normal; } @@ -351,7 +351,7 @@ input { * 1. Address box sizing set to `content-box` in IE 8/9/10. * 2. Remove excess padding in IE 8/9/10. */ -/* line 334, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 334, ../components/foundation/scss/normalize.scss */ input[type="checkbox"], input[type="radio"] { box-sizing: border-box; @@ -365,7 +365,7 @@ input[type="radio"] { * `font-size` values of the `input`, it causes the cursor style of the * decrement button to change from `default` to `text`. */ -/* line 346, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 346, ../components/foundation/scss/normalize.scss */ input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; @@ -376,7 +376,7 @@ input[type="number"]::-webkit-outer-spin-button { * 2. Address `box-sizing` set to `border-box` in Safari and Chrome * (include `-moz` to future-proof). */ -/* line 357, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 357, ../components/foundation/scss/normalize.scss */ input[type="search"] { -webkit-appearance: textfield; /* 1 */ @@ -391,7 +391,7 @@ input[type="search"] { * Safari (but not Chrome) clips the cancel button when the search input has * padding (and `textfield` appearance). */ -/* line 370, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 370, ../components/foundation/scss/normalize.scss */ input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; @@ -400,7 +400,7 @@ input[type="search"]::-webkit-search-decoration { /** * Define consistent border, margin, and padding. */ -/* line 379, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 379, ../components/foundation/scss/normalize.scss */ fieldset { border: 1px solid #c0c0c0; margin: 0 2px; @@ -411,7 +411,7 @@ fieldset { * 1. Correct `color` not being inherited in IE 8/9/10/11. * 2. Remove padding so people aren't caught out if they zero out fieldsets. */ -/* line 390, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 390, ../components/foundation/scss/normalize.scss */ legend { border: 0; /* 1 */ @@ -422,7 +422,7 @@ legend { /** * Remove default vertical scrollbar in IE 8/9/10/11. */ -/* line 399, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 399, ../components/foundation/scss/normalize.scss */ textarea { overflow: auto; } @@ -431,7 +431,7 @@ textarea { * Don't inherit the `font-weight` (applied by a rule above). * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. */ -/* line 408, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 408, ../components/foundation/scss/normalize.scss */ optgroup { font-weight: bold; } @@ -441,13 +441,13 @@ optgroup { /** * Remove most spacing between table cells. */ -/* line 419, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 419, ../components/foundation/scss/normalize.scss */ table { border-collapse: collapse; border-spacing: 0; } -/* line 424, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/normalize.scss */ +/* line 424, ../components/foundation/scss/normalize.scss */ td, th { padding: 0; @@ -484,76 +484,76 @@ th { top: -9999px; } -/* line 348, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 348, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-version { font-family: "/5.5.1/"; } -/* line 352, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 352, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-small { font-family: "/all/"; width: 1230px; } -/* line 357, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 357, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-small-only { font-family: "/all/"; width: 1230px; } -/* line 362, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 362, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-medium { font-family: "/all/"; width: 1230px; } -/* line 367, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 367, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-medium-only { font-family: "/all/"; width: 1230px; } -/* line 372, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 372, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-large { font-family: "/all/"; width: 1230px; } -/* line 377, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 377, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-large-only { font-family: "/all/"; width: 1230px; } -/* line 382, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 382, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-xlarge { font-family: "/all and (min-width:1230px)/"; width: 1230px; } -/* line 387, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 387, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-xlarge-only { font-family: "/all and (min-width:1230px) and (max-width:1230px)/"; width: 1230px; } -/* line 392, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 392, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-mq-xxlarge { font-family: "/all and (min-width:120.063em)/"; width: 120.063em; } -/* line 397, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 397, ../components/foundation/scss/foundation/components/_global.scss */ meta.foundation-data-attribute-namespace { font-family: false; } -/* line 404, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 404, ../components/foundation/scss/foundation/components/_global.scss */ html, body { height: 100%; } -/* line 407, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 407, ../components/foundation/scss/foundation/components/_global.scss */ *, *:before, *:after { @@ -562,13 +562,13 @@ html, body { box-sizing: border-box; } -/* line 413, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 413, ../components/foundation/scss/foundation/components/_global.scss */ html, body { font-size: 100%; } -/* line 417, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 417, ../components/foundation/scss/foundation/components/_global.scss */ body { background: #d4d1cd; color: #222; @@ -582,23 +582,23 @@ body { cursor: auto; } -/* line 430, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 430, ../components/foundation/scss/foundation/components/_global.scss */ a:hover { cursor: pointer; } -/* line 433, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 433, ../components/foundation/scss/foundation/components/_global.scss */ img { max-width: 100%; height: auto; } -/* line 435, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 435, ../components/foundation/scss/foundation/components/_global.scss */ img { -ms-interpolation-mode: bicubic; } -/* line 439, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 439, ../components/foundation/scss/foundation/components/_global.scss */ #map_canvas img, #map_canvas embed, #map_canvas object, @@ -608,60 +608,60 @@ img { max-width: none !important; } -/* line 446, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 446, ../components/foundation/scss/foundation/components/_global.scss */ .left { float: left !important; } -/* line 447, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 447, ../components/foundation/scss/foundation/components/_global.scss */ .right { float: right !important; } -/* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 172, ../components/foundation/scss/foundation/components/_global.scss */ .clearfix:before, .footer:before, .box-header:before, .panel.user:before, .panel.episode .events-overview:before, .event .event-header:before, .element-header:before, .edit .optional-elements-header:before, .sub-element-header:before, .clearfix:after, .footer:after, .box-header:after, .panel.user:after, .panel.episode .events-overview:after, .event .event-header:after, .element-header:after, .edit .optional-elements-header:after, .sub-element-header:after { content: " "; display: table; } -/* line 173, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 173, ../components/foundation/scss/foundation/components/_global.scss */ .clearfix:after, .footer:after, .box-header:after, .panel.user:after, .panel.episode .events-overview:after, .event .event-header:after, .element-header:after, .edit .optional-elements-header:after, .sub-element-header:after { clear: both; } -/* line 451, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 451, ../components/foundation/scss/foundation/components/_global.scss */ .hide { display: none; } -/* line 456, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 456, ../components/foundation/scss/foundation/components/_global.scss */ .invisible { visibility: hidden; } -/* line 462, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 462, ../components/foundation/scss/foundation/components/_global.scss */ .antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } -/* line 465, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 465, ../components/foundation/scss/foundation/components/_global.scss */ img { display: inline-block; vertical-align: middle; } -/* line 475, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 475, ../components/foundation/scss/foundation/components/_global.scss */ textarea { height: auto; min-height: 50px; } -/* line 478, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 478, ../components/foundation/scss/foundation/components/_global.scss */ select { width: 100%; } -/* line 232, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ +/* line 232, ../components/foundation/scss/foundation/components/_grid.scss */ .row { width: 100%; margin-left: auto; @@ -670,27 +670,27 @@ select { margin-bottom: 0; max-width: 1230px; } -/* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 172, ../components/foundation/scss/foundation/components/_global.scss */ .row:before, .row:after { content: " "; display: table; } -/* line 173, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 173, ../components/foundation/scss/foundation/components/_global.scss */ .row:after { clear: both; } -/* line 236, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ +/* line 236, ../components/foundation/scss/foundation/components/_grid.scss */ .row.collapse > .column, .row.collapse > .columns { padding-left: 0; padding-right: 0; } -/* line 239, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ +/* line 239, ../components/foundation/scss/foundation/components/_grid.scss */ .row.collapse .row { margin-left: 0; margin-right: 0; } -/* line 242, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ +/* line 242, ../components/foundation/scss/foundation/components/_grid.scss */ .row .row { width: auto; margin-left: -0.75rem; @@ -699,32 +699,32 @@ select { margin-bottom: 0; max-width: none; } -/* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 172, ../components/foundation/scss/foundation/components/_global.scss */ .row .row:before, .row .row:after { content: " "; display: table; } -/* line 173, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 173, ../components/foundation/scss/foundation/components/_global.scss */ .row .row:after { clear: both; } -/* line 243, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ +/* line 243, ../components/foundation/scss/foundation/components/_grid.scss */ .row .row.collapse { width: auto; margin: 0; max-width: none; } -/* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 172, ../components/foundation/scss/foundation/components/_global.scss */ .row .row.collapse:before, .row .row.collapse:after { content: " "; display: table; } -/* line 173, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 173, ../components/foundation/scss/foundation/components/_global.scss */ .row .row.collapse:after { clear: both; } -/* line 247, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ +/* line 247, ../components/foundation/scss/foundation/components/_grid.scss */ .column, .columns { padding-left: 0.75rem; @@ -733,186 +733,186 @@ select { float: left; } -/* line 250, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ +/* line 250, ../components/foundation/scss/foundation/components/_grid.scss */ [class*="column"] + [class*="column"]:last-child { float: right; } -/* line 251, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ +/* line 251, ../components/foundation/scss/foundation/components/_grid.scss */ [class*="column"] + [class*="column"].end { float: left; } @media all { - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-0 { position: relative; left: 0%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-0 { position: relative; right: 0%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-1 { position: relative; left: 8.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-1 { position: relative; right: 8.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-2 { position: relative; left: 16.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-2 { position: relative; right: 16.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-3 { position: relative; left: 25%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-3 { position: relative; right: 25%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-4 { position: relative; left: 33.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-4 { position: relative; right: 33.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-5 { position: relative; left: 41.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-5 { position: relative; right: 41.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-6 { position: relative; left: 50%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-6 { position: relative; right: 50%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-7 { position: relative; left: 58.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-7 { position: relative; right: 58.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-8 { position: relative; left: 66.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-8 { position: relative; right: 66.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-9 { position: relative; left: 75%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-9 { position: relative; right: 75%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-10 { position: relative; left: 83.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-10 { position: relative; right: 83.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .small-push-11 { position: relative; left: 91.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .small-pull-11 { position: relative; right: 91.66667%; left: auto; } - /* line 167, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 167, ../components/foundation/scss/foundation/components/_grid.scss */ .column, .columns { position: relative; @@ -921,127 +921,127 @@ select { float: left; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-1 { width: 8.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-2 { width: 16.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-3 { width: 25%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-4 { width: 33.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-5 { width: 41.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-6 { width: 50%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-7 { width: 58.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-8 { width: 66.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-9 { width: 75%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-10 { width: 83.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-11 { width: 91.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .small-12 { width: 100%; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-0 { margin-left: 0% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-1 { margin-left: 8.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-2 { margin-left: 16.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-3 { margin-left: 25% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-4 { margin-left: 33.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-5 { margin-left: 41.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-6 { margin-left: 50% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-7 { margin-left: 58.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-8 { margin-left: 66.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-9 { margin-left: 75% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-10 { margin-left: 83.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .small-offset-11 { margin-left: 91.66667% !important; } - /* line 179, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 179, ../components/foundation/scss/foundation/components/_grid.scss */ .small-reset-order { margin-left: 0; margin-right: 0; @@ -1050,7 +1050,7 @@ select { float: left; } - /* line 187, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 187, ../components/foundation/scss/foundation/components/_grid.scss */ .column.small-centered, .columns.small-centered { margin-left: auto; @@ -1058,7 +1058,7 @@ select { float: none; } - /* line 190, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 190, ../components/foundation/scss/foundation/components/_grid.scss */ .column.small-uncentered, .columns.small-uncentered { margin-left: 0; @@ -1066,36 +1066,36 @@ select { float: left; } - /* line 198, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 198, ../components/foundation/scss/foundation/components/_grid.scss */ .column.small-centered:last-child, .columns.small-centered:last-child { float: none; } - /* line 204, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 204, ../components/foundation/scss/foundation/components/_grid.scss */ .column.small-uncentered:last-child, .columns.small-uncentered:last-child { float: left; } - /* line 209, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 209, ../components/foundation/scss/foundation/components/_grid.scss */ .column.small-uncentered.opposite, .columns.small-uncentered.opposite { float: right; } - /* line 216, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 216, ../components/foundation/scss/foundation/components/_grid.scss */ .row.small-collapse > .column, .row.small-collapse > .columns { padding-left: 0; padding-right: 0; } - /* line 219, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 219, ../components/foundation/scss/foundation/components/_grid.scss */ .row.small-collapse .row { margin-left: 0; margin-right: 0; } - /* line 222, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 222, ../components/foundation/scss/foundation/components/_grid.scss */ .row.small-uncollapse > .column, .row.small-uncollapse > .columns { padding-left: 0.75rem; @@ -1104,175 +1104,175 @@ select { } } @media all { - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-0 { position: relative; left: 0%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-0 { position: relative; right: 0%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-1 { position: relative; left: 8.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-1 { position: relative; right: 8.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-2 { position: relative; left: 16.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-2 { position: relative; right: 16.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-3 { position: relative; left: 25%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-3 { position: relative; right: 25%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-4 { position: relative; left: 33.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-4 { position: relative; right: 33.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-5 { position: relative; left: 41.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-5 { position: relative; right: 41.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-6 { position: relative; left: 50%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-6 { position: relative; right: 50%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-7 { position: relative; left: 58.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-7 { position: relative; right: 58.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-8 { position: relative; left: 66.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-8 { position: relative; right: 66.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-9 { position: relative; left: 75%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-9 { position: relative; right: 75%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-10 { position: relative; left: 83.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-10 { position: relative; right: 83.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-push-11 { position: relative; left: 91.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-pull-11 { position: relative; right: 91.66667%; left: auto; } - /* line 167, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 167, ../components/foundation/scss/foundation/components/_grid.scss */ .column, .columns { position: relative; @@ -1281,127 +1281,127 @@ select { float: left; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-1 { width: 8.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-2 { width: 16.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-3 { width: 25%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-4 { width: 33.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-5 { width: 41.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-6 { width: 50%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-7 { width: 58.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-8 { width: 66.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-9 { width: 75%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-10 { width: 83.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-11 { width: 91.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-12 { width: 100%; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-0 { margin-left: 0% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-1 { margin-left: 8.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-2 { margin-left: 16.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-3 { margin-left: 25% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-4 { margin-left: 33.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-5 { margin-left: 41.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-6 { margin-left: 50% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-7 { margin-left: 58.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-8 { margin-left: 66.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-9 { margin-left: 75% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-10 { margin-left: 83.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-offset-11 { margin-left: 91.66667% !important; } - /* line 179, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 179, ../components/foundation/scss/foundation/components/_grid.scss */ .medium-reset-order { margin-left: 0; margin-right: 0; @@ -1410,7 +1410,7 @@ select { float: left; } - /* line 187, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 187, ../components/foundation/scss/foundation/components/_grid.scss */ .column.medium-centered, .columns.medium-centered { margin-left: auto; @@ -1418,7 +1418,7 @@ select { float: none; } - /* line 190, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 190, ../components/foundation/scss/foundation/components/_grid.scss */ .column.medium-uncentered, .columns.medium-uncentered { margin-left: 0; @@ -1426,36 +1426,36 @@ select { float: left; } - /* line 198, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 198, ../components/foundation/scss/foundation/components/_grid.scss */ .column.medium-centered:last-child, .columns.medium-centered:last-child { float: none; } - /* line 204, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 204, ../components/foundation/scss/foundation/components/_grid.scss */ .column.medium-uncentered:last-child, .columns.medium-uncentered:last-child { float: left; } - /* line 209, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 209, ../components/foundation/scss/foundation/components/_grid.scss */ .column.medium-uncentered.opposite, .columns.medium-uncentered.opposite { float: right; } - /* line 216, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 216, ../components/foundation/scss/foundation/components/_grid.scss */ .row.medium-collapse > .column, .row.medium-collapse > .columns { padding-left: 0; padding-right: 0; } - /* line 219, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 219, ../components/foundation/scss/foundation/components/_grid.scss */ .row.medium-collapse .row { margin-left: 0; margin-right: 0; } - /* line 222, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 222, ../components/foundation/scss/foundation/components/_grid.scss */ .row.medium-uncollapse > .column, .row.medium-uncollapse > .columns { padding-left: 0.75rem; @@ -1463,168 +1463,168 @@ select { float: left; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-0 { position: relative; left: 0%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-0 { position: relative; right: 0%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-1 { position: relative; left: 8.33333%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-1 { position: relative; right: 8.33333%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-2 { position: relative; left: 16.66667%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-2 { position: relative; right: 16.66667%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-3 { position: relative; left: 25%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-3 { position: relative; right: 25%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-4 { position: relative; left: 33.33333%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-4 { position: relative; right: 33.33333%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-5 { position: relative; left: 41.66667%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-5 { position: relative; right: 41.66667%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-6 { position: relative; left: 50%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-6 { position: relative; right: 50%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-7 { position: relative; left: 58.33333%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-7 { position: relative; right: 58.33333%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-8 { position: relative; left: 66.66667%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-8 { position: relative; right: 66.66667%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-9 { position: relative; left: 75%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-9 { position: relative; right: 75%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-10 { position: relative; left: 83.33333%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-10 { position: relative; right: 83.33333%; left: auto; } - /* line 261, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 261, ../components/foundation/scss/foundation/components/_grid.scss */ .push-11 { position: relative; left: 91.66667%; right: auto; } - /* line 264, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 264, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-11 { position: relative; right: 91.66667%; @@ -1632,175 +1632,175 @@ select { } } @media all { - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-0 { position: relative; left: 0%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-0 { position: relative; right: 0%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-1 { position: relative; left: 8.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-1 { position: relative; right: 8.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-2 { position: relative; left: 16.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-2 { position: relative; right: 16.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-3 { position: relative; left: 25%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-3 { position: relative; right: 25%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-4 { position: relative; left: 33.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-4 { position: relative; right: 33.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-5 { position: relative; left: 41.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-5 { position: relative; right: 41.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-6 { position: relative; left: 50%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-6 { position: relative; right: 50%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-7 { position: relative; left: 58.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-7 { position: relative; right: 58.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-8 { position: relative; left: 66.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-8 { position: relative; right: 66.66667%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-9 { position: relative; left: 75%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-9 { position: relative; right: 75%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-10 { position: relative; left: 83.33333%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-10 { position: relative; right: 83.33333%; left: auto; } - /* line 159, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 159, ../components/foundation/scss/foundation/components/_grid.scss */ .large-push-11 { position: relative; left: 91.66667%; right: auto; } - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_grid.scss */ .large-pull-11 { position: relative; right: 91.66667%; left: auto; } - /* line 167, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 167, ../components/foundation/scss/foundation/components/_grid.scss */ .column, .columns { position: relative; @@ -1809,127 +1809,127 @@ select { float: left; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-1 { width: 8.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-2 { width: 16.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-3 { width: 25%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-4 { width: 33.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-5 { width: 41.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-6, .element-eye.left-eye, .element-eye.right-eye { width: 50%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-7 { width: 58.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-8 { width: 66.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-9 { width: 75%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-10 { width: 83.33333%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-11 { width: 91.66667%; } - /* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 172, ../components/foundation/scss/foundation/components/_grid.scss */ .large-12 { width: 100%; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-0 { margin-left: 0% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-1 { margin-left: 8.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-2 { margin-left: 16.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-3 { margin-left: 25% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-4 { margin-left: 33.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-5 { margin-left: 41.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-6 { margin-left: 50% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-7 { margin-left: 58.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-8 { margin-left: 66.66667% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-9 { margin-left: 75% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-10 { margin-left: 83.33333% !important; } - /* line 176, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 176, ../components/foundation/scss/foundation/components/_grid.scss */ .large-offset-11 { margin-left: 91.66667% !important; } - /* line 179, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 179, ../components/foundation/scss/foundation/components/_grid.scss */ .large-reset-order { margin-left: 0; margin-right: 0; @@ -1938,7 +1938,7 @@ select { float: left; } - /* line 187, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 187, ../components/foundation/scss/foundation/components/_grid.scss */ .column.large-centered, .columns.large-centered { margin-left: auto; @@ -1946,7 +1946,7 @@ select { float: none; } - /* line 190, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 190, ../components/foundation/scss/foundation/components/_grid.scss */ .column.large-uncentered, .columns.large-uncentered { margin-left: 0; @@ -1954,36 +1954,36 @@ select { float: left; } - /* line 198, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 198, ../components/foundation/scss/foundation/components/_grid.scss */ .column.large-centered:last-child, .columns.large-centered:last-child { float: none; } - /* line 204, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 204, ../components/foundation/scss/foundation/components/_grid.scss */ .column.large-uncentered:last-child, .columns.large-uncentered:last-child { float: left; } - /* line 209, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 209, ../components/foundation/scss/foundation/components/_grid.scss */ .column.large-uncentered.opposite, .columns.large-uncentered.opposite { float: right; } - /* line 216, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 216, ../components/foundation/scss/foundation/components/_grid.scss */ .row.large-collapse > .column, .row.large-collapse > .columns { padding-left: 0; padding-right: 0; } - /* line 219, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 219, ../components/foundation/scss/foundation/components/_grid.scss */ .row.large-collapse .row { margin-left: 0; margin-right: 0; } - /* line 222, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 222, ../components/foundation/scss/foundation/components/_grid.scss */ .row.large-uncollapse > .column, .row.large-uncollapse > .columns { padding-left: 0.75rem; @@ -1991,168 +1991,168 @@ select { float: left; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-0 { position: relative; left: 0%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-0 { position: relative; right: 0%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-1 { position: relative; left: 8.33333%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-1 { position: relative; right: 8.33333%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-2 { position: relative; left: 16.66667%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-2 { position: relative; right: 16.66667%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-3 { position: relative; left: 25%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-3 { position: relative; right: 25%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-4 { position: relative; left: 33.33333%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-4 { position: relative; right: 33.33333%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-5 { position: relative; left: 41.66667%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-5 { position: relative; right: 41.66667%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-6 { position: relative; left: 50%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-6 { position: relative; right: 50%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-7 { position: relative; left: 58.33333%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-7 { position: relative; right: 58.33333%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-8 { position: relative; left: 66.66667%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-8 { position: relative; right: 66.66667%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-9 { position: relative; left: 75%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-9 { position: relative; right: 75%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-10 { position: relative; left: 83.33333%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-10 { position: relative; right: 83.33333%; left: auto; } - /* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 272, ../components/foundation/scss/foundation/components/_grid.scss */ .push-11 { position: relative; left: 91.66667%; right: auto; } - /* line 275, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_grid.scss */ + /* line 275, ../components/foundation/scss/foundation/components/_grid.scss */ .pull-11 { position: relative; right: 91.66667%; @@ -2160,243 +2160,243 @@ select { } } /* Accessibility - hides the forward slash */ -/* line 130, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_breadcrumbs.scss */ +/* line 130, ../components/foundation/scss/foundation/components/_breadcrumbs.scss */ [aria-label="breadcrumbs"] [aria-hidden="true"]:after { content: "/"; } -/* line 155, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 155, ../components/foundation/scss/foundation/components/_type.scss */ .text-left { text-align: left !important; } -/* line 156, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 156, ../components/foundation/scss/foundation/components/_type.scss */ .text-right { text-align: right !important; } -/* line 157, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 157, ../components/foundation/scss/foundation/components/_type.scss */ .text-center { text-align: center !important; } -/* line 158, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 158, ../components/foundation/scss/foundation/components/_type.scss */ .text-justify { text-align: justify !important; } @media all { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .small-only-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .small-only-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .small-only-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .small-only-text-justify { text-align: justify !important; } } @media all { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .small-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .small-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .small-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .small-text-justify { text-align: justify !important; } } @media all { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .medium-only-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .medium-only-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .medium-only-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .medium-only-text-justify { text-align: justify !important; } } @media all { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .medium-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .medium-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .medium-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .medium-text-justify { text-align: justify !important; } } @media all { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .large-only-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .large-only-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .large-only-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .large-only-text-justify { text-align: justify !important; } } @media all { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .large-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .large-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .large-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .large-text-justify { text-align: justify !important; } } @media all and (min-width: 1230px) and (max-width: 1230px) { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .xlarge-only-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .xlarge-only-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .xlarge-only-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .xlarge-only-text-justify { text-align: justify !important; } } @media all and (min-width: 1230px) { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .xlarge-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .xlarge-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .xlarge-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .xlarge-text-justify { text-align: justify !important; } } @media all and (min-width: 120.063em) and (max-width: 999999999999) { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .xxlarge-only-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .xxlarge-only-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .xxlarge-only-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .xxlarge-only-text-justify { text-align: justify !important; } } @media all and (min-width: 120.063em) { - /* line 162, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 162, ../components/foundation/scss/foundation/components/_type.scss */ .xxlarge-text-left { text-align: left !important; } - /* line 163, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 163, ../components/foundation/scss/foundation/components/_type.scss */ .xxlarge-text-right { text-align: right !important; } - /* line 164, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 164, ../components/foundation/scss/foundation/components/_type.scss */ .xxlarge-text-center { text-align: center !important; } - /* line 165, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 165, ../components/foundation/scss/foundation/components/_type.scss */ .xxlarge-text-justify { text-align: justify !important; } } /* Typography resets */ -/* line 193, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 193, ../components/foundation/scss/foundation/components/_type.scss */ div, dl, dt, @@ -2421,23 +2421,23 @@ td { } /* Default Link Styles */ -/* line 217, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 217, ../components/foundation/scss/foundation/components/_type.scss */ a { color: #0b59da; text-decoration: none; line-height: inherit; } -/* line 222, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 222, ../components/foundation/scss/foundation/components/_type.scss */ a:hover, a:focus { color: #094dbb; } -/* line 230, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 230, ../components/foundation/scss/foundation/components/_type.scss */ a img { border: none; } /* Default paragraph styles */ -/* line 234, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 234, ../components/foundation/scss/foundation/components/_type.scss */ p { font-family: inherit; font-weight: normal; @@ -2446,12 +2446,12 @@ p { margin-bottom: 16px; text-rendering: optimizeLegibility; } -/* line 242, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 242, ../components/foundation/scss/foundation/components/_type.scss */ p.lead { font-size: 1.03125rem; line-height: 1.6; } -/* line 244, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 244, ../components/foundation/scss/foundation/components/_type.scss */ p aside { font-size: 0.875rem; line-height: 1.35; @@ -2459,7 +2459,7 @@ p aside { } /* Default header styles */ -/* line 252, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 252, ../components/foundation/scss/foundation/components/_type.scss */ h1, h2, h3, h4, h5, h6 { font-family: "Helvetica", Helvetica, Arial, sans-serif; font-weight: normal; @@ -2470,44 +2470,44 @@ h1, h2, h3, h4, h5, h6 { margin-bottom: 0.5em; line-height: 1.4; } -/* line 262, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 262, ../components/foundation/scss/foundation/components/_type.scss */ h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-size: 60%; color: #7a7a7a; line-height: 0; } -/* line 269, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 269, ../components/foundation/scss/foundation/components/_type.scss */ h1 { font-size: 0.875rem; } -/* line 270, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 270, ../components/foundation/scss/foundation/components/_type.scss */ h2 { font-size: 0.5625rem; } -/* line 271, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 271, ../components/foundation/scss/foundation/components/_type.scss */ h3 { font-size: 0.75rem; } -/* line 272, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 272, ../components/foundation/scss/foundation/components/_type.scss */ h4 { font-size: 0.6875rem; } -/* line 273, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 273, ../components/foundation/scss/foundation/components/_type.scss */ h5 { font-size: 0.9375rem; } -/* line 274, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 274, ../components/foundation/scss/foundation/components/_type.scss */ h6 { font-size: 1rem; } -/* line 276, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 276, ../components/foundation/scss/foundation/components/_type.scss */ .subheader { line-height: 1.4; color: #7a7a7a; @@ -2516,7 +2516,7 @@ h6 { margin-bottom: 0.5rem; } -/* line 278, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 278, ../components/foundation/scss/foundation/components/_type.scss */ hr { border: solid #DDDDDD; border-width: 1px 0 0; @@ -2526,27 +2526,27 @@ hr { } /* Helpful Typography Defaults */ -/* line 287, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 287, ../components/foundation/scss/foundation/components/_type.scss */ em, i { font-style: italic; line-height: inherit; } -/* line 293, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 293, ../components/foundation/scss/foundation/components/_type.scss */ strong, b { font-weight: bold; line-height: inherit; } -/* line 299, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 299, ../components/foundation/scss/foundation/components/_type.scss */ small { font-size: 60%; line-height: inherit; } -/* line 304, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 304, ../components/foundation/scss/foundation/components/_type.scss */ code { font-family: Consolas, "Liberation Mono", Courier, monospace; font-weight: normal; @@ -2559,7 +2559,7 @@ code { } /* Lists */ -/* line 316, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 316, ../components/foundation/scss/foundation/components/_type.scss */ ul, ol, dl { @@ -2570,15 +2570,15 @@ dl { font-family: inherit; } -/* line 326, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 326, ../components/foundation/scss/foundation/components/_type.scss */ ul { margin-left: 1.1rem; } -/* line 328, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 328, ../components/foundation/scss/foundation/components/_type.scss */ ul.no-bullet { margin-left: 0; } -/* line 331, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 331, ../components/foundation/scss/foundation/components/_type.scss */ ul.no-bullet li ul, ul.no-bullet li ol { margin-left: 1.25rem; @@ -2587,42 +2587,42 @@ ul.no-bullet li ol { } /* Unordered Lists */ -/* line 344, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 344, ../components/foundation/scss/foundation/components/_type.scss */ ul li ul, ul li ol { margin-left: 1.25rem; margin-bottom: 0; } -/* line 353, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 353, ../components/foundation/scss/foundation/components/_type.scss */ ul.square li ul, ul.circle li ul, ul.disc li ul { list-style: inherit; } -/* line 356, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 356, ../components/foundation/scss/foundation/components/_type.scss */ ul.square { list-style-type: square; margin-left: 1.1rem; } -/* line 357, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 357, ../components/foundation/scss/foundation/components/_type.scss */ ul.circle { list-style-type: circle; margin-left: 1.1rem; } -/* line 358, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 358, ../components/foundation/scss/foundation/components/_type.scss */ ul.disc { list-style-type: disc; margin-left: 1.1rem; } -/* line 359, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 359, ../components/foundation/scss/foundation/components/_type.scss */ ul.no-bullet { list-style: none; } /* Ordered Lists */ -/* line 363, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 363, ../components/foundation/scss/foundation/components/_type.scss */ ol { margin-left: 1.4rem; } -/* line 366, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 366, ../components/foundation/scss/foundation/components/_type.scss */ ol li ul, ol li ol { margin-left: 1.25rem; @@ -2630,18 +2630,18 @@ ol li ol { } /* Definition Lists */ -/* line 376, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 376, ../components/foundation/scss/foundation/components/_type.scss */ dl dt { margin-bottom: 0.3rem; font-weight: bold; } -/* line 380, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 380, ../components/foundation/scss/foundation/components/_type.scss */ dl dd { margin-bottom: 0.75rem; } /* Abbreviations */ -/* line 384, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 384, ../components/foundation/scss/foundation/components/_type.scss */ abbr, acronym { text-transform: uppercase; @@ -2650,39 +2650,39 @@ acronym { cursor: help; } -/* line 391, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 391, ../components/foundation/scss/foundation/components/_type.scss */ abbr { text-transform: none; } -/* line 393, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 393, ../components/foundation/scss/foundation/components/_type.scss */ abbr[title] { border-bottom: 1px dotted #DDDDDD; } /* Blockquotes */ -/* line 399, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 399, ../components/foundation/scss/foundation/components/_type.scss */ blockquote { margin: 0 0 16px; padding: 0.5625rem 1.25rem 0 1.1875rem; border-left: 1px solid #DDDDDD; } -/* line 404, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 404, ../components/foundation/scss/foundation/components/_type.scss */ blockquote cite { display: block; font-size: 0.8125rem; color: #626262; } -/* line 408, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 408, ../components/foundation/scss/foundation/components/_type.scss */ blockquote cite:before { content: "\2014 \0020"; } -/* line 412, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 412, ../components/foundation/scss/foundation/components/_type.scss */ blockquote cite a, blockquote cite a:visited { color: #626262; } -/* line 418, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 418, ../components/foundation/scss/foundation/components/_type.scss */ blockquote, blockquote p { line-height: 1.2; @@ -2690,29 +2690,29 @@ blockquote p { } /* Microformats */ -/* line 425, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 425, ../components/foundation/scss/foundation/components/_type.scss */ .vcard { display: inline-block; margin: 0 0 1.25rem 0; border: 1px solid #DDDDDD; padding: 0.625rem 0.75rem; } -/* line 431, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 431, ../components/foundation/scss/foundation/components/_type.scss */ .vcard li { margin: 0; display: block; } -/* line 435, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 435, ../components/foundation/scss/foundation/components/_type.scss */ .vcard .fn { font-weight: bold; font-size: 0.9375rem; } -/* line 442, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 442, ../components/foundation/scss/foundation/components/_type.scss */ .vevent .summary { font-weight: bold; } -/* line 444, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ +/* line 444, ../components/foundation/scss/foundation/components/_type.scss */ .vevent abbr { cursor: default; text-decoration: none; @@ -2722,37 +2722,37 @@ blockquote p { } @media all { - /* line 455, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 455, ../components/foundation/scss/foundation/components/_type.scss */ h1, h2, h3, h4, h5, h6 { line-height: 1.4; } - /* line 456, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 456, ../components/foundation/scss/foundation/components/_type.scss */ h1 { font-size: 1.5rem; } - /* line 457, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 457, ../components/foundation/scss/foundation/components/_type.scss */ h2 { font-size: 1.1875rem; } - /* line 458, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 458, ../components/foundation/scss/foundation/components/_type.scss */ h3 { font-size: 1.0625rem; } - /* line 459, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 459, ../components/foundation/scss/foundation/components/_type.scss */ h4 { font-size: 1rem; } - /* line 460, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 460, ../components/foundation/scss/foundation/components/_type.scss */ h5 { font-size: 0.9375rem; } - /* line 461, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_type.scss */ + /* line 461, ../components/foundation/scss/foundation/components/_type.scss */ h6 { font-size: 1rem; } @@ -2792,12 +2792,12 @@ html, body { margin-bottom: 0; max-width: 1230px; } -/* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 172, ../components/foundation/scss/foundation/components/_global.scss */ .container:before, .container:after { content: " "; display: table; } -/* line 173, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 173, ../components/foundation/scss/foundation/components/_global.scss */ .container:after { clear: both; } @@ -2805,7 +2805,7 @@ html, body { /* line 18, ../sass/openeyes/components/containers/_main.scss */ .container.main { border-radius: 5px; - background: #dae6f1 url('../img/_structure/gradient_bg.png?1457349956') 0 0 repeat-x; + background: #dae6f1 url('../img/_structure/gradient_bg.png?1473759481') 0 0 repeat-x; border: 2px solid #b3b0ae; margin-bottom: 40px; width: 1234px; @@ -2829,7 +2829,7 @@ html, body { /* line 18, ../sass/openeyes/components/containers/_content.scss */ .container.content { - background: url('../img/_structure/help_top_grad.png?1457349956') 0 bottom repeat-x; + background: url('../img/_structure/help_top_grad.png?1473759481') 0 bottom repeat-x; min-height: 330px; } @media print { @@ -2940,14 +2940,14 @@ dl li { list-style: none; overflow: hidden; } -/* line 42, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_inline-lists.scss */ +/* line 42, ../components/foundation/scss/foundation/components/_inline-lists.scss */ .inline-list > li { list-style: none; float: left; margin-left: 1.375rem; display: block; } -/* line 47, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_inline-lists.scss */ +/* line 47, ../components/foundation/scss/foundation/components/_inline-lists.scss */ .inline-list > li > * { display: block; } @@ -2960,18 +2960,18 @@ table { border: solid 1px #DDDDDD; table-layout: auto; } -/* line 69, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_tables.scss */ +/* line 69, ../components/foundation/scss/foundation/components/_tables.scss */ table caption { background: transparent; color: #444444; font-size: 1rem; font-weight: bold; } -/* line 78, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_tables.scss */ +/* line 78, ../components/foundation/scss/foundation/components/_tables.scss */ table thead { background: whitesmoke; } -/* line 82, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_tables.scss */ +/* line 82, ../components/foundation/scss/foundation/components/_tables.scss */ table thead tr th, table thead tr td { padding: 8px 10px; @@ -2979,11 +2979,11 @@ table thead tr td { font-weight: bold; color: #444444; } -/* line 92, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_tables.scss */ +/* line 92, ../components/foundation/scss/foundation/components/_tables.scss */ table tfoot { background: whitesmoke; } -/* line 96, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_tables.scss */ +/* line 96, ../components/foundation/scss/foundation/components/_tables.scss */ table tfoot tr th, table tfoot tr td { padding: 8px 10px; @@ -2991,7 +2991,7 @@ table tfoot tr td { font-weight: bold; color: #444444; } -/* line 107, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_tables.scss */ +/* line 107, ../components/foundation/scss/foundation/components/_tables.scss */ table tr th, table tr td { padding: 10px; @@ -2999,11 +2999,11 @@ table tr td { color: #222; text-align: left; } -/* line 115, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_tables.scss */ +/* line 115, ../components/foundation/scss/foundation/components/_tables.scss */ table tr.even, table tr.alt, table tr:nth-of-type(even) { background: #e1eef9; } -/* line 120, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_tables.scss */ +/* line 120, ../components/foundation/scss/foundation/components/_tables.scss */ table thead tr th, table tfoot tr th, table tfoot tr td, @@ -3252,7 +3252,7 @@ table.grid tfoot tr { } /* line 24, ../sass/openeyes/components/_header.scss */ .header .logo { - background: url('../img/_structure/openeyes.png?1457349956') no-repeat; + background: url('../img/_structure/openeyes.png?1473759481') no-repeat; background-size: 100%; display: block; height: 70px; @@ -3262,14 +3262,14 @@ table.grid tfoot tr { /* line 24, ../sass/openeyes/components/_header.scss */ .header .logo { -webkit-print-color-adjust: exact; - background: url('../img/_structure/openeyes.png?1457349956') no-repeat !important; + background: url('../img/_structure/openeyes.png?1473759481') no-repeat !important; background-size: 100% !important; } } @media screen { /* line 37, ../sass/openeyes/components/_header.scss */ .header.stuck { - background: #a0d7f8 url('../img/_structure/miniheader/bg_gradient.png?1457349956') bottom repeat-x; + background: #a0d7f8 url('../img/_structure/miniheader/bg_gradient.png?1473759481') bottom repeat-x; position: fixed; top: 0; z-index: 200; @@ -3286,13 +3286,13 @@ table.grid tfoot tr { .header.stuck .logo { height: 25px; margin: 8px 0 0 10px; - background: url('../img/_structure/openeyes_small.png?1457349956') 0 0 no-repeat; + background: url('../img/_structure/openeyes_small.png?1473759481') 0 0 no-repeat; } } /* line 19, ../sass/openeyes/components/_footer.scss */ .footer { - background: #b3b0ae url('../img/_structure/openeyes_footer.png?1457349956') no-repeat right top; + background: #b3b0ae url('../img/_structure/openeyes_footer.png?1473759481') no-repeat right top; } /* line 22, ../sass/openeyes/components/_footer.scss */ .footer .info { @@ -3329,24 +3329,24 @@ table.grid tfoot tr { border-radius: 0 0 3px 3px; margin: 1px 0 0 0; } -/* line 55, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 55, ../components/foundation/scss/foundation/components/_panels.scss */ .footer .help .panel > :first-child { margin-top: 0; } -/* line 56, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 56, ../components/foundation/scss/foundation/components/_panels.scss */ .footer .help .panel > :last-child { margin-bottom: 0; } -/* line 61, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 61, ../components/foundation/scss/foundation/components/_panels.scss */ .footer .help .panel h1, .footer .help .panel h2, .footer .help .panel h3, .footer .help .panel h4, .footer .help .panel h5, .footer .help .panel h6, .footer .help .panel p, .footer .help .panel li, .footer .help .panel dl { color: #333333; } -/* line 68, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 68, ../components/foundation/scss/foundation/components/_panels.scss */ .footer .help .panel h1, .footer .help .panel h2, .footer .help .panel h3, .footer .help .panel h4, .footer .help .panel h5, .footer .help .panel h6 { line-height: 1; margin-bottom: 0.625rem; } -/* line 70, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 70, ../components/foundation/scss/foundation/components/_panels.scss */ .footer .help .panel h1.subheader, .footer .help .panel h2.subheader, .footer .help .panel h3.subheader, .footer .help .panel h4.subheader, .footer .help .panel h5.subheader, .footer .help .panel h6.subheader { line-height: 1.4; } @@ -3490,23 +3490,23 @@ input[type="text"], input[type="password"], input[type="date"], input[type="date padding: 4px 5px; margin: 0; } -/* line 185, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 185, ../components/foundation/scss/foundation/components/_global.scss */ input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="week"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="time"]:focus, input[type="url"]:focus, textarea:focus { box-shadow: 0 0 5px #19a8ea; border-color: #19a8ea; } -/* line 133, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_forms.scss */ +/* line 133, ../components/foundation/scss/foundation/components/_forms.scss */ input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="week"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="time"]:focus, input[type="url"]:focus, textarea:focus { background: white; border-color: #19a8ea; outline: none; } -/* line 139, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_forms.scss */ +/* line 139, ../components/foundation/scss/foundation/components/_forms.scss */ input[type="text"]:disabled, input[type="password"]:disabled, input[type="date"]:disabled, input[type="datetime"]:disabled, input[type="datetime-local"]:disabled, input[type="month"]:disabled, input[type="week"]:disabled, input[type="email"]:disabled, input[type="number"]:disabled, input[type="search"]:disabled, input[type="tel"]:disabled, input[type="time"]:disabled, input[type="url"]:disabled, textarea:disabled { background-color: #dddddd; cursor: default; } -/* line 145, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_forms.scss */ +/* line 145, ../components/foundation/scss/foundation/components/_forms.scss */ input[type="text"][disabled], input[type="text"][readonly], fieldset[disabled] input[type="text"], input[type="password"][disabled], input[type="password"][readonly], fieldset[disabled] input[type="password"], input[type="date"][disabled], input[type="date"][readonly], fieldset[disabled] input[type="date"], input[type="datetime"][disabled], input[type="datetime"][readonly], fieldset[disabled] input[type="datetime"], input[type="datetime-local"][disabled], input[type="datetime-local"][readonly], fieldset[disabled] input[type="datetime-local"], input[type="month"][disabled], input[type="month"][readonly], fieldset[disabled] input[type="month"], input[type="week"][disabled], input[type="week"][readonly], fieldset[disabled] input[type="week"], input[type="email"][disabled], input[type="email"][readonly], fieldset[disabled] input[type="email"], input[type="number"][disabled], input[type="number"][readonly], fieldset[disabled] input[type="number"], input[type="search"][disabled], input[type="search"][readonly], fieldset[disabled] input[type="search"], input[type="tel"][disabled], input[type="tel"][readonly], fieldset[disabled] input[type="tel"], input[type="time"][disabled], input[type="time"][readonly], fieldset[disabled] input[type="time"], input[type="url"][disabled], input[type="url"][readonly], fieldset[disabled] input[type="url"], textarea[disabled], textarea[readonly], fieldset[disabled] textarea { background-color: #dddddd; cursor: default; @@ -3988,12 +3988,12 @@ button.button-icon.small.delete:hover .icon-button-small-trash-can, button.butto margin: 0; left: 0; } -/* line 172, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 172, ../components/foundation/scss/foundation/components/_global.scss */ .button-group:before, .button-group:after { content: " "; display: table; } -/* line 173, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_global.scss */ +/* line 173, ../components/foundation/scss/foundation/components/_global.scss */ .button-group:after { clear: both; } @@ -4002,12 +4002,12 @@ button.button-icon.small.delete:hover .icon-button-small-trash-can, button.butto margin: 0 -2px; display: inline-block; } -/* line 39, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_button-groups.scss */ +/* line 39, ../components/foundation/scss/foundation/components/_button-groups.scss */ .button-group > li > button, .button-group > li .button { border-left: 1px solid; border-color: rgba(255, 255, 255, 0.5); } -/* line 45, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_button-groups.scss */ +/* line 45, ../components/foundation/scss/foundation/components/_button-groups.scss */ .button-group > li:first-child button, .button-group > li:first-child .button { border-left: 0; } @@ -4068,31 +4068,31 @@ button.disabled, button.inactive, .button.inactive, input[type="submit"].inactiv font-family: "Helvetica", Helvetica, Arial, sans-serif; padding-top: 0; } -/* line 70, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_side-nav.scss */ +/* line 70, ../components/foundation/scss/foundation/components/_side-nav.scss */ .side-nav li { margin: 0 0 6px 0; font-size: 0.875rem; font-weight: normal; } -/* line 75, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_side-nav.scss */ +/* line 75, ../components/foundation/scss/foundation/components/_side-nav.scss */ .side-nav li a:not(.button) { display: block; color: #0b59da; margin: 0; padding: 0.4375rem 0.875rem; } -/* line 80, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_side-nav.scss */ +/* line 80, ../components/foundation/scss/foundation/components/_side-nav.scss */ .side-nav li a:not(.button):hover, .side-nav li a:not(.button):focus { background: rgba(0, 0, 0, 0.025); color: #4487f6; } -/* line 87, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_side-nav.scss */ +/* line 87, ../components/foundation/scss/foundation/components/_side-nav.scss */ .side-nav li.active > a:first-child:not(.button) { color: #4487f6; font-weight: normal; font-family: "Helvetica", Helvetica, Arial, sans-serif; } -/* line 93, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_side-nav.scss */ +/* line 93, ../components/foundation/scss/foundation/components/_side-nav.scss */ .side-nav li.divider { border-top: 1px solid; height: 0; @@ -4100,7 +4100,7 @@ button.disabled, button.inactive, .button.inactive, input[type="submit"].inactiv list-style: none; border-top-color: white; } -/* line 101, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_side-nav.scss */ +/* line 101, ../components/foundation/scss/foundation/components/_side-nav.scss */ .side-nav li.heading { color: #0b59da; font-size: 0.875rem; @@ -4167,11 +4167,11 @@ button.disabled, button.inactive, .button.inactive, input[type="submit"].inactiv padding: 0; border-top: none; } -/* line 73, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_dropdown.scss */ +/* line 73, ../components/foundation/scss/foundation/components/_dropdown.scss */ .navigation.user .sub-menu-item > *:first-child { margin-top: 0; } -/* line 74, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_dropdown.scss */ +/* line 74, ../components/foundation/scss/foundation/components/_dropdown.scss */ .navigation.user .sub-menu-item > *:last-child { margin-bottom: 0; } @@ -4195,14 +4195,14 @@ ul.pagination { height: auto; min-height: 1.5rem; } -/* line 104, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 104, ../components/foundation/scss/foundation/components/_pagination.scss */ ul.pagination li { height: 1.5rem; color: #222222; font-size: 0.875rem; margin-left: 0.3125rem; } -/* line 110, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 110, ../components/foundation/scss/foundation/components/_pagination.scss */ ul.pagination li a, ul.pagination li button { display: block; padding: 0.0625rem 0.625rem 0.0625rem; @@ -4214,33 +4214,33 @@ ul.pagination li a, ul.pagination li button { line-height: inherit; transition: background-color 300ms ease-out; } -/* line 122, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 122, ../components/foundation/scss/foundation/components/_pagination.scss */ ul.pagination li:hover a, ul.pagination li a:focus, ul.pagination li:hover button, ul.pagination li button:focus { background: #e6e6e6; } -/* line 51, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 51, ../components/foundation/scss/foundation/components/_pagination.scss */ ul.pagination li.unavailable a, ul.pagination li.unavailable button { cursor: default; color: #999999; } -/* line 55, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 55, ../components/foundation/scss/foundation/components/_pagination.scss */ ul.pagination li.unavailable:hover a, ul.pagination li.unavailable a:focus, ul.pagination li.unavailable:hover button, ul.pagination li.unavailable button:focus { background: transparent; } -/* line 68, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 68, ../components/foundation/scss/foundation/components/_pagination.scss */ ul.pagination li.current a, ul.pagination li.current button { background: #0b59da; color: #FFFFFF; font-weight: bold; cursor: default; } -/* line 74, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 74, ../components/foundation/scss/foundation/components/_pagination.scss */ ul.pagination li.current a:hover, ul.pagination li.current a:focus, ul.pagination li.current button:hover, ul.pagination li.current button:focus { background: #0b59da; } -/* line 136, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 136, ../components/foundation/scss/foundation/components/_pagination.scss */ ul.pagination li { float: left; display: block; @@ -4324,7 +4324,7 @@ tfoot.pagination-container .pagination-view-all { .pagination-centered { text-align: center; } -/* line 136, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_pagination.scss */ +/* line 136, ../components/foundation/scss/foundation/components/_pagination.scss */ .pagination-centered ul.pagination li { float: none; display: inline-block; @@ -4360,7 +4360,7 @@ tfoot.pagination-container .pagination-view-all { background: inherit; top: 1em; } -/* line 96, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_alert-boxes.scss */ +/* line 96, ../components/foundation/scss/foundation/components/_alert-boxes.scss */ .alert-box .close:hover, .alert-box .close:focus { opacity: 0.5; } @@ -4415,7 +4415,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 33, ../sass/openeyes/components/alert-boxes/_alert.scss */ .alert-box.alert.with-icon, .with-icon.alert-box.warning { - background-image: url('../img/_elements/icons/box/warning.png?1457349956'); + background-image: url('../img/_elements/icons/box/warning.png?1473759481'); min-height: 36px; padding-bottom: 11px; padding-top: 11px; @@ -4424,7 +4424,7 @@ tfoot.pagination-container .pagination-view-all { /* line 33, ../sass/openeyes/components/alert-boxes/_alert.scss */ .alert-box.alert.with-icon, .with-icon.alert-box.warning { background-color: #ffe6b2 !important; - background-image: url('../img/_elements/icons/box/warning.png?1457349956') !important; + background-image: url('../img/_elements/icons/box/warning.png?1473759481') !important; } } @@ -4437,14 +4437,14 @@ tfoot.pagination-container .pagination-view-all { } /* line 32, ../sass/openeyes/components/alert-boxes/_issue.scss */ .alert-box.issue.with-icon { - background-image: url('../img/_elements/icons/box/issue.png?1457349956'); + background-image: url('../img/_elements/icons/box/issue.png?1473759481'); min-height: 36px; } @media print { /* line 32, ../sass/openeyes/components/alert-boxes/_issue.scss */ .alert-box.issue.with-icon { background-color: #fdf2e5 !important; - background-image: url('../img/_elements/icons/box/issue.png?1457349956') !important; + background-image: url('../img/_elements/icons/box/issue.png?1473759481') !important; } } @@ -4456,7 +4456,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 33, ../sass/openeyes/components/alert-boxes/_patient.scss */ .alert-box.patient.with-icon { - background-image: url('../img/_elements/icons/box/patient-warning.png?1457349956'); + background-image: url('../img/_elements/icons/box/patient-warning.png?1473759481'); padding-bottom: 11px; padding-top: 11px; } @@ -4464,7 +4464,7 @@ tfoot.pagination-container .pagination-view-all { /* line 33, ../sass/openeyes/components/alert-boxes/_patient.scss */ .alert-box.patient.with-icon { background-color: #eb5911 !important; - background-image: url('../img/_elements/icons/box/patient-warning.png?1457349956') !important; + background-image: url('../img/_elements/icons/box/patient-warning.png?1473759481') !important; } } @@ -4477,7 +4477,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 32, ../sass/openeyes/components/alert-boxes/_success.scss */ .alert-box.success.with-icon, .alert-box.info.with-icon { - background-image: url('../img/_elements/icons/box/info.png?1457349956'); + background-image: url('../img/_elements/icons/box/info.png?1473759481'); min-height: 36px; padding-bottom: 11px; padding-top: 11px; @@ -4486,7 +4486,7 @@ tfoot.pagination-container .pagination-view-all { /* line 32, ../sass/openeyes/components/alert-boxes/_success.scss */ .alert-box.success.with-icon, .alert-box.info.with-icon { background-color: #e0f2db !important; - background-image: url('../img/_elements/icons/box/info.png?1457349956') !important; + background-image: url('../img/_elements/icons/box/info.png?1473759481') !important; } } @@ -4500,7 +4500,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 33, ../sass/openeyes/components/alert-boxes/_error.scss */ .alert-box.error.with-icon { - background-image: url('../img/_elements/icons/box/error.png?1457349956'); + background-image: url('../img/_elements/icons/box/error.png?1473759481'); min-height: 36px; padding-bottom: 11px; padding-top: 11px; @@ -4509,7 +4509,7 @@ tfoot.pagination-container .pagination-view-all { /* line 33, ../sass/openeyes/components/alert-boxes/_error.scss */ .alert-box.error.with-icon { background-color: #c90000 !important; - background-image: url('../img/_elements/icons/box/error.png?1457349956') !important; + background-image: url('../img/_elements/icons/box/error.png?1473759481') !important; } } @@ -4608,24 +4608,24 @@ tfoot.pagination-container .pagination-view-all { margin-top: 0; padding: 12px; } -/* line 55, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 55, ../components/foundation/scss/foundation/components/_panels.scss */ .box.generic > :first-child { margin-top: 0; } -/* line 56, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 56, ../components/foundation/scss/foundation/components/_panels.scss */ .box.generic > :last-child { margin-bottom: 0; } -/* line 61, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 61, ../components/foundation/scss/foundation/components/_panels.scss */ .box.generic h1, .box.generic h2, .box.generic h3, .box.generic h4, .box.generic h5, .box.generic h6, .box.generic p, .box.generic li, .box.generic dl { color: #333333; } -/* line 68, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 68, ../components/foundation/scss/foundation/components/_panels.scss */ .box.generic h1, .box.generic h2, .box.generic h3, .box.generic h4, .box.generic h5, .box.generic h6 { line-height: 1; margin-bottom: 0.625rem; } -/* line 70, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 70, ../components/foundation/scss/foundation/components/_panels.scss */ .box.generic h1.subheader, .box.generic h2.subheader, .box.generic h3.subheader, .box.generic h4.subheader, .box.generic h5.subheader, .box.generic h6.subheader { line-height: 1.4; } @@ -4824,24 +4824,24 @@ tfoot.pagination-container .pagination-view-all { margin-top: 0; padding: 5px; } -/* line 55, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 55, ../components/foundation/scss/foundation/components/_panels.scss */ .box.dashboard > :first-child { margin-top: 0; } -/* line 56, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 56, ../components/foundation/scss/foundation/components/_panels.scss */ .box.dashboard > :last-child { margin-bottom: 0; } -/* line 61, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 61, ../components/foundation/scss/foundation/components/_panels.scss */ .box.dashboard h1, .box.dashboard h2, .box.dashboard h3, .box.dashboard h4, .box.dashboard h5, .box.dashboard h6, .box.dashboard p, .box.dashboard li, .box.dashboard dl { color: #333333; } -/* line 68, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 68, ../components/foundation/scss/foundation/components/_panels.scss */ .box.dashboard h1, .box.dashboard h2, .box.dashboard h3, .box.dashboard h4, .box.dashboard h5, .box.dashboard h6 { line-height: 1; margin-bottom: 0.625rem; } -/* line 70, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 70, ../components/foundation/scss/foundation/components/_panels.scss */ .box.dashboard h1.subheader, .box.dashboard h2.subheader, .box.dashboard h3.subheader, .box.dashboard h4.subheader, .box.dashboard h5.subheader, .box.dashboard h6.subheader { line-height: 1.4; } @@ -5103,24 +5103,24 @@ tfoot.pagination-container .pagination-view-all { border-color: #d9d9d9; margin-top: 0; } -/* line 55, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 55, ../components/foundation/scss/foundation/components/_panels.scss */ .panel > :first-child { margin-top: 0; } -/* line 56, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 56, ../components/foundation/scss/foundation/components/_panels.scss */ .panel > :last-child { margin-bottom: 0; } -/* line 61, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 61, ../components/foundation/scss/foundation/components/_panels.scss */ .panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6, .panel p, .panel li, .panel dl { color: #333333; } -/* line 68, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 68, ../components/foundation/scss/foundation/components/_panels.scss */ .panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6 { line-height: 1; margin-bottom: 0.625rem; } -/* line 70, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 70, ../components/foundation/scss/foundation/components/_panels.scss */ .panel h1.subheader, .panel h2.subheader, .panel h3.subheader, .panel h4.subheader, .panel h5.subheader, .panel h6.subheader { line-height: 1.4; } @@ -5165,31 +5165,31 @@ tfoot.pagination-container .pagination-view-all { -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0; border-radius: 0 0 5px 5px; - background-image: url('../img/_elements/icons/user/idcard_bg.png?1457349956'); + background-image: url('../img/_elements/icons/user/idcard_bg.png?1473759481'); background-position: left bottom; background-repeat: no-repeat; border-color: #b3b0ae; border-top: 0; margin: 0; } -/* line 55, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 55, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.user > :first-child { margin-top: 0; } -/* line 56, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 56, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.user > :last-child { margin-bottom: 0; } -/* line 61, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 61, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.user h1, .panel.user h2, .panel.user h3, .panel.user h4, .panel.user h5, .panel.user h6, .panel.user p, .panel.user li, .panel.user dl { color: #333333; } -/* line 68, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 68, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.user h1, .panel.user h2, .panel.user h3, .panel.user h4, .panel.user h5, .panel.user h6 { line-height: 1; margin-bottom: 0.625rem; } -/* line 70, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 70, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.user h1.subheader, .panel.user h2.subheader, .panel.user h3.subheader, .panel.user h4.subheader, .panel.user h5.subheader, .panel.user h6.subheader { line-height: 1.4; } @@ -5299,11 +5299,11 @@ tfoot.pagination-container .pagination-view-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; - background: url('../img/_elements/icons/patient/patient-id_small.png?1457349956'), url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZjJkOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZTZiMyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); - background: url('../img/_elements/icons/patient/patient-id_small.png?1457349956'), -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fff2d8), color-stop(100%, #ffe6b3)); - background: url('../img/_elements/icons/patient/patient-id_small.png?1457349956'), -moz-linear-gradient(top, #fff2d8 0%, #ffe6b3 100%); - background: url('../img/_elements/icons/patient/patient-id_small.png?1457349956'), -webkit-linear-gradient(top, #fff2d8 0%, #ffe6b3 100%); - background: url('../img/_elements/icons/patient/patient-id_small.png?1457349956'), linear-gradient(to bottom, #fff2d8 0%, #ffe6b3 100%); + background: url('../img/_elements/icons/patient/patient-id_small.png?1473759481'), url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZjJkOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZTZiMyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); + background: url('../img/_elements/icons/patient/patient-id_small.png?1473759481'), -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fff2d8), color-stop(100%, #ffe6b3)); + background: url('../img/_elements/icons/patient/patient-id_small.png?1473759481'), -moz-linear-gradient(top, #fff2d8 0%, #ffe6b3 100%); + background: url('../img/_elements/icons/patient/patient-id_small.png?1473759481'), -webkit-linear-gradient(top, #fff2d8 0%, #ffe6b3 100%); + background: url('../img/_elements/icons/patient/patient-id_small.png?1473759481'), linear-gradient(to bottom, #fff2d8 0%, #ffe6b3 100%); background-position: 98% 2px, top; background-repeat: no-repeat, no-repeat; border-color: #ffb212; @@ -5316,24 +5316,24 @@ tfoot.pagination-container .pagination-view-all { border-width: 0 2px 2px 2px; margin: 0; } -/* line 55, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 55, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.patient > :first-child { margin-top: 0; } -/* line 56, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 56, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.patient > :last-child { margin-bottom: 0; } -/* line 61, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 61, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.patient h1, .panel.patient h2, .panel.patient h3, .panel.patient h4, .panel.patient h5, .panel.patient h6, .panel.patient p, .panel.patient li, .panel.patient dl { color: #333333; } -/* line 68, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 68, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.patient h1, .panel.patient h2, .panel.patient h3, .panel.patient h4, .panel.patient h5, .panel.patient h6 { line-height: 1; margin-bottom: 0.625rem; } -/* line 70, ../../../../../../var/www/openeyes/protected/assets/components/foundation/scss/foundation/components/_panels.scss */ +/* line 70, ../components/foundation/scss/foundation/components/_panels.scss */ .panel.patient h1.subheader, .panel.patient h2.subheader, .panel.patient h3.subheader, .panel.patient h4.subheader, .panel.patient h5.subheader, .panel.patient h6.subheader { line-height: 1.4; } @@ -5392,13 +5392,7 @@ tfoot.pagination-container .pagination-view-all { position: absolute; right: 0; } -@media screen { - /* line 118, ../sass/openeyes/components/panels/_patient.scss */ - .stuck .panel.patient .patient-summary-anchor { - display: none; - } -} -/* line 123, ../sass/openeyes/components/panels/_patient.scss */ +/* line 118, ../sass/openeyes/components/panels/_patient.scss */ .panel.patient .clinical-summary-anchor { bottom: 12px; font-size: 0.6875rem; @@ -5407,49 +5401,49 @@ tfoot.pagination-container .pagination-view-all { right: 63px; } @media screen { - /* line 130, ../sass/openeyes/components/panels/_patient.scss */ + /* line 125, ../sass/openeyes/components/panels/_patient.scss */ .stuck .panel.patient .clinical-summary-anchor { display: none; } } -/* line 136, ../sass/openeyes/components/panels/_patient.scss */ +/* line 130, ../sass/openeyes/components/panels/_patient.scss */ .panel.patient .hospital-number { margin-bottom: 3px; } @media print { - /* line 139, ../sass/openeyes/components/panels/_patient.scss */ + /* line 133, ../sass/openeyes/components/panels/_patient.scss */ .panel.patient .patient-summary-anchor { display: none; } } @media print { - /* line 144, ../sass/openeyes/components/panels/_patient.scss */ + /* line 138, ../sass/openeyes/components/panels/_patient.scss */ .panel.patient .column, .panel.patient .columns { width: 100%; } } -/* line 149, ../sass/openeyes/components/panels/_patient.scss */ +/* line 143, ../sass/openeyes/components/panels/_patient.scss */ .panel.patient.warning { - background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1457349956'), url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZjJkOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZTZiMyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); - background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1457349956'), -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fff2d8), color-stop(100%, #ffe6b3)); - background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1457349956'), -moz-linear-gradient(top, #fff2d8 0%, #ffe6b3 100%); - background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1457349956'), -webkit-linear-gradient(top, #fff2d8 0%, #ffe6b3 100%); - background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1457349956'), linear-gradient(to bottom, #fff2d8 0%, #ffe6b3 100%); + background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1473759481'), url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZjJkOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZTZiMyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); + background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1473759481'), -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fff2d8), color-stop(100%, #ffe6b3)); + background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1473759481'), -moz-linear-gradient(top, #fff2d8 0%, #ffe6b3 100%); + background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1473759481'), -webkit-linear-gradient(top, #fff2d8 0%, #ffe6b3 100%); + background: url('../img/_elements/icons/patient/patient-id_small-warning.png?1473759481'), linear-gradient(to bottom, #fff2d8 0%, #ffe6b3 100%); background-position: 98% 2px, top; background-repeat: no-repeat, no-repeat; } -/* line 152, ../sass/openeyes/components/panels/_patient.scss */ +/* line 146, ../sass/openeyes/components/panels/_patient.scss */ .panel.patient.warning .warning .messages { display: none; } -/* line 164, ../sass/openeyes/components/panels/_patient.scss */ +/* line 158, ../sass/openeyes/components/panels/_patient.scss */ .nhs-number { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #107ebd; - background-image: url('../img/_elements/icons/nhs_tiny.png?1457349956'); + background-image: url('../img/_elements/icons/nhs_tiny.png?1473759481'); background-position: center left; background-repeat: no-repeat; color: white; @@ -5457,12 +5451,12 @@ tfoot.pagination-container .pagination-view-all { padding: 2px 3px 1px 33px; } @media print { - /* line 164, ../sass/openeyes/components/panels/_patient.scss */ + /* line 158, ../sass/openeyes/components/panels/_patient.scss */ .nhs-number { padding-left: 0; } } -/* line 179, ../sass/openeyes/components/panels/_patient.scss */ +/* line 173, ../sass/openeyes/components/panels/_patient.scss */ .nhs-number .messages { display: none; } @@ -5645,7 +5639,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 77, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .episode-title a { - background: url('../img/_elements/graphic/view-episode-summary.png?1457349955') right bottom no-repeat; + background: url('../img/_elements/graphic/view-episode-summary.png?1473759481') right bottom no-repeat; color: black; display: block; padding: 5px 0 16px 5px; @@ -5656,13 +5650,13 @@ tfoot.pagination-container .pagination-view-all { /* line 83, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .episode-title a:hover { background-color: #3665ff; - background-image: url('../img/_elements/icons/event/event_open_arrow.png?1457349956'); + background-image: url('../img/_elements/icons/event/event_open_arrow.png?1473759481'); color: white; } /* line 88, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .episode-title a.selected { background-color: #aaa; - background-image: url('../img/_elements/icons/event/event_open_arrow.png?1457349956'); + background-image: url('../img/_elements/icons/event/event_open_arrow.png?1473759481'); color: #fff; } /* line 94, ../sass/openeyes/components/panels/_episode.scss */ @@ -5722,31 +5716,31 @@ tfoot.pagination-container .pagination-view-all { } /* line 139, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events a:hover { - background: #3665ff url('../img/_elements/icons/event/event_open_arrow.png?1457349956') right center no-repeat; + background: #3665ff url('../img/_elements/icons/event/event_open_arrow.png?1473759481') right center no-repeat; color: white; } /* line 144, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events .event-type { display: inline-block; width: 35px; - background: url('../img/_elements/icons/event/status/quicklook.png?1457349956') right top no-repeat; + background: url('../img/_elements/icons/event/status/quicklook.png?1473759481') right top no-repeat; } /* line 148, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events .event-type:hover { - background-image: url('../img/_elements/icons/event/status/quicklook-hover.png?1457349956'); + background-image: url('../img/_elements/icons/event/status/quicklook-hover.png?1473759481'); } /* line 151, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events .event-type.alert { - background-image: url('../img/_elements/icons/event/status/alert.png?1457349956'); + background-image: url('../img/_elements/icons/event/status/alert.png?1473759481'); } /* line 153, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events .event-type.alert:hover { - background-image: url('../img/_elements/icons/event/status/alert-hover.png?1457349956'); + background-image: url('../img/_elements/icons/event/status/alert-hover.png?1473759481'); } /* line 158, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events .ev_date { padding-left: 21px; - background: url('../img/_elements/icons/event/small/datetime-past.png?1457349956') left center no-repeat; + background: url('../img/_elements/icons/event/small/datetime-past.png?1473759481') left center no-repeat; } /* line 162, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events .event-date { @@ -5775,12 +5769,12 @@ tfoot.pagination-container .pagination-view-all { } /* line 185, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events li.selected a { - background: #aaaaaa url('../img/_elements/icons/event/event_open_arrow.png?1457349956') right center no-repeat; + background: #aaaaaa url('../img/_elements/icons/event/event_open_arrow.png?1473759481') right center no-repeat; color: white; } /* line 190, ../sass/openeyes/components/panels/_episode.scss */ .panel.episode .events li.selected .event-type.alert { - background-image: url('../img/_elements/icons/event/status/alert-hover.png?1457349956'); + background-image: url('../img/_elements/icons/event/status/alert-hover.png?1473759481'); } /* line 33, ../sass/openeyes/components/panels/_login.scss */ @@ -6135,7 +6129,7 @@ tfoot.pagination-container .pagination-view-all { /* line 19, ../sass/openeyes/components/events/_episode.scss */ .event.episode .event-content { border-color: #C2BCA5; - background-image: url('../img/_elements/icons/event/watermark/_episode.png?1457349956'); + background-image: url('../img/_elements/icons/event/watermark/_episode.png?1473759481'); } /* line 25, ../sass/openeyes/components/events/_episode.scss */ .event.episode.view .event-types .collapsible { @@ -6381,7 +6375,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 174, ../sass/openeyes/components/events/_elements.scss */ .edit .icon-remove-side { - background: url('../img/_elements/icons/event-optional/element-remove.png?1457349956') no-repeat -10px -2px; + background: url('../img/_elements/icons/event-optional/element-remove.png?1473759481') no-repeat -10px -2px; height: 16px; position: absolute; right: 5px; @@ -6391,7 +6385,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 183, ../sass/openeyes/components/events/_elements.scss */ .edit .icon-add-side { - background: url('../img/_elements/icons/event-optional/element-view.png?1457349956') no-repeat -10px -4px; + background: url('../img/_elements/icons/event-optional/element-view.png?1473759481') no-repeat -10px -4px; height: 16px; width: 16px; } @@ -6609,12 +6603,12 @@ tfoot.pagination-container .pagination-view-all { } /* line 66, ../sass/openeyes/components/events/_optional-elements.scss */ .edit .optional-elements-list li.clicked a, .edit .sub-elements-list li.clicked a, .edit .optional-elements-list li.clicked a:hover, .edit .sub-elements-list li.clicked a:hover { - background: #dddddd url('../img/ajax-loader.gif?1457349956') no-repeat 99.5% 2px; + background: #dddddd url('../img/ajax-loader.gif?1473759481') no-repeat 99.5% 2px; color: #333; } /* line 72, ../sass/openeyes/components/events/_optional-elements.scss */ .edit .optional-elements-list li a, .edit .sub-elements-list li a { - background: #8c949c url('../img/_elements/icons/event-optional/element-view.png?1457349956') no-repeat right top; + background: #8c949c url('../img/_elements/icons/event-optional/element-view.png?1473759481') no-repeat right top; border-bottom: 1px dotted #fafafa; color: #fff; display: block; @@ -6719,7 +6713,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 43, ../sass/openeyes/components/_dialog.scss */ .ui-dialog.dialog .ui-dialog-content.loading { - background: url('../img/ajax-loader-large.gif?1457349956') center center no-repeat; + background: url('../img/ajax-loader-large.gif?1473759481') center center no-repeat; padding: 20px 0 40px 0; text-align: center; } @@ -6728,7 +6722,7 @@ tfoot.pagination-container .pagination-view-all { -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; - background: transparent url('../img/_elements/btns/overlay/big-cross.png?1457349955') top left no-repeat; + background: transparent url('../img/_elements/btns/overlay/big-cross.png?1473759481') top left no-repeat; border: 0; display: block; float: none; @@ -6851,7 +6845,7 @@ tfoot.pagination-container .pagination-view-all { .multi-select .remove-one { filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); opacity: 0.5; - background: url('../img/_elements/icons/event-optional/element-remove.png?1457349956') no-repeat -10px -2px; + background: url('../img/_elements/icons/event-optional/element-remove.png?1473759481') no-repeat -10px -2px; display: inline-block; height: 15px; margin-left: 2px; @@ -6925,7 +6919,7 @@ tfoot.pagination-container .pagination-view-all { .multi-select-free-text .remove-one { filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); opacity: 0.5; - background: url('../img/_elements/icons/event-optional/element-remove.png?1457349956') no-repeat -10px -2px; + background: url('../img/_elements/icons/event-optional/element-remove.png?1473759481') no-repeat -10px -2px; display: inline-block; height: 15px; margin-left: 2px; @@ -7101,7 +7095,7 @@ tfoot.pagination-container .pagination-view-all { } /* line 59, ../sass/openeyes/components/_quicklook.scss */ .quicklook .event-issue { - background: #fdf2e5 url('../img/_elements/icons/event/status/alert.png?1457349956') top left no-repeat; + background: #fdf2e5 url('../img/_elements/icons/event/status/alert.png?1473759481') top left no-repeat; color: #600; font-size: 11px; margin-top: 7px; diff --git a/protected/assets/js/PCRCalculation.js b/protected/assets/js/PCRCalculation.js index 3d07e0a0b3..4089902620 100644 --- a/protected/assets/js/PCRCalculation.js +++ b/protected/assets/js/PCRCalculation.js @@ -1,22 +1,18 @@ - - - /** * Takes the element that has been changed and worked out which eye it should be altering in PCR risk * * @param ev * @returns {*|jQuery|HTMLElement} */ -function getPcrContainer(ev) -{ - var isRight = (ev.target.id.indexOf('right') > -1), - $container = $('#ophCiExaminationPCRRiskLeftEye'); +function getPcrContainer(ev) { + var isRight = (ev.target.id.indexOf('right') > -1), + $container = $('#ophCiExaminationPCRRiskLeftEye, section.OEModule_OphCiExamination_models_Element_OphCiExamination_PcrRisk .left-eye'); - if(isRight){ - $container = $('#ophCiExaminationPCRRiskRightEye'); - } + if (isRight) { + $container = $('#ophCiExaminationPCRRiskRightEye, section.OEModule_OphCiExamination_models_Element_OphCiExamination_PcrRisk .right-eye'); + } - return $container; + return $container; } /** @@ -25,20 +21,19 @@ function getPcrContainer(ev) * @param ev * @param pcrEl */ -function setFundalView(ev, pcrEl) -{ - if (!pcrEl) { - pcrEl = ev.data; - } - - var $container = getPcrContainer(ev); - if($(ev.target).find(':selected').data('value') === 'No view'){ - $container.find(pcrEl).val('Y'); - } else { - $container.find(pcrEl).val('N'); - } - - $(pcrEl).trigger('change'); +function setFundalView(ev, pcrEl) { + if (!pcrEl) { + pcrEl = ev.data; + } + + var $container = getPcrContainer(ev); + if ($(ev.target).find(':selected').data('value') === 'No view') { + $container.find(pcrEl).val('Y'); + } else { + $container.find(pcrEl).val('N'); + } + + $(pcrEl).trigger('change'); } /** @@ -47,17 +42,16 @@ function setFundalView(ev, pcrEl) * @param ev * @param pcrEl */ -function setDiabeticDisorder(ev, pcrEl) -{ - if (!pcrEl) { - pcrEl = ev.data; - } +function setDiabeticDisorder(ev, pcrEl) { + if (!pcrEl) { + pcrEl = ev.data; + } - if($('input[name^="diabetic_diagnoses"]').length){ - $(pcrEl).val('Y'); - } + if ($('input[name^="diabetic_diagnoses"]').length) { + $(pcrEl).val('Y'); + } - $(pcrEl).trigger('change'); + $(pcrEl).trigger('change'); } /** @@ -66,17 +60,16 @@ function setDiabeticDisorder(ev, pcrEl) * @param ev * @param pcrEl */ -function setGlaucomaDisorder(ev, pcrEl) -{ - if (!pcrEl) { - pcrEl = ev.data; - } +function setGlaucomaDisorder(ev, pcrEl) { + if (!pcrEl) { + pcrEl = ev.data; + } - if($('input[name^="glaucoma_diagnoses"]').length){ - $(pcrEl).val('Y'); - } + if ($('input[name^="glaucoma_diagnoses"]').length) { + $(pcrEl).val('Y'); + } - $(pcrEl).trigger('change'); + $(pcrEl).trigger('change'); } /** @@ -87,29 +80,28 @@ function setGlaucomaDisorder(ev, pcrEl) * @param ev * @param pcrEl */ -function setSurgeonFromNote(ev, pcrEl) -{ - if(!pcrEl){ - pcrEl = ev.data; - } - - var surgeonId = $(ev.target).val(); - if(!surgeonId){ - $(pcrEl).val(''); - $(pcrEl).trigger('change'); - return; - } - - $.ajax({ - 'type': 'GET', - 'url': '/user/surgeonGrade/', - 'data': {'id': surgeonId}, - 'success': function(data){ - $(pcrEl).val(data.id); - $(pcrEl).trigger('change'); - } - }); +function setSurgeonFromNote(ev, pcrEl) { + if (!pcrEl) { + pcrEl = ev.data; + } + + var surgeonId = $(ev.target).val(); + if (!surgeonId) { + $(pcrEl).val(''); $(pcrEl).trigger('change'); + return; + } + + $.ajax({ + 'type': 'GET', + 'url': '/user/surgeonGrade/', + 'data': {'id': surgeonId}, + 'success': function (data) { + $(pcrEl).val(data.id); + $(pcrEl).trigger('change'); + } + }); + $(pcrEl).trigger('change'); } /** @@ -118,26 +110,25 @@ function setSurgeonFromNote(ev, pcrEl) * @param ev * @param pcrEl */ -function setPcrBrunescent(ev, pcrEl) -{ - if(!pcrEl){ - pcrEl = ev.data.pcr; - } - - var $container = getPcrContainer(ev); - var $cataractDrop = $(ev.target); - - var isRight = (ev.target.id.indexOf('right') > -1); - var $related = isRight ? $(ev.data.related.right) : $(ev.data.related.left); - - var value = $cataractDrop.find(':selected').data('value'); - var related_value = $related.find(':selected').data('value'); - if( (value === 'Brunescent' || value === 'White') || (related_value === "Brunescent" || related_value === "White") ){ - $container.find(pcrEl).val('Y'); - } else { - $container.find(pcrEl).val('N'); - } - $(pcrEl).trigger('change'); +function setPcrBrunescent(ev, pcrEl) { + if (!pcrEl) { + pcrEl = ev.data.pcr; + } + + var $container = getPcrContainer(ev); + var $cataractDrop = $(ev.target); + + var isRight = (ev.target.id.indexOf('right') > -1); + var $related = isRight ? $(ev.data.related.right) : $(ev.data.related.left); + + var value = $cataractDrop.find(':selected').data('value'); + var related_value = $related.find(':selected').data('value'); + if ((value === 'Brunescent' || value === 'White') || (related_value === "Brunescent" || related_value === "White")) { + $container.find(pcrEl).val('Y'); + } else { + $container.find(pcrEl).val('N'); + } + $(pcrEl).trigger('change'); } @@ -146,21 +137,20 @@ function setPcrBrunescent(ev, pcrEl) * @param ev * @param pcrEl */ -function setPcrPxf(ev, pcrEl) -{ - if(!pcrEl){ - pcrEl = ev.data.pcr; - } +function setPcrPxf(ev, pcrEl) { + if (!pcrEl) { + pcrEl = ev.data.pcr; + } - var $container = getPcrContainer(ev); - var $related = $(ev.data.related); - - if(ev.target.checked || $related.is(':checked') ){ - $container.find(pcrEl).val('Y'); - } else { - $container.find(pcrEl).val('N'); - } - $(pcrEl).trigger('change'); + var $container = getPcrContainer(ev); + var $related = $(ev.data.related); + + if (ev.target.checked || $related.is(':checked')) { + $container.find(pcrEl).val('Y'); + } else { + $container.find(pcrEl).val('N'); + } + $(pcrEl).trigger('change'); } @@ -169,105 +159,134 @@ function setPcrPxf(ev, pcrEl) * @param ev * @param pcrEl */ -function setPcrPupil(ev, pcrEl) -{ - if(!pcrEl){ - pcrEl = ev.data; - } +function setPcrPupil(ev, pcrEl) { + if (!pcrEl) { + pcrEl = ev.data; + } - var $container = getPcrContainer(ev); - $container.find(pcrEl).val($(ev.target).val()); - $(pcrEl).trigger('change'); + var $container = getPcrContainer(ev); + $container.find(pcrEl).val($(ev.target).val()); + $(pcrEl).trigger('change'); } +/** + * Sets alpha blocker + * @param ev + * @param pcrEl + */ +function setAlphaBlocker(ev, pcrEl) { + if (!pcrEl) { + pcrEl = ev.data; + } + + if($(ev.target).val() === '0'){ + return; + } + if ($(ev.target).val() === '1') { + $(pcrEl).val('Y'); + } else { + $(pcrEl).val('N'); + } + $(pcrEl).trigger('change'); +} + /** * Maps elements in examination or op not to their respective elements in PCR risk so changes in the * examination are reflected in the PCR risk calculation automatically */ -function mapExaminationToPcr() -{ - var examinationMap = { - "#Element_OphTrOperationnote_Surgeon_surgeon_id": { - "pcr": '.pcr_doctor_grade', - "func": setSurgeonFromNote, - "init": true - }, - "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_right_nuclear_id,#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_left_nuclear_id": { - "pcr": { "related" : { - "left" : "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_left_cortical_id", - "right" : "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_right_cortical_id" - }, - "pcr" : '.pcrrisk_brunescent_white_cataract'}, - "func": setPcrBrunescent, - "init": true - }, - "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_right_cortical_id,#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_left_cortical_id": { - "pcr": { "related": { - "left" : "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_left_nuclear_id", - "right" : "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_right_nuclear_id" - } , - "pcr": '.pcrrisk_brunescent_white_cataract'}, - "func": setPcrBrunescent, - "init": true - }, - - ":checkbox[id*='_pxe_control']": { - "pcr": { "related": ":checkbox[id*='_phako']", - "pcr": '.pcrrisk_pxf_phako' - }, - "func": setPcrPxf, - "init": true +function mapExaminationToPcr() { + var examinationMap = { + "#Element_OphTrOperationnote_Surgeon_surgeon_id": { + "pcr": '.pcr_doctor_grade', + "func": setSurgeonFromNote, + "init": true + }, + "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_right_nuclear_id,#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_left_nuclear_id": { + "pcr": { + "related": { + "left": "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_left_cortical_id", + "right": "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_right_cortical_id" }, - ":checkbox[id*='_phako']": { - "pcr": { "related": ":checkbox[id*='_pxe_control']", - "pcr": '.pcrrisk_pxf_phako' - }, - "func": setPcrPxf, - "init": true + "pcr": '.pcrrisk_brunescent_white_cataract' + }, + "func": setPcrBrunescent, + "init": true + }, + "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_right_cortical_id,#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_left_cortical_id": { + "pcr": { + "related": { + "left": "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_left_nuclear_id", + "right": "#OEModule_OphCiExamination_models_Element_OphCiExamination_AnteriorSegment_right_nuclear_id" }, + "pcr": '.pcrrisk_brunescent_white_cataract' + }, + "func": setPcrBrunescent, + "init": true + }, - ":input[id*='_pupilSize_control']": { - "pcr": '.pcrrisk_pupil_size', - "func": setPcrPupil, - "init": true - }, - ":input[name^='diabetic_diagnoses']": { - "pcr": '.pcrrisk_diabetic', - "func": setDiabeticDisorder, - "init": true - }, - ":input[name^='glaucoma_diagnoses']": { - "pcr": '.pcrrisk_glaucoma', - "func": setGlaucomaDisorder, - "init": true - }, - "#OEModule_OphCiExamination_models_Element_OphCiExamination_OpticDisc_right_cd_ratio_id,#OEModule_OphCiExamination_models_Element_OphCiExamination_OpticDisc_left_cd_ratio_id": { - "pcr": '.pcrrisk_no_fundal_view', - "func": setFundalView, - "init": true - } + ":checkbox[id*='_pxe_control']": { + "pcr": { + "related": ":checkbox[id*='_phako']", + "pcr": '.pcrrisk_pxf_phako' + }, + "func": setPcrPxf, + "init": true + }, + ":checkbox[id*='_phako']": { + "pcr": { + "related": ":checkbox[id*='_pxe_control']", + "pcr": '.pcrrisk_pxf_phako' + }, + "func": setPcrPxf, + "init": true + }, + ":input[id*='_pupilSize_control']": { + "pcr": '.pcrrisk_pupil_size', + "func": setPcrPupil, + "init": true + }, + ":input[name^='diabetic_diagnoses']": { + "pcr": '.pcrrisk_diabetic', + "func": setDiabeticDisorder, + "init": true + }, + ":input[name^='glaucoma_diagnoses']": { + "pcr": '.pcrrisk_glaucoma', + "func": setGlaucomaDisorder, + "init": true }, - examinationObj, - examinationEl; - - for(examinationEl in examinationMap){ - if(examinationMap.hasOwnProperty(examinationEl)){ - examinationObj = examinationMap[examinationEl]; - if(typeof examinationObj.func === 'function'){ - $('#event-content').on('change', examinationEl, examinationObj.pcr, examinationObj.func); - } - //Some stuff is set from PHP on page load, some is not so we need to init them - if(typeof examinationObj.init !== 'undefined' && examinationObj.init){ - - if(typeof examinationObj.pcr === 'object'){ - $(examinationEl).trigger('change', [examinationObj.pcr.pcr]); - }else{ - $(examinationEl).trigger('change', [examinationObj.pcr]); - } - } + "#OEModule_OphCiExamination_models_Element_OphCiExamination_OpticDisc_right_cd_ratio_id,#OEModule_OphCiExamination_models_Element_OphCiExamination_OpticDisc_left_cd_ratio_id": { + "pcr": '.pcrrisk_no_fundal_view', + "func": setFundalView, + "init": true + }, + "#OEModule_OphCiExamination_models_Element_OphCiExamination_HistoryRisk_alphablocker input[type='radio']": { + "pcr": '.pcrrisk_arb', + "func": setAlphaBlocker, + "init": true + } + }, + examinationObj, + examinationEl; + + for (examinationEl in examinationMap) { + if (examinationMap.hasOwnProperty(examinationEl)) { + examinationObj = examinationMap[examinationEl]; + if (typeof examinationObj.func === 'function') { + $('#event-content').on('change', examinationEl, examinationObj.pcr, examinationObj.func); + } + //Some stuff is set from PHP on page load, some is not so we need to init them + if (typeof examinationObj.init !== 'undefined' && examinationObj.init) { + + if (typeof examinationObj.pcr === 'object') { + $(examinationEl).trigger('change', [examinationObj.pcr.pcr]); + } else { + $(examinationEl).trigger('change', [examinationObj.pcr]); } + } } + } } /** @@ -276,34 +295,33 @@ function mapExaminationToPcr() * @param input * @returns {string} */ -function capitalizeFirstLetter( input) { - return input.charAt(0).toUpperCase() + input.slice(1); +function capitalizeFirstLetter(input) { + return input.charAt(0).toUpperCase() + input.slice(1); } /** * Collects the data from the form in to an object * - * @param side + * @param $eyeSide * @returns {{}} */ -function collectValues( side ){ - var pcrData = {}, - $eyeSide = $('#ophCiExaminationPCRRisk' + side + 'Eye'); - - pcrData.age = $eyeSide.find(":input[id$='age']").val(); - pcrData.gender = $eyeSide.find(":input[id$='gender']").val(); - pcrData.glaucoma = $eyeSide.find("select[id$='glaucoma']").val(); - pcrData.diabetic = $eyeSide.find("select[id$='diabetic']").val(); - pcrData.fundalview = $eyeSide.find("select[id$='no_fundal_view']").val(); - pcrData.brunescentwhitecataract = $eyeSide.find("select[id$='brunescent_white_cataract']").val(); - pcrData.pxf = $eyeSide.find("select[id$='pxf_phako']").val(); - pcrData.pupilsize = $eyeSide.find("select[id$='pupil_size']").val(); - pcrData.axiallength = $eyeSide.find("select[id$='axial_length']").val(); - pcrData.alphareceptorblocker = $eyeSide.find("select[id$='arb']").val(); - pcrData.abletolieflat = $eyeSide.find("select[id$='abletolieflat']").val(); - pcrData.doctorgrade = $eyeSide.find("select[id$='doctor_grade_id']").val(); - - return pcrData; +function collectValues($eyeSide) { + var pcrData = {}; + + pcrData.age = $eyeSide.find(":input[id$='age']").val(); + pcrData.gender = $eyeSide.find(":input[id$='gender']").val(); + pcrData.glaucoma = $eyeSide.find("select[id$='glaucoma']").val(); + pcrData.diabetic = $eyeSide.find("select[id$='diabetic']").val(); + pcrData.fundalview = $eyeSide.find("select[id$='no_fundal_view']").val(); + pcrData.brunescentwhitecataract = $eyeSide.find("select[id$='brunescent_white_cataract']").val(); + pcrData.pxf = $eyeSide.find("select[id$='pxf_phako'], select[id$='pxf']").val(); + pcrData.pupilsize = $eyeSide.find("select[id$='pupil_size']").val(); + pcrData.axiallength = $eyeSide.find("select[id$='axial_length'], select[id$='axial_length_group']").val(); + pcrData.alphareceptorblocker = $eyeSide.find("select[id$='arb'], select[id$='alpha_receptor_blocker']").val(); + pcrData.abletolieflat = $eyeSide.find("select[id$='abletolieflat'], select[id$='can_lie_flat']").val(); + pcrData.doctorgrade = $eyeSide.find("select[id$='doctor_grade_id']").find(":selected").data('pcrValue'); + + return pcrData; } /** @@ -311,130 +329,116 @@ function collectValues( side ){ * @param inputValues * @returns {*} */ -function calculateORValue( inputValues ) -{ - if(Object.keys(inputValues).length === 0){ - return 0; - } - - var OR ={}; - var orMultiplied = 1; // base value - - // multipliers for the attributes and selected values - OR.age = {'1': 1, '2': 1.14, '3': 1.42, '4': 1.58, '5': 2.37}; - OR.gender = {'Male': 1.28, 'Female': 1, 'Other': 1.14, 'Unknown': 1.14}; - OR.glaucoma = {'Y': 1.30, 'N': 1, 'NK': 1}; - OR.diabetic = {'Y': 1.63, 'N': 1, 'NK': 1}; - OR.fundalview = {'Y': 2.46, 'N': 1, 'NK': 1}; - OR.brunescentwhitecataract = {'Y': 2.99, 'N': 1, 'NK': 1}; - OR.pxf = {'Y': 2.92, 'N': 1, 'NK': 1}; - OR.pupilsize = {'Small': 1.45, 'Medium': 1.14, 'Large': 1, 'NK': 1}; - OR.axiallength = {'1': 1, '2': 1.47}; - OR.alphareceptorblocker = {'Y': 1.51, 'N': 1, 'NK': 1}; - OR.abletolieflat = {'Y': 1, 'N': 1.27}; - OR.doctorgrade = {}; - - if(Object.keys(inputValues).length !== Object.keys(OR).length){ - return 0; +function calculateORValue(inputValues) { + if (Object.keys(inputValues).length === 0) { + return 0; + } + + var OR = {}; + var orMultiplied = 1; // base value + + // multipliers for the attributes and selected values + OR.age = {'1': 1, '2': 1.14, '3': 1.42, '4': 1.58, '5': 2.37}; + OR.gender = {'Male': 1.28, 'Female': 1, 'Other': 1.14, 'Unknown': 1.14}; + OR.glaucoma = {'Y': 1.30, 'N': 1, 'NK': 1}; + OR.diabetic = {'Y': 1.63, 'N': 1, 'NK': 1}; + OR.fundalview = {'Y': 2.46, 'N': 1, 'NK': 1}; + OR.brunescentwhitecataract = {'Y': 2.99, 'N': 1, 'NK': 1}; + OR.pxf = {'Y': 2.92, 'N': 1, 'NK': 1}; + OR.pupilsize = {'Small': 1.45, 'Medium': 1.14, 'Large': 1, 'NK': 1}; + OR.axiallength = {'1': 1, '2': 1.47}; + OR.alphareceptorblocker = {'Y': 1.51, 'N': 1, 'NK': 1}; + OR.abletolieflat = {'Y': 1, 'N': 1.27}; + OR.doctorgrade = {}; + + if (Object.keys(inputValues).length !== Object.keys(OR).length) { + return 0; + } + + for (var key in inputValues) { + if (!inputValues.hasOwnProperty(key)) { + continue; } - - for (var key in inputValues) { - if(!inputValues.hasOwnProperty(key)){ - continue; - } - var riskFactor; - //if we have a key to factor relationship use that, otherwise the factor is in the input value itself. - if(OR[key].hasOwnProperty(inputValues[key])){ - riskFactor = OR[key][inputValues[key]]; - } else { - riskFactor = inputValues[key]; - } - orMultiplied *= riskFactor; + var riskFactor; + //if we have a key to factor relationship use that, otherwise the factor is in the input value itself. + if (OR[key].hasOwnProperty(inputValues[key])) { + riskFactor = OR[key][inputValues[key]]; + } else { + riskFactor = inputValues[key]; } + orMultiplied *= riskFactor; + } - return orMultiplied; + return orMultiplied; } /** * Calculates the value */ function calculatePcrValue(ORValue) { - var averageRiskConst, - pcrRisk, - excessRisk, - pcrColour; - - if (ORValue) { - pcrRisk = ORValue * (0.00736 / (1 - 0.00736)) / (1 + (ORValue * 0.00736 / (1 - 0.00736))) * 100; - averageRiskConst = 1.92; - excessRisk = pcrRisk / averageRiskConst; - excessRisk = excessRisk.toFixed(2); - pcrRisk = pcrRisk.toFixed(2); - - if (pcrRisk <= 1) { - pcrColour = 'green'; - } else if (pcrRisk > 1 && pcrRisk <= 5) { - pcrColour = 'orange'; - } else { - pcrColour = 'red'; - } + var averageRiskConst, + pcrRisk, + excessRisk, + pcrColour; + + if (ORValue) { + pcrRisk = ORValue * (0.00736 / (1 - 0.00736)) / (1 + (ORValue * 0.00736 / (1 - 0.00736))) * 100; + averageRiskConst = 1.92; + excessRisk = pcrRisk / averageRiskConst; + excessRisk = excessRisk.toFixed(2); + pcrRisk = pcrRisk.toFixed(2); + + if (pcrRisk <= 1) { + pcrColour = 'green'; + } else if (pcrRisk > 1 && pcrRisk <= 5) { + pcrColour = 'orange'; } else { - pcrRisk = "N/A"; - excessRisk = "N/A"; - pcrColour = 'blue'; + pcrColour = 'red'; } - - return { - pcrRisk: pcrRisk, - excessRisk: excessRisk, - pcrColour: pcrColour - }; + } else { + pcrRisk = "N/A"; + excessRisk = "N/A"; + pcrColour = 'blue'; + } + + return { + pcrRisk: pcrRisk, + excessRisk: excessRisk, + pcrColour: pcrColour + }; } /** * Calculates the PCR risk for a given side * + * @param $eyeSide * @param side */ -function pcrCalculate( side ){ - - side = capitalizeFirstLetter(side); // we use this to keep camelCase div names - - var pcrDataValues = collectValues( side), - ORValue = calculateORValue( pcrDataValues), - pcrData; - - pcrData = calculatePcrValue(ORValue); - - $('#ophCiExaminationPCRRisk'+side+'Eye').find('#pcr-risk-div').css('background', pcrData.pcrColour); - $('#ophCiExaminationPCRRisk'+side+'Eye').find('.pcr-span').html(pcrData.pcrRisk); - $('#ophCiExaminationPCRRisk'+side+'Eye').find('.pcr-erisk').html(pcrData.excessRisk); - - $('#ophCiExaminationPCRRisk'+side+'EyeLabel').find('a').css('color', pcrData.pcrColour); - $('#ophCiExaminationPCRRisk'+side+'EyeLabel').find('.pcr-span1').html(pcrData.pcrRisk); - - $('#ophCiExaminationPCRRiskEyeLabel').find('a').css('color', pcrData.pcrColour); - $('#ophCiExaminationPCRRiskEyeLabel').find('.pcr-span1').html(pcrData.pcrRisk); - //$('#ophCiExaminationPCRRisk'+side+'EyeLabel').find('.pcr-span1').css('color', pcrColor); - if(pcrData.pcrRisk !== 'N/A'){ - $('#Element_OphTrOperationnote_Cataract_pcr_risk').val(pcrData.pcrRisk); - } -} - -$(document).ready(function() -{ - //Map the elements - mapExaminationToPcr(); - //Make the initial calculations - pcrCalculate('left'); - pcrCalculate('right'); - - $(document.body).on('change','#ophCiExaminationPCRRiskLeftEye',function(){ - pcrCalculate('left'); - }); - - $(document.body).on('change','#ophCiExaminationPCRRiskRightEye',function(){ - pcrCalculate('right'); - }); - -}); \ No newline at end of file +function pcrCalculate($eyeSide, side) { + var pcrDataValues = collectValues($eyeSide), + ORValue = calculateORValue(pcrDataValues), + pcrData; + + side = capitalizeFirstLetter(side); + pcrData = calculatePcrValue(ORValue); + + $eyeSide.find('#pcr-risk-div, .pcr-risk-div label').css('background', pcrData.pcrColour); + $eyeSide.find('.pcr-span').html(pcrData.pcrRisk); + $eyeSide.find('.pcr-erisk').html(pcrData.excessRisk); + if(pcrData.pcrRisk !== 'N/A'){ + $eyeSide.find('.pcr-input').val(pcrData.pcrRisk); + } else { + $eyeSide.find('.pcr-input').val(''); + } + $eyeSide.find('.pcr-erisk-input').val(pcrData.excessRisk); + + $('#ophCiExaminationPCRRisk' + side + 'EyeLabel').find('a').css('color', pcrData.pcrColour); + $('#ophCiExaminationPCRRisk' + side + 'EyeLabel').find('.pcr-span1').html(pcrData.pcrRisk); + + $('#ophCiExaminationPCRRiskEyeLabel').find('a').css('color', pcrData.pcrColour); + $('#ophCiExaminationPCRRiskEyeLabel').find('.pcr-span1').html(pcrData.pcrRisk); + //$('#ophCiExaminationPCRRisk'+side+'EyeLabel').find('.pcr-span1').css('color', pcrColor); + if (pcrData.pcrRisk !== 'N/A') { + $('#Element_OphTrOperationnote_Cataract_pcr_risk').val(pcrData.pcrRisk); + } +} \ No newline at end of file diff --git a/protected/assets/js/dashboard/whiteboard.js b/protected/assets/js/dashboard/whiteboard.js index 7ce524c787..3c4854ac81 100644 --- a/protected/assets/js/dashboard/whiteboard.js +++ b/protected/assets/js/dashboard/whiteboard.js @@ -1,4 +1,18 @@ document.addEventListener("DOMContentLoaded", function () { + + var confirm_exit = function(e){ + e = e || window.event; + var message = "You have unsaved changes. Are you sure you want to leave this page?"; + if (e) + { + e.returnValue = message; + } + + return message; + }; + + window.onbeforeunload = null; + OpenEyes.Dialog.init( document.getElementById('dialog-container'), document.getElementById('refresh-button'), @@ -25,6 +39,7 @@ document.addEventListener("DOMContentLoaded", function () { icon.textContent = 'done'; textArea[0].value = $cardContent.get(0).textContent.trim(); $cardContent.html(textArea); + window.onbeforeunload = confirm_exit; } else { contentId = $cardContent.get(0).id; text = $cardContent.find('textarea').val(); @@ -37,6 +52,7 @@ document.addEventListener("DOMContentLoaded", function () { 'success': function () { $cardContent.text(text); icon.textContent = 'create'; + window.onbeforeunload = null; }, 'error': function () { alert('Something went wrong, please try again.'); @@ -44,4 +60,6 @@ document.addEventListener("DOMContentLoaded", function () { }); } }); + + }); \ No newline at end of file diff --git a/protected/assets/js/patient_merge.js b/protected/assets/js/patient_merge.js index 4f777dc185..224cbda66a 100644 --- a/protected/assets/js/patient_merge.js +++ b/protected/assets/js/patient_merge.js @@ -274,10 +274,10 @@ $(document).ready(function(){ if(!isValid){ e.preventDefault(); } - - if( $('#patientDataConflictConfirmation').is(':visible') && !$('#PatientMergeRequest_personalDetailsConflictConfirm').is(':checked') ){ + + if( $('#patientDataConflictConfirmation').is(':visible') && !$('#PatientMergeRequest_personal_details_conflict_confirm').is(':checked') ){ e.preventDefault(); - $('#PatientMergeRequest_personalDetailsConflictConfirm').closest('label').css({"border":'3px solid red',"padding":"5px"}); + $('#PatientMergeRequest_personal_details_conflict_confirm').closest('label').css({"border":'3px solid red',"padding":"5px"}); } if( $('#PatientMergeRequest_confirm').length > 0 && !$('#PatientMergeRequest_confirm').is(':checked') ){ diff --git a/protected/assets/sass/openeyes/components/panels/_patient.scss b/protected/assets/sass/openeyes/components/panels/_patient.scss index ff00b08327..cdc7d03979 100644 --- a/protected/assets/sass/openeyes/components/panels/_patient.scss +++ b/protected/assets/sass/openeyes/components/panels/_patient.scss @@ -114,11 +114,6 @@ padding-right: 8px; position: absolute; right: 0; - @media screen { - .stuck & { - display: none; - } - } } .clinical-summary-anchor { bottom: 12px; @@ -132,7 +127,6 @@ } } } - .hospital-number { margin-bottom: 3px; } diff --git a/protected/commands/DocManDeliveryCommand.php b/protected/commands/DocManDeliveryCommand.php index 7c7547c802..84440d3c27 100644 --- a/protected/commands/DocManDeliveryCommand.php +++ b/protected/commands/DocManDeliveryCommand.php @@ -17,47 +17,75 @@ * @copyright Copyright (c) 2011-2012, OpenEyes Foundation * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 */ - class DocManDeliveryCommand extends CConsoleCommand { private $path; private $event; + private $csv_format = 'OEGPLetterReport_%s.csv'; + + private $generate_xml = false; + + private $generate_csv = false; + + /** + * DocManDeliveryCommand constructor. + */ public function __construct() { $this->path = Yii::app()->params['docman_export_dir']; - // check if directory is exists + $this->generate_xml = !isset(Yii::app()->params['docman_xml_format']) || Yii::app()->params['docman_xml_format'] !== 'none'; + $this->generate_csv = Yii::app()->params['docman_generate_csv']; - if(!is_dir($this->path)) - { + // check if directory exists + if (!is_dir($this->path)) { mkdir($this->path); - echo "ALERT! Directory ".$this->path." has been created!"; + echo "ALERT! Directory " . $this->path . " has been created!"; } parent::__construct(null, null); } - public function actionIndex() + + /** + * Run the command. + */ + public function run($args) { $pending_documents = $this->getPendingDocuments(); - foreach($pending_documents as $document) - { - $event_id = $document->document_target->document_instance->correspondence_event_id; - //var_dump($event_id); - $this->savePDFFile($event_id, $document->id); + foreach ($pending_documents as $document) { + echo 'Processing event ' . $document->document_target->document_instance->correspondence_event_id . PHP_EOL; + $this->savePDFFile($document->document_target->document_instance->correspondence_event_id, $document->id); } } + /** + * @return CActiveRecord[] + */ private function getPendingDocuments() - { - $documents = DocumentOutput::model()->findAllByAttributes(array("output_status"=>"PENDING","output_type"=>"Docman")); - return $documents; + { + $criteria = new CDbCriteria(); + $criteria->join = "JOIN `document_target` tr ON t.`document_target_id` = tr.id"; + $criteria->join .= " JOIN `document_instance` i ON tr.`document_instance_id` = i.`id`"; + $criteria->join .= " JOIN event e ON i.`correspondence_event_id` = e.id"; + $criteria->addCondition("e.deleted = 0"); + $criteria->addCondition("t.`output_status` = 'PENDING' AND t.`output_type`= 'Docman'"); + + return DocumentOutput::model()->findAll($criteria); } + /** + * @param $event_id + * @param $output_id + * + * @return bool; + */ private function savePDFFile($event_id, $output_id) { - if($this->event = Event::model()->findByPk($event_id)) { - + $pdf_generated = false; + $xml_generated = false; + $this->event = Event::model()->findByPk($event_id); + if ($this->event) { $login_page = Yii::app()->params['docman_login_url']; $username = Yii::app()->params['docman_user']; $password = Yii::app()->params['docman_password']; @@ -92,7 +120,7 @@ private function savePDFFile($event_id, $output_id) curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params)); curl_exec($ch); - + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_URL, $print_url . $this->event->id . '?auto_print=' . (int)$inject_autoprint_js . '&print_only_gp=1'); @@ -100,30 +128,107 @@ private function savePDFFile($event_id, $output_id) curl_close($ch); - if (!isset(Yii::app()->params['docman_filename_format']) || Yii::app()->params['docman_filename_format'] == 'format1') { - $filename = "OPENEYES_" . $this->event->episode->patient->hos_num . '_' . $this->event->id . "_" . rand(); - } else if (Yii::app()->params['docman_filename_format'] == 'format2') { - $filename = $this->event->episode->patient->hos_num . '_' . date('YmdHi', - strtotime($this->event->last_modified_date)) . '_' . $this->event->id; - } else if (Yii::app()->params['docman_filename_format'] == 'format3') { - $filename = $this->event->episode->patient->hos_num . '_edtdep-OEY_' . date('Ymd_His', - strtotime($this->event->last_modified_date)) . '_' . $this->event->id; + if (!isset(Yii::app()->params['docman_filename_format']) || Yii::app()->params['docman_filename_format'] === 'format1') { + $filename = "OPENEYES_" . (str_replace(' ', '', $this->event->episode->patient->hos_num)) . '_' . $this->event->id . "_" . rand(); + } else { + if (Yii::app()->params['docman_filename_format'] === 'format2') { + $filename = (str_replace(' ', '', $this->event->episode->patient->hos_num)) . '_' . date('YmdHi', + strtotime($this->event->last_modified_date)) . '_' . $this->event->id; + } else { + if (Yii::app()->params['docman_filename_format'] === 'format3') { + $filename = (str_replace(' ', '', $this->event->episode->patient->hos_num)) . '_edtdep-OEY_' . + date('Ymd_His', strtotime($this->event->last_modified_date)) . '_' . $this->event->id; + } + } + } + + $pdf_generated = (file_put_contents($this->path . "/" . $filename . ".pdf", $content) !== false); + + if ($this->generate_xml) { + $xml_generated = $this->generateXMLOutput($filename); + } + + if (!$pdf_generated || ($this->generate_xml && !$xml_generated)) { + echo 'Generating for file ' . $filename . ' failed' . PHP_EOL; + + return false; } - file_put_contents($this->path . "/" . $filename . ".pdf", $content); - if (!isset(Yii::app()->params['docman_xml_format']) || Yii::app()->params['docman_xml_format'] != 'none') { - $this->generateXMLOutput($filename, $output_id); + + $correspondenceDate = $this->event->event_date; + + $event_type = EventType::model()->find('class_name=?', array('OphTrOperationnote')); + $event_type_id = $event_type->id; + + $criteria = new CDbCriteria(); + $criteria->condition = "episode_id = '" . $this->event->episode->id + . "' AND event_date <= '$correspondenceDate' AND deleted = 0 AND event_type_id = '$event_type_id'"; + $criteria->order = 'event_date desc, created_date desc'; + + $lastOpNoteDate = ''; + if($opNote = Event::model()->find($criteria)){ + $lastOpNoteDate = $opNote->event_date; } - $this->updateDelivery($output_id); + + $event_type = EventType::model()->find('class_name=?', array('OphCiExamination')); + $event_type_id = $event_type->id; + + $criteria = new CDbCriteria(); + $criteria->condition = "episode_id = '" . $this->event->episode->id + . "' AND event_date <= '$correspondenceDate' AND deleted = 0 AND event_type_id = '$event_type_id'"; + $criteria->order = 'event_date desc, created_date desc'; + + $lastExamDate = ''; + if($examEvent = Event::model()->find($criteria)){ + $lastExamDate = $examEvent->event_date; + } + + $lastSignificantEventDate = ''; + if(!$lastExamDate && $lastOpNoteDate) { + $lastSignificantEventDate = $lastOpNoteDate; + } + if($lastExamDate && !$lastOpNoteDate) { + $lastSignificantEventDate = $lastExamDate; + } + if(!$lastExamDate && !$lastOpNoteDate) { + $lastSignificantEventDate = NULL; + } + if($lastExamDate && $lastOpNoteDate){ + $diff = date_diff(date_create($lastExamDate), date_create($lastOpNoteDate)); + if($diff->days >= 0){ + $lastSignificantEventDate = $lastOpNoteDate; + }else{ + $lastSignificantEventDate = $lastExamDate; + } + } + + if ($this->updateDelivery($output_id)) { + $element_letter = ElementLetter::model()->findByAttributes(array("event_id" => $this->event->id)); + $this->logData(array( + 'hos_num' => $this->event->episode->patient->hos_num, + 'clinician_name' => $this->event->user->getFullName(), + 'letter_type' => (isset($element_letter->letterType->name) ? $element_letter->letterType->name : ''), + 'letter_finalised_date' => $this->event->last_modified_date, + 'letter_created_date' => $this->event->created_date, + 'last_significant_event_date' => $lastSignificantEventDate, + 'letter_sent_date' => date('Y-m-d H:i:s'), + )); + } + + return true; } } + /** + * @param string $filename + * + * @return bool + */ private function generateXMLOutput($filename) { - $element_letter = ElementLetter::model()->findByAttributes(array("event_id"=>$this->event->id)); - $letter_types = array("0"=>"","1"=>"Clinic discharge letter","2"=>"Post-op letter","3"=>"Clinic letter","4"=>"Other letter"); - - $subspeciality = isset($this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty->ref_spec) ? $this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty->ref_spec : 'SS'; - $subspeciality_name = isset($this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty->name) ? $this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty->name : 'Support Services'; + $element_letter = ElementLetter::model()->findByAttributes(array("event_id" => $this->event->id)); + $subObj = $this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty; + $subspeciality = isset($subObj->ref_spec) ? $subObj->ref_spec : 'SS'; + $subspeciality_name = isset($subObj->name) ? $subObj->name : 'Support Services'; $nat_id = isset($this->event->episode->patient->gp->nat_id) ? $this->event->episode->patient->gp->nat_id : null; $gp_name = isset($this->event->episode->patient->gp->contact) ? $this->event->episode->patient->gp->contact->getFullName() : null; $practice_code = isset($this->event->episode->patient->practice->code) ? $this->event->episode->patient->practice->code : ''; @@ -133,62 +238,90 @@ private function generateXMLOutput($filename) $county = isset($this->event->episode->patient->contact->address) ? ($this->event->episode->patient->contact->address->county) : ''; $city = isset($this->event->episode->patient->contact->address) ? ($this->event->episode->patient->contact->address->city) : ''; $post_code = isset($this->event->episode->patient->contact->address) ? ($this->event->episode->patient->contact->address->postcode) : ''; + $letter_type = isset($element_letter->letterType->name) ? $element_letter->letterType->name : ''; $xml = " - ".$this->event->episode->patient->hos_num." - ".$this->event->episode->patient->nhs_num." - ".$this->event->episode->patient->contact->getFullName()." - ".$this->event->episode->patient->contact->last_name." - ".$this->event->episode->patient->contact->first_name." + " . $this->event->episode->patient->hos_num . " + " . $this->event->episode->patient->nhs_num . " + " . $this->event->episode->patient->contact->getFullName() . " + " . $this->event->episode->patient->contact->last_name . " + " . $this->event->episode->patient->contact->first_name . " - ".$this->event->episode->patient->contact->title." - ".$this->event->episode->patient->dob." - ".$this->event->episode->patient->gender." -
".implode(", ", $address)."
+ " . $this->event->episode->patient->contact->title . " + " . $this->event->episode->patient->dob . " + " . $this->event->episode->patient->gender . " +
" . implode(", ", $address) . "
" . $address1 . " - ".$city." - ".$county." - ".$post_code." + " . $city . " + " . $county . " + " . $post_code . " " . $nat_id . " " . $gp_name . " " . $practice_code . " - ".$letter_types[$element_letter->letter_type]." - ".$this->event->id." - ".$this->event->event_date." + " . $letter_type . " + " . $this->event->id . " + " . $this->event->event_date . " - ".$subspeciality." - ".$subspeciality_name." + " . $subspeciality . " + " . $subspeciality_name . " " . $element_letter->site->short_name . " " . $element_letter->site->name . "
"; - file_put_contents($this->path."/".$filename.".XML", $this->cleanXML($xml) ); + return (file_put_contents($this->path . "/" . $filename . ".XML", $this->cleanXML($xml)) !== false); } - + /** * Special function to sanitize XML - * - * @param type $xml - * @return type + * + * @param string $xml + * @return string */ private function cleanXML($xml) { - return str_replace ("&", "and", $xml); + return str_replace("&", "and", $xml); } + /** + * @param $output_id + * @return bool + */ private function updateDelivery($output_id) { $output = DocumentOutput::model()->findByPk($output_id); $output->output_status = "COMPLETE"; - $output->save(); + + return $output->save(); + } + + /** + * @param $data + */ + private function logData($data) + { + if ($this->generate_csv) { + $doc_log = new DocumentLog(); + $doc_log->attributes = $data; + $doc_log->save(); + + $csv_filename = implode(DIRECTORY_SEPARATOR, array($this->path, sprintf($this->csv_format, date('Ymd')))); + $put_header = !file_exists($csv_filename); + + $fp = fopen($csv_filename, 'ab'); + if($put_header){ + fputcsv($fp, array_keys($data)); + } + fputcsv($fp, $data); + fclose($fp); + } } } \ No newline at end of file diff --git a/protected/components/Helper.php b/protected/components/Helper.php index 5e56b8047d..382b300b68 100644 --- a/protected/components/Helper.php +++ b/protected/components/Helper.php @@ -123,7 +123,7 @@ public static function convertDate2HTML($value, $empty_string = '-') * * @param string $value * - * @return float + * @return int */ public static function mysqlDate2JsTimestamp($value) { diff --git a/protected/components/OptomPortalConnection.php b/protected/components/OptomPortalConnection.php index 36d281a4bf..7843d2f318 100644 --- a/protected/components/OptomPortalConnection.php +++ b/protected/components/OptomPortalConnection.php @@ -50,6 +50,22 @@ class OptomPortalConnection protected $client; protected $config = array(); + /** + * @return Zend_Http_Client + */ + public function getClient() + { + return $this->client; + } + + /** + * @return array + */ + public function getConfig() + { + return $this->config; + } + /** * OptomPortalConnection constructor. @@ -92,12 +108,21 @@ protected function setConfig() /** * Init HTTP client. * - * @return Zend_Http_Client * @throws Zend_Http_Client_Exception */ protected function initClient() { - $client = new Zend_Http_Client($this->config['uri']); + $clientConfig = array(); + if($this->yii->params['curl_proxy']){ + $proxy = parse_url($this->yii->params['curl_proxy']); + $clientConfig['adapter'] = 'Zend_Http_Client_Adapter_Proxy'; + $clientConfig['proxy_host'] = $proxy['host']; + if(array_key_exists('port', $proxy)){ + $clientConfig['proxy_port'] = $proxy['port']; + } + } + + $client = new Zend_Http_Client($this->config['uri'], $clientConfig); $client->setHeaders('Accept', 'application/vnd.OpenEyesPortal.v1+json'); $this->client = $client; diff --git a/protected/components/PatientMerge.php b/protected/components/PatientMerge.php index 384f0ca9f4..6a064c9c64 100644 --- a/protected/components/PatientMerge.php +++ b/protected/components/PatientMerge.php @@ -21,12 +21,12 @@ class PatientMerge /** * @var Patient AR */ - private $primaryPatient; + private $primary_patient; /** * @var Patient AR */ - private $secondaryPatient; + private $secondary_patient; /** * @var array @@ -40,7 +40,7 @@ class PatientMerge */ public function setPrimaryPatientById($id) { - $this->primaryPatient = Patient::model()->findByPk($id); + $this->primary_patient = Patient::model()->findByPk($id); } /** @@ -50,7 +50,7 @@ public function setPrimaryPatientById($id) */ public function getPrimaryPatient() { - return $this->primaryPatient; + return $this->primary_patient; } /** @@ -60,7 +60,7 @@ public function getPrimaryPatient() */ public function setSecondaryPatientById($id) { - $this->secondaryPatient = Patient::model()->findByPk($id); + $this->secondary_patient = Patient::model()->findByPk($id); } /** @@ -70,7 +70,7 @@ public function setSecondaryPatientById($id) */ public function getSecondaryPatient() { - return $this->secondaryPatient; + return $this->secondary_patient; } /** @@ -132,7 +132,7 @@ public function comparePatientDetails(Patient $primary, Patient $secondary) } return array( - 'isConflict' => !empty($conflict), + 'is_conflict' => !empty($conflict), 'details' => $conflict, ); } @@ -140,49 +140,49 @@ public function comparePatientDetails(Patient $primary, Patient $secondary) /** * Do the actual merging by calling separated functions to move episodes, events etc... * - * @return bool $isMerged success or fail + * @return bool $is_merged success or fail */ public function merge() { - $isMerged = false; + $is_merged = false; // Update Episode - $isMerged = $this->updateEpisodes($this->primaryPatient, $this->secondaryPatient); + $is_merged = $this->updateEpisodes($this->primary_patient, $this->secondary_patient); // Update legacy episodes - $isMerged = $isMerged && $this->updateLegacyEpisodes($this->primaryPatient, $this->secondaryPatient); + $is_merged = $is_merged && $this->updateLegacyEpisodes($this->primary_patient, $this->secondary_patient); // Update allergyAssignments - $isMerged = $isMerged && $this->updateAllergyAssignments($this->primaryPatient, $this->secondaryPatient); + $is_merged = $is_merged && $this->updateAllergyAssignments($this->primary_patient, $this->secondary_patient); // Updates riskAssignments - $isMerged = $isMerged && $this->updateRiskAssignments($this->primaryPatient->id, $this->secondaryPatient->riskAssignments); + $is_merged = $is_merged && $this->updateRiskAssignments($this->primary_patient, $this->secondary_patient->riskAssignments); // Update previousOperations - $isMerged = $isMerged && $this->updatePreviousOperations($this->primaryPatient, $this->secondaryPatient->previousOperations); + $is_merged = $is_merged && $this->updatePreviousOperations($this->primary_patient, $this->secondary_patient->previousOperations); //Update Other ophthalmic diagnoses - $isMerged = $isMerged && $this->updateOphthalmicDiagnoses($this->primaryPatient, $this->secondaryPatient->ophthalmicDiagnoses); + $is_merged = $is_merged && $this->updateOphthalmicDiagnoses($this->primary_patient, $this->secondary_patient->ophthalmicDiagnoses); // Update Systemic Diagnoses - $isMerged = $isMerged && $this->updateSystemicDiagnoses($this->primaryPatient, $this->secondaryPatient->systemicDiagnoses); + $is_merged = $is_merged && $this->updateSystemicDiagnoses($this->primary_patient, $this->secondary_patient->systemicDiagnoses); - if ($isMerged) { - $secondaryPatient = $this->secondaryPatient; + if ($is_merged) { + $secondary_patient = $this->secondary_patient; - $secondaryPatient->deleted = 1; + $secondary_patient->deleted = 1; - if ($secondaryPatient->save()) { - $msg = 'Patient hos_num: '.$this->secondaryPatient->hos_num.' flagged as deleted.'; + if ($secondary_patient->save()) { + $msg = 'Patient hos_num: '.$this->secondary_patient->hos_num.' flagged as deleted.'; $this->addLog($msg); Audit::add('Patient Merge', 'Patient flagged as deleted', $msg); - $isMerged = $isMerged && true; + $is_merged = $is_merged && true; } else { - throw new Exception('Failed to update Patient: '.print_r($secondaryPatient->errors, true)); + throw new Exception('Failed to update Patient: '.print_r($secondary_patient->errors, true)); } } - return $isMerged; + return $is_merged; } /** @@ -191,80 +191,89 @@ public function merge() * - if secondary patient has no episodes we have nothing to do here * - if both patiens have episode we have to check if there is any conflicting(same subspeicaly like cataract or glaucoma) episodes * - we move the non conflictong episodes from secondary to primary - * - when two episodes are conflicting we move the events from the secondary patient's episode to the primary patient's episode then delete the secondary empty episode. + * - when two episodes are conflicting we have to keep the episode with the highest status (when compared using the standard order of status from New to Discharged). + * - start date should be the earliest start date of the two episodes + * - end date should be the latest end date of the two episodes (null is classed as later than any date). * - * @param Patient $primaryPatient - * @param Patient $secondaryPatient + * @param Patient $primary_patient + * @param Patient $secondary_patient * * @return bool * * @throws Exception */ - public function updateEpisodes(Patient $primaryPatient, Patient $secondaryPatient) + public function updateEpisodes(Patient $primary_patient, Patient $secondary_patient) { - $primaryHasEpisodes = $primaryPatient->episodes; - $secondaryHasEpisodes = $secondaryPatient->episodes; + $primary_has_episodes = $primary_patient->episodes; + $secondary_has_episodes = $secondary_patient->episodes; // if primary has no episodes than we just assign the secondary patient's episodes to the primary - if (!$primaryHasEpisodes && $secondaryHasEpisodes) { + if (!$primary_has_episodes && $secondary_has_episodes) { // this case is fine, we can assign the episodes from secondary to primary - $this->updateEpisodesPatientId($primaryPatient->id, $secondaryPatient->episodes); - } elseif ($primaryHasEpisodes && !$secondaryHasEpisodes) { + $this->updateEpisodesPatientId($primary_patient->id, $secondary_patient->episodes); + } elseif ($primary_has_episodes && !$secondary_has_episodes) { // primary has episodes but secondary has not, nothing to do here } else { // Both have episodes, we have to compare the subspecialties - foreach ($secondaryPatient->episodes as $secondaryEpisode) { - $secondary_subspecialty = $secondaryEpisode->getSubspecialtyID(); + foreach ($secondary_patient->episodes as $secondary_episode) { + $secondary_subspecialty = $secondary_episode->getSubspecialtyID(); - $isSameSubspecialty = false; - foreach ($primaryHasEpisodes as $primaryEpisode) { - $primary_subspecialty = $primaryEpisode->getSubspecialtyID(); + $is_same_subspecialty = false; + foreach ($primary_has_episodes as $primary_episode) { + $primary_subspecialty = $primary_episode->getSubspecialtyID(); if ($secondary_subspecialty == $primary_subspecialty) { - /* We need to keep the older episode so we compare the dates **/ + /* We have to keep the episode with the highest status */ - if ($primaryEpisode->created_date < $secondaryEpisode->created_date) { - // the primary episode is older than the secondary so we move the events from the Secondary into the Primary - $this->updateEventsEpisodeId($primaryEpisode->id, $secondaryEpisode->events); + if ($primary_episode->status->order > $secondary_episode->status->order) { + // the primary episode has greater status than the secondary so we move the events from the Secondary into the Primary + $this->updateEventsEpisodeId($primary_episode->id, $secondary_episode->events); + + //set earliest start date and latest end date of the two episodes + list($primary_episode->start_date, $primary_episode->end_date) = $this->getTwoEpisodesStartEndDate($primary_episode, $secondary_episode); + + $primary_episode->save(); // after all events are moved we flag the secondary episode as deleted - $secondaryEpisode->deleted = 1; - if ($secondaryEpisode->save()) { - $msg = 'Episode '.$secondaryEpisode->id." marked as deleted, events moved under the primary patient's same firm episode."; + $secondary_episode->deleted = 1; + if ($secondary_episode->save()) { + $msg = 'Episode '.$secondary_episode->id." marked as deleted, events moved under the primary patient's same firm episode."; $this->addLog($msg); Audit::add('Patient Merge', 'Episode marked as deleted', $msg); } else { - throw new Exception('Failed to update Episode: '.$secondaryEpisode->id.' '.print_r($secondaryEpisode->errors, true)); + throw new Exception('Failed to update Episode: '.$secondary_episode->id.' '.print_r($secondary_episode->errors, true)); } } else { - // the secondary episode is older than the primary so we move the events from the Primary into the Secondary - $this->updateEventsEpisodeId($secondaryEpisode->id, $primaryEpisode->events); + // the secondary episode has greated status than the primary so we move the events from the Primary into the Secondary + $this->updateEventsEpisodeId($secondary_episode->id, $primary_episode->events); + + list($secondary_episode->start_date, $secondary_episode->end_date) = $this->getTwoEpisodesStartEndDate($primary_episode, $secondary_episode); /* BUT do not forget we have to delete the primary episode AND move the secondary episode to the primary patient **/ - $primaryEpisode->deleted = 1; + $primary_episode->deleted = 1; - if ($primaryEpisode->save()) { - $msg = 'Episode '.$primaryEpisode->id." marked as deleted, events moved under the secondary patient's same firm episode."; + if ($primary_episode->save()) { + $msg = 'Episode '.$primary_episode->id." marked as deleted, events moved under the secondary patient's same firm episode."; $this->addLog($msg); Audit::add('Patient Merge', 'Episode marked as deleted', $msg); } else { - throw new Exception('Failed to update Episode: '.$primaryEpisode->id.' '.print_r($primaryEpisode->errors, true)); + throw new Exception('Failed to update Episode: '.$primary_episode->id.' '.print_r($primary_episode->errors, true)); } //then we move the episode to the pri1mary - $this->updateEpisodesPatientId($primaryPatient->id, array($secondaryEpisode)); + $this->updateEpisodesPatientId($primary_patient->id, array($secondary_episode)); } - $isSameSubspecialty = true; + $is_same_subspecialty = true; } } // if there is no conflict we still need to move the secondary episode to the primary patient - if (!$isSameSubspecialty) { - $this->updateEpisodesPatientId($primaryPatient->id, array($secondaryEpisode)); + if (!$is_same_subspecialty) { + $this->updateEpisodesPatientId($primary_patient->id, array($secondary_episode)); } else { // there was a conflict and the episode was already moved in the foreach above } @@ -278,49 +287,49 @@ public function updateEpisodes(Patient $primaryPatient, Patient $secondaryPatien /** * Moving Legacy episode from secondary patient to primary. * - * @param type $primaryPatient - * @param type $secondaryPatient + * @param type $primary_patient + * @param type $secondary_patient * * @return bool * * @throws Exception */ - public function updateLegacyEpisodes($primaryPatient, $secondaryPatient) + public function updateLegacyEpisodes($primary_patient, $secondary_patient) { // if the secondary patient has legacy episodes - if ($secondaryPatient->legacyepisodes) { + if ($secondary_patient->legacyepisodes) { // if primary patient doesn't have legacy episode we can just update the episode's patient_id to assign it to the primary patient - if (!$primaryPatient->legacyepisodes) { + if (!$primary_patient->legacyepisodes) { // Patient can have only one legacy episode - $legacyEpisode = $secondaryPatient->legacyepisodes[0]; + $legacy_episode = $secondary_patient->legacyepisodes[0]; - $legacyEpisode->patient_id = $primaryPatient->id; - if ($legacyEpisode->save()) { - $msg = 'Legacy Episode '.$legacyEpisode->id.' moved from patient '.$secondaryPatient->hos_num.' to '.$primaryPatient->hos_num; + $legacy_episode->patient_id = $primary_patient->id; + if ($legacy_episode->save()) { + $msg = 'Legacy Episode '.$legacy_episode->id.' moved from patient '.$secondary_patient->hos_num.' to '.$primary_patient->hos_num; $this->addLog($msg); Audit::add('Patient Merge', 'Legacy Episode moved', $msg); } else { - throw new Exception('Failed to update (legacy) Episode: '.$legacyEpisode->id.' '.print_r($legacyEpisode->errors, true)); + throw new Exception('Failed to update (legacy) Episode: '.$legacy_episode->id.' '.print_r($legacy_episode->errors, true)); } } else { - $primaryLegacyEpisode = $primaryPatient->legacyepisodes[0]; - $secondaryLegacyEpisode = $secondaryPatient->legacyepisodes[0]; + $primary_legacy_episode = $primary_patient->legacyepisodes[0]; + $secondary_legacy_episode = $secondary_patient->legacyepisodes[0]; - if ($primaryLegacyEpisode->created_date < $secondaryLegacyEpisode->created_date) { + if ($primary_legacy_episode->created_date < $secondary_legacy_episode->created_date) { // we move the events from the secondaty patient's legacy episod to the primary patient's legacy epiode - $this->updateEventsEpisodeId($primaryLegacyEpisode->id, $secondaryLegacyEpisode->events); + $this->updateEventsEpisodeId($primary_legacy_episode->id, $secondary_legacy_episode->events); // Flag secondary patient's legacy episode deleted as it will be empty - $secondaryLegacyEpisode->deleted = 1; - if ($secondaryLegacyEpisode->save()) { - $msg = 'Legacy Episode '.$secondaryLegacyEpisode->id."marked as deleted, events moved under the primary patient's same firm episode."; + $secondary_legacy_episode->deleted = 1; + if ($secondary_legacy_episode->save()) { + $msg = 'Legacy Episode '.$secondary_legacy_episode->id."marked as deleted, events moved under the primary patient's same firm episode."; $this->addLog($msg); Audit::add('Patient Merge', 'Legacy Episode marked as deleted', $msg); } else { - throw new Exception('Failed to update (legacy) Episode: '.$secondaryLegacyEpisode->id.' '.print_r($secondaryLegacyEpisode->errors, true)); + throw new Exception('Failed to update (legacy) Episode: '.$secondary_legacy_episode->id.' '.print_r($secondary_legacy_episode->errors, true)); } } else { // in this case the secondary legacy episode is older than the primary @@ -328,20 +337,20 @@ public function updateLegacyEpisodes($primaryPatient, $secondaryPatient) // then move the secondary legacy episode to the Primary patient // then flag the primary's legacy episode as deleted // as only 1 legacy episode can be assigned to the patient - $this->updateEventsEpisodeId($secondaryLegacyEpisode->id, $primaryLegacyEpisode->events); + $this->updateEventsEpisodeId($secondary_legacy_episode->id, $primary_legacy_episode->events); - $primaryLegacyEpisode->deleted = 1; + $primary_legacy_episode->deleted = 1; - if ($primaryLegacyEpisode->save()) { - $msg = 'Legacy Episode '.$primaryLegacyEpisode->id."marked as deleted, events moved under the secondary patient's same firm episode."; + if ($primary_legacy_episode->save()) { + $msg = 'Legacy Episode '.$primary_legacy_episode->id."marked as deleted, events moved under the secondary patient's same firm episode."; $this->addLog($msg); Audit::add('Patient Merge', 'Legacy Episode marked as deleted', $msg); } else { - throw new Exception('Failed to update (legacy) Episode: '.$primaryLegacyEpisode->id.' '.print_r($primaryLegacyEpisode->errors, true)); + throw new Exception('Failed to update (legacy) Episode: '.$primary_legacy_episode->id.' '.print_r($primary_legacy_episode->errors, true)); } //then we move the episode to the pri1mary - $this->updateEpisodesPatientId($primaryPatient->id, array($secondaryLegacyEpisode)); + $this->updateEpisodesPatientId($primary_patient->id, array($secondary_legacy_episode)); } } } @@ -353,64 +362,64 @@ public function updateLegacyEpisodes($primaryPatient, $secondaryPatient) /** * Updates the patient id in the Allergy Assigment. * - * @param int $newPatientId Primary patient id + * @param int $new_patient_id Primary patient id * @param array of AR $allergies * * @throws Exception AllergyAssigment cannot be saved */ - public function updateAllergyAssignments($primaryPatient, $secondaryPatient) + public function updateAllergyAssignments($primary_patient, $secondary_patient) { - $primaryAssignments = $primaryPatient->allergyAssignments; - $secondaryAssignments = $secondaryPatient->allergyAssignments; - - if (!$primaryAssignments && $secondaryAssignments) { - foreach ($secondaryAssignments as $allergyAssignment) { - $msg = 'AllergyAssignment '.$allergyAssignment->id.' moved from patient '.$allergyAssignment->patient->hos_num.' to '.$primaryPatient->hos_num; - $allergyAssignment->patient_id = $primaryPatient->id; - if ($allergyAssignment->save()) { + $primary_assignments = $primary_patient->allergyAssignments; + $secondary_assignments = $secondary_patient->allergyAssignments; + + if (!$primary_assignments && $secondary_assignments) { + foreach ($secondary_assignments as $allergy_assignment) { + $msg = 'AllergyAssignment '.$allergy_assignment->id.' moved from patient '.$allergy_assignment->patient->hos_num.' to '.$primary_patient->hos_num; + $allergy_assignment->patient_id = $primary_patient->id; + if ($allergy_assignment->save()) { $this->addLog($msg); Audit::add('Patient Merge', 'AllergyAssignment moved patient', $msg); } else { - throw new Exception('Failed to update AllergyAssigment: '.$allergyAssignment->id.' '.print_r($allergyAssignment->errors, true)); + throw new Exception('Failed to update AllergyAssigment: '.$allergy_assignment->id.' '.print_r($allergy_assignment->errors, true)); } } - } elseif ($primaryAssignments && $secondaryAssignments) { - foreach ($secondaryAssignments as $secondaryAssignment) { - $sameAssignment = false; - foreach ($primaryAssignments as $primaryAssignment) { - if ($primaryAssignment->allergy_id == $secondaryAssignment->allergy_id) { + } elseif ($primary_assignments && $secondary_assignments) { + foreach ($secondary_assignments as $secondary_assignment) { + $same_assignment = false; + foreach ($primary_assignments as $primary_assignment) { + if ($primary_assignment->allergy_id == $secondary_assignment->allergy_id) { // the allergy is already present in the primary patient's record so we just update the 'comment' and 'other' fields - $sameAssignment = true; + $same_assignment = true; - $comments = $primaryAssignment->comments.' ; '.$secondaryAssignment->comments; - $other = $primaryAssignment->other.' ; '.$secondaryAssignment->other; + $comments = $primary_assignment->comments.' ; '.$secondary_assignment->comments; + $other = $primary_assignment->other.' ; '.$secondary_assignment->other; - $primaryAssignment->comments = $comments; - $primaryAssignment->other = $other; + $primary_assignment->comments = $comments; + $primary_assignment->other = $other; - if ($primaryAssignment->save()) { + if ($primary_assignment->save()) { $msg = "AllergyAssignment 'comments' and 'other' updated"; $this->addLog($msg); Audit::add('Patient Merge', 'AllergyAssignment updated', $msg); } else { - throw new Exception('Failed to update AllergyAssigment: '.$primaryAssignment->id.' '.print_r($primaryAssignment->errors, true)); + throw new Exception('Failed to update AllergyAssigment: '.$primary_assignment->id.' '.print_r($primary_assignment->errors, true)); } // as we just copied the comments and other fields we remove the assignment - $secondaryAssignment->delete(); + $secondary_assignment->delete(); } } // This means we have to move the assignment from secondary to primary - if (!$sameAssignment) { - $secondaryAssignment->patient_id = $primaryPatient->id; - if ($secondaryAssignment->save()) { - $msg = 'AllergyAssignment '.$secondaryAssignment->id.' moved from patient '.$secondaryPatient->hos_num.' to '.$primaryPatient->hos_num; + if (!$same_assignment) { + $secondary_assignment->patient_id = $primary_patient->id; + if ($secondary_assignment->save()) { + $msg = 'AllergyAssignment '.$secondary_assignment->id.' moved from patient '.$secondary_patient->hos_num.' to '.$primary_patient->hos_num; $this->addLog($msg); Audit::add('Patient Merge', 'AllergyAssignment moved from patient', $msg); } else { - throw new Exception('Failed to update AllergyAssigment: '.$allergyAssignment->id.' '.print_r($allergyAssignment->errors, true)); + throw new Exception('Failed to update AllergyAssigment: '.$allergy_assignment->id.' '.print_r($allergy_assignment->errors, true)); } } } @@ -422,21 +431,21 @@ public function updateAllergyAssignments($primaryPatient, $secondaryPatient) /** * Updates patient id in Risk Assignment. * - * @param int $newPatientId + * @param int $new_patient_id * @param array of AR $risks * * @throws Exception Failed to save RiskAssigment */ - public function updateRiskAssignments($newPatientId, $riskAssignments) + public function updateRiskAssignments($primary_patient, $risk_assignments) { - foreach ($riskAssignments as $riskAssignment) { - $msg = 'RiskAssignment '.$riskAssignment->id.' moved from patient '.$riskAssignment->patient->hos_num.' to '.$newPatientId; - $riskAssignment->patient_id = $newPatientId; - if ($riskAssignment->save()) { + foreach ($risk_assignments as $risk_assignment) { + $msg = 'RiskAssignment '.$risk_assignment->id.' moved from patient '.$risk_assignment->patient->hos_num.' to '.$primary_patient->id; + $risk_assignment->patient_id = $primary_patient->id; + if ($risk_assignment->save()) { $this->addLog($msg); Audit::add('Patient Merge', 'RiskAssignment moved patient', $msg); } else { - throw new Exception('Failed to update RiskAssigment: '.$riskAssignment->id.' '.print_r($riskAssignment->errors, true)); + throw new Exception('Failed to update RiskAssigment: '.$risk_assignment->id.' '.print_r($risk_assignment->errors, true)); } } @@ -446,24 +455,24 @@ public function updateRiskAssignments($newPatientId, $riskAssignments) /** * Moving previous operations from secondaty patient to primary. * - * @param Patient $newPatient - * @param type $previousOperations + * @param Patient $new_patient + * @param type $previous_operations * * @return bool * * @throws Exception */ - public function updatePreviousOperations($newPatient, $previousOperations) + public function updatePreviousOperations($new_patient, $previous_operations) { - foreach ($previousOperations as $previousOperation) { - $msg = 'Previous Operation '.$previousOperation->id.' moved from Patient ' . $previousOperation->patient->hos_num.' to '.$newPatient->hos_num; - $previousOperation->patient_id = $newPatient->id; - if ($previousOperation->save()) { + foreach ($previous_operations as $previous_operation) { + $msg = 'Previous Operation '.$previous_operation->id.' moved from Patient ' . $previous_operation->patient->hos_num.' to '.$new_patient->hos_num; + $previous_operation->patient_id = $new_patient->id; + if ($previous_operation->save()) { $this->addLog($msg); Audit::add('Patient Merge', 'Previous Operation moved patient', $msg); } else { - throw new Exception('Failed to update Previous Operation: ' . $previousOperation->id.' ' . print_r($previousOperation->errors, true)); + throw new Exception('Failed to update Previous Operation: ' . $previous_operation->id.' ' . print_r($previous_operation->errors, true)); } } @@ -473,20 +482,20 @@ public function updatePreviousOperations($newPatient, $previousOperations) /** * Updates the Ophthalmic Diagnoses' patient_id * - * @param Patient $newPatient - * @param type $ophthalmicDiagnoses + * @param Patient $new_patient + * @param type $ophthalmic_diagnoses * @throws Exception */ - public function updateOphthalmicDiagnoses($newPatient, $ophthalmicDiagnoses) + public function updateOphthalmicDiagnoses($new_patient, $ophthalmic_diagnoses) { - foreach ($ophthalmicDiagnoses as $ophthalmicDiagnosis) { - $msg = 'Ophthalmic Diagnosis(SecondaryDiagnosis) ' . $ophthalmicDiagnosis->id . ' moved from Patient ' . $ophthalmicDiagnosis->patient->hos_num . ' to ' . $newPatient->hos_num; - $ophthalmicDiagnosis->patient_id = $newPatient->id; - if ($ophthalmicDiagnosis->save()) { + foreach ($ophthalmic_diagnoses as $ophthalmic_diagnosis) { + $msg = 'Ophthalmic Diagnosis(SecondaryDiagnosis) ' . $ophthalmic_diagnosis->id . ' moved from Patient ' . $ophthalmic_diagnosis->patient->hos_num . ' to ' . $new_patient->hos_num; + $ophthalmic_diagnosis->patient_id = $new_patient->id; + if ($ophthalmic_diagnosis->save()) { $this->addLog($msg); Audit::add('Patient Merge', 'Ophthalmic Diagnosis(SecondaryDiagnosis) moved patient', $msg); } else { - throw new Exception('Failed to update Ophthalmic Diagnosis(SecondaryDiagnosis): ' . $ophthalmicDiagnosis->id . ' ' . print_r($ophthalmicDiagnosis->errors, true)); + throw new Exception('Failed to update Ophthalmic Diagnosis(SecondaryDiagnosis): ' . $ophthalmic_diagnosis->id . ' ' . print_r($ophthalmic_diagnosis->errors, true)); } } @@ -496,21 +505,21 @@ public function updateOphthalmicDiagnoses($newPatient, $ophthalmicDiagnoses) /** * Update Systemati Diagnoses' patient id * - * @param Patient $newPatient - * @param type $systemicDiagnoses + * @param Patient $new_patient + * @param type $systemic_diagnoses * @return boolean * @throws Exception */ - public function updateSystemicDiagnoses($newPatient, $systemicDiagnoses) + public function updateSystemicDiagnoses($new_patient, $systemic_diagnoses) { - foreach ($systemicDiagnoses as $systemicDiagnosis) { - $msg = 'Systemic Diagnoses ' . $systemicDiagnosis->id . ' moved from Patient ' . $systemicDiagnosis->patient->hos_num . ' to ' . $newPatient->hos_num; - $systemicDiagnosis->patient_id = $newPatient->id; - if ($systemicDiagnosis->save()) { + foreach ($systemic_diagnoses as $systemic_diagnosis) { + $msg = 'Systemic Diagnoses ' . $systemic_diagnosis->id . ' moved from Patient ' . $systemic_diagnosis->patient->hos_num . ' to ' . $new_patient->hos_num; + $systemic_diagnosis->patient_id = $new_patient->id; + if ($systemic_diagnosis->save()) { $this->addLog($msg); Audit::add('Patient Merge', 'Systemic Diagnoses moved patient', $msg); } else { - throw new Exception('Failed to update Systemic Diagnoses: ' . $systemicDiagnosis->id . ' ' . print_r($systemicDiagnosis->errors, true)); + throw new Exception('Failed to update Systemic Diagnoses: ' . $systemic_diagnosis->id . ' ' . print_r($systemic_diagnosis->errors, true)); } } @@ -527,17 +536,17 @@ public function updateSystemicDiagnoses($newPatient, $systemicDiagnoses) * * @return bool true if no error thrown */ - public function updateEpisodesPatientId($newPatientId, $episodes) + public function updateEpisodesPatientId($new_patient_id, $episodes) { foreach ($episodes as $episode) { - $msg = 'Episode '.$episode->id.' moved from patient '.$episode->patient_id.' to '.$newPatientId; - $episode->patient_id = $newPatientId; + $msg = 'Episode '.$episode->id.' moved from patient '.$episode->patient_id.' to '.$new_patient_id; + $episode->patient_id = $new_patient_id; if ($episode->save()) { $this->addLog($msg); Audit::add('Patient Merge', 'Episode moved patient', $msg); } else { - throw new Exception('Failed to save Episode: '.print_r($secondaryPatient->errors, true)); + throw new Exception('Failed to save Episode: '.print_r($secondary_patient->errors, true)); } } @@ -547,19 +556,19 @@ public function updateEpisodesPatientId($newPatientId, $episodes) /** * Moving event from one episode to another. * - * @param int $newEpisodeId + * @param int $new_episode_id * @param array $events * * @return bool * * @throws Exception */ - public function updateEventsEpisodeId($newEpisodeId, $events) + public function updateEventsEpisodeId($new_episode_id, $events) { foreach ($events as $event) { - $msg = 'Event '.$event->id.' moved from Episode '.$event->episode_id.' to '.$newEpisodeId; + $msg = 'Event '.$event->id.' moved from Episode '.$event->episode_id.' to '.$new_episode_id; - $event->episode_id = $newEpisodeId; + $event->episode_id = $new_episode_id; if ($event->save()) { $this->addLog($msg); @@ -571,4 +580,24 @@ public function updateEventsEpisodeId($newEpisodeId, $events) return true; } + + /** + * Returns the earliest start date and the latest end date of the two episodes + * + * @param Episode $primary_episode + * @param Episode $secondary_episode + * @return array start date, end date + */ + public function getTwoEpisodesStartEndDate(Episode $primary_episode, Episode $secondary_episode) + { + $start_date = ($primary_episode->start_date > $secondary_episode->start_date) ? $secondary_episode->start_date : $primary_episode->start_date; + + if( !$primary_episode->end_date || !$secondary_episode->end_date){ + $end_date = null; + } else { + $end_date = ($primary_episode->end_date < $secondary_episode->end_date) ? $secondary_episode->end_date : $primary_episode->end_date; + } + + return array($start_date, $end_date); + } } diff --git a/protected/components/PcrRisk.php b/protected/components/PcrRisk.php index a8f5741dcf..3ee8a1043e 100644 --- a/protected/components/PcrRisk.php +++ b/protected/components/PcrRisk.php @@ -18,10 +18,34 @@ */ class PcrRisk { + protected $stringMap = array( + 'general' => array( + 'NK' => 'Not Known', + 'N' => 'No', + 'Y' => 'Yes', + ), + 'glaucoma' => array( + 'NK' => 'Not Known', + 'N' => 'No Glaucoma', + 'Y' => 'Glaucoma Present', + ), + 'diabetes' => array( + 'NK' => 'Not Known', + 'N' => 'No Diabetes', + 'Y' => 'Diabetes Present', + ), + 'axial' => array( + '0' => 'Not Known', + '1' => '< 26', + '2' => '> or = 26', + ), + ); + /** * @var Patient */ protected $patient; + /** * @param $patientId * @param $side @@ -100,7 +124,7 @@ public function getPCRData($patientId, $side, $element) $pcr['anteriorsegment'] = $this->getPatientAnteriorSegment($patientId, $side, $pcrRiskValues); $pcr['doctor_grade_id'] = $doctor_grade_id; $pcr['axial_length_group'] = ($this->getAxialLength($patientId, $side) !== 'N') ? $this->getAxialLength($patientId, $side) : $pcrRiskValues->axial_length_group; - $pcr['arb'] = $pcrRiskValues->alpha_receptor_blocker; + $pcr['arb'] = ($this->getAlphaBlocker($this->patient)) ? $this->getAlphaBlocker($this->patient) : $pcrRiskValues->alpha_receptor_blocker; return $pcr; } @@ -166,14 +190,14 @@ public function getOpticDisc($patientId, $side, $isAll = false) $criteria = new CDbCriteria(); $criteria->select = 'event.id, ophciexamination_opticdisc_cd_ratio.name'; - if ($side == 'right') { + if ($side === 'right') { $criteria->join = 'JOIN event ON event.episode_id = t.id - JOIN et_ophciexamination_opticdisc ON et_ophciexamination_opticdisc.event_id = event.id - JOIN ophciexamination_opticdisc_cd_ratio ON et_ophciexamination_opticdisc.right_cd_ratio_id = ophciexamination_opticdisc_cd_ratio.id'; - } elseif ($side == 'left') { + JOIN et_ophciexamination_opticdisc ON et_ophciexamination_opticdisc.event_id = event.id + JOIN ophciexamination_opticdisc_cd_ratio ON et_ophciexamination_opticdisc.right_cd_ratio_id = ophciexamination_opticdisc_cd_ratio.id'; + } elseif ($side === 'left') { $criteria->join = 'JOIN event ON event.episode_id = t.id - JOIN et_ophciexamination_opticdisc ON et_ophciexamination_opticdisc.event_id = event.id - JOIN ophciexamination_opticdisc_cd_ratio ON et_ophciexamination_opticdisc.left_cd_ratio_id = ophciexamination_opticdisc_cd_ratio.id'; + JOIN et_ophciexamination_opticdisc ON et_ophciexamination_opticdisc.event_id = event.id + JOIN ophciexamination_opticdisc_cd_ratio ON et_ophciexamination_opticdisc.left_cd_ratio_id = ophciexamination_opticdisc_cd_ratio.id'; } if ($isAll) { @@ -227,7 +251,7 @@ public function getPatientAnteriorSegment($patientId, $side, PcrRiskValues $stor } if (is_array($eyedraw)) { - foreach ($eyedraw as $key => $val) { + foreach ($eyedraw as $val) { if (!empty($val['pupilSize'])) { $as['pupil_size'] = $val['pupilSize']; } @@ -277,9 +301,9 @@ public function getAxialLength($patientId, $side) $axial_length = 0; - if (($side == 'right') && ($biometry_measurement['eye_id'] == 2 || $biometry_measurement['eye_id'] == 3)) { + if (($side === 'right') && ($biometry_measurement['eye_id'] == 2 || $biometry_measurement['eye_id'] == 3)) { $axial_length = $biometry_measurement['axial_length_right']; - } elseif (($side == 'left') && ($biometry_measurement['eye_id'] == 1 || $biometry_measurement['eye_id'] == 3)) { + } elseif (($side === 'left') && ($biometry_measurement['eye_id'] == 1 || $biometry_measurement['eye_id'] == 3)) { $axial_length = $biometry_measurement['axial_length_left']; } @@ -295,6 +319,25 @@ public function getAxialLength($patientId, $side) return $axial_length_group; } + /** + * @param Patient $patient + * + * @return string + */ + protected function getAlphaBlocker(Patient $patient) + { + $historyRisk = new \OEModule\OphCiExamination\models\Element_OphCiExamination_HistoryRisk(); + $alphaBlocker = $historyRisk->mostRecentCheckedAlpha($patient->id); + + if(!$alphaBlocker || $alphaBlocker->alphablocker === '0') { + return 'NK'; + } elseif ($alphaBlocker->alphablocker === '1') { + return 'Y'; + } else { + return 'N'; + } + } + /** * @param $side * @param Patient $patient @@ -323,20 +366,38 @@ public function persist($side, Patient $patient, $data = array()) if ($existing) { $pcrRiskValues = $existing; } - $data['doctor_grade_id'] = '1'; - $pcrRiskValues->glaucoma = (isset($data['glaucoma']) && $data['glaucoma'] != 'NK') ? $data['glaucoma'] : null; - $pcrRiskValues->pxf = (isset($data['pxf_phako']) && $data['pxf_phako'] != 'NK') ? $data['pxf_phako'] : null; - $pcrRiskValues->diabetic = (isset($data['diabetic']) && $data['diabetic'] != 'NK') ? $data['diabetic'] : null; - $pcrRiskValues->pupil_size = (isset($data['pupil_size']) && $data['pupil_size'] != 'NK') ? $data['pupil_size'] : null; - $pcrRiskValues->no_fundal_view = (isset($data['no_fundal_view']) && $data['no_fundal_view'] != 'NK') ? $data['no_fundal_view'] : null; - $pcrRiskValues->axial_length_group = (isset($data['axial_length']) && $data['axial_length'] != 'NK') ? $data['axial_length'] : null; - $pcrRiskValues->brunescent_white_cataract = (isset($data['brunescent_white_cataract']) && $data['brunescent_white_cataract'] != 'NK') ? $data['brunescent_white_cataract'] : null; - $pcrRiskValues->alpha_receptor_blocker = (isset($data['arb']) && $data['arb'] != 'NK') ? $data['arb'] : null; - $pcrRiskValues->doctor_grade_id = (isset($data['doctor_grade_id']) && $data['doctor_grade_id'] != '') ? $data['doctor_grade_id'] : null; - $pcrRiskValues->can_lie_flat = (isset($data['abletolieflat']) && $data['abletolieflat'] != 'NK') ? $data['abletolieflat'] : null; + + $pcrRiskValues->glaucoma = (isset($data['glaucoma']) && $data['glaucoma'] !== 'NK') ? $data['glaucoma'] : null; + $pcrRiskValues->pxf = (isset($data['pxf_phako']) && $data['pxf_phako'] !== 'NK') ? $data['pxf_phako'] : null; + $pcrRiskValues->diabetic = (isset($data['diabetic']) && $data['diabetic'] !== 'NK') ? $data['diabetic'] : null; + $pcrRiskValues->pupil_size = (isset($data['pupil_size']) && $data['pupil_size'] !== 'NK') ? $data['pupil_size'] : null; + $pcrRiskValues->no_fundal_view = (isset($data['no_fundal_view']) && $data['no_fundal_view'] !== 'NK') ? $data['no_fundal_view'] : null; + $pcrRiskValues->axial_length_group = (isset($data['axial_length']) && $data['axial_length'] !== 'NK') ? $data['axial_length'] : null; + $pcrRiskValues->brunescent_white_cataract = (isset($data['brunescent_white_cataract']) && $data['brunescent_white_cataract'] !== 'NK') ? $data['brunescent_white_cataract'] : null; + $pcrRiskValues->alpha_receptor_blocker = (isset($data['arb']) && $data['arb'] !== 'NK') ? $data['arb'] : null; + $pcrRiskValues->doctor_grade_id = (isset($data['pcr_doctor_grade']) && $data['pcr_doctor_grade'] !== '') ? $data['pcr_doctor_grade'] : null; + $pcrRiskValues->can_lie_flat = (isset($data['abletolieflat']) && $data['abletolieflat'] !== 'NK') ? $data['abletolieflat'] : null; if (!$pcrRiskValues->save()) { throw new CException('PCR Risk failed to save'); } } + + /** + * @param string $value + * @param string $type + * @return string + */ + public function displayValues($value, $type = 'general') + { + if(!array_key_exists($type, $this->stringMap)){ + $type = 'general'; + } + + if(array_key_exists($value, $this->stringMap[$type])){ + return $this->stringMap[$type][$value]; + } + + return $value; + } } diff --git a/protected/components/UserIdentity.php b/protected/components/UserIdentity.php index a5199be1a2..7d2807212c 100644 --- a/protected/components/UserIdentity.php +++ b/protected/components/UserIdentity.php @@ -75,7 +75,9 @@ public function authenticate($force = false) Yii::app()->params['auth_source'] = 'BASIC'; } - $this->password = utf8_decode($this->password); + if(Yii::app()->params['utf8_decode_required']){ + $this->password = utf8_decode($this->password); + } /* * Here we diverge depending on the authentication source. diff --git a/protected/components/WorklistManager.php b/protected/components/WorklistManager.php index 840bfedaa7..aa241fa876 100644 --- a/protected/components/WorklistManager.php +++ b/protected/components/WorklistManager.php @@ -1411,7 +1411,7 @@ public function canUpdateWorklistDefinition(WorklistDefinition $definition) return true; } - return $definition->isNewRecord || count($definition->worklists) == 0; + return $definition->isNewRecord || $definition->getWorklistCount() == 0; } /** diff --git a/protected/config/core/common.php b/protected/config/core/common.php index 83a7646f48..1943424d24 100644 --- a/protected/config/core/common.php +++ b/protected/config/core/common.php @@ -256,6 +256,7 @@ ), 'params' => array( + 'utf8_decode_required' => true, 'pseudonymise_patient_details' => false, 'ab_testing' => false, 'auth_source' => 'BASIC', // Options are BASIC or LDAP. @@ -419,5 +420,13 @@ 'saveprint' => 'Save and print' ) ), + + /** + * Operation bookings will be automatically scheduled to the next available slot (regardless of the firm) + */ + "auto_schedule_operation" => false, + + 'clinical_management_pcr' => true, + 'docman_generate_csv' => false, ), ); diff --git a/protected/config/local.sample/common.php b/protected/config/local.sample/common.php index 1932918e75..3d358fd6e2 100644 --- a/protected/config/local.sample/common.php +++ b/protected/config/local.sample/common.php @@ -138,6 +138,7 @@ 'event_print_method' => 'pdf', 'wkhtmltopdf_nice_level' => 19, 'city_road_satellite_view' => 1, + 'enable_concise_med_history' => true, // default start time used for automatic worklist definitions //'worklist_default_start_time' => 'H:i', // default end time used for automatic worklist definitions diff --git a/protected/controllers/AdminController.php b/protected/controllers/AdminController.php index 7670d9ef99..9c17be7035 100644 --- a/protected/controllers/AdminController.php +++ b/protected/controllers/AdminController.php @@ -377,6 +377,28 @@ public function actionAddUser() if (!$user->save()) { throw new Exception('Unable to save user: ' . print_r($user->getErrors(), true)); } + + if (!$contact = $user->contact) { + $contact = new Contact(); + } + + $contact->title = $user->title; + $contact->first_name = $user->first_name; + $contact->last_name = $user->last_name; + $contact->qualifications = $user->qualifications; + + if (!$contact->save()) { + throw new Exception('Unable to save user contact: ' . print_r($contact->getErrors(), true)); + } + + if (!$user->contact) { + $user->contact_id = $contact->id; + + if (!$user->save()) { + throw new Exception('Unable to save user: ' . print_r($user->getErrors(), true)); + } + } + Audit::add('admin-User', 'add', $user->id); if (!isset($userAtt['roles'])) { @@ -1868,9 +1890,7 @@ public function actionEditSetting() $setting = new SettingInstallation(); $setting->key = $metadata->key; } - $setting->value = @$_POST[$metadata->key]; - if (!$setting->save()) { $errors = $setting->errors; } else { diff --git a/protected/controllers/PatientMergeRequestController.php b/protected/controllers/PatientMergeRequestController.php index d08ebc70b5..dd187098f0 100644 --- a/protected/controllers/PatientMergeRequestController.php +++ b/protected/controllers/PatientMergeRequestController.php @@ -94,12 +94,12 @@ public function actionIndex() $criteria->params[':status'] = PatientMergeRequest::STATUS_NOT_PROCESSED; } - $itemsCount = PatientMergeRequest::model()->count($criteria); - $pagination = new CPagination($itemsCount); + $items_count = PatientMergeRequest::model()->count($criteria); + $pagination = new CPagination($items_count); $pagination->pageSize = 15; $pagination->applyLimit($criteria); - $dataProvider = new CActiveDataProvider('PatientMergeRequest', array( + $data_provider = new CActiveDataProvider('PatientMergeRequest', array( 'criteria' => $criteria, 'pagination' => $pagination, 'sort' => array( @@ -108,7 +108,7 @@ public function actionIndex() )); $this->render('//patientmergerequest/index', array( - 'dataProvider' => $dataProvider, + 'data_provider' => $data_provider, 'filters' => $filters, )); } @@ -116,57 +116,55 @@ public function actionIndex() public function actionCreate() { $model = new PatientMergeRequest(); - $mergeHandler = new PatientMerge(); - $patientMergeRequest = Yii::app()->request->getParam('PatientMergeRequest', null); - $personalDetailsConflictConfirm = null; + $merge_handler = new PatientMerge(); + $patient_merge_request = Yii::app()->request->getParam('PatientMergeRequest', null); + $personal_details_conflict_confirm = null; - if ($patientMergeRequest && isset($patientMergeRequest['primary_id']) && isset($patientMergeRequest['secondary_id'])) { - $primaryPatient = Patient::model()->findByPk($patientMergeRequest['primary_id']); - $secondaryPatient = Patient::model()->findByPk($patientMergeRequest['secondary_id']); + if ($patient_merge_request && isset($patient_merge_request['primary_id']) && isset($patient_merge_request['secondary_id'])) { + $primary_patient = Patient::model()->findByPk($patient_merge_request['primary_id']); + $secondary_patient = Patient::model()->findByPk($patient_merge_request['secondary_id']); //check if the patients' ids are already submited // we do not allow the same patient id in the list multiple times $criteria = new CDbCriteria(); - //$criteria->condition = '((primary_id=:primary_id OR primary_id=:secondary_id OR secondary_id=:secondary_id OR secondary_id=:primary_id) AND ( deleted = 0))'; - // as secondary records will be deleted the numbers cannot be in the secondry columns $criteria->condition = '(secondary_id=:secondary_id OR secondary_id=:primary_id) '; //we allow primary patients only if it has no active/unmerged requests $criteria->condition .= 'AND ( (primary_id=@primary AND STATUS != 20) OR (primary_id=@secondary AND STATUS != 20) )'; - $criteria->params = array(':primary_id' => $patientMergeRequest['primary_id'], ':secondary_id' => $patientMergeRequest['secondary_id']); + $criteria->params = array(':primary_id' => $patient_merge_request['primary_id'], ':secondary_id' => $patient_merge_request['secondary_id']); - $numbersNotUnique = PatientMergeRequest::model()->find($criteria); + $numbers_not_unique = PatientMergeRequest::model()->find($criteria); - $personalDetailsConflictConfirm = $mergeHandler->comparePatientDetails($primaryPatient, $secondaryPatient); + $personal_details_conflict_confirm = $merge_handler->comparePatientDetails($primary_patient, $secondary_patient); - if (empty($numbersNotUnique) && (!$personalDetailsConflictConfirm['isConflict'] || ($personalDetailsConflictConfirm['isConflict'] && isset($patientMergeRequest['personalDetailsConflictConfirm'])))) { + if (empty($numbers_not_unique) && (!$personal_details_conflict_confirm['is_conflict'] || ($personal_details_conflict_confirm['is_conflict'] && isset($patient_merge_request['personal_details_conflict_confirm'])))) { // the Primary and Secondary user cannot be the same user , same database record I mean - if ((!empty($patientMergeRequest['secondary_id']) && !empty($patientMergeRequest['primary_id'])) && $patientMergeRequest['secondary_id'] == $patientMergeRequest['primary_id']) { + if ((!empty($patient_merge_request['secondary_id']) && !empty($patient_merge_request['primary_id'])) && $patient_merge_request['secondary_id'] == $patient_merge_request['primary_id']) { Yii::app()->user->setFlash('warning.merge_error', 'The Primary and Secondary patient cannot be the same. Record cannot be merged into itself.'); } else { - if (empty($patientMergeRequest['secondary_id']) || empty($patientMergeRequest['primary_id'])) { + if (empty($patient_merge_request['secondary_id']) || empty($patient_merge_request['primary_id'])) { Yii::app()->user->setFlash('warning.merge_error', 'Both Primary and Secondary patients have to be selected.'); } else { - $model->attributes = $patientMergeRequest; + $model->attributes = $patient_merge_request; if ($model->save()) { $this->redirect(array('index')); } } } - } elseif ($personalDetailsConflictConfirm['isConflict'] && !isset($patientMergeRequest['personalDetailsConflictConfirm'])) { + } elseif ($personal_details_conflict_confirm['is_conflict'] && !isset($patient_merge_request['personal_details_conflict_confirm'])) { Yii::app()->user->setFlash('warning.user_error', 'Please tick the checkboxes.'); - } elseif ($numbersNotUnique) { + } elseif ($numbers_not_unique) { Yii::app()->user->setFlash('warning.merge_error_duplicate', 'One of the Hospital Numbers are already in the Patient Merge Request list, please merge them first.'); $this->redirect(array('index')); } } - if ($personalDetailsConflictConfirm && $personalDetailsConflictConfirm['isConflict'] == true) { - foreach ($personalDetailsConflictConfirm['details'] as $conflict) { + if ($personal_details_conflict_confirm && $personal_details_conflict_confirm['is_conflict'] == true) { + foreach ($personal_details_conflict_confirm['details'] as $conflict) { Yii::app()->user->setFlash('warning.merge_error_'.$conflict['column'], 'Patients have different personal details : '.$conflict['column']); } } @@ -195,7 +193,7 @@ public function actionLog($id) $this->render('//patientmergerequest/log', array( 'model' => $model, - 'dataProvider' => new CArrayDataProvider($log), + 'data_provider' => new CArrayDataProvider($log), )); } @@ -221,37 +219,37 @@ public function actionView($id) */ public function actionUpdate($id) { - $mergeRequest = $this->loadModel($id); - $mergeHandler = new PatientMerge(); + $merge_request = $this->loadModel($id); + $merge_handler = new PatientMerge(); // if the personal details are conflictng (DOB and Gender at the moment) we need extra confirmation - $personalDetailsConflictConfirm = $mergeHandler->comparePatientDetails($mergeRequest->primaryPatient, $mergeRequest->secondaryPatient); - if ($personalDetailsConflictConfirm && $personalDetailsConflictConfirm['isConflict'] == true) { - foreach ($personalDetailsConflictConfirm['details'] as $conflict) { + $personal_details_conflict_confirm = $merge_handler->comparePatientDetails($merge_request->primaryPatient, $merge_request->secondaryPatient); + if ($personal_details_conflict_confirm && $personal_details_conflict_confirm['is_conflict'] == true) { + foreach ($personal_details_conflict_confirm['details'] as $conflict) { Yii::app()->user->setFlash('warning.merge_error_'.$conflict['column'], 'Patients have different personal details : '.$conflict['column']); } } if (isset($_POST['PatientMergeRequest'])) { - if (!$personalDetailsConflictConfirm['isConflict'] || ($personalDetailsConflictConfirm['isConflict'] && isset($_POST['PatientMergeRequest']['personalDetailsConflictConfirm']))) { - $mergeRequest->attributes = $_POST['PatientMergeRequest']; - if ($mergeRequest->status == PatientMergeRequest::STATUS_MERGED) { - $this->redirect(array('view', 'id' => $mergeRequest->id)); - } elseif ($mergeRequest->save()) { + if (!$personal_details_conflict_confirm['is_conflict'] || ($personal_details_conflict_confirm['is_conflict'] && isset($_POST['PatientMergeRequest']['personal_details_conflict_confirm']))) { + $merge_request->attributes = $_POST['PatientMergeRequest']; + if ($merge_request->status == PatientMergeRequest::STATUS_MERGED) { + $this->redirect(array('view', 'id' => $merge_request->id)); + } elseif ($merge_request->save()) { $this->redirect(array('index')); } - } elseif ($personalDetailsConflictConfirm['isConflict'] && !isset($_POST['PatientMergeRequest']['personalDetailsConflictConfirm'])) { + } elseif ($personal_details_conflict_confirm['is_conflict'] && !isset($_POST['PatientMergeRequest']['personal_details_conflict_confirm'])) { Yii::app()->user->setFlash('warning.user_error', 'Please tick the checkboxes.'); } } - $primary = Patient::model()->findByPk($mergeRequest->primary_id); - $secondary = Patient::model()->findByPk($mergeRequest->secondary_id); + $primary = Patient::model()->findByPk($merge_request->primary_id); + $secondary = Patient::model()->findByPk($merge_request->secondary_id); $this->render('//patientmergerequest/update', array( - 'model' => $mergeRequest, - 'personalDetailsConflictConfirm' => $personalDetailsConflictConfirm['isConflict'], - 'primaryPatientJSON' => CJavaScript::jsonEncode(array( + 'model' => $merge_request, + 'personal_details_conflict_confirm' => $personal_details_conflict_confirm['is_conflict'], + 'primary_patient_JSON' => CJavaScript::jsonEncode(array( 'id' => $primary->id, 'first_name' => $primary->first_name, 'last_name' => $primary->last_name, @@ -265,7 +263,7 @@ public function actionUpdate($id) ) ), - 'secondaryPatientJSON' => CJavaScript::jsonEncode(array( + 'secondary_patient_JSON' => CJavaScript::jsonEncode(array( 'id' => $secondary->id, 'first_name' => $secondary->first_name, 'last_name' => $secondary->last_name, @@ -288,19 +286,19 @@ public function actionUpdate($id) */ public function actionMerge($id) { - $mergeRequest = $this->loadModel($id); + $merge_request = $this->loadModel($id); //if the model already merged we just redirect to the index page - if ($mergeRequest->status == PatientMergeRequest::STATUS_MERGED) { + if ($merge_request->status == PatientMergeRequest::STATUS_MERGED) { $this->redirect(array('index')); } - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); // if the personal details are conflictng (DOB and Gender at the moment) we need extra confirmation - $personalDetailsConflictConfirm = $mergeHandler->comparePatientDetails($mergeRequest->primaryPatient, $mergeRequest->secondaryPatient); - if ($personalDetailsConflictConfirm && $personalDetailsConflictConfirm['isConflict'] == true) { - foreach ($personalDetailsConflictConfirm['details'] as $conflict) { + $personal_details_conflict_confirm = $merge_handler->comparePatientDetails($merge_request->primaryPatient, $merge_request->secondaryPatient); + if ($personal_details_conflict_confirm && $personal_details_conflict_confirm['is_conflict'] == true) { + foreach ($personal_details_conflict_confirm['details'] as $conflict) { Yii::app()->user->setFlash('warning.merge_error_'.$conflict['column'], 'Patients have different personal details : '.$conflict['column']); } } @@ -309,54 +307,52 @@ public function actionMerge($id) // if personal details are not conflictin than its fine, // but if there is a conflict we need the extra confirmation - if (!$personalDetailsConflictConfirm['isConflict'] || ($personalDetailsConflictConfirm['isConflict'] && isset($_POST['PatientMergeRequest']['personalDetailsConflictConfirm']))) { + if (!$personal_details_conflict_confirm['is_conflict'] || ($personal_details_conflict_confirm['is_conflict'] && isset($_POST['PatientMergeRequest']['personal_details_conflict_confirm']))) { // Load data from PatientMergeRequest AR record - $mergeHandler->load($mergeRequest); - - if ($mergeHandler->merge()) { - $msg = 'Merge Request '.$mergeRequest->secondaryPatient->hos_num.' INTO '.$mergeRequest->primaryPatient->hos_num.'(hos_num) successfully done.'; - $mergeHandler->addLog($msg); - $mergeRequest->status = $mergeRequest::STATUS_MERGED; - $mergeRequest->merge_json = json_encode(array('log' => $mergeHandler->getLog())); - $mergeRequest->save(); - Audit::add('Patient Merge', $msg); - $this->redirect(array('log', 'id' => $mergeRequest->id)); + $merge_handler->load($merge_request); + + if ($merge_handler->merge()) { + $msg = 'Merge Request '.$merge_request->secondaryPatient->hos_num.' INTO '.$merge_request->primaryPatient->hos_num.'(hos_num) successfully done.'; + $merge_handler->addLog($msg); + $merge_request->status = $merge_request::STATUS_MERGED; + $merge_request->merge_json = json_encode(array('log' => $merge_handler->getLog())); + $merge_request->save(); + Audit::add('Patient Merge', 'Patient Merge Request successfully done.', $msg); + $this->redirect(array('log', 'id' => $merge_request->id)); } else { - $msg = 'Merge Request '.$mergeRequest->secondaryPatient->hos_num.' INTO '.$mergeRequest->primaryPatient->hos_num.' FAILED.'; - $mergeHandler->addLog($msg); - $mergeRequest->status = $mergeRequest::STATUS_CONFLICT; - $mergeRequest->merge_json = json_encode(array('log' => $mergeHandler->getLog())); - $mergeRequest->save(); + $msg = 'Merge Request '.$merge_request->secondaryPatient->hos_num.' INTO '.$merge_request->primaryPatient->hos_num.' FAILED.'; + $merge_handler->addLog($msg); + $merge_request->status = $merge_request::STATUS_CONFLICT; + $merge_request->merge_json = json_encode(array('log' => $merge_handler->getLog())); + $merge_request->save(); Yii::app()->user->setFlash('warning.search_error', 'Merge failed.'); $this->redirect(array('index')); } } } - $primary = Patient::model()->findByPk($mergeRequest->primary_id); - $secondary = Patient::model()->findByPk($mergeRequest->secondary_id); $this->render('//patientmergerequest/merge', array( - 'model' => $mergeRequest, - 'personalDetailsConflictConfirm' => $personalDetailsConflictConfirm['isConflict'], + 'model' => $merge_request, + 'personal_details_conflict_confirm' => $personal_details_conflict_confirm['is_conflict'], )); } public function actionDelete() { - if (isset($_POST['patientMergeRequestIds'])) { + if (isset($_POST['patient_merge_request_ids'])) { $criteria = new CDbCriteria(); $criteria->condition = 't.status = '.PatientMergeRequest::STATUS_NOT_PROCESSED; - $requests = PatientMergeRequest::model()->findAllByPk($_POST['patientMergeRequestIds'], $criteria); + $requests = PatientMergeRequest::model()->findAllByPk($_POST['patient_merge_request_ids'], $criteria); foreach ($requests as $request) { $request->deleted = 1; if ($request->save()) { - Audit::add('Patient Merge', 'Patient Merge Request flagged as deleted. id: '.$request->id); + Audit::add('Patient Merge', 'Patient Merge Request flagged as deleted.', "Patient merge request id:{$request->id} deleted."); } else { throw new Exception('Unable to save Patient Merge Request: '.print_r($request->getErrors(), true)); } @@ -402,9 +398,9 @@ public function isPatientInRequestList($patientId) $criteria->params = array(':patient_id' => $patientId); - $mergeRequest = PatientMergeRequest::model()->find($criteria); + $merge_request = PatientMergeRequest::model()->find($criteria); - return $mergeRequest ? ($mergeRequest->primary_id == $patientId ? 'primary' : 'secondary') : null; + return $merge_request ? ($merge_request->primary_id == $patientId ? 'primary' : 'secondary') : null; } public function actionSearch() @@ -412,17 +408,17 @@ public function actionSearch() $term = trim(\Yii::app()->request->getParam('term', '')); $result = array(); - $patientSearch = new PatientSearch(); + $patient_search = new PatientSearch(); - if ($patientSearch->isValidSearchTerm($term)) { - $dataProvider = $patientSearch->search($term); - foreach ($dataProvider->getData() as $patient) { + if ($patient_search->isValidSearchTerm($term)) { + $data_provider = $patient_search->search($term); + foreach ($data_provider->getData() as $patient) { // check if the patient is already in the Request List $warning = ''; - $isInList = $this->isPatientInRequestList($patient->id); - if ($isInList) { - $warning = "This patient is already requested for merge as $isInList patient."; + $is_in_list = $this->isPatientInRequestList($patient->id); + if ($is_in_list) { + $warning = "This patient is already requested for merge as $is_in_list patient."; } $result[] = array( diff --git a/protected/controllers/WorklistAdminController.php b/protected/controllers/WorklistAdminController.php index 3b04013302..d2fbe470ea 100644 --- a/protected/controllers/WorklistAdminController.php +++ b/protected/controllers/WorklistAdminController.php @@ -56,7 +56,6 @@ public function actionDefinitions() $this->render('//admin/worklists/definitions', array( 'definitions' => $definitions, - 'errors' => @$errors, )); } diff --git a/protected/migrations/m160928_073106_drop_medication_frequency_foreign_key.php b/protected/migrations/m160928_073106_drop_medication_frequency_foreign_key.php new file mode 100644 index 0000000000..98d8175bdd --- /dev/null +++ b/protected/migrations/m160928_073106_drop_medication_frequency_foreign_key.php @@ -0,0 +1,18 @@ +alterColumn('medication', 'frequency_id', 'int(10) unsigned DEFAULT NULL'); + } + + public function down() + { + $this->alterColumn('medication', 'frequency_id', 'int(10) unsigned NOT NULL'); + } + +} \ No newline at end of file diff --git a/protected/migrations/m161026_135722_remove_patient_merge_unique_audit_action.php b/protected/migrations/m161026_135722_remove_patient_merge_unique_audit_action.php new file mode 100644 index 0000000000..52ff7356bb --- /dev/null +++ b/protected/migrations/m161026_135722_remove_patient_merge_unique_audit_action.php @@ -0,0 +1,42 @@ +dbConnection->createCommand('SELECT id FROM audit_action WHERE name = "Patient Merge Request successfully done."')->queryScalar(); + + /* get all actions we want to delete from audit_action */ + $audit_actions = $this->dbConnection->createCommand('SELECT id FROM audit_action WHERE name LIKE "%(hos_num) successfully done.%"')->queryAll(); + + /* check if there is anything to remove, if not we just return */ + if(!$audit_actions){ + return true; + } + + /* Insert the action if there is not in the DB */ + if(!$audit_action_id){ + $this->insert('audit_action', array('name' => 'Patient Merge Request successfully done.')); + } + + //get the action id we want to us + $audit_action_id = $this->dbConnection->createCommand('SELECT id FROM audit_action WHERE name = "Patient Merge Request successfully done."')->queryScalar(); + + $action_ids = array(); + if($audit_actions){ + foreach($audit_actions as $action){ + $action_ids[] = $action['id']; + } + } + + /* update the audit table to set the new action id and remove the reference to unwanted actions */ + $this->update('audit', array('action_id' => $audit_action_id), 'action_id IN (' . (implode(',',$action_ids)) . ')'); + $this->delete('audit_action', 'id IN (' . (implode(',',$action_ids)) . ')'); + + } + + public function down() + { + } +} \ No newline at end of file diff --git a/protected/migrations/m161222_161414_docman_log.php b/protected/migrations/m161222_161414_docman_log.php new file mode 100644 index 0000000000..2d9f1775a8 --- /dev/null +++ b/protected/migrations/m161222_161414_docman_log.php @@ -0,0 +1,21 @@ +createOETable('document_log', array( + 'id' => 'pk', + 'hos_num' => 'varchar(40)', + 'clinician_name' => 'varchar(256)', + 'event_updated' => 'datetime', + 'event_date' => 'datetime', + 'output_date' => 'datetime', + )); + } + + public function down() + { + $this->dropOETable('document_log'); + } +} \ No newline at end of file diff --git a/protected/migrations/m170110_152227_remove_migration_route_fk.php b/protected/migrations/m170110_152227_remove_migration_route_fk.php new file mode 100644 index 0000000000..fc9e18af6e --- /dev/null +++ b/protected/migrations/m170110_152227_remove_migration_route_fk.php @@ -0,0 +1,24 @@ +alterColumn('medication', 'route_id', 'int(10) unsigned DEFAULT NULL'); + } + + public function down() + { + $this->alterColumn('medication', 'route_id', 'int(10) unsigned NOT NULL'); + } + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/protected/migrations/m170124_151953_update_shortcodes.php b/protected/migrations/m170124_151953_update_shortcodes.php new file mode 100644 index 0000000000..517ca95088 --- /dev/null +++ b/protected/migrations/m170124_151953_update_shortcodes.php @@ -0,0 +1,33 @@ +update('patient_shortcode', array('description'=>'Patient as object (him/her)'), 'default_code="obj"'); + $this->update('patient_shortcode', array('description'=>'Patient possessive (his/hers)'), 'default_code="pos"'); + $this->update('patient_shortcode', array('description'=>'Patient as subject (man/woman)'), 'default_code="sub"'); + $this->update('patient_shortcode', array('description'=>'Patient pronoun (he/she)'), 'default_code="pro"'); + $this->update('patient_shortcode', array('description'=>'Patient Unique Code for portal'), 'default_code="puc"'); + } + + public function down() + { + $this->update('patient_shortcode', array('description'=>'Patient as object'), 'default_code="obj"'); + $this->update('patient_shortcode', array('description'=>'Patient possessive'), 'default_code="pos"'); + $this->update('patient_shortcode', array('description'=>'Patient as subject'), 'default_code="sub"'); + $this->update('patient_shortcode', array('description'=>'Patient pronoun'), 'default_code="pro"'); + $this->update('patient_shortcode', array('description'=>'Patient Unique Code'), 'default_code="puc"'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/protected/migrations/m170124_153056_add_new_correspondence_shortcodes.php b/protected/migrations/m170124_153056_add_new_correspondence_shortcodes.php new file mode 100644 index 0000000000..495b594dda --- /dev/null +++ b/protected/migrations/m170124_153056_add_new_correspondence_shortcodes.php @@ -0,0 +1,139 @@ +dbConnection->createCommand() + ->select('id')->from('event_type') + ->where('name = "Correspondence"')->queryAll(); + $event_type_id = $data[0]['id']; + + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'pna', + 'code' => 'pna', + 'method' => 'getFullName', + 'description' => 'Get Full Patient Name', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'pnt', + 'code' => 'pnt', + 'method' => 'getPatientTitle', + 'description' => 'Get Patient Title', + 'last_modified_user_id' => '1', + )); + + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'pnf', + 'code' => 'pnf', + 'method' => 'getFirstName', + 'description' => 'Get Patient First Name', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'pnl', + 'code' => 'pnl', + 'method' => 'getLastName', + 'description' => 'Get Patient Last Name', + 'last_modified_user_id' => '1', + )); + + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'eld', + 'code' => 'eld', + 'method' => 'getLastExaminationDate', + 'description' => 'Get Date of Last Examination Date', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'aod', + 'code' => 'aod', + 'method' => 'getOphthalmicDiagnoses', + 'description' => 'List of Ophthalmic Diagnoses', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'ilt', + 'code' => 'ilt', + 'method' => 'getLastIOLType', + 'description' => 'IOL type from last cataract Operation Note', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'ilp', + 'code' => 'ilp', + 'method' => 'getLastIOLPower', + 'description' => 'IOL Power from last cataract operation note', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'loe', + 'code' => 'loe', + 'method' => 'getLastOperatedEye', + 'description' => 'Operated Eye (left/right) from last operation note', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'pov', + 'code' => 'pov', + 'method' => 'getPreOpVABothEyes', + 'description' => 'Pre-Op Visual Acuity - both eyes', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'por', + 'code' => 'por', + 'method' => 'getPreOpRefraction', + 'description' => 'Pre-Op Refraction - both eyes', + 'last_modified_user_id' => '1', + )); + $this->insert('patient_shortcode', array( + 'event_type_id' => $event_type_id, + 'default_code' => 'alg', + 'code' => 'alg', + 'method' => 'getAllergiesBulleted', + 'description' => 'List all patients assigned allergies', + 'last_modified_user_id' => '1', + )); + } + + public function down() + { + $this->delete('patient_shortcode', '`default_code`="pna"'); + $this->delete('patient_shortcode', '`default_code`="pnt"'); + $this->delete('patient_shortcode', '`default_code`="pnf"'); + $this->delete('patient_shortcode', '`default_code`="pnl"'); + $this->delete('patient_shortcode', '`default_code`="ilp"'); + $this->delete('patient_shortcode', '`default_code`="ilt"'); + $this->delete('patient_shortcode', '`default_code`="aod"'); + $this->delete('patient_shortcode', '`default_code`="eld"'); + $this->delete('patient_shortcode', '`default_code`="loe"'); + $this->delete('patient_shortcode', '`default_code`="pov"'); + $this->delete('patient_shortcode', '`default_code`="por"'); + $this->delete('patient_shortcode', '`default_code`="alg"'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/protected/migrations/m170126_161056_docmandb_changes.php b/protected/migrations/m170126_161056_docmandb_changes.php new file mode 100644 index 0000000000..6d5b98e79c --- /dev/null +++ b/protected/migrations/m170126_161056_docmandb_changes.php @@ -0,0 +1,25 @@ +renameColumn('document_log', 'event_date', 'letter_created_date' ); + $this->renameColumn('document_log', 'event_updated', 'letter_finalised_date' ); + $this->renameColumn('document_log', 'output_date', 'letter_sent_date' ); + // Add new column + $this->addColumn('document_log', 'last_significant_event_date', 'DATETIME'); + } + + + public function down() + { + $this->renameColumn('document_log', 'letter_created_date', 'event_date' ); + $this->renameColumn('document_log', 'letter_finalised_date', 'event_updated' ); + $this->renameColumn('document_log', 'letter_sent_date', 'output_date' ); + // Add new column + $this->dropColumn('document_log', 'last_significant_event_date'); + } + +} \ No newline at end of file diff --git a/protected/migrations/m170201_114016_add_letter_type_to_document_log.php b/protected/migrations/m170201_114016_add_letter_type_to_document_log.php new file mode 100644 index 0000000000..e27bb592d5 --- /dev/null +++ b/protected/migrations/m170201_114016_add_letter_type_to_document_log.php @@ -0,0 +1,66 @@ +createOETable('ophcocorrespondence_letter_type', array( + 'id' => 'pk', + 'name' => 'varchar(40)' + )); + + $this->insert('ophcocorrespondence_letter_type', array( 'id' => 1, 'name' => 'Clinic discharge letter')); + $this->insert('ophcocorrespondence_letter_type', array( 'id' => 2, 'name' => 'Post-op letter')); + $this->insert('ophcocorrespondence_letter_type', array( 'id' => 3, 'name' => 'Clinic letter')); + $this->insert('ophcocorrespondence_letter_type', array( 'id' => 4, 'name' => 'Other letter')); + + $this->addColumn('document_log', 'letter_type', 'VARCHAR(40) DEFAULT NULL AFTER clinician_name'); + + //letter type is not mandatory + $this->alterColumn('et_ophcocorrespondence_letter', 'letter_type', 'int(1) DEFAULT NULL'); + $this->alterColumn('et_ophcocorrespondence_letter_version', 'letter_type', 'int(1) DEFAULT NULL'); + $this->alterColumn('ophcocorrespondence_letter_macro', 'letter_type', 'int(1) DEFAULT NULL'); + $this->alterColumn('ophcocorrespondence_letter_macro_version', 'letter_type', 'int(1) DEFAULT NULL'); + + //set back letter_type to NULL + $this->update('et_ophcocorrespondence_letter', array('letter_type' => null), 'letter_type=0'); + $this->update('et_ophcocorrespondence_letter_version', array('letter_type' => null), 'letter_type=0'); + $this->update('ophcocorrespondence_letter_macro', array('letter_type' => null), 'letter_type=0'); + $this->update('ophcocorrespondence_letter_macro_version', array('letter_type' => null), 'letter_type=0'); + + $this->renameColumn('et_ophcocorrespondence_letter', 'letter_type', 'letter_type_id'); + $this->renameColumn('et_ophcocorrespondence_letter_version', 'letter_type', 'letter_type_id'); + + $this->renameColumn('ophcocorrespondence_letter_macro', 'letter_type', 'letter_type_id'); + $this->renameColumn('ophcocorrespondence_letter_macro_version', 'letter_type', 'letter_type_id'); + + $this->addForeignKey('et_ophcocorrespondence_letter_ibfk_1', 'et_ophcocorrespondence_letter', 'letter_type_id', 'ophcocorrespondence_letter_type', 'id'); + $this->addForeignKey('ophcocorrespondence_letter_macro_ibfk_1', 'ophcocorrespondence_letter_macro', 'letter_type_id', 'ophcocorrespondence_letter_type', 'id'); + } + + public function safeDown() + { + $this->dropForeignKey('et_ophcocorrespondence_letter_ibfk_1', 'et_ophcocorrespondence_letter'); + $this->dropForeignKey('ophcocorrespondence_letter_macro_ibfk_1', 'ophcocorrespondence_letter_macro'); + + $this->dropOETable('ophcocorrespondence_letter_type'); + $this->dropColumn('document_log', 'letter_type'); + + $this->update('et_ophcocorrespondence_letter', array('letter_type_id' => 0), 'letter_type_id IS NULL'); + $this->update('et_ophcocorrespondence_letter_version', array('letter_type_id' => 0), 'letter_type_id IS NULL'); + $this->update('ophcocorrespondence_letter_macro', array('letter_type_id' => 0), 'letter_type_id IS NULL'); + $this->update('ophcocorrespondence_letter_macro_version', array('letter_type_id' => 0), 'letter_type_id IS NULL'); + + $this->alterColumn('et_ophcocorrespondence_letter', 'letter_type_id', 'int(1) NOT NULL DEFAULT 0'); + $this->alterColumn('et_ophcocorrespondence_letter_version', 'letter_type_id', 'int(1) NOT NULL DEFAULT 0'); + $this->alterColumn('ophcocorrespondence_letter_macro', 'letter_type_id', 'int(1) NOT NULL DEFAULT 0'); + $this->alterColumn('ophcocorrespondence_letter_macro_version', 'letter_type_id', 'int(1) NOT NULL DEFAULT 0'); + + $this->renameColumn('et_ophcocorrespondence_letter', 'letter_type_id', 'letter_type'); + $this->renameColumn('et_ophcocorrespondence_letter_version', 'letter_type_id', 'letter_type'); + + $this->renameColumn('ophcocorrespondence_letter_macro', 'letter_type_id', 'letter_type'); + $this->renameColumn('ophcocorrespondence_letter_macro_version', 'letter_type_id', 'letter_type'); + + } +} \ No newline at end of file diff --git a/protected/models/BaseEventTypeElement.php b/protected/models/BaseEventTypeElement.php index f22ef2dc45..afe1541227 100644 --- a/protected/models/BaseEventTypeElement.php +++ b/protected/models/BaseEventTypeElement.php @@ -353,8 +353,8 @@ public function getFrontEndErrors() public function requiredIfSide($attribute, $params) { - if (($params['side'] == 'left' && $this->eye_id != 2) || ($params['side'] == 'right' && $this->eye_id != 1)) { - if ($this->$attribute == null) { + if (($params['side'] === 'left' && $this->eye_id != 2) || ($params['side'] === 'right' && $this->eye_id != 1)) { + if ($this->$attribute !== 0 && $this->$attribute == null) { if (!@$params['message']) { $params['message'] = ucfirst($params['side']).' {attribute} cannot be blank.'; } diff --git a/protected/models/Document.php b/protected/models/Document.php index 1f34f6f3a0..018ad20b35 100644 --- a/protected/models/Document.php +++ b/protected/models/Document.php @@ -178,15 +178,6 @@ public function getMacros() } - - // Need new document version. - // This will: - // Copy the current _version record to a new version number - - public function updateDocument($macroId, $eventId, $target, $outputs, $data = null) - { - } - /** * Dispatches all the documents associated with this DocSet, that have not already been sent. */ @@ -300,9 +291,11 @@ public function createNewDocSet() if (isset($document_output['id'])) { $data['id'] = $document_output['id']; } - + if( $this->is_draft && $data['output_type'] == 'Docman' ){ $data['output_status'] = "DRAFT"; + } else if($this->is_draft == 0 && $data['output_type'] == 'Docman'){ + $data['output_status'] = "PENDING"; } $this->createNewDocOutput($doc_target, $doc_instance_version, $data); @@ -346,10 +339,7 @@ public function createNewDocOutput($doc_target, $doc_instance_version, $data) $doc_output->document_instance_data_id = $doc_instance_version->id; $doc_output->output_type = $data['output_type']; $doc_output->requestor_id = 'OE'; - if ( isset($_POST['saveprint']) ){ - $doc_output->output_status = "PENDING"; - } - + if( isset($data['output_status']) && $doc_output->output_type != "COMPLETE"){ $doc_output->output_status = $data['output_status']; } diff --git a/protected/models/DocumentDispatchClass.php b/protected/models/DocumentDispatchClass.php deleted file mode 100644 index d823abc1c3..0000000000 --- a/protected/models/DocumentDispatchClass.php +++ /dev/null @@ -1,33 +0,0 @@ -. - * - * @package OpenEyes - * @link http://www.openeyes.org.uk - * Written by Antony Penn - * - * This is the main API end point for the document management functions. - */ - -class DocumentDispatchClass -{ - public $obj; - - public function __construct($obj) - { - $this->obj = $obj; - } - - - public function send() - { - // TODO - } -} diff --git a/protected/models/DocumentDispatchDocMan.php b/protected/models/DocumentDispatchDocMan.php deleted file mode 100644 index 38d59cf1b6..0000000000 --- a/protected/models/DocumentDispatchDocMan.php +++ /dev/null @@ -1,29 +0,0 @@ -. - * - * @package OpenEyes - * @link http://www.openeyes.org.uk - * Written by Antony Penn - * - * This is the main API end point for the document management functions. - */ - -class DocumentDispatchDocMan extends DocumentDispatchClass -{ - public function send() - { - // TODO: Copy guts from previous docman code - // Pull the directory info from the system config documentInstance->docman - // Copy this object's binary to the right location - // Create META file and copy that to correct location - // DocumentInstance::updateStatus to write status (success/fail) of output - } -} diff --git a/protected/models/DocumentDispatchFile.php b/protected/models/DocumentDispatchFile.php deleted file mode 100644 index 43aa25f728..0000000000 --- a/protected/models/DocumentDispatchFile.php +++ /dev/null @@ -1,28 +0,0 @@ -. - * - * @package OpenEyes - * @link http://www.openeyes.org.uk - * Written by Antony Penn - * - * This is the main API end point for the document management functions. - */ - -class DocumentDispatchFile extends DocumentDispatchClass -{ - public function send() - { - // TODO: - // Pull the directory info from the system config documentInstance->file - // Copy this object's binary to the right location - // DocumentInstance::updateStatus to write status (success/fail) of output - } -} diff --git a/protected/models/DocumentDispatchPrint.php b/protected/models/DocumentDispatchPrint.php deleted file mode 100644 index 61ba067c49..0000000000 --- a/protected/models/DocumentDispatchPrint.php +++ /dev/null @@ -1,27 +0,0 @@ -. - * - * @package OpenEyes - * @link http://www.openeyes.org.uk - * Written by Antony Penn - * - * This is the main API end point for the document management functions. - */ - -class DocumentDispatchPrint extends DocumentDispatchClass -{ - public function send() - { - // TODO: - // Copy the PDF data to a temp file - // Return the temp filename - } -} diff --git a/protected/models/DocumentInstance.php b/protected/models/DocumentInstance.php index b6a3aaf9b5..93162cf313 100644 --- a/protected/models/DocumentInstance.php +++ b/protected/models/DocumentInstance.php @@ -19,85 +19,87 @@ class DocumentInstance extends BaseActiveRecord { - /** - * Returns the static model of the specified AR class. - * @return Site the static model class - */ - public static function model($className=__CLASS__) - { - return parent::model($className); - } + /** + * Returns the static model of the specified AR class. + * + * @return Site the static model class + */ + public static function model($className = __CLASS__) + { + return parent::model($className); + } - /** - * @return string the associated database table name - */ - public function tableName() - { - return 'document_instance'; - } + /** + * @return string the associated database table name + */ + public function tableName() + { + return 'document_instance'; + } - public function behaviors() - { - return array( - 'LookupTable' => 'LookupTable', - ); - } + public function behaviors() + { + return array( + 'LookupTable' => 'LookupTable', + ); + } - /** - * @return array validation rules for model attributes. - */ - public function rules() - { - // NOTE: you should only define rules for those attributes that - // will receive user inputs. - return array( - array('document_set_id, correspondence_event_id', 'safe'), - // The following rule is used by search(). - // Please remove those attributes that should not be searched. - array('document_set_id, correspondence_event_id', 'safe', 'on' => 'search'), - ); - } + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + // NOTE: you should only define rules for those attributes that + // will receive user inputs. + return array( + array('document_set_id, correspondence_event_id', 'safe'), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('document_set_id, correspondence_event_id', 'safe', 'on' => 'search'), + ); + } - /** - * @return array relational rules. - */ - public function relations() - { - return array( - 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), - 'document_set' => array(self::BELONGS_TO, 'DocumentSet', 'document_set_id'), - 'correspondence_event' => array(self::BELONGS_TO, 'Event', 'correspondence_event_id'), - 'document_instance_data' => array(self::HAS_MANY, 'DocumentInstanceData', 'document_instance_id'), - 'document_target' => array(self::HAS_MANY, 'DocumentTarget', 'document_instance_id'), - 'event' => array(self::BELONGS_TO, 'Event', 'event_id'), - ); - } + /** + * @return array relational rules. + */ + public function relations() + { + return array( + 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), + 'document_set' => array(self::BELONGS_TO, 'DocumentSet', 'document_set_id'), + 'correspondence_event' => array(self::BELONGS_TO, 'Event', 'correspondence_event_id'), + 'document_instance_data' => array(self::HAS_MANY, 'DocumentInstanceData', 'document_instance_id'), + 'document_target' => array(self::HAS_MANY, 'DocumentTarget', 'document_instance_id'), + 'event' => array(self::BELONGS_TO, 'Event', 'event_id'), + ); + } - /** - * @return array customized attribute labels (name=>label) - */ - public function attributeLabels() - { - } + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + } - public function dispatch() - { - switch ($this->dispatchType) { - case 'PRINT': - $dispatchObj = new DocumentDispatchPrint($this); - break; - case 'DOCMAN': - $dispatchObj = new DocumentDispatchDocMan($this); - break; - case 'FILE': - $dispatchObj = new DocumentDispatchFile($this); - break; - } + public function dispatch() + { + switch ($this->dispatchType) { + case 'PRINT': + $dispatchObj = new DocumentDispatchPrint($this); + break; + case 'DOCMAN': + $dispatchObj = new DocumentDispatchDocMan($this); + break; + case 'FILE': + $dispatchObj = new DocumentDispatchFile($this); + break; + } - if ($dispatchObj) { - $tempname = $dispatchObj->send(); - return $tempname; // PRINT dispatch types return the temp filename that was created - } - } + if ($dispatchObj) { + $tempname = $dispatchObj->send(); + + return $tempname; // PRINT dispatch types return the temp filename that was created + } + } } diff --git a/protected/models/DocumentInstanceData.php b/protected/models/DocumentInstanceData.php index ef72e000ae..b76b7da0a5 100644 --- a/protected/models/DocumentInstanceData.php +++ b/protected/models/DocumentInstanceData.php @@ -1,4 +1,5 @@ 'LookupTable', - ); - } + public function behaviors() + { + return array( + 'LookupTable' => 'LookupTable', + ); + } - /** - * @return array validation rules for model attributes. - */ - public function rules() - { - return array( - array('document_instance_id, macro_id', 'safe'), - // The following rule is used by search(). - // Please remove those attributes that should not be searched. - array('document_instance_id, macro_id', 'safe', 'on' => 'search'), - ); - } + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + return array( + array('document_instance_id, macro_id', 'safe'), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('document_instance_id, macro_id', 'safe', 'on' => 'search'), + ); + } - /** - * @return array relational rules. - */ - public function relations() - { - return array( - 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), - 'document_instance' => array(self::BELONGS_TO, 'DocumentInstance', 'document_instance_id'), - 'macro' => array(self::BELONGS_TO, 'LetterMacro', 'macro_id'), + /** + * @return array relational rules. + */ + public function relations() + { + return array( + 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), + 'document_instance' => array(self::BELONGS_TO, 'DocumentInstance', 'document_instance_id'), + 'macro' => array(self::BELONGS_TO, 'LetterMacro', 'macro_id'), - ); - } + ); + } - /** - * @return array customized attribute labels (name=>label) - */ - public function attributeLabels() - { - } + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + } } diff --git a/protected/models/DocumentLog.php b/protected/models/DocumentLog.php new file mode 100644 index 0000000000..a6f9bc5fda --- /dev/null +++ b/protected/models/DocumentLog.php @@ -0,0 +1,82 @@ +. + * + * @link http://www.openeyes.org.uk + * + * @author OpenEyes + * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust + * @copyright Copyright (c) 2011-2013, OpenEyes Foundation + * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 + */ + +/** + * This is the model class for table "document_log". + * + * The followings are the available columns in table 'document_log': + * + * @property int $id + * + * The followings are the available model relations: + */ +class DocumentLog extends BaseActiveRecordVersioned +{ + /** + * Returns the static model of the specified AR class. + * + * @return DocumentLog the static model class + */ + public static function model($className = __CLASS__) + { + return parent::model($className); + } + + /** + * @return string the associated database table name + */ + public function tableName() + { + return 'document_log'; + } + + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + // NOTE: you should only define rules for those attributes that + // will receive user inputs. + return array( + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, hos_num, clinician_name, letter_finalised_date, letter_created_date, letter_sent_date, last_significant_event_date, letter_type', 'safe'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + ); + } +} diff --git a/protected/models/DocumentOutput.php b/protected/models/DocumentOutput.php index 5fb6cb14de..9a5448d1d4 100644 --- a/protected/models/DocumentOutput.php +++ b/protected/models/DocumentOutput.php @@ -1,4 +1,5 @@ array(self::BELONGS_TO, 'User', 'created_user_id'), + 'document_target' => array(self::BELONGS_TO, 'DocumentTarget', 'document_target_id'), + 'document_instance_data' => array(self::BELONGS_TO, 'DocumentInstanceData', 'document_instance_data_id'), - /** - * @return string the associated database table name - */ - public function tableName() - { - return 'document_output'; - } + ); + } - /** - * @return array relational rules. - */ - public function relations() - { - return array( - 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), - 'document_target' => array(self::BELONGS_TO, 'DocumentTarget', 'document_target_id'), - 'document_instance_data' => array(self::BELONGS_TO, 'DocumentInstanceData', 'document_instance_data_id'), + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + return array( + array('document_target_id, ToCc, output_type, output_status, document_instance_version_id, requestor_id, request_datetime, success_datetime', 'safe'), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('document_target_id, ToCc, output_type, output_status, document_instance_version_id, requestor_id, request_datetime, success_datetime', 'safe', 'on' => 'search'), + ); + } - ); - } - /** - * @return array validation rules for model attributes. - */ - public function rules() - { - return array( - array('document_target_id, ToCc, output_type, output_status, document_instance_version_id, requestor_id, request_datetime, success_datetime', 'safe'), - // The following rule is used by search(). - // Please remove those attributes that should not be searched. - array('document_target_id, ToCc, output_type, output_status, document_instance_version_id, requestor_id, request_datetime, success_datetime', 'safe', 'on' => 'search'), - ); - } + public function getLongListForCurrentInstitution() + { + $institution = Institution::model()->getCurrent(); + $site = $this->findByAttributes(array('code' => Yii::app()->params['default_site_code'])); + $site = Site::model()->findByPk(Yii::app()->session['selected_site_id']); + } - public function getLongListForCurrentInstitution() - { - $institution = Institution::model()->getCurrent(); - $site = $this->findByAttributes(array('code' => Yii::app()->params['default_site_code'])); - $site = Site::model()->findByPk(Yii::app()->session['selected_site_id']); - } + public function createSet($eventId) + { + $ds = new DocumentSet; + $ds->event_id = $eventId; + $ds->save(); - public function createSet($eventId) - { - $ds = new DocumentSet; - $ds->event_id = $eventId; - $ds->save(); - return ($ds->id); - } + return ($ds->id); + } } diff --git a/protected/models/DocumentSet.php b/protected/models/DocumentSet.php index c79c9fa615..6c25f50a1a 100644 --- a/protected/models/DocumentSet.php +++ b/protected/models/DocumentSet.php @@ -19,85 +19,66 @@ class DocumentSet extends BaseActiveRecord { - /** - * Returns the static model of the specified AR class. - * @return Site the static model class - */ - public static function model($className=__CLASS__) - { - return parent::model($className); - } + /** + * Returns the static model of the specified AR class. + * + * @return Site the static model class + */ + public static function model($className = __CLASS__) + { + return parent::model($className); + } - /** - * @return string the associated database table name - */ - public function tableName() - { - return 'document_set'; - } + /** + * @return string the associated database table name + */ + public function tableName() + { + return 'document_set'; + } - public function behaviors() - { - return array(); - } + public function behaviors() + { + return array(); + } - /** - * @return array validation rules for model attributes. - */ - public function rules() - { - // NOTE: you should only define rules for those attributes that - // will receive user inputs. - return array( - array('event_id', 'safe'), - // The following rule is used by search(). - // Please remove those attributes that should not be searched. - array('id, event_id', 'safe', 'on' => 'search'), - ); - } + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + // NOTE: you should only define rules for those attributes that + // will receive user inputs. + return array( + array('event_id', 'safe'), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, event_id', 'safe', 'on' => 'search'), + ); + } - /** - * @return array relational rules. - */ - public function relations() - { - return array( - 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), - 'event' => array(self::BELONGS_TO, 'Event', 'event_id'), - 'document_instance' => array(self::HAS_MANY, 'DocumentInstance', 'document_set_id'), - ); - } + /** + * @return array relational rules. + */ + public function relations() + { + return array( + 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), + 'event' => array(self::BELONGS_TO, 'Event', 'event_id'), + 'document_instance' => array(self::HAS_MANY, 'DocumentInstance', 'document_set_id'), + ); + } - /** - * @return array customized attribute labels (name=>label) - */ - public function attributeLabels() - { - } - - - public function createNew($eventId) - { - $ds = new DocumentSet; - $ds->event_id = $eventId; - $ds->save(); - return ($ds->id); - } - - // If AUTO, pre-calculates template - // If MANUAL, takes body text from data[] arrary - public function addDocument($autoManual, $macroId, $eventId, $target, $outputs, $data=null) - { - } - - - // Need new document version. - // This will: - // Copy the current _version record to a new version number - -// It will also incement - public function updateDocument($macroId, $eventId, $target, $outputs, $data=null) - { - } + /** + * @param $eventId + * @return mixed + */ + public function createNew($eventId) + { + $documentSet = new DocumentSet(); + $documentSet->event_id = $eventId; + $documentSet->save(); + return ($documentSet->id); + } } diff --git a/protected/models/DocumentTarget.php b/protected/models/DocumentTarget.php index 1626987f9d..bcd5bcbd1d 100644 --- a/protected/models/DocumentTarget.php +++ b/protected/models/DocumentTarget.php @@ -19,59 +19,60 @@ class DocumentTarget extends BaseActiveRecord { - /** - * Returns the static model of the specified AR class. - * @return Site the static model class - */ - public static function model($className=__CLASS__) - { - return parent::model($className); - } + /** + * Returns the static model of the specified AR class. + * + * @return Site the static model class + */ + public static function model($className = __CLASS__) + { + return parent::model($className); + } - /** - * @return string the associated database table name - */ - public function tableName() - { - return 'document_target'; - } + /** + * @return string the associated database table name + */ + public function tableName() + { + return 'document_target'; + } - public function behaviors() - { - return array(); - } + public function behaviors() + { + return array(); + } - /** - * @return array validation rules for model attributes. - */ - public function rules() - { - return array( - array('document_instance_id, contact_type, contact_id, contact_name, contact_modified, address, emailemail, ToCc', 'safe'), - // The following rule is used by search(). - // Please remove those attributes that should not be searched. - array('document_instance_id, contact_type, contact_id, contact_name, contact_modified, address, emailemail', 'safe', 'on' => 'search'), - ); - } + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + return array( + array('document_instance_id, contact_type, contact_id, contact_name, contact_modified, address, emailemail, ToCc', 'safe'), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('document_instance_id, contact_type, contact_id, contact_name, contact_modified, address, emailemail', 'safe', 'on' => 'search'), + ); + } - /** - * @return array relational rules. - */ - public function relations() - { - return array( - 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), - 'document_instance' => array(self::BELONGS_TO, 'DocumentInstance', 'document_instance_id'), - 'contact' => array(self::BELONGS_TO, 'Contact', 'contact_id'), - 'document_output' => array(self::HAS_MANY, 'DocumentOutput', 'document_target_id'), - ); - } + /** + * @return array relational rules. + */ + public function relations() + { + return array( + 'created_user' => array(self::BELONGS_TO, 'User', 'created_user_id'), + 'document_instance' => array(self::BELONGS_TO, 'DocumentInstance', 'document_instance_id'), + 'contact' => array(self::BELONGS_TO, 'Contact', 'contact_id'), + 'document_output' => array(self::HAS_MANY, 'DocumentOutput', 'document_target_id'), + ); + } - /** - * @return array customized attribute labels (name=>label) - */ - public function attributeLabels() - { - return array(); - } + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array(); + } } diff --git a/protected/models/EventType.php b/protected/models/EventType.php index d7ffe5e4f3..ed40676e0f 100644 --- a/protected/models/EventType.php +++ b/protected/models/EventType.php @@ -342,6 +342,11 @@ public function getAllElementTypes() $criteria->addInCondition('event_type_id', $ids); $criteria->order = 'display_order asc'; + if(Yii::app()->params['clinical_management_pcr']){ + $criteria->addCondition('class_name <> :class'); + $criteria->params['class'] = 'OEModule\\OphCiExamination\\models\\Element_OphCiExamination_PcrRisk'; + } + return ElementType::model()->findAll($criteria); } } diff --git a/protected/models/Medication.php b/protected/models/Medication.php index abeb531d5e..7cf41c468d 100644 --- a/protected/models/Medication.php +++ b/protected/models/Medication.php @@ -48,9 +48,14 @@ public function tableName() */ public function rules() { + $required_fields = 'start_date'; + if (!isset(Yii::app()->params['enable_concise_med_history']) || !Yii::app()->params['enable_concise_med_history']) + { + $required_fields .= ', frequency_id, route_id'; + } return array( array('medication_drug_id, drug_id, route_id, option_id, dose, frequency_id, start_date, end_date, stop_reason_id, prescription_item_id', 'safe'), - array('route_id, frequency_id, start_date', 'required'), + array($required_fields, 'required'), array('start_date', 'OEFuzzyDateValidatorNotFuture'), array('end_date', 'OEFuzzyDateValidator'), array('option_id', 'validateOptionId'), diff --git a/protected/models/Patient.php b/protected/models/Patient.php index 1d797f58e4..e3c22d0717 100644 --- a/protected/models/Patient.php +++ b/protected/models/Patient.php @@ -211,7 +211,6 @@ public function search($params = array()) { $params += array( 'pageSize' => 20, - 'currentPage' => 0, 'sortBy' => 'hos_num*1', 'sortDir' => 'asc', ); @@ -238,7 +237,7 @@ public function search($params = array()) $dataProvider = new CActiveDataProvider(get_class($this), array( 'criteria' => $criteria, - 'pagination' => array('pageSize' => $params['pageSize'], 'currentPage' => $params['currentPage']), + 'pagination' => array('pageSize' => $params['pageSize']), )); return $dataProvider; @@ -1038,6 +1037,22 @@ public function hasRisk($riskCompare) return false; } + /** + * @param $riskCompare + * + * @return Risk|null + */ + public function getAssignedRisk($riskCompare) + { + foreach ($this->riskAssignments as $riskAssignment) { + if ($riskAssignment->risk->name === $riskCompare) { + return $riskAssignment; + } + } + + return null; + } + /** * marks the patient as having no family history. * diff --git a/protected/models/SiteSubspecialtyOperativeDevice.php b/protected/models/SiteSubspecialtyOperativeDevice.php index 4809ce62ec..174dde0515 100644 --- a/protected/models/SiteSubspecialtyOperativeDevice.php +++ b/protected/models/SiteSubspecialtyOperativeDevice.php @@ -62,6 +62,11 @@ public function rules() */ public function relations() { - return array(); + return array( + 'sites' => array(self::BELONGS_TO, 'Site', 'site_id'), + 'subspecialties' => array(self::BELONGS_TO, 'Subspecialty', 'subspecialty_id'), + 'devices' => array(self::BELONGS_TO, 'OperativeDevice', 'operative_device_id'), + ); } + } diff --git a/protected/models/UniqueCodes.php b/protected/models/UniqueCodes.php index c240c416f9..9b75636147 100644 --- a/protected/models/UniqueCodes.php +++ b/protected/models/UniqueCodes.php @@ -131,18 +131,33 @@ public function eventFromUniqueCode($code) return Event::model()->findByPk($eventId['id']); } + /** + * @param $code + * @return mixed + */ public function examinationEventCheckFromUniqueCode($code) { - return $this->dbConnection->createCommand() - ->select('count(*) as count, automatic_examination_event_log.*') + $logs = $this->dbConnection->createCommand() + ->select('automatic_examination_event_log.*') ->from('automatic_examination_event_log') - ->join('event', 'event.id = automatic_examination_event_log.event_id and event.deleted !=1') + ->join('event', 'event.id = automatic_examination_event_log.event_id and event.deleted <> 1') ->join('import_status', 'import_status.id = automatic_examination_event_log.import_success') ->where('unique_code = ? ', array($code)) ->andWhere('import_status.status_value <> "Import Failure"') - ->queryRow(); + ->order('created_date ASC') + ->queryAll(); + + $count = count($logs); + $log = array_pop($logs); + $log['count'] = $count; + + return $log; } + /** + * @param $code + * @return mixed + */ public function getEpisodeIdFromCode($code) { $episodeId = $this->dbConnection->createCommand() @@ -155,6 +170,11 @@ public function getEpisodeIdFromCode($code) return $episodeId; } + /** + * @param $episode_id + * @param $event_type_id + * @return mixed + */ public function getEventFromEpisode($episode_id, $event_type_id) { $event_id = $this->dbConnection->createCommand() diff --git a/protected/models/User.php b/protected/models/User.php index 0e0e4d11ed..806d6a0557 100644 --- a/protected/models/User.php +++ b/protected/models/User.php @@ -22,15 +22,15 @@ * * The followings are the available columns in table 'User': * - * @property int $id + * @property int $id * @property string $username * @property string $first_name * @property string $last_name * @property string $email - * @property int $active + * @property int $active * @property string $password * @property string $salt - * @property int $global_firm_rights + * @property int $global_firm_rights */ class User extends BaseActiveRecordVersioned { @@ -439,10 +439,10 @@ public static function getSurgeons() /** * Perform an audit log for the user * - * @param $target - * @param $action - * @param null $data - * @param bool $log + * @param $target + * @param $action + * @param null $data + * @param bool $log * @param array $properties */ public function audit($target, $action, $data = null, $log = false, $properties = array()) @@ -598,17 +598,17 @@ public function saveRoles(array $roles) */ public function saveFirms(array $firms) { - if(!$this->global_firm_rights && count($firms) === 0){ + if (!$this->global_firm_rights && count($firms) === 0) { throw new FirmSaveException('When global firm rights are not set, a firm must be selected'); } $transaction = Yii::app()->db->beginTransaction(); FirmUserAssignment::model()->deleteAll('user_id = :user_id', array('user_id' => $this->id)); - foreach($firms as $firm){ + foreach ($firms as $firm) { $firmUserAssign = new FirmUserAssignment(); $firmUserAssign->user_id = $this->id; $firmUserAssign->firm_id = $firm; - if(!$firmUserAssign->insert()){ + if (!$firmUserAssign->insert()) { throw new CDbException('Unable to save firm assignment'); } } @@ -689,10 +689,14 @@ protected function decryptSignature($text, $key) if (Yii::app()->params['no_md5_verify']) { return $decrypt; } + return Helper::md5Verified($decrypt); } - + /** + * @param $uniqueCodeId + * @return string + */ public function generateUniqueCodeWithChecksum($uniqueCodeId) { $uniqueCode = UniqueCodes::model()->findByPk($uniqueCodeId)->code; @@ -704,6 +708,9 @@ public function generateUniqueCodeWithChecksum($uniqueCodeId) return $finalUniqueCode; } + /** + * @return mixed + */ protected function getUniqueCode() { $userUniqueCode = UniqueCodeMapping::model()->findByAttributes(array('user_id' => $this->id)); @@ -711,17 +718,23 @@ protected function getUniqueCode() return $userUniqueCode->unique_code_id; } + /** + * @param $signature_pin + * @return bool|string + */ public function getDecryptedSignature($signature_pin) { - if($signature_pin) - { - if($this->signature_file_id){ + if ($signature_pin) { + if ($this->signature_file_id) { $signature_file = ProtectedFile::model()->findByPk($this->signature_file_id); - $image_data = base64_decode($this->decryptSignature( - file_get_contents($signature_file->getPath()), - md5(md5($this->id).$this->generateUniqueCodeWithChecksum($this->getUniqueCode()).$signature_pin))); - if(strlen($image_data) > 100) - { + $image_data = base64_decode( + $this->decryptSignature( + file_get_contents($signature_file->getPath()), + md5(md5($this->id) . $this->generateUniqueCodeWithChecksum($this->getUniqueCode()) . $signature_pin) + ) + ); + + if (strlen($image_data) > 100) { return $image_data; } @@ -731,5 +744,4 @@ public function getDecryptedSignature($signature_pin) return false; } - } diff --git a/protected/models/WorklistDefinition.php b/protected/models/WorklistDefinition.php index 8d4b02a8e2..bd0718aa9c 100644 --- a/protected/models/WorklistDefinition.php +++ b/protected/models/WorklistDefinition.php @@ -22,19 +22,19 @@ * * The followings are the available columns in table: * - * @property int $id - * @property string $name - * @property string $rrule - * @property string $description - * @property string $worklist_name - * @property string $start_time - * @property string $end_time - * @property DateTime $active_from - * @property DateTime $active_until - * @property Worklist[] $worklists - * @property WorklistDefinitionMapping[] $mappings - * @property WorklistDefinitionMappingp[] $displayed_mappings - * @property WorklistDefinitionMappingp[] $hidden_mappings + * @property int $id + * @property string $name + * @property string $rrule + * @property string $description + * @property string $worklist_name + * @property string $start_time + * @property string $end_time + * @property DateTime $active_from + * @property DateTime $active_until + * @property Worklist[] $worklists + * @property WorklistDefinitionMapping[] $mappings + * @property WorklistDefinitionMappingp[] $displayed_mappings + * @property WorklistDefinitionMappingp[] $hidden_mappings * @property WorklistDefinitionDisplayContext[] $display_contexts */ class WorklistDefinition extends BaseActiveRecordVersioned @@ -54,7 +54,7 @@ public function tableName() */ public function defaultScope() { - return array('order' => $this->getTableAlias(true, false).'.display_order'); + return array('order' => $this->getTableAlias(true, false) . '.display_order'); } /** @@ -79,7 +79,7 @@ public function rules() 'allowEmpty' => true, 'allowCompareEmpty' => true, 'operator' => '<=', - 'message' => '{attribute} must be on or before {compareAttribute}' + 'message' => '{attribute} must be on or before {compareAttribute}', ), array('active_from', 'default', 'setOnEmpty' => true, 'value' => date("Y-m-d H:i:s", time())), array('active_until', 'default', 'setOnEmpty' => true, 'value' => null), @@ -90,7 +90,7 @@ public function rules() array( 'id, name, rrule, worklist_name, start_time, end_time, description, scheduled', 'safe', - 'on' => 'search' + 'on' => 'search', ), ); } @@ -110,15 +110,15 @@ public function relations() 'WorklistDefinitionMapping', 'worklist_definition_id', 'on' => 'display_order is NOT NULL', - 'order' => 'display_order ASC' + 'order' => 'display_order ASC', ), 'hidden_mappings' => array( self::HAS_MANY, 'WorklistDefinitionMapping', 'worklist_definition_id', - 'on' => 'display_order is NULL' + 'on' => 'display_order is NULL', ), - 'display_contexts' => array(self::HAS_MANY, 'WorklistDefinitionDisplayContext', 'worklist_definition_id') + 'display_contexts' => array(self::HAS_MANY, 'WorklistDefinitionDisplayContext', 'worklist_definition_id'), ); } @@ -190,7 +190,7 @@ public function validateRrule($attribute) $valid = false; } if (!$valid) { - $this->addError($attribute, $this->getAttributeLabel($attribute).' is not valid'); + $this->addError($attribute, $this->getAttributeLabel($attribute) . ' is not valid'); } } @@ -198,7 +198,7 @@ public function validateRrule($attribute) * Check whether the given key would be unique on the Definition * (optional id indicates the current mapping the key is from so it is not checked against itself). * - * @param $key + * @param $key * @param int $id * * @return bool @@ -251,11 +251,42 @@ public function getRruleHumanReadable() } $final_rrule = new RRule($rrule_str); + return $final_rrule->humanReadable(array( 'date_formatter' => function ($d) { return $d->format(Helper::NHS_DATE_FORMAT); - } + }, )); } } + + /** + * @return CDbDataReader|mixed|string + */ + public function getWorklistCount() + { + $sql = 'SELECT COUNT(id) FROM worklist where worklist_definition_id = ' . $this->id; + + return $this->getDbConnection()->createCommand($sql)->queryScalar(); + } + + /** + * @return CDbDataReader|mixed|string + */ + public function getMappingCount() + { + $sql = 'SELECT COUNT(id) FROM worklist_definition_mapping where worklist_definition_id = ' . $this->id; + + return $this->getDbConnection()->createCommand($sql)->queryScalar(); + } + + /** + * @return CDbDataReader|mixed|string + */ + public function getdisplayContextCount() + { + $sql = 'SELECT COUNT(id) FROM worklist_definition_display_context where worklist_definition_id = ' . $this->id; + + return $this->getDbConnection()->createCommand($sql)->queryScalar(); + } } diff --git a/protected/modules/OphCiExamination/assets/css/module.css b/protected/modules/OphCiExamination/assets/css/module.css index d54d6d0e64..4bd8c98776 100644 --- a/protected/modules/OphCiExamination/assets/css/module.css +++ b/protected/modules/OphCiExamination/assets/css/module.css @@ -22,19 +22,19 @@ } /* line 19, ../sass/components/_event.scss */ .event .event-content { - background-image: url('../img/watermark.png'); + background-image: url('../img/watermark.png?1460033156'); } /* line 21, ../sass/components/_event.scss */ .event .event-content.auto { - background-image: url('../img/watermark-auto.png'); + background-image: url('../img/watermark-auto.png?1471611444'); } /* line 25, ../sass/components/_event.scss */ .event .event-title { - background-image: url('../img/medium.png'); + background-image: url('../img/medium.png?1460033156'); } /* line 27, ../sass/components/_event.scss */ .event .event-title.auto { - background-image: url('../img/medium-auto.png'); + background-image: url('../img/medium-auto.png?1471611444'); } /* line 33, ../sass/components/_event.scss */ @@ -136,12 +136,40 @@ /* line 18, ../sass/components/elements/_current-management.scss */ .OEModule_OphCiExamination_models_Element_OphCiExamination_CurrentManagementPlan .past_iop { height: 28px; - background: url('../img/past_icon.png') no-repeat right top; + background: url('../img/past_icon.png?1460033156') no-repeat right top; +} + +/* line 1, ../sass/components/elements/_pcr.scss */ +.pcr-link { + font-size: 0.625rem; +} + +/* line 6, ../sass/components/elements/_pcr.scss */ +.pcr-risk-div label { + background-color: #f00; + padding: 5px; + text-align: center; +} +/* line 10, ../sass/components/elements/_pcr.scss */ +.pcr-risk-div label.red { + background-color: #f00; +} +/* line 13, ../sass/components/elements/_pcr.scss */ +.pcr-risk-div label.blue { + background-color: #00f; +} +/* line 16, ../sass/components/elements/_pcr.scss */ +.pcr-risk-div label.orange { + background-color: #ffa500; +} +/* line 19, ../sass/components/elements/_pcr.scss */ +.pcr-risk-div label.green { + background-color: #008000; } /* line 17, ../sass/components/_gonio-cross.scss */ .gonio-cross { - background: url('../img/cross.gif') no-repeat center center; + background: url('../img/cross.gif?1460033155') no-repeat center center; height: 110px; margin: 0 0 10px 0; position: relative; @@ -151,7 +179,7 @@ /* line 17, ../sass/components/_gonio-cross.scss */ .gonio-cross { -webkit-print-color-adjust: exact; - background: url('../img/cross.gif') no-repeat center center !important; + background: url('../img/cross.gif?1460033155') no-repeat center center !important; } } /* line 27, ../sass/components/_gonio-cross.scss */ diff --git a/protected/modules/OphCiExamination/assets/sass/components/_elements.scss b/protected/modules/OphCiExamination/assets/sass/components/_elements.scss index 8fd0e8413d..fe3e4a929e 100644 --- a/protected/modules/OphCiExamination/assets/sass/components/_elements.scss +++ b/protected/modules/OphCiExamination/assets/sass/components/_elements.scss @@ -25,3 +25,4 @@ @import "elements/visual-acuity"; @import "elements/comorbidities"; @import "elements/current-management"; +@import "elements/pcr"; diff --git a/protected/modules/OphCiExamination/assets/sass/components/elements/_pcr.scss b/protected/modules/OphCiExamination/assets/sass/components/elements/_pcr.scss new file mode 100644 index 0000000000..020002e7bf --- /dev/null +++ b/protected/modules/OphCiExamination/assets/sass/components/elements/_pcr.scss @@ -0,0 +1,23 @@ +.pcr-link { + font-size: rem-calc(10); +} + +.pcr-risk-div { + label{ + background-color: #f00; + padding: 5px; + text-align: center; + &.red { + background-color: #f00; + } + &.blue { + background-color: #00f; + } + &.orange { + background-color: #ffa500; + } + &.green { + background-color: #008000; + } + } +} \ No newline at end of file diff --git a/protected/modules/OphCiExamination/commands/PortalExamsCommand.php b/protected/modules/OphCiExamination/commands/PortalExamsCommand.php index ae44e9eec0..d008bb975d 100644 --- a/protected/modules/OphCiExamination/commands/PortalExamsCommand.php +++ b/protected/modules/OphCiExamination/commands/PortalExamsCommand.php @@ -29,9 +29,9 @@ public function run($args) { $creator = new OEModule\OphCiExamination\components\ExaminationCreator(); $user = new User(); - $this->setConfig(); - $this->client = $this->initClient(); - $this->login(); + $connection = new OptomPortalConnection(); + $this->client = $connection->getClient(); + $this->config = $connection->getConfig(); $examinations = $this->examinationSearch(); $eventType = EventType::model()->find('name = "Examination"'); @@ -120,45 +120,6 @@ public function run($args) } } - /** - * Set portal config. - */ - protected function setConfig() - { - $this->config = Yii::app()->params['portal']; - } - - /** - * Init HTTP client. - * - * @return Zend_Http_Client - * - * @throws Zend_Http_Client_Exception - */ - protected function initClient() - { - $client = new Zend_Http_Client($this->config['uri']); - $client->setHeaders('Accept', 'application/vnd.OpenEyesPortal.v1+json'); - - return $client; - } - - /** - * Login to the API, set the auth header. - */ - protected function login() - { - $this->client->setUri($this->config['uri'].$this->config['endpoints']['auth']); - $this->client->setParameterPost($this->config['credentials']); - $response = $this->client->request('POST'); - if ($response->getStatus() > 299) { - throw new Exception('Unable to login, user credentials in config incorrect'); - } - $jsonResponse = json_decode($response->getBody(), true); - $this->client->resetParameters(); - $this->client->setHeaders('Authorization', 'Bearer '.$jsonResponse['access_token']); - } - /** * Search the API for examinations. * diff --git a/protected/modules/OphCiExamination/components/ExaminationCreator.php b/protected/modules/OphCiExamination/components/ExaminationCreator.php index 99c9789c1f..425fda1388 100644 --- a/protected/modules/OphCiExamination/components/ExaminationCreator.php +++ b/protected/modules/OphCiExamination/components/ExaminationCreator.php @@ -216,7 +216,7 @@ protected function addVisualAcuityReading($userId, $visualAcuity, $unit, $vaData $vaReading->element_id = $visualAcuity->id; $baseValue = \OEModule\OphCiExamination\models\OphCiExamination_VisualAcuityUnitValue::model()->getBaseValue($unit->id, $vaData['reading']); $vaReading->value = $baseValue; - $vaReading->method_id = \OEModule\OphCiExamination\models\OphCiExamination_VisualAcuity_Method::model()->find('name = :name', array('name' => $vaData['method']))->id; + $vaReading->method_id = \OEModule\OphCiExamination\models\OphCiExamination_VisualAcuity_Method::model()->find('LOWER(name) = :name', array('name' => strtolower($vaData['method'])))->id; if($eyeLabel === 'left'){ $vaReading->side = \OEModule\OphCiExamination\models\OphCiExamination_VisualAcuity_Reading::LEFT; } else { @@ -346,7 +346,7 @@ protected function addComplication($userId, $eyeIds, $opNoteEventId, $eye, $comp foreach ($eye['complications'] as $complicationArray) { $eyeComplication = new \OEModule\OphCiExamination\models\OphCiExamination_Et_PostOpComplications(); $eyeComplication->element_id = $complications->id; - $complicationToAdd = \OEModule\OphCiExamination\models\OphCiExamination_PostOpComplications::model()->find('name = "' . $complicationArray['complication'] . '"'); + $complicationToAdd = \OEModule\OphCiExamination\models\OphCiExamination_PostOpComplications::model()->find('LOWER(name) = "' . strtolower($complicationArray['complication']) . '"'); $eyeComplication->complication_id = $complicationToAdd->id; $eyeComplication->operation_note_id = $opNoteEventId; $eyeComplication->eye_id = $eyeIds[$eyeLabel]; @@ -384,6 +384,9 @@ protected function addIop($eyeIds, $eye, $iop, $eyeLabel) array($iopReading['mm_hg'])); $instrument = \OEModule\OphCiExamination\models\OphCiExamination_Instrument::model()->find('LOWER(name) = ?', array(strtolower($iopReading['instrument']))); + if ($instrument['scale_id']){ + $iopValue->qualitative_reading_id = $instrument['scale_id']; + } $iopValue->reading_id = $iopReadingValue['id']; $iopValue->instrument_id = $instrument['id']; if (!$iopValue->save(true, null, true)) { diff --git a/protected/modules/OphCiExamination/components/OphCiExamination_API.php b/protected/modules/OphCiExamination/components/OphCiExamination_API.php index 2ac0ed60c6..eb34a6b6b1 100644 --- a/protected/modules/OphCiExamination/components/OphCiExamination_API.php +++ b/protected/modules/OphCiExamination/components/OphCiExamination_API.php @@ -24,6 +24,10 @@ class OphCiExamination_API extends \BaseAPI { + + const LEFT = 1; + const RIGHT = 0; + /** * Extends parent method to prepend model namespace. * @@ -294,6 +298,53 @@ public function getLetterPosteriorPolePrincipal($patient) } } + public function getRefractionValues($eventid) + { + if ($unit = models\Element_OphCiExamination_Refraction::model()->find('event_id = ' . $eventid)) { + return $unit; + } + return; + } + + public function getMostRecentVA($eventid) + { + if($vaevents = models\Element_OphCiExamination_VisualAcuity::model()->findAll('event_id = ' . $eventid)) { + for ($i = 0; $i < count($vaevents); ++$i) { + if($vaevents){ + return $vaevents[$i]; + } + } + } + } + + + public function getMostRecentVAData($id) + { + if ($unit = models\OphCiExamination_VisualAcuity_Reading::model()->findAll('element_id = ' . $id)) { + return $unit; + } + } + + + public function getMostRecentNearVA($eventid) + { + if($vaevents = models\Element_OphCiExamination_NearVisualAcuity::model()->findAll('event_id = ' . $eventid)) { + for ($i = 0; $i < count($vaevents); ++$i) { + return $vaevents[$i]; + } + } + } + + + public function getMostRecentNearVAData($id) + { + // Then findAll data from va_reading for that element_id. Most recent. + if ($unit = models\OphCiExamination_NearVisualAcuity_Reading::model()->findAll('element_id = ' . $id)) { + return $unit; + } + } + + /** * returns the best visual acuity for the specified side in the given episode for the patient. This is from the most recent * examination that has a visual acuity element. @@ -316,6 +367,130 @@ public function getBestVisualAcuity($patient, $episode, $side) } } + public function getBestNearVisualAcuity($patient, $episode, $side) + { + if ($va = $this->getElementForLatestEventInEpisode($episode, 'models\Element_OphCiExamination_NearVisualAcuity')) { + switch ($side) { + case 'left': + return $va->getBestReading('left'); + case 'right': + return $va->getBestReading('right'); + } + } + } + + public function getVAId($patient, $episode) + { + if ($va = $this->getElementForLatestEventInEpisode($episode, 'models\Element_OphCiExamination_VisualAcuity')) { + return $va; + } + } + + public function getNearVAId($patient, $episode) + { + if ($va = $this->getElementForLatestEventInEpisode($episode, 'models\Element_OphCiExamination_NearVisualAcuity')) { + return $va; + } + } + public function getVAvalue($vareading, $unitId) + { + if ($unit = models\OphCiExamination_VisualAcuityUnitValue::model()->find('base_value = ' . $vareading . ' AND unit_id = ' . $unitId)) { + return $unit->value; + } + return; + } + + public function getVARight($vaid) + { + if ($unit = models\OphCiExamination_VisualAcuity_Reading::model()->findAll('element_id = ' + . $vaid . ' AND side = ' . self::RIGHT)) { + return $unit; + } + return; + } + + public function getVALeft($vaid) + { + if ($unit = models\OphCiExamination_VisualAcuity_Reading::model()->findAll('element_id = ' + . $vaid . ' AND side = ' . self::LEFT)) { + return $unit; + } + return; + } + + + public function getNearVARight($vaid) + { + if ($unit = models\OphCiExamination_NearVisualAcuity_Reading::model()->findAll('element_id = ' + . $vaid . ' AND side = ' . self::RIGHT)) { + return $unit; + } + return; + } + + public function getNearVALeft($vaid) + { + if ($unit = models\OphCiExamination_NearVisualAcuity_Reading::model()->findAll('element_id = ' + . $vaid . ' AND side = ' . self::LEFT)) { + return $unit; + } + return; + } + + + public function getMethodIdRight($vaid, $episode) + { + if ($unit = models\OphCiExamination_VisualAcuity_Reading::model()->findAll('element_id = ' + . $vaid . ' AND side = ' . self::RIGHT)) { + return $unit; + } + return; + } + + public function getMethodIdNearRight($vaid) + { + if ($unit = models\OphCiExamination_NearVisualAcuity_Reading::model()->findAll('element_id = ' . $vaid + . ' AND side = ' . self::RIGHT)) { + return $unit; + } + return; + } + + public function getMethodIdLeft($vaid, $episode) + { + if ($unit = models\OphCiExamination_VisualAcuity_Reading::model()->findAll('element_id = ' . $vaid + . ' AND side = ' . self::LEFT)) { + return $unit; + } + return; + } + + public function getMethodIdNearLeft($vaid) + { + if ($unit = models\OphCiExamination_NearVisualAcuity_Reading::model()->findAll('element_id = ' . $vaid + . ' AND side = ' . self::LEFT)) { + return $unit; + } + return; + } + + + public function getUnitId($vaid, $episode) + { + if ($unit = models\Element_OphCiExamination_VisualAcuity::model()->find('id = ?', array($vaid))) { + return $unit->unit_id; + } + return; + } + + public function getNearUnitId($vaid, $episode) + { + if ($unit = models\Element_OphCiExamination_NearVisualAcuity::model()->find('id = ?', array($vaid))) { + return $unit->unit_id; + } + return; + } + /** * gets the id for the Snellen Metre unit type for VA. * @@ -330,6 +505,55 @@ protected function getSnellenUnitId() return; } + public function getAllVisualAcuityLeft($patient) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + return ($best = $this->getBestVisualAcuity($patient, $episode, 'left')) ? $best->convertTo($best->value, + $this->getSnellenUnitId()) : null; + } + } + + public function getAllVisualAcuityRight($patient) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + return ($best = $this->getBestVisualAcuity($patient, $episode, 'right')) ? $best->convertTo($best->value, + $this->getSnellenUnitId()) : null; + } + } + + public function getAllVisualAcuityLeftByDate($patient, $opDate) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + return ($best = $this->getBestVisualAcuity($patient, $episode, 'left')) ? $best->convertTo($best->value, + $this->getSnellenUnitId()) : null; + } + } + + public function getAllVisualAcuityRightByDate($patient, $opDate) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + return ($best = $this->getBestVisualAcuity($patient, $episode, 'right')) ? $best->convertTo($best->value, + $this->getSnellenUnitId()) : null; + } + } + + + public function getUnitName($unitId) + { + if ($unit = models\OphCiExamination_VisualAcuityUnit::model()->find('id = ?', array($unitId))) { + return $unit->name; + } + return; + } + + public function getMethodName($methodId) + { + if ($unit = models\OphCiExamination_VisualAcuity_Method::model()->find('id = ?', array($methodId))) { + return $unit->name; + } + return; + } + public function getLetterVisualAcuityLeft($patient) { if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { @@ -341,6 +565,7 @@ public function getLetterVisualAcuityLeft($patient) public function getLetterVisualAcuityRight($patient) { if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { +// var_dump($episode); return ($best = $this->getBestVisualAcuity($patient, $episode, 'right')) ? $best->convertTo($best->value, $this->getSnellenUnitId()) : null; } @@ -369,6 +594,25 @@ public function getLetterVisualAcuityPrincipal($patient) } } + /** + * Get a combined string of the different readings. If a unit_id is given, the readings will + * be converted to unit type of that id. + * + * @param string $side + * @param null $unit_id + * + * @return string + */ + public function getCombined($side, $unit_id = null) + { + $combined = array(); + foreach ($this->{$side.'_readings'} as $reading) { + $combined[] = $reading->convertTo($reading->value, $unit_id).' '.$reading->method->name; + } + + return implode(', ', $combined); + } + /** * Get the default findings string from VA in te latest examination event (if it exists). * @@ -391,11 +635,11 @@ public function getLetterVisualAcuityFindings($patient) * get the va from the given episode for the left side of the episode patient. * @param Episode $episode * @param bool $include_nr_values -<<<<<<< HEAD + <<<<<<< HEAD * -======= + ======= * @param string $before_date ->>>>>>> develop + >>>>>>> develop * @return OphCiExamination_VisualAcuity_Reading */ public function getLetterVisualAcuityForEpisodeLeft($episode, $include_nr_values = false, $before_date = '') @@ -420,13 +664,13 @@ public function getLetterVisualAcuityForEpisodeLeft($episode, $include_nr_values /** * get the va from the given episode for the right side of the episode patient. * @param Episode $episode -<<<<<<< HEAD + <<<<<<< HEAD * @param bool $include_nr_values * -======= + ======= * @param bool $include_nr_values * @param string $before_date ->>>>>>> develop + >>>>>>> develop * @return OphCiExamination_VisualAcuity_Reading */ public function getLetterVisualAcuityForEpisodeRight($episode, $include_nr_values = false, $before_date = '') diff --git a/protected/modules/OphCiExamination/controllers/DefaultController.php b/protected/modules/OphCiExamination/controllers/DefaultController.php index fa01e94ffa..a3a6d26bb1 100644 --- a/protected/modules/OphCiExamination/controllers/DefaultController.php +++ b/protected/modules/OphCiExamination/controllers/DefaultController.php @@ -690,6 +690,10 @@ protected function setComplexAttributes_Element_OphCiExamination_History($elemen } $this->allergies = $allergies; + + if (isset($data['no_allergies']) && $data['no_allergies'] && !$this->patient->no_allergies_date) { + $this->patient->no_allergies_date = date('Y-m-d'); + } } /** @@ -899,20 +903,17 @@ protected function saveComplexAttributes_Element_OphCiExamination_HistoryRisk($e */ protected function updateRisk($risk_name, $risk_value, $risk_comment) { - $risk_check = ($risk_name === 'anticoagulant') ? 'Anticoagulants' : 'Alpha blockers'; - $risk = \Risk::model()->find('name=?', array($risk_check)); - $criteria = new \CDbCriteria(); - $criteria->compare('risk_id', $risk['id']); - $criteria->compare('patient_id', $this->patient->id); - $patient_risk = \PatientRiskAssignment::model()->find($criteria); - if ($risk_value === '1') { - $patient_risk = (!$patient_risk) ? new \PatientRiskAssignment() : $patient_risk; - $patient_risk->risk_id = $risk['id']; - $patient_risk->patient_id = $this->patient->id; - $patient_risk->comments = $risk_comment; - $patient_risk->save(); - } elseif ($patient_risk && ($risk_value === '2')) { - \PatientRiskAssignment::model()->deleteByPk($patient_risk->id); + $historyRisk = new models\Element_OphCiExamination_HistoryRisk(); + if ($risk_name === 'anticoagulant') { + $risk_check = 'Anticoagulants'; + $recent = $historyRisk->mostRecentCheckedAnticoag($this->patient->id); + } else { + $risk_check = 'Alpha blockers'; + $recent = $historyRisk->mostRecentCheckedAlpha($this->patient->id); + } + + if (is_null($recent) || strtotime($this->event->event_date) >= strtotime($recent->event->event_date)) { + $this->updateSummaryRisk($risk_value, $risk_comment, $risk_check); } } @@ -1302,6 +1303,7 @@ public function actionGetPostOpComplicationAutocopleteList() /** * Setting the CVI alert flag to dismiss + * * @param int $element_id */ public function actionDismissCVIalert($element_id) @@ -1318,4 +1320,57 @@ public function actionDismissCVIalert($element_id) } } } + + /** + * @param $id + * + * @return bool + */ + public function actionDelete($id) + { + $historyRisk = new models\Element_OphCiExamination_HistoryRisk(); + $recentAnticoag = $historyRisk->mostRecentCheckedAnticoag($this->patient->id); + $recentAlpha = $historyRisk->mostRecentCheckedAlpha($this->patient->id); + $thisRisk = $historyRisk->find('event_id = ?', array($this->event->id)); + + if ($thisRisk) { + if (is_null($recentAnticoag) || $recentAnticoag->anticoagulant === '0' || $recentAnticoag->event->id === $thisRisk->event->id) { + $previous = $historyRisk->previousCheckedAnticoag($this->patient->id, $thisRisk->event->event_date); + if ($previous->anticoagulant !== $thisRisk->anticoagulant) { + $this->updateSummaryRisk($previous->anticoagulant, $previous->anticoagulant_name, 'Anticoagulants'); + } + } + if (is_null($recentAlpha) || $recentAlpha->alphablocker === '0' || $recentAnticoag->event->id === $thisRisk->event->id) { + $previous = $historyRisk->previousCheckedAlpha($this->patient->id, $thisRisk->event->event_date); + if ($previous->alphablocker !== $thisRisk->alphablocker) { + $this->updateSummaryRisk($previous->alphablocker, $previous->alpha_blocker_name, 'Alpha blockers'); + } + } + } + + return parent::actionDelete($id); + } + + /** + * @param $risk_value + * @param $risk_comment + * @param $risk_check + */ + protected function updateSummaryRisk($risk_value, $risk_comment, $risk_check) + { + $risk = \Risk::model()->find('name=?', array($risk_check)); + $criteria = new \CDbCriteria(); + $criteria->compare('risk_id', $risk['id']); + $criteria->compare('patient_id', $this->patient->id); + $patient_risk = \PatientRiskAssignment::model()->find($criteria); + if ($risk_value === '1') { + $patient_risk = (!$patient_risk) ? new \PatientRiskAssignment() : $patient_risk; + $patient_risk->risk_id = $risk['id']; + $patient_risk->patient_id = $this->patient->id; + $patient_risk->comments = $risk_comment; + $patient_risk->save(); + } elseif ($patient_risk && ($risk_value === '2')) { + \PatientRiskAssignment::model()->deleteByPk($patient_risk->id); + } + } } \ No newline at end of file diff --git a/protected/modules/OphCiExamination/migrations/m161004_063341_alter_refraction_type.php b/protected/modules/OphCiExamination/migrations/m161004_063341_alter_refraction_type.php new file mode 100644 index 0000000000..d3f76ab014 --- /dev/null +++ b/protected/modules/OphCiExamination/migrations/m161004_063341_alter_refraction_type.php @@ -0,0 +1,15 @@ +update('ophciexamination_refraction_type', array('name' => 'Focimetry'), 'name = "Own Glasses"'); + } + + public function down() + { + $this->update('ophciexamination_refraction_type', array('name' => 'Own Glasses'), 'name = "Focimetry"'); + } + +} \ No newline at end of file diff --git a/protected/modules/OphCiExamination/migrations/m161012_084258_add_pupillary_abnormalities.php b/protected/modules/OphCiExamination/migrations/m161012_084258_add_pupillary_abnormalities.php new file mode 100644 index 0000000000..6c6f0901b0 --- /dev/null +++ b/protected/modules/OphCiExamination/migrations/m161012_084258_add_pupillary_abnormalities.php @@ -0,0 +1,19 @@ +insert($this->table, array('name' => $this->pupillary_abnormality, 'display_order' =>'60')); + } + + public function down() + { + $this->delete($this->table, 'name = :name', array(':name' => $this->pupillary_abnormality)); + } + +} \ No newline at end of file diff --git a/protected/modules/OphCiExamination/migrations/m161026_095125_pcr_risk_element.php b/protected/modules/OphCiExamination/migrations/m161026_095125_pcr_risk_element.php new file mode 100644 index 0000000000..01b8fdae6c --- /dev/null +++ b/protected/modules/OphCiExamination/migrations/m161026_095125_pcr_risk_element.php @@ -0,0 +1,55 @@ +createOETable( + 'et_ophciexamination_pcr_risk', + array( + 'id' => 'pk', + 'event_id' => 'INTEGER(10) UNSIGNED NOT NULL', + 'eye_id' => 'INTEGER(10) UNSIGNED NOT NULL DEFAULT 3', + 'left_glaucoma' => 'VARCHAR(2)', + 'left_pxf' => 'VARCHAR(2)', + 'left_diabetic' => 'VARCHAR(2)', + 'left_pupil_size' => 'VARCHAR(10) NOT NULL', + 'left_no_fundal_view' => 'VARCHAR(2)', + 'left_axial_length_group' => 'INTEGER(2)', + 'left_brunescent_white_cataract' => 'VARCHAR(2)', + 'left_alpha_receptor_blocker' => 'VARCHAR(2)', + 'left_doctor_grade_id' => 'INTEGER(11) NOT NULL', + 'left_can_lie_flat' => 'VARCHAR(2)', + 'left_pcr_risk' => 'DECIMAL(5,2)', + 'left_excess_risk' => 'DECIMAL(5,2)', + 'right_glaucoma' => 'VARCHAR(2)', + 'right_pxf' => 'VARCHAR(2)', + 'right_diabetic' => 'VARCHAR(2)', + 'right_pupil_size' => 'VARCHAR(10) NOT NULL', + 'right_no_fundal_view' => 'VARCHAR(2)', + 'right_axial_length_group' => 'INTEGER(2)', + 'right_brunescent_white_cataract' => 'VARCHAR(2)', + 'right_alpha_receptor_blocker' => 'VARCHAR(2)', + 'right_doctor_grade_id' => 'INTEGER(11) NOT NULL', + 'right_can_lie_flat' => 'VARCHAR(2)', + 'right_pcr_risk' => 'DECIMAL(5,2)', + 'right_excess_risk' => 'DECIMAL(5,2)', + 'CONSTRAINT el_pcr_eye foreign key (eye_id) references eye (id)', + 'CONSTRAINT el_right_pcr_doctor_grade foreign key (right_doctor_grade_id) references doctor_grade (id)', + 'CONSTRAINT el_left_pcr_doctor_grade foreign key (left_doctor_grade_id) references doctor_grade (id)', + ), + true + ); + + $this->createElementType('OphCiExamination', 'PCR Risk', array( + 'class_name' => 'OEModule\OphCiExamination\models\Element_OphCiExamination_PcrRisk', + 'display_order' => '50', + )); + } + + public function down() + { + $this->dropOETable('et_ophciexamination_pcr_risk', true); + $this->delete('element_type', 'class_name = "Element_OphCiExamination_PcrRisk"'); + } +} \ No newline at end of file diff --git a/protected/modules/OphCiExamination/migrations/m161103_153904_nullable_doctor_id.php b/protected/modules/OphCiExamination/migrations/m161103_153904_nullable_doctor_id.php new file mode 100644 index 0000000000..3c2a9ad071 --- /dev/null +++ b/protected/modules/OphCiExamination/migrations/m161103_153904_nullable_doctor_id.php @@ -0,0 +1,21 @@ +alterColumn('et_ophciexamination_pcr_risk', 'left_doctor_grade_id', 'int(11) null'); + $this->alterColumn('et_ophciexamination_pcr_risk_version', 'left_doctor_grade_id', 'int(11) null'); + $this->alterColumn('et_ophciexamination_pcr_risk', 'right_doctor_grade_id', 'int(11) null'); + $this->alterColumn('et_ophciexamination_pcr_risk_version', 'right_doctor_grade_id', 'int(11) null'); + } + + public function down() + { + $this->alterColumn('et_ophciexamination_pcr_risk', 'left_doctor_grade_id', 'int(11)'); + $this->alterColumn('et_ophciexamination_pcr_risk_version', 'left_doctor_grade_id', 'int(11)'); + $this->alterColumn('et_ophciexamination_pcr_risk', 'right_doctor_grade_id', 'int(11)'); + $this->alterColumn('et_ophciexamination_pcr_risk_version', 'right_doctor_grade_id', 'int(11)'); + } + +} \ No newline at end of file diff --git a/protected/modules/OphCiExamination/migrations/m170113_133457_move_PCR_order.php b/protected/modules/OphCiExamination/migrations/m170113_133457_move_PCR_order.php new file mode 100644 index 0000000000..016b55c6ca --- /dev/null +++ b/protected/modules/OphCiExamination/migrations/m170113_133457_move_PCR_order.php @@ -0,0 +1,29 @@ +update('element_type', array('display_order' => 94), 'name = :nm', array(':nm' => 'PCR Risk')); + } + + public function down() + { + echo "m170113_133457_move_PCR_order does not support migration down.\n"; + return false; + } + + + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + $this->update('element_type', array('display_order' => 94), 'name = :nm', array(':nm' => 'PCR Risk')); + } + + public function safeDown() + { + echo "m170113_133457_move_PCR_order does not support migration down.\n"; + return false; + } + +} \ No newline at end of file diff --git a/protected/modules/OphCiExamination/models/Element_OphCiExamination_HistoryRisk.php b/protected/modules/OphCiExamination/models/Element_OphCiExamination_HistoryRisk.php index 1cd79a6e17..937e4e8f68 100644 --- a/protected/modules/OphCiExamination/models/Element_OphCiExamination_HistoryRisk.php +++ b/protected/modules/OphCiExamination/models/Element_OphCiExamination_HistoryRisk.php @@ -19,13 +19,15 @@ namespace OEModule\OphCiExamination\models; +use services\DateTime; + /** * This is the model class for table "et_ophciexamination_glaucomarisk". * * The followings are the available columns in table: * - * @property int $id - * @property int $event_id + * @property int $id + * @property int $event_id * @property OphCiExamination_GlaucomaRisk_Risk $risk * * The followings are the available model relations: @@ -74,13 +76,13 @@ public function rules() * @param $attribute * @param $params */ - public function validateName($attribute,$params) + public function validateName($attribute, $params) { - if($this->$params['type'] === '1' && !$this->$attribute){ + if ($this->$params['type'] === '1' && !$this->$attribute) { $this->addError($attribute, 'When checked a drug name is required'); } - if($this->$params['type'] !== '1' && $this->$attribute){ + if ($this->$params['type'] !== '1' && $this->$attribute) { $this->addError($attribute, 'A drug name cannot be supplied without selecting yes.'); } } @@ -144,7 +146,7 @@ public function search() */ public function anticoagulantText() { - return 'Anticoagulants: '.$this->yesNoText($this->anticoagulant).(($this->anticoagulant_name) ? ' - '.$this->anticoagulant_name : ''); + return 'Anticoagulants: ' . $this->yesNoText($this->anticoagulant) . (($this->anticoagulant_name) ? ' - ' . $this->anticoagulant_name : ''); } /** @@ -152,7 +154,7 @@ public function anticoagulantText() */ public function alphaBlockerText() { - return 'Alpha-Blockers: '.$this->yesNoText($this->alphablocker).(($this->alpha_blocker_name) ? ' - '.$this->alpha_blocker_name : ''); + return 'Alpha-Blockers: ' . $this->yesNoText($this->alphablocker) . (($this->alpha_blocker_name) ? ' - ' . $this->alpha_blocker_name : ''); } /** @@ -185,4 +187,104 @@ public function canCopy() { return true; } + + + /** + * @param $patientId + * + * @return array|mixed|null + */ + public function mostRecentCheckedAlpha($patientId) + { + return $this->mostRecentChecked('alphablocker', $patientId); + } + + /** + * @param $patientId + * + * @return array|mixed|null + */ + public function mostRecentCheckedAnticoag($patientId) + { + return $this->mostRecentChecked('anticoagulant', $patientId); + } + + /** + * @param $patientId + * @param $date + * + * @return array|mixed|null + */ + public function previousCheckedAlpha($patientId, $date = 'now') + { + return $this->previousChecked('alphablocker', $patientId, $date); + } + + /** + * @param $patientId + * @param $date + * + * @return array|mixed|null + */ + public function previousCheckedAnticoag($patientId, $date = 'now') + { + return $this->previousChecked('anticoagulant', $patientId, $date); + } + + /** + * Find the most recent element that has actually been checked + * + * Finds the most recent element where the question of $type has + * actually been checked, yes or no. + * + * @param $type + * @param $patientId + * + * @return array|mixed|null + */ + protected function mostRecentChecked($type, $patientId) + { + $criteria = $this->risksByTypeForPatient($type, $patientId); + $criteria->limit = 1; + + return self::model()->find($criteria); + } + + /** + * @param $type + * @param $patientId + * @param string $before + * + * @return array|mixed|null + */ + protected function previousChecked($type, $patientId, $before = 'now') + { + $date = new \DateTime($before); + $criteria = $this->risksByTypeForPatient($type, $patientId); + $criteria->limit = 1; + $criteria->addCondition('event.event_date < :date'); + $criteria->params['date'] = $date->format('Y-m-d H:i:s'); + + return self::model()->find($criteria); + } + + /** + * @param $type + * @param $patientId + * @return \CDbCriteria + */ + protected function risksByTypeForPatient($type, $patientId) + { + $criteria = new \CDbCriteria(); + $criteria->join = 'join event on t.event_id = event.id '; + $criteria->join .= 'join episode on event.episode_id = episode.id '; + $criteria->addCondition($type . ' > 0'); + $criteria->addCondition('event.deleted <> 1'); + $criteria->addCondition('episode.patient_id = :patient_id'); + $criteria->params = array('patient_id' => $patientId); + $criteria->order = 'event.event_date DESC'; + + return $criteria; + } + } diff --git a/protected/modules/OphCiExamination/models/Element_OphCiExamination_PcrRisk.php b/protected/modules/OphCiExamination/models/Element_OphCiExamination_PcrRisk.php new file mode 100644 index 0000000000..bf86b9ea04 --- /dev/null +++ b/protected/modules/OphCiExamination/models/Element_OphCiExamination_PcrRisk.php @@ -0,0 +1,211 @@ + array(self::BELONGS_TO, 'EventType', 'event_type_id'), + 'event' => array(self::BELONGS_TO, 'Event', 'event_id'), + 'user' => array(self::BELONGS_TO, 'User', 'created_user_id'), + 'usermodified' => array(self::BELONGS_TO, 'User', 'last_modified_user_id'), + 'eye' => array(self::BELONGS_TO, 'Eye', 'eye_id'), + 'right_doctor' => array(self::BELONGS_TO, 'DoctorGrade', 'right_doctor_grade_id'), + 'left_doctor' => array(self::BELONGS_TO, 'DoctorGrade', 'left_doctor_grade_id'), + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'event_id' => 'Event', + 'left_glaucoma' => 'Glaucoma', + 'left_pxf' => 'PXF/Phacodonesis', + 'left_diabetic' => 'Diabetic', + 'left_pupil_size' => 'Pupil Size', + 'left_no_fundal_view' => 'No fundal view/Vitreous opacities', + 'left_axial_length_group' => 'Axial Length (mm)', + 'left_brunescent_white_cataract' => 'Brunescent/White Cataract', + 'left_alpha_receptor_blocker' => 'Alpha receptor blocker', + 'left_doctor_grade_id' => 'Surgeon Grade', + 'left_can_lie_flat' => 'Can lie flat', + 'right_glaucoma' => 'Glaucoma', + 'right_pxf' => 'PXF/Phacodonesis', + 'right_diabetic' => 'Diabetic', + 'right_pupil_size' => 'Pupil Size', + 'right_no_fundal_view' => 'No fundal view/Vitreous opacities', + 'right_axial_length_group' => 'Axial Length (mm)', + 'right_brunescent_white_cataract' => 'Brunescent/White Cataract', + 'right_alpha_receptor_blocker' => 'Alpha receptor blocker', + 'right_doctor_grade_id' => 'Surgeon Grade', + 'right_can_lie_flat' => 'Can lie flat', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + $criteria = new \CDbCriteria(); + + return new \CActiveDataProvider(get_class($this), array( + 'criteria' => $criteria, + )); + } + + /** + * Set the risk to be null if it's empty string to stop it being stored as 0.00 + * + * @return bool + */ + public function beforeSave() + { + if ($this->left_pcr_risk === '') { + $this->left_pcr_risk = null; + } + + if ($this->right_pcr_risk === '') { + $this->right_pcr_risk = null; + } + + $pcr = new \PcrRisk(); + foreach (array('left', 'right') as $side) { + $data = array( + 'glaucoma' => $this->{$side . '_glaucoma'}, + 'pxf_phako' => $this->{$side . '_pxf'}, + 'diabetic' => $this->{$side . '_diabetic'}, + 'pupil_size' => $this->{$side . '_pupil_size'}, + 'no_fundal_view' => $this->{$side . '_no_fundal_view'}, + 'axial_length' => $this->{$side . '_axial_length_group'}, + 'brunescent_white_cataract' => $this->{$side . '_brunescent_white_cataract'}, + 'arb' => $this->{$side . '_alpha_receptor_blocker'}, + 'pcr_doctor_grade' => $this->{$side . '_doctor_grade_id'}, + 'abletolieflat' => $this->{$side . '_can_lie_flat'}, + ); + $pcr->persist($side, $this->event->episode->patient, $data); + } + + return parent::beforeSave(); + } + + /** + * Get the class required to make the risk the correct colour + * + * @param $side + * @return string + */ + public function pcrRiskColour($side) + { + $value = $this->{$side . '_pcr_risk'}; + + if (!$value) { + return 'blue'; + } + + if ($value <= 1) { + return 'green'; + } else { + if ($value > 1 && $value <= 5) { + return 'orange'; + } else { + return 'red'; + } + } + } + + /** + * Set the data from other parts of the system if it's available. + */ + public function afterConstruct() + { + if ($this->getIsNewRecord() && \Yii::app()->request->getQuery('patient_id', false)) { + $pcr = new \PcrRisk(); + foreach (array('left', 'right') as $side) { + $data = $pcr->getPCRData(\Yii::app()->request->getQuery('patient_id'), $side, $this); + $this->{$side . '_glaucoma'} = $data['glaucoma']; + $this->{$side . '_diabetic'} = $data['diabetic']; + $this->{$side . '_can_lie_flat'} = $data['lie_flat']; + $this->{$side . '_no_fundal_view'} = $data['noview']; + $this->{$side . '_pxf'} = $data['anteriorsegment']['pxf_phako']; + $this->{$side . '_pupil_size'} = $data['anteriorsegment']['pupil_size']; + $this->{$side . '_brunescent_white_cataract'} = $data['anteriorsegment']['brunescent_white_cataract']; + $this->{$side . '_doctor_grade_id'} = $data['doctor_grade_id']; + $this->{$side . '_axial_length_group'} = $data['axial_length_group']; + $this->{$side . '_alpha_receptor_blocker'} = $data['arb']; + } + } + + parent::afterConstruct(); + } +} \ No newline at end of file diff --git a/protected/modules/OphCiExamination/models/OphCiExamination_Diagnosis.php b/protected/modules/OphCiExamination/models/OphCiExamination_Diagnosis.php index a378765cbd..2363c87af2 100644 --- a/protected/modules/OphCiExamination/models/OphCiExamination_Diagnosis.php +++ b/protected/modules/OphCiExamination/models/OphCiExamination_Diagnosis.php @@ -80,7 +80,9 @@ public function relations() } /** - * @param BaseEventTypeElement $element + * @param \BaseEventTypeElement $element + * + * @return OphCiExamination_Diagnosis */ public function findAllByElement($element) { @@ -92,7 +94,7 @@ public function findAllByElement($element) /** * Retrieves a list of models based on the current search/filter conditions. * - * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + * @return \CActiveDataProvider the data provider that can return the models based on the search/filter conditions. */ public function search() { @@ -104,4 +106,21 @@ public function search() 'criteria' => $criteria, )); } + + /** + * Return the disorder with the side it applies to if the side is not in disorder name. + * + * @return string + */ + public function __toString() + { + + if (strpos($this->disorder->term, $this->eye->adjective. ' ') === 0) { + $term = $this->disorder->term; + } else { + $term = $this->eye->adjective . ' ' . $this->disorder->term; + } + + return $term; + } } diff --git a/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_AdnexalComorbidity.php b/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_AdnexalComorbidity.php index 735da14b8b..26fdea5b73 100644 --- a/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_AdnexalComorbidity.php +++ b/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_AdnexalComorbidity.php @@ -19,9 +19,7 @@ ?>
hiddenInput($element, 'eye_id', false, array('class' => 'sideField'))?> -
+
Remove side
@@ -39,9 +37,7 @@
-
+
Remove side
diff --git a/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_CataractSurgicalManagement.php b/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_CataractSurgicalManagement.php index 13a0edf7d2..00d9a6d176 100644 --- a/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_CataractSurgicalManagement.php +++ b/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_CataractSurgicalManagement.php @@ -18,72 +18,77 @@ */ ?>
-
- radioButtons($element, 'eye_id', CHtml::listData(\OEModule\OphCiExamination\models\OphCiExamination_CataractSurgicalManagement_Eye::model()->findAll(), 'id', 'name'), null, false, false, false, false, array('nowrapper' => true))?> - - - Right Eye - PCR Risk % -  |  - - Left Eye - PCR Risk % - - -
- -
+
+ radioButtons($element, 'eye_id', + CHtml::listData(\OEModule\OphCiExamination\models\OphCiExamination_CataractSurgicalManagement_Eye::model()->findAll(), 'id', 'name'), null, false, false, false, false, + array('nowrapper' => true)) ?> + params['clinical_management_pcr']): ?> + + + Right Eye - PCR Risk % +  |  + + Left Eye - PCR Risk % + + + +
+ +
checkbox($element, 'city_road', array('nowrapper' => true)); - echo $form->checkbox($element, 'satellite', array('nowrapper' => true)); - } - ?> - checkbox($element, 'fast_track', array('nowrapper' => true))?> -
+ if ($active_check === 'on') { + echo $form->checkbox($element, 'city_road', array('nowrapper' => true)); + echo $form->checkbox($element, 'satellite', array('nowrapper' => true)); + } + ?> + checkbox($element, 'fast_track', array('nowrapper' => true)) ?> +
- textfield($element, 'target_postop_refraction', array(), array(), array('label' => 3, 'field' => 1)); - $this->widget('zii.widgets.jui.CJuiSliderInput', array( - 'name' => 'refraction', - 'value' => $element->target_postop_refraction, - 'event' => 'change', - 'attribute' => 'value', - // additional javascript options for the slider plugin - 'options' => array( - 'min' => -10, - 'max' => 10, - 'step' => 0.25, - 'animate' => true, - 'slide' => 'js:function(event,ui){$("#OEModule_OphCiExamination_models_Element_OphCiExamination_CataractSurgicalManagement_target_postop_refraction").val(ui.value);}', - ), - 'htmlOptions' => array( - 'style' => 'height:10px; width:400px;margin-top:-10px;margin-bottom:20px;margin-left:250px;', - ), - )); + textfield($element, 'target_postop_refraction', array(), array(), array('label' => 3, 'field' => 1)); + $this->widget('zii.widgets.jui.CJuiSliderInput', array( + 'name' => 'refraction', + 'value' => $element->target_postop_refraction, + 'event' => 'change', + 'attribute' => 'value', + // additional javascript options for the slider plugin + 'options' => array( + 'min' => -10, + 'max' => 10, + 'step' => 0.25, + 'animate' => true, + 'slide' => 'js:function(event,ui){$("#OEModule_OphCiExamination_models_Element_OphCiExamination_CataractSurgicalManagement_target_postop_refraction").val(ui.value);}', + ), + 'htmlOptions' => array( + 'style' => 'height:10px; width:400px;margin-top:-10px;margin-bottom:20px;margin-left:250px;', + ), + )); ?> - radioBoolean($element, 'correction_discussed', array(), array('label' => 3, 'field' => 9))?> -
-
- -
-
- dropDownList($element, 'suitable_for_surgeon_id', '\OEModule\OphCiExamination\models\OphCiExamination_CataractSurgicalManagement_SuitableForSurgeon', array('class' => 'inline', 'empty' => '- Please select -', 'nowrapper' => true))?> - -
-
- radioBoolean($element, 'previous_refractive_surgery', array(), array('label' => 3, 'field' => 9))?> - radioBoolean($element, 'vitrectomised_eye', array(), array('label' => 3, 'field' => 9))?> -
-
- -
-
- radioBoolean($element, 'correction_discussed', array(), array('label' => 3, 'field' => 9)) ?> +
+
+ +
+
+ dropDownList($element, 'suitable_for_surgeon_id', '\OEModule\OphCiExamination\models\OphCiExamination_CataractSurgicalManagement_SuitableForSurgeon', + array('class' => 'inline', 'empty' => '- Please select -', 'nowrapper' => true)) ?> + +
+
+ radioBoolean($element, 'previous_refractive_surgery', array(), array('label' => 3, 'field' => 9)) ?> + radioBoolean($element, 'vitrectomised_eye', array(), array('label' => 3, 'field' => 9)) ?> +
+
+ +
+
+ multiSelectList( $element, 'OEModule_OphCiExamination_models_Element_OphCiExamination_CataractSurgicalManagement[reasonForSurgery]', @@ -104,35 +109,34 @@ array('label' => 3, 'field' => 9) ); ?> -
+
-
-
- -
- renderPartial('application.views.default._pcr_risk_form', array('side' => 'left', 'element' => $element)); - ?> -
-
- renderPartial('application.views.default._pcr_risk_form', array('side' => 'right', 'element' => $element)); - ?> -
- +
+
+params['clinical_management_pcr']): ?> +
+ renderPartial('application.views.default._pcr_risk_form', array('side' => 'left', 'element' => $element)); + ?> +
+
+ renderPartial('application.views.default._pcr_risk_form', array('side' => 'right', 'element' => $element)); + ?> +
+ \ No newline at end of file diff --git a/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_HistoryRisk.php b/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_HistoryRisk.php index 48f834a8f6..1bbb4371b3 100644 --- a/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_HistoryRisk.php +++ b/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_HistoryRisk.php @@ -21,11 +21,14 @@
- radioButtons($element, 'anticoagulant', array( - 0 => 'Not Checked', - 1 => 'Yes', - 2 => 'No', - ), + radioButtons( + $element, + 'anticoagulant', + array( + 0 => 'Not Checked', + 1 => 'Yes', + 2 => 'No', + ), ($element->anticoagulant !== null) ? $element->anticoagulant : 0, false, false, @@ -51,16 +54,19 @@ 'label' => 4, 'field' => 8, ) - );?> + ); ?>
- radioButtons($element, 'alphablocker', array( - 0 => 'Not Checked', - 1 => 'Yes', - 2 => 'No', - ), + radioButtons( + $element, + 'alphablocker', + array( + 0 => 'Not Checked', + 1 => 'Yes', + 2 => 'No', + ), ($element->alphablocker !== null) ? $element->alphablocker : 0, false, false, @@ -85,7 +91,7 @@ array( 'label' => 4, 'field' => 8, - ));?> + )); ?>
\ No newline at end of file diff --git a/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_PcrRisk.php b/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_PcrRisk.php new file mode 100644 index 0000000000..efbda4a712 --- /dev/null +++ b/protected/modules/OphCiExamination/views/default/form_Element_OphCiExamination_PcrRisk.php @@ -0,0 +1,196 @@ +getAssetManager()->publish(Yii::getPathOfAlias('application.assets.js'), false, -1); +?> + +
+patient->getDiabetes()) { + $diabeticOptions = array('Y' => 'Diabetes present'); +}else{ + $diabeticOptions = array('NK' => 'Not Known', 'N' => 'No Diabetes', 'Y' => 'Diabetes present'); +} + + +$criteria = new CDbCriteria(); +$criteria->condition = 'has_pcr_risk'; +$grades = \DoctorGrade::model()->findAll($criteria, array('order' => 'display_order')); +$dropDowns = array( + 'glaucoma' => array( + 'options' => array('NK' => 'Not Known', 'N' => 'No Glaucoma', 'Y' => 'Glaucoma present'), + 'class' => 'pcrrisk_glaucoma', + ), + 'pxf' => array( + 'options' => array('NK' => 'Not Known', 'N' => 'No', 'Y' => 'Yes'), + 'class' => 'pcrrisk_pxf_phako', + ), + 'diabetic' => array( + 'options' => $diabeticOptions, + 'class' => 'pcrrisk_diabetic', + ), + 'pupil_size' => array( + 'options' => array('Large' => 'Large', 'Medium' => 'Medium', 'Small' => 'Small'), + 'class' => 'pcrrisk_pupil_size', + ), + 'no_fundal_view' => array( + 'options' => array('NK' => 'Not Known', 'N' => 'No', 'Y' => 'Yes'), + 'class' => 'pcrrisk_no_fundal_view', + ), + 'axial_length_group' => array( + 'options' => array(0 => 'Not Known', 1 => '< 26', 2 => '> or = 26'), + 'class' => '', + ), + 'brunescent_white_cataract' => array( + 'options' => array('NK' => 'Not Known', 'N' => 'No', 'Y' => 'Yes'), + 'class' => 'pcrrisk_brunescent_white_cataract', + ), + 'alpha_receptor_blocker' => array( + 'options' => array('NK' => 'Not Known', 'N' => 'No', 'Y' => 'Yes'), + 'class' => 'pcrrisk_arb', + ), + 'doctor_grade_id' => array( + 'options' => $grades, + 'class' => 'pcr_doctor_grade', + ), + 'can_lie_flat' => array( + 'options' => array('N' => 'No', 'Y' => 'Yes'), + 'class' => '', + ), +); +echo $form->hiddenInput($element, 'eye_id', false, array('class' => 'sideField')); + +foreach (array('right', 'left') as $side): + $opposite = ($side === 'right') ? 'left' : 'right'; + $pcrRisk = new PcrRisk(); + $activeClass = ($element->{'has'.ucfirst($side)}()) ? 'active' : 'inactive'; ?> +
+ event){ + $patientId = $this->event->episode->patient->id; + } else { + $patientId = Yii::app()->request->getQuery('patient_id'); + } + + $pcr = $pcrRisk->getPCRData($patientId, $side, $element); + echo CHtml::hiddenField('age', $pcr['age_group']); + echo CHtml::hiddenField('gender', $pcr['gender']); + ?> +
+ Remove side + $data): + if ($key === 'doctor_grade_id'):?> +
+
+ +
+
+ +
+
+ {'left_diabetic'} == 'Y' OR $element->{'left_diabetic'} == 'N'){ + $element->{'right_diabetic'} = $element->{'left_diabetic'}; + }elseif($element->{'right_diabetic'} == 'Y' OR $element->{'right_diabetic'} == 'N'){ + $element->{'left_diabetic'} = $element->{'right_diabetic'}; + } + if($element->{'left_alpha_receptor_blocker'} == 'Y' OR $element->{'left_alpha_receptor_blocker'} == 'N'){ + $element->{'right_alpha_receptor_blocker'} = $element->{'left_alpha_receptor_blocker'}; + }elseif($element->{'right_alpha_receptor_blocker'} == 'Y' OR $element->{'right_alpha_receptor_blocker'} == 'N'){ + $element->{'left_alpha_receptor_blocker'} = $element->{'right_alpha_receptor_blocker'}; + } + echo $form->dropDownList( + $element, + $side.'_'.$key, + $data['options'], + array('class' => $data['class']), + false, + array('label' => 4, 'field' => 4) + ); + endif; + endforeach;?> +
+
+ +
+
+ +
+
+
+ +
+ + +
+ diff --git a/protected/modules/OphCiExamination/views/default/view_Element_OphCiExamination_Diagnoses.php b/protected/modules/OphCiExamination/views/default/view_Element_OphCiExamination_Diagnoses.php index b5c7fb2c6c..505d89aa63 100644 --- a/protected/modules/OphCiExamination/views/default/view_Element_OphCiExamination_Diagnoses.php +++ b/protected/modules/OphCiExamination/views/default/view_Element_OphCiExamination_Diagnoses.php @@ -18,53 +18,60 @@ */ ?>
-
- find('element_diagnoses_id=? and principal=1 and eye_id in (2,3)', array($element->id))) { - ?> -
-
- - eye->adjective?> - disorder->term?> - -
-
- - findAll('element_diagnoses_id=? and principal=0 and eye_id in (2,3)', array($element->id)) as $diagnosis) { - ?> -
-
- eye->adjective?> - disorder->term?> -
-
- -
-
- find('element_diagnoses_id=? and principal=1 and eye_id in (1,3)', array($element->id))) { - ?> -
-
- - eye->adjective?> - disorder->term?> - -
-
- - findAll('element_diagnoses_id=? and principal=0 and eye_id in (1,3)', array($element->id)) as $diagnosis) { - ?> -
-
- eye->adjective?> - disorder->term?> -
-
- -
+
+ find('element_diagnoses_id=? and principal=1 and eye_id in (2,3)', array($element->id)); + if ($principal) { + ?> +
+
+ + + +
+
+ + findAll('element_diagnoses_id=? and principal=0 and eye_id in (2,3)', array($element->id)); + foreach ($diagnoses as $diagnosis) { + ?> +
+
+ +
+
+ +
+
+ find('element_diagnoses_id=? and principal=1 and eye_id in (1,3)', array($element->id)); + if ($principal) { + ?> +
+
+ + + +
+
+ + findAll('element_diagnoses_id=? and principal=0 and eye_id in (1,3)', array($element->id)); + foreach ($diagnoses as $diagnosis) { + ?> +
+
+ +
+
+ +
diff --git a/protected/modules/OphCiExamination/views/default/view_Element_OphCiExamination_PcrRisk.php b/protected/modules/OphCiExamination/views/default/view_Element_OphCiExamination_PcrRisk.php new file mode 100644 index 0000000000..90a7d38efc --- /dev/null +++ b/protected/modules/OphCiExamination/views/default/view_Element_OphCiExamination_PcrRisk.php @@ -0,0 +1,112 @@ +
+{'has'.ucfirst($side)}()) ? 'active' : 'inactive'; + if(!$element->{$side.'_glaucoma'}){ + continue; + } +?> +
+
+
+
getAttributeLabel($side.'_glaucoma')?>:
+
+
+
displayValues($element->{$side.'_glaucoma'}, 'glaucoma')?>
+
+
+
+
+
getAttributeLabel($side.'_pxf')?>:
+
+
+
displayValues($element->{$side.'_pxf'})?>
+
+
+
+
+
getAttributeLabel($side.'_diabetic')?>:
+
+
+
displayValues($element->{$side.'_diabetic'}, 'diabetic')?>
+
+
+
+
+
getAttributeLabel($side.'_pupil_size')?>:
+
+
+
{$side.'_pupil_size'}?>
+
+
+
+
+
getAttributeLabel($side.'_no_fundal_view')?>:
+
+
+
displayValues($element->{$side.'_no_fundal_view'})?>
+
+
+
+
+
getAttributeLabel($side.'_axial_length_group')?>:
+
+
+
displayValues($element->{$side.'_axial_length_group'}, 'axial')?>
+
+
+
+
+
getAttributeLabel($side.'_brunescent_white_cataract')?>:
+
+
+
displayValues($element->{$side.'_brunescent_white_cataract'})?>
+
+
+
+
+
getAttributeLabel($side.'_alpha_receptor_blocker')?>:
+
+
+
displayValues($element->{$side.'_alpha_receptor_blocker'})?>
+
+
+
+
+
getAttributeLabel($side.'_doctor_grade_id')?>:
+
+
+
+ {$side.'_doctor'}) { + echo $element->{$side.'_doctor'}->grade; + } + ?> +
+
+
+
+
+
getAttributeLabel($side.'_can_lie_flat')?>:
+
+
+
displayValues($element->{$side.'_can_lie_flat'})?>
+
+
+
+
+ +
+
+ +
+
+
+ +
\ No newline at end of file diff --git a/protected/modules/OphCiExamination/widgets/OphCiExamination_Episode_MedicalRetinalHistory.php b/protected/modules/OphCiExamination/widgets/OphCiExamination_Episode_MedicalRetinalHistory.php index 8d4c564c26..425c9393e0 100644 --- a/protected/modules/OphCiExamination/widgets/OphCiExamination_Episode_MedicalRetinalHistory.php +++ b/protected/modules/OphCiExamination/widgets/OphCiExamination_Episode_MedicalRetinalHistory.php @@ -85,9 +85,9 @@ public function addData(\FlotChart $chart) } /** - * @param \FlotChart $chart - * @param Element_OphCiExamination_OCT $oct - * @param string $side + * @param \FlotChart $chart + * @param models\Element_OphCiExamination_OCT $oct + * @param string $side */ protected function addSftReading(\FlotChart $chart, models\Element_OphCiExamination_OCT $oct, $side) { @@ -114,10 +114,10 @@ protected function addInjection(\FlotChart $chart, $va_axis, array $injection, $ $this->injections[$timestamp][$side] = $drug; - if ($side == 'right' && (!$injMin || $timestamp < $injMin)) { + if ($side === 'right' && (!$injMin || $timestamp < $injMin)) { $injMin = $timestamp; } - if ($side == 'left' && (!$injMax || $timestamp > $injMax)) { + if ($side === 'left' && (!$injMax || $timestamp > $injMax)) { $injMax = $timestamp; } } diff --git a/protected/modules/OphCoCorrespondence/assets/js/module.js b/protected/modules/OphCoCorrespondence/assets/js/module.js index 684b804917..aa3f1c0331 100644 --- a/protected/modules/OphCoCorrespondence/assets/js/module.js +++ b/protected/modules/OphCoCorrespondence/assets/js/module.js @@ -18,13 +18,28 @@ var correspondence_markprinted_url, correspondence_print_url; +function setDropDownWidth(id){ + var $option_obj; + var option_width; + var arrow_width = 30; + + $option_obj = $("").html($('#' + id +' option:selected').text()); + $option_obj.appendTo('body'); + option_width = $option_obj.width(); + $option_obj.remove(); + + $('#' + id).width(option_width + arrow_width); +} + function updateCorrespondence(macro_id) { var nickname = $('input[id="ElementLetter_use_nickname"][type="checkbox"]').is(':checked') ? '1' : '0'; var obj = $(this); if ( macro_id != '') { - + + setDropDownWidth('macro_id'); + $.ajax({ 'type': 'GET', 'dataType': 'json', @@ -44,9 +59,7 @@ function updateCorrespondence(macro_id) obj.val(''); //set letter type - if('Post-op' == $('#macro_id option:selected').text() ){ - $('#ElementLetter_letter_type').val(2); - } + $('#ElementLetter_letter_type_id').val(data.sel_letter_type_id); } }); } @@ -77,6 +90,10 @@ $(document).ready(function() { handleButton($('#et_saveprint'),function() { $('#ElementLetter_draft').val(0); }); + + handleButton($('#et_save'),function() { + $('#ElementLetter_draft').val(0); + }); handleButton($('#et_cancel'),function() { $('#dialog-confirm-cancel').dialog({ diff --git a/protected/modules/OphCoCorrespondence/components/OphCoCorrespondence_API.php b/protected/modules/OphCoCorrespondence/components/OphCoCorrespondence_API.php index 42fb235d61..c12eef4759 100644 --- a/protected/modules/OphCoCorrespondence/components/OphCoCorrespondence_API.php +++ b/protected/modules/OphCoCorrespondence/components/OphCoCorrespondence_API.php @@ -53,6 +53,225 @@ public function getLatestEvent($episode) } } + /** + * get the full name of the patient for use in correspondence. + * + * @param Patient $patient + * + * @return string + */ + public function getFullName($patient) + { + $fullname = trim(implode(' ', array($patient->title, $patient->first_name, $patient->last_name))); + return $fullname; + } + + /** + * get the patient title for use in correspondence. + * + * @param Patient $patient + * + * @return string + */ + public function getPatientTitle($patient) + { + return $patient->title; + } + + /** + * get the patient first name for use in correspondence. + * + * @param Patient $patient + * + * @return string + */ + public function getFirstName($patient) + { + return $patient->first_name; + } + + + /** + * get the patient last name for use in correspondence. + * + * @param Patient $patient + * + * @return string + */ + public function getLastName($patient) + { + return $patient->last_name; + } + + + /** + * get the last Examination Date for patient for use in correspondence. + * + * @param Patient $patient + * + * @return string + */ + public function getLastExaminationDate(\Patient $patient) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + $event_type = EventType::model()->find('class_name=?', array('OphCiExamination')); + $event = $this->getMostRecentEventInEpisode($episode->id, $event_type->id); + if (isset($event->event_date)) { + return Helper::convertDate2NHS($event->event_date); + } + } + + return ''; + } + + + public function getOphthalmicDiagnoses(\Patient $patient) + { + $allDiagnoses =''; + foreach ($patient->ophthalmicDiagnoses as $diagnosis) { + return $diagnosis->eye->adjective . ' ' . $diagnosis->disorder->term; + } + } + + public function getLastIOLType(\Patient $patient) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + $event_type = EventType::model()->find('class_name=?', array('OphTrOperationnote')); + $element = $this->getMostRecentElementInEpisode($episode->id, $event_type->id, 'Element_OphTrOperationnote_Cataract'); + return $element->iol_type->name; + } + } + + public function getLastIOLPower(\Patient $patient) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + $event_type = EventType::model()->find('class_name=?', array('OphTrOperationnote')); + $element = $this->getMostRecentElementInEpisode($episode->id, $event_type->id, 'Element_OphTrOperationnote_Cataract'); + return $element->iol_power; + } + } + + public function getLastOperatedEye(\Patient $patient) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + $event_type = EventType::model()->find('class_name=?', array('OphTrOperationnote')); + $element = $this->getMostRecentElementInEpisode($episode->id, $event_type->id, + 'Element_OphTrOperationnote_ProcedureList'); + return $element->eye->adjective; + } + } + + /** + * Get the Pre-Op Visual Acuity - both eyes. + * + * @param $patient + * + * @return string|null + */ + public function getPreOpVABothEyes($patient) + { + if ($apiNote = Yii::app()->moduleAPI->get('OphTrOperationnote')) { + $opDate = $apiNote->getLastOperationDateUnformatted($patient); + } + $api = Yii::app()->moduleAPI->get('OphCiExamination'); + $episode = $patient->getEpisodeForCurrentSubspecialty(); + $event_type = EventType::model()->find('class_name=?', array('OphCiExamination')); + $data = ''; + $criteria = new CDbCriteria(); + $criteria->condition = 'episode_id = :e_id AND event_type_id = :et_id'; + $criteria->addCondition('event_date <= :event_date'); + $criteria->order = ' event_date DESC, created_date DESC'; + $criteria->params = array(':e_id' => $episode->id, ':et_id' => $event_type->id, 'event_date' => $opDate); + + if($events = Event::model()->findAll($criteria)){ + for ($i = 0; $i < count($events); ++$i) { + // Get Most Recent VA + $vaID = $api->getMostRecentVA($events[$i]->id); + if($vaID && !$data){ + $data = $api->getMostRecentVAData($vaID->id); + $chosenVA = $vaID; + } + } + } + + if($data){ + for ($i = 0; $i < count($data); ++$i) { + if($data[$i]->side == 0){ + $rightData[] = $data[$i]; + } + if($data[$i]->side == 1){ + $leftData[] = $data[$i]; + } + } + $unitId = $chosenVA->unit_id; + + $rightVA = $api->getVAvalue($rightData[0]->value, $unitId); + $leftVA = $api->getVAvalue($leftData[0]->value, $unitId); + + return $rightVA . " Right Eye" . " " . $leftVA . " Left Eye"; + }else{ + return; + } + + } + + /** + * Get the Pre-Op Refraction - both eyes. + * + * @param $patient + * + * @return string|null + */ + public function getPreOpRefraction($patient) + { + if ($apiNote = Yii::app()->moduleAPI->get('OphTrOperationnote')) { + $opDate = $apiNote->getLastOperationDateUnformatted($patient); + } + $api = Yii::app()->moduleAPI->get('OphCiExamination'); + $episode = $patient->getEpisodeForCurrentSubspecialty(); + $event_type = EventType::model()->find('class_name=?', array('OphCiExamination')); + $eventtypeid = $event_type->id; +// Refraction here + $refractfound = false; + + if ($eventid = Event::model()->findAll(array( + 'condition' => 'event_type_id = ' . $eventtypeid . ' AND episode_id = ' . $episode->id . " AND event_date <= '" . $opDate . "'", + 'order' => 'event_date DESC', + )) + ) { +// Loop through responses, for ones that have RefractionValues + for ($i = 0; $i < count($eventid); ++$i) { + if ($api->getRefractionValues($eventid[$i]->id)) { + if (!$refractfound) { + $refractelement = $api->getRefractionValues($eventid[$i]->id); + $refract_event_date = $eventid[$i]->event_date; + $refractfound = true; + $rightspherical = number_format($refractelement->{'right_sphere'} + 0.5 * $refractelement->{'right_cylinder'}, 2); + $leftspherical = number_format($refractelement->{'left_sphere'} + 0.5 * $refractelement->{'left_cylinder'}, 2); + return $rightspherical . " Right Eye" . ", " . $leftspherical . " Left Eye"; + } + } + } + } + } + + /** + * Get Allergies in a bullet format. + * + * @param $patient + * + * @return string|null + */ + public function getAllergiesBulleted($patient) + { + $multiAllergies = ''; + foreach ($patient->allergyAssignments as $aa) { + $multiAllergies .= " - " . $aa->allergy->name . "\r\n"; + } + return $multiAllergies; + } + + public function getMacroTargets($patient_id, $macro_id) { if (!$patient = Patient::model()->findByPk($patient_id)) { diff --git a/protected/modules/OphCoCorrespondence/controllers/DefaultController.php b/protected/modules/OphCoCorrespondence/controllers/DefaultController.php index 5054d91f85..cc4035f383 100644 --- a/protected/modules/OphCoCorrespondence/controllers/DefaultController.php +++ b/protected/modules/OphCoCorrespondence/controllers/DefaultController.php @@ -256,7 +256,7 @@ public function actionGetMacroData() $data['textappend_ElementLetter_cc'] = implode("\n", $cc['text']); $data['elementappend_cc_targets'] = implode("\n", $cc['targets']); - $data['sel_letter_type'] = $macro->letter_type; + $data['sel_letter_type_id'] = $macro->letter_type_id; echo json_encode($data); } @@ -396,7 +396,12 @@ public function actionPrint($id) if($to_recipient_gp){ // print an extra copy to note - $this->render('print', array('element' => $letter, 'letter_address' => ($to_recipient_gp->contact_name . "\n" . $to_recipient_gp->address))); + if(!Yii::app()->params['disable_correspondence_notes_copy']) { + $this->render('print', array( + 'element' => $letter, + 'letter_address' => ($to_recipient_gp->contact_name . "\n" . $to_recipient_gp->address) + )); + } } $print_outputs = $letter->getOutputByType("Print"); @@ -407,7 +412,9 @@ public function actionPrint($id) //extra printout for note if($document_target->ToCc == 'To' && $document_target->contact_type != 'GP'){ - $this->render('print', array('element' => $letter, 'letter_address' => ($document_target->contact_name . "\n" . $document_target->address))); + if(!Yii::app()->params['disable_correspondence_notes_copy']){ + $this->render('print', array('element' => $letter, 'letter_address' => ($document_target->contact_name . "\n" . $document_target->address))); + } } } } @@ -431,7 +438,9 @@ public function actionPrint($id) $this->render('print', array('element' => $letter)); if ($this->pdf_print_suffix == 'all' || @$_GET['all']) { - $this->render('print', array('element' => $letter)); + if(!Yii::app()->params['disable_correspondence_notes_copy']) { + $this->render('print', array('element' => $letter)); + } foreach ($letter->getCcTargets() as $letter_address) { $this->render('print', array('element' => $letter, 'letter_address' => $letter_address)); diff --git a/protected/modules/OphCoCorrespondence/models/ElementLetter.php b/protected/modules/OphCoCorrespondence/models/ElementLetter.php index 8cf31408fd..4f3255f6a7 100644 --- a/protected/modules/OphCoCorrespondence/models/ElementLetter.php +++ b/protected/modules/OphCoCorrespondence/models/ElementLetter.php @@ -67,7 +67,7 @@ public function rules() 'print_all, is_signed_off', 'safe' ), - array('letter_type', 'letterTypeValidator'), + array('letter_type_id', 'letterTypeValidator'), array('site_id, date, introduction, body, footer', 'requiredIfNotDraft'), array('use_nickname', 'required'), array('date', 'OEDateValidator'), @@ -75,7 +75,7 @@ public function rules() //array('is_signed_off', 'isSignedOffValidator'), // they do not want this at the moment - waiting for the demo/feedback // The following rule is used by search(). // Please remove those attributes that should not be searched. - array('id, event_id, site_id, use_nickname, date, introduction, re, body, footer, draft, direct_line, letter_type', 'safe', 'on' => 'search'), + array('id, event_id, site_id, use_nickname, date, introduction, re, body, footer, draft, direct_line, letter_type_id', 'safe', 'on' => 'search'), ); } @@ -95,7 +95,7 @@ public function relations() 'site' => array(self::BELONGS_TO, 'Site', 'site_id'), 'enclosures' => array(self::HAS_MANY, 'LetterEnclosure', 'element_letter_id', 'order' => 'display_order'), 'document_instance' => array(self::HAS_MANY, 'DocumentInstance', array( 'correspondence_event_id' => 'event_id')), - + 'letterType' => array(self::BELONGS_TO, 'LetterType', 'letter_type_id'), ); } diff --git a/protected/modules/OphCoCorrespondence/models/FirmSiteSecretary.php b/protected/modules/OphCoCorrespondence/models/FirmSiteSecretary.php index 5fa3994c22..c53baf7146 100644 --- a/protected/modules/OphCoCorrespondence/models/FirmSiteSecretary.php +++ b/protected/modules/OphCoCorrespondence/models/FirmSiteSecretary.php @@ -57,7 +57,7 @@ public function rules() // will receive user inputs. return array( array('firm_id, site_id, direct_line, fax', 'safe'), - array('firm_id, site_id, direct_line', 'required'), + array('firm_id, site_id', 'required'), array('firm_id', 'ext.validators.UniqueSiteFirmValidator', 'message' => 'Only one contact can be added for each firm and site'), // The following rule is used by search(). // Please remove those attributes that should not be searched. diff --git a/protected/modules/OphCoCorrespondence/models/LetterMacro.php b/protected/modules/OphCoCorrespondence/models/LetterMacro.php index d9f55eba4c..ab6a6e9276 100644 --- a/protected/modules/OphCoCorrespondence/models/LetterMacro.php +++ b/protected/modules/OphCoCorrespondence/models/LetterMacro.php @@ -54,7 +54,7 @@ public function tableName() public function rules() { return array( - array('name, recipient_id, use_nickname, body, cc_patient, cc_doctor, display_order, site_id, subspecialty_id, firm_id, cc_drss, episode_status_id, letter_type', 'safe'), + array('name, recipient_id, use_nickname, body, cc_patient, cc_doctor, display_order, site_id, subspecialty_id, firm_id, cc_drss, episode_status_id, letter_type_id', 'safe'), array('name, use_nickname, body, cc_patient, cc_doctor, type', 'required'), array('site_id', 'RequiredIfFieldValidator', 'field' => 'type', 'value' => 'site'), array('subspecialty_id', 'RequiredIfFieldValidator', 'field' => 'type', 'value' => 'subspecialty'), diff --git a/protected/modules/OphCoCorrespondence/models/LetterType.php b/protected/modules/OphCoCorrespondence/models/LetterType.php new file mode 100644 index 0000000000..8d48ae9e6e --- /dev/null +++ b/protected/modules/OphCoCorrespondence/models/LetterType.php @@ -0,0 +1,100 @@ +. + * + * @link http://www.openeyes.org.uk + * + * @author OpenEyes + * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust + * @copyright Copyright (c) 2011-2013, OpenEyes Foundation + * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 + */ + +/** + * The followings are the available columns in table '':. + * + * @property string $id + * @property int $event_id + * + * The followings are the available model relations: + * @property Event $event + */ +class LetterType extends BaseActiveRecordVersioned +{ + + /** + * Returns the static model of the specified AR class. + * + * @return ElementOperation the static model class + */ + public static function model($className = __CLASS__) + { + return parent::model($className); + } + + /** + * @return string the associated database table name + */ + public function tableName() + { + return 'ophcocorrespondence_letter_type'; + } + + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + return array( + array('name', 'safe'), + array('name', 'required'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array(); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'name' => 'Letter Type', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria = new CDbCriteria(); + + $criteria->compare('id', $this->id, true); + $criteria->compare('name', $this->name, true); + + return new CActiveDataProvider(get_class($this), array( + 'criteria' => $criteria, + )); + } +} diff --git a/protected/modules/OphCoCorrespondence/views/admin/_macro.php b/protected/modules/OphCoCorrespondence/views/admin/_macro.php index 5f51cfaf97..69c29c5c19 100644 --- a/protected/modules/OphCoCorrespondence/views/admin/_macro.php +++ b/protected/modules/OphCoCorrespondence/views/admin/_macro.php @@ -32,7 +32,7 @@ ), ))?> dropDownList($macro, 'type', array('site' => 'Site', 'subspecialty' => 'Subspecialty', 'firm' => 'Firm'), array('empty' => '- Type -'))?> - dropDownList($macro, 'letter_type', array('1'=>'Clinic discharge letter', '2'=>'Post-op letter', '3'=>'Clinic letter', '4'=>'Other letter'), array('empty' => '- Letter type -'))?> + dropDownList($macro, 'letter_type_id', CHtml::listData(LetterType::model()->findAll(array('order' => 'name asc')), 'id', 'name'), array('empty' => '- Letter type -'))?> dropDownList($macro, 'site_id', Site::model()->getListForCurrentInstitution(), array('empty' => '- Site -', 'div-class' => 'typeSite'), $macro->type != 'site')?> dropDownList($macro, 'subspecialty_id', CHtml::listData(Subspecialty::model()->findAll(array('order' => 'name asc')), 'id', 'name'), array('empty' => '- Subspecialty -', 'div-class' => 'typeSubspecialty'), $macro->type != 'subspecialty')?> dropDownList($macro, 'firm_id', Firm::model()->getListWithSpecialties(true), array('empty' => '- Firm -', 'div-class' => 'typeFirm'), $macro->type != 'firm')?> diff --git a/protected/modules/OphCoCorrespondence/views/default/create_ElementLetter.php b/protected/modules/OphCoCorrespondence/views/default/create_ElementLetter.php index 72ea903c7d..7c703563e0 100644 --- a/protected/modules/OphCoCorrespondence/views/default/create_ElementLetter.php +++ b/protected/modules/OphCoCorrespondence/views/default/create_ElementLetter.php @@ -25,15 +25,16 @@ $layoutColumns = $form->layoutColumns; $macro_id = isset($_POST['macro_id']) ? $_POST['macro_id'] : (isset($element->macro->id) ? $element->macro->id : null); -$macro_name = null; + +$macro_letter_type_id = null; if($macro_id){ $macro = LetterMacro::model()->findByPk($macro_id); - $macro_name = $macro ? $macro->name : null; + $macro_letter_type_id = $macro->letter_type_id; } $patient_id = Yii::app()->request->getQuery('patient_id', null); $patient = Patient::model()->findByPk($patient_id); -$element->letter_type = ($element->letter_type ? $element->letter_type : ( $macro_name == 'Post-op' ? 2 : null ) ); +$element->letter_type_id = ($element->letter_type_id ? $element->letter_type_id : $macro_letter_type_id ); ?>
@@ -59,8 +60,8 @@
-
- letter_macros, array('empty' => '- Macro -', 'nowrapper' => true, 'class' => 'full-width')); ?> +
+ letter_macros, array('empty' => '- Macro -', 'nowrapper' => true, 'class' => 'full-width resizeselect')); ?>
@@ -69,11 +70,8 @@
- dropDownList($element, 'letter_type', - array( '1' => 'Clinic discharge letter', - '2' => 'Post-op letter', - '3' => 'Clinic letter', - '4' => 'Other letter'), + + dropDownList($element, 'letter_type_id', CHtml::listData(LetterType::model()->findAll(array('order' => 'name asc')), 'id', 'name'), array('empty' => '- Please select -', 'nowrapper' => true, 'class' => 'full-width')) ?>
@@ -364,6 +362,8 @@ array('nowrapper' => true) ); ?>
-
-
\ No newline at end of file +
+ diff --git a/protected/modules/OphCoCorrespondence/views/default/update_ElementLetter.php b/protected/modules/OphCoCorrespondence/views/default/update_ElementLetter.php index a1c8ab31d9..65decffc43 100644 --- a/protected/modules/OphCoCorrespondence/views/default/update_ElementLetter.php +++ b/protected/modules/OphCoCorrespondence/views/default/update_ElementLetter.php @@ -29,13 +29,14 @@ if( !$macro_id ){ $macro_id = isset($element->document_instance[0]->document_instance_data[0]->macro_id) ? $element->document_instance[0]->document_instance_data[0]->macro_id : null; } -$macro_name = null; + +$macro_letter_type_id = null; if($macro_id){ $macro = LetterMacro::model()->findByPk($macro_id); - $macro_name = $macro ? $macro->name : null; + $macro_letter_type_id = $macro->letter_type_id; } -$element->letter_type = ($element->letter_type ? $element->letter_type : ( $macro_name == 'Post-op' ? 2 : null ) ); +$element->letter_type_id = ($element->letter_type_id ? $element->letter_type_id : $macro_letter_type_id ); $patient_id = Yii::app()->request->getQuery('patient_id', null); $patient = Patient::model()->findByPk($patient_id); @@ -67,17 +68,16 @@
-
- letter_macros, array('empty' => '- Macro -', 'nowrapper' => true, 'class' => 'full-width')); ?> +
+ letter_macros, array('empty' => '- Macro -', 'nowrapper' => true, 'class' => 'full-width resizeselect')); ?>
-
- dropDownList($element, 'letter_type', array('1' => 'Clinic discharge letter', '2' => 'Post-op letter', '3' => 'Clinic letter', '4' => 'Other letter'), + dropDownList($element, 'letter_type_id', CHtml::listData(LetterType::model()->findAll(array('order' => 'name asc')), 'id', 'name'), array('empty' => '- Please select -', 'nowrapper' => true, 'class' => 'full-width')) ?>
diff --git a/protected/modules/OphCoCvi/migrations/m170119_125608_add_new_preferred_info_fmt.php b/protected/modules/OphCoCvi/migrations/m170119_125608_add_new_preferred_info_fmt.php new file mode 100644 index 0000000000..71318bd240 --- /dev/null +++ b/protected/modules/OphCoCvi/migrations/m170119_125608_add_new_preferred_info_fmt.php @@ -0,0 +1,34 @@ +insert('ophcocvi_clericinfo_preferred_info_fmt', array( + 'name' => 'No Preference', + 'require_email' => '0', + 'active' => '1', + 'display_order' => '5', + 'code' => 'NOPREF', + 'last_modified_user_id' => '1', + 'created_user_id' => '1', + 'deleted' => '0', + )); + } + + public function down() + { + $this->delete('ophcocvi_clericinfo_preferred_info_fmt', '`name`="No Preference"'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/protected/modules/OphCoCvi/models/Element_OphCoCvi_ConsentSignature.php b/protected/modules/OphCoCvi/models/Element_OphCoCvi_ConsentSignature.php index 38520029d2..776fab6d57 100644 --- a/protected/modules/OphCoCvi/models/Element_OphCoCvi_ConsentSignature.php +++ b/protected/modules/OphCoCvi/models/Element_OphCoCvi_ConsentSignature.php @@ -102,7 +102,7 @@ public function attributeLabels() return array( 'id' => 'ID', 'event_id' => 'Event', - 'is_patient' => 'Is patient', + 'is_patient' => 'Patient', 'signature_date' => 'Signature date', 'representative_name' => 'Representative name', 'signature_file_id' => 'Signature File', diff --git a/protected/modules/OphCoCvi/views/default/form_Element_OphCoCvi_ConsentSignature.php b/protected/modules/OphCoCvi/views/default/form_Element_OphCoCvi_ConsentSignature.php index 9bbb24d80b..ab30377296 100644 --- a/protected/modules/OphCoCvi/views/default/form_Element_OphCoCvi_ConsentSignature.php +++ b/protected/modules/OphCoCvi/views/default/form_Element_OphCoCvi_ConsentSignature.php @@ -22,13 +22,20 @@ array('style' => 'width: 110px;')) ?>
- +
- radioBoolean($element, 'is_patient', array('nowrapper' => true)) ?> + radioButtons($element, 'is_patient', array( + 1 => 'Patient', + 0 => "Patient's Representative", + ), + $element->is_patient, + false, false, false, false, + array('nowrapper' => true) + ); ?> + radioBoolean($element, 'is_patient', array('nowrapper' => true)) ?>
- textField($element, 'representative_name', array('hide' => $element->is_patient), null, array('field' => 4)) ?>
diff --git a/protected/modules/OphCoMessaging/components/MessageCreator.php b/protected/modules/OphCoMessaging/components/MessageCreator.php index bf88e6ed0a..ba78cffd67 100644 --- a/protected/modules/OphCoMessaging/components/MessageCreator.php +++ b/protected/modules/OphCoMessaging/components/MessageCreator.php @@ -182,7 +182,11 @@ public function emailAlert(array $recipients, $subject, $content) $message->setSubject($subject); $message->setBody($content); - return \Yii::app()->mailer->sendMessage($message); + try { + return \Yii::app()->mailer->sendMessage($message); + } catch (\Exception $e) { + return false; + } } } diff --git a/protected/modules/OphCoTherapyapplication/services/OphCoTherapyapplication_Processor.php b/protected/modules/OphCoTherapyapplication/services/OphCoTherapyapplication_Processor.php index b9ec642835..0706c34d41 100644 --- a/protected/modules/OphCoTherapyapplication/services/OphCoTherapyapplication_Processor.php +++ b/protected/modules/OphCoTherapyapplication/services/OphCoTherapyapplication_Processor.php @@ -561,8 +561,8 @@ private function getServiceInfo() private function getEmailRecipients($service_info, $recipient_type) { - if (!$recipients = OphCoTherapyapplication_Email_Recipient::model()->with('type')->findAll('site_id = ? and type.id is null or type.name = ?', array($service_info->site_id, $recipient_type))) { - if (!$recipients = OphCoTherapyapplication_Email_Recipient::model()->with('type')->findAll('site_id is null and type.id is null or type.name = ?', array($recipient_type))) { + if (!$recipients = OphCoTherapyapplication_Email_Recipient::model()->with('type')->findAll('site_id = ? and (type.id is null or type.name = ?)', array($service_info->site_id, $recipient_type))) { + if (!$recipients = OphCoTherapyapplication_Email_Recipient::model()->with('type')->findAll('site_id is null and (type.id is null or type.name = ?)', array($recipient_type))) { throw new Exception('No email recipient defined for site '.$service_info->site->name.", $recipient_type"); } } diff --git a/protected/modules/OphInBiometry/assets/css/module.css b/protected/modules/OphInBiometry/assets/css/module.css index 7ccc4e18f0..604ca4e9e0 100644 --- a/protected/modules/OphInBiometry/assets/css/module.css +++ b/protected/modules/OphInBiometry/assets/css/module.css @@ -32,11 +32,11 @@ } /* line 19, ../sass/components/_event.scss */ .event .event-content { - background-image: url('../img/watermark.png?1457349986'); + background-image: url('../img/watermark.png?1473759482'); } /* line 22, ../sass/components/_event.scss */ .event .event-title { - background-image: url('../img/medium.png?1457349986'); + background-image: url('../img/medium.png?1473759482'); } /* line 27, ../sass/components/_event.scss */ @@ -114,16 +114,25 @@ label.rse_d_left, label.rse_d_right { .highlighted-calculation { border-left: 3px solid #FF9900 !important; border-right: 3px solid #FF9900 !important; - border-bottom: 3px solid #FF9900; + border-top: 3px solid transparent; } /* line 96, ../sass/components/_event.scss */ +.highlighted-comments { + border-bottom: 3px solid transparent; + border-left: 3px solid #FF9900 !important; + border-right: 3px solid #FF9900 !important; + border-bottom: 3px solid #FF9900; + margin-bottom: 3px; +} + +/* line 104, ../sass/components/_event.scss */ .disabled { opacity: 0.60; border-bottom: 3px solid transparent; } -/* line 101, ../sass/components/_event.scss */ +/* line 109, ../sass/components/_event.scss */ .top-pad { border-top: 3px solid transparent; border-left: 3px solid transparent; @@ -131,18 +140,18 @@ label.rse_d_left, label.rse_d_right { border-bottom: 3px solid transparent; } -/* line 108, ../sass/components/_event.scss */ +/* line 116, ../sass/components/_event.scss */ tr:hover, tr.even:hover, tr:nth-of-type(even):hover, tr.alt.hover { border: 0px solid #FF9900; background: #FFFFE0; } -/* line 113, ../sass/components/_event.scss */ +/* line 121, ../sass/components/_event.scss */ .highlighted, tr:nth-of-type(even).highlighted { background-color: #FF9900; } -/* line 117, ../sass/components/_event.scss */ +/* line 125, ../sass/components/_event.scss */ .readonly-box { background-color: #dddddd; padding: 4px 6px; @@ -152,12 +161,12 @@ tr:hover, tr.even:hover, tr:nth-of-type(even):hover, tr.alt.hover { border-radius: 3px; } -/* line 126, ../sass/components/_event.scss */ +/* line 134, ../sass/components/_event.scss */ .box-margin { margin-left: 40px; } -/* line 129, ../sass/components/_event.scss */ +/* line 137, ../sass/components/_event.scss */ .readonly-div { height: auto; border: 1px solid #6b8aaa; @@ -165,7 +174,7 @@ tr:hover, tr.even:hover, tr:nth-of-type(even):hover, tr.alt.hover { width: 1025px; } -/* line 135, ../sass/components/_event.scss */ +/* line 143, ../sass/components/_event.scss */ .closest { font-weight: bold; } diff --git a/protected/modules/OphInBiometry/assets/sass/components/_event.scss b/protected/modules/OphInBiometry/assets/sass/components/_event.scss index e1008bdce9..ec4789c737 100644 --- a/protected/modules/OphInBiometry/assets/sass/components/_event.scss +++ b/protected/modules/OphInBiometry/assets/sass/components/_event.scss @@ -88,9 +88,17 @@ label.rse_d_left, label.rse_d_right { } .highlighted-calculation{ + border-left: 3px solid #FF9900 !important; + border-right: 3px solid #FF9900 !important; + border-top:3px solid transparent; +} + +.highlighted-comments{ + border-bottom: 3px solid transparent; border-left: 3px solid #FF9900 !important; border-right: 3px solid #FF9900 !important; border-bottom: 3px solid #FF9900; + margin-bottom: 3px; } .disabled{ diff --git a/protected/modules/OphInBiometry/migrations/m161021_110716_add_eye_comments.php b/protected/modules/OphInBiometry/migrations/m161021_110716_add_eye_comments.php new file mode 100644 index 0000000000..faec17c68f --- /dev/null +++ b/protected/modules/OphInBiometry/migrations/m161021_110716_add_eye_comments.php @@ -0,0 +1,31 @@ +addColumn('et_ophinbiometry_calculation', 'comments_right', 'text'); + $this->addColumn('et_ophinbiometry_calculation', 'comments_left', 'text'); + $this->addColumn('et_ophinbiometry_calculation_version', 'comments_right', 'text'); + $this->addColumn('et_ophinbiometry_calculation_version', 'comments_left', 'text'); + } + + public function down() + { + $this->dropColumn('et_ophinbiometry_calculation', 'comments_right'); + $this->dropColumn('et_ophinbiometry_calculation', 'comments_left'); + $this->dropColumn('et_ophinbiometry_calculation_version', 'comments_right'); + $this->dropColumn('et_ophinbiometry_calculation_version', 'comments_left'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/protected/modules/OphInBiometry/models/Element_OphInBiometry_Calculation.php b/protected/modules/OphInBiometry/models/Element_OphInBiometry_Calculation.php index 648b11f967..29d84b4186 100644 --- a/protected/modules/OphInBiometry/models/Element_OphInBiometry_Calculation.php +++ b/protected/modules/OphInBiometry/models/Element_OphInBiometry_Calculation.php @@ -65,7 +65,7 @@ public function rules() // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( - array('event_id, target_refraction_left, eye_id, formula_id_left,target_refraction_right, formula_id_right, comments', 'safe'), + array('event_id, target_refraction_left, eye_id, formula_id_left,target_refraction_right, formula_id_right, comments, comments_left, comments_right', 'safe'), array('target_refraction_left, target_refraction_right', 'match', 'pattern' => '/([0-9]*?)(\.[0-9]{0,2})?/'), array('target_refraction_left', 'checkNumericRangeIfSide', 'side' => 'left', 'max' => 10, 'min' => -10), array('target_refraction_right', 'checkNumericRangeIfSide', 'side' => 'right', 'max' => 10, 'min' => -10), @@ -108,6 +108,8 @@ public function attributeLabels() 'formula_id_right' => 'Formula', 'emmetropia_left' => 'Emmetropic IOL power', 'emmetropia_right' => 'Emmetropic IOL power', + 'comments_right' => 'General Comments', + 'comments_left' => 'General Comments', ); } diff --git a/protected/modules/OphInBiometry/views/default/form_Element_OphInBiometry_Calculation.php b/protected/modules/OphInBiometry/views/default/form_Element_OphInBiometry_Calculation.php index bbe7c5d9a3..c1d6b55e32 100644 --- a/protected/modules/OphInBiometry/views/default/form_Element_OphInBiometry_Calculation.php +++ b/protected/modules/OphInBiometry/views/default/form_Element_OphInBiometry_Calculation.php @@ -56,16 +56,52 @@ +
+
+
+
+ General Comments: +
+
+
+
+ textArea($element, 'comments_right', + array('rows' => 3, 'label' => false, 'nowrapper' => true), false, + array('class' => 'comments_right')) ?> +
+
+
+
+
+
+ General Comments: +
+
+
+
+ textArea($element, 'comments_left', + array('rows' => 3, 'label' => false, 'nowrapper' => true), false, + array('class' => 'comments_left')) ?> +
+
+
+
- + is_auto) { - echo 'Comments:
'.$element->{'comments'}.'
'; - } else { - echo $form->textField($element, 'comments', array('style' => 'width:1027px;'), null, array('label' => 4, 'field' => 200)); - } - ?> + if ($this->is_auto) { + if (!$this->getAutoBiometryEventData($this->event->id)[0]->is700() || $element->{'comments'}) { + echo 'Device Comments:'; + echo '
' . $element->{'comments'} . '
'; + } + } else { + echo $form->textField($element, 'comments', array('style' => 'width:1027px;'), null, + array('label' => 4, 'field' => 200)); + } + ?>
diff --git a/protected/modules/OphInBiometry/views/default/form_Element_OphInBiometry_Measurement.php b/protected/modules/OphInBiometry/views/default/form_Element_OphInBiometry_Measurement.php index dcaaf055f0..23a56ad8be 100644 --- a/protected/modules/OphInBiometry/views/default/form_Element_OphInBiometry_Measurement.php +++ b/protected/modules/OphInBiometry/views/default/form_Element_OphInBiometry_Measurement.php @@ -20,81 +20,477 @@ event != null && $element->event->id > 0) { - $iolRefValues = Element_OphInBiometry_IolRefValues::Model()->findAllByAttributes( - array( - 'event_id' => $element->event->id, - )); - } else { - $iolRefValues = array(); +if ($element->event != null && $element->event->id > 0) { + $iolRefValues = Element_OphInBiometry_IolRefValues::Model()->findAllByAttributes( + array( + 'event_id' => $element->event->id, + )); +} else { + $iolRefValues = array(); +} + +if ($eventtype = EventType::model()->find('class_name = "OphCiExamination"')){ + $eventtypeid = $eventtype->id; +} + +?> +episode; +if ($api = Yii::app()->moduleAPI->get('OphCiExamination')) { + + $chosenVA[] = array(''); + + //Get All Events for episode. + $criteria = new CDbCriteria(); + $criteria->condition = 'episode_id = :e_id AND event_type_id = :e_typeid'; + $criteria->order = ' event_date DESC'; + $criteria->params = array(':e_id' => $episode->id, ':e_typeid' => $eventtypeid); + + //For each event, check if =event_id in _visualacuity. + + if($events = Event::model()->findAll($criteria)){ + for ($i = 0; $i < count($events); ++$i) { + // Get Most Recent VA + $vaID = $api->getMostRecentVA($events[$i]->id); + if($vaID && !$data){ + $data = $api->getMostRecentVAData($vaID->id); + $chosenVA = $vaID; + $VAdate = "- (exam date " . date("d M Y", strtotime($events[$i]->event_date)) . ")"; + } + } + } + + $rightData = array(); + $leftData = array(); + + for ($i = 0; $i < count($data); ++$i) { + if($data[$i]->side == 0){ + $rightData[] = $data[$i]; + } + if($data[$i]->side == 1){ + $leftData[] = $data[$i]; + } } + + $methodnameRight = array(); + $methodnameLeft = array(); + + if($data){ + $unitId = $chosenVA->unit_id; + + for ($i = 0; $i < count($rightData); ++$i) { + $VAfinalright = $api->getVAvalue($rightData[$i]->value, $unitId); + } + + for ($i = 0; $i < count($leftData); ++$i) { + $VAfinalleft = $api->getVAvalue($leftData[$i]->value, $unitId); + } + + $methodIdRight = $api->getMethodIdRight($chosenVA->id, $episode); + for ($i = 0; $i < count($methodIdRight); ++$i) { + $methodnameRight[$i] = $api->getMethodName($methodIdRight[$i]->method_id); + } + + $methodIdLeft = $api->getMethodIdLeft($chosenVA->id, $episode); + for ($i = 0; $i < count($methodIdLeft); ++$i) { + $methodnameLeft[$i] = $api->getMethodName($methodIdLeft[$i]->method_id); + } + + $unitname = $api->getUnitName($unitId); + } +} + ?> -
-
- hiddenInput($element, 'eye_id', false, array('class' => 'sideField')); ?> -
-
-

RIGHT

-
-
- Remove side - renderPartial('form_Element_OphInBiometry_Measurement_fields', array('side' => 'right', 'element' => $element, 'form' => $form, 'data' => $data, 'measurementInput' => $iolRefValues)); ?> -
- -
-
-
-

LEFT

-
-
- Remove side - renderPartial('form_Element_OphInBiometry_Measurement_fields', array('side' => 'left', 'element' => $element, 'form' => $form, 'data' => $data, 'measurementInput' => $iolRefValues)); ?> -
- -
-
+
+
  +
+
+
+
+

Visual Acuity

+
+
+
+ +
+
+ +
+
+
+
+ getVAvalue($rightData[$i]->value, $unitId) . " " . $methodnameRight[$i]; + if ($i != (count($methodnameRight) - 1)) { + echo ", "; + } + } + ?> +
+
+ +
+
+ Not recorded +
+
+ +
+
+ +
+
+ +
+
+
+
+ getVAvalue($leftData[$i]->value, $unitId) . " " . $methodnameLeft[$i]; + if ($i != (count($methodnameLeft) - 1)) { + echo ", "; + } + } + ?> +
+
+ +
+
+ Not recorded +
+
+ +
+
+
+ +moduleAPI->get('OphCiExamination')) { + for ($i = 0; $i < count($events); ++$i) { + // Get Most Recent VA + $vaID = $api->getMostRecentNearVA($events[$i]->id); + // Loop through $data and separate into different eyes + if ($vaID && !$NearVAFound) { + $neardata = $api->getMostRecentNearVAData($vaID->id); + $chosenNearVA = $vaID; + $NearVAFound = true; + $NearVAdate = "- (exam date " . date("d M Y", strtotime($events[$i]->event_date)) . ")"; + } + } + + $rightNearData = array(); + $leftNearData = array(); + + if($NearVAFound){ + for ($i = 0; $i < count($neardata); ++$i) { + if($neardata[$i]->side == 0){ + $rightNearData[] = $neardata[$i]; + } + if($neardata[$i]->side == 1){ + $leftNearData[] = $neardata[$i]; + } + } + + $unitId = $chosenNearVA->unit_id; + + for ($i = 0; $i < count($rightNearData); ++$i) { + $VAfinalright = $api->getVAvalue($rightNearData[$i]->value, $unitId); + } + + for ($i = 0; $i < count($leftNearData); ++$i) { + $VAfinalleft = $api->getVAvalue($leftNearData[$i]->value, $unitId); + } + + $methodIdRight = $api->getMethodIdNearRight($chosenNearVA->id); + for ($i = 0; $i < count($rightNearData); ++$i) { + $methodnameRight[$i] = $api->getMethodName($rightNearData[$i]->method_id); + } + + $methodIdLeft = $api->getMethodIdNearLeft($chosenNearVA->id); + for ($i = 0; $i < count($leftNearData); ++$i) { + $methodnameLeft[$i] = $api->getMethodName($leftNearData[$i]->method_id); + } + + $unitname = $api->getUnitName($unitId); + } +} +?> + +
+
+

Near Visual Acuity

+
+
+
+ +
+
+ +
+
+
+
+ + getVAvalue($rightNearData[$i]->value, $unitId). " " . $methodnameRight[$i]; + if ($i != (count($rightNearData) - 1)) { + echo ", "; + } + } + ?> +
+
+ +
+
+ Not recorded +
+
+ +
+
+ +
+
+ +
+
+
+
+ getVAvalue($leftNearData[$i]->value, $unitId) . " " . $methodnameLeft[$i]; + if ($i != (count($leftNearData) - 1)) { + echo ", "; + } + } + ?> +
+
+ +
+
+ Not recorded +
+
+ +
+
+
+ +findAll(array( + 'condition' => 'event_type_id = ' . $eventtypeid . ' AND episode_id = ' . $episode->id, + 'order' => 'event_date DESC', +))){ +// Loop through responses, for ones that have RefractionValues +for ($i = 0; $i < count($eventid); ++$i) { + if ($api->getRefractionValues($eventid[$i]->id)) { + if (!$refractfound){ + $refractelement = $api->getRefractionValues($eventid[$i]->id); + $refract_event_date = $eventid[$i]->event_date; + $refractfound = true; + } + } +} + +if ($refractfound) { +?> +
+
+

Refraction - (exam date )

+
+
+
+ hasRight()) { + ?> +
+ renderPartial($element->view_view . '_OEEyeDraw', + array('side' => 'right', 'element' => $refractelement)); + ?> +
+ +
+
+ Not recorded +
+
+ +
+
+ hasLeft()) { + ?> + renderPartial($element->view_view . '_OEEyeDraw', + array('side' => 'left', 'element' => $refractelement)); + ?> + +
+
+ Not recorded +
+
+ +
+
+ +
+
+

Refraction - (Not Recorded)

+
+
+
+
+
+ Not recorded +
+
+
+
+
+
+ Not recorded +
+
+
+
+ +
+
+
+ hiddenInput($element, 'eye_id', false, array('class' => 'sideField')); ?> +
+
+

RIGHT

+
+
+ Remove side + id, array('class' => 'element_id')); ?> +
+ +
+ renderPartial('form_Element_OphInBiometry_Measurement_fields', array( + 'side' => 'right', + 'element' => $element, + 'form' => $form, + 'data' => $data, + 'measurementInput' => $iolRefValues, + )); ?> +
+ +
+
+
+

LEFT

+
+ + +
+ renderPartial('form_Element_OphInBiometry_Measurement_fields', array( + 'side' => 'left', + 'element' => $element, + 'form' => $form, + 'data' => $data, + 'measurementInput' => $iolRefValues, + )); ?>
+
+
+
+
- diff --git a/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Calculation.php b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Calculation.php index 9015055c7e..53a13df07f 100644 --- a/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Calculation.php +++ b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Calculation.php @@ -39,7 +39,7 @@
  Comments: '.$element->{'comments'}; + echo 'Device Comments: '.$element->{'comments'}; ?>
diff --git a/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Calculation_fields.php b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Calculation_fields.php index af71e9bfb1..d4f64f122d 100644 --- a/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Calculation_fields.php +++ b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Calculation_fields.php @@ -1,3 +1,18 @@ +
+
+
+
getAttributeLabel('comments_'.$side)) ?>:
+
+
+
{'comments_'.$side}) ?>
+
+
+
diff --git a/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Measurement_OEEyeDraw.php b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Measurement_OEEyeDraw.php new file mode 100644 index 0000000000..d5338cb271 --- /dev/null +++ b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Measurement_OEEyeDraw.php @@ -0,0 +1,39 @@ +. + * + * @link http://www.openeyes.org.uk + * + * @author OpenEyes + * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust + * @copyright Copyright (c) 2011-2013, OpenEyes Foundation + * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 + */ +?> +
+ format->text($element->getCombined($side)) ?>
+ Spherical equivalent: {$side.'_sphere'} + 0.5 * $element->{$side.'_cylinder'}, 2)?> + {$side.'_notes'}) { + ?> + textWithLineBreaks($side.'_notes')?> + +
+
+ widget('application.modules.eyedraw.OEEyeDrawWidget', array( + 'idSuffix' => $side.'_'.$element->elementType->id.'_'.$element->id, + 'side' => ($side == 'right') ? 'R' : 'L', + 'mode' => 'view', + 'width' => 100, + 'height' => 100, + 'model' => $element, + 'attribute' => $side.'_axis_eyedraw', + ))?> +
diff --git a/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Selection_fields.php b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Selection_fields.php index 4b4c23d1c1..f7c9fe5da4 100644 --- a/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Selection_fields.php +++ b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_Selection_fields.php @@ -54,18 +54,20 @@ class="field-info">getAttributeLabel('lens
is_auto) { $iolrefValues = Element_OphInBiometry_IolRefValues::model()->findAllByAttributes(array('event_id' => $element->event->id)); foreach ($iolrefValues as $iolrefData) { if (isset($data)) { if ($iolrefData->lens_id == $element->{'lens_'.$side}->id && $iolrefData->formula_id == $data[0]->id) { - echo $this->formatAconst($iolrefData->constant); + $aconst = $this->formatAconst($iolrefData->constant); } } } } else { - echo ($element->{'lens_'.$side}) ? $this->formatAconst($element->{'lens_'.$side}->acon) : 'None'; + $aconst = ($element->{'lens_'.$side}) ? $this->formatAconst($element->{'lens_'.$side}->acon) : 'None'; } + echo $aconst; ?>
diff --git a/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_VisualAcuity.php b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_VisualAcuity.php new file mode 100644 index 0000000000..731e60ca84 --- /dev/null +++ b/protected/modules/OphInBiometry/views/default/view_Element_OphInBiometry_VisualAcuity.php @@ -0,0 +1,124 @@ +. + * + * @link http://www.openeyes.org.uk + * + * @author OpenEyes + * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust + * @copyright Copyright (c) 2011-2013, OpenEyes Foundation + * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 + */ +?> + +id, array('class' => 'element_id')); ?> + +
+
+ hasRight()) { + ?> + getCombined('right')) { + ?> +
+
+ unit->name ?> +
+
+
+
+ getCombined('right') ?> +
+
+ +
+
+ Not recorded + right_unable_to_assess) { + ?> + (Unable to assessright_eye_missing) { + ?>, eye missing) + right_eye_missing) { + ?> + (Eye missing) + +
+
+ + +
+
+ Not recorded +
+
+ +
+
+ hasLeft()) { + ?> + getCombined('left')) { + ?> +
+
+ unit->name ?> +
+
+
+
+ getCombined('left') ?> +
+
+ +
+
+ Not recorded + left_unable_to_assess) { + ?> + (Unable to assessleft_eye_missing) { + ?>, eye missing) + left_eye_missing) { + ?> + (Eye missing) + +
+
+ + +
+
+ Not recorded +
+
+ +
+
diff --git a/protected/modules/OphTrIntravitrealinjection/components/OphTrIntravitrealinjection_API.php b/protected/modules/OphTrIntravitrealinjection/components/OphTrIntravitrealinjection_API.php index 7308a5fcef..a490acba7f 100644 --- a/protected/modules/OphTrIntravitrealinjection/components/OphTrIntravitrealinjection_API.php +++ b/protected/modules/OphTrIntravitrealinjection/components/OphTrIntravitrealinjection_API.php @@ -1,4 +1,5 @@ legacy_api; } - /** - * caching method for previous injections store. - * - * @param Patient $patient - * @param Episode $episode - * - * @return Element_OphTrIntravitrealinjection_Treatment[] - */ - protected function previousInjectionsForPatientEpisode($patient, $episode) - { - if (!isset($this->previous_treatments[$patient->id])) { - $this->previous_treatments[$patient->id] = array(); - } - - if (!isset($this->previous_treatments[$patient->id][$episode->id])) { - $events = $this->getEventsInEpisode($patient, $episode); - $previous = array(); - foreach ($events as $event) { - if ($treat = Element_OphTrIntravitrealinjection_Treatment::model()->find('event_id = :event_id', array(':event_id' => $event->id))) { - $previous[] = $treat; - } - } - $this->previous_treatments[$patient->id][$episode->id] = $previous; - } - - return $this->previous_treatments[$patient->id][$episode->id]; - } - /** * return only previous injections given a starting event id. */ @@ -71,73 +44,103 @@ public function previousInjectionsByEvent($event_id, $side, $drug) $event = Event::model()->find('id = :id', array(':id' => $event_id)); $episode = $event->episode; $patient = $event->episode->patient; - $injections = $this->previousInjections($patient, $episode, $side, $drug); - //remove this event and events in the future - $previousInjections = array(); - foreach ($injections as $injection) { - if ($event_id > $injection['event_id']) { - $previousInjections[] = $injection; - } - } - - return $previousInjections; + return $this->previousInjections($patient, $episode, $side, $drug, $event->event_date); } /** * return the set of treatment elements from previous injection events in descending order. * - * @param Patient $patient - * @param Episode $episode - * @param string $side - * @param Drug $drug + * @param Patient $patient + * @param Episode $episode + * @param string $side + * @param OphTrIntravitrealinjection_Treatment_Drug $drug + * @param string $since * * @throws Exception * * @return array {$side . '_drug_id' => integer, $side . '_number' => integer, 'date' => datetime}[] - array of treatment elements for the eye and optional drug */ - public function previousInjections($patient, $episode, $side, $drug = null) + public function previousInjections($patient, $episode, $side, $drug = null, $since = 'now') { $res = array(); + // NOTE: we assume that all legacy injections would be from before any injections in + // this module. Should this prove not to be the case, we would need to sort the result + // data structure by date + if ($legacy_api = $this->getLegacyAPI()) { + foreach ($legacy_api->previousInjections($patient, $episode, $side, $drug) as $legacy) { + $res[] = $legacy; + } + } + + if (!$drug || get_class($drug) !== 'OphTrIntravitrealinjection_Treatment_Drug') { + $drug = new OphTrIntravitrealinjection_Treatment_Drug(); + } + + $injections = $this->injectionsSinceByEpisodeSideAndDrug($episode, $side, $drug, $since); + + foreach ($injections as $injection) { + $res[] = array( + $side . '_drug_id' => $injection->{$side . '_drug_id'}, + $side . '_drug' => $injection->{$side . '_drug'}->name, + $side . '_number' => $injection->{$side . '_number'}, + 'date' => $injection->event->event_date, + 'event_id' => $injection->event_id, + ); + } + + return $res; + } - $previous = $this->previousInjectionsForPatientEpisode($patient, $episode); + /** + * @param Episode $episode + * @param string $side + * @param OphTrIntravitrealinjection_Treatment_Drug $drug + * @param string $since + * + * @return mixed + * + * @throws Exception + */ + protected function injectionsSinceByEpisodeSideAndDrug(Episode $episode, $side, OphTrIntravitrealinjection_Treatment_Drug $drug, $since = 'now') + { switch ($side) { case 'left': - $eye_ids = array(SplitEventTypeElement::LEFT, SplitEventTypeElement::BOTH); + $eye_id = SplitEventTypeElement::LEFT; break; case 'right': - $eye_ids = array(SplitEventTypeElement::RIGHT, SplitEventTypeElement::BOTH); + $eye_id = SplitEventTypeElement::RIGHT; break; default: - throw new Exception('invalid side value provided: '.$side); + throw new Exception('invalid side value provided: ' . $side); break; } - foreach ($previous as $prev) { - if (in_array($prev->eye_id, $eye_ids)) { - if ($drug == null || $prev->{$side.'_drug_id'} == $drug->id) { - $res[] = array( - $side.'_drug_id' => $prev->{$side.'_drug_id'}, - $side.'_drug' => $prev->{$side.'_drug'}->name, - $side.'_number' => $prev->{$side.'_number'}, - 'date' => $prev->created_date, - 'event_id' => $prev->event_id, - ); - } - } - } + $sinceDate = new DateTime($since); - // NOTE: we assume that all legacy injections would be from before any injections in - // this module. Should this prove not to be the case, we would need to sort the result - // data structure by date - if ($legacy_api = $this->getLegacyAPI()) { - foreach ($legacy_api->previousInjections($patient, $episode, $side, $drug) as $legacy) { - $res[] = $legacy; - } + $criteria = new CDbCriteria(); + $criteria->alias = 'treatment'; + $criteria->addCondition(array( + 'event.episode_id = :episode_id', + 'treatment.eye_id in (:eye_id,'.SplitEventTypeElement::BOTH.')', + 'event_date <= :since', + ) + ); + $criteria->join = 'JOIN event ON treatment.event_id = event.id'; + $criteria->order = 'event.event_date ASC'; + $criteria->params = array( + 'episode_id' => $episode->id, + 'eye_id' => $eye_id, + 'since' => $sinceDate->format('Y-m-d'), + ); + + if ($drug->id) { + $criteria->addCondition('treatment.' . $side . '_drug_id = :drug_id'); + $criteria->params['drug_id'] = $drug->id; } - return $res; + return Element_OphTrIntravitrealinjection_Treatment::model()->findAll($criteria); } /** @@ -151,7 +154,7 @@ public function previousInjections($patient, $episode, $side, $drug = null) */ protected function getPreviousTreatmentForSide($patient, $episode, $side) { - $checker = ($side == 'left') ? 'hasLeft' : 'hasRight'; + $checker = ($side === 'left') ? 'hasLeft' : 'hasRight'; $treatment = $this->getElementForLatestEventInEpisode($episode, 'Element_OphTrIntravitrealinjection_Treatment'); if ($treatment && $treatment->$checker()) { return $treatment; @@ -170,7 +173,7 @@ protected function getPreviousTreatmentForSide($patient, $episode, $side) public function getLetterTreatmentDrugForSide($patient, $episode, $side) { if ($injection = $this->getPreviousTreatmentForSide($patient, $episode, $side)) { - return $injection->{$side.'_drug'}->name; + return $injection->{$side . '_drug'}->name; } } @@ -216,12 +219,12 @@ public function getLetterTreatmentDrugBoth($patient) $right = $this->getLetterTreatmentDrugForSide($patient, $episode, 'right'); $left = $this->getLetterTreatmentDrugForSide($patient, $episode, 'left'); if ($right) { - $res = $right.' injection to the right eye'; + $res = $right . ' injection to the right eye'; if ($left) { - $res .= ', and '.$left.' injection to the left eye'; + $res .= ', and ' . $left . ' injection to the left eye'; } } elseif ($left) { - $res = $left.' injection on the left eye'; + $res = $left . ' injection on the left eye'; } return $res; @@ -240,7 +243,7 @@ public function getLetterTreatmentDrugBoth($patient) public function getLetterTreatmentNumberForSide($patient, $episode, $side) { if ($injection = $this->getPreviousTreatmentForSide($patient, $episode, $side)) { - return $injection->{$side.'_number'}; + return $injection->{$side . '_number'}; } } @@ -283,12 +286,12 @@ public function getLetterTreatmentNumberBoth($patient) $left = $this->getLetterTreatmentNumberLeft($patient); $res = ''; if ($right) { - $res = $right.' on the right eye'; + $res = $right . ' on the right eye'; if ($left) { - $res .= ', and '.$left.' on the left eye'; + $res .= ', and ' . $left . ' on the left eye'; } } elseif ($left) { - $res = $left.' on the left eye'; + $res = $left . ' on the left eye'; } return $res; @@ -307,10 +310,10 @@ public function getLetterPostInjectionDrops($patient) if ($el = $this->getElementForLatestEventInEpisode($episode, 'Element_OphTrIntravitrealinjection_PostInjectionExamination')) { $drops = array(); if ($el->hasRight()) { - $drops[] = $el->right_drops->name.' to the right eye'; + $drops[] = $el->right_drops->name . ' to the right eye'; } if ($el->hasLeft()) { - $drops[] = $el->left_drops->name.' to the left eye'; + $drops[] = $el->left_drops->name . ' to the left eye'; } return implode(', and ', $drops); diff --git a/protected/modules/OphTrIntravitrealinjection/controllers/DefaultController.php b/protected/modules/OphTrIntravitrealinjection/controllers/DefaultController.php index df88b2d5e7..8e7cbdae8a 100644 --- a/protected/modules/OphTrIntravitrealinjection/controllers/DefaultController.php +++ b/protected/modules/OphTrIntravitrealinjection/controllers/DefaultController.php @@ -155,7 +155,7 @@ protected function setElementOptions($action) $element->eye_id = $default_eye; } - if (get_class($element) == 'Element_OphTrIntravitrealinjection_Treatment') { + if (get_class($element) === 'Element_OphTrIntravitrealinjection_Treatment') { if ($therapy_api) { // get the latest drug that has been applied for and set it as default (for the appropriate eye) if ($default_left_drug) { @@ -176,7 +176,7 @@ protected function setElementOptions($action) $element->left_injection_given_by_id = Yii::app()->user->id; $element->right_injection_given_by_id = Yii::app()->user->id; } - if (get_class($element) == 'Element_OphTrIntravitrealinjection_Site') { + if (get_class($element) === 'Element_OphTrIntravitrealinjection_Site') { $element->site_id = $this->selectedSiteId; } } diff --git a/protected/modules/OphTrIntravitrealinjection/models/OphTrIntravitrealinjection_ReportInjections.php b/protected/modules/OphTrIntravitrealinjection/models/OphTrIntravitrealinjection_ReportInjections.php index 878f9bc12e..02d0596679 100644 --- a/protected/modules/OphTrIntravitrealinjection/models/OphTrIntravitrealinjection_ReportInjections.php +++ b/protected/modules/OphTrIntravitrealinjection/models/OphTrIntravitrealinjection_ReportInjections.php @@ -1,4 +1,5 @@ given_by_id) { if (!$user = User::model()->findByPk($this->given_by_id)) { - throw new Exception('User not found: '.$this->given_by_id); + throw new Exception('User not found: ' . $this->given_by_id); } } if ($this->drug_id) { if (!$drug = OphTrIntravitrealinjection_Treatment_Drug::model()->findByPk($this->drug_id)) { - throw new Exception('Drug not found: '.$this->drug_id); + throw new Exception('Drug not found: ' . $this->drug_id); } } if ($this->pre_antisept_drug_id) { if (!$pre_antisept_drug = OphTrIntravitrealinjection_AntiSepticDrug::model()->findByPk($this->pre_antisept_drug_id)) { - throw new Exception('Drug not found: '.$this->pre_antisept_drug_id); + throw new Exception('Drug not found: ' . $this->pre_antisept_drug_id); } } if ($this->summary) { - $this->injections = $this->getSummaryInjections($this->date_from, $this->date_to, @$user, @$drug, @$pre_antisept_drug); + $this->injections = $this->getSummaryInjections($this->date_from, $this->date_to, @$user, @$drug, + @$pre_antisept_drug); $this->view = '_summary_injections'; } else { - $this->injections = $this->getInjections($this->date_from, $this->date_to, @$user, @$drug, @$pre_antisept_drug); + $this->injections = $this->getInjections($this->date_from, $this->date_to, @$user, @$drug, + @$pre_antisept_drug); $this->view = '_injections'; } } @@ -145,25 +148,25 @@ protected function getSummaryInjections($date_from, $date_to, $given_by_user, $d $patient_data = array(); $where = ''; $command = Yii::app()->db->createCommand() - ->select( - 'p.id as patient_id, treat.left_drug_id, treat.right_drug_id, treat.left_number, treat.right_number, e.id, - e.created_date, c.first_name, c.last_name, e.created_date, p.hos_num,p.gender, p.dob, eye.name AS eye, site.name as site_name' - ) - ->from('et_ophtrintravitinjection_treatment treat') - ->join('event e', 'e.id = treat.event_id') - ->join('episode ep', 'e.episode_id = ep.id') - ->join('patient p', 'ep.patient_id = p.id') - ->join('contact c', 'p.contact_id = c.id') - ->join('eye', 'eye.id = treat.eye_id') - ->join('et_ophtrintravitinjection_site insite', 'insite.event_id = treat.event_id') - ->leftJoin('site', 'insite.site_id = site.id') - ->order('p.id, e.created_date asc'); + ->select( + 'p.id as patient_id, treat.left_drug_id, treat.right_drug_id, treat.left_number, treat.right_number, e.id, + e.event_date, c.first_name, c.last_name, e.created_date, p.hos_num,p.gender, p.dob, eye.name AS eye, site.name as site_name' + ) + ->from('et_ophtrintravitinjection_treatment treat') + ->join('event e', 'e.id = treat.event_id') + ->join('episode ep', 'e.episode_id = ep.id') + ->join('patient p', 'ep.patient_id = p.id') + ->join('contact c', 'p.contact_id = c.id') + ->join('eye', 'eye.id = treat.eye_id') + ->join('et_ophtrintravitinjection_site insite', 'insite.event_id = treat.event_id') + ->leftJoin('site', 'insite.site_id = site.id') + ->order('p.id, e.event_date asc'); // for debug if ($this->patient_id) { - $where = 'ep.patient_id = :pat_id and e.deleted = 0 and ep.deleted = 0 and e.created_date >= :from_date and e.created_date < (:to_date + interval 1 day)'; + $where = 'ep.patient_id = :pat_id and e.deleted = 0 and ep.deleted = 0 and e.event_date >= :from_date and e.event_date < (:to_date + interval 1 day)'; $params = array(':from_date' => $date_from, ':to_date' => $date_to, ':pat_id' => $this->patient_id); } else { - $where = 'e.deleted = 0 and ep.deleted = 0 and e.created_date >= :from_date and e.created_date < (:to_date + interval 1 day)'; + $where = 'e.deleted = 0 and ep.deleted = 0 and e.event_date >= :from_date and e.event_date < (:to_date + interval 1 day)'; $params = array(':from_date' => $date_from, ':to_date' => $date_to); } @@ -205,10 +208,10 @@ protected function getSummaryInjections($date_from, $date_to, $given_by_user, $d $site = 'Unknown'; } foreach (array('left', 'right') as $side) { - $dt = date('j M Y', strtotime($row['created_date'])); - if ($drug = $this->getDrugById($row[$side.'_drug_id'])) { + $dt = date('j M Y', strtotime($row['event_date'])); + if ($drug = $this->getDrugById($row[$side . '_drug_id'])) { $patient_data[$side][$drug->name][$site]['last_injection_date'] = $dt; - $patient_data[$side][$drug->name][$site]['injection_number'] = $row[$side.'_number']; + $patient_data[$side][$drug->name][$site]['injection_number'] = $row[$side . '_number']; if (!isset($patient_data[$side][$drug->name][$site]['first_injection_date'])) { $patient_data[$side][$drug->name][$site]['first_injection_date'] = $dt; } @@ -224,24 +227,25 @@ protected function getSummaryInjections($date_from, $date_to, $given_by_user, $d protected function getInjections($date_from, $date_to, $given_by_user, $drug, $pre_antisept_drug) { - $where = 'e.deleted = 0 and ep.deleted = 0 and e.created_date >= :from_date and e.created_date < (:to_date + interval 1 day)'; + $where = 'e.deleted = 0 and ep.deleted = 0 and e.event_date >= :from_date and e.event_date < (:to_date + interval 1 day)'; $command = Yii::app()->db->createCommand() - ->select( - 'p.id as patient_id, treat.left_drug_id, treat.right_drug_id, treat.left_number, treat.right_number, e.id, - e.created_date, c.first_name, c.last_name, e.created_date, p.hos_num,p.gender, p.dob, eye.name AS eye, site.name as site_name,treat.left_injection_given_by_id, treat.right_injection_given_by_id, - treat.left_pre_antisept_drug_id, treat.right_pre_antisept_drug_id, anteriorseg.left_lens_status_id, anteriorseg.right_lens_status_id' - ) - ->from('et_ophtrintravitinjection_treatment treat') - ->join('event e', 'e.id = treat.event_id') - ->join('episode ep', 'e.episode_id = ep.id') - ->join('patient p', 'ep.patient_id = p.id') - ->join('contact c', 'p.contact_id = c.id') - ->join('eye', 'eye.id = treat.eye_id') - ->join('et_ophtrintravitinjection_site insite', 'insite.event_id = treat.event_id') - ->join('et_ophtrintravitinjection_anteriorseg anteriorseg', 'anteriorseg.event_id = treat.event_id') - ->join('site', 'insite.site_id = site.id') - ->order('p.id, e.created_date asc'); + ->select( + 'p.id as patient_id, treat.left_drug_id, treat.right_drug_id, treat.left_number, treat.right_number, e.id, + e.event_date, c.first_name, c.last_name, p.hos_num, p.gender, p.dob, eye.name AS eye, site.name as site_name, + treat.left_injection_given_by_id, treat.right_injection_given_by_id, + treat.left_pre_antisept_drug_id, treat.right_pre_antisept_drug_id, anteriorseg.left_lens_status_id, anteriorseg.right_lens_status_id' + ) + ->from('et_ophtrintravitinjection_treatment treat') + ->join('event e', 'e.id = treat.event_id') + ->join('episode ep', 'e.episode_id = ep.id') + ->join('patient p', 'ep.patient_id = p.id') + ->join('contact c', 'p.contact_id = c.id') + ->join('eye', 'eye.id = treat.eye_id') + ->join('et_ophtrintravitinjection_site insite', 'insite.event_id = treat.event_id') + ->join('et_ophtrintravitinjection_anteriorseg anteriorseg', 'anteriorseg.event_id = treat.event_id') + ->join('site', 'insite.site_id = site.id') + ->order('p.id, e.event_date asc'); $params = array(':from_date' => $date_from, ':to_date' => $date_to); if ($given_by_user) { @@ -263,32 +267,32 @@ protected function getInjections($date_from, $date_to, $given_by_user, $drug, $p $results = array(); foreach ($command->queryAll(true, $params) as $row) { - $diagnosisData = $this->getDiagnosisData($row['patient_id'], $row['created_date']); + $diagnosisData = $this->getDiagnosisData($row['patient_id'], $row['event_date']); $record = array( - 'injection_date' => date('j M Y', strtotime($row['created_date'])), - 'patient_hosnum' => $row['hos_num'], - 'patient_firstname' => $row['first_name'], - 'patient_surname' => $row['last_name'], - 'patient_gender' => $row['gender'], - 'patient_dob' => date('j M Y', strtotime($row['dob'])), - 'eye' => $row['eye'], - 'site_name' => $row['site_name'], - 'left_drug' => $this->getDrugString($row['left_drug_id']), - 'left_injection_number' => $row['left_number'], - 'right_drug' => $this->getDrugString($row['right_drug_id']), - 'right_injection_number' => $row['right_number'], - 'pre_antisept_drug_left' => $this->getPreAntiseptDrugString($row['left_pre_antisept_drug_id']), - 'pre_antisept_drug_right' => $this->getPreAntiseptDrugString($row['right_pre_antisept_drug_id']), - 'given_by_left' => $this->getGivenByName($row['left_injection_given_by_id']), - 'given_by_right' => $this->getGivenByName($row['right_injection_given_by_id']), - 'lens_status_left' => $this->getLensStatus($row['left_lens_status_id']), - 'lens_status_right' => $this->getLensStatus($row['right_lens_status_id']), - 'diagnosis_left' => $this->getDiagnosisName($diagnosisData['left_diagnosis_id']), - 'diagnosis_right' => $this->getDiagnosisName($diagnosisData['right_diagnosis_id']), + 'injection_date' => date('j M Y', strtotime($row['event_date'])), + 'patient_hosnum' => $row['hos_num'], + 'patient_firstname' => $row['first_name'], + 'patient_surname' => $row['last_name'], + 'patient_gender' => $row['gender'], + 'patient_dob' => date('j M Y', strtotime($row['dob'])), + 'eye' => $row['eye'], + 'site_name' => $row['site_name'], + 'left_drug' => $this->getDrugString($row['left_drug_id']), + 'left_injection_number' => $row['left_number'], + 'right_drug' => $this->getDrugString($row['right_drug_id']), + 'right_injection_number' => $row['right_number'], + 'pre_antisept_drug_left' => $this->getPreAntiseptDrugString($row['left_pre_antisept_drug_id']), + 'pre_antisept_drug_right' => $this->getPreAntiseptDrugString($row['right_pre_antisept_drug_id']), + 'given_by_left' => $this->getGivenByName($row['left_injection_given_by_id']), + 'given_by_right' => $this->getGivenByName($row['right_injection_given_by_id']), + 'lens_status_left' => $this->getLensStatus($row['left_lens_status_id']), + 'lens_status_right' => $this->getLensStatus($row['right_lens_status_id']), + 'diagnosis_left' => $this->getDiagnosisName($diagnosisData['left_diagnosis_id']), + 'diagnosis_right' => $this->getDiagnosisName($diagnosisData['right_diagnosis_id']), ); - $this->appendExaminationValues($record, $row['patient_id'], $row['created_date']); + $this->appendExaminationValues($record, $row['patient_id'], $row['event_date']); $results[] = $record; } @@ -305,10 +309,11 @@ public function description() } if ($this->given_by_id) { - $description .= ' given by '.User::model()->findByPk($this->given_by_id)->fullName; + $description .= ' given by ' . User::model()->findByPk($this->given_by_id)->fullName; } - $description .= ' between '.date('j M Y', strtotime($this->date_from)).' and '.date('j M Y', strtotime($this->date_to)); + $description .= ' between ' . date('j M Y', strtotime($this->date_from)) . ' and ' . date('j M Y', + strtotime($this->date_to)); if ($this->pre_va && $this->post_va) { $description .= ' with pre-injection and post-injection VA'; @@ -328,10 +333,10 @@ public function description() */ public function toCSV() { - $output = $this->description()."\n\n"; + $output = $this->description() . "\n\n"; if ($this->summary) { - $output .= Patient::model()->getAttributeLabel('hos_num').','.Patient::model()->getAttributeLabel('first_name').','.Patient::model()->getAttributeLabel('last_name').','.Patient::model()->getAttributeLabel('gender').','.Patient::model()->getAttributeLabel('dob').',Eye,Drug,Site,First injection date,Last injection date,Injection no'; + $output .= Patient::model()->getAttributeLabel('hos_num') . ',' . Patient::model()->getAttributeLabel('first_name') . ',' . Patient::model()->getAttributeLabel('last_name') . ',' . Patient::model()->getAttributeLabel('gender') . ',' . Patient::model()->getAttributeLabel('dob') . ',Eye,Drug,Site,First injection date,Last injection date,Injection no'; if ($this->pre_va) { $output .= ',Left pre-injection VA,Right pre-injection VA'; @@ -341,7 +346,7 @@ public function toCSV() } $output .= "\n"; } else { - $output .= 'Date,'.Patient::model()->getAttributeLabel('hos_num').','.Patient::model()->getAttributeLabel('first_name').','.Patient::model()->getAttributeLabel('last_name').','.Patient::model()->getAttributeLabel('gender').','.Patient::model()->getAttributeLabel('dob').',Eye,Site,Left drug,Left injection no,Right drug,Right injection no,Left Pre-injection Antiseptics,Right Pre-injection Antiseptics,Left Injection given by,Right Injection given by,Left Lens Status,Right Lens Status,Left Diagnosis,Right Diagnosis'; + $output .= 'Date,' . Patient::model()->getAttributeLabel('hos_num') . ',' . Patient::model()->getAttributeLabel('first_name') . ',' . Patient::model()->getAttributeLabel('last_name') . ',' . Patient::model()->getAttributeLabel('gender') . ',' . Patient::model()->getAttributeLabel('dob') . ',Eye,Site,Left drug,Left injection no,Right drug,Right injection no,Left Pre-injection Antiseptics,Right Pre-injection Antiseptics,Left Injection given by,Right Injection given by,Left Lens Status,Right Lens Status,Left Diagnosis,Right Diagnosis'; if ($this->pre_va) { $output .= ',Left pre-injection VA,Right pre-injection VA'; @@ -352,7 +357,7 @@ public function toCSV() $output .= "\n"; } - return $output.$this->array2Csv($this->injections); + return $output . $this->array2Csv($this->injections); } protected function getDiagnosisDataFromEvent($patient_id, $close_to_date, $event_type_id, $model) @@ -374,7 +379,7 @@ protected function getDiagnosisDataFromEvent($patient_id, $close_to_date, $event if ($eventData) { $criteria = new CDbCriteria(); - $criteria->addCondition('event_id = '.$eventData['id']); + $criteria->addCondition('event_id = ' . $eventData['id']); $injectionManagementData = $model::model()->find($criteria); //var_dump($injectionManagementData); @@ -392,14 +397,18 @@ protected function getDiagnosisDataFromEvent($patient_id, $close_to_date, $event } } } + //var_dump('Patient: '.$patient_id.' LEFT: '.$left_diagnosis_id." RIGHT: ".$right_diagnosis_id." Command: ".$command->getText()." :: ".print_r($command->params)); return array('left_diagnosis_id' => $left_diagnosis_id, 'right_diagnosis_id' => $right_diagnosis_id); } /** - * a) From the injection management element under Examination event saved before the injection event - usually on the same day - * b) If no injection management saved then this can be obtained from the application event If there is an application event saved before the injection started for the patient - * c) if there is no application then diagnoses for the episode. + * a) From the injection management element under Examination event saved before the injection event - usually on the same day + * b) If no injection management saved then this can be obtained from the application event If there is an application event saved before the injection started for the patient + * c) if there is no application then diagnoses for the episode. + * @param $patient_id + * @param $close_to_date + * @return array */ protected function getDiagnosisData($patient_id, $close_to_date) { @@ -407,10 +416,13 @@ protected function getDiagnosisData($patient_id, $close_to_date) // check for examination data // search for the closest examination event first - $diagnosisData = $this->getDiagnosisDataFromEvent($patient_id, $close_to_date, $this->getExaminationEventTypeId(), 'OEModule\OphCiExamination\models\Element_OphCiExamination_InjectionManagementComplex'); + $diagnosisData = $this->getDiagnosisDataFromEvent($patient_id, $close_to_date, + $this->getExaminationEventTypeId(), + 'OEModule\OphCiExamination\models\Element_OphCiExamination_InjectionManagementComplex'); if (!$diagnosisData['left_diagnosis_id'] || !$diagnosisData['right_diagnosis_id']) { - $diagnosisData = $this->getDiagnosisDataFromEvent($patient_id, $close_to_date, $this->getApplicationEventTypeID(), 'Element_OphCoTherapyapplication_Therapydiagnosis'); + $diagnosisData = $this->getDiagnosisDataFromEvent($patient_id, $close_to_date, + $this->getApplicationEventTypeID(), 'Element_OphCoTherapyapplication_Therapydiagnosis'); } return $diagnosisData; @@ -450,7 +462,7 @@ protected function getGivenByName($user_id) return 'N/A'; } if ($user = User::model()->findByPk($user_id)) { - return $user->first_name.' '.$user->last_name; + return $user->first_name . ' ' . $user->last_name; } else { return 'UNKNOWN'; } @@ -502,16 +514,21 @@ protected function getDrugString($drug_id) protected function appendExaminationValues(&$record, $patient_id, $event_date) { if ($this->pre_va || $this->post_va) { - foreach (array('left_preinjection_va', 'right_preinjection_va', 'left_postinjection_va', 'right_postinjection_va') as $k) { + foreach (array( + 'left_preinjection_va', + 'right_preinjection_va', + 'left_postinjection_va', + 'right_postinjection_va', + ) as $k) { $record[$k] = 'N/A'; } $vas = $this->getPatientVAElements($patient_id); $before = null; $after = null; foreach ($vas as $va) { - if ($va->created_date < $event_date) { + if ($va->event->event_date < $event_date) { $before = $va; - } elseif ($va->created_date > $event_date) { + } elseif ($va->event->event_date > $event_date) { $after = $va; break; } @@ -550,21 +567,22 @@ protected function getPatientVAElements($patient_id) if ($patient_id != $this->_current_patient_id) { $this->_current_patient_id = $patient_id; $command = Yii::app()->db->createCommand() - ->select( - 'e.id' - ) - ->from('event e') - ->join('episode ep', 'e.episode_id = ep.id') - ->where('e.deleted = 0 and ep.deleted = 0 and ep.patient_id = :patient_id and e.event_type_id = :etype_id', - array(':patient_id' => $patient_id, ':etype_id' => $this->getExaminationEventTypeId()) - ); + ->select('e.id') + ->from('event e') + ->join('episode ep', 'e.episode_id = ep.id') + ->where('e.deleted = 0 and ep.deleted = 0 and ep.patient_id = :patient_id and e.event_type_id = :etype_id', + array(':patient_id' => $patient_id, ':etype_id' => $this->getExaminationEventTypeId()) + ); $event_ids = array(); foreach ($command->queryAll() as $res) { $event_ids[] = $res['id']; } $criteria = new CDbCriteria(); $criteria->addInCondition('event_id', $event_ids); - $this->_patient_vas = OEModule\OphCiExamination\models\Element_OphCiExamination_VisualAcuity::model()->with('right_readings', 'left_readings')->findAll($criteria); + $criteria->order = 'event_date asc'; + $this->_patient_vas = OEModule\OphCiExamination\models\Element_OphCiExamination_VisualAcuity::model() + ->with('right_readings', 'left_readings', 'event') + ->findAll($criteria); } return $this->_patient_vas; @@ -574,14 +592,16 @@ protected function getPatientVAElements($patient_id) * Simple wrapper function for getting a string representation of the best VA reading for a side from the given element. * * @param $side - * @param Element_OphCiExamination_VisualAcuity $va + * @param OEModule\OphCiExamination\models\Element_OphCiExamination_VisualAcuity $va * * @return string */ - protected function getBestVaFromReading($side, OEModule\OphCiExamination\models\Element_OphCiExamination_VisualAcuity $va) - { + protected function getBestVaFromReading( + $side, + OEModule\OphCiExamination\models\Element_OphCiExamination_VisualAcuity $va + ) { if ($reading = $va->getBestReading($side)) { - return $reading->convertTo($reading->value, $va->unit_id).' ('.$reading->method->name.')'; + return $reading->convertTo($reading->value, $va->unit_id) . ' (' . $reading->method->name . ')'; } return 'N/A'; diff --git a/protected/modules/OphTrIntravitrealinjection/views/default/form_Element_OphTrIntravitrealinjection_Treatment_fields.php b/protected/modules/OphTrIntravitrealinjection/views/default/form_Element_OphTrIntravitrealinjection_Treatment_fields.php index 9d1ed722d7..a177e5c826 100644 --- a/protected/modules/OphTrIntravitrealinjection/views/default/form_Element_OphTrIntravitrealinjection_Treatment_fields.php +++ b/protected/modules/OphTrIntravitrealinjection/views/default/form_Element_OphTrIntravitrealinjection_Treatment_fields.php @@ -19,188 +19,205 @@ ?> with('allergies')->activeOrPk($element->{$side.'_pre_antisept_drug_id'})->findAll(); - $antiseptic_drugs_opts = array( - 'empty' => '- Please select -', - 'nowrapper' => true, - 'options' => array(), - ); - $antiseptic_allergic = false; - foreach ($antiseptic_drugs as $drug) { - $opts = array(); - foreach ($drug->allergies as $allergy) { - if ($this->patient->hasAllergy($allergy)) { - $opts['data-allergic'] = 1; - if ($drug->id == $element->{$side.'_pre_antisept_drug_id'}) { - $antiseptic_allergic = true; - } +$antiseptic_drugs = OphTrIntravitrealinjection_AntiSepticDrug::model()->with('allergies')->activeOrPk($element->{$side . '_pre_antisept_drug_id'})->findAll(); +$antiseptic_drugs_opts = array( + 'empty' => '- Please select -', + 'nowrapper' => true, + 'options' => array(), +); +$antiseptic_allergic = false; +foreach ($antiseptic_drugs as $drug) { + $opts = array(); + foreach ($drug->allergies as $allergy) { + if ($this->patient->hasAllergy($allergy)) { + $opts['data-allergic'] = 1; + if ($drug->id == $element->{$side . '_pre_antisept_drug_id'}) { + $antiseptic_allergic = true; } } - $antiseptic_drugs_opts['options'][(string) $drug->id] = $opts; } - $skin_drugs = OphTrIntravitrealinjection_SkinDrug::model()->with('allergies')->activeOrPk($element->{$side.'_pre_skin_drug_id'})->findAll(); - $skin_drugs_opts = array('empty' => '- Please select -', 'nowrapper' => true, 'options' => array()); - $skin_allergic = false; - foreach ($skin_drugs as $drug) { - $opts = array(); - foreach ($drug->allergies as $allergy) { - if ($this->patient->hasAllergy($allergy)) { - $opts['data-allergic'] = 1; - if ($drug->id == $element->{$side.'_pre_skin_drug_id'}) { - $skin_allergic = true; - } + $antiseptic_drugs_opts['options'][(string)$drug->id] = $opts; +} +$skin_drugs = OphTrIntravitrealinjection_SkinDrug::model()->with('allergies')->activeOrPk($element->{$side . '_pre_skin_drug_id'})->findAll(); +$skin_drugs_opts = array('empty' => '- Please select -', 'nowrapper' => true, 'options' => array()); +$skin_allergic = false; +foreach ($skin_drugs as $drug) { + $opts = array(); + foreach ($drug->allergies as $allergy) { + if ($this->patient->hasAllergy($allergy)) { + $opts['data-allergic'] = 1; + if ($drug->id == $element->{$side . '_pre_skin_drug_id'}) { + $skin_allergic = true; } } - $skin_drugs_opts['options'][(string) $drug->id] = $opts; } + $skin_drugs_opts['options'][(string)$drug->id] = $opts; +} ?> -
-
- -
-
-
- dropDownList($element, $side.'_pre_antisept_drug_id', CHtml::listData($antiseptic_drugs, 'id', 'name'), $antiseptic_drugs_opts); +
+
+ +
+
+
+ dropDownList($element, $side . '_pre_antisept_drug_id', CHtml::listData($antiseptic_drugs, 'id', 'name'), $antiseptic_drugs_opts); ?> -
-
+
+
-
-
- -
-
-
- dropDownList($element, $side.'_pre_skin_drug_id', CHtml::listData($skin_drugs, 'id', 'name'), $skin_drugs_opts); +
+
+ +
+
+
+ dropDownList($element, $side . '_pre_skin_drug_id', CHtml::listData($skin_drugs, 'id', 'name'), $skin_drugs_opts); ?> -
-
+
+
checkbox($element, $side.'_pre_ioplowering_required'); +echo $form->checkbox($element, $side . '_pre_ioplowering_required'); ?> { $side.'_pre_ioplowering_required'}; +$show = $element->{$side . '_pre_ioplowering_required'}; if (isset($_POST[get_class($element)])) { - $show = $_POST[get_class($element)][$side.'_pre_ioplowering_required']; + $show = $_POST[get_class($element)][$side . '_pre_ioplowering_required']; } ?> array(), - 'empty' => '- Please select -', - 'div_id' => 'div_'.get_class($element).'_'.$side.'_pre_ioploweringdrugs', - 'label' => $element->getAttributeLabel($side.'_pre_ioploweringdrugs'), - 'div_class' => $div_class, ); - $ioplowering_drugs = OphTrIntravitrealinjection_IOPLoweringDrug::model()->activeOrPk($element->iopLoweringDrugValues)->findAll(array('order' => 'display_order asc')); - foreach ($ioplowering_drugs as $drug) { - $html_options['options'][(string) $drug->id] = array('data-order' => $drug->display_order); - } - echo $form->multiSelectList($element, get_class($element).'['.$side.'_pre_ioploweringdrugs]', $side.'_pre_ioploweringdrugs', 'id', CHtml::listData($ioplowering_drugs, 'id', 'name'), array(), $html_options, false, false, null, false, false, array('field' => 6)); +$div_class = 'eventDetail'; +if (!$show) { + $div_class .= ' hidden'; +} - $drugs = OphTrIntravitrealinjection_Treatment_Drug::model()->activeOrPk($element->{$side.'_drug_id'})->findAll(); +$html_options = array( + 'options' => array(), + 'empty' => '- Please select -', + 'div_id' => 'div_' . get_class($element) . '_' . $side . '_pre_ioploweringdrugs', + 'label' => $element->getAttributeLabel($side . '_pre_ioploweringdrugs'), + 'div_class' => $div_class, +); +$ioplowering_drugs = OphTrIntravitrealinjection_IOPLoweringDrug::model()->activeOrPk($element->iopLoweringDrugValues)->findAll(array('order' => 'display_order asc')); +foreach ($ioplowering_drugs as $drug) { + $html_options['options'][(string)$drug->id] = array('data-order' => $drug->display_order); +} - $html_options = array( - 'empty' => '- Please select -', - 'options' => array(), - ); - // get the previous injection counts for each of the drug options for this eye - $drug_history = array(); +echo $form->multiSelectList( + $element, + get_class($element) . '[' . $side . '_pre_ioploweringdrugs]', $side . '_pre_ioploweringdrugs', + 'id', + CHtml::listData($ioplowering_drugs, 'id', 'name'), + array(), + $html_options, + false, + false, + null, + false, + false, + array('field' => 6) +); - foreach ($drugs as $drug) { - if ($element->event_id) { - $previous = $injection_api->previousInjectionsByEvent($element->event_id, $side, $drug); - } else { - $previous = $injection_api->previousInjections($this->patient, $episode, $side, $drug); - } - $count = 0; - if (sizeof($previous)) { - $count = $previous[0][$side.'_number']; - } - $drug_history[$drug->id] = array_reverse($previous); +$drugs = OphTrIntravitrealinjection_Treatment_Drug::model()->activeOrPk($element->{$side . '_drug_id'})->findAll(); - $html_options['options'][$drug->id] = array( - 'data-previous' => $count, - ); +$html_options = array( + 'empty' => '- Please select -', + 'options' => array(), +); +// get the previous injection counts for each of the drug options for this eye +$drug_history = array(); - // if this is an edit, we want to know what the original count was so that we don't replace it - if ($element->{$side.'_drug_id'} && $element->{$side.'_drug_id'} == $drug->id) { - $html_options['options'][$drug->id]['data-original-count'] = $element->{$side.'_number'}; - } +foreach ($drugs as $drug) { + if ($element->event_id) { + $previous = $injection_api->previousInjectionsByEvent($element->event_id, $side, $drug); + } else { + $previous = $injection_api->previousInjections($this->patient, $episode, $side, $drug); + } + $count = 0; + if (count($previous)) { + $count = $previous[count($previous) - 1][$side . '_number']; } + $drug_history[$drug->id] = $previous; - echo $form->dropDownList($element, $side.'_drug_id', CHtml::listData($drugs, 'id', 'name'), $html_options, false, array('field' => 6)); + $html_options['options'][$drug->id] = array( + 'data-previous' => $count, + ); - $selected_drug = null; - if (@$_POST['Element_OphTrIntravitrealinjection_Treatment']) { - $selected_drug = $_POST['Element_OphTrIntravitrealinjection_Treatment'][$side.'_drug_id']; - } else { - $selected_drug = $element->{$side.'_drug_id'}; + // if this is an edit, we want to know what the original count was so that we don't replace it + if ($element->{$side . '_drug_id'} && $element->{$side . '_drug_id'} == $drug->id) { + $html_options['options'][$drug->id]['data-original-count'] = $element->{$side . '_number'}; } +} + +echo $form->dropDownList($element, $side . '_drug_id', CHtml::listData($drugs, 'id', 'name'), $html_options, false, array('field' => 6)); + +$selected_drug = null; +if (@$_POST['Element_OphTrIntravitrealinjection_Treatment']) { + $selected_drug = $_POST['Element_OphTrIntravitrealinjection_Treatment'][$side . '_drug_id']; +} else { + $selected_drug = $element->{$side . '_drug_id'}; +} ?> -
-
- -
-
-
-
- textField($element, $side.'_number', array('size' => '10', 'nowrapper' => true))?> -
-
- - +
+
+ +
+
+
+
+ textField($element, $side . '_number', array('size' => '10', 'nowrapper' => true)) ?> +
+
+ + - '; - }?> -
-
-
-
+ } ?> +
+
+
+
-textField($element, $side.'_batch_number', array(), array(), array('field' => 6))?> +textField($element, $side . '_batch_number', array(), array(), array('field' => 6)) ?> getIsNewRecord()) { @@ -210,38 +227,40 @@ class="row field-row"> } ?> -datePicker($element, $side.'_batch_expiry_date', $expiry_date_params, array(), array( +datePicker($element, $side . '_batch_expiry_date', $expiry_date_params, array(), array( 'label' => $form->layoutColumns['label'], 'field' => 3, -))?> +)) ?> -dropDownList($element, $side.'_injection_given_by_id', CHtml::listData(OphTrIntravitrealinjection_InjectionUser::model()->getUsers(), 'id', 'ReversedFullNameAndUserName'), array('empty' => '- Please select -'), false, array('field' => 6))?> +dropDownList($element, $side . '_injection_given_by_id', + CHtml::listData(OphTrIntravitrealinjection_InjectionUser::model()->getUsers(), 'id', 'ReversedFullNameAndUserName'), array('empty' => '- Please select -'), false, + array('field' => 6)) ?> -
-
- -
-
- {$side.'_injection_time'} != null) { - $val = date('H:i', strtotime($element->{$side.'_injection_time'})); - } else { - $val = date('H:i'); - } +
+
+ +
+
+ {$side . '_injection_time'} != null) { + $val = date('H:i', strtotime($element->{$side . '_injection_time'})); + } else { + $val = date('H:i'); + } - if (isset($_POST[get_class($element)])) { - $val = $_POST[get_class($element)][$side.'_injection_time']; - } - echo CHtml::textField(get_class($element).'['.$side.'_injection_time]', $val, array('autocomplete' => Yii::app()->params['html_autocomplete'])); + if (isset($_POST[get_class($element)])) { + $val = $_POST[get_class($element)][$side . '_injection_time']; + } + echo CHtml::textField(get_class($element) . '[' . $side . '_injection_time]', $val, array('autocomplete' => Yii::app()->params['html_autocomplete'])); ?> -
+
checkbox($element, $side.'_post_ioplowering_required'); +echo $form->checkbox($element, $side . '_post_ioplowering_required'); ?>
-*/?> +*/ ?> { $side.'_post_ioplowering_required'}; +$div_class = 'eventDetail'; +$show = $element->{$side . '_post_ioplowering_required'}; - if (isset($_POST[get_class($element)])) { - $show = $_POST[get_class($element)][$side.'_post_ioplowering_required']; - } +if (isset($_POST[get_class($element)])) { + $show = $_POST[get_class($element)][$side . '_post_ioplowering_required']; +} - if (!$show) { - $div_class .= ' hidden'; - } +if (!$show) { + $div_class .= ' hidden'; +} - $html_options = array( - 'options' => array(), - 'empty' => '- Please select -', - 'div_id' => 'div_'.get_class($element).'_'.$side.'_post_ioploweringdrugs', - 'label' => $element->getAttributeLabel($side.'_post_ioploweringdrugs'), - 'div_class' => $div_class, ); - $ioplowering_drugs = OphTrIntravitrealinjection_IOPLoweringDrug::model()->activeOrPk($element->iopLoweringDrugValues)->findAll(array('order' => 'display_order asc')); - foreach ($ioplowering_drugs as $drug) { - $html_options['options'][(string) $drug->id] = array('data-order' => $drug->display_order); - } - echo $form->multiSelectList($element, get_class($element).'['.$side.'_post_ioploweringdrugs]', $side.'_post_ioploweringdrugs', 'id', CHtml::listData($ioplowering_drugs, 'id', 'name'), array(), $html_options, false, false, null, false, false, array('field' => 6)); +$html_options = array( + 'options' => array(), + 'empty' => '- Please select -', + 'div_id' => 'div_' . get_class($element) . '_' . $side . '_post_ioploweringdrugs', + 'label' => $element->getAttributeLabel($side . '_post_ioploweringdrugs'), + 'div_class' => $div_class, +); +$ioplowering_drugs = OphTrIntravitrealinjection_IOPLoweringDrug::model()->activeOrPk($element->iopLoweringDrugValues)->findAll(array('order' => 'display_order asc')); +foreach ($ioplowering_drugs as $drug) { + $html_options['options'][(string)$drug->id] = array('data-order' => $drug->display_order); +} +echo $form->multiSelectList($element, get_class($element) . '[' . $side . '_post_ioploweringdrugs]', $side . '_post_ioploweringdrugs', 'id', + CHtml::listData($ioplowering_drugs, 'id', 'name'), array(), $html_options, false, false, null, false, false, array('field' => 6)); ?> diff --git a/protected/modules/OphTrOperationbooking/components/OphTrOperationbooking_API.php b/protected/modules/OphTrOperationbooking/components/OphTrOperationbooking_API.php index 7a168a8943..62659a76bd 100644 --- a/protected/modules/OphTrOperationbooking/components/OphTrOperationbooking_API.php +++ b/protected/modules/OphTrOperationbooking/components/OphTrOperationbooking_API.php @@ -423,11 +423,128 @@ public function getAllBookingsWithoutOperationNotes(\Patient $patient) $booking_procs = OphTrOperationbooking_Operation_Procedures::model()->findAll($criteria); if ($booking_procs) { foreach ($booking_procs as $proc) { - $not_booked_events[] = $proc->procedure->term; + $not_booked_events[] = $proc->element->eye->getAdjective() . ' ' . $proc->procedure->term; } } return implode(', ', $not_booked_events); } + + /** + * Automatically scheduleds all the un-scheduled op bookings in the episode + * @param \Episode $episode + * @return type + */ + public function autoScheduleOperationBookings(\Episode $episode) + { + $errors = array(); + + $criteria = new CDbCriteria(); + $criteria->order = 't.created_date asc'; + $criteria->condition = 't.status_id = 1'; + $criteria->compare('episode_id', $episode->id); + + $operations = Element_OphTrOperationbooking_Operation::model()->with(array( + 'event' => array( + 'condition'=>'event.deleted=0', + ) + ))->findAll($criteria); + + $op_status_scheduled = OphTrOperationbooking_Operation_Status::model()->find('name=?', array('Scheduled')); + $ep_status_listed = EpisodeStatus::model()->find('name=?', array('Listed/booked')); + + foreach($operations as $operation){ + // get the first bookable session regardless of the firm + $session = $this->getFirstBookableSession($operation); + + //we need to pass to schedule the op + $schedule_options = Element_OphTrOperationbooking_ScheduleOperation::model()->find('event_id = ?', array($operation->event->id)); + + if($session){ + $transaction = Yii::app()->db->beginTransaction(); + + try { + + $ward = OphTrOperationbooking_Operation_Ward::model()->find('site_id = ?', array($operation->site->id)); + if(!$ward){ + //as this feature is used when the client/hospital doesn't use the + //scheduling, most likely it will have a dummy ward set up for only one site + $ward = OphTrOperationbooking_Operation_Ward::model()->find(); + } + $booking = new OphTrOperationbooking_Operation_Booking('insert'); + $booking->ward_id = $ward->id; + $booking->element_id = $operation->id; + $booking->session_id = $session->id; + $booking->session_theatre_id = 1; + $booking->session_date = date("Y-m-d H:i:s"); + $booking->session_start_time = $session->start_time; + $booking->admission_time = $session->start_time; + $booking->session_end_time = $session->end_time; + $booking->cancellation_comment = ''; + //$booking will be saved in $operation->schedule() + + $result = $operation->schedule($booking, '', '', '', false, null, $schedule_options); + + if ($result !== true) { + $errors[$operation->id] = $result; + } else { + $operation->status_id = $op_status_scheduled->id; + $operation->save(); + + $episode->episode_status_id = $ep_status_listed->id; + $episode->save(); + + $operation->event->deleteIssues(); + + $transaction->commit(); + } + + } catch (RaceConditionException $e) { + $errors[$operation->id] = $e->getMessage(); + $transaction->rollback(); + } catch (Exception $e) { + $errors[$operation->id] = $e->getMessage(); + $transaction->rollback(); + } + + } else { + $errors[$operation->id] = 'Operation notes cannot be created for un-scheduled Operations. Please add free sessions.'; + } + + if( isset($errors[$operation->id]) ){ + $evevnt_date = new DateTime($operation->event->event_date); + $errors[$operation->id] .= ' (' . $evevnt_date->format("d M Y") .': '. $operation->getProceduresCommaSeparated() . ')'; + } + } + + return $errors ? $errors : true; + + } + + public function getFirstBookableSession(\Element_OphTrOperationbooking_Operation $operation) + { + $criteria = new CDbCriteria(); + $criteria->compare('available', 1); + $criteria->addCondition("date >= '" . date("Y-m-d") . "'" ); + $criteria->order = 'date asc'; + + $dataProvider = new CActiveDataProvider('OphTrOperationbooking_Operation_Session', + array( + 'criteria' => $criteria + ) + ); + + $session_iterator = new CDataProviderIterator($dataProvider); + + foreach ($session_iterator as $session){ + $is_bookable = $session->operationBookable($operation); + + if ($is_bookable && ($session->availableMinutes >= $operation->total_duration)) { + return $session; + } + } + + return null; + } } diff --git a/protected/modules/OphTrOperationbooking/controllers/TheatreDiaryController.php b/protected/modules/OphTrOperationbooking/controllers/TheatreDiaryController.php index 5e21326b3a..cecc88afd6 100644 --- a/protected/modules/OphTrOperationbooking/controllers/TheatreDiaryController.php +++ b/protected/modules/OphTrOperationbooking/controllers/TheatreDiaryController.php @@ -38,6 +38,16 @@ public function accessRules() ), ); } + + protected function beforeAction($action) + { + $is_auto_schedule_operation = isset(Yii::app()->params['auto_schedule_operation']) && Yii::app()->params['auto_schedule_operation'] === true; + + if($is_auto_schedule_operation){ + Yii::app()->user->setFlash('warning.alert', 'Operation bookings are automatically scheduled to the next available slot, regardless of the firms.'); + } + return parent::beforeAction($action); + } /** * @return array diff --git a/protected/modules/OphTrOperationbooking/controllers/WhiteboardController.php b/protected/modules/OphTrOperationbooking/controllers/WhiteboardController.php index 191b50e59a..96368c455b 100644 --- a/protected/modules/OphTrOperationbooking/controllers/WhiteboardController.php +++ b/protected/modules/OphTrOperationbooking/controllers/WhiteboardController.php @@ -109,6 +109,11 @@ public function actionView($id) } $this->setWhiteboard($whiteboard); + if (is_object($whiteboard->booking) && $whiteboard->booking->isEditable() && !$whiteboard->is_confirmed) + { + $whiteboard->loadData($id); + } + $this->render('view', array('data' => $whiteboard), false, true); } diff --git a/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php b/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php index 3c5e12bab8..6c5278497a 100644 --- a/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php +++ b/protected/modules/OphTrOperationbooking/models/OphTrOperationbooking_Whiteboard.php @@ -74,42 +74,12 @@ public function loadData($id) $episode = Episode::model()->findByPk($event->episode_id); $patient = Patient::model()->findByPk($episode->patient_id); $contact = Contact::model()->findByPk($patient->contact_id); - - $biometryCriteria = new CDbCriteria(); - $biometryCriteria->addCondition('patient_id = :patient_id'); - $biometryCriteria->params = array('patient_id' => $patient->id); - $biometryCriteria->order = 'last_modified_date DESC'; - $biometryCriteria->limit = 1; - $biometry = Element_OphTrOperationnote_Biometry::model()->find($biometryCriteria); - - $examination = $event->getPreviousInEpisode(EventType::model()->findByAttributes(array('name' => 'Examination'))->id); - $risks = new \OEModule\OphCiExamination\models\Element_OphCiExamination_HistoryRisk(); - if ($examination) { - $risks = $risks->findByAttributes(array('event_id' => $examination->id)); - } - + $biometry = $this->recentBiometry($patient); + $blockers = $this->alphaBlockerStatusAndDate($patient); + $anticoag = $this->anticoagsStatusAndDate($patient); $labResult = Element_OphInLabResults_Inr::model()->findPatientResultByType($patient->id, '1'); - - $allergies = Yii::app()->db->createCommand() - ->select('a.name as name') - ->from('patient_allergy_assignment pas') - ->leftJoin('allergy a', 'pas.allergy_id = a.id') - ->where("pas.patient_id = {$episode->patient_id}") - ->order('a.name') - ->queryAll(); - - $allergyString = 'None'; - if ($allergies) { - $allergyString = implode(',', array_column($allergies, 'name')); - } - - $operation = Yii::app()->db->createCommand() - ->select('proc.term as term') - ->from('et_ophtroperationbooking_operation op') - ->leftJoin('ophtroperationbooking_operation_procedures_procedures opp', 'opp.element_id = op.id') - ->leftJoin('proc', 'opp.proc_id = proc.id') - ->where("op.event_id = {$id}") - ->queryAll(); + $allergyString = $this->allergyString($episode); + $operation = $this->operation($id); $this->event_id = $id; $this->booking = $booking; @@ -118,15 +88,15 @@ public function loadData($id) $this->patient_name = $contact['title'] . ' ' . $contact['first_name'] . ' ' . $contact['last_name']; $this->date_of_birth = $patient['dob']; $this->hos_num = $patient['hos_num']; - $this->procedure = implode(',', array_column($operation, 'term')); + $this->procedure = implode(', ', array_column($operation, 'term')); $this->allergies = $allergyString; $this->iol_model = ($biometry) ? $biometry->attributes['lens_description_' . $eyeLabel] . '
' . $biometry->attributes['formula_' . $eyeLabel] : 'Unknown'; $this->iol_power = ($biometry) ? $biometry->attributes['iol_power_' . $eyeLabel] : 'None'; $this->predicted_refractive_outcome = ($biometry) ? $biometry->attributes['predicted_refraction_' . $eyeLabel] : 'Unknown'; $this->alpha_blockers = $patient->hasRisk('Alpha blockers'); $this->anticoagulants = $patient->hasRisk('Anticoagulants'); - $this->alpha_blocker_name = ($risks) ? $risks->alpha_blocker_name : ''; - $this->anticoagulant_name = ($risks) ? $risks->anticoagulant_name : ''; + $this->alpha_blocker_name = $blockers; + $this->anticoagulant_name = $anticoag; $this->inr = ($labResult) ? $labResult : 'None'; if (!$this->predicted_additional_equipment) { @@ -149,4 +119,122 @@ public function isEditable() { return is_object($this->booking) && $this->booking->isEditable() && !$this->is_confirmed; } + + /** + * @param $patient + * @return mixed + */ + protected function recentBiometry($patient) + { + $biometryCriteria = new CDbCriteria(); + $biometryCriteria->addCondition('patient_id = :patient_id'); + $biometryCriteria->params = array('patient_id' => $patient->id); + $biometryCriteria->order = 'last_modified_date DESC'; + $biometryCriteria->limit = 1; + $biometry = Element_OphTrOperationnote_Biometry::model()->find($biometryCriteria); + + return $biometry; + } + + /** + * @param $episode + * + * @return string + */ + protected function allergyString($episode) + { + $allergies = Yii::app()->db->createCommand() + ->select('a.name as name, pas.other as other') + ->from('patient_allergy_assignment pas') + ->leftJoin('allergy a', 'pas.allergy_id = a.id') + ->where("a.name != 'Other' AND pas.patient_id = {$episode->patient_id}") + ->order('a.name') + ->queryAll(); + + $allergiesOther = Yii::app()->db->createCommand() + ->select('a.name as name, pas.other as other') + ->from('patient_allergy_assignment pas') + ->leftJoin('allergy a', 'pas.allergy_id = a.id') + ->where("a.name = 'Other' AND pas.patient_id = {$episode->patient_id}") + ->order('a.name') + ->queryAll(); + + + $allergyString = 'None'; + if ($allergies || $allergiesOther) { + $allergyString = implode(', ', array_column($allergies, 'name')); + $allergyOtherString = implode(', ', array_column($allergiesOther, 'other')); + + if ($allergyOtherString && $allergyString){ + $allergyString = $allergyString . ", " . $allergyOtherString; + } + + if ($allergyOtherString && !$allergyString){ + $allergyString = $allergyOtherString; + } + + + return $allergyString; + } + + return $allergyString; + } + + /** + * @param $id + * + * @return mixed + */ + protected function operation($id) + { + $operation = Yii::app()->db->createCommand() + ->select('proc.term as term') + ->from('et_ophtroperationbooking_operation op') + ->leftJoin('ophtroperationbooking_operation_procedures_procedures opp', 'opp.element_id = op.id') + ->leftJoin('proc', 'opp.proc_id = proc.id') + ->where("op.event_id = {$id}") + ->queryAll(); + + return $operation; + } + + /** + * @param $patient + * + * @return string + */ + protected function alphaBlockerStatusAndDate($patient) + { + $risks = new \OEModule\OphCiExamination\models\Element_OphCiExamination_HistoryRisk(); + $blockers = $risks->mostRecentCheckedAlpha($patient->id); + if ($blockers) { + if ($blockers->alphablocker === '2') { + return 'No (' . Helper::convertMySQL2NHS($blockers->event->event_date) . ')'; + } else { + return 'Yes - ' . $blockers->alpha_blocker_name . ' (' . Helper::convertMySQL2NHS($blockers->event->event_date) . ')'; + } + } else { + return 'Not Checked'; + } + } + + /** + * @param $patient + * + * @return string + */ + protected function anticoagsStatusAndDate($patient) + { + $risks = new \OEModule\OphCiExamination\models\Element_OphCiExamination_HistoryRisk(); + $anticoag = $risks->mostRecentCheckedAnticoag($patient->id); + if ($anticoag) { + if ($anticoag->anticoagulant === '2') { + return 'No (' . Helper::convertMySQL2NHS($anticoag->event->event_date) . ')'; + } else { + return 'Yes - ' . $anticoag->anticoagulant_name . ' (' . Helper::convertMySQL2NHS($anticoag->event->event_date) . ')'; + } + } else { + return 'Not Checked'; + } + } } diff --git a/protected/modules/OphTrOperationbooking/views/booking/schedule.php b/protected/modules/OphTrOperationbooking/views/booking/schedule.php index 935daead40..4bed00cdcc 100644 --- a/protected/modules/OphTrOperationbooking/views/booking/schedule.php +++ b/protected/modules/OphTrOperationbooking/views/booking/schedule.php @@ -18,6 +18,11 @@ */ ?> beginContent('//patient/event_container'); ?> +checkAccess('OprnViewClinical'); + +$warnings = $this->patient->getWarnings($clinical); +?>
@@ -39,6 +44,20 @@
+ +
+
+
+ + + - +
+
+
+ + +
patient->getDisplayName() ?> (patient->hos_num ?> ) diff --git a/protected/modules/OphTrOperationbooking/views/default/create.php b/protected/modules/OphTrOperationbooking/views/default/create.php index a541768b33..8ed2088ab4 100644 --- a/protected/modules/OphTrOperationbooking/views/default/create.php +++ b/protected/modules/OphTrOperationbooking/views/default/create.php @@ -18,6 +18,11 @@ */ ?> beginContent('//patient/event_container'); ?> +checkAccess('OprnViewClinical'); + +$warnings = $this->patient->getWarnings($clinical); +?> beginWidget('BaseEventTypeCActiveForm', array( @@ -32,6 +37,18 @@ $this->event_actions[] = EventAction::button('Save and Schedule now', '#', array('level' => 'secondary'), array('name' => 'scheduleNow', 'id' => 'et_save_and_schedule', 'class' => 'button small', 'form' => 'clinical-create', 'style' => $this->checkScheduleAccess() ? '' : 'display: none;')); ?> + +
+
+
+ + + - +
+
+
+ displayErrors($errors); $this->renderOpenElements($this->action->id, $form); diff --git a/protected/modules/OphTrOperationbooking/views/default/update.php b/protected/modules/OphTrOperationbooking/views/default/update.php index 332d55b450..a0da7de49b 100644 --- a/protected/modules/OphTrOperationbooking/views/default/update.php +++ b/protected/modules/OphTrOperationbooking/views/default/update.php @@ -18,6 +18,11 @@ */ ?> beginContent('//patient/event_container'); ?> +checkAccess('OprnViewClinical'); + +$warnings = $this->patient->getWarnings($clinical); +?> beginWidget('BaseEventTypeCActiveForm', array( @@ -43,6 +48,19 @@ params['OphTrOperationbooking_duplicate_proc_warn']) {?> + +
+
+
+ + + - +
+
+
+ + displayErrors($errors)?> renderOpenElements($this->action->id, $form); ?> renderOptionalElements($this->action->id, $form); ?> diff --git a/protected/modules/OphTrOperationbooking/views/default/view.php b/protected/modules/OphTrOperationbooking/views/default/view.php index 0cf9ed2319..13e3763e1d 100644 --- a/protected/modules/OphTrOperationbooking/views/default/view.php +++ b/protected/modules/OphTrOperationbooking/views/default/view.php @@ -17,6 +17,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 */ ?> +checkAccess('OprnViewClinical'); + +$warnings = $this->patient->getWarnings($clinical); +?> beginContent('//patient/event_container'); ?> @@ -24,6 +29,19 @@ $this->moduleNameCssClass .= ' highlight-fields'; $this->title .= ' ('.Element_OphTrOperationbooking_Operation::model()->find('event_id=?', array($this->event->id))->status->name.')'?> + +
+
+
+ + + - +
+
+
+ + has_gp) {?>
Patient has no GP practice address, please correct in PAS before printing GP letter. diff --git a/protected/modules/OphTrOperationbooking/views/default/view_Element_OphTrOperationbooking_Operation.php b/protected/modules/OphTrOperationbooking/views/default/view_Element_OphTrOperationbooking_Operation.php index 9cf254dbe8..b00ea77447 100644 --- a/protected/modules/OphTrOperationbooking/views/default/view_Element_OphTrOperationbooking_Operation.php +++ b/protected/modules/OphTrOperationbooking/views/default/view_Element_OphTrOperationbooking_Operation.php @@ -131,6 +131,17 @@
+
+
+

Admission category:

+
overnight_stay) ? 'An overnight stay' : 'Day case'?> +
+
+
+

Total theatre time (mins):

+
total_duration)?>
+
+
special_equipment)): ?> diff --git a/protected/modules/OphTrOperationbooking/views/theatreDiary/index.php b/protected/modules/OphTrOperationbooking/views/theatreDiary/index.php index a9a22b1e3f..26c3ddb244 100644 --- a/protected/modules/OphTrOperationbooking/views/theatreDiary/index.php +++ b/protected/modules/OphTrOperationbooking/views/theatreDiary/index.php @@ -18,11 +18,15 @@ */ ?>

Theatre Diaries

- +
+
+ renderPartial('//base/_messages'); ?> +
+
- +
Use the filters below to view Theatre schedules: diff --git a/protected/modules/OphTrOperationbooking/views/whiteboard/header.php b/protected/modules/OphTrOperationbooking/views/whiteboard/header.php index d51f66d9ba..c1aabef3d4 100644 --- a/protected/modules/OphTrOperationbooking/views/whiteboard/header.php +++ b/protected/modules/OphTrOperationbooking/views/whiteboard/header.php @@ -24,12 +24,6 @@ Refresh refresh - endWidget()?>
diff --git a/protected/modules/OphTrOperationbooking/views/whiteboard/view.php b/protected/modules/OphTrOperationbooking/views/whiteboard/view.php index b179006089..33ad41a006 100644 --- a/protected/modules/OphTrOperationbooking/views/whiteboard/view.php +++ b/protected/modules/OphTrOperationbooking/views/whiteboard/view.php @@ -78,11 +78,7 @@

Alpha-blockers

- alpha_blockers):?> - Yes - alpha_blocker_name?> - - No - + alpha_blocker_name?>
@@ -92,12 +88,8 @@

Anticoagulants

- anticoagulants):?> - Yes - anticoagulant_name?>
- INR: inr?> - - No - + anticoagulant_name?>
+ INR: inr?>
diff --git a/protected/modules/OphTrOperationnote/assets/js/module.js b/protected/modules/OphTrOperationnote/assets/js/module.js index 43afbe3b56..0b5c8d4bd9 100644 --- a/protected/modules/OphTrOperationnote/assets/js/module.js +++ b/protected/modules/OphTrOperationnote/assets/js/module.js @@ -675,11 +675,11 @@ function changeEye() { if(typeof pcrCalculate === 'function'){ if($("#Element_OphTrOperationnote_ProcedureList_eye_id_2").attr('checked') == "checked") { - pcrCalculate('right'); + pcrCalculate($('#ophCiExaminationPCRRiskRightEye'), 'right'); } if($("#Element_OphTrOperationnote_ProcedureList_eye_id_1").attr('checked') == "checked") { - pcrCalculate('left'); + pcrCalculate($('#ophCiExaminationPCRRiskLeftEye'), 'left'); } } diff --git a/protected/modules/OphTrOperationnote/components/OphTrOperationnote_API.php b/protected/modules/OphTrOperationnote/components/OphTrOperationnote_API.php index d63baa5e64..032ac10bf4 100644 --- a/protected/modules/OphTrOperationnote/components/OphTrOperationnote_API.php +++ b/protected/modules/OphTrOperationnote/components/OphTrOperationnote_API.php @@ -145,6 +145,27 @@ public function getLastOperationDate(\Patient $patient) return ''; } + /** + * Get the last operation date + * + * @param Patient $patient + * + * @return false|string + */ + public function getLastOperationDateUnformatted(\Patient $patient) + { + if ($episode = $patient->getEpisodeForCurrentSubspecialty()) { + $event_type = EventType::model()->find('class_name=?', array('OphTrOperationnote')); + $event = $this->getMostRecentEventInEpisode($episode->id, $event_type->id); + if (isset($event->event_date)) { + return $event->event_date; + } + } + + return ''; + } + + /** * Get the last operation's surgeon name diff --git a/protected/modules/OphTrOperationnote/config/common.php b/protected/modules/OphTrOperationnote/config/common.php index d4fe3e8ca5..254e78fab2 100644 --- a/protected/modules/OphTrOperationnote/config/common.php +++ b/protected/modules/OphTrOperationnote/config/common.php @@ -28,6 +28,7 @@ 'Per Op Instructions' => '/OphTrOperationnote/admin/postOpInstructions', 'Default Incision Length' => '/OphTrOperationnote/admin/viewIncisionLengthDefaults', 'Operative Devices' => '/OphTrOperationnote/OperativeDevice/list', + 'Operative Devices Mapping' => '/OphTrOperationnote/OperativeDeviceMapping/list', ), 'reports' => array( 'Operations' => '/OphTrOperationnote/report/operation', diff --git a/protected/modules/OphTrOperationnote/controllers/DefaultController.php b/protected/modules/OphTrOperationnote/controllers/DefaultController.php index a1538adfb8..beb3e51dc4 100644 --- a/protected/modules/OphTrOperationnote/controllers/DefaultController.php +++ b/protected/modules/OphTrOperationnote/controllers/DefaultController.php @@ -197,8 +197,10 @@ protected function initActionCreate() { parent::initActionCreate(); + $api = Yii::app()->moduleAPI->get('OphTrOperationbooking'); + if (isset($_GET['booking_event_id'])) { - if (!$api = Yii::app()->moduleAPI->get('OphTrOperationbooking')) { + if (!$api) { throw new Exception('invalid request for booking event'); } if (!$this->booking_operation = $api->getOperationForEvent($_GET['booking_event_id'])) { @@ -207,6 +209,18 @@ protected function initActionCreate() } elseif (isset($_GET['unbooked'])) { $this->unbooked = true; } + + $is_auto_schedule_operation = Yii::app()->params['auto_schedule_operation']; + + if ($api && $is_auto_schedule_operation) { + $schedule_result = $api->autoScheduleOperationBookings($this->current_episode); + if( $schedule_result !== true ){ + foreach($schedule_result as $error){ + Yii::app()->user->setFlash('error.alert', $error); + } + + } + } $this->initEdit(); } @@ -273,6 +287,7 @@ public function actionCreate() $this->render('select_event', array( 'errors' => $errors, 'bookings' => $bookings, + 'is_auto_schedule_operation' => Yii::app()->params['auto_schedule_operation'] )); } } diff --git a/protected/modules/OphTrOperationnote/controllers/OperativeDeviceMappingController.php b/protected/modules/OphTrOperationnote/controllers/OperativeDeviceMappingController.php new file mode 100644 index 0000000000..b56372e019 --- /dev/null +++ b/protected/modules/OphTrOperationnote/controllers/OperativeDeviceMappingController.php @@ -0,0 +1,228 @@ +. + * + * @link http://www.openeyes.org.uk + * + * @author OpenEyes + * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust + * @copyright Copyright (c) 2011-2012, OpenEyes Foundation + * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 + */ +class OperativeDeviceMappingController extends BaseAdminController +{ + /** + * To list the operative devices per site per subspeciality + */ + public function actionList() + { + $admin = new AdminListAutocomplete(SiteSubspecialtyOperativeDevice::model(), $this); + + $admin->setListFields(array( + 'id', + 'devices.name', + 'default', + )); + + $admin->setCustomDeleteURL('/OphTrOperationnote/OperativeDeviceMapping/delete'); + $admin->setCustomSaveURL('/OphTrOperationnote/OperativeDeviceMapping/add'); + $admin->setCustomSetDefaultURL('/OphTrOperationnote/OperativeDeviceMapping/setDefault'); + $admin->setCustomRemoveDefaultURL('/OphTrOperationnote/OperativeDeviceMapping/removeDefault'); + $admin->setModelDisplayName('Operation Note Operative Device Mapping'); + $admin->setFilterFields( + array( + array( + 'label' => 'Site', + 'dropDownName' => 'site_id', + 'defaultValue' => Yii::app()->session['selected_site_id'], + 'listModel' => Site::model(), + 'listIdField' => 'id', + 'listDisplayField' => 'short_name', + ), + array( + 'label' => 'Subspecialty', + 'dropDownName' => 'subspecialty_id', + 'defaultValue' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id, + 'listModel' => Subspecialty::model(), + 'listIdField' => 'id', + 'listDisplayField' => 'name', + ), + ) + ); + + // we set default search options + if ($this->request->getParam('search') == '') { + $admin->getSearch()->initSearch(array( + 'filterid' => array( + 'subspecialty_id' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id, + 'site_id' => Yii::app()->session['selected_site_id'], + ), + ) + ); + } + + $admin->setAutocompleteField( + array( + 'fieldName' => 'operative_device_id', + 'allowBlankSearch' => 1, + 'jsonURL' => '/OphTrOperationnote/OperativeDeviceMapping/search', + 'placeholder' => 'search for adding operative devices', + ) + ); + //$admin->searchAll(); + $admin->listModel(); + } + + /** + * Delete an operative device association with the site + * @param $itemId + */ + public function actionDelete($itemId) + { + /* + * We make sure to not allow deleting directly with the URL, user must come from the commondrugs list page + */ + if (!Yii::app()->request->isAjaxRequest) { + $this->render('errorpage', array('errorMessage' => 'notajaxcall')); + } else { + if ($leafletSubspecialy = SiteSubspecialtyOperativeDevice::model()->findByPk($itemId)) { + $leafletSubspecialy->delete(); + echo 'success'; + } else { + $this->render('errorpage', array('errormessage' => 'recordmissing')); + } + } + } + + /** + * To set default values to Operative Device + * @param $item_id + */ + public function actionSetDefault($itemId) + { + /* + * We make sure to not allow deleting directly with the URL, user must come from the commondrugs list page + */ + if (!Yii::app()->request->isAjaxRequest) { + $this->render('errorpage', array('errorMessage' => 'notajaxcall')); + } else { + $currentSSOD = SiteSubspecialtyOperativeDevice::model()->findByPk($itemId); + if ($currentSSOD) { + $currentSSOD->default = 1; + if ($currentSSOD->update()) { + echo 'success set default to SSOD'; + } else { + echo 'error'; + } + } else { + echo 'error'; + } + } + } + + /** + * To remove default values to Operative Device + * @param $item_id + */ + public function actionRemoveDefault($itemId) + { + /* + * We make sure to not allow deleting directly with the URL, user must come from the commondrugs list page + */ + if (!Yii::app()->request->isAjaxRequest) { + $this->render('errorpage', array('errorMessage' => 'notajaxcall')); + } else { + $currentSSOD = SiteSubspecialtyOperativeDevice::model()->findByPk($itemId); + if ($currentSSOD) { + $currentSSOD->default = 0; + if ($currentSSOD->save()) { + echo 'success remove default to SSOD'; + } else { + echo 'error'; + } + } else { + echo 'error'; + } + } + } + + /** + * To add new operative devices to the site. + */ + public function actionAdd() + { + $subspecialtyId = $this->request->getParam('subspecialty_id'); + $siteId = $this->request->getParam('site_id'); + $operativeDeviceId = $this->request->getParam('operative_device_id'); + if (!Yii::app()->request->isAjaxRequest) { + $this->render('errorpage', array('errormessage' => 'notajaxcall')); + } else { + if (!is_numeric($subspecialtyId) || !is_numeric($siteId) || !is_numeric($operativeDeviceId)) { + echo 'error'; + } else { + $criteria = new CDbCriteria(); + $criteria->condition = 'operative_device_id=:operative_device_id AND site_id=:site_id AND subspecialty_id=:subspecialty_id'; + $criteria->params = array( + ':operative_device_id' => $operativeDeviceId, + ':site_id' => $siteId, + ':subspecialty_id' => $subspecialtyId, + ); + $currentSSOD = SiteSubspecialtyOperativeDevice::model()->findall($criteria); + if (!$currentSSOD) { + $newSSOD = new SiteSubspecialtyOperativeDevice(); + $newSSOD->subspecialty_id = $subspecialtyId; + $newSSOD->site_id = $siteId; + $newSSOD->operative_device_id = $operativeDeviceId; + if ($newSSOD->save()) { + echo 'success added to SSAA'; + } else { + echo 'error'; + } + } else { + echo 'success'; + } + } + } + } + + /** + * To search the operative devices. + */ + public function actionSearch() + { + if (Yii::app()->request->isAjaxRequest) { + $criteria = new CDbCriteria(); + if (isset($_GET['term'])) { + $term = $_GET['term']; + $criteria->addCondition(array('LOWER(name) LIKE :term'), + 'OR'); + $params[':term'] = '%' . strtolower(strtr($term, array('%' => '\%'))) . '%'; + } + + $criteria->order = 'name'; + $criteria->select = 'id, name'; + $criteria->params = $params; + + $results = OperativeDevice::model()->active()->findAll($criteria); + + $return = array(); + foreach ($results as $resultRow) { + $return[] = array( + 'label' => $resultRow->name, + 'value' => $resultRow->name, + 'id' => $resultRow->id, + ); + } + echo CJSON::encode($return); + } + } + +} \ No newline at end of file diff --git a/protected/modules/OphTrOperationnote/views/default/form_Element_OphTrOperationnote_Cataract.php b/protected/modules/OphTrOperationnote/views/default/form_Element_OphTrOperationnote_Cataract.php index 3a81980cd1..4ecfba7dea 100644 --- a/protected/modules/OphTrOperationnote/views/default/form_Element_OphTrOperationnote_Cataract.php +++ b/protected/modules/OphTrOperationnote/views/default/form_Element_OphTrOperationnote_Cataract.php @@ -23,39 +23,39 @@ $form->layoutColumns = array('label' => 3, 'field' => 9); ?>
-
-
- renderPartial($element->form_view.'_OEEyeDraw', array( +
+
+ renderPartial($element->form_view . '_OEEyeDraw', array( 'element' => $element, 'form' => $form, )); ?> -
-
- renderPartial($element->form_view.'_OEEyeDraw_fields', array( +
+
+ renderPartial($element->form_view . '_OEEyeDraw_fields', array( 'form' => $form, 'element' => $element, )); ?> -
-
- - PCR Risk - % - +
+
+ + PCR Risk + % + -
- +
diff --git a/protected/modules/OphTrOperationnote/views/default/form_Element_OphTrOperationnote_Cataract_OEEyeDraw_fields.php b/protected/modules/OphTrOperationnote/views/default/form_Element_OphTrOperationnote_Cataract_OEEyeDraw_fields.php index 05a06d293a..9e0f1c9714 100644 --- a/protected/modules/OphTrOperationnote/views/default/form_Element_OphTrOperationnote_Cataract_OEEyeDraw_fields.php +++ b/protected/modules/OphTrOperationnote/views/default/form_Element_OphTrOperationnote_Cataract_OEEyeDraw_fields.php @@ -18,33 +18,53 @@ */ ?> -dropDownList($element, 'incision_site_id', 'OphTrOperationnote_IncisionSite', array('empty' => '- Please select -', 'textAttribute' => 'data-value'), false, array('field' => 4))?> -textField($element, 'length', array(), array(), array_merge($form->layoutColumns, array('field' => 3)))?> -textField($element, 'meridian', array(), array(), array_merge($form->layoutColumns, array('field' => 3)))?> -dropDownList($element, 'incision_type_id', 'OphTrOperationnote_IncisionType', array('empty' => '- Please select -', 'textAttribute' => 'data-value'), false, array('field' => 4))?> -textArea($element, 'report', array(), false, array('rows' => 6))?> +dropDownList($element, 'incision_site_id', 'OphTrOperationnote_IncisionSite', + array('empty' => '- Please select -', 'textAttribute' => 'data-value'), false, array('field' => 4)) ?> +textField($element, 'length', array(), array(), + array_merge($form->layoutColumns, array('field' => 3))) ?> +textField($element, 'meridian', array(), array(), + array_merge($form->layoutColumns, array('field' => 3))) ?> +dropDownList($element, 'incision_type_id', 'OphTrOperationnote_IncisionType', + array('empty' => '- Please select -', 'textAttribute' => 'data-value'), false, array('field' => 4)) ?> +textArea($element, 'report', array(), false, array('rows' => 6)) ?> dropDownList($element, 'iol_type_id', array( - CHtml::listData(OphTrOperationnote_IOLType::model()->activeOrPk($element->iol_type_id)->findAll(array('condition' => 'private=0', 'order' => 'display_order asc')), 'id', 'name'), - CHtml::listData(OphTrOperationnote_IOLType::model()->activeOrPk($element->iol_type_id)->findAll(array('condition' => 'private=1', 'order' => 'display_order')), 'id', 'name'), - ), - array('empty' => '- Please select -', 'divided' => true), $element->iol_hidden, array('field' => 4))?> -
-
- -
-
- -
-
- -
-
- -
-
+ CHtml::listData(OphTrOperationnote_IOLType::model()->activeOrPk($element->iol_type_id)->findAll(array( + 'condition' => 'private=0', + 'order' => 'display_order asc', + )), 'id', 'name'), + CHtml::listData(OphTrOperationnote_IOLType::model()->activeOrPk($element->iol_type_id)->findAll(array( + 'condition' => 'private=1', + 'order' => 'display_order', + )), 'id', 'name'), +), + array('empty' => '- Please select -', 'divided' => true), $element->iol_hidden, array('field' => 4)) ?> +
+
+ +
+
+ +
+
+ +
+
+ +
+
-dropDownList($element, 'iol_position_id', 'OphTrOperationnote_IOLPosition', array('empty' => '- Please select -'), $element->iol_hidden, array('field' => 4))?> -multiSelectList($element, 'OphTrOperationnote_CataractOperativeDevices', 'operative_devices', 'id', $this->getOperativeDeviceList($element), $this->getOperativeDeviceDefaults(), array('empty' => '- Devices -', 'label' => 'Devices'), false, false, null, false, false, array('field' => 4))?> -multiSelectList($element, 'OphTrOperationnote_CataractComplications', 'complications', 'id', CHtml::listData(OphTrOperationnote_CataractComplications::model()->activeOrPk($element->cataractComplicationValues)->findAll(array('order' => 'display_order asc')), 'id', 'name'), null, array('empty' => '- Complications -', 'label' => 'Complications'), false, false, null, false, false, array('field' => 4))?> -textArea($element, 'complication_notes', array(), false, array('rows' => 6))?> -hiddenInput($element, 'pcr_risk')?> \ No newline at end of file +dropDownList($element, 'iol_position_id', 'OphTrOperationnote_IOLPosition', + array('empty' => '- Please select -'), $element->iol_hidden, array('field' => 4)) ?> +multiSelectList($element, 'OphTrOperationnote_CataractOperativeDevices', 'operative_devices', 'id', + $this->getOperativeDeviceList($element), $this->getOperativeDeviceDefaults(), + array('empty' => '- Agents -', 'label' => 'Agents'), false, false, null, false, false, array('field' => 4)) ?> +multiSelectList($element, 'OphTrOperationnote_CataractComplications', 'complications', 'id', + CHtml::listData(OphTrOperationnote_CataractComplications::model()->activeOrPk($element->cataractComplicationValues)->findAll(array('order' => 'display_order asc')), + 'id', 'name'), null, array('empty' => '- Complications -', 'label' => 'Complications'), false, false, null, + false, false, array('field' => 4)) ?> +textArea($element, 'complication_notes', array(), false, array('rows' => 6)) ?> +hiddenInput($element, 'pcr_risk') ?> \ No newline at end of file diff --git a/protected/modules/OphTrOperationnote/views/default/select_event.php b/protected/modules/OphTrOperationnote/views/default/select_event.php index 6c07701b98..bc5ea54346 100644 --- a/protected/modules/OphTrOperationnote/views/default/select_event.php +++ b/protected/modules/OphTrOperationnote/views/default/select_event.php @@ -65,12 +65,17 @@ op - + operation->booking->session->NHSDate('date')?> + Operation + + + operation->comments; ?> + operation->procedures as $i => $procedure) { if ($i > 0) { echo '
'; } diff --git a/protected/tests/unit/components/PatientMergeTest.php b/protected/tests/unit/components/PatientMergeTest.php index 1e3a3e1624..6dadb800ad 100644 --- a/protected/tests/unit/components/PatientMergeTest.php +++ b/protected/tests/unit/components/PatientMergeTest.php @@ -43,26 +43,26 @@ public function setUp() public function testComparePatientDetails() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); - $result = $mergeHandler->comparePatientDetails($primaryPatient, $secondaryPatient); + $result = $merge_handler->comparePatientDetails($primary_patient, $secondary_patient); $this->assertTrue(is_array($result)); - $this->assertFalse($result['isConflict'], 'Personal details should be the same at this point.'); + $this->assertFalse($result['is_conflict'], 'Personal details should be the same at this point.'); $this->assertEmpty($result['details']); // Change the dob and gender - $primaryPatient->gender = 'M'; - $primaryPatient->dob = '1981-12-21'; + $primary_patient->gender = 'M'; + $primary_patient->dob = '1981-12-21'; - $primaryPatient->save(); + $primary_patient->save(); - $result = $mergeHandler->comparePatientDetails($primaryPatient, $secondaryPatient); + $result = $merge_handler->comparePatientDetails($primary_patient, $secondary_patient); - $this->assertTrue($result['isConflict'], 'Personal details should NOT be the same. Both DOB and Gender are different at this point.'); + $this->assertTrue($result['is_conflict'], 'Personal details should NOT be the same. Both DOB and Gender are different at this point.'); $this->assertEquals($result['details'][0]['column'], 'dob'); $this->assertEquals($result['details'][0]['primary'], '1981-12-21'); @@ -75,10 +75,10 @@ public function testComparePatientDetails() public function testUpdateEpisodesWhenPrimaryHasNoEpisodes() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); $episode7 = $this->episodes('episode7'); $episode7->patient_id = 1; @@ -88,15 +88,15 @@ public function testUpdateEpisodesWhenPrimaryHasNoEpisodes() $episode8->patient_id = 1; $episode8->save(); - $primaryPatient->refresh(); + $primary_patient->refresh(); // primary has no episodes - $this->assertEquals(count($primaryPatient->episodes), 0); + $this->assertEquals(count($primary_patient->episodes), 0); // at this pont the primary patient has no episodes and the secondary has // move the episodes , (secondary INTO primary) - $result = $mergeHandler->updateEpisodes($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateEpisodes($primary_patient, $secondary_patient); $this->assertTrue($result); @@ -106,25 +106,25 @@ public function testUpdateEpisodesWhenPrimaryHasNoEpisodes() $episode10 = $this->episodes('episode10'); $this->assertEquals($episode10->patient_id, 7); - $secondaryPatient->refresh(); + $secondary_patient->refresh(); // secondary has no episodes - $this->assertEquals(count($secondaryPatient->episodes), 0); + $this->assertEquals(count($secondary_patient->episodes), 0); } public function testUpdateEpisodesWhenBothHaveEpisodesNoConflict() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); // this episode conflicts with episode7, so assign it to a different user to avoid the conflict $eposode9 = $this->episodes('episode9'); $eposode9->patient_id = 1; $eposode9->save(); - $secondaryPatient->refresh(); + $secondary_patient->refresh(); // now primary has Episode7 and Episode8 //secondary has Episode 10 @@ -138,10 +138,10 @@ public function testUpdateEpisodesWhenBothHaveEpisodesNoConflict() $eposode10 = $this->episodes('episode10'); $this->assertEquals($eposode10->patient_id, 8); - $this->assertEquals(2, count($primaryPatient->episodes)); - $this->assertEquals(1, count($secondaryPatient->episodes)); + $this->assertEquals(2, count($primary_patient->episodes)); + $this->assertEquals(1, count($secondary_patient->episodes)); - $result = $mergeHandler->updateEpisodes($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateEpisodes($primary_patient, $secondary_patient); $this->assertTrue($result); @@ -155,45 +155,47 @@ public function testUpdateEpisodesWhenBothHaveEpisodesNoConflict() } /** - * We have to keep the newer/most recent episode - * so if the Secondary Episode is the older one than we flag it as deleted + * We have to keep the episode with greater status + * so if the Secondary Episode has greater status we flag it as deleted */ - public function testUpdateEpisodesWhenBothHaveEpisodesConflict_secondaryEpisodeOlder() + public function testUpdateEpisodesWhenBothHaveEpisodesConflict_secondaryEpisodeHasLessStatus() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - // $primaryPatient has episode7 and episode8 - $primaryPatient = $this->patients('patient7'); // episode7 + // $primary_patient has episode7 and episode8 + $primary_patient = $this->patients('patient7'); // episode7 - // $secondaryPatient has episode9, episode10 - $secondaryPatient = $this->patients('patient8'); //episode9 + // $secondary_patient has episode9, episode10 + $secondary_patient = $this->patients('patient8'); //episode9 $episode7 = $this->episodes('episode7'); - $episode7->created_date = date('Y-m-d', strtotime('-15 days')); + $episode7->episode_status_id = 5; + $episode7->start_date = date('Y-m-d', strtotime('-30 days')); + $episode7->end_date = date('Y-m-d', strtotime('-15 days')); $episode7->save(); $episode9 = $this->episodes('episode9'); - $episode9->created_date = date('Y-m-d', strtotime('-30 days')); + $episode9->episode_status_id = 2; + $episode9->start_date = date('Y-m-d', strtotime('-20 days')); + $episode9->end_date = date('Y-m-d', strtotime('-10 days')); $episode9->save(); + + $this->assertTrue($episode7->status->order > $episode9->status->order); - // conflicting episodes : - // episode7 <-> episode9 - - $this->assertTrue($episode7->created_date > $episode9->created_date); - $this->assertEquals(count($primaryPatient->episodes), 2); - $this->assertEquals(count($secondaryPatient->episodes), 2); + $this->assertEquals(count($primary_patient->episodes), 2); + $this->assertEquals(count($secondary_patient->episodes), 2); // move the episodes , (secondary INTO primary) - $result = $mergeHandler->updateEpisodes($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateEpisodes($primary_patient, $secondary_patient); - $this->assertTrue($result, 'Merge result FALSE.'); + $episode7->refresh(); + $this->assertEquals( date('Y-m-d 00:00:00', strtotime('-30 days')), $episode7->start_date ); + $this->assertEquals( date('Y-m-d 00:00:00', strtotime('-10 days')), $episode7->end_date ); - // The conflicting episodes: - // episode9 created 30 days ago and the episode7 created 15 days ago - // as we keep the older episode we move events from episode7 to episode9 than move episode9 to Patient7 + $this->assertTrue($result, 'Merge result FALSE.'); - $this->assertEquals(count($primaryPatient->episodes), 2); + $this->assertEquals(count($primary_patient->episodes), 2); $event16 = $this->events('event16'); $this->assertEquals($event16->episode_id, 9); @@ -219,34 +221,48 @@ public function testUpdateEpisodesWhenBothHaveEpisodesConflict_secondaryEpisodeO $episode10->refresh(); $this->assertEquals($episode10->patient_id, 7); - $secondaryPatient->refresh(); - $this->assertEquals(count($secondaryPatient->episodes), 0); + $secondary_patient->refresh(); + $this->assertEquals(count($secondary_patient->episodes), 0); - $primaryPatient->refresh(); - $this->assertEquals(count($primaryPatient->episodes), 3); + $primary_patient->refresh(); + $this->assertEquals(count($primary_patient->episodes), 3); } - public function testUpdateEpisodesWhenBothHaveEpisodesConflict_primaryEpisodeOlder() + public function testUpdateEpisodesWhenBothHaveEpisodesConflict_primaryEpisodeHasLessStatus() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - // $primaryPatient has episode7 and episode8 - $primaryPatient = $this->patients('patient7'); + // $primary_patient has episode7 and episode8 + $primary_patient = $this->patients('patient7'); - // $secondaryPatient has episode9, episode10 - $secondaryPatient = $this->patients('patient8'); + // $secondary_patient has episode9, episode10 + $secondary_patient = $this->patients('patient8'); // conflicting episodes : // episode7 <-> episode9 $episode7 = $this->episodes('episode7'); + $episode7->episode_status_id = 2; + $episode7->start_date = date('Y-m-d', strtotime('-20 days')); + $episode7->end_date = date('Y-m-d', strtotime('-10 days')); + $episode7->save(); + $episode9 = $this->episodes('episode9'); - $this->assertTrue($episode7->created_date < $episode9->created_date); + $episode9->episode_status_id = 5; + $episode9->start_date = date('Y-m-d', strtotime('-30 days')); + $episode9->end_date = null; + $episode9->save(); + + $this->assertTrue($episode7->status->order < $episode9->status->order); - $this->assertEquals(count($primaryPatient->episodes), 2); - $this->assertEquals(count($secondaryPatient->episodes), 2); + $this->assertEquals(count($primary_patient->episodes), 2); + $this->assertEquals(count($secondary_patient->episodes), 2); - $result = $mergeHandler->updateEpisodes($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateEpisodes($primary_patient, $secondary_patient); + + $episode9->refresh(); + $this->assertEquals( date('Y-m-d 00:00:00', strtotime('-30 days')), $episode9->start_date ); + $this->assertEquals( null, $episode9->end_date ); $this->assertTrue($result, 'Merge result FALSE.'); @@ -273,22 +289,22 @@ public function testUpdateEpisodesWhenBothHaveEpisodesConflict_primaryEpisodeOld $episode8 = $this->episodes('episode8'); $this->assertEquals($episode8->patient_id, 7); - $secondaryPatient->refresh(); - $this->assertEquals(count($secondaryPatient->episodes), 0); + $secondary_patient->refresh(); + $this->assertEquals(count($secondary_patient->episodes), 0); - $primaryPatient->refresh(); - $this->assertEquals(count($primaryPatient->episodes), 3); + $primary_patient->refresh(); + $this->assertEquals(count($primary_patient->episodes), 3); } public function testUpdateLegacyEpisodes_primaryNoLegacyEpisodes() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - // $primaryPatient has episode7 and episode8 - $primaryPatient = $this->patients('patient7'); + // $primary_patient has episode7 and episode8 + $primary_patient = $this->patients('patient7'); - // $secondaryPatient has episode9, episode10 - $secondaryPatient = $this->patients('patient8'); + // $secondary_patient has episode9, episode10 + $secondary_patient = $this->patients('patient8'); // Lets modify the episodes to have a legacy episode @@ -300,9 +316,9 @@ public function testUpdateLegacyEpisodes_primaryNoLegacyEpisodes() $episode9->save(); $this->assertEquals(1, $episode9->legacy); - $primaryPatient->refresh(); + $primary_patient->refresh(); - $result = $mergeHandler->updateLegacyEpisodes($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateLegacyEpisodes($primary_patient, $secondary_patient); $this->assertTrue($result, 'Merge result FALSE.'); @@ -311,22 +327,22 @@ public function testUpdateLegacyEpisodes_primaryNoLegacyEpisodes() $episode9 = $this->episodes('episode9'); $this->assertEquals($episode9->patient_id, 7); - $secondaryPatient->refresh(); - $this->assertEquals(count($secondaryPatient->legacyepisodes), 0); + $secondary_patient->refresh(); + $this->assertEquals(count($secondary_patient->legacyepisodes), 0); - $primaryPatient->refresh(); - $this->assertEquals(count($primaryPatient->legacyepisodes), 1); + $primary_patient->refresh(); + $this->assertEquals(count($primary_patient->legacyepisodes), 1); } public function testUpdateLegacyEpisodes_bothHaveLegacyEpisodes_secondaryOlder() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - // $primaryPatient has episode7 and episode8 - $primaryPatient = $this->patients('patient7'); + // $primary_patient has episode7 and episode8 + $primary_patient = $this->patients('patient7'); - // $secondaryPatient has episode9, episode10 - $secondaryPatient = $this->patients('patient8'); + // $secondary_patient has episode9, episode10 + $secondary_patient = $this->patients('patient8'); // Lets modify the episodes to have a legacy episode @@ -346,7 +362,7 @@ public function testUpdateLegacyEpisodes_bothHaveLegacyEpisodes_secondaryOlder() $this->assertTrue($episode7->created_date > $episode9->created_date); - $result = $mergeHandler->updateLegacyEpisodes($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateLegacyEpisodes($primary_patient, $secondary_patient); $this->assertTrue($result, 'Merge result FALSE.'); @@ -361,23 +377,23 @@ public function testUpdateLegacyEpisodes_bothHaveLegacyEpisodes_secondaryOlder() $this->assertEquals($episode9->patient_id, 7); $this->assertEquals(count($episode9->events), 4); - $primaryPatient->refresh(); - $this->assertEquals(count($primaryPatient->legacyepisodes), 1); - $this->assertEquals(count($primaryPatient->legacyepisodes[0]->events), 4); + $primary_patient->refresh(); + $this->assertEquals(count($primary_patient->legacyepisodes), 1); + $this->assertEquals(count($primary_patient->legacyepisodes[0]->events), 4); - $secondaryPatient->refresh(); - $this->assertEquals(count($secondaryPatient->legacyepisodes), 0); + $secondary_patient->refresh(); + $this->assertEquals(count($secondary_patient->legacyepisodes), 0); } public function testUpdateLegacyEpisodes_bothHaveLegacyEpisodes_primaryOlder() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - // $primaryPatient has episode7 and episode8 - $primaryPatient = $this->patients('patient7'); + // $primary_patient has episode7 and episode8 + $primary_patient = $this->patients('patient7'); - // $secondaryPatient has episode9, episode10 - $secondaryPatient = $this->patients('patient8'); + // $secondary_patient has episode9, episode10 + $secondary_patient = $this->patients('patient8'); // Lets modify the episodes to have a legacy episode @@ -395,7 +411,7 @@ public function testUpdateLegacyEpisodes_bothHaveLegacyEpisodes_primaryOlder() $this->assertTrue($episode7->created_date < $episode9->created_date); - $result = $mergeHandler->updateLegacyEpisodes($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateLegacyEpisodes($primary_patient, $secondary_patient); $this->assertTrue($result, 'Merge result FALSE.'); @@ -411,16 +427,16 @@ public function testUpdateLegacyEpisodes_bothHaveLegacyEpisodes_primaryOlder() $episode9->refresh(); $this->assertEquals(count($episode9->events), 0); - $primaryPatient->refresh(); - $this->assertEquals(count($primaryPatient->legacyepisodes), 1); + $primary_patient->refresh(); + $this->assertEquals(count($primary_patient->legacyepisodes), 1); - $secondaryPatient->refresh(); - $this->assertEquals(count($secondaryPatient->legacyepisodes), 0); + $secondary_patient->refresh(); + $this->assertEquals(count($secondary_patient->legacyepisodes), 0); } public function testUpdateAllergyAssignments_primaryHasNoAllergyAssignments() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); $assignment1 = $this->patient_allergy_assignment('assignment1'); $assignment2 = $this->patient_allergy_assignment('assignment2'); @@ -428,43 +444,43 @@ public function testUpdateAllergyAssignments_primaryHasNoAllergyAssignments() $assignment1->patient_id = 1; $assignment1->save(); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); - $this->assertEquals(count($primaryPatient->allergyAssignments), 0); - $this->assertEquals(count($secondaryPatient->allergyAssignments), 1); + $this->assertEquals(count($primary_patient->allergyAssignments), 0); + $this->assertEquals(count($secondary_patient->allergyAssignments), 1); - $result = $mergeHandler->updateAllergyAssignments($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateAllergyAssignments($primary_patient, $secondary_patient); - $primaryPatient->refresh(); - $secondaryPatient->refresh(); + $primary_patient->refresh(); + $secondary_patient->refresh(); $this->assertTrue($result, 'Update Allergy Assigmant FAILED.'); $assignment2->refresh(); $this->assertEquals($assignment2->patient_id, 7); - $this->assertEquals(count($primaryPatient->allergyAssignments), 1); - $this->assertEquals(count($secondaryPatient->allergyAssignments), 0); + $this->assertEquals(count($primary_patient->allergyAssignments), 1); + $this->assertEquals(count($secondary_patient->allergyAssignments), 0); } public function testUpdateAllergyAssignments_bothHaveDifferentAllergyAssignments() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); $assignment1 = $this->patient_allergy_assignment('assignment1'); $assignment2 = $this->patient_allergy_assignment('assignment2'); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); - $this->assertEquals(count($primaryPatient->allergyAssignments), 1); - $this->assertEquals(count($secondaryPatient->allergyAssignments), 1); + $this->assertEquals(count($primary_patient->allergyAssignments), 1); + $this->assertEquals(count($secondary_patient->allergyAssignments), 1); - $result = $mergeHandler->updateAllergyAssignments($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateAllergyAssignments($primary_patient, $secondary_patient); - $primaryPatient->refresh(); - $secondaryPatient->refresh(); + $primary_patient->refresh(); + $secondary_patient->refresh(); $this->assertTrue($result, 'Update Allergy Assigmant FAILED.'); @@ -474,13 +490,13 @@ public function testUpdateAllergyAssignments_bothHaveDifferentAllergyAssignments $assignment2->refresh(); $this->assertEquals($assignment2->patient_id, 7); - $this->assertEquals(count($primaryPatient->allergyAssignments), 2); - $this->assertEquals(count($secondaryPatient->allergyAssignments), 0); + $this->assertEquals(count($primary_patient->allergyAssignments), 2); + $this->assertEquals(count($secondary_patient->allergyAssignments), 0); } public function testUpdateAllergyAssignments_bothHaveSameAllergyAssignments() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); $assignment1 = $this->patient_allergy_assignment('assignment1'); $assignment2 = $this->patient_allergy_assignment('assignment2'); @@ -491,16 +507,16 @@ public function testUpdateAllergyAssignments_bothHaveSameAllergyAssignments() $this->assertEquals($assignment1->allergy_id, $assignment2->allergy_id); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); - $this->assertEquals(count($primaryPatient->allergyAssignments), 1); - $this->assertEquals(count($secondaryPatient->allergyAssignments), 1); + $this->assertEquals(count($primary_patient->allergyAssignments), 1); + $this->assertEquals(count($secondary_patient->allergyAssignments), 1); - $result = $mergeHandler->updateAllergyAssignments($primaryPatient, $secondaryPatient); + $result = $merge_handler->updateAllergyAssignments($primary_patient, $secondary_patient); - $primaryPatient->refresh(); - $secondaryPatient->refresh(); + $primary_patient->refresh(); + $secondary_patient->refresh(); $assignment1->refresh(); $this->assertEquals($assignment1->patient_id, 7); @@ -515,104 +531,172 @@ public function testUpdateRiskAssignments() public function testUpdatePreviousOperations() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); - $previousOperation1 = $this->previous_operation('previousOperation1'); + $previous_operation1 = $this->previous_operation('previousOperation1'); - $previousOperation1->patient_id = 8; - $previousOperation1->save(); - $previousOperation1->refresh(); + $previous_operation1->patient_id = 8; + $previous_operation1->save(); + $previous_operation1->refresh(); // Before we update the Previous Operations we check if the patient id is equals to the secondary patient id - $this->assertEquals(8, $previousOperation1->patient_id); + $this->assertEquals(8, $previous_operation1->patient_id); - $primaryPatient->refresh(); - $secondaryPatient->refresh(); - $this->assertEquals(0, count($primaryPatient->previousOperations) ); - $this->assertEquals(1, count($secondaryPatient->previousOperations) ); + $primary_patient->refresh(); + $secondary_patient->refresh(); + $this->assertEquals(0, count($primary_patient->previousOperations) ); + $this->assertEquals(1, count($secondary_patient->previousOperations) ); - $mergeHandler->updatePreviousOperations($primaryPatient, $secondaryPatient->previousOperations); + $merge_handler->updatePreviousOperations($primary_patient, $secondary_patient->previousOperations); - $primaryPatient->refresh(); - $secondaryPatient->refresh(); - $this->assertTrue(is_array($secondaryPatient->previousOperations)); + $primary_patient->refresh(); + $secondary_patient->refresh(); + $this->assertTrue(is_array($secondary_patient->previousOperations)); - $this->assertEquals(0, count($secondaryPatient->previousOperations) ); - $this->assertEquals(1, count($primaryPatient->previousOperations) ); + $this->assertEquals(0, count($secondary_patient->previousOperations) ); + $this->assertEquals(1, count($primary_patient->previousOperations) ); - $previousOperation1->refresh(); + $previous_operation1->refresh(); - $this->assertEquals(7, $previousOperation1->patient_id); + $this->assertEquals(7, $previous_operation1->patient_id); } public function testUpdateOphthalmicDiagnoses() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); - $secondaryDiagnoses8 = $this->secondary_diagnosis('secondaryDiagnoses8'); - $secondaryDiagnoses8->patient_id = 8; - $secondaryDiagnoses8->save(); - $secondaryDiagnoses8->refresh(); + $secondary_diagnoses8 = $this->secondary_diagnosis('secondaryDiagnoses8'); + $secondary_diagnoses8->patient_id = 8; + $secondary_diagnoses8->save(); + $secondary_diagnoses8->refresh(); // Before we update the Ophthalmic Diagnoses we check if the patient id is equals to the secondary patient id - $this->assertEquals(8, $secondaryDiagnoses8->patient_id); + $this->assertEquals(8, $secondary_diagnoses8->patient_id); - $secondaryPatient->refresh(); - $this->assertTrue(is_array($secondaryPatient->ophthalmicDiagnoses) ); - $this->assertEquals(1, count($secondaryPatient->ophthalmicDiagnoses) ); + $secondary_patient->refresh(); + $this->assertTrue(is_array($secondary_patient->ophthalmicDiagnoses) ); + $this->assertEquals(1, count($secondary_patient->ophthalmicDiagnoses) ); - $mergeHandler->updateOphthalmicDiagnoses($primaryPatient, $secondaryPatient->ophthalmicDiagnoses); + $merge_handler->updateOphthalmicDiagnoses($primary_patient, $secondary_patient->ophthalmicDiagnoses); - $secondaryDiagnoses8->refresh(); - $secondaryPatient->refresh(); + $secondary_diagnoses8->refresh(); + $secondary_patient->refresh(); - $this->assertEquals(0, count($secondaryPatient->ophthalmicDiagnoses) ); + $this->assertEquals(0, count($secondary_patient->ophthalmicDiagnoses) ); - $this->assertEquals(7, $secondaryDiagnoses8->patient_id); + $this->assertEquals(7, $secondary_diagnoses8->patient_id); } public function testUpdateSystemicDiagnoses() { - $mergeHandler = new PatientMerge(); + $merge_handler = new PatientMerge(); - $primaryPatient = $this->patients('patient7'); - $secondaryPatient = $this->patients('patient8'); - - $secondaryDiagnoses8 = $this->secondary_diagnosis('secondaryDiagnoses8'); - $secondaryDiagnoses8->patient_id = 8; - $secondaryDiagnoses8->disorder_id = 5; - $secondaryDiagnoses8->save(); - $secondaryDiagnoses8->refresh(); + $primary_patient = $this->patients('patient7'); + $secondary_patient = $this->patients('patient8'); + $secondary_diagnoses8 = $this->secondary_diagnosis('secondaryDiagnoses8'); + $secondary_diagnoses8->patient_id = 8; + $secondary_diagnoses8->disorder_id = 5; + $secondary_diagnoses8->save(); + $secondary_diagnoses8->refresh(); + // Befor we update the Ophthalmic Diagnoses we check if the patient id is equals to the secondary patient id - $this->assertEquals(8, $secondaryDiagnoses8->patient_id); - $this->assertEquals(5, $secondaryDiagnoses8->disorder_id); + $this->assertEquals(8, $secondary_diagnoses8->patient_id); + $this->assertEquals(5, $secondary_diagnoses8->disorder_id); - $secondaryPatient->refresh(); - $this->assertTrue(is_array($secondaryPatient->systemicDiagnoses) ); - $this->assertEquals(1, count($secondaryPatient->systemicDiagnoses) ); + $secondary_patient->refresh(); + $this->assertTrue(is_array($secondary_patient->systemicDiagnoses) ); + $this->assertEquals(1, count($secondary_patient->systemicDiagnoses) ); - $mergeHandler->updateOphthalmicDiagnoses($primaryPatient, $secondaryPatient->systemicDiagnoses); + $merge_handler->updateOphthalmicDiagnoses($primary_patient, $secondary_patient->systemicDiagnoses); - $secondaryDiagnoses8->refresh(); + $secondary_diagnoses8->refresh(); - $this->assertEquals(7, $secondaryDiagnoses8->patient_id); + $this->assertEquals(7, $secondary_diagnoses8->patient_id); - $this->assertEquals(0, count($secondaryPatient->systemicDiagnoses) ); - $this->assertEquals(1, count($primaryPatient->systemicDiagnoses) ); + $this->assertEquals(0, count($secondary_patient->systemicDiagnoses) ); + $this->assertEquals(1, count($primary_patient->systemicDiagnoses) ); } - + public function testGetTwoEpisodesStartEndDate() + { + $merge_handler = new PatientMerge(); + + $episode7 = $this->episodes('episode7'); + $episode7->start_date = date('Y-m-d', strtotime('-30 days')); + $episode7->end_date = date('Y-m-d', strtotime('-15 days')); + $episode7->save(); + + $episode9 = $this->episodes('episode9'); + $episode9->start_date = date('Y-m-d', strtotime('-20 days')); + $episode9->end_date = date('Y-m-d', strtotime('-10 days')); + $episode9->save(); + + list($start_date, $end_date) = $merge_handler->getTwoEpisodesStartEndDate($episode7, $episode9); + + $this->assertEquals($start_date, $episode7->start_date); + $this->assertEquals($end_date, $episode9->end_date); + + /******/ + + $episode7->start_date = date('Y-m-d', strtotime('-20 days')); + $episode7->save(); + + $episode9->start_date = date('Y-m-d', strtotime('-30 days')); + $episode9->save(); + + list($start_date, $end_date) = $merge_handler->getTwoEpisodesStartEndDate($episode7, $episode9); + + $this->assertEquals($start_date, $episode9->start_date); + $this->assertEquals($end_date, $episode9->end_date); + + /******/ + + $episode7->end_date = null; + $episode7->save(); + + list($start_date, $end_date) = $merge_handler->getTwoEpisodesStartEndDate($episode7, $episode9); + + $this->assertEquals($start_date, $episode9->start_date); + $this->assertEquals($end_date, null); + + /******/ + + $episode7->end_date = date('Y-m-d', strtotime('-15 days')); + $episode7->save(); + + $episode9->end_date = null; + $episode9->save(); + + list($start_date, $end_date) = $merge_handler->getTwoEpisodesStartEndDate($episode7, $episode9); + + $this->assertEquals($start_date, $episode9->start_date); + $this->assertEquals($end_date, null); + + /******/ + + $episode7->end_date = date('Y-m-d', strtotime('-10 days')); + $episode7->save(); + + $episode9->end_date = date('Y-m-d', strtotime('-15 days')); + $episode9->save(); + + list($start_date, $end_date) = $merge_handler->getTwoEpisodesStartEndDate($episode7, $episode9); + + $this->assertEquals($start_date, $episode9->start_date); + $this->assertEquals($end_date, $episode7->end_date); + + } public function testIsSecondaryPatientDeleted() { diff --git a/protected/views/admin/commissioning_body_services.php b/protected/views/admin/commissioning_body_services.php index 5bf229cd87..33fced8d5c 100644 --- a/protected/views/admin/commissioning_body_services.php +++ b/protected/views/admin/commissioning_body_services.php @@ -49,7 +49,7 @@ with = array('commissioning_body'); - $criteria->order = 't.name asc'; + $criteria->order = 'LOWER(t.name) asc'; if (isset($commissioning_bt)) { $criteria->addColumnCondition(array('commissioning_body.commissioning_body_type_id' => $commissioning_bt->id)); diff --git a/protected/views/admin/worklists/definition_worklists_delete.php b/protected/views/admin/worklists/definition_worklists_delete.php index 41df83c1d3..fa27cffbc2 100644 --- a/protected/views/admin/worklists/definition_worklists_delete.php +++ b/protected/views/admin/worklists/definition_worklists_delete.php @@ -19,7 +19,7 @@

Confirm Delete

Are you sure you want to delete all the instances for the worklist definition name ?>? - There are currently worklists) ?> instances that have been generated.

+ There are currently getWorklistCount() ?> instances that have been generated.

diff --git a/protected/views/admin/worklists/definitions.php b/protected/views/admin/worklists/definitions.php index 1b7ce6d6d3..c3212f7f42 100644 --- a/protected/views/admin/worklists/definitions.php +++ b/protected/views/admin/worklists/definitions.php @@ -37,10 +37,10 @@ name?> manager->canUpdateWorklistDefinition($definition)) {?>Edit | View | - Instances (worklists)?>) | - Mapping Items(mappings)?>) | - Display Context (display_contexts) > 0 ? 'limited' : 'any';?>) | - worklists)) {?> + Instances (worklistCount?>) | + Mapping Items(mappingCount?>) | + Display Context (displayContextCount > 0 ? 'limited' : 'any';?>) | + worklistCount) {?> Delete Instances Generate | diff --git a/protected/views/base/_banner_watermark.php b/protected/views/base/_banner_watermark.php index 9b18857c4e..38c52c3e48 100644 --- a/protected/views/base/_banner_watermark.php +++ b/protected/views/base/_banner_watermark.php @@ -20,13 +20,13 @@ user->checkAccess('admin') && Yii::app()->params['watermark_admin']) {?> params['watermark']) {?> params['watermark_description']) {?> -

params['watermark_description']?>

+

params['watermark_description']);?>

diff --git a/protected/views/clinical/episodeSummary.php b/protected/views/clinical/episodeSummary.php index 2dd549857c..7cc8d664f9 100644 --- a/protected/views/clinical/episodeSummary.php +++ b/protected/views/clinical/episodeSummary.php @@ -37,7 +37,18 @@
- + findAll('patient_id = "' . $episode->patient->id . ' "')) { + if (count($episodesTotal) > 1){ + ?> +
Only data from the selected episode is included in this + summary. + For a full picture of the patient’s care, please look at all episodes individually. +
+

Overview

diff --git a/protected/views/default/_pcr_risk_form.php b/protected/views/default/_pcr_risk_form.php index 1ac97c876d..35712a0eff 100644 --- a/protected/views/default/_pcr_risk_form.php +++ b/protected/views/default/_pcr_risk_form.php @@ -20,13 +20,44 @@ $side = 'left'; } if ($side === 'left') { - $jsPath = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.assets.js'), - false, -1); + $jsPath = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.assets.js'), false, -1); ?> - findAll($criteria->condition = 'has_pcr_risk', array('order' => 'display_order'));?> - - + diff --git a/protected/views/docman/depricated_index.php b/protected/views/docman/depricated_index.php index 4ba1022ccd..f4d58d63ac 100644 --- a/protected/views/docman/depricated_index.php +++ b/protected/views/docman/depricated_index.php @@ -74,6 +74,7 @@ ); } } + } echo $this->renderPartial('/docman/document_table', array('data' => $data, 'document_set' => $document_set)); } diff --git a/protected/views/medication/form.php b/protected/views/medication/form.php index 66b9ab8096..b2da71d0bc 100644 --- a/protected/views/medication/form.php +++ b/protected/views/medication/form.php @@ -21,7 +21,8 @@ - +
@@ -36,7 +37,12 @@ id="medication_drug_name">getDrugLabel()) ?>
- listBySubspecialtyWithCommonMedications($firm->getSubspecialtyID()), array('empty' => '- Select -')) ?> + listBySubspecialtyWithCommonMedications($firm->getSubspecialtyID()), + array('empty' => '- Select -') + ) ?>
@@ -64,9 +70,18 @@
- widget('application.widgets.TextField', array('element' => $medication, 'field' => 'dose', 'name' => 'dose')); ?> + widget('application.widgets.TextField', + array('element' => $medication, 'field' => 'dose', 'name' => 'dose')); ?> - widget('application.widgets.DropDownList', array('element' => $medication, 'field' => 'route_id', 'data' => 'DrugRoute', 'htmlOptions' => array('name' => 'route_id', 'empty' => '- Select -'))); ?> + widget( + 'application.widgets.DropDownList', + array( + 'element' => $medication, + 'field' => 'route_id', + 'data' => 'DrugRoute', + 'htmlOptions' => array('name' => 'route_id', 'empty' => '- Select -'), + ) + ); ?>
route) { @@ -74,10 +89,33 @@ } ?>
- widget('application.widgets.DropDownList', array('element' => $medication, 'field' => 'frequency_id', 'data' => 'DrugFrequency', 'htmlOptions' => array('name' => 'frequency_id', 'empty' => '- Select -'))); ?> + widget( + 'application.widgets.DropDownList', + array( + 'element' => $medication, + 'field' => 'frequency_id', + 'data' => 'DrugFrequency', + 'htmlOptions' => array('name' => 'frequency_id', 'empty' => '- Select -'), + ) + ); ?> - renderPartial('/patient/_fuzzy_date', array('form' => $form, 'date' => $medication->start_date, 'class' => 'medication_start_date', 'label' => 'Date from')); ?> + start_date) { + $medication_start_date = $medication->start_date; + } elseif (isset(Yii::app()->params['enable_concise_med_history']) && Yii::app()->params['enable_concise_med_history']) { + $medication_start_date = date('Y-m-d'); + } + $this->renderPartial( + '/patient/_fuzzy_date', + array( + 'form' => $form, + 'date' => $medication_start_date, + 'class' => 'medication_start_date', + 'label' => 'Date from', + ) + ); ?>
@@ -88,15 +126,30 @@ class="inline">end_date, array(' - + params['enable_concise_med_history']) || !Yii::app()->params['enable_concise_med_history']) { ?> + +
renderPartial('/patient/_fuzzy_date', array('form' => $form, 'date' => $medication->end_date, 'class' => 'medication_end_date', 'label' => 'Date to')); + $medication_end_date = null; + if ($medication->end_date) { + $medication_end_date = $medication->end_date; + } elseif (isset(Yii::app()->params['enable_concise_med_history']) && Yii::app()->params['enable_concise_med_history']) { + $medication_end_date = date('Y-m-d'); + } + $this->renderPartial( + '/patient/_fuzzy_date', + array( + 'form' => $form, + 'date' => $medication_end_date, + 'class' => 'medication_end_date', + 'label' => 'Date to', + ) + ); $this->renderPartial('stop_reason', array('form' => $form, 'medication' => $medication)); ?> diff --git a/protected/views/medication/list.php b/protected/views/medication/list.php index f06d6ad633..00e81161da 100644 --- a/protected/views/medication/list.php +++ b/protected/views/medication/list.php @@ -24,7 +24,10 @@ Administration - dose ?> route->name ?> option ? "({$medication->option->name})" : '' ?> frequency->name ?> + dose ?> + route->name) ? $medication->route->name : '' ?> + option ? "({$medication->option->name})" : '' ?> + frequency->name) ? $medication->frequency->name : '' ?> Date diff --git a/protected/views/patient/_130_diagnoses.php b/protected/views/patient/_130_diagnoses.php index fa28dcd4e9..f265ea4bf0 100644 --- a/protected/views/patient/_130_diagnoses.php +++ b/protected/views/patient/_130_diagnoses.php @@ -46,8 +46,15 @@ patient->ophthalmicDiagnoses as $diagnosis) {?> + disorder->term, $diagnosis->eye->adjective. ' ') === 0) { + $term = $diagnosis->disorder->term; + } else { + $term = $diagnosis->eye->adjective . ' ' . $diagnosis->disorder->term; + } + ?>
 dateText?> - eye->adjective?> disorder->term?> + checkAccess('OprnEditOtherOphDiagnosis')) { ?> Remove diff --git a/protected/views/patientmergerequest/_list.php b/protected/views/patientmergerequest/_list.php index ec6ddf6c42..35aafcd4ce 100644 --- a/protected/views/patientmergerequest/_list.php +++ b/protected/views/patientmergerequest/_list.php @@ -4,19 +4,19 @@ - getSort()->link('secondary_hos_num', 'Secondary
hospital num', array('class' => 'sort-link')) ?> + getSort()->link('secondary_hos_num', 'Secondary
hospital num', array('class' => 'sort-link')) ?> - getSort()->link('primary_hos_num', 'Primary
hospital num', array('class' => 'sort-link')) ?> + getSort()->link('primary_hos_num', 'Primary
hospital num', array('class' => 'sort-link')) ?> - getSort()->link('status', 'Status', array('class' => 'sort-link')); ?> - getSort()->link('created_date', 'Created', array('class' => 'sort-link')); ?> + getSort()->link('status', 'Status', array('class' => 'sort-link')); ?> + getSort()->link('created_date', 'Created', array('class' => 'sort-link')); ?> - getSort()->link('last_modified_date', 'Merged', array('class' => 'sort-link')); ?> + getSort()->link('last_modified_date', 'Merged', array('class' => 'sort-link')); ?> - itemCount): ?> + itemCount): ?> @@ -36,15 +36,15 @@ 'rq_delete', 'class' => 'button small', 'disabled' => ($filters['show_merged'] ? 'disabled' : ''))); ?> renderPartial('//admin/_pagination', array( - 'pagination' => $dataProvider->getPagination(), + 'pagination' => $data_provider->getPagination(), )); ?> - itemCount): ?> - getData() as $i => $request): ?> + itemCount): ?> + getData() as $i => $request): ?> status == PatientMergeRequest::STATUS_NOT_PROCESSED): ?> @@ -52,7 +52,7 @@ - status == PatientMergeRequest::STATUS_NOT_PROCESSED ? '' : 'disabled'?>> + status == PatientMergeRequest::STATUS_NOT_PROCESSED ? '' : 'disabled'?>> secondary_hos_num?> INTO diff --git a/protected/views/patientmergerequest/_view.php b/protected/views/patientmergerequest/_view.php index 56729ad5b2..8dc5437715 100644 --- a/protected/views/patientmergerequest/_view.php +++ b/protected/views/patientmergerequest/_view.php @@ -33,51 +33,4 @@ secondary_id); ?>
- getAttributeLabel('secondary_hos_num')); ?>:
- secondary_hos_num); ?> -
- - getAttributeLabel('secondary_nhsnum')); ?>: - secondary_nhsnum); ?> -
- - getAttributeLabel('secondary_dob')); ?>: - secondary_dob); ?> -
- - getAttributeLabel('secondary_gender')); ?>: - secondary_gender); ?> -
- - getAttributeLabel('merge_json')); ?>: - merge_json); ?> -
- - getAttributeLabel('comment')); ?>: - comment); ?> -
- - getAttributeLabel('status')); ?>: - status); ?> -
- - getAttributeLabel('last_modified_user_id')); ?>: - last_modified_user_id); ?> -
- - getAttributeLabel('last_modified_date')); ?>: - last_modified_date); ?> -
- - getAttributeLabel('created_user_id')); ?>: - created_user_id); ?> -
- - getAttributeLabel('created_date')); ?>: - created_date); ?> -
- - */ ?> -
\ No newline at end of file diff --git a/protected/views/patientmergerequest/create.php b/protected/views/patientmergerequest/create.php index 1bcec4b79a..bba3756817 100644 --- a/protected/views/patientmergerequest/create.php +++ b/protected/views/patientmergerequest/create.php @@ -68,7 +68,7 @@ Please confirm you selected the right patients.
Note, the primary patient's personal details will NOT be overwritten.

+ I hereby confirm that I selected the right patients.
diff --git a/protected/views/patientmergerequest/index.php b/protected/views/patientmergerequest/index.php index 294a4505d1..bcb41dad95 100644 --- a/protected/views/patientmergerequest/index.php +++ b/protected/views/patientmergerequest/index.php @@ -1,6 +1,6 @@ @@ -10,7 +10,6 @@ 'id' => 'merge-form', 'enableAjaxValidation' => false, 'enableClientValidation' => true, - //'focus' => array($model,'firstName'), )); ?> @@ -38,7 +37,7 @@
- renderPartial('//patientmergerequest/_list', array('dataProvider' => $dataProvider, 'filters' => $filters))?> + renderPartial('//patientmergerequest/_list', array('data_provider' => $data_provider, 'filters' => $filters))?>
diff --git a/protected/views/patientmergerequest/log.php b/protected/views/patientmergerequest/log.php index 918f0097f7..ab51e48d16 100644 --- a/protected/views/patientmergerequest/log.php +++ b/protected/views/patientmergerequest/log.php @@ -24,7 +24,7 @@ widget('zii.widgets.grid.CGridView', array( 'itemsCssClass' => 'grid', - 'dataProvider' => $dataProvider, + 'dataProvider' => $data_provider, 'summaryText' => '

{start}-{end} of {count}

', 'htmlOptions' => array('id' => 'patientMergeList'), 'columns' => array('log'), diff --git a/protected/views/patientmergerequest/merge.php b/protected/views/patientmergerequest/merge.php index 7b1f4fb878..26d5616532 100644 --- a/protected/views/patientmergerequest/merge.php +++ b/protected/views/patientmergerequest/merge.php @@ -57,14 +57,14 @@
- user->checkAccess('Patient Merge')):?> + user->checkAccess('Patient Merge')):?>

Personal details are conflicting.

Please confirm you selected the right patients.
Note, the primary patient's personal details will NOT be overwritten.

+ I hereby confirm that I selected the right patients.
diff --git a/protected/views/patientmergerequest/update.php b/protected/views/patientmergerequest/update.php index ec3a868dc3..233c28e251 100644 --- a/protected/views/patientmergerequest/update.php +++ b/protected/views/patientmergerequest/update.php @@ -63,14 +63,14 @@

renderPartial('//base/_messages')?> - user->checkAccess('Patient Merge')):?> + user->checkAccess('Patient Merge')):?>

Personal details are conflicting.

Please confirm you selected the right patients.
Note, the primary patient's personal details will NOT be overwritten.

+ I hereby confirm that I selected the right patients.
@@ -92,10 +92,10 @@