{"version":3,"sources":["app.module.js","bundle.min.js","components/components.module.js","components/angular-bootstrap-extensions/angular-bootstrap-extensions.module.js","components/animatedflash/animatedflash.module.js","components/autofocus/autofocus.module.js","components/breadcrumbs/uiBreadcrumbs.module.js","components/checklist-model/checklist-model.module.js","components/collapse-menu/collapsemenu.module.js","components/displaytemperature/displaytemperature.module.js","components/files/files.module.js","components/forms/forms.module.js","components/highlight/highlight.module.js","components/imageselection/imageselection.module.js","components/print/print.module.js","components/searchbar/searchbar.module.js","components/smooth-expand/smoothexpand.module.js","components/smoothscroll/smoothscroll.module.js","components/storage/storage.module.js","components/time-log-session/time-log-session.module.js","components/ui-select-extensions/ui-select-extensions.module.js","components/vh-caregiver-menu/vh-caregiver-menu.module.js","components/vh-fixed/vh-fixed.module.js","components/vh-language/vh-language.module.js","components/vh-list-item/vh-list-item.module.js","components/vh-paging/vh-paging.module.js","components/vh-phone/vh-phone.module.js","components/vh-select/vh-select.module.js","components/vh-slider/vh-slider.module.js","modules/analytics/analytics.module.js","modules/authorization/authorization.module.js","modules/bi/bi.module.js","modules/caregivers/caregivers.module.js","modules/configurations/configurations.module.js","modules/content/content.module.js","modules/dashboard/dashboard.module.js","modules/idle/idle.module.js","modules/invites/invites.module.js","modules/kit_logistics/kit_logistics.module.js","modules/messaging/message.module.js","modules/patient/patient.module.js","modules/permissions/permissions.module.js","modules/reports/reports.module.js","modules/repository/repos.module.js","modules/site/site.module.js","modules/system/system.module.js","modules/time_log/time_log.module.js","modules/toast/toast.module.js","modules/authorization/login/login.module.js","modules/authorization/twoFactorLoginSetup/twoFactorLoginSetup.module.js","modules/configurations/billingcodes/currentproceduralterminologycodes.module.js","modules/configurations/caregiverUpload/caregiverUpload.module.js","modules/configurations/alerttypes/alerttypes.module.js","modules/configurations/careManagementTypes/careManagementTypes.module.js","modules/configurations/content/content.module.js","modules/configurations/monitoringconfiguration/monitoringconfiguration.module.js","modules/configurations/patientheaderconfiguration/patientheaderconfiguration.module.js","modules/configurations/providers/providers.module.js","modules/content/cards/cards.module.js","modules/content/chart/chart.module.js","modules/content/resource_library/resource.library.module.js","modules/kit_logistics/kits/kits.module.js","modules/kit_logistics/locations/locations.module.js","modules/kit_logistics/logistics/logistics.module.js","modules/kit_logistics/provisioning/provisioning.module.js","modules/kit_logistics/receive-kits/receive-kits.module.js","modules/patient/activity/activity.module.js","modules/patient/chart/chart.module.js","modules/patient/demographics/demographics.module.js","modules/patient/directentry/directentry.module.js","modules/patient/forms/forms.module.js","modules/patient/header/patientheader.module.js","modules/patient/list/patientlist.module.js","modules/patient/medications/medications.module.js","modules/patient/monitoring/monitoring.module.js","modules/patient/parameters/parameters.module.js","modules/patient/PMHx/PMHx.module.js","modules/reports/forms/patientformreport.module.js","modules/reports/time_log/time_log.report.module.js","modules/site/biometrics/biometrics.module.js","modules/site/hospitals/hospitals.module.js","modules/site/payers/payers.module.js","modules/site/populationGroups/populationGroups.module.js","modules/site/populations/population.module.js","modules/site/profileFields/profileFields.module.js","modules/site/programDurations/programDurations.module.js","modules/site/providerGroups/providerGroups.module.js","modules/site/referrals/referrals.module.js","modules/site/settings/settings.module.js","modules/site/specialhandling/specialhandling.module.js","modules/system/biometricalerts/biometricalerts.module.js","modules/system/email/email.module.js","modules/system/emailServers/emailServers.module.js","modules/system/forms/forms.module.js","modules/system/go_devices/go_devices.module.js","modules/system/languages/languages.module.js","modules/system/loginNotification/loginNotification.module.js","modules/system/logo/logo.module.js","modules/system/networkoperator/networkoperator.module.js","modules/system/patientIdentifierFields/patientIdentifierFields.module.js","modules/system/pickup/pickup.module.js","modules/system/rules/rules.module.js","modules/system/securityroles/securityroles.module.js","modules/system/serviceLevel/serviceLevel.module.js","modules/system/settings/settings.module.js","modules/system/sites/sites.module.js","modules/system/slideshow/slideshow.module.js","modules/system/sms/sms.module.js","modules/system/titles/titles.module.js","modules/system/webhooks/webhooks.module.js","modules/system/_controls/controls.module.js","modules/time_log/detail/detail.module.js","modules/content/careplan_editor/categories/categories.module.js","modules/content/careplan_editor/healthtips/healthtips.module.js","modules/content/careplan_editor/patientsurvey/patientsurvey.module.js","modules/content/careplan_editor/services/services.module.js","modules/content/careplan_editor/videos/videos.module.js","modules/content/careplan_editor/templates/templates.module.js","modules/kit_logistics/kits/kit/kit.module.js","modules/content/careplan_editor/components/alertlabel/alertlabel.module.js","modules/content/careplan_editor/components/healthtipbutton/healthtipbutton.module.js","modules/content/careplan_editor/components/mediapreview/mediapreview.module.js","modules/content/careplan_editor/components/question/question.module.js","modules/content/careplan_editor/components/schedule/schedule.module.js","modules/content/careplan_editor/components/tree-extensions/tree-extensions.module.js","modules/content/careplan_editor/components/videobutton/videobutton.module.js","app.config.js","app.constants.js","components/angles/angles.js","components/angles/chartjs.extensions.js","components/angular-bootstrap-extensions/timepicker.override.js","components/angular-chart/_Chart.js","components/angular-chart/angular-chart.js","components/angular-chart/plugins/chartjs-plugin-background.js","components/angular-chart/plugins/chartjs-plugin-datalabels.js","components/angular-chart/plugins/chartjs-plugin-vh-events.js","components/angular-file-upload/angular-file-upload.js","components/bind-html-compile/bind-html-compile.js","components/card-preview/card-preview.directive.js","components/card-preview/card-preview.tpl.js","components/card-selector/card-selector.directive.js","components/card-selector/card-selector.tpl.js","components/card-tooltip/card-tooltip.directive.js","components/CCOW/ccow.directive.js","components/CCOW/ccow.service.js","components/files/downloadfile.directive.js","components/files/downloadtext.directive.js","components/files/readfileinput.directive.js","components/files/validfile.directive.js","components/filters/age.filter.js","components/filters/alphaCounter.filter.js","components/filters/code.filter.js","components/filters/dateInString.filter.js","components/filters/datetime.filter.js","components/filters/datetimeTimeZone.filter.js","components/filters/dateUTCformat.filter.js","components/filters/name.filter.js","components/filters/pascalSpacing.filter.js","components/filters/pathwayStatus.filter.js","components/filters/secondsToDateTime.filter.js","components/filters/ssn.filter.js","components/filters/telephone.filter.js","components/filters/telephoneUnformat.filter.js","components/forms/alpha-only.directive.js","components/forms/checkifdirty.directive.js","components/forms/datepicker.directive.js","components/forms/datepicker.tpl.js","components/forms/form-bar.directive.js","components/forms/name.directive.js","components/forms/select-format.directive.js","components/forms/telephone.directive.js","components/forms/zip-code.directive.js","components/imageselection/imageselection.controller.js","components/imageselection/imageselection.modal.js","components/infinite-scroll/infinite-scroll.directive.js","components/lock-status-icon/lockstatusicon.directive.js","components/max-length-display/maxlengthdisplay.direcive.js","components/mentio/mentio.js","components/mentio/templates.js","components/ng-sticky/sticky.js","components/polyfill/polyfill.js","components/programs-dropdown/programs-dropdown.modal.js","components/service-now/service-now.controller.js","components/service-now/service-now.directive.js","components/service-now/service-now.service.js","components/service-now/service-now.tpl.js","components/storage/cookie.service.js","components/storage/localstorage.service.js","components/time-log-session/time-log-session.auto.service.js","components/time-log-session/time-log-session.directive.js","components/time-log-session/time-log-session.factory.js","components/time-log-session/time-log-session.service.js","components/time-log-session/time-log-session.timer.service.js","components/time-log-session/time-log-session.tpl.js","components/time-log-session/time-log-session.video.service.js","components/ui-select-extensions/ui-select-focus.js","components/ui-tree/angular-ui-tree.js","components/vh-caregiver-menu/vh-caregiver-menu.directive.js","components/vh-caregiver-menu/vh-caregiver-menu.service.js","components/vh-caregiver-menu/vh-caregiver-menu.tpl.js","components/vh-export/vh-export.directive.js","components/vh-import/previews/card-import-preview.directive.js","components/vh-import/previews/card-import-preview.tpl.js","components/vh-import/previews/missing-import-preview.directive.js","components/vh-import/previews/missing-import-preview.tpl.js","components/vh-import/previews/pathways-import-preview.directive.js","components/vh-import/previews/pathways-import-preview.tpl.js","components/vh-import/previews/program-import-preview.directive.js","components/vh-import/previews/program-import-preview.tpl.js","components/vh-import/previews/question-category-preview.directive.js","components/vh-import/previews/question-category-preview.tpl.js","components/vh-import/previews/question-preview.directive.js","components/vh-import/previews/question-preview.tpl.js","components/vh-import/previews/rule-import-preview.directive.js","components/vh-import/previews/rule-import-preview.tpl.js","components/vh-import/previews/tile-import-preview.directive.js","components/vh-import/previews/tile-import-preview.tpl.js","components/vh-import/previews/video-import-preview.directive.js","components/vh-import/previews/video-import-preview.tpl.js","components/vh-import/vh-import-modal.controller.js","components/vh-import/vh-import-modal.tpl.js","components/vh-import/vh-import.directive.js","components/vh-import/vh-import.tpl.js","components/vh-language/vh-language-tabs.directive.js","components/vh-language/vh-language-tabs.tpl.js","components/vh-language/vh-language.directive.js","components/vh-list-item/vh-list-item-option-info.directive.js","components/vh-list-item/vh-list-item-option-info.tpl.js","components/vh-list-item/vh-list-item-options.directive.js","components/vh-list-item/vh-list-item-options.tpl.js","components/vh-list-item/vh-list-item.directive.js","components/vh-list-item/vh-list-item.tpl.js","components/vh-list-item/vh-list-tabs.directive.js","components/vh-list-item/vh-list-tabs.tpl.js","components/vh-multiselect/vh-multiselect.directive.js","components/vh-multiselect/vh-multiselect.tpl.js","components/vh-paging/vh-page-info.directive.js","components/vh-paging/vh-page-info.tpl.js","components/vh-paging/vh-page-size.directive.js","components/vh-paging/vh-page-size.tpl.js","components/vh-paging/vh-pagination.directive.js","components/vh-paging/vh-pagination.tpl.js","components/vh-phone/vh-phone.directive.js","components/vh-phone/vh-phone.tpl.js","components/vh-rules-parser/vh-rules-parser.js","components/vh-select/vh-multi-select.directive.js","components/vh-select/vh-single-select.directive.js","components/vh-slider/vh-slider.directive.js","components/vh-slider/vh-slider.tpl.js","components/vh-ui-avatar/vh-ui-avatar.js","components/vh-ui-biometric-graph/vh-ui-biometric-graph.js","components/vh-ui-biometric-graph/vh-ui-biometric-graph.tpl.js","components/vh-ui-content-uid/vh-ui-content-uid.directive.js","components/vh-ui-content-uid/vh-ui-content-uid.tpl.js","components/vh-ui-header/vh-ui-header.js","components/vh-ui-metricgraph/vh-ui-metricgraph.js","components/vh-ui-sparknav/vh-ui-sparknav.js","components/vh-ui-sparknav/vh-ui-sparknav.tooltip.tpl.js","components/vh-ui-sparknav/vh-ui-sparknav.tpl.js","components/vh-ui-ssn/vh-ssn.directive.js","components/vh-ui-status/vh-ui-status.js","components/vh-ui-tags/vh-ui-tags.directive.js","components/vh-ui-tags/vh-ui-tags.tpl.js","components/vh-uom-conversion/vh-uom-conversion.service.js","components/vh-utilities/date.utilities.js","components/vh-utilities/tag.utilities.js","components/video-controls/video-controls.js","layout/about.controller.js","layout/about.modal.js","layout/body.controller.js","layout/body.tpl.js","layout/footer.controller.js","layout/footer.tpl.js","layout/header.controller.js","layout/header.tpl.js","layout/help.service.js","layout/logo.directive.js","layout/logo.tpl.js","layout/navigation.controller.js","layout/navigation.service.js","layout/navigation.tpl.js","layout/unauthorized.tpl.js","layout/version.service.js","modules/analytics/analytics.factory.js","modules/authorization/authorization.service.js","modules/authorization/login/agreement.controller.js","modules/authorization/login/agreement.modal.js","modules/authorization/login/info.modal.js","modules/authorization/login/login.controller.js","modules/authorization/login/login.service.js","modules/authorization/login/login.tpl.js","modules/authorization/login/logininfo.controller.js","modules/authorization/login/password-confirm.directive.js","modules/authorization/login/password-expired.directive.js","modules/authorization/login/password-expired.rules.tpl.js","modules/authorization/login/password-expired.tpl.js","modules/authorization/login/password-login.directive.js","modules/authorization/login/password-login.tpl.js","modules/authorization/login/password-reset.directive.js","modules/authorization/login/password-reset.tpl.js","modules/authorization/login/password-validate.directive.js","modules/authorization/login/reset-error.directive.js","modules/authorization/twoFactorLoginSetup/twoFactorLoginSetup.controller.js","modules/authorization/twoFactorLoginSetup/twoFactorLoginSetup.tpl.js","modules/bi/bi-iframe.service.js","modules/bi/bi-report-designer-iframe.directive.js","modules/bi/bi-report.directive.js","modules/bi/bi-report.tpl.js","modules/bi/bi-reportedit.controller.js","modules/bi/bi-reportedit.tpl.js","modules/bi/bi-reporteditiframe.tpl.js","modules/bi/bi-ssreports.tpl.js","modules/bi/bi.service.js","modules/bi/copyreport.controller.js","modules/bi/copyreport.modal.js","modules/bi/importreport.controller.js","modules/bi/importreport.modal.js","modules/bi/parameters/bi-param-checkbox.directive.js","modules/bi/parameters/bi-param-checkbox.tpl.js","modules/bi/parameters/bi-param-daterange.directive.js","modules/bi/parameters/bi-param-daterange.tpl.js","modules/bi/parameters/bi-param-month-select.directive.js","modules/bi/parameters/bi-param-month-select.tpl.js","modules/bi/parameters/bi-param-multi-select-check.directive.js","modules/bi/parameters/bi-param-multi-select-check.tpl.js","modules/bi/parameters/bi-param-multi-select-type-ahead.directive.js","modules/bi/parameters/bi-param-multi-select-type-ahead.tpl.js","modules/bi/parameters/bi-param-multiselectlist.directive.js","modules/bi/parameters/bi-param-multiselectlist.tpl.js","modules/bi/parameters/bi-param-notetext.directive.js","modules/bi/parameters/bi-param-notetext.tpl.js","modules/bi/parameters/bi-param-single-select-type-ahead.directive.js","modules/bi/parameters/bi-param-single-select-type-ahead.tpl.js","modules/bi/parameters/bi-param-singleselectlist.directive.js","modules/bi/parameters/bi-param-singleselectlist.tpl.js","modules/bi/parameters/bi-parameters.directive.js","modules/bi/parameters/bi-parameters.tpl.js","modules/bi/parameters/timelog/bi-param-patient-time-log.directive.js","modules/bi/parameters/timelog/bi-param-patient-time-log.tpl.js","modules/caregivers/caregiver_row.directive.js","modules/caregivers/caregiver_row.tpl.js","modules/caregivers/caregiver-search-keywords.tpl.js","modules/caregivers/caregivers.controller.js","modules/caregivers/caregivers.service.js","modules/caregivers/caregivers.tpl.js","modules/caregivers/changepassword.controller.js","modules/caregivers/changepassword.modal.js","modules/caregivers/editCaregiver.controller.js","modules/caregivers/editCaregiver.tpl.js","modules/caregivers/twoFactorSetup.controller.js","modules/caregivers/twoFactorSetup.modal.js","modules/caregivers/viewCaregiver.controller.js","modules/caregivers/viewCaregiver.tpl.js","modules/configurations/alerttypes/alerttypeEdit.controller.js","modules/configurations/alerttypes/alerttypeEdit.tpl.js","modules/configurations/alerttypes/alerttypes.controller.js","modules/configurations/alerttypes/alerttypes.service.js","modules/configurations/alerttypes/alerttypes.tpl.js","modules/configurations/billingcodes/currentproceduralterminologycodeEdit.controller.js","modules/configurations/billingcodes/currentproceduralterminologycodeEdit.tpl.js","modules/configurations/billingcodes/currentproceduralterminologycodes.controller.js","modules/configurations/billingcodes/currentproceduralterminologycodes.service.js","modules/configurations/billingcodes/currentproceduralterminologycodes.tpl.js","modules/configurations/caregiverUpload/accordion-template.tpl.js","modules/configurations/caregiverUpload/caregiverUpload.controller.js","modules/configurations/caregiverUpload/caregiverUpload.modal.js","modules/configurations/caregiverUpload/caregiverUpload.service.js","modules/configurations/caregiverUpload/caregiverUpload.tpl.js","modules/configurations/caregiverUpload/caregiverUploadModal.controller.js","modules/configurations/careManagementTypes/careManagementTypes.controller.js","modules/configurations/careManagementTypes/careManagementTypes.service.js","modules/configurations/careManagementTypes/careManagementTypes.tpl.js","modules/configurations/careManagementTypes/careManagementTypesEdit.tpl.js","modules/configurations/configurations.controller.js","modules/configurations/configurations.service.js","modules/configurations/configurations.tpl.js","modules/configurations/content/addconfiguration.controller.js","modules/configurations/content/addconfiguration.modal.js","modules/configurations/content/addpopulation.controller.js","modules/configurations/content/addpopulation.modal.js","modules/configurations/content/content.controller.js","modules/configurations/content/content.service.js","modules/configurations/content/content.tpl.js","modules/configurations/content/editcontent.controller.js","modules/configurations/content/editcontent.modal.js","modules/configurations/content/goconfigurations.controller.js","modules/configurations/content/goconfigurations.tpl.js","modules/configurations/content/populations.directive.js","modules/configurations/content/populations.sortable.tpl.js","modules/configurations/content/populations.tpl.js","modules/configurations/content/populationsettings/editpopulationsetting.controller.js","modules/configurations/content/populationsettings/editpopulationsetting.value.directive.js","modules/configurations/content/populationsettings/populationsettings.directive.js","modules/configurations/content/populationsettings/populationsettings.modal.js","modules/configurations/content/populationsettings/populationsettings.service.js","modules/configurations/content/populationsettings/populationsettings.tpl.js","modules/configurations/content/selectvideo.controller.js","modules/configurations/content/selectvideo.modal.js","modules/configurations/content/slideshow/slideshow.directive.js","modules/configurations/content/slideshow/slideshow.service.js","modules/configurations/content/slideshow/slideshow.tpl.js","modules/configurations/content/slideshow/slideshowAdd.controller.js","modules/configurations/content/slideshow/slideshowAdd.modal.js","modules/configurations/content/slideshow/slideshowImage.directive.js","modules/configurations/content/slideshow/slideshowImage.tpl.js","modules/configurations/content/welcomevideo.directive.js","modules/configurations/content/welcomevideo.service.js","modules/configurations/content/welcomevideo.tpl.js","modules/configurations/edit.configurations.service.js","modules/configurations/interventionform.directive.js","modules/configurations/interventionform.tpl.js","modules/configurations/messageinterventionform.directive.js","modules/configurations/messageinterventionform.tpl.js","modules/configurations/milestoneEdit.controller.js","modules/configurations/milestoneEdit.modal.js","modules/configurations/monitoringconfiguration/monitoringconfiguration.service.js","modules/configurations/patientheaderconfiguration/patientheaderconfiguration.controller.js","modules/configurations/patientheaderconfiguration/patientheaderconfiguration.service.js","modules/configurations/patientheaderconfiguration/patientheaderconfiguration.tpl.js","modules/configurations/providerform.directive.js","modules/configurations/providerform.tpl.js","modules/configurations/providers/editProvider.controller.js","modules/configurations/providers/editProvider.modal.js","modules/configurations/providers/provider-search-keyword.tpl.js","modules/configurations/providers/provider.service.js","modules/configurations/providers/providers.controller.js","modules/configurations/providers/providers.tpl.js","modules/configurations/reasonform.directive.js","modules/configurations/reasonform.tpl.js","modules/configurations/transformform.directive.js","modules/configurations/transformform.tpl.js","modules/content/addcategory.controller.js","modules/content/addcategory.modal.js","modules/content/addentry.controller.js","modules/content/addentry.modal.js","modules/content/cards/addeditcard.controller.js","modules/content/cards/addeditcard.modal.js","modules/content/cards/cards.controller.js","modules/content/cards/cards.service.js","modules/content/cards/cards.tpl.js","modules/content/careplan_editor/categories/categories.controller.js","modules/content/careplan_editor/categories/categories.tpl.js","modules/content/careplan_editor/categories/nestquestion.controller.js","modules/content/careplan_editor/categories/nestquestion.tpl.js","modules/content/careplan_editor/components/mediapreview/mediapreview.controller.js","modules/content/careplan_editor/components/mediapreview/mediapreview.modal.js","modules/content/careplan_editor/components/question/questioncontainer.directive.js","modules/content/careplan_editor/components/question/questiondisplay.directive.js","modules/content/careplan_editor/components/question/questionedit.directive.js","modules/content/careplan_editor/components/question/questioneraser.directive.js","modules/content/careplan_editor/components/question/questionicon.directive.js","modules/content/careplan_editor/components/question/questionoption.directive.js","modules/content/careplan_editor/components/question/questiontext.directive.js","modules/content/careplan_editor/components/schedule/schedule.controller.js","modules/content/careplan_editor/components/schedule/schedule.directive.js","modules/content/careplan_editor/components/schedule/schedule.filter.js","modules/content/careplan_editor/components/schedule/schedule.modal.js","modules/content/careplan_editor/components/schedule/schedule.service.js","modules/content/careplan_editor/components/schedule/scheduleedit.tpl.js","modules/content/careplan_editor/components/schedule/schedulemodal.controller.js","modules/content/careplan_editor/components/tree-extensions/expandcollapse.directive.js","modules/content/careplan_editor/editpathways.controller.js","modules/content/careplan_editor/editpathways.modal.js","modules/content/careplan_editor/healthtips/addhealthtip.controller.js","modules/content/careplan_editor/healthtips/addhealthtip.modal.js","modules/content/careplan_editor/healthtips/apk.sanitizer.js","modules/content/careplan_editor/healthtips/healthtips.controller.js","modules/content/careplan_editor/healthtips/healthtips.service.js","modules/content/careplan_editor/healthtips/healthtips.tpl.js","modules/content/careplan_editor/patientsurvey/orderbyschedule.filter.js","modules/content/careplan_editor/patientsurvey/overduealertselection.directive.js","modules/content/careplan_editor/patientsurvey/patientsurvey.controller.js","modules/content/careplan_editor/patientsurvey/patientsurvey.tpl.js","modules/content/careplan_editor/patientsurvey/patientsurveyalertchange.controller.js","modules/content/careplan_editor/patientsurvey/patientsurveyalertchange.modal.js","modules/content/careplan_editor/patientsurvey/patientsurveyedit.controller.js","modules/content/careplan_editor/patientsurvey/patientsurveyedit.tpl.js","modules/content/careplan_editor/patientsurvey/patientsurveyhistory.controller.js","modules/content/careplan_editor/patientsurvey/patientsurveyhistory.modal.js","modules/content/careplan_editor/patientsurvey/patientsurveykithistory.controller.js","modules/content/careplan_editor/patientsurvey/patientsurveykithistory.modal.js","modules/content/careplan_editor/patientsurvey/patientsurveys.controller.js","modules/content/careplan_editor/patientsurvey/patientsurveys.tpl.js","modules/content/careplan_editor/patientsurvey/template.controller.js","modules/content/careplan_editor/patientsurvey/template.tpl.js","modules/content/careplan_editor/services/categories.service.js","modules/content/careplan_editor/services/patientsurvey.service.js","modules/content/careplan_editor/services/templates.service.js","modules/content/careplan_editor/services/videos.service.js","modules/content/careplan_editor/templates/addquestion.modal.js","modules/content/careplan_editor/templates/addquestionmodal.controller.js","modules/content/careplan_editor/templates/addrule.modal.js","modules/content/careplan_editor/templates/addrulemodal.controller.js","modules/content/careplan_editor/templates/addtemplate.controller.js","modules/content/careplan_editor/templates/addtemplate.modal.js","modules/content/careplan_editor/templates/editbiometric.controller.js","modules/content/careplan_editor/templates/editbiometric.modal.js","modules/content/careplan_editor/templates/importtemplate.controller.js","modules/content/careplan_editor/templates/importtemplate.modal.js","modules/content/careplan_editor/templates/templates.controller.js","modules/content/careplan_editor/templates/templates.tpl.js","modules/content/careplan_editor/templates/templatesedit.controller.js","modules/content/careplan_editor/templates/templatesedit.tpl.js","modules/content/careplan_editor/templates/updatecustomtemplate.modal.js","modules/content/careplan_editor/templates/updatecustomtemplatemodal.controller.js","modules/content/careplan_editor/videos/video.controller.js","modules/content/careplan_editor/videos/video.modal.controller.js","modules/content/careplan_editor/videos/video.modal.js","modules/content/careplan_editor/videos/video.tpl.js","modules/content/careplan_editor/videos/videos.controller.js","modules/content/careplan_editor/videos/videos.tpl.js","modules/content/chart/chart.tpl.js","modules/content/chart/contentchart.controller.js","modules/content/chart/contentchart.service.js","modules/content/images/croppie.directive.js","modules/content/images/image.editor.controller.js","modules/content/images/image.editor.modal.js","modules/content/resource_library/add_resource/add.resource.controller.js","modules/content/resource_library/add_resource/add.resource.tpl.js","modules/content/resource_library/category_editor/editcategory.controller.js","modules/content/resource_library/category_editor/editcategory.modal.js","modules/content/resource_library/icon_picker/icon.picker.controller.js","modules/content/resource_library/icon_picker/icon.picker.modal.js","modules/content/resource_library/resource.library.controller.js","modules/content/resource_library/resource.library.service.js","modules/content/resource_library/resource.library.tpl.js","modules/content/resource_library/tile.resources.directive.js","modules/content/resource_library/tile.resources.tpl.js","modules/dashboard/dashboard.controller.js","modules/dashboard/dashboard.tpl.js","modules/dashboard/selectreporttype.controller.js","modules/dashboard/selectreportype.modal.js","modules/idle/events.controller.js","modules/idle/idle.modal.js","modules/idle/idle.service.js","modules/invites/editphone.modal.controller.js","modules/invites/editphone.modal.js","modules/invites/invites_patient_row.directive.js","modules/invites/invites_patient_row.tpl.js","modules/invites/invites.controller.js","modules/invites/invites.service.js","modules/invites/invites.tpl.js","modules/kit_logistics/kits/details.modal.controller.js","modules/kit_logistics/kits/details.modal.js","modules/kit_logistics/kits/kit-search-keywords.tpl.js","modules/kit_logistics/kits/kit/kit.controller.js","modules/kit_logistics/kits/kit/kit.service.js","modules/kit_logistics/kits/kit/kit.tpl.js","modules/kit_logistics/kits/kits.controller.js","modules/kit_logistics/kits/kits.service.js","modules/kit_logistics/kits/kits.tpl.js","modules/kit_logistics/kits/move_kits.modal.controller.js","modules/kit_logistics/kits/move_kits.modal.js","modules/kit_logistics/locations/editlocation.controller.js","modules/kit_logistics/locations/editlocation.modal.js","modules/kit_logistics/locations/locations.controller.js","modules/kit_logistics/locations/locations.service.js","modules/kit_logistics/locations/locations.tpl.js","modules/kit_logistics/locations/locationtypeeditor.directive.js","modules/kit_logistics/locations/locationtypeeditor.tpl.js","modules/kit_logistics/logistics/EditShipping/goDevicesShippingInfo.controller.js","modules/kit_logistics/logistics/EditShipping/goDevicesShippingInfo.tpl.js","modules/kit_logistics/logistics/EditShipping/goDevicesShippingInfoModel.js","modules/kit_logistics/logistics/EditShipping/KitShippingInfo.controller.js","modules/kit_logistics/logistics/EditShipping/KitShippingInfoModel.js","modules/kit_logistics/logistics/EditShipping/KitShippingInfoModel.tpl.js","modules/kit_logistics/logistics/logistics-row/logistics-row.directive.js","modules/kit_logistics/logistics/logistics-row/logistics-row.tpl.js","modules/kit_logistics/logistics/logistics.controller.js","modules/kit_logistics/logistics/logistics.service.js","modules/kit_logistics/logistics/logistics.tpl.js","modules/kit_logistics/logistics/shipped-goDevices.ship.controller.js","modules/kit_logistics/logistics/shipped-goDevices.ship.tpl.js","modules/kit_logistics/logistics/shipped-goDevices.work.controller.js","modules/kit_logistics/logistics/shipped-goDevices.work.tpl.js","modules/kit_logistics/logistics/shipped-kits.ship.controller.js","modules/kit_logistics/logistics/shipped-kits.ship.tpl.js","modules/kit_logistics/logistics/shipped-kits.work.controller.js","modules/kit_logistics/logistics/shipped-kits.work.tpl.js","modules/kit_logistics/provisioning/provisioning.controller.js","modules/kit_logistics/provisioning/provisioning.service.js","modules/kit_logistics/provisioning/provisioning.tpl.js","modules/kit_logistics/receive-kits/receive-kits-kits.directive.js","modules/kit_logistics/receive-kits/receive-kits-kits.tpl.js","modules/kit_logistics/receive-kits/receive-kits.controller.js","modules/kit_logistics/receive-kits/receive-kits.service.js","modules/kit_logistics/receive-kits/receive-kits.tpl.js","modules/messaging/addchart.controller.js","modules/messaging/addchart.modal.js","modules/messaging/message.service.js","modules/messaging/messenger.directive.js","modules/messaging/messenger.tpl.js","modules/patient/activity/activity.controller.js","modules/patient/activity/activity.service.js","modules/patient/activity/activity.tpl.js","modules/patient/activity/alerthistory.directive.js","modules/patient/activity/alerthistory.tpl.js","modules/patient/activity/billedcodeshistory.directive.js","modules/patient/activity/billedcodeshistory.tpl.js","modules/patient/activity/goapphistory.directive.js","modules/patient/activity/goapphistory.tpl.js","modules/patient/activity/patientcardhistory.directive.js","modules/patient/activity/patientcardhistory.tpl.js","modules/patient/activity/patientmessagehistory.directive.js","modules/patient/activity/patientmessagehistory.tpl.js","modules/patient/activity/profilehistory.directive.js","modules/patient/activity/profilehistory.tpl.js","modules/patient/activity/readinghistory.directive.js","modules/patient/activity/readinghistory.tpl.js","modules/patient/activity/rulehistory.directive.js","modules/patient/activity/rulehistory.tpl.js","modules/patient/activity/surveyhistory.directive.js","modules/patient/activity/surveyhistory.tpl.js","modules/patient/activity/taghistory.directive.js","modules/patient/activity/taghistory.tpl.js","modules/patient/caregivertopatienttime.service.js","modules/patient/chart/chart.controller.js","modules/patient/chart/chart.service.js","modules/patient/chart/chart.tpl.js","modules/patient/chart/editentry.controller.js","modules/patient/chart/editentry.tpl.js","modules/patient/chart/entry.controller.js","modules/patient/chart/entry.tpl.js","modules/patient/demographics/caregivers.service.js","modules/patient/demographics/careteam.controller.js","modules/patient/demographics/careteam.modal.js","modules/patient/demographics/demographics.controller.js","modules/patient/demographics/demographics.service.js","modules/patient/demographics/demographics.tpl.js","modules/patient/demographics/demographicsview.tpl.js","modules/patient/demographics/editdemographics.controller.js","modules/patient/demographics/editdemographics.modal.js","modules/patient/demographics/emergencycontacts.controller.js","modules/patient/demographics/emergencycontacts.service.js","modules/patient/demographics/emergencycontacts.tpl.js","modules/patient/demographics/godevices.directive.js","modules/patient/demographics/godevices.tpl.js","modules/patient/demographics/kitdevices.directive.js","modules/patient/demographics/kitdevices.tpl.js","modules/patient/demographics/kitshipping.directive.js","modules/patient/demographics/kitshipping.tpl.js","modules/patient/demographics/patienthospital.controller.js","modules/patient/demographics/patienthospital.modal.js","modules/patient/demographics/patientMilestone/patientMilestone.service.js","modules/patient/demographics/patientMilestone/patientMilestoneState.js","modules/patient/demographics/PatientSearch.controller.js","modules/patient/demographics/PatientSearch.tpl.js","modules/patient/demographics/program.controller.js","modules/patient/demographics/program.modal.js","modules/patient/demographics/providers.controller.js","modules/patient/demographics/providers.directive.js","modules/patient/demographics/providers.service.js","modules/patient/demographics/providers.tpl.js","modules/patient/demographics/providerupdate.directive.js","modules/patient/demographics/providerupdate.tpl.js","modules/patient/demographics/servicelevels/byod/servicelevel-byod.directive.js","modules/patient/demographics/servicelevels/byod/servicelevel-byod.tpl.js","modules/patient/demographics/servicelevels/go/servicelevel-go-confirmation.directive.js","modules/patient/demographics/servicelevels/go/servicelevel-go-confirmation.tpl.js","modules/patient/demographics/servicelevels/go/servicelevel-go-devices.directive.js","modules/patient/demographics/servicelevels/go/servicelevel-go-devices.tpl.js","modules/patient/demographics/servicelevels/go/servicelevel-go-shipping.directive.js","modules/patient/demographics/servicelevels/go/servicelevel-go-shipping.tpl.js","modules/patient/demographics/servicelevels/ivr/servicelevel-ivr.directive.js","modules/patient/demographics/servicelevels/ivr/servicelevel-ivr.tpl.js","modules/patient/demographics/servicelevels/patientservicelevel.service.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kit.directive.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kit.tpl.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kitpickup.directive.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kitship.directive.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kitshipping.tpl.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-manager.directive.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-pool.directive.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-pool.tpl.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-type.directive.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-type.tpl.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-unassign.directive.js","modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-unassign.tpl.js","modules/patient/demographics/servicelevels/servicelevel-confirmation.directive.js","modules/patient/demographics/servicelevels/servicelevel-confirmation.tpl.js","modules/patient/demographics/servicelevels/servicelevel-selection.directive.js","modules/patient/demographics/servicelevels/servicelevel-selection.tpl.js","modules/patient/demographics/servicelevels/servicelevel-wizard.controller.js","modules/patient/demographics/servicelevels/servicelevel-wizard.modal.js","modules/patient/demographics/servicelevels/servicelevel-wizard.service.js","modules/patient/demographics/servicelevels/wizard-step.directive.js","modules/patient/demographics/specialhandling.modal.controller.js","modules/patient/demographics/specialhandling.modal.js","modules/patient/demographics/specialhandling.service.js","modules/patient/directentry/biometric.modal.js","modules/patient/directentry/biometricmodal.controller.js","modules/patient/directentry/complete.modal.js","modules/patient/directentry/completemodal.controller.js","modules/patient/directentry/directentry.controller.js","modules/patient/directentry/directentry.service.js","modules/patient/directentry/directentry.tpl.js","modules/patient/directentry/question.directive.js","modules/patient/directentry/question.tpl.js","modules/patient/directentry/survey.directive.js","modules/patient/directentry/templates/question-biometric.tpl.js","modules/patient/directentry/templates/question-custom-address.tpl.js","modules/patient/directentry/templates/question-custom-alphanumeric.tpl.js","modules/patient/directentry/templates/question-custom-date.tpl.js","modules/patient/directentry/templates/question-custom-datemonthyear.tpl.js","modules/patient/directentry/templates/question-custom-datetime.tpl.js","modules/patient/directentry/templates/question-custom-numeric.tpl.js","modules/patient/directentry/templates/question-custom-time.tpl.js","modules/patient/directentry/templates/question-healthtip.tpl.js","modules/patient/directentry/templates/question-missing.tpl.js","modules/patient/directentry/templates/question-multiselect.tpl.js","modules/patient/directentry/templates/question-singleselect.tpl.js","modules/patient/forms/form-info.directive.js","modules/patient/forms/form-info.tpl.js","modules/patient/forms/form.controller.js","modules/patient/forms/form.tpl.js","modules/patient/forms/forms.controller.js","modules/patient/forms/forms.service.js","modules/patient/forms/forms.tpl.js","modules/patient/forms/patientFormGraph.directive.js","modules/patient/forms/patientFormGraph.tpl.js","modules/patient/forms/surveyform.controller.js","modules/patient/forms/surveyform.tpl.js","modules/patient/header/abbreviatedpatientheader.directive.js","modules/patient/header/abbreviatedpatientheader.tpl.js","modules/patient/header/addcptcodebilling.controller.js","modules/patient/header/addcptcodebilling.modal.tpl.js","modules/patient/header/addcptcodebilling.service.js","modules/patient/header/addTimeLog.controller.js","modules/patient/header/addTimeLog.modal.js","modules/patient/header/alertstatus.filter.js","modules/patient/header/alertstatusbar.directive.js","modules/patient/header/alertstatusbar.tpl.js","modules/patient/header/callstatus.directive.js","modules/patient/header/copybiometrics.controller.js","modules/patient/header/copybiometrics.modal.js","modules/patient/header/generalalert.controller.js","modules/patient/header/generalalert.modal.js","modules/patient/header/healthscores.directive.js","modules/patient/header/messagestatus.directive.js","modules/patient/header/monitoringStatus/monitoring-status-change.directive.js","modules/patient/header/monitoringStatus/monitoring-status-change.tpl.js","modules/patient/header/monitoringStatus/monitoring-status-manager.directive.js","modules/patient/header/monitoringStatus/monitoring-status-wizard.controller.js","modules/patient/header/monitoringStatus/monitoring-status-wizard.modal.js","modules/patient/header/patient-demographics.directive.js","modules/patient/header/patient-demographics.tpl.js","modules/patient/header/patientavatar.directive.js","modules/patient/header/patientcall.controller.js","modules/patient/header/patientcall.modal.js","modules/patient/header/patientheader.directive.js","modules/patient/header/patientheader.service.js","modules/patient/header/patientheader.tpl.js","modules/patient/header/risk.modal.js","modules/patient/header/riskmodal.controller.js","modules/patient/header/schedulevirtualvisit.controller.js","modules/patient/header/schedulevirtualvisit.modal.js","modules/patient/header/videocall.service.js","modules/patient/healthsummary/healthsummary.tpl.js","modules/patient/list/actions/assignCaregiverAction.directive.js","modules/patient/list/actions/assignCaregiverAction.tpl.js","modules/patient/list/actions/removeCaregiversAction.directive.js","modules/patient/list/actions/removeCaregiversAction.tpl.js","modules/patient/list/filters/patientlistfilters.directive.js","modules/patient/list/filters/patientlistfilters.tpl.js","modules/patient/list/filters/patientListUiSelect.directive.js","modules/patient/list/patient-search-keywords.tpl.js","modules/patient/list/patientlist.controller.js","modules/patient/list/patientlist.service.js","modules/patient/list/patientlist.tpl.js","modules/patient/medications/mastermedications.controller.js","modules/patient/medications/mastermedications.tpl.js","modules/patient/medications/medication.controller.js","modules/patient/medications/medication.tpl.js","modules/patient/medications/medications.controller.js","modules/patient/medications/medications.service.js","modules/patient/medications/medications.tpl.js","modules/patient/monitoring/alerts/alertview.directive.js","modules/patient/monitoring/alerts/alertview.tpl.js","modules/patient/monitoring/alerts/monitoringalert.controller.js","modules/patient/monitoring/alerts/monitoringalert.modal.js","modules/patient/monitoring/alerts/monitoringalert.service.js","modules/patient/monitoring/alerts/monitoringalerts.directive.js","modules/patient/monitoring/alerts/monitoringalerts.tpl.js","modules/patient/monitoring/biometrics/biometricdevice.directive.js","modules/patient/monitoring/biometrics/biometricdevice.tpl.js","modules/patient/monitoring/biometrics/biometricdevicegraph.directive.js","modules/patient/monitoring/biometrics/biometricgraph.tpl.js","modules/patient/monitoring/biometrics/biometricreading.directive.js","modules/patient/monitoring/biometrics/biometricreading.tpl.js","modules/patient/monitoring/biometrics/biometrics.directive.js","modules/patient/monitoring/biometrics/biometrics.service.js","modules/patient/monitoring/biometrics/biometrics.tpl.js","modules/patient/monitoring/biometrics/biometricsummary.directive.js","modules/patient/monitoring/biometrics/biometricsummary.tpl.js","modules/patient/monitoring/biometrics/biometricsummarypopup.tpl.js","modules/patient/monitoring/biometrics/collapsedreadingtooltip.tpl.js","modules/patient/monitoring/biometrics/modifyresponse.controller.js","modules/patient/monitoring/biometrics/modifyresponse.modal.js","modules/patient/monitoring/biometrics/valuetooltip.tpl.js","modules/patient/monitoring/indexes/healthindex.directive.js","modules/patient/monitoring/indexes/healthindex.tpl.js","modules/patient/monitoring/monitoring.controller.js","modules/patient/monitoring/monitoring.events.service.js","modules/patient/monitoring/monitoring.service.js","modules/patient/monitoring/monitoring.tpl.js","modules/patient/monitoring/navigation/navigation.directive.js","modules/patient/monitoring/navigation/navigation.tpl.js","modules/patient/monitoring/surveys/questiontooltip.tpl.js","modules/patient/monitoring/surveys/surveyquestion.directive.js","modules/patient/monitoring/surveys/surveyquestion.tpl.js","modules/patient/monitoring/surveys/surveys.directive.js","modules/patient/monitoring/surveys/surveys.tpl.js","modules/patient/parameters/addchangereason.controller.js","modules/patient/parameters/addchangereason.modal.js","modules/patient/parameters/devices/bloodPressureParameters.tpl.js","modules/patient/parameters/devices/bloodSugarParameters.tpl.js","modules/patient/parameters/devices/heartRateParameters.tpl.js","modules/patient/parameters/devices/oxygenParameters.tpl.js","modules/patient/parameters/devices/pedometerParameters.tpl.js","modules/patient/parameters/devices/spirometerParameters.tpl.js","modules/patient/parameters/devices/thermometerParameters.tpl.js","modules/patient/parameters/devices/weightScaleParameters.tpl.js","modules/patient/parameters/parameters.controller.js","modules/patient/parameters/parameters.service.js","modules/patient/parameters/parameters.tpl.js","modules/patient/patient.controller.js","modules/patient/patient.tpl.js","modules/patient/PMHx/admit.directive.js","modules/patient/PMHx/admit.tpl.js","modules/patient/PMHx/clinicalhistory.service.js","modules/patient/PMHx/comorbidities.directive.js","modules/patient/PMHx/comorbidities.tpl.js","modules/patient/PMHx/editAdmitDischarge.controller.js","modules/patient/PMHx/editAdmitDischarge.modal.js","modules/patient/PMHx/editcomorbidity.controller.js","modules/patient/PMHx/editcomorbidity.modal.js","modules/patient/PMHx/history.directive.js","modules/patient/PMHx/history.tpl.js","modules/patient/PMHx/PMHx.controller.js","modules/patient/PMHx/PMHx.tpl.js","modules/permissions/permission.required.directive.js","modules/permissions/permission.router.directive.js","modules/permissions/permissions.service.js","modules/reports/allreports.controller.js","modules/reports/biometriccharts/biometricchart.directive.js","modules/reports/biometriccharts/biometricchart.tpl.js","modules/reports/biometriccharts/biometriccharts.directive.js","modules/reports/biometriccharts/biometriccharts.tpl.js","modules/reports/biometricgrid/biometricgrid.directive.js","modules/reports/biometricgrid/biometricgrid.tpl.js","modules/reports/biometricgrid/biometricvalue.directive.js","modules/reports/biometricgrid/healthscorebadge.directive.js","modules/reports/caregiverselect.controller.js","modules/reports/caregiverselect.modal.js","modules/reports/forms/patientformreport.controller.js","modules/reports/forms/patientformreport.tpl.js","modules/reports/healthsummary.controller.js","modules/reports/healthsummary.tpl.js","modules/reports/medications/medications.directive.js","modules/reports/medications/medications.tpl.js","modules/reports/patientnotes/patientnotes.directive.js","modules/reports/patientnotes/patientnotes.tpl.js","modules/reports/patientselect.controller.js","modules/reports/patientselect.modal.js","modules/reports/patientsummary/patient.directive.js","modules/reports/patientsummary/patienthealthscore.directive.js","modules/reports/patientsummary/patienthealthscore.tpl.js","modules/reports/patientsummary/patientimg.directive.js","modules/reports/patientsummary/patientinfo.directive.js","modules/reports/patientsummary/patientinfo.tpl.js","modules/reports/patientsummary/patientsummary.directive.js","modules/reports/patientsummary/patientsummary.tpl.js","modules/reports/patientsummary/providerinfo.directive.js","modules/reports/patientsummary/providerinfo.tpl.js","modules/reports/report_parameters/ccm-time-type.parameter.directive.js","modules/reports/report_parameters/ccm-time-type.tpl.js","modules/reports/report_parameters/date-month.parameter.directive.js","modules/reports/report_parameters/date-month.tpl.js","modules/reports/report_parameters/multiple-patient.filter.directive.js","modules/reports/report_parameters/multiple-patient.tpl.js","modules/reports/report_parameters/report_parameters.directive.js","modules/reports/report_parameters/report_parameters.tpl.js","modules/reports/report_parameters/typeahead-caregiver.parameter.directive.js","modules/reports/report_parameters/typeahead-caregiver.tpl.js","modules/reports/report_parameters/typeahead-patient.parameter.directive.js","modules/reports/report_parameters/typeahead-patient.tpl.js","modules/reports/report.controller.js","modules/reports/report.rdl.directive.js","modules/reports/report.rdl.tpl.js","modules/reports/report.tpl.js","modules/reports/report.type.directive.js","modules/reports/reportheader.directive.js","modules/reports/reportheader.tpl.js","modules/reports/reports.service.js","modules/reports/reports.tpl.js","modules/reports/reportsections.directive.js","modules/reports/responses/responses.directive.js","modules/reports/responses/responses.tpl.js","modules/reports/time_log/report.tpl.js","modules/reports/time_log/time_log.report.directive.js","modules/reports/usagemonitoring/report.tpl.js","modules/reports/usagemonitoring/usagemonitoring.report.directive.js","modules/repository/cardgroup.repository.js","modules/repository/cards.repository.js","modules/repository/configuration.repository.js","modules/repository/hospital.repository.js","modules/repository/icons.repository.js","modules/repository/keepalive.repository.js","modules/repository/kit.repository.js","modules/repository/kitlocation.repository.js","modules/repository/kitprovisioning.repository.js","modules/repository/patientlanguage.repository.js","modules/repository/patientsummary.repository.js","modules/repository/patientsurvey.repository.js","modules/repository/patientsurveyschedule.repository.js","modules/repository/pending.service.js","modules/repository/populations.repository.js","modules/repository/question.repository.js","modules/repository/questioncategory.repository.js","modules/repository/questiontype.repository.js","modules/repository/resourcelibrary.repository.js","modules/repository/tag.repository.js","modules/repository/template.repository.js","modules/repository/templategroup.repository.js","modules/repository/templateschedule.repository.js","modules/repository/video.repository.js","modules/repository/webformfield.repository.js","modules/site/biometrics/biometrics.controller.js","modules/site/biometrics/biometrics.modal.js","modules/site/biometrics/biometrics.service.js","modules/site/biometrics/biometrics.tpl.js","modules/site/biometrics/biometricsEdit.controller.js","modules/site/hospitals/hospital.modal.controller.js","modules/site/hospitals/hospital.modal.js","modules/site/hospitals/hospitals.controller.js","modules/site/hospitals/hospitals.service.js","modules/site/hospitals/hospitals.tpl.js","modules/site/payers/payers.controller.js","modules/site/payers/payers.service.js","modules/site/payers/payers.tpl.js","modules/site/payers/payersEdit.controller.js","modules/site/payers/payersEdit.tpl.js","modules/site/populationGroups/populationGroups.controller.js","modules/site/populationGroups/populationGroups.service.js","modules/site/populationGroups/populationGroups.tpl.js","modules/site/populationGroups/populationGroupsEdit.controller.js","modules/site/populationGroups/populationGroupsEdit.tpl.js","modules/site/populations/population.controller.js","modules/site/populations/population.tpl.js","modules/site/populations/populationEdit.controller.js","modules/site/populations/populationEdit.tpl.js","modules/site/profileFields/profileFields.controller.js","modules/site/profileFields/profileFields.service.js","modules/site/profileFields/profileFields.tpl.js","modules/site/profileFields/profileFieldsEdit.controller.js","modules/site/profileFields/profileFieldsEdit.tpl.js","modules/site/programDurations/programDurations.controller.js","modules/site/programDurations/programDurations.service.js","modules/site/programDurations/programDurations.tpl.js","modules/site/programDurations/programDurationsEdit.controller.js","modules/site/programDurations/programDurationsEdit.tpl.js","modules/site/providerGroups/providerGroups.controller.js","modules/site/providerGroups/providerGroups.service.js","modules/site/providerGroups/providerGroups.tpl.js","modules/site/providerGroups/providerGroupsEdit.controller.js","modules/site/providerGroups/providerGroupsEdit.tpl.js","modules/site/referrals/referrals.controller.js","modules/site/referrals/referrals.service.js","modules/site/referrals/referrals.tpl.js","modules/site/referrals/referralsEdit.controller.js","modules/site/referrals/referralsEdit.tpl.js","modules/site/specialhandling/specialhandling.controller.js","modules/site/specialhandling/specialhandling.tpl.js","modules/site/specialhandling/specialhandlingEdit.controller.js","modules/site/specialhandling/specialhandlingEdit.tpl.js","modules/system/_controls/controls.tpl.js","modules/system/biometricalerts/biometricalert.controller.js","modules/system/biometricalerts/biometricalert.tpl.js","modules/system/biometricalerts/biometricAlertCondition.directive.js","modules/system/biometricalerts/biometricAlertCondition.tpl.js","modules/system/biometricalerts/biometricAlertExpression.directive.js","modules/system/biometricalerts/biometricAlertExpression.tpl.js","modules/system/biometricalerts/biometricalerts.controller.js","modules/system/biometricalerts/biometricalerts.service.js","modules/system/biometricalerts/biometricalerts.tpl.js","modules/system/biometricalerts/biometricAlertTest.directive.js","modules/system/biometricalerts/biometricAlertTest.tpl.js","modules/system/email/email.controller.js","modules/system/email/email.service.js","modules/system/email/email.tpl.js","modules/system/emailServers/emailServers.controller.js","modules/system/emailServers/emailServers.service.js","modules/system/emailServers/emailServers.tpl.js","modules/system/emailServers/emailServersEdit.controller.js","modules/system/emailServers/emailServersEdit.tpl.js","modules/system/forms/add-form.controller.js","modules/system/forms/add-form.modal.js","modules/system/forms/add-question-variable-tooltip.tpl.js","modules/system/forms/add-question.controller.js","modules/system/forms/add-question.modal.js","modules/system/forms/add-section.controller.js","modules/system/forms/add-section.modal.js","modules/system/forms/forms.controller.js","modules/system/forms/forms.service.js","modules/system/forms/forms.tpl.js","modules/system/forms/import-form.controller.js","modules/system/forms/import-form.modal.js","modules/system/go_devices/go_devices.confirmation.controller.js","modules/system/go_devices/go_devices.controller.js","modules/system/go_devices/go_devices.modal.controller.js","modules/system/go_devices/go_devices.modal.js","modules/system/go_devices/go_devices.models.js","modules/system/go_devices/go_devices.service.js","modules/system/go_devices/go_devices.tpl.js","modules/system/languages/language.modal.controller.js","modules/system/languages/languages.controller.js","modules/system/languages/languages.modal.js","modules/system/languages/languages.service.js","modules/system/languages/languages.tpl.js","modules/system/loginNotification/addNotification.controller.js","modules/system/loginNotification/addNotification.modal.js","modules/system/loginNotification/importloginnotification.controller.js","modules/system/loginNotification/importloginnotification.modal.js","modules/system/loginNotification/loginNotification.controller.js","modules/system/loginNotification/loginNotification.service.js","modules/system/loginNotification/loginNotification.tpl.js","modules/system/logo/logo.controller.js","modules/system/logo/logo.modal.js","modules/system/logo/logo.service.js","modules/system/logo/logo.tpl.js","modules/system/logo/logoModal.controller.js","modules/system/networkoperator/networkoperator.controller.js","modules/system/networkoperator/networkoperator.service.js","modules/system/networkoperator/networkoperator.tpl.js","modules/system/patientIdentifierFields/patientIdentifierFields.controller.js","modules/system/patientIdentifierFields/patientIdentifierFields.service.js","modules/system/patientIdentifierFields/patientIdentifierFields.tpl.js","modules/system/patientIdentifierFields/patientIdentifierFieldsEdit.controller.js","modules/system/patientIdentifierFields/patientIdentifierFieldsEdit.tpl.js","modules/system/pickup/pickup.controller.js","modules/system/pickup/pickup.service.js","modules/system/pickup/pickup.tpl.js","modules/system/pickup/pickupedit.controller.js","modules/system/pickup/pickupedit.tpl.js","modules/system/rules/actions/addLibraryTileAction.tpl.js","modules/system/rules/actions/addPathwayAction.tpl.js","modules/system/rules/actions/addPatientAlertAction.tpl.js","modules/system/rules/actions/addPatientCardAction.tpl.js","modules/system/rules/actions/changePathwayStatusAction.tpl.js","modules/system/rules/actions/changePatientProgramAction.tpl.js","modules/system/rules/actions/changePatientStatusAction.tpl.js","modules/system/rules/actions/discontinueAllPathwaysExceptAction.tpl.js","modules/system/rules/actions/executeSQLCommandAction.tpl.js","modules/system/rules/actions/managePatientDeviceAction.tpl.js","modules/system/rules/actions/managePatientSpecialHandlingAction.tpl.js","modules/system/rules/actions/managePatientSurveySchedulesAction.tpl.js","modules/system/rules/actions/managePatientTagAction.tpl.js","modules/system/rules/actions/removeLibraryTileAction.tpl.js","modules/system/rules/actions/removePatientCardAction.tpl.js","modules/system/rules/actions/replacePatientCardAction.tpl.js","modules/system/rules/actions/ruleAction.directive.js","modules/system/rules/actions/sendEmailRuleAction.tpl.js","modules/system/rules/actions/transitionPatientServiceLevelAction.tpl.js","modules/system/rules/addrule.modal.js","modules/system/rules/executeSQLCommandAction.tpl.js","modules/system/rules/rule.controller.js","modules/system/rules/rule.tpl.js","modules/system/rules/ruleCondition.directive.js","modules/system/rules/ruleCondition.tpl.js","modules/system/rules/ruleExpression.directive.js","modules/system/rules/ruleExpression.tpl.js","modules/system/rules/rules.controller.js","modules/system/rules/rules.service.js","modules/system/rules/rules.tpl.js","modules/system/securityroles/addrole.controller.js","modules/system/securityroles/addrole.modal.js","modules/system/securityroles/securityroles.controller.js","modules/system/securityroles/securityroles.service.js","modules/system/securityroles/securityroles.tpl.js","modules/system/serviceLevel/serviceLevel.service.js","modules/system/serviceLevel/serviceLevelEdit.directive.js","modules/system/serviceLevel/serviceLevelEdit.tpl.js","modules/system/serviceLevel/serviceLevelList.controller.js","modules/system/serviceLevel/serviceLevelList.tpl.js","modules/system/settings/editsetting.controller.js","modules/system/settings/editsetting.value.directive.js","modules/system/settings/editsettings.stringtonumber.directive.js","modules/system/settings/install.controller.js","modules/system/settings/install.modal.js","modules/system/settings/settings.controller.js","modules/system/settings/settings.modal.js","modules/system/settings/settings.service.js","modules/system/settings/settings.tpl.js","modules/system/sites/addsite.controller.js","modules/system/sites/addsite.modal.js","modules/system/sites/sites.controller.js","modules/system/sites/sites.service.js","modules/system/sites/sites.tpl.js","modules/system/slideshow/addSlideshowImage.controller.js","modules/system/slideshow/addSlideshowImage.modal.js","modules/system/slideshow/slideshow.controller.js","modules/system/slideshow/slideshow.tpl.js","modules/system/sms/sms.controller.js","modules/system/sms/sms.service.js","modules/system/sms/sms.tpl.js","modules/system/titles/titleEdit.controller.js","modules/system/titles/titleEdit.tpl.js","modules/system/titles/titles.controller.js","modules/system/titles/titles.service.js","modules/system/titles/titles.tpl.js","modules/system/webhooks/webhook.modal.js","modules/system/webhooks/webhookmodal.controller.js","modules/system/webhooks/webhooks.controller.js","modules/system/webhooks/webhooks.repository.js","modules/system/webhooks/webhooks.service.js","modules/system/webhooks/webhooks.tpl.js","modules/time_log/detail/deletedetail.controller.js","modules/time_log/detail/deletedetail.modal.js","modules/time_log/detail/detail.audit.directive.js","modules/time_log/detail/detail.audit.tpl.js","modules/time_log/detail/detail.controller.js","modules/time_log/detail/detail.datepicker.directive.js","modules/time_log/detail/detail.day.directive.js","modules/time_log/detail/detail.day.tpl.js","modules/time_log/detail/detail.service.js","modules/time_log/detail/detail.session.directive.js","modules/time_log/detail/detail.session.tpl.js","modules/time_log/detail/detail.time.directive.js","modules/time_log/detail/detail.time.tpl.js","modules/time_log/detail/detail.tpl.js","modules/time_log/detail/detail.utilities.service.js","modules/toast/vhToaster.directive.js","modules/toast/vhToaster.tpl.js"],"names":["window","document","angular","undefined","AppInit","KeepAliveRepository","PermissionService","TimeLogFactory","get","then","isAuthorized","loadUserPermissions","register","$inject","module","run","provider","$stateProvider","this","$get","state","stateName","options","isString","length","Error","isObject","modalInstance","url","onEnter","$uibModal","$state","open","result","$current","name","go","onExit","close","animatedflash","$animate","$timeout","restrict","link","scope","element","attrs","$watch","animatedFlash","newValue","addClass","removeClass","directive","focusMe","$parse","timeout","focusDelay","$eval","$observe","value","assign","focus","uiBreadcrumbs","$interpolate","$transitions","lodash","template","displaynameProperty","abstractProxyProperty","displayparamProperty","updateBreadcrumbsArray","workingState","displayName","breadcrumbs","currentState","disableBreadCrumbLink","getWorkingState","getDisplayName","abstract","stateAlreadyInBreadcrumbs","displayParam","getDisplayParam","displayParamAlreadyInBreadcrumb","index","findIndex","splice","push","route","disableLink","parent","reverse","i","alreadyUsed","proxyStateName","getObjectValue","interpolationContext","propertyReference","locals","globals","objectPath","context","propertyArray","split","isDefined","onSuccess","$compile","contains","arr","item","comparator","isArray","postLinkFn","elem","checklistModel","$set","getter","setter","checklistChange","checklistBeforeChange","checklistValue","$parent","equals","hasOwnProperty","checklistComparator","comparatorExpression","substring","a","b","setValueInChecklistModel","checked","current","isFunction","add","remove","setChecked","newArr","oldArr","ngModel","oldValue","$watchCollection","priority","terminal","compile","tElement","tAttrs","tagName","type","btnCheckbox","CollapseMenu","$document","CollapserDirective","on","body","hasClass","$emit","defaultTempUnit","displayBothUnits","controller","$scope","config","$compileProvider","aHrefSanitizationWhitelist","require","modelController","highlightText","$render","$viewValue","$sce","controllers","highlightController","text","html","regex","RegExp","replace","trustAsHtml","ImageSelection","show","imageOptions","templateUrl","backdrop","resolve","showModal","factory","PrintDirective","$rootScope","$location","trans","search","print","PrintFooterDirective","transclude","escapedFooter","prepend","$evalAsync","htmlText","clone","$on","$destroy","searchText","placeholderText","searchAction","cancelAction","activeSearch","performSearch","clearSearch","plText","SmoothExpand","$root","css","animate","opacity","yOffset","$window","scrollToPosition","stopY","startY","pageYOffset","documentElement","scrollTop","distance","scrollTo","speed","Math","round","step","leapY","timer","scroll","scrollEId","viewEId","viewElement","scrollElement","getElementById","offset","curTop","getBoundingClientRect","top","screenHeight","innerHeight","isElmOnScreen","y","offsetTop","node","offsetParent","max","elmYPosition","scrollToTop","FixedDirective","marker","container","angularWindow","paddingHeight","parseInt","getComputedStyle","getPropertyValue","el","prev","elParent","children","after","before","attr","scrolled","offsetWatch","topWatch","nodeName","toLowerCase","off","isFocusListenerSet","focusListener","event","targetElem","target","potentialChild","isChildOf","rect","scrollY","toggleFocusListener","isFixed","scrollTimeout","elm","bottom","clientHeight","checkVisible","detach","append","pageSize","totalCount","SelectableDirective","number","msCtrl","selectedClass","selectClass","selectItem","selectable","changeSelect","selected","vhSelected","$event","disabled","tEl","depth","shouldHandleClick","clickedSelectable","registerSelectElem","removeSelectElem","$attrs","ctrl","trackBy","delegate","selectables","getSelectableKey","key","unselect","select","addSelectable","removeSelectable","CaregiversRoutes","data","displayIcon","views","main@","isAll","AdditionalIdentifiers","ConfigurationsService","getConfig","configs","params","isNew","caregiver","$stateParams","CaregiversService","successMessage","getCaregiverById","caregiverId","ConfigurationsRoutes","requiredPermissions","configurationContent","EditConfigurationsService","getConfigurationContent","webformfields","WebFormFieldRepository","alerttypes","AlertTypesService","getAlertTypes","patientHeaderConfigurations","PatientHeaderConfigurationService","getPatientHeaderConfigurations","availablePopulations","canAssignDisabledItems","userHasPermission","populationsList","enabledOnly","filter","x","IsEnabled","ContentRoutes","DashboardRoutes","lazyLoad","transition","injector","getExagoApi","biReport","BIService","promise","getReport","biReportId","ExagoFullPath","cachedReport","getCachedReportContent","content","timestamp","timeStamp","IdleConfig","IdleProvider","interrupt","InvitesRoutes","filterDisplayNames","all","defaultParamValues","filterName","firstPageInvites","InvitesService","getInvites","KitLogisticsRoutes","PatientRoutes","patientContent","PatientHeaderService","ccowService","getPatientHeader","patientId","patient","mapPatient","PatientHeader","portalPatientChange","hasMaskedIdentifiersWritePermission","hasPatientHospitalUpdatePermission","RequireAdditionalIdentifier","HL7RequireAdditionalIdentifier","patient-area@patients.patient","healthSummaryReport","ReportsService","getHealthSummaryReport","timeLogAction","ReportsRoutes","cache","isSelfService","reportData","getSelfServiceReports","folderId","report","isEdit","PHIWarningText","ConfigurationRepository","getByParamName","Value","transform$Ref","json","refMap","JSON","parse","$ref","SiteRoutes","SystemRoutes","LoginRoutes","$animateProvider","DirtyPageProvider","loginStateName","classNameFilter","ignoreRoutes","TwoFactorSetupRoutes","cptCodeList","CurrentProceduralTerminologyCodesService","getCurrentProceduralTerminologyCodes","careManagementTypes","CareManagementTypesService","getAll","billingCode","cptCode","find","o","Code","constant","Biometric","Survey","Task","WeightBaseLine","Password","BloodPressureManualCount","BloodSugarManualCount","WeightScaleManualCount","PulseOxManualCount","BloodPressureBiometric","BloodSugarBiometric","WeightScaleBiometric","PulseBiometric","OxygenBiometric","Phone","General","CareplanOverdue","NinetyDay","IVRPinValidationFailed","IVRWelcomeCallAttemptsExceeded","TemperatureBiometric","TemperatureManualCount","QuestionableDate","PEFBiometric","SpirometerManualCount","FEVOneBiometric","FEVRatioBiometric","SkipWeight","SkipBloodPressure","SkipBloodSugar","SkipPulse","SkipOxygen","SkipTemperature","SkipSpirometer","StepsBiometric","SkipSteps","StepsManualCount","SMSStopAlert","Notification","InUseKitDeliveredtoLogistics","ExternalRegistrationFailed","ScheduleChange","Alert","All","High","Medium","None","New","Accepted","Rejected","Scheduled","CareManagementTypesRoutes","ConfigContentRoutes","multiLingualContent","ConfigurationContentService","kitContent","webRpmContent","getGoConfigurationWebRpmContent","response","WelcomeVideos","MultiLingualContent","availableLanguages","getAvailablePopulations","contentConfig","configTypeEnum","configTypeText","ProgramGroupSettings","PopulationGroupsService","SiteSettings","SitesService","getAvailableLanguages","agreementType","HospitalSettings","getHospital","Providers","GetProviders","AuthorizationService","getCaregiver","Id","getSites","ProviderGroup","ProviderGroupsService","ConfigurationRankings","getConfigurationRankings","ConfigService","Agreements","getAgreements","AgreementsEnum","Type","getMultiLingualContent","getHomeKitContent","Slideshows","CardsRoutes","cardGroupId","ChartRoutes","chartContent","ContentChartService","getChartContent","LibraryRoutes","groupId","groupName","KitsConfig","kitsContent","KitsService","filters","pageNumber","sortBy","getContent","portalConfig","KitLogisticsLocationsRoutes","locations","KitLogisticsLocationsService","getLocations","hospitalLabel","getHospitalLabel","KitLogisticsLogisticsRoutes","searchableFields","LogisticsService","GetSearchableFields","KitLogisticsProvisioningRoutes","kits","KitLogisticsProvisioningService","getKits","InboundDeliveriesRoutes","inboundContent","InboundService","getInboundContent","ActivityRoutes","patient-area","PatientChartRoutes","changedEntry","chart","PatientChartService","getChart","chartLogger","AnalyticsFactory","entryGroup","masterEntries","getMasterEntries","logger","getEntryGroup","patientChartEntryGroupId","DemographicsRoutes","modalStateProvider","demographics","DemographicsService","getLists","patientDemographics","getPatient","hasWritePermission","hasProgramStartDateWritePermission","ShowPatientIdentifier","showPinInHeader","ShowPinInPatientHeader","monitoringCaregivers","PatientDemographicsCaregiversService","getPatientCaregivers","specialHandling","PatientDemographicSpecialHandlingService","getPatientSpecialHandling","emergencyContacts","PatientDemographicsContactsService","getContacts","ProviderGroups","PatientDemographicsProvidersService","getProviderGroups","patientIdentifierFields","getPatientIdentifierFields","patientConfigurationRankings","getConfigRankings","currentSites","s","IsCurrent","WebFormFields","getWebFormFields","PatientFields","patientFields","getNewPatient","size","windowClass","serviceLevels","PatientServiceLevelService","getServiceLevels","patientServiceLevel","getPatientServiceLevelWithKitInfo","webFormFields","configurations","configurationRankings","kitInfo","getServiceLevelKitInfo","TemplatesService","availableEducationMaterials","getEducationMaterials","Disabled","logisticsConfig","getLogisticsConfiguration","installMethods","getInstallMethods","kitPickupOptions","pickupService","GoAddDevice","Unassign","CMP","RPM","RPMVideo","BYOD","IVR","Go","DirectEntryRoutes","PatientTimeZone","DirectEntryService","date","Date","getDirectEntry","PatientFormsRoutes","allForms","PatientFormsService","getForms","forms","form","IsActive","getPatientForm","patientFormId","getPatientFormsByType","FormTypeId","getFormQuestionValues","FormId","questionValues","currentForm","otherForms","lists","patientParameters","ParametersService","getParameters","getForm","formId","isCreate","getDailyFormResponses","patientSurveyId","PatientListRoutes","filterBy","patientListContent","PatientListService","getPatientListContent","stateParams","AllPatients","NoAlerts","AlertsOnly","SurveyDueToday","NonResponders","UnreadMessages","NotificationsOnly","CallRequests","AlertPriority","PatientName","TotalTimeAscending","TotalTimeDescending","ClinicalTimeAscending","ClinicalTimeDescending","NonResponderSinceDateTime","DaysInStatusAscending","DaysInStatusDescending","CallRequestSeverityDescending","MedicationsRoutes","medications","MedicationsService","getMedications","masterMedication","patientMedication","displayname","timelogaction","getPatientMedication","patientMedicationId","PatientMonitoringRoutes","healthScores","MonitoringService","getAllHealthScores","monitoringData","MonitoringAlertService","end","start","getTime","setDate","getDate","getPatientResponses","startDate","endDate","responseData","getAlertTasks","tasks","monitoringConfig","MonitoringConfigurationService","getMonitoringConfigurations","readingThreshold","getValueFor","populationId","enableReadingCollapse","showGraphHeader","BloodSugar","BloodPressure","PulseOx","Weight","Number","SingleSelection","MultiSelection","HealthTip","Video","YesNo","Temperature","Spirometer","Pulse","Oxygen","Steps","HbA1c","ControlClicks","RescueClicks","Sleep","Systolic","Diastolic","ReadingType","TempFahrenheit","PEF","TempCelsius","FEVOne","FEVRatio","ReadingDeviceModel","UnitType","AddressLine1","AddressLine2","City","State","Zip","Details","Hour","Min","Time","Grid","Audit","Graph","ParametersRoutes","parameters","ClinicalHistoryRoutes","comorbiditiesData","ClinicalHistoryService","getPatientComorbidities","admitDischargeData","getPatientAdmitDischarge","PatientFormReportRoutes","BiometricsRoutes","populationName","populations","BiometricsService","getAllPopulations","hospitalRoutes","Hospitals","HospitalsService","PatientCounts","getPatientCounts","PayersRoutes","payers","PayersService","PopulationGroupsRoutes","populationGroups","PopulationRoutes","PopulationCount","getPopulationCount","ProfileFieldsRoutes","fields","ProfileFieldsService","getFields","ProgramDurationsRoutes","programDurations","ProgramDurationsService","ProviderGroupsRoutes","providerGroups","ReferralsRoutes","referrals","ReferralsService","SettingsRoutes","isSiteSettings","SpecialHandlingRoutes","SpecialHandlings","getSpecialHandlingList","BiometricAlertsRoutes","FromState","BiometricAlertId","BiometricAlert","BiometricAlertsService","retVal","EmailRoutes","EmailServerRoutes","servers","EmailServersService","getEmailServers","FormsRoutes","FormQuestionTypes","FormsService","getQuestionTypes","OriginalInputType","InlineRadion","Radion","MultiLineTextbox","Textbox","InlineCheckboxs","Checkboxes","DropDown","StaticVariable","Provider","ActiveMedications","PatientParameters","DynamicVariable","WeightGraph","PulseGraph","O2Graph","BPGraph","DevicesRoutes","DeviceModels","GoDevicesService","getDeviceModels","deviceModels","device","DeviceTypeId","languageRoutes","Languages","LanguagesService","LoginNotificationRoutes","LogoRoutes","networkOperatorRoute","NetworkOperators","NetworkOperatorService","PatientIdentifierFieldsRoutes","PatientIdentifierFieldsService","PickupRoutes","pickupOptions","RulesRoutes","RuleId","Rule","RulesService","ruleEvents","PatientSurveyCompleted","description","PatientStatusUpdated","PatientPopulationUpdated","PatientAdded","PatientBiometricAdded","PatientAlertInterventionAdded","PatientAlertExternalRegistrationFailed","PatientServiceLevelTransitioned","PatientSpecialHandlingAddedEvent","PatientSpecialHandlingRemovedEvent","PatientSurveyOverdueEvent","ruleEventTypes","Object","ruleActions","AddPathway","ChangePathwayStatus","DiscontinueAllPathwaysExcept","AddPatientAlert","ChangePatientProgram","ChangePatientStatus","AddPatientCard","RemovePatientCard","ReplacePatientCard","AddLibraryTile","RemoveLibraryTile","SendEmailRule","ManagePatientDevice","ManagePatientTag","ExecuteSQLCommand","TransitionPatientServiceLevel","ManagePatientSpecialHandling","ManagePatientSurveySchedules","ruleActionTypes","SecurityroleRoutes","serviceLevelRoutes","ServiceLevels","ServiceLevelService","KitCreation","CommKit","Packaging","SlideshowRoutes","SmsRoutes","TitleRoutes","titles","TitlesService","WebhookRoutes","DemoController","vm","searchActive","isRequired","code","innerHTML","selectedOptions","addItem","newOption","actionClick","$action","console","log","label","notify","duration","sendNotification","copy","ControlRoutes","PatientTimeLogDetailRoutes","timeLogDetailContent","TimeLogDetailService","getTimeLogsByMonth","monthOffset","CategoryRoutes","Category","CategoriesService","SurveyQuestionCategoryId","getAllCategories","q","Name","HealthTipRoutes","TextAngularConfig","healthTipsObj","HealthTipsService","getHealthTipsByPage","getPageSize","healthTipName","getHealthTip","TipQuestionId","healthTip","$provide","decorator","taRegisterTool","$delegate","display","action","deferred","textAngular","newVal","$editor","wrapSelection","toolbar","taSelection","insertImage","deffered","restoreSelection","editorScope","maxImageSize","imageData","filetype","base64","fileSize","units","toFixed","PatientSurveyRoutes","PatientSurveyRun","$urlRouterProvider","careplan-area","PatientCareplanContent","PatientSurveyService","getPatientCareplanContent","isYesterday","survey","PatientSurvey","presentUnansweredQuestions","configParams","ShowPresentedPathwayQuestions","getPatientSurvey","PatientSurveyId","AvailableLanguages","Template","getTemplateForPatient","templateId","careplan-area@patients.patient.careplan","PatientCareplanEditContent","getPatientCareplanEditContent","reloaded","onBefore","fromState","from","toState","to","indexOf","VideosRoutes","video","VideosService","getVideo","videoId","TemplatesRoutes","TemplateGroup","templateGroupId","getTemplateGroup","group","TemplateGroupName","SurveyTemplate","getAllTemplates","SurveyTemplateId","KitConfig","KitService","getKitContent","kitId","requiredPermission","editable","alertChanged","option","AlertSeverityLevel","isVisible","AlertSeverityLevelId","alertSeverityClass","clickable","alertClass","tooltip","changeAlert","getNextAlertSeverity","HealthTipButton","MediaPreview","iClicked","title","texts","Text","PatientSurveyOptions","SurveyOptions","OptionTexts","QuestionTexts","showHealthTip","DisplayCondition","sources","media","healthTipMedia","showVideo","videoMedia","VideoButton","VideoRepository","showPreview","VideoFiles","reduce","map","source","protocol","host","port","RelativeUrl","FileName","LocaleCode","GeneralConfig","$rootScopeProvider","$httpProvider","repositoryUrlBuilderProvider","$uibModalProvider","$qProvider","errorOnUnhandledRejections","digestTtl","setBaseUrl","defaults","headers","common","animation","keyboard","AppRoutesConfig","$urlMatcherFactoryProvider","caseInsensitive","otherwise","HttpErrorHandling","interceptors","$q","$injector","responseError","rejection","$loginService","vhSweetAlert","status","location","origin","hostname","hash","setLoginRedirect","reject","error","isConfirm","transitionTo","reload","inherit","shouldUseDefault","preventDefault","AppRouteHandling","editableOptions","$log","editableThemes","$uibModalStack","LoginService","theme","bs3","buttonsClass","$to","hasLoadedPermissions","warn","isLoggedIn","setTimeout","dismissAll","SmoothScrollConfig","SmoothScrollProvider","$browser","notifyWhenNoOutstandingRequests","callback","ms","clearTimeout","overwrites","directiveName","inputTpl","$locationProvider","hashPrefix","lowercase","$$lowercase","$trace","_classCallCheck","instance","Constructor","TypeError","_defineProperties","props","descriptor","enumerable","configurable","writable","defineProperty","_createClass","protoProps","staticProps","prototype","EnumSymbol","_ref","serializeByName","symbol","Symbol","is","saveAsKey","freeze","keyFor","valueOf","LockStatusEnum","Enum","enumValues","_this","keys","_this2","UnLocked","Locked","InheritedLock","href","hasField","sessionStorage","setItem","getItem","concat","className","startExpanded","expanded","Proxy","receiver","Reflect","set","ownKeys","getOwnPropertyNames","initial","arguments","internalObject","startsWith","hasContentLock","LockStatus","handlers","forEach","angles","id","width","height","resize","segments","responsive","legend","$elem","ctx","getContext","oldVal","chartCreated","destroy","update","generateLegend","draw","isFinite","activeSegment","save","fillColor","highlightColor","showTooltip","restore","OldChart","Chart","noConflict","types","Line","extend","initialize","helpers","PointClass","Point","offsetGridLines","strokeWidth","pointDotStrokeWidth","radius","pointDotRadius","pointDot","hitDetectionRadius","pointHitDetectionRadius","inRange","mouseX","pow","datasets","showTooltips","bindEvents","tooltipEvents","evt","activePoints","getPointsAtEvent","cleanActivePoints","where","p","eachPoints","point","each","activePoint","highlightFill","strokeColor","highlightStroke","dataset","datasetObject","pointColor","pointStrokeColor","points","dataPoint","val","labels","datasetLabel","pointHighlightFill","pointHighlightStroke","buildScale","self","referenceLabel","lastPoint","findPreviousWhere","refLine","RefLine","lineWidth","lastPointValue","scale","calculateYRange","currentHeight","updatedRanges","calculateScaleRange","values","bar","minValue","min","maxValue","dataTotal","fontSize","beginAtZero","integersOnly","calculateX","endPoint","render","ease","apply","startX","stopX","calculateY","Element","beginPath","strokeStyle","moveTo","lineTo","stroke","fill","closePath","measureText","fillStyle","textAlign","textBaseline","yVal","fillText","$templateCache","put","_typeof","obj","iterator","constructor","global","moment","colorName","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","conversions","fn","exports","createCommonjsModule","reverseKeywords","convert","rgb","channels","hsl","hsv","hwb","cmyk","xyz","lab","lch","hex","keyword","ansi16","ansi256","hcg","apple","model","comparativeDistance","h","l","r","g","delta","rdif","gdif","bdif","v","diff","diffc","c","k","reversed","currentClosestKeyword","currentClosestDistance","Infinity","z","t1","t2","t3","smin","lmin","hi","floor","f","t","sl","vmin","n","wh","bl","ratio","m","y2","x2","z2","atan2","PI","sqrt","hr","cos","sin","args","ansi","color","mult","rem","string","toString","toUpperCase","match","colorString","char","join","integer","hue","chroma","mg","pure","w","deriveBFS","fromModel","graph","models","len","buildGraph","queue","pop","adjacents","adjacent","unshift","wrapConversion","toModel","path","cur","conversion","routes","wrappedFn","Array","slice","call","wrapRounded","raw","wrapRaw","colorConvert","colorName$1","getRgba","getHsla","getRgb","rgba","getHsl","hsla","getHwb","getAlpha","vals","hexString","hexDouble","rgbString","alpha","rgbaString","percentString","percentaString","hslString","hslaString","hwbString","reverseNames","hexAlpha","parseFloat","isNaN","num","str","Color","valid","setValues","lightness","whiteness","isValid","setSpace","rgbArray","hslArray","hsvArray","hwbArray","cmykArray","rgbaArray","hslaArray","setChannel","saturation","saturationv","blackness","rgbNumber","luminosity","lum","chan","contrast","color2","lum1","lum2","level","contrastRatio","dark","light","negate","lighten","darken","saturate","desaturate","whiten","blacken","greyscale","clearer","opaquer","rotate","degrees","mix","mixinColor","weight","color1","w1","w2","toJSON","prop","spaces","maxes","getValues","space","charAt","capped","chans","sname","svalues","chartjsColor","noop","uid","isNullOrUndef","substr","_isFinite","_x","valueOrDefault","defaultValue","valueAtIndexOrDefault","thisArg","loopable","arrayEquals","a0","a1","ilen","v0","v1","klen","_merger","tval","sval","merge","_mergerIf","mergeIf","merger","dst","src","inherits","extensions","me","ChartElement","Surrogate","__super__","_deprecated","previous","helpers_core","callCallback","array","fromIndex","getValueOrDefault","getValueAtIndexOrDefault","effects","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","asin","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","helpers_easing","easingEffects","RAD_PER_DEG","DOUBLE_PI","HALF_PI","QUARTER_PI","TWO_THIRDS_PI","exports$1","clear","clearRect","roundedRect","left","right","arc","drawPoint","style","rotation","xOffset","cornerRadius","rad","translate","drawImage","SQRT1_2","_isPointInArea","area","epsilon","clipArea","clip","unclipArea","flip","stepped","steppedLine","midpoint","tension","bezierCurveTo","controlPointPreviousX","controlPointNextX","controlPointPreviousY","controlPointNextY","helpers_canvas","drawRoundedRectangle","_set","defaultColor","defaultFontColor","defaultFontFamily","defaultFontSize","defaultFontStyle","defaultLineHeight","showLines","core_defaults","helpers_options","toLineHeight","matches","toPadding","_parseFont","globalDefaults","font","family","fontFamily","lineHeight","fontStyle","toFontString","inputs","info","cacheable","exports$2","_factorize","sort","log10","exponent","LOG10E","powerOf10","helpers_math","helpers$1","easing","canvas","math","rtl","getRtlAdapter","rectX","setWidth","align","xPlus","leftForLtr","itemWidth","_itemWidth","overrideTextDirection","direction","original","getPropertyPriority","setProperty","prevTextDirection","restoreTextDirection","configuration","_type","hidden","pivot","_view","_model","_start","view","actual","c0","c1","interpolate","tooltipPosition","hasValue","isNumber","core_element","exports$3","currentStep","numSteps","onAnimationProgress","onAnimationComplete","core_animation","onProgress","onComplete","core_animations","animations","request","addAnimation","lazy","startTime","now","animating","requestAnimationFrame","cancelAnimation","requestAnimFrame","startDigest","advance","nextStep","arrayEvents","unlistenArrayEvents","listener","stub","_chartjs","listeners","DatasetController","datasetIndex","datasetElementType","dataElementType","_datasetElementOptions","_dataElementOptions","linkScales","addElements","getMeta","updateIndex","meta","scales","getDataset","scalesOpts","xAxisID","xAxes","yAxisID","yAxes","getDatasetMeta","getScaleForId","scaleID","_getValueScaleId","_getIndexScaleId","_getValueScale","_getIndexScale","reset","_update","_data","createMetaDataset","_chart","_datasetIndex","createMetaData","_index","metaData","addElementAndReset","updateElement","buildOrUpdateElements","isExtensible","method","base","res","object","listenArrayEvents","resyncElements","_configure","_config","_cachedDataOpts","easingValue","elements","getStyle","_resolveDatasetElementOptions","_resolveDataElementOptions","backgroundColor","borderColor","hover","readKey","datasetOpts","custom","elementOptions","cached","dataIndex","removeHoverStyle","$previousStyle","setHoverStyle","getHoverColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","_removeDatasetHoverStyle","_setDatasetHoverStyle","hoverOptions","numMeta","numData","insertElements","count","onDataPush","onDataPop","onDataShift","shift","onDataSplice","onDataUnshift","core_datasetController","TAU","clipArc","startAngle","endAngle","pixelMargin","angleMargin","outerRadius","innerRadius","drawBorder","inner","borderAlign","lineJoin","fullCircles","drawFullCircleBorders","element_arc","inLabelRange","hoverRadius","chartX","chartY","pointRelativePosition","getAngleFromPoint","angle","betweenAngles","withinRadius","getCenterPoint","halfAngle","halfRadius","getArea","centreAngle","rangeFromCentre","circumference","valueOrDefault$1","line","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","capBezierPoints","element_line","currentVM","spanGaps","_children","globalOptionLineElements","lastDrawnIndex","_loop","previousItem","skip","lineCap","setLineDash","lineDashOffset","valueOrDefault$2","defaultColor$1","xRange","abs","hitRadius","pointStyle","element_point","mouseY","inXRange","inYRange","padding","chartArea","defaultColor$2","isVertical","getBarBounds","x1","y1","half","swap","orig","v2","parseBorderWidth","maxW","maxH","edge","borderSkipped","horizontal","parseBorderSkipped","skipX","skipY","bounds","rectangle","element_rectangle","rects","border","outer","boundingRects","fillRect","Arc","Rectangle","deprecated","valueOrDefault$3","computeFitCategoryTraits","ruler","thickness","barThickness","stackCount","curr","pixels","_length","getTicks","getPixelForTick","computeMinSampleSize","categoryPercentage","barPercentage","chunk","mode","gridLines","controller_bar","scaleOpts","stack","minBarLength","maxBarThickness","_ruler","getRuler","_xScale","_yScale","_updateElementGeometry","vscale","getBasePixel","isHorizontal","vpixels","calculateBarValuePixels","ipixels","calculateBarIndexPixels","head","center","_getStacks","last","metasets","_getMatchingVisibleMetas","stacked","stacks","getStackCount","getStackIndex","getPixelForValue","_startPixel","_endPixel","imeta","ivalue","stackLength","_parseValue","range","next","percent","computeFlexCategoryTraits","stackIndex","indexOpts","valueOpts","valueOrDefault$4","resolve$1","position","tooltips","callbacks","xLabel","yLabel","controller_bubble","xScale","yScale","dsIndex","getPixelForDecimal","NaN","_options","valueOrDefault$5","PI$1","DOUBLE_PI$1","HALF_PI$1","animateRotate","animateScale","legendCallback","listItem","list","createElement","setAttribute","appendChild","createTextNode","outerHTML","generateLabels","onClick","e","legendItem","cutoutPercentage","tooltipItem","dataLabel","controller_doughnut","getRingIndex","ringIndex","j","isDatasetVisible","maxWidth","maxHeight","opts","ratioX","ratioY","offsetX","offsetY","arcs","cutout","chartWeight","_getRingWeight","endX","endY","contains0","contains90","contains270","minX","minY","maxX","maxY","getMaxBorderWidth","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","animationOpts","centerX","centerY","calculateCircumference","hoverWidth","ringWeightOffset","dataSetIndex","axis","horizontalBar","controller_horizontalBar","valueOrDefault$6","resolve$2","isPointInArea","scaleClip","halfBorderWidth","tickOpts","ticks","defaultClip","toClip","controller_line","showLine","_showLine","lineTension","_scale","updateBezierControlPoints","lineModel","calculatePointY","lineOptions","ds","dsMeta","stackedRightValue","rightValue","sumPos","sumNeg","getRightValue","_getSortedVisibleDatasetMetas","controlPoints","capControlPoint","pt","cubicInterpolationMode","splineCurveMonotone","splineCurve","nextItem","resolve$3","angleLines","circular","pointLabels","controller_polarArea","starts","_starts","_angles","_updateRadius","countVisibleElements","_computeAngle","minSize","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getDistanceFromCenterForValue","resetRadius","doughnut","controller_pie","valueOrDefault$7","controller_radar","pointPosition","getPointPositionForValue","scatter","bubble","polarArea","pie","radar","getRelativePosition","parseVisibleItems","handler","metadata","jlen","getIntersectItems","getNearestItems","intersect","distanceMetric","minDistance","POSITIVE_INFINITY","nearestItems","getDistanceMetricForAxis","useX","useY","pt1","pt2","deltaX","deltaY","indexMode","items","core_interaction","modes","single","x-axis","nearest","intersectsItem","filterByPosition","pos","sortByWeight","getCombinedMax","maxPadding","updateDims","layout","newWidth","newHeight","box","getPadding","boxPadding","outerWidth","outerHeight","getMargins","marginForPositions","positions","margin","fitBoxes","boxes","refit","changed","refitBoxes","fullWidth","placeBoxes","userPadding","core_layouts","addBox","_layers","removeBox","layoutItem","configure","layoutOptions","availableWidth","availableHeight","layoutBoxes","wrapBoxes","leftAndTop","rightAndBottom","vertical","buildLayoutBoxes","verticalBoxes","horizontalBoxes","vBoxMaxWidth","hBoxMaxHeight","layouts","setLayoutDims","updatePos","change","handleMaxPadding","stylesheet","__proto__","default","CSS_SIZE_MONITOR","CSS_PREFIX","CSS_RENDER_MONITOR","ANIMATION_START_EVENTS","EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","readUsedSize","property","eventListenerOptions","supports","addEventListener","passive","addListener","removeListener","removeEventListener","createEvent","nativeEvent","native","createDiv","cls","addResizeListener","ticking","expando","EXPANDO_KEY","resizer","maxSize","expand","shrink","_reset","scrollLeft","onScroll","bind","createResizer","maintainAspectRatio","parentNode","clientWidth","proxy","renderProxy","animationName","reflow","classList","watchForRender","insertBefore","firstChild","removeResizeListener","unwatchForRender","removeChild","platform_dom$2","disableCSSInjection","_enabled","_ensureLoaded","root","getRootNode","rootNode","containsStyles","injectCSS","acquireContext","renderHeight","getAttribute","renderWidth","displayWidth","aspectRatio","displayHeight","initCanvas","releaseContext","removeAttribute","proxies","fromNativeEvent","addEvent","removeEvent","implementation","platform","plugins","core_plugins","_plugins","_cacheId","plugin","unregister","idx","hook","descriptors","$plugins","_invalidate","core_scaleService","constructors","registerScaleType","scaleConstructor","scaleDefaults","getScaleConstructor","getScaleDefaults","updateScaleDefaults","additions","addScalesToLayout","valueOrDefault$8","getRtlHelper","enabled","titleFontStyle","titleSpacing","titleMarginBottom","titleFontColor","titleAlign","bodySpacing","bodyFontColor","bodyAlign","footerFontStyle","footerSpacing","footerMarginTop","footerFontColor","footerAlign","yPadding","xPadding","caretPadding","caretSize","multiKeyBackground","displayColors","beforeTitle","tooltipItems","labelCount","afterTitle","beforeBody","beforeLabel","labelColor","labelTextColor","afterLabel","afterBody","beforeFooter","footer","afterFooter","positioners","average","eventPosition","nearestElement","d","distanceBetweenPoints","tp","pushOrConcat","toPush","splitNewlines","String","createTooltipItem","indexScale","valueScale","getLabelForIndex","getBaseModel","tooltipOpts","xAlign","yAlign","textDirection","_bodyFontFamily","bodyFontFamily","_bodyFontStyle","bodyFontStyle","_bodyAlign","bodyFontSize","_titleFontFamily","titleFontFamily","_titleFontStyle","titleFontSize","_titleAlign","_footerFontFamily","footerFontFamily","_footerFontStyle","footerFontSize","_footerAlign","legendColorBackground","getAlignedX","getBeforeAfterBodyLines","exports$4","_lastActive","getTitle","lines","getBeforeBody","getBody","bodyItems","bodyItem","getAfterBody","getFooter","existingModel","active","_active","alignment","backgroundPoint","tooltipSize","caretX","caretY","labelColors","labelTextColors","_eventPosition","itemSort","dataPoints","combinedBodyLength","titleLineCount","footerLineCount","widthPadding","maxLineWidth","fontString","getTooltipSize","paddingAndSize","radiusAndPadding","getBackgroundPoint","lf","rf","olf","orf","yf","midX","midY","determineAlignment","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","tmp","drawTitle","rtlHelper","drawBody","textColor","drawColorBoxes","xLinePadding","colorX","fillLineOfText","bodyAlignForCalculation","rtlColorX","strokeRect","drawFooter","drawBackground","quadraticCurveTo","hasTooltipContent","globalAlpha","handleEvent","getElementsAtEventForMode","positioners_1","core_tooltip","valueOrDefault$9","mergeScaleConfig","slen","mergeConfig","updateConfig","newOptions","ensureScalesHaveIDs","buildOrUpdateScales","nextAvailableScaleId","axesOpts","prefix","hasId","positionIsHorizontal","compare2Level","l1","l2","events","onHover","animationDuration","responsiveAnimationDuration","construct","initConfig","_bufferedRender","instances","retinaScale","devicePixelRatio","initToolTip","stop","silent","getMaximumWidth","getMaximumHeight","newSize","onResize","scalesOptions","scaleOptions","xAxisOptions","yAxisOptions","updated","dtype","dposition","isDefault","scaleType","scaleClass","mergeTicksOptions","hasUpdated","buildOrUpdateControllers","newControllers","destroyDatasetMeta","order","ControllerClass","resetElements","updateLayout","updateDatasets","lastActive","_bufferedRequest","_idx","updateDataset","animationOptions","animationObject","easingFunction","stepDecimal","layers","drawDatasets","_drawTooltip","_getSortedDatasetMetas","filterVisible","drawDataset","getElementAtEvent","getElementsAtEvent","getElementsAtXAxis","getDatasetAtEvent","_meta","unbindEvents","toBase64Image","toDataURL","_chartInstance","_listeners","eventHandler","updateHoverStyle","bufferedRequest","core_controller","DateAdapter","Controller","configMerge","scaleMerge","formats","format","startOf","endOf","_create","override","members","core_adapters","_date","core_ticks","formatters","tickValue","logDelta","tickString","logTick","numExponential","toExponential","numDecimal","logarithmic","remain","valueOrDefault$a","getPixelForGridLine","validIndex","lineValue","computeLabelSizes","tickFonts","caches","tickFont","nestedLabel","widest","highest","widths","heights","offsets","major","minor","gc","valueAt","gcLen","garbageCollect","first","getTickMarkLength","drawTicks","tickMarkLength","getScaleLabelHeight","parseFontOptions","nestedOpts","fontColor","parseTickFontOptions","nonSkipped","ticksToFilter","filtered","spacing","majorStart","majorEnd","tick","ceil","drawOnChartArea","zeroLineWidth","zeroLineColor","zeroLineBorderDash","zeroLineBorderDashOffset","scaleLabel","labelString","minRotation","maxRotation","mirror","autoSkip","autoSkipPadding","labelOffset","Scale","zeroLineIndex","paddingLeft","paddingTop","paddingRight","paddingBottom","_ticks","_getLabels","xLabels","yLabels","beforeUpdate","margins","samplingEnabled","sampleSize","_labelSizes","_maxLabelLines","longestLabelWidth","longestTextCache","_gridLineItems","_labelItems","beforeSetDimensions","setDimensions","afterSetDimensions","beforeDataLimits","determineDataLimits","afterDataLimits","beforeBuildTicks","buildTicks","afterBuildTicks","_convertTicksToLabels","numItems","increment","sample","beforeCalculateTickRotation","calculateTickRotation","afterCalculateTickRotation","beforeFit","fit","afterFit","_ticksToDraw","_autoSkip","afterUpdate","startPixel","endPixel","reversePixels","_reversePixels","beforeTickToLabelConversion","convertTicksToLabels","userCallback","afterTickToLabelConversion","labelSizes","maxLabelWidth","maxLabelHeight","tickWidth","maxLabelDiagonal","numTicks","labelRotation","_isVisible","_getLabelSizes","toDegrees","scaleLabelOpts","gridLineOpts","isBottom","firstLabelSize","lastLabelSize","widestLabelSize","highestLabelSize","lineSpace","tickPadding","isRotated","angleRadians","toRadians","cosRotation","sinRotation","labelHeight","offsetLeft","offsetRight","labelWidth","handleMargins","isFullWidth","rawValue","_getScaleLabel","getValueForPixel","decimal","getDecimalForPixel","pixel","getBaseValue","avgMajorSpacing","axisLength","ticksLimit","maxTicksLimit","_tickSize","majorIndices","getMajorIndices","numMajorIndices","skipMajors","factors","factor","evenMajorSpacing","getEvenSpacing","calculateSpacing","optionTicks","rot","_computeGridLineItems","borderValue","alignedLineValue","tx1","ty1","tx2","ty2","lineColor","ticksLength","tl","axisWidth","axisHalfWidth","alignPixel","_alignPixel","alignBorderValue","_computeLabelItems","lineCount","textOffset","isMirrored","fonts","_drawGrid","firstLineWidth","lastLineWidth","_drawLabels","_drawTitle","scaleLabelX","scaleLabelY","scaleLabelFontColor","scaleLabelFont","scaleLabelPadding","halfLineHeight","isLeft","tz","gz","_draw","core_scale","isNullOrUndef$1","scale_category","ticksOpts","minIndex","maxIndex","_startValue","_valueRange","valueCategory","_defaults","isNullOrUndef$2","scale_linearbase","handleTickRangeOptions","minSign","sign","maxSign","setMin","suggestedMin","setMax","suggestedMax","getTickLimit","maxTicks","stepSize","_computeTickLimit","handleDirectionalChanges","numericGeneratorOptions","precision","fixedStepSize","generationOptions","dataRange","niceMin","niceMax","numSpaces","unit","maxNumSpaces","rmin","rmax","niceNum","_decimalPlaces","almostWhole","almostEquals","generateTicks","ticksAsNumbers","_endValue","defaultConfig$1","stackData","neg","getOrCreateStack","relativePoints","updateMinMax","scale_linear","hasStacks","NEGATIVE_INFINITY","stackValues","_defaults$1","valueOrDefault$b","defaultConfig$2","nonNegativeOrDefault","scale_logarithmic","IDMatches","minNotZero","valuesPerStack","valuesForType","minVal","maxVal","exp","significand","tickVal","endExp","endSignificand","lastTick","generateTicks$1","tickValues","_getFirstTickValue","_valueOffset","_defaults$2","valueOrDefault$c","valueAtIndexOrDefault$1","resolve$4","defaultConfig$3","showLabelBackdrop","backdropColor","backdropPaddingY","backdropPaddingX","getTickBackdropHeight","determineLimits","getTextAlignForAngle","adjustPointPositionForLabelHeight","textSize","numberOrZero","param","scale_radialLinear","drawingArea","plFont","furthestLimits","furthestAngles","_pointLabelSizes","valueCount","getPointPosition","longestText","getIndexAngle","hLimits","vLimits","setReductions","fitWithPointLabels","setCenterPoint","largestPossibleRadius","radiusReductionLeft","radiusReductionRight","radiusReductionTop","radiusReductionBottom","leftMovement","rightMovement","topMovement","bottomMovement","maxRight","maxLeft","maxTop","maxBottom","scalingFactor","distanceFromCenter","thisAngle","getBasePosition","angleLineOpts","pointLabelOpts","tickBackdropHeight","outerDistance","extra","pointLabelPosition","pointLabelFontColor","drawPointLabels","drawRadiusLine","tickFontColor","_defaults$3","deprecated$1","resolve$5","valueOrDefault$d","MIN_INTEGER","MIN_SAFE_INTEGER","MAX_INTEGER","MAX_SAFE_INTEGER","INTERVALS","millisecond","steps","second","minute","hour","day","week","month","quarter","year","UNITS","sorter","getMin","time","getMax","interpolate$1","table","skey","tkey","mid","i0","i1","lo","lookup","span","toTimestamp","input","adapter","_adapter","parser","determineUnitForAutoTicks","minUnit","capacity","interval","ticksFromTimestamps","majorUnit","setMajorTicks","scale_time","adapters","displayFormats","labelsAdded","timestamps","dataLabels","out","arrayUnique","_table","_timestamps","timeOpts","getLabelCapacity","distribution","unitStepSize","weekday","isoWeekday","generate","_unit","determineUnitForFormatting","_majorUnit","determineMajorUnit","buildLookupTable","_offsets","computeOffsets","tooltipFormat","datetime","tickFormatFunction","minorFormat","majorFormat","nestedTickOpts","formatter","getPixelForOffset","_getLabelSize","tickLabelWidth","tickFontSize","getLabelWidth","exampleTime","exampleLabel","_defaults$4","displayFormat","category","radialLinear","FORMATS","_id","amount","filler","propagate","mappers","boundary","decodeFill","computeBoundary","cx","cy","computeCircularBoundary","scaleBottom","scaleTop","scaleZero","computeLinearBoundary","resolveTarget","visited","visible","createMapper","isDrawable","drawArea","curve0","curve1","len0","len1","doFill","mapper","loop","p0","p1","d0","d1","loopOffset","plugin_filler","afterDatasetsUpdate","$filler","beforeDatasetsDraw","getRtlHelper$1","noop$1","valueOrDefault$e","getBoxWidth","labelOpts","usePointStyle","boxWidth","ci","onLeave","lineDash","Legend","legendHitBoxes","_hoveredItem","doughnutMode","beforeBuildLabels","buildLabels","afterBuildLabels","legendItems","labelFont","hitboxes","lineWidths","totalHeight","vPadding","columnWidths","columnHeights","totalWidth","currentColWidth","currentColHeight","lineDefault","legendHeight","legendWidth","cursor","alignmentOffset","dimension","blockSize","itemHeight","textWidth","realX","SQRT2","drawLegendBox","halfFontSize","xLeft","yMiddle","_getLegendItemAt","hitBox","lh","hoveredItem","createNewLegendAndAttach","legendOpts","plugin_legend","_element","beforeInit","afterEvent","noop$2","Title","titleX","titleY","fontOpts","createNewTitleBlockAndAttach","titleOpts","titleBlock","parseMaxStyle","styleValue","parentProperty","valueInPixels","isConstrainedValue","getConstraintDimension","domNode","maxStyle","percentageProperty","defaultView","_getParentNode","constrainedNode","constrainedContainer","hasCNode","hasCContainer","infinity","collection","filterCallback","findNextWhere","arrayToSearch","startIndex","currentItem","rounded","radians","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","radialDistanceFromCenter","aliasPixel","pixelWidth","currentDevicePixelRatio","halfWidth","firstPoint","middlePoint","afterPoint","d01","d12","s01","s12","fa","fb","EPSILON","pointBefore","pointCurrent","pointAfter","alphaK","betaK","tauK","squaredMagnitude","pointsWithTangents","deltaK","mK","pointsLen","slopeDeltaX","fraction","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","originalEvent","srcElement","boundingRect","touches","clientX","clientY","getConstraintWidth","getConstraintHeight","_calculatePadding","parentDimension","cw","ch","currentStyle","forceRatio","pixelRatio","pixelSize","arrayOfThings","thing","nestedThing","longest","numberOfLabelLines","numberOfLines","CanvasGradient","colorValue","CanvasPattern","core_helpers","_adapters","Animation","animationService","Interaction","scaleService","Ticks","Tooltip","pluginService","PluginBase","canvasHelpers","layoutService","LinearScaleBase","klass","cfg","define","amd","multiTooltipTemplate","colors","useExcanvas","G_vmlCanvasManager","initElement","ChartJs","getOptions","typeOptions","setOptions","customOptions","chartGetColor","chartType","chartData","chartLabels","chartOptions","chartSeries","chartColors","chartClick","chartHover","chartDatasetOverride","watchOther","isEmpty","createChart","destroyChart","every","sum","canUpdateChart","updateChart","getChartOptions","hasData","canDisplay","cvs","getRandomColor","getChartColorFn","notEnoughColors","convertColor","getColors","series","datasetOverride","getDataSets","pointBackgroundColor","getData","getChartData","onclick","getEventHandler","onmousemove","carry","triggerOnlyOnChange","lastState","atEvent","getPointAtEvent","atEvents","getColor","rgbStringToRgb","bigint","getRandomInt","pointHoverBackgroundColor","pointBorderColor","pointHoverBorderColor","random","ChartJsFactory","beforeDraw","screen","deviceXDPI","logicalXDPI","utils","toTextLines","parseFont","bound","arrayDiff","updates","rasterize","orient","x0","y0","dx","dy","ln","region","compute","anchor","segment","clamp","r0","r1","clipped","vx","vy","aligned","rx","ry","sx","sy","getScaleOrigin","getPositioner","drawTextLine","shadow","shadowBlur","stroked","strokeText","filled","Label","_rects","_ctx","_el","_modelize","borderRadius","positioner","textShadowBlur","textShadowColor","textStrokeColor","textStrokeWidth","th","tw","tx","ty","frame","geometry","bgColor","drawFrame","textGeometry","shadowColor","drawText","helpers$2","rotated","projected","dp","toAxis","HitBox","_rotation","_rect","coordinates","vs","intersects","other","pr0","pr1","_points","axes","prepare","$layout","_box","_hidable","_visible","sa","sb","dirty","collider","s0","s1","collide","h0","h1","compute$1","helpers$3","helpers$4","DEFAULT_KEY","dispatchEvent","$context","groups","$groups","_key","_dirty","handleMoveEvents","enter","leave","_labels","_hovered","dispatchMoveEvents","datalabels","_actives","_listened","_datasets","afterDatasetUpdate","afterDatasetsDraw","beforeEvent","click","handleClickEvents","actives","invalidate","ChartDataLabels","afterInit","_chart$options$plugin","vhEvents","_chart$options$plugin2","_ref2","alias","progress","autoUpload","removeAfterUpload","formData","queueLimit","MAX_VALUE","withCredentials","fileUploaderOptions","$http","FileUploader","settings","isUploading","_nextIndex","_failFilterIndex","_directives","drop","over","_queueLimitFilter","_folderFilter","FileLikeObject","fileOrInput","fakePathOrObject","isElement","FileItem","uploader","some","isInput","file","isReady","isUploaded","isSuccess","isCancel","isError","_file","_input","_replaceNode","FileDirective","_saveLinks","FileSelect","super_","isHTML5","removeAttr","FileDrop","FileOver","File","FormData","addToQueue","files","isArrayLikeObject","arrayOfFilters","_getFilters","addedFileItems","temp","_isValidFile","fileItem","_onAfterAddingFile","_onWhenAddingFileFailed","_onAfterAddingAll","_getTotalProgress","_render","uploadAll","removeFromQueue","getIndexOfItem","cancel","_destroy","clearQueue","uploadItem","transport","_prepareToUploading","cancelItem","abort","getNotUploadedItems","upload","cancelAll","isFile","isFileLikeObject","getReadyItems","item1","item2","onAfterAddingAll","fileItems","onAfterAddingFile","onWhenAddingFileFailed","onBeforeUploadItem","onProgressItem","onProgressAll","onSuccessItem","onErrorItem","onCancelItem","onCompleteItem","onCompleteAll","notUploaded","uploaded","isUndefined","names","$$phase","$apply","_isSuccessCode","_transformResponse","headersGetter","_headersGetter","transformResponse","transformFn","_parseHeaders","parsed","trim","parsedHeaders","_xhrTransport","xhr","_xhr","XMLHttpRequest","that","_onBeforeUploadItem","onprogress","lengthComputable","loaded","_onProgressItem","onload","getAllResponseHeaders","gist","_onCompleteItem","onerror","_onErrorItem","onabort","_onCancelItem","setRequestHeader","send","_iframeTransport","iframe","_form","replaceWith","enctype","encoding","contentDocument","reg","message","test","dummy","_onSuccessItem","unbind","submit","_onBeforeUpload","_onProgress","_onSuccess","_onError","_onCancel","_onComplete","create","_createFromFakePath","lastModifiedDate","lastIndexOf","_createFromObject","onBeforeUpload","onError","onCancel","getFilters","isEmptyAfterSelection","onChange","dragover","dragleave","onDrop","transfer","_getTransfer","_preventAndStop","_removeOverClass","onDragOver","_haveFiles","dropEffect","_addOverClass","onDragLeave","currentTarget","dataTransfer","stopPropagation","addOverClass","removeOverClass","overClass","getOverClass","attributes","bindHtmlCompile","compileScope","bindHtmlScope","contents","card","localCard","stringify","allContents","CardContents","cardContents","LanguageId","Subtitle","subtitle","Units","Information","information","Icon","icon","CardStatusId","cardStatusId","getHeroColor","_slicedToArray","_arrayWithHoles","_i","_s","_e","_arr","_n","_d","done","err","_iterableToArrayLimit","minLen","_arrayLikeToArray","_unsupportedIterableToArray","_nonIterableRest","arr2","cards","languages","CardsService","localVm","userCanReadCard","userCanWriteCard","cardIndex","hideCard","showAdd","showEdit","showCopy","ruleform","formScope","querySelector","entries","sortCards","population","loadCards","Promise","getCards","getLanguages","newCards","Populations","PopulationName","setupCard","CardId","onCardChanged","cardColor","_","CardUId","coachcard","$setDirty","language","LanguageName","addCard","showCardModal","editCard","copyCard","isCopy","saveCards","editedCard","selectedContents","CCOWDirective","DirtyPage","isIE11","rv","navigator","appName","ua","userAgent","exec","$1","CCOWEnabled","enableCcow","contextItems","dirtyObjects","findDirtyCheckers","SetSurveyResponse","unregisterAllDirtyCheckers","contextPatientChange","ccowEnabled","currentPortalPatient","MRNIdent","PatientId","joinContext","contextorControl","Resume","Run","newIdentifier","getPatientIdentifierFromVault","CurrentContext","coll","Enumerator","atEnd","moveNext","itemName","itemValue","CCOWPatientIdentifier","addContextorItem","contextorItems","ActiveXObject","Add","isCcowEnabled","identifier","mrnIdent","patientIdent","lastName","firstName","gender","ContextorControl","StartContextChange","EndContextChange","Suspend","contextorState","hasDirtyCheckers","verify","DownloadFileDirective","download","responseType","URL","revokeObjectURL","Blob","fileName","msSaveBlob","createObjectURL","downloadURL","DownloadTextDirective","fileText","textFile","setFileName","cleanFileName","mimeType","fullFileName","clickedDownload","changeEvent","reader","FileReader","loadEvent","sanitizer","$setViewValue","fileType","readAsDataURL","readAsText","long","short","age","ageFormat","ageString","charIndex","fromCharCode","letterObj","letter","computeLetterMap","retval","DateInStringFilter","dateFormat","DateFormat","DatetimeFilter","utc","isSame","DatetimeTimeZoneFilter","patientTimeZone","caregiverTimeZone","AndroidID","Abbreviation","mi","statusId","seconds","setSeconds","TelephoneFilter","tel","components","formattedNumber","libphonenumber","phoneUtil","PhoneNumberUtil","getInstance","bcCountries","supportedCountries","SupportedCountries","countryIso2","getIso2CodeByDigits","dialCode","getDialCodeByDigits","numberWithoutDialCode","phoneNumber","parseAndKeepRawInput","isValidRegion","isValidNumberForRegion","isValidNumber","DefaultCountry","PhoneNumberFormat","NATIONAL","INTERNATIONAL","phone","ALPHA_REGEX","ngModelCtrl","$validators","alphaOnly","$isEmpty","CheckIfDirtyDirective","formCtrl","dirtyListener","onDirty","dirtyCheckerName","$name","registerDirtyChecker","$dirty","unregisterDirtyChecker","stateChangeListener","checkers","checker","onStateChange","toParams","any","dirtyCheckers","router","stateService","onBeforeUnload","returnValue","unregisterListeners","onStart","VhDatePicker","datePickerModel","dateChanged","required","readonly","datepickerOptions","selfCtrl","datePickerName","datePickerOptions","showWeeks","showButtonBar","businessDaysOnly","datepickerNgModelCtrl","businessDays","modelValue","getDay","clickedCalendar","isOpen","modelChanged","$valid","closeCalendar","tabAway","DateFormatDirective","keyCode","FormBarDirective","onSave","showSave","disableSave","showTest","saveText","saveClass","saving","hasCancel","disable","when","NAME_REGEX","converters","int","bool","ngModelController","formatType","selectFormat","converter","$parsers","$formatters","Telephone","$filter","telephone","stripped","viewVal","defer","ZIP_REGEX","zipCode","ImageSelectionController","$uibModalInstance","imgvm","ok","submitted","image","filesize","validationError","dismiss","InfiniteScrollDirective","limit","totalItems","func","wait","totalItemsWatch","changeLimits","viewableHeight","_construct","Parent","Class","_isNativeReflectConstruct","Function","_setPrototypeOf","sham","Boolean","setPrototypeOf","includes","LockStatusIconDirective","confirm","lockPermission","showInherited","hideLabel","itemText","postText","toggleLabel","labelStyle","toggleStyle","colorTemplate","controllerAs","LockStatusIconController","contentLock","changeHandler","locking","lockStatusEnum","locked","userCanLock","lockStatusTooltip","lockStatusText","textMuted","stopImmediatePropagation","modalConfirm","showCancelButton","cancelButtonText","confirmButtonText","_toggle","SurveyQuestions","__setLockStatusOnChildQuestions","ChildQuestions","childQuestion","MaxLengthDisplayDirective","maxLength","showWarnings","warningLimit","MaxLengthDisplayController","warning","danger","charactersLeft","mentioUtil","macros","typedTerm","altId","iframeElement","requireLeadingSpace","selectNotFound","trimTerm","query","triggerChar","triggerText","remoteScope","triggerCharMap","showMenu","term","defaultSearch","results","localItems","bridgeSearch","termString","mentioSearch","defaultSelect","defaultTriggerChar","bridgeSelect","itemVar","mentioSelect","setTriggerText","syncTriggerText","replaceText","hasTrailingSpace","hideAll","replaceTriggerText","targetElement","targetElementPath","targetElementSelectedOffset","triggerCharSet","triggerHandler","isContentEditable","contentEditableMenuPasted","hideMenu","getActiveMenuScope","selectActive","isActive","replaceMacro","macro","replaceMacroText","replacingMacro","addMenu","menuScope","parentScope","setParent","mentioId","activeMenuScope","which","activateNextItem","adjustScroll","activatePreviousItem","mentioItems","itemsRef","mentioTriggerChar","mentioTemplateUrl","linkFn","keyHandler","stopEvent","mentioTypedTerm","iframeDocument","contentWindow","mentionInfo","getTriggerInfo","mentionTriggerChar","currentMentionTriggerChar","mentionPosition","currentMentionPosition","mentionSelectedElement","mentionSelectedPath","mentionSelectedOffset","mentionText","currentTypedTerm","macroMatchInfo","getMacroMatch","macroSelectedElement","macroSelectedPath","macroSelectedOffset","macroText","macroHasTrailingSpace","lastScope","forElem","activate","activeItem","parentMentio","isFirstItemActive","isLastItemActive","requestVisiblePendingSearch","menuElement","$broadcast","popUnderMention","menuEl","menuItemsList","menuItem","scrollHeight","offsetHeight","matchItem","hightlightClass","$anchorScroll","scrollIntoView","clientRect","childNodes","elemTop","elemBottom","targetY","selectedElementIsTextAreaOrInput","getDocument","activeElement","selectElement","nextSibling","previousSibling","sel","getWindowSelection","createRange","setStart","setEnd","collapse","removeAllRanges","addRange","pasteHtml","startPos","endPos","anchorNode","deleteContents","lastNode","frag","createDocumentFragment","insertNode","cloneRange","setStartAfter","resetSelection","getNodePositionInParent","selectionInfo","getContentEditableSelectedPath","effectiveRange","getTextPrecedingCurrentSelection","matchInfo","prevCharPos","macroPosition","ce","contentEditable","getRangeAt","startOffset","menuAlreadyActive","mostRecentTriggerCharPos","currentTriggerSnippet","firstSnippetChar","leadingSpace","getSelection","textComponent","selectionStart","selectedElem","workingNodeContent","textContent","selectStartOffset","getContentEditableCaretPosition","selectedNodePosition","markerEl","markerId","prevRange","localToGlobalCoordinates","getTextAreaOrInputUnderlinePosition","isFirefox","mozInnerScreenX","div","computed","whiteSpace","wordWrap","visibility","overflowY","overflow","borderTopWidth","borderLeftWidth","selectionEl","zIndex","selectionEnd","myField","mediaQuery","stickyClass","bodyClass","$body","doc","initialCSS","isSticking","stickyLine","prevOffset","matchMedia","fudge","marginTop","cssLeft","offsetWidth","checkIfShouldStick","parentElement","initialOffsetWidth","shouldStick","clientTop","absoluteLeft","stickElement","initialStyle","unstickElement","_getTopOffset","flat","acc","isInteger","toObject","roundToHour","addDays","days","addHours","hours","setTime","addMinutes","minutes","addSeconds","addMilliseconds","milliseconds","removeTime","toDateString","_defineProperty","ServiceNowController","_arguments","ServiceNowService","email","memberId","attachments","submitting","minimized","caseNumber","max_attachment_count","max_count_reached","fileInputAccept","serviceNow","$setPristine","$getControls","$setUntouched","$setTouched","$invalid","handleFiles","$index","extension","file_name","_toConsumableArray","_arrayWithoutHoles","iter","_iterableToArray","_nonIterableSpread","ServiceNowDirective","uploadDrop","highlight","unhighlight","preventDefaults","fileChangeHandler","fileElement","allowedFileTypes","endsWith","repeat","file_content","newAttachment","testSize","handleFileChange","eventName","asyncGeneratorStep","gen","_next","_throw","arg","_asyncToGenerator","ServiceNowRequest","kit_id","member_id","load","_this$$stateParams$pa","regeneratorRuntime","mark","_callee","kit","wrap","_context","KitNo","_x2","_submit","_load","_callee2","_this$name","_this$email","_context2","DisplayName","Email","sent","ServiceNowUrl","newFile","_this$name2","_this$email2","_this$kitId","_this$memberId","_this$description","_this$attachments","encodeURIComponent","max_request_size","_callee4","_this$name3","_this$email3","_this$kitId2","_this$memberId2","_this$description2","_this$attachments2","_context4","_callee3","_yield$_this2$$http$p","errorMessage","_context3","post","t0","Success","Case_Number","service","bake","cookie","toJson","taste","fromJson","rawTaste","crumble","LocalStorageService","store","localStorage","removeItem","TimeLogSessionAutoService","$interval","TimeLogSessionService","patientTimeLogTimeout","patientTimeLogWarningTimeout","timeLogInactivityTimer","inactivityStartTime","isIdleCalled","idleDefer","dateTime1","dateTime2","totalSeconds","currentTime","timeDiff","warningDuration","Stop","remainingDuration","remainingSeconds","getTimeLogConfiguration","Timeout","Warning","restart","isPaused","timeLogParameters","toggleClock","toggle","selectCareManagementType","careManagementType","setCareManagementType","session","clock","clinical","cumulative","TimeLogSessionTimerService","TimeLogSessionVideoService","isPausing","showTimeLog","isInVideoCall","isToggled","isIdle","isIdlePromptOpen","resumeTimerService","timerType","resume","logTimes","setClocks","stopService","startAutoService","swal","timerTypes","auto","warningInitialized","isAutoPaused","pause","reason","updateIdleWarning","checkVideoCall","timeLogSession","videoCallEnded","isCallEnded","getTimeLogSession","getClock","timeDifference","invalidParams","requiredParams","hasRequiredParams","hasValidParams","hasInvalidParams","currentSession","newPatient","setAction","initValues","currentCareManagementType","saveTimeLogSession","getTimeLogEnabled","isEnabled","refreshCareManagementTypes","eventNames","registerVideoEvents","manualStart","manualStop","startVideoCall","repository","enableTimeLog","timeLogRepo","getNewTimeLog","SessionIdent","uuid","Action","StartTime_UTC","StartTimeLogTypeId","StopTime_UTC","StopTimeLogTypeId","CareManagementTypeId","addTimeLog","timeLog","getPatientTimeLogSummary","sessionIdent","getIsMostRecentCallEnded","TimeLogEnabled","pauseDateTime","initialCumulative","initialClinical","initDateTime","sessionOffset","cumulativeOffset","clinicalOffset","caregiverShownInTimeLog","timeLogTimerPromise","cumulativeTime","clinicalTime","currentDateTime","getTimeDifference","isClinicalUser","updateTimeLogModels","IsClinical","commit","TimerTypes","pageLoad","pageClose","IsShownInTimeLog","timeLogSummary","TotalSeconds","SessionSeconds","ClinicalSeconds","CareManagementTypes","cmt","IsClinicalTimeMeasured","LastUsedCareManagementTypeId","stopTypeId","startTypeId","pauseTime","resumeTime","checkInterval","callEnded","videoCallPromise","UiSelectFocus","uiSelect","uiSelectFocus","setFocus","uiSelectOn","treeClass","emptyTreeClass","dropzoneClass","hiddenClass","nodesClass","nodeClass","handleClass","placeholderClass","dragClass","dragThreshold","defaultCollapsed","appendChildOnHover","$element","$nodeScope","$type","countSubTreeDepth","childDepth","thisLevelDepth","$modelValue","$parentNodeScope","$childNodesScope","$parentNodesScope","$treeScope","$handleScope","$$allowNodeDrop","collapsed","expandOnHover","init","controllersArr","treeNodesCtrl","initSubNode","destroySubNode","dragEnabled","isSibling","targetNode","isChild","nodes","siblings","childNodesCount","hasChild","accept","sourceNode","destIndex","removeNode","$callbacks","maxSubDepth","$nodesMap","nodropEnabled","maxDepth","cloneEnabled","subNode","$$hashKey","beforeDrag","isParent","removed","nodeData","outOfDepth","$nodesScope","$emptyElm","$dropzoneElm","emptyPlaceholderEnabled","dragDelay","dropzoneEnabled","place","placeElm","resetEmptyElement","resetDropzoneElement","treeConfig","tdElm","$trElm","emptyElmColspan","sourceNodeScope","destNodesScope","expandTimeoutStart","expandTimeoutCancel","expandTimeoutEnd","dropped","dragStart","dragMove","dragStop","beforeDrop","uiTree","treeNodeCtrl","UiTreeHelper","firstMoving","dragInfo","hiddenPlaceElm","dragElm","scrollContainerElm","unhover","document_height","document_width","dragEnd","dragStartEvent","dragMoveEvent","dragEndEvent","dragCancelEvent","bindDragStartEvents","bindDragMoveEvents","unbindDragMoveEvents","keydownHandler","isHandleChild","isUiTreeRoot","treeOfOrigin","hasTouch","treeScope","getNodeAttribute","scrollContainer","sourceOnly","setNodeAttribute","button","uiTreeDragging","cloneElm","eventElmTagName","eventObj","hStyle","isTreeNode","isTreeNodeHandle","eventElm","treeNodeHandlerContainerOfElement","elementIsTreeNode","elementIsTreeNodeHandle","elementContainsTreeNodeHandler","nodrag","$id","positionStarted","isClone","pageX","pageY","placeholder","dragging","eventArgs","scrollWidth","leftElmPos","topElmPos","top_scroll","bottom_scroll","scrollContainerElmRect","targetX","displayElm","targetElm","scrollDownBy","scrollUpBy","targetOffset","targetBefore","targetBeforeBuffer","targetHeight","targetChildElm","isDropzone","selection","empty","scrollBy","positionMoved","pageXOffset","clientLeft","hide","elementFromPoint","elementIsTree","elementIsTreeNodes","elementIsPlaceholder","elementIsDropzone","dirAx","distX","expandTimeoutOn","expandTimeout","dragEventArgs","allowDrop","oldCur","treeCtrl","nodesData","attrName","targetTouches","sourceInfo","cloneModel","nodeScope","nodesScope","resetParent","clonedNode","isDirty","isForeign","dest","boundingClientRect","lastX","lastY","nowX","nowY","distY","dirX","dirY","lastDirX","lastDirY","distAxX","distAxY","newAx","moving","querySelectorAll","attributeName","childObj","testObj","hasAttribute","findFirstParentElementWithAttribute","CaregiverMenuService","loadCaregiverInfo","caregiverImage","Photo","Gender","setPhoto","showProfileLink","logout","logoutUrl","gotoProfile","caregiverRepo","vhExportDirective","itemType","ids","singleId","exporting","filename","vhExportDirectiveIcon","urls","rule","tiles","program","vhExportController","exported","_fileName","_getFileObject","headersFn","headerContentDisposition","disposition","_extractFileName","contentType","_promise","blob","notifications","pluralize","word","success","ex","existingItem","programs","expandAll","collapseAll","removeCard","cardUId","removedSuccess","removeMsg","getProgramDisplay","populationUId","programUId","programName","missing","missingObjects","ScheduleService","removePathway","surveyTemplateUId","_toAntiCamel","newO","origKey","newKey","getMilestones","milestones","getGetMilestoneName","milestoneId","MilestoneId","_toggleClass","getProgramPauseSetting","programPauseSetting","globalProgramPauseSetting","removeProgram","defaultHours","OverdueAlertHours","EnableOverDueAlerts","globalAlerts","globalMessaging","isHealthTip","healthTipQuestions","removeHealthTip","ContainsKeyValue","pathways","healthTips","question","surveyQuestionUId","index2","surveyQuestionType","getOptionHtml","questionType","optionTexts","getQuestionText","surveyQuestionTypeId","questionTexts","import","surveyStatuses","patientStatuses","cardTypes","rules","removeRule","ruleUId","existingItems","videos","removeTile","resourceLibraryCategoryUId","videoUId","removeVideo","getLanguageName","languageId","getThumbnail","thumbnails","getURL","ImportControllerFactory","ImportExportModel","entity","cdnThumbnailUrl","thumbnailData","exportedBy","ExportedBy","exportedFrom","ExportedFrom","exportedDateTime_UTC","ExportedDateTime_UTC","Cards","overwrite","questions","Questions","Videos","Tiles","HealthTips","Rules","Pathways","Programs","Card","cardId","videoFiles","importTypes","surveyQuestion","libraryTile","ImportController","ResourceLibraryService","ResponseTransformers","sectionSort","errors","showSelectFile","showInvalidFile","showFileData","eventTypes","actionTypes","modal","loading","contentRemoved","existing","getValidationData","missingData","fileUploader","getFileUploader","handleFileSelect","opened","_this3","_this4","uploading","localData","getImport","promises","itemTypeIs","importCards","importVideos","importQuestionCategories","importHealthTips","importResourceLibraryCategories","importRules","importPrograms","_this5","_toCamel","missingUIds","missingVideos","Set","GetAllEnabled","getSQLCommands","sqlCommands","conditionCount","ruleConditions","actions","condition","actionCount","actionDescription","actionName","actionData","pathway","pathwayName","TemplateUId","SurveyStatusId","AlertText","DisplayText","RuleSQLCommandUId","StatusId","CardTypeId","SurveyVideoUId","healthTipQuestion","HealthTipUId","LibraryCategoryUId","Subject","ManageDeviceAction","DeviceModelId","ManageTagAction","Tag","distinct","DeviceModelEnumId","DeviceName","programId","allCards","VhImportDirective","imported","alertMessage","added","vhLanguageTabsDirective","usedLanguages","onSelectionChange","displayLanguages","allLanguages","unusedLanguages","displayedIds","pluck","selectLanguage","newLanguage","selectedLanguageId","addLanguage","currentLanguage","vhListItemOptionInfo","optionSelected","isReason","isSubReason","ctrls","listOptionsController","optionContainerController","maxlength","descriptionMaxlength","optionid","saveToMedicalHistory","enableNotes","requireNotes","showDefault","hasDescription","descriptionSpacer","enabledatetimepicker","enableWriteToChart","enablewritetochart","customToggle","customToggleLabel","editableLabel","genLabel","noEnabling","showEnableNotes","showRequireNotes","showSaveToMedicalHistory","savePatientStatusPMHSlider","optionEnabledChanged","savePatientStatusEnableNotes","savePatientStatusRequireNotes","saveToMedicalHistoryBool","customAdd","selectOption","labelForm","$show","labelFilter","filteredLabel","defaultToggled","optionDefaultToggled","customSliderToggled","enabledToggled","setTimePicker","canbackdate","canBackDate","setWriteToChart","writetochart","WriteToChart","labelChanged","newLabel","optionLabelChanged","descriptionChanged","newDescription","optionDescriptionChanged","cancelEdit","vhListItemOptionsDirective","itemOptions","optionChanged","optionAdded","tabOptions","cs","parentOption","newOptionLabel","multilingual","sortable","noAdd","languageSwitchedMap","optionLanguages","selectedLanguage","ordering","orderBy","displayLanguageIds","flatten","uniq","showOptions","getDisplayLanguages","cancelAddOption","selectTab","tabId","selectedTab","subdragControlListeners","sourceItemHandleScope","destSortableScope","itemScope","sortableScope","orderChanged","oldIndex","newIndex","sortOrder","opt","clickedAddOption","addOption","addingResponse","addedName","isSelected","clicked","optionClicked","selectedOption","updateLabel","optionContainer","optionsIsOpen","optionsToggle","selectToggle","tabs","tab","bindToController","optionLabel","searchEnabled","onActionClick","customActions","dropdownWidth","inputKeydown","toggled","focusSearchInput","getSelections","isOptionSelected","addSelection","updateModel","removeSelection","removedItem","toggleOption","searchEl","addCustomAction","removeCustomAction","actionClicked","isDefaultPrevented","vhPaging","pageSizes","pageChanged","VhPhone","selectedCountry","ngDisabled","extName","extLabel","getPhoneDigits","digits","iso2Code","numberObj","countryCode","getRegionCodeForNumber","getPhoneExtension","fullNumber","isValidExtension","ext","getCountryFromNumber","getCountryByIso2Code","country","getPlaceholder","getExampleNumber","getDigits","isSupportedCountry","showPhoneIcon","allCountries","codes","preferredCountries","getCountries","displayNumber","extDisplayNumber","numberNoExt","placeholderNumber","placeholderExtension","selectCountry","$setValidity","isCountrySelected","$validate","extChanged","vhRulesParserService","throwError","unary_ops","-","!","~","+","binary_ops","||","&&","|","^","&","=","==","!=","===","!==","<",">","<=",">=","<<",">>",">>>","*","/","%","getMaxKeyLen","max_len","max_unop_len","max_binop_len","isDecimalDigit","isInArray","isSpace","chCode","parserFn","expr","charAtFunc","charCodeAtFunc","charCodeAt","nextChar","nextCharCode","isDelimiter","gobbleToken","token","gobbleSpaces","gobbleStringLiteral","quote","closed","exprI","getOperandValue","operand","variable","Variable","isDateVariable","processEquals","firstoperand","secondoperand","isDate","firstDate","secondDate","getMonth","processNotEquals","processLessThenEquals","processGreaterThenEquals","processLessThen","processGreaterThen","updateQuizValues","maxPoints","maxName","totalName","scoreName","processInitQuiz","parts","processAddPoints","processSubtractPoints","exprICode","to_check","tc_len","binaryOp","gobbleBinaryOp","gobbleNumericLiteral","gobbleVariable","isIdentifierStart","evaluate","postfixList","valueStack","irstoperand","toOrdinal","last_digits","addBPReading","systolic","diastolic","conditionValues","BPReadingCount","BPReadings","systolicTotal","diastolicTotal","BPAverage","addTag","tagValue","tags","Tags","replaceVariables","varName","varValue","toLocaleUpperCase","MultiSelectDirective","selectCtrl","currentSelectables","selectableKey","removeCurrentSelected","restict","currentSelectable","newSelected","enableTooltip","itemId","labelValue","slidervalue","disableTooltip","autosize","autosizeflag","pulsate","randMax","randIllustrated","imageStyle","backgroundImage","panelStyle","labelsStyle","sublabel","vhChartinjects","vhChartScope","selectedDate","vhChartProperties","getFullYear","watch","updateDates","viewStart","viewEnd","alerts","allowCollapse","allowAlertSelect","canWriteNotifications","canWriteAlerts","setEnabled","setPermissions","canClick","alertLevel","alertStatus","isNotification","pointRadius","alertRadius","convertBiometricInfoToDatasets","alert","alertCollapsed","fromAlertLevel","primary","VhUiBiometricGraphDirective","VhUiBiometricGraphController","argument","scopeValue","resolveChart","initializeOptions","updatePoints","beforeDatasetDrawx","pointIndex","MonitoringEventsService","onExpandCurrentGraphs","expanding","updateMargins","onBiometricsLoaded","onDisplayTypeChanged","dataType","idOrName","hasAlerts","alertIds","PatientAlertId","updateSelected","toggleExpand","topCollapsed","topExpanded","firstItem","actualX","tooltipModel","tooltipEl","isFirst","isLast","titleLines","bodyLines","innerHtml","cellStyle","legendStyle","toopTipLabel","legendColor","addedAlerts","iconColor","Message","pointerEvents","stopPropogation","_chartTimeout","_minX","_maxX","_allData","overLapping","point2","dates","_this6","biometricInfo","ignoredParameterTypes","idToParameterTypeName","SurveyParameterType","isParameterTypeDisplayed","parameterTypes","readings","isDeleted","reading","readingIndex","Values","tooltipMessages","unitTypeValue","SurveyParameterTypeId","valueIndex","parameterType","AlertStatusId","AlertStatus","alertKeys","_adjustment","ObservationDateTime_UTC","firstY","addMargins","flattendData","__","changeView","VhUiContentUidDirective","openLeft","buttonMode","setTooltip","expandToolTip","showUid","openRight","toggleUid","copyUid","textArea","execCommand","uidToolTip","surroundElem","headerElem","menu","fixedMinWidth","fixableRegistered","resized","lessThanMinWidth","innerWidth","pageIsOffsetBy","fixable","pageHeading","getElementsByClassName","wrapperContent","bodyHideNav","newOp","gradient","minWidth","constrain","contrain","newStatus","oldStatus","linked","svgPalette","svgPaletteView","viewHeight","viewWidth","yMin","yMax","yDomain","debug","data2","showLabels","showAllLabels","showBaseline","showDays","showFill","plotEnds","interpolation","showZoom","zoom","partial","datamin","datamax","zoomToggle","removeValue","svgDraw","d3","yMin2","yMax2","domainPadder","svgDrawChart","selectAll","svgDrawDays","svgPaletteDays","dayWidth","svgPaletteDay","dimensionsX1","dimensionsY1","dimensionsX2","dimensionsY2","svgDrawSeries","fillStart","visibleData","scaleTime","scaleLinear","axisBottom","axisLeft","defined","curve","curveCatmullRom","baseline","svg","domain","extent","plotData","plot","datum","loader","dateStart","dateEnd","currentMonth","quantity","quantityTotal","visibleWidth","monthLabel","tooltipTemplateUrl","atStart","slidePosX","getDayHeight","score","navHeight","slide","navigate","inactive","setClasses","rightWidth","closeToStart","showNav","later","updateNav","debounceUpdate","navWidth","viewParse","arrType","newIcon","addLabel","labelText","alertSeverityColor","skipLabel","newLabelText","type2","urgent","VhTags","tagList","placeHolder","tagDelimiter","tagListReturnValue","tagArray","tagListArray","getSurveyTags","surveyTags","onblur","$digest","cleanTag","tag","newCollection","oldCollection","tagString","decimals","convertToLb","weightKg","convertToKg","weightLb","convertToF","celciusTemp","convertToC","fahrenheitTemp","convertToMmolL","bloodSugar","convertToMgdL","_getDateInMilliseconds","localizedDatetime","utcOffset","_getDateInMillisecondsForTimezone","dateTime","timeZoneAndroidId","localizedDateTime","getServerUTCDateTimeToDateInMillisecondsForTimezone","serverUTCDateTime","serverLocalizedUTCCreatedDateTime","getDateInMilliseconds","getDateInMillisecondsForTimezone","isValidDate","cleanUpTags","currentTags","splitTags","addPause","videoControls","AboutController","VersionService","version","getVersionDisplayInfo","BodyController","delay","btn","thresholds","classIndex","widoth","classes","handleResize","windowWidth","handleDragStart","handleDragOver","handleDragEnter","handleDragLeave","handleDrop","handleDragEnd","isSelectable","showTwoFactorSetup","showBackToTop","onscroll","scrollFunction","scrolltoTop","destination","easings","lastScrollValue","performance","documentHeight","windowHeight","getElementsByTagName","destinationOffset","destinationOffsetToScroll","timeFunction","scrollIt","PortalTextSelectEnabled","twoFactorSetupRequired","footerController","getVersion","details","headerController","MessageService","HelpService","LoginNotificationService","callRequestCount","kitMessageCount","messageCount","virtualVisitInWaitingRoomCount","previousPatient","currentPatientArrayIndex","selectNewState","patientList","patientIds","currentPatientIndex","nextPageNumber","nextPagePatientArrayIndex","pageLength","loadPatientListPage","nextPatient","totalPatients","messagePollerLock","messagePollerToggle","visitPollerLock","visitPollerToggle","nextPagePatientIds","showLoginNotification","loginNotification","shouldShowAgreement","messagePollingEnabled","visitPollingEnabled","listener1","listener2","getHelpUrlSet","vivifyUniversityUrlSet","supportVendor","getUnreadMessageCount","pulling","MessageCount","LogisticsCount","callRequestNowCount","CallRequestNowCount","callRequestLaterCount","CallRequestLaterCount","startMessagePoller","getVirtualVisitWaitingRoomCounts","getVirtualVisitCounts","startVisitPoller","callToEnabled","caregiverMessagingEnabled","patientMessagingEnabled","logisticsMessagingEnabled","showCallRequestAlert","showCaregiverMessageAlert","showPatientMessageAlert","showKitShipAlert","sites","IsAssigned","getForCurrentUser","saveResponse","LoginNotificationId","MessageHtml","AuthorizationModeId","openAgreementModals","stopMessagePoller","stopVisitPoller","showUserGuides","showGetHelp","showVivifyUniversity","showAbout","showConnectedIcon","showDisconnectedIcon","rejoinPatientContext","navigateShipPage","navigatevirtualVisitInWaitingRoom","navigateMessageAudit","navigateCallRequests","changeSites","SiteId","changeSite","newState","searchPatients","SortBy","loadPatientListPageComplete","getPatientList","PatientHeaders","TotalPatients","_helpUrl","_vivifyUniversityUrl","_zendDeskKey","_zendeskPatientFieldId","_zendeskKitFieldId","_selectedPatient","_selectedKit","_helpUrls","_setupZendesk","zESettings","webWidget","helpCenter","contactForm","prefill","chat","talk","zE","zEmbed","async","_updateZendeskPatientKit","kitNumber","_showGetHelp","helpUrlFlags","organization","_getKeywords","routeInfo","helpUrl","_windowOpenOptions","ZendeskPatientFieldId","ZendeskKitFieldId","getProtectedConfig","protectedData","ZendeskKey","removeKeyWords","replaceKeyWords","clinicalhistory","keywords","HelpUrl","VivifyUniversityUrl","SupportVendor","LogoDirective","setImgSrc","navigationController","NavigationService","hasHideNav","navRoutes","dashboardData","navItems","selectedStateName","templategroups","resourceLibraryGroups","clickSubNav","cardgroups","getCardGroups","getTemplateGroups","getResourceLibraryGroups","biometricGroups","getBiometricGroups","populationClicked","cardPopulationClicked","biometricsPopulationClicked","reportClicked","FolderId","ReportId","dashboardClicked","Dashboard","isBiFolderSelected","routeName","isBIDashboardSelected","dashboard","isBIReportSelected","isTemplateGroup","templateGroup","isLibraryGroup","libraryGroup","isCardGroup","cardGroup","isBiometricGroup","biometricGroup","isSubLevelItemSelected","userId","navType","getRoutes","nextNavType","isEmaEnabled","KitLogisticsLevel","buildNavigation","EnableDynamicBiometrics","EnableWebRpm","CareTeamMemberMassUploadToolEnabled","getSelfServiceFolder","reports","biFolder","reportItem","selfServiceIndex","subItems","Reports","IsPublished","ReportOwnerId","folder","updateSelfServiceReports","refreshCardGroups","CardGroupId","CardGroupName","_helpUrlFlags","addUniversityAndGetHelpNav","helpNavItem","getRootFolder","dashboards","subRoute","navItem","paramValues","selectedSubStateName","rootNavItem","Folders","addDashboards","ForceShowFolder","FolderTypeEnum","folderTypeEnum","SelfService","addReports","TemplateGroupRepository","PopulationsRepository","CardGroupRepository","ResourceLibraryRepository","templateGroups","cardGroups","includeDisabledItems","refreshGroups","refreshTemplateGroups","_refreshCardGroups","_refreshResourceLibraryGroups","refreshResourceLibraryGroups","refreshBiometricGroups","displayNameSecondLine","PopulationId","groupNameSecondLine","spaceIndex","cardCount","CardCount","_refreshGroups","pops","TemplateGroupId","templateCount","TemplateCount","mapGroups","GroupName","groupCount","GroupCount","GroupId","getPlatformVersion","platformversion","versionArray","cleanLogText","Analytics","domainInstance","logTemplate","cleanAction","cleanContext","stringValue","contextToString","Log","IdleService","GetCaregiver","OpenAgreementModals","agreements","PortalTexts","agreement","Caregiver","currentAgreement","nextAgreements","SetCaregiver","AuthenticationResponse","ShowAgreement","CaregiverLastLogins","loadPermissions","resetSessionFilters","closeAll","clearUserPermissions","RedirectAfterLogin","ValidateUserAfterAgreement","getLoginRedirect","logOutUser","changePassword","passwordRequest","PasswordRequest","getLoginMessages","HasPopulatedPortalTexts","login","username","password","twoFactorCode","siteId","User_Name","TwoFactorCode","auth","TwoFactorCodeRequired","TwoFactorSetupRequired","IsExpired","IsPassowrdChangeSuccessful","IsAuthorized","deleteExagoApi","redirectAfterLogin","setCaregiver","requestResetPassword","validateResetToken","requestUsername","AgreementModalController","checkIfDirty","nextAgreement","agreed","LoginController","CookieService","checkTokenForPasswordReset","loginInfo","backToLogin","isExpired","messages","hasPrivacyMessage","hasTermsMessage","unsupportedBrowser","forgotPassword","authWatcher","hasErrors","errorMessages","welcomeMessage","LoginWelcomeMessage","bannerMessage","BannerMessage","PrivacyMessage","TermsAndConditionsMessage","AuthorizationModes","EnableCTPPasswordReset","showLocalLogin","ShowLocalAlways","appVersion","loadController","showMessage","messageInfo","passwordLength","loginRedirect","getErrorWithpasswordLength","hasSequence","PasswordLength","validateNewPassword","errorMsg","groupings","hasNumeric","hasUpperAlpha","hasLowerAlpha","hasSpecialChars","repeating","hasRepeatingChars","userName","hasChars","userNamePart","hasUserNameChars","stringToCheck","hasRepeatingSequence","getAllNewPasswordErrorMessages","redirectURL","LoginInfoController","passwordConfirm","matchTarget","$templateRequest","removeMessage","oldPasswordError","newPasswordErrors","confirmPasswordError","isValidationError","resetExpired","oldPassword","newPassword","confirmPassword","hasNewPasswordValidationErrors","passwordChange","validateOldPassword","validateConfirmPassword","NewPassword","UserName","Token","IsPasswordChangeSuccessful","showTwoFactorLogin","isNewPasswordError","ErrorMessage","isOldPasswordError","isConfirmPasswordError","displayPasswordRules","setCapsLockEnabled","capsLockEnabled","isLoginError","charCode","shiftKey","validateUsername","isUsernameEmpty","validatePassword","isPasswordEmpty","validateTwoFactorCode","isTwoFactorCode","showAdmin","loginAuthorization","authorizationModelId","IsLocked","IsAccountLocked","LockMinutesRemaining","lockMessage","invalidInformationMessage","forgotCredentials","authorizationModes","passwordResetEnabled","resetInfo","inputField","changeField","field","validateResetInfo","ret","validateEmail","api_call","ret_call","PasswordValidateDirective","passwordValidate","ResetLoginErrorDirective","resetLoginErrors","oldErrorClass","newErrorClass","TwoFactorLoginSetupController","openTwoFactorModal","TwoFactorSecret","getTwoFactorSecret","NewSecret","getNewTwoFactorSecret","loginPending","BIIFrameService","exagoApi","exagoSession","editreportController","editdirectiveController","reportMessage","ExagoPath","selectedReport","postMessage","processReport","ReportDesignerChanged","sessionRequest","HttpProtocol","HttpHost","HttpPort","ReportParams","ExagoApi","ExagoBaseURL","ApiKey","deleteSession","DisposePage","executionStatusEnum","Unknown","Initializing","Refreshing","Executing","Starting","Visualizing","Complete","raiseCreateReportFinish","setReportController","reportController","raiseDesignerLoaded","setDirectiveController","directiveController","cachedReports","initalAction","startingaction","statusChangeCallback","loadinghtml","showloadingspinner","biReportDesignerIframeCtrl","watchers","biApi","exagoContainer","onDestroy","DisposeContainerContent","onReportError","reportLoading","api","displayLoadingSpinner","EditReport","reportTypes","GetAllowedReportTypes","NewReport","createReport","OnCreateReportFinish","clientInfo","reportDesignerCallback","biReportCtrl","currentReportInstance","setLoadingContent","onReportProgress","updateType","instanceStatus","ReportInstanceStatus","Running","SetExecutionStatus","isRenderingComplete","Status","updateReportInstance","executeReport","exportFormat","ReportInstanceId","ReportTypeId","BIReportId","ReportPath","CreatedDateTime_UTC","ExportType","ActionType","ReportInstanceParams","createReportInstance","newInstance","exagoParams","getExagoParams","PromptText","reportOptions","Udf","UpdateCallback","ErrorCallback","NewFilters","PromptingFilterValues","Parameters","ExecuteReport","filterSelectedString","biParam","InputTypeEnum","inputTypeEnum","DateRange","MonthRange","dateRelative","dateRangeStart","dateRangeEnd","SelectedValue","Options","Option","DisplayValue","CustomStartDate","CustomEndDate","toLocaleDateString","setExagoDateRangeParams","SingleSelectList","selectedValues","ExagoParameterName","setExagoExagoSingleSelectListParam","MultiSelectList","setExagoExagoMultiSelectListParam","SingleSelectTypeAhead","setExagoSingleSelectTypeAheadParam","MultiSelectCheck","MultiSelectTypeAhead","addParameterName","setExagoMultiSelectTypeAheadParam","CheckBox","setExagoCheckBoxParam","NoteText","noteText","setExagoNoteTextParam","reportFilterSelectedParams","parameter","refreshReport","exagoRefreshBtn","refreshed","editReport","deleteReport","reportDesignerStatusEnum","DeleteReport","reportType","scheduleReport","ScheduleReportWizard","viewSchedules","ScheduleReportManager","loadFullUI","ifLoadFullUI","LoadFullUI","ExternalFilters","Filters","getCellIdFromUIElement","uiElement","cellId","tableDataElement","closest","NavigateToPatientList","biClickData","actionArgs","EventName","ExecutionId","internal","executionId","ReportData","includeReportData","ReportName","reportName","ReportType","ReportSaveDataJson","includeReportSaveData","reportSaveData","UdfData","udfData","exportType","userArgs","Utilities","GetActionArguments","thisObj","AjaxRequest","UserResponse","recursiveGetLabel","labelClass","GetClickLabel","classNames","performInitalAction","isStateChanging","navigateToPatientListByIdList","idListDataElement","idListAngularDataElement","idListAttr","idList","dashboardItem","htmlViewer","contextObject","clickText","clickFilters","reportInstanceId","ReportInfo","cellText","getClickDataFromReportCell","exportExcelOnlyReport","SaveReport","OnClick_Navigate_PatientList_ByChartLabel","chartSeriesValue","chartLabelValue","OnClick_Navigate_PatientList_ByGridLabel","selectedPointId","reportWidgets","widgetId","widget","chartContainer","getCellIdFromWidget","chartSeriesDataPoint","seriesname","chartItemDataPoint","_widgetParcels","dataArray","index1","pointsArray","BIReportEdit","rvm","getExagoFullReportPath","currentReportFullPath","ExagoFileName","originalReportName","renameReport","returnObj","alertError","showErrorMessage","showCancel","PendingService","Root","Default","Custom","folderSubTypeEnum","Dashboards","DashboardWidgets","Templates","OnDisposeContainer","reportParams","reportParam","exagoParam","ReportParam","listType","folderSubType","reportTypeEnum","Legacy","reportSubTypeEnum","SsrsExcel","PatientTimeLog","UsageMonitor","PatientSummary","BIAdvanced","BIExpress","BIDashboard","BIChained","BIVisulization","BIExpressView","TooManyRecords","bigSpinner","setCachedReportContent","expirationTimeStamp","Month","PatientTypeList","computeDateRange","relativeDate","dateRange","Start","End","toDate","subtract","savePublishState","selfServiceFolderType","reportId","oldName","newName","udf","getTypeaheadData","dataSource","searchString","DataSource","SearchText","createReportRequest","reportExecRequest","getReportStatus","reportGuid","getReportDefinition","importReport","reportImportRequest","copyReport","reportCopyRequest","getExtendedReportStatus","getReportByDisplayName","genericRequest","CopyReportModalController","modalName","originalReportId","isIENine","progressStep","validating","validationData","caption","reportDefinition","enableCancelButton","enableOkButton","validate","OriginalReportId","CopyReportModalControllerFactory","ImportReportModalController","fileSelected","fileNameValidationError","theFile","_forceUpdate","ReportDefinition","ImportReportModalControllerFactory","paramChangeCallback","biParamCheckboxCtrl","parameterChanged","isChecked","dateformat","biParamDateRangeCtrl","isDateRange","dateRangeChanged","formCrtl","relativeDateChanged","calendarChanged","openStartCalendar","startCalendarOpen","endCalendarOpen","openEndCalendar","showValidationError","relativeDateCtrl","dateRangeRelativeDate","startDateCtrl","dateRangeStartDate","endDateCtrl","dateRangeEndDate","$pristine","$submitted","$error","isDateOnly","isInvalidDateRange","dateOptions","maxDate","biParamMonthSelectorCtrl","startmonthCtrl","StartMonth","endmonthCtrl","EndMonth","isMonthRange","isInvalidMonthRange","isMonthOnly","lastMonth","setMonth","minMode","biParamMultiSelectCheckCtrl","biParamMultiSelectTypeAheadCtrl","availableTags","showTagList","onRemoveItem","onSelectItem","biParamMultiSelectListCtrl","hasSelectedOption","IsRequired","biParamNotetextCtrl","biParamSingleSelectTypeAheadCtrl","searchList","_getTypeaheadData","abrupt","singleSelectTypeAheadCtrl","notFound","onBlur","biParamSingleSelectListCtrl","skipReason","biParametersCtrl","BiSubOptionsModel","statusReason","singleSelectListCtrl","parameterChangeCallback","isDateRangeParam","isSingleSelectListParam","isMultiSelectListParam","isSingleSelectTypeAheadParam","Description","isMultiSelectTypeAheadParam","isMonthParam","isPatientTypeList","isCheckBoxParam","isNoteTextParam","isMultiSelectCheck","ParameterChanged","PatientTimeLogPatientId","PatientTimeLogAdditionalTime","biParamPatientTimeLogCtrl","validateName","validatePatient","getPatientTypeaheadData","validateAdditionalTime","additionalTime","CaregiverRow","crvm","newAction","userCanEditCaregiverList","actionIcon","actionText","currentCaregiver","openPasswordModal","IsDeleted","deleteCaregiver","caregiversAll","postCaregiver","ModelState","lastSearch","_createForOfIteratorHelper","allowArrayLike","it","F","normalCompletion","didErr","_e2","CaregiversController","getCaregivers","currentPage","activated","Records","numCaregivers","TotalRecords","startCaregiver","endCaregiver","formfields","_step","_iterator","FieldName","FieldLabel","saveFilters","filterByText","saveFiltersToSession","handleData","gotoCaregiver","cg","gotoNewCaregiver","refresh","searchKeywords","switchFilter","getSessionFilters","setFilters","Pluralize","page","checkForVivifyUniversity","getCaregiverRoles","getDefaultLogisticsMessages","getAllSecurityRoles","getTitles","isTitleRequired","getSpecialties","getTimeZones","getHospitals","getHospitalsLabel","getByFieldName","fieldLabelModel","getAuthorizationModesForUser","IsHL7IdentExists","HL7Ident","unlockCaregiver","SaveTwoFactorSecret","SendTwoFactorCode","deleteMyTwoFactor","deleteTwoFactor","ChangePasswordModalController","isSubmitting","isSubmitted","changepassword","currentpassword","password1","ExpireNow","ExpirePasswordNow","setPasswordValidity","password2","passwordDontMatch","passRules","isLoggedInUser","EditCaregiverModalController","WebhooksService","SmoothScroll","clearFields","filename_changed","previous_filename","isHospitalsValid","hospitals","isSitesValid","setError","isAdd","AuthorizationMode","ObjectName","IsExternal","confirmErrors","passwordErrors","passwordConfirmErrors","caregiverForm","passconfirm","CG_password","scrollToAnchor","$setSubmitted","errorType","SecurityRoles","roles","caregiverRoles","SecurityRoleId","CaregiverHospitals","caregiverPreSites","CaregiverSites","caregiverPostSites","caregiverCopy","getEnabledClass","file_changed","sourceImage","Image","maxImageDim","resizeImage","dataURL","isHideText","hospitalsLabel","hasCaregiverWrite","hasHospitalsReadAll","hasSitesReadAll","facilityIsEditable","isEditable","sitesIsEditable","checkHL7Ident","hl7Ident","ShowTwoFactorRequired","TwoFactorLogin","EmailAlertsForCareTeamMembersDefault","enableUniversity","VivifyUniversityEnabled","ReceiveEmail","IsThirdParty","TimeZoneId","TwoFactorRequired","TwoFactorDefault","specialties","defaultTitle","IsDefault","CaregiverTitleId","zones","ReceiveLogisticsMessages","caregiverSecurityRoleIds","role","CreateUniversityUser","VivifyUniversityUserDefault","VivifyUniCreateDateUTC","VivifyUniSuspendDateUTC","toggleCreateUniversityUser","TwoFactorSetupModalController","enableNextBtn","wizardStep","SelectedTypeId","SetFocus","SendTestCode","TwoFactorTypeId","inputId","back","resendTestCode","doneBtnText","twoFactorUri","Help","TotpHelp","SmsHelp","EmailHelp","TwoFactorTypes","ViewCaregiverModalController","initTwoFactorButton","twoFactorBtnText","TwoFactorLoginEnabled","userIsSelf","gotoEditCaregiver","userCanChangePassword","AuthorizationModeIsExternal","ShowUnlockButton","twoFactorBtnClicked","msg","resetTwoFactorModal","AlertTypeEditCtrl","alertType","severityLevels","alertClasses","AlertClass","changeAlertClass","AlertClassId","loadSeverityLevels","alertTypeForm","AlertTypesCtrl","AlertType","toggleEnabled","updateAlertType","openEdit","canDisable","canAlertTypeBeDisabled","CanEdit","AlertTypeId","CurrentProceduralTerminologyCodeEditCtrl","cptCodeForm","$errors","cpt","CPTCodeId","updateCurrentProceduralTerminologyCode","swallowInput","isPositive","clipboardData","readOnlyCareManagementType","Acronym","canEdit","CurrentProceduralTerminologyCodesCtrl","destItemScope","SortOrder","resort","updateAll","getcptCodeList","getAcronym","cmtId","dragListeners","currentProceduralTerminologyCodeRepo","getList","createCurrentProceduralTerminologyCode","currentProceduralTerminologyCode","mapCurrentProceduralTerminologyCode","currentProceduralTerminologyCodes","FacilityFee","NonFacilityFee","CaregiverUploadController","CaregiverUploadService","refreshRecords","getCaregiverRecords","CaregiverMassUploadLogId","setVivifyUniversityDefault","loadLogList","numUploads","getLogList","logs","openLogTab","clearData","recordsSubmitted","headVisible","deleteCaregiverRecords","getDisplayTime","timezone","guess","downloadLog","getLogFile","numCellsEditing","deleteEntry","record","confirmed","deleteRecord","affectedRecords","updateAffectedRecord","CaregiversReady","submitEdit","setFormPristine","updateRecord","newRecord","currentRecordIndex","rec","CaregiverMassUploadRecordId","getRoleNames","rolesString","roleIds","roleNames","getSiteAndHospitalNames","sitesString","hospitalsString","siteIds","hospitalIds","selectedSites","siteStrings","site","currentSite","selectedHospitalNames","hospital","FacilityName","checkTitle","setFormDirty","emptyForm","getStatusIcon","changedSort","validString","genders","getCaregiverHospitalsBySite","timeZones","responseVal","displayVal","VivifyUniversity","openUploadModal","fileAlreadyUploaded","isFileAlreadyUploaded","logSettings","Settings","FILTERKEY","logId","updateLogSettings","methode","fileURL","getTemplateFile","UploadModalController","loadData","reqTitle","importFileToolTip","selectedHospitals","IsOpen","Sites","headerClicked","accordion","panelId","closeOthers","defaultPassword","Roles","scrollToError","saveSettings","selectedRoles","settingsModel","fileUploadForm","MassUpload_Password","saveUploadedFile","SettingsModel","isFileUploading","fileError","saveEditedLogSettings","openAccordion","phase","downloadTemplate","CareManagementTypesController","toggleIsClinicalTimeMeasured","toggleIsEnabled","getToggleClass","toggleValue","CareManagementTypesEditController","careManagementForm","resourceUrl","blankCareManagementType","getResponseData","ConfigurationsController","TagUtilities","cvm","childOption","mapPathwayAlertChangeReason","hasPathwayAlertChangeReasonsWrite","PathwayAlertChangeReasonId","getPathwayAlertChangeReasonsList","getPathwayAlertChangeReasons","pathwayAlertChangeReasonsList","CaregiverSpecialties","caregiverTitles","CaregiverTitles","hasPathwayAlertChangeReasonsRead","hasMessageInterventionsRead","labelhint","optionsEditable","addPathwayAlertChangeReason","createPathwayAlertChangeReason","updatePathwayAlertChangeReason","hasdeleteReasonListRead","monitoringStatusList","MonitoringStatuses","CanBackDate","EnableNotes","RequireNotes","SaveToMedicalHistory","StatusChangeReasons","StatusChangeReasonId","Reason","StatusChangeSubReasons","sr","StatusChangeSubReasonId","patientStatusList","canread","changedStatusReason","forStatus","apiReason","updateStatusChangeReason","addedStatusChangeReason","reasonLabel","maxSort","MonitoringStatusId","addStatusChangeReason","changedStatusSubReason","forReason","apiSubReason","updateStatusChangeSubReason","addedStatusChangeSubReason","addStatusChangeSubReason","subReason","hasskipBiometricTypesRead","mapSkips","SkipBiometricReasonId","SkipBiometricReasonTexts","mapSkipLabel","skipReasonTextModel","skipBiometricTypes","BloodPressureSkipReasons","PulseSkipReasons","OxygenSkipReasons","WeightSkipReasons","GlucoseSkipReasons","TemperatureSkipReasons","SpirometerSkipReasons","StepsSkipReasons","HbA1cSkipReasons","skipOptionAdded","inItem","SurveyQuestionTypeId","addSkipBiometricReason","skipOptionChanged","changedSuboption","inOption","updateSkipBiometricReason","installMethodChanged","changedOption","updateInstallMethod","installMethod","installOption","hasProviderRoleRead","mapPersonalCaregiverRole","PersonalCaregiverRoleId","Enabled","IsReferrer","getComorbidityList","comorbiditiesList","mapComorbidity","ComorbidityId","hasProviderRoleWrite","primaryCaregiverRoles","getPrimaryCaregiverRoles","personalCaregiverRoleAdded","newRole","createPrimaryCaregiverRole","personCaregiverRoleChanged","updatePrimaryCaregiverRole","hasConfigComorbidityRead","hasConfigComorbidityWrite","getTags","addComorbidity","updateComorbidity","hasEducationalMaterialRead","hasEducationalMaterialWrite","educationalMaterialChanged","EducationalMaterials","EducationalMaterialId","updateEducationalMaterials","eduMaterialsOptions","EducationalMaterialModels","ed","CreatedBy_Id","hasRead","hasWrite","addedEducationalMaterial","EducationalMaterialObject","addEducationalMaterial","deleteTimeLogReasons","DeleteTimeLogReasons","DeleteTimeLogReasonId","deleteReasonList","changedDeleteReason","changedReason","forOption","updateDeleteTimeLogReason","addedDeleteReason","addDeleteTimeLogReason","skipDirectiveLanguages","PatientLanguages","deleteReasonsConfig","showSuboptions","optionsHaveDefault","hasBiometricThresholdsChangeReasonsRead","mapReason","populationList","allPatients","BiometricThresholdsChangeReasonId","addedBiometricThresholdsChangeReasons","addBiometricThresholdsChangeReason","BiometricThresholdsChangeReasons","changedBiometricThresholdsChangeReason","updateBiometricThresholdsChangeReasons","hasInterventionsRead","mapInterventions","alertTypeId","alertClassId","interventions","AlertInterventions","Interventions","intervention","interventionTagList","union","InterventionId","classId","typeId","hasInterventionsWrite","mapToApiIntervention","mapMessageIntervention","hasMessageInterventionsWrite","MessageInterventionId","getMessageInterventionList","getMessageInterventions","messageInterventionList","getMilestoneList","milestoneList","MilestoneUId","hasConfigMilestoneWrite","MilestonePopulations","mapMilestone","alertTypes","AlertTypes","class","interventionTabOptions","getPopulations","IsAllPatients","alertInterventionsList","hasReadPermission","notificationInterventionsList","canRead","interventionChanged","apiIntervention","updateIntervention","interventionAdded","addIntervention","newIntervention","addMessageIntervention","createMessageIntervention","updateMessageIntervention","hasTransformsRead","hasTransformsWrite","formVariableTransformList","FormVariableTransforms","FormVariableTransformId","FormVariableTransformDetails","FormVariableTransformDetailId","parentId","SourceValue","TargetValue","sourceValue","targetValue","variableTransformAdded","createFormVariableTransform","variableTransform","variableTransformUpdated","updateFormVariableTransform","variableTransformDetailAdded","createFormVariableTransformDetail","variableTransformDetail","variableTransformDetailUpdated","updateFormVariableTransformDetail","hasConfigMilestoneRead","addMilestone","createMilestone","updateMilestone","openMilestoneModal","milestone","protectedConfigParams","clearPortalConfig","AddGoConfigurationController","showDisabled","availableConfigurations","HospitalAvailable","availableProgramGroups","availableSites","addGoPop","CType","selectedPopulation","ProviderMasterId","providerList","getProvidersAsync","ProviderId","selectProvider","selectedProvider","AddPopulationController","addPop","ConfigContentController","WelcomeVideoService","SlideshowService","PopulationSettingsService","bcvm","pageType","welcomeVideoPopulations","groupBy","mapValues","defaultWelcomeVideo","slideshowPopulations","updateSlideshowImages","settingsPopulations","KitConfigurations","WebRpmConfigurations","defaultSettings","mapConfig","contentTextOrDefault","populationContent","defaultContent","selectedContent","selectedPopulationId","multiLingualTypes","ContentType","contentTypeId","ContentTypeId","MaxLength","contentDataTypeId","ConfigurationDataTypeId","contentPopulations","compact","configId","populationsWithContent","usedLanguageIds","PopulationConfigurations","selectPopulation","selectedconfigId","deletePopulation","deleteAllMultiLingualContent","welcomeVideo","slideshow","populationSettings","deleteWelcomeVideo","WelcomeVideoId","ImageName","ConfigType","deleteSettingsConfiguration","deleteSettings","setting","setCurrentLanguageText","addedVideo","createWelcomeVideo","VideoId","newWelcomeVideo","changedVideo","updateWelcomeVideo","deletedVideo","editEntry","dataTypeId","contentText","updateMultiLingualContent","deleteMultiLingualContent","addPopulation","cp","selectConfiguration","addEntry","contentTypeGroup","addMultiLingualContent","ConfigTypeEnum","updatePopulation","toggleDisabled","PatientLanguageRepository","getWebRpmContent","hospitalId","goSetting","deleteMultiLingualContentConfiguration","deleteAllMultiLingualContentConfiguration","updateConfigurationRankings","sync","serviceType","addAgreement","deleteAgreement","deleteAllAgreements","EditContentController","ApkSanitizer","editContent","agreementTitle","agreementSubTitle","subTitle","AType","SelectedAgrementType","AgreementType","agrementType","dataTypeHtml","TextPlaceholder","checkAgreementFlow","disableNewAgreementFlow","ShowSaveMsg","advancedUser","tools","fileReader","otherTools","buildOtherTools","GoConfigurationController","isHomeNewAgreementFlow","HomeUseAgreementsTypeWorkflow","isGoNewAgreementFlow","GoUseAgreementTypeWorkflow","isSortable","addAgreementEntry","AppAgreementId","sd","populationTitle","DefaultLanguage","AgrementTypes","AgreementTypeId","AgreementId","agreementTypes","AgreementContentTypeid","cf","returnRequest","mapText","ServiceType","addagrementRequest","AppAgreementMultilingualContentModel","AppAgreementTypeModel","_bcvm$Agreements","AgreementsMap","MapAgreements","editAgreementEntry","populationSubtitle","populationSubTitle","populationTitleDefault","modelTitleDefault","modelSubTitle","modelTitle","languageContent","_bcvm$Agreements2","mapConfigurations","contentExists","Pluckcontent","findmatch","GetSelectedPopulation","findOption","HospitalId","ProgramGroupId","ProviderGroupId","getSelectedConfigRanking","Ranking","pluckContent","setPopulationPriority","MapConfigIdtomultiLingualContent","AgreementContent","mapDefaultVideo","filterConfiguration","IsStatic","HospitalConfigurations","ProgramGoupConfigurations","ProviderConfigurations","SiteConfigurations","ProviderGroupConfigurations","FullName","mapAgreementDeleteRequest","req","AppAgreement","filterbyagreementTitle","filterbyagreementDescription","filterbyagreementSubTitle","DeleteAgreements","removeSlide","AgreementTitle","updateAgreementContent","DeleteAgreement","ContentPopulationsDirective","viewPopulations","sorteable","deletedPopulation","updatedPopulation","getViewablePopulation","getStaticPopulation","filteredPopulations","staticPopulations","selectedItem","getTemplateUrl","newPopulations","oldPopulations","isConfigurationActive","returnTypeName","pendingId","getPopulationId","removePopulation","EditPopulationSettingController","SettingsService","saveSetting","settingTypeMap","filepath","validatePath","resourceName","fileParts","fileExtention","populationSetting","ConfigurationId","ResourceScope","ResourceType","ResourceName","uploadMedia","cancelEditing","canEditSettings","alertText","errorText","noNameError","nameLengthError","isValidFileName","PopulationSettingValueInput","validValues","typeMap","onedecimal","minMax","getTemplate","ValidValues","PopulationSettingsDirective","getDescription","getValue","findPopulationSettings","canDelete","isImage","Param","deleteMedia","deleteSetting","getPopulationSetting","editValue","SettingConfig","populationConfiguration","identity","Identity","SelectVideoController","selectedVideoId","selectVideo","ContentSlideshowDirective","images","addSlideshowImageModal","currentList","getPopulation","populationImages","selectImage","selectedImage","deleteImage","programGroupId","imageName","resourceScope","resourceType","sendRequest","SlideshowAddCtrl","slideshowImageName","fileNameExistsError","_name","isFilenameExists","SlideshowImageDirective","canDeleteImage","answer","WelcomeVideoDirective","defaultVideo","addVideo","getAvailableVideos","deleteVideo","videoName","editVideo","welcomeVideoId","getWelcomeVideos","TagRepository","contentRepo","statusChangeReasonRepo","statusChangeSubReasonRepo","skipReasonRepo","deleteTimeLogReasonRepo","interventionRepo","biometricThresholdsChangeReasonRepo","installMethodRepo","populationsRepo","personalCaregiverRoleRepo","messageInterventionRepo","milestoneRepo","pathwayAlertChangeReasonRepo","getStatusChangeReason","getStatusChangeSubReason","updateStatusChangeReasonShowSaveToPMHSlider","updatePromise","oldReason","updateStatusChangeReasonEnableNotes","updateStatusChangeReasonRequireNotes","updateStatusChangeSubReasonShowSaveToPMHSlider","updateStatusChangeSubReasonEnableNotes","updateStatusChangeSubReasonRequireNotes","biometricThresholdsChangeReason","educationalMaterial","updateSpecialHandling","deleteSpecialHandling","SpecialHandlingId","allSites","clearCache","updatePopulationList","primaryCaregiverRole","formVariableTransform","formVariableTransformDetail","getCaregiverTitles","messageIntervention","importMilestones","comorbidity","pathwayAlertChangeReason","InterventionFormDirective","hasTagWrite","lastSelectedPrograms","populationsChanged","copySelected","clickSave","interventionForm","MessageInterventionFormDirective","programList","onUpdated","onAdded","allPatientsProgram","programsChanged","messageInterventionForm","MilestoneEditController","Configurations","configName","saveConfigurations","responses","deleteConfigurations","PatientHeaderConfigurationCtrl","defaultPatientHeaderConfigurations","DefaultPatientHeaderConfigurations","contentPopulationIds","PopulationPatientHeaderConfigurations","selectedConfigurations","patientHeader","PatientHeaderConfigurationId","selectedPatientHeaderConfigurations","newPatientHeaderConfigurations","defaultConfig","newConfig","savePopulationPatientHeaderConfigurations","savePopulationPatientHeaderConfiguration","saveDefaultPatientHeaderConfiguration","defaultPatientHeaderConfiguration","populationPatientHeadersConfigurations","populationPatientHeadersConfiguration","ProviderFormDirective","providerSaved","providerAdded","parsePhoneProperty","CaregiverTitle","titleObject","FirstName","LastName","MiddleInitial","providerInfo","CaregiverSpecialtyId","PhoneNumber1","PhoneNumber2","MobileNumber","AnsweringServiceNumber","FaxNumber","EmailAddress","AddressOne","AddressTwo","ZipCode","providerForm","CaregiverSpecialty","EditProviderController","ProviderService","checkHl7Ident","formElement","providerRepo","getProviderByHl7Ident","oldHl7Ident","unsavedProviders","unsavedProviderFormFields","refreshUnsavedProviders","checkUnsavedProviders","unsavedFormField","duplicatesFound","foundCount","fieldIndex","ProvidersController","getProviders","providers","numProviders","startProvider","endProvider","defineWebformFields","editProvider","setSortOrder","showSearchHelper","setSearchText","toggleProvider","ReasonFormDirective","reasonChanged","reasonAdded","reasonForm","TransformFormDirective","transformDetailChanged","transformDetailAdded","transformForm","AddCategoryModalController","categories","showPopulations","categoryName","categoryPopulations","categoryIndex","chr","titleText","bodyText","getCategoryPopulations","MasterChartCategoryId","AddEntryModalController","entry","entryText","selectedCategory","newCategory","AddEditCardController","selectedStatus","selectedIcon","setCurrentLanguage","_setCurrentLanguage","statusChanged","CardContentId","CardTblPopulationId","iconChanged","_getSelectedFont","fontChanged","getSelectedFont","getIconClass","icons","getIcons","cardStatus","modalHeader","_vm$populations","_vm$populations2","isInSelection","tmpContents","activeLanguageIds","disabledCardContents","CardsController","userCanEditRules","itemsSelected","_showCardModal","allData","searchTextBox","_isSelected","showImportModal","removeMissingLanguagesFromCardContent","cc","contentLanguageId","noSearchResults","selectedCard","currentLanguageIndex","selectedCardRules","contentIndex","searching","getCardGroupByPage","selectCard","getCard","setLanguageId","getRulesForCard","selectCategoryId","searchCards","setPage","pageNo","loadAllCards","getRuleName","Display","deleteCard","cardServiceFactory","CardsRepository","IconsRepository","getByPageNumber","CategoriesController","Language","surveyQuestions","ShowOptions","expandedAll","expandAllNodes","collapseAllNodes","showNoResultsLabel","userCanAddCategory","userCanDeleteCategory","userCanEditCategory","userCanAddEditQuestion","userCanDeleteQuestion","getQuestionsByCategory","categoriesOptions","saveCategory","selectCategory","surveyQuestionCategoryId","clearQuestionsCache","getUncategorizedQuestions","SearchResults","ResultsCount","searchQuestions","goToLastQuestion","lastPage","questionNodes","showDeleteIcon","isBiometricQuestion","isHealthTipQuestion","searchCategories","searched","expandNode","collapseNode","queryToEscape","deleteCategory","categoryId","st","checkCategoryName","showSiteMapIcon","addCategory","surveyQuestionCategory","createCategory","addQuestion","preselectedCategoryId","disableEdits","saveFunction","createQuestion","editQuestion","saveQuestion","showInternalName","showEditQuestion","nestQuestion","SurveyQuestionId","deleteQuestion","getTemplatesByQuestionId","deleteMasterQuestion","searchOrderExpression","disableExportButton","disableDeleteButton","NestQuestionController","searchResultQuestion","mainCategory","selectedQuestions","isCustomResponseQuestion","buttonSearch","questionCategoryId","selectedQuestionId","removeQuestion","child","parentQuestion","disableCategory","flashQuestion","addNestedQuestion","refreshQuestion","showEditQuestionIcon","isTemp","flash","getQuestion","questionId","treeOptions","srcModel","parentModel","srcParent","destParent","srcIndex","searchTreeOptions","setQuestionAsTemp","SurveyResponseOptionId","MediaPreviewController","getSourceForLanguage","mpvm","videoSrc","controls","trustAsResourceUrl","mediaType","en","getAvailableLanguagesMap","player","questionContainer","IsIncompatible","onEdit","questionContainerController","clickedEdit","onDelete","isDisabled","clickedDelete","collapseIcon","collapsable","showBio","uiTreeNodeController","alertEditable","languageController","optionText","changeText","lang","textModel","defaultLanguage","showVideoButton","draggable","ContentId","contentId","questionText","defaultTextModel","incompatibleTexts","1","2","3","4","5","6","7","toolTipTexts","IncompatibilityIds","tooltipText","ScheduleController","NewSchedule","SchedulePromptTimeOfDay","schedule","DueTime","StartMinutesBeforePrompt","LateMinutesAfterPrompt","EndMinutesAfterPrompt","IsValid","DefaultProgramDuration","StartDateType","StartDate","StartDateSubType","StartDateRecompute","StartDateValue","StartDateSunday","StartDateMonday","StartDateTuesday","StartDateWednesday","StartDateThursday","StartDateFriday","StartDateSaturday","StartDateInterval","Immediate","Days","Delay","EndDate","MilestoneDay","Recompute","ProgramDay","Day","DaysBefore","StartDateOldLogic","v56Logic","Before","SpecificDate","getUtcDateAsString","DayOfWeek","Weeks","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","IsStartDayChecked","saveStartDate","RecurrenceType","RecurrencePattern","RecurrenceSubType","RecurrenceInterval","RecurrenceDayOfMonth","RecurrenceSunday","RecurrenceMonday","RecurrenceTuesday","RecurrenceWednesday","RecurrenceThursday","RecurrenceFriday","RecurrenceSaturday","RecurrenceOrdinal","RecurrenceOrdinalDay","Daily","Weekly","IsRecurrenceDayChecked","Monthly","Months","DayOfMonth","Ordinal","OrdinalDay","saveRecurrencePattern","EndDateType","EndDateSubType","EndDateInterval","EndDateRecompute","EndDateValue","After","Completed","Presented","saveEndDate","buildCalendar","milestoneName","CalculateDisplayTimes","Milestones","getMilestoneName","recurrence","adjustMinutes","StartMinutesBeforePromptTime","setMinutes","getMinutes","ValidStartTime","LateMinutesAfterPromptTime","ValidLateTime","EndMinutesAfterPromptTime","ValidEndTime","isBefore","prompt","addedTime","newTime","setHours","difference","getUtcPlusLocalOffsetDate","dateString","getTimezoneOffset","scheduleToEdit","ruleAction","ActionData","Schedule","isTemplate","templateInfo","ShowNewRecurrenceOptions","AdvancedPathwayScheduling","monthFirstFormat","StartDateHelp","RecurrenceHelp","EndDateHelp","activeMilestons","initMilestoneId","samplePathwayAdded","SampleCalendar","DateAdded","Milestone","FirstDate","calendarLoaded","StartMinutesBeforePromptDescription","SchedulePromptTimeOfDayDescription","LateMinutesAfterPromptDescription","EndMinutesAfterPromptDescription","StartDateDescription","EndDateDescription","loadDueTime","loadStartDate","loadRecurrencePattern","loadEndDate","pendingRefresh","StartEditMode","toggleStartEditMode","LateEditMode","toggleLateEditMode","EndEditMode","toggleEndEditMode","uibDateParser","scheduleChanged","templateName","getSchedule","getScheduleDescription","SurveyScheduleId","PatientSurveyScheduleId","OpenEditModal","returnToSurveyEdit","scheduleData","savePatientSurveySchedule","saveSchedule","ScheduleFilter","part","startDatePhrase","endDatePhrase","recurrencePhrase","timePhrase","numericalForm","ordinalSuffix","ordinal","weekDays","byTen","byHundred","getMilestone","CreateMilestone","DeleteMilestone","UpdateMilestone","ComputeSampleSchedule","pathwayScheduleSample","ScheduleModalController","userCanEditLockedPathways","referenceDates","todayLocalMidnight","GetTodayLocalMidnight","Now_UTC","PathwayAddedDateTime_UTC","ProgramStartDate","ProgramDurationDays","ProgramEffectiveDate","PatientPathwayStartDate","PatientPathwayEndDate","LastPathwayDueDate","sampleMilestoneDate","daysInMonth","GetDaysInMonth","AddDays","MilestoneDates","pathwayScheduleSampleResult","PathwayAdded","MilestoneDate","milestoneDate","pathwayAdded","buildSampleMonths","DueDates","today","FirstDueDate","firstDueDate","sampleMonth","buildSampleMonth","thisMonth","dayOfWeek","toLocaleString","weekIndex","dayCnt","isDueDate","IsDueDate","dueDateStr","HelpTopic","setLastEditedPatientSurveyId","SetSamplePathwayAddDate","rendered","uiTreeController","EditPathwaysController","pathwayCount","myTime","unpublished","AddHealthTipController","defaultLanguageId","nameTexts","activeTab","defaultHealthTip","defaultHealthTipName","maxFileSize","validError","languageCount","createHealthTip","saveHealthTip","tipData","tabIndex","languageDictionary","isDefaultLanguage","healthTipNameText","healthTipText","languageName","titleChanged","onPaste","includesMedia","sanitizeTags","userCanEditTags","userCanEditContentId","es","fr_ca","getHealthTipMaxSize","getQuestionCategories","languageCode","existingTipLanguage","EnglishTitle","tipBodyPrefix","tipBodySuffix","removeStyling","subEl","removeTag","htmlString","hasValidImages","validSrc","sanitizeForApk","containerWidth","wrappedText","addWrapperTags","htmlElement","percentWidth","cssWidth","naturalWidth","lessPercent","formatImageTags","sanitizeForWeb","parsedText","HealthTipsController","defaultLanguageCode","tips","LanguageCode","selectedTip","userCanAddHealthTip","userCanEditHealthTips","userCanDeleteHealthTips","userCanImportHealthTips","userCanExportHealthTips","userCanDownloadHealthTip","setLanguageCode","getCurrentLanguageText","showImageEditor","imgType","imgUrl","thumbnailUrl","resourceId","portraitUrl","landscapeUrl","resetThumbnail","deleteThumbnail","forOwn","getResourceThumbnailImages","thumbnailImages","itemImages","ThumbnailUrl","PortraitUrl","LandscapeUrl","toggledItem","toggleHealthTipSelection","getHealthTips","ht","checkAllOnPage","selectTip","tipId","tip","searchHealthTips","onCategoryIdChanged","loadAllHealthTips","optionHtml","languageText","showTipModal","healthTipIndex","addHealthTip","editHealthTip","deleteHealthTip","getImageUrl","QuestionRepository","QuestionCategoryRepository","selectedTipQuestion","tipFromTipQuestion","tipQuestion","tipName","surveyOption","getQuestionOptionText","tipTexts","TimeToReadSeconds","SurveyQuestionUId","tipsFromTipsQuestions","updateHealthTip","updateTipQuestion","sanitizedText","searchQuestionsByTypeAndPageNumber","searchQuestionsByType","SurveyScheduleOrderFilter","isDaily","SurveySchedule","IsOneTime","sortByTimeOfDay","aTime","bTime","ahour","aminute","bhour","bminute","PromptOrder","aName","bName","sortByName","sortByPromptOrder","sortByStartDate","astartDate","bstartDate","dailySurveys","oneTime","weekly","OverdueAlertSelectionDirective","noneOption","overdueTime","times","hourOfDay","IsOverdueAlertEnabled","OverdueMinutesAfterPrompt","overdueTimeChanged","PatientSurveyController","selectedPatientSurvey","ScheduleText","showPushToTableButton","userCanDeletePatientSurvey","userCanChangePatientPathwayStatus","userCanReadWritePathwayAlertChangeReason","userCanEditPatientPathwaySchedule","deletePatientSurvey","overdueAlertTime","changeStatus","setPatientSurveyStatus","toggleShowOptions","optionLimit","defaultOptionLimit","ShowHistory","HistoryData","getPatientSurveyHistory","showEditPathwayBtn","showEditPathwayScheduleBtn","toggleLanguage","SurveyTexts","PatientSurveyAlertChangeController","logText","selectedReasons","isOtherSelected","otherReasonText","submitAlertChangeReason","otherReason","isInvalid","alertChangeReasons","isOther","includeReason","getPatientSurveyAlertChangeReasons","PatientSurveyEditController","searchResultQuestions","alertsChanged","patientSurvey","titleLanguage","showSendPathwayStartMessageButton","serviceLevelTypeId","hasSurveysDue","userCanEditSchedule","userCanEditLockedPathwaySchedule","userCanEditPatientSurvey","isValidTitle","surveyTitle","surveySelected","TagArray","savePatientSurvey","showHidePushButton","findQuestion","flagSearchedQuestions","surveyQuestionId","ExistsInTemplate","showButton","searchQuestionsForPatient","parentQuestions","setDirty","pushToTablet","pushSurveyToTablet","sendPathwayStartMessage","addQuestionToSurvey","newQuestion","PatientSurveyQuestionId","numNewQuestions","IsNew","checkSurveyName","restricted","removeContentIds","Patient","HasDirtySurveys","submitPatientSurveyAlertChangeReason","PatientSurveyHistoryController","parseJustDate","dateStr","userTimezoneOffset","PatientSurveyCompliances","CompletedOn_UTC","historyRow","CreatedByLastName","PatientSurveyHistory","NextDueDate","AddedDate","PatientSurveySchedules","PatientSurveyDue","SurveyDate","oldLogic","PatientSurveyKitHistoryController","patientName","gotoPage","getPatientSurveyKitHistory","KitHistory","pageCount","TotalCount","historyDetail","historyDetailVisible","showHistoryDetail","row","Index","getPatientSurveyKitHistoryDetail","SyncTime_UTC","PatientSurveysController","selectPatientSurvey","addTemplateToPatient","selectSurveyTemplate","surveyTemplateId","surveyTemplates","surveyTemplate","templates","addedSurvey","checkAddTempaltesToPatient","isVerify","patientSurveys","editPathways","editData","changedSurveySchedules","savePatientSurveySchedules","changedSurveys","discontinuePatientSurvey","showKitHistory","toggleExpansion","yesterday","pending","discontinued","PatientSurveys","surveyTemplatesCount","SelectedGroup","generalSurveyTemplates","userCanAddPatientSurvey","ShowYesterdaysPathways","prepSurvey","AvailableTemplates","SurveyPatientPopulations","selectedPatientSurveyId","getLastEditedPatientSurveyId","getTodaysPatientCareplans","todaysCareplans","lastKitSyncDatetimeTooltip","LastKitSyncDateTime_UTC","setList","surveyDue","EventTypeId","ListId","found","hasError","createPatientSurvey","surveyId","statusid","reloadState","PatientSurveyTemplateController","selectedTemplate","PatientSurveyRepository","PatientSurveyScheduleRepository","lastEditedPatientSurveyId","assignTemplate","preview","createByTemplate","unassignTemplate","deleteByTemplate","patientSurveySchedule","patientSurveySchedules","saveSchedules","isVideoQuestion","postData","changeReason","kitNo","syncTime","TemplateRepository","QuestionTypeRepository","TemplateScheduleRepository","SurveyQuestionType","templateGroupRepo","lastEditedTemplateId","importTemplates","searchTemplates","saveTemplate","deleteTemplate","getUncategorized","templatesToUpdate","lockQuestion","revisionId","unlockQuestion","lockPathway","unlockPathway","saveTemplateSchedule","surveySchedule","saveTemplateSchedules","surveySchedules","includeAllPatients","getFormsInPopulation","isSingleSelectQuestion","isMultiSelectQuestion","getRules","getRulesForPathway","pathwayId","saveRule","deleteRule","setLasstEditedTemplateId","getLastEditedTemplateId","getTemplates","isQuestionAssignedToPatientPathway","getAllVideos","getVideos","contentProviderId","saveVideo","importData","getContentProviders","videoUploadUrl","_e3","AddQuestionModalController","SurveyQuestionAttribute","videoQuestionOptionIndex","questionAttributeTypes","AlphaNumeric","QuestionAttributeId","Numeric","Address","DateMonthYear","DateTime","questionAttributesEnum","limitEdits","addCondition","questionHeader","questionTypes","questionOptionsDisabled","showDelete","disableCategoryList","maxLengthAttribute","maxValueAttribute","minValueAttribute","decimalValueAttribute","saveToMilestone","allowPrevious","allowFuture","previousDays","futureDays","ruleOperator","ruleVariables","ruleChanged","ruleSet","addRuleItem","SurveyQuestionTypeName","EnglishText","newText","newQuestionType","questionAttributeId","TypeId","questionAttributeType","SurveyQuestionCategory","englishOptionText","optionId","SurveyOptionId","attribute","videoIndex","SurveyQuestionAttributes","DecimalPlacesAllowed","MaxValue","MinValue","selectedMilestone","PreviousDaysAllowed","FutureDaysAllowed","originalQuestion","Active","setOptionsEditable","addEmptyOption","_step2","_iterator2","addNewOption","alertLevelId","removeEmptyOptions","optionIsEmpty","optionsAreValid","customPathways","CustomizedQuestion","excludedProperties","updatedQuestion","modified","obj1","obj2","isEqual","getChanges","isRevisionModified","selectedTemplates","callSave","optionLostFocus","removeOption","resetVariables","questionTypeChanged","questionOptions","selectedVideo","newVideo","showVideoSelection","AddRuleModalController","TemplateId","TemplateName","promptForName","updateDescription","eventItem","actionItem","RuleConditions","RuleActions","ActionName","DescriptionText","changePathwayStatusData","PathwayName","addPathwayActionData","IsSunday","IsMonday","IsTuesday","IsWednesday","IsThursday","IsFriday","IsSaturday","OverrideDays","AllowDuplicateSurveyTemplates","addPatientCardActionData","ruleCondition","Condition","AddTemplateModalController","enabledPrograms","disabledPrograms","EnableAlerts","defaultsChanged","hasAllPatients","selectedPopulations","userCanWriteRules","userCanWriteTemplateTags","showDisabledPrograms","canAssignDisabledPrograms","toggleShowDisabledPrograms","navigatedPopulation","EditBiometricQuestionController","userCanEditConditions","ImportTemplateModalControllerFactory","ImportTemplateModalController","_chunkSize","missingMilestones","missingPrograms","copyMode","userCanUploadPrograms","userCanUploadMilestones","userCanUploadVideos","removeDeletedInfo","deletedBy_Id","deletedDateTime_UTC","subObj","surveyOptions","_getVideos","milestoneUId","milestonePromise","videoPromise","working","_chunk","progressSize","surveyPatientPopulations","uploadNext","existingResult","deleted","endDateMilestoneName","endDateMilestoneUId","endDateMilestoneId","_distinctObjects","_this7","TemplatesController","DefaultLanguageId","userCanDeleteTemplate","userCanAddTemplate","usercanPublishTemplate","userCanExportTemplate","usercanBulkAssign","userCanImportTemplate","userCanAddSaveSurveyQuestion","userCanLockQuestions","userCanEditLockedSchedules","selectTemplate","lasttemplateGroupId","lockChanged","templateGroupName","publishTemplate","unPublishTemplate","unpublishedSurveyId","openAddModal","popInt","SurveyTypeId","DefaultStatusId","showDefaults","flashUnpublished","importPathway","programResult","showSelectAllButton","testConditions","conditionData","VariableList","DisplayQuestion","PostFixDisplayCondition","conditionArray","resetConditions","editSchedule","disableExport","exportPathways","lastEditedTempalteId","getSelectedTemplate","mapContentLock","itemIsQuestion","itemIsTemplate","isLocking","lockLogic","setLockStatus","SurveyQuestionRevisionId","loadingSurvey","jsonText","conditions","buildVariableList","PatientDateEditEnabled","PatientPromptTimeEnabled","TemplateTexts","lockPathways","isSurveyMultiLingual","getPatientSurveyCount","PatientSurveyCount","TemplatesEditController","availableQuestions","_loadController","_$stateParams$templat","_getCategories","_getPrograms","userDisableEnableAlerts","userCanEditQuestions","refreshTemplate","_populations","selectEnglish","refreshRules","_refreshTemplate","sortRoutine","originalTemplate","canAssignDisabled","_selectedDeletedPopulations","addNewQuestion","addQuestionToTemplate","lastSortedQuestion","populationChanged","newSchedule","SMSText","_setLockStatusOnQuestions","checkTemplateName","editBiometricQuestion","editNonBiometricQuestion","toggleinput","addRule","editRule","ruleId","showDisabledItems","canAssignFromAllSites","toggleShowDisabled","canEditPathway","deleteSurveyTitle","UpdateCustomTemplateModalController","selectAllTemplates","checkboxChanged","allSelected","VideoController","selectedFile","contentProviders","canEditVideo","videoSource","videoElement","checkVideoName","videoFile","fileUrl","lastFileUrl","lastTrustedFileUrl","resource","VideoModalController","selectedVideoFile","getVideoFile","videoFileIndex","getVideoFileIndex","VideoFileId","VideoLengthSeconds","ContentProviderId","fileInputValues","lastFileName","lastResourceUrl","removeEmptyVideoFiles","fileNameToName","openFile","fileChange","fileInput","textInput","clearPreviousFile","canSave","nameChanged","VideosController","selectcontentProviderId","Results","searchPlaceholder","canAddVideo","onContentProviderIdChanged","cancelSearch","addVideoModal","ContentProvider","ChartController","Response","MasterChartEntries","filteredCategory","MasterChartEntryModel","createEntry","selectedId","refreshContent","masterChartCategoryModel","newEntry","editCategory","userHasWritePermission","entityMap","\"","'","chartCategoryId","selectionId","dragEntryControlListeners","itemPosition","containment","below","above","dragCategoryControlListeners","ChartService","masterChartEntryModel","vme","croppieReady","ImageEditorModalController","croppie","quality","circle","img","uploadImage","resourceImage","ResourceId","ImageType","ImageUrl","updateResourceImage","imageUrl","deleteTempFile","tempFilename","Croppie","viewport","viewPort","showZoomer","enableOrientation","enableResize","enforceBoundary","defaultImageUrl","orientation","hasFile","typeName","imageType","AddTileResourceController","updateTileResources","LibraryCategoryId","categoryResources","switchLanguage","searchResources","addResource","isUtilized","resources","originalCategoryResources","languageIndex","showButtons","resourceOptions","destList","libraryOptions","libraryCategoryId","tileId","getLibraryResources","getTileResources","getResourceIdList","getLibraryTile","EditCategoryModalController","setPlaceholderText","MultilingualText","multilingualText","CategoryTextId","createNewCategory","serviceChanged","lastSelectedServices","categoryServices","availableServices","primaryLanguage","cat","createLibraryTile","updateTileServices","updateTilePopulations","updateLibraryTile","selectIcon","iconClass","getTilePopulations","getLibraryServices","getTileServices","IconPickerController","searchIcons","createIcons","iconClasses","include","ResourceLibraryController","sortMode","sortList","updateResourceSortOrders","getLibraryTiles","preProcessCategory","Viewed","Counts","Favorite","ThumbsUp","ThumbsDown","mTexts","showUID","userCanImportTiles","userCanExportTiles","userCanEditResourceLibrary","userCanReadResourceLibrary","libraryGroupName","showCategoryEditor","cancelBubble","CategoryId","deleteLibraryTile","deleteCategoryResource","deleteTileResource","HealthTipCount","VideoCount","searchLibrary","togglePublish","postItem","publishLibraryTile","sortResources","sortIndex","ResourceLibraryCategoryUId","getLanguageIndex","languageRepo","categoriesRepo","FilterBy","PageNumber","PageSize","tileServices","tilePopulations","imgBytes","Content-Type","updateResourceSortOrder","DashboardController","hasAdvancedWrite","dashboardCtrl","formatLastUpdatedDate","lastupdated","dateStyle","timeStyle","handleReportRunning","reportTypeId","excelOnlyReportGuid","isReportRunning","executionStatus","lastRunDate","exportReport","executionStatusText","cachedHtml","hasMissingReportPath","DisplayRunBtn","DisplayExportBtn","DisplayCreateBtn","DisplayEditBtn","DisplayScheduleBtn","DisplayViewSchedulesBtn","DisplayFullUIBtn","DisplayRefreshBtn","RunBtnClicked","ExportBtnClicked","CreateBtnClicked","EditBtnClicked","ScheduleBtnClicked","ViewSchedulesBtnClicked","FullUIBtnClicked","RefreshBtnClicked","LegacyReport","ReportActionType","StatusChanged","lastChild","SelectReportTypeController","okEnabled","selectionChanged","reportTypeSelected","EventsController","Idle","closeModal","initializeAuthorization","onbeforeunload","unwatch","Keepalive","timeoutInSeconds","keepAliveInterval","setIdle","setInterval","EditPhoneModalController","regexp","phoneNumberForm","changedPhone","changedEmail","removedPhone","removedEmail","Alertmessage","isConfirmed","newNumber","newEmail","emailPattern","InvitesPatientRow","InvitationStatusEnum","invitePatient","usePinValidation","editPhone","PhoneNumber","newValues","savePhoneNumber","PatientServiceLevelId","saveEmail","emptyValue","resendWelcomeMessage","InvitationId","statusUpdated","InvitationStatus","Invited","statusClass","statusIcon","statusText","currentAction","DobValidationFailed","WrongPerson","OptedOut","OptedIn","Expired","gotoPatientProfile","MESSAGEDETAILPAGESIZE","InvitationHistory","InvitationHistoryPage","userCanEditInviteList","GoAllowPasswords","showPen","HybridAppEnabled","showPinInPatientHeader","dobEditable","isDobDateMin","DateOfBirth","dobForm","populateMessageDetail","patientImage","savedDOB","newDate","newDob","toISOString","saveDateOfBirth","passwordSet","HasPatientPassword","showPin","confirmMessage","picker","openPicker","closePicker","detailToggle","getInviteMessageHistory","InvitationHistoryCount","showHidePen","showHideTooltip","InvitesController","ivm","PopulationGroupId","PayerId","recordType","inviteContentChanged","callSearch","openSearchHelp","modalText","filterSearch","searchTextKeypressed","keyEvent","fileterBy","usingPinValidation","UsingPinValidation","currentPageInvites","Invites","totalInvites","TotalInvites","startInvite","endInvite","inviteContentRepo","patientServiceLevelId","newPhoneNumber","invitationId","newDOB","dob","KitLogisticsUpdateKitDetailsController","kitCount","kitContentPromises","KitId","kitContents","Kit","saveKit","KitController","_lodash$find","kvm","bindEma","created","emaProvisioned","emaProvisionText","emaProvisiontext","getDeviceText","deviceId","Devices","fetchKitLog","getKitLog","LogPage","KitLog","CurrentKitLocation","KitStatus","network","NetworkOperatorId","owner","TabletOwnerId","currentStatus","KitStatusId","networks","owners","TabletOwners","kitStatuses","KitStatuses","KitLocations","shippingLocations","KitLocationTypeId","reprocess","KitShippingHistory","sipUrl","SipUrl","emaCallsEnabled","IsEmaCallEnabled","currentKitLocationId","KitLocationId","getTrackingURL","TrackingNumber","KitTrackingURL","bp","oxy","bs","spiro","pedo","spirometerEnabled","EnableSpirometerBiometric","pedometerEnabled","EnablePedometerBiometric","kitForm","KitTypeId","KitStatusUd","moveKit","foundStatus","defaultKitLocationId","DefaultKitLocationId","defaultKitLocationName","phoneNo","PhoneNo","phoneChanged","clickedProvisionEma","provisionEma","transaction","kitTypeName","KitTypeName","KitPoolName","userCanProvision","userCanEditNetworkTablet","userCanEditKitStatus","userCanEditDetails","userCanEditLocation","userCanEditReturnLocation","KitCreatedByEma","kitStatus","kitLocation","kitno","KitsController","klvm","bindKitResults","kitResults","selectedKits","totalKits","TotalKits","Kits","canMakeAvailable","canEditKitStatus","HasPatientAssigned","KitLocation","updateKitsDetail","moveKits","statusesAndLocations","updatedKits","changedKitStatusName","statuses","changedKitLocationName","KitIds","u","KitStatusName","KitLocationName","sortingId","toggleSelectAll","updateKitDetail","updateSelectedKitDetail","searchKits","canDeleteKits","canMoveKits","canUpdateDescription","deleteKits","arrayKit","anyPatients","deleteKit","makeAvailable","showSpirometer","showPedometer","sortings","kitIds","parseResponse","locationId","InUse","Shipped","MoveKitsModalController","chain","KitLogisticsEditLocationController","isNameEditable","locationTypeName","isHospitalAssociated","AssociatedHospitals","isNewLocation","hospitalLabelSingular","hospitalLabelPlural","hospitalOptions","areAllHospitalsAssociated","wasAllHospitalsOptionIncludedInOldSelection","isAllHospitalsOptionIncludedInNewSelection","saveLocation","associatedHospitals","savedLocation","KitLogisticsLocationsController","canEditLocations","locationTypes","canAddOrEditLocations","canEditHospitalAssociations","KitLocationRepository","HospitalRepository","deleteLocation","kitLogisticsLocationTypeEditor","editLocation","updatedLocation","NumberOfKits","addLocation","newLocation","goDevicesShippingInfoController","goDevicesShippingInfoModel","disabledByStatus","CurrentKitStatus","shippingmodel","GetLogisticsOrder","LogisticsOrderId","setFromModel","UpdateLogisticsOrderShippingInfo","getObjectToSave","X","Phone2","OrderNumber","DeletedDateTime_UTC","DeletedBy_Id","LogisticsStatusId","KitShippingInfoController","KitShippingInfoModel","IsPickup","enabledInstallMethods","GetkitshippinginfoForKitInfoId","KitShippingInfoId","isPickup","InstallMethod","UpdateKitShippingModel","pickup","numberofDays","kitPickUpdateFilter","formatDate","validatePickupDate","kitUpdateshippingForm","PickupDate","dateField","getNextBusinessDay","validateWelcomeCallDate","WelcomeCallDate","WelcomeCallDays","disabledDate","odate","InstallMethodId","OffSet","welcomeCallEnabled","EnableWelcomeCall","PickupTime","Note","ModifiedBy_Id","ModifiedDateTime_UTC","HasPendingShipOrder","KitPickupOptionId","datepickerOptionsWelcomeCall","dateDisabled","minDate","datepickerOptionsPickup","KitPickUpdateFilter","cloneDeep","KitShippingEducationMaterial","PatientLanguageModel","EducationLanguageId","EducationalMaterialLanguage","WelcomeCallTime","setKitAudits","getKitAudits","audits","setMessages","logisticsType","getKitShippingMessageGroup","messageGroup","getLogisticsOrderMessageGroup","setGoDeviceAudits","getGoDeviceAudits","setStatus","statusOrderedIcon","statusProcessingIcon","statusShippedIcon","statusDeliveredIcon","statusTextDisplay","getStatus","goDeviceTypes","LogisticsMessagingEnabled","PatientMessagingEnabled","detailExpand","LogisticsType","expandDetails","DeviceTypes","showMarkAsDelivered","AllDevicesShipped","hasFirstName","IsTitleClinical","getTrackingAuditDisplay","getGoDeviceTrackingURL","getAddress","address","openMessenger","MessageGroupId","createGroup","createGroup_fulfillment","goToPatientProfile","Patient_Id","markAllMessagesRead","markMessagesAsRead","UnreadMessageCount","rollbackStatus","updateShipping","updateKitStatus","history","OrderedKitStatusCreatedDateTime_UTC","ProcessingKitStatusCreatedDateTime_UTC","CurrentKitStatusCreatedDateTime_UTC","UpdateGoDeviceOrderStatus","OrderPendingStatusCreatedDateTime_UTC","DeliveredStatusCreatedDateTime_UTC","ship","isEditTracking","tracking","shipKitToPatient","ShipGoDevicesToPatient","ShipKitStatusCreatedDateTime_UTC","DeviceOrders","deviceOrder","AreYouSureThisHasBeenShipped","KitEditShippedWarning","editShipping","work","MarkDeviceOrdersInProgress","deliver","complete","getStatusLabelClass","markProcessing","LastKitStatus2","LastKitStatus","LastKitStatusCreatedDateTime_UTC2","LastKitStatusCreatedDateTime_UTC","markReceived","removeKit","deleteKitShippingInfo","markKitLost","hasGoDevice","LogisticsController","pageTitle","sortByText","sortByDirection","KitNumber","StatusChangeDate","KitPickupOption","isAudit","loadOrders","GetKitShippingInfo","deliveries","pageDisplay","useMarkMessagesByCaregiver","MarkLogisticsMessageAsReadForAllEnabled","switchSort","searchHelpTemplate","kitShippingInfoId","logisticsOrderId","shipping","orderId","logisticsOrder","GoDevicesLogisticsDeliveriesShipController","deviceOrders","onTrackingNumberChange","GoDevicesLogisticsDeliveriesWorkController","onOrderNumberChange","KitLogisticsDeliveriesShipController","KitLogisticsDeliveriesWorkController","KitLogisticsProvisioningController","isProvisioning","provisionKit","kitIndex","textClass","ktis","KitProvisioningRepository","provision","InboundKitsDirective","receiveKit","undoKit","InboundController","inboundKits","InboundKitDeliveries","availableKits","KitsAvailableToday","kitToReceive","kitNumberToReceive","receivedKit","changeKitStatus","LastKitStatusId","inboundOrderBy","orderInboundKits","receivedOrderBy","orderReceivedKits","AddChartModalController","patientData","messageList","acceptNoteVisible","submittingGroup","acceptNote","messageInterventions","toggleIntervention","TextPatientChartEntries","addEntryGroup","MessagePatientChartEntries","MessageId","getMessages","MessageInterventionPatientChartEntries","updateEntryGroup","PatientChartEntryGroupId","getPatientMessageGroup","getMessageGroup","messageGroupId","ignoreLoadingBar","GetMessagesForGroup","getMessageGroups","addMessage","messageText","addPatientMessage","Messenger","ParticipantNames","acceptMessages","Messages","startMessagePolling","selectedCount","showGroupList","showGroups","closeMessenger","patientGroupsIsCollapsed","kitShipGroupsIsCollapsed","kitPickUpGroupsIsCollapsed","caregiverGroupsIsCollapsed","showGroup","startGroupPolling","removeStateHandler","showMessenger","newMessage","stopMessagePolling","stopGroupPolling","showNewGroup","CaregiverMessagingEnabled","messagePoller","groupPoller","selectedGroup","updateMessages","Participants","CaregiverId","ParticipantName","focusMessenger","enterPressed","UnreadCount","scrollToBottom","markAsRead","UnreadByAnyMessageCount","UnreadByCaregiverMessageCount","unreadMessageCount","toggleSelection","patientGroups","IsPatientGroup","kitShipGroups","IsKitLogistics","IsKitPickup","kitPickUpGroups","caregiverGroups","IsCaregiverGroup","sortMessageGroups","sortByOrder","currentMessageCount","IsPatient","IsLogistics","ReadByAnyUser","ReadByCurrentUser","addMouseListener","drag","mouseUp","removeMouseListener","mouseDown","reposition","newY","newX","ActivityController","notification","profile","goapp","billingcodes","canViewRuleLog","canViewTagHistory","canViewCardHistory","canViewMessageHistory","canExportAudit","canViewGoAppHistory","canViewCPTBillingHistory","ActivityService","dateFormatString","getProfileHistory","getReadingHistory","getSurveyHistory","getAlertHistory","severityId","getRuleHistory","getPatientTagHistory","deletePatientTag","patientTagId","addPatientTag","getPatientCardHistory","getPatientMessageHistory","getGoAppHistory","getBilledCodesHistory","AlertHistoryDirective","alertClassName","alertHistoryPageChanged","alertHistoryPaging","alertFiltering","alertHistory","alertHistoryTotal","alertStatusName","alertHistoryRow","BilledCodesHistoryDirective","billedCodesHistoryPageChanged","billedCodesHistoryPaging","billedCodesHistory","billedCodesHistoryTotal","GoAppHistoryDirective","paging","historyTotal","historyPageChanged","historyPaging","activity","welcomeContent","features","EnableMessaging","RequestCallType","GoVirtualVisitsEnabled","EnableLibrary","GoAllowRememberMe","GoAllowStayLoggedIn","GoStayLoggedInDefault","EnableTrend","GoTechnicalIssueEnabled","handleDateChanged","PatientCardHistoryDirective","cardTotal","patientCards","cardType","manageDeviceModels","formatDetailsDate","cardPageChanged","getDetails","DisplayOrder","EndTime_UTC","HealthTipId","PatientMessageHistoryDirective","messageHistoryPageChanged","messageHistoryPaging","messageHistory","messageHistoryTotal","ProfileHistoryDirective","profileHistoryPageChanged","profileHistoryPaging","profileHistory","profileHistoryTotal","ReadingHistoryDirective","initializeCounter","readingHistoryPageChanged","readingHistoryPaging","readingHistoryStartDate","readingHistoryEndDate","readingHistory","readingHistoryExcelSrc","readingHistoryTotal","DefaultTempUnit","enableSpirometerBiometric","enablePedometerBiometric","enableInhalerBiometric","EnableInhalerBiometrics","phiWarningText","tempDate","RuleHistory","rulePageChanged","ruleHistory","Data","EventData","Event","PatientData","ruleHistoryExcelSrc","ruleHistoryTotal","SurveyHistoryDirective","surveyHistoryPageChanged","surveyHistoryPaging","surveyHistoryStartDate","surveyHistoryEndDate","surveyHistory","surveyHistoryExcelSrc","surveyHistoryTotal","TagHistoryDirective","tagHistoryPageChanged","tagHistoryPaging","tagHistory","tagHistoryExcelSrc","tagHistoryTotal","deleteTag","PatientTagId","newTagText","CaregiverToPatientTimeService","calculatePatientTime","currentDate","rightNow","rightNowNoTimeZone","ptTime","calculateCaregiverTime","caregiverTime","PatientChartController","toggleNotesExpansion","notesExpanded","expandCollapseButtonTitle","expandCollapseButtonIcon","mapGroup","CreatedBy","createdByName","First_Name","Last_Name","isClinical","mapTitle","ChartGroupHistories","auditByName","AuditBy","recentlyChanged","SourceName","canModify","canModifyNote","CreatedById","createdByid","audit","orderByDescending","getChartAudit","totalNotes","chartGroups","toggleSort","deleteNote","chartGroupId","deleteEntryGroup","getChartGroupsByRange","startDate_UTC","endDate_UTC","entryGroupId","EditEntryController","textareaBlurred","pageLeaveDirty","PatientChartEntryController","searchChanged","notes","InterventionPatientChartEntries","MasterChartEntryId","alertNotes","AlertPatientChartEntries","messageNotes","masterContent","showEmptyError","currentNote","notesToString","addedNote","inUse","addCustomNote","startText","openEditModal","saveNote","oldEntry","originalNotes","except","xor","note","decodeHtml","updateNote","noteId","formatLength","masterEntry","editNote","originalNote","oldNote","newNote","noteIsEmpty","deleteMessage","originalMsgNotesLength","bindMasterEntries","masterEntryResponse","usedMasterIds","CollapsePatientChartNotes","totalMasterEntries","Request","PatientChartEntryId","EntryGroupId","addPatientCaregiver","updatePatientCaregivers","removePatientCaregiver","patientCaregiverId","assignPatientCaregivers","caregiverList","patients","caregivers","removePatientCaregivers","CareteamModalController","availableCaregivers","filteredAvailableCaregivers","careteam","available","DemographicsController","ServiceLevelType","PatientMilestoneService","PatientMilestoneState","_patientMileStonePermission","editMode","races","Races","religions","Religions","populationgroups","PopulationGroups","currentSiteId","programdurations","ProgramDurations","patientProviders","providergroups","Referrals","Payers","timezones","TimeZones","patientDevices","patientMilestoneState","validationEnabled","ShowRequiredFieldMissing","contacts","showHl7Ident","AddSecondaryProviderToProviderList","showGoDeviceOrderStatus","showHomeServiceLevelInfo","photo","clearPhoto","focusLastName","enableEditing","getPatientDevices","hosp","IsThirdPartyMonitored","HL7UseVivifyID","datePickerOptionsDOB","datePickerOptionsProgramStartDate","disabledProgramDate","DOB","DateofBirth","getUTCDate","getUTCMonth","getUTCFullYear","getServiceLevel","serviceLevelData","_serviceLevelChanged","serviceLevelChanged","serviceLevelUnassignedListener","bindPatient","refreshPatientHeader","updatePatientMonitoringStatus","isKitPickupEnabled","EnableAllThirdPartyMonitoring","UsePinValidation","ShowProviderHL7Ident","payer","PatientCareManagementTypes","populationgroup","programduration","ProgramDurationId","providergroup","race","RaceId","referral","ReferralId","religion","ReligionId","setDefaults","handleUserNamePolling","ServiceLevelTypeId","validateBirthDay","updateTimeZone","hospitalTimeZone","validateProgramStartDate","_getServiceLevel","shippingStatuses","goDeviceOrderStatus","has","ServiceLevelKitNum","ServiceLevel","ServiceLevelId","ServiceLevelPIN","PIN","pin","ServiceLevelPhoneNumber","PhoneNum","goDevicesOrder","serviceLevel","getPatientUserName","monitoringStatusId","NewPatientIdent","PatientIdent","PatientProviders","patientProvider","IsPrimary","PersonalCaregiverNameField","PersonalCaregiverName","HospitalName","Race","Religion","PopulationGroup","ProgramDurationName","Referral","Payer","getUtcDate","primaryProvider","updatePersonalCaregiverFields","handleProviders","originalPatient","getPatientMilestoneList","setStonesFromBag","checkIdentifier","isTestValue","catchSavePatient","getTaskOrderDisplay","taskOrders","taskOrder","ignore","PersonalCaregiverContactNumber","PersonalCaregiverSpecialtyId","PersonalCaregiverProviderId","PersonalCaregiverFax","PersonalCaregiverHl7Ident","Hl7Ident","PersonalCaregiverTitleId","setPersonalCaregiverFields","PersonalCaregiverId","PatientProviderId","PrimaryProviderMasterId","typeaheadTitle","clearPersonalCaregiver","editDemographicsClick","createPatient","savePromise","PatientIdentifiers","IsTestPatient","savePatient","saveDemographics","savePatientDemographics","saveProgram","savePatientProgram","saveHospital","savePatientHospital","nameParts","FreeText","saveNewPatient","editServiceLevel","kitShippingStatusId","editCareTeam","editSpecialHandling","patientSpecialHandling","editDemographics","editProgram","pmilestone","saveMileStoneList","getPstonesToSave","setPatientMilestones","restoreMilestones","editHospitalInfo","enableAllThirdPartyMonitoring","IsMrnDisabled","editProviders","editing","personalCaregiverRoles","getCaregiverSpecialties","isPrimaryCaregiverEdited","isFreetext","addProvider","updateFreetextProvider","addFreetextProvider","removeProvider","updateProviderGroup","editEmergencyContacts","contact","removedContact","identifierType","ident","IdentifierType","Identifier","currentPatientId","exists","checkHasError","providerGroupList","providerName","providerGroupId","selectProviderGroup","providerId","formatCareManagementTypes","payerChanged","mapFormFieldsArray","formFields","serializedDate","searchField","CustomField","Address1","Address2","Zipcode","Phone1","EmpiIdent","AccountIdent","VisitIdent","HL7DeptIdent","HL7Custom1","HL7Custom2","RiskId","RequireShipping","PatientIdentifierFields","saveKitShippingInfo","saveCaregiver","cancelShipping","cancelShippingForRequestByKitType","SearchPatientDuplicate","getPatientKitShippingStatus","EditDemographicsModalController","canDeleteEmail","photoChanged","EmergencyContactsController","ecvm","addNewRow","lastContact","relationship","contactNumber","addEmergencyContactForm","createdContacts","updatedContacts","removedContacts","createdPromise","addContacts","updatedPromise","updateContacts","removedPromise","removeContacts","removeContact","updateContact","focusNameElement","defaultCountry","Relationship","Phone_No","contactIds","typeIcons","8","13","35","58","64","66","67","68","typeAbb","getTypeAbb","getTypeIcon","devices","enableSpiro","enablePedo","KitShippingDirective","orderedLang","defualtLanguage","patientLanguage","logisticsInfo","validateDate","enableWelcomeCall","logisticsOptions","PatientHospitalModalController","updateCareManagementTypes","currentPayer","isMrnDisabled","getMrnTitle","updatePatientHospital","updatePatientTimezone","TimeZoneName","updatePatientReferral","updatePatientPayer","payerHasManagementTypes","getMileStoneList","metod","DateUtilities","_patient","OriginalBag","patientMilestones","patientMilestonesHeader","MilestoneList","_invalidDates","CreatedDtUTC","TimeZoneAndroidId","PatientMilestones","getPatientId","EditingDate","EventDateTime_UTC","bag","PatientMilestoneId","inThePast","setMilestones","BackupMileStones","MilestoneDateOptions","validateMileStoneDate","stone","PatientSearchController","setProgramDateText","MonitoringStatusChangeDate","programDayText","PatientSearchFields","MRNIndent","Phonerequired","patientSearch","PhoneSearch","CancelSearch","SearchPatients","SearchPatientListResult","programDate","programTotalDaysText","programStatusText","ProgramDurationTotalDays","pristinePatientSearchFields","createNewPatient","createNewVisit","createNewEncounter","ProgramModalController","filterMilestones","updateProgramDuration","validatedate","PatientProvidersController","clearProvider","newProvider","allProviderGroups","originalPatientProviders","focusProvider","canFreetext","editableProvider","patientProviderPostModel","SpecialtyId","addNewProvider","newprovider","isNewRow","originalPersonalCaregiverName","originalPersonalCaregiverContactNumber","addSecondaryProviderToProviderList","isRemoved","updateProviderGroupFields","providerMasterId","PersonalCaregiverSpecialty","toggleOther","patientProviderForm","demographicsProviderForm","allProvidersValid","PersonalCaregiverRole","newPatientProviders","newPatientProvider","IsNewRow","isProviderRequired","ProvidersDirective","updateProvider","patientProviderId","getProviderByGroup","ProviderUpdateDirective","setIsFreetext","toggleFreetext","updatePatientProvider","updateProviderForm","editableSpecialties","ServiceLevelWizardService","serviceLevelType","PhoneNumRequired","wizard","EmailRequired","PhoneOrEmailRequired","dateOfBirth","isByodServiceType","isGoServiceType","usePin","requireDob","useHybrid","byodDateOptions","byodDate","byodDateChange","byodWelcomeDate","validateEitherPhoneOrEmailExist","byodTimeOptions","byodTime","byodTimeChange","byodWelcomeTime","byodPin","generatePIN","EmailId1","GoWelcomeCallDate","GoWelcomeCallTime","skipDeviceSelection","showOk","showNext","wizardForm","confirmationController","fromConfirmation","shippedDevices","DeliveryOptionId","handDeliveredDevices","IsEditMode","toggleDevice","DeliveryOptions","checkForActive","toggleDeliveryMethod","enableNext","shippingController","goDeviceShippingInfo","provinceExp","zipAndPostalExp","zipExp","postalExp","nonPoBoxPattern","statePattern","zipPattern","ivrPhoneNumber","IvrPhoneNumber","ivrWelcomeDateOptions","ivrDateChange","welcomeDate","ivrWelcomeDate","ivrWelcomeTimeOptions","ivrTimeChange","welcomeTime","ivrWelcomeTime","IvrWelcomeCallDate","IvrWelcomeCallTime","ivrPin","getPatientKit","getPatientKitCommon","getLatestGoDeviceOrderStatus","getKitAttributes","kitPoolId","kitTypeId","KitPoolId","kitDevices","getKitNo","getKitStatus","getKitStatusDate","mapDevices","kitDevice","getDevice","hasKitDevice","MapConfiguration","configurationRanking","mapKit","kitModel","statusDate","hasWt","hasBP","hasSpO2","hasBS","hasTemp","hasSpiro","hasPedo","isTabletOnly","kitCuffAttributeId","KitCuffAttributeId","kitScaleAttributeId","KitScaleAttributeId","hasPendingShipOrder","DisplayDetails","displayDetails","displayKitNo","mapTaskOrder","TaskOrderId","TaskOrderNumber","getPatientConfigurationRanking","_getPatientConfigurationRanking","ConfigurationName","getPatientConfigurationCategory","mapPatientServiceLevel","serviceLevelId","ServiceLevelType_Enum","TaskOrders","configurationRankingId","ConfigurationRankingId","configurationCategory","isEulaAccepted","EulaAcceptedDateTime_UTC","invitation","Invitations","_getPatientServiceLevelWithKitInfo","isNewPatientServiceLevel","kitCommon","kitScale","kitCuff","selectedBPCuffSizeName","SelectedBPCuffSizeName","selectedScaleTypeName","SelectedScaleTypeName","KitShippingStatusId","kitType","KitTypeDesc","kitPool","t4","kitCuffs","KitCuffAttributes","kitScales","KitScaleAttributes","AttributeId","LogisticsStatusName","getAvailableKits","getAvailableKitTypes","getIvrConfiguration","defaultDate","defaultTime","getIsEmaEnabled","isShippingEnabled","isPickupEnabled","updateTaskOrders","validModels","ServiceLevelRpmKitDirective","manager","manual","displayOnly","selectKit","manualKit","showTopKit","setKit","orgkitDevices","getKit","selectedKit","selectKitNumber","toggleState","biometric","selectedState","loadNextPage","filterBiometricFilters","isFilter","getDeviceName","getDevices","getDeviceList","initStep","serviceLevelLogisticsType","callTimeOptions","IsCustomer","selectedKitPickupOption","welcomeCallDays","PickupFromPatient","kitShippingIncluded","showForm","ServiceLevelRpmKitship","kitshippingForm","defaultInstallMethod","selectedKitType","selectedKitPool","truncate","$$watchers","selectedKitKitPool","KitPools","DoesShipToPatient","noAvailableKits","ServiceLevelRpmManager","slw","enterKitNo","kitNoFocused","clearManual","setKitSelectionValues","filteredKitCount","KitCount","selectedKitCuff","selectedKitScale","kitList","EnableRequestByKitType","DisplayCount","KitLicenseLimit","hasKits","canLoadMore","enableKitWizardEnterKitNo","EnableKitWizardEnterKitNo","defaultKitPoolHelpText","DefaultKitPoolHelpText","defaultKitTypeHelpText","DefaultKitTypeHelpText","defaultKitSelectionHelpText","DefaultKitSelectionHelpText","limitKitOrderingWhenKitPoolIsEmpty","LimitKitOrderingWhenKitPoolIsEmpty","isSkip","manualFunc","setFunc","getAvailableKitLicenseCount","homeServiceLevelAssignedCount","lostKitsCount","numKitLicenses","_args","getHomeServiceLevelAssignedCount","getLostKitsCount","setManual","noKitLicense","nextButtonTooltip","noLicenseMsg","setKitPool","_ref3","numKits","openShipRecords","getOpenKitShipsKitPool","Count","setKitType","_ref4","getOpenKitShipsKitType","_x3","setUnassignOption","successFunc","getAvailableKit","debounce","deviceStates","deviceName","getKitIcons","kitTypes","deviceList","resetKitDevices","ServiceLevelRpmPoolDirective","clearErrors","poolKitNumber","selectManualEntry","ele","selectKitPool","kitPools","IsDefaultSelectedCtp","heading","subHeading","getPatientConditionValues","filteredKitPools","postfixConditionList","ServiceLevelRpmTypeDirective","selectKitType","KitTypes","typeKitNumber","selectCuff","cuff","selectScale","servicelevelRpmUnassign","IsCancel","DoesPickupFromPatient","getWarning","showBack","isKitServicelevel","originalServiceLevel","ServiceLevelConfirmationDirective","deviceTypeId","shipText","buildShipText","educationalMaterials","ServiceLevelSelectionDirective","selectServiceLevel","isGo","nonPendingStatuses","logOrders","PendingDevices","ShippedDevices","originalServiceLevelId","IsTransition","getPatientDeviceOrders","PatientDevice","DeviceModel","kitManager","assignWorkflow","finish","isCurrentServiceLevel","IsAdd","unassignedServiceLevel","EMAServiceLevelCode","EnableVideo","TabletRequired","TaskOrderRequired","kitFilters","activeServiceLevelId","serviceLevelFilter","goSl","canAddGoDevices","goDevicesEnabled","ServiceLevelWizardController","selectedConfigurationRanking","previousStep","selectedWorkflow","getWizardSteps","originalServiceLevelTypeId","serviceConfigurationRankings","kitServiceLevels","updateWorkflow","serviceLevelForm","isActiveServiceLevelType","_len","serviceLevelTypes","isSelectedServiceLevelType","_len2","_key2","getResendModalText","presave","_presave","_save","isTransition","createGoDevicesOrderModel","saveServiceLevel","savePatientGoDevices","setConfigurationRankingOptions","DefaultRanking","goServiceLevel","isKit","goDeviceWorkflow","goDevices","getGoDevices","requireValidation","kitpoolId","KitInShippedWarning","_saveServiceLevel","isManualKit","isUnassign","serviceLevelPhoneNumber","patientServiceLevelModel","kitShippingModel","rawMaterials","isRequestByKitType","IvrWelcomeDate","IvrWelcomeTime","ByodDate","ByodTime","selectedBPCuffSizeId","selectedScaleTypeId","formatEducationModelsForSave","unassignServicelevel","getKitPool","Reprocessing","CreatePickupOrderForCustomerPickup","createProfileHistoryEntry","updatePatientServicelevel","updatePatientData","saveDOB","material","EducationalMaterial","IsSuccess","logToPatientProfileHistory","patientDevicesOrderModel","_canAddGoDevices","patientProgramId","serviceLevelConfigs","configValue","byodConfigs","programConfig","deviceConfig","deviceConfigOk","getConfigs","GoDevices","_getGoDevices","popDevices","GetByPopulation","hasDevice","patientDevice","PatientDeviceStatusId","DeviceModelPopulationDeliveryOptions","IsDefaultDevice","HasDeviceWarning","DeviceModelDeliveryOptions","deviceData","_x6","_x7","selectedDevices","patientDeviceModels","DeviceModelName","PatientDeviceModels","_x4","_x5","kitCuffId","kitScaleId","Page","isIvr","IvrPinValidationLength","PinValidationLength","isDuplicates","isSequential","isKitAssigned","maxHeightStyle","max-height","maxDeviceHeightStyle","selectionStep","confirmationStep","background-color","wizardSteps","_x8","_x9","WizardStepDirective","stepName","SpecialHandlingModalController","specialHandlingList","visibleSpecialHandlingList","getSpecialHandling","apiRequests","sp","removePatientSpecialHandling","PatientSpecialHandlingId","addPatientSpecialHandling","specialHandlingId","patientSpecialHandlingId","BiometricModalController","liPatient","patientTimeZoneName","observationDate","showDatePicker","HbA1cMin","HbA1cMax","HbA1cFormatErrorText","ClicksMin","ClicksMax","defaultQuestions","ParentPatientSurveyQuestion","weightUnitTypeOptions","WeightUnitType","HbA1cUnitTypeOptions","HbA1cUnitType","temperatureUnitTypeOptions","TemperatureUnitType","bloodSugarUnitType","DefaultBloodSugarUnit","hbA1cUnitType","DefaultHba1cUnit","bloodSugarStep","bloodSugarMin","bloodSugarMax","bloodSugarFormat","bloodSugarFormatErrorText","HbA1cStep","hbA1cFormat","BiometricAnswer","BloodPressureTime","ObservationDateTime","BloodSugarTime","WeightTime","weightUnit","DefaultWeightUnit","HbA1cTime","ControlClicksTime","RescueClicksTime","PulseTime","OxygenTime","TemperatureTime","tempUnit","Pef","SpirometerTime","FevOne","FevRatio","StepsTime","focusId","hasQuestionType","questionTypeId","hasQuestion","hasPulseOnBloodPressure","hasPulse","bpQuestion","propagateTime","updateMaxTime","patientMaxTime","tomorrow","maxTime","updateBiometricModels","getHours","answers","CompleteModalController","DirectEntryController","patientInfo","loadDirectEntryContent","directentry","surveyQuestionTypeIds","biometricQuestions","allQuestions","PatientSurveyQuestions","allOptions","nestedQuestions","ParentPatientSurveyOptionId","ParentPatientSurveyOption","PatientSurveyOptionId","Visible","DisplayConditionResult","HideDisplayCondition","TextTemplate","isCollapsed","IsAnswered","Selected","Answer","CustomResponseAnswer","ApplyAnswerToSurveyQuestion","ApplyAnswersToSurveyQuestions","ApplyAnswersToBiometricQuestions","ApplyAnswersToHealthTips","processRules","ChildPatientSurveyQuestions","anyAvailableSurveys","QuestionFilter","displayIndex","originaldirectentry","deepCopy","reloadDirectEntryContent","isValidDueDate","processDueDateChange","responseTime","unansweredQuestions","unanswered","att","address1","Highlight","unhighlightAllQuestions","saveEntries","showTimeRequired","directEntryForm","openBiometrics","dueDate","responseTimes","setResponseTime","ShouldSave","ConditionValues","bloodSugarOption","bpAnswer","systolicOption","diastolicOption","pulseAnswer","pulseOption","oxygenOption","weightOption","HbA1cOption","temperatureOption","pefOption","fevOneOption","fevRatioOption","stepsOption","shouldComplete","surveysToComplete","unique","savePatientResponses","gdcc","isFutureDate","isAfter","processHealthTipText","getResponseForQuestion","observationDateTime","patientResponse","PatientResponseInputMethodId","IsPatientSurveyCompleted","PatientResponseValues","readingTypeOption","bloodSugarResponseValue","readingTypeResponseValue","unitTypeResponseValue","weightResponseValue","HbA1cResponseValue","temperatureParameterTypeId","temperatureResponsevalue","patientResponseValue","getBiometricResponses","customQuestionType","address2","city","zip","getCustomQuestionResponses","patientResponses","overallResponseDateTime","patientTimeFormat","caregiverOffset","patientOffset","surveyComplete","QuestionDirective","devm","_controllers","surveyController","formController","DateTimeFilter","questionTemplates","singleSelect","multiSelect","healthtip","alphanumeric","numeric","dateMonthYear","cloned","isVideo","isBiometric","isCustomResponse","isMultiSelect","isSingleSelect","isAlphaNumeric","isNumeric","isAddress","previousDaysAllowed","futureDaysAllowed","singleSelectLongOption","states","isTime","isDateTime","isMonthYear","decimalPlacesAllowed","datepickerMode","getDatePickerOptions","clickedBiometric","longSelectChanged","selectedOptionId","formatAnswer","siblingOptions","siblingOption","qo","toggleCollapse","healthTipSelected","customResponseQuestionAnswered","isValidAddress","showModifiedField","patientForm","cDate","mDate","PatientFormController","FormQuestionType","pfvm","getParameterText","uom","setFormsComplete","isComplete","IsComplete","setVariables","currentQuestionValues","variables","FormVariables","medicationQuestion","FormSections","FormQuestionTypeId","AnswerText","Medications","hasPatientParameterType","pulseOxParams","savedParams","pulse","low","high","Med_Alert_Pulse","High_Alert_Pulse","setPulseParameterQuestions","PulseOxParameters","oxygen","medium","Med_Alert","High_Alert","setOxygenParameterQuestions","bpParams","medium_upper","medium_lower","high_upper","high_lower","Systolic_MedUL","Systolic_MedLL","Systolic_HighUL","Systolic_HighLL","Diastolic_MedUL","Diastolic_MedLL","Diastolic_HighUL","Diastolic_HighLL","setBloodPressureQuestions","BloodPressureParameters","weightParams","dailyGain","dailyLoss","UnitOfMeasure","Baseline_Weight","High_Alert_Lbs","Med_Alert_Lbs","Med_Alert_Lbs_Weekly","Max_Weight","Min_Weight","setWeightQuestions","WeightScaleParameters","setParameters","formPageHeader","getFormVariable","PageHeader","formPageFooter","PageFooter","currentMedications","formVariableQuestions","isSaveable","Question","FormQuestionId","FormOptions","variableValue","VariableName","mapPostProcessing","resultName","ResultName","resultValue","ResultValue","checkIfComplete","isSendDisabled","SendLockDateTime_UTC","pastForms","canAddNew","Include","graphData","saveForm","selections","SelectedOptionId","FormOptionId","selectedItemIds","Checked","SelectedOptionIds","Rows","toUTCString","o2","PatientFormId","PostProcessor","PatientFormSelections","AutoRunPostProcessor","submitForm","saveResults","postProcessingPromise","saveData","pastFound","runChartPostProcessor","postProcess","ppResponse","runHrmPostProcessor","gridChanged","lastRow","addEmptyGridRow","gridLostFocus","showChartButton","GraphDataDefaultDays","showHrmButtons","getTitleForSendButton","PostProcessorResult","pendingPostProcessor","pastForm","weightData","WeightBiometrics","Parameter","PatientFormParameterId","graphEndDate","PatientFormPatientResponses","Biometrics","biometrics","Responses","weightResponses","pulseOxResponses","pulseResponses","pulseBpResponses","pulseOxValues","pulseValues","pulseBpValues","o2Responses","o2Values","bpResponses","buildGraphs","PatientFormsController","determineAvailableForms","formsTitle","FormTypeName","FormPopulations","availableForms","Forms","canAdd","PatientForms","pendingPostProcessors","postProcessor","LastPatientForm","saveModel","formType","Required","PatientFormGraph","xDomain","filterDate","showNoData","minHeight","classed","nice","xAxisG","tickFormat","tickSize","baselineData","thead","tbody","columns","columnData","Low","Baseline","column","buildLegendTable","PatientSurveyFormController","Surveys","CompleteInfo","shortDate","answered","Alerts","showNoteField","avatar","riskStatus","riskId","AddCPTCodeBillingController","billingCodes","AddCptCodeBillingService","eligibleCodes","patientDate","createdDtUTC","minDateYear","minDateMonth","minDateDay","getEligibleCodes","pickerOpen","datePickerOpen","addCPTCodeBilling","billings","selectedCodes","CPTCodeBilling","addCptCodeBillings","cptCodeBillings","cptCodeId","DateTime_UTC","AddTimeLogDetailController","createDate","isDescriptionOptional","cmtRequired","currentYear","timeLogYear","timeLogMonth","stopTime","AlertStatusFilter","alertSeverity","AlertStatusBarDirective","showBothWeight","displayTempCtrl","biometricExceptionsEnum","BloodGlucose","OxygenSaturation","ControlUse","RescueUse","reviewed","surveyStatus","getIconStatus","surveyTooltip","getIconTooltip","surveySeverityColor","findTextColor","weightStatus","weightTooltip","weightSeverityColor","bpStatus","bpTooltip","bpSeverityColor","glucoseStatus","glucose","glucoseTooltip","glucoseSeverityColor","pulseStatus","pulseTooltip","pulseSeverityColor","oxygenStatus","oxygenTooltip","oxygenSeverityColor","tempStatus","temperature","tempTooltip","tempSeverityColor","spiroStatus","spirometer","spiroTooltip","spiroSeverityColor","notificationStatus","generalStatus","lastReading","general","getGeneralIconStatus","sleepTooltip","sleep","sleepStatus","sleepSeverityColor","stepsStatus","stepsSeverityColor","stepsTooltip","controlStatus","control","controlToolTip","controlSeverityColor","rescueStatus","rescue","rescueToolTip","rescueSeverityColor","shouldShowIcon","patientHeaderConfigurationId","dateText","notificationTooltip","generalTooltip","hoursNotResponsive","daysNotResponsive","daysNotResponsiveText","bpValue","sleepValue","controlValue","rescueValue","stepsValue","isSkipped","tempValue","fahrenheit","celsius","defaultUnit","weightValue","noAlertIcon","DisplayGreenBiometricIcons","latestAlertSeverity","readingDate","biometricDate","iconData","nameData","toolTip","addSubtip","pef","fevOne","fevRatio","pounds","weightValues","kilograms","milligramsPerDeciliter","glucoseValues","millimolsPerLiter","baselineValues","biasMinutes","isDST","daylightSavingsBias","standardBias","glucoseValue","surveyText","completedSurveys","availableSurveys","getTooltip","LastReadingDateTime_UTC","labelName","getTooltipLabel","TypeName","IsLastReadingSkipped","BiometricMeasurementTypeId","LastReadings","Key","readingHour","readingMin","LastReadingUnit","getLabel","wtUnit","glucosePosition","getSeverityColor","LatestAlertSeverity","HighestAlertSeverity","CallStatusDirective","VideoCallService","callType","enableVideo","GoWebShowPhoneIcon","goPlatformId","canCall","callAlertSeverity","CallToEnabled","callAlertDateTime","minutesSince","timeSince","callDuration","videoVisitTooltip","VisitStatus","InProgress","Ended","InWaitingRoom","PatientNotJoined","CareMemberNotJoined","CallRejected","Cancelled","patientsScheduledVirtualVisits","subscribe","visitsListFiltered","filterVirtualVisitsByPatientId","ScheduleDateTime_UTC","callPatient","callAlertId","getPatientCallAlert","CallDuration","hasNotificationPermission","getPermissionStatus","optedIn","isPatientScheduleVirtualVisitEnabled","getPatientScheduleVirtualVisitEnabled","hasEulaAccepted","hasPatientAcceptedEula","scheduledVisitsList","getPatientScheduleVirtualVisits","isDisableScheduling","IsDisableScheduling","isEnableScheduleNowPreNotification","EnableScheduleNowExperiencePreNotification","isEnableScheduleNowPreNotificationConfirmation","EnableScheduleNowExperiencePreNotificationConfirmation","CopyBiometricsModalController","MonitoringBiometricsService","patientBiometricTypes","formattedText","includeChartNotes","dataLoaded","HEADING_WEIGHT","HEADING_BP","HEADING_PULSE","HEADING_BS","HEADING_OXY","HEADING_TEMP","HEADING_FEV1","HEADING_PEF","HEADING_FEVRatio","HEADING_STEPS","bpValues","bsValues","oxyValues","tempFValues","tempCValues","stepsValues","pefValues","fevOneValues","fevRatioValues","populateSummaryObj","summaryObj","padValue","ave","decimalPlaces","dec","countDecimals","writeBiometricSet","biometricDates","responseTypes","lineFeed","dashes","dailyReadingIndex","readingsAvailable","bio","hasWeight","getBiometricByDate","hasOxygen","hasFEV1","hasPEF","hasFEVRatio","hasSTEPS","formatBiometricValues","startNewHeader","totalLengthExpected","responseValues","surveyParameterTypeId","getBiometricsByParameterType","getBiometrics","availableBiometricParameterTypes","patientParameterType","selectedBiometricParameterTypes","copytoclipboard","fetchData","logPatientDataPreview","formattedStartDate","formattedEndDate","getSelectedParameterTypes","valIndex","responseValue","PatientResponseId","OriginalValue","consolidateBloodPressureValues","parseBiometrics","currentResponseArray","columnIndex","startHeader","summaryValues","summaryIndex","diaValues","tempValues","populateSummary","parseChartNotes","getPHIWarningText","GeneralAlertModalController","patientAlertType","alertDelay","alertDate","roundedUp","alertTime","saveAlert","alertDateTime","buildAlertDateTime","AlertDateTime_UTC","saveGeneralAlert","textRemainingClass","HealthScoresDirective","recentScores","lastScore","lastScoreClass","isToday","historyElem","dayscore","scoreValue","patientOptedIn","isOptedIn","canSendMessages","messagingEnabled","enableMessaging","statusChangedDate","showReason","showSubReason","showReasonNotes","backDatePermission","dateSelected","assignStatus","defaultReason","monitoringStatus","statusChangeReason","originalMonitoringStatusId","assignChangeReason","dayOf","validDate","validBackDate","dateEntered","mostRecentStatusChangeDate","mostRecentStatusChangeDtUTC","validateBackDate","formatMostRecentStatusChangeDtUTC","MonitoringStatusManager","msw","loadUnassignData","MonitoringStatusWizardController","patientStatus","monitoringStatuses","enableBack","enableCancel","enableStatusPicker","originalStatusId","Statusid","mostRecentRecord","IsFinalState","reasonText","monitoringStatusChange","heightStyle","min-height","kitPickup","workflow","monitoringStatusForm","getServiceLevelType","includeStatusReason","includeStatusSubReason","includeReasonText","statusChangeSubReason","OriginalMonitoringStatusId","MostRecentRecord","ReasonText","StatusName","saveMonitoringStatus","PatientDemographicsDirective","statusName","kitStatusName","kitStatusDays","showKitStatusLink","showKitStatusText","kitStatusId","ShowRaceMRNOrLast4InHeader","displayfield","nameTooltip","newdate","isPatientList","avatarData","PatientCallModalController","callTimer","inVideoCall","ScheduleVirtualVisitEnabled","ScheduleVirtualVisitButtonEnabled","headingText","postponeCall","postponePatientCall","callPatientNow","newTimeLog","videoCallNow","endCall","TEXT_INITCALL","requestCall","MeetingId","TEXT_CONTACTTAB","IsVideoProviderInTouch","ackTimer","ackTimeoutCallback","AckTimeout","getMeetingInfo","videoCall","videoCallUrl","start_url","checkCallStatus","StatusCheckDuration","getInTouchCaregiverMeetingUrl","handleException","videoCallNowText","scheduledvideoCallNowText","sendPreNotificationText","scheduleVisit","visit","saveScheduleVirtualVisit","TEXT_RINGINGTAB","startStatusCheck","checksHomecheduleVisitStatus","checkVirtualVisitTimer","scheduleNowVideoVisit","joinVirtualVideoVisit","liPatientkitNumber","virtualVisitId","maxLengthScheduleVisitNotes","careMemberTimeZone","sendPreNotification","sendScheduleNowPreNotification","ringTimer","scheduledVideoVisitTimer","TEXT_CONTACTTAB_TIMEOUT","TEXT_CALLACCEPTED","TEXT_CALLDECLINED","TEXT_CALLENDED","TEXT_CALLCOMPLETE","CallStatus","launchVideoWindow","launchZoomWindow","ringTimeoutCallback","getCallStatus","CallStatusId","RingTimeout","clearAllTimeouts","clearCallAlert","checkscheduleVisitStatus","scheduledvisits","scheduleDate","VivifyVirtualVisitId","indexId","RecordId","intervalTimer","scheduledVideoVisitTimeout","joinVideoVisit","cancelScheduledVisit","videoVisitId","datetimeString","mdate","cancelScheduleVideoVisit","IsScheduleVideoVisitStarted","videoVisitStatus","phoneCallNow","remoteNotificationsEnabled","disableCallButtons","disabledToolTip","PatientHeaderDirective","PatientTimeLogUtilitiesService","isTimeLogEnabled","directEntryEnabled","isPatientDataTransferEnabled","showDirectEntry","originalPatientNote","getRiskClass","addPatientNote","completedPercent","completedDays","durationDays","guageStyle","chartRouteActive","shouldShowChartSubmenu","activityRouteActive","shouldShowActivitySubmenu","showRiskModal","originalRiskId","newRiskId","showMonitoringStatusModal","getPatientStatus","getMonitoringStatuses","newMonitoringStatusId","bindProgramStuff","showGeneralAlertModal","showNotificationModal","showBiometricsModal","questionHasAnswer","showCopyBiometricsModal","getPatientBiometricTypes","reviewPatient","setPatientreviewed","canMarkPatientReviewed","reviewIsNotCompleted","hasNoUnansweredAlerts","patientHasAlert","completedSurveysToday","availableSurveysToday","finishedAllSurveysToday","hasSurveysToday","patientIsReviewed","hasAlert","showAddTimeLog","offsetDate","setYear","getMonthOffset","updateDate","showAddCPTCode","CPTCodes","CPTCodesList","cptCodes","showExternalSite","ExternalLinkUrl","ExternalLinkMenuText","ExternalLinkIcon","clinicalWatcher","getTimeLogModel","isPatientListClass","monitoringGridUrl","stateListener","monitoringStatusChangeDate","timeLogSeconds","totalTimeSeconds","clinicalTimeSeconds","launchCallModal","mapProvider","mapSpecialHandlings","mapNotification","mapListItemDataPoint","dataName","valueMapper","dateKey","activeKey","mapValue","mapBasicValue","lastReadingDate","lastValue","LastTemperatureSurveyParameterTypeId","BaselineWeight","Pounds","Kilograms","BaselineWeightUnit","mapProgramData","isFinalState","mapLastScore","Score","scoreDate","ScoreDate","scoreStatus","invalid","IsInvalidScore","mapScores","RecentScores","mapTimeLog","TimeLogClinicalSeconds","TimeLogTotalSeconds","mapAge","mapName","invitationStatusId","InvitationStatusId","phone1","phone2","phone1Label","Phone1Label","phone2Label","Phone2Label","IVRPin","BYODPin","ServiceLevelName","PatientTimeZoneBias","PatientTimeZoneDaylightBias","isThirdPartyMonitored","isCcm","IsCCM","isRpm","IsRPM","isCpt","IsCPT","Reviewed","populationGroup","Population","KitStatusDays","isActivePatient","IsActivePatient","PatientTimeZoneName","CallAlertId","HighestPhoneAlertSeverity","CallAlertDateTime_UTC","Age","SurveyCount","CompletedSurveyCount","LastNotificationMessage","GeneralAlertMessage","specialHandlings","isClinicalTimeMeasured","careManagementList","HoursNotResponsive","IsOptedIn","GoPlatformId","virtualvisit","RemoteNotificationsEnabled","mappedBiometrics","LastWeight","LastWeightUnit","LastSystolic","LastDiastolic","LastSteps","LastBloodSugar","MilligramsPerDeciliter","MillimolsPerLiter","LastBloodSugarUnit","LastControl","LastRescue","LastTemperature","Celsius","Fahrenheit","LastHour","LastMin","LastPEF","LastFEVOne","LastFEVRatio","saveRisk","getNotificationsEnabled","RiskModalController","riskLevels","riskLevel","differentRiskSelected","newRisk","SchedulevirtualvisitController","instructions","createTime","zoneAbbr","careMemberTimeZoneText","meetingId","visitid","patientSet","onAction","selectedCaregivers","isUpdating","currentUser","user","unchangedCount","UpdatedPatients","toast","Notifications","PatientListFiltersDirective","AlertFilter","PatientListSortBy","filtersChanged","canSeeAll","defaultCaregiverId","addToArray","addDefaultCaregiver","addDefaultHospital","updateCaregiverIds","ViewAll","Caregivers","updateHospitalIds","changeSortDropdown","timelogSorting","ClinicalTimeOnly","loggedInCaregiver","isClinicalChanged","clearAll","BIClickData","VirtualVisits","saveFiltersToDatabase","caregiverSelect","hospitalSelect","IsMonitoring","NonFinalStatusFilterEnabled","allCaregiver","initFilters","patientListUiSelect","$select","refreshItems","PatientListController","plvm","PatientHeaderConfigurations","IsSpirometerEnabled","IsTimeLogEnabled","IsPatientDataTransferEnabled","tempUnits","DefaultTemperatureUnit","displayBothTempUnits","ShowBothTemperatureUnits","multiSpecialHandlingColor","MultipleSpecialHandlingColor","displayBothWeight","ShowBothWeightUnits","pages","pageLengths","DefaultPageLengths","showFilters","showActiveFilters","clearSelections","configItems","toggleFilters","showSearch","toggleSearch","toggleSelect","showSelection","selectActions","getActionMenu","selectedPatients","toggleSelectPatient","selectedAction","toggleActiveFilters","isPatientSelected","actionSelected","actionCompleted","removeFilter","displayText","defaultHospital","removeHospitalFilter","defaultCaregiver","removeCaregiverFilter","CaregiverFilters","mainDisplay","numActiveFilters","activeFilters","triggerSearchFocus","canSeeAllPatients","canSelectPatients","hasSelectPermissions","CPCompleted","KitAssigned","PatientCreated","SpecialHandling","TimeZone","checkForOldFilters","replaceState","updatePatientList","keepSelected","ignoreSoftStop","countDisplay","IgnoreSoftStop","checkResultStatus","resultStatusEnum","HardLimitReached","retrievePatientsComplete","showHardLimitDialog","SoftLimitReached","okButtonText","showSoftLimitDialog","getMainDisplayText","startingPatient","biClick","updateToPlural","filterChanged","filterCount","_populationGroup","_populationId","_programDurationId","riskDisplayText","goDisplayText","_providerGroupId","_payerId","_serviceLevelTypeId","hospitalFilters","activeFiltersCount","setFiltersText","getDisplayText","getPatientsScheduleVirtualVisits","showStickyPager","showBottomPager","SearchForExistingProfile","sessionFilters","applyFilterParams","defaultCaregiverIdx","h2","patientUpdatedWatcher","updatePatient","Rx","BehaviorSubject","patientNote","alertId","isVideoCall","scheduleVisitId","Keys","onNext","virtualVisits","component","Sucess","MasterMedicationsController","searchName","searchReason","searchCondition","searchAhfsClass","searchMedications","bindSearchMeds","medSearch","totalMasterMeds","masterMeds","GenericName","searchCondtion","MedicationController","MedStatus","dateStoppedOptions","medication","startDateChanged","submitMedForm","gotoState","medForm","isCreateNew","medicationName","medName","handleMissingMedicineName","PatientMedicationId","savePatientMedication","createPatientMedication","MasterMedicationId","MedStatusId","canEditDose","Dose","canEditUoM","MedUnitOfMeasureValue","focusInput","carEditUoM","determineFocusElem","MedicationsController","mapMedication","MedStatusName","GroupingName","bindResponse","pairs","bindMedications","totalMeds","allCollapsed","outerCount","meds","showDetails","ahfsClass","AlertCategory","loadAlerts","patientAlerts","alertDateGroupings","selectedAlerts","hasSelectedAlerts","updateButtonText","patientAlert","updateSelectedAlerts","getAlertClass","PatientResponse","intersection","getIcon","patientAlertDate","AlertStatusSetDateTime_UTC","alertDateGrouping","patientAlertDateGroup","patientAlertGroupDay","removeIfEmpty","createAlertDateGrouping","getAlertDateGrouping","initializeAlert","selectAlertClass","selectedAlertClass","group1","group2","group1Date","group2Date","sortByAll","sortGroupAlerts","showAlertModal","previouslySelectedAlertClass","previouslySelectedAlertClassName","invert","selectedAlertClassName","alertClassPluralLowercase","plural","alertClassNames","updateVisibility","thisClassAlerts","otherClassAlerts","acceptAlertText","rejectAlertText","tabHeading","alertCount","visibleGroupAlerts","updateCompliance","updateDisplay","concludeAlert","alertStatusId","relatedAlerts","concludeRelatedAlerts","onUpdateAlerts","alertsLoaded","MonitoringAlertController","alertvm","alertsPlural","acceptVerb","notificationCount","highSurveyAlertCount","mediumSurveyAlertCount","highBiometricAlertCount","mediumBiometricAlertCount","highTaskCount","mediumTaskCount","selectedAcceptInterventions","selectedRejectInterventions","acceptAlertNote","rejectAlertNote","isAccepting","isRejecting","submittingAlerts","getInterventions","acceptinterventions","rejectinterventions","toggleAcceptInterventions","interventionId","toggleRejectInterventions","alertStatusObj","addChartNotes","InterventionModels","PatientChartEntries","interventionIds","getIntervention","accepted","saveAlertStatus","rejected","selectAlert","validUrl","pattern","getClass","MonitoringViewType","enableCollapse","maxReadingCount","selectSummary","toggleReadings","showReadings","hasModifyResponse","setCanModifyReadings","setMultipleReadings","displayType","hasMultipleReadings","hasVisibleReadings","multipleReadings","hasReadings","enableAlerts","viewType","getDisplayType","updateVisiblility","onExpandReadings","_scope","biometricGraphPrimary","biometricGraphSecondary","canProcess","biometricReading","getReadingClass","updateAlertDisplay","hasNotes","activeAlerts","standardAlerts","updatedNotes","tooltipMessage","readingClass","displayUom","unitOfMeasure","obs","diffDays","showCreatedDateTime","getGraphNodeStatus","getGraphNodeState","graphNodes","isNewAlert","handleAlerts","processReading","changeResponseStatus","hasBiometricReadings","getBiometricConfigurations","displayBoth","displayBothWeightUnits","onUpdateBiometrics","biometricData","timeZone","graph2","newReading","getNewReading","generateReadings","getBiometric","isBluetooth","HasDevice","addReading","finalizeBiometric","assignResponses","biometricsLoaded","showBiometric","vhUomConversionService","readingType","partOne","partTwo","partThree","SkipReason","findParameterType","bloodSugarType","addGraphNodes","getAlertInfo","mapGraphNode","secondaryNode","addGraphEndDates","lastDate","sortByDate","aa","bb","alertDisplay","getBiometricMeasurementTypes","ShortName","UnitName","SurveyQuestionTypes","SurveyParameterTypes","showAllReadings","firstType","bioReading","findReading","serializedCreatedDate","cd","createdTime","createdDate","PatientResponseInputMethod","mapReading","alternateReading","alternateUnit","mapAlternateReading","addAlertIcon","dateProp","obsProp","bioMetricSummaryInjects","bioMetricSummaryScope","bioMetricSummaryAttributes","BiometricSummaryDirective","transcludeFn","BiometricSummaryController","separator","summary","_averages","_min","_max","_selected","popupPlacement","popupTemplate","actualValues","allAlerts","warnings","onSelectSummary","ModifyResponseController","mvm","modifyReason","loadCurrentHealthScores","scores","areDatesEqual","healthScoreModel","isDataView","onHealthScoresChanged","getBarHeight","PatientMonitoringController","timeZoneInfo","loadPatientResponses","skipDateComparison","toggleHeading","surveys","earliestDate","programStartDate","CreatedDate","loadDayHeaders","dayHeaders","getAlerts","updateAlerts","updateBiometrics","updateSurveys","task","dayHeader","onAlertsLoaded","onSurveysLoaded","onGetDisplayType","biometricAdded","toggleReadingsHeading","expandCurrentSurveys","expandHeading","toggleGraphHeading","toggleGraphExpand","expandCurrentGraphs","toggleReadingsExpand","expandReadings","updateViewType","displayTypeChanged","showUserGuideHealthScore","expandCurrentSurveysHandler","alertHandler","statusChangeHandler","onGetDisplayTypeHandler","healthScoresChangedHandler","healthScoresLoadedHandler","updateBiometricsHandler","updateSurveysHandler","alertsLoadedHandler","updateAlertsHandler","expandCurrentGraphsHandler","displayTypeChangedHandlers","biometricsLoadedHandler","surveysLoadedHandler","selectSummaryHandlers","expandReadingsHandlers","onHealthScoresLoaded","onUpdateSurveys","healthScoresChanged","healthScoresLoaded","surveysLoaded","onExpandCurrentSurveys","onHandleStatusChange","handleStatusChange","onHandleAlerts","obsStart","obsEnd","DisplayBothTempUnits","DisplayBothUnitsOfWeight","defaultBloodSugarUnit","patientResponseId","getPatientFirstResponseDate","navigationData","patientCreatedDateTimeUtc","currentHealthScore","currentParsedDate","getScoreStatus","getNavigationData","getToolTipMessage","displayClass","getAlertSeverityClass","ObservationDateTime_Local","CreatedDateTime_Local","formatResponseValue","tooltipEnabled","toggleAlertSelection","isForms","loadSurveys","hasSurveyResponses","showSurvey","complianceInfo","compliance","getComplianceResponses","loadComplianceInfo","loadQuestionResponses","assignAlertCounts","highCount","mediumCount","AddChangeReasonController","getChangeReasons","defaultChangeReasons","defaultReasons","enumerableOnly","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","_objectSpread","getOwnPropertyDescriptors","defineProperties","ParametersController","pvm","BloodSugarParameters","ThermometerParameters","SpirometerParameters","PedometerParameters","TimeDiffBetReadings","TabletParameters","bloodSugarValues","getTempLabel","getWeightLabel","bloodSugarLabel","weightUnitChanged","sectionChanged","High_Alert_Lbs_Weekly","MaxMinWeightAbsoluteSafeguard","DailyHighAlertValueSafeguard","DailyMediumAlertValueSafeguard","WeeklyMediumAlertValueSafeguard","WeeklyHighAlertValueSafeguard","weightVariance","weightScaleDayCount","WeightScaleGainLossAlertDays","heartRateDevice","setMinMaxWeights","variance","MaxMinWeightPercentage","MaxMinWeightAbsolute","MaxMinWeightPercentageSafeguard","canWrite","formDirty","openChangeReasonModal","dirtySections","pulseOxy","wt","gluco","thermo","sectionChangedDynamic","saveChanges","cancelChanges","parametersForm","High_Alert_Per_Weekly","originalParameters","DynamicParameters","glucoAdvanced","IsSingleReading","bloodPressure","heartRate","glucometer","tablet","alertSeverityLevels","upperhigh","UpperHighAlert","upperMed","UpperMedAlert","lowerHigh","LowerHighAlert","lowerMed","LowerMedAlert","TemperatureUpperBoundaryHighAlertSafeguard","TemperatureUpperBoundaryMediumAlertSafeguard","TemperatureLowerBoundaryHighAlertSafeguard","TemperatureLowerBoundaryMediumAlertSafeguard","ObtainPulse","lowerValueHigh","LB_High","lowerValueMed","LB_Med","upperFastingMed","UB_Fasting_Med","upperPPMed","UB_PP_Med","upperPPIncHigh","UB_PP_Inc_High","upperPPIncMed","UB_PP_Inc_Med","upperRandomCheckMed","UB_RandomChk_Med","upperRandomCheckHigh","UB_RandomChk_High","FastingUpperBoundaryMediumAlertValueSafeguard","LowerBoundaryHighAlertValueSafeguard","LowerBoundaryMediumAlertValueSafeguard","PostPrandialIncreasedHighAlertValueSafeguard","PostPrandialIncreasedMediumAlertValueSafeguard","PostPrandialUpperBoundaryMediumAlertValueSafeguard","RandomUpperBoundaryHighAlertValueSafeguard","RandomUpperBoundaryMediumAlertValueSafeguard","bloodSugarPattern","bloodSugarPPMax","bloodSugarPPIncMax","bloodSugarPatternAlertText","BiometricAlertConditions","condit","Severity","sev","setPristine","FEVOneHighAlert","FEVOneMedAlert","FEVRatioHighAlert","FEVRatioMedAlert","BloodGlucoseGuidelines","BloodPressureGuidelines","OxygenSaturationGuidelines","PedometerGuidelines","PulseGuidelines","SpirometerGuidelines","TemperatureGuidelines","WeightGuidelines","DailyGain_S_LossPercentageSafeguard","DailyMediumAlertPercentageSafeguard","WeeklyMediumAlertPercentageSafeguard","WeeklyHighAlertPercentageSafeguard","PulseHighAlertValueSafeguard","PulseMediumAlertValueSafeguard","OxygenHighAlertValueSafeguard","OxygenMediumAlertValueSafeguard","SystolicComparedToLastReadingPositiveDifferentialSafeguard","SystolicComparedToLastReadingNegativeDifferentialSafeguard","SystolicUpperBoundaryHighAlertValueSafeguard","SystolicUpperBoundaryMediumAlertValueSafeguard","SystolicLowerBoundaryHighAlertValueSafeguard","SystolicLowerBoundaryMediumAlertValueSafeguard","DiastolicUpperBoundaryHighAlertValueSafeguard","DiastolicUpperBoundaryMediumAlertValueSafeguard","DiastolicLowerBoundaryMediumAlertValueSafeguard","PedometerHighAlertSafeguard","PedometerMediumAlertSafeguard","section","dynamic","invalidDynamic","BiometricAlertExpressions","valueInvalid","behavior","parametersSaveModel","updatedCondition","originalCondition","bt","bAId","BiometricAlertConditionId","bac","ChangeReason","saveParameters","oldDyn","ModifiedByName","ModifiedDtUTC","deleteTimeLog","getParameter","parameterName","PatientController","IsDirectEntryEnabled","refreshPatient","admitData","newAdmitData","Comment","patientAdmitData","admitDate","dischargeDate","readOnly","addDischargeInfo","admitDischargeForm","AdmitDtUTC","DischargeDtUTC","addAdmitDischargeInfo","deleteAdmitData","deleteAdmitDischargeInfo","editAdmitData","admitDischargeDetail","editedAdmitData","editAdmitDischargeInfo","getComorbidities","removeComorbidity","comorbidityId","editPatientComorbidities","comorbidities","admitDischargeInfo","admitId","getPatientClinicalHistory","editPatientClinicalHistory","clincialHistory","patientComorbidities","availableComorbidities","selectedComorbidities","allComorbidities","filterAvailableComorbidities","sortpatientComorbidities","ComorbidityName","addNew","comorbidityName","newComorbidity","deleteComorbidity","addComorbidities","newPatientComorbidities","comorbiditiesForm","EditAdmitDischargeModalController","addEmptyEntry","editedContent","checkState","lastEntry","isEntryValid","isLastEntry","invalidAdmit","invalidDischarge","emptyAdmit","emptyDischarge","markDeleted","editedDetail","adForm","EditComorbidityModalController","addedComorbidities","validateAddedComorbidities","textAngularManager","clinicalHistory","userHasWritePermissions","isEditMode","editClinicalHistory","retrieveEditor","displayElements","saveClinicalHistory","historyForm","originalHistory","History_Text","ClinicalHistoryController","patientAdmitDischarge","editAdmitDischarge","editedAdmitDischargeData","editComorbidities","VhRequiredPermission","onAuthFailed","permission","UiSrefAuth","removeElem","uiSrefAuth","paramsIndex","uiSref","elemToKill","permissionMap","ConfigurationsRead","ConfigurationsWrite","MasterCareplansRead","MasterCareplansWrite","KitsRead","KitsWrite","SecurityReservedActivityRead","KitLocationRead","KitLocationWrite","ToggleOverDueAlerts","KitsDelete","ConfigurationSkipBiometricRead","ConfigurationSkipBiometricWrite","MoveKits","ProvisionKits","SmsWrite","AdvancedConfigurationsWrite","ConfigurationPatientStatusRead","ConfigurationPatientStatusWrite","KitStatusWrite","WebhookRead","WebhookWrite","ConfigurationProviderGroupRead","ConfigurationProviderGroupWrite","SurveyTemplateExport","SurveyTemplateImport","SecurityRoleRead","SecurityRoleWrite","SecurityAccessLevelBasicRead","SecurityAccessLevelBasicWrite","SecurityAccessLevelModerateRead","SecurityAccessLevelModerateWrite","SecurityAccessLevelAdvancedRead","SecurityAccessLevelAdvancedWrite","ConfigurationInterventionsRead","ConfigurationInterventionsWrite","ChartContentRead","ChartContentWrite","WelcomeVideoConfigRead","WelcomeVideoConfigWrite","InstallMethodConfigRead","InstallMethodConfigWrite","EducationalMaterialWrite","EducationalMaterialRead","EmailServersReadAndWrite","SpecialHandlingReadAndWrite","SystemServiceLevelRead","SystemServiceLevelWrite","SystemFormsRead","SystemFormsWrite","KitPickupOptionRead","KitPickupOptionWrite","RuleWrite","PathwayConditionWrite","PathwayTagWrite","ProviderRoleRead","ProviderRoleWrite","ProviderFreetextWrite","ConfigurationsTransformsRead","ConfigurationsTransformsWrite","ConfigurationPopulationRead","ConfigurationPopulationWrite","HospitalSettingsRead","HospitalSettingsWrite","ConfigurationMilestoneRead","ConfigurationMilestoneWrite","LanguageSettingsRead","LanguageSettingsWrite","MessageInterventionsRead","MessageInterventionsWrite","SpecialHandlingTagWrite","ComorbidityTagWrite","ConfigurationComorbidityRead","ConfigurationComorbidityWrite","NetworkOperatorRead","NetworkOperatorWrite","GoDevicesRead","GoDevicesWrite","GoDevicesPopulationsWrite","AlertTypeRead","AlertTypeWrite","CoachCardRead","CoachCardWrite","PatientHeaderConfigurationWrite","LoginNotificationRead","LoginNotificationWrite","PayersRead","PayersWrite","ReferralsRead","ReferralsWrite","ProviderGroupsRead","ProviderGroupsWrite","PopulationGroupsRead","PopulationGroupsWrite","ContentUIDRead","CurrentProceduralTerminologyCodeRead","CurrentProceduralTerminologyCodeWrite","ProgramDurationsRead","ProgramDurationsWrite","ResourceLibraryImport","ResourceLibraryExport","RulesImport","RulesExport","ProgramExport","ProgramImport","ConfigurationPathwayAlertChangeReasonRead","ConfigurationPathwayAlertChangeReasonWrite","CanAssignDisabledContent","CanAssignFromAllSites","SecurityRoleExport","CanDisableRule","CanLockQuestions","CanEditLockedQuestions","CanLockPathways","CanEditLockedPathways","CaregiversRead","CaregiversWrite","KitShippingEdit","NetworkAndTabletWrite","KitDetailsWrite","KitReturnLocationWrite","EditKitStatus","EditKitLocation","PatientDemographicsRead","PatientClinicalDataRead","PatientDemographicsWrite","PatientMedicationsWrite","PatientAlertsWrite","PatientChartNotesWrite","DirectEntryWrite","HospitalsReadAll","PatientCareplanRead","PatientCareplanScheduleWrite","PatientCareplanWrite","PatientAssignWrite","PatientTimeLogAuditWrite","HealthTipsWriteAdvanced","ProgramStartDateWrite","ModifyResponse","VideosRead","VideosWrite","HealthTipsRead","HealthTipsWrite","MasterCareplanCategoryDelete","MasterCareplanQuestionDelete","PatientResponseApiRead","KitLogisticsRead","KitLogisticsWrite","InviteListRead","InviteListWrite","VideoListRead","ReceiveKitsRead","ReceiveKitsWrite","PatientListRead","PatientMonitoringRead","PatientTimeLogRead","BulkPatientCareplanWrite","PatientParametersRead","PatientParametersWrite","PatientFormRead","PatientFormWrite","PatientMedicationsRead","PatientClinicalHistoryRead","PatientClinicalHistoryWrite","PatientChartNotesRead","PatientMaskedIdentifierWrite","PatientDataTransfer","PatientCardsRead","UnassignKitOptions","KitPickupRemoveKit","PatientBackdateStatus","SurveyTemplateMassEdit","PatientSurveyMassEdit","PatientMilestoneRead","PatientMilestoneWrite","SiteRead","SiteWrite","SitesReadAll","ProfileFieldsRead","ProfileFieldsWrite","PatientRuleLogRead","PatientTagWrite","PatientTagHxRead","PatientMessageWrite","PatientPathwayStatusWrite","PatientAuditExport","PatientCall","PatientNotificationsWrite","PatientActivityRead","AllHospitalAccess","CreateNewPatient","SurveyQuestionsRead","SurveyQuestionsWrite","PatientCPTCodeBillingRead","PatientCPTCodeBillingWrite","ContentPathwayScheduleEdit","PatientPathwayScheduleEdit","PathwayAlertChangeReasonRead","PathwayAlertChangeReasonWrite","PatientHospitalUpdate","PatientsReadAll","DocumentGenerator","ReportsRead","DashboardRead","PatientIdentifierConfigurationRead","PatientIdentifierConfigurationWrite","ProgramStatusReport","KitUtilizationReport","ProgramComplianceReport","KitHistoryReport","KitStatusReport","AlertAnalysisReport","PatientStatusReport","PatientDataDumpReport","BYODStatusReport","SkipBiometricReport","HealthSummaryReport","PatientTimeLogReport","PatientSatisfactionReport","UsageMonitoringReport","ReportDesigner","MediaRead","MediaWrite","KitShippingMarkKitAsLost","ConfigurationDeleteReasonRead","ConfigurationDeleteReasonWrite","BiometricThresholdsChangeReasonsRead","BiometricThresholdsChangeReasonsWrite","ResourceLibraryRead","ResourceLibraryWrite","CaregiverMassUpload","usersPermissions","permissionsToCheck","userPermissions","getPermissions","permissionToCheck","SecurityActivities","AllReports","hasModerateWrite","SetUserReportCounts","UserReport","UserReportCount","MaximumReportCount","canAddNewReport","isReportOwner","isPublish","selectReport","DisplayDeleteBtn","DisplayCopyBtn","unPublishReport","publishReport","reportIndex","isReportDesigner","reportParameters","DeleteBtnClicked","CopyBtnClicked","ImportBtnClicked","ExagoSessionLoaded","selReports","DisplayPublishToggle","BiometricChartDirective","chartTitle","chartIcon","labelDates","mapToData","lastValues","highestAlert","lastValueClass","badgeClassFromAlert","mapChartDataValue","onlyDate","nextDate","getUTCHours","previousDate","scaleShowGridLines","scaleGridLineColor","scaleGridLineWidth","scaleFontColor","scaleLineColor","bezierCurve","bezierCurveTension","datasetStroke","datasetStrokeWidth","datasetFill","backgroundOpacity","BiometricChartsDirective","allBiometrics","baselineWeight","charts","hbA1c","tempController","tempKey","sysData","mapBiometric","diaData","alertLevelFromHealthScore","bioName","valueSelector","IsSkipped","ObservationDate","bpData","BiometricValues","biometricValue","reference","large","BiometricGridDirective","tempCtrl","primaryKey","secondaryKey","temperatureUnits","healthScoreDates","bloodSugarUnit","hbA1cUnit","BiometricValueDirective","displayTemperatureCtrl","displayValue","noBadge","scoreText","skippedSurvey","healthClass","CaregiverSelectController","selectedCaregiver","okDisabled","caregiverChanged","PatientFormReportController","isTextDisplay","HealthSummaryController","hsvm","mapImage","im","header","patientImgSrc","risk","providerGroup","Hospital","lastHealthScore","LastHealthScore","PatientBiometrics","PatientScores","patientNotes","PatientNotes","PatientSurveyResponses","PatientMedications","ShowSpirometer","ShowPedometer","validHealthScores","reportInfo","infoLineOne","TextLineOne","infoLineTwo","TextLineTwo","logoSrc","ReportLogo","mapReportInfo","ReportHeader","DefaultTemperature","reportSections","ReportSections","maphealthSummaryReport","MedicationsDirective","holdingMedications","discontinuedMedications","PatientNotesDirective","patientNoteData","ToArray","Html","PatientSelectController","selectedPatient","patientChanged","patientController","healthScoreText","healthScoreTrendClass","healthScoreTrendIconClass","PatientInfoDirective","filterOption","otherFilterOptions","infoFirstRow","firstRowCount","infoSecondRow","riskText","riskNotAssigned","monthOpened","ReportMultiplePatientFilterDirective","getTypeAheadPatientByName","ReportTypeaheadCaregiverFilterDirective","ReportTypeaheadPatientFilterDirective","Report","hasReportOwnership","reportHasParam","databaseName","getParam","getBIParam","BIParamName","DatabaseName","isExcelOnly","ReportTypeEnum","ExcelReportClass","ReportInstances","ReportGUID","ExportTypeEnum","PDF","Excel","RTF","CSV","PhiWarningText","isExportOptionAvailable","ExcludedExportOptions","isLegacyReport","showPhiWarningText","IsPatientRelated","canExport","canPreview","additionaltime","getPatientTimeLogData","getReportParams","ReportParamOption","ParamOptionSubOptions","paramOption","sortOptionsByName","ReportParamDataTypeId","ReportParamId","selectedValue","selectedValuesDisplay","startCalendarOpened","endCalendarOpened","getTypeAheadKitByNumber","kitTypeaheadData","autoSelectSubOption","parentParam","childParam","getRelativeDateOptions","relativeDateOptions","patientTypeaheadData","caregiverTypeaheadData","openReport","SecurityActivityId","CanExport","exagoState","ExagoState","caregiverParam","caregiverName","openCaregiverSelectModal","validateCaregiver","validateKit","validateReport","TypeEnum","isExagoReport","executeExagoReport","doReport","canWriteNotes","getCaregiverTypeaheadData","getTypeAheadCaregiverByName","CanPreview","dropDowns","typeAheadFields","paramValue","paramType","hospitalParam","displayValues","alertClassParam","reportInstanceParamModels","reportInstanceParamModel","ReportInstanceParamId","reportInstanceModel","onExagoReportProgress","onExagoReportError","showExagoReport","sectionParamOptions","DefaultPatientSummaryReportSections","initializeController","patientParam","openPatientSelectModal","reportInstance","ReportTypeDirective","typeEnum","reportHeaderInfo","InvalidInstance","generateParamaters","getTimeLogReport","If-Modified-Since","Cache-Control","Pragma","getUsageMonitoringReport","getReportHeader","runReportToExcel","exportToExcel","getTypeAheadPatient","getTypeAheadCaregiver","getTypeAheadKit","ReportSectionsDirective","sectionData","sections","elementString","sectionType","directiveHtml","getDirective","SectionName","PatientResponsesDirective","patientResponseData","TimeLogReportDirective","SINGLE","CCM_OVER_60","NON_CCM_RPM","RPM_OVER_16_DAYS","RPM_OVER_20","timeType","emptyDisplayText","typeAheadData","reportHeader","loadReport","timeLogReport","filterTimeType","timeLogType","reportBody","reportHasData","selectedYear","selectedMonth","execReport","excelSrc","UsageMonitoringReportDirective","runReport","displayEmptyMessage","totals","newActivePatients","completedPatients","kitsAssigned","kitsUnassigned","caregiversCreated","caregiversDeleted","healthMeasurements","videoConferencing","NewActivePatients","CompletedPatients","KitsAssigned","KitsUnassigned","CaregiversCreated","CaregiversDeleted","HealthMeasurements","VideoConferencing","cardsRepositoryFactory","getSystemConfigurations","getSiteConfigurations","getMediaPaths","createMediaPaths","faIconClasses","vhIcons","getFA","getVivify","getAllAssignableStatusesAndLocations","delete","PatientSummaryRepository","schedules","promiseCallback","$cacheFactory","questionCache","removeAll","uncategorized","surveyTemplatesToUpdate","templateCache","BiometricsController","configuredPopulations","hasConfigurationsWrite","hasAdvancedConfigurationsWrite","canEditSetting","doEdit","updatedSetting","toggleHead","editSetting","resetPopulation","listLoading","toggleExpandAll","headList","expandOrUnexpand","searchvalue","searchhead","siteName","heads","mapHeaders","sortedHeads","EditBiometricController","saveBiometric","savedSetting","canEditBiometrics","HospitalModalController","toggleClass","hospitalForm","PhoneNumberUnFormatted","HospitalsController","refreshHospitals","contain","determineFacilityButtonParams","openHospitalModal","newHospital","updateHospitalList","resetDefault","updatedHospital","updateHospitals","hasFacilityFeeEnabled","FacilityFeeEnabled","hasFacilityFeeDisabled","isAllFacilityButtonDisabled","allFacilityButtonText","getHospitalSettingDefault","mapTimeZone","patientCounts","updateAllFacilityFeeSetting","enableConfirmationString","allFacilityFeeSetting","PayersController","updatedPayer","formatList","toggleIsDefault","toggleIsCPT","PayersEditController","payerForm","PopulationGroupsController","updatedPopulationGroup","PopulationGroupsEditController","populationGroupForm","PopulationCtrl","orderList","populationCount","IsAll","CanEditPopulations","listChanged","canImport","formatProgramPauseSetting","PopulationEditCtrl","DaysTilNonResponder","PendingProgramCompletion","TabletReminderEnabled","ProgramPauseSetting","populationsForm","ProfileFieldsController","updatedField","updateField","ProfileFieldsEditController","RequiredEditDisabled","fieldName","ProgramDurationsController","updatedProgramDuration","programDuration","ProgramDurationsEditController","programDurationForm","ProviderGroupsController","updatedProviderGroup","ProviderGroupsEditController","providerGroupForm","ReferralsController","updatedReferral","toggleIsCCM","ReferralsEditController","referralForm","SpecialHandlingCtrl","sh","specialhandlingEditCtrl","specialhandlingForm","deleteSp","BiometricAlertController","expandable","privateProperties","biometricAlert","showDebug","conditionDragListeners","acceptConditionOrderChange","conditionsOrderChanged","testObject","testParameter","testValue","lookups","getRuleExpressionValues","biometricAlertExpressionValues","getBiometricAlertPopulations","_data2","alertPrograms","biometricMeasurementTypes","allPopulations","biometricPopulations","biometricMeasurementType","conditionProxy","loadSelectedProgramsFromBiometricAlert","biometricChanged","BiometricAlertPrograms","bioimetricMeasurementType","pauseDescriptionUpdates","biometricAlertPrograms","checkFDAStatement","AlertName","minMaxInvalid","biometricAlertCondition","proxyCondition","selectedItems","resetAlertName","saveSelectedProgramToBiometricAlert","saveBiometricAlert","SurveyParameterTypeIds","postTestAlert","biometricAlertConditionDirective","isPatientLevel","onchange","conditionText","expression","expressionOperator","expressionOperators","anyAll","showRemove","Property","Operator","biometricAlertExpressionDirective","expressionIndex","expressionLast","operator","updateVariable","expressionVariable","updateExpression","getSelectedPropertyType","enableTypeahead","varType","properties","getSelectedPropertyTypeahead","valueSafeguard","valueError","MinSafeguard","MaxSafeguard","edit","propChanged","selectedBiometricAlertExpressionList","isExpressionListEnabled","selectItems","ExpressionName","hideId","HideId","ExpressionValues","arrayOperator","boolOperator","stringOperator","intOperator","biometricAlertOperator","showOperatorList","biometricAlertExpressionOnSelect","showExpression","showExpressionList","addExpression","removeExpression","searchTags","tagsList","getTag","BiometricAlertsController","selectProgram","programTypes","ProgramFilter","loadPrograms","BiometricAlerts","BiometricMeasurementTypeName","displayProgramName","alertSecurityLevels","AlertSecurityLevelId","selectedBiometricAlert","anyProgram","biometricAlertFilter","Program","hasProgram","selectedBiometricAlerts","clearFilters","ActionNameFilter","EventNameFilter","biometricAlertId","addBiometricAlert","deleteBiometricAlert","programText","ProgramName","programItem","BiometricMeasurementAlertType","biometricAlertTestDirective","EmailController","EmailService","loadEmails","getQueuedEmails","bindEmails","emails","clearEmailFields","BodyText","SubjectText","ReceivingCaregiver_Id","SendingCaregiver_Id","alertEmailSent","SendDate_UTC","ExpirationDate_UTC","getUTCMinutes","getUTCSeconds","Retries","addEmailToQueue","deleteEmail","EmailServerCtrl","EmailServers","server","toggleSSL","IsSSLConnection","updateEmailServer","EmailServerId","saveServer","updateEmailServerList","emailServerId","EmailServerEditCtrl","emailServersForm","AddFormModalController","newForm","variableDisplay","mentioSetup","isGreaterThanZero","getFormPopulationIds","searchVariables","variableList","getVariableText","mentioSetupHeader","mentioSetupFooter","variableTooltipTemplate","AddFormQuestionModalController","variableTransforms","formQuestionTypes","patientParameterTypes","RequiredStr","setOptionSortOrder","hasOptions","Columns","MinHeight","AddFormSectionModalController","newSection","FormSectionId","FormsController","selectedForm","populationString","selectForm","formPopulations","popString","parsePopulationString","editForm","getFormVariables","editSection","sectionId","getFormVariableTransforms","FormQuestions","unPublishForm","publishForm","deleteSection","deleteForm","deleteQuesiton","importForm","updateForm","getAllForms","objId","ImportFormModalController","GoDevicesConfirmationController","GoDevicesController","OpenNavigationConfirmation","selectedDevice","swapDevice","selectedDeviceCopy","EnableDirectShip","EnableHandDeliver","DevicePopulations","editPopulations","isShowPopulations","isDirectShip","isHandDeliver","isDefaultDevice","allowNavigation","dm","DeviceTypeValue","canPopulationWrite","LoadPopulations","GetDevices","selectDeviceModelId","GetAll","SelectDevice","GetPatientDeviceCount","DeleteDevice","Toggle","ToggleDevice","EditDevice","shipOption","handOption","UpdateDevice","CancelDeviceChanges","CancelPopulationChanges","DeviceModelTblPopulations","InitPopulations","SaveDevicePopulations","DeviceModelTblPopulationId","UpdateDevicePopulations","tempModelName","tempDeviceTypeId","tempDirectShipEnabled","tempHandDeliverEnabled","isFormDirty","popform","PopulateDevicePopulations","FindPopulationDeliveryOption","IsPopulationDefaultDevice","AttemptSelect","OnAddPopulation","OnRemovePopulation","OpenAddDeviceModal","GoDeviceModels","currentDeviceModels","deviceModel","UpdateDeletedDevice","AddDevice","populationIndex","deliveryOptionId","absUrl","GoDevicesModalController","BluetoothProfileId","ShowForRule","ModelIdInvalid","ModelIdDeleted","Device_Name","deviceModelForm","CheckModelId","Exists","selectDeviceModel","AvailableDeliveryOptions","PopulationModel","DeviceModelDeliveryOption","DeliveryModelDeliveryOptionId","DeviceModelPopulationDeliveryOption","DeliveryModelPopulationDeliveryOptionId","DeviceModelTplPopulationId","GetAllExclude","popId","Get","GetDevicePopulationSettings","deviceModelId","ValidateDevice","ValidatePopulationSetting","LanguageModalController","languageForm","LanguagesController","refreshLanguages","updateLanguages","contentEnabledOnly","isEnabledOnly","AddNotificationModalController","updateHtml","RenderHtml","Url","Buttons","TrustedRenderHtml","validDateError","ExpireDate","Priority","TemplateHtml","TemplateData","LoginNotificationTypeId","showError","showDateError","NotificationId","showHtml","isUpgradeNotification","ImportLoginNotificationModalControllerFactory","ImportLoginNotificationModalController","LoginNotificationController","activeNotifications","expiredNotifications","deletedNotifications","processData","userCanEdit","getName","getResponses","jsonResponses","csvResponses","objArray","JSON2CSV","deleteItem","editItem","importItem","sortByStartDateAndPriority","loginNotificationId","LogoUpdateController","addUpdateLogoModal","buttonType","LogoService","getSettingId","LogoModalController","reportSettingId","OverwriteResource","naturalHeight","NetworkOperatorController","PatientIdentifierFieldsController","PatientIdentifierFieldsEditController","IsVisible","PatientIdentifierEnumId","pickupController","pickupOption","toggleDelete","deleteOption","pickupEditController","pickupForm","ruleActionDirective","showHelp","onVideoChanged","SurveyVideoId","VideoUId","onHealthTipChanged","onPathwayChanged","SurveyTemplateUId","onProgramChanged","$item","selectedPrograms","ProgramId","onServiceLevelChanged","ServiceLevelUId","onLibraryTileChanged","tile","cardDeviceModelEnum","alertSeverityLevel","manageDeviceAction","manageTagAction","manageSpecialHandlingAction","managePatientSurveySchedulesAction","ruleController","maxCommentLength","itemsDeleted","userSites","canDisableRule","isEditing","actionDragListeners","acceptActionOrderChange","actionsOrderChanged","_initialize","forward","dotInterval","updateLoadingMessage","_yield$Promise$all","_yield$Promise$all2","ruleExpressionValues","templateExpressions","sortedTemplates","enabledValues","disabledValues","dots","updateSubProcessLabel","subLoadProcess","clearInterval","loadingError","getAllSites","includeDisabled","getGoPlatforms","updatePrograms","actionExpressionValues","UId","_editComment","actionProxy","loadSelectedProgramsFromRule","loadSelectedSitesFromRule","RulePrograms","filterRuleExpressionValues","SiteName","distinctSiteIds","sortedResults","sitePrograms","defaultName","descriptionHtml","ProgramUId","getActionExpressionData","jsonTarget","PopulationUId","ruleSQLCmd","RuleSQLCommandId","actionType","cardName","surveyStatusText","alertTypeText","tileName","ManageSpecialHandlingAction","expressionName","applyDisabledFilter","rulePrograms","setCurrentSite","sitesOfSelectedPrograms","_this8","notDeleted","editCondition","addAction","actionArray","proxyAction","_this9","_this10","_this11","saveSelectedProgramToRule","ruleConditionDirective","isediting","expressions","indent","ruleExpressionDirective","selectedRuleExpressionList","PossibleValues","ruleExpressionOnSelect","closeDropdowns","fetchValue","RulesController","parseLogObjects","hasAction","DefaultRuleActions","selectedRule","ruleFilter","RuleUId","selectedRules","userCanImport","userCanExport","userCanDisableRule","ruleLogPaging","ruleLogPageChanged","getLog","logexpanded","getActionExpressionValues","AddRoleModalController","SecurityrolesService","isDupError","securityActivityId","addRole","pushRole","mapRoleActivities","setSelectedRole","deleteRole","SecurityrolesController","updateReadWrite","activityId","activitiesMap","roleId","rolesMap","selectedRole","securityAccessLevelRead","securityAccessLevelWrite","enableDisableActivity","removeActivity","enableActivity","activities","getByRoleId","acts","SecurityActivity","getAbledMapRoles","Group","accessLevels","updateRole","copyRole","cpy","IsReserved","deleteRolePrompt","canReadItem","itemSecurityActivityId","canWriteItem","selectRole","securityLevelName","secuirtyObj","mappermissionGroups","searchType","filterRoles","exportRoles","canExportRoles","Security_Activity_Id","Security_Activity_Name","Security_Activity_Description","Is_API_Only_Role","IsAPIOnlyRole","Is_Deleted","Is_Reserved","permissions","role_permissions","Role_Name","Role_Description","Permission_Name","Permission_Decription","activiityIds","permission_roles","incRoles","wb","XLSX","book_new","ws","json_to_sheet","book_append_sheet","writeFile","getAllActivities","getTypes","ServiceLevelEditDirective","applyConfig","merged","spread","disabledEdit","changeType","DefaultIcon","DefaultDescriptionText","LongDescriptionText","DefaultLongDescriptionText","ServiceLevelListCtrl","refreshServiceLevels","updateAllServiceLevels","currentServiceLevel","newServiceLevel","EditSettingController","defalutValue","SettingValueInput","configureTools","newModel","oldModel","InstallController","mediaPaths","canMediaWrite","portalUrlConfig","instanceIdConfig","disableUpdateVid","updateVideoLength","savePortalConfig","configModel","SettingsController","getSiteSettings","getSystemSettings","refreshCache","launchInstall","double","AddSiteModalController","saveSite","newSite","SitesController","AddSite","selectedSite","selectSite","getSite","deleteSite","AddSlideshowImageController","SlideshowController","SmsController","SmsService","selectedEncoding","allEncodings","smsSegments","sms","PatientPhoneNum","sendSms","segmenter","gsm","segmentWith","unicodeToGsm","ucs2","sub","pickencoding","maxSingleSegmentSize","maxConcatSegmentSize","doEncode","listOfUnichrs","bytes","isHighSurrogate","codeUnit","unicodeCharacters","chars","testMsg","messageChanged","inputCharacters","charCodes","unicodeCodePoints","isInGsmCodeSet","searchLog","10","12","32","33","34","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","59","60","61","62","63","65","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","97","98","99","100","101","102","103","104","105","106","107","108","109","110","111","112","113","114","115","116","117","118","119","120","121","122","123","124","125","126","161","163","164","165","167","191","196","197","198","201","209","214","216","220","223","224","228","229","230","199","232","233","236","241","242","246","248","249","252","915","916","920","923","926","928","931","934","936","937","8364","smsRepo","TitleEditController","clinicalRoles","getRoles","TitlesController","updatedTitle","updatedTitles","blankTitle","ClinicalRole","WebhookModalController","webhook","newWebhookParamDefaults","WebhookParamName","WebhookParamValue","WebhookParamTypeId","showInput","saveWebhook","savedWebhook","populateEventParams","eventParams","newEventParams","isEventParam","eventParam","addParam","newWebhookParam","WebhookParams","onWebhookParamChanged","deleteParam","toRemove","paramTypes","getEvents","eventList","WebhooksController","getAppWebhooks","app","getByApp","ApplicationKey","webhooks","selectedApp","getParamTypeName","paramTypeId","enableDisableWebhook","enableWebhook","WebhookId","editWebhook","ApplicationId","ApplicationName","updatedWebhook","getApps","apps","WebhooksRepository","appkey","saveWebhookParam","webhookId","getAllWebhooks","DeleteTimeLogDetailController","getDeleteTimeLogReasons","totalTime","totalTimeHours","totalTimeMinutes","timeIsOpen","getDateTimeDisplay","timeLogAudit","AuditModifiedDateTime","getDateDisplay","getTimeDisplay","updateTotalTime","PatientTimeLogDetailController","IsTimeVisible","clockType","updateFilteredDays","filterType","isAuditView","setMonthTime","UpdateTimeLog","stopDate","timeLabel","TimeDiff","updateTimeLog","hasModifiedRecords","DeleteTimeLog","setDays","filtering","updateMonthTime","clinicalTimeHours","clinicalTimeMinutes","sessions","timeLogs","getTotalTime","UpdateDayTime","Sessions","UpdateSessionTime","parentLogs","TimeLogs","UpdateTime","ShowAddTimeLogModal","ToggleAuditView","getTimeLogAuditsByMonth","updateAudits","IsInAuditView","getModel","updateDays","canShowAuditView","getPatientName","DefaultFilter","updateDayTime","updateSessionTime","updateTime","showAddTimeLogModal","toggleAuditView","isInAuditView","isTimeVisible","dd","selectChildren","dayIsOpen","addingTimeLog","dayToggle","patientRepo","GetTimeLogsByMonth","timeLogAudits","TimeLogId","TimeLogAudits","sessionIsOpen","sessionToggle","updateParentController","PatientTimeLogTimeDirective","notWholeNumber","negativeNumber","emptyString","isValidMinutes","isInt","setMinutesValid","updateAction","oncancel","updateMinutes","minutesDisplay","showDeleteTimeLogModal","$locale","GetTimeDisplay","toLocaleTimeString","hour12","GetDateDisplay","DeleteCaregiverLastName","DeleteCaregiverFirstName","DeleteCaregiverTitleName","ModifyCaregiverLastName","ModifyCaregiverFirstName","ModifyCaregiverTitleName","CurrentCaregiverLastName","CurrentCaregiverFirstName","CurrentCaregiverTitleName","CaregiverLastName","CaregiverFirstName","CaregiverTitleName","getAuditType","isAdded","previousAudit","AuditAction","AuditTimeDiff","auditType","diffs","hourString","minuteString","secondString","getTimeStrings","dateLabel","clinicalText","sessionStartTime","StartDateTime","sessionStartDate","hasAudits","logStartTime","logStartDate","logTimeDiff","logStopDate","AuditDeletedBy_Id","auditStartTime","AuditStartTime","auditStartDate","auditTimeDiff","auditStopDate","newAudits","timeLogId","getTimeLogAudits","DeletedReason","hasSessions","hasVisibleLogs","closeAlert"],"mappings":"CAAA,SAAAA,EAAAC,EAAAC,EAAAC,GAAA,SAAAC,EAAAC,EAAAC,EAAAC,GACAF,EAAAG,MAAAC,MAAA,SAAAC,GACAA,GACAJ,EAAAK,yBAIAJ,EAAAK,WCNAR,EAAQS,QAAU,CAAC,sBAAuB,oBAAqB,kBDS/DX,EAAAY,OAAA,MACA,CACA,UACA,gBACA,UACA,mBACA,qBACA,oBACA,oBACA,oBACA,WACA,gBACA,QACA,qBACA,cACA,YACA,WACA,OACA,YACA,0BACA,cACA,sBACA,iBACA,aACA,gBACA,gBACA,SACA,mBACA,WACA,UACA,QACA,UACA,oBACA,gBACA,OACA,YACA,aACA,kBACA,OACA,UAEAC,IAAAX,GAnDA,CAoDAJ,OAAAC,SAAAD,OAAAE,SEpDA,SAAAF,EAAAC,EAAAC,EAAAC,GAEAD,EAAAY,OA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5+J,KAAO4+J,EAAM5+J,MAAQ,UAC3B4+J,EAAM86L,UAAYA,EAElBzoU,EAAG6sI,OAAOnkH,QAAQilH,MAGtB3tI,EAAG8xY,WAAa,SAASrpE,GACrB,IAAIz9V,EAAQg1B,EAAG6sI,OAAO5hK,WAAU,SAAA0iK,GAAK,OAAIA,EAAM86L,UAAYA,KACvDz9V,GAAS,GACTg1B,EAAG6sI,OAAO3hK,OAAOF,EAAO,UAtB5C,CA6BAnF,OAAAC,SAAAD,OAAAE,SC7BC,SAASF,EAAQC,EAAUC,EAASC,GAAWD,EAAQY,OAAO,OAAOC,IAAI,CAAC,iBAAkB,SAASmyC,GACpGA,EAAeC,IAAI,mCACjB,uSAFJ,CAIEnzC,OAAQC,SAAUD,OAAOE","file":"../bundle-12e5ca5d72.min.js","sourcesContent":["function AppInit(KeepAliveRepository, PermissionService, TimeLogFactory){\r\n KeepAliveRepository.get().then(function(isAuthorized){\r\n if(isAuthorized) {\r\n PermissionService.loadUserPermissions();\r\n }\r\n });\r\n\r\n\tTimeLogFactory.register();\r\n}\r\n\r\nangular.module('app',\r\n[\r\n 'content',\r\n 'kit_logistics',\r\n 'invites',\r\n 'vh.ui.sweetalert',\r\n 'vh.ui.cardSelector',\r\n 'vh.ui.cardtooltip',\r\n 'vh.ui.cardpreview',\r\n 'vh.ui.content.uid',\r\n 'chart.js',\r\n 'vh.components',\r\n 'repos',\r\n \"vh_core.repository\",\r\n 'permissions',\r\n 'xeditable',\r\n 'ngLodash',\r\n 'idle',\r\n 'ui.router',\r\n\t'ui.bootstrap.extensions',\r\n 'breadcrumbs',\r\n 'angular-loading-bar',\r\n 'configurations',\r\n 'caregivers',\r\n 'collapse-menu',\r\n 'smooth-expand',\r\n 'system',\r\n 'time-log-session',\r\n 'time_log',\r\n 'reports',\r\n 'print',\r\n 'patient',\r\n 'vh-caregiver-menu',\r\n 'authorization',\r\n 'ccow',\r\n 'messaging',\r\n 'dashboards',\r\n 'bindHtmlCompile',\r\n 'site',\r\n 'toast'\r\n])\r\n.run(AppInit);\r\n",null,"\r\n\r\nangular.module('vh.components', ['content.services', 'ui.bootstrap', 'checklist-model', 'repos']);\r\n","angular.module(\"ui.bootstrap.extensions\", ['ui.bootstrap', 'ui.bootstrap.modal', 'ui.router'])\r\n\r\n/**\r\n * ModalStateProvider allows you to open a modal via a route. Navigating to the route will open the modal.\r\n */\r\n.provider('modalState', function ModalStateProvider($stateProvider) {\r\n const provider = this;\r\n\r\n this.$get = function() {\r\n return provider;\r\n }\r\n\r\n this.state = function(stateName, options) {\r\n if (!angular.isString(stateName) || stateName.length === 0)\r\n throw new Error('missing or invalid stateName');\r\n\r\n if (!angular.isObject(options))\r\n throw new Error('modalStateProvider requires options');\r\n\r\n let modalInstance = null;\r\n\r\n $stateProvider.state(stateName, {\r\n url: options.url,\r\n onEnter: function($uibModal, $state) {\r\n \"ngInject\";\r\n modalInstance = $uibModal.open(options);\r\n modalInstance.result['finally'](function() {\r\n modalInstance = null;\r\n if ($state.$current.name === stateName) {\r\n $state.go('^');\r\n }\r\n });\r\n },\r\n onExit: function() {\r\n \"ngInject\";\r\n if (modalInstance) {\r\n modalInstance.close();\r\n }\r\n }\r\n });\r\n };\r\n});\r\n","function animatedflash($animate, $timeout) {\r\n return {\r\n restrict: 'A',\r\n link: function (scope, element, attrs) {\r\n scope.$watch(attrs.animatedFlash, function (newValue) {\r\n if (newValue) {\r\n $animate.addClass(element, \"flash-color\").then(function() {\r\n element.addClass(\"change-animation\");\r\n $animate.removeClass(element, \"flash-color\").then(function(){\r\n element.removeClass(\"change-animation\");\r\n });\r\n });\r\n }\r\n });\r\n }\r\n };\r\n}\r\nangular.module('animatedflash', ['ngAnimate']).directive('animatedFlash', animatedflash);\r\n","function focusMe($timeout, $parse) {\r\n return {\r\n link: function (scope, element, attrs) {\r\n var timeout = 500;\r\n if (attrs.focusDelay) {\r\n timeout = scope.$eval(attrs.focusDelay);\r\n }\r\n attrs.$observe('focusMe', function(value) {\r\n if (value == true || value == 'true') {\r\n if ($parse(attrs.focusMe).assign) {\r\n attrs.focusMe = false;\r\n }\r\n $timeout(function () {\r\n element[0].focus();\r\n }, timeout);\r\n }\r\n });\r\n }\r\n };\r\n\r\n}\r\nangular.module('focusme', []).directive('focusMe', focusMe);\r\n","/**\r\n* uiBreadcrumbs automatic breadcrumbs directive for AngularJS & Angular ui-router.\r\n*\r\n* https://github.com/michaelbromley/angularUtils/tree/master/src/directives/uiBreadcrumbs\r\n*\r\n* Copyright 2014 Michael Bromley \r\n*/\r\n\r\n//Modified by Vivify Health team SOA\r\n//Modified so that abstract routes will still be displayed in breadcrumbs, however\r\n//they will only be displayed as text, and not as a hyperlink\r\n\r\nfunction uiBreadcrumbs($interpolate, $state, $transitions, lodash) {\r\n return {\r\n restrict: 'E',\r\n template:\r\n '
    ' +\r\n '
  1. ' +\r\n '{{ crumb.displayName }} ' +\r\n '{{ crumb.displayName }} ' +\r\n '{{ crumb.displayName }} ' +\r\n '
  2. ' +\r\n '
',\r\n scope: {\r\n displaynameProperty: '@',\r\n abstractProxyProperty: '@?',\r\n displayparamProperty: '@'\r\n },\r\n link: function (scope) {\r\n scope.breadcrumbs = [];\r\n if ($state.$current.name !== '') {\r\n updateBreadcrumbsArray();\r\n }\r\n\r\n $transitions.onSuccess({}, ()=>{\r\n updateBreadcrumbsArray();\r\n });\r\n\r\n /**\r\n * Start with the current state and traverse up the path to build the\r\n * array of breadcrumbs that can be used in an ng-repeat in the template.\r\n */\r\n function updateBreadcrumbsArray() {\r\n var workingState;\r\n var displayName;\r\n var breadcrumbs = [];\r\n var currentState = $state.$current;\r\n\r\n while (currentState && currentState.name !== '') {\r\n workingState = getWorkingState(currentState);\r\n var disableBreadCrumbLink = false;\r\n if (workingState) {\r\n displayName = getDisplayName(workingState);\r\n if (workingState.abstract || workingState.name == \"patients.patient\") {\r\n disableBreadCrumbLink = true;\r\n }\r\n\r\n if (displayName !== false && !stateAlreadyInBreadcrumbs(workingState, breadcrumbs)) {\r\n displayParam = getDisplayParam(workingState);\r\n if (displayParam) {\r\n if (displayParamAlreadyInBreadcrumb(displayParam, breadcrumbs)) {\r\n var index = lodash.findIndex(breadcrumbs, {displayName: displayParam});\r\n breadcrumbs.splice(index, 1);\r\n }\r\n breadcrumbs.push({\r\n displayName: displayParam,\r\n route: workingState.name,\r\n disableLink: disableBreadCrumbLink\r\n });\r\n }\r\n breadcrumbs.push({\r\n displayName: displayName,\r\n route: workingState.name,\r\n disableLink: disableBreadCrumbLink\r\n });\r\n }\r\n }\r\n currentState = currentState.parent;\r\n }\r\n breadcrumbs.reverse();\r\n scope.breadcrumbs = breadcrumbs;\r\n }\r\n\r\n function displayParamAlreadyInBreadcrumb(displayParam, breadcrumbs) {\r\n var i;\r\n var alreadyUsed = false;\r\n for (i = 0; i < breadcrumbs.length; i++) {\r\n if (breadcrumbs[i].displayName === displayParam) {\r\n alreadyUsed = true;\r\n }\r\n }\r\n return alreadyUsed;\r\n }\r\n\r\n /**\r\n * Get the state to put in the breadcrumbs array, taking into account that if the current state is abstract,\r\n * we need to either substitute it with the state named in the `scope.abstractProxyProperty` property, or\r\n * set it to `false` which means this breadcrumb level will be skipped entirely.\r\n * @param currentState\r\n * @returns {*}\r\n */\r\n function getWorkingState(currentState) {\r\n var proxyStateName;\r\n var workingState = currentState;\r\n if (currentState.abstract === true) {\r\n if (typeof scope.abstractProxyProperty !== 'undefined') {\r\n proxyStateName = getObjectValue(scope.abstractProxyProperty, currentState);\r\n if (proxyStateName) {\r\n workingState = $state.get(proxyStateName);\r\n } else {\r\n workingState = false;\r\n }\r\n } else {\r\n workingState = $state.get(workingState);\r\n }\r\n }\r\n return workingState;\r\n }\r\n\r\n /**\r\n * Resolve the displayName of the specified state. Take the property specified by the `displayname-property`\r\n * attribute and look up the corresponding property on the state's config object. The specified string can be interpolated against any resolved\r\n * properties on the state config object, by using the usual {{ }} syntax.\r\n * @param currentState\r\n * @returns {*}\r\n */\r\n function getDisplayName(currentState) {\r\n var interpolationContext;\r\n var propertyReference;\r\n var displayName;\r\n\r\n if (!scope.displaynameProperty) {\r\n // if the displayname-property attribute was not specified, default to the state's name\r\n return currentState.name;\r\n }\r\n propertyReference = getObjectValue(scope.displaynameProperty, currentState);\r\n\r\n if (propertyReference === false) {\r\n return false;\r\n } else if (typeof propertyReference === 'undefined') {\r\n return currentState.name;\r\n } else {\r\n // use the $interpolate service to handle any bindings in the propertyReference string.\r\n interpolationContext = (typeof currentState.locals !== 'undefined') ? currentState.locals.globals : currentState;\r\n displayName = $interpolate(propertyReference)(interpolationContext);\r\n return displayName;\r\n }\r\n }\r\n\r\n function getDisplayParam(currentState) {\r\n var interpolationContext;\r\n var propertyReference;\r\n var displayName;\r\n\r\n if (!scope.displayparamProperty) {\r\n // if the displayname-property attribute was not specified, default to the state's name\r\n return currentState.name;\r\n }\r\n propertyReference = getObjectValue(scope.displayparamProperty, currentState);\r\n\r\n if (propertyReference !== false && typeof propertyReference !== 'undefined') {\r\n // use the $interpolate service to handle any bindings in the propertyReference string.\r\n interpolationContext = (typeof currentState.locals !== 'undefined') ? currentState.locals.globals : currentState;\r\n displayName = $interpolate(propertyReference)(interpolationContext);\r\n return displayName;\r\n }\r\n }\r\n\r\n /**\r\n * Given a string of the type 'object.property.property', traverse the given context (eg the current $state object) and return the\r\n * value found at that path.\r\n *\r\n * @param objectPath\r\n * @param context\r\n * @returns {*}\r\n */\r\n function getObjectValue(objectPath, context) {\r\n var i;\r\n var propertyArray = objectPath.split('.');\r\n var propertyReference = context;\r\n\r\n for (i = 0; i < propertyArray.length; i++) {\r\n if (angular.isDefined(propertyReference[propertyArray[i]])) {\r\n propertyReference = propertyReference[propertyArray[i]];\r\n } else {\r\n // if the specified property was not found, default to the state's name\r\n return undefined;\r\n }\r\n }\r\n return propertyReference;\r\n }\r\n\r\n /**\r\n * Check whether the current `state` has already appeared in the current breadcrumbs array. This check is necessary\r\n * when using abstract states that might specify a proxy that is already there in the breadcrumbs.\r\n * @param state\r\n * @param breadcrumbs\r\n * @returns {boolean}\r\n */\r\n function stateAlreadyInBreadcrumbs(state, breadcrumbs) {\r\n var i;\r\n var alreadyUsed = false;\r\n for (i = 0; i < breadcrumbs.length; i++) {\r\n if (breadcrumbs[i].route === state.name) {\r\n alreadyUsed = true;\r\n }\r\n }\r\n return alreadyUsed;\r\n }\r\n }\r\n };\r\n}\r\nangular.module('breadcrumbs', ['ngLodash']).directive('uiBreadcrumbs', uiBreadcrumbs);\r\n","/**\r\n * Checklist-model\r\n * AngularJS directive for list of checkboxes\r\n * https://github.com/vitalets/checklist-model\r\n * License: MIT http://opensource.org/licenses/MIT\r\n */\r\n\r\nangular.module('checklist-model', [])\r\n.directive('checklistModel', ['$parse', '$compile', function($parse, $compile) {\r\n // contains\r\n function contains(arr, item, comparator) {\r\n if (angular.isArray(arr)) {\r\n for (var i = arr.length; i--;) {\r\n if (comparator(arr[i], item)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // add\r\n function add(arr, item, comparator) {\r\n arr = angular.isArray(arr) ? arr : [];\r\n if(!contains(arr, item, comparator)) {\r\n arr.push(item);\r\n }\r\n return arr;\r\n } \r\n\r\n // remove\r\n function remove(arr, item, comparator) {\r\n if (angular.isArray(arr)) {\r\n for (var i = arr.length; i--;) {\r\n if (comparator(arr[i], item)) {\r\n arr.splice(i, 1);\r\n break;\r\n }\r\n }\r\n }\r\n return arr;\r\n }\r\n\r\n // http://stackoverflow.com/a/19228302/1458162\r\n function postLinkFn(scope, elem, attrs) {\r\n // exclude recursion, but still keep the model\r\n var checklistModel = attrs.checklistModel;\r\n attrs.$set(\"checklistModel\", null);\r\n // compile with `ng-model` pointing to `checked`\r\n $compile(elem)(scope);\r\n attrs.$set(\"checklistModel\", checklistModel);\r\n\r\n // getter / setter for original model\r\n var getter = $parse(checklistModel);\r\n var setter = getter.assign;\r\n var checklistChange = $parse(attrs.checklistChange);\r\n var checklistBeforeChange = $parse(attrs.checklistBeforeChange);\r\n\r\n // value added to list\r\n var value = attrs.checklistValue ? $parse(attrs.checklistValue)(scope.$parent) : attrs.value;\r\n\r\n\r\n var comparator = angular.equals;\r\n\r\n if (attrs.hasOwnProperty('checklistComparator')){\r\n if (attrs.checklistComparator[0] == '.') {\r\n var comparatorExpression = attrs.checklistComparator.substring(1);\r\n comparator = function (a, b) {\r\n return a[comparatorExpression] === b[comparatorExpression];\r\n };\r\n \r\n } else {\r\n comparator = $parse(attrs.checklistComparator)(scope.$parent);\r\n }\r\n }\r\n\r\n // watch UI checked change\r\n scope.$watch(attrs.ngModel, function(newValue, oldValue) {\r\n if (newValue === oldValue) { \r\n return;\r\n } \r\n\r\n if (checklistBeforeChange && (checklistBeforeChange(scope) === false)) {\r\n scope[attrs.ngModel] = contains(getter(scope.$parent), value, comparator);\r\n return;\r\n }\r\n\r\n setValueInChecklistModel(value, newValue);\r\n\r\n if (checklistChange) {\r\n checklistChange(scope);\r\n }\r\n });\r\n\r\n function setValueInChecklistModel(value, checked) {\r\n var current = getter(scope.$parent);\r\n if (angular.isFunction(setter)) {\r\n if (checked === true) {\r\n setter(scope.$parent, add(current, value, comparator));\r\n } else {\r\n setter(scope.$parent, remove(current, value, comparator));\r\n }\r\n }\r\n \r\n }\r\n\r\n // declare one function to be used for both $watch functions\r\n function setChecked(newArr, oldArr) {\r\n if (checklistBeforeChange && (checklistBeforeChange(scope) === false)) {\r\n setValueInChecklistModel(value, scope[attrs.ngModel]);\r\n return;\r\n }\r\n scope[attrs.ngModel] = contains(newArr, value, comparator);\r\n }\r\n\r\n // watch original model change\r\n // use the faster $watchCollection method if it's available\r\n if (angular.isFunction(scope.$parent.$watchCollection)) {\r\n scope.$parent.$watchCollection(checklistModel, setChecked);\r\n } else {\r\n scope.$parent.$watch(checklistModel, setChecked, true);\r\n }\r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n priority: 1000,\r\n terminal: true,\r\n scope: true,\r\n compile: function(tElement, tAttrs) {\r\n if ((tElement[0].tagName !== 'INPUT' || tAttrs.type !== 'checkbox') && (tElement[0].tagName !== 'MD-CHECKBOX') && (!tAttrs.btnCheckbox)) {\r\n throw 'checklist-model should be applied to `input[type=\"checkbox\"]` or `md-checkbox`.';\r\n }\r\n\r\n if (!tAttrs.checklistValue && !tAttrs.value) {\r\n throw 'You should provide `value` or `checklist-value`.';\r\n }\r\n\r\n // by default ngModel is 'checked', so we set it if not specified\r\n if (!tAttrs.ngModel) {\r\n // local scope var storing individual checkbox model\r\n tAttrs.$set(\"ngModel\", \"checked\");\r\n }\r\n\r\n return postLinkFn;\r\n }\r\n };\r\n}]);\r\n","function CollapseMenu ($document) {\r\n return {\r\n restrict: 'E',\r\n template: ''\r\n };\r\n}\r\n\r\nfunction CollapserDirective($document) {\r\n return {\r\n restrict: \"A\",\r\n link: function (scope, elem, attrs) {\r\n elem.on(\"click\", function collapse() {\r\n var body = angular.element($document[0].body);\r\n if (body.hasClass('mini-navbar')) {\r\n body.removeClass('mini-navbar');\r\n scope.$emit('cm:expanded');\r\n } else {\r\n body.addClass('mini-navbar');\r\n }\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('collapse-menu', [])\r\n.directive('collapseMenu', CollapseMenu)\r\n.directive(\"collapser\", CollapserDirective);\r\n","function DisplayTemperatureDirective() {\r\n return {\r\n restrict: \"A\",\r\n scope: {\r\n defaultTempUnit: \"=\",\r\n displayBothUnits: \"=\"\r\n },\r\n controller: function ($scope) {\r\n this.defaultTempUnit = $scope.defaultTempUnit;\r\n this.displayBothUnits = $scope.displayBothUnits;\r\n }\r\n }\r\n}\r\nangular.module(\"display-temperature\", []).directive(\"displayTemperature\", DisplayTemperatureDirective);\r\n","angular.module(\"files\", []).config(function ($compileProvider) {\r\n $compileProvider.aHrefSanitizationWhitelist(/^\\s*(https?|ftp|mailto|blob|tel):/);\r\n});;\r\n","angular.module(\"forms\", [\"vh.fixed\"]);\r\n","function escapeRegexString(value) {\r\n return value.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\r\n}\r\n\r\nangular.module(\"vh.highlight\", []).directive(\"highlight\", function () {\r\n return {\r\n restrict: \"A\",\r\n scope: false,\r\n require: \"ngModel\",\r\n link: function (scope, elem, attrs, modelController) {\r\n scope.highlightText = '';\r\n modelController.$render = function () {\r\n scope.highlightText = modelController.$viewValue;\r\n };\r\n },\r\n controller: function ($scope) {\r\n this.scope = $scope;\r\n }\r\n };\r\n}).directive(\"highlightable\", function($sce) {\r\n return {\r\n restrict: \"E\",\r\n require: [\"ngModel\",\"^?highlight\"],\r\n scope: false,\r\n template: '',\r\n link: function (scope, elem, attrs, controllers) {\r\n var modelController = controllers[0];\r\n var highlightController = controllers[1];\r\n var text = '';\r\n modelController.$render = function () {\r\n text = modelController.$viewValue;\r\n };\r\n scope.highlightText = function () {\r\n var html = text;\r\n if (!angular.isString(html)) return text;\r\n if (highlightController && highlightController.scope.highlightText && highlightController.scope.highlightText.length > 0) {\r\n var regex = new RegExp(escapeRegexString(highlightController.scope.highlightText), 'gi');\r\n html = html.replace(regex, '$&');\r\n }\r\n return $sce.trustAsHtml(html);\r\n };\r\n }\r\n };\r\n});\r\n","function ImageSelection($uibModal) {\r\n function showModal(imageOptions) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'components/imageselection/imageselection.modal.html',\r\n controller: 'ImageSelectionController as imgvm',\r\n backdrop: 'static',\r\n resolve: {\r\n options: function() {\r\n return imageOptions;\r\n }\r\n }\r\n });\r\n return modalInstance.result;\r\n }\r\n\r\n return {\r\n show: function(options) {\r\n var modalResult = showModal(options);\r\n return modalResult;\r\n }\r\n };\r\n}\r\n\r\nangular.module('imageselection', ['ui.bootstrap', 'naif.base64']).factory('ImageSelection', ImageSelection);\r\n","function PrintDirective($rootScope, $location, $transitions) {\r\n return {\r\n restrict: \"A\",\r\n link: function (scope, elem, attrs) {\r\n\r\n $transitions.onSuccess({}, (trans)=>{\r\n var params = $location.search();\r\n if (params.print) {\r\n elem.addClass(\"print\");\r\n } else {\r\n elem.removeClass(\"print\");\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nfunction PrintFooterDirective($compile, $document) {\r\n return {\r\n restrict: \"E\",\r\n transclude: true,\r\n replace: true,\r\n template: '
',\r\n link: function (scope, elem, attrs, controllers, transclude) {\r\n var escapedFooter = $compile('

')(scope);\r\n elem.parent().prepend(escapedFooter);\r\n scope.$watch(function () {\r\n return elem.html();\r\n }, function () {\r\n scope.$evalAsync(function () {\r\n scope.htmlText = elem.html();\r\n });\r\n });\r\n transclude(function (clone) {\r\n var htmlText = elem.html();\r\n scope.htmlText = htmlText;\r\n });\r\n\r\n scope.$on('destroy', function () {\r\n escapedFooter.remove();\r\n escapedFooter.$destroy();\r\n });\r\n }\r\n };\r\n}\r\n\r\nfunction PrintPageNumberDirective() {\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n template: ''\r\n };\r\n}\r\n\r\nfunction PrintPageCountDirective() {\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n template: ''\r\n };\r\n}\r\n\r\nangular.module(\"print\", [\"ui.router\"])\r\n.directive(\"print\", PrintDirective)\r\n.directive(\"printFooter\", PrintFooterDirective)\r\n.directive(\"printPageNumber\", PrintPageNumberDirective)\r\n.directive(\"printPageCount\", PrintPageCountDirective);\r\n","function searchBar() {\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n searchText: '=',\r\n placeholderText: '=',\r\n searchAction: '=',\r\n cancelAction: '='\r\n },\r\n template:\r\n '
' +\r\n '
' +\r\n '' +\r\n '
' +\r\n '' +\r\n '' +\r\n '
',\r\n controller: function ($scope) {\r\n $scope.activeSearch = false;\r\n $scope.performSearch = function () {\r\n $scope.activeSearch = true;\r\n $scope.searchAction();\r\n };\r\n $scope.clearSearch = function () {\r\n $scope.activeSearch = false;\r\n $scope.cancelAction();\r\n $scope.searchText = '';\r\n };\r\n $scope.plText = $scope.placeholderText;\r\n }\r\n };\r\n}\r\n\r\nangular.module('searchbar', []).directive('searchBar', searchBar);\r\n","function SmoothExpand($animate, $timeout) {\r\n return {\r\n restrict: 'A',\r\n link: function(scope, element, attrs) {\r\n scope.$root.$on('cm:expanded', function () {\r\n element.css('opacity', 0);\r\n $timeout(function() {\r\n element.addClass('side-nav-transtion');\r\n $timeout(function() {\r\n $animate.animate(element, {opacity:0}, {opacity:1}).then(function () {\r\n element.removeClass('side-nav-transtion');\r\n });\r\n }, 300);\r\n }, 0);\r\n\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('smooth-expand', []).directive('smoothExpand', SmoothExpand);\r\n","function SmoothScrollProvider() {\r\n\r\n var options = {\r\n yOffset: 0\r\n };\r\n\r\n /** @function yOffset\r\n * @param {int} yOffset the yOffset for the scoll element, to account for fixed headers.\r\n * @example yOffset(60) will scroll to 60px above the element\r\n */\r\n this.yOffset = function(yOffset) {\r\n options.yOffset = yOffset;\r\n };\r\n\r\n this.$get = function($document, $window, $timeout) {\r\n function currentYPosition() {\r\n // Firefox, Chrome, Opera, Safari\r\n if ($window.pageYOffset) return $window.pageYOffset;\r\n // Internet Explorer 6 - standards mode\r\n if ($document[0].documentElement && $document[0].documentElement.scrollTop)\r\n return $document[0].documentElement.scrollTop;\r\n // Internet Explorer 6, 7 and 8\r\n if ($document[0].body.scrollTop) return $document[0].body.scrollTop;\r\n return 0;\r\n }\r\n\r\n function scrollToPosition(stopY) {\r\n var startY = currentYPosition();\r\n var distance = stopY > startY ? stopY - startY : startY - stopY;\r\n if (distance < 100) {\r\n $window.scrollTo(0, stopY); return;\r\n }\r\n var speed = Math.round(distance / 100);\r\n if (speed >= 20) speed = 20;\r\n var step = Math.round(distance / 25);\r\n var leapY = stopY > startY ? startY + step : startY - step;\r\n var timer = 0;\r\n if (stopY > startY) {\r\n for ( var i=startY; i stopY) leapY = stopY;\r\n timer++;\r\n }\r\n return;\r\n }\r\n for ( var i=startY; i>stopY; i-=step ) {\r\n $timeout(function () {\r\n $window.scrollTo(0, leapY);\r\n }, timer * speed);\r\n leapY -= step;\r\n if (leapY < stopY) leapY = stopY;\r\n timer++;\r\n }\r\n }\r\n\r\n return {\r\n /** @function scroll\r\n * @oaram {String} scrollEId The id of the element you want to scroll to.\r\n * @param {string} [viewEId] The function will only scroll if this element is off the page.\r\n * If not defined, function will scroll only if scrollEId is off the page.\r\n */\r\n scroll: function(scrollEId, viewEId, yOffset) {\r\n var scrollElement = $document[0].getElementById(scrollEId);\r\n var viewElement;\r\n var offset = yOffset || options.yOffset;\r\n\r\n if (viewEId) {\r\n viewElement = $document[0].getElementById(viewEId);\r\n } else {\r\n viewElement = scrollElement;\r\n }\r\n\r\n if (viewElement && !isElmOnScreen(viewElement)) {\r\n var stopY = elmYPosition(scrollElement);\r\n scrollToPosition(stopY);\r\n }\r\n\r\n function elmYPosition(element) {\r\n var y = element.offsetTop;\r\n var node = element;\r\n while (node.offsetParent && node.offsetParent != $document[0].body) {\r\n node = node.offsetParent;\r\n y += node.offsetTop;\r\n }\r\n return Math.max(y - offset, 0);\r\n }\r\n\r\n function isElmOnScreen(element) {\r\n var curTop = element.getBoundingClientRect().top;\r\n if (curTop < 0) return false;\r\n var screenHeight = $window.innerHeight;\r\n return (curTop > (screenHeight - 100)) ? false : true;\r\n }\r\n },\r\n scrollToTop: function() {\r\n scrollToPosition(0);\r\n }\r\n };\r\n };\r\n}\r\n\r\nangular.module('smoothscroll', []).provider('SmoothScroll', SmoothScrollProvider);\r\n","angular.module('storage', []);\r\n","var listDeps = ['ui.router', 'storage', 'vh.ui.sweetalert', 'repos', 'vh_core.repository'];\r\nangular.module('time-log-session', listDeps);\r\n\r\n","angular.module('ui-select-extensions', []);\r\n","angular.module(\"vh-caregiver-menu\", []);","function FixedDirective($window, $document, $timeout) {\r\n function isChildOf(elem, potentialChild) {\r\n if (potentialChild === elem) {\r\n return true;\r\n }\r\n var parent = potentialChild.parent();\r\n while(parent[0]) {\r\n if (parent[0] === elem[0]) {\r\n return true;\r\n }\r\n parent = parent.parent();\r\n }\r\n return false;\r\n }\r\n\r\n function before(el, template) {\r\n var elParent = el.parent();\r\n var children = elParent.children();\r\n var prev;\r\n for(var i = 0; i < children.length; i++) {\r\n if (children[i] == el && i !== 0) {\r\n prev = children[i-1];\r\n break;\r\n }\r\n }\r\n if (prev) {\r\n prev.after(template);\r\n } else {\r\n elParent.prepend(template);\r\n }\r\n }\r\n\r\n function getScrollTop() {\r\n return typeof $window.pageYOffset != 'undefined' ? $window.pageYOffset : $document[0].documentElement.scrollTop ? $document[0].documentElement.scrollTop: body.scrollTop ? body.scrollTop : 0;\r\n }\r\n\r\n function checkVisible(elm, paddingHeight) {\r\n var rect = elm.getBoundingClientRect();\r\n\r\n return (rect.top >= 0 && (rect.bottom + paddingHeight) <= ($window.innerHeight || $document[0].documentElement.clientHeight));\r\n }\r\n\r\n return {\r\n restrict: \"A\",\r\n link: function (scope, elem, attrs) {\r\n //put a marker before this elem to mark and fix floats\r\n var marker = angular.element('
');\r\n var parent = elem.parent();\r\n var container = null;\r\n var angularWindow = angular.element($window);\r\n\r\n var paddingHeight = parseInt($window.getComputedStyle(elem[0], null).getPropertyValue('padding-top').replace('px', ''));\r\n\r\n before(elem, marker);\r\n elem.addClass(\"fixed\");\r\n\r\n while(parent[0] && container === null) {\r\n if (parent.attr(\"fixedContainer\")) {\r\n container = parent;\r\n break;\r\n }\r\n parent = parent.parent();\r\n }\r\n\r\n\r\n scrolled();\r\n angularWindow.on(\"resize scroll\", scrolled);\r\n\r\n // watcher for offset parent, if it changes we need to recalculate\r\n offsetWatch = scope.$watch(function () {\r\n return elem[0].offsetParent;\r\n }, function(newValue) {\r\n if (newValue) {\r\n scrolled();\r\n }\r\n });\r\n\r\n // watch the top of the marker to make sure the\r\n // fixed didnt get pushed off the window\r\n topWatch = scope.$watch(function () {\r\n var offsetParent = marker[0].offsetParent;\r\n var top = marker[0].offsetTop;\r\n if (offsetParent === null) {\r\n return;\r\n }\r\n while(offsetParent.nodeName.toLowerCase() !== \"body\") {\r\n top += offsetParent.offsetTop;\r\n offsetParent = offsetParent.offsetParent;\r\n }\r\n return top;\r\n }, scrolled);\r\n\r\n //clean up\r\n scope.$on('$destroy', function() {\r\n // since we move the element to body, it needs to be removed manually\r\n elem.remove();\r\n });\r\n\r\n elem.on(\"$destroy\", function () {\r\n angularWindow.off(\"resize scroll\", scrolled);\r\n offsetWatch();\r\n topWatch();\r\n });\r\n\r\n var isFocusListenerSet = false;\r\n\r\n // if a field gains focus under the fixed element, we need to scroll up so it is not covered up\r\n // to mimic the same effect as if the field gaining focus was below the screen when gaining focus\r\n var focusListener = function(event) {\r\n var targetElem = event.target;\r\n // ignore fields within the fixed element\r\n if (isChildOf(elem, angular.element(targetElem))) {\r\n return;\r\n }\r\n var top = targetElem.offsetTop;\r\n var rect = targetElem.getBoundingClientRect();\r\n var viewHeight = $window.innerHeight;\r\n var currentTop = viewHeight - rect.top;\r\n if (currentTop < 100) {\r\n $window.scrollTo(0, $window.scrollY + 50);\r\n }\r\n };\r\n\r\n function toggleFocusListener(isFixed) {\r\n if (isFocusListenerSet === undefined) { return; }\r\n\r\n if(isFixed && !isFocusListenerSet) {\r\n isFocusListenerSet = true;\r\n $document.on('focusin', focusListener);\r\n } else if (!isFixed && isFocusListenerSet) {\r\n isFocusListenerSet = false;\r\n $document.off('focusin', focusListener);\r\n }\r\n }\r\n\r\n // when scrolled or other events\r\n // throttle calculations every 200ms\r\n // if off page, move element to body tag, and add fixed class\r\n // else move back to where it was and remove class\r\n // also handle adding or removing listeners only when we need them\r\n var scrollTimeout = null;\r\n function scrolled() {\r\n if (scrollTimeout) {\r\n return;\r\n }\r\n scrollTimeout = $timeout(function () {\r\n scrollTimeout = null;\r\n if (checkVisible(marker[0], paddingHeight)) {\r\n elem.detach();\r\n marker.after(elem);\r\n elem.removeClass(\"fixed-bottom\");\r\n marker.css(\"height\", \"0px\");\r\n toggleFocusListener(false);\r\n } else {\r\n elem.detach();\r\n angular.element($document[0].body).append(elem);\r\n elem.addClass(\"fixed-bottom\");\r\n marker.css(\"height\", elem[0].clientHeight + \"px\");\r\n toggleFocusListener(true);\r\n }\r\n }, 200);\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.fixed\", []).directive(\"vhFixed\", FixedDirective);\r\n","angular.module(\"vh.language\", [\"ui.bootstrap\"]);\r\n","var listDeps = [\"ui.bootstrap\", \"as.sortable\", \"xeditable\", \"vh.language\", \"vh-slider\"];\r\nangular.module(\"vh-list-item\", listDeps);\r\n","function VhPagingDirective() {\r\n return {\r\n restrict: \"E\",\r\n template: '
',\r\n transclude: true,\r\n scope: {\r\n pageSize: \"=?\",\r\n totalCount: \"=\"\r\n },\r\n controller: function ($scope) {\r\n this.scope = $scope;\t\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.paging\", [\"ui.bootstrap\"]).directive(\"vhPaging\", VhPagingDirective);\r\n","angular.module(\"vh-phone\", []);\r\n","function vhSelectDirective() {\r\n return {\r\n restrict: \"A\",\r\n controller: function ($scope, $attrs) {\r\n var ctrl = this;\r\n var trackBy = $attrs.trackBy;\r\n\r\n ctrl.delegate = null;\r\n ctrl.selectables = {};\r\n ctrl.getSelectableKey = function (item) {\r\n return trackBy !== undefined ? item[trackBy] : item;\r\n };\r\n\r\n ctrl.clickedSelectable = function (item) {\r\n var key = ctrl.getSelectableKey(item);\r\n ctrl.delegate.clickedSelectable(ctrl.selectables[key]);\r\n };\r\n\r\n ctrl.unselect = function (selectable) {\r\n selectable.changeSelect(false);\r\n };\r\n\r\n ctrl.select = function (selectable) {\r\n selectable.changeSelect(true);\r\n };\r\n\r\n ctrl.registerSelectElem = function (selectable) {\r\n var key = ctrl.getSelectableKey(selectable.item);\r\n ctrl.selectables[key] = selectable;\r\n ctrl.delegate.addSelectable(selectable);\r\n };\r\n\r\n ctrl.removeSelectElem = function (selectable) {\r\n ctrl.delegate.removeSelectable(selectable);\r\n var key = ctrl.getSelectableKey(selectable.item);\r\n delete ctrl.selectables[key];\r\n };\r\n }\r\n };\r\n}\r\n\r\nfunction SelectableDirective($timeout) {\r\n var number = 1;\r\n return {\r\n restrict: \"A\",\r\n require: \"^vhSelect\",\r\n link: function (scope, elem, attrs, msCtrl) {\r\n elem.attr(\"selectable-id\", ++number);\r\n var selectedClass = attrs.selectClass || \"selected\";\r\n var item = scope.$eval(attrs.selectItem);\r\n var selectable = {\r\n scope: scope,\r\n elem: elem,\r\n item: item,\r\n changeSelect: changeSelect\r\n };\r\n\r\n scope.vhSelected = false;\r\n elem.on(\"click\", function ($event) {\r\n if (!shouldHandleClick($event.target)){\r\n return;\r\n }\r\n $timeout(msCtrl.clickedSelectable(selectable.item));\r\n });\r\n\r\n msCtrl.registerSelectElem(selectable);\r\n\r\n scope.$on(\"$destroy\", function () {\r\n msCtrl.removeSelectElem(selectable);\r\n });\r\n\r\n function changeSelect(selected) {\r\n scope.vhSelected = selected;\r\n if (selected) {\r\n elem.addClass(selectedClass);\r\n } else {\r\n elem.removeClass(selectedClass);\r\n }\r\n }\r\n\r\n // go up tree and determine if we should listen to this click\r\n // if we run into a button, ng-click, href, or a different selectable\r\n // before getting to this elem -> ignore click\r\n // unless selectable-extra attr is on the element\r\n // this way children can have different actions than the selectable\r\n // or children can have \"extra actions\" along with selecting the elem\r\n function shouldHandleClick(target) {\r\n if (attrs.disabled) {\r\n return false;\r\n }\r\n var tEl = angular.element(target);\r\n var depth = 0;\r\n while(depth < 50 && tEl && tEl.length > 0 && tEl.attr(\"selectable-id\") !== elem.attr(\"selectable-id\")) {\r\n depth++;\r\n if (tEl.attr(\"vh-selectable\") !== undefined) {\r\n return false;\r\n }\r\n\r\n if ((tEl[0].nodeName.toLowerCase() === \"button\" ||\r\n tEl.attr(\"ng-click\") ||\r\n tEl.attr(\"href\")) && tEl.attr(\"selectable-extra\") === undefined) {\r\n return false;\r\n }\r\n tEl = tEl.parent();\r\n }\r\n return true;\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.select\", [\"ngLodash\"])\r\n.directive(\"vhSelectable\", SelectableDirective)\r\n.directive(\"vhSelect\", vhSelectDirective);\r\n","var sliderDeps = [\"ui.bootstrap\", \"as.sortable\", \"xeditable\", \"vh.language\"];\r\nangular.module(\"vh-slider\", sliderDeps);","angular.module(\"vh.analytics\", []);\r\n","angular.module('authorization', ['authorization.login', 'repos', 'idle', 'storage', 'time-log-session', 'focusme', 'patients.list', 'permissions']);\r\n","var biDependencies = ['ui.select'];\r\n\r\nangular.module('bi', biDependencies);\r\n","function CaregiversRoutes($stateProvider) {\r\n\r\n $stateProvider.state(\"caregivers\", {\r\n url: '/Caregivers',\r\n data: {\r\n displayName: 'Care Team',\r\n displayIcon: 'fa fa-user-md'\r\n },\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/caregivers/caregivers.tpl.html',\r\n controller: 'CaregiversController as crvm'\r\n }\r\n },\r\n resolve: {\r\n isAll: function () {\r\n return true;\r\n },\r\n AdditionalIdentifiers: function(ConfigurationsService){\r\n return ConfigurationsService.getConfig().then(function(configs){\r\n return !!configs['HL7RequireAdditionalIdentifier']\r\n })\r\n\r\n }\r\n }\r\n })\r\n .state(\"caregivers.create\", {\r\n url:\"/create\",\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/caregivers/editCaregiver.tpl.html\",\r\n controller: \"EditCaregiverModalController as vm\"\r\n }\r\n },\r\n data: {\r\n displayName: 'New Caregiver',\r\n },\r\n params: {\r\n isNew: true\r\n },\r\n resolve: {\r\n caregiver: function ($stateParams, CaregiversService) {\r\n return {} ; },\r\n AdditionalIdentifiers: function(ConfigurationsService){\r\n return ConfigurationsService.getConfig().then(function(configs){\r\n return !!configs['HL7RequireAdditionalIdentifier']\r\n })\r\n\r\n }\r\n }\r\n })\r\n .state(\"caregivers.caregiver\", {\r\n url:\"/:caregiverId\",\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/caregivers/viewCaregiver.tpl.html\",\r\n controller: \"ViewCaregiverModalController as vm\"\r\n }\r\n },\r\n data: {\r\n displayName: 'View User',\r\n },\r\n params: {\r\n successMessage: null,\r\n },\r\n resolve: {\r\n caregiver: function ($stateParams, CaregiversService) {\r\n return CaregiversService.getCaregiverById($stateParams.caregiverId, true);\r\n },\r\n AdditionalIdentifiers: function(ConfigurationsService){\r\n return ConfigurationsService.getConfig().then(function(configs){\r\n return !!configs['HL7RequireAdditionalIdentifier']\r\n })\r\n\r\n }\r\n }\r\n })\r\n .state(\"caregivers.caregiver.edit\", {\r\n url: \"/edit\",\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/caregivers/editCaregiver.tpl.html\",\r\n controller: \"EditCaregiverModalController as vm\"\r\n }\r\n },\r\n data: {\r\n displayName: 'Edit User',\r\n },\r\n params: {\r\n isNew: false\r\n },\r\n resolve: {\r\n caregiver: function ($stateParams, CaregiversService) {\r\n return CaregiversService.getCaregiverById($stateParams.caregiverId);\r\n },\r\n AdditionalIdentifiers: function(ConfigurationsService){\r\n return ConfigurationsService.getConfig().then(function(configs){\r\n return !!configs['HL7RequireAdditionalIdentifier']\r\n })\r\n\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"caregivers\", [\r\n \"ui.router\",\r\n \"ui.bootstrap\",\r\n \"vh_core.repository\",\r\n \"ja.qr\"\r\n])\r\n.config(CaregiversRoutes);\r\n","function ConfigurationsRoutes($stateProvider) {\r\n $stateProvider.state(\"configurations\", {\r\n url: \"/Configurations\",\r\n abstract: true,\r\n data: {\r\n displayName: \"Configurations\",\r\n displayIcon: \"fa-gears\"\r\n }\r\n });\r\n\r\n $stateProvider.state(\"configurations.lists\", {\r\n url: \"/Lists\",\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/configurations/configurations.tpl.html',\r\n controller: 'ConfigurationsController as cvm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Lists',\r\n requiredPermissions: [\r\n \"ConfigurationPatientStatusRead\",\r\n \"ConfigurationSkipBiometricRead\",\r\n \"InstallMethodConfigRead\",\r\n \"ProviderRoleRead\",\r\n \"ConfigurationComorbidityRead\",\r\n \"EducationalMaterialRead\",\r\n \"ConfigurationDeleteReasonRead\",\r\n \"BiometricThresholdsChangeReasonsRead\",\r\n \"ConfigurationProviderGroupRead\",\r\n \"ConfigurationInterventionsRead\",\r\n \"MessageInterventionsRead\",\r\n \"ConfigurationsTransformsRead\",\r\n \"ConfigurationMilestoneRead\",\r\n \"CurrentProceduralTerminologyCodeRead\"\r\n ]\r\n },\r\n resolve: {\r\n configurationContent: function (EditConfigurationsService) {\r\n return EditConfigurationsService.getConfigurationContent();\r\n }\r\n }\r\n });\r\n\r\n $stateProvider.state('configurations.providers', {\r\n url: '/Providers',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/configurations/providers/providers.tpl.html',\r\n controller: 'ProvidersController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Providers',\r\n requiredPermissions: ['ConfigurationProviderGroupRead', 'ConfigurationProviderGroupWrite']\r\n },\r\n resolve: {\r\n configurationContent: function (EditConfigurationsService) {\r\n return EditConfigurationsService.getConfigurationContent();\r\n },\r\n webformfields: function(WebFormFieldRepository) {\r\n return WebFormFieldRepository.get();\r\n }\r\n }\r\n });\r\n\r\n $stateProvider.state('configurations.alerttypes', {\r\n url: '/AlertTypes',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/configurations/alerttypes/alerttypes.tpl.html',\r\n controller: 'AlertTypesCtrl as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Alert Types',\r\n requiredPermissions: ['AlertTypeRead']\r\n },\r\n resolve: {\r\n alerttypes: function(AlertTypesService) {\r\n return AlertTypesService.getAlertTypes().then(function(data) {\r\n return data;\r\n });\r\n }\r\n }\r\n });\r\n\r\n $stateProvider.state('configurations.patientheaderconfiguration', {\r\n url: '/PatientHeaderConfiguration',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/configurations/patientheaderconfiguration/patientheaderconfiguration.tpl.html',\r\n controller: 'PatientHeaderConfigurationCtrl as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Patient Header',\r\n requiredPermissions: ['PatientHeaderConfigurationWrite']\r\n },\r\n resolve: {\r\n patientHeaderConfigurations: function(PatientHeaderConfigurationService) {\r\n return PatientHeaderConfigurationService.getPatientHeaderConfigurations().then(function(data) {\r\n return data;\r\n });\r\n },\r\n availablePopulations: function(EditConfigurationsService, PermissionService) {\r\n var canAssignDisabledItems = PermissionService.canAssignDisabledItems = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n return EditConfigurationsService.populationsList({enabledOnly: !canAssignDisabledItems}).then(data => {\r\n return [...data.filter(x => x.IsEnabled), ...data.filter(x => !x.IsEnabled)];\r\n });\r\n }\r\n }\r\n });\r\n\r\n $stateProvider.state('configurations.caregiverUpload', {\r\n url: '/upload',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/configurations/caregiverUpload/caregiverUpload.tpl.html',\r\n controller: 'CaregiverUploadController as vm',\r\n }\r\n },\r\n data: {\r\n displayName: 'Upload Care Team Members',\r\n requiredPermissions: ['CaregiverMassUpload']\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"configurations\", [\r\n \"ui.router\",\r\n \"vh_core.repository\",\r\n \"ngLodash\",\r\n \"repos\",\r\n \"vh-list-item\",\r\n \"forms\",\r\n \"configurations.content\",\r\n \"configurations.providers\",\r\n \"configurations.alerttypes\",\r\n 'configurations.careManagementTypes',\r\n \"configurations.currentproceduralterminologycodes\",\r\n \"configurations.patientheaderconfiguration\",\r\n \"configurations.monitoringconfiguration\",\r\n \"configurations.caregiverUpload\",\r\n \"repos\",\r\n \"angularFileUpload\"\r\n]).config(ConfigurationsRoutes);\r\n","function ContentRoutes($stateProvider) {\r\n $stateProvider\r\n .state('content', {\r\n abstract: true,\r\n url: '/Content',\r\n data: {\r\n displayName: 'Content',\r\n displayIcon: 'fa-clipboard'\r\n }\r\n });\r\n}\r\n\r\nvar ContentDependencies = [\r\n 'ui.router',\r\n 'content.chart',\r\n 'content.categories',\r\n 'content.healthtips',\r\n 'content.patientsurvey',\r\n 'content.templates',\r\n 'content.cards',\r\n 'content.videos',\r\n 'content.library'\r\n];\r\nangular.module('content', ContentDependencies)\r\n .config(ContentRoutes);\r\n","function DashboardRoutes($stateProvider) {\r\n $stateProvider\r\n .state('dashboards', {\r\n abstract: true,\r\n url: \"/Dashboards\",\r\n data: {\r\n displayName: \"Dashboards\",\r\n displayIcon: \"fa-tachometer\",\r\n requiredPermissions: [\"DashboardRead\"]\r\n }\r\n }).state(\"dashboards.folder\", {\r\n url: \"/:folderId\"\r\n }).state('dashboards.folder.dashboard', {\r\n url: \"/:biReportId\",\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/dashboard/dashboard.tpl.html\",\r\n controller: \"DashboardController as dashboardCtrl\"\r\n }\r\n },\r\n lazyLoad: function (transition) {\r\n return transition.injector().get('BIService').getExagoApi();\r\n },\r\n resolve: {\r\n biReport: function ($stateParams, BIService) {\r\n var promise = BIService.getReport($stateParams.biReportId)\r\n\r\n promise.then\r\n (\r\n function (biReport) {\r\n // load cached HTML (might just be a page-level spinner)\r\n if (biReport && biReport.ExagoFullPath) {\r\n var cachedReport = BIService.getCachedReportContent(biReport.ExagoFullPath);\r\n if (cachedReport) {\r\n biReport.cachedReport = { content: cachedReport.content, timestamp: cachedReport.timeStamp };\r\n }\r\n }\r\n\r\n return biReport;\r\n }\r\n );\r\n\r\n return promise;\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar dashboardDependencies = [\r\n 'ui.router', 'bi'\r\n];\r\nangular.module('dashboards', dashboardDependencies)\r\n .config(DashboardRoutes);\r\n","function IdleConfig(IdleProvider) {\r\n IdleProvider.interrupt('mousemove keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll');\r\n}\r\n\r\nangular.module('idle', ['ngIdle', 'vh.ui.sweetalert', 'repos', 'authorization'])\r\n .config(IdleConfig);\r\n","function InvitesRoutes($stateProvider) {\r\n var filterDisplayNames = {\r\n all: \"All Invites\"\r\n };\r\n\r\n $stateProvider.state(\"invites\", {\r\n url: '/Invites',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/invites/invites.tpl.html',\r\n controller: 'InvitesController as ivm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Invites',\r\n displayIcon: 'fa-send',\r\n requiredPermissions: [\"InviteListRead\"],\r\n defaultParamValues: [\r\n {\r\n params: {filter: 'all'},\r\n displayName: filterDisplayNames.all\r\n }\r\n ]\r\n },\r\n resolve: {\r\n filterName: function ($stateParams) {\r\n return filterDisplayNames[$stateParams.filter];\r\n },\r\n webformfields: function(WebFormFieldRepository) {\r\n return WebFormFieldRepository.get();\r\n }, \r\n firstPageInvites: function (InvitesService) {\r\n return InvitesService.getInvites(\"\",\"\",25, 1);\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"invites\", [\r\n \"ui.router\",\r\n \"ui.bootstrap\",\r\n \"vh_core.repository\"\r\n])\r\n.config(InvitesRoutes);\r\n","function KitLogisticsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('kit_logistics', {\r\n abstract: true,\r\n url: '/KitLogistics',\r\n data: {\r\n displayName: 'Logistics',\r\n displayIcon: \"fa-briefcase\"\r\n }\r\n });\r\n}\r\n\r\nvar kitLogisticsDependencies = [\r\n 'ui.router',\r\n 'kit_logistics.locations',\r\n 'kit_logistics.provisioning',\r\n 'kit_logistics.kits',\r\n 'kit_logistics.logistics',\r\n 'kit_logistics.receive-kits'\r\n];\r\nangular.module('kit_logistics', kitLogisticsDependencies)\r\n .config(KitLogisticsRoutes);\r\n","\r\nangular.module('messaging', []);","function PatientRoutes($stateProvider) {\r\n $stateProvider.state(\"patients\", {\r\n abstract: true,\r\n url: \"/Patient\",\r\n data: {\r\n displayName: \"Patients\",\r\n displayIcon: \"fa-users\"\r\n }\r\n })\r\n .state(\"patients.patient\", {\r\n url: \"/:patientId?:hidenav\",\r\n data: {\r\n displayName: \"{{patientContent.patient.name | name}}\"\r\n },\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/patient/patient.tpl.html\",\r\n controller: \"PatientController as vm\"\r\n }\r\n },\r\n resolve: {\r\n patientContent: function (PatientHeaderService, $stateParams, ccowService) {\r\n return PatientHeaderService.getPatientHeader($stateParams.patientId).then(function (patientContent) {\r\n patientContent.patient = PatientHeaderService.mapPatient(patientContent.PatientHeader);\r\n var response = ccowService.portalPatientChange(patientContent.patient);\r\n if (response === 2) {\r\n //User chose to cancel, do not change state\r\n throw \"Patient context change event cancelled\";\r\n }\r\n return patientContent;\r\n });\r\n },\r\n hasMaskedIdentifiersWritePermission: function(PermissionService) {\r\n return PermissionService.userHasPermission(\"PatientMaskedIdentifierWrite\");\r\n },\r\n hasPatientHospitalUpdatePermission: function(PermissionService) {\r\n return PermissionService.userHasPermission(\"PatientHospitalUpdate\");\r\n },\r\n RequireAdditionalIdentifier: function(ConfigurationsService) {\r\n return ConfigurationsService.getConfig().then(function(data){\r\n return !!data.HL7RequireAdditionalIdentifier;\r\n });\r\n }\r\n }\r\n }).state(\"patients.patient.healthsummary\", {\r\n url: \"/HealthSummary\",\r\n views: {\r\n \"patient-area@patients.patient\": {\r\n templateUrl: \"modules/patient/healthsummary/healthsummary.tpl.html\",\r\n controller: \"HealthSummaryController as hsvm\"\r\n }\r\n },\r\n resolve: {\r\n healthSummaryReport: function (ReportsService, $stateParams) {\r\n return ReportsService.getHealthSummaryReport($stateParams.patientId);\r\n }\r\n },\r\n data: {\r\n displayName: \"Health Summary\",\r\n requiredPermissions: [\"HealthSummaryReport\"],\r\n timeLogAction: \"Viewing Patient Health Summary\"\r\n }\r\n });\r\n}\r\nangular.module(\"patient\", [\r\n \"patients.list\",\r\n 'patient.monitoring',\r\n 'patient.demographics',\r\n 'patient.chart',\r\n 'patient.activity',\r\n 'patient.medications',\r\n 'patient.directentry',\r\n 'patient.clinicalhistory',\r\n 'patient.parameters',\r\n \"patient.forms\",\r\n \"patient.header\",\r\n \"vh-ssn\",\r\n \"vh.rules.parser\"\r\n]).config(PatientRoutes);\r\n","angular.module('permissions', ['ngLodash', 'storage']);\r\n","function ReportsRoutes($stateProvider) {\r\n $stateProvider.state(\"healthsummaryreport\", {\r\n url: \"/Patient/:patientId/Reports/HealthSummary?print\",\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/reports/healthsummary.tpl.html\",\r\n controller: \"HealthSummaryController as hsvm\"\r\n }\r\n },\r\n resolve: {\r\n healthSummaryReport: function (ReportsService, $stateParams) {\r\n return ReportsService.getHealthSummaryReport($stateParams.patientId);\r\n }\r\n },\r\n data: {\r\n displayName: \"Health Summary\",\r\n requiredPermissions: [\"HealthSummaryReport\", \"DocumentGenerator\"]\r\n }\r\n }).state(\"reports\", {\r\n abstract: true,\r\n url: \"/Reports\",\r\n data: {\r\n displayName: \"Reports\",\r\n displayIcon: \"fa-area-chart\",\r\n requiredPermissions: [\"ReportsRead\"]\r\n }\r\n }).state(\"reports.folder\", {\r\n url: \"/:folderId\",\r\n cache: false,\r\n params: {\r\n isSelfService:[]\r\n },\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/bi/bi-ssreports.tpl.html\",\r\n controller: \"AllReportsController as rvm\"\r\n }\r\n },\r\n resolve: {\r\n reportData: function (BIService, $stateParams, $state) {\r\n var reports = BIService.getSelfServiceReports($stateParams.folderId);\r\n return reports;\r\n }\r\n\r\n },\r\n }).state(\"reports.folder.edit\", {\r\n url: \"/Edit\",\r\n cache: false,\r\n params: {\r\n report: [],\r\n isEdit: []\r\n },\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/bi/bi-reporteditiframe.tpl.html\",\r\n controller: \"BIReportEditController as rvm\"\r\n }\r\n },\r\n lazyLoad: function (transition) {\r\n return transition.injector().get('BIService').getExagoApi();\r\n }\r\n }).state(\"reports.folder.report\", {\r\n url: \"/:biReportId\",\r\n params: {\r\n isSelfService: []\r\n },\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/reports/report.tpl.html\",\r\n controller: \"ReportController as rvm\"\r\n }\r\n },\r\n lazyLoad: function (transition) {\r\n return transition.injector().get('BIService').getExagoApi();\r\n },\r\n resolve: {\r\n biReport: function ($stateParams, BIService) {\r\n return BIService.getReport($stateParams.biReportId);\r\n },\r\n PHIWarningText: function (ConfigurationRepository) {\r\n return ConfigurationRepository.getByParamName('ReportPHIWarningText').then(function (data) {\r\n return data.Value;\r\n });\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar reportDependencies = [\r\n 'ui.router', 'display-temperature', 'angles', 'angularMoment', 'reports.time_log', 'reports.patientforms', 'bi'\r\n];\r\n\r\nangular.module(\"reports\", reportDependencies).config(ReportsRoutes);\r\n","angular.module('repos', []);\r\n\r\nfunction ResponseTransformers() {\r\n return {\r\n // transform response and replace $ref placeholders (IsReference=true)\r\n transform$Ref: function(json) {\r\n var refMap = {};\r\n\r\n return JSON.parse(json, function (key, value) {\r\n if (key === '$id') { \r\n refMap[value] = this;\r\n // return undefined so that the property is deleted\r\n return void(0);\r\n }\r\n\r\n if (value && value.$ref) {\r\n return refMap[value.$ref];\r\n }\r\n\r\n return value; \r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('repos').factory('ResponseTransformers', ResponseTransformers);\r\n","function SiteRoutes($stateProvider) {\r\n $stateProvider\r\n .state('site', {\r\n abstract: true,\r\n url: '/Site',\r\n data: {\r\n displayName: 'Site',\r\n displayIcon: 'fa-hospital-o'\r\n }\r\n });\r\n}\r\n\r\nvar siteDependencies = [\r\n 'ui.router',\r\n 'site.biometrics',\r\n 'site.hospitals',\r\n 'site.payers',\r\n 'site.populations',\r\n 'site.populationGroups',\r\n 'site.profileFields',\r\n 'site.programDurations',\r\n 'site.providerGroups',\r\n 'site.referrals',\r\n 'site.specialhandling',\r\n 'site.settings'\r\n];\r\nangular.module('site', siteDependencies)\r\n .config(SiteRoutes);\r\n","function SystemRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system', {\r\n abstract: true,\r\n url: '/System',\r\n data: {\r\n displayName: 'System',\r\n displayIcon: \"fa-wrench\"\r\n }\r\n });\r\n}\r\n\r\nvar systemDependencies = [\r\n 'ui.router',\r\n 'system.controls',\r\n 'system.biometricAlerts',\r\n 'system.sms',\r\n 'system.settings',\r\n 'system.webhooks',\r\n 'system.securityroles',\r\n 'system.logo',\r\n 'system.email',\r\n 'system.forms',\r\n 'system.emailServers',\r\n 'system.serviceLevels',\r\n 'system.sites',\r\n 'system.titles',\r\n 'system.pickup',\r\n 'system.networkoperator',\r\n 'system.rules',\r\n 'system.languages',\r\n 'system.go_devices',\r\n 'twoFactorSetup',\r\n 'system.loginNotification',\r\n 'system.patientIdentifierFields'\r\n];\r\nangular.module('system', systemDependencies)\r\n .config(SystemRoutes);\r\n","var timeLogDeps = [\r\n 'ui.router',\r\n 'time_log.detail', \r\n 'xeditable'\r\n];\r\n\r\nangular.module('time_log', timeLogDeps);\r\n","\r\nangular.module('toast', []);","function LoginRoutes($stateProvider, $animateProvider, DirtyPageProvider) {\r\n var loginStateName = 'login';\r\n $stateProvider\r\n .state(loginStateName, {\r\n url: '/Login',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/authorization/login/login.tpl.html',\r\n controller: 'LoginController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Login'\r\n }\r\n })\r\n .state('reset', {\r\n url: '/Reset/{token}',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/authorization/login/login.tpl.html',\r\n controller: 'LoginController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Reset'\r\n }\r\n })\r\n .state('consume', {\r\n url: '/Consume'\r\n });\r\n\r\n $animateProvider.classNameFilter(/^(?:(?!ng-animate-disabled).)*$/);\r\n DirtyPageProvider.ignoreRoutes.push(loginStateName);\r\n}\r\n\r\nangular.module('authorization.login', ['ui.router', 'storage', 'ngAnimate']).config(LoginRoutes);\r\n","function TwoFactorSetupRoutes($stateProvider) {\r\n\r\n $stateProvider.state(\"twoFactorSetup\", {\r\n url: '/twoFactorSetup',\r\n data: {\r\n displayName: 'Two Factor Setup',\r\n displayIcon: 'fa fa-shield'\r\n },\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/authorization/twoFactorLoginSetup/twoFactorLoginSetup.tpl.html',\r\n controller: 'TwoFactorLoginSetupController as vm'\r\n }\r\n },\r\n resolve: {\r\n isAll: function () {\r\n return true;\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"twoFactorSetup\", [\r\n \"ui.router\",\r\n \"ui.bootstrap\",\r\n \"vh_core.repository\",\r\n \"ja.qr\"\r\n])\r\n.config(TwoFactorSetupRoutes);\r\n","angular.module('configurations.currentproceduralterminologycodes', ['ngSanitize'])\r\n.config(function($stateProvider) {\r\n\r\n $stateProvider.state('configurations.currentproceduralterminologycodes', {\r\n url: '/BillingCodes',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/configurations/billingcodes/currentproceduralterminologycodes.tpl.html',\r\n controller: 'CurrentProceduralTerminologyCodesCtrl as vm'\r\n }\r\n },\r\n resolve: {\r\n cptCodeList: function(CurrentProceduralTerminologyCodesService) {\r\n return CurrentProceduralTerminologyCodesService.getCurrentProceduralTerminologyCodes();\r\n },\r\n careManagementTypes: function(CareManagementTypesService) {\r\n return CareManagementTypesService.getAll(false);\r\n }\r\n },\r\n data: {\r\n displayName: 'Billing Codes',\r\n requiredPermissions: ['CurrentProceduralTerminologyCodeRead']\r\n }\r\n })\r\n\r\n .state('configurations.currentproceduralterminologycodes.edit', {\r\n url: '/:billingCode',\r\n views: {\r\n billingCode: {\r\n templateUrl: 'modules/configurations/billingcodes/currentproceduralterminologycodeEdit.tpl.html',\r\n controller: 'CurrentProceduralTerminologyCodeEditCtrl as vm'\r\n }\r\n },\r\n resolve: {\r\n cptCode: function($stateParams, cptCodeList) {\r\n if ($stateParams.billingCode === 'new') {\r\n return {};\r\n } else {\r\n return cptCodeList.find(o => o.Code === $stateParams.billingCode);\r\n }\r\n }\r\n },\r\n data: {\r\n displayName: 'CPT {{cptCode.Code}}'\r\n }\r\n });\r\n});\r\n","angular.module('configurations.caregiverUpload', []);","angular.module('configurations.alerttypes', [])\r\n.constant('AlertCategory', {\r\n Biometric: 'Biometric',\r\n Survey: 'Survey',\r\n Task: 'Task'\r\n})\r\n.constant('AlertType', {\r\n WeightBaseLine: 1,\r\n Password: 2,\r\n BloodPressureManualCount: 3,\r\n BloodSugarManualCount: 4,\r\n WeightScaleManualCount: 5,\r\n PulseOxManualCount: 6,\r\n BloodPressureBiometric: 7,\r\n BloodSugarBiometric: 8,\r\n WeightScaleBiometric: 9,\r\n PulseBiometric: 10,\r\n OxygenBiometric: 11,\r\n Survey: 12,\r\n Phone: 13,\r\n General: 14,\r\n CareplanOverdue: 15,\r\n NinetyDay: 16,\r\n IVRPinValidationFailed: 17,\r\n IVRWelcomeCallAttemptsExceeded: 18,\r\n TemperatureBiometric: 19,\r\n TemperatureManualCount: 20,\r\n QuestionableDate: 21,\r\n PEFBiometric: 23,\r\n SpirometerManualCount: 24,\r\n FEVOneBiometric: 25,\r\n FEVRatioBiometric: 26,\r\n SkipWeight: 27,\r\n SkipBloodPressure: 28,\r\n SkipBloodSugar: 29,\r\n SkipPulse: 30,\r\n SkipOxygen: 31,\r\n SkipTemperature: 32,\r\n SkipSpirometer: 33,\r\n StepsBiometric: 34,\r\n SkipSteps: 35,\r\n StepsManualCount: 36,\r\n SMSStopAlert: 37,\r\n Notification: 38,\r\n InUseKitDeliveredtoLogistics: 39,\r\n ExternalRegistrationFailed: 40,\r\n ScheduleChange: 41\r\n})\r\n.constant('AlertClass', {\r\n Alert: 1,\r\n Notification: 2\r\n})\r\n.constant('AlertSeverityLevel', {\r\n All: 0,\r\n High: 1,\r\n Medium: 2,\r\n None: 3,\r\n Notification: 4\r\n})\r\n.constant('AlertStatus', {\r\n All: 0,\r\n New: 1,\r\n Accepted: 2,\r\n Rejected: 3,\r\n Scheduled: 4\r\n});\r\n","function CareManagementTypesRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('configurations.careManagementTypes', {\r\n\t\t\t\turl: '/CareManagementTypes',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/configurations/careManagementTypes/careManagementTypes.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'CareManagementTypesController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Care Management Types',\r\n\t\t\t\t\trequiredPermissions: [\"PayersWrite\"]\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tcareManagementTypes: function(CareManagementTypesService) {\r\n\t\t\t\t\t\treturn CareManagementTypesService.getAll();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar careManagementTypesDependencies = [\r\n\t\"ui.router\"\r\n]\r\n\r\nangular.module(\"configurations.careManagementTypes\", careManagementTypesDependencies)\r\n\t.config(CareManagementTypesRoutes);\r\n\t","function ConfigContentRoutes($stateProvider) {\r\n $stateProvider.state(\"configurations.byod\", {\r\n url: \"/byod\",\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/configurations/content/content.tpl.html\",\r\n controller: \"ConfigContentController as bcvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"+Go Settings\",\r\n requiredPermissions: [\"WelcomeVideoConfigRead\"]\r\n },\r\n resolve: {\r\n multiLingualContent: function(ConfigurationContentService){\r\n return false;\r\n },\r\n kitContent: function(ConfigurationContentService) {\r\n return false;\r\n },\r\n webRpmContent: function(ConfigurationContentService) {\r\n return ConfigurationContentService.getGoConfigurationWebRpmContent(false).then(function(response) {\r\n if (response&&response.WelcomeVideos) {\r\n response.WelcomeVideos = false;\r\n }\r\n if (response && response.MultiLingualContent) {\r\n response.MultiLingualContent = false;\r\n }\r\n return response;\r\n }); \r\n },\r\n availableLanguages: function (ConfigurationContentService) {\r\n return false;\r\n },\r\n availablePopulations: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAvailablePopulations({enabledOnly: false});\r\n },\r\n contentConfig: function () {\r\n return { configTypeEnum: 2, configTypeText: \"+Go Settings\"};\r\n },\r\n ProgramGroupSettings: function(PopulationGroupsService) {\r\n return PopulationGroupsService.get({ enabledOnly : true })\r\n },\r\n SiteSettings: function (SitesService) {\r\n return false;\r\n }\r\n }\r\n }).state(\"configurations.GoConfigurations\", {\r\n url: \"/GoConfiguration\",\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/configurations/content/goconfigurations.tpl.html\",\r\n controller: \"GoConfigurationController as bcvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"+Go Configurations\",\r\n requiredPermissions: [\"WelcomeVideoConfigRead\"]\r\n },\r\n resolve: {\r\n multiLingualContent: function (ConfigurationContentService) {\r\n return false;\r\n },\r\n kitContent: function (ConfigurationContentService) {\r\n return false;\r\n },\r\n webRpmContent: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getGoConfigurationWebRpmContent(true);\r\n },\r\n availableLanguages: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAvailableLanguages();\r\n },\r\n availablePopulations: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAvailablePopulations({ enabledOnly: false });\r\n },\r\n contentConfig: function () {\r\n return { configTypeEnum: 2, configTypeText: \"+Go\", agreementType: \"Agreement\"};\r\n },\r\n HospitalSettings: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getHospital(); //get the list of facilities\r\n },\r\n ProgramGroupSettings: function(PopulationGroupsService) {\r\n return PopulationGroupsService.get({ enabledOnly: true });\r\n },\r\n Providers: function (ConfigurationContentService) {\r\n return ConfigurationContentService.GetProviders();\r\n }, \r\n SiteSettings: function (CaregiversService, AuthorizationService) {\r\n var caregiverId = AuthorizationService.getCaregiver();\r\n var id = caregiverId ? caregiverId.Id : 0;\r\n return CaregiversService.getSites();\r\n },\r\n ProviderGroup: function (ProviderGroupsService) {\r\n return ProviderGroupsService.get();\r\n },\r\n ConfigurationRankings: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getConfigurationRankings({ ConfigService: 'Go'});\r\n },\r\n Agreements: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAgreements(1);\r\n },\r\n AgreementsEnum: function () {\r\n var configurations = [{ Id: 99, Type: 'Title' }, { Id: 100, Type: 'SubTitle' }, { Id: 101, Type: 'Text' }]\r\n return configurations;\r\n }\r\n \r\n }\r\n }).state(\"configurations.ivr\", {\r\n url: \"/ivr\",\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/configurations/content/content.tpl.html\",\r\n controller: \"ConfigContentController as bcvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"IVR Text\",\r\n requiredPermissions: [\"WelcomeVideoConfigRead\"]\r\n },\r\n resolve: {\r\n multiLingualContent: function(ConfigurationContentService){\r\n return ConfigurationContentService.getMultiLingualContent(3);\r\n },\r\n kitContent: function(ConfigurationContentService) {\r\n return false;\r\n },\r\n webRpmContent: function(ConfigurationContentService) {\r\n return false;\r\n },\r\n availableLanguages: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAvailableLanguages();\r\n },\r\n availablePopulations: function (ConfigurationContentService) {\r\n return false;\r\n },\r\n contentConfig: function () {\r\n return {configTypeEnum: 3, configTypeText: \"IVR\"};\r\n },\r\n HospitalSettings: function (ConfigurationContentService) {\r\n return false;\r\n },\r\n ProgramGroupSettings: function(PopulationGroupsService) {\r\n return false;\r\n },\r\n SiteSettings: function(SitesService) {\r\n return false;\r\n }\r\n }\r\n }).state(\"configurations.kit\", {\r\n url: \"/kit\",\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/configurations/content/content.tpl.html\",\r\n controller: \"ConfigContentController as bcvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"+Home Settings\",\r\n requiredPermissions: [\"WelcomeVideoConfigRead\"]\r\n },\r\n resolve: {\r\n kitContent: function(ConfigurationContentService) {\r\n return ConfigurationContentService.getHomeKitContent(false).then(function (response) {\r\n if (response && response.Slideshows) {\r\n response.Slideshows = false;\r\n }\r\n if (response && response.MultiLingualContent) {\r\n response.MultiLingualContent = false;\r\n }\r\n return response;\r\n });\r\n },\r\n webRpmContent: function(ConfigurationContentService) {\r\n return false;\r\n },\r\n multiLingualContent: function(ConfigurationContentService){\r\n return false;\r\n },\r\n availableLanguages: function (ConfigurationContentService) {\r\n return false;;\r\n },\r\n availablePopulations: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAvailablePopulations({ enabledOnly: false });\r\n },\r\n contentConfig: function () {\r\n return {configTypeEnum: 1, configTypeText: \"+Home Settings\"};\r\n },\r\n HospitalSettings: function (ConfigurationContentService) {\r\n return false;\r\n },\r\n ProgramGroupSettings: function(PopulationGroupsService) {\r\n return false;\r\n },\r\n SiteSettings: function(SitesService) {\r\n return false;\r\n },\r\n ConfigurationRankings: function (ConfigurationContentService) {\r\n return false;\r\n }, \r\n }\r\n }).state(\"configurations.HomeConfigurations\", {\r\n url: \"/HomeConfiguration\",\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/configurations/content/goconfigurations.tpl.html\",\r\n controller: \"GoConfigurationController as bcvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"+Home Configurations\",\r\n requiredPermissions: [\"WelcomeVideoConfigRead\"]\r\n },\r\n resolve: {\r\n kitContent: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getHomeKitContent(true)\r\n },\r\n webRpmContent: function (ConfigurationContentService) {\r\n return false;\r\n },\r\n multiLingualContent: function (ConfigurationContentService) {\r\n return false;\r\n },\r\n availableLanguages: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAvailableLanguages();\r\n },\r\n availablePopulations: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAvailablePopulations({ enabledOnly: false });\r\n },\r\n contentConfig: function () {\r\n return { configTypeEnum: 1, configTypeText: \"+Home\" ,agreementType:\"Agreement\"};\r\n },\r\n HospitalSettings: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getHospital(); //get the list of facilities\r\n },\r\n ProgramGroupSettings: function (PopulationGroupsService) {\r\n return PopulationGroupsService.get({ enabledOnly: true })\r\n },\r\n Providers: function (ConfigurationContentService) {\r\n return ConfigurationContentService.GetProviders();\r\n }, \r\n SiteSettings: function (CaregiversService, AuthorizationService) {\r\n var caregiverId = AuthorizationService.getCaregiver();\r\n var id = caregiverId ? caregiverId.Id : 0;\r\n return CaregiversService.getSites();\r\n },\r\n ProviderGroup: function (ProviderGroupsService) {\r\n return ProviderGroupsService.get();\r\n },\r\n\r\n ConfigurationRankings: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getConfigurationRankings({ ConfigService: 'Home' });\r\n },\r\n Agreements: function (ConfigurationContentService) {\r\n return ConfigurationContentService.getAgreements(2);\r\n },\r\n\r\n AgreementsEnum: function () {\r\n var configurations = [{ Id: 102, Type: 'Title' }, { Id: 103, Type: 'SubTitle' }, { Id: 104, Type: 'Text' }]\r\n return configurations;\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"configurations.content\", ['site.populationGroups', 'system.sites', 'authorization'])\r\n .config(ConfigContentRoutes);\r\n","angular.module('configurations.monitoringconfiguration', []);","angular.module('configurations.patientheaderconfiguration', []);","angular.module('configurations.providers', []);","var cardsDeps = [\r\n 'ui.router',\r\n 'ui.bootstrap',\r\n 'ui.tree',\r\n 'ngLodash',\r\n 'xeditable',\r\n 'vh.ui.sweetalert',\r\n 'sticky',\r\n 'ui.select',\r\n 'ui-select-extensions',\r\n 'content.healthtipbutton',\r\n 'content.videobutton',\r\n 'focusme',\r\n 'content.alertlabel',\r\n 'content.services',\r\n 'permissions',\r\n 'content.schedule',\r\n 'smoothscroll',\r\n 'animatedflash',\r\n 'content.question',\r\n 'vh.highlight',\r\n 'vh.language',\r\n 'vh.ui.tags'\r\n];\r\nangular.module('content.cards', cardsDeps).config(CardsRoutes);\r\n\r\nfunction CardsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('content.cards', {\r\n url: '/cards/:cardGroupId',\r\n params: { cardGroupId: '-2' },\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/cards/cards.tpl.html',\r\n controller: 'CardsController as vm'\r\n },\r\n \r\n },\r\n data: {\r\n displayName: 'Coach Cards',\r\n displayParam: '{{CardGroup}}',\r\n requiredPermissions: [\"CoachCardRead\"]\r\n }\r\n /*\r\n ,\r\n resolve: {\r\n CardGroup: function ($stateParams, CardsService) {\r\n if ($stateParams.cardGroupId !== undefined && $stateParams.cardGroupId !== null && $stateParams.cardGroupId !== 0) {\r\n return CardsService.getCardGroupByPage(1, CardsService.getPageSize(), $stateParams.cardGroupId).then(function (group) {\r\n return group.CardGroupName;\r\n });\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n }\r\n */\r\n })\r\n\r\n .state('content_cards_card', {\r\n url: '/card/:CardId',\r\n parent: 'content.cards',\r\n templateUrl: 'modules/content/cards/cards.tpl.html',\r\n data: {\r\n displayName: '{{Card}}'\r\n }\r\n /*\r\n ,\r\n resolve: {\r\n CardGroup:\r\n function ($stateParams, CardsService) {\r\n return CardsService.getCard($stateParams.CardId).then(function (data) {\r\n return data;\r\n });\r\n },\r\n }\r\n */\r\n })\r\n\r\n .state('content_cards_card.edit', {\r\n url: '/Edit',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/cards/cardedit.tpl.html',\r\n }\r\n },\r\n data: {\r\n displayName: 'Edit',\r\n requiredPermissions: [\"CoachCardWrite\"]\r\n }\r\n });\r\n}\r\n","function ChartRoutes($stateProvider) {\r\n $stateProvider\r\n .state('content.chart', {\r\n url: '/ChartContent',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/chart/chart.tpl.html',\r\n controller: 'ContentChartController as cvm',\r\n }\r\n },\r\n data: {\r\n displayName: 'Chart Content',\r\n requiredPermissions: [\"ChartContentRead\"]\r\n },\r\n resolve: {\r\n chartContent: function (ContentChartService) {\r\n return ContentChartService.getChartContent();\r\n }\r\n }\r\n })\r\n\r\n .state('content.chart.category', {\r\n url: '/:MasterChartCategoryId',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/chart/chart.tpl.html',\r\n controller: 'ContentChartController as cvm',\r\n }\r\n },\r\n data: {\r\n displayName: 'Category'\r\n }\r\n });\r\n}\r\n\r\n\r\nvar chartDep = [\r\n 'ui.router',\r\n 'ngLodash',\r\n 'ui.bootstrap',\r\n 'vh.ui.sweetalert',\r\n 'xeditable',\r\n 'ui.tree',\r\n 'focusme',\r\n 'animatedflash',\r\n 'sticky',\r\n 'permissions',\r\n 'as.sortable'\r\n];\r\nangular.module('content.chart', chartDep).config(ChartRoutes);\r\n","function LibraryRoutes($stateProvider) {\r\n $stateProvider\r\n .state('content.library', {\r\n url: '/ResourceLibrary/:groupId?groupName',\r\n params: {\r\n groupId: '',\r\n groupName: ''\r\n },\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/resource_library/resource.library.tpl.html',\r\n controller: 'ResourceLibraryController as vm',\r\n }\r\n },\r\n data: {\r\n displayName: 'Resource Library',\r\n requiredPermissions: [\"ResourceLibraryRead\"]\r\n }\r\n })\r\n .state('content.library.tile', {\r\n url: '/Tile/:tileId',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/resource_library/resource.library.tpl.html',\r\n controller: 'ResourceLibraryController as vm',\r\n }\r\n },\r\n data: {\r\n displayName: 'Resource Library',\r\n requiredPermissions: [\"ResourceLibraryRead\"]\r\n }\r\n })\r\n .state('content.library.tile.healthtips', {\r\n url: '/HealthTips',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/resource_library/add_resource/add.resource.tpl.html',\r\n controller: 'AddTileResourceController as vm',\r\n }\r\n }\r\n })\r\n .state('content.library.tile.videos', {\r\n url: '/Videos',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/resource_library/add_resource/add.resource.tpl.html',\r\n controller: 'AddTileResourceController as vm',\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('content.library', [\r\n \"ui.router\",\r\n \"ui.bootstrap\",\r\n \"vh_core.repository\",\r\n \"repos\",\r\n \"ui.select\",\r\n \"ngSanitize\"\r\n]).config(LibraryRoutes);","function KitsConfig($stateProvider) {\r\n $stateProvider.state(\"kit_logistics.kits\", {\r\n url: \"/Kits\",\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/kit_logistics/kits/kits.tpl.html\",\r\n controller: \"KitsController as klvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"Kits\",\r\n requiredPermissions: [\"KitsRead\"]\r\n },\r\n resolve: {\r\n kitsContent: function (KitsService) {\r\n var filters = {pageSize: 50, pageNumber: 1, sortBy: \"KITNO=a\"};\r\n return KitsService.getContent(filters).then(function (result) {\r\n result.filters = filters;\r\n return result;\r\n });\r\n },\r\n portalConfig: function(ConfigurationsService) {\r\n return ConfigurationsService.getConfig();\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"kit_logistics.kits\", [\r\n \"ui.bootstrap\",\r\n \"ui.router\",\r\n \"forms\",\r\n \"ngLodash\",\r\n \"vh.select\",\r\n \"kits.kit\"\r\n]).config(KitsConfig);\r\n","function KitLogisticsLocationsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('kit_logistics.locations', {\r\n url: '/Locations',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/kit_logistics/locations/locations.tpl.html',\r\n controller: 'KitLogisticsLocationsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Locations',\r\n requiredPermissions: [\"KitLocationRead\"]\r\n },\r\n resolve: {\r\n locations: function (KitLogisticsLocationsService) {\r\n return KitLogisticsLocationsService.getLocations();\r\n },\r\n hospitalLabel: function(KitLogisticsLocationsService) {\r\n return KitLogisticsLocationsService.getHospitalLabel();\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar kitLogisticsLocationsDependencies = [\r\n 'ui.router',\r\n 'kit_logistics.locations',\r\n 'angular-pluralize'\r\n];\r\nangular.module('kit_logistics.locations', kitLogisticsLocationsDependencies)\r\n .config(KitLogisticsLocationsRoutes);\r\n","function KitLogisticsLogisticsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('kit_logistics.logistics', {\r\n url: '/logistics?patientId',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/kit_logistics/logistics/logistics.tpl.html',\r\n controller: 'LogisticsController as vm',\r\n }\r\n },\r\n data: {\r\n displayName: 'Ship/Pickup',\r\n requiredPermissions: ['KitLogisticsRead']\r\n },\r\n resolve: {\r\n searchableFields: function (LogisticsService) {\r\n return LogisticsService.GetSearchableFields().then(function (searchableFields) {\r\n return searchableFields;\r\n });\r\n }\r\n }\r\n })\r\n .state('kit_logistics.logistics.filtered', {\r\n url: '/logistics?filterBy',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/kit_logistics/logistics/logistics.tpl.html',\r\n controller: 'LogisticsController as vm',\r\n }\r\n },\r\n data: {\r\n displayName: 'Ship/Pickup',\r\n requiredPermissions: ['KitLogisticsRead']\r\n },\r\n resolve: {\r\n searchableFields: function (LogisticsService) {\r\n return LogisticsService.GetSearchableFields().then(function (searchableFields) {\r\n return searchableFields;\r\n });\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar logisticsDependencies = [\r\n 'ui.router',\r\n 'ui.bootstrap'\r\n];\r\n\r\nangular.module('kit_logistics.logistics', logisticsDependencies).config(KitLogisticsLogisticsRoutes);\r\n","function KitLogisticsProvisioningRoutes($stateProvider) {\r\n $stateProvider\r\n .state('kit_logistics.provisioning', {\r\n url: '/Provisioning',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/kit_logistics/provisioning/provisioning.tpl.html',\r\n controller: 'KitLogisticsProvisioningController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Provisioning',\r\n requiredPermissions: [\"ProvisionKits\"]\r\n },\r\n resolve: {\r\n kits: function (KitLogisticsProvisioningService) {\r\n return KitLogisticsProvisioningService.getKits();\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar kitLogisticsProvisioningDependencies = [\r\n 'ui.router',\r\n 'kit_logistics.provisioning',\r\n];\r\nangular.module('kit_logistics.provisioning', kitLogisticsProvisioningDependencies)\r\n .config(KitLogisticsProvisioningRoutes);\r\n","function InboundDeliveriesRoutes($stateProvider) {\r\n $stateProvider\r\n .state('kit_logistics.receive-kits', {\r\n url: '/ReceiveKits',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/kit_logistics/receive-kits/receive-kits.tpl.html',\r\n controller: 'InboundController as ivm',\r\n\r\n }\r\n },\r\n data: {\r\n displayName: 'Receive Kits',\r\n requiredPermissions: ['ReceiveKitsRead']\r\n },\r\n resolve: {\r\n inboundContent: function (InboundService) {\r\n return InboundService.getInboundContent();\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar InboundDeliveriesDependencies = [\r\n 'ui.router',\r\n 'ui.bootstrap'\r\n];\r\n\r\nangular.module('kit_logistics.receive-kits', InboundDeliveriesDependencies).config(InboundDeliveriesRoutes);\r\n","function ActivityRoutes($stateProvider) {\r\n $stateProvider\r\n .state('patients.patient.activity', {\r\n url: '/Activity',\r\n views: {\r\n 'patient-area': {\r\n templateUrl: 'modules/patient/activity/activity.tpl.html',\r\n controller: 'ActivityController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Activity',\r\n requiredPermissions: ['PatientClinicalDataRead'], //TODO: probably need patient activity history permissions\r\n timeLogAction: 'Patient Activity History View'\r\n },\r\n resolve: {\r\n }\r\n });\r\n}\r\n\r\nangular.module('patient.activity', []).config(ActivityRoutes);\r\n","function PatientChartRoutes($stateProvider) {\r\n $stateProvider\r\n .state('patients.patient.chart', {\r\n url: '/Chart',\r\n views: {\r\n 'patient-area': {\r\n templateUrl: 'modules/patient/chart/chart.tpl.html',\r\n controller: 'PatientChartController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Chart',\r\n requiredPermissions: ['PatientChartNotesRead'],\r\n timeLogAction: 'Patient Chart View'\r\n },\r\n params: {\r\n changedEntry: 0\r\n },\r\n resolve: {\r\n chart: function(PatientChartService, $stateParams) {\r\n return PatientChartService.getChart($stateParams.patientId, 50, 1);\r\n },\r\n chartLogger: function (AnalyticsFactory, $stateParams) {\r\n return new AnalyticsFactory(\"View patient notes\", $stateParams.patientId);\r\n }\r\n }\r\n })\r\n .state(\"patients.patient.chart.create\", {\r\n url: \"/Create\",\r\n views: {\r\n \"patient-area@patients.patient\": {\r\n templateUrl: \"modules/patient/chart/entry.tpl.html\",\r\n controller: \"PatientChartEntryController as vm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"Entry\",\r\n requiredPermissions: [\"PatientChartNotesWrite\"],\r\n timeLogAction: \"Patient Chart Add\"\r\n },\r\n resolve: {\r\n entryGroup: function () {\r\n return {};\r\n },\r\n masterEntries: function (PatientChartService, $stateParams) {\r\n return PatientChartService.getMasterEntries($stateParams.patientId, 50,1);\r\n },\r\n logger: function (AnalyticsFactory, $stateParams) {\r\n return new AnalyticsFactory(\"Add new patient chart entry\", $stateParams.patientId);\r\n }\r\n }\r\n })\r\n .state('patients.patient.chart.entry', {\r\n url: '/:patientChartEntryGroupId',\r\n views: {\r\n 'patient-area@patients.patient': {\r\n templateUrl: \"modules/patient/chart/entry.tpl.html\",\r\n controller: \"PatientChartEntryController as vm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"Entry\",\r\n requiredPermissions: [\"PatientChartNotesWrite\"],\r\n timeLogAction: \"Patient Chart Edit\"\r\n },\r\n resolve: {\r\n entryGroup: function (PatientChartService, $stateParams) {\r\n return PatientChartService.getEntryGroup($stateParams.patientId, $stateParams.patientChartEntryGroupId);\t\r\n },\r\n masterEntries: function (PatientChartService, $stateParams) {\r\n return PatientChartService.getMasterEntries($stateParams.patientId, 50, 1);\r\n },\r\n logger: function (AnalyticsFactory, $stateParams) {\r\n return new AnalyticsFactory(\"Edit patient chart entry\", $stateParams.patientId);\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('patient.chart', ['vh.highlight', 'vh.analytics']).config(PatientChartRoutes);\r\n\r\n","function DemographicsRoutes($stateProvider, modalStateProvider) {\r\n $stateProvider\r\n .state('patients.patient.demographics', {\r\n url: '/Demographics',\r\n views: {\r\n 'patient-area': {\r\n templateUrl: 'modules/patient/demographics/demographicsview.tpl.html',\r\n controller: 'DemographicsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Demographics',\r\n requiredPermissions: ['PatientDemographicsRead'],\r\n timeLogAction: 'Patient Demographics View'\r\n },\r\n resolve: {\r\n demographics: function(DemographicsService, $stateParams) {\r\n return DemographicsService.getLists($stateParams.patientId);\r\n },\r\n patientDemographics: function(DemographicsService, $stateParams) {\r\n return DemographicsService.getPatient($stateParams.patientId);\r\n },\r\n hasWritePermission: function(PermissionService) {\r\n return PermissionService.userHasPermission(\"PatientDemographicsWrite\");\r\n },\r\n hasProgramStartDateWritePermission: function(PermissionService) {\r\n return PermissionService.userHasPermission(\"ProgramStartDateWrite\");\r\n },\r\n ShowPatientIdentifier: function(ConfigurationsService) {\r\n return ConfigurationsService.getConfig().then(function(data){\r\n return !!data.ShowPatientIdentifier;\r\n });\r\n },\r\n showPinInHeader: function(ConfigurationsService){\r\n return ConfigurationsService.getConfig().then(function(data) {\r\n return data.ShowPinInPatientHeader === true;\r\n });\r\n }, \r\n monitoringCaregivers: function(PatientDemographicsCaregiversService, $stateParams) {\r\n return PatientDemographicsCaregiversService.getPatientCaregivers($stateParams.patientId);\r\n },\r\n specialHandling: function(PatientDemographicSpecialHandlingService, $stateParams) {\r\n return PatientDemographicSpecialHandlingService.getPatientSpecialHandling($stateParams.patientId);\r\n },\r\n // patientProviders: function(PatientDemographicsProvidersService, $stateParams) {\r\n // return PatientDemographicsProvidersService.getProviders($stateParams.patientId);\r\n // },\r\n emergencyContacts: function(PatientDemographicsContactsService, $stateParams) {\r\n return PatientDemographicsContactsService.getContacts($stateParams.patientId);\r\n },\r\n ProviderGroups: function(PatientDemographicsProvidersService) {\r\n return PatientDemographicsProvidersService.getProviderGroups();\r\n },\r\n patientIdentifierFields: function(DemographicsService, $stateParams) {\r\n return DemographicsService.getPatientIdentifierFields($stateParams.patientId);\r\n },\r\n patientConfigurationRankings: function(ConfigurationsService, $stateParams) {\r\n return ConfigurationsService.getConfigRankings($stateParams.patientId);\r\n },\r\n currentSites: function (AuthorizationService) {\r\n return AuthorizationService.getSites().then(function (data) {\r\n return data.filter(s => s.IsCurrent == true);\r\n });\r\n } \r\n }\r\n })\r\n \r\n .state(\"patients.Search\", {\r\n url: \"/SearchPatient\",\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/patient/demographics/PatientSearch.tpl.html',\r\n controller: 'PatientSearchController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Search Patient',\r\n requiredPermissions: ['PatientDemographicsRead']\r\n },\r\n resolve: {\r\n WebFormFields: function (DemographicsService) {\r\n return DemographicsService.getWebFormFields();\r\n }\r\n }\r\n })\r\n\r\n .state(\"patients.create\", {\r\n url: \"/Create\",\r\n params: {\r\n PatientFields: {}\r\n },\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/patient/demographics/demographics.tpl.html',\r\n controller: 'DemographicsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Create Patient',\r\n requiredPermissions: ['PatientDemographicsRead']\r\n },\r\n resolve: {\r\n demographics: function(DemographicsService) {\r\n return DemographicsService.getLists(0);\r\n },\r\n patientDemographics: function (DemographicsService,$stateParams) {\r\n var patientFields = $stateParams;\r\n return DemographicsService.getNewPatient(patientFields);\r\n },\r\n hasWritePermission: function(PermissionService) {\r\n return PermissionService.userHasPermission(\"PatientDemographicsWrite\");\r\n },\r\n hasMaskedIdentifiersWritePermission: function(PermissionService) {\r\n return PermissionService.userHasPermission(\"PatientMaskedIdentifierWrite\");\r\n },\r\n hasPatientHospitalUpdatePermission: function(PermissionService) {\r\n return PermissionService.userHasPermission(\"PatientHospitalUpdate\");\r\n },\r\n hasProgramStartDateWritePermission: function(PermissionService) {\r\n return PermissionService.userHasPermission(\"ProgramStartDateWrite\");\r\n },\r\n RequireAdditionalIdentifier: function(ConfigurationsService) {\r\n return ConfigurationsService.getConfig().then(function(data){\r\n return !!data.HL7RequireAdditionalIdentifier;\r\n });\r\n },\r\n ShowPatientIdentifier: function(ConfigurationsService) {\r\n return ConfigurationsService.getConfig().then(function(data){\r\n return !!data.ShowPatientIdentifier;\r\n });\r\n },\r\n showPinInHeader: function(ConfigurationsService){\r\n return ConfigurationsService.getConfig().then(function(data) {\r\n return data.ShowPinInPatientHeader === true;\r\n });\r\n }, \r\n monitoringCaregivers: function() {\r\n return [];\r\n },\r\n specialHandling: function() {\r\n return [];\r\n },\r\n // patientProviders: function() {\r\n // return [];\r\n // },\r\n emergencyContacts: function(PatientDemographicsContactsService, $stateParams) {\r\n return [];\r\n },\r\n ProviderGroups: function(PatientDemographicsProvidersService) {\r\n return PatientDemographicsProvidersService.getProviderGroups();\r\n },\r\n patientIdentifierFields: function(DemographicsService) {\r\n return DemographicsService.getPatientIdentifierFields(-1);\r\n },\r\n patientConfigurationRankings: function (ConfigurationsService, $stateParams) {\r\n return false;\r\n },\r\n currentSites: function (AuthorizationService) {\r\n return AuthorizationService.getSites().then(function (data) {\r\n return data.filter(s => s.IsCurrent == true);\r\n });\r\n } \r\n }\r\n });\r\n\r\n modalStateProvider.state('patients.patient.demographics.servicelevelWizard', {\r\n templateUrl: 'modules/patient/demographics/servicelevels/servicelevel-wizard.modal.html',\r\n controller: 'ServiceLevelWizardController as slw',\r\n backdrop: 'static',\r\n //_demographics.scss line 31\r\n size: 'lgmd',\r\n windowClass: 'tempClass',\r\n resolve: {\r\n serviceLevels: function (PatientServiceLevelService, $stateParams) {\r\n 'ngInject';\r\n return PatientServiceLevelService.getServiceLevels($stateParams.patientId);\r\n },\r\n patient: function (DemographicsService, $stateParams) {\r\n 'ngInject';\r\n return DemographicsService.getPatient($stateParams.patientId)\r\n },\r\n patientServiceLevel: function (PatientServiceLevelService, $stateParams) {\r\n 'ngInject';\r\n return PatientServiceLevelService.getPatientServiceLevelWithKitInfo($stateParams.patientId);\r\n },\r\n webFormFields: function (DemographicsService, $stateParams) {\r\n 'ngInject';\r\n return DemographicsService.getWebFormFields();\r\n },\r\n configurations: function (ConfigurationsService) {\r\n 'ngInject';\r\n return ConfigurationsService.getConfig();\r\n },\r\n configurationRankings: function(ConfigurationsService, $stateParams) {\r\n 'ngInject';\r\n // fetch new configuration sets\r\n return ConfigurationsService.getConfigRankings($stateParams.patientId);\r\n },\r\n kitInfo: function (PatientServiceLevelService) {\r\n 'ngInject';\r\n return PatientServiceLevelService.getServiceLevelKitInfo();\r\n },\r\n availableLanguages: function (TemplatesService) {\r\n 'ngInject';\r\n return TemplatesService.getAvailableLanguages();\r\n },\r\n availableEducationMaterials: function (PatientServiceLevelService, lodash) {\r\n 'ngInject';\r\n return PatientServiceLevelService.getEducationMaterials().then(function (response) {\r\n return lodash.filter(response.data, { 'Disabled': false });\r\n });\r\n },\r\n logisticsConfig: function (PatientServiceLevelService) {\r\n 'ngInject';\r\n return PatientServiceLevelService.getLogisticsConfiguration();\r\n },\r\n installMethods: function (DemographicsService) {\r\n 'ngInject';\r\n return DemographicsService.getInstallMethods();\r\n },\r\n kitPickupOptions: function(pickupService) {\r\n 'ngInject';\r\n return pickupService.getAll();\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('patient.demographics', ['forms', 'vh-phone'])\r\n.config(DemographicsRoutes)\r\n.constant('ServiceLevelType', {\r\n None: null,\r\n GoAddDevice: -1,\r\n Unassign: 0,\r\n CMP: 1,\r\n RPM: 2,\r\n RPMVideo: 3,\r\n BYOD: 9,\r\n IVR: 10,\r\n Go: 11,\r\n});\r\n","function DirectEntryRoutes($stateProvider) {\r\n $stateProvider\r\n .state('patients.patient.directentry', {\r\n url: '/DirectEntry',\r\n views: {\r\n 'patient-area': {\r\n templateUrl: 'modules/patient/directentry/directentry.tpl.html',\r\n controller: 'DirectEntryController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'DirectEntry',\r\n requiredPermissions: ['DirectEntryWrite'],\r\n timeLogAction: 'Patient DirectEntry View'\r\n },\r\n resolve: {\r\n portalConfig: function (ConfigurationsService) {\r\n return ConfigurationsService.getConfig();\r\n },\r\n PatientTimeZone: function($stateParams, DirectEntryService) {\r\n var date = new Date();\r\n return DirectEntryService.getDirectEntry($stateParams.patientId, date).then(function(response){\r\n return response.PatientTimeZone;\r\n })\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('patient.directentry', []).config(DirectEntryRoutes);","function PatientFormsRoutes($stateProvider) {\r\n $stateProvider.state(\"patients.patient.forms\", {\r\n url: \"/Forms\",\r\n views: {\r\n \"patient-area\": {\r\n templateUrl: \"modules/patient/forms/forms.tpl.html\",\r\n controller: \"PatientFormsController as pfvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"Forms\",\r\n requiredPermissions: [\"PatientFormRead\"],\r\n timeLogAction: 'Forms'\r\n },\r\n resolve: {\r\n allForms: function (PatientFormsService, $stateParams) {\r\n return PatientFormsService.getForms($stateParams.patientId).then(function(forms) {\r\n return forms.filter(function(form) {\r\n return form.IsActive;\r\n });\r\n });\r\n }\r\n }\r\n }).state(\"patients.patient.forms.form\", {\r\n url: \"/:patientFormId\",\r\n views: {\r\n \"patient-area@patients.patient\": {\r\n templateUrl: \"modules/patient/forms/form.tpl.html\",\r\n controller: \"PatientFormController as pfvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"{{form.currentForm.FormTypeName}}\",\r\n requiredPermissions: [\"PatientFormRead\"],\r\n timeLogAction: 'Patient Forms'\r\n },\r\n resolve: {\r\n form: function (PatientFormsService, $stateParams) {\r\n return PatientFormsService.getPatientForm($stateParams.patientId, $stateParams.patientFormId).then(function (data) {\r\n return PatientFormsService.getPatientFormsByType($stateParams.patientId, data.FormTypeId).then(function(forms) {\r\n return PatientFormsService.getFormQuestionValues($stateParams.patientId, data.FormId, $stateParams.patientFormId).then(function(questionValues) {\r\n return {\r\n currentForm: data,\r\n otherForms: forms,\r\n questionValues: questionValues\r\n };\r\n });\r\n });\r\n });\r\n },\r\n questionValues: function() {\r\n return undefined;\r\n },\r\n lists: function(DemographicsService, $stateParams) {\r\n return DemographicsService.getLists($stateParams.patientId);\r\n },\r\n patientParameters: function(ParametersService, $stateParams) {\r\n return ParametersService.getParameters($stateParams.patientId);\r\n }\r\n }\r\n }).state(\"patients.patient.forms.create\", {\r\n url: \"/:formId/Create\",\r\n views: {\r\n \"patient-area@patients.patient\": {\r\n templateUrl: \"modules/patient/forms/form.tpl.html\",\r\n controller: \"PatientFormController as pfvm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"{{form.FormTypeName}}\",\r\n requiredPermissions: [\"PatientFormWrite\"],\r\n timeLogAction: 'Creating Patient Form'\r\n },\r\n resolve: {\r\n form: function (PatientFormsService, $stateParams) {\r\n return PatientFormsService.getForm($stateParams.formId, $stateParams.patientId);\r\n },\r\n questionValues: function(PatientFormsService, $stateParams) {\r\n return PatientFormsService.getFormQuestionValues($stateParams.patientId, $stateParams.formId, 0);\r\n },\r\n lists: function(DemographicsService, $stateParams) {\r\n return DemographicsService.getLists($stateParams.patientId);\r\n },\r\n patientParameters: function(ParametersService, $stateParams) {\r\n return ParametersService.getParameters($stateParams.patientId);\r\n }\r\n },\r\n params: {\r\n isCreate: true\r\n }\r\n }).state(\"patients.patient.forms.surveyform\", {\r\n url: \"/Other/:patientSurveyId\",\r\n views: {\r\n \"patient-area@patients.patient\": {\r\n templateUrl: \"modules/patient/forms/surveyform.tpl.html\",\r\n controller: \"PatientSurveyFormController as vm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"{{form.SurveyName}}\",\r\n requiredPermissions: [\"PatientFormRead\"],\r\n timeLogAction: \"Patient Forms\"\r\n },\r\n resolve: {\r\n form: function (PatientFormsService, $stateParams) {\r\n return PatientFormsService.getDailyFormResponses($stateParams.patientId, $stateParams.patientSurveyId);\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"patient.forms\", [\"ui.router\", \"angles\"]).config(PatientFormsRoutes);\r\n\r\n","angular.module(\"patient.header\", [\r\n \"vh.ui.header\",\r\n \"vh.ui.avatar\",\r\n \"vh.ui.status\",\r\n \"vh.ui.tags\"\r\n]);\r\n","function PatientListRoutes($stateProvider) {\r\n $stateProvider.state(\"patients.list\", {\r\n url: \"/List\",\r\n params: {\r\n filterBy: null,\r\n value: null\r\n },\r\n data: {\r\n displayName: \"List\",\r\n requiredPermissions: [\"PatientListRead\"]\r\n },\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/patient/list/patientlist.tpl.html\",\r\n controller: \"PatientListController as plvm\"\r\n }\r\n },\r\n resolve: {\r\n webformfields: function(WebFormFieldRepository) {\r\n return WebFormFieldRepository.get();\r\n },\r\n patientListContent: function (PatientListService) {\r\n return PatientListService.getPatientListContent();\r\n },\r\n stateParams: function ($stateParams) {\r\n return $stateParams;\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"patients.list\", [\"ui.router\", \"ngLodash\", \"angularMoment\", \"infinite-scroll\", \"display-temperature\", \"forms\"])\r\n.config(PatientListRoutes)\r\n.constant('AlertFilter', {\r\n AllPatients: -1,\r\n NoAlerts: 0,\r\n AlertsOnly: 1,\r\n SurveyDueToday: 2,\r\n NonResponders: 3,\r\n UnreadMessages: 4,\r\n NotificationsOnly: 5,\r\n CallRequests: 6\r\n})\r\n.constant('PatientListSortBy', {\r\n AlertPriority: 1,\r\n PatientName: 2,\r\n TotalTimeAscending: 3,\r\n TotalTimeDescending: 4,\r\n ClinicalTimeAscending: 5,\r\n ClinicalTimeDescending: 6,\r\n NonResponderSinceDateTime: 7,\r\n DaysInStatusAscending: 8,\r\n DaysInStatusDescending: 9,\r\n CallRequestSeverityDescending: 10\r\n});\r\n","function MedicationsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('patients.patient.medications', {\r\n url: '/Medications',\r\n views: {\r\n 'patient-area@patients.patient': {\r\n templateUrl: 'modules/patient/medications/medications.tpl.html',\r\n controller: 'MedicationsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'All',\r\n requiredPermissions: ['PatientMedicationsRead'],\r\n timeLogAction: 'Patient Medications View'\r\n },\r\n resolve: {\r\n medications: function(MedicationsService, $stateParams) {\r\n return MedicationsService.getMedications($stateParams.patientId, 50, 1, \"\");\r\n }\r\n }\r\n })\r\n .state(\"patients.patient.medications.create\", {\r\n url: \"/Create\",\r\n views: {\r\n \"patient-area@patients.patient\": {\r\n templateUrl: \"modules/patient/medications/medication.tpl.html\",\r\n controller: \"MedicationController as vm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"Add\",\r\n timeLogAction: \"Add Patient Medication\",\r\n requiredPermissions: ['PatientMedicationsWrite']\r\n },\r\n params: {\r\n masterMedication: null\r\n },\r\n resolve: {\r\n patientMedication: function ($stateParams) {\r\n return $stateParams.masterMedication;\r\n }\r\n }\r\n })\r\n .state(\"patients.patient.medications.master\", {\r\n url: \"/Add\",\r\n views: {\r\n \"patient-area@patients.patient\": {\r\n templateUrl: \"modules/patient/medications/mastermedications.tpl.html\",\r\n controller: \"MasterMedicationsController as vm\"\r\n }\r\n },\r\n data: {\r\n displayName: \"Add\",\r\n timeLogAction: \"Patient Medication Add\",\r\n requiredPermissions: ['PatientMedicationsWrite']\r\n }\r\n })\r\n .state(\"patients.patient.medications.medication\", {\r\n url: \"/:patientMedicationId\",\r\n views: {\r\n \"patient-area@patients.patient\": {\r\n templateUrl: \"modules/patient/medications/medication.tpl.html\",\r\n controller: \"MedicationController as vm\"\r\n }\r\n },\r\n data: {\r\n displayname: \"{{patientmedication.name}}\",\r\n timelogaction: \"patient medication view/edit\",\r\n requiredPermissions: ['PatientMedicationsWrite']\r\n },\r\n resolve: {\r\n patientMedication: function (MedicationsService, $stateParams) {\r\n return MedicationsService.getPatientMedication($stateParams.patientId, $stateParams.patientMedicationId);\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('patient.medications', ['vh.paging']).config(MedicationsRoutes);\r\n","function PatientMonitoringRoutes($stateProvider) {\r\n $stateProvider\r\n .state('patients.patient.monitoring', {\r\n url: '/Monitoring',\r\n views: {\r\n 'patient-area': {\r\n templateUrl: 'modules/patient/monitoring/monitoring.tpl.html',\r\n controller: 'PatientMonitoringController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Monitoring',\r\n requiredPermissions: ['PatientMonitoringRead'],\r\n timeLogAction: 'Patient Monitoring View'\r\n },\r\n resolve: {\r\n healthScores: function (MonitoringService, $stateParams) {\r\n return MonitoringService.getAllHealthScores($stateParams.patientId);\r\n },\r\n monitoringData: function(MonitoringService, MonitoringAlertService, $stateParams) {\r\n var end = new Date();\r\n var start = new Date(end.getTime());\r\n start.setDate(start.getDate() - 13);\r\n\r\n return MonitoringService.getPatientResponses($stateParams.patientId, start, end).then(function (data) {\r\n return {\r\n data: data,\r\n startDate: start,\r\n endDate: end\r\n };\r\n }).then(function(responseData){\r\n return MonitoringAlertService.getAlertTasks($stateParams.patientId).then(function (tasks) {\r\n return {\r\n data: responseData.data,\r\n tasks: tasks,\r\n startDate: responseData.startDate,\r\n endDate: responseData.endDate\r\n }\r\n });\r\n });\r\n },\r\n monitoringConfig: function(MonitoringConfigurationService, patientContent) {\r\n return MonitoringConfigurationService.getMonitoringConfigurations().then(data => {\r\n return {\r\n readingThreshold: parseInt(data.getValueFor('MonitoringGridCollapseThreshold', patientContent.patient.populationId) || '0'),\r\n enableReadingCollapse: parseInt(data.getValueFor('MonitoringGridCollapseThreshold', patientContent.patient.populationId) || '0') > 0,\r\n showGraphHeader: data.getValueFor('ExpandMonitoringGraphDays', patientContent.patient.populationId) === 'True' \r\n };\r\n });\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('patient.monitoring', [\"vh.ui.sparknav\", \"vh.ui.metricgraph\", \"vh.uom.conversion\"]).config(PatientMonitoringRoutes)\r\n .constant('SurveyQuestionType', {\r\n BloodSugar: 1,\r\n BloodPressure: 2,\r\n PulseOx: 3,\r\n Weight: 4,\r\n Number: 5,\r\n SingleSelection: 6,\r\n MultiSelection: 7,\r\n HealthTip: 8,\r\n Video: 9,\r\n YesNo: 10,\r\n Temperature: 11,\r\n Spirometer: 13,\r\n Pulse: 14,\r\n Oxygen: 15,\r\n Steps: 16,\r\n HbA1c: 18,\r\n ControlClicks: 19,\r\n RescueClicks: 20,\r\n Sleep: 21\r\n })\r\n .constant('SurveyParameterType', {\r\n Systolic: 1,\r\n Diastolic: 2,\r\n BloodSugar: 3,\r\n Weight: 4,\r\n Pulse: 5,\r\n Oxygen: 6,\r\n ReadingType: 7,\r\n Survey: 8,\r\n Video: 9,\r\n HealthTip: 10,\r\n TempFahrenheit: 11,\r\n PEF: 13,\r\n TempCelsius: 14,\r\n FEVOne: 15,\r\n FEVRatio: 16,\r\n ReadingDeviceModel: 17,\r\n UnitType: 18,\r\n Steps: 19,\r\n HbA1c: 20,\r\n AddressLine1: 21,\r\n AddressLine2: 22,\r\n City: 23,\r\n State: 24,\r\n Zip: 25,\r\n ControlClicks: 26,\r\n RescueClicks: 27,\r\n Details: 28,\r\n Hour: 29,\r\n Min: 30,\r\n Date: 31,\r\n Time: 32\r\n })\r\n .constant('MonitoringViewType', {\r\n Grid: 'Grid',\r\n Audit: 'Audit',\r\n Graph: 'Graph'\r\n });\r\n","function ParametersRoutes($stateProvider) {\r\n $stateProvider\r\n .state('patients.patient.parameters', {\r\n url: '/Parameters',\r\n views: {\r\n 'patient-area': {\r\n templateUrl: 'modules/patient/parameters/parameters.tpl.html',\r\n controller: 'ParametersController as pvm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Parameters',\r\n requiredPermissions: ['PatientParametersRead'],\r\n timeLogAction: 'Patient Parameters View'\r\n },\r\n resolve: {\r\n parameters: function(ParametersService, $stateParams) {\r\n return ParametersService.getParameters($stateParams.patientId);\r\n },\r\n portalConfig: function(ConfigurationsService) {\r\n return ConfigurationsService.getConfig();\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('patient.parameters', ['vh.uom.conversion']).config(ParametersRoutes);\r\n","function ClinicalHistoryRoutes($stateProvider) {\r\n $stateProvider\r\n .state('patients.patient.clinicalhistory', {\r\n url: '/ClinicalHistory',\r\n views: {\r\n 'patient-area': {\r\n templateUrl: 'modules/patient/PMHx/PMHx.tpl.html',\r\n controller: 'ClinicalHistoryController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Clinicial History',\r\n requiredPermissions: ['PatientClinicalHistoryRead'],\r\n timeLogAction: 'Patient Clinical History View'\r\n },\r\n resolve: {\r\n comorbiditiesData: function (ClinicalHistoryService, $stateParams) {\r\n return ClinicalHistoryService.getPatientComorbidities($stateParams.patientId).then(function (data) {\r\n return data;\r\n });\r\n },\r\n admitDischargeData: function(ClinicalHistoryService, $stateParams) {\r\n return ClinicalHistoryService.getPatientAdmitDischarge($stateParams.patientId);\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('patient.clinicalhistory', []).config(ClinicalHistoryRoutes);\r\n","function PatientFormReportRoutes($stateProvider) {\r\n $stateProvider.state(\"patientformreport\", {\r\n url: \"/Patient/:patientId/Form/:patientFormId/Reports?print\",\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/reports/forms/patientformreport.tpl.html\",\r\n controller: \"PatientFormReportController as pfvm\"\r\n }\r\n },\r\n resolve: {\r\n form: function (PatientFormsService, $stateParams) {\r\n return PatientFormsService.getPatientForm($stateParams.patientId, $stateParams.patientFormId).then(function (data) {\r\n return PatientFormsService.getFormQuestionValues($stateParams.patientId, data.FormId, $stateParams.patientFormId).then(function (questionValues) {\r\n return {\r\n currentForm: data,\r\n questionValues: questionValues\r\n };\r\n });\r\n });\r\n },\r\n lists: function (DemographicsService, $stateParams) {\r\n return DemographicsService.getLists($stateParams.patientId);\r\n },\r\n patientParameters: function(ParametersService, $stateParams) {\r\n return ParametersService.getParameters($stateParams.patientId);\r\n }\r\n },\r\n data: {\r\n displayName: \"Patient Form\",\r\n requiredPermissions: [\"PatientFormRead\", \"DocumentGenerator\"]\r\n }\r\n });\r\n}\r\n\r\nangular.module(\"reports.patientforms\", [\"ui.router\"]).config(PatientFormReportRoutes);","var timeLogReportDeps = [\r\n 'time_log.detail',\r\n 'files'\r\n];\r\n\r\nangular.module('reports.time_log', timeLogReportDeps);","function BiometricsRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('site.biometrics', {\r\n\t\t\t\turl: '/Biometrics',\r\n\t\t\t\tparams: { \r\n\t\t\t\t\tpopulationId: '-1',\r\n\t\t\t\t\tpopulationName: 'Default'\r\n\t\t\t\t},\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/site/biometrics/biometrics.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'BiometricsController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Biometrics',\r\n\t\t\t\t\trequiredPermissions: [\"ConfigurationsWrite\"]\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tpopulations: function(BiometricsService) {\r\n\t\t\t\t\t\treturn BiometricsService.getAllPopulations();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar biometricsDependencies = [\r\n\t'ui.router',\r\n 'site.biometrics',\r\n 'configurations.content'\r\n]\r\n\r\nangular.module(\"site.biometrics\", biometricsDependencies)\r\n.config(BiometricsRoutes);","function hospitalRoutes($stateProvider) {\r\n $stateProvider\r\n .state('site.hospitals', {\r\n url: '/Hospital',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/site/hospitals/hospitals.tpl.html',\r\n controller: 'HospitalsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Hospitals',\r\n requiredPermissions: ['HospitalSettingsRead']\r\n },\r\n resolve: {\r\n Hospitals: function(HospitalsService) {\r\n return HospitalsService.get();\r\n },\r\n PatientCounts: function(HospitalsService) {\r\n return HospitalsService.getPatientCounts();\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('site.hospitals', []).config(hospitalRoutes);","function PayersRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('site.payers', {\r\n\t\t\turl: '/Payers',\r\n\t\t\tviews: {\r\n\t\t\t\t'main@': {\r\n\t\t\t\t\ttemplateUrl: 'modules/site/payers/payers.tpl.html',\r\n\t\t\t\t\tcontroller: 'PayersController as vm'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdata: {\r\n\t\t\t\tdisplayName: 'Payers',\r\n\t\t\t\trequiredPermissions: [\"PayersWrite\"]\r\n\t\t\t},\r\n\t\t\tresolve: {\r\n\t\t\t\tpayers: function (PayersService) {\r\n\t\t\t\t\treturn PayersService.get();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n}\r\n\r\nvar payersDependencies = [\r\n\t\"ui.router\",\r\n\t\"site.payers\"\r\n]\r\n\r\nangular.module(\"site.payers\", payersDependencies)\r\n\t.config(PayersRoutes);","function PopulationGroupsRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('site.populationGroups', {\r\n\t\t\t\turl: '/ProgramGroups',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/site/populationGroups/populationGroups.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'PopulationGroupsController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Program Groups',\r\n\t\t\t\t\trequiredPermissions: [\"PopulationGroupsWrite\"]\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tpopulationGroups: function(PopulationGroupsService) {\r\n\t\t\t\t\t\treturn PopulationGroupsService.get();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar populationGroupsDependencies = [\r\n\t\"ui.router\",\r\n\t\"site.populationGroups\"\r\n]\r\n\r\nangular.module(\"site.populationGroups\", populationGroupsDependencies)\r\n.config(PopulationGroupsRoutes);","function PopulationRoutes($stateProvider) {\r\n $stateProvider.state('site.populations', {\r\n url: '/Programs',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/site/populations/population.tpl.html',\r\n controller: 'PopulationCtrl as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Programs',\r\n requiredPermissions: ['ConfigurationPopulationRead', 'ConfigurationPopulationWrite']\r\n },\r\n resolve: {\r\n populations: function(EditConfigurationsService) {\r\n return EditConfigurationsService.populationsList({enabledOnly: false});\r\n },\r\n PopulationCount: function(EditConfigurationsService) {\r\n return EditConfigurationsService.getPopulationCount();\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar populationDependencies = [\r\n\t\"ui.router\",\r\n\t\"site.populations\"\r\n]\r\n\r\nangular.module(\"site.populations\", populationDependencies)\r\n .config(PopulationRoutes);\r\n","function ProfileFieldsRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('site.profileFields', {\r\n\t\t\t\turl: '/ProfileFields',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/site/profileFields/profileFields.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'ProfileFieldsController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Profile Fields',\r\n\t\t\t\t\trequiredPermissions: [\"ProfileFieldsRead\"]\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tfields: function(ProfileFieldsService) {\r\n\t\t\t\t\t\treturn ProfileFieldsService.getFields();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar profileFieldsDependencies = [\r\n\t\"ui.router\",\r\n\t\"site.profileFields\"\r\n]\r\n\r\nangular.module(\"site.profileFields\",profileFieldsDependencies)\r\n.config(ProfileFieldsRoutes);","function ProgramDurationsRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('site.programDurations', {\r\n\t\t\t\turl: '/ProgramDurations',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/site/programDurations/programDurations.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'ProgramDurationsController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Program Durations',\r\n\t\t\t\t\trequiredPermissions: [\"ProgramDurationsWrite\"]\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tprogramDurations: function(ProgramDurationsService) {\r\n\t\t\t\t\t\treturn ProgramDurationsService.get();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar programDurationsDependencies = [\r\n\t\"ui.router\",\r\n\t\"site.programDurations\"\r\n]\r\n\r\nangular.module(\"site.programDurations\", programDurationsDependencies)\r\n.config(ProgramDurationsRoutes);","function ProviderGroupsRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('site.providerGroups', {\r\n\t\t\t\turl: '/ProviderGroups',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/site/providerGroups/providerGroups.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'ProviderGroupsController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Provider Groups',\r\n\t\t\t\t\trequiredPermissions: [\"ProviderGroupsWrite\"]\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tproviderGroups: function(ProviderGroupsService) {\r\n\t\t\t\t\t\treturn ProviderGroupsService.get();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar providerGroupsDependencies = [\r\n\t\"ui.router\",\r\n\t\"site.providerGroups\"\r\n]\r\n\r\nangular.module(\"site.providerGroups\", providerGroupsDependencies)\r\n.config(ProviderGroupsRoutes);","function ReferralsRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('site.referrals', {\r\n\t\t\t\turl: '/Referrals',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/site/referrals/referrals.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'ReferralsController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Referrals',\r\n\t\t\t\t\trequiredPermissions: [\"ReferralsWrite\"]\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\treferrals: function(ReferralsService) {\r\n\t\t\t\t\t\treturn ReferralsService.get();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar referralsDependencies = [\r\n\t\"ui.router\",\r\n\t\"site.referrals\"\r\n]\r\n\r\nangular.module(\"site.referrals\", referralsDependencies)\r\n.config(ReferralsRoutes);","function SettingsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('site.settings', {\r\n url: '/Settings',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/settings/settings.tpl.html',\r\n controller: 'SettingsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Site Settings',\r\n requiredPermissions: [\"ConfigurationsRead\"]\r\n },\r\n resolve: {\r\n isSiteSettings: () => true\r\n }\r\n });\r\n}\r\n\r\nvar settingsDependencies = [\r\n 'ui.router',\r\n 'repos',\r\n 'permissions',\r\n 'ui.bootstrap',\r\n 'system.settings'\r\n];\r\n\r\nangular.module('site.settings', settingsDependencies)\r\n .config(SettingsRoutes);\r\n","function SpecialHandlingRoutes($stateProvider) {\r\n $stateProvider.state('site.specialhandling', {\r\n url: '/SpecialHandling',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/site/specialhandling/specialhandling.tpl.html',\r\n controller: 'SpecialHandlingCtrl as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Special Handling',\r\n requiredPermissions: ['SpecialHandlingReadAndWrite']\r\n },\r\n resolve: {\r\n SpecialHandlings: function(EditConfigurationsService) {\r\n return EditConfigurationsService.getSpecialHandlingList();\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar specialHandlingDependencies = [\r\n\t\"ui.router\",\r\n\t\"site.specialhandling\"\r\n]\r\n\r\nangular.module(\"site.specialhandling\", specialHandlingDependencies)\r\n.config(SpecialHandlingRoutes);\r\n\r\n\r\n\r\n","function BiometricAlertsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.biometricAlerts', {\r\n url: '/BiometricAlerts',\r\n params: { FromState: {}},\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/biometricalerts/biometricalerts.tpl.html',\r\n controller: 'BiometricAlertsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Biometric Alerts',\r\n requiredPermissions: [\"ConfigurationsRead\"] \r\n }\r\n })\r\n .state('system.biometricAlerts.biometricAlert', {\r\n url: '/:BiometricAlertId',\r\n params: {BiometricAlertId: '0', FromState: {}},\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/biometricalerts/biometricalert.tpl.html',\r\n controller: 'BiometricAlertController as vm'\r\n }\r\n },\r\n resolve: {\r\n BiometricAlert: function($stateParams, BiometricAlertsService) {\r\n var retVal = null;\r\n if ($stateParams.BiometricAlertId > 0){\r\n retVal = BiometricAlertsService.get($stateParams.BiometricAlertId);\r\n }\r\n return retVal;\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar biometricAlertsDependencies = [\r\n \"ui.router\",\r\n \"vh_core.repository\",\r\n \"system.biometricAlerts\",\r\n];\r\nangular.module('system.biometricAlerts', biometricAlertsDependencies)\r\n .config(BiometricAlertsRoutes);\r\n","function EmailRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.email', {\r\n url: '/Email',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/email/email.tpl.html',\r\n controller: 'EmailController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Email',\r\n requiredPermissions: [\"ConfigurationsWrite\"]\r\n }\r\n });\r\n}\r\n\r\nvar emailDependencies = [\r\n \"ui.router\",\r\n \"vh_core.repository\",\r\n \"system.email\",\r\n];\r\nangular.module('system.email', emailDependencies)\r\n .config(EmailRoutes);\r\n","function EmailServerRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('system.emailServers', {\r\n\t\t\t\turl: '/EmailServers',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/system/emailServers/emailServers.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'EmailServerCtrl as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Email Servers',\r\n\t\t\t\t\trequiredPermissions: ['EmailServersReadAndWrite']\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tservers: function(EmailServersService) {\r\n\t\t\t\t\t\treturn EmailServersService.getEmailServers();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar emailServerDependencies = [\r\n \"ui.router\",\r\n \"vh_core.repository\",\r\n \"system.emailServers\"\r\n];\r\n\r\nangular.module('system.emailServers', emailServerDependencies)\r\n\t.config(EmailServerRoutes);","function FormsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.forms', {\r\n url: '/Forms',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/forms/forms.tpl.html',\r\n controller: 'FormsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Forms',\r\n requiredPermissions: [\"SystemFormsRead\"]\r\n },\r\n resolve: {\r\n FormQuestionTypes: function(FormsService) {\r\n return FormsService.getQuestionTypes();\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar formsDependencies = [\r\n 'ui.router',\r\n 'repos',\r\n 'permissions',\r\n 'ui.bootstrap',\r\n 'mentio'\r\n];\r\n\r\nangular.module('system.forms', formsDependencies).config(FormsRoutes)\r\n.constant('FormQuestionType', {\r\n OriginalInputType: 1,\r\n InlineRadion: 8,\r\n Radion: 2,\r\n MultiLineTextbox: 4,\r\n Textbox: 5,\r\n InlineCheckboxs: 7,\r\n Checkboxes: 6,\r\n DropDown: 3,\r\n Grid: 9,\r\n StaticVariable: 10,\r\n Provider: 11,\r\n ActiveMedications: 12,\r\n PatientParameters: 13,\r\n 'Date': 14,\r\n DynamicVariable: 15,\r\n WeightGraph: 16,\r\n PulseGraph: 17,\r\n O2Graph: 18,\r\n BPGraph: 19\r\n});\r\n","function DevicesRoutes($stateProvider){\r\n $stateProvider.state(\"system.go_devices\", {\r\n url: \"/GoDevices\",\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/system/go_devices/go_devices.tpl.html\",\r\n controller: \"GoDevicesController as gdc\"\r\n }\r\n },\r\n data: {\r\n displayName: \"+Go Devices\",\r\n displayIcon: \"fa-bluetooth\",\r\n requiredPermissions: ['GoDevicesRead']\r\n // requiredPermissions: [\"HealthSummaryReport\", \"DocumentGenerator\"]\r\n },\r\n resolve: {\r\n DeviceModels: function(GoDevicesService) {\r\n return GoDevicesService.getDeviceModels().then(function(deviceModels) { \r\n return deviceModels.filter(function(device) {\r\n // dont show tablets\r\n return device.DeviceTypeId !== null && device.DeviceTypeId !== 9;\r\n });\r\n });\r\n }\r\n }\r\n })\r\n};\r\n\r\nangular.module(\"system.go_devices\", [\"ui.router\"]).config(DevicesRoutes);","function languageRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.languages', {\r\n url: '/Language',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/languages/languages.tpl.html',\r\n controller: 'LanguagesController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Languages',\r\n requiredPermissions: ['LanguageSettingsRead']\r\n },\r\n resolve: {\r\n Languages: function(LanguagesService) {\r\n return LanguagesService.get(false, false);\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('system.languages', []).config(languageRoutes);\r\n","function LoginNotificationRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.loginNotification', {\r\n url: '/LoginNotification',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/loginNotification/loginNotification.tpl.html',\r\n controller: 'LoginNotificationController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Login Notification',\r\n requiredPermissions: [\"LoginNotificationRead\"]\r\n }\r\n });\r\n}\r\n\r\nvar loginNotificationDependencies = [\r\n \"ui.router\",\r\n \"vh_core.repository\",\r\n \"system.loginNotification\",\r\n];\r\nangular.module('system.loginNotification', loginNotificationDependencies)\r\n .config(LoginNotificationRoutes);\r\n","var logoDeps = [\r\n 'angularFileUpload',\r\n 'ui.bootstrap',\r\n 'ui.router',\r\n 'permissions',\r\n 'ngLodash',\r\n 'vh.ui.sweetalert',\r\n 'focusme',\r\n];\r\n\r\nangular.module('system.logo', logoDeps);\r\n\r\nfunction LogoRoutes($stateProvider) {\r\n $stateProvider \r\n .state('system.logo', {\r\n url: '/Logo',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/logo/logo.tpl.html',\r\n controller: 'LogoUpdateController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Logo',\r\n requiredPermissions: [\"MediaWrite\"]\r\n }\r\n });\r\n}\r\n\r\nangular.module('system.logo').config(LogoRoutes);","function networkOperatorRoute($stateProvider) {\r\n $stateProvider.state('system.networkoperator', {\r\n url: '/NetworkOperator',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/networkoperator/networkoperator.tpl.html',\r\n controller: 'NetworkOperatorController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Network Operator',\r\n requiredPermissions: ['NetworkOperatorRead']\r\n },\r\n resolve: {\r\n NetworkOperators: function(NetworkOperatorService) {\r\n return NetworkOperatorService.get();\r\n }\r\n }\r\n });\r\n}\r\nangular.module('system.networkoperator', []).config(networkOperatorRoute);","function PatientIdentifierFieldsRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('system.patientIdentifierFields', {\r\n\t\t\t\turl: '/PatientIdentifierFields',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/system/patientIdentifierFields/patientIdentifierFields.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'PatientIdentifierFieldsController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Patient Identifier Fields',\r\n\t\t\t\t\trequiredPermissions: [\"PatientIdentifierConfigurationRead\"]\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\tfields: function(PatientIdentifierFieldsService) {\r\n\t\t\t\t\t\treturn PatientIdentifierFieldsService.getFields();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar patientIdentifierFieldsDependencies = [\r\n\t\"ui.router\",\r\n\t\"system.patientIdentifierFields\"\r\n]\r\n\r\nangular.module(\"system.patientIdentifierFields\",patientIdentifierFieldsDependencies)\r\n.config(PatientIdentifierFieldsRoutes);\r\n","function PickupRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.pickup', {\r\n url: '/PickupOptions',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/pickup/pickup.tpl.html',\r\n controller: 'pickupController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Pickup Options',\r\n requiredPermissions: [\"KitPickupOptionRead\"]\r\n },\r\n resolve: {\r\n pickupOptions: function(pickupService) {\r\n return pickupService.getAll();\r\n }\r\n }\r\n });\r\n}\r\n\r\n\r\nangular.module('system.pickup', [])\r\n .config(PickupRoutes);","function RulesRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.rules', {\r\n url: '/Rules',\r\n params: { FromState: {}},\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/rules/rules.tpl.html',\r\n controller: 'RulesController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Rules',\r\n requiredPermissions: [\"RuleWrite\"] \r\n }\r\n })\r\n .state('system.rules.rule', {\r\n url: '/:RuleId',\r\n params: {RuleId: '0', FromState: {}},\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/rules/rule.tpl.html',\r\n controller: 'ruleController as vm' \r\n }\r\n },\r\n resolve: {\r\n Rule: function($stateParams, RulesService) {\r\n var retVal = null;\r\n if ($stateParams.RuleId > 0){\r\n retVal = RulesService.get($stateParams.RuleId);\r\n }\r\n return retVal;\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar rulesDependencies = [\r\n \"ui.router\",\r\n \"vh_core.repository\",\r\n \"system.rules\",\r\n];\r\nangular.module('system.rules', rulesDependencies)\r\n .config(RulesRoutes)\r\n\r\n // rule specific constants\r\n .constant('ruleEventTypes', (function() {\r\n const ruleEvents = {\r\n PatientSurveyCompleted: {\r\n name: 'Patient completes any pathway.',\r\n value: 'Vivify.Platform.Events.PatientSurveyCompletedEvent',\r\n description: 'When patient completes any pathway'\r\n },\r\n PatientStatusUpdated: {\r\n name: 'Patient\\'s status changes.',\r\n value: 'Vivify.Platform.Events.PatientStatusUpdatedEvent',\r\n description: 'When patient\\'s status changes'\r\n },\r\n PatientPopulationUpdated: {\r\n name: 'Patient\\'s program changes.',\r\n value: 'Vivify.Platform.Events.PatientPopulationUpdatedEvent',\r\n description: 'When patient\\'s program changes'\r\n },\r\n PatientAdded: {\r\n name: 'Patient is added.',\r\n value: 'Vivify.Platform.Events.PatientAddedEvent',\r\n description: 'When a patient is added'\r\n },\r\n PatientBiometricAdded: {\r\n name: 'Patient adds a biometric reading.',\r\n value: 'Vivify.Platform.Events.PatientBiometricAddedEvent',\r\n description: 'When a patient enters a biometric reading'\r\n },\r\n PatientAlertInterventionAdded: {\r\n name: 'Care Team Portal user accepts alert/notification',\r\n value: 'Vivify.Platform.Events.PatientAlertInterventionAddedEvent',\r\n description: 'When a care team user accepts a patient alert or notification with an intervention'\r\n },\r\n PatientAlertExternalRegistrationFailed: {\r\n name: 'Patient Alert External Registration Failed',\r\n value: 'Vivify.Platform.Events.PatientAlertExternalRegistrationFailedEvent',\r\n description: 'This event is fired when alert is create for HL7 registration fails to create a new patient because the patient already has an active encounter'\r\n },\r\n PatientServiceLevelTransitioned: {\r\n name: 'Patient Service Level Transitioned',\r\n value: 'Vivify.Platform.Events.ServiceLevelTransitionEvent',\r\n description: 'This event is fired when a patient\\'s service level is transitioned'\r\n },\r\n PatientSpecialHandlingAddedEvent: { \r\n name: 'Special Handling is added to a patient', \r\n value: 'Vivify.Platform.Events.PatientSpecialHandlingAddedEvent', \r\n description: 'This event is fired when a special handling indicator is added to a patient' \r\n },\r\n PatientSpecialHandlingRemovedEvent: { \r\n name: 'Special Handling is removed from a patient', \r\n value: 'Vivify.Platform.Events.PatientSpecialHandlingRemovedEvent', \r\n description: 'This event is fired when a special handling indicator is removed from a patient' \r\n },\r\n PatientSurveyOverdueEvent: {\r\n name: 'Patient Survey is Overdue',\r\n value: 'Vivify.Platform.Events.PatientSurveyOverdueEvent',\r\n description: 'This event is fired when a patient survey is overdue'\r\n }\r\n };\r\n\r\n let ruleEventTypes = [\r\n ruleEvents.PatientSurveyCompleted,\r\n ruleEvents.PatientStatusUpdated,\r\n ruleEvents.PatientPopulationUpdated,\r\n ruleEvents.PatientAdded,\r\n ruleEvents.PatientBiometricAdded,\r\n ruleEvents.PatientAlertInterventionAdded,\r\n ruleEvents.PatientAlertExternalRegistrationFailed,\r\n ruleEvents.PatientServiceLevelTransitioned,\r\n ruleEvents.PatientSpecialHandlingAddedEvent,\r\n ruleEvents.PatientSpecialHandlingRemovedEvent,\r\n ruleEvents.PatientSurveyOverdueEvent\r\n ];\r\n\r\n // can be referenced as either an array or an object\r\n return Object.assign(ruleEventTypes, ruleEvents);\r\n })())\r\n\r\n .constant('ruleActionTypes', (function() {\r\n const ruleActions = {\r\n AddPathway: {\r\n name: 'Add pathway to patient',\r\n value: 'AddPathwayAction',\r\n description: 'add this pathway to patient'\r\n },\r\n ChangePathwayStatus: {\r\n name: 'Change pathway status to',\r\n value: 'ChangePathwayStatusAction',\r\n description: 'change the status of this pathway'\r\n },\r\n DiscontinueAllPathwaysExcept: {\r\n name: 'Discontinue all pathways except',\r\n value: 'DiscontinueAllPathwaysExceptAction',\r\n description: 'Discontinue all pathways on the patient except those listed'\r\n },\r\n AddPatientAlert: {\r\n name: 'Add alert to patient',\r\n value: 'AddPatientAlertAction',\r\n description: ''\r\n },\r\n ChangePatientProgram: {\r\n name: 'Change patient\\'s program',\r\n value: 'ChangePatientProgramAction',\r\n description: ''\r\n },\r\n ChangePatientStatus: {\r\n name: 'Change patient\\'s status',\r\n value: 'ChangePatientStatusAction',\r\n description: ''\r\n },\r\n AddPatientCard: {\r\n name: 'Add card to patient',\r\n value: 'AddPatientCardAction',\r\n description: ''\r\n },\r\n RemovePatientCard: {\r\n name: 'Remove card from patient',\r\n value: 'RemovePatientCardAction',\r\n description: ''\r\n },\r\n ReplacePatientCard: {\r\n name: 'Replace card for patient',\r\n value: 'ReplacePatientCardAction',\r\n description: ''\r\n },\r\n AddLibraryTile: {\r\n name: 'Add library tile to patient',\r\n value: 'AddLibraryTileAction',\r\n description: ''\r\n },\r\n RemoveLibraryTile: {\r\n name: 'Remove library tile from patient',\r\n value: 'RemoveLibraryTileAction',\r\n description: ''\r\n },\r\n SendEmailRule: {\r\n name: 'Send an email',\r\n value: 'SendEmailRuleAction',\r\n description: ''\r\n },\r\n ManagePatientDevice: {\r\n name: 'Manage Patient Device',\r\n value: 'ManagePatientDeviceAction',\r\n description: ''\r\n },\r\n ManagePatientTag: {\r\n name: 'Manage Patient Tag',\r\n value: 'ManagePatientTagAction',\r\n description: ''\r\n },\r\n ExecuteSQLCommand: {\r\n name: 'Execute SQL Command',\r\n value: 'ExecuteSQLCommandAction',\r\n description: ''\r\n },\r\n TransitionPatientServiceLevel: {\r\n name: 'Transition Patient Service Level',\r\n value: 'TransitionPatientServiceLevelAction',\r\n description: 'Assigns an active patient to another service level of the same type'\r\n },\r\n ManagePatientSpecialHandling: {\r\n name: 'Manage Patient Special Handling',\r\n value: 'ManagePatientSpecialHandlingAction',\r\n description: ''\r\n },\r\n ManagePatientSurveySchedules: {\r\n name: 'Manage Patient Survey Schedules',\r\n value: 'ManagePatientSurveySchedulesAction',\r\n description: ''\r\n }\r\n };\r\n\r\n let ruleActionTypes = [\r\n ruleActions.AddPathway,\r\n ruleActions.ChangePathwayStatus,\r\n ruleActions.DiscontinueAllPathwaysExcept,\r\n ruleActions.AddPatientAlert,\r\n ruleActions.ChangePatientProgram,\r\n ruleActions.ChangePatientStatus,\r\n ruleActions.AddPatientCard,\r\n ruleActions.RemovePatientCard,\r\n ruleActions.ReplacePatientCard,\r\n ruleActions.AddLibraryTile,\r\n ruleActions.RemoveLibraryTile,\r\n ruleActions.SendEmailRule,\r\n ruleActions.ManagePatientDevice,\r\n ruleActions.ManagePatientTag,\r\n ruleActions.ExecuteSQLCommand,\r\n ruleActions.TransitionPatientServiceLevel,\r\n ruleActions.ManagePatientSpecialHandling,\r\n ruleActions.ManagePatientSurveySchedules\r\n ];\r\n\r\n // can be referenced as either an array or an object\r\n return Object.assign(ruleActionTypes, ruleActions);\r\n })())\r\n\r\n .constant('surveyStatuses', [\r\n { name: 'Active', value: 1 },\r\n { name: 'Inactive', value: 2 },\r\n { name: 'Discontinued', value: 3 }\r\n ])\r\n .constant('patientStatuses', [\r\n {value: 1, name: \"Active\"},\r\n {value: 4, name: \"Completed\"},\r\n {value: 7, name: \"Deleted\"},\r\n {value: 2, name: \"Inactive\"},\r\n {value: 9, name: \"Invited\"},\r\n {value: 8, name: \"Pre-active\"},\r\n {value: 6, name: \"Screen Fail\"},\r\n {value: 3, name: \"Screening\"}\r\n ])\r\n .constant('cardTypes', [\r\n { name : 'BluetoothDevice', value : 2, description: 'Bluetooth Device' },\r\n { name : 'Video', value : 3, description: 'Video' },\r\n { name : 'HealthTip', value : 4, description: 'HealthTip' },\r\n { name : 'Hero', value : 5, description: 'Hero' }\r\n ])\r\n .constant('alertTypes',[\r\n { name : 'Blood Pressure', value : 7 },\r\n { name : 'Blood Sugar', value : 8 },\r\n { name : 'Caregiver Alert', value : 14 },\r\n { name : 'Caregiver Notification', value : 38 },\r\n { name : 'Heart Rate', value : 10 },\r\n { name : 'Oxygen Saturation', value : 11 },\r\n { name : 'Phone Call Request', value : 13 },\r\n { name : 'Survey Response', value : 12 },\r\n { name : 'Temperature', value : 19 },\r\n { name : 'Weight', value : 9 }\r\n ]);\r\n","function SecurityroleRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.securityroles', {\r\n url: '/Securityroles',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/securityroles/securityroles.tpl.html',\r\n controller: 'SecurityrolesController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Security Roles',\r\n requiredPermissions: [\"SecurityRoleRead\"]\r\n }\r\n });\r\n}\r\n\r\nvar securityroleDependencies = [\r\n 'ui.router',\r\n 'repos',\r\n 'permissions',\r\n 'ui.bootstrap'\r\n];\r\n\r\nangular.module('system.securityroles', securityroleDependencies)\r\n .config(SecurityroleRoutes);\r\n","function serviceLevelRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.serviceLevels', {\r\n url: '/ServiceLevel',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/serviceLevel/serviceLevelList.tpl.html',\r\n controller: 'ServiceLevelListCtrl as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Service Levels',\r\n requiredPermissions: ['SystemServiceLevelRead']\r\n },\r\n resolve: {\r\n ServiceLevels: function(ServiceLevelService) {\r\n return ServiceLevelService.get();\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('system.serviceLevels', [])\r\n.config(serviceLevelRoutes)\r\n.constant('ServiceLevelType', {\r\n CMP: 1, \r\n RPM: 2, \r\n RPMVideo: 3, \r\n KitCreation: 6, \r\n CommKit: 7, \r\n Packaging: 8, \r\n BYOD: 9, \r\n IVR: 10, \r\n Go: 11\r\n});","function SettingsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.settings', {\r\n url: '/Settings',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/settings/settings.tpl.html',\r\n controller: 'SettingsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Settings',\r\n requiredPermissions: [\"ConfigurationsRead\"]\r\n },\r\n resolve: {\r\n isSiteSettings: () => false\r\n }\r\n });\r\n}\r\n\r\nvar settingsDependencies = [\r\n 'ui.router',\r\n 'repos',\r\n 'permissions',\r\n 'ui.bootstrap'\r\n];\r\n\r\nangular.module('system.settings', settingsDependencies)\r\n .config(SettingsRoutes);\r\n","var siteDeps = [\r\n 'permissions',\r\n 'ngLodash',\r\n 'vh.ui.sweetalert',\r\n 'focusme',\r\n];\r\n\r\nangular.module('system.sites', siteDeps);\r\n\r\nfunction SiteRoutes($stateProvider) {\r\n $stateProvider \r\n .state('system.sites', {\r\n url: '/Sites',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/sites/sites.tpl.html',\r\n controller: 'SitesController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Sites',\r\n requiredPermissions: [\"SiteWrite\"]\r\n }\r\n });\r\n}\r\n\r\nangular.module('system.sites').config(SiteRoutes);","var slideshowDeps = [\r\n 'angularFileUpload',\r\n 'ui.bootstrap',\r\n 'ui.router',\r\n 'permissions',\r\n 'ngLodash',\r\n 'vh.ui.sweetalert',\r\n 'focusme',\r\n 'searchbar'\r\n];\r\n\r\nangular.module('system.slideshow', slideshowDeps);\r\n\r\nfunction SlideshowRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.slideshow', {\r\n url: '/Slideshow',\r\n views:{\r\n 'main@': {\r\n templateUrl: 'modules/system/slideshow/slideshow.tpl.html',\r\n controller: 'SlideshowController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Slideshow',\r\n requiredPermissions: [\"MediaRead\"]\r\n }\r\n });\r\n}\r\n\r\nangular.module('system.slideshow').config(SlideshowRoutes);","function SmsRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.sms', {\r\n url: '/Sms',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/sms/sms.tpl.html',\r\n controller: 'SmsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Sms',\r\n requiredPermissions: [\"SmsWrite\"]\r\n }\r\n });\r\n}\r\n\r\nvar smsDependencies = [\r\n \"ui.router\",\r\n \"vh_core.repository\",\r\n \"system.sms\",\r\n];\r\nangular.module('system.sms', smsDependencies)\r\n .config(SmsRoutes);\r\n","function TitleRoutes($stateProvider) {\r\n\t$stateProvider\r\n\t\t.state('system.titles', {\r\n\t\t\t\turl: '/Titles',\r\n\t\t\t\tviews: {\r\n\t\t\t\t\t'main@': {\r\n\t\t\t\t\t\ttemplateUrl: 'modules/system/titles/titles.tpl.html',\r\n\t\t\t\t\t\tcontroller: 'TitlesController as vm'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tdisplayName: 'Care Team Titles',\r\n\t\t\t\t\trequiredPermissions: ['ConfigurationsWrite']\r\n\t\t\t\t},\r\n\t\t\t\tresolve: {\r\n\t\t\t\t\ttitles: function(TitlesService) {\r\n\t\t\t\t\t\treturn TitlesService.get();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n\r\nvar titlesDependencies = [\r\n\t\"ui.router\"\r\n]\r\n\r\nangular.module(\"system.titles\", titlesDependencies)\r\n\t.config(TitleRoutes);","function WebhookRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.webhooks', {\r\n url: '/Webhooks',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/webhooks/webhooks.tpl.html',\r\n controller: 'WebhooksController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Webhooks',\r\n requiredPermissions: [\"WebhookRead\"]\r\n }\r\n });\r\n}\r\n\r\nvar webhookDependencies = [\r\n 'ui.router',\r\n 'repos',\r\n 'permissions',\r\n 'ui.bootstrap'\r\n];\r\n\r\nangular.module('system.webhooks', webhookDependencies)\r\n .config(WebhookRoutes);\r\n","function DemoController($rootScope) {\r\n var vm = this;\r\n vm.searchActive = false;\r\n vm.isRequired = false;\r\n\r\n var el = document.getElementById('multiselect.html');\r\n vm.code = el.innerHTML;\r\n\r\n vm.options = [\r\n { text: 'One' },\r\n { text: 'Two' },\r\n { text: 'Three' },\r\n { text: 'Item Four' },\r\n { text: 'Item Five' },\r\n { text: 'Item Six' },\r\n ];\r\n vm.selectedOptions = [vm.options[1]];\r\n\r\n vm.addItem = function() {\r\n var newOption = { text: 'New item'};\r\n vm.options.push(newOption);\r\n vm.selectedOptions.push(newOption);\r\n }\r\n\r\n vm.actionClick = function($action) { \r\n console.log('Action clicked: ' + $action.label);\r\n }\r\n\r\n /***************************************************** */\r\n\r\n vm.notify = {\r\n text: '',\r\n type: 'primary',\r\n duration: 6000 //ms (optional)\r\n };\r\n\r\n vm.sendNotification = function() {\r\n $rootScope.$emit('vh:notify', angular.copy(vm.notify));\r\n vm.notify.text = '';\r\n }\r\n}\r\n\r\nfunction ControlRoutes($stateProvider) {\r\n $stateProvider\r\n .state('system.controls', {\r\n url: '/controls',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/system/_controls/controls.tpl.html',\r\n controller: 'DemoController as vm'\r\n }\r\n }\r\n });\r\n}\r\n\r\nangular.module('system.controls', ['ui.router'])\r\n .config(ControlRoutes)\r\n .controller('DemoController', DemoController);","function PatientTimeLogDetailRoutes($stateProvider) {\r\n $stateProvider\r\n .state('patients.patient.time_log', {\r\n abstract: \"true\",\r\n data: {\r\n displayName: \"Time Log\",\r\n displayIcon: \"fa-list-ul\"\r\n }\r\n })\r\n .state('patients.patient.time_log.detail', {\r\n url: '/TimeLog?monthOffset',\r\n views: {\r\n 'patient-area@patients.patient': {\r\n templateUrl: 'modules/time_log/detail/detail.tpl.html',\r\n controller: 'PatientTimeLogDetailController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Details',\r\n requiredPermissions: [\"PatientTimeLogRead\"],\r\n defaultParamValues: [\r\n {\r\n params: \"{monthOffset: 0}\",\r\n displayName: \"Most Recent\"\r\n }\r\n ]\r\n },\r\n resolve: {\r\n timeLogDetailContent: function(TimeLogDetailService, $stateParams) {\r\n return TimeLogDetailService.getTimeLogsByMonth($stateParams.patientId, $stateParams.monthOffset);\r\n }\r\n }\r\n });\r\n}\r\n\r\nvar timeLogDetailDeps = [\r\n 'ui.router',\r\n 'ngLodash',\r\n 'ui.bootstrap',\r\n 'permissions',\r\n 'vh_core.repository',\r\n 'xeditable',\r\n 'time-log-session'\r\n];\r\n\r\nangular.module('time_log.detail', timeLogDetailDeps).config(PatientTimeLogDetailRoutes);\r\n","var categoriesDep = [\r\n 'content.services',\r\n 'ui.router',\r\n 'ngLodash',\r\n 'ui.bootstrap',\r\n 'vh.ui.sweetalert',\r\n 'content.healthtipbutton',\r\n 'xeditable',\r\n 'ui.tree',\r\n 'content.videobutton',\r\n 'focusme',\r\n 'animatedflash',\r\n 'sticky',\r\n 'permissions'\r\n];\r\nangular.module('content.categories', categoriesDep).config(CategoryRoutes);\r\n\r\nfunction CategoryRoutes($stateProvider) {\r\n $stateProvider\r\n .state('content.categories', {\r\n url: '/Questions',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/careplan_editor/categories/categories.tpl.html',\r\n }\r\n },\r\n data: {\r\n displayName: 'Questions',\r\n requiredPermissions: [\"MasterCareplansRead\"]\r\n }\r\n })\r\n\r\n .state('content.categories.category', {\r\n url: '/:SurveyQuestionCategoryId',\r\n templateUrl: 'modules/content/careplan_editor/categories/categories.tpl.html',\r\n data: {\r\n displayName: '{{Category}}'\r\n },\r\n resolve: {\r\n Category:\r\n function ($stateParams, CategoriesService, lodash) {\r\n if ($stateParams.SurveyQuestionCategoryId > 0) {\r\n return CategoriesService.getAllCategories().then(function (data) {\r\n var category = lodash.find(data, function(q) { return q.SurveyQuestionCategoryId == $stateParams.SurveyQuestionCategoryId; });\r\n return category.Name;\r\n });\r\n } else {\r\n return 'Uncategorized';\r\n }\r\n }\r\n }\r\n })\r\n\r\n .state('content.categories.category.question', {\r\n url: '/:SurveyQuestionId',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/careplan_editor/categories/nestquestion.tpl.html',\r\n }\r\n },\r\n data: {\r\n displayName: 'Nest Question'\r\n }\r\n });\r\n}\r\n","var healthTipDeps = [\r\n 'ui.router',\r\n 'repos',\r\n 'ngLodash',\r\n 'textAngular',\r\n 'colorpicker.module',\r\n 'imageselection',\r\n 'vh.ui.sweetalert',\r\n 'permissions',\r\n 'ui.bootstrap',\r\n 'focusme',\r\n 'files'\r\n];\r\n\r\nfunction HealthTipRoutes($stateProvider) {\r\n $stateProvider.state('content.healthtips', {\r\n url: '/HealthTips',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/careplan_editor/healthtips/healthtips.tpl.html',\r\n controller: 'HealthTipsController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Health Tips',\r\n requiredPermissions: [\"HealthTipsRead\"]\r\n },\r\n resolve: {\r\n healthTipsObj: function (HealthTipsService) {\r\n return HealthTipsService.getHealthTipsByPage(1,HealthTipsService.getPageSize()).then(function (data) {\r\n return data;\r\n });\r\n }\r\n }\r\n })\r\n\r\n .state('content.healthtips.healthtip', {\r\n url: '/:TipQuestionId',\r\n templateUrl: 'modules/content/careplan_editor/healthtips/healthtips.tpl.html',\r\n data: {\r\n displayName: '{{healthTipName}}',\r\n },\r\n resolve: {\r\n healthTipName: function (HealthTipsService, $stateParams) {\r\n return HealthTipsService.getHealthTip($stateParams.TipQuestionId).then(function (healthTip) {\r\n return healthTip.name;\r\n });\r\n }\r\n }\r\n });\r\n}\r\n\r\nfunction TextAngularConfig($provide) {\r\n $provide.decorator('taOptions', function(taRegisterTool, $delegate){\r\n taRegisterTool('fontColor', {\r\n display:\"',\r\n action: function (deferred) {\r\n var textAngular = this;\r\n\r\n textAngular.$watch('textAngular.fontColor', function (newVal) {\r\n if (newVal !== '') {\r\n textAngular.$editor().wrapSelection('foreColor', newVal);\r\n deferred.resolve();\r\n }\r\n });\r\n return false;\r\n }\r\n });\r\n\r\n $delegate.toolbar[1].push('fontColor');\r\n return $delegate;\r\n });\r\n\r\n $provide.decorator('taTools', function ($delegate, ImageSelection, taSelection, ConfigurationRepository) {\r\n $delegate.insertImage.action = function (deffered, restoreSelection) {\r\n var editorScope = this;\r\n var imageSizeConfigName = 'EmbeddedImageSizeMax';\r\n\r\n ConfigurationRepository.getByParamName(imageSizeConfigName).then(function (data) {\r\n imageOptions = {maxImageSize: data.Value};\r\n ImageSelection.show(imageOptions).then(function (imageData) {\r\n restoreSelection();\r\n editorScope.$editor().wrapSelection('insertImage', 'data:'+imageData.filetype+';base64,'+imageData.base64, true);\r\n deffered.resolve();\r\n }, function () {\r\n restoreSelection();\r\n deffered.resolve();\r\n });\r\n });\r\n\r\n return false;\r\n };\r\n return $delegate;\r\n });\r\n}\r\n\r\nfunction FileSizeUnitFilter() {\r\n return function (fileSize) {\r\n var value = fileSize;\r\n var units = 'bytes';\r\n if (fileSize > 1000 && fileSize< 1000000) {\r\n value = (fileSize/1000).toFixed(1);\r\n units = 'KBs';\r\n } else if (fileSize >= 1000000) {\r\n value = (fileSize/1000000).toFixed(1);\r\n units = 'MBs';\r\n }\r\n return value + ' ' + units;\r\n };\r\n}\r\nangular.module('content.healthtips', healthTipDeps);\r\nangular.module('content.healthtips').config(HealthTipRoutes)\r\n .config(TextAngularConfig)\r\n .filter('fileSizeUnitFilter', FileSizeUnitFilter);\r\n","var patientSurveyDeps = [\r\n 'ui.router',\r\n 'content.services',\r\n 'ngLodash',\r\n 'vh.ui.sweetalert',\r\n 'permissions',\r\n 'ui.bootstrap',\r\n 'smoothscroll',\r\n 'content.healthtipbutton',\r\n 'ui.tree',\r\n 'content.alertlabel',\r\n 'content.videobutton',\r\n 'content.schedule',\r\n 'content.question',\r\n 'animatedflash',\r\n 'xeditable',\r\n 'focusme',\r\n 'content.tree_extensions'\r\n];\r\nfunction PatientSurveyRoutes($stateProvider, $urlRouterProvider) {\r\n $stateProvider\r\n .state('patients.patient.careplan', {\r\n url:'/CarePlan',\r\n abstract: true,\r\n data: {\r\n displayName: 'Care Plan',\r\n displayIcon: 'fa-clipboard'\r\n },\r\n views: {\r\n 'patient-area': {\r\n template: '
'\r\n }\r\n }\r\n })\r\n .state('patients.patient.careplan.surveys', {\r\n url: '/Survey',\r\n views: {\r\n 'careplan-area': {\r\n templateUrl: 'modules/content/careplan_editor/patientsurvey/patientsurveys.tpl.html',\r\n controller: 'PatientSurveysController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Pathways',\r\n requiredPermissions: [\"PatientCareplanRead\"],\r\n timeLogAction: 'Patient Pathways'\r\n },\r\n resolve: {\r\n PatientCareplanContent: function (PatientSurveyService, $stateParams) {\r\n return PatientSurveyService.getPatientCareplanContent($stateParams.patientId);\r\n }\r\n }\r\n })\r\n\r\n .state('patients.patient.careplan.surveys.survey', {\r\n url: '/:PatientSurveyId',\r\n params: {\r\n isYesterday: true\r\n },\r\n views: {\r\n 'survey': {\r\n templateUrl: 'modules/content/careplan_editor/patientsurvey/patientsurvey.tpl.html',\r\n controller: 'PatientSurveyController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: '{{PatientSurvey.Name}}',\r\n timeLogAction: 'Editing Patient Pathway'\r\n },\r\n resolve: {\r\n PatientSurvey: function ($stateParams, PatientSurveyService, ConfigurationsService) {\r\n var presentUnansweredQuestions = !$stateParams.isYesterday && ConfigurationsService.configParams.ShowPresentedPathwayQuestions ? true : false;\r\n return PatientSurveyService.getPatientSurvey($stateParams.patientId, $stateParams.PatientSurveyId, presentUnansweredQuestions).then(function (data) {\r\n return data;\r\n })},\r\n\r\n AvailableLanguages: function (TemplatesService) { \r\n return TemplatesService.getAvailableLanguages().then(function (data) {\r\n return data;\r\n }); \r\n }\r\n }\r\n })\r\n .state('patients.patient.careplan.surveys.templates', {\r\n abstract: true,\r\n url: '/Template',\r\n views: {\r\n 'survey': {\r\n template: '
',\r\n }\r\n },\r\n data: {\r\n displayName: \"Available Surveys\"\r\n }\r\n })\r\n .state('patients.patient.careplan.surveys.templates.template', {\r\n url:'/:templateId',\r\n views: {\r\n 'template': {\r\n templateUrl: 'modules/content/careplan_editor/patientsurvey/template.tpl.html',\r\n controller: 'PatientSurveyTemplateController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: '{{Template.Name}}'\r\n },\r\n resolve: {\r\n Template: function ($stateParams, PatientSurveyService) {\r\n return PatientSurveyService.getTemplateForPatient($stateParams.patientId, $stateParams.templateId);\r\n },\r\n AvailableLanguages: function (TemplatesService) { \r\n return TemplatesService.getAvailableLanguages().then(function (data) {\r\n return data;\r\n }); \r\n } \r\n }\r\n })\r\n\r\n .state('patients.patient.careplan.surveys.survey.edit', {\r\n url: '/Edit',\r\n views: {\r\n 'careplan-area@patients.patient.careplan': {\r\n templateUrl: 'modules/content/careplan_editor/patientsurvey/patientsurveyedit.tpl.html',\r\n controller: 'PatientSurveyEditController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Edit',\r\n requiredPermissions: [\"PatientCareplanWrite\", \"PatientCareplanScheduleWrite\"]\r\n },\r\n resolve: {\r\n PatientCareplanEditContent: function(PatientSurveyService, $stateParams) {\r\n return PatientSurveyService.getPatientCareplanEditContent($stateParams.patientId, $stateParams.PatientSurveyId);\r\n }\r\n }\r\n });\r\n}\r\n\r\n// to make sure after editing a careplan it is reflected in the patient careplan tab\r\nfunction PatientSurveyRun($rootScope, $state, $transitions) {\r\n var reloaded = false;\r\n $transitions.onBefore({}, (trans) => {\r\n var fromState = trans.from();\r\n var toState = trans.to();\r\n\r\n if (fromState.name === \"patients.patient.careplan.surveys.survey.edit\" && toState.name.indexOf(\"patients.patient.careplan.surveys\") > -1 && !reloaded) {\r\n reloaded = true;\r\n $state.go(toState, trans.params());\r\n return true;\r\n } else {\r\n reloaded = false;\r\n }\r\n });\r\n}\r\n\r\nangular.module('content.patientsurvey', patientSurveyDeps).config(PatientSurveyRoutes).run(PatientSurveyRun);\r\n","angular.module('content.services', ['repos', 'angularFileUpload', 'vh_core.repository']);\r\n","var videosDeps = [\r\n 'angularFileUpload',\r\n 'content.services',\r\n 'ui.bootstrap',\r\n 'ui.router',\r\n 'permissions',\r\n 'ngLodash',\r\n 'vh.ui.sweetalert',\r\n 'focusme',\r\n 'searchbar'\r\n];\r\nangular.module('content.videos', videosDeps);\r\n\r\nfunction VideosRoutes($stateProvider) {\r\n $stateProvider\r\n .state('content.videos', {\r\n url: '/Videos',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/careplan_editor/videos/videos.tpl.html',\r\n controller: 'VideosController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Videos',\r\n requiredPermissions: [\"VideoListRead\"]\r\n }\r\n })\r\n\r\n .state('content.videos.video', {\r\n url: '/:videoId',\r\n views: {\r\n 'video': {\r\n templateUrl: 'modules/content/careplan_editor/videos/video.tpl.html',\r\n controller: \"VideoController as vm\"\r\n }\r\n },\r\n resolve: {\r\n video: function ($stateParams, VideosService) {\r\n return VideosService.getVideo($stateParams.videoId).then(function (data) {\r\n return data;\r\n });\r\n }\r\n },\r\n data: {\r\n displayName: '{{video.Name}}',\r\n }\r\n });\r\n}\r\nangular.module('content.videos').config(VideosRoutes);\r\n","var templatesDeps = [\r\n 'ui.router',\r\n 'ui.bootstrap',\r\n 'ui.tree',\r\n 'ngLodash',\r\n 'xeditable',\r\n 'vh.ui.sweetalert',\r\n 'sticky',\r\n 'ui.select',\r\n 'ui-select-extensions',\r\n 'content.healthtipbutton',\r\n 'content.videobutton',\r\n 'focusme',\r\n 'content.alertlabel',\r\n 'content.services',\r\n 'permissions',\r\n 'content.schedule',\r\n 'smoothscroll',\r\n 'animatedflash',\r\n 'content.question',\r\n 'vh.highlight',\r\n 'vh.language',\r\n 'vh.ui.tags'\r\n];\r\nangular.module('content.templates', templatesDeps).config(TemplatesRoutes);\r\n\r\nfunction TemplatesRoutes($stateProvider) {\r\n $stateProvider\r\n .state('content.templates', {\r\n url: '/Surveys?templateGroupId',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/careplan_editor/templates/templates.tpl.html',\r\n controller: 'TemplatesController as vm'\r\n }\r\n },\r\n data: {\r\n displayName: 'Pathways',\r\n displayParam: '{{TemplateGroup}}',\r\n requiredPermissions: [\"MasterCareplansRead\"]\r\n },\r\n resolve: {\r\n TemplateGroup: function ($stateParams, TemplatesService) {\r\n if ($stateParams.templateGroupId !== undefined && $stateParams.templateGroupId !== null && $stateParams.templateGroupId !== 0) {\r\n return TemplatesService.getTemplateGroup($stateParams.templateGroupId).then(function (group) {\r\n return group.TemplateGroupName;\r\n });\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n }\r\n })\r\n\r\n .state('content.templates.template', {\r\n url: '/:SurveyTemplateId',\r\n templateUrl: 'modules/content/careplan_editor/templates/templates.tpl.html',\r\n data: {\r\n displayName: '{{SurveyTemplate}}'\r\n },\r\n resolve: {\r\n SurveyTemplate:\r\n function ($stateParams, TemplatesService, lodash) {\r\n return TemplatesService.getAllTemplates().then(function (data) {\r\n var template = lodash.find(data, function (q) { return q.SurveyTemplateId == $stateParams.SurveyTemplateId; });\r\n return template.Name;\r\n });\r\n },\r\n }\r\n })\r\n\r\n .state('content.templates.template.edit', {\r\n url: '/Edit',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'modules/content/careplan_editor/templates/templatesedit.tpl.html',\r\n }\r\n },\r\n data: {\r\n displayName: 'Edit',\r\n requiredPermissions: [\"MasterCareplansWrite\"]\r\n }\r\n });\r\n}\r\n","function KitConfig($stateProvider) {\r\n $stateProvider.state(\"kit_logistics.kits.kit\", {\r\n url: \"/:kitId\",\r\n views: {\r\n \"main@\": {\r\n templateUrl: \"modules/kit_logistics/kits/kit/kit.tpl.html\",\r\n controller: \"KitController as kvm\",\r\n }\r\n },\r\n resolve: {\r\n kitContent: function (KitService, $stateParams) {\r\n return KitService.getKitContent($stateParams.kitId);\r\n },\r\n portalConfig: function(ConfigurationsService) {\r\n return ConfigurationsService.getConfig();\r\n }\r\n },\r\n data: {\r\n displayName: \"{{kitContent.Kit.KitNo}}\",\r\n requiredPermission: [\"KitsRead\"]\r\n }\r\n });\r\n}\r\nangular.module(\"kits.kit\", [\r\n \"ui.router\",\r\n \"forms\"\r\n]).config(KitConfig);\r\n","function alertLabel() {\r\n\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n editable: '=',\r\n alertChanged: '&',\r\n option: '='\r\n },\r\n template:\r\n '',\r\n controller: function ($scope, PatientSurveyService, AlertSeverityLevel) {\r\n $scope.isVisible = function() {\r\n return $scope.editable || $scope.option.AlertSeverityLevelId !== AlertSeverityLevel.None;\r\n };\r\n $scope.alertSeverityClass = function() {\r\n var clickable = $scope.editable ? 'clickable ' : '';\r\n switch ($scope.option.AlertSeverityLevelId) {\r\n case AlertSeverityLevel.High : return clickable + 'badge-danger';\r\n case AlertSeverityLevel.Medium : return clickable + 'badge-warning';\r\n case AlertSeverityLevel.Notification : return clickable + 'badge-primary';\r\n case AlertSeverityLevel.None : return clickable + 'badge-info';\r\n }\r\n };\r\n $scope.alertClass = function() {\r\n return $scope.option.AlertSeverityLevelId === AlertSeverityLevel.Notification ? 'fa fa-bell-o' : 'vh-ui-glyph vh-ui-glyph-item-survey';\r\n };\r\n $scope.tooltip = function() {\r\n switch ($scope.option.AlertSeverityLevelId) {\r\n case AlertSeverityLevel.High : return 'High Alert';\r\n case AlertSeverityLevel.Medium : return 'Medium Alert';\r\n case AlertSeverityLevel.Notification : return 'Notification';\r\n case AlertSeverityLevel.None : return 'Normal';\r\n }\r\n }\r\n $scope.changeAlert = function () {\r\n if ($scope.editable === true) {\r\n $scope.alertChanged();\r\n $scope.option.AlertSeverityLevelId = getNextAlertSeverity();\r\n }\r\n };\r\n\r\n function getNextAlertSeverity() {\r\n switch ($scope.option.AlertSeverityLevelId) {\r\n case AlertSeverityLevel.High : return AlertSeverityLevel.Medium;\r\n case AlertSeverityLevel.Medium : return AlertSeverityLevel.Notification;\r\n case AlertSeverityLevel.Notification : return AlertSeverityLevel.None;\r\n case AlertSeverityLevel.None : return AlertSeverityLevel.High;\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module('content.alertlabel', ['content.services']).directive('alertLabel', alertLabel);\r\n","function HealthTipButton(MediaPreview, lodash) {\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n healthTip: '='\r\n },\r\n template: '',\r\n link: function (scope, element, attrs) {\r\n scope.iClicked = function () {\r\n var healthTip = scope.healthTip;\r\n var isCondensedModel = healthTip.Text !== undefined;\r\n var title = '';\r\n var texts = {};\r\n\r\n if (isCondensedModel) {\r\n texts = healthTip.PatientSurveyOptions[0].Text;\r\n title = healthTip.Text;\r\n } else {\r\n texts = healthTip.SurveyOptions[0].OptionTexts;\r\n title = healthTip.QuestionTexts['en'];\r\n }\r\n\r\n MediaPreview.showHealthTip({\r\n title: title,\r\n DisplayCondition : healthTip.DisplayCondition,\r\n sources: texts\r\n });\r\n };\r\n }\r\n };\r\n}\r\nangular.module('content.healthtipbutton', ['content.mediapreview']).directive('healthTipButton', HealthTipButton);\r\n","// media = {\r\n// type: '',\r\n// source: '',\r\n// title: '',\r\n// };\r\nangular.module('mediapreview', ['ui.bootstrap']);\r\n\r\nfunction MediaPreview(lodash, $uibModal) {\r\n function showModal(media) {\r\n\r\n return $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/components/mediapreview/mediapreview.modal.html',\r\n controller: 'MediaPreviewController as mpvm',\r\n backdrop: true,\r\n resolve: {\r\n media: function() {\r\n return media;\r\n }\r\n }\r\n }).result;\r\n }\r\n\r\n return {\r\n showHealthTip: function (healthTipMedia) {\r\n healthTipMedia.type = 'healthTip';\r\n return showModal(healthTipMedia);\r\n },\r\n\r\n showVideo: function (videoMedia) {\r\n videoMedia.type = 'video';\r\n return showModal(videoMedia);\r\n }\r\n };\r\n}\r\n\r\nangular.module('content.mediapreview', ['ngLodash', 'ui.bootstrap', 'videocontrols']).factory('MediaPreview', MediaPreview);\r\n","angular.module(\"content.question\", [\r\n \"ui.bootstrap\",\r\n \"content.services\",\r\n \"ngLodash\",\r\n \"ui.tree\",\r\n \"content.healthtipbutton\",\r\n \"content.alertlabel\",\r\n \"content.videobutton\",\r\n \"vh.highlight\",\r\n \"vh.language\"\r\n]);\r\n","angular.module('content.schedule', [\r\n 'content.services',\r\n 'xeditable',\r\n 'app'\r\n]);\r\n","angular.module(\"content.tree_extensions\", [\"ui.tree\"]);\r\n","function VideoButton(MediaPreview, VideoRepository, $location, lodash) {\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n video: '=',\r\n videoId: '='\r\n },\r\n template: '',\r\n link: function (scope, element, attrs) {\r\n function showPreview(video) {\r\n var sources = video.VideoFiles.reduce(function(map, video) {\r\n var source = $location.protocol() + '://' + $location.host() + ($location.port() ? ':' + $location.port() : '') + video.RelativeUrl + video.FileName;\r\n map[video.LocaleCode] = source;\r\n return map;\r\n }, {});\r\n\r\n var title = video.Name;\r\n MediaPreview.showVideo({\r\n title: title,\r\n sources: sources\r\n });\r\n }\r\n scope.iClicked = function () {\r\n if (scope.video) {\r\n showPreview(scope.video);\r\n } else {\r\n VideoRepository.getVideo(scope.videoId).then(function (data) {\r\n showPreview(data);\r\n });\r\n }\r\n };\r\n }\r\n };\r\n}\r\n\r\nangular.module('content.videobutton', ['content.mediapreview', 'repos']).directive('videoButton', VideoButton);\r\n","function GeneralConfig($rootScopeProvider, $httpProvider, repositoryUrlBuilderProvider, $uibModalProvider, $qProvider) {\r\n \r\n // after upgrade to angular 1.8.2 possible unhandled rejects/cancels caused errors\r\n // these errors need to be addressed but the following reverts to previous behavior\r\n $qProvider.errorOnUnhandledRejections(false);\r\n \r\n //Default value is 10, when this value is 10 nesting question/options are limited to 5 deep.\r\n //Set this value so we can nest questions deeper. Templaception\r\n $rootScopeProvider.digestTtl(50);\r\n repositoryUrlBuilderProvider.setBaseUrl(\"/api/\");\r\n //Add headers to http api calls\r\n $httpProvider.defaults.headers.common['vh-app'] = 'CGP';\r\n //Set default options for modal dialogs\r\n $uibModalProvider.options = {\r\n animation: true,\r\n backdrop: 'static',\r\n keyboard: false\r\n };\r\n}\r\n\r\nfunction AppRoutesConfig($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvider) {\r\n $urlMatcherFactoryProvider.caseInsensitive(true);\r\n $urlRouterProvider.otherwise(\"unknown\");\r\n $stateProvider.state('unauthorized', {\r\n url: '/Unauthorized',\r\n views: {\r\n 'main@': {\r\n templateUrl: 'layout/unauthorized.tpl.html'\r\n }\r\n }\r\n })\r\n .state('unknown', {\r\n url: \"/unknown\",\r\n views: {\r\n 'main@': {\r\n template: \"
Not Found
\"\r\n }\r\n }\r\n })\r\n .state(\"root\", {\r\n url: \"/\",\r\n data: {\r\n displayName: \"List\",\r\n requiredPermissions: [\"PatientListRead\"]\r\n },\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/patient/list/patientlist.tpl.html\",\r\n controller: \"PatientListController as plvm\"\r\n }\r\n },\r\n resolve: {\r\n webformfields: function(WebFormFieldRepository) {\r\n return WebFormFieldRepository.get();\r\n },\r\n patientListContent: function (PatientListService) {\r\n return PatientListService.getPatientListContent();\r\n },\r\n stateParams: function ($stateParams) {\r\n return $stateParams;\r\n }\r\n }\r\n })\r\n .state(\"empty\", {\r\n url: \"\",\r\n data: {\r\n displayName: \"List\",\r\n requiredPermissions: [\"PatientListRead\"]\r\n },\r\n views: {\r\n 'main@': {\r\n templateUrl: \"modules/patient/list/patientlist.tpl.html\",\r\n controller: \"PatientListController as plvm\",\r\n \r\n }\r\n },\r\n resolve: {\r\n webformfields: function(WebFormFieldRepository) {\r\n return WebFormFieldRepository.get();\r\n },\r\n patientListContent: function (PatientListService) {\r\n return PatientListService.getPatientListContent();\r\n },\r\n stateParams: function ($stateParams) {\r\n return $stateParams;\r\n }\r\n }\r\n });\r\n}\r\n\r\n// HttpErrorHandling, for all requests!!!!\r\n// If status code 401 -> log out\r\n// if status code 500 show error swal\r\n// if status code >= 400 default action is to show standard error message\r\n// to prevent default error, in .catch promise call rejection.preventDefault()\r\n// ex:\r\n// $http.get(\"thing\").then(successFunction).catch(function (rejection)\r\n// console.log(\"thing failed but i dont want to show an error swal\");\r\n// rejection.preventDefault();\r\n// });\r\nfunction HttpErrorHandling($httpProvider) {\r\n $httpProvider.interceptors.push(function($q, $window, $injector, $rootScope) {\r\n return {\r\n 'responseError': function(rejection) {\r\n var $loginService = $injector.get('LoginService');\r\n var $state = $injector.get('$state');\r\n var vhSweetAlert = $injector.get('vhSweetAlert');\r\n if (rejection.status === 401) {\r\n //Check that user is still logged in on the server\r\n var KeepAliveRepository = $injector.get('KeepAliveRepository');\r\n KeepAliveRepository.get().then(function (data) {\r\n if (!window.location.origin) { //IE9 Hack\r\n window.location.origin = window.location.protocol + \"//\" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');\r\n }\r\n if (data) {\r\n $state.go('unauthorized');\r\n } else {\r\n if (window.location.hash != '#/Login') {\r\n $loginService.setLoginRedirect(window.location.hash);\r\n }\r\n $rootScope.isAuthorized = false;\r\n $state.go('login');\r\n }\r\n });\r\n return $q.reject(rejection);\r\n } else if (rejection.status === 500\r\n && rejection.config.url !== \"/api/Message/Unread/Count\"\r\n && rejection.config.url !== \"/api/VirtualVisit/GetVirtualVisitCounts\"\r\n ) {\r\n vhSweetAlert.error(\"Server Error\", 'An unexpected server error occurred. Please try again or contact your local administrator.')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $state.transitionTo($state.current.name, $state.params, {\r\n reload: true,\r\n inherit: false,\r\n notify: true\r\n });\r\n }\r\n });\r\n return $q.reject(rejection);\r\n } else {\r\n return $q.reject(rejection);\r\n }\r\n }\r\n };\r\n });\r\n $httpProvider.interceptors.push(function ($timeout, $q, $injector) {\r\n return {\r\n responseError: function (rejection) {\r\n var $state = $injector.get('$state');\r\n var shouldUseDefault = true;\r\n var vhSweetAlert = $injector.get('vhSweetAlert');\r\n rejection.preventDefault = function () {\r\n shouldUseDefault = false;\r\n };\r\n if (rejection.status >= 400 && rejection.status !== 500 && rejection.status !== 401 && rejection.config.url !==\"/api/Message/Unread/Count\" && rejection.config.url !== \"/api/SurveyQuestion\") {\r\n $timeout(function () {\r\n if (shouldUseDefault) {\r\n vhSweetAlert.error(\"Server Error\", 'An unexpected server error occurred. Please try again or contact your local administrator.')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $state.transitionTo($state.current, $state.params, {\r\n reload: true,\r\n inherit: false,\r\n notify: true\r\n });\r\n }\r\n });\r\n }\r\n });\r\n return $q.reject(rejection);\r\n } else {\r\n return $q.reject(rejection);\r\n }\r\n\r\n }\r\n };\r\n });\r\n}\r\n\r\nfunction AppRouteHandling(editableOptions, $transitions, $rootScope, $document, PermissionService, KeepAliveRepository, $log, $window, $state, lodash, $injector, editableThemes, $uibModalStack, LoginService) {\r\n editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default'\r\n editableThemes.bs3.buttonsClass = 'btn-sm';\r\n // Route handling\r\n $transitions.onBefore({}, (trans)=>{\r\n var toState = trans.$to();\r\n // Check permissions for the route\r\n var requiredPermissions = false;\r\n if (toState.data !== null && toState.data !== undefined) {\r\n requiredPermissions = toState.data.requiredPermissions;\r\n }\r\n if (!requiredPermissions) {\r\n return;\r\n }\r\n // if we alread have the users permission list look up permission else load permissions and try route again\r\n if (PermissionService.hasLoadedPermissions) {\r\n if (PermissionService.userHasPermission(requiredPermissions)) {\r\n return;\r\n }\r\n // The user does not have permission to access this route\r\n $log.warn(\"ACCESS DENIED TO ROUTE: \" + toState.name + \" (required permissions: \" + requiredPermissions + \")\");\r\n\r\n // Redirect the user to the login page\r\n KeepAliveRepository.get().then(function (isLoggedIn) {\r\n if (isLoggedIn === true) {\r\n // If they are already logged in, then they don't have access\r\n // to this route, so we want to show then the \"unauthorized\" page.\r\n $state.go('unauthorized');\r\n } else {\r\n // If they are not logged in, then they might actually have\r\n // permission to access this route but we don't know since\r\n // they're not logged in. Let's show them the login page.\r\n $rootScope.isAuthorized = false;\r\n $state.go('login');\r\n }\r\n });\r\n\r\n // Prevent them from accessing the route while we redirect them\r\n //event.preventDefault();\r\n return;\r\n } else {\r\n if (window.location.hash != '#/Login') {\r\n LoginService.setLoginRedirect(window.location.hash);\r\n }\r\n PermissionService.loadUserPermissions().then(function () {\r\n window.setTimeout(()=>{\r\n $state.go(toState, trans.params());\r\n }, 250)\r\n }).catch(error => {\r\n console.log('Error loading user permissions.');\r\n });\r\n //event.preventDefault();\r\n return false;\r\n }\r\n });\r\n\r\n $transitions.onSuccess({}, (trans)=>{\r\n $document[0].body.scrollTop = $document[0].documentElement.scrollTop = 0;\r\n $uibModalStack.dismissAll();\r\n });\r\n}\r\n\r\nfunction SmoothScrollConfig(SmoothScrollProvider) {\r\n SmoothScrollProvider.yOffset(60);\r\n}\r\n\r\nangular.module('app')\r\n .config(GeneralConfig)\r\n .config(AppRoutesConfig)\r\n .config(HttpErrorHandling)\r\n .config(SmoothScrollConfig)\r\n .run(AppRouteHandling).directive(\"docReady\", function ($browser, $window) {\r\n return {\r\n restrict: \"A\",\r\n terminal: true,\r\n transclude: false,\r\n link: function (scope) {\r\n scope.$evalAsync(function () {\r\n $browser.notifyWhenNoOutstandingRequests(function () {\r\n scope.$evalAsync(function () {\r\n var delay = (function() {\r\n var timer = 0;\r\n return function(callback, ms){\r\n clearTimeout(timer);\r\n timer = setTimeout(callback, ms);\r\n }\r\n })();\r\n\r\n delay(function(){\r\n $window.status = \"pagerendercomplete\";\r\n }, 3000);\r\n });\r\n });\r\n });\r\n }\r\n };\r\n }).config(function ($provide) {\r\n $provide.decorator('editableDirectiveFactory', function ($delegate) {\r\n //TODO: temporary until angular-xeditable fixes issue with wrong template for\r\n // uib-timepicker 12/4/2016\r\n return function (overwrites) {\r\n if (overwrites.directiveName === \"editableBstime\") {\r\n overwrites.inputTpl = '
';\r\n }\r\n return $delegate(overwrites);\r\n };\r\n });\r\n }) // work around for the breaking hash prefix issue introduced in angularJs 1.6\r\n .config(['$locationProvider', function($locationProvider) {\r\n $locationProvider.hashPrefix('');\r\n }])\r\n // work around for breaking change to angularJs 1.6 when they removed\r\n // angular.lowercase which is used by text-sanatize\r\n .config(function(){\r\n angular.lowercase = angular.$$lowercase;\r\n })\r\n .run(function ($rootScope, $transitions, $trace) {\r\n // $trace.enable();\r\n // $transitions.onError({}, (trans) => {\r\n // console.log(trans.error());\r\n // });\r\n });\r\n\r\n","// HELPER METHODS/CLASSES\r\nclass EnumSymbol {\r\n \r\n constructor(name, {value, description}, serializeByName) {\r\n \r\n var _serializeByName = serializeByName === true;\r\n\r\n this.symbol = Symbol.for(name);\r\n \r\n if(!Object.is(value, undefined))\r\n {\r\n this.value = value;\r\n }\r\n\r\n if(description){\r\n this.description = description;\r\n }\r\n \r\n\r\n // this should let us change the save as key\r\n // value on this immutable object\r\n this.saveAsKey = (newValue) =>{\r\n if(Object.is(newValue), undefined)\r\n return _serializeByName;\r\n else\r\n _serializeByName = newValue;\r\n } \r\n\r\n Object.freeze(this);\r\n\r\n }\r\n\r\n get display(){\r\n return this.description || Symbol.keyFor(this.symbol);\r\n }\r\n\r\n toString(){\r\n return this.valueOf() || Symbol.keyFor(this.symbol);\r\n }\r\n\r\n toJSON(){\r\n return this.value;\r\n }\r\n\r\n valueOf(){\r\n return this.value;\r\n }\r\n\r\n\r\n}\r\n\r\nclass Enum {\r\n\r\n constructor(enumValues, serializeByName) {\r\n \r\n for (let key in enumValues) {\r\n if(!enumValues[key]) throw new TypeError();\r\n this[key] = new EnumSymbol(key, enumValues[key], serializeByName === true);\r\n }\r\n Object.freeze(this);\r\n }\r\n\r\n symbols() {\r\n return Object.keys(this).map(x => this[x]);\r\n }\r\n\r\n keys() {\r\n return Object.keys(this);\r\n }\r\n\r\n contains(symbol) {\r\n if (!(symbol instanceof EnumSymbol)) return false;\r\n return this[Symbol.keyFor(symbol.symbol)] === symbol;\r\n }\r\n\r\n parse(value) {\r\n var key = Object.keys(this).find(x => x === value || this[x].value === value);\r\n return this[key];\r\n }\r\n\r\n}\r\n\r\n// ENUMS\r\nconst LockStatusEnum = new Enum({\r\n UnLocked: {value: 0, description: 'Unlocked'},\r\n Locked: {value: 1, description: 'Locked'},\r\n InheritedLock: {value: 2, description: 'Inherited Lock'}\r\n});\r\n\r\n// END ENUMS\r\n\r\n// PROXIES\r\nconst ContentLock = function(item, callback) {\r\n\r\n if(item.hasContentLock)\r\n return item;\r\n\r\n if(!item.hasOwnProperty('LockStatus'))\r\n throw 'Invalid ContentLock object.'\r\n\r\n if(typeof item.LockStatus == 'string')\r\n item.LockStatus = LockStatusEnum.parse(item.LockStatus).value;\r\n\r\n var handlers = [];\r\n\r\n return new Proxy(item, {\r\n get: (target, key, receiver)=>{\r\n\r\n if(typeof key == 'string'){\r\n switch(`${key}`.toLowerCase()){\r\n case 'hascontentlock': return true;\r\n case 'setlockstatus': return (value)=>{ \r\n var newValue = LockStatusEnum.parse(value) || value;\r\n return Reflect.set(target, 'LockStatus', newValue, receiver);\r\n }\r\n case 'lockstatus':\r\n return LockStatusEnum.parse(Reflect.get(target, key, receiver)) || Reflect.get(target, key, receiver);\r\n case 'handlers':\r\n return handlers;\r\n default:\r\n return Reflect.get(target, key, receiver);\r\n }\r\n }else {\r\n return Reflect.get(target, key, receiver);\r\n }\r\n\r\n \r\n },\r\n set: (target, key, value, receiver)=>{\r\n switch(`${key}`.toLowerCase()){\r\n case 'lockstatus':\r\n var newValue = LockStatusEnum.parse(value) || value;\r\n var result = Reflect.set(target, key, newValue, receiver);\r\n if(callback)\r\n callback(item, newValue);\r\n handlers.forEach(x => x(item, newValue));\r\n return result;\r\n default:\r\n return Reflect.set(target, key, value, receiver);\r\n }\r\n }\r\n });\r\n};\r\n\r\nconst Expandable = function(item, startExpanded){ \r\n // inject to create expand collapse functionality on objects. \r\n // Example: expandable({}) wraps the object and the object will now have \r\n // the following properties: expanded\r\n // and the following methods: expand(), collapse(), toggleExpand()\r\n // these can now be used instead of having to recreate this logic everywhere \r\n\r\n var expanded = startExpanded === true;\r\n return new Proxy(item,{\r\n get: (target, key, receiver)=>{\r\n\r\n switch(`${key}`.toLowerCase()){\r\n case 'expanded':\r\n return expanded;\r\n case 'expand':\r\n return ()=> { return expanded = true; };\r\n case 'collapse':\r\n return ()=> { return expanded = false; };\r\n case 'toggleexpand':\r\n return () => {return expanded = !expanded; }; \r\n case 'target':\r\n return target;\r\n default:\r\n return Reflect.get(target, key, receiver);\r\n }\r\n },\r\n set: (target, key, value, receiver) => {\r\n if(key == 'expanded')\r\n return expanded = value;\r\n\r\n return Reflect.set(target, key, value, receiver);\r\n },\r\n ownKeys(target){\r\n return Object.getOwnPropertyNames(target).filter(x => x != 'expanded' && x != 'expand' && x != 'collapse');\r\n }\r\n });\r\n\r\n};\r\n\r\nconst HasHideNav = function(){\r\n// injected for use to hide the header and left nav \r\n // used for embedding the app into iframes\r\n // this must be injected and called in the route\r\n // where the ?hidenav=true querystring param is passed in\r\n var field = 'hidenav';\r\n var url = window.location.href;\r\n var hasField = false;\r\n \r\n if(url.indexOf('?' + field + '=') != -1)\r\n hasField = true;\r\n else if(url.indexOf('&' + field + '=') != -1)\r\n hasField = true;\r\n \r\n if(window.sessionStorage && hasField)\r\n window.sessionStorage.setItem('hidenav', 'true');\r\n \r\n if(window.sessionStorage && !hasField)\r\n hasField = window.sessionStorage.getItem('hidenav') === 'true';\r\n \r\n if(hasField && window && window.document && window.document.body && `${window.document.body.className}`.indexOf('hide-nav') == -1)\r\n window.document.body.className =`${window.document.body.className} hide-nav`;\r\n \r\n return hasField;\r\n};\r\n\r\nconst PrivateProperties = function(item, initial = {}){\r\n var internalObject = initial || {};\r\n return new Proxy(item, {\r\n \r\n get: (target, key, receiver) => {\r\n if(`${key}`.startsWith('_'))\r\n return internalObject[key];\r\n\r\n if(key == 'target')\r\n return target;\r\n\r\n return Reflect.get(target, key, receiver);\r\n },\r\n\r\n set: (target, key, value, receiver) => {\r\n \r\n if(`${key}`.startsWith('_'))\r\n {\r\n internalObject[key] = value;\r\n return value === internalObject[key];\r\n }\r\n\r\n return Reflect.set(target, key, value, receiver);\r\n },\r\n\r\n ownKeys(target){\r\n return Object.getOwnPropertyNames(target).filter(x => !x.startsWith('_'));\r\n }\r\n })\r\n };\r\n\r\n// END PROXIES\r\n\r\nangular.module('app')\r\n.constant('hasHideNav', HasHideNav)\r\n.constant('expandable',Expandable) \r\n.constant('privateProperties', PrivateProperties)\r\n.constant('contentLock', ContentLock)\r\n.constant('lockStatusEnum', LockStatusEnum)","//based on https://github.com/gonewandering/angles MIT LICENCE\r\nvar angles = angular.module(\"angles\", []);\r\n\r\nangles.chart = function (type) {\r\n return {\r\n restrict: \"A\",\r\n scope: {\r\n data: \"=\",\r\n options: \"=\",\r\n id: \"@\",\r\n width: \"=\",\r\n height: \"=\",\r\n resize: \"=\",\r\n chart: \"@\",\r\n segments: \"@\",\r\n responsive: \"=\",\r\n tooltip: \"=\",\r\n legend: \"=\"\r\n },\r\n link: function ($scope, $elem) {\r\n var ctx = $elem[0].getContext(\"2d\");\r\n var autosize = false;\r\n\r\n $scope.size = function () {\r\n // if ($scope.width <= 0) {\r\n // var parentWidth = $elem.parent()[0].clientWidth;\r\n // $elem.css(\"width\", parentWidth);\r\n // ctx.canvas.width = parentWidth;\r\n // } else {\r\n // ctx.canvas.width = $elem.parent()[0].clientWidth || $scope.width || ctx.canvas.width;\r\n // autosize = true;\r\n // //}\r\n //\r\n // // if($scope.height <= 0){\r\n // // $elem.height($elem.parent().height());\r\n // // ctx.canvas.height = ctx.canvas.width / 2;\r\n // // } else {\r\n // ctx.canvas.height = $scope.height || ctx.canvas.height;\r\n // autosize = true;\r\n // }\r\n }\r\n\r\n $scope.$watch(\"data\", function (newVal, oldVal) {\r\n if(chartCreated)\r\n chartCreated.destroy();\r\n\r\n var options = $scope.options || {};\r\n\r\n // if data not defined, exit\r\n if (!newVal) {\r\n return;\r\n }\r\n if ($scope.chart) { type = $scope.chart; }\r\n\r\n if(autosize){\r\n $scope.size();\r\n chart = new OldChart(ctx);\r\n };\r\n\r\n if($scope.responsive || $scope.resize)\r\n options.responsive = true;\r\n\r\n if($scope.responsive !== undefined)\r\n options.responsive = $scope.responsive;\r\n\r\n chartCreated = chart[type]($scope.data, options);\r\n chartCreated.update();\r\n if($scope.legend)\r\n angular.element($elem[0]).parent().after( chartCreated.generateLegend() );\r\n }, true);\r\n\r\n $scope.$watch(\"tooltip\", function (newVal, oldVal) {\r\n if (chartCreated)\r\n chartCreated.draw();\r\n if(newVal===undefined || !chartCreated.segments)\r\n return;\r\n if(!isFinite(newVal) || newVal >= chartCreated.segments.length || newVal < 0)\r\n return;\r\n var activeSegment = chartCreated.segments[newVal];\r\n activeSegment.save();\r\n activeSegment.fillColor = activeSegment.highlightColor;\r\n chartCreated.showTooltip([activeSegment]);\r\n activeSegment.restore();\r\n }, true);\r\n\r\n $scope.size();\r\n var chart = new OldChart(ctx);\r\n var chartCreated;\r\n }\r\n }\r\n}\r\n\r\n\r\n/* Aliases for various chart types */\r\nangles.directive(\"chart\", function () { return angles.chart(); });\r\nangles.directive(\"linechart\", function () { return angles.chart(\"Line\"); });\r\nangles.directive(\"barchart\", function () { return angles.chart(\"Bar\"); });\r\nangles.directive(\"radarchart\", function () { return angles.chart(\"Radar\"); });\r\nangles.directive(\"polarchart\", function () { return angles.chart(\"PolarArea\"); });\r\nangles.directive(\"piechart\", function () { return angles.chart(\"Pie\"); });\r\nangles.directive(\"doughnutchart\", function () { return angles.chart(\"Doughnut\"); });\r\nangles.directive(\"donutchart\", function () { return angles.chart(\"Doughnut\"); });\r\n","window.OldChart = Chart.noConflict();\r\n\r\nOldChart.types.Line.extend({\r\n name: \"LinePoint\",\r\n initialize: function(data){\r\n // override Line initialize to change point type\r\n\r\n //Declare the extension of the default point, to cater for the options passed in to the constructor\r\n var helpers = OldChart.helpers;\r\n\r\n // COPIED FROM ORIGINAL LINE initialize\r\n this.PointClass = OldChart.Point.extend({\r\n offsetGridLines : this.options.offsetGridLines,\r\n strokeWidth : this.options.pointDotStrokeWidth,\r\n radius : this.options.pointDotRadius,\r\n display: this.options.pointDot,\r\n hitDetectionRadius : this.options.pointHitDetectionRadius,\r\n ctx : this.chart.ctx,\r\n inRange : function(mouseX){\r\n return (Math.pow(mouseX-this.x, 2) < Math.pow(this.radius + this.hitDetectionRadius,2));\r\n }\r\n });\r\n\r\n this.datasets = [];\r\n\r\n //Set up tooltip events on the chart\r\n if (this.options.showTooltips){\r\n helpers.bindEvents(this, this.options.tooltipEvents, function(evt){\r\n var activePoints = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];\r\n var cleanActivePoints = helpers.where(activePoints, function (p) {\r\n return p.value !== null;\r\n });\r\n this.eachPoints(function(point){\r\n point.restore(['fillColor', 'strokeColor']);\r\n });\r\n helpers.each(cleanActivePoints, function(activePoint){\r\n activePoint.fillColor = activePoint.highlightFill;\r\n activePoint.strokeColor = activePoint.highlightStroke;\r\n });\r\n this.showTooltip(cleanActivePoints);\r\n });\r\n }\r\n\r\n //Iterate through each of the datasets, and build this into a property of the chart\r\n helpers.each(data.datasets,function(dataset){\r\n\r\n var datasetObject = {\r\n label : dataset.label || null,\r\n fillColor : dataset.fillColor,\r\n strokeColor : dataset.strokeColor,\r\n pointColor : dataset.pointColor,\r\n pointStrokeColor : dataset.pointStrokeColor,\r\n points : []\r\n };\r\n\r\n this.datasets.push(datasetObject);\r\n\r\n\r\n helpers.each(dataset.data,function(dataPoint,index){\r\n // ADDED: ablilty to pass in a pointColor\r\n var val = dataPoint;\r\n var fillColor = dataset.pointColor;\r\n if (dataPoint !== null && dataPoint.pointColor !== undefined) {\r\n val = dataPoint.value;\r\n fillColor = dataPoint.pointColor;\r\n }\r\n //Add a new point for each piece of data, passing any required data to draw.\r\n datasetObject.points.push(new this.PointClass({\r\n value : val,\r\n label : data.labels[index],\r\n datasetLabel: dataset.label,\r\n strokeColor : dataset.pointStrokeColor,\r\n fillColor : fillColor,\r\n highlightFill : dataset.pointHighlightFill || dataset.pointColor,\r\n highlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor\r\n }));\r\n //END ADDED\r\n },this);\r\n\r\n\r\n this.buildScale(data.labels);\r\n\r\n // ADDED: Ability to add a horizontal reference line\r\n var self = this;\r\n if (dataset.referenceLabel) {\r\n /////\r\n var lastPoint = helpers.findPreviousWhere(datasetObject.points, function (point) {\r\n return point.value != null;\r\n });\r\n this.refLine = new OldChart.RefLine(\r\n {\r\n strokeColor: 'rgba(180,180,180,1)',\r\n lineWidth: 1,\r\n value: dataset.referenceLabel,\r\n ctx : this.chart.ctx,\r\n lastPointValue: lastPoint.value\r\n }\r\n );\r\n\r\n /////\r\n\r\n var dataTotal = function(){\r\n var values = [];\r\n self.eachPoints(function(bar){\r\n values.push(bar.value);\r\n });\r\n values.push(dataset.referenceLabel);\r\n var minValue = helpers.min(values);\r\n var maxValue = helpers.max(values);\r\n\r\n // pad reference label so its not on bottom or top\r\n if (minValue == dataset.referenceLabel && minValue != 0 && values.length > 2) {\r\n values.push(minValue - 1);\r\n } else if (maxValue == dataset.referenceLabel && maxValue != 0 && values.length > 2) {\r\n values.push(maxValue + 1);\r\n }\r\n return values;\r\n };\r\n\r\n this.scale.calculateYRange = function (currentHeight) {\r\n var updatedRanges = helpers.calculateScaleRange(\r\n dataTotal(),\r\n currentHeight,\r\n this.fontSize,\r\n this.beginAtZero,\r\n this.integersOnly\r\n );\r\n helpers.extend(this, updatedRanges);\r\n }\r\n }\r\n //END ADDED\r\n\r\n this.eachPoints(function(point, index){\r\n helpers.extend(point, {\r\n x: this.scale.calculateX(index),\r\n y: this.scale.endPoint\r\n });\r\n point.save();\r\n }, this);\r\n\r\n },this);\r\n\r\n\r\n this.render();\r\n },\r\n draw: function(ease) {\r\n OldChart.types.Line.prototype.draw.apply(this, arguments);\r\n\r\n if (this.refLine) {\r\n OldChart.helpers.extend(this.refLine,{\r\n startX: this.scale.calculateX(0),\r\n stopX: this.scale.width,\r\n y: this.scale.calculateY(this.refLine.value)\r\n });\r\n this.refLine.draw();\r\n }\r\n }\r\n\r\n\r\n});\r\n\r\nOldChart.RefLine = OldChart.Element.extend({\r\n display: true,\r\n draw: function () {\r\n if (this.display) {\r\n var ctx = this.ctx;\r\n\r\n ctx.beginPath();\r\n ctx.strokeStyle = this.strokeColor;\r\n ctx.lineWidth = this.lineWidth;\r\n\r\n ctx.moveTo(this.startX, this.y);\r\n ctx.lineTo(this.stopX, this.y);\r\n ctx.stroke();\r\n ctx.fill();\r\n ctx.closePath();\r\n\r\n var refTextWidth = ctx.measureText(this.value).width;\r\n\r\n ctx.fillStyle = 'rgb(125,125,125)';\r\n ctx.textAlign = \"right\";\r\n ctx.textBaseline = \"middle\";\r\n\r\n var yVal = this.y + 10;\r\n if (this.lastPointValue < this.value) {\r\n yVal = this.y - 10;\r\n }\r\n\r\n ctx.fillText(this.value, this.stopX, yVal);\r\n }\r\n }\r\n})\r\n\r\nangular.module(\"angles\").directive(\"linepointchart\", function () { return angular.module(\"angles\").chart(\"LinePoint\")});\r\n","//Theres a bug with the timepicker where the input fields are being disabled when max time is hit\r\n//https://github.com/angular-ui/bootstrap/issues/6342\r\nangular.module(\"ui.bootstrap.extensions\").run(function($templateCache) {\r\n $templateCache.put(\"uib/template/timepicker/timepicker.html\",\r\n \"\\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \" \\n\" +\r\n \"
  
\\n\" +\r\n \" \\n\" +\r\n \" :\\n\" +\r\n \" \\n\" +\r\n \" :\\n\" +\r\n \" \\n\" +\r\n \"
  
\\n\" +\r\n \"\");\r\n});\r\n","/*!\r\n * Chart.js v2.9.3\r\n * https://www.chartjs.org\r\n * (c) 2019 Chart.js Contributors\r\n * Released under the MIT License\r\n */\r\n(function (global, factory) {\r\ntypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(function() { try { return require('moment'); } catch(e) { } }()) :\r\ntypeof define === 'function' && define.amd ? define(['require'], function(require) { return factory(function() { try { return require('moment'); } catch(e) { } }()); }) :\r\n(global = global || self, global.Chart = factory(global.moment));\r\n}(this, (function (moment) { 'use strict';\r\n\r\nmoment = moment && moment.hasOwnProperty('default') ? moment['default'] : moment;\r\n\r\nfunction createCommonjsModule(fn, module) {\r\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\r\n}\r\n\r\nfunction getCjsExportFromNamespace (n) {\r\n\treturn n && n['default'] || n;\r\n}\r\n\r\nvar colorName = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n\r\nvar conversions = createCommonjsModule(function (module) {\r\n/* MIT license */\r\n\r\n\r\n// NOTE: conversions should only return primitive values (i.e. arrays, or\r\n// values that give correct `typeof` results).\r\n// do not use box values types (i.e. Number(), String(), etc.)\r\n\r\nvar reverseKeywords = {};\r\nfor (var key in colorName) {\r\n\tif (colorName.hasOwnProperty(key)) {\r\n\t\treverseKeywords[colorName[key]] = key;\r\n\t}\r\n}\r\n\r\nvar convert = module.exports = {\r\n\trgb: {channels: 3, labels: 'rgb'},\r\n\thsl: {channels: 3, labels: 'hsl'},\r\n\thsv: {channels: 3, labels: 'hsv'},\r\n\thwb: {channels: 3, labels: 'hwb'},\r\n\tcmyk: {channels: 4, labels: 'cmyk'},\r\n\txyz: {channels: 3, labels: 'xyz'},\r\n\tlab: {channels: 3, labels: 'lab'},\r\n\tlch: {channels: 3, labels: 'lch'},\r\n\thex: {channels: 1, labels: ['hex']},\r\n\tkeyword: {channels: 1, labels: ['keyword']},\r\n\tansi16: {channels: 1, labels: ['ansi16']},\r\n\tansi256: {channels: 1, labels: ['ansi256']},\r\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\r\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\r\n\tgray: {channels: 1, labels: ['gray']}\r\n};\r\n\r\n// hide .channels and .labels properties\r\nfor (var model in convert) {\r\n\tif (convert.hasOwnProperty(model)) {\r\n\t\tif (!('channels' in convert[model])) {\r\n\t\t\tthrow new Error('missing channels property: ' + model);\r\n\t\t}\r\n\r\n\t\tif (!('labels' in convert[model])) {\r\n\t\t\tthrow new Error('missing channel labels property: ' + model);\r\n\t\t}\r\n\r\n\t\tif (convert[model].labels.length !== convert[model].channels) {\r\n\t\t\tthrow new Error('channel and label counts mismatch: ' + model);\r\n\t\t}\r\n\r\n\t\tvar channels = convert[model].channels;\r\n\t\tvar labels = convert[model].labels;\r\n\t\tdelete convert[model].channels;\r\n\t\tdelete convert[model].labels;\r\n\t\tObject.defineProperty(convert[model], 'channels', {value: channels});\r\n\t\tObject.defineProperty(convert[model], 'labels', {value: labels});\r\n\t}\r\n}\r\n\r\nconvert.rgb.hsl = function (rgb) {\r\n\tvar r = rgb[0] / 255;\r\n\tvar g = rgb[1] / 255;\r\n\tvar b = rgb[2] / 255;\r\n\tvar min = Math.min(r, g, b);\r\n\tvar max = Math.max(r, g, b);\r\n\tvar delta = max - min;\r\n\tvar h;\r\n\tvar s;\r\n\tvar l;\r\n\r\n\tif (max === min) {\r\n\t\th = 0;\r\n\t} else if (r === max) {\r\n\t\th = (g - b) / delta;\r\n\t} else if (g === max) {\r\n\t\th = 2 + (b - r) / delta;\r\n\t} else if (b === max) {\r\n\t\th = 4 + (r - g) / delta;\r\n\t}\r\n\r\n\th = Math.min(h * 60, 360);\r\n\r\n\tif (h < 0) {\r\n\t\th += 360;\r\n\t}\r\n\r\n\tl = (min + max) / 2;\r\n\r\n\tif (max === min) {\r\n\t\ts = 0;\r\n\t} else if (l <= 0.5) {\r\n\t\ts = delta / (max + min);\r\n\t} else {\r\n\t\ts = delta / (2 - max - min);\r\n\t}\r\n\r\n\treturn [h, s * 100, l * 100];\r\n};\r\n\r\nconvert.rgb.hsv = function (rgb) {\r\n\tvar rdif;\r\n\tvar gdif;\r\n\tvar bdif;\r\n\tvar h;\r\n\tvar s;\r\n\r\n\tvar r = rgb[0] / 255;\r\n\tvar g = rgb[1] / 255;\r\n\tvar b = rgb[2] / 255;\r\n\tvar v = Math.max(r, g, b);\r\n\tvar diff = v - Math.min(r, g, b);\r\n\tvar diffc = function (c) {\r\n\t\treturn (v - c) / 6 / diff + 1 / 2;\r\n\t};\r\n\r\n\tif (diff === 0) {\r\n\t\th = s = 0;\r\n\t} else {\r\n\t\ts = diff / v;\r\n\t\trdif = diffc(r);\r\n\t\tgdif = diffc(g);\r\n\t\tbdif = diffc(b);\r\n\r\n\t\tif (r === v) {\r\n\t\t\th = bdif - gdif;\r\n\t\t} else if (g === v) {\r\n\t\t\th = (1 / 3) + rdif - bdif;\r\n\t\t} else if (b === v) {\r\n\t\t\th = (2 / 3) + gdif - rdif;\r\n\t\t}\r\n\t\tif (h < 0) {\r\n\t\t\th += 1;\r\n\t\t} else if (h > 1) {\r\n\t\t\th -= 1;\r\n\t\t}\r\n\t}\r\n\r\n\treturn [\r\n\t\th * 360,\r\n\t\ts * 100,\r\n\t\tv * 100\r\n\t];\r\n};\r\n\r\nconvert.rgb.hwb = function (rgb) {\r\n\tvar r = rgb[0];\r\n\tvar g = rgb[1];\r\n\tvar b = rgb[2];\r\n\tvar h = convert.rgb.hsl(rgb)[0];\r\n\tvar w = 1 / 255 * Math.min(r, Math.min(g, b));\r\n\r\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\r\n\r\n\treturn [h, w * 100, b * 100];\r\n};\r\n\r\nconvert.rgb.cmyk = function (rgb) {\r\n\tvar r = rgb[0] / 255;\r\n\tvar g = rgb[1] / 255;\r\n\tvar b = rgb[2] / 255;\r\n\tvar c;\r\n\tvar m;\r\n\tvar y;\r\n\tvar k;\r\n\r\n\tk = Math.min(1 - r, 1 - g, 1 - b);\r\n\tc = (1 - r - k) / (1 - k) || 0;\r\n\tm = (1 - g - k) / (1 - k) || 0;\r\n\ty = (1 - b - k) / (1 - k) || 0;\r\n\r\n\treturn [c * 100, m * 100, y * 100, k * 100];\r\n};\r\n\r\n/**\r\n * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\r\n * */\r\nfunction comparativeDistance(x, y) {\r\n\treturn (\r\n\t\tMath.pow(x[0] - y[0], 2) +\r\n\t\tMath.pow(x[1] - y[1], 2) +\r\n\t\tMath.pow(x[2] - y[2], 2)\r\n\t);\r\n}\r\n\r\nconvert.rgb.keyword = function (rgb) {\r\n\tvar reversed = reverseKeywords[rgb];\r\n\tif (reversed) {\r\n\t\treturn reversed;\r\n\t}\r\n\r\n\tvar currentClosestDistance = Infinity;\r\n\tvar currentClosestKeyword;\r\n\r\n\tfor (var keyword in colorName) {\r\n\t\tif (colorName.hasOwnProperty(keyword)) {\r\n\t\t\tvar value = colorName[keyword];\r\n\r\n\t\t\t// Compute comparative distance\r\n\t\t\tvar distance = comparativeDistance(rgb, value);\r\n\r\n\t\t\t// Check if its less, if so set as closest\r\n\t\t\tif (distance < currentClosestDistance) {\r\n\t\t\t\tcurrentClosestDistance = distance;\r\n\t\t\t\tcurrentClosestKeyword = keyword;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn currentClosestKeyword;\r\n};\r\n\r\nconvert.keyword.rgb = function (keyword) {\r\n\treturn colorName[keyword];\r\n};\r\n\r\nconvert.rgb.xyz = function (rgb) {\r\n\tvar r = rgb[0] / 255;\r\n\tvar g = rgb[1] / 255;\r\n\tvar b = rgb[2] / 255;\r\n\r\n\t// assume sRGB\r\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\r\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\r\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\r\n\r\n\tvar x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\r\n\tvar y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\r\n\tvar z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\r\n\r\n\treturn [x * 100, y * 100, z * 100];\r\n};\r\n\r\nconvert.rgb.lab = function (rgb) {\r\n\tvar xyz = convert.rgb.xyz(rgb);\r\n\tvar x = xyz[0];\r\n\tvar y = xyz[1];\r\n\tvar z = xyz[2];\r\n\tvar l;\r\n\tvar a;\r\n\tvar b;\r\n\r\n\tx /= 95.047;\r\n\ty /= 100;\r\n\tz /= 108.883;\r\n\r\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\r\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\r\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\r\n\r\n\tl = (116 * y) - 16;\r\n\ta = 500 * (x - y);\r\n\tb = 200 * (y - z);\r\n\r\n\treturn [l, a, b];\r\n};\r\n\r\nconvert.hsl.rgb = function (hsl) {\r\n\tvar h = hsl[0] / 360;\r\n\tvar s = hsl[1] / 100;\r\n\tvar l = hsl[2] / 100;\r\n\tvar t1;\r\n\tvar t2;\r\n\tvar t3;\r\n\tvar rgb;\r\n\tvar val;\r\n\r\n\tif (s === 0) {\r\n\t\tval = l * 255;\r\n\t\treturn [val, val, val];\r\n\t}\r\n\r\n\tif (l < 0.5) {\r\n\t\tt2 = l * (1 + s);\r\n\t} else {\r\n\t\tt2 = l + s - l * s;\r\n\t}\r\n\r\n\tt1 = 2 * l - t2;\r\n\r\n\trgb = [0, 0, 0];\r\n\tfor (var i = 0; i < 3; i++) {\r\n\t\tt3 = h + 1 / 3 * -(i - 1);\r\n\t\tif (t3 < 0) {\r\n\t\t\tt3++;\r\n\t\t}\r\n\t\tif (t3 > 1) {\r\n\t\t\tt3--;\r\n\t\t}\r\n\r\n\t\tif (6 * t3 < 1) {\r\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\r\n\t\t} else if (2 * t3 < 1) {\r\n\t\t\tval = t2;\r\n\t\t} else if (3 * t3 < 2) {\r\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\r\n\t\t} else {\r\n\t\t\tval = t1;\r\n\t\t}\r\n\r\n\t\trgb[i] = val * 255;\r\n\t}\r\n\r\n\treturn rgb;\r\n};\r\n\r\nconvert.hsl.hsv = function (hsl) {\r\n\tvar h = hsl[0];\r\n\tvar s = hsl[1] / 100;\r\n\tvar l = hsl[2] / 100;\r\n\tvar smin = s;\r\n\tvar lmin = Math.max(l, 0.01);\r\n\tvar sv;\r\n\tvar v;\r\n\r\n\tl *= 2;\r\n\ts *= (l <= 1) ? l : 2 - l;\r\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\r\n\tv = (l + s) / 2;\r\n\tsv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\r\n\r\n\treturn [h, sv * 100, v * 100];\r\n};\r\n\r\nconvert.hsv.rgb = function (hsv) {\r\n\tvar h = hsv[0] / 60;\r\n\tvar s = hsv[1] / 100;\r\n\tvar v = hsv[2] / 100;\r\n\tvar hi = Math.floor(h) % 6;\r\n\r\n\tvar f = h - Math.floor(h);\r\n\tvar p = 255 * v * (1 - s);\r\n\tvar q = 255 * v * (1 - (s * f));\r\n\tvar t = 255 * v * (1 - (s * (1 - f)));\r\n\tv *= 255;\r\n\r\n\tswitch (hi) {\r\n\t\tcase 0:\r\n\t\t\treturn [v, t, p];\r\n\t\tcase 1:\r\n\t\t\treturn [q, v, p];\r\n\t\tcase 2:\r\n\t\t\treturn [p, v, t];\r\n\t\tcase 3:\r\n\t\t\treturn [p, q, v];\r\n\t\tcase 4:\r\n\t\t\treturn [t, p, v];\r\n\t\tcase 5:\r\n\t\t\treturn [v, p, q];\r\n\t}\r\n};\r\n\r\nconvert.hsv.hsl = function (hsv) {\r\n\tvar h = hsv[0];\r\n\tvar s = hsv[1] / 100;\r\n\tvar v = hsv[2] / 100;\r\n\tvar vmin = Math.max(v, 0.01);\r\n\tvar lmin;\r\n\tvar sl;\r\n\tvar l;\r\n\r\n\tl = (2 - s) * v;\r\n\tlmin = (2 - s) * vmin;\r\n\tsl = s * vmin;\r\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\r\n\tsl = sl || 0;\r\n\tl /= 2;\r\n\r\n\treturn [h, sl * 100, l * 100];\r\n};\r\n\r\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\r\nconvert.hwb.rgb = function (hwb) {\r\n\tvar h = hwb[0] / 360;\r\n\tvar wh = hwb[1] / 100;\r\n\tvar bl = hwb[2] / 100;\r\n\tvar ratio = wh + bl;\r\n\tvar i;\r\n\tvar v;\r\n\tvar f;\r\n\tvar n;\r\n\r\n\t// wh + bl cant be > 1\r\n\tif (ratio > 1) {\r\n\t\twh /= ratio;\r\n\t\tbl /= ratio;\r\n\t}\r\n\r\n\ti = Math.floor(6 * h);\r\n\tv = 1 - bl;\r\n\tf = 6 * h - i;\r\n\r\n\tif ((i & 0x01) !== 0) {\r\n\t\tf = 1 - f;\r\n\t}\r\n\r\n\tn = wh + f * (v - wh); // linear interpolation\r\n\r\n\tvar r;\r\n\tvar g;\r\n\tvar b;\r\n\tswitch (i) {\r\n\t\tdefault:\r\n\t\tcase 6:\r\n\t\tcase 0: r = v; g = n; b = wh; break;\r\n\t\tcase 1: r = n; g = v; b = wh; break;\r\n\t\tcase 2: r = wh; g = v; b = n; break;\r\n\t\tcase 3: r = wh; g = n; b = v; break;\r\n\t\tcase 4: r = n; g = wh; b = v; break;\r\n\t\tcase 5: r = v; g = wh; b = n; break;\r\n\t}\r\n\r\n\treturn [r * 255, g * 255, b * 255];\r\n};\r\n\r\nconvert.cmyk.rgb = function (cmyk) {\r\n\tvar c = cmyk[0] / 100;\r\n\tvar m = cmyk[1] / 100;\r\n\tvar y = cmyk[2] / 100;\r\n\tvar k = cmyk[3] / 100;\r\n\tvar r;\r\n\tvar g;\r\n\tvar b;\r\n\r\n\tr = 1 - Math.min(1, c * (1 - k) + k);\r\n\tg = 1 - Math.min(1, m * (1 - k) + k);\r\n\tb = 1 - Math.min(1, y * (1 - k) + k);\r\n\r\n\treturn [r * 255, g * 255, b * 255];\r\n};\r\n\r\nconvert.xyz.rgb = function (xyz) {\r\n\tvar x = xyz[0] / 100;\r\n\tvar y = xyz[1] / 100;\r\n\tvar z = xyz[2] / 100;\r\n\tvar r;\r\n\tvar g;\r\n\tvar b;\r\n\r\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\r\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\r\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\r\n\r\n\t// assume sRGB\r\n\tr = r > 0.0031308\r\n\t\t? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\r\n\t\t: r * 12.92;\r\n\r\n\tg = g > 0.0031308\r\n\t\t? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\r\n\t\t: g * 12.92;\r\n\r\n\tb = b > 0.0031308\r\n\t\t? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\r\n\t\t: b * 12.92;\r\n\r\n\tr = Math.min(Math.max(0, r), 1);\r\n\tg = Math.min(Math.max(0, g), 1);\r\n\tb = Math.min(Math.max(0, b), 1);\r\n\r\n\treturn [r * 255, g * 255, b * 255];\r\n};\r\n\r\nconvert.xyz.lab = function (xyz) {\r\n\tvar x = xyz[0];\r\n\tvar y = xyz[1];\r\n\tvar z = xyz[2];\r\n\tvar l;\r\n\tvar a;\r\n\tvar b;\r\n\r\n\tx /= 95.047;\r\n\ty /= 100;\r\n\tz /= 108.883;\r\n\r\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\r\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\r\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\r\n\r\n\tl = (116 * y) - 16;\r\n\ta = 500 * (x - y);\r\n\tb = 200 * (y - z);\r\n\r\n\treturn [l, a, b];\r\n};\r\n\r\nconvert.lab.xyz = function (lab) {\r\n\tvar l = lab[0];\r\n\tvar a = lab[1];\r\n\tvar b = lab[2];\r\n\tvar x;\r\n\tvar y;\r\n\tvar z;\r\n\r\n\ty = (l + 16) / 116;\r\n\tx = a / 500 + y;\r\n\tz = y - b / 200;\r\n\r\n\tvar y2 = Math.pow(y, 3);\r\n\tvar x2 = Math.pow(x, 3);\r\n\tvar z2 = Math.pow(z, 3);\r\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\r\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\r\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\r\n\r\n\tx *= 95.047;\r\n\ty *= 100;\r\n\tz *= 108.883;\r\n\r\n\treturn [x, y, z];\r\n};\r\n\r\nconvert.lab.lch = function (lab) {\r\n\tvar l = lab[0];\r\n\tvar a = lab[1];\r\n\tvar b = lab[2];\r\n\tvar hr;\r\n\tvar h;\r\n\tvar c;\r\n\r\n\thr = Math.atan2(b, a);\r\n\th = hr * 360 / 2 / Math.PI;\r\n\r\n\tif (h < 0) {\r\n\t\th += 360;\r\n\t}\r\n\r\n\tc = Math.sqrt(a * a + b * b);\r\n\r\n\treturn [l, c, h];\r\n};\r\n\r\nconvert.lch.lab = function (lch) {\r\n\tvar l = lch[0];\r\n\tvar c = lch[1];\r\n\tvar h = lch[2];\r\n\tvar a;\r\n\tvar b;\r\n\tvar hr;\r\n\r\n\thr = h / 360 * 2 * Math.PI;\r\n\ta = c * Math.cos(hr);\r\n\tb = c * Math.sin(hr);\r\n\r\n\treturn [l, a, b];\r\n};\r\n\r\nconvert.rgb.ansi16 = function (args) {\r\n\tvar r = args[0];\r\n\tvar g = args[1];\r\n\tvar b = args[2];\r\n\tvar value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization\r\n\r\n\tvalue = Math.round(value / 50);\r\n\r\n\tif (value === 0) {\r\n\t\treturn 30;\r\n\t}\r\n\r\n\tvar ansi = 30\r\n\t\t+ ((Math.round(b / 255) << 2)\r\n\t\t| (Math.round(g / 255) << 1)\r\n\t\t| Math.round(r / 255));\r\n\r\n\tif (value === 2) {\r\n\t\tansi += 60;\r\n\t}\r\n\r\n\treturn ansi;\r\n};\r\n\r\nconvert.hsv.ansi16 = function (args) {\r\n\t// optimization here; we already know the value and don't need to get\r\n\t// it converted for us.\r\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\r\n};\r\n\r\nconvert.rgb.ansi256 = function (args) {\r\n\tvar r = args[0];\r\n\tvar g = args[1];\r\n\tvar b = args[2];\r\n\r\n\t// we use the extended greyscale palette here, with the exception of\r\n\t// black and white. normal palette only has 4 greyscale shades.\r\n\tif (r === g && g === b) {\r\n\t\tif (r < 8) {\r\n\t\t\treturn 16;\r\n\t\t}\r\n\r\n\t\tif (r > 248) {\r\n\t\t\treturn 231;\r\n\t\t}\r\n\r\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\r\n\t}\r\n\r\n\tvar ansi = 16\r\n\t\t+ (36 * Math.round(r / 255 * 5))\r\n\t\t+ (6 * Math.round(g / 255 * 5))\r\n\t\t+ Math.round(b / 255 * 5);\r\n\r\n\treturn ansi;\r\n};\r\n\r\nconvert.ansi16.rgb = function (args) {\r\n\tvar color = args % 10;\r\n\r\n\t// handle greyscale\r\n\tif (color === 0 || color === 7) {\r\n\t\tif (args > 50) {\r\n\t\t\tcolor += 3.5;\r\n\t\t}\r\n\r\n\t\tcolor = color / 10.5 * 255;\r\n\r\n\t\treturn [color, color, color];\r\n\t}\r\n\r\n\tvar mult = (~~(args > 50) + 1) * 0.5;\r\n\tvar r = ((color & 1) * mult) * 255;\r\n\tvar g = (((color >> 1) & 1) * mult) * 255;\r\n\tvar b = (((color >> 2) & 1) * mult) * 255;\r\n\r\n\treturn [r, g, b];\r\n};\r\n\r\nconvert.ansi256.rgb = function (args) {\r\n\t// handle greyscale\r\n\tif (args >= 232) {\r\n\t\tvar c = (args - 232) * 10 + 8;\r\n\t\treturn [c, c, c];\r\n\t}\r\n\r\n\targs -= 16;\r\n\r\n\tvar rem;\r\n\tvar r = Math.floor(args / 36) / 5 * 255;\r\n\tvar g = Math.floor((rem = args % 36) / 6) / 5 * 255;\r\n\tvar b = (rem % 6) / 5 * 255;\r\n\r\n\treturn [r, g, b];\r\n};\r\n\r\nconvert.rgb.hex = function (args) {\r\n\tvar integer = ((Math.round(args[0]) & 0xFF) << 16)\r\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\r\n\t\t+ (Math.round(args[2]) & 0xFF);\r\n\r\n\tvar string = integer.toString(16).toUpperCase();\r\n\treturn '000000'.substring(string.length) + string;\r\n};\r\n\r\nconvert.hex.rgb = function (args) {\r\n\tvar match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\r\n\tif (!match) {\r\n\t\treturn [0, 0, 0];\r\n\t}\r\n\r\n\tvar colorString = match[0];\r\n\r\n\tif (match[0].length === 3) {\r\n\t\tcolorString = colorString.split('').map(function (char) {\r\n\t\t\treturn char + char;\r\n\t\t}).join('');\r\n\t}\r\n\r\n\tvar integer = parseInt(colorString, 16);\r\n\tvar r = (integer >> 16) & 0xFF;\r\n\tvar g = (integer >> 8) & 0xFF;\r\n\tvar b = integer & 0xFF;\r\n\r\n\treturn [r, g, b];\r\n};\r\n\r\nconvert.rgb.hcg = function (rgb) {\r\n\tvar r = rgb[0] / 255;\r\n\tvar g = rgb[1] / 255;\r\n\tvar b = rgb[2] / 255;\r\n\tvar max = Math.max(Math.max(r, g), b);\r\n\tvar min = Math.min(Math.min(r, g), b);\r\n\tvar chroma = (max - min);\r\n\tvar grayscale;\r\n\tvar hue;\r\n\r\n\tif (chroma < 1) {\r\n\t\tgrayscale = min / (1 - chroma);\r\n\t} else {\r\n\t\tgrayscale = 0;\r\n\t}\r\n\r\n\tif (chroma <= 0) {\r\n\t\thue = 0;\r\n\t} else\r\n\tif (max === r) {\r\n\t\thue = ((g - b) / chroma) % 6;\r\n\t} else\r\n\tif (max === g) {\r\n\t\thue = 2 + (b - r) / chroma;\r\n\t} else {\r\n\t\thue = 4 + (r - g) / chroma + 4;\r\n\t}\r\n\r\n\thue /= 6;\r\n\thue %= 1;\r\n\r\n\treturn [hue * 360, chroma * 100, grayscale * 100];\r\n};\r\n\r\nconvert.hsl.hcg = function (hsl) {\r\n\tvar s = hsl[1] / 100;\r\n\tvar l = hsl[2] / 100;\r\n\tvar c = 1;\r\n\tvar f = 0;\r\n\r\n\tif (l < 0.5) {\r\n\t\tc = 2.0 * s * l;\r\n\t} else {\r\n\t\tc = 2.0 * s * (1.0 - l);\r\n\t}\r\n\r\n\tif (c < 1.0) {\r\n\t\tf = (l - 0.5 * c) / (1.0 - c);\r\n\t}\r\n\r\n\treturn [hsl[0], c * 100, f * 100];\r\n};\r\n\r\nconvert.hsv.hcg = function (hsv) {\r\n\tvar s = hsv[1] / 100;\r\n\tvar v = hsv[2] / 100;\r\n\r\n\tvar c = s * v;\r\n\tvar f = 0;\r\n\r\n\tif (c < 1.0) {\r\n\t\tf = (v - c) / (1 - c);\r\n\t}\r\n\r\n\treturn [hsv[0], c * 100, f * 100];\r\n};\r\n\r\nconvert.hcg.rgb = function (hcg) {\r\n\tvar h = hcg[0] / 360;\r\n\tvar c = hcg[1] / 100;\r\n\tvar g = hcg[2] / 100;\r\n\r\n\tif (c === 0.0) {\r\n\t\treturn [g * 255, g * 255, g * 255];\r\n\t}\r\n\r\n\tvar pure = [0, 0, 0];\r\n\tvar hi = (h % 1) * 6;\r\n\tvar v = hi % 1;\r\n\tvar w = 1 - v;\r\n\tvar mg = 0;\r\n\r\n\tswitch (Math.floor(hi)) {\r\n\t\tcase 0:\r\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\r\n\t\tcase 1:\r\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\r\n\t\tcase 2:\r\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\r\n\t\tcase 3:\r\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\r\n\t\tcase 4:\r\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\r\n\t\tdefault:\r\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\r\n\t}\r\n\r\n\tmg = (1.0 - c) * g;\r\n\r\n\treturn [\r\n\t\t(c * pure[0] + mg) * 255,\r\n\t\t(c * pure[1] + mg) * 255,\r\n\t\t(c * pure[2] + mg) * 255\r\n\t];\r\n};\r\n\r\nconvert.hcg.hsv = function (hcg) {\r\n\tvar c = hcg[1] / 100;\r\n\tvar g = hcg[2] / 100;\r\n\r\n\tvar v = c + g * (1.0 - c);\r\n\tvar f = 0;\r\n\r\n\tif (v > 0.0) {\r\n\t\tf = c / v;\r\n\t}\r\n\r\n\treturn [hcg[0], f * 100, v * 100];\r\n};\r\n\r\nconvert.hcg.hsl = function (hcg) {\r\n\tvar c = hcg[1] / 100;\r\n\tvar g = hcg[2] / 100;\r\n\r\n\tvar l = g * (1.0 - c) + 0.5 * c;\r\n\tvar s = 0;\r\n\r\n\tif (l > 0.0 && l < 0.5) {\r\n\t\ts = c / (2 * l);\r\n\t} else\r\n\tif (l >= 0.5 && l < 1.0) {\r\n\t\ts = c / (2 * (1 - l));\r\n\t}\r\n\r\n\treturn [hcg[0], s * 100, l * 100];\r\n};\r\n\r\nconvert.hcg.hwb = function (hcg) {\r\n\tvar c = hcg[1] / 100;\r\n\tvar g = hcg[2] / 100;\r\n\tvar v = c + g * (1.0 - c);\r\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\r\n};\r\n\r\nconvert.hwb.hcg = function (hwb) {\r\n\tvar w = hwb[1] / 100;\r\n\tvar b = hwb[2] / 100;\r\n\tvar v = 1 - b;\r\n\tvar c = v - w;\r\n\tvar g = 0;\r\n\r\n\tif (c < 1) {\r\n\t\tg = (v - c) / (1 - c);\r\n\t}\r\n\r\n\treturn [hwb[0], c * 100, g * 100];\r\n};\r\n\r\nconvert.apple.rgb = function (apple) {\r\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\r\n};\r\n\r\nconvert.rgb.apple = function (rgb) {\r\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\r\n};\r\n\r\nconvert.gray.rgb = function (args) {\r\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\r\n};\r\n\r\nconvert.gray.hsl = convert.gray.hsv = function (args) {\r\n\treturn [0, 0, args[0]];\r\n};\r\n\r\nconvert.gray.hwb = function (gray) {\r\n\treturn [0, 100, gray[0]];\r\n};\r\n\r\nconvert.gray.cmyk = function (gray) {\r\n\treturn [0, 0, 0, gray[0]];\r\n};\r\n\r\nconvert.gray.lab = function (gray) {\r\n\treturn [gray[0], 0, 0];\r\n};\r\n\r\nconvert.gray.hex = function (gray) {\r\n\tvar val = Math.round(gray[0] / 100 * 255) & 0xFF;\r\n\tvar integer = (val << 16) + (val << 8) + val;\r\n\r\n\tvar string = integer.toString(16).toUpperCase();\r\n\treturn '000000'.substring(string.length) + string;\r\n};\r\n\r\nconvert.rgb.gray = function (rgb) {\r\n\tvar val = (rgb[0] + rgb[1] + rgb[2]) / 3;\r\n\treturn [val / 255 * 100];\r\n};\r\n});\r\nvar conversions_1 = conversions.rgb;\r\nvar conversions_2 = conversions.hsl;\r\nvar conversions_3 = conversions.hsv;\r\nvar conversions_4 = conversions.hwb;\r\nvar conversions_5 = conversions.cmyk;\r\nvar conversions_6 = conversions.xyz;\r\nvar conversions_7 = conversions.lab;\r\nvar conversions_8 = conversions.lch;\r\nvar conversions_9 = conversions.hex;\r\nvar conversions_10 = conversions.keyword;\r\nvar conversions_11 = conversions.ansi16;\r\nvar conversions_12 = conversions.ansi256;\r\nvar conversions_13 = conversions.hcg;\r\nvar conversions_14 = conversions.apple;\r\nvar conversions_15 = conversions.gray;\r\n\r\n/*\r\n\tthis function routes a model to all other models.\r\n\r\n\tall functions that are routed have a property `.conversion` attached\r\n\tto the returned synthetic function. This property is an array\r\n\tof strings, each with the steps in between the 'from' and 'to'\r\n\tcolor models (inclusive).\r\n\r\n\tconversions that are not possible simply are not included.\r\n*/\r\n\r\nfunction buildGraph() {\r\n\tvar graph = {};\r\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\r\n\tvar models = Object.keys(conversions);\r\n\r\n\tfor (var len = models.length, i = 0; i < len; i++) {\r\n\t\tgraph[models[i]] = {\r\n\t\t\t// http://jsperf.com/1-vs-infinity\r\n\t\t\t// micro-opt, but this is simple.\r\n\t\t\tdistance: -1,\r\n\t\t\tparent: null\r\n\t\t};\r\n\t}\r\n\r\n\treturn graph;\r\n}\r\n\r\n// https://en.wikipedia.org/wiki/Breadth-first_search\r\nfunction deriveBFS(fromModel) {\r\n\tvar graph = buildGraph();\r\n\tvar queue = [fromModel]; // unshift -> queue -> pop\r\n\r\n\tgraph[fromModel].distance = 0;\r\n\r\n\twhile (queue.length) {\r\n\t\tvar current = queue.pop();\r\n\t\tvar adjacents = Object.keys(conversions[current]);\r\n\r\n\t\tfor (var len = adjacents.length, i = 0; i < len; i++) {\r\n\t\t\tvar adjacent = adjacents[i];\r\n\t\t\tvar node = graph[adjacent];\r\n\r\n\t\t\tif (node.distance === -1) {\r\n\t\t\t\tnode.distance = graph[current].distance + 1;\r\n\t\t\t\tnode.parent = current;\r\n\t\t\t\tqueue.unshift(adjacent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn graph;\r\n}\r\n\r\nfunction link(from, to) {\r\n\treturn function (args) {\r\n\t\treturn to(from(args));\r\n\t};\r\n}\r\n\r\nfunction wrapConversion(toModel, graph) {\r\n\tvar path = [graph[toModel].parent, toModel];\r\n\tvar fn = conversions[graph[toModel].parent][toModel];\r\n\r\n\tvar cur = graph[toModel].parent;\r\n\twhile (graph[cur].parent) {\r\n\t\tpath.unshift(graph[cur].parent);\r\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\r\n\t\tcur = graph[cur].parent;\r\n\t}\r\n\r\n\tfn.conversion = path;\r\n\treturn fn;\r\n}\r\n\r\nvar route = function (fromModel) {\r\n\tvar graph = deriveBFS(fromModel);\r\n\tvar conversion = {};\r\n\r\n\tvar models = Object.keys(graph);\r\n\tfor (var len = models.length, i = 0; i < len; i++) {\r\n\t\tvar toModel = models[i];\r\n\t\tvar node = graph[toModel];\r\n\r\n\t\tif (node.parent === null) {\r\n\t\t\t// no possible conversion, or this node is the source model.\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\r\n\t}\r\n\r\n\treturn conversion;\r\n};\r\n\r\nvar convert = {};\r\n\r\nvar models = Object.keys(conversions);\r\n\r\nfunction wrapRaw(fn) {\r\n\tvar wrappedFn = function (args) {\r\n\t\tif (args === undefined || args === null) {\r\n\t\t\treturn args;\r\n\t\t}\r\n\r\n\t\tif (arguments.length > 1) {\r\n\t\t\targs = Array.prototype.slice.call(arguments);\r\n\t\t}\r\n\r\n\t\treturn fn(args);\r\n\t};\r\n\r\n\t// preserve .conversion property if there is one\r\n\tif ('conversion' in fn) {\r\n\t\twrappedFn.conversion = fn.conversion;\r\n\t}\r\n\r\n\treturn wrappedFn;\r\n}\r\n\r\nfunction wrapRounded(fn) {\r\n\tvar wrappedFn = function (args) {\r\n\t\tif (args === undefined || args === null) {\r\n\t\t\treturn args;\r\n\t\t}\r\n\r\n\t\tif (arguments.length > 1) {\r\n\t\t\targs = Array.prototype.slice.call(arguments);\r\n\t\t}\r\n\r\n\t\tvar result = fn(args);\r\n\r\n\t\t// we're assuming the result is an array here.\r\n\t\t// see notice in conversions.js; don't use box types\r\n\t\t// in conversion functions.\r\n\t\tif (typeof result === 'object') {\r\n\t\t\tfor (var len = result.length, i = 0; i < len; i++) {\r\n\t\t\t\tresult[i] = Math.round(result[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\r\n\t// preserve .conversion property if there is one\r\n\tif ('conversion' in fn) {\r\n\t\twrappedFn.conversion = fn.conversion;\r\n\t}\r\n\r\n\treturn wrappedFn;\r\n}\r\n\r\nmodels.forEach(function (fromModel) {\r\n\tconvert[fromModel] = {};\r\n\r\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\r\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\r\n\r\n\tvar routes = route(fromModel);\r\n\tvar routeModels = Object.keys(routes);\r\n\r\n\trouteModels.forEach(function (toModel) {\r\n\t\tvar fn = routes[toModel];\r\n\r\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\r\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\r\n\t});\r\n});\r\n\r\nvar colorConvert = convert;\r\n\r\nvar colorName$1 = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n\r\n/* MIT license */\r\n\r\n\r\nvar colorString = {\r\n getRgba: getRgba,\r\n getHsla: getHsla,\r\n getRgb: getRgb,\r\n getHsl: getHsl,\r\n getHwb: getHwb,\r\n getAlpha: getAlpha,\r\n\r\n hexString: hexString,\r\n rgbString: rgbString,\r\n rgbaString: rgbaString,\r\n percentString: percentString,\r\n percentaString: percentaString,\r\n hslString: hslString,\r\n hslaString: hslaString,\r\n hwbString: hwbString,\r\n keyword: keyword\r\n};\r\n\r\nfunction getRgba(string) {\r\n if (!string) {\r\n return;\r\n }\r\n var abbr = /^#([a-fA-F0-9]{3,4})$/i,\r\n hex = /^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,\r\n rgba = /^rgba?\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\r\n per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\r\n keyword = /(\\w+)/;\r\n\r\n var rgb = [0, 0, 0],\r\n a = 1,\r\n match = string.match(abbr),\r\n hexAlpha = \"\";\r\n if (match) {\r\n match = match[1];\r\n hexAlpha = match[3];\r\n for (var i = 0; i < rgb.length; i++) {\r\n rgb[i] = parseInt(match[i] + match[i], 16);\r\n }\r\n if (hexAlpha) {\r\n a = Math.round((parseInt(hexAlpha + hexAlpha, 16) / 255) * 100) / 100;\r\n }\r\n }\r\n else if (match = string.match(hex)) {\r\n hexAlpha = match[2];\r\n match = match[1];\r\n for (var i = 0; i < rgb.length; i++) {\r\n rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);\r\n }\r\n if (hexAlpha) {\r\n a = Math.round((parseInt(hexAlpha, 16) / 255) * 100) / 100;\r\n }\r\n }\r\n else if (match = string.match(rgba)) {\r\n for (var i = 0; i < rgb.length; i++) {\r\n rgb[i] = parseInt(match[i + 1]);\r\n }\r\n a = parseFloat(match[4]);\r\n }\r\n else if (match = string.match(per)) {\r\n for (var i = 0; i < rgb.length; i++) {\r\n rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\r\n }\r\n a = parseFloat(match[4]);\r\n }\r\n else if (match = string.match(keyword)) {\r\n if (match[1] == \"transparent\") {\r\n return [0, 0, 0, 0];\r\n }\r\n rgb = colorName$1[match[1]];\r\n if (!rgb) {\r\n return;\r\n }\r\n }\r\n\r\n for (var i = 0; i < rgb.length; i++) {\r\n rgb[i] = scale(rgb[i], 0, 255);\r\n }\r\n if (!a && a != 0) {\r\n a = 1;\r\n }\r\n else {\r\n a = scale(a, 0, 1);\r\n }\r\n rgb[3] = a;\r\n return rgb;\r\n}\r\n\r\nfunction getHsla(string) {\r\n if (!string) {\r\n return;\r\n }\r\n var hsl = /^hsla?\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\r\n var match = string.match(hsl);\r\n if (match) {\r\n var alpha = parseFloat(match[4]);\r\n var h = scale(parseInt(match[1]), 0, 360),\r\n s = scale(parseFloat(match[2]), 0, 100),\r\n l = scale(parseFloat(match[3]), 0, 100),\r\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\r\n return [h, s, l, a];\r\n }\r\n}\r\n\r\nfunction getHwb(string) {\r\n if (!string) {\r\n return;\r\n }\r\n var hwb = /^hwb\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\r\n var match = string.match(hwb);\r\n if (match) {\r\n var alpha = parseFloat(match[4]);\r\n var h = scale(parseInt(match[1]), 0, 360),\r\n w = scale(parseFloat(match[2]), 0, 100),\r\n b = scale(parseFloat(match[3]), 0, 100),\r\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\r\n return [h, w, b, a];\r\n }\r\n}\r\n\r\nfunction getRgb(string) {\r\n var rgba = getRgba(string);\r\n return rgba && rgba.slice(0, 3);\r\n}\r\n\r\nfunction getHsl(string) {\r\n var hsla = getHsla(string);\r\n return hsla && hsla.slice(0, 3);\r\n}\r\n\r\nfunction getAlpha(string) {\r\n var vals = getRgba(string);\r\n if (vals) {\r\n return vals[3];\r\n }\r\n else if (vals = getHsla(string)) {\r\n return vals[3];\r\n }\r\n else if (vals = getHwb(string)) {\r\n return vals[3];\r\n }\r\n}\r\n\r\n// generators\r\nfunction hexString(rgba, a) {\r\n var a = (a !== undefined && rgba.length === 3) ? a : rgba[3];\r\n return \"#\" + hexDouble(rgba[0]) \r\n + hexDouble(rgba[1])\r\n + hexDouble(rgba[2])\r\n + (\r\n (a >= 0 && a < 1)\r\n ? hexDouble(Math.round(a * 255))\r\n : \"\"\r\n );\r\n}\r\n\r\nfunction rgbString(rgba, alpha) {\r\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\r\n return rgbaString(rgba, alpha);\r\n }\r\n return \"rgb(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2] + \")\";\r\n}\r\n\r\nfunction rgbaString(rgba, alpha) {\r\n if (alpha === undefined) {\r\n alpha = (rgba[3] !== undefined ? rgba[3] : 1);\r\n }\r\n return \"rgba(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2]\r\n + \", \" + alpha + \")\";\r\n}\r\n\r\nfunction percentString(rgba, alpha) {\r\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\r\n return percentaString(rgba, alpha);\r\n }\r\n var r = Math.round(rgba[0]/255 * 100),\r\n g = Math.round(rgba[1]/255 * 100),\r\n b = Math.round(rgba[2]/255 * 100);\r\n\r\n return \"rgb(\" + r + \"%, \" + g + \"%, \" + b + \"%)\";\r\n}\r\n\r\nfunction percentaString(rgba, alpha) {\r\n var r = Math.round(rgba[0]/255 * 100),\r\n g = Math.round(rgba[1]/255 * 100),\r\n b = Math.round(rgba[2]/255 * 100);\r\n return \"rgba(\" + r + \"%, \" + g + \"%, \" + b + \"%, \" + (alpha || rgba[3] || 1) + \")\";\r\n}\r\n\r\nfunction hslString(hsla, alpha) {\r\n if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {\r\n return hslaString(hsla, alpha);\r\n }\r\n return \"hsl(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%)\";\r\n}\r\n\r\nfunction hslaString(hsla, alpha) {\r\n if (alpha === undefined) {\r\n alpha = (hsla[3] !== undefined ? hsla[3] : 1);\r\n }\r\n return \"hsla(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%, \"\r\n + alpha + \")\";\r\n}\r\n\r\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\r\n// (hwb have alpha optional & 1 is default value)\r\nfunction hwbString(hwb, alpha) {\r\n if (alpha === undefined) {\r\n alpha = (hwb[3] !== undefined ? hwb[3] : 1);\r\n }\r\n return \"hwb(\" + hwb[0] + \", \" + hwb[1] + \"%, \" + hwb[2] + \"%\"\r\n + (alpha !== undefined && alpha !== 1 ? \", \" + alpha : \"\") + \")\";\r\n}\r\n\r\nfunction keyword(rgb) {\r\n return reverseNames[rgb.slice(0, 3)];\r\n}\r\n\r\n// helpers\r\nfunction scale(num, min, max) {\r\n return Math.min(Math.max(min, num), max);\r\n}\r\n\r\nfunction hexDouble(num) {\r\n var str = num.toString(16).toUpperCase();\r\n return (str.length < 2) ? \"0\" + str : str;\r\n}\r\n\r\n\r\n//create a list of reverse color names\r\nvar reverseNames = {};\r\nfor (var name in colorName$1) {\r\n reverseNames[colorName$1[name]] = name;\r\n}\r\n\r\n/* MIT license */\r\n\r\n\r\n\r\nvar Color = function (obj) {\r\n\tif (obj instanceof Color) {\r\n\t\treturn obj;\r\n\t}\r\n\tif (!(this instanceof Color)) {\r\n\t\treturn new Color(obj);\r\n\t}\r\n\r\n\tthis.valid = false;\r\n\tthis.values = {\r\n\t\trgb: [0, 0, 0],\r\n\t\thsl: [0, 0, 0],\r\n\t\thsv: [0, 0, 0],\r\n\t\thwb: [0, 0, 0],\r\n\t\tcmyk: [0, 0, 0, 0],\r\n\t\talpha: 1\r\n\t};\r\n\r\n\t// parse Color() argument\r\n\tvar vals;\r\n\tif (typeof obj === 'string') {\r\n\t\tvals = colorString.getRgba(obj);\r\n\t\tif (vals) {\r\n\t\t\tthis.setValues('rgb', vals);\r\n\t\t} else if (vals = colorString.getHsla(obj)) {\r\n\t\t\tthis.setValues('hsl', vals);\r\n\t\t} else if (vals = colorString.getHwb(obj)) {\r\n\t\t\tthis.setValues('hwb', vals);\r\n\t\t}\r\n\t} else if (typeof obj === 'object') {\r\n\t\tvals = obj;\r\n\t\tif (vals.r !== undefined || vals.red !== undefined) {\r\n\t\t\tthis.setValues('rgb', vals);\r\n\t\t} else if (vals.l !== undefined || vals.lightness !== undefined) {\r\n\t\t\tthis.setValues('hsl', vals);\r\n\t\t} else if (vals.v !== undefined || vals.value !== undefined) {\r\n\t\t\tthis.setValues('hsv', vals);\r\n\t\t} else if (vals.w !== undefined || vals.whiteness !== undefined) {\r\n\t\t\tthis.setValues('hwb', vals);\r\n\t\t} else if (vals.c !== undefined || vals.cyan !== undefined) {\r\n\t\t\tthis.setValues('cmyk', vals);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nColor.prototype = {\r\n\tisValid: function () {\r\n\t\treturn this.valid;\r\n\t},\r\n\trgb: function () {\r\n\t\treturn this.setSpace('rgb', arguments);\r\n\t},\r\n\thsl: function () {\r\n\t\treturn this.setSpace('hsl', arguments);\r\n\t},\r\n\thsv: function () {\r\n\t\treturn this.setSpace('hsv', arguments);\r\n\t},\r\n\thwb: function () {\r\n\t\treturn this.setSpace('hwb', arguments);\r\n\t},\r\n\tcmyk: function () {\r\n\t\treturn this.setSpace('cmyk', arguments);\r\n\t},\r\n\r\n\trgbArray: function () {\r\n\t\treturn this.values.rgb;\r\n\t},\r\n\thslArray: function () {\r\n\t\treturn this.values.hsl;\r\n\t},\r\n\thsvArray: function () {\r\n\t\treturn this.values.hsv;\r\n\t},\r\n\thwbArray: function () {\r\n\t\tvar values = this.values;\r\n\t\tif (values.alpha !== 1) {\r\n\t\t\treturn values.hwb.concat([values.alpha]);\r\n\t\t}\r\n\t\treturn values.hwb;\r\n\t},\r\n\tcmykArray: function () {\r\n\t\treturn this.values.cmyk;\r\n\t},\r\n\trgbaArray: function () {\r\n\t\tvar values = this.values;\r\n\t\treturn values.rgb.concat([values.alpha]);\r\n\t},\r\n\thslaArray: function () {\r\n\t\tvar values = this.values;\r\n\t\treturn values.hsl.concat([values.alpha]);\r\n\t},\r\n\talpha: function (val) {\r\n\t\tif (val === undefined) {\r\n\t\t\treturn this.values.alpha;\r\n\t\t}\r\n\t\tthis.setValues('alpha', val);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tred: function (val) {\r\n\t\treturn this.setChannel('rgb', 0, val);\r\n\t},\r\n\tgreen: function (val) {\r\n\t\treturn this.setChannel('rgb', 1, val);\r\n\t},\r\n\tblue: function (val) {\r\n\t\treturn this.setChannel('rgb', 2, val);\r\n\t},\r\n\thue: function (val) {\r\n\t\tif (val) {\r\n\t\t\tval %= 360;\r\n\t\t\tval = val < 0 ? 360 + val : val;\r\n\t\t}\r\n\t\treturn this.setChannel('hsl', 0, val);\r\n\t},\r\n\tsaturation: function (val) {\r\n\t\treturn this.setChannel('hsl', 1, val);\r\n\t},\r\n\tlightness: function (val) {\r\n\t\treturn this.setChannel('hsl', 2, val);\r\n\t},\r\n\tsaturationv: function (val) {\r\n\t\treturn this.setChannel('hsv', 1, val);\r\n\t},\r\n\twhiteness: function (val) {\r\n\t\treturn this.setChannel('hwb', 1, val);\r\n\t},\r\n\tblackness: function (val) {\r\n\t\treturn this.setChannel('hwb', 2, val);\r\n\t},\r\n\tvalue: function (val) {\r\n\t\treturn this.setChannel('hsv', 2, val);\r\n\t},\r\n\tcyan: function (val) {\r\n\t\treturn this.setChannel('cmyk', 0, val);\r\n\t},\r\n\tmagenta: function (val) {\r\n\t\treturn this.setChannel('cmyk', 1, val);\r\n\t},\r\n\tyellow: function (val) {\r\n\t\treturn this.setChannel('cmyk', 2, val);\r\n\t},\r\n\tblack: function (val) {\r\n\t\treturn this.setChannel('cmyk', 3, val);\r\n\t},\r\n\r\n\thexString: function () {\r\n\t\treturn colorString.hexString(this.values.rgb);\r\n\t},\r\n\trgbString: function () {\r\n\t\treturn colorString.rgbString(this.values.rgb, this.values.alpha);\r\n\t},\r\n\trgbaString: function () {\r\n\t\treturn colorString.rgbaString(this.values.rgb, this.values.alpha);\r\n\t},\r\n\tpercentString: function () {\r\n\t\treturn colorString.percentString(this.values.rgb, this.values.alpha);\r\n\t},\r\n\thslString: function () {\r\n\t\treturn colorString.hslString(this.values.hsl, this.values.alpha);\r\n\t},\r\n\thslaString: function () {\r\n\t\treturn colorString.hslaString(this.values.hsl, this.values.alpha);\r\n\t},\r\n\thwbString: function () {\r\n\t\treturn colorString.hwbString(this.values.hwb, this.values.alpha);\r\n\t},\r\n\tkeyword: function () {\r\n\t\treturn colorString.keyword(this.values.rgb, this.values.alpha);\r\n\t},\r\n\r\n\trgbNumber: function () {\r\n\t\tvar rgb = this.values.rgb;\r\n\t\treturn (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];\r\n\t},\r\n\r\n\tluminosity: function () {\r\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\r\n\t\tvar rgb = this.values.rgb;\r\n\t\tvar lum = [];\r\n\t\tfor (var i = 0; i < rgb.length; i++) {\r\n\t\t\tvar chan = rgb[i] / 255;\r\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\r\n\t\t}\r\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\r\n\t},\r\n\r\n\tcontrast: function (color2) {\r\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\r\n\t\tvar lum1 = this.luminosity();\r\n\t\tvar lum2 = color2.luminosity();\r\n\t\tif (lum1 > lum2) {\r\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\r\n\t\t}\r\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\r\n\t},\r\n\r\n\tlevel: function (color2) {\r\n\t\tvar contrastRatio = this.contrast(color2);\r\n\t\tif (contrastRatio >= 7.1) {\r\n\t\t\treturn 'AAA';\r\n\t\t}\r\n\r\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\r\n\t},\r\n\r\n\tdark: function () {\r\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\r\n\t\tvar rgb = this.values.rgb;\r\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\r\n\t\treturn yiq < 128;\r\n\t},\r\n\r\n\tlight: function () {\r\n\t\treturn !this.dark();\r\n\t},\r\n\r\n\tnegate: function () {\r\n\t\tvar rgb = [];\r\n\t\tfor (var i = 0; i < 3; i++) {\r\n\t\t\trgb[i] = 255 - this.values.rgb[i];\r\n\t\t}\r\n\t\tthis.setValues('rgb', rgb);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tlighten: function (ratio) {\r\n\t\tvar hsl = this.values.hsl;\r\n\t\thsl[2] += hsl[2] * ratio;\r\n\t\tthis.setValues('hsl', hsl);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tdarken: function (ratio) {\r\n\t\tvar hsl = this.values.hsl;\r\n\t\thsl[2] -= hsl[2] * ratio;\r\n\t\tthis.setValues('hsl', hsl);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tsaturate: function (ratio) {\r\n\t\tvar hsl = this.values.hsl;\r\n\t\thsl[1] += hsl[1] * ratio;\r\n\t\tthis.setValues('hsl', hsl);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tdesaturate: function (ratio) {\r\n\t\tvar hsl = this.values.hsl;\r\n\t\thsl[1] -= hsl[1] * ratio;\r\n\t\tthis.setValues('hsl', hsl);\r\n\t\treturn this;\r\n\t},\r\n\r\n\twhiten: function (ratio) {\r\n\t\tvar hwb = this.values.hwb;\r\n\t\thwb[1] += hwb[1] * ratio;\r\n\t\tthis.setValues('hwb', hwb);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tblacken: function (ratio) {\r\n\t\tvar hwb = this.values.hwb;\r\n\t\thwb[2] += hwb[2] * ratio;\r\n\t\tthis.setValues('hwb', hwb);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tgreyscale: function () {\r\n\t\tvar rgb = this.values.rgb;\r\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\r\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\r\n\t\tthis.setValues('rgb', [val, val, val]);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tclearer: function (ratio) {\r\n\t\tvar alpha = this.values.alpha;\r\n\t\tthis.setValues('alpha', alpha - (alpha * ratio));\r\n\t\treturn this;\r\n\t},\r\n\r\n\topaquer: function (ratio) {\r\n\t\tvar alpha = this.values.alpha;\r\n\t\tthis.setValues('alpha', alpha + (alpha * ratio));\r\n\t\treturn this;\r\n\t},\r\n\r\n\trotate: function (degrees) {\r\n\t\tvar hsl = this.values.hsl;\r\n\t\tvar hue = (hsl[0] + degrees) % 360;\r\n\t\thsl[0] = hue < 0 ? 360 + hue : hue;\r\n\t\tthis.setValues('hsl', hsl);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Ported from sass implementation in C\r\n\t * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\r\n\t */\r\n\tmix: function (mixinColor, weight) {\r\n\t\tvar color1 = this;\r\n\t\tvar color2 = mixinColor;\r\n\t\tvar p = weight === undefined ? 0.5 : weight;\r\n\r\n\t\tvar w = 2 * p - 1;\r\n\t\tvar a = color1.alpha() - color2.alpha();\r\n\r\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\r\n\t\tvar w2 = 1 - w1;\r\n\r\n\t\treturn this\r\n\t\t\t.rgb(\r\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\r\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\r\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue()\r\n\t\t\t)\r\n\t\t\t.alpha(color1.alpha() * p + color2.alpha() * (1 - p));\r\n\t},\r\n\r\n\ttoJSON: function () {\r\n\t\treturn this.rgb();\r\n\t},\r\n\r\n\tclone: function () {\r\n\t\t// NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,\r\n\t\t// making the final build way to big to embed in Chart.js. So let's do it manually,\r\n\t\t// assuming that values to clone are 1 dimension arrays containing only numbers,\r\n\t\t// except 'alpha' which is a number.\r\n\t\tvar result = new Color();\r\n\t\tvar source = this.values;\r\n\t\tvar target = result.values;\r\n\t\tvar value, type;\r\n\r\n\t\tfor (var prop in source) {\r\n\t\t\tif (source.hasOwnProperty(prop)) {\r\n\t\t\t\tvalue = source[prop];\r\n\t\t\t\ttype = ({}).toString.call(value);\r\n\t\t\t\tif (type === '[object Array]') {\r\n\t\t\t\t\ttarget[prop] = value.slice(0);\r\n\t\t\t\t} else if (type === '[object Number]') {\r\n\t\t\t\t\ttarget[prop] = value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconsole.error('unexpected color value:', value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n};\r\n\r\nColor.prototype.spaces = {\r\n\trgb: ['red', 'green', 'blue'],\r\n\thsl: ['hue', 'saturation', 'lightness'],\r\n\thsv: ['hue', 'saturation', 'value'],\r\n\thwb: ['hue', 'whiteness', 'blackness'],\r\n\tcmyk: ['cyan', 'magenta', 'yellow', 'black']\r\n};\r\n\r\nColor.prototype.maxes = {\r\n\trgb: [255, 255, 255],\r\n\thsl: [360, 100, 100],\r\n\thsv: [360, 100, 100],\r\n\thwb: [360, 100, 100],\r\n\tcmyk: [100, 100, 100, 100]\r\n};\r\n\r\nColor.prototype.getValues = function (space) {\r\n\tvar values = this.values;\r\n\tvar vals = {};\r\n\r\n\tfor (var i = 0; i < space.length; i++) {\r\n\t\tvals[space.charAt(i)] = values[space][i];\r\n\t}\r\n\r\n\tif (values.alpha !== 1) {\r\n\t\tvals.a = values.alpha;\r\n\t}\r\n\r\n\t// {r: 255, g: 255, b: 255, a: 0.4}\r\n\treturn vals;\r\n};\r\n\r\nColor.prototype.setValues = function (space, vals) {\r\n\tvar values = this.values;\r\n\tvar spaces = this.spaces;\r\n\tvar maxes = this.maxes;\r\n\tvar alpha = 1;\r\n\tvar i;\r\n\r\n\tthis.valid = true;\r\n\r\n\tif (space === 'alpha') {\r\n\t\talpha = vals;\r\n\t} else if (vals.length) {\r\n\t\t// [10, 10, 10]\r\n\t\tvalues[space] = vals.slice(0, space.length);\r\n\t\talpha = vals[space.length];\r\n\t} else if (vals[space.charAt(0)] !== undefined) {\r\n\t\t// {r: 10, g: 10, b: 10}\r\n\t\tfor (i = 0; i < space.length; i++) {\r\n\t\t\tvalues[space][i] = vals[space.charAt(i)];\r\n\t\t}\r\n\r\n\t\talpha = vals.a;\r\n\t} else if (vals[spaces[space][0]] !== undefined) {\r\n\t\t// {red: 10, green: 10, blue: 10}\r\n\t\tvar chans = spaces[space];\r\n\r\n\t\tfor (i = 0; i < space.length; i++) {\r\n\t\t\tvalues[space][i] = vals[chans[i]];\r\n\t\t}\r\n\r\n\t\talpha = vals.alpha;\r\n\t}\r\n\r\n\tvalues.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));\r\n\r\n\tif (space === 'alpha') {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar capped;\r\n\r\n\t// cap values of the space prior converting all values\r\n\tfor (i = 0; i < space.length; i++) {\r\n\t\tcapped = Math.max(0, Math.min(maxes[space][i], values[space][i]));\r\n\t\tvalues[space][i] = Math.round(capped);\r\n\t}\r\n\r\n\t// convert to all the other color spaces\r\n\tfor (var sname in spaces) {\r\n\t\tif (sname !== space) {\r\n\t\t\tvalues[sname] = colorConvert[space][sname](values[space]);\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n};\r\n\r\nColor.prototype.setSpace = function (space, args) {\r\n\tvar vals = args[0];\r\n\r\n\tif (vals === undefined) {\r\n\t\t// color.rgb()\r\n\t\treturn this.getValues(space);\r\n\t}\r\n\r\n\t// color.rgb(10, 10, 10)\r\n\tif (typeof vals === 'number') {\r\n\t\tvals = Array.prototype.slice.call(args);\r\n\t}\r\n\r\n\tthis.setValues(space, vals);\r\n\treturn this;\r\n};\r\n\r\nColor.prototype.setChannel = function (space, index, val) {\r\n\tvar svalues = this.values[space];\r\n\tif (val === undefined) {\r\n\t\t// color.red()\r\n\t\treturn svalues[index];\r\n\t} else if (val === svalues[index]) {\r\n\t\t// color.red(color.red())\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// color.red(100)\r\n\tsvalues[index] = val;\r\n\tthis.setValues(space, svalues);\r\n\r\n\treturn this;\r\n};\r\n\r\nif (typeof window !== 'undefined') {\r\n\twindow.Color = Color;\r\n}\r\n\r\nvar chartjsColor = Color;\r\n\r\n/**\r\n * @namespace Chart.helpers\r\n */\r\nvar helpers = {\r\n\t/**\r\n\t * An empty function that can be used, for example, for optional callback.\r\n\t */\r\n\tnoop: function() {},\r\n\r\n\t/**\r\n\t * Returns a unique id, sequentially generated from a global variable.\r\n\t * @returns {number}\r\n\t * @function\r\n\t */\r\n\tuid: (function() {\r\n\t\tvar id = 0;\r\n\t\treturn function() {\r\n\t\t\treturn id++;\r\n\t\t};\r\n\t}()),\r\n\r\n\t/**\r\n\t * Returns true if `value` is neither null nor undefined, else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @since 2.7.0\r\n\t */\r\n\tisNullOrUndef: function(value) {\r\n\t\treturn value === null || typeof value === 'undefined';\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is an array (including typed arrays), else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @function\r\n\t */\r\n\tisArray: function(value) {\r\n\t\tif (Array.isArray && Array.isArray(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar type = Object.prototype.toString.call(value);\r\n\t\tif (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is an object (excluding null), else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @since 2.7.0\r\n\t */\r\n\tisObject: function(value) {\r\n\t\treturn value !== null && Object.prototype.toString.call(value) === '[object Object]';\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is a finite number, else returns false\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t */\r\n\tisFinite: function(value) {\r\n\t\treturn (typeof value === 'number' || value instanceof Number) && isFinite(value);\r\n\t},\r\n\r\n\t/**\r\n\t * Returns `value` if defined, else returns `defaultValue`.\r\n\t * @param {*} value - The value to return if defined.\r\n\t * @param {*} defaultValue - The value to return if `value` is undefined.\r\n\t * @returns {*}\r\n\t */\r\n\tvalueOrDefault: function(value, defaultValue) {\r\n\t\treturn typeof value === 'undefined' ? defaultValue : value;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns value at the given `index` in array if defined, else returns `defaultValue`.\r\n\t * @param {Array} value - The array to lookup for value at `index`.\r\n\t * @param {number} index - The index in `value` to lookup for value.\r\n\t * @param {*} defaultValue - The value to return if `value[index]` is undefined.\r\n\t * @returns {*}\r\n\t */\r\n\tvalueAtIndexOrDefault: function(value, index, defaultValue) {\r\n\t\treturn helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue);\r\n\t},\r\n\r\n\t/**\r\n\t * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\r\n\t * value returned by `fn`. If `fn` is not a function, this method returns undefined.\r\n\t * @param {function} fn - The function to call.\r\n\t * @param {Array|undefined|null} args - The arguments with which `fn` should be called.\r\n\t * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.\r\n\t * @returns {*}\r\n\t */\r\n\tcallback: function(fn, args, thisArg) {\r\n\t\tif (fn && typeof fn.call === 'function') {\r\n\t\t\treturn fn.apply(thisArg, args);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Note(SB) for performance sake, this method should only be used when loopable type\r\n\t * is unknown or in none intensive code (not called often and small loopable). Else\r\n\t * it's preferable to use a regular for() loop and save extra function calls.\r\n\t * @param {object|Array} loopable - The object or array to be iterated.\r\n\t * @param {function} fn - The function to call for each item.\r\n\t * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.\r\n\t * @param {boolean} [reverse] - If true, iterates backward on the loopable.\r\n\t */\r\n\teach: function(loopable, fn, thisArg, reverse) {\r\n\t\tvar i, len, keys;\r\n\t\tif (helpers.isArray(loopable)) {\r\n\t\t\tlen = loopable.length;\r\n\t\t\tif (reverse) {\r\n\t\t\t\tfor (i = len - 1; i >= 0; i--) {\r\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tfor (i = 0; i < len; i++) {\r\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (helpers.isObject(loopable)) {\r\n\t\t\tkeys = Object.keys(loopable);\r\n\t\t\tlen = keys.length;\r\n\t\t\tfor (i = 0; i < len; i++) {\r\n\t\t\t\tfn.call(thisArg, loopable[keys[i]], keys[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\r\n\t * @see https://stackoverflow.com/a/14853974\r\n\t * @param {Array} a0 - The array to compare\r\n\t * @param {Array} a1 - The array to compare\r\n\t * @returns {boolean}\r\n\t */\r\n\tarrayEquals: function(a0, a1) {\r\n\t\tvar i, ilen, v0, v1;\r\n\r\n\t\tif (!a0 || !a1 || a0.length !== a1.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = a0.length; i < ilen; ++i) {\r\n\t\t\tv0 = a0[i];\r\n\t\t\tv1 = a1[i];\r\n\r\n\t\t\tif (v0 instanceof Array && v1 instanceof Array) {\r\n\t\t\t\tif (!helpers.arrayEquals(v0, v1)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if (v0 !== v1) {\r\n\t\t\t\t// NOTE: two different object instances will never be equal: {x:20} != {x:20}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns a deep copy of `source` without keeping references on objects and arrays.\r\n\t * @param {*} source - The value to clone.\r\n\t * @returns {*}\r\n\t */\r\n\tclone: function(source) {\r\n\t\tif (helpers.isArray(source)) {\r\n\t\t\treturn source.map(helpers.clone);\r\n\t\t}\r\n\r\n\t\tif (helpers.isObject(source)) {\r\n\t\t\tvar target = {};\r\n\t\t\tvar keys = Object.keys(source);\r\n\t\t\tvar klen = keys.length;\r\n\t\t\tvar k = 0;\r\n\r\n\t\t\tfor (; k < klen; ++k) {\r\n\t\t\t\ttarget[keys[k]] = helpers.clone(source[keys[k]]);\r\n\t\t\t}\r\n\r\n\t\t\treturn target;\r\n\t\t}\r\n\r\n\t\treturn source;\r\n\t},\r\n\r\n\t/**\r\n\t * The default merger when Chart.helpers.merge is called without merger option.\r\n\t * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\r\n\t * @private\r\n\t */\r\n\t_merger: function(key, target, source, options) {\r\n\t\tvar tval = target[key];\r\n\t\tvar sval = source[key];\r\n\r\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\r\n\t\t\thelpers.merge(tval, sval, options);\r\n\t\t} else {\r\n\t\t\ttarget[key] = helpers.clone(sval);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Merges source[key] in target[key] only if target[key] is undefined.\r\n\t * @private\r\n\t */\r\n\t_mergerIf: function(key, target, source) {\r\n\t\tvar tval = target[key];\r\n\t\tvar sval = source[key];\r\n\r\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\r\n\t\t\thelpers.mergeIf(tval, sval);\r\n\t\t} else if (!target.hasOwnProperty(key)) {\r\n\t\t\ttarget[key] = helpers.clone(sval);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Recursively deep copies `source` properties into `target` with the given `options`.\r\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\r\n\t * @param {object} target - The target object in which all sources are merged into.\r\n\t * @param {object|object[]} source - Object(s) to merge into `target`.\r\n\t * @param {object} [options] - Merging options:\r\n\t * @param {function} [options.merger] - The merge method (key, target, source, options)\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\tmerge: function(target, source, options) {\r\n\t\tvar sources = helpers.isArray(source) ? source : [source];\r\n\t\tvar ilen = sources.length;\r\n\t\tvar merge, i, keys, klen, k;\r\n\r\n\t\tif (!helpers.isObject(target)) {\r\n\t\t\treturn target;\r\n\t\t}\r\n\r\n\t\toptions = options || {};\r\n\t\tmerge = options.merger || helpers._merger;\r\n\r\n\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\tsource = sources[i];\r\n\t\t\tif (!helpers.isObject(source)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tkeys = Object.keys(source);\r\n\t\t\tfor (k = 0, klen = keys.length; k < klen; ++k) {\r\n\t\t\t\tmerge(keys[k], target, source, options);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn target;\r\n\t},\r\n\r\n\t/**\r\n\t * Recursively deep copies `source` properties into `target` *only* if not defined in target.\r\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\r\n\t * @param {object} target - The target object in which all sources are merged into.\r\n\t * @param {object|object[]} source - Object(s) to merge into `target`.\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\tmergeIf: function(target, source) {\r\n\t\treturn helpers.merge(target, source, {merger: helpers._mergerIf});\r\n\t},\r\n\r\n\t/**\r\n\t * Applies the contents of two or more objects together into the first object.\r\n\t * @param {object} target - The target object in which all objects are merged into.\r\n\t * @param {object} arg1 - Object containing additional properties to merge in target.\r\n\t * @param {object} argN - Additional objects containing properties to merge in target.\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\textend: Object.assign || function(target) {\r\n\t\treturn helpers.merge(target, [].slice.call(arguments, 1), {\r\n\t\t\tmerger: function(key, dst, src) {\r\n\t\t\t\tdst[key] = src[key];\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * Basic javascript inheritance based on the model created in Backbone.js\r\n\t */\r\n\tinherits: function(extensions) {\r\n\t\tvar me = this;\r\n\t\tvar ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {\r\n\t\t\treturn me.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tvar Surrogate = function() {\r\n\t\t\tthis.constructor = ChartElement;\r\n\t\t};\r\n\r\n\t\tSurrogate.prototype = me.prototype;\r\n\t\tChartElement.prototype = new Surrogate();\r\n\t\tChartElement.extend = helpers.inherits;\r\n\r\n\t\tif (extensions) {\r\n\t\t\thelpers.extend(ChartElement.prototype, extensions);\r\n\t\t}\r\n\r\n\t\tChartElement.__super__ = me.prototype;\r\n\t\treturn ChartElement;\r\n\t},\r\n\r\n\t_deprecated: function(scope, value, previous, current) {\r\n\t\tif (value !== undefined) {\r\n\t\t\tconsole.warn(scope + ': \"' + previous +\r\n\t\t\t\t'\" is deprecated. Please use \"' + current + '\" instead');\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar helpers_core = helpers;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.callback instead.\r\n * @function Chart.helpers.callCallback\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.callCallback = helpers.callback;\r\n\r\n/**\r\n * Provided for backward compatibility, use Array.prototype.indexOf instead.\r\n * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+\r\n * @function Chart.helpers.indexOf\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.indexOf = function(array, item, fromIndex) {\r\n\treturn Array.prototype.indexOf.call(array, item, fromIndex);\r\n};\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.\r\n * @function Chart.helpers.getValueOrDefault\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.getValueOrDefault = helpers.valueOrDefault;\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.\r\n * @function Chart.helpers.getValueAtIndexOrDefault\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\r\n\r\n/**\r\n * Easing functions adapted from Robert Penner's easing equations.\r\n * @namespace Chart.helpers.easingEffects\r\n * @see http://www.robertpenner.com/easing/\r\n */\r\nvar effects = {\r\n\tlinear: function(t) {\r\n\t\treturn t;\r\n\t},\r\n\r\n\teaseInQuad: function(t) {\r\n\t\treturn t * t;\r\n\t},\r\n\r\n\teaseOutQuad: function(t) {\r\n\t\treturn -t * (t - 2);\r\n\t},\r\n\r\n\teaseInOutQuad: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t;\r\n\t\t}\r\n\t\treturn -0.5 * ((--t) * (t - 2) - 1);\r\n\t},\r\n\r\n\teaseInCubic: function(t) {\r\n\t\treturn t * t * t;\r\n\t},\r\n\r\n\teaseOutCubic: function(t) {\r\n\t\treturn (t = t - 1) * t * t + 1;\r\n\t},\r\n\r\n\teaseInOutCubic: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t;\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * t + 2);\r\n\t},\r\n\r\n\teaseInQuart: function(t) {\r\n\t\treturn t * t * t * t;\r\n\t},\r\n\r\n\teaseOutQuart: function(t) {\r\n\t\treturn -((t = t - 1) * t * t * t - 1);\r\n\t},\r\n\r\n\teaseInOutQuart: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t * t;\r\n\t\t}\r\n\t\treturn -0.5 * ((t -= 2) * t * t * t - 2);\r\n\t},\r\n\r\n\teaseInQuint: function(t) {\r\n\t\treturn t * t * t * t * t;\r\n\t},\r\n\r\n\teaseOutQuint: function(t) {\r\n\t\treturn (t = t - 1) * t * t * t * t + 1;\r\n\t},\r\n\r\n\teaseInOutQuint: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t * t * t;\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * t * t * t + 2);\r\n\t},\r\n\r\n\teaseInSine: function(t) {\r\n\t\treturn -Math.cos(t * (Math.PI / 2)) + 1;\r\n\t},\r\n\r\n\teaseOutSine: function(t) {\r\n\t\treturn Math.sin(t * (Math.PI / 2));\r\n\t},\r\n\r\n\teaseInOutSine: function(t) {\r\n\t\treturn -0.5 * (Math.cos(Math.PI * t) - 1);\r\n\t},\r\n\r\n\teaseInExpo: function(t) {\r\n\t\treturn (t === 0) ? 0 : Math.pow(2, 10 * (t - 1));\r\n\t},\r\n\r\n\teaseOutExpo: function(t) {\r\n\t\treturn (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1;\r\n\t},\r\n\r\n\teaseInOutExpo: function(t) {\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * Math.pow(2, 10 * (t - 1));\r\n\t\t}\r\n\t\treturn 0.5 * (-Math.pow(2, -10 * --t) + 2);\r\n\t},\r\n\r\n\teaseInCirc: function(t) {\r\n\t\tif (t >= 1) {\r\n\t\t\treturn t;\r\n\t\t}\r\n\t\treturn -(Math.sqrt(1 - t * t) - 1);\r\n\t},\r\n\r\n\teaseOutCirc: function(t) {\r\n\t\treturn Math.sqrt(1 - (t = t - 1) * t);\r\n\t},\r\n\r\n\teaseInOutCirc: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn -0.5 * (Math.sqrt(1 - t * t) - 1);\r\n\t\t}\r\n\t\treturn 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\r\n\t},\r\n\r\n\teaseInElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.3;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\treturn -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\r\n\t},\r\n\r\n\teaseOutElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.3;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\treturn a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1;\r\n\t},\r\n\r\n\teaseInOutElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((t /= 0.5) === 2) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.45;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\tif (t < 1) {\r\n\t\t\treturn -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\r\n\t\t}\r\n\t\treturn a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n\t},\r\n\teaseInBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\treturn t * t * ((s + 1) * t - s);\r\n\t},\r\n\r\n\teaseOutBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\treturn (t = t - 1) * t * ((s + 1) * t + s) + 1;\r\n\t},\r\n\r\n\teaseInOutBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\r\n\t},\r\n\r\n\teaseInBounce: function(t) {\r\n\t\treturn 1 - effects.easeOutBounce(1 - t);\r\n\t},\r\n\r\n\teaseOutBounce: function(t) {\r\n\t\tif (t < (1 / 2.75)) {\r\n\t\t\treturn 7.5625 * t * t;\r\n\t\t}\r\n\t\tif (t < (2 / 2.75)) {\r\n\t\t\treturn 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75;\r\n\t\t}\r\n\t\tif (t < (2.5 / 2.75)) {\r\n\t\t\treturn 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375;\r\n\t\t}\r\n\t\treturn 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375;\r\n\t},\r\n\r\n\teaseInOutBounce: function(t) {\r\n\t\tif (t < 0.5) {\r\n\t\t\treturn effects.easeInBounce(t * 2) * 0.5;\r\n\t\t}\r\n\t\treturn effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5;\r\n\t}\r\n};\r\n\r\nvar helpers_easing = {\r\n\teffects: effects\r\n};\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.easing.effects instead.\r\n * @function Chart.helpers.easingEffects\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.easingEffects = effects;\r\n\r\nvar PI = Math.PI;\r\nvar RAD_PER_DEG = PI / 180;\r\nvar DOUBLE_PI = PI * 2;\r\nvar HALF_PI = PI / 2;\r\nvar QUARTER_PI = PI / 4;\r\nvar TWO_THIRDS_PI = PI * 2 / 3;\r\n\r\n/**\r\n * @namespace Chart.helpers.canvas\r\n */\r\nvar exports$1 = {\r\n\t/**\r\n\t * Clears the entire canvas associated to the given `chart`.\r\n\t * @param {Chart} chart - The chart for which to clear the canvas.\r\n\t */\r\n\tclear: function(chart) {\r\n\t\tchart.ctx.clearRect(0, 0, chart.width, chart.height);\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a \"path\" for a rectangle with rounded corners at position (x, y) with a\r\n\t * given size (width, height) and the same `radius` for all corners.\r\n\t * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context.\r\n\t * @param {number} x - The x axis of the coordinate for the rectangle starting point.\r\n\t * @param {number} y - The y axis of the coordinate for the rectangle starting point.\r\n\t * @param {number} width - The rectangle's width.\r\n\t * @param {number} height - The rectangle's height.\r\n\t * @param {number} radius - The rounded amount (in pixels) for the four corners.\r\n\t * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object?\r\n\t */\r\n\troundedRect: function(ctx, x, y, width, height, radius) {\r\n\t\tif (radius) {\r\n\t\t\tvar r = Math.min(radius, height / 2, width / 2);\r\n\t\t\tvar left = x + r;\r\n\t\t\tvar top = y + r;\r\n\t\t\tvar right = x + width - r;\r\n\t\t\tvar bottom = y + height - r;\r\n\r\n\t\t\tctx.moveTo(x, top);\r\n\t\t\tif (left < right && top < bottom) {\r\n\t\t\t\tctx.arc(left, top, r, -PI, -HALF_PI);\r\n\t\t\t\tctx.arc(right, top, r, -HALF_PI, 0);\r\n\t\t\t\tctx.arc(right, bottom, r, 0, HALF_PI);\r\n\t\t\t\tctx.arc(left, bottom, r, HALF_PI, PI);\r\n\t\t\t} else if (left < right) {\r\n\t\t\t\tctx.moveTo(left, y);\r\n\t\t\t\tctx.arc(right, top, r, -HALF_PI, HALF_PI);\r\n\t\t\t\tctx.arc(left, top, r, HALF_PI, PI + HALF_PI);\r\n\t\t\t} else if (top < bottom) {\r\n\t\t\t\tctx.arc(left, top, r, -PI, 0);\r\n\t\t\t\tctx.arc(left, bottom, r, 0, PI);\r\n\t\t\t} else {\r\n\t\t\t\tctx.arc(left, top, r, -PI, PI);\r\n\t\t\t}\r\n\t\t\tctx.closePath();\r\n\t\t\tctx.moveTo(x, y);\r\n\t\t} else {\r\n\t\t\tctx.rect(x, y, width, height);\r\n\t\t}\r\n\t},\r\n\r\n\tdrawPoint: function(ctx, style, radius, x, y, rotation) {\r\n\t\tvar type, xOffset, yOffset, size, cornerRadius;\r\n\t\tvar rad = (rotation || 0) * RAD_PER_DEG;\r\n\r\n\t\tif (style && typeof style === 'object') {\r\n\t\t\ttype = style.toString();\r\n\t\t\tif (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\r\n\t\t\t\tctx.save();\r\n\t\t\t\tctx.translate(x, y);\r\n\t\t\t\tctx.rotate(rad);\r\n\t\t\t\tctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\r\n\t\t\t\tctx.restore();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (isNaN(radius) || radius <= 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.beginPath();\r\n\r\n\t\tswitch (style) {\r\n\t\t// Default includes circle\r\n\t\tdefault:\r\n\t\t\tctx.arc(x, y, radius, 0, DOUBLE_PI);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'triangle':\r\n\t\t\tctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\trad += TWO_THIRDS_PI;\r\n\t\t\tctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\trad += TWO_THIRDS_PI;\r\n\t\t\tctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'rectRounded':\r\n\t\t\t// NOTE: the rounded rect implementation changed to use `arc` instead of\r\n\t\t\t// `quadraticCurveTo` since it generates better results when rect is\r\n\t\t\t// almost a circle. 0.516 (instead of 0.5) produces results with visually\r\n\t\t\t// closer proportion to the previous impl and it is inscribed in the\r\n\t\t\t// circle with `radius`. For more details, see the following PRs:\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5597\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5858\r\n\t\t\tcornerRadius = radius * 0.516;\r\n\t\t\tsize = radius - cornerRadius;\r\n\t\t\txOffset = Math.cos(rad + QUARTER_PI) * size;\r\n\t\t\tyOffset = Math.sin(rad + QUARTER_PI) * size;\r\n\t\t\tctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\r\n\t\t\tctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);\r\n\t\t\tctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);\r\n\t\t\tctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'rect':\r\n\t\t\tif (!rotation) {\r\n\t\t\t\tsize = Math.SQRT1_2 * radius;\r\n\t\t\t\tctx.rect(x - size, y - size, 2 * size, 2 * size);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\t/* falls through */\r\n\t\tcase 'rectRot':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'crossRot':\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\t/* falls through */\r\n\t\tcase 'cross':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'star':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'line':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'dash':\r\n\t\t\tctx.moveTo(x, y);\r\n\t\t\tctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tctx.fill();\r\n\t\tctx.stroke();\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if the point is inside the rectangle\r\n\t * @param {object} point - The point to test\r\n\t * @param {object} area - The rectangle\r\n\t * @returns {boolean}\r\n\t * @private\r\n\t */\r\n\t_isPointInArea: function(point, area) {\r\n\t\tvar epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\r\n\r\n\t\treturn point.x > area.left - epsilon && point.x < area.right + epsilon &&\r\n\t\t\tpoint.y > area.top - epsilon && point.y < area.bottom + epsilon;\r\n\t},\r\n\r\n\tclipArea: function(ctx, area) {\r\n\t\tctx.save();\r\n\t\tctx.beginPath();\r\n\t\tctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\r\n\t\tctx.clip();\r\n\t},\r\n\r\n\tunclipArea: function(ctx) {\r\n\t\tctx.restore();\r\n\t},\r\n\r\n\tlineTo: function(ctx, previous, target, flip) {\r\n\t\tvar stepped = target.steppedLine;\r\n\t\tif (stepped) {\r\n\t\t\tif (stepped === 'middle') {\r\n\t\t\t\tvar midpoint = (previous.x + target.x) / 2.0;\r\n\t\t\t\tctx.lineTo(midpoint, flip ? target.y : previous.y);\r\n\t\t\t\tctx.lineTo(midpoint, flip ? previous.y : target.y);\r\n\t\t\t} else if ((stepped === 'after' && !flip) || (stepped !== 'after' && flip)) {\r\n\t\t\t\tctx.lineTo(previous.x, target.y);\r\n\t\t\t} else {\r\n\t\t\t\tctx.lineTo(target.x, previous.y);\r\n\t\t\t}\r\n\t\t\tctx.lineTo(target.x, target.y);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!target.tension) {\r\n\t\t\tctx.lineTo(target.x, target.y);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.bezierCurveTo(\r\n\t\t\tflip ? previous.controlPointPreviousX : previous.controlPointNextX,\r\n\t\t\tflip ? previous.controlPointPreviousY : previous.controlPointNextY,\r\n\t\t\tflip ? target.controlPointNextX : target.controlPointPreviousX,\r\n\t\t\tflip ? target.controlPointNextY : target.controlPointPreviousY,\r\n\t\t\ttarget.x,\r\n\t\t\ttarget.y);\r\n\t}\r\n};\r\n\r\nvar helpers_canvas = exports$1;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.\r\n * @namespace Chart.helpers.clear\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.clear = exports$1.clear;\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.\r\n * @namespace Chart.helpers.drawRoundedRectangle\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.drawRoundedRectangle = function(ctx) {\r\n\tctx.beginPath();\r\n\texports$1.roundedRect.apply(exports$1, arguments);\r\n};\r\n\r\nvar defaults = {\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_set: function(scope, values) {\r\n\t\treturn helpers_core.merge(this[scope] || (this[scope] = {}), values);\r\n\t}\r\n};\r\n\r\n// TODO(v3): remove 'global' from namespace. all default are global and\r\n// there's inconsistency around which options are under 'global'\r\ndefaults._set('global', {\r\n\tdefaultColor: 'rgba(0,0,0,0.1)',\r\n\tdefaultFontColor: '#666',\r\n\tdefaultFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\r\n\tdefaultFontSize: 12,\r\n\tdefaultFontStyle: 'normal',\r\n\tdefaultLineHeight: 1.2,\r\n\tshowLines: true\r\n});\r\n\r\nvar core_defaults = defaults;\r\n\r\nvar valueOrDefault = helpers_core.valueOrDefault;\r\n\r\n/**\r\n * Converts the given font object into a CSS font string.\r\n * @param {object} font - A font object.\r\n * @return {string} The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\r\n * @private\r\n */\r\nfunction toFontString(font) {\r\n\tif (!font || helpers_core.isNullOrUndef(font.size) || helpers_core.isNullOrUndef(font.family)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (font.style ? font.style + ' ' : '')\r\n\t\t+ (font.weight ? font.weight + ' ' : '')\r\n\t\t+ font.size + 'px '\r\n\t\t+ font.family;\r\n}\r\n\r\n/**\r\n * @alias Chart.helpers.options\r\n * @namespace\r\n */\r\nvar helpers_options = {\r\n\t/**\r\n\t * Converts the given line height `value` in pixels for a specific font `size`.\r\n\t * @param {number|string} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\r\n\t * @param {number} size - The font size (in pixels) used to resolve relative `value`.\r\n\t * @returns {number} The effective line height in pixels (size * 1.2 if value is invalid).\r\n\t * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\r\n\t * @since 2.7.0\r\n\t */\r\n\ttoLineHeight: function(value, size) {\r\n\t\tvar matches = ('' + value).match(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\r\n\t\tif (!matches || matches[1] === 'normal') {\r\n\t\t\treturn size * 1.2;\r\n\t\t}\r\n\r\n\t\tvalue = +matches[2];\r\n\r\n\t\tswitch (matches[3]) {\r\n\t\tcase 'px':\r\n\t\t\treturn value;\r\n\t\tcase '%':\r\n\t\t\tvalue /= 100;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn size * value;\r\n\t},\r\n\r\n\t/**\r\n\t * Converts the given value into a padding object with pre-computed width/height.\r\n\t * @param {number|object} value - If a number, set the value to all TRBL component,\r\n\t * else, if and object, use defined properties and sets undefined ones to 0.\r\n\t * @returns {object} The padding values (top, right, bottom, left, width, height)\r\n\t * @since 2.7.0\r\n\t */\r\n\ttoPadding: function(value) {\r\n\t\tvar t, r, b, l;\r\n\r\n\t\tif (helpers_core.isObject(value)) {\r\n\t\t\tt = +value.top || 0;\r\n\t\t\tr = +value.right || 0;\r\n\t\t\tb = +value.bottom || 0;\r\n\t\t\tl = +value.left || 0;\r\n\t\t} else {\r\n\t\t\tt = r = b = l = +value || 0;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\ttop: t,\r\n\t\t\tright: r,\r\n\t\t\tbottom: b,\r\n\t\t\tleft: l,\r\n\t\t\theight: t + b,\r\n\t\t\twidth: l + r\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Parses font options and returns the font object.\r\n\t * @param {object} options - A object that contains font options to be parsed.\r\n\t * @return {object} The font object.\r\n\t * @todo Support font.* options and renamed to toFont().\r\n\t * @private\r\n\t */\r\n\t_parseFont: function(options) {\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);\r\n\t\tvar font = {\r\n\t\t\tfamily: valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily),\r\n\t\t\tlineHeight: helpers_core.options.toLineHeight(valueOrDefault(options.lineHeight, globalDefaults.defaultLineHeight), size),\r\n\t\t\tsize: size,\r\n\t\t\tstyle: valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle),\r\n\t\t\tweight: null,\r\n\t\t\tstring: ''\r\n\t\t};\r\n\r\n\t\tfont.string = toFontString(font);\r\n\t\treturn font;\r\n\t},\r\n\r\n\t/**\r\n\t * Evaluates the given `inputs` sequentially and returns the first defined value.\r\n\t * @param {Array} inputs - An array of values, falling back to the last value.\r\n\t * @param {object} [context] - If defined and the current value is a function, the value\r\n\t * is called with `context` as first argument and the result becomes the new input.\r\n\t * @param {number} [index] - If defined and the current value is an array, the value\r\n\t * at `index` become the new input.\r\n\t * @param {object} [info] - object to return information about resolution in\r\n\t * @param {boolean} [info.cacheable] - Will be set to `false` if option is not cacheable.\r\n\t * @since 2.7.0\r\n\t */\r\n\tresolve: function(inputs, context, index, info) {\r\n\t\tvar cacheable = true;\r\n\t\tvar i, ilen, value;\r\n\r\n\t\tfor (i = 0, ilen = inputs.length; i < ilen; ++i) {\r\n\t\t\tvalue = inputs[i];\r\n\t\t\tif (value === undefined) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (context !== undefined && typeof value === 'function') {\r\n\t\t\t\tvalue = value(context);\r\n\t\t\t\tcacheable = false;\r\n\t\t\t}\r\n\t\t\tif (index !== undefined && helpers_core.isArray(value)) {\r\n\t\t\t\tvalue = value[index];\r\n\t\t\t\tcacheable = false;\r\n\t\t\t}\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tif (info && !cacheable) {\r\n\t\t\t\t\tinfo.cacheable = false;\r\n\t\t\t\t}\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * @alias Chart.helpers.math\r\n * @namespace\r\n */\r\nvar exports$2 = {\r\n\t/**\r\n\t * Returns an array of factors sorted from 1 to sqrt(value)\r\n\t * @private\r\n\t */\r\n\t_factorize: function(value) {\r\n\t\tvar result = [];\r\n\t\tvar sqrt = Math.sqrt(value);\r\n\t\tvar i;\r\n\r\n\t\tfor (i = 1; i < sqrt; i++) {\r\n\t\t\tif (value % i === 0) {\r\n\t\t\t\tresult.push(i);\r\n\t\t\t\tresult.push(value / i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (sqrt === (sqrt | 0)) { // if value is a square number\r\n\t\t\tresult.push(sqrt);\r\n\t\t}\r\n\r\n\t\tresult.sort(function(a, b) {\r\n\t\t\treturn a - b;\r\n\t\t}).pop();\r\n\t\treturn result;\r\n\t},\r\n\r\n\tlog10: Math.log10 || function(x) {\r\n\t\tvar exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 / Math.LN10.\r\n\t\t// Check for whole powers of 10,\r\n\t\t// which due to floating point rounding error should be corrected.\r\n\t\tvar powerOf10 = Math.round(exponent);\r\n\t\tvar isPowerOf10 = x === Math.pow(10, powerOf10);\r\n\r\n\t\treturn isPowerOf10 ? powerOf10 : exponent;\r\n\t}\r\n};\r\n\r\nvar helpers_math = exports$2;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.math.log10 instead.\r\n * @namespace Chart.helpers.log10\r\n * @deprecated since version 2.9.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.log10 = exports$2.log10;\r\n\r\nvar getRtlAdapter = function(rectX, width) {\r\n\treturn {\r\n\t\tx: function(x) {\r\n\t\t\treturn rectX + rectX + width - x;\r\n\t\t},\r\n\t\tsetWidth: function(w) {\r\n\t\t\twidth = w;\r\n\t\t},\r\n\t\ttextAlign: function(align) {\r\n\t\t\tif (align === 'center') {\r\n\t\t\t\treturn align;\r\n\t\t\t}\r\n\t\t\treturn align === 'right' ? 'left' : 'right';\r\n\t\t},\r\n\t\txPlus: function(x, value) {\r\n\t\t\treturn x - value;\r\n\t\t},\r\n\t\tleftForLtr: function(x, itemWidth) {\r\n\t\t\treturn x - itemWidth;\r\n\t\t},\r\n\t};\r\n};\r\n\r\nvar getLtrAdapter = function() {\r\n\treturn {\r\n\t\tx: function(x) {\r\n\t\t\treturn x;\r\n\t\t},\r\n\t\tsetWidth: function(w) { // eslint-disable-line no-unused-vars\r\n\t\t},\r\n\t\ttextAlign: function(align) {\r\n\t\t\treturn align;\r\n\t\t},\r\n\t\txPlus: function(x, value) {\r\n\t\t\treturn x + value;\r\n\t\t},\r\n\t\tleftForLtr: function(x, _itemWidth) { // eslint-disable-line no-unused-vars\r\n\t\t\treturn x;\r\n\t\t},\r\n\t};\r\n};\r\n\r\nvar getAdapter = function(rtl, rectX, width) {\r\n\treturn rtl ? getRtlAdapter(rectX, width) : getLtrAdapter();\r\n};\r\n\r\nvar overrideTextDirection = function(ctx, direction) {\r\n\tvar style, original;\r\n\tif (direction === 'ltr' || direction === 'rtl') {\r\n\t\tstyle = ctx.canvas.style;\r\n\t\toriginal = [\r\n\t\t\tstyle.getPropertyValue('direction'),\r\n\t\t\tstyle.getPropertyPriority('direction'),\r\n\t\t];\r\n\r\n\t\tstyle.setProperty('direction', direction, 'important');\r\n\t\tctx.prevTextDirection = original;\r\n\t}\r\n};\r\n\r\nvar restoreTextDirection = function(ctx) {\r\n\tvar original = ctx.prevTextDirection;\r\n\tif (original !== undefined) {\r\n\t\tdelete ctx.prevTextDirection;\r\n\t\tctx.canvas.style.setProperty('direction', original[0], original[1]);\r\n\t}\r\n};\r\n\r\nvar helpers_rtl = {\r\n\tgetRtlAdapter: getAdapter,\r\n\toverrideTextDirection: overrideTextDirection,\r\n\trestoreTextDirection: restoreTextDirection,\r\n};\r\n\r\nvar helpers$1 = helpers_core;\r\nvar easing = helpers_easing;\r\nvar canvas = helpers_canvas;\r\nvar options = helpers_options;\r\nvar math = helpers_math;\r\nvar rtl = helpers_rtl;\r\nhelpers$1.easing = easing;\r\nhelpers$1.canvas = canvas;\r\nhelpers$1.options = options;\r\nhelpers$1.math = math;\r\nhelpers$1.rtl = rtl;\r\n\r\nfunction interpolate(start, view, model, ease) {\r\n\tvar keys = Object.keys(model);\r\n\tvar i, ilen, key, actual, origin, target, type, c0, c1;\r\n\r\n\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\tkey = keys[i];\r\n\r\n\t\ttarget = model[key];\r\n\r\n\t\t// if a value is added to the model after pivot() has been called, the view\r\n\t\t// doesn't contain it, so let's initialize the view to the target value.\r\n\t\tif (!view.hasOwnProperty(key)) {\r\n\t\t\tview[key] = target;\r\n\t\t}\r\n\r\n\t\tactual = view[key];\r\n\r\n\t\tif (actual === target || key[0] === '_') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!start.hasOwnProperty(key)) {\r\n\t\t\tstart[key] = actual;\r\n\t\t}\r\n\r\n\t\torigin = start[key];\r\n\r\n\t\ttype = typeof target;\r\n\r\n\t\tif (type === typeof origin) {\r\n\t\t\tif (type === 'string') {\r\n\t\t\t\tc0 = chartjsColor(origin);\r\n\t\t\t\tif (c0.valid) {\r\n\t\t\t\t\tc1 = chartjsColor(target);\r\n\t\t\t\t\tif (c1.valid) {\r\n\t\t\t\t\t\tview[key] = c1.mix(c0, ease).rgbString();\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (helpers$1.isFinite(origin) && helpers$1.isFinite(target)) {\r\n\t\t\t\tview[key] = origin + (target - origin) * ease;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tview[key] = target;\r\n\t}\r\n}\r\n\r\nvar Element = function(configuration) {\r\n\thelpers$1.extend(this, configuration);\r\n\tthis.initialize.apply(this, arguments);\r\n};\r\n\r\nhelpers$1.extend(Element.prototype, {\r\n\t_type: undefined,\r\n\r\n\tinitialize: function() {\r\n\t\tthis.hidden = false;\r\n\t},\r\n\r\n\tpivot: function() {\r\n\t\tvar me = this;\r\n\t\tif (!me._view) {\r\n\t\t\tme._view = helpers$1.extend({}, me._model);\r\n\t\t}\r\n\t\tme._start = {};\r\n\t\treturn me;\r\n\t},\r\n\r\n\ttransition: function(ease) {\r\n\t\tvar me = this;\r\n\t\tvar model = me._model;\r\n\t\tvar start = me._start;\r\n\t\tvar view = me._view;\r\n\r\n\t\t// No animation -> No Transition\r\n\t\tif (!model || ease === 1) {\r\n\t\t\tme._view = helpers$1.extend({}, model);\r\n\t\t\tme._start = null;\r\n\t\t\treturn me;\r\n\t\t}\r\n\r\n\t\tif (!view) {\r\n\t\t\tview = me._view = {};\r\n\t\t}\r\n\r\n\t\tif (!start) {\r\n\t\t\tstart = me._start = {};\r\n\t\t}\r\n\r\n\t\tinterpolate(start, view, model, ease);\r\n\r\n\t\treturn me;\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\treturn {\r\n\t\t\tx: this._model.x,\r\n\t\t\ty: this._model.y\r\n\t\t};\r\n\t},\r\n\r\n\thasValue: function() {\r\n\t\treturn helpers$1.isNumber(this._model.x) && helpers$1.isNumber(this._model.y);\r\n\t}\r\n});\r\n\r\nElement.extend = helpers$1.inherits;\r\n\r\nvar core_element = Element;\r\n\r\nvar exports$3 = core_element.extend({\r\n\tchart: null, // the animation associated chart instance\r\n\tcurrentStep: 0, // the current animation step\r\n\tnumSteps: 60, // default number of steps\r\n\teasing: '', // the easing to use for this animation\r\n\trender: null, // render function used by the animation service\r\n\r\n\tonAnimationProgress: null, // user specified callback to fire on each step of the animation\r\n\tonAnimationComplete: null, // user specified callback to fire when the animation finishes\r\n});\r\n\r\nvar core_animation = exports$3;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.Animation instead\r\n * @prop Chart.Animation#animationObject\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n */\r\nObject.defineProperty(exports$3.prototype, 'animationObject', {\r\n\tget: function() {\r\n\t\treturn this;\r\n\t}\r\n});\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.Animation#chart instead\r\n * @prop Chart.Animation#chartInstance\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n */\r\nObject.defineProperty(exports$3.prototype, 'chartInstance', {\r\n\tget: function() {\r\n\t\treturn this.chart;\r\n\t},\r\n\tset: function(value) {\r\n\t\tthis.chart = value;\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tanimation: {\r\n\t\tduration: 1000,\r\n\t\teasing: 'easeOutQuart',\r\n\t\tonProgress: helpers$1.noop,\r\n\t\tonComplete: helpers$1.noop\r\n\t}\r\n});\r\n\r\nvar core_animations = {\r\n\tanimations: [],\r\n\trequest: null,\r\n\r\n\t/**\r\n\t * @param {Chart} chart - The chart to animate.\r\n\t * @param {Chart.Animation} animation - The animation that we will animate.\r\n\t * @param {number} duration - The animation duration in ms.\r\n\t * @param {boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions\r\n\t */\r\n\taddAnimation: function(chart, animation, duration, lazy) {\r\n\t\tvar animations = this.animations;\r\n\t\tvar i, ilen;\r\n\r\n\t\tanimation.chart = chart;\r\n\t\tanimation.startTime = Date.now();\r\n\t\tanimation.duration = duration;\r\n\r\n\t\tif (!lazy) {\r\n\t\t\tchart.animating = true;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = animations.length; i < ilen; ++i) {\r\n\t\t\tif (animations[i].chart === chart) {\r\n\t\t\t\tanimations[i] = animation;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tanimations.push(animation);\r\n\r\n\t\t// If there are no animations queued, manually kickstart a digest, for lack of a better word\r\n\t\tif (animations.length === 1) {\r\n\t\t\tthis.requestAnimationFrame();\r\n\t\t}\r\n\t},\r\n\r\n\tcancelAnimation: function(chart) {\r\n\t\tvar index = helpers$1.findIndex(this.animations, function(animation) {\r\n\t\t\treturn animation.chart === chart;\r\n\t\t});\r\n\r\n\t\tif (index !== -1) {\r\n\t\t\tthis.animations.splice(index, 1);\r\n\t\t\tchart.animating = false;\r\n\t\t}\r\n\t},\r\n\r\n\trequestAnimationFrame: function() {\r\n\t\tvar me = this;\r\n\t\tif (me.request === null) {\r\n\t\t\t// Skip animation frame requests until the active one is executed.\r\n\t\t\t// This can happen when processing mouse events, e.g. 'mousemove'\r\n\t\t\t// and 'mouseout' events will trigger multiple renders.\r\n\t\t\tme.request = helpers$1.requestAnimFrame.call(window, function() {\r\n\t\t\t\tme.request = null;\r\n\t\t\t\tme.startDigest();\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tstartDigest: function() {\r\n\t\tvar me = this;\r\n\r\n\t\tme.advance();\r\n\r\n\t\t// Do we have more stuff to animate?\r\n\t\tif (me.animations.length > 0) {\r\n\t\t\tme.requestAnimationFrame();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tadvance: function() {\r\n\t\tvar animations = this.animations;\r\n\t\tvar animation, chart, numSteps, nextStep;\r\n\t\tvar i = 0;\r\n\r\n\t\t// 1 animation per chart, so we are looping charts here\r\n\t\twhile (i < animations.length) {\r\n\t\t\tanimation = animations[i];\r\n\t\t\tchart = animation.chart;\r\n\t\t\tnumSteps = animation.numSteps;\r\n\r\n\t\t\t// Make sure that currentStep starts at 1\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/6104\r\n\t\t\tnextStep = Math.floor((Date.now() - animation.startTime) / animation.duration * numSteps) + 1;\r\n\t\t\tanimation.currentStep = Math.min(nextStep, numSteps);\r\n\r\n\t\t\thelpers$1.callback(animation.render, [chart, animation], chart);\r\n\t\t\thelpers$1.callback(animation.onAnimationProgress, [animation], chart);\r\n\r\n\t\t\tif (animation.currentStep >= numSteps) {\r\n\t\t\t\thelpers$1.callback(animation.onAnimationComplete, [animation], chart);\r\n\t\t\t\tchart.animating = false;\r\n\t\t\t\tanimations.splice(i, 1);\r\n\t\t\t} else {\r\n\t\t\t\t++i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar resolve = helpers$1.options.resolve;\r\n\r\nvar arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\r\n\r\n/**\r\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\r\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\r\n * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.\r\n */\r\nfunction listenArrayEvents(array, listener) {\r\n\tif (array._chartjs) {\r\n\t\tarray._chartjs.listeners.push(listener);\r\n\t\treturn;\r\n\t}\r\n\r\n\tObject.defineProperty(array, '_chartjs', {\r\n\t\tconfigurable: true,\r\n\t\tenumerable: false,\r\n\t\tvalue: {\r\n\t\t\tlisteners: [listener]\r\n\t\t}\r\n\t});\r\n\r\n\tarrayEvents.forEach(function(key) {\r\n\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\r\n\t\tvar base = array[key];\r\n\r\n\t\tObject.defineProperty(array, key, {\r\n\t\t\tconfigurable: true,\r\n\t\t\tenumerable: false,\r\n\t\t\tvalue: function() {\r\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\t\t\tvar res = base.apply(this, args);\r\n\r\n\t\t\t\thelpers$1.each(array._chartjs.listeners, function(object) {\r\n\t\t\t\t\tif (typeof object[method] === 'function') {\r\n\t\t\t\t\t\tobject[method].apply(object, args);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}\r\n\r\n/**\r\n * Removes the given array event listener and cleanup extra attached properties (such as\r\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\r\n */\r\nfunction unlistenArrayEvents(array, listener) {\r\n\tvar stub = array._chartjs;\r\n\tif (!stub) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar listeners = stub.listeners;\r\n\tvar index = listeners.indexOf(listener);\r\n\tif (index !== -1) {\r\n\t\tlisteners.splice(index, 1);\r\n\t}\r\n\r\n\tif (listeners.length > 0) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tarrayEvents.forEach(function(key) {\r\n\t\tdelete array[key];\r\n\t});\r\n\r\n\tdelete array._chartjs;\r\n}\r\n\r\n// Base class for all dataset controllers (line, bar, etc)\r\nvar DatasetController = function(chart, datasetIndex) {\r\n\tthis.initialize(chart, datasetIndex);\r\n};\r\n\r\nhelpers$1.extend(DatasetController.prototype, {\r\n\r\n\t/**\r\n\t * Element type used to generate a meta dataset (e.g. Chart.element.Line).\r\n\t * @type {Chart.core.element}\r\n\t */\r\n\tdatasetElementType: null,\r\n\r\n\t/**\r\n\t * Element type used to generate a meta data (e.g. Chart.element.Point).\r\n\t * @type {Chart.core.element}\r\n\t */\r\n\tdataElementType: null,\r\n\r\n\t/**\r\n\t * Dataset element option keys to be resolved in _resolveDatasetElementOptions.\r\n\t * A derived controller may override this to resolve controller-specific options.\r\n\t * The keys defined here are for backward compatibility for legend styles.\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderColor',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'borderWidth'\r\n\t],\r\n\r\n\t/**\r\n\t * Data element option keys to be resolved in _resolveDataElementOptions.\r\n\t * A derived controller may override this to resolve controller-specific options.\r\n\t * The keys defined here are for backward compatibility for legend styles.\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'pointStyle'\r\n\t],\r\n\r\n\tinitialize: function(chart, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tme.chart = chart;\r\n\t\tme.index = datasetIndex;\r\n\t\tme.linkScales();\r\n\t\tme.addElements();\r\n\t\tme._type = me.getMeta().type;\r\n\t},\r\n\r\n\tupdateIndex: function(datasetIndex) {\r\n\t\tthis.index = datasetIndex;\r\n\t},\r\n\r\n\tlinkScales: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar chart = me.chart;\r\n\t\tvar scales = chart.scales;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar scalesOpts = chart.options.scales;\r\n\r\n\t\tif (meta.xAxisID === null || !(meta.xAxisID in scales) || dataset.xAxisID) {\r\n\t\t\tmeta.xAxisID = dataset.xAxisID || scalesOpts.xAxes[0].id;\r\n\t\t}\r\n\t\tif (meta.yAxisID === null || !(meta.yAxisID in scales) || dataset.yAxisID) {\r\n\t\t\tmeta.yAxisID = dataset.yAxisID || scalesOpts.yAxes[0].id;\r\n\t\t}\r\n\t},\r\n\r\n\tgetDataset: function() {\r\n\t\treturn this.chart.data.datasets[this.index];\r\n\t},\r\n\r\n\tgetMeta: function() {\r\n\t\treturn this.chart.getDatasetMeta(this.index);\r\n\t},\r\n\r\n\tgetScaleForId: function(scaleID) {\r\n\t\treturn this.chart.scales[scaleID];\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.getMeta().yAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.getMeta().xAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScale: function() {\r\n\t\treturn this.getScaleForId(this._getValueScaleId());\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScale: function() {\r\n\t\treturn this.getScaleForId(this._getIndexScaleId());\r\n\t},\r\n\r\n\treset: function() {\r\n\t\tthis._update(true);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tdestroy: function() {\r\n\t\tif (this._data) {\r\n\t\t\tunlistenArrayEvents(this._data, this);\r\n\t\t}\r\n\t},\r\n\r\n\tcreateMetaDataset: function() {\r\n\t\tvar me = this;\r\n\t\tvar type = me.datasetElementType;\r\n\t\treturn type && new type({\r\n\t\t\t_chart: me.chart,\r\n\t\t\t_datasetIndex: me.index\r\n\t\t});\r\n\t},\r\n\r\n\tcreateMetaData: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar type = me.dataElementType;\r\n\t\treturn type && new type({\r\n\t\t\t_chart: me.chart,\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index\r\n\t\t});\r\n\t},\r\n\r\n\taddElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar data = me.getDataset().data || [];\r\n\t\tvar metaData = meta.data;\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = data.length; i < ilen; ++i) {\r\n\t\t\tmetaData[i] = metaData[i] || me.createMetaData(i);\r\n\t\t}\r\n\r\n\t\tmeta.dataset = meta.dataset || me.createMetaDataset();\r\n\t},\r\n\r\n\taddElementAndReset: function(index) {\r\n\t\tvar element = this.createMetaData(index);\r\n\t\tthis.getMeta().data.splice(index, 0, element);\r\n\t\tthis.updateElement(element, index, true);\r\n\t},\r\n\r\n\tbuildOrUpdateElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar data = dataset.data || (dataset.data = []);\r\n\r\n\t\t// In order to correctly handle data addition/deletion animation (an thus simulate\r\n\t\t// real-time charts), we need to monitor these data modifications and synchronize\r\n\t\t// the internal meta data accordingly.\r\n\t\tif (me._data !== data) {\r\n\t\t\tif (me._data) {\r\n\t\t\t\t// This case happens when the user replaced the data array instance.\r\n\t\t\t\tunlistenArrayEvents(me._data, me);\r\n\t\t\t}\r\n\r\n\t\t\tif (data && Object.isExtensible(data)) {\r\n\t\t\t\tlistenArrayEvents(data, me);\r\n\t\t\t}\r\n\t\t\tme._data = data;\r\n\t\t}\r\n\r\n\t\t// Re-sync meta data in case the user replaced the data array or if we missed\r\n\t\t// any updates and so make sure that we handle number of datapoints changing.\r\n\t\tme.resyncElements();\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the merged user-supplied and default dataset-level options\r\n\t * @private\r\n\t */\r\n\t_configure: function() {\r\n\t\tvar me = this;\r\n\t\tme._config = helpers$1.merge({}, [\r\n\t\t\tme.chart.options.datasets[me._type],\r\n\t\t\tme.getDataset(),\r\n\t\t], {\r\n\t\t\tmerger: function(key, target, source) {\r\n\t\t\t\tif (key !== '_meta' && key !== 'data') {\r\n\t\t\t\t\thelpers$1._merger(key, target, source);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t_update: function(reset) {\r\n\t\tvar me = this;\r\n\t\tme._configure();\r\n\t\tme._cachedDataOpts = null;\r\n\t\tme.update(reset);\r\n\t},\r\n\r\n\tupdate: helpers$1.noop,\r\n\r\n\ttransition: function(easingValue) {\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar elements = meta.data || [];\r\n\t\tvar ilen = elements.length;\r\n\t\tvar i = 0;\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\telements[i].transition(easingValue);\r\n\t\t}\r\n\r\n\t\tif (meta.dataset) {\r\n\t\t\tmeta.dataset.transition(easingValue);\r\n\t\t}\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar elements = meta.data || [];\r\n\t\tvar ilen = elements.length;\r\n\t\tvar i = 0;\r\n\r\n\t\tif (meta.dataset) {\r\n\t\t\tmeta.dataset.draw();\r\n\t\t}\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\telements[i].draw();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Returns a set of predefined style properties that should be used to represent the dataset\r\n\t * or the data if the index is specified\r\n\t * @param {number} index - data index\r\n\t * @return {IStyleInterface} style object\r\n\t */\r\n\tgetStyle: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar dataset = meta.dataset;\r\n\t\tvar style;\r\n\r\n\t\tme._configure();\r\n\t\tif (dataset && index === undefined) {\r\n\t\t\tstyle = me._resolveDatasetElementOptions(dataset || {});\r\n\t\t} else {\r\n\t\t\tindex = index || 0;\r\n\t\t\tstyle = me._resolveDataElementOptions(meta.data[index] || {}, index);\r\n\t\t}\r\n\r\n\t\tif (style.fill === false || style.fill === null) {\r\n\t\t\tstyle.backgroundColor = style.borderColor;\r\n\t\t}\r\n\r\n\t\treturn style;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function(element, hover) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar datasetOpts = me._config;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar options = chart.options.elements[me.datasetElementType.prototype._type] || {};\r\n\t\tvar elementOptions = me._datasetElementOptions;\r\n\t\tvar values = {};\r\n\t\tvar i, ilen, key, readKey;\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataset: me.getDataset(),\r\n\t\t\tdatasetIndex: me.index,\r\n\t\t\thover: hover\r\n\t\t};\r\n\r\n\t\tfor (i = 0, ilen = elementOptions.length; i < ilen; ++i) {\r\n\t\t\tkey = elementOptions[i];\r\n\t\t\treadKey = hover ? 'hover' + key.charAt(0).toUpperCase() + key.slice(1) : key;\r\n\t\t\tvalues[key] = resolve([\r\n\t\t\t\tcustom[readKey],\r\n\t\t\t\tdatasetOpts[readKey],\r\n\t\t\t\toptions[readKey]\r\n\t\t\t], context);\r\n\t\t}\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function(element, index) {\r\n\t\tvar me = this;\r\n\t\tvar custom = element && element.custom;\r\n\t\tvar cached = me._cachedDataOpts;\r\n\t\tif (cached && !custom) {\r\n\t\t\treturn cached;\r\n\t\t}\r\n\t\tvar chart = me.chart;\r\n\t\tvar datasetOpts = me._config;\r\n\t\tvar options = chart.options.elements[me.dataElementType.prototype._type] || {};\r\n\t\tvar elementOptions = me._dataElementOptions;\r\n\t\tvar values = {};\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: me.getDataset(),\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\t// `resolve` sets cacheable to `false` if any option is indexed or scripted\r\n\t\tvar info = {cacheable: !custom};\r\n\r\n\t\tvar keys, i, ilen, key;\r\n\r\n\t\tcustom = custom || {};\r\n\r\n\t\tif (helpers$1.isArray(elementOptions)) {\r\n\t\t\tfor (i = 0, ilen = elementOptions.length; i < ilen; ++i) {\r\n\t\t\t\tkey = elementOptions[i];\r\n\t\t\t\tvalues[key] = resolve([\r\n\t\t\t\t\tcustom[key],\r\n\t\t\t\t\tdatasetOpts[key],\r\n\t\t\t\t\toptions[key]\r\n\t\t\t\t], context, index, info);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tkeys = Object.keys(elementOptions);\r\n\t\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\t\t\tkey = keys[i];\r\n\t\t\t\tvalues[key] = resolve([\r\n\t\t\t\t\tcustom[key],\r\n\t\t\t\t\tdatasetOpts[elementOptions[key]],\r\n\t\t\t\t\tdatasetOpts[key],\r\n\t\t\t\t\toptions[key]\r\n\t\t\t\t], context, index, info);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (info.cacheable) {\r\n\t\t\tme._cachedDataOpts = Object.freeze(values);\r\n\t\t}\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tremoveHoverStyle: function(element) {\r\n\t\thelpers$1.merge(element._model, element.$previousStyle || {});\r\n\t\tdelete element.$previousStyle;\r\n\t},\r\n\r\n\tsetHoverStyle: function(element) {\r\n\t\tvar dataset = this.chart.data.datasets[element._datasetIndex];\r\n\t\tvar index = element._index;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar model = element._model;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\telement.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = resolve([custom.hoverBackgroundColor, dataset.hoverBackgroundColor, getHoverColor(model.backgroundColor)], undefined, index);\r\n\t\tmodel.borderColor = resolve([custom.hoverBorderColor, dataset.hoverBorderColor, getHoverColor(model.borderColor)], undefined, index);\r\n\t\tmodel.borderWidth = resolve([custom.hoverBorderWidth, dataset.hoverBorderWidth, model.borderWidth], undefined, index);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_removeDatasetHoverStyle: function() {\r\n\t\tvar element = this.getMeta().dataset;\r\n\r\n\t\tif (element) {\r\n\t\t\tthis.removeHoverStyle(element);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_setDatasetHoverStyle: function() {\r\n\t\tvar element = this.getMeta().dataset;\r\n\t\tvar prev = {};\r\n\t\tvar i, ilen, key, keys, hoverOptions, model;\r\n\r\n\t\tif (!element) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmodel = element._model;\r\n\t\thoverOptions = this._resolveDatasetElementOptions(element, true);\r\n\r\n\t\tkeys = Object.keys(hoverOptions);\r\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\t\tkey = keys[i];\r\n\t\t\tprev[key] = model[key];\r\n\t\t\tmodel[key] = hoverOptions[key];\r\n\t\t}\r\n\r\n\t\telement.$previousStyle = prev;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tresyncElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar data = me.getDataset().data;\r\n\t\tvar numMeta = meta.data.length;\r\n\t\tvar numData = data.length;\r\n\r\n\t\tif (numData < numMeta) {\r\n\t\t\tmeta.data.splice(numData, numMeta - numData);\r\n\t\t} else if (numData > numMeta) {\r\n\t\t\tme.insertElements(numMeta, numData - numMeta);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tinsertElements: function(start, count) {\r\n\t\tfor (var i = 0; i < count; ++i) {\r\n\t\t\tthis.addElementAndReset(start + i);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataPush: function() {\r\n\t\tvar count = arguments.length;\r\n\t\tthis.insertElements(this.getDataset().data.length - count, count);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataPop: function() {\r\n\t\tthis.getMeta().data.pop();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataShift: function() {\r\n\t\tthis.getMeta().data.shift();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataSplice: function(start, count) {\r\n\t\tthis.getMeta().data.splice(start, count);\r\n\t\tthis.insertElements(start, arguments.length - 2);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataUnshift: function() {\r\n\t\tthis.insertElements(0, arguments.length);\r\n\t}\r\n});\r\n\r\nDatasetController.extend = helpers$1.inherits;\r\n\r\nvar core_datasetController = DatasetController;\r\n\r\nvar TAU = Math.PI * 2;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tarc: {\r\n\t\t\tbackgroundColor: core_defaults.global.defaultColor,\r\n\t\t\tborderColor: '#fff',\r\n\t\t\tborderWidth: 2,\r\n\t\t\tborderAlign: 'center'\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction clipArc(ctx, arc) {\r\n\tvar startAngle = arc.startAngle;\r\n\tvar endAngle = arc.endAngle;\r\n\tvar pixelMargin = arc.pixelMargin;\r\n\tvar angleMargin = pixelMargin / arc.outerRadius;\r\n\tvar x = arc.x;\r\n\tvar y = arc.y;\r\n\r\n\t// Draw an inner border by cliping the arc and drawing a double-width border\r\n\t// Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\r\n\tctx.beginPath();\r\n\tctx.arc(x, y, arc.outerRadius, startAngle - angleMargin, endAngle + angleMargin);\r\n\tif (arc.innerRadius > pixelMargin) {\r\n\t\tangleMargin = pixelMargin / arc.innerRadius;\r\n\t\tctx.arc(x, y, arc.innerRadius - pixelMargin, endAngle + angleMargin, startAngle - angleMargin, true);\r\n\t} else {\r\n\t\tctx.arc(x, y, pixelMargin, endAngle + Math.PI / 2, startAngle - Math.PI / 2);\r\n\t}\r\n\tctx.closePath();\r\n\tctx.clip();\r\n}\r\n\r\nfunction drawFullCircleBorders(ctx, vm, arc, inner) {\r\n\tvar endAngle = arc.endAngle;\r\n\tvar i;\r\n\r\n\tif (inner) {\r\n\t\tarc.endAngle = arc.startAngle + TAU;\r\n\t\tclipArc(ctx, arc);\r\n\t\tarc.endAngle = endAngle;\r\n\t\tif (arc.endAngle === arc.startAngle && arc.fullCircles) {\r\n\t\t\tarc.endAngle += TAU;\r\n\t\t\tarc.fullCircles--;\r\n\t\t}\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.startAngle + TAU, arc.startAngle, true);\r\n\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\tctx.stroke();\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.startAngle + TAU);\r\n\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\tctx.stroke();\r\n\t}\r\n}\r\n\r\nfunction drawBorder(ctx, vm, arc) {\r\n\tvar inner = vm.borderAlign === 'inner';\r\n\r\n\tif (inner) {\r\n\t\tctx.lineWidth = vm.borderWidth * 2;\r\n\t\tctx.lineJoin = 'round';\r\n\t} else {\r\n\t\tctx.lineWidth = vm.borderWidth;\r\n\t\tctx.lineJoin = 'bevel';\r\n\t}\r\n\r\n\tif (arc.fullCircles) {\r\n\t\tdrawFullCircleBorders(ctx, vm, arc, inner);\r\n\t}\r\n\r\n\tif (inner) {\r\n\t\tclipArc(ctx, arc);\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.endAngle);\r\n\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\tctx.closePath();\r\n\tctx.stroke();\r\n}\r\n\r\nvar element_arc = core_element.extend({\r\n\t_type: 'arc',\r\n\r\n\tinLabelRange: function(mouseX) {\r\n\t\tvar vm = this._view;\r\n\r\n\t\tif (vm) {\r\n\t\t\treturn (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\tinRange: function(chartX, chartY) {\r\n\t\tvar vm = this._view;\r\n\r\n\t\tif (vm) {\r\n\t\t\tvar pointRelativePosition = helpers$1.getAngleFromPoint(vm, {x: chartX, y: chartY});\r\n\t\t\tvar angle = pointRelativePosition.angle;\r\n\t\t\tvar distance = pointRelativePosition.distance;\r\n\r\n\t\t\t// Sanitise angle range\r\n\t\t\tvar startAngle = vm.startAngle;\r\n\t\t\tvar endAngle = vm.endAngle;\r\n\t\t\twhile (endAngle < startAngle) {\r\n\t\t\t\tendAngle += TAU;\r\n\t\t\t}\r\n\t\t\twhile (angle > endAngle) {\r\n\t\t\t\tangle -= TAU;\r\n\t\t\t}\r\n\t\t\twhile (angle < startAngle) {\r\n\t\t\t\tangle += TAU;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if within the range of the open/close angle\r\n\t\t\tvar betweenAngles = (angle >= startAngle && angle <= endAngle);\r\n\t\t\tvar withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);\r\n\r\n\t\t\treturn (betweenAngles && withinRadius);\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar halfAngle = (vm.startAngle + vm.endAngle) / 2;\r\n\t\tvar halfRadius = (vm.innerRadius + vm.outerRadius) / 2;\r\n\t\treturn {\r\n\t\t\tx: vm.x + Math.cos(halfAngle) * halfRadius,\r\n\t\t\ty: vm.y + Math.sin(halfAngle) * halfRadius\r\n\t\t};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2);\r\n\t\tvar rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;\r\n\r\n\t\treturn {\r\n\t\t\tx: vm.x + (Math.cos(centreAngle) * rangeFromCentre),\r\n\t\t\ty: vm.y + (Math.sin(centreAngle) * rangeFromCentre)\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar vm = this._view;\r\n\t\tvar pixelMargin = (vm.borderAlign === 'inner') ? 0.33 : 0;\r\n\t\tvar arc = {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y,\r\n\t\t\tinnerRadius: vm.innerRadius,\r\n\t\t\touterRadius: Math.max(vm.outerRadius - pixelMargin, 0),\r\n\t\t\tpixelMargin: pixelMargin,\r\n\t\t\tstartAngle: vm.startAngle,\r\n\t\t\tendAngle: vm.endAngle,\r\n\t\t\tfullCircles: Math.floor(vm.circumference / TAU)\r\n\t\t};\r\n\t\tvar i;\r\n\r\n\t\tctx.save();\r\n\r\n\t\tctx.fillStyle = vm.backgroundColor;\r\n\t\tctx.strokeStyle = vm.borderColor;\r\n\r\n\t\tif (arc.fullCircles) {\r\n\t\t\tarc.endAngle = arc.startAngle + TAU;\r\n\t\t\tctx.beginPath();\r\n\t\t\tctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle);\r\n\t\t\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\t\t\tctx.closePath();\r\n\t\t\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\t\t\tctx.fill();\r\n\t\t\t}\r\n\t\t\tarc.endAngle = arc.startAngle + vm.circumference % TAU;\r\n\t\t}\r\n\r\n\t\tctx.beginPath();\r\n\t\tctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle);\r\n\t\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\t\tctx.closePath();\r\n\t\tctx.fill();\r\n\r\n\t\tif (vm.borderWidth) {\r\n\t\t\tdrawBorder(ctx, vm, arc);\r\n\t\t}\r\n\r\n\t\tctx.restore();\r\n\t}\r\n});\r\n\r\nvar valueOrDefault$1 = helpers$1.valueOrDefault;\r\n\r\nvar defaultColor = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tline: {\r\n\t\t\ttension: 0.4,\r\n\t\t\tbackgroundColor: defaultColor,\r\n\t\t\tborderWidth: 3,\r\n\t\t\tborderColor: defaultColor,\r\n\t\t\tborderCapStyle: 'butt',\r\n\t\t\tborderDash: [],\r\n\t\t\tborderDashOffset: 0.0,\r\n\t\t\tborderJoinStyle: 'miter',\r\n\t\t\tcapBezierPoints: true,\r\n\t\t\tfill: true, // do we fill in the area between the line and its base axis\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar element_line = core_element.extend({\r\n\t_type: 'line',\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar vm = me._view;\r\n\t\tvar ctx = me._chart.ctx;\r\n\t\tvar spanGaps = vm.spanGaps;\r\n\t\tvar points = me._children.slice(); // clone array\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar globalOptionLineElements = globalDefaults.elements.line;\r\n\t\tvar lastDrawnIndex = -1;\r\n\t\tvar closePath = me._loop;\r\n\t\tvar index, previous, currentVM;\r\n\r\n\t\tif (!points.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (me._loop) {\r\n\t\t\tfor (index = 0; index < points.length; ++index) {\r\n\t\t\t\tprevious = helpers$1.previousItem(points, index);\r\n\t\t\t\t// If the line has an open path, shift the point array\r\n\t\t\t\tif (!points[index]._view.skip && previous._view.skip) {\r\n\t\t\t\t\tpoints = points.slice(index).concat(points.slice(0, index));\r\n\t\t\t\t\tclosePath = spanGaps;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// If the line has a close path, add the first point again\r\n\t\t\tif (closePath) {\r\n\t\t\t\tpoints.push(points[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tctx.save();\r\n\r\n\t\t// Stroke Line Options\r\n\t\tctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;\r\n\r\n\t\t// IE 9 and 10 do not support line dash\r\n\t\tif (ctx.setLineDash) {\r\n\t\t\tctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);\r\n\t\t}\r\n\r\n\t\tctx.lineDashOffset = valueOrDefault$1(vm.borderDashOffset, globalOptionLineElements.borderDashOffset);\r\n\t\tctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;\r\n\t\tctx.lineWidth = valueOrDefault$1(vm.borderWidth, globalOptionLineElements.borderWidth);\r\n\t\tctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;\r\n\r\n\t\t// Stroke Line\r\n\t\tctx.beginPath();\r\n\r\n\t\t// First point moves to it's starting position no matter what\r\n\t\tcurrentVM = points[0]._view;\r\n\t\tif (!currentVM.skip) {\r\n\t\t\tctx.moveTo(currentVM.x, currentVM.y);\r\n\t\t\tlastDrawnIndex = 0;\r\n\t\t}\r\n\r\n\t\tfor (index = 1; index < points.length; ++index) {\r\n\t\t\tcurrentVM = points[index]._view;\r\n\t\t\tprevious = lastDrawnIndex === -1 ? helpers$1.previousItem(points, index) : points[lastDrawnIndex];\r\n\r\n\t\t\tif (!currentVM.skip) {\r\n\t\t\t\tif ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {\r\n\t\t\t\t\t// There was a gap and this is the first point after the gap\r\n\t\t\t\t\tctx.moveTo(currentVM.x, currentVM.y);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Line to next point\r\n\t\t\t\t\thelpers$1.canvas.lineTo(ctx, previous._view, currentVM);\r\n\t\t\t\t}\r\n\t\t\t\tlastDrawnIndex = index;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (closePath) {\r\n\t\t\tctx.closePath();\r\n\t\t}\r\n\r\n\t\tctx.stroke();\r\n\t\tctx.restore();\r\n\t}\r\n});\r\n\r\nvar valueOrDefault$2 = helpers$1.valueOrDefault;\r\n\r\nvar defaultColor$1 = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tpoint: {\r\n\t\t\tradius: 3,\r\n\t\t\tpointStyle: 'circle',\r\n\t\t\tbackgroundColor: defaultColor$1,\r\n\t\t\tborderColor: defaultColor$1,\r\n\t\t\tborderWidth: 1,\r\n\t\t\t// Hover\r\n\t\t\thitRadius: 1,\r\n\t\t\thoverRadius: 4,\r\n\t\t\thoverBorderWidth: 1\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction xRange(mouseX) {\r\n\tvar vm = this._view;\r\n\treturn vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false;\r\n}\r\n\r\nfunction yRange(mouseY) {\r\n\tvar vm = this._view;\r\n\treturn vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false;\r\n}\r\n\r\nvar element_point = core_element.extend({\r\n\t_type: 'point',\r\n\r\n\tinRange: function(mouseX, mouseY) {\r\n\t\tvar vm = this._view;\r\n\t\treturn vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;\r\n\t},\r\n\r\n\tinLabelRange: xRange,\r\n\tinXRange: xRange,\r\n\tinYRange: yRange,\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y\r\n\t\t};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\treturn Math.PI * Math.pow(this._view.radius, 2);\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y,\r\n\t\t\tpadding: vm.radius + vm.borderWidth\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function(chartArea) {\r\n\t\tvar vm = this._view;\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar pointStyle = vm.pointStyle;\r\n\t\tvar rotation = vm.rotation;\r\n\t\tvar radius = vm.radius;\r\n\t\tvar x = vm.x;\r\n\t\tvar y = vm.y;\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar defaultColor = globalDefaults.defaultColor; // eslint-disable-line no-shadow\r\n\r\n\t\tif (vm.skip) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Clipping for Points.\r\n\t\tif (chartArea === undefined || helpers$1.canvas._isPointInArea(vm, chartArea)) {\r\n\t\t\tctx.strokeStyle = vm.borderColor || defaultColor;\r\n\t\t\tctx.lineWidth = valueOrDefault$2(vm.borderWidth, globalDefaults.elements.point.borderWidth);\r\n\t\t\tctx.fillStyle = vm.backgroundColor || defaultColor;\r\n\t\t\thelpers$1.canvas.drawPoint(ctx, pointStyle, radius, x, y, rotation);\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar defaultColor$2 = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\trectangle: {\r\n\t\t\tbackgroundColor: defaultColor$2,\r\n\t\t\tborderColor: defaultColor$2,\r\n\t\t\tborderSkipped: 'bottom',\r\n\t\t\tborderWidth: 0\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction isVertical(vm) {\r\n\treturn vm && vm.width !== undefined;\r\n}\r\n\r\n/**\r\n * Helper function to get the bounds of the bar regardless of the orientation\r\n * @param bar {Chart.Element.Rectangle} the bar\r\n * @return {Bounds} bounds of the bar\r\n * @private\r\n */\r\nfunction getBarBounds(vm) {\r\n\tvar x1, x2, y1, y2, half;\r\n\r\n\tif (isVertical(vm)) {\r\n\t\thalf = vm.width / 2;\r\n\t\tx1 = vm.x - half;\r\n\t\tx2 = vm.x + half;\r\n\t\ty1 = Math.min(vm.y, vm.base);\r\n\t\ty2 = Math.max(vm.y, vm.base);\r\n\t} else {\r\n\t\thalf = vm.height / 2;\r\n\t\tx1 = Math.min(vm.x, vm.base);\r\n\t\tx2 = Math.max(vm.x, vm.base);\r\n\t\ty1 = vm.y - half;\r\n\t\ty2 = vm.y + half;\r\n\t}\r\n\r\n\treturn {\r\n\t\tleft: x1,\r\n\t\ttop: y1,\r\n\t\tright: x2,\r\n\t\tbottom: y2\r\n\t};\r\n}\r\n\r\nfunction swap(orig, v1, v2) {\r\n\treturn orig === v1 ? v2 : orig === v2 ? v1 : orig;\r\n}\r\n\r\nfunction parseBorderSkipped(vm) {\r\n\tvar edge = vm.borderSkipped;\r\n\tvar res = {};\r\n\r\n\tif (!edge) {\r\n\t\treturn res;\r\n\t}\r\n\r\n\tif (vm.horizontal) {\r\n\t\tif (vm.base > vm.x) {\r\n\t\t\tedge = swap(edge, 'left', 'right');\r\n\t\t}\r\n\t} else if (vm.base < vm.y) {\r\n\t\tedge = swap(edge, 'bottom', 'top');\r\n\t}\r\n\r\n\tres[edge] = true;\r\n\treturn res;\r\n}\r\n\r\nfunction parseBorderWidth(vm, maxW, maxH) {\r\n\tvar value = vm.borderWidth;\r\n\tvar skip = parseBorderSkipped(vm);\r\n\tvar t, r, b, l;\r\n\r\n\tif (helpers$1.isObject(value)) {\r\n\t\tt = +value.top || 0;\r\n\t\tr = +value.right || 0;\r\n\t\tb = +value.bottom || 0;\r\n\t\tl = +value.left || 0;\r\n\t} else {\r\n\t\tt = r = b = l = +value || 0;\r\n\t}\r\n\r\n\treturn {\r\n\t\tt: skip.top || (t < 0) ? 0 : t > maxH ? maxH : t,\r\n\t\tr: skip.right || (r < 0) ? 0 : r > maxW ? maxW : r,\r\n\t\tb: skip.bottom || (b < 0) ? 0 : b > maxH ? maxH : b,\r\n\t\tl: skip.left || (l < 0) ? 0 : l > maxW ? maxW : l\r\n\t};\r\n}\r\n\r\nfunction boundingRects(vm) {\r\n\tvar bounds = getBarBounds(vm);\r\n\tvar width = bounds.right - bounds.left;\r\n\tvar height = bounds.bottom - bounds.top;\r\n\tvar border = parseBorderWidth(vm, width / 2, height / 2);\r\n\r\n\treturn {\r\n\t\touter: {\r\n\t\t\tx: bounds.left,\r\n\t\t\ty: bounds.top,\r\n\t\t\tw: width,\r\n\t\t\th: height\r\n\t\t},\r\n\t\tinner: {\r\n\t\t\tx: bounds.left + border.l,\r\n\t\t\ty: bounds.top + border.t,\r\n\t\t\tw: width - border.l - border.r,\r\n\t\t\th: height - border.t - border.b\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction inRange(vm, x, y) {\r\n\tvar skipX = x === null;\r\n\tvar skipY = y === null;\r\n\tvar bounds = !vm || (skipX && skipY) ? false : getBarBounds(vm);\r\n\r\n\treturn bounds\r\n\t\t&& (skipX || x >= bounds.left && x <= bounds.right)\r\n\t\t&& (skipY || y >= bounds.top && y <= bounds.bottom);\r\n}\r\n\r\nvar element_rectangle = core_element.extend({\r\n\t_type: 'rectangle',\r\n\r\n\tdraw: function() {\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar vm = this._view;\r\n\t\tvar rects = boundingRects(vm);\r\n\t\tvar outer = rects.outer;\r\n\t\tvar inner = rects.inner;\r\n\r\n\t\tctx.fillStyle = vm.backgroundColor;\r\n\t\tctx.fillRect(outer.x, outer.y, outer.w, outer.h);\r\n\r\n\t\tif (outer.w === inner.w && outer.h === inner.h) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.save();\r\n\t\tctx.beginPath();\r\n\t\tctx.rect(outer.x, outer.y, outer.w, outer.h);\r\n\t\tctx.clip();\r\n\t\tctx.fillStyle = vm.borderColor;\r\n\t\tctx.rect(inner.x, inner.y, inner.w, inner.h);\r\n\t\tctx.fill('evenodd');\r\n\t\tctx.restore();\r\n\t},\r\n\r\n\theight: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn vm.base - vm.y;\r\n\t},\r\n\r\n\tinRange: function(mouseX, mouseY) {\r\n\t\treturn inRange(this._view, mouseX, mouseY);\r\n\t},\r\n\r\n\tinLabelRange: function(mouseX, mouseY) {\r\n\t\tvar vm = this._view;\r\n\t\treturn isVertical(vm)\r\n\t\t\t? inRange(vm, mouseX, null)\r\n\t\t\t: inRange(vm, null, mouseY);\r\n\t},\r\n\r\n\tinXRange: function(mouseX) {\r\n\t\treturn inRange(this._view, mouseX, null);\r\n\t},\r\n\r\n\tinYRange: function(mouseY) {\r\n\t\treturn inRange(this._view, null, mouseY);\r\n\t},\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar x, y;\r\n\t\tif (isVertical(vm)) {\r\n\t\t\tx = vm.x;\r\n\t\t\ty = (vm.y + vm.base) / 2;\r\n\t\t} else {\r\n\t\t\tx = (vm.x + vm.base) / 2;\r\n\t\t\ty = vm.y;\r\n\t\t}\r\n\r\n\t\treturn {x: x, y: y};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\tvar vm = this._view;\r\n\r\n\t\treturn isVertical(vm)\r\n\t\t\t? vm.width * Math.abs(vm.y - vm.base)\r\n\t\t\t: vm.height * Math.abs(vm.x - vm.base);\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y\r\n\t\t};\r\n\t}\r\n});\r\n\r\nvar elements = {};\r\nvar Arc = element_arc;\r\nvar Line = element_line;\r\nvar Point = element_point;\r\nvar Rectangle = element_rectangle;\r\nelements.Arc = Arc;\r\nelements.Line = Line;\r\nelements.Point = Point;\r\nelements.Rectangle = Rectangle;\r\n\r\nvar deprecated = helpers$1._deprecated;\r\nvar valueOrDefault$3 = helpers$1.valueOrDefault;\r\n\r\ncore_defaults._set('bar', {\r\n\thover: {\r\n\t\tmode: 'label'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\toffset: true,\r\n\t\t\tgridLines: {\r\n\t\t\t\toffsetGridLines: true\r\n\t\t\t}\r\n\t\t}],\r\n\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear'\r\n\t\t}]\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\tbar: {\r\n\t\t\tcategoryPercentage: 0.8,\r\n\t\t\tbarPercentage: 0.9\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/**\r\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\r\n * @private\r\n */\r\nfunction computeMinSampleSize(scale, pixels) {\r\n\tvar min = scale._length;\r\n\tvar prev, curr, i, ilen;\r\n\r\n\tfor (i = 1, ilen = pixels.length; i < ilen; ++i) {\r\n\t\tmin = Math.min(min, Math.abs(pixels[i] - pixels[i - 1]));\r\n\t}\r\n\r\n\tfor (i = 0, ilen = scale.getTicks().length; i < ilen; ++i) {\r\n\t\tcurr = scale.getPixelForTick(i);\r\n\t\tmin = i > 0 ? Math.min(min, Math.abs(curr - prev)) : min;\r\n\t\tprev = curr;\r\n\t}\r\n\r\n\treturn min;\r\n}\r\n\r\n/**\r\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\r\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\r\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\r\n * @private\r\n */\r\nfunction computeFitCategoryTraits(index, ruler, options) {\r\n\tvar thickness = options.barThickness;\r\n\tvar count = ruler.stackCount;\r\n\tvar curr = ruler.pixels[index];\r\n\tvar min = helpers$1.isNullOrUndef(thickness)\r\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\r\n\t\t: -1;\r\n\tvar size, ratio;\r\n\r\n\tif (helpers$1.isNullOrUndef(thickness)) {\r\n\t\tsize = min * options.categoryPercentage;\r\n\t\tratio = options.barPercentage;\r\n\t} else {\r\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\r\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\r\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\r\n\t\tsize = thickness * count;\r\n\t\tratio = 1;\r\n\t}\r\n\r\n\treturn {\r\n\t\tchunk: size / count,\r\n\t\tratio: ratio,\r\n\t\tstart: curr - (size / 2)\r\n\t};\r\n}\r\n\r\n/**\r\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\r\n * percentage options are 1), based on the previous and following categories. This mode\r\n * generates bars with different widths when data are not evenly spaced.\r\n * @private\r\n */\r\nfunction computeFlexCategoryTraits(index, ruler, options) {\r\n\tvar pixels = ruler.pixels;\r\n\tvar curr = pixels[index];\r\n\tvar prev = index > 0 ? pixels[index - 1] : null;\r\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\r\n\tvar percent = options.categoryPercentage;\r\n\tvar start, size;\r\n\r\n\tif (prev === null) {\r\n\t\t// first data: its size is double based on the next point or,\r\n\t\t// if it's also the last data, we use the scale size.\r\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\r\n\t}\r\n\r\n\tif (next === null) {\r\n\t\t// last data: its size is also double based on the previous point.\r\n\t\tnext = curr + curr - prev;\r\n\t}\r\n\r\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\r\n\tsize = Math.abs(next - prev) / 2 * percent;\r\n\r\n\treturn {\r\n\t\tchunk: size / ruler.stackCount,\r\n\t\tratio: options.barPercentage,\r\n\t\tstart: start\r\n\t};\r\n}\r\n\r\nvar controller_bar = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Rectangle,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderSkipped',\r\n\t\t'borderWidth',\r\n\t\t'barPercentage',\r\n\t\t'barThickness',\r\n\t\t'categoryPercentage',\r\n\t\t'maxBarThickness',\r\n\t\t'minBarLength'\r\n\t],\r\n\r\n\tinitialize: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta, scaleOpts;\r\n\r\n\t\tcore_datasetController.prototype.initialize.apply(me, arguments);\r\n\r\n\t\tmeta = me.getMeta();\r\n\t\tmeta.stack = me.getDataset().stack;\r\n\t\tmeta.bar = true;\r\n\r\n\t\tscaleOpts = me._getIndexScale().options;\r\n\t\tdeprecated('bar chart', scaleOpts.barPercentage, 'scales.[x/y]Axes.barPercentage', 'dataset.barPercentage');\r\n\t\tdeprecated('bar chart', scaleOpts.barThickness, 'scales.[x/y]Axes.barThickness', 'dataset.barThickness');\r\n\t\tdeprecated('bar chart', scaleOpts.categoryPercentage, 'scales.[x/y]Axes.categoryPercentage', 'dataset.categoryPercentage');\r\n\t\tdeprecated('bar chart', me._getValueScale().options.minBarLength, 'scales.[x/y]Axes.minBarLength', 'dataset.minBarLength');\r\n\t\tdeprecated('bar chart', scaleOpts.maxBarThickness, 'scales.[x/y]Axes.maxBarThickness', 'dataset.maxBarThickness');\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar rects = me.getMeta().data;\r\n\t\tvar i, ilen;\r\n\r\n\t\tme._ruler = me.getRuler();\r\n\r\n\t\tfor (i = 0, ilen = rects.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(rects[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(rectangle, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar options = me._resolveDataElementOptions(rectangle, index);\r\n\r\n\t\trectangle._xScale = me.getScaleForId(meta.xAxisID);\r\n\t\trectangle._yScale = me.getScaleForId(meta.yAxisID);\r\n\t\trectangle._datasetIndex = me.index;\r\n\t\trectangle._index = index;\r\n\t\trectangle._model = {\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderSkipped: options.borderSkipped,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\tdatasetLabel: dataset.label,\r\n\t\t\tlabel: me.chart.data.labels[index]\r\n\t\t};\r\n\r\n\t\tif (helpers$1.isArray(dataset.data[index])) {\r\n\t\t\trectangle._model.borderSkipped = null;\r\n\t\t}\r\n\r\n\t\tme._updateElementGeometry(rectangle, index, reset, options);\r\n\r\n\t\trectangle.pivot();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_updateElementGeometry: function(rectangle, index, reset, options) {\r\n\t\tvar me = this;\r\n\t\tvar model = rectangle._model;\r\n\t\tvar vscale = me._getValueScale();\r\n\t\tvar base = vscale.getBasePixel();\r\n\t\tvar horizontal = vscale.isHorizontal();\r\n\t\tvar ruler = me._ruler || me.getRuler();\r\n\t\tvar vpixels = me.calculateBarValuePixels(me.index, index, options);\r\n\t\tvar ipixels = me.calculateBarIndexPixels(me.index, index, ruler, options);\r\n\r\n\t\tmodel.horizontal = horizontal;\r\n\t\tmodel.base = reset ? base : vpixels.base;\r\n\t\tmodel.x = horizontal ? reset ? base : vpixels.head : ipixels.center;\r\n\t\tmodel.y = horizontal ? ipixels.center : reset ? base : vpixels.head;\r\n\t\tmodel.height = horizontal ? ipixels.size : undefined;\r\n\t\tmodel.width = horizontal ? undefined : ipixels.size;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the stacks based on groups and bar visibility.\r\n\t * @param {number} [last] - The dataset index\r\n\t * @returns {string[]} The list of stack IDs\r\n\t * @private\r\n\t */\r\n\t_getStacks: function(last) {\r\n\t\tvar me = this;\r\n\t\tvar scale = me._getIndexScale();\r\n\t\tvar metasets = scale._getMatchingVisibleMetas(me._type);\r\n\t\tvar stacked = scale.options.stacked;\r\n\t\tvar ilen = metasets.length;\r\n\t\tvar stacks = [];\r\n\t\tvar i, meta;\r\n\r\n\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\tmeta = metasets[i];\r\n\t\t\t// stacked | meta.stack\r\n\t\t\t// | found | not found | undefined\r\n\t\t\t// false | x | x | x\r\n\t\t\t// true | | x |\r\n\t\t\t// undefined | | x | x\r\n\t\t\tif (stacked === false || stacks.indexOf(meta.stack) === -1 ||\r\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\r\n\t\t\t\tstacks.push(meta.stack);\r\n\t\t\t}\r\n\t\t\tif (meta.index === last) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn stacks;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the effective number of stacks based on groups and bar visibility.\r\n\t * @private\r\n\t */\r\n\tgetStackCount: function() {\r\n\t\treturn this._getStacks().length;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\r\n\t * @param {number} [datasetIndex] - The dataset index\r\n\t * @param {string} [name] - The stack name to find\r\n\t * @returns {number} The stack index\r\n\t * @private\r\n\t */\r\n\tgetStackIndex: function(datasetIndex, name) {\r\n\t\tvar stacks = this._getStacks(datasetIndex);\r\n\t\tvar index = (name !== undefined)\r\n\t\t\t? stacks.indexOf(name)\r\n\t\t\t: -1; // indexOf returns -1 if element is not present\r\n\r\n\t\treturn (index === -1)\r\n\t\t\t? stacks.length - 1\r\n\t\t\t: index;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tgetRuler: function() {\r\n\t\tvar me = this;\r\n\t\tvar scale = me._getIndexScale();\r\n\t\tvar pixels = [];\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) {\r\n\t\t\tpixels.push(scale.getPixelForValue(null, i, me.index));\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tpixels: pixels,\r\n\t\t\tstart: scale._startPixel,\r\n\t\t\tend: scale._endPixel,\r\n\t\t\tstackCount: me.getStackCount(),\r\n\t\t\tscale: scale\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Note: pixel values are not clamped to the scale area.\r\n\t * @private\r\n\t */\r\n\tcalculateBarValuePixels: function(datasetIndex, index, options) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar scale = me._getValueScale();\r\n\t\tvar isHorizontal = scale.isHorizontal();\r\n\t\tvar datasets = chart.data.datasets;\r\n\t\tvar metasets = scale._getMatchingVisibleMetas(me._type);\r\n\t\tvar value = scale._parseValue(datasets[datasetIndex].data[index]);\r\n\t\tvar minBarLength = options.minBarLength;\r\n\t\tvar stacked = scale.options.stacked;\r\n\t\tvar stack = me.getMeta().stack;\r\n\t\tvar start = value.start === undefined ? 0 : value.max >= 0 && value.min >= 0 ? value.min : value.max;\r\n\t\tvar length = value.start === undefined ? value.end : value.max >= 0 && value.min >= 0 ? value.max - value.min : value.min - value.max;\r\n\t\tvar ilen = metasets.length;\r\n\t\tvar i, imeta, ivalue, base, head, size, stackLength;\r\n\r\n\t\tif (stacked || (stacked === undefined && stack !== undefined)) {\r\n\t\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\t\timeta = metasets[i];\r\n\r\n\t\t\t\tif (imeta.index === datasetIndex) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (imeta.stack === stack) {\r\n\t\t\t\t\tstackLength = scale._parseValue(datasets[imeta.index].data[index]);\r\n\t\t\t\t\tivalue = stackLength.start === undefined ? stackLength.end : stackLength.min >= 0 && stackLength.max >= 0 ? stackLength.max : stackLength.min;\r\n\r\n\t\t\t\t\tif ((value.min < 0 && ivalue < 0) || (value.max >= 0 && ivalue > 0)) {\r\n\t\t\t\t\t\tstart += ivalue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tbase = scale.getPixelForValue(start);\r\n\t\thead = scale.getPixelForValue(start + length);\r\n\t\tsize = head - base;\r\n\r\n\t\tif (minBarLength !== undefined && Math.abs(size) < minBarLength) {\r\n\t\t\tsize = minBarLength;\r\n\t\t\tif (length >= 0 && !isHorizontal || length < 0 && isHorizontal) {\r\n\t\t\t\thead = base - minBarLength;\r\n\t\t\t} else {\r\n\t\t\t\thead = base + minBarLength;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tsize: size,\r\n\t\t\tbase: base,\r\n\t\t\thead: head,\r\n\t\t\tcenter: head + size / 2\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tcalculateBarIndexPixels: function(datasetIndex, index, ruler, options) {\r\n\t\tvar me = this;\r\n\t\tvar range = options.barThickness === 'flex'\r\n\t\t\t? computeFlexCategoryTraits(index, ruler, options)\r\n\t\t\t: computeFitCategoryTraits(index, ruler, options);\r\n\r\n\t\tvar stackIndex = me.getStackIndex(datasetIndex, me.getMeta().stack);\r\n\t\tvar center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\r\n\t\tvar size = Math.min(\r\n\t\t\tvalueOrDefault$3(options.maxBarThickness, Infinity),\r\n\t\t\trange.chunk * range.ratio);\r\n\r\n\t\treturn {\r\n\t\t\tbase: center - size / 2,\r\n\t\t\thead: center + size / 2,\r\n\t\t\tcenter: center,\r\n\t\t\tsize: size\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar scale = me._getValueScale();\r\n\t\tvar rects = me.getMeta().data;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar ilen = rects.length;\r\n\t\tvar i = 0;\r\n\r\n\t\thelpers$1.canvas.clipArea(chart.ctx, chart.chartArea);\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tvar val = scale._parseValue(dataset.data[i]);\r\n\t\t\tif (!isNaN(val.min) && !isNaN(val.max)) {\r\n\t\t\t\trects[i].draw();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\thelpers$1.canvas.unclipArea(chart.ctx);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function() {\r\n\t\tvar me = this;\r\n\t\tvar values = helpers$1.extend({}, core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments));\r\n\t\tvar indexOpts = me._getIndexScale().options;\r\n\t\tvar valueOpts = me._getValueScale().options;\r\n\r\n\t\tvalues.barPercentage = valueOrDefault$3(indexOpts.barPercentage, values.barPercentage);\r\n\t\tvalues.barThickness = valueOrDefault$3(indexOpts.barThickness, values.barThickness);\r\n\t\tvalues.categoryPercentage = valueOrDefault$3(indexOpts.categoryPercentage, values.categoryPercentage);\r\n\t\tvalues.maxBarThickness = valueOrDefault$3(indexOpts.maxBarThickness, values.maxBarThickness);\r\n\t\tvalues.minBarLength = valueOrDefault$3(valueOpts.minBarLength, values.minBarLength);\r\n\r\n\t\treturn values;\r\n\t}\r\n\r\n});\r\n\r\nvar valueOrDefault$4 = helpers$1.valueOrDefault;\r\nvar resolve$1 = helpers$1.options.resolve;\r\n\r\ncore_defaults._set('bubble', {\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'linear', // bubble should probably use a linear scale by default\r\n\t\t\tposition: 'bottom',\r\n\t\t\tid: 'x-axis-0' // need an ID so datasets can reference the scale\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'left',\r\n\t\t\tid: 'y-axis-0'\r\n\t\t}]\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\t// Title doesn't make sense for scatter since we format the data as a point\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(item, data) {\r\n\t\t\t\tvar datasetLabel = data.datasets[item.datasetIndex].label || '';\r\n\t\t\t\tvar dataPoint = data.datasets[item.datasetIndex].data[item.index];\r\n\t\t\t\treturn datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_bubble = core_datasetController.extend({\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tdataElementType: elements.Point,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t\t'hoverRadius',\r\n\t\t'hitRadius',\r\n\t\t'pointStyle',\r\n\t\t'rotation'\r\n\t],\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar points = meta.data;\r\n\r\n\t\t// Update Points\r\n\t\thelpers$1.each(points, function(point, index) {\r\n\t\t\tme.updateElement(point, index, reset);\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar xScale = me.getScaleForId(meta.xAxisID);\r\n\t\tvar yScale = me.getScaleForId(meta.yAxisID);\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\t\tvar data = me.getDataset().data[index];\r\n\t\tvar dsIndex = me.index;\r\n\r\n\t\tvar x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex);\r\n\t\tvar y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex);\r\n\r\n\t\tpoint._xScale = xScale;\r\n\t\tpoint._yScale = yScale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = dsIndex;\r\n\t\tpoint._index = index;\r\n\t\tpoint._model = {\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\thitRadius: options.hitRadius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tradius: reset ? 0 : options.radius,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\tx: x,\r\n\t\t\ty: y,\r\n\t\t};\r\n\r\n\t\tpoint.pivot();\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$4(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$4(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$4(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = options.radius + options.hoverRadius;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function(point, index) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar data = dataset.data[index] || {};\r\n\t\tvar values = core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments);\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: dataset,\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\t// In case values were cached (and thus frozen), we need to clone the values\r\n\t\tif (me._cachedDataOpts === values) {\r\n\t\t\tvalues = helpers$1.extend({}, values);\r\n\t\t}\r\n\r\n\t\t// Custom radius resolution\r\n\t\tvalues.radius = resolve$1([\r\n\t\t\tcustom.radius,\r\n\t\t\tdata.r,\r\n\t\t\tme._config.radius,\r\n\t\t\tchart.options.elements.point.radius\r\n\t\t], context, index);\r\n\r\n\t\treturn values;\r\n\t}\r\n});\r\n\r\nvar valueOrDefault$5 = helpers$1.valueOrDefault;\r\n\r\nvar PI$1 = Math.PI;\r\nvar DOUBLE_PI$1 = PI$1 * 2;\r\nvar HALF_PI$1 = PI$1 / 2;\r\n\r\ncore_defaults._set('doughnut', {\r\n\tanimation: {\r\n\t\t// Boolean - Whether we animate the rotation of the Doughnut\r\n\t\tanimateRotate: true,\r\n\t\t// Boolean - Whether we animate scaling the Doughnut from the centre\r\n\t\tanimateScale: false\r\n\t},\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\tlegendCallback: function(chart) {\r\n\t\tvar list = document.createElement('ul');\r\n\t\tvar data = chart.data;\r\n\t\tvar datasets = data.datasets;\r\n\t\tvar labels = data.labels;\r\n\t\tvar i, ilen, listItem, listItemSpan;\r\n\r\n\t\tlist.setAttribute('class', chart.id + '-legend');\r\n\t\tif (datasets.length) {\r\n\t\t\tfor (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) {\r\n\t\t\t\tlistItem = list.appendChild(document.createElement('li'));\r\n\t\t\t\tlistItemSpan = listItem.appendChild(document.createElement('span'));\r\n\t\t\t\tlistItemSpan.style.backgroundColor = datasets[0].backgroundColor[i];\r\n\t\t\t\tif (labels[i]) {\r\n\t\t\t\t\tlistItem.appendChild(document.createTextNode(labels[i]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list.outerHTML;\r\n\t},\r\n\tlegend: {\r\n\t\tlabels: {\r\n\t\t\tgenerateLabels: function(chart) {\r\n\t\t\t\tvar data = chart.data;\r\n\t\t\t\tif (data.labels.length && data.datasets.length) {\r\n\t\t\t\t\treturn data.labels.map(function(label, i) {\r\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\r\n\t\t\t\t\t\tvar style = meta.controller.getStyle(i);\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\ttext: label,\r\n\t\t\t\t\t\t\tfillStyle: style.backgroundColor,\r\n\t\t\t\t\t\t\tstrokeStyle: style.borderColor,\r\n\t\t\t\t\t\t\tlineWidth: style.borderWidth,\r\n\t\t\t\t\t\t\thidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden,\r\n\r\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\r\n\t\t\t\t\t\t\tindex: i\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn [];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tonClick: function(e, legendItem) {\r\n\t\t\tvar index = legendItem.index;\r\n\t\t\tvar chart = this.chart;\r\n\t\t\tvar i, ilen, meta;\r\n\r\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\t// toggle visibility of index if exists\r\n\t\t\t\tif (meta.data[index]) {\r\n\t\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tchart.update();\r\n\t\t}\r\n\t},\r\n\r\n\t// The percentage of the chart that we cut out of the middle.\r\n\tcutoutPercentage: 50,\r\n\r\n\t// The rotation of the chart, where the first data arc begins.\r\n\trotation: -HALF_PI$1,\r\n\r\n\t// The total circumference of the chart.\r\n\tcircumference: DOUBLE_PI$1,\r\n\r\n\t// Need to override these to give a nice default\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(tooltipItem, data) {\r\n\t\t\t\tvar dataLabel = data.labels[tooltipItem.index];\r\n\t\t\t\tvar value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\r\n\r\n\t\t\t\tif (helpers$1.isArray(dataLabel)) {\r\n\t\t\t\t\t// show value on first line of multiline label\r\n\t\t\t\t\t// need to clone because we are changing the value\r\n\t\t\t\t\tdataLabel = dataLabel.slice();\r\n\t\t\t\t\tdataLabel[0] += value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdataLabel += value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn dataLabel;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_doughnut = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Arc,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'borderAlign',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t],\r\n\r\n\t// Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly\r\n\tgetRingIndex: function(datasetIndex) {\r\n\t\tvar ringIndex = 0;\r\n\r\n\t\tfor (var j = 0; j < datasetIndex; ++j) {\r\n\t\t\tif (this.chart.isDatasetVisible(j)) {\r\n\t\t\t\t++ringIndex;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ringIndex;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar ratioX = 1;\r\n\t\tvar ratioY = 1;\r\n\t\tvar offsetX = 0;\r\n\t\tvar offsetY = 0;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar arcs = meta.data;\r\n\t\tvar cutout = opts.cutoutPercentage / 100 || 0;\r\n\t\tvar circumference = opts.circumference;\r\n\t\tvar chartWeight = me._getRingWeight(me.index);\r\n\t\tvar maxWidth, maxHeight, i, ilen;\r\n\r\n\t\t// If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\r\n\t\tif (circumference < DOUBLE_PI$1) {\r\n\t\t\tvar startAngle = opts.rotation % DOUBLE_PI$1;\r\n\t\t\tstartAngle += startAngle >= PI$1 ? -DOUBLE_PI$1 : startAngle < -PI$1 ? DOUBLE_PI$1 : 0;\r\n\t\t\tvar endAngle = startAngle + circumference;\r\n\t\t\tvar startX = Math.cos(startAngle);\r\n\t\t\tvar startY = Math.sin(startAngle);\r\n\t\t\tvar endX = Math.cos(endAngle);\r\n\t\t\tvar endY = Math.sin(endAngle);\r\n\t\t\tvar contains0 = (startAngle <= 0 && endAngle >= 0) || endAngle >= DOUBLE_PI$1;\r\n\t\t\tvar contains90 = (startAngle <= HALF_PI$1 && endAngle >= HALF_PI$1) || endAngle >= DOUBLE_PI$1 + HALF_PI$1;\r\n\t\t\tvar contains180 = startAngle === -PI$1 || endAngle >= PI$1;\r\n\t\t\tvar contains270 = (startAngle <= -HALF_PI$1 && endAngle >= -HALF_PI$1) || endAngle >= PI$1 + HALF_PI$1;\r\n\t\t\tvar minX = contains180 ? -1 : Math.min(startX, startX * cutout, endX, endX * cutout);\r\n\t\t\tvar minY = contains270 ? -1 : Math.min(startY, startY * cutout, endY, endY * cutout);\r\n\t\t\tvar maxX = contains0 ? 1 : Math.max(startX, startX * cutout, endX, endX * cutout);\r\n\t\t\tvar maxY = contains90 ? 1 : Math.max(startY, startY * cutout, endY, endY * cutout);\r\n\t\t\tratioX = (maxX - minX) / 2;\r\n\t\t\tratioY = (maxY - minY) / 2;\r\n\t\t\toffsetX = -(maxX + minX) / 2;\r\n\t\t\toffsetY = -(maxY + minY) / 2;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarcs[i]._options = me._resolveDataElementOptions(arcs[i], i);\r\n\t\t}\r\n\r\n\t\tchart.borderWidth = me.getMaxBorderWidth();\r\n\t\tmaxWidth = (chartArea.right - chartArea.left - chart.borderWidth) / ratioX;\r\n\t\tmaxHeight = (chartArea.bottom - chartArea.top - chart.borderWidth) / ratioY;\r\n\t\tchart.outerRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\r\n\t\tchart.innerRadius = Math.max(chart.outerRadius * cutout, 0);\r\n\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / (me._getVisibleDatasetWeightTotal() || 1);\r\n\t\tchart.offsetX = offsetX * chart.outerRadius;\r\n\t\tchart.offsetY = offsetY * chart.outerRadius;\r\n\r\n\t\tmeta.total = me.calculateTotal();\r\n\r\n\t\tme.outerRadius = chart.outerRadius - chart.radiusLength * me._getRingWeightOffset(me.index);\r\n\t\tme.innerRadius = Math.max(me.outerRadius - chart.radiusLength * chartWeight, 0);\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(arcs[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(arc, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar animationOpts = opts.animation;\r\n\t\tvar centerX = (chartArea.left + chartArea.right) / 2;\r\n\t\tvar centerY = (chartArea.top + chartArea.bottom) / 2;\r\n\t\tvar startAngle = opts.rotation; // non reset case handled later\r\n\t\tvar endAngle = opts.rotation; // non reset case handled later\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / DOUBLE_PI$1);\r\n\t\tvar innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius;\r\n\t\tvar outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius;\r\n\t\tvar options = arc._options || {};\r\n\r\n\t\thelpers$1.extend(arc, {\r\n\t\t\t// Utility\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index,\r\n\r\n\t\t\t// Desired view properties\r\n\t\t\t_model: {\r\n\t\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\t\tborderColor: options.borderColor,\r\n\t\t\t\tborderWidth: options.borderWidth,\r\n\t\t\t\tborderAlign: options.borderAlign,\r\n\t\t\t\tx: centerX + chart.offsetX,\r\n\t\t\t\ty: centerY + chart.offsetY,\r\n\t\t\t\tstartAngle: startAngle,\r\n\t\t\t\tendAngle: endAngle,\r\n\t\t\t\tcircumference: circumference,\r\n\t\t\t\touterRadius: outerRadius,\r\n\t\t\t\tinnerRadius: innerRadius,\r\n\t\t\t\tlabel: helpers$1.valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tvar model = arc._model;\r\n\r\n\t\t// Set correct angles if not resetting\r\n\t\tif (!reset || !animationOpts.animateRotate) {\r\n\t\t\tif (index === 0) {\r\n\t\t\t\tmodel.startAngle = opts.rotation;\r\n\t\t\t} else {\r\n\t\t\t\tmodel.startAngle = me.getMeta().data[index - 1]._model.endAngle;\r\n\t\t\t}\r\n\r\n\t\t\tmodel.endAngle = model.startAngle + model.circumference;\r\n\t\t}\r\n\r\n\t\tarc.pivot();\r\n\t},\r\n\r\n\tcalculateTotal: function() {\r\n\t\tvar dataset = this.getDataset();\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar total = 0;\r\n\t\tvar value;\r\n\r\n\t\thelpers$1.each(meta.data, function(element, index) {\r\n\t\t\tvalue = dataset.data[index];\r\n\t\t\tif (!isNaN(value) && !element.hidden) {\r\n\t\t\t\ttotal += Math.abs(value);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t/* if (total === 0) {\r\n\t\t\ttotal = NaN;\r\n\t\t}*/\r\n\r\n\t\treturn total;\r\n\t},\r\n\r\n\tcalculateCircumference: function(value) {\r\n\t\tvar total = this.getMeta().total;\r\n\t\tif (total > 0 && !isNaN(value)) {\r\n\t\t\treturn DOUBLE_PI$1 * (Math.abs(value) / total);\r\n\t\t}\r\n\t\treturn 0;\r\n\t},\r\n\r\n\t// gets the max border or hover width to properly scale pie charts\r\n\tgetMaxBorderWidth: function(arcs) {\r\n\t\tvar me = this;\r\n\t\tvar max = 0;\r\n\t\tvar chart = me.chart;\r\n\t\tvar i, ilen, meta, arc, controller, options, borderWidth, hoverWidth;\r\n\r\n\t\tif (!arcs) {\r\n\t\t\t// Find the outmost visible dataset\r\n\t\t\tfor (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\r\n\t\t\t\tif (chart.isDatasetVisible(i)) {\r\n\t\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\t\tarcs = meta.data;\r\n\t\t\t\t\tif (i !== me.index) {\r\n\t\t\t\t\t\tcontroller = meta.controller;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!arcs) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarc = arcs[i];\r\n\t\t\tif (controller) {\r\n\t\t\t\tcontroller._configure();\r\n\t\t\t\toptions = controller._resolveDataElementOptions(arc, i);\r\n\t\t\t} else {\r\n\t\t\t\toptions = arc._options;\r\n\t\t\t}\r\n\t\t\tif (options.borderAlign !== 'inner') {\r\n\t\t\t\tborderWidth = options.borderWidth;\r\n\t\t\t\thoverWidth = options.hoverBorderWidth;\r\n\r\n\t\t\t\tmax = borderWidth > max ? borderWidth : max;\r\n\t\t\t\tmax = hoverWidth > max ? hoverWidth : max;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max;\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(arc) {\r\n\t\tvar model = arc._model;\r\n\t\tvar options = arc._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tarc.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$5(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$5(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$5(options.hoverBorderWidth, options.borderWidth);\r\n\t},\r\n\r\n\t/**\r\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\r\n\t * @private\r\n\t */\r\n\t_getRingWeightOffset: function(datasetIndex) {\r\n\t\tvar ringWeightOffset = 0;\r\n\r\n\t\tfor (var i = 0; i < datasetIndex; ++i) {\r\n\t\t\tif (this.chart.isDatasetVisible(i)) {\r\n\t\t\t\tringWeightOffset += this._getRingWeight(i);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ringWeightOffset;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getRingWeight: function(dataSetIndex) {\r\n\t\treturn Math.max(valueOrDefault$5(this.chart.data.datasets[dataSetIndex].weight, 1), 0);\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the sum of all visibile data set weights. This value can be 0.\r\n\t * @private\r\n\t */\r\n\t_getVisibleDatasetWeightTotal: function() {\r\n\t\treturn this._getRingWeightOffset(this.chart.data.datasets.length);\r\n\t}\r\n});\r\n\r\ncore_defaults._set('horizontalBar', {\r\n\thover: {\r\n\t\tmode: 'index',\r\n\t\taxis: 'y'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'bottom'\r\n\t\t}],\r\n\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\tposition: 'left',\r\n\t\t\toffset: true,\r\n\t\t\tgridLines: {\r\n\t\t\t\toffsetGridLines: true\r\n\t\t\t}\r\n\t\t}]\r\n\t},\r\n\r\n\telements: {\r\n\t\trectangle: {\r\n\t\t\tborderSkipped: 'left'\r\n\t\t}\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tmode: 'index',\r\n\t\taxis: 'y'\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\thorizontalBar: {\r\n\t\t\tcategoryPercentage: 0.8,\r\n\t\t\tbarPercentage: 0.9\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_horizontalBar = controller_bar.extend({\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.getMeta().xAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.getMeta().yAxisID;\r\n\t}\r\n});\r\n\r\nvar valueOrDefault$6 = helpers$1.valueOrDefault;\r\nvar resolve$2 = helpers$1.options.resolve;\r\nvar isPointInArea = helpers$1.canvas._isPointInArea;\r\n\r\ncore_defaults._set('line', {\r\n\tshowLines: true,\r\n\tspanGaps: false,\r\n\r\n\thover: {\r\n\t\tmode: 'label'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\tid: 'x-axis-0'\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tid: 'y-axis-0'\r\n\t\t}]\r\n\t}\r\n});\r\n\r\nfunction scaleClip(scale, halfBorderWidth) {\r\n\tvar tickOpts = scale && scale.options.ticks || {};\r\n\tvar reverse = tickOpts.reverse;\r\n\tvar min = tickOpts.min === undefined ? halfBorderWidth : 0;\r\n\tvar max = tickOpts.max === undefined ? halfBorderWidth : 0;\r\n\treturn {\r\n\t\tstart: reverse ? max : min,\r\n\t\tend: reverse ? min : max\r\n\t};\r\n}\r\n\r\nfunction defaultClip(xScale, yScale, borderWidth) {\r\n\tvar halfBorderWidth = borderWidth / 2;\r\n\tvar x = scaleClip(xScale, halfBorderWidth);\r\n\tvar y = scaleClip(yScale, halfBorderWidth);\r\n\r\n\treturn {\r\n\t\ttop: y.end,\r\n\t\tright: x.end,\r\n\t\tbottom: y.start,\r\n\t\tleft: x.start\r\n\t};\r\n}\r\n\r\nfunction toClip(value) {\r\n\tvar t, r, b, l;\r\n\r\n\tif (helpers$1.isObject(value)) {\r\n\t\tt = value.top;\r\n\t\tr = value.right;\r\n\t\tb = value.bottom;\r\n\t\tl = value.left;\r\n\t} else {\r\n\t\tt = r = b = l = value;\r\n\t}\r\n\r\n\treturn {\r\n\t\ttop: t,\r\n\t\tright: r,\r\n\t\tbottom: b,\r\n\t\tleft: l\r\n\t};\r\n}\r\n\r\n\r\nvar controller_line = core_datasetController.extend({\r\n\r\n\tdatasetElementType: elements.Line,\r\n\r\n\tdataElementType: elements.Point,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderColor',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'borderWidth',\r\n\t\t'cubicInterpolationMode',\r\n\t\t'fill'\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: {\r\n\t\tbackgroundColor: 'pointBackgroundColor',\r\n\t\tborderColor: 'pointBorderColor',\r\n\t\tborderWidth: 'pointBorderWidth',\r\n\t\thitRadius: 'pointHitRadius',\r\n\t\thoverBackgroundColor: 'pointHoverBackgroundColor',\r\n\t\thoverBorderColor: 'pointHoverBorderColor',\r\n\t\thoverBorderWidth: 'pointHoverBorderWidth',\r\n\t\thoverRadius: 'pointHoverRadius',\r\n\t\tpointStyle: 'pointStyle',\r\n\t\tradius: 'pointRadius',\r\n\t\trotation: 'pointRotation'\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar line = meta.dataset;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar options = me.chart.options;\r\n\t\tvar config = me._config;\r\n\t\tvar showLine = me._showLine = valueOrDefault$6(config.showLine, options.showLines);\r\n\t\tvar i, ilen;\r\n\r\n\t\tme._xScale = me.getScaleForId(meta.xAxisID);\r\n\t\tme._yScale = me.getScaleForId(meta.yAxisID);\r\n\r\n\t\t// Update Line\r\n\t\tif (showLine) {\r\n\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\r\n\t\t\tif (config.tension !== undefined && config.lineTension === undefined) {\r\n\t\t\t\tconfig.lineTension = config.tension;\r\n\t\t\t}\r\n\r\n\t\t\t// Utility\r\n\t\t\tline._scale = me._yScale;\r\n\t\t\tline._datasetIndex = me.index;\r\n\t\t\t// Data\r\n\t\t\tline._children = points;\r\n\t\t\t// Model\r\n\t\t\tline._model = me._resolveDatasetElementOptions(line);\r\n\r\n\t\t\tline.pivot();\r\n\t\t}\r\n\r\n\t\t// Update Points\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(points[i], i, reset);\r\n\t\t}\r\n\r\n\t\tif (showLine && line._model.tension !== 0) {\r\n\t\t\tme.updateBezierControlPoints();\r\n\t\t}\r\n\r\n\t\t// Now pivot the point for animation\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tpoints[i].pivot();\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar datasetIndex = me.index;\r\n\t\tvar value = dataset.data[index];\r\n\t\tvar xScale = me._xScale;\r\n\t\tvar yScale = me._yScale;\r\n\t\tvar lineModel = meta.dataset._model;\r\n\t\tvar x, y;\r\n\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\r\n\t\tx = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex);\r\n\t\ty = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);\r\n\r\n\t\t// Utility\r\n\t\tpoint._xScale = xScale;\r\n\t\tpoint._yScale = yScale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = datasetIndex;\r\n\t\tpoint._index = index;\r\n\r\n\t\t// Desired view properties\r\n\t\tpoint._model = {\r\n\t\t\tx: x,\r\n\t\t\ty: y,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\t// Appearance\r\n\t\t\tradius: options.radius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\ttension: valueOrDefault$6(custom.tension, lineModel ? lineModel.tension : 0),\r\n\t\t\tsteppedLine: lineModel ? lineModel.steppedLine : false,\r\n\t\t\t// Tooltip\r\n\t\t\thitRadius: options.hitRadius\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function(element) {\r\n\t\tvar me = this;\r\n\t\tvar config = me._config;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar options = me.chart.options;\r\n\t\tvar lineOptions = options.elements.line;\r\n\t\tvar values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments);\r\n\r\n\t\t// The default behavior of lines is to break at null values, according\r\n\t\t// to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158\r\n\t\t// This option gives lines the ability to span gaps\r\n\t\tvalues.spanGaps = valueOrDefault$6(config.spanGaps, options.spanGaps);\r\n\t\tvalues.tension = valueOrDefault$6(config.lineTension, lineOptions.tension);\r\n\t\tvalues.steppedLine = resolve$2([custom.steppedLine, config.steppedLine, lineOptions.stepped]);\r\n\t\tvalues.clip = toClip(valueOrDefault$6(config.clip, defaultClip(me._xScale, me._yScale, values.borderWidth)));\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tcalculatePointY: function(value, index, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar yScale = me._yScale;\r\n\t\tvar sumPos = 0;\r\n\t\tvar sumNeg = 0;\r\n\t\tvar i, ds, dsMeta, stackedRightValue, rightValue, metasets, ilen;\r\n\r\n\t\tif (yScale.options.stacked) {\r\n\t\t\trightValue = +yScale.getRightValue(value);\r\n\t\t\tmetasets = chart._getSortedVisibleDatasetMetas();\r\n\t\t\tilen = metasets.length;\r\n\r\n\t\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\t\tdsMeta = metasets[i];\r\n\t\t\t\tif (dsMeta.index === datasetIndex) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tds = chart.data.datasets[dsMeta.index];\r\n\t\t\t\tif (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id) {\r\n\t\t\t\t\tstackedRightValue = +yScale.getRightValue(ds.data[index]);\r\n\t\t\t\t\tif (stackedRightValue < 0) {\r\n\t\t\t\t\t\tsumNeg += stackedRightValue || 0;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsumPos += stackedRightValue || 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (rightValue < 0) {\r\n\t\t\t\treturn yScale.getPixelForValue(sumNeg + rightValue);\r\n\t\t\t}\r\n\t\t\treturn yScale.getPixelForValue(sumPos + rightValue);\r\n\t\t}\r\n\t\treturn yScale.getPixelForValue(value);\r\n\t},\r\n\r\n\tupdateBezierControlPoints: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar lineModel = meta.dataset._model;\r\n\t\tvar area = chart.chartArea;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar i, ilen, model, controlPoints;\r\n\r\n\t\t// Only consider points that are drawn in case the spanGaps option is used\r\n\t\tif (lineModel.spanGaps) {\r\n\t\t\tpoints = points.filter(function(pt) {\r\n\t\t\t\treturn !pt._model.skip;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction capControlPoint(pt, min, max) {\r\n\t\t\treturn Math.max(Math.min(pt, max), min);\r\n\t\t}\r\n\r\n\t\tif (lineModel.cubicInterpolationMode === 'monotone') {\r\n\t\t\thelpers$1.splineCurveMonotone(points);\r\n\t\t} else {\r\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\t\tmodel = points[i]._model;\r\n\t\t\t\tcontrolPoints = helpers$1.splineCurve(\r\n\t\t\t\t\thelpers$1.previousItem(points, i)._model,\r\n\t\t\t\t\tmodel,\r\n\t\t\t\t\thelpers$1.nextItem(points, i)._model,\r\n\t\t\t\t\tlineModel.tension\r\n\t\t\t\t);\r\n\t\t\t\tmodel.controlPointPreviousX = controlPoints.previous.x;\r\n\t\t\t\tmodel.controlPointPreviousY = controlPoints.previous.y;\r\n\t\t\t\tmodel.controlPointNextX = controlPoints.next.x;\r\n\t\t\t\tmodel.controlPointNextY = controlPoints.next.y;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (chart.options.elements.line.capBezierPoints) {\r\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\t\tmodel = points[i]._model;\r\n\t\t\t\tif (isPointInArea(model, area)) {\r\n\t\t\t\t\tif (i > 0 && isPointInArea(points[i - 1]._model, area)) {\r\n\t\t\t\t\t\tmodel.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);\r\n\t\t\t\t\t\tmodel.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i < points.length - 1 && isPointInArea(points[i + 1]._model, area)) {\r\n\t\t\t\t\t\tmodel.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);\r\n\t\t\t\t\t\tmodel.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar points = meta.data || [];\r\n\t\tvar area = chart.chartArea;\r\n\t\tvar canvas = chart.canvas;\r\n\t\tvar i = 0;\r\n\t\tvar ilen = points.length;\r\n\t\tvar clip;\r\n\r\n\t\tif (me._showLine) {\r\n\t\t\tclip = meta.dataset._model.clip;\r\n\r\n\t\t\thelpers$1.canvas.clipArea(chart.ctx, {\r\n\t\t\t\tleft: clip.left === false ? 0 : area.left - clip.left,\r\n\t\t\t\tright: clip.right === false ? canvas.width : area.right + clip.right,\r\n\t\t\t\ttop: clip.top === false ? 0 : area.top - clip.top,\r\n\t\t\t\tbottom: clip.bottom === false ? canvas.height : area.bottom + clip.bottom\r\n\t\t\t});\r\n\r\n\t\t\tmeta.dataset.draw();\r\n\r\n\t\t\thelpers$1.canvas.unclipArea(chart.ctx);\r\n\t\t}\r\n\r\n\t\t// Draw the points\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tpoints[i].draw(area);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$6(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$6(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$6(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = valueOrDefault$6(options.hoverRadius, options.radius);\r\n\t},\r\n});\r\n\r\nvar resolve$3 = helpers$1.options.resolve;\r\n\r\ncore_defaults._set('polarArea', {\r\n\tscale: {\r\n\t\ttype: 'radialLinear',\r\n\t\tangleLines: {\r\n\t\t\tdisplay: false\r\n\t\t},\r\n\t\tgridLines: {\r\n\t\t\tcircular: true\r\n\t\t},\r\n\t\tpointLabels: {\r\n\t\t\tdisplay: false\r\n\t\t},\r\n\t\tticks: {\r\n\t\t\tbeginAtZero: true\r\n\t\t}\r\n\t},\r\n\r\n\t// Boolean - Whether to animate the rotation of the chart\r\n\tanimation: {\r\n\t\tanimateRotate: true,\r\n\t\tanimateScale: true\r\n\t},\r\n\r\n\tstartAngle: -0.5 * Math.PI,\r\n\tlegendCallback: function(chart) {\r\n\t\tvar list = document.createElement('ul');\r\n\t\tvar data = chart.data;\r\n\t\tvar datasets = data.datasets;\r\n\t\tvar labels = data.labels;\r\n\t\tvar i, ilen, listItem, listItemSpan;\r\n\r\n\t\tlist.setAttribute('class', chart.id + '-legend');\r\n\t\tif (datasets.length) {\r\n\t\t\tfor (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) {\r\n\t\t\t\tlistItem = list.appendChild(document.createElement('li'));\r\n\t\t\t\tlistItemSpan = listItem.appendChild(document.createElement('span'));\r\n\t\t\t\tlistItemSpan.style.backgroundColor = datasets[0].backgroundColor[i];\r\n\t\t\t\tif (labels[i]) {\r\n\t\t\t\t\tlistItem.appendChild(document.createTextNode(labels[i]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list.outerHTML;\r\n\t},\r\n\tlegend: {\r\n\t\tlabels: {\r\n\t\t\tgenerateLabels: function(chart) {\r\n\t\t\t\tvar data = chart.data;\r\n\t\t\t\tif (data.labels.length && data.datasets.length) {\r\n\t\t\t\t\treturn data.labels.map(function(label, i) {\r\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\r\n\t\t\t\t\t\tvar style = meta.controller.getStyle(i);\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\ttext: label,\r\n\t\t\t\t\t\t\tfillStyle: style.backgroundColor,\r\n\t\t\t\t\t\t\tstrokeStyle: style.borderColor,\r\n\t\t\t\t\t\t\tlineWidth: style.borderWidth,\r\n\t\t\t\t\t\t\thidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden,\r\n\r\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\r\n\t\t\t\t\t\t\tindex: i\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn [];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tonClick: function(e, legendItem) {\r\n\t\t\tvar index = legendItem.index;\r\n\t\t\tvar chart = this.chart;\r\n\t\t\tvar i, ilen, meta;\r\n\r\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\r\n\t\t\t}\r\n\r\n\t\t\tchart.update();\r\n\t\t}\r\n\t},\r\n\r\n\t// Need to override these to give a nice default\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(item, data) {\r\n\t\t\t\treturn data.labels[item.index] + ': ' + item.yLabel;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_polarArea = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Arc,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'borderAlign',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar start = me.chart.options.startAngle || 0;\r\n\t\tvar starts = me._starts = [];\r\n\t\tvar angles = me._angles = [];\r\n\t\tvar arcs = meta.data;\r\n\t\tvar i, ilen, angle;\r\n\r\n\t\tme._updateRadius();\r\n\r\n\t\tmeta.count = me.countVisibleElements();\r\n\r\n\t\tfor (i = 0, ilen = dataset.data.length; i < ilen; i++) {\r\n\t\t\tstarts[i] = start;\r\n\t\t\tangle = me._computeAngle(i);\r\n\t\t\tangles[i] = angle;\r\n\t\t\tstart += angle;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarcs[i]._options = me._resolveDataElementOptions(arcs[i], i);\r\n\t\t\tme.updateElement(arcs[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_updateRadius: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\r\n\r\n\t\tchart.outerRadius = Math.max(minSize / 2, 0);\r\n\t\tchart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\r\n\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\r\n\r\n\t\tme.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);\r\n\t\tme.innerRadius = me.outerRadius - chart.radiusLength;\r\n\t},\r\n\r\n\tupdateElement: function(arc, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar opts = chart.options;\r\n\t\tvar animationOpts = opts.animation;\r\n\t\tvar scale = chart.scale;\r\n\t\tvar labels = chart.data.labels;\r\n\r\n\t\tvar centerX = scale.xCenter;\r\n\t\tvar centerY = scale.yCenter;\r\n\r\n\t\t// var negHalfPI = -0.5 * Math.PI;\r\n\t\tvar datasetStartAngle = opts.startAngle;\r\n\t\tvar distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\r\n\t\tvar startAngle = me._starts[index];\r\n\t\tvar endAngle = startAngle + (arc.hidden ? 0 : me._angles[index]);\r\n\r\n\t\tvar resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\r\n\t\tvar options = arc._options || {};\r\n\r\n\t\thelpers$1.extend(arc, {\r\n\t\t\t// Utility\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index,\r\n\t\t\t_scale: scale,\r\n\r\n\t\t\t// Desired view properties\r\n\t\t\t_model: {\r\n\t\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\t\tborderColor: options.borderColor,\r\n\t\t\t\tborderWidth: options.borderWidth,\r\n\t\t\t\tborderAlign: options.borderAlign,\r\n\t\t\t\tx: centerX,\r\n\t\t\t\ty: centerY,\r\n\t\t\t\tinnerRadius: 0,\r\n\t\t\t\touterRadius: reset ? resetRadius : distance,\r\n\t\t\t\tstartAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,\r\n\t\t\t\tendAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,\r\n\t\t\t\tlabel: helpers$1.valueAtIndexOrDefault(labels, index, labels[index])\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tarc.pivot();\r\n\t},\r\n\r\n\tcountVisibleElements: function() {\r\n\t\tvar dataset = this.getDataset();\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar count = 0;\r\n\r\n\t\thelpers$1.each(meta.data, function(element, index) {\r\n\t\t\tif (!isNaN(dataset.data[index]) && !element.hidden) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn count;\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(arc) {\r\n\t\tvar model = arc._model;\r\n\t\tvar options = arc._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\t\tvar valueOrDefault = helpers$1.valueOrDefault;\r\n\r\n\t\tarc.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault(options.hoverBorderWidth, options.borderWidth);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_computeAngle: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar count = this.getMeta().count;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar meta = me.getMeta();\r\n\r\n\t\tif (isNaN(dataset.data[index]) || meta.data[index].hidden) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: me.chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: dataset,\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\treturn resolve$3([\r\n\t\t\tme.chart.options.elements.arc.angle,\r\n\t\t\t(2 * Math.PI) / count\r\n\t\t], context, index);\r\n\t}\r\n});\r\n\r\ncore_defaults._set('pie', helpers$1.clone(core_defaults.doughnut));\r\ncore_defaults._set('pie', {\r\n\tcutoutPercentage: 0\r\n});\r\n\r\n// Pie charts are Doughnut chart with different defaults\r\nvar controller_pie = controller_doughnut;\r\n\r\nvar valueOrDefault$7 = helpers$1.valueOrDefault;\r\n\r\ncore_defaults._set('radar', {\r\n\tspanGaps: false,\r\n\tscale: {\r\n\t\ttype: 'radialLinear'\r\n\t},\r\n\telements: {\r\n\t\tline: {\r\n\t\t\tfill: 'start',\r\n\t\t\ttension: 0 // no bezier in radar\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_radar = core_datasetController.extend({\r\n\tdatasetElementType: elements.Line,\r\n\r\n\tdataElementType: elements.Point,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderWidth',\r\n\t\t'borderColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'fill'\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: {\r\n\t\tbackgroundColor: 'pointBackgroundColor',\r\n\t\tborderColor: 'pointBorderColor',\r\n\t\tborderWidth: 'pointBorderWidth',\r\n\t\thitRadius: 'pointHitRadius',\r\n\t\thoverBackgroundColor: 'pointHoverBackgroundColor',\r\n\t\thoverBorderColor: 'pointHoverBorderColor',\r\n\t\thoverBorderWidth: 'pointHoverBorderWidth',\r\n\t\thoverRadius: 'pointHoverRadius',\r\n\t\tpointStyle: 'pointStyle',\r\n\t\tradius: 'pointRadius',\r\n\t\trotation: 'pointRotation'\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar line = meta.dataset;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar scale = me.chart.scale;\r\n\t\tvar config = me._config;\r\n\t\tvar i, ilen;\r\n\r\n\t\t// Compatibility: If the properties are defined with only the old name, use those values\r\n\t\tif (config.tension !== undefined && config.lineTension === undefined) {\r\n\t\t\tconfig.lineTension = config.tension;\r\n\t\t}\r\n\r\n\t\t// Utility\r\n\t\tline._scale = scale;\r\n\t\tline._datasetIndex = me.index;\r\n\t\t// Data\r\n\t\tline._children = points;\r\n\t\tline._loop = true;\r\n\t\t// Model\r\n\t\tline._model = me._resolveDatasetElementOptions(line);\r\n\r\n\t\tline.pivot();\r\n\r\n\t\t// Update Points\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(points[i], i, reset);\r\n\t\t}\r\n\r\n\t\t// Update bezier control points\r\n\t\tme.updateBezierControlPoints();\r\n\r\n\t\t// Now pivot the point for animation\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tpoints[i].pivot();\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar scale = me.chart.scale;\r\n\t\tvar pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\t\tvar lineModel = me.getMeta().dataset._model;\r\n\t\tvar x = reset ? scale.xCenter : pointPosition.x;\r\n\t\tvar y = reset ? scale.yCenter : pointPosition.y;\r\n\r\n\t\t// Utility\r\n\t\tpoint._scale = scale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = me.index;\r\n\t\tpoint._index = index;\r\n\r\n\t\t// Desired view properties\r\n\t\tpoint._model = {\r\n\t\t\tx: x, // value not used in dataset scale, but we want a consistent API between scales\r\n\t\t\ty: y,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\t// Appearance\r\n\t\t\tradius: options.radius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\ttension: valueOrDefault$7(custom.tension, lineModel ? lineModel.tension : 0),\r\n\r\n\t\t\t// Tooltip\r\n\t\t\thitRadius: options.hitRadius\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function() {\r\n\t\tvar me = this;\r\n\t\tvar config = me._config;\r\n\t\tvar options = me.chart.options;\r\n\t\tvar values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments);\r\n\r\n\t\tvalues.spanGaps = valueOrDefault$7(config.spanGaps, options.spanGaps);\r\n\t\tvalues.tension = valueOrDefault$7(config.lineTension, options.elements.line.tension);\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tupdateBezierControlPoints: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar area = me.chart.chartArea;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar i, ilen, model, controlPoints;\r\n\r\n\t\t// Only consider points that are drawn in case the spanGaps option is used\r\n\t\tif (meta.dataset._model.spanGaps) {\r\n\t\t\tpoints = points.filter(function(pt) {\r\n\t\t\t\treturn !pt._model.skip;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction capControlPoint(pt, min, max) {\r\n\t\t\treturn Math.max(Math.min(pt, max), min);\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tmodel = points[i]._model;\r\n\t\t\tcontrolPoints = helpers$1.splineCurve(\r\n\t\t\t\thelpers$1.previousItem(points, i, true)._model,\r\n\t\t\t\tmodel,\r\n\t\t\t\thelpers$1.nextItem(points, i, true)._model,\r\n\t\t\t\tmodel.tension\r\n\t\t\t);\r\n\r\n\t\t\t// Prevent the bezier going outside of the bounds of the graph\r\n\t\t\tmodel.controlPointPreviousX = capControlPoint(controlPoints.previous.x, area.left, area.right);\r\n\t\t\tmodel.controlPointPreviousY = capControlPoint(controlPoints.previous.y, area.top, area.bottom);\r\n\t\t\tmodel.controlPointNextX = capControlPoint(controlPoints.next.x, area.left, area.right);\r\n\t\t\tmodel.controlPointNextY = capControlPoint(controlPoints.next.y, area.top, area.bottom);\r\n\t\t}\r\n\t},\r\n\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$7(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$7(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$7(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = valueOrDefault$7(options.hoverRadius, options.radius);\r\n\t}\r\n});\r\n\r\ncore_defaults._set('scatter', {\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\tid: 'x-axis-1', // need an ID so datasets can reference the scale\r\n\t\t\ttype: 'linear', // scatter should not use a category axis\r\n\t\t\tposition: 'bottom'\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\tid: 'y-axis-1',\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'left'\r\n\t\t}]\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn ''; // doesn't make sense for scatter since data are formatted as a point\r\n\t\t\t},\r\n\t\t\tlabel: function(item) {\r\n\t\t\t\treturn '(' + item.xLabel + ', ' + item.yLabel + ')';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\tscatter: {\r\n\t\t\tshowLine: false\r\n\t\t}\r\n\t}\r\n});\r\n\r\n// Scatter charts use line controllers\r\nvar controller_scatter = controller_line;\r\n\r\n// NOTE export a map in which the key represents the controller type, not\r\n// the class, and so must be CamelCase in order to be correctly retrieved\r\n// by the controller in core.controller.js (`controllers[meta.type]`).\r\n\r\nvar controllers = {\r\n\tbar: controller_bar,\r\n\tbubble: controller_bubble,\r\n\tdoughnut: controller_doughnut,\r\n\thorizontalBar: controller_horizontalBar,\r\n\tline: controller_line,\r\n\tpolarArea: controller_polarArea,\r\n\tpie: controller_pie,\r\n\tradar: controller_radar,\r\n\tscatter: controller_scatter\r\n};\r\n\r\n/**\r\n * Helper function to get relative position for an event\r\n * @param {Event|IEvent} event - The event to get the position for\r\n * @param {Chart} chart - The chart\r\n * @returns {object} the event position\r\n */\r\nfunction getRelativePosition(e, chart) {\r\n\tif (e.native) {\r\n\t\treturn {\r\n\t\t\tx: e.x,\r\n\t\t\ty: e.y\r\n\t\t};\r\n\t}\r\n\r\n\treturn helpers$1.getRelativePosition(e, chart);\r\n}\r\n\r\n/**\r\n * Helper function to traverse all of the visible elements in the chart\r\n * @param {Chart} chart - the chart\r\n * @param {function} handler - the callback to execute for each visible item\r\n */\r\nfunction parseVisibleItems(chart, handler) {\r\n\tvar metasets = chart._getSortedVisibleDatasetMetas();\r\n\tvar metadata, i, j, ilen, jlen, element;\r\n\r\n\tfor (i = 0, ilen = metasets.length; i < ilen; ++i) {\r\n\t\tmetadata = metasets[i].data;\r\n\t\tfor (j = 0, jlen = metadata.length; j < jlen; ++j) {\r\n\t\t\telement = metadata[j];\r\n\t\t\tif (!element._view.skip) {\r\n\t\t\t\thandler(element);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Helper function to get the items that intersect the event position\r\n * @param {ChartElement[]} items - elements to filter\r\n * @param {object} position - the point to be nearest to\r\n * @return {ChartElement[]} the nearest items\r\n */\r\nfunction getIntersectItems(chart, position) {\r\n\tvar elements = [];\r\n\r\n\tparseVisibleItems(chart, function(element) {\r\n\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\telements.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn elements;\r\n}\r\n\r\n/**\r\n * Helper function to get the items nearest to the event position considering all visible items in teh chart\r\n * @param {Chart} chart - the chart to look at elements from\r\n * @param {object} position - the point to be nearest to\r\n * @param {boolean} intersect - if true, only consider items that intersect the position\r\n * @param {function} distanceMetric - function to provide the distance between points\r\n * @return {ChartElement[]} the nearest items\r\n */\r\nfunction getNearestItems(chart, position, intersect, distanceMetric) {\r\n\tvar minDistance = Number.POSITIVE_INFINITY;\r\n\tvar nearestItems = [];\r\n\r\n\tparseVisibleItems(chart, function(element) {\r\n\t\tif (intersect && !element.inRange(position.x, position.y)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar center = element.getCenterPoint();\r\n\t\tvar distance = distanceMetric(position, center);\r\n\t\tif (distance < minDistance) {\r\n\t\t\tnearestItems = [element];\r\n\t\t\tminDistance = distance;\r\n\t\t} else if (distance === minDistance) {\r\n\t\t\t// Can have multiple items at the same distance in which case we sort by size\r\n\t\t\tnearestItems.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn nearestItems;\r\n}\r\n\r\n/**\r\n * Get a distance metric function for two points based on the\r\n * axis mode setting\r\n * @param {string} axis - the axis mode. x|y|xy\r\n */\r\nfunction getDistanceMetricForAxis(axis) {\r\n\tvar useX = axis.indexOf('x') !== -1;\r\n\tvar useY = axis.indexOf('y') !== -1;\r\n\r\n\treturn function(pt1, pt2) {\r\n\t\tvar deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\r\n\t\tvar deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\r\n\t\treturn Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\r\n\t};\r\n}\r\n\r\nfunction indexMode(chart, e, options) {\r\n\tvar position = getRelativePosition(e, chart);\r\n\t// Default axis for index mode is 'x' to match old behaviour\r\n\toptions.axis = options.axis || 'x';\r\n\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\r\n\tvar elements = [];\r\n\r\n\tif (!items.length) {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tchart._getSortedVisibleDatasetMetas().forEach(function(meta) {\r\n\t\tvar element = meta.data[items[0]._index];\r\n\r\n\t\t// don't count items that are skipped (null data)\r\n\t\tif (element && !element._view.skip) {\r\n\t\t\telements.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn elements;\r\n}\r\n\r\n/**\r\n * @interface IInteractionOptions\r\n */\r\n/**\r\n * If true, only consider items that intersect the point\r\n * @name IInterfaceOptions#boolean\r\n * @type Boolean\r\n */\r\n\r\n/**\r\n * Contains interaction related functions\r\n * @namespace Chart.Interaction\r\n */\r\nvar core_interaction = {\r\n\t// Helper function for different modes\r\n\tmodes: {\r\n\t\tsingle: function(chart, e) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar elements = [];\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\telements.push(element);\r\n\t\t\t\t\treturn elements;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn elements.slice(0, 1);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * @function Chart.Interaction.modes.label\r\n\t\t * @deprecated since version 2.4.0\r\n\t\t * @todo remove at version 3\r\n\t\t * @private\r\n\t\t */\r\n\t\tlabel: indexMode,\r\n\r\n\t\t/**\r\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\r\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\r\n\t\t * @function Chart.Interaction.modes.index\r\n\t\t * @since v2.4.0\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use during interaction\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tindex: indexMode,\r\n\r\n\t\t/**\r\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\r\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\r\n\t\t * @function Chart.Interaction.modes.dataset\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use during interaction\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tdataset: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\toptions.axis = options.axis || 'xy';\r\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\t\t\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\r\n\r\n\t\t\tif (items.length > 0) {\r\n\t\t\t\titems = chart.getDatasetMeta(items[0]._datasetIndex).data;\r\n\t\t\t}\r\n\r\n\t\t\treturn items;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * @function Chart.Interaction.modes.x-axis\r\n\t\t * @deprecated since version 2.4.0. Use index mode and intersect == true\r\n\t\t * @todo remove at version 3\r\n\t\t * @private\r\n\t\t */\r\n\t\t'x-axis': function(chart, e) {\r\n\t\t\treturn indexMode(chart, e, {intersect: false});\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Point mode returns all elements that hit test based on the event position\r\n\t\t * of the event\r\n\t\t * @function Chart.Interaction.modes.intersect\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tpoint: function(chart, e) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\treturn getIntersectItems(chart, position);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * nearest mode returns the element closest to the point\r\n\t\t * @function Chart.Interaction.modes.intersect\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tnearest: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\toptions.axis = options.axis || 'xy';\r\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\t\t\treturn getNearestItems(chart, position, options.intersect, distanceMetric);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * x mode returns the elements that hit-test at the current x coordinate\r\n\t\t * @function Chart.Interaction.modes.x\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tx: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar items = [];\r\n\t\t\tvar intersectsItem = false;\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inXRange(position.x)) {\r\n\t\t\t\t\titems.push(element);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\tintersectsItem = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// If we want to trigger on an intersect and we don't have any items\r\n\t\t\t// that intersect the position, return nothing\r\n\t\t\tif (options.intersect && !intersectsItem) {\r\n\t\t\t\titems = [];\r\n\t\t\t}\r\n\t\t\treturn items;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * y mode returns the elements that hit-test at the current y coordinate\r\n\t\t * @function Chart.Interaction.modes.y\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\ty: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar items = [];\r\n\t\t\tvar intersectsItem = false;\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inYRange(position.y)) {\r\n\t\t\t\t\titems.push(element);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\tintersectsItem = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// If we want to trigger on an intersect and we don't have any items\r\n\t\t\t// that intersect the position, return nothing\r\n\t\t\tif (options.intersect && !intersectsItem) {\r\n\t\t\t\titems = [];\r\n\t\t\t}\r\n\t\t\treturn items;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar extend = helpers$1.extend;\r\n\r\nfunction filterByPosition(array, position) {\r\n\treturn helpers$1.where(array, function(v) {\r\n\t\treturn v.pos === position;\r\n\t});\r\n}\r\n\r\nfunction sortByWeight(array, reverse) {\r\n\treturn array.sort(function(a, b) {\r\n\t\tvar v0 = reverse ? b : a;\r\n\t\tvar v1 = reverse ? a : b;\r\n\t\treturn v0.weight === v1.weight ?\r\n\t\t\tv0.index - v1.index :\r\n\t\t\tv0.weight - v1.weight;\r\n\t});\r\n}\r\n\r\nfunction wrapBoxes(boxes) {\r\n\tvar layoutBoxes = [];\r\n\tvar i, ilen, box;\r\n\r\n\tfor (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\r\n\t\tbox = boxes[i];\r\n\t\tlayoutBoxes.push({\r\n\t\t\tindex: i,\r\n\t\t\tbox: box,\r\n\t\t\tpos: box.position,\r\n\t\t\thorizontal: box.isHorizontal(),\r\n\t\t\tweight: box.weight\r\n\t\t});\r\n\t}\r\n\treturn layoutBoxes;\r\n}\r\n\r\nfunction setLayoutDims(layouts, params) {\r\n\tvar i, ilen, layout;\r\n\tfor (i = 0, ilen = layouts.length; i < ilen; ++i) {\r\n\t\tlayout = layouts[i];\r\n\t\t// store width used instead of chartArea.w in fitBoxes\r\n\t\tlayout.width = layout.horizontal\r\n\t\t\t? layout.box.fullWidth && params.availableWidth\r\n\t\t\t: params.vBoxMaxWidth;\r\n\t\t// store height used instead of chartArea.h in fitBoxes\r\n\t\tlayout.height = layout.horizontal && params.hBoxMaxHeight;\r\n\t}\r\n}\r\n\r\nfunction buildLayoutBoxes(boxes) {\r\n\tvar layoutBoxes = wrapBoxes(boxes);\r\n\tvar left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\r\n\tvar right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\r\n\tvar top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\r\n\tvar bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\r\n\r\n\treturn {\r\n\t\tleftAndTop: left.concat(top),\r\n\t\trightAndBottom: right.concat(bottom),\r\n\t\tchartArea: filterByPosition(layoutBoxes, 'chartArea'),\r\n\t\tvertical: left.concat(right),\r\n\t\thorizontal: top.concat(bottom)\r\n\t};\r\n}\r\n\r\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\r\n\treturn Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\r\n}\r\n\r\nfunction updateDims(chartArea, params, layout) {\r\n\tvar box = layout.box;\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\tvar newWidth, newHeight;\r\n\r\n\tif (layout.size) {\r\n\t\t// this layout was already counted for, lets first reduce old size\r\n\t\tchartArea[layout.pos] -= layout.size;\r\n\t}\r\n\tlayout.size = layout.horizontal ? box.height : box.width;\r\n\tchartArea[layout.pos] += layout.size;\r\n\r\n\tif (box.getPadding) {\r\n\t\tvar boxPadding = box.getPadding();\r\n\t\tmaxPadding.top = Math.max(maxPadding.top, boxPadding.top);\r\n\t\tmaxPadding.left = Math.max(maxPadding.left, boxPadding.left);\r\n\t\tmaxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\r\n\t\tmaxPadding.right = Math.max(maxPadding.right, boxPadding.right);\r\n\t}\r\n\r\n\tnewWidth = params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right');\r\n\tnewHeight = params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom');\r\n\r\n\tif (newWidth !== chartArea.w || newHeight !== chartArea.h) {\r\n\t\tchartArea.w = newWidth;\r\n\t\tchartArea.h = newHeight;\r\n\r\n\t\t// return true if chart area changed in layout's direction\r\n\t\treturn layout.horizontal ? newWidth !== chartArea.w : newHeight !== chartArea.h;\r\n\t}\r\n}\r\n\r\nfunction handleMaxPadding(chartArea) {\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\r\n\tfunction updatePos(pos) {\r\n\t\tvar change = Math.max(maxPadding[pos] - chartArea[pos], 0);\r\n\t\tchartArea[pos] += change;\r\n\t\treturn change;\r\n\t}\r\n\tchartArea.y += updatePos('top');\r\n\tchartArea.x += updatePos('left');\r\n\tupdatePos('right');\r\n\tupdatePos('bottom');\r\n}\r\n\r\nfunction getMargins(horizontal, chartArea) {\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\r\n\tfunction marginForPositions(positions) {\r\n\t\tvar margin = {left: 0, top: 0, right: 0, bottom: 0};\r\n\t\tpositions.forEach(function(pos) {\r\n\t\t\tmargin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\r\n\t\t});\r\n\t\treturn margin;\r\n\t}\r\n\r\n\treturn horizontal\r\n\t\t? marginForPositions(['left', 'right'])\r\n\t\t: marginForPositions(['top', 'bottom']);\r\n}\r\n\r\nfunction fitBoxes(boxes, chartArea, params) {\r\n\tvar refitBoxes = [];\r\n\tvar i, ilen, layout, box, refit, changed;\r\n\r\n\tfor (i = 0, ilen = boxes.length; i < ilen; ++i) {\r\n\t\tlayout = boxes[i];\r\n\t\tbox = layout.box;\r\n\r\n\t\tbox.update(\r\n\t\t\tlayout.width || chartArea.w,\r\n\t\t\tlayout.height || chartArea.h,\r\n\t\t\tgetMargins(layout.horizontal, chartArea)\r\n\t\t);\r\n\t\tif (updateDims(chartArea, params, layout)) {\r\n\t\t\tchanged = true;\r\n\t\t\tif (refitBoxes.length) {\r\n\t\t\t\t// Dimensions changed and there were non full width boxes before this\r\n\t\t\t\t// -> we have to refit those\r\n\t\t\t\trefit = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!box.fullWidth) { // fullWidth boxes don't need to be re-fitted in any case\r\n\t\t\trefitBoxes.push(layout);\r\n\t\t}\r\n\t}\r\n\r\n\treturn refit ? fitBoxes(refitBoxes, chartArea, params) || changed : changed;\r\n}\r\n\r\nfunction placeBoxes(boxes, chartArea, params) {\r\n\tvar userPadding = params.padding;\r\n\tvar x = chartArea.x;\r\n\tvar y = chartArea.y;\r\n\tvar i, ilen, layout, box;\r\n\r\n\tfor (i = 0, ilen = boxes.length; i < ilen; ++i) {\r\n\t\tlayout = boxes[i];\r\n\t\tbox = layout.box;\r\n\t\tif (layout.horizontal) {\r\n\t\t\tbox.left = box.fullWidth ? userPadding.left : chartArea.left;\r\n\t\t\tbox.right = box.fullWidth ? params.outerWidth - userPadding.right : chartArea.left + chartArea.w;\r\n\t\t\tbox.top = y;\r\n\t\t\tbox.bottom = y + box.height;\r\n\t\t\tbox.width = box.right - box.left;\r\n\t\t\ty = box.bottom;\r\n\t\t} else {\r\n\t\t\tbox.left = x;\r\n\t\t\tbox.right = x + box.width;\r\n\t\t\tbox.top = chartArea.top;\r\n\t\t\tbox.bottom = chartArea.top + chartArea.h;\r\n\t\t\tbox.height = box.bottom - box.top;\r\n\t\t\tx = box.right;\r\n\t\t}\r\n\t}\r\n\r\n\tchartArea.x = x;\r\n\tchartArea.y = y;\r\n}\r\n\r\ncore_defaults._set('global', {\r\n\tlayout: {\r\n\t\tpadding: {\r\n\t\t\ttop: 0,\r\n\t\t\tright: 0,\r\n\t\t\tbottom: 0,\r\n\t\t\tleft: 0\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/**\r\n * @interface ILayoutItem\r\n * @prop {string} position - The position of the item in the chart layout. Possible values are\r\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\r\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\r\n * @prop {boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down\r\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\r\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\r\n * @prop {function} getPadding - Returns an object with padding on the edges\r\n * @prop {number} width - Width of item. Must be valid after update()\r\n * @prop {number} height - Height of item. Must be valid after update()\r\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\r\n */\r\n\r\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\r\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\r\n// It is this service's responsibility of carrying out that layout.\r\nvar core_layouts = {\r\n\tdefaults: {},\r\n\r\n\t/**\r\n\t * Register a box to a chart.\r\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\r\n\t * @param {Chart} chart - the chart to use\r\n\t * @param {ILayoutItem} item - the item to add to be layed out\r\n\t */\r\n\taddBox: function(chart, item) {\r\n\t\tif (!chart.boxes) {\r\n\t\t\tchart.boxes = [];\r\n\t\t}\r\n\r\n\t\t// initialize item with default values\r\n\t\titem.fullWidth = item.fullWidth || false;\r\n\t\titem.position = item.position || 'top';\r\n\t\titem.weight = item.weight || 0;\r\n\t\titem._layers = item._layers || function() {\r\n\t\t\treturn [{\r\n\t\t\t\tz: 0,\r\n\t\t\t\tdraw: function() {\r\n\t\t\t\t\titem.draw.apply(item, arguments);\r\n\t\t\t\t}\r\n\t\t\t}];\r\n\t\t};\r\n\r\n\t\tchart.boxes.push(item);\r\n\t},\r\n\r\n\t/**\r\n\t * Remove a layoutItem from a chart\r\n\t * @param {Chart} chart - the chart to remove the box from\r\n\t * @param {ILayoutItem} layoutItem - the item to remove from the layout\r\n\t */\r\n\tremoveBox: function(chart, layoutItem) {\r\n\t\tvar index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\r\n\t\tif (index !== -1) {\r\n\t\t\tchart.boxes.splice(index, 1);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Sets (or updates) options on the given `item`.\r\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\r\n\t * @param {ILayoutItem} item - the item to configure with the given options\r\n\t * @param {object} options - the new item options.\r\n\t */\r\n\tconfigure: function(chart, item, options) {\r\n\t\tvar props = ['fullWidth', 'position', 'weight'];\r\n\t\tvar ilen = props.length;\r\n\t\tvar i = 0;\r\n\t\tvar prop;\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tprop = props[i];\r\n\t\t\tif (options.hasOwnProperty(prop)) {\r\n\t\t\t\titem[prop] = options[prop];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Fits boxes of the given chart into the given size by having each box measure itself\r\n\t * then running a fitting algorithm\r\n\t * @param {Chart} chart - the chart\r\n\t * @param {number} width - the width to fit into\r\n\t * @param {number} height - the height to fit into\r\n\t */\r\n\tupdate: function(chart, width, height) {\r\n\t\tif (!chart) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar layoutOptions = chart.options.layout || {};\r\n\t\tvar padding = helpers$1.options.toPadding(layoutOptions.padding);\r\n\r\n\t\tvar availableWidth = width - padding.width;\r\n\t\tvar availableHeight = height - padding.height;\r\n\t\tvar boxes = buildLayoutBoxes(chart.boxes);\r\n\t\tvar verticalBoxes = boxes.vertical;\r\n\t\tvar horizontalBoxes = boxes.horizontal;\r\n\r\n\t\t// Essentially we now have any number of boxes on each of the 4 sides.\r\n\t\t// Our canvas looks like the following.\r\n\t\t// The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\r\n\t\t// B1 is the bottom axis\r\n\t\t// There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\r\n\t\t// These locations are single-box locations only, when trying to register a chartArea location that is already taken,\r\n\t\t// an error will be thrown.\r\n\t\t//\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | T1 (Full Width) |\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | | | T2 | |\r\n\t\t// | |----|-------------------------------------|----|\r\n\t\t// | | | C1 | | C2 | |\r\n\t\t// | | |----| |----| |\r\n\t\t// | | | | |\r\n\t\t// | L1 | L2 | ChartArea (C0) | R1 |\r\n\t\t// | | | | |\r\n\t\t// | | |----| |----| |\r\n\t\t// | | | C3 | | C4 | |\r\n\t\t// | |----|-------------------------------------|----|\r\n\t\t// | | | B1 | |\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | B2 (Full Width) |\r\n\t\t// |----------------------------------------------------|\r\n\t\t//\r\n\r\n\t\tvar params = Object.freeze({\r\n\t\t\touterWidth: width,\r\n\t\t\touterHeight: height,\r\n\t\t\tpadding: padding,\r\n\t\t\tavailableWidth: availableWidth,\r\n\t\t\tvBoxMaxWidth: availableWidth / 2 / verticalBoxes.length,\r\n\t\t\thBoxMaxHeight: availableHeight / 2\r\n\t\t});\r\n\t\tvar chartArea = extend({\r\n\t\t\tmaxPadding: extend({}, padding),\r\n\t\t\tw: availableWidth,\r\n\t\t\th: availableHeight,\r\n\t\t\tx: padding.left,\r\n\t\t\ty: padding.top\r\n\t\t}, padding);\r\n\r\n\t\tsetLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\r\n\r\n\t\t// First fit vertical boxes\r\n\t\tfitBoxes(verticalBoxes, chartArea, params);\r\n\r\n\t\t// Then fit horizontal boxes\r\n\t\tif (fitBoxes(horizontalBoxes, chartArea, params)) {\r\n\t\t\t// if the area changed, re-fit vertical boxes\r\n\t\t\tfitBoxes(verticalBoxes, chartArea, params);\r\n\t\t}\r\n\r\n\t\thandleMaxPadding(chartArea);\r\n\r\n\t\t// Finally place the boxes to correct coordinates\r\n\t\tplaceBoxes(boxes.leftAndTop, chartArea, params);\r\n\r\n\t\t// Move to opposite side of chart\r\n\t\tchartArea.x += chartArea.w;\r\n\t\tchartArea.y += chartArea.h;\r\n\r\n\t\tplaceBoxes(boxes.rightAndBottom, chartArea, params);\r\n\r\n\t\tchart.chartArea = {\r\n\t\t\tleft: chartArea.left,\r\n\t\t\ttop: chartArea.top,\r\n\t\t\tright: chartArea.left + chartArea.w,\r\n\t\t\tbottom: chartArea.top + chartArea.h\r\n\t\t};\r\n\r\n\t\t// Finally update boxes in chartArea (radial scale for example)\r\n\t\thelpers$1.each(boxes.chartArea, function(layout) {\r\n\t\t\tvar box = layout.box;\r\n\t\t\textend(box, chart.chartArea);\r\n\t\t\tbox.update(chartArea.w, chartArea.h);\r\n\t\t});\r\n\t}\r\n};\r\n\r\n/**\r\n * Platform fallback implementation (minimal).\r\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\r\n */\r\n\r\nvar platform_basic = {\r\n\tacquireContext: function(item) {\r\n\t\tif (item && item.canvas) {\r\n\t\t\t// Support for any object associated to a canvas (including a context2d)\r\n\t\t\titem = item.canvas;\r\n\t\t}\r\n\r\n\t\treturn item && item.getContext('2d') || null;\r\n\t}\r\n};\r\n\r\nvar platform_dom = \"/*\\n * DOM element rendering detection\\n * https://davidwalsh.name/detect-node-insertion\\n */\\n@keyframes chartjs-render-animation {\\n\\tfrom { opacity: 0.99; }\\n\\tto { opacity: 1; }\\n}\\n\\n.chartjs-render-monitor {\\n\\tanimation: chartjs-render-animation 0.001s;\\n}\\n\\n/*\\n * DOM element resizing detection\\n * https://github.com/marcj/css-element-queries\\n */\\n.chartjs-size-monitor,\\n.chartjs-size-monitor-expand,\\n.chartjs-size-monitor-shrink {\\n\\tposition: absolute;\\n\\tdirection: ltr;\\n\\tleft: 0;\\n\\ttop: 0;\\n\\tright: 0;\\n\\tbottom: 0;\\n\\toverflow: hidden;\\n\\tpointer-events: none;\\n\\tvisibility: hidden;\\n\\tz-index: -1;\\n}\\n\\n.chartjs-size-monitor-expand > div {\\n\\tposition: absolute;\\n\\twidth: 1000000px;\\n\\theight: 1000000px;\\n\\tleft: 0;\\n\\ttop: 0;\\n}\\n\\n.chartjs-size-monitor-shrink > div {\\n\\tposition: absolute;\\n\\twidth: 200%;\\n\\theight: 200%;\\n\\tleft: 0;\\n\\ttop: 0;\\n}\\n\";\r\n\r\nvar platform_dom$1 = /*#__PURE__*/Object.freeze({\r\n__proto__: null,\r\n'default': platform_dom\r\n});\r\n\r\nvar stylesheet = getCjsExportFromNamespace(platform_dom$1);\r\n\r\nvar EXPANDO_KEY = '$chartjs';\r\nvar CSS_PREFIX = 'chartjs-';\r\nvar CSS_SIZE_MONITOR = CSS_PREFIX + 'size-monitor';\r\nvar CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';\r\nvar CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation';\r\nvar ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart'];\r\n\r\n/**\r\n * DOM event types -> Chart.js event types.\r\n * Note: only events with different types are mapped.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\r\n */\r\nvar EVENT_TYPES = {\r\n\ttouchstart: 'mousedown',\r\n\ttouchmove: 'mousemove',\r\n\ttouchend: 'mouseup',\r\n\tpointerenter: 'mouseenter',\r\n\tpointerdown: 'mousedown',\r\n\tpointermove: 'mousemove',\r\n\tpointerup: 'mouseup',\r\n\tpointerleave: 'mouseout',\r\n\tpointerout: 'mouseout'\r\n};\r\n\r\n/**\r\n * The \"used\" size is the final value of a dimension property after all calculations have\r\n * been performed. This method uses the computed style of `element` but returns undefined\r\n * if the computed style is not expressed in pixels. That can happen in some cases where\r\n * `element` has a size relative to its parent and this last one is not yet displayed,\r\n * for example because of `display: none` on a parent node.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\r\n * @returns {number} Size in pixels or undefined if unknown.\r\n */\r\nfunction readUsedSize(element, property) {\r\n\tvar value = helpers$1.getStyle(element, property);\r\n\tvar matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\r\n\treturn matches ? Number(matches[1]) : undefined;\r\n}\r\n\r\n/**\r\n * Initializes the canvas style and render size without modifying the canvas display size,\r\n * since responsiveness is handled by the controller.resize() method. The config is used\r\n * to determine the aspect ratio to apply in case no explicit height has been specified.\r\n */\r\nfunction initCanvas(canvas, config) {\r\n\tvar style = canvas.style;\r\n\r\n\t// NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\r\n\t// returns null or '' if no explicit value has been set to the canvas attribute.\r\n\tvar renderHeight = canvas.getAttribute('height');\r\n\tvar renderWidth = canvas.getAttribute('width');\r\n\r\n\t// Chart.js modifies some canvas values that we want to restore on destroy\r\n\tcanvas[EXPANDO_KEY] = {\r\n\t\tinitial: {\r\n\t\t\theight: renderHeight,\r\n\t\t\twidth: renderWidth,\r\n\t\t\tstyle: {\r\n\t\t\t\tdisplay: style.display,\r\n\t\t\t\theight: style.height,\r\n\t\t\t\twidth: style.width\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Force canvas to display as block to avoid extra space caused by inline\r\n\t// elements, which would interfere with the responsive resize process.\r\n\t// https://github.com/chartjs/Chart.js/issues/2538\r\n\tstyle.display = style.display || 'block';\r\n\r\n\tif (renderWidth === null || renderWidth === '') {\r\n\t\tvar displayWidth = readUsedSize(canvas, 'width');\r\n\t\tif (displayWidth !== undefined) {\r\n\t\t\tcanvas.width = displayWidth;\r\n\t\t}\r\n\t}\r\n\r\n\tif (renderHeight === null || renderHeight === '') {\r\n\t\tif (canvas.style.height === '') {\r\n\t\t\t// If no explicit render height and style height, let's apply the aspect ratio,\r\n\t\t\t// which one can be specified by the user but also by charts as default option\r\n\t\t\t// (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\r\n\t\t\tcanvas.height = canvas.width / (config.options.aspectRatio || 2);\r\n\t\t} else {\r\n\t\t\tvar displayHeight = readUsedSize(canvas, 'height');\r\n\t\t\tif (displayWidth !== undefined) {\r\n\t\t\t\tcanvas.height = displayHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn canvas;\r\n}\r\n\r\n/**\r\n * Detects support for options object argument in addEventListener.\r\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\r\n * @private\r\n */\r\nvar supportsEventListenerOptions = (function() {\r\n\tvar supports = false;\r\n\ttry {\r\n\t\tvar options = Object.defineProperty({}, 'passive', {\r\n\t\t\t// eslint-disable-next-line getter-return\r\n\t\t\tget: function() {\r\n\t\t\t\tsupports = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\twindow.addEventListener('e', null, options);\r\n\t} catch (e) {\r\n\t\t// continue regardless of error\r\n\t}\r\n\treturn supports;\r\n}());\r\n\r\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\r\n// https://github.com/chartjs/Chart.js/issues/4287\r\nvar eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\r\n\r\nfunction addListener(node, type, listener) {\r\n\tnode.addEventListener(type, listener, eventListenerOptions);\r\n}\r\n\r\nfunction removeListener(node, type, listener) {\r\n\tnode.removeEventListener(type, listener, eventListenerOptions);\r\n}\r\n\r\nfunction createEvent(type, chart, x, y, nativeEvent) {\r\n\treturn {\r\n\t\ttype: type,\r\n\t\tchart: chart,\r\n\t\tnative: nativeEvent || null,\r\n\t\tx: x !== undefined ? x : null,\r\n\t\ty: y !== undefined ? y : null,\r\n\t};\r\n}\r\n\r\nfunction fromNativeEvent(event, chart) {\r\n\tvar type = EVENT_TYPES[event.type] || event.type;\r\n\tvar pos = helpers$1.getRelativePosition(event, chart);\r\n\treturn createEvent(type, chart, pos.x, pos.y, event);\r\n}\r\n\r\nfunction throttled(fn, thisArg) {\r\n\tvar ticking = false;\r\n\tvar args = [];\r\n\r\n\treturn function() {\r\n\t\targs = Array.prototype.slice.call(arguments);\r\n\t\tthisArg = thisArg || this;\r\n\r\n\t\tif (!ticking) {\r\n\t\t\tticking = true;\r\n\t\t\thelpers$1.requestAnimFrame.call(window, function() {\r\n\t\t\t\tticking = false;\r\n\t\t\t\tfn.apply(thisArg, args);\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction createDiv(cls) {\r\n\tvar el = document.createElement('div');\r\n\tel.className = cls || '';\r\n\treturn el;\r\n}\r\n\r\n// Implementation based on https://github.com/marcj/css-element-queries\r\nfunction createResizer(handler) {\r\n\tvar maxSize = 1000000;\r\n\r\n\t// NOTE(SB) Don't use innerHTML because it could be considered unsafe.\r\n\t// https://github.com/chartjs/Chart.js/issues/5902\r\n\tvar resizer = createDiv(CSS_SIZE_MONITOR);\r\n\tvar expand = createDiv(CSS_SIZE_MONITOR + '-expand');\r\n\tvar shrink = createDiv(CSS_SIZE_MONITOR + '-shrink');\r\n\r\n\texpand.appendChild(createDiv());\r\n\tshrink.appendChild(createDiv());\r\n\r\n\tresizer.appendChild(expand);\r\n\tresizer.appendChild(shrink);\r\n\tresizer._reset = function() {\r\n\t\texpand.scrollLeft = maxSize;\r\n\t\texpand.scrollTop = maxSize;\r\n\t\tshrink.scrollLeft = maxSize;\r\n\t\tshrink.scrollTop = maxSize;\r\n\t};\r\n\r\n\tvar onScroll = function() {\r\n\t\tresizer._reset();\r\n\t\thandler();\r\n\t};\r\n\r\n\taddListener(expand, 'scroll', onScroll.bind(expand, 'expand'));\r\n\taddListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));\r\n\r\n\treturn resizer;\r\n}\r\n\r\n// https://davidwalsh.name/detect-node-insertion\r\nfunction watchForRender(node, handler) {\r\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\r\n\tvar proxy = expando.renderProxy = function(e) {\r\n\t\tif (e.animationName === CSS_RENDER_ANIMATION) {\r\n\t\t\thandler();\r\n\t\t}\r\n\t};\r\n\r\n\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\r\n\t\taddListener(node, type, proxy);\r\n\t});\r\n\r\n\t// #4737: Chrome might skip the CSS animation when the CSS_RENDER_MONITOR class\r\n\t// is removed then added back immediately (same animation frame?). Accessing the\r\n\t// `offsetParent` property will force a reflow and re-evaluate the CSS animation.\r\n\t// https://gist.github.com/paulirish/5d52fb081b3570c81e3a#box-metrics\r\n\t// https://github.com/chartjs/Chart.js/issues/4737\r\n\texpando.reflow = !!node.offsetParent;\r\n\r\n\tnode.classList.add(CSS_RENDER_MONITOR);\r\n}\r\n\r\nfunction unwatchForRender(node) {\r\n\tvar expando = node[EXPANDO_KEY] || {};\r\n\tvar proxy = expando.renderProxy;\r\n\r\n\tif (proxy) {\r\n\t\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\r\n\t\t\tremoveListener(node, type, proxy);\r\n\t\t});\r\n\r\n\t\tdelete expando.renderProxy;\r\n\t}\r\n\r\n\tnode.classList.remove(CSS_RENDER_MONITOR);\r\n}\r\n\r\nfunction addResizeListener(node, listener, chart) {\r\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\r\n\r\n\t// Let's keep track of this added resizer and thus avoid DOM query when removing it.\r\n\tvar resizer = expando.resizer = createResizer(throttled(function() {\r\n\t\tif (expando.resizer) {\r\n\t\t\tvar container = chart.options.maintainAspectRatio && node.parentNode;\r\n\t\t\tvar w = container ? container.clientWidth : 0;\r\n\t\t\tlistener(createEvent('resize', chart));\r\n\t\t\tif (container && container.clientWidth < w && chart.canvas) {\r\n\t\t\t\t// If the container size shrank during chart resize, let's assume\r\n\t\t\t\t// scrollbar appeared. So we resize again with the scrollbar visible -\r\n\t\t\t\t// effectively making chart smaller and the scrollbar hidden again.\r\n\t\t\t\t// Because we are inside `throttled`, and currently `ticking`, scroll\r\n\t\t\t\t// events are ignored during this whole 2 resize process.\r\n\t\t\t\t// If we assumed wrong and something else happened, we are resizing\r\n\t\t\t\t// twice in a frame (potential performance issue)\r\n\t\t\t\tlistener(createEvent('resize', chart));\r\n\t\t\t}\r\n\t\t}\r\n\t}));\r\n\r\n\t// The resizer needs to be attached to the node parent, so we first need to be\r\n\t// sure that `node` is attached to the DOM before injecting the resizer element.\r\n\twatchForRender(node, function() {\r\n\t\tif (expando.resizer) {\r\n\t\t\tvar container = node.parentNode;\r\n\t\t\tif (container && container !== resizer.parentNode) {\r\n\t\t\t\tcontainer.insertBefore(resizer, container.firstChild);\r\n\t\t\t}\r\n\r\n\t\t\t// The container size might have changed, let's reset the resizer state.\r\n\t\t\tresizer._reset();\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction removeResizeListener(node) {\r\n\tvar expando = node[EXPANDO_KEY] || {};\r\n\tvar resizer = expando.resizer;\r\n\r\n\tdelete expando.resizer;\r\n\tunwatchForRender(node);\r\n\r\n\tif (resizer && resizer.parentNode) {\r\n\t\tresizer.parentNode.removeChild(resizer);\r\n\t}\r\n}\r\n\r\n/**\r\n * Injects CSS styles inline if the styles are not already present.\r\n * @param {HTMLDocument|ShadowRoot} rootNode - the node to contain the \\n
    \\n
  • \\n \\n
  • \\n
\");}]);","angular.module(\"mentio\").run([\"$templateCache\", function($templateCache) {$templateCache.put(\"mentio-menu.tpl.html\",\"
    \\n
  • \\n \\n
  • \\n
\");}]);","(function () {\r\n 'use strict';\r\n\r\n var module = angular.module('sticky', []);\r\n\r\n // Directive: sticky\r\n //\r\n module.directive('sticky', function() {\r\n return {\r\n restrict: 'A', // this directive can only be used as an attribute.\r\n link: linkFn\r\n };\r\n\r\n function linkFn($scope, $elem, $attrs) {\r\n var mediaQuery, stickyClass, bodyClass, elem, $window, $body,\r\n doc, initialCSS, initialStyle, isPositionFixed, isSticking,\r\n stickyLine, offset, anchor, prevOffset, matchMedia, fudge;\r\n\r\n //fudge was added by Vivify Health, Team SOA\r\n //When a sticky element is larger than the page size, element would stick to\r\n //top and not scroll the sticky element causing the bottom of the sticky element to never\r\n //be seen. fudge factor is calculated based on element size and window height to change\r\n //sticky line and offsets so that sticky element will be scrolled correctly.\r\n fudge = 0;\r\n isPositionFixed = false;\r\n isSticking = false;\r\n\r\n matchMedia = window.matchMedia;\r\n\r\n // elements\r\n $window = angular.element(window);\r\n $body = angular.element(document.body);\r\n elem = $elem[0];\r\n doc = document.documentElement;\r\n\r\n // attributes\r\n mediaQuery = $attrs.mediaQuery || false;\r\n stickyClass = $attrs.stickyClass || '';\r\n bodyClass = $attrs.bodyClass || '';\r\n\r\n initialStyle = $elem.attr('style');\r\n\r\n offset = typeof $attrs.offset === 'string' ?\r\n parseInt($attrs.offset.replace(/px;?/, '')) :\r\n 0;\r\n\r\n anchor = typeof $attrs.anchor === 'string' ?\r\n $attrs.anchor.toLowerCase().trim()\r\n : 'top';\r\n\r\n // initial style\r\n initialCSS = {\r\n top: $elem.css('top'),\r\n width: $elem.css('width'),\r\n position: $elem.css('position'),\r\n marginTop: $elem.css('margin-top'),\r\n cssLeft: $elem.css('left')\r\n };\r\n\r\n switch (anchor) {\r\n case 'top':\r\n case 'bottom':\r\n break;\r\n default:\r\n console.log('Unknown anchor '+anchor+', defaulting to top');\r\n anchor = 'top';\r\n break;\r\n }\r\n\r\n\r\n // Listeners\r\n //\r\n $window.on('scroll', checkIfShouldStick);\r\n $window.on('click', checkIfShouldStick);\r\n $window.on('resize', $scope.$apply.bind($scope, onResize));\r\n $scope.$on('$destroy', onDestroy);\r\n\r\n function onResize() {\r\n initialCSS.offsetWidth = elem.offsetWidth;\r\n checkIfShouldStick();\r\n\r\n if(isSticking){\r\n var parent = window.getComputedStyle(elem.parentElement, null),\r\n e = window.getComputedStyle(elem, null),\r\n initialOffsetWidth = elem.parentElement.offsetWidth -\r\n parent.getPropertyValue('padding-right').replace('px', '') -\r\n parent.getPropertyValue('padding-left').replace('px', '') -\r\n e.getPropertyValue('margin-right').replace('px', '') -\r\n e.getPropertyValue('margin-left').replace('px', '');\r\n\r\n $elem.css('width', initialOffsetWidth+'px');\r\n }\r\n }\r\n\r\n function onDestroy() {\r\n $window.off('scroll', checkIfShouldStick);\r\n $window.off('resize', onResize);\r\n\r\n if ( bodyClass ) {\r\n $body.removeClass(bodyClass);\r\n }\r\n }\r\n\r\n\r\n // Watcher\r\n //\r\n prevOffset = _getTopOffset(elem);\r\n\r\n $scope.$watch( function() { // triggered on load and on digest cycle\r\n if ( isSticking ) return prevOffset;\r\n\r\n prevOffset =\r\n (anchor === 'top') ?\r\n _getTopOffset(elem) :\r\n _getBottomOffset(elem);\r\n\r\n return prevOffset;\r\n\r\n }, function(newVal, oldVal) {\r\n if ( newVal !== oldVal || typeof stickyLine === 'undefined' ) {\r\n stickyLine = newVal - offset;\r\n checkIfShouldStick();\r\n }\r\n });\r\n\r\n\r\n // Methods\r\n //\r\n function checkIfShouldStick() {\r\n var scrollTop, shouldStick, scrollBottom, scrolledDistance;\r\n\r\n if ( mediaQuery && !(matchMedia('('+mediaQuery+')').matches || matchMedia(mediaQuery).matches) )\r\n return;\r\n\r\n if ($elem.prop('offsetHeight') + stickyLine - window.innerHeight + offset > 0) {\r\n fudge = $elem.prop('offsetHeight') + stickyLine - window.innerHeight + offset + 100; //100 is to account for footer\r\n } else {\r\n fudge = 0;\r\n }\r\n\r\n if ( anchor === 'top' ) {\r\n scrolledDistance = window.pageYOffset || doc.scrollTop;\r\n scrollTop = scrolledDistance - (doc.clientTop || 0);\r\n shouldStick = scrollTop >= stickyLine+fudge;\r\n } else {\r\n scrollBottom = window.pageYOffset + window.innerHeight;\r\n shouldStick = scrollBottom <= stickyLine;\r\n }\r\n\r\n // Switch the sticky mode if the element crosses the sticky line\r\n if ( shouldStick) // && !isSticking )\r\n stickElement();\r\n\r\n else if ( !shouldStick && isSticking )\r\n unstickElement();\r\n }\r\n\r\n function stickElement() {\r\n var rect, absoluteLeft;\r\n\r\n rect = $elem[0].getBoundingClientRect();\r\n absoluteLeft = rect.left;\r\n\r\n initialCSS.offsetWidth = elem.offsetWidth;\r\n\r\n isSticking = true;\r\n\r\n if ( bodyClass ) {\r\n $body.addClass(bodyClass);\r\n }\r\n\r\n if ( stickyClass ) {\r\n $elem.addClass(stickyClass);\r\n }\r\n\r\n $elem\r\n .css('width', elem.offsetWidth+'px')\r\n .css('position', 'fixed')\r\n .css(anchor, offset - fudge +'px')\r\n .css('left', absoluteLeft)\r\n .css('margin-top', 0);\r\n\r\n if ( anchor === 'bottom' ) {\r\n $elem.css('margin-bottom', 0);\r\n }\r\n }\r\n\r\n function unstickElement() {\r\n $elem.attr('style', $elem.initialStyle);\r\n isSticking = false;\r\n\r\n if ( bodyClass ) {\r\n $body.removeClass(bodyClass);\r\n }\r\n\r\n if ( stickyClass ) {\r\n $elem.removeClass(stickyClass);\r\n }\r\n\r\n $elem\r\n .css('width', '')\r\n .css('top', initialCSS.top)\r\n .css('position', initialCSS.position)\r\n .css('left', initialCSS.cssLeft)\r\n .css('margin-top', initialCSS.marginTop);\r\n }\r\n\r\n function _getTopOffset (element) {\r\n var pixels = 0;\r\n\r\n if (element.offsetParent) {\r\n do {\r\n pixels += element.offsetTop;\r\n element = element.offsetParent;\r\n } while (element);\r\n }\r\n\r\n return pixels;\r\n }\r\n\r\n function _getBottomOffset (element) {\r\n return element.offsetTop + element.clientHeight;\r\n }\r\n }\r\n\r\n });\r\n\r\n // Shiv: matchMedia\r\n //\r\n window.matchMedia = window.matchMedia || (function() {\r\n var warning = 'angular-sticky: This browser does not support '+\r\n 'matchMedia, therefore the minWidth option will not work on '+\r\n 'this browser. Polyfill matchMedia to fix this issue.';\r\n\r\n if ( window.console && console.warn ) {\r\n console.warn(warning);\r\n }\r\n\r\n return function() {\r\n return {\r\n matches: true\r\n };\r\n };\r\n }());\r\n\r\n}());\r\n","window.Object = window.Object || {};\r\nwindow.Object.values = window.Object.values || function(obj) {\r\n var res = [];\r\n for (var i in obj) {\r\n if (obj.hasOwnProperty(i)) {\r\n res.push(obj[i]);\r\n }\r\n }\r\n return res;\r\n};\r\n\r\nif (!Array.prototype.flat) {\r\n\tObject.defineProperty(Array.prototype, 'flat', {\r\n\t\tconfigurable: true,\r\n\t\tvalue: function flat () {\r\n\t\t\tvar depth = isNaN(arguments[0]) ? 1 : Number(arguments[0]);\r\n\r\n\t\t\treturn depth ? Array.prototype.reduce.call(this, function (acc, cur) {\r\n\t\t\t\tif (Array.isArray(cur)) {\r\n\t\t\t\t\tacc.push.apply(acc, flat.call(cur, depth - 1));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tacc.push(cur);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn acc;\r\n\t\t\t}, []) : Array.prototype.slice.call(this);\r\n\t\t},\r\n\t\twritable: true\r\n\t});\r\n}\r\n\r\nwindow.Number = window.Number || {}; \r\nNumber.isInteger = Number.isInteger || function(value) {\r\n return typeof value === 'number' && \r\n isFinite(value) && \r\n Math.floor(value) === value;\r\n };\r\n\r\n\r\nString.prototype.toObject = function(){\r\n return JSON.parse(this);\r\n}\r\n\r\nDate.prototype.roundToHour = function() {\r\n var p = 60 * 60 * 1000; // milliseconds in an hour\r\n return new Date(Math.round(this.getTime() / p ) * p);\r\n};\r\n\r\n\r\nDate.prototype.addDays = function(days){\r\n this.setDate(this.getDate() + days);\r\n return this;\r\n};\r\n\r\n\r\nDate.prototype.addHours = function(hours){\r\n this.setTime(this.getTime() + (hours*60*60*1000));\r\n return this;\r\n};\r\n\r\nDate.prototype.addMinutes = function(minutes){\r\n this.setTime(this.getTime() + (minutes*60*1000));\r\n return this;\r\n};\r\n\r\nDate.prototype.addSeconds = function(seconds){\r\n this.setTime(this.getTime() + seconds * 1000);\r\n return this;\r\n};\r\n\r\nDate.prototype.addMilliseconds = function(milliseconds){\r\n this.setTime(this.getTime() + milliseconds);\r\n return this;\r\n};\r\n\r\nDate.prototype.clone = function(){\r\n return new Date(this);\r\n};\r\n\r\nDate.prototype.removeTime = function(){\r\n return new Date(this.toDateString());\r\n}\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/programs-dropdown/programs-dropdown.modal.html',\n '
Program(s):{{$item.PopulationName}}{{population.PopulationName}}
');\n}]);\n}(window, document, window.angular));","class ServiceNowController {\r\n\r\n static $inject = [\r\n 'ServiceNowService',\r\n '$scope'\r\n ];\r\n\r\n ServiceNowService = null;\r\n $scope = null;\r\n\r\n uploadDrop = null;\r\n\r\n\r\n // these properties wrapp the ServiceNowService properties\r\n // just to make the HTML easier to read and shorter \r\n get display() { return this.ServiceNowService.display; }\r\n set display(value) { this.ServiceNowService.display = value; }\r\n\r\n get name() { return this.ServiceNowService.name; }\r\n set name(value) { this.ServiceNowService.name = value; }\r\n\r\n get email() { return this.ServiceNowService.email; }\r\n set email(value) { this.ServiceNowService.email = value; }\r\n\r\n get memberId() { return this.ServiceNowService.memberId; }\r\n set memberId(value) { this.ServiceNowService.memberId = value; }\r\n\r\n get kitId() { return this.ServiceNowService.kitId; }\r\n set kitId(value) { this.ServiceNowService.kitId = value; }\r\n\r\n get description() { return this.ServiceNowService.description; }\r\n set description(value) { this.ServiceNowService.description = value; }\r\n\r\n get mode() { return this.ServiceNowService.mode; }\r\n set mode(value) { this.ServiceNowService.mode = value; }\r\n\r\n get attachments() { return this.ServiceNowService.attachments; }\r\n set attachments(value) { this.ServiceNowService.attachments = value; }\r\n\r\n get submitting() { return this.ServiceNowService.submitting; }\r\n set submitting(value) { this.ServiceNowService.submitting = value; }\r\n\r\n get error() { return this.ServiceNowService.error; }\r\n set error(value) { this.ServiceNowService.error = value; }\r\n\r\n get minimized() { return this.ServiceNowService.minimized; }\r\n set minimized(value) { this.ServiceNowService.minimized = value; }\r\n\r\n get link() { return this.ServiceNowService.link; }\r\n set link(value) { this.ServiceNowService.link = value; }\r\n\r\n get caseNumber() { return this.ServiceNowService.caseNumber; }\r\n set caseNumber(value) { this.ServiceNowService.caseNumber = value; }\r\n\r\n get max_attachment_count() { return this.ServiceNowService.max_attachment_count; }\r\n\r\n get max_count_reached() { return this.ServiceNowService.max_count_reached; }\r\n set max_count_reached(value) { this.ServiceNowService.max_count_reached = value; }\r\n\r\n get fileInputAccept() { return this.ServiceNowService.fileInputAccept; }\r\n\r\n constructor() {\r\n ServiceNowController.$inject.forEach((prop, index) => this[prop] = arguments[index]);\r\n }\r\n\r\n toggle() {\r\n this.ServiceNowService.minimized = !this.ServiceNowService.minimized;\r\n }\r\n\r\n preventDefault($event){\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n }\r\n\r\n close($event) {\r\n this.preventDefault($event);\r\n this.$scope.serviceNow.$setPristine();\r\n this.$scope.serviceNow.$getControls().forEach(x => x.$setUntouched());\r\n this.ServiceNowService.close();\r\n }\r\n\r\n submit($event) {\r\n\r\n $event.preventDefault();\r\n this.$scope.serviceNow.$getControls().forEach(x => x.$setTouched());\r\n if (this.$scope.serviceNow.$invalid) {\r\n return;\r\n }\r\n this.ServiceNowService.submit();\r\n }\r\n\r\n handleFiles(files) {\r\n this.ServiceNowService.handleFiles(files);\r\n }\r\n\r\n removeAttachment($event, $index) {\r\n this.attachments.splice($index, 1);\r\n $event.preventDefault()\r\n $event.stopPropagation()\r\n }\r\n\r\n getIcon(file) {\r\n let extension = '';\r\n const fileName = file.file_name;\r\n try {\r\n extension = fileName.match(/\\.[0-9a-z]+$/i)[0];\r\n } catch (error) {\r\n\r\n }\r\n\r\n switch (extension) {\r\n case '.png':\r\n case '.gif':\r\n case '.jpg':\r\n case '.jpeg':\r\n case '.bmp':\r\n case '.svg':\r\n file.icon = 'fa-file-image-o';\r\n break;\r\n case '.doc':\r\n case '.docx':\r\n file.icon = 'fa-file-word-o text-primary';\r\n break;\r\n case '.xlsx':\r\n case '.xls':\r\n case '.csv':\r\n file.icon = 'fa-file-excel-o text-success';\r\n break;\r\n case '.pdf':\r\n file.icon = 'fa-file-pdf-o text-danger';\r\n break;\r\n default:\r\n file.icon = 'fa-file-o';\r\n break;\r\n }\r\n\r\n return file.icon;\r\n\r\n }\r\n\r\n\r\n}\r\nangular.module('vh.components').controller('ServiceNowController', ServiceNowController);\r\n","class ServiceNowDirective {\r\n\r\n restrict = 'E'\r\n templateUrl = 'components/service-now/service-now.tpl.html'\r\n replace = true\r\n controllerAs = 'vm'\r\n controller = 'ServiceNowController'\r\n scope = {\r\n\r\n }\r\n $scope = null;\r\n ServiceNowService = null;\r\n vhSweetAlert = null;\r\n uploadDrop = null;\r\n \r\n \r\n constructor(ServiceNowService, vhSweetAlert) {\r\n this.ServiceNowService = ServiceNowService;\r\n this.vhSweetAlert = vhSweetAlert;\r\n }\r\n\r\n link(scope, element, attrs) {\r\n this.$scope = scope;\r\n this.uploadDrop = document.getElementById('service-now-attachments');\r\n\r\n const handleDrop = (e) => {\r\n let dt = e.dataTransfer\r\n let files = dt.files\r\n handleFiles(files)\r\n }\r\n\r\n const highlight = (e) => {\r\n this.uploadDrop.classList.add('highlight')\r\n }\r\n\r\n const unhighlight = (e) => {\r\n this.uploadDrop.classList.remove('highlight')\r\n }\r\n\r\n const preventDefaults = (e) => {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n }\r\n\r\n const fileChangeHandler = (evt) => {\r\n var files = evt.target.files; // FileList object\r\n handleFiles(files);\r\n };\r\n\r\n var fileElement = document.getElementById('service-now-file-input');\r\n fileElement.removeEventListener('change', fileChangeHandler);\r\n fileElement.addEventListener('change', fileChangeHandler, false);\r\n const handleFiles = (files) => {\r\n ([...files])\r\n .filter(x => {\r\n return this.ServiceNowService.allowedFileTypes.find(y => x.name.toLowerCase().endsWith(y)) ;\r\n })\r\n .forEach((file) => {\r\n const file_name = file.name;\r\n var reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n reader.onload = () => {\r\n if (this.ServiceNowService.attachments.length < this.ServiceNowService.max_attachment_count) {\r\n\r\n let data = reader.result.toString().replace(/^data:(.*,)?/, '');\r\n if ((data.length % 4) > 0) {\r\n data += '='.repeat(4 - (data.length % 4));\r\n }\r\n\r\n const existing = this.ServiceNowService.attachments\r\n .find(x => x.file_name == file_name\r\n && x.file_content == data);\r\n \r\n if (!existing) {\r\n const newAttachment = {\r\n file_name: file_name,\r\n file_content: data,\r\n type: file.type\r\n };\r\n\r\n if(this.ServiceNowService.testSize(newAttachment)){\r\n this.ServiceNowService.attachments\r\n .push(newAttachment);\r\n } else {\r\n this.vhSweetAlert.error(`Unable to Add File ${newAttachment.file_name}`, `The combined attachments sizes are too large.`)\r\n }\r\n\r\n this.$scope.$apply();\r\n }\r\n if(this.ServiceNowService.attachments.length == this.ServiceNowService.max_attachment_count){\r\n this.ServiceNowService.max_count_reached = true;\r\n this.$scope.$apply();\r\n }\r\n }\r\n };\r\n reader.onerror = function (error) {\r\n console.log('Error: ', error);\r\n };\r\n });\r\n }\r\n\r\n this.$scope.handleFileChange = (event) => {\r\n const files = event.target.files;\r\n handleFiles(files);\r\n };\r\n\r\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {\r\n this.uploadDrop.addEventListener(eventName, preventDefaults, false)\r\n });\r\n\r\n ['dragenter', 'dragover'].forEach(eventName => {\r\n this.uploadDrop.addEventListener(eventName, highlight, false)\r\n });\r\n\r\n ['dragleave', 'drop'].forEach(eventName => {\r\n this.uploadDrop.addEventListener(eventName, unhighlight, false)\r\n });\r\n\r\n this.uploadDrop.addEventListener('drop', handleDrop, false)\r\n }\r\n\r\n static factory(ServiceNowService, vhSweetAlert) {\r\n return new ServiceNowDirective(ServiceNowService, vhSweetAlert);\r\n }\r\n}\r\nangular.module('vh.components').directive('serviceNow', ['ServiceNowService', 'vhSweetAlert', ServiceNowDirective.factory]);\r\n","\r\n\r\nclass ServiceNowRequest {\r\n name = null;\r\n email = null;\r\n kit_id = null;\r\n member_id = null;\r\n description = null;\r\n attachments = null;\r\n\r\n\r\n constructor(options) {\r\n const defaultOptions = {\r\n name: '',\r\n email: '',\r\n kit_id: '',\r\n member_id: '',\r\n description: '',\r\n attachments: []\r\n };\r\n\r\n Object.assign(this, defaultOptions, options ?? {});\r\n\r\n }\r\n\r\n}\r\n\r\nclass Attachment {\r\n file_name = '';\r\n file_content = '';\r\n}\r\n\r\nclass ServiceNowService {\r\n\r\n\r\n static $inject = [\r\n '$rootScope',\r\n '$stateParams',\r\n 'PatientHeaderService',\r\n 'AuthorizationService',\r\n 'ConfigurationsService',\r\n '$http'\r\n ];\r\n\r\n URL = '/api/servicenow';\r\n\r\n display = false;\r\n minimized = false;\r\n submitting = false;\r\n error = null;\r\n caseNumber = null;\r\n link = null;\r\n\r\n email = null;\r\n name = null;\r\n kitId = null;\r\n memberId = null;\r\n description = null;\r\n attachments = [];\r\n\r\n mode = 'patient';\r\n\r\n $rootScope = null;\r\n PatientHeaderService = null;\r\n AuthorizationService = null;\r\n ConfigurationsService = null;\r\n $http = null;\r\n\r\n max_attachment_count = 5;\r\n max_request_size = 102400;\r\n\r\n max_count_reached = false;\r\n\r\n allowedFileTypes = ['pdf', 'jpeg', 'jpg', 'png', 'xls', 'xlsx', 'doc', 'docx', 'csv'];\r\n \r\n get fileInputAccept() {\r\n return this.allowedFileTypes.map(x => (`.${x}`)).join(', ');\r\n }\r\n \r\n constructor() {\r\n ServiceNowService.$inject.forEach((prop, index) => this[prop] = arguments[index]);\r\n\r\n this.clear();\r\n this.load();\r\n\r\n this.$rootScope.$on('vh:patientSelected', (event, patientId, patient) => {\r\n patientId = this.$stateParams.patientId ?? patientId;\r\n patientId = patientId <= 0 ? null : patientId;\r\n this.kitId = null;\r\n this.memberId = patientId; \r\n this.mode = 'patient';\r\n this.load();\r\n });\r\n\r\n this.$rootScope.$on(\"vh:kitSelected\", async (event, kit) => {\r\n this.kitId = kit?.KitNo;\r\n this.memberId = kit?.PatientId; \r\n this.mode = kit ? 'kit' : 'patient';\r\n this.load();\r\n });\r\n }\r\n\r\n clear() {\r\n this.email = null;\r\n this.name = null;\r\n //this.kitId = null;\r\n //this.memberId = null;\r\n this.description = null;\r\n this.attachments = [];\r\n this.error = null;\r\n this.caseNumber = null;\r\n\r\n }\r\n\r\n async load() {\r\n const caregiver = this.AuthorizationService.getCaregiver();\r\n this.name = this.name ?? caregiver.DisplayName;\r\n this.email = this.email ?? caregiver.Email;\r\n\r\n const config = await this.ConfigurationsService.getConfig();\r\n this.link = `${config.ServiceNowUrl}/csm/?id=csm_my_lists&table=sn_customerservice_case&view=csp&sel=all`;\r\n\r\n }\r\n\r\n show() {\r\n if (!this.display)\r\n this.clear();\r\n\r\n this.load();\r\n this.display = true;\r\n }\r\n\r\n hide() {\r\n this.clear();\r\n this.display = false;\r\n }\r\n\r\n close() {\r\n this.clear();\r\n this.display = false;\r\n }\r\n\r\n testSize(newFile){\r\n\r\n function lengthInUtf8Bytes(str) {\r\n // Matches only the 10.. bytes that are non-initial characters in a multi-byte sequence.\r\n var m = encodeURIComponent(str).match(/%[89ABab]/g);\r\n return str.length + (m ? m.length : 0);\r\n }\r\n\r\n const newSize = lengthInUtf8Bytes(JSON.stringify(new ServiceNowRequest({\r\n name: this.name ?? '',\r\n email: this.email ?? '',\r\n kit_id: this.kitId ?? '',\r\n member_id: this.memberId ?? '',\r\n description: this.description ?? '',\r\n attachments: [...(this.attachments ?? []), newFile].map(x => ({ file_name: x.file_name, file_content: x.file_content }) )\r\n }))) / 1024;\r\n \r\n return newSize <= this.max_request_size;\r\n }\r\n\r\n async submit() {\r\n // validate \r\n \r\n this.submitting = true; \r\n this.error = null;\r\n \r\n const request = new ServiceNowRequest({\r\n name: this.name ?? '',\r\n email: this.email ?? '',\r\n kit_id: this.kitId ?? '',\r\n member_id: this.memberId ?? '',\r\n description: this.description ?? '',\r\n attachments: [...(this.attachments ?? [])].map(x => ({ file_name: x.file_name, file_content: x.file_content }) )\r\n });\r\n \r\n try {\r\n window.setTimeout(async ()=> {\r\n\r\n const errorMessage = 'An error occured submitting your request';\r\n const data = (await this.$http.post(this.URL, request))?.data;\r\n if(data.Success){\r\n this.caseNumber = data.Case_Number; \r\n this.error = null;\r\n } else {\r\n this.error = errorMessage;\r\n }\r\n this.submitting = false; \r\n }, 100); \r\n } catch (error) {\r\n error = errorMessage; \r\n } \r\n\r\n this.submitting = false;\r\n }\r\n\r\n\r\n}\r\nangular.module('vh.components').service('ServiceNowService', ServiceNowService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/service-now/service-now.tpl.html',\n '

Contact Us

');\n}]);\n}(window, document, window.angular));","function CookieService() {\r\n return {\r\n //This creates the storage.\r\n bake: function(name, value) {\r\n var cookie = [name, '=', angular.toJson(value), '; path=/;'].join('');\r\n document.cookie = cookie;\r\n },\r\n\r\n //This reads the storage.\r\n taste: function(name) {\r\n var result = document.cookie.match(new RegExp(name + '=([^;]+)'));\r\n result && (result = angular.fromJson(result[1]));\r\n return result;\r\n },\r\n\r\n rawTaste: function(name) {\r\n var result = document.cookie.match(new RegExp(name + '=([^;]+)'));\r\n result && (result = result[1]);\r\n return result;\r\n },\r\n\r\n //This delete the storage.\r\n crumble: function(name) {\r\n document.cookie = [name, '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/;'].join('');\r\n }\r\n }\r\n}\r\n\r\nangular.module('storage').factory('CookieService', CookieService);\r\n","function LocalStorageService($window) {\r\n function store(key, obj) {\r\n if ($window.localStorage) {\r\n var json = JSON.stringify(obj);\r\n $window.localStorage.setItem(key, json);\r\n }\r\n }\r\n\r\n function get(key) {\r\n var str = $window.localStorage && $window.localStorage.getItem(key);\r\n return str && JSON.parse(str);\r\n }\r\n\r\n function remove(key) {\r\n if ($window.localStorage) {\r\n $window.localStorage.removeItem(key);\r\n }\r\n }\r\n\r\n return {\r\n store: store,\r\n get: get,\r\n remove: remove\r\n }\r\n}\r\n\r\nangular.module('storage').factory('LocalStorageService', LocalStorageService);\r\n","function TimeLogSessionAutoService($q, $interval, TimeLogSessionService) {\r\n var patientTimeLogTimeout;\r\n var patientTimeLogWarningTimeout;\r\n\r\n var timeLogInactivityTimer;\r\n var inactivityStartTime;\r\n\r\n var isWarningCalled = false;\r\n var isIdleCalled = false;\r\n\r\n function Initialize() {\r\n return TimeLogSessionService.getTimeLogConfiguration()\r\n .then(function (model) {\r\n patientTimeLogTimeout = +model.Timeout;\r\n patientTimeLogWarningTimeout = +model.Warning;\r\n });\r\n }\r\n\r\n function Restart() {\r\n if (timeLogInactivityTimer) {\r\n $interval.cancel(timeLogInactivityTimer);\r\n }\r\n\r\n inactivityStartTime = new Date();\r\n\r\n isWarningCalled = false;\r\n isIdleCalled = false;\r\n\r\n var idleDefer = $q.defer();\r\n\r\n update(idleDefer);\r\n timeLogInactivityTimer = $interval(function () {\r\n update(idleDefer);\r\n }, 1000);\r\n\r\n timeLogInactivityTimer\r\n .then(function () {\r\n idleDefer.resolve(false);\r\n });\r\n\r\n return idleDefer.promise;\r\n }\r\n\r\n function update(idleDefer) {\r\n var currentTime = new Date();\r\n var timeDiff = getTimeDifference(currentTime, inactivityStartTime);\r\n\r\n var warningDuration = patientTimeLogTimeout - patientTimeLogWarningTimeout;\r\n\r\n if (timeDiff.milliseconds > patientTimeLogTimeout) {\r\n Stop();\r\n idleDefer.resolve(true);\r\n }\r\n else if (timeDiff.milliseconds > patientTimeLogWarningTimeout && isIdleCalled === false) {\r\n var remainingDuration = warningDuration - (timeDiff.milliseconds - patientTimeLogWarningTimeout);\r\n var remainingSeconds = Math.round(remainingDuration / 1000);\r\n idleDefer.notify(remainingSeconds);\r\n }\r\n }\r\n\r\n function Stop() {\r\n if (timeLogInactivityTimer) {\r\n $interval.cancel(timeLogInactivityTimer);\r\n }\r\n }\r\n\r\n function getTimeDifference(dateTime1, dateTime2) {\r\n var milliseconds = Date.parse(dateTime1) - Date.parse(dateTime2);\r\n\r\n var totalSeconds = Math.floor(milliseconds / 1000);\r\n\r\n var seconds = totalSeconds % 60;\r\n\r\n return {\r\n milliseconds: milliseconds,\r\n seconds: seconds,\r\n };\r\n }\r\n\r\n return {\r\n initialize: Initialize,\r\n restart: Restart,\r\n stop: Stop,\r\n isPaused: isIdleCalled,\r\n }\r\n}\r\n\r\nangular.module(\"time-log-session\").factory(\"TimeLogSessionAutoService\", TimeLogSessionAutoService);\r\n","function timeLogSessionDirective() {\r\n\r\n function controller($scope, TimeLogFactory) {\r\n\r\n $scope.timeLogParameters = TimeLogFactory.parameters;\r\n\r\n $scope.toggleClock = function() {\r\n TimeLogFactory.toggle();\r\n };\r\n\r\n $scope.selectCareManagementType = function(careManagementType) {\r\n TimeLogFactory.setCareManagementType(careManagementType);\r\n }\r\n \r\n $scope.session = $scope.timeLogParameters.clock.session;\r\n $scope.clinical = $scope.timeLogParameters.clock.clinical;\r\n $scope.cumulative = $scope.timeLogParameters.clock.cumulative;\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'components/time-log-session/time-log-session.tpl.html'\r\n };\r\n}\r\nangular.module(\"time-log-session\").directive('timeLogSession', timeLogSessionDirective);\r\n","function TimeLogFactory($rootScope, $transitions, $stateParams, $window, vhSweetAlert, TimeLogSessionService, TimeLogSessionTimerService, TimeLogSessionAutoService, TimeLogSessionVideoService) {\r\n\r\n var parameters = {\r\n isActive: false,\r\n isPausing: false,\r\n isPaused: false,\r\n showTimeLog: false,\r\n isInVideoCall: false,\r\n patientId: 0,\r\n careManagementTypes: [],\r\n clock: {}\r\n };\r\n\r\n var isToggled = false;\r\n var lastManuallyPausedId = 0;\r\n\r\n var isIdle = false;\r\n var isIdlePromptOpen = false;\r\n\r\n function register() {\r\n registerRootScope();\r\n registerEvents();\r\n }\r\n\r\n function registerRootScope() {\r\n\r\n $transitions.onSuccess({}, (trans)=>{\r\n var toParams = trans.params();\r\n\r\n var invalidParams = [\r\n toParams.monthOffset,\r\n toParams.print\r\n ];\r\n\r\n var requiredParams = [\r\n toParams.patientId\r\n ];\r\n\r\n if (!hasValidParams(requiredParams)) {\r\n stopService(true);\r\n\r\n return;\r\n }\r\n\r\n if (hasInvalidParams(invalidParams)) {\r\n stopService(true);\r\n\r\n return;\r\n }\r\n\r\n var newPatient = isNewPatient(toParams.patientId);\r\n if (newPatient) {\r\n lastManuallyPausedId = 0;\r\n }\r\n\r\n if (parameters.isActive && !parameters.isInVideoCall) {\r\n TimeLogSessionTimerService.save();\r\n }\r\n\r\n TimeLogSessionTimerService.setAction(trans.$to());\r\n\r\n if (!parameters.isActive || newPatient) {\r\n startService();\r\n }\r\n });\r\n\r\n $rootScope.$on(\"vh:patientUpdated\", function (event, patientId) {\r\n TimeLogSessionTimerService.refreshCareManagementTypes().then(function(response) {\r\n parameters.careManagementTypes = response;\r\n if (response.length === 1) {\r\n parameters.currentCareManagementType = response[0];\r\n }\r\n });\r\n });\r\n }\r\n\r\n function registerEvents() {\r\n registerIdleEvents(['mousemove', 'keypress']);\r\n registerVideoEvents(['focus']);\r\n registerUnloadEvent();\r\n }\r\n\r\n function registerIdleEvents(eventNames) {\r\n eventNames.forEach(function (eventName) {\r\n $window.addEventListener(eventName, function () {\r\n startAutoService();\r\n });\r\n });\r\n }\r\n\r\n function registerVideoEvents(eventNames) {\r\n eventNames.forEach(function (eventName) {\r\n $window.addEventListener(eventName, function () {\r\n var timeLogSession = TimeLogSessionTimerService.getTimeLogSession();\r\n if (timeLogSession && parameters.isActive && !isIdle && parameters.isInVideoCall) {\r\n checkVideoCall(timeLogSession);\r\n }\r\n });\r\n });\r\n }\r\n\r\n function registerUnloadEvent() {\r\n $window.addEventListener('beforeunload', function(event) {\r\n if(!parameters.isActive) {\r\n return;\r\n }\r\n\r\n if(typeof event == 'undefined') {\r\n event = window.event;\r\n }\r\n\r\n if(parameters.isActive === undefined) {\r\n event.returnValue = '';\r\n }\r\n else {\r\n TimeLogSessionAutoService.stop();\r\n TimeLogSessionTimerService.stop();\r\n }\r\n });\r\n }\r\n\r\n function hasValidParams(requiredParams) {\r\n var hasRequiredParams = true;\r\n requiredParams.forEach(function (param) {\r\n if (!param) {\r\n hasRequiredParams = false;\r\n }\r\n });\r\n\r\n return hasRequiredParams;\r\n }\r\n\r\n function hasInvalidParams(invalidParams) {\r\n var hasInvalidParams = false;\r\n invalidParams.forEach(function (param) {\r\n if (param) {\r\n hasInvalidParams = true;\r\n }\r\n });\r\n\r\n return hasInvalidParams;\r\n }\r\n\r\n function isNewPatient(patientId) {\r\n var timeLogSession = TimeLogSessionService.getTimeLogSession();\r\n\r\n if (timeLogSession && timeLogSession.patientId) {\r\n return timeLogSession.patientId != patientId;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n function startService() {\r\n var currentSession;\r\n\r\n parameters.patientId = $stateParams.patientId;\r\n\r\n TimeLogSessionTimerService.initialize($stateParams.patientId).then(function (initValues) {\r\n setClocks(initValues.logTimes);\r\n\r\n parameters.careManagementTypes = initValues.careManagementTypes;\r\n parameters.currentCareManagementType = initValues.timeLogSession.currentCareManagementType;\r\n\r\n currentSession = initValues.timeLogSession;\r\n TimeLogSessionService.saveTimeLogSession(currentSession);\r\n\r\n return TimeLogSessionAutoService.initialize();\r\n }).then(function () {\r\n return TimeLogSessionService.getTimeLogEnabled();\r\n }).then(function (isEnabled) {\r\n parameters.showTimeLog = isEnabled;\r\n\r\n checkVideoCall(currentSession);\r\n });\r\n }\r\n\r\n function startTimerService() {\r\n TimeLogSessionTimerService.start()\r\n .then(null, null, function (logTimes) {\r\n setClocks(logTimes);\r\n });\r\n }\r\n\r\n function toggle() {\r\n if(parameters.isInVideoCall) {\r\n return;\r\n }\r\n\r\n if(parameters.isPaused) {\r\n resumeTimerService(TimeLogSessionTimerService.timerTypes.manualStart);\r\n parameters.isPaused = false;\r\n isToggled = false;\r\n lastManuallyPausedId = 0;\r\n } else {\r\n TimeLogSessionTimerService.pause(TimeLogSessionTimerService.timerTypes.manualStop)\r\n .then(function () {\r\n TimeLogSessionAutoService.stop();\r\n parameters.isPaused = true;\r\n parameters.isPausing = false;\r\n isToggled = true;\r\n lastManuallyPausedId = parameters.patientId;\r\n });\r\n }\r\n }\r\n\r\n function resumeTimerService(timerType) {\r\n TimeLogSessionTimerService.resume(timerType)\r\n .then(null, null, function (logTimes) {\r\n setClocks(logTimes);\r\n });\r\n }\r\n\r\n function stopService(disable) {\r\n TimeLogSessionAutoService.stop();\r\n\r\n if (parameters.isActive === true) {\r\n TimeLogSessionTimerService.stop();\r\n }\r\n else {\r\n TimeLogSessionTimerService.cancel();\r\n }\r\n\r\n parameters.isActive = !disable;\r\n parameters.isPausing = false;\r\n }\r\n\r\n function startAutoService() {\r\n\r\n if (isIdlePromptOpen && $window.swal) {\r\n $window.swal.close();\r\n isIdlePromptOpen = false;\r\n }\r\n\r\n if (isToggled || !parameters.isActive || $rootScope.isAuthorized === false) {\r\n return;\r\n }\r\n\r\n if (parameters.isPaused) {\r\n resumeTimerService(TimeLogSessionTimerService.timerTypes.auto);\r\n parameters.isPaused = false;\r\n }\r\n\r\n isIdle = false;\r\n parameters.isPausing = false;\r\n\r\n var warningInitialized = false;\r\n TimeLogSessionAutoService.restart(parameters.isPaused)\r\n .then(function (isAutoPaused) {\r\n if (isAutoPaused) {\r\n TimeLogSessionTimerService.pause(TimeLogSessionTimerService.timerTypes.auto)\r\n .then(function () {\r\n if (isIdlePromptOpen && $window.swal) {\r\n $window.swal.close();\r\n isIdlePromptOpen = false;\r\n }\r\n\r\n isIdle = true;\r\n parameters.isPaused = true;\r\n parameters.isPausing = false;\r\n });\r\n }\r\n },\r\n function (reason) {\r\n // error\r\n },\r\n function (remainingSeconds) {\r\n if (warningInitialized) {\r\n updateIdleWarning(remainingSeconds);\r\n }\r\n else {\r\n initializeIdleWarning(remainingSeconds);\r\n warningInitialized = true;\r\n }\r\n }\r\n );\r\n }\r\n\r\n function initializeIdleWarning(remainingSeconds) {\r\n isIdlePromptOpen = true;\r\n // if (parameters.showTimeLog) {\r\n // vhSweetAlert({\r\n // title: 'Patient Session Timeout',\r\n // text: '

The timer will pause in ' + remainingSeconds + ' second(s).

Any action will resume the timer.

',\r\n // html: true,\r\n // type: 'warning',\r\n // showCancelButton: false,\r\n // showConfirmButton: false,\r\n // });\r\n // }\r\n }\r\n\r\n function updateIdleWarning(remainingSeconds) {\r\n var element = angular.element($window.document.querySelector('#timeLogIdleWarningSeconds'));\r\n element.text(remainingSeconds);\r\n parameters.isPausing = true;\r\n }\r\n\r\n function checkVideoCall(timeLogSession) {\r\n TimeLogSessionVideoService.videoCallEnded(timeLogSession)\r\n .then(function (isCallEnded) {\r\n parameters.isActive = true;\r\n parameters.isPausing = false;\r\n\r\n if (isCallEnded === false) {\r\n parameters.isInVideoCall = true;\r\n\r\n setClocks('');\r\n\r\n parameters.isPaused = true;\r\n parameters.isPausing = false;\r\n isToggled = true;\r\n return;\r\n }\r\n\r\n var timeLogSession = TimeLogSessionTimerService.getTimeLogSession();\r\n parameters.isInVideoCall = false;\r\n\r\n if (isCallEnded && (!timeLogSession.isPaused || timeLogSession.patientId !== parameters.patientId)) {\r\n startTimerService();\r\n startAutoService();\r\n\r\n parameters.isPaused = false;\r\n isToggled = false;\r\n }\r\n else if (timeLogSession.isPaused) {\r\n parameters.isInVideoCall = false;\r\n parameters.isPaused = true;\r\n parameters.isPausing = false;\r\n isToggled = true;\r\n }\r\n });\r\n }\r\n\r\n function setClocks(logTimes) {\r\n parameters.clock.session = getClock(logTimes.session);\r\n parameters.clock.clinical = getClock(logTimes.clinical);\r\n parameters.clock.cumulative = getClock(logTimes.cumulative);\r\n }\r\n\r\n function getClock(timeDifference) {\r\n var hours, minutes, seconds;\r\n\r\n if(parameters.isInVideoCall) {\r\n hours = '--';\r\n minutes = '--';\r\n seconds = '--';\r\n }\r\n else {\r\n hours = timeDifference.hours;\r\n if (hours < 100) {\r\n hours = ('0' + timeDifference.hours).slice(-2);\r\n }\r\n\r\n minutes = timeDifference.hours;\r\n if (minutes < 100) {\r\n minutes = ('0' + timeDifference.minutes).slice(-2);\r\n }\r\n\r\n seconds = ('0' + timeDifference.seconds).slice(-2);\r\n }\r\n\r\n return {\r\n hours: hours,\r\n minutes: minutes,\r\n seconds: seconds\r\n };\r\n }\r\n\r\n function startVideoCall() {\r\n stopService(false);\r\n\r\n parameters.isInVideoCall = true;\r\n\r\n setClocks('');\r\n\r\n parameters.isPaused = true;\r\n parameters.isPausing = false;\r\n isToggled = true;\r\n }\r\n\r\n function setCareManagementType(careManagementType) {\r\n var timeLogSession = TimeLogSessionTimerService.getTimeLogSession();\r\n timeLogSession.currentCareManagementType = careManagementType;\r\n \r\n parameters.currentCareManagementType = careManagementType;\r\n }\r\n\r\n return {\r\n parameters,\r\n register,\r\n toggle,\r\n setCareManagementType,\r\n startVideoCall\r\n };\r\n}\r\n\r\nangular.module(\"time-log-session\").factory('TimeLogFactory', TimeLogFactory);\r\n","function TimeLogSessionService($http, LocalStorageService, repository) {\r\n var timeLogRepo = repository.new(\"Timelog\");\r\n var enableTimeLog\r\n\r\n function GetNewTimeLog(action) {\r\n return {\r\n SessionIdent: GenerateUUID(),\r\n PatientId: 0,\r\n Action: action,\r\n StartTime_UTC: new Date(),\r\n StartTimeLogTypeId: 1,\r\n StopTime_UTC: new Date(),\r\n StopTimeLogTypeId: 2,\r\n CareManagementTypeId: null\r\n };\r\n }\r\n\r\n function GetTimeLogSession() {\r\n return LocalStorageService.get('timeLogSession');\r\n }\r\n\r\n function SaveTimeLogSession(timeLogSession) {\r\n LocalStorageService.store('timeLogSession', timeLogSession);\r\n }\r\n\r\n function AddTimeLog(timeLog) {\r\n return timeLogRepo.create(timeLog).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetPatientTimeLogSummary(patientId, sessionIdent) {\r\n return $http.get('/api/Patient/' + patientId + '/TimeLogSummary', {params: {sessionIdent}}).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetIsMostRecentCallEnded(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/videocall').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetTimeLogConfiguration() {\r\n return $http.get('/api/Timelog/configuration').then(\r\n function (response) {\r\n enableTimeLog = response.data.TimeLogEnabled;\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetTimeLogEnabled () {\r\n return enableTimeLog;\r\n }\r\n\r\n function GenerateUUID() {\r\n var d = new Date().getTime();\r\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = (d + Math.random() * 16) % 16 | 0;\r\n d = Math.floor(d / 16);\r\n return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\r\n });\r\n return uuid;\r\n }\r\n\r\n return {\r\n getNewTimeLog: GetNewTimeLog,\r\n getTimeLogSession: GetTimeLogSession,\r\n saveTimeLogSession: SaveTimeLogSession,\r\n addTimeLog: AddTimeLog,\r\n getPatientTimeLogSummary: GetPatientTimeLogSummary,\r\n getIsMostRecentCallEnded: GetIsMostRecentCallEnded,\r\n getTimeLogConfiguration: GetTimeLogConfiguration,\r\n getTimeLogEnabled: GetTimeLogEnabled\r\n };\r\n}\r\n\r\nangular.module(\"time-log-session\").service(\"TimeLogSessionService\", TimeLogSessionService);\r\n","function TimeLogSessionTimerService($q, $interval, TimeLogSessionService, AuthorizationService) {\r\n var initDateTime = new Date();\r\n var pauseDateTime;\r\n var isPaused = false;\r\n\r\n var sessionOffset = 0;\r\n var cumulativeOffset = 0;\r\n var clinicalOffset = 0;\r\n\r\n var duration = 0;\r\n var clock;\r\n\r\n var timeLog;\r\n var timeLogSession;\r\n var action;\r\n\r\n var initialCumulative;\r\n var initialClinical;\r\n var caregiverShownInTimeLog = false;\r\n\r\n function Initialize(patientId) {\r\n if (clock) {\r\n $interval.cancel(clock);\r\n }\r\n\r\n caregiverShownInTimeLog = AuthorizationService.getCaregiver().IsShownInTimeLog;\r\n updateTimeLogModels(patientId);\r\n\r\n return TimeLogSessionService.getPatientTimeLogSummary(patientId, timeLogSession.sessionIdent).then(function (timeLogSummary) {\r\n cumulativeOffset = timeLogSummary.TotalSeconds;\r\n sessionOffset = timeLogSummary.SessionSeconds;\r\n clinicalOffset = timeLogSummary.ClinicalSeconds;\r\n\r\n initDateTime = new Date();\r\n pauseDateTime = angular.copy(initDateTime);\r\n isPaused = timeLogSession.isPaused;\r\n\r\n initialCumulative = getTimeDifference(pauseDateTime, initDateTime, cumulativeOffset);\r\n initialClinical = getTimeDifference(pauseDateTime, initDateTime, clinicalOffset);\r\n\r\n let careManagementTypes = [];\r\n if (timeLogSession.isClinicalUser) {\r\n careManagementTypes = timeLogSummary.CareManagementTypes.filter(cmt => cmt.IsClinicalTimeMeasured);\r\n\r\n if (careManagementTypes.length === 1) {\r\n timeLogSession.currentCareManagementType = careManagementTypes[0];\r\n } else if (timeLogSummary.LastUsedCareManagementTypeId) {\r\n timeLogSession.currentCareManagementType = timeLogSummary.CareManagementTypes\r\n .find(cmt => cmt.Id === timeLogSummary.LastUsedCareManagementTypeId && cmt.IsClinicalTimeMeasured);\r\n }\r\n }\r\n\r\n return {\r\n timeLogSession,\r\n careManagementTypes,\r\n logTimes: {\r\n session: getTimeDifference(pauseDateTime, initDateTime, sessionOffset),\r\n cumulative: initialCumulative,\r\n clinical: initialClinical\r\n }\r\n };\r\n });\r\n }\r\n\r\n function Start() {\r\n if (clock) {\r\n $interval.cancel(clock);\r\n }\r\n\r\n var timeLogTimerPromise = $q.defer();\r\n\r\n update(timeLogTimerPromise);\r\n clock = $interval(function () {\r\n update(timeLogTimerPromise);\r\n }, 1000);\r\n\r\n clock.then(function () {\r\n timeLogTimerPromise.resolve(true);\r\n });\r\n\r\n return timeLogTimerPromise.promise;\r\n }\r\n\r\n function update(timeLogTimerPromise) {\r\n var currentDateTime = new Date();\r\n\r\n var cumulativeTime;\r\n var clinicalTime;\r\n if (caregiverShownInTimeLog) {\r\n cumulativeTime = getTimeDifference(currentDateTime, initDateTime, cumulativeOffset);\r\n clinicalTime = !timeLogSession.isClinicalUser ? initialClinical : getTimeDifference(currentDateTime, initDateTime, clinicalOffset);\r\n }\r\n else {\r\n cumulativeTime = initialCumulative;\r\n clinicalTime = initialClinical;\r\n }\r\n var logTimes = {\r\n session: getTimeDifference(currentDateTime, initDateTime, sessionOffset),\r\n cumulative: cumulativeTime,\r\n clinical: clinicalTime\r\n };\r\n\r\n timeLogTimerPromise.notify(logTimes);\r\n }\r\n\r\n function Pause(stopTypeId) {\r\n if (clock) {\r\n $interval.cancel(clock);\r\n }\r\n\r\n return $q(function (resolve) {\r\n timeLog.StopTimeLogTypeId = stopTypeId;\r\n\r\n timeLogSession.isPaused = stopTypeId !== TimerTypes.auto;\r\n\r\n commit();\r\n\r\n pauseDateTime = new Date();\r\n\r\n isPaused = true;\r\n\r\n resolve();\r\n });\r\n }\r\n\r\n function Resume(startTypeId) {\r\n if (clock) {\r\n $interval.cancel(clock);\r\n }\r\n\r\n var timeLogTimerPromise = $q.defer();\r\n\r\n updateTimeLogModels(timeLogSession.patientId);\r\n\r\n if (isPaused) {\r\n var resumeDateTime = new Date();\r\n var pauseTime = resumeDateTime - pauseDateTime;\r\n var resumeTime = initDateTime.getTime() + pauseTime;\r\n initDateTime = new Date(resumeTime);\r\n timeLog.StartTimeLogTypeId = startTypeId;\r\n }\r\n\r\n update(timeLogTimerPromise);\r\n clock = $interval(function () {\r\n update(timeLogTimerPromise);\r\n }, 1000);\r\n\r\n clock.then(function () {\r\n timeLogTimerPromise.resolve();\r\n });\r\n\r\n isPaused = false;\r\n timeLogSession.isPaused = false;\r\n\r\n return timeLogTimerPromise.promise;\r\n }\r\n\r\n function Stop() {\r\n if (clock) {\r\n $interval.cancel(clock);\r\n }\r\n\r\n return commit();\r\n }\r\n\r\n function Cancel() {\r\n if (clock) {\r\n $interval.cancel(clock);\r\n }\r\n\r\n }\r\n\r\n function updateTimeLogModels(patientId) {\r\n timeLog = TimeLogSessionService.getNewTimeLog(action);\r\n timeLog.PatientId = patientId;\r\n\r\n timeLogSession = TimeLogSessionService.getTimeLogSession();\r\n if (!timeLogSession) {\r\n const caregiver = AuthorizationService.getCaregiver();\r\n timeLogSession = {\r\n patientId: patientId,\r\n sessionIdent: timeLog.SessionIdent,\r\n isPaused: false,\r\n isInVideoCall: false,\r\n currentCareManagementType: null,\r\n isClinicalUser: caregiver.IsClinical\r\n };\r\n }\r\n else if (timeLogSession.patientId === patientId) {\r\n timeLog.SessionIdent = timeLogSession.sessionIdent;\r\n timeLog.CareManagementTypeId = timeLogSession.currentCareManagementType && timeLogSession.currentCareManagementType.Id;\r\n }\r\n else {\r\n timeLogSession.patientId = patientId;\r\n timeLogSession.sessionIdent = timeLog.SessionIdent;\r\n timeLogSession.isPaused = false;\r\n timeLogSession.currentCareManagementType = null;\r\n }\r\n }\r\n\r\n function SetAction(state) {\r\n var retVal = '';\r\n\r\n if (state.data.timeLogAction) {\r\n retVal = state.data.timeLogAction;\r\n }\r\n else {\r\n retVal = (state.name).substring((state.name).lastIndexOf(\".\") + 1);\r\n }\r\n\r\n action = retVal;\r\n }\r\n\r\n /// Returns promise with updated list of patient care management types\r\n function RefreshCareManagementTypes() {\r\n if (!(timeLogSession && timeLogSession.isClinicalUser)) {\r\n return $q.resolve([]);\r\n }\r\n\r\n return TimeLogSessionService.getPatientTimeLogSummary(timeLogSession.patientId, timeLogSession.sessionIdent).then(function (timeLogSummary) {\r\n let careManagementTypes = timeLogSummary.CareManagementTypes.filter(cmt => cmt.IsClinicalTimeMeasured);\r\n\r\n if (careManagementTypes.length === 1) {\r\n timeLogSession.currentCareManagementType = careManagementTypes[0];\r\n }\r\n\r\n return careManagementTypes;\r\n });\r\n }\r\n\r\n /// Returns promise\r\n function Save() {\r\n commit().then(function () {\r\n updateTimeLogModels(timeLogSession.patientId);\r\n });\r\n }\r\n\r\n /// Returns promise with latest time log entry\r\n function commit() {\r\n if (timeLog && isPaused === false) {\r\n timeLog.StopTime_UTC = new Date();\r\n timeLog.CareManagementTypeId = timeLogSession.currentCareManagementType && timeLogSession.currentCareManagementType.Id;\r\n TimeLogSessionService.saveTimeLogSession(timeLogSession);\r\n return TimeLogSessionService.addTimeLog(timeLog);\r\n }\r\n else {\r\n return $q(function (resolve) {\r\n resolve();\r\n });\r\n }\r\n }\r\n\r\n function getTimeDifference(dateTime1, dateTime2, offset) {\r\n var milliseconds = Date.parse(dateTime1) - Date.parse(dateTime2);\r\n\r\n duration = milliseconds;\r\n\r\n milliseconds = +milliseconds + offset;\r\n\r\n var totalSeconds = Math.floor(milliseconds / 1000);\r\n\r\n var seconds = totalSeconds % 60;\r\n var minutes = Math.floor(totalSeconds / 60 % 60);\r\n var hours = Math.floor(totalSeconds / 60 / 60);\r\n\r\n return {\r\n milliseconds: milliseconds,\r\n hours: hours,\r\n minutes: minutes,\r\n seconds: seconds,\r\n };\r\n }\r\n\r\n var TimerTypes = {\r\n pageLoad: 1,\r\n pageClose: 2,\r\n manualStart: 3,\r\n manualStop: 4,\r\n auto: 5\r\n };\r\n\r\n return {\r\n initialize: Initialize,\r\n start: Start,\r\n pause: Pause,\r\n resume: Resume,\r\n stop: Stop,\r\n save: Save,\r\n cancel: Cancel,\r\n setAction: SetAction,\r\n refreshCareManagementTypes: RefreshCareManagementTypes,\r\n getTimeLogSession: function () {\r\n return timeLogSession\r\n },\r\n timerTypes: TimerTypes\r\n };\r\n}\r\n\r\nangular.module(\"time-log-session\").factory(\"TimeLogSessionTimerService\", TimeLogSessionTimerService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/time-log-session/time-log-session.tpl.html',\n '
{{timeLogParameters.currentCareManagementType.Acronym}}
{{timeLogParameters.clock.session.hours}}
{{timeLogParameters.clock.session.minutes}}
{{timeLogParameters.clock.session.seconds}}
Stop Start
');\n}]);\n}(window, document, window.angular));","function TimeLogSessionVideoService($q, $interval, TimeLogSessionService) {\r\n\r\n var count = 0;\r\n var max = 3;\r\n var callEnded = false;\r\n\r\n var checkInterval;\r\n\r\n function VideoCallEnded(timeLogSession) {\r\n count = 0;\r\n callEnded = false;\r\n\r\n var videoCallPromise = $q.defer();\r\n\r\n var duration = 2000;\r\n\r\n checkVideoCall(timeLogSession, videoCallPromise);\r\n checkInterval = $interval(function () {\r\n checkVideoCall(timeLogSession, videoCallPromise);\r\n }, duration);\r\n\r\n return videoCallPromise.promise;\r\n }\r\n\r\n function checkVideoCall(timeLogSession, videoCallPromise) {\r\n if (++count >= max) {\r\n $interval.cancel(checkInterval);\r\n videoCallPromise.resolve(false);\r\n return;\r\n }\r\n\r\n if (callEnded === true) {\r\n $interval.cancel(checkInterval);\r\n videoCallPromise.resolve(true);\r\n return;\r\n }\r\n\r\n TimeLogSessionService.getIsMostRecentCallEnded(timeLogSession.patientId).then(function (data) {\r\n if (data === true && callEnded === false) {\r\n callEnded = true;\r\n timeLogSession.isInVideoCall = false;\r\n $interval.cancel(checkInterval);\r\n videoCallPromise.resolve(true);\r\n }\r\n });\r\n }\r\n\r\n return {\r\n videoCallEnded: VideoCallEnded\r\n }\r\n}\r\n\r\nangular.module(\"time-log-session\").factory(\"TimeLogSessionVideoService\", TimeLogSessionVideoService);\r\n","function UiSelectFocus($parse, $timeout) {\r\n return {\r\n restrict: 'A',\r\n require: '^uiSelect',\r\n link: function (scope, elem, attrs, uiSelect) {\r\n var focus = $parse(attrs.uiSelectFocus);\r\n \r\n function setFocus() {\r\n $timeout(function () {\r\n uiSelect.activate();\r\n if(angular.isFunction(focus)) {\r\n focus.assign(scope, false);\r\n }\r\n }, 100);\r\n }\r\n \r\n scope.$watch(focus, function (value) {\r\n if (value === true) {\r\n setFocus();\r\n }\r\n });\r\n\r\n scope.$on(attrs.uiSelectOn, setFocus);\r\n }\r\n };\r\n}\r\nangular.module('ui-select-extensions').directive('uiSelectFocus', UiSelectFocus);\r\n","/**\r\n * @license Angular UI Tree v2.22.6\r\n * (c) 2010-2017. https://github.com/angular-ui-tree/angular-ui-tree\r\n * License: MIT\r\n */\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree', [])\r\n .constant('treeConfig', {\r\n treeClass: 'angular-ui-tree',\r\n emptyTreeClass: 'angular-ui-tree-empty',\r\n dropzoneClass: 'angular-ui-tree-dropzone',\r\n hiddenClass: 'angular-ui-tree-hidden',\r\n nodesClass: 'angular-ui-tree-nodes',\r\n nodeClass: 'angular-ui-tree-node',\r\n handleClass: 'angular-ui-tree-handle',\r\n placeholderClass: 'angular-ui-tree-placeholder',\r\n dragClass: 'angular-ui-tree-drag',\r\n dragThreshold: 3,\r\n defaultCollapsed: true,\r\n appendChildOnHover: true\r\n });\r\n\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n\r\n .controller('TreeHandleController', ['$scope', '$element',\r\n function ($scope, $element) {\r\n this.scope = $scope;\r\n\r\n $scope.$element = $element;\r\n $scope.$nodeScope = null;\r\n $scope.$type = 'uiTreeHandle';\r\n\r\n }\r\n ]);\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n .controller('TreeNodeController', ['$scope', '$element',\r\n function ($scope, $element) {\r\n this.scope = $scope;\r\n\r\n $scope.$element = $element;\r\n $scope.$modelValue = null; // Model value for node;\r\n $scope.$parentNodeScope = null; // uiTreeNode Scope of parent node;\r\n $scope.$childNodesScope = null; // uiTreeNodes Scope of child nodes.\r\n $scope.$parentNodesScope = null; // uiTreeNodes Scope of parent nodes.\r\n $scope.$treeScope = null; // uiTree scope\r\n $scope.$handleScope = null; // it's handle scope\r\n $scope.$type = 'uiTreeNode';\r\n $scope.$$allowNodeDrop = false;\r\n $scope.collapsed = false;\r\n $scope.expandOnHover = false;\r\n\r\n //Called by uiTreeNode Directive on load.\r\n $scope.init = function (controllersArr) {\r\n var treeNodesCtrl = controllersArr[0];\r\n $scope.$treeScope = controllersArr[1] ? controllersArr[1].scope : null;\r\n\r\n //Find the scope of it's parent node.\r\n $scope.$parentNodeScope = treeNodesCtrl.scope.$nodeScope;\r\n\r\n //modelValue for current node.\r\n $scope.$modelValue = treeNodesCtrl.scope.$modelValue[$scope.$index];\r\n $scope.$parentNodesScope = treeNodesCtrl.scope;\r\n\r\n //Init sub nodes.\r\n treeNodesCtrl.scope.initSubNode($scope);\r\n\r\n $element.on('$destroy', function () {\r\n\r\n //Destroy sub nodes.\r\n treeNodesCtrl.scope.destroySubNode($scope);\r\n });\r\n };\r\n\r\n //Return the index of child node in parent node (nodesScope).\r\n $scope.index = function () {\r\n return $scope.$parentNodesScope.$modelValue.indexOf($scope.$modelValue);\r\n };\r\n\r\n $scope.dragEnabled = function () {\r\n return !($scope.$treeScope && !$scope.$treeScope.dragEnabled);\r\n };\r\n\r\n $scope.isSibling = function (targetNode) {\r\n return $scope.$parentNodesScope == targetNode.$parentNodesScope;\r\n };\r\n\r\n $scope.isChild = function (targetNode) {\r\n var nodes = $scope.childNodes();\r\n return nodes && nodes.indexOf(targetNode) > -1;\r\n };\r\n\r\n //TODO(jcarter): This method is on uiTreeHelper already.\r\n $scope.prev = function () {\r\n var index = $scope.index();\r\n if (index > 0) {\r\n return $scope.siblings()[index - 1];\r\n }\r\n return null;\r\n };\r\n\r\n //Calls childNodes on parent.\r\n $scope.siblings = function () {\r\n return $scope.$parentNodesScope.childNodes();\r\n };\r\n\r\n $scope.childNodesCount = function () {\r\n return $scope.childNodes() ? $scope.childNodes().length : 0;\r\n };\r\n\r\n $scope.hasChild = function () {\r\n return $scope.childNodesCount() > 0;\r\n };\r\n\r\n $scope.childNodes = function () {\r\n return $scope.$childNodesScope && $scope.$childNodesScope.$modelValue ?\r\n $scope.$childNodesScope.childNodes() :\r\n null;\r\n };\r\n\r\n $scope.accept = function (sourceNode, destIndex) {\r\n return $scope.$childNodesScope &&\r\n $scope.$childNodesScope.$modelValue &&\r\n $scope.$childNodesScope.accept(sourceNode, destIndex);\r\n };\r\n\r\n $scope.remove = function () {\r\n return $scope.$parentNodesScope.removeNode($scope);\r\n };\r\n\r\n $scope.toggle = function () {\r\n $scope.collapsed = !$scope.collapsed;\r\n $scope.$treeScope.$callbacks.toggle($scope.collapsed, $scope);\r\n };\r\n\r\n $scope.collapse = function () {\r\n $scope.collapsed = true;\r\n };\r\n\r\n $scope.expand = function () {\r\n $scope.collapsed = false;\r\n };\r\n\r\n $scope.depth = function () {\r\n var parentNode = $scope.$parentNodeScope;\r\n if (parentNode) {\r\n return parentNode.depth() + 1;\r\n }\r\n return 1;\r\n };\r\n\r\n /**\r\n * Returns the depth of the deepest subtree under this node\r\n * @param scope a TreeNodesController scope object\r\n * @returns Depth of all nodes *beneath* this node. If scope belongs to a leaf node, the\r\n * result is 0 (it has no subtree).\r\n */\r\n function countSubTreeDepth(scope) {\r\n if (!scope) {\r\n return 0;\r\n }\r\n var thisLevelDepth = 0,\r\n childNodes = scope.childNodes(),\r\n childNode,\r\n childDepth,\r\n i;\r\n if (!childNodes || childNodes.length === 0) {\r\n return 0;\r\n }\r\n for (i = childNodes.length - 1; i >= 0 ; i--) {\r\n childNode = childNodes[i],\r\n childDepth = 1 + countSubTreeDepth(childNode);\r\n thisLevelDepth = Math.max(thisLevelDepth, childDepth);\r\n }\r\n return thisLevelDepth;\r\n }\r\n\r\n $scope.maxSubDepth = function () {\r\n return $scope.$childNodesScope ? countSubTreeDepth($scope.$childNodesScope) : 0;\r\n };\r\n }\r\n ]);\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n\r\n .controller('TreeNodesController', ['$scope', '$element', '$timeout',\r\n function ($scope, $element, $timeout) {\r\n this.scope = $scope;\r\n\r\n $scope.$element = $element;\r\n $scope.$modelValue = null;\r\n $scope.$nodeScope = null; // the scope of node which the nodes belongs to\r\n $scope.$treeScope = null;\r\n $scope.$type = 'uiTreeNodes';\r\n $scope.$nodesMap = {};\r\n\r\n $scope.nodropEnabled = false;\r\n $scope.maxDepth = 0;\r\n $scope.cloneEnabled = false;\r\n\r\n $scope.initSubNode = function (subNode) {\r\n if (!subNode.$modelValue) {\r\n return null;\r\n }\r\n $scope.$nodesMap[subNode.$modelValue.$$hashKey] = subNode;\r\n };\r\n\r\n $scope.destroySubNode = function (subNode) {\r\n if (!subNode.$modelValue) {\r\n return null;\r\n }\r\n $scope.$nodesMap[subNode.$modelValue.$$hashKey] = null;\r\n };\r\n\r\n $scope.accept = function (sourceNode, destIndex) {\r\n return $scope.$treeScope.$callbacks.accept(sourceNode, $scope, destIndex);\r\n };\r\n\r\n $scope.beforeDrag = function (sourceNode) {\r\n return $scope.$treeScope.$callbacks.beforeDrag(sourceNode);\r\n };\r\n\r\n $scope.isParent = function (node) {\r\n return node.$parentNodesScope == $scope;\r\n };\r\n\r\n $scope.hasChild = function () {\r\n return $scope.$modelValue.length > 0;\r\n };\r\n\r\n //Called in apply method of UiTreeHelper.dragInfo.\r\n $scope.removeNode = function (node) {\r\n var index = $scope.$modelValue.indexOf(node.$modelValue);\r\n if (index > -1) {\r\n //$timeout(function () { // This causes the model to get updated after the dropped event is triggered\r\n $scope.$modelValue.splice(index, 1)[0];\r\n //});\r\n return $scope.$treeScope.$callbacks.removed(node);\r\n }\r\n return null;\r\n };\r\n\r\n //Called in apply method of UiTreeHelper.dragInfo.\r\n $scope.insertNode = function (index, nodeData) {\r\n //$timeout(function () { // This causes the model to get updated after the dropped event is triggered\r\n $scope.$modelValue.splice(index, 0, nodeData);\r\n //});\r\n };\r\n\r\n $scope.childNodes = function () {\r\n var i, nodes = [];\r\n if ($scope.$modelValue) {\r\n for (i = 0; i < $scope.$modelValue.length; i++) {\r\n nodes.push($scope.$nodesMap[$scope.$modelValue[i].$$hashKey]);\r\n }\r\n }\r\n return nodes;\r\n };\r\n\r\n $scope.depth = function () {\r\n if ($scope.$nodeScope) {\r\n return $scope.$nodeScope.depth();\r\n }\r\n return 0; // if it has no $nodeScope, it's root\r\n };\r\n\r\n // check if depth limit has reached\r\n $scope.outOfDepth = function (sourceNode) {\r\n var maxDepth = $scope.maxDepth || $scope.$treeScope.maxDepth;\r\n if (maxDepth > 0) {\r\n return $scope.depth() + sourceNode.maxSubDepth() + 1 > maxDepth;\r\n }\r\n return false;\r\n };\r\n\r\n }\r\n ]);\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n\r\n .controller('TreeController', ['$scope', '$element',\r\n function ($scope, $element) {\r\n this.scope = $scope;\r\n\r\n $scope.$element = $element;\r\n $scope.$nodesScope = null; // root nodes\r\n $scope.$type = 'uiTree';\r\n $scope.$emptyElm = null;\r\n $scope.$dropzoneElm = null;\r\n $scope.$callbacks = null;\r\n\r\n $scope.dragEnabled = true;\r\n $scope.emptyPlaceholderEnabled = true;\r\n $scope.maxDepth = 0;\r\n $scope.dragDelay = 0;\r\n $scope.cloneEnabled = false;\r\n $scope.nodropEnabled = false;\r\n $scope.dropzoneEnabled = false;\r\n\r\n // Check if it's a empty tree\r\n $scope.isEmpty = function () {\r\n return ($scope.$nodesScope && $scope.$nodesScope.$modelValue\r\n && $scope.$nodesScope.$modelValue.length === 0);\r\n };\r\n\r\n // add placeholder to empty tree\r\n $scope.place = function (placeElm) {\r\n $scope.$nodesScope.$element.append(placeElm);\r\n $scope.$emptyElm.remove();\r\n };\r\n\r\n this.resetEmptyElement = function () {\r\n if ((!$scope.$nodesScope.$modelValue || $scope.$nodesScope.$modelValue.length === 0) &&\r\n $scope.emptyPlaceholderEnabled) {\r\n $element.append($scope.$emptyElm);\r\n } else {\r\n $scope.$emptyElm.remove();\r\n }\r\n };\r\n\r\n this.resetDropzoneElement = function () {\r\n if ((!$scope.$nodesScope.$modelValue || $scope.$nodesScope.$modelValue.length !== 0) &&\r\n $scope.dropzoneEnabled) {\r\n $element.append($scope.$dropzoneElm);\r\n } else {\r\n $scope.$dropzoneElm.remove();\r\n }\r\n };\r\n\r\n $scope.resetEmptyElement = this.resetEmptyElement;\r\n $scope.resetDropzoneElement = this.resetDropzoneElement;\r\n }\r\n ]);\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n .directive('uiTree', ['treeConfig', '$window',\r\n function (treeConfig, $window) {\r\n return {\r\n restrict: 'A',\r\n scope: true,\r\n controller: 'TreeController',\r\n link: function (scope, element, attrs, ctrl) {\r\n var callbacks = {\r\n accept: null,\r\n beforeDrag: null\r\n },\r\n config = {},\r\n tdElm,\r\n $trElm,\r\n emptyElmColspan;\r\n\r\n //Adding configured class to uiTree.\r\n angular.extend(config, treeConfig);\r\n\r\n if (config.treeClass) {\r\n element.addClass(config.treeClass);\r\n }\r\n\r\n //Determining if uiTree is on a table.\r\n if (element.prop('tagName').toLowerCase() === 'table') {\r\n scope.$emptyElm = angular.element($window.document.createElement('tr'));\r\n $trElm = element.find('tr');\r\n \r\n //If we can find a tr, then we can use its td children as the empty element colspan.\r\n if ($trElm.length > 0) {\r\n emptyElmColspan = angular.element($trElm).children().length;\r\n } else {\r\n \r\n //If not, by setting a huge colspan we make sure it takes full width.\r\n //TODO(jcarter): Check for negative side effects.\r\n emptyElmColspan = 1000000;\r\n }\r\n tdElm = angular.element($window.document.createElement('td'))\r\n .attr('colspan', emptyElmColspan);\r\n scope.$emptyElm.append(tdElm);\r\n } else {\r\n scope.$emptyElm = angular.element($window.document.createElement('div'));\r\n scope.$dropzoneElm = angular.element($window.document.createElement('div'));\r\n }\r\n\r\n if (config.emptyTreeClass) {\r\n scope.$emptyElm.addClass(config.emptyTreeClass);\r\n }\r\n if (config.dropzoneClass) {\r\n scope.$dropzoneElm.addClass(config.dropzoneClass);\r\n }\r\n\r\n scope.$watch('$nodesScope.$modelValue.length', function (val) {\r\n if (!angular.isNumber(val)) {\r\n return;\r\n }\r\n\r\n ctrl.resetEmptyElement();\r\n ctrl.resetDropzoneElement();\r\n }, true);\r\n\r\n scope.$watch(attrs.dragEnabled, function (val) {\r\n if ((typeof val) == 'boolean') {\r\n scope.dragEnabled = val;\r\n }\r\n });\r\n\r\n scope.$watch(attrs.emptyPlaceholderEnabled, function (val) {\r\n if ((typeof val) == 'boolean') {\r\n scope.emptyPlaceholderEnabled = val;\r\n ctrl.resetEmptyElement();\r\n }\r\n });\r\n\r\n scope.$watch(attrs.nodropEnabled, function (val) {\r\n if ((typeof val) == 'boolean') {\r\n scope.nodropEnabled = val;\r\n }\r\n });\r\n\r\n scope.$watch(attrs.dropzoneEnabled, function (val) {\r\n if ((typeof val) == 'boolean') {\r\n scope.dropzoneEnabled = val;\r\n ctrl.resetDropzoneElement();\r\n }\r\n });\r\n\r\n scope.$watch(attrs.cloneEnabled, function (val) {\r\n if ((typeof val) == 'boolean') {\r\n scope.cloneEnabled = val;\r\n }\r\n });\r\n\r\n scope.$watch(attrs.maxDepth, function (val) {\r\n if ((typeof val) == 'number') {\r\n scope.maxDepth = val;\r\n }\r\n });\r\n\r\n scope.$watch(attrs.dragDelay, function (val) {\r\n if ((typeof val) == 'number') {\r\n scope.dragDelay = val;\r\n }\r\n });\r\n\r\n /**\r\n * Callback checks if the destination node can accept the dragged node.\r\n * By default, ui-tree will check that 'data-nodrop-enabled' is not set for the\r\n * destination ui-tree-nodes, and that the 'max-depth' attribute will not be exceeded\r\n * if it is set on the ui-tree or ui-tree-nodes.\r\n * This callback can be overridden, but callers must manually enforce nodrop and max-depth\r\n * themselves if they need those to be enforced.\r\n * @param sourceNodeScope Scope of the ui-tree-node being dragged\r\n * @param destNodesScope Scope of the ui-tree-nodes where the node is hovering\r\n * @param destIndex Index in the destination nodes array where the source node will drop\r\n * @returns {boolean} True if the node is permitted to be dropped here\r\n */\r\n callbacks.accept = function (sourceNodeScope, destNodesScope, destIndex) {\r\n return !(destNodesScope.nodropEnabled || destNodesScope.$treeScope.nodropEnabled || destNodesScope.outOfDepth(sourceNodeScope));\r\n };\r\n\r\n callbacks.beforeDrag = function (sourceNodeScope) {\r\n return true;\r\n };\r\n\r\n callbacks.expandTimeoutStart = function()\r\n {\r\n\r\n };\r\n\r\n callbacks.expandTimeoutCancel = function()\r\n {\r\n\r\n };\r\n\r\n callbacks.expandTimeoutEnd = function()\r\n {\r\n\r\n };\r\n\r\n callbacks.removed = function (node) {\r\n\r\n };\r\n\r\n /**\r\n * Callback is fired when a node is successfully dropped in a new location\r\n * @param event\r\n */\r\n callbacks.dropped = function (event) {\r\n\r\n };\r\n\r\n /**\r\n * Callback is fired each time the user starts dragging a node\r\n * @param event\r\n */\r\n callbacks.dragStart = function (event) {\r\n\r\n };\r\n\r\n /**\r\n * Callback is fired each time a dragged node is moved with the mouse/touch.\r\n * @param event\r\n */\r\n callbacks.dragMove = function (event) {\r\n\r\n };\r\n\r\n /**\r\n * Callback is fired when the tree exits drag mode. If the user dropped a node, the drop may have been\r\n * accepted or reverted.\r\n * @param event\r\n */\r\n callbacks.dragStop = function (event) {\r\n\r\n };\r\n\r\n /**\r\n * Callback is fired when a user drops a node (but prior to processing the drop action)\r\n * beforeDrop can return a Promise, truthy, or falsy (returning nothing is falsy).\r\n * If it returns falsy, or a resolve Promise, the node move is accepted\r\n * If it returns truthy, or a rejected Promise, the node move is reverted\r\n * @param event\r\n * @returns {Boolean|Promise} Truthy (or rejected Promise) to cancel node move; falsy (or resolved promise)\r\n */\r\n callbacks.beforeDrop = function (event) {\r\n\r\n };\r\n\r\n /**\r\n * Callback is fired when a user toggles node (but after processing the toggle action)\r\n * @param sourceNodeScope\r\n * @param collapsed\r\n */\r\n callbacks.toggle = function (collapsed, sourceNodeScope) {\r\n\r\n };\r\n\r\n scope.$watch(attrs.uiTree, function (newVal, oldVal) {\r\n angular.forEach(newVal, function (value, key) {\r\n if (callbacks[key]) {\r\n if (typeof value === 'function') {\r\n callbacks[key] = value;\r\n }\r\n }\r\n });\r\n\r\n scope.$callbacks = callbacks;\r\n }, true);\r\n\r\n\r\n }\r\n };\r\n }\r\n ]);\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n .directive('uiTreeHandle', ['treeConfig',\r\n function (treeConfig) {\r\n return {\r\n require: '^uiTreeNode',\r\n restrict: 'A',\r\n scope: true,\r\n controller: 'TreeHandleController',\r\n link: function (scope, element, attrs, treeNodeCtrl) {\r\n var config = {};\r\n angular.extend(config, treeConfig);\r\n if (config.handleClass) {\r\n element.addClass(config.handleClass);\r\n }\r\n // connect with the tree node.\r\n if (scope != treeNodeCtrl.scope) {\r\n scope.$nodeScope = treeNodeCtrl.scope;\r\n treeNodeCtrl.scope.$handleScope = scope;\r\n }\r\n }\r\n };\r\n }\r\n ]);\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n\r\n .directive('uiTreeNode', ['treeConfig', 'UiTreeHelper', '$window', '$document', '$timeout', '$q',\r\n function (treeConfig, UiTreeHelper, $window, $document, $timeout, $q) {\r\n return {\r\n require: ['^uiTreeNodes', '^uiTree'],\r\n restrict: 'A',\r\n controller: 'TreeNodeController',\r\n link: function (scope, element, attrs, controllersArr) {\r\n var config = {},\r\n hasTouch = 'ontouchstart' in window,\r\n firstMoving,\r\n dragInfo,\r\n pos,\r\n placeElm,\r\n hiddenPlaceElm,\r\n dragElm,\r\n scrollContainerElm,\r\n unhover,\r\n treeScope = null,\r\n elements, // As a parameter for callbacks\r\n dragDelaying = true,\r\n dragStarted = false,\r\n dragTimer = null,\r\n body = document.body,\r\n html = document.documentElement,\r\n document_height,\r\n document_width,\r\n dragStart,\r\n tagName,\r\n dragMove,\r\n dragEnd,\r\n dragStartEvent,\r\n dragMoveEvent,\r\n dragEndEvent,\r\n dragCancelEvent,\r\n dragDelay,\r\n bindDragStartEvents,\r\n bindDragMoveEvents,\r\n unbindDragMoveEvents,\r\n keydownHandler,\r\n isHandleChild,\r\n el,\r\n isUiTreeRoot,\r\n treeOfOrigin;\r\n\r\n //Adding configured class to ui-tree-node.\r\n angular.extend(config, treeConfig);\r\n\r\n if (config.nodeClass) {\r\n element.addClass(config.nodeClass);\r\n }\r\n\r\n //Call init function in nodeCtrl, sets parent node and sets up sub nodes.\r\n scope.init(controllersArr);\r\n\r\n scope.collapsed = !!UiTreeHelper.getNodeAttribute(scope, 'collapsed') || treeConfig.defaultCollapsed;\r\n scope.expandOnHover = !!UiTreeHelper.getNodeAttribute(scope, 'expandOnHover');\r\n scope.scrollContainer = UiTreeHelper.getNodeAttribute(scope, 'scrollContainer') || attrs.scrollContainer || null;\r\n scope.sourceOnly = scope.nodropEnabled || scope.$treeScope.nodropEnabled;\r\n\r\n scope.$watch(attrs.collapsed, function (val) {\r\n if ((typeof val) == 'boolean') {\r\n scope.collapsed = val;\r\n }\r\n });\r\n\r\n //Watches to trigger behavior based on actions and settings.\r\n scope.$watch('collapsed', function (val) {\r\n UiTreeHelper.setNodeAttribute(scope, 'collapsed', val);\r\n attrs.$set('collapsed', val);\r\n });\r\n\r\n scope.$watch(attrs.expandOnHover, function(val) {\r\n if ((typeof val) === 'boolean' || (typeof val) === 'number') {\r\n scope.expandOnHover = val;\r\n }\r\n });\r\n\r\n scope.$watch('expandOnHover', function (val) {\r\n UiTreeHelper.setNodeAttribute(scope, 'expandOnHover', val);\r\n attrs.$set('expandOnHover', val);\r\n });\r\n\r\n attrs.$observe('scrollContainer', function(val) {\r\n if ((typeof val) === 'string') {\r\n scope.scrollContainer = val;\r\n }\r\n });\r\n\r\n scope.$watch('scrollContainer', function(val) {\r\n UiTreeHelper.setNodeAttribute(scope, 'scrollContainer', val);\r\n attrs.$set('scrollContainer', val);\r\n scrollContainerElm = document.querySelector(val);\r\n });\r\n\r\n scope.$on('angular-ui-tree:collapse-all', function () {\r\n scope.collapsed = true;\r\n });\r\n\r\n scope.$on('angular-ui-tree:expand-all', function () {\r\n scope.collapsed = false;\r\n });\r\n\r\n /**\r\n * Called when the user has grabbed a node and started dragging it.\r\n *\r\n * @param {MouseEvent} e event that is triggered by DOM.\r\n * @return undefined?\r\n */\r\n dragStart = function (e) {\r\n\r\n //Disable right click.\r\n if (!hasTouch && (e.button === 2 || e.which === 3)) {\r\n return;\r\n }\r\n\r\n //Event has already fired in other scope.\r\n if (e.uiTreeDragging || (e.originalEvent && e.originalEvent.uiTreeDragging)) {\r\n return;\r\n }\r\n\r\n //The node being dragged.\r\n var eventElm = angular.element(e.target),\r\n isHandleChild,\r\n cloneElm,\r\n eventElmTagName,\r\n tagName,\r\n eventObj,\r\n tdElm,\r\n hStyle,\r\n isTreeNode,\r\n isTreeNodeHandle;\r\n\r\n //If the target element is a child element of a ui-tree-handle,\r\n // use the containing handle element as target element.\r\n isHandleChild = UiTreeHelper.treeNodeHandlerContainerOfElement(eventElm);\r\n if (isHandleChild) {\r\n eventElm = angular.element(isHandleChild);\r\n }\r\n\r\n cloneElm = element.clone();\r\n isTreeNode = UiTreeHelper.elementIsTreeNode(eventElm);\r\n isTreeNodeHandle = UiTreeHelper.elementIsTreeNodeHandle(eventElm);\r\n\r\n //If we are not triggering mousedown on our uiTree or any of it's parts, return.\r\n if (!isTreeNode && !isTreeNodeHandle) {\r\n return;\r\n }\r\n\r\n //If we are not triggering mousedown on our uiTree or any of it's parts, return.\r\n if (isTreeNode && UiTreeHelper.elementContainsTreeNodeHandler(eventElm)) {\r\n return;\r\n }\r\n\r\n //Dragging not allowed on inputs or buttons.\r\n eventElmTagName = eventElm.prop('tagName').toLowerCase();\r\n if (eventElmTagName == 'input' ||\r\n eventElmTagName == 'textarea' ||\r\n eventElmTagName == 'button' ||\r\n eventElmTagName == 'select') {\r\n return;\r\n }\r\n\r\n //Check if it or it's parents has a 'data-nodrag' attribute\r\n el = angular.element(e.target);\r\n isUiTreeRoot = el[0].attributes['ui-tree'];\r\n while (el && el[0] && el[0] !== element && !isUiTreeRoot) {\r\n\r\n //Checking that I can access attributes.\r\n if (el[0].attributes) {\r\n isUiTreeRoot = el[0].attributes['ui-tree'];\r\n }\r\n\r\n //If the node mark as `nodrag`, DONOT drag it.\r\n if (UiTreeHelper.nodrag(el)) {\r\n return;\r\n }\r\n el = el.parent();\r\n }\r\n\r\n //If users beforeDrag calback returns falsey, do not initiate.\r\n if (!scope.beforeDrag(scope)) {\r\n return;\r\n }\r\n\r\n //Set property checked at start of function to prevent running logic again.\r\n e.uiTreeDragging = true;\r\n if (e.originalEvent) {\r\n e.originalEvent.uiTreeDragging = true;\r\n }\r\n e.preventDefault();\r\n\r\n //Get original event if TouchEvent.\r\n eventObj = UiTreeHelper.eventObj(e);\r\n\r\n //Set boolean used to specify beginning of move.\r\n firstMoving = true;\r\n\r\n //Setting drag info properties and methods in scope of node being moved.\r\n dragInfo = UiTreeHelper.dragInfo(scope);\r\n\r\n //Setting original tree to adjust horizontal behavior in drag move.\r\n treeOfOrigin = dragInfo.source.$treeScope.$id;\r\n\r\n //Determine tage name of element ui-tree-node is on.\r\n tagName = element.prop('tagName');\r\n\r\n if (tagName.toLowerCase() === 'tr') {\r\n\r\n //Create a new table column as placeholder.\r\n placeElm = angular.element($window.document.createElement(tagName));\r\n\r\n //Create a column placeholder and set colspan to whole row length.\r\n tdElm = angular.element($window.document.createElement('td'))\r\n .addClass(config.placeholderClass)\r\n .attr('colspan', element[0].children.length);\r\n placeElm.append(tdElm);\r\n } else {\r\n\r\n //If not a table just duplicate element and add placeholder class.\r\n placeElm = angular.element($window.document.createElement(tagName))\r\n .addClass(config.placeholderClass);\r\n }\r\n\r\n //Create a hidden placeholder and add class from config.\r\n hiddenPlaceElm = angular.element($window.document.createElement(tagName));\r\n if (config.hiddenClass) {\r\n hiddenPlaceElm.addClass(config.hiddenClass);\r\n }\r\n\r\n //Getting starting position of element being moved.\r\n pos = UiTreeHelper.positionStarted(eventObj, element);\r\n placeElm.css('height', element.prop('offsetHeight') + 'px');\r\n\r\n //Creating drag element to represent node.\r\n dragElm = angular.element($window.document.createElement(scope.$parentNodesScope.$element.prop('tagName')))\r\n .addClass(scope.$parentNodesScope.$element.attr('class')).addClass(config.dragClass);\r\n dragElm.css('width', UiTreeHelper.width(element) + 'px');\r\n dragElm.css('z-index', 9999);\r\n\r\n //Prevents cursor to change rapidly in Opera 12.16 and IE when dragging an element.\r\n hStyle = (element[0].querySelector('.angular-ui-tree-handle') || element[0]).currentStyle;\r\n if (hStyle) {\r\n document.body.setAttribute('ui-tree-cursor', $document.find('body').css('cursor') || '');\r\n $document.find('body').css({'cursor': hStyle.cursor + '!important'});\r\n }\r\n\r\n //If tree is sourceOnly (noDragDrop) don't show placeholder when moving about it.\r\n if (scope.sourceOnly) {\r\n placeElm.css('display', 'none');\r\n }\r\n\r\n //Insert placeholder.\r\n element.after(placeElm);\r\n element.after(hiddenPlaceElm);\r\n if (dragInfo.isClone() && scope.sourceOnly) {\r\n dragElm.append(cloneElm);\r\n } else {\r\n dragElm.append(element);\r\n }\r\n\r\n //Create drag element.\r\n $document.find('body').append(dragElm);\r\n\r\n //Set drag elements position on screen.\r\n dragElm.css({\r\n 'left': eventObj.pageX - pos.offsetX + 'px',\r\n 'top': eventObj.pageY - pos.offsetY + 'px'\r\n });\r\n elements = {\r\n placeholder: placeElm,\r\n dragging: dragElm\r\n };\r\n\r\n //Create all drag/move bindings.\r\n bindDragMoveEvents();\r\n\r\n //Fire dragStart callback.\r\n scope.$apply(function () {\r\n scope.$treeScope.$callbacks.dragStart(dragInfo.eventArgs(elements, pos));\r\n });\r\n\r\n //Get bounds of document.\r\n document_height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\r\n document_width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);\r\n };\r\n\r\n dragMove = function (e) {\r\n var eventObj = UiTreeHelper.eventObj(e),\r\n prev,\r\n next,\r\n leftElmPos,\r\n topElmPos,\r\n top_scroll,\r\n bottom_scroll,\r\n scrollContainerElmRect,\r\n target,\r\n targetX,\r\n targetY,\r\n displayElm,\r\n targetNode,\r\n targetElm,\r\n isEmpty,\r\n scrollDownBy,\r\n scrollUpBy,\r\n targetOffset,\r\n targetBefore,\r\n moveWithinTree,\r\n targetBeforeBuffer,\r\n targetHeight,\r\n targetChildElm,\r\n targetChildHeight,\r\n isDropzone;\r\n\r\n //If check ensures that drag element was created.\r\n if (dragElm) {\r\n e.preventDefault();\r\n\r\n //Deselect anything (text, etc.) that was selected when move began.\r\n if ($window.getSelection) {\r\n $window.getSelection().removeAllRanges();\r\n } else if ($window.document.selection) {\r\n $window.document.selection.empty();\r\n }\r\n\r\n //Get top left positioning of element being moved.\r\n leftElmPos = eventObj.pageX - pos.offsetX;\r\n topElmPos = eventObj.pageY - pos.offsetY;\r\n\r\n //dragElm can't leave the screen on the left.\r\n if (leftElmPos < 0) {\r\n leftElmPos = 0;\r\n }\r\n\r\n //dragElm can't leave the screen on the top.\r\n if (topElmPos < 0) {\r\n topElmPos = 0;\r\n }\r\n\r\n //dragElm can't leave the screen on the bottom.\r\n if ((topElmPos + 10) > document_height) {\r\n topElmPos = document_height - 10;\r\n }\r\n\r\n //dragElm can't leave the screen on the right.\r\n if ((leftElmPos + 10) > document_width) {\r\n leftElmPos = document_width - 10;\r\n }\r\n\r\n //Updating element being moved css.\r\n dragElm.css({\r\n 'left': leftElmPos + 'px',\r\n 'top': topElmPos + 'px'\r\n });\r\n\r\n if (scrollContainerElm) {\r\n //Getting position to top and bottom of container element.\r\n scrollContainerElmRect = scrollContainerElm.getBoundingClientRect();\r\n top_scroll = scrollContainerElm.scrollTop;\r\n bottom_scroll = top_scroll + scrollContainerElm.clientHeight;\r\n\r\n //To scroll down if cursor y-position is greater than the bottom position of the container vertical scroll\r\n if (scrollContainerElmRect.bottom < eventObj.clientY && bottom_scroll < scrollContainerElm.scrollHeight) {\r\n scrollDownBy = Math.min(scrollContainerElm.scrollHeight - bottom_scroll, 10);\r\n scrollContainerElm.scrollTop += scrollDownBy;\r\n }\r\n\r\n //To scroll top if cursor y-position is less than the top position of the container vertical scroll\r\n if (scrollContainerElmRect.top > eventObj.clientY && top_scroll > 0) {\r\n scrollUpBy = Math.min(top_scroll, 10);\r\n scrollContainerElm.scrollTop -= scrollUpBy;\r\n }\r\n } else {\r\n //Getting position to top and bottom of page.\r\n top_scroll = window.pageYOffset || $window.document.documentElement.scrollTop;\r\n bottom_scroll = top_scroll + (window.innerHeight || $window.document.clientHeight || $window.document.clientHeight);\r\n\r\n //To scroll down if cursor y-position is greater than the bottom position of the window vertical scroll\r\n if (bottom_scroll < eventObj.pageY && bottom_scroll < document_height) {\r\n scrollDownBy = Math.min(document_height - bottom_scroll, 10);\r\n window.scrollBy(0, scrollDownBy);\r\n }\r\n\r\n //To scroll top if cursor y-position is less than the top position of the window vertical scroll\r\n if (top_scroll > eventObj.pageY) {\r\n scrollUpBy = Math.min(top_scroll, 10);\r\n window.scrollBy(0, -scrollUpBy);\r\n }\r\n }\r\n\r\n //Calling service to update position coordinates based on move.\r\n UiTreeHelper.positionMoved(e, pos, firstMoving);\r\n if (firstMoving) {\r\n firstMoving = false;\r\n return;\r\n }\r\n\r\n //Setting X point for elementFromPoint.\r\n targetX = eventObj.pageX - ($window.pageXOffset ||\r\n $window.document.body.scrollLeft ||\r\n $window.document.documentElement.scrollLeft) -\r\n ($window.document.documentElement.clientLeft || 0);\r\n\r\n targetY = eventObj.pageY - ($window.pageYOffset ||\r\n $window.document.body.scrollTop ||\r\n $window.document.documentElement.scrollTop) -\r\n ($window.document.documentElement.clientTop || 0);\r\n\r\n //Select the drag target. Because IE does not support CSS 'pointer-events: none', it will always\r\n // pick the drag element itself as the target. To prevent this, we hide the drag element while\r\n // selecting the target.\r\n if (angular.isFunction(dragElm.hide)) {\r\n dragElm.hide();\r\n } else {\r\n displayElm = dragElm[0].style.display;\r\n dragElm[0].style.display = 'none';\r\n }\r\n\r\n //When using elementFromPoint() inside an iframe, you have to call\r\n // elementFromPoint() twice to make sure IE8 returns the correct value\r\n //MDN: The elementFromPoint() method of the Document interface returns the topmost element at the specified coordinates.\r\n $window.document.elementFromPoint(targetX, targetY);\r\n\r\n //Set target element (element in specified x/y coordinates).\r\n targetElm = angular.element($window.document.elementFromPoint(targetX, targetY));\r\n\r\n //If the target element is a child element of a ui-tree-handle,\r\n // use the containing handle element as target element\r\n isHandleChild = UiTreeHelper.treeNodeHandlerContainerOfElement(targetElm);\r\n if (isHandleChild) {\r\n targetElm = angular.element(isHandleChild);\r\n }\r\n\r\n if (angular.isFunction(dragElm.show)) {\r\n dragElm.show();\r\n } else {\r\n dragElm[0].style.display = displayElm;\r\n }\r\n\r\n //Assigning scope to target you are moving draggable over.\r\n if (UiTreeHelper.elementIsTree(targetElm)) {\r\n targetNode = targetElm.controller('uiTree').scope;\r\n } else if (UiTreeHelper.elementIsTreeNodeHandle(targetElm)) {\r\n targetNode = targetElm.controller('uiTreeHandle').scope;\r\n } else if (UiTreeHelper.elementIsTreeNode(targetElm)) {\r\n targetNode = targetElm.controller('uiTreeNode').scope;\r\n } else if (UiTreeHelper.elementIsTreeNodes(targetElm)) {\r\n targetNode = targetElm.controller('uiTreeNodes').scope;\r\n } else if (UiTreeHelper.elementIsPlaceholder(targetElm)) {\r\n targetNode = targetElm.controller('uiTreeNodes').scope;\r\n } else if (UiTreeHelper.elementIsDropzone(targetElm)) {\r\n targetNode = targetElm.controller('uiTree').scope;\r\n isDropzone = true;\r\n } else if (targetElm.controller('uiTreeNode')) {\r\n //Is a child element of a node.\r\n targetNode = targetElm.controller('uiTreeNode').scope;\r\n }\r\n\r\n moveWithinTree = (targetNode && targetNode.$treeScope && targetNode.$treeScope.$id && targetNode.$treeScope.$id === treeOfOrigin);\r\n\r\n /* (jcarter) Notes to developers:\r\n * pos.dirAx is either 0 or 1\r\n * 1 means horizontal movement is happening\r\n * 0 means vertical movement is happening\r\n */\r\n\r\n // Move nodes up and down in nesting level.\r\n if (moveWithinTree && pos.dirAx) {\r\n\r\n // increase horizontal level if previous sibling exists and is not collapsed\r\n // example 1.1.1 becomes 1.2\r\n if (pos.distX > 0) {\r\n prev = dragInfo.prev();\r\n if (prev && !prev.collapsed\r\n && prev.accept(scope, prev.childNodesCount())) {\r\n prev.$childNodesScope.$element.append(placeElm);\r\n dragInfo.moveTo(prev.$childNodesScope, prev.childNodes(), prev.childNodesCount());\r\n }\r\n }\r\n\r\n // decrease horizontal level\r\n // example 1.2 become 1.1.1\r\n if (pos.distX < 0) {\r\n // we can't decrease a level if an item preceeds the current one\r\n next = dragInfo.next();\r\n if (!next) {\r\n target = dragInfo.parentNode(); // As a sibling of it's parent node\r\n if (target\r\n && target.$parentNodesScope.accept(scope, target.index() + 1)) {\r\n target.$element.after(placeElm);\r\n dragInfo.moveTo(target.$parentNodesScope, target.siblings(), target.index() + 1);\r\n }\r\n }\r\n }\r\n } else { //Either in origin tree and moving horizontally OR you are moving within a new tree.\r\n\r\n //Check it's new position.\r\n isEmpty = false;\r\n\r\n //Exit if target is not a uiTree or child of one.\r\n if (!targetNode) {\r\n return;\r\n }\r\n\r\n //Show the placeholder if it was hidden for nodrop-enabled and this is a new tree\r\n if (targetNode.$treeScope && !targetNode.$parent.nodropEnabled && !targetNode.$treeScope.nodropEnabled) {\r\n placeElm.css('display', '');\r\n }\r\n\r\n //Set whether target tree is empty or not.\r\n if (targetNode.$type === 'uiTree' && targetNode.dragEnabled) {\r\n isEmpty = targetNode.isEmpty();\r\n }\r\n\r\n //If target is a handle set new target to handle's node.\r\n if (targetNode.$type === 'uiTreeHandle') {\r\n targetNode = targetNode.$nodeScope;\r\n }\r\n\r\n //Check if it is a uiTreeNode or it's an empty tree or it's a dropzone.\r\n if (targetNode.$type !== 'uiTreeNode' && !isEmpty && !isDropzone) {\r\n\r\n // Allow node to return to its original position if no longer hovering over target\r\n if (config.appendChildOnHover) {\r\n next = dragInfo.next();\r\n if (!next && unhover) {\r\n target = dragInfo.parentNode();\r\n target.$element.after(placeElm);\r\n dragInfo.moveTo(target.$parentNodesScope, target.siblings(), target.index() + 1);\r\n unhover = false;\r\n }\r\n }\r\n return;\r\n }\r\n\r\n //If placeholder move from empty tree, reset it.\r\n if (treeScope && placeElm.parent()[0] != treeScope.$element[0]) {\r\n treeScope.resetEmptyElement();\r\n treeScope.resetDropzoneElement();\r\n treeScope = null;\r\n }\r\n\r\n //It's an empty tree\r\n if (isEmpty) {\r\n treeScope = targetNode;\r\n if (targetNode.$nodesScope.accept(scope, 0)) {\r\n dragInfo.moveTo(targetNode.$nodesScope, targetNode.$nodesScope.childNodes(), 0);\r\n }\r\n //It's a dropzone\r\n } else if (isDropzone) {\r\n treeScope = targetNode;\r\n if (targetNode.$nodesScope.accept(scope, targetNode.$nodesScope.childNodes().length)) {\r\n dragInfo.moveTo(targetNode.$nodesScope, targetNode.$nodesScope.childNodes(), targetNode.$nodesScope.childNodes().length);\r\n }\r\n //Not empty and drag enabled.\r\n } else if (targetNode.dragEnabled()) {\r\n\r\n //Setting/Resetting data for exanding on hover.\r\n if (angular.isDefined(scope.expandTimeoutOn) && scope.expandTimeoutOn !== targetNode.id) {\r\n $timeout.cancel(scope.expandTimeout);\r\n delete scope.expandTimeout;\r\n delete scope.expandTimeoutOn;\r\n\r\n scope.$callbacks.expandTimeoutCancel();\r\n }\r\n\r\n //Determining if expansion is needed.\r\n if (targetNode.collapsed) {\r\n if (scope.expandOnHover === true || (angular.isNumber(scope.expandOnHover) && scope.expandOnHover === 0)) {\r\n targetNode.collapsed = false;\r\n targetNode.$treeScope.$callbacks.toggle(false, targetNode);\r\n } else if (scope.expandOnHover !== false && angular.isNumber(scope.expandOnHover) && scope.expandOnHover > 0) {\r\n\r\n //Triggering expansion.\r\n if (angular.isUndefined(scope.expandTimeoutOn)) {\r\n scope.expandTimeoutOn = targetNode.$id;\r\n\r\n scope.$callbacks.expandTimeoutStart();\r\n scope.expandTimeout = $timeout(function()\r\n {\r\n scope.$callbacks.expandTimeoutEnd();\r\n targetNode.collapsed = false;\r\n targetNode.$treeScope.$callbacks.toggle(false, targetNode);\r\n }, scope.expandOnHover);\r\n }\r\n }\r\n }\r\n\r\n //Get the element of ui-tree-node\r\n targetElm = targetNode.$element;\r\n targetOffset = UiTreeHelper.offset(targetElm);\r\n targetHeight = UiTreeHelper.height(targetElm);\r\n targetChildElm = targetNode.$childNodesScope ? targetNode.$childNodesScope.$element : null;\r\n targetChildHeight = targetChildElm ? UiTreeHelper.height(targetChildElm) : 0;\r\n targetHeight -= targetChildHeight;\r\n targetBeforeBuffer = config.appendChildOnHover ? targetHeight * 0.25 : UiTreeHelper.height(targetElm) / 2;\r\n targetBefore = eventObj.pageY < (targetOffset.top + targetBeforeBuffer);\r\n\r\n if (targetNode.$parentNodesScope.accept(scope, targetNode.index())) {\r\n if (targetBefore) {\r\n targetElm[0].parentNode.insertBefore(placeElm[0], targetElm[0]);\r\n dragInfo.moveTo(targetNode.$parentNodesScope, targetNode.siblings(), targetNode.index());\r\n } else {\r\n // Try to append as a child if dragged upwards onto targetNode\r\n if (config.appendChildOnHover && targetNode.accept(scope, targetNode.childNodesCount())) {\r\n targetNode.$childNodesScope.$element.prepend(placeElm);\r\n dragInfo.moveTo(targetNode.$childNodesScope, targetNode.childNodes(), 0);\r\n unhover = true;\r\n } else {\r\n targetElm.after(placeElm);\r\n dragInfo.moveTo(targetNode.$parentNodesScope, targetNode.siblings(), targetNode.index() + 1);\r\n }\r\n }\r\n\r\n //We have to check if it can add the dragging node as a child.\r\n } else if (!targetBefore && targetNode.accept(scope, targetNode.childNodesCount())) {\r\n targetNode.$childNodesScope.$element.append(placeElm);\r\n dragInfo.moveTo(targetNode.$childNodesScope, targetNode.childNodes(), targetNode.childNodesCount());\r\n }\r\n }\r\n }\r\n\r\n //Triggering dragMove callback.\r\n scope.$apply(function () {\r\n scope.$treeScope.$callbacks.dragMove(dragInfo.eventArgs(elements, pos));\r\n });\r\n }\r\n };\r\n\r\n dragEnd = function (e) {\r\n\r\n var dragEventArgs = dragInfo.eventArgs(elements, pos);\r\n\r\n e.preventDefault();\r\n\r\n //TODO(jcarter): Is dragStart need to be unbound?\r\n unbindDragMoveEvents();\r\n\r\n //This cancel the collapse/expand login running.\r\n $timeout.cancel(scope.expandTimeout);\r\n\r\n scope.$treeScope.$apply(function () {\r\n $q.when(scope.$treeScope.$callbacks.beforeDrop(dragEventArgs))\r\n\r\n //Promise resolved (or callback didn't return false)\r\n .then(function (allowDrop) {\r\n if (allowDrop !== false && scope.$$allowNodeDrop) {\r\n //Node drop accepted.\r\n dragInfo.apply();\r\n\r\n //Fire the dropped callback only if the move was successful.\r\n scope.$treeScope.$callbacks.dropped(dragEventArgs);\r\n } else {\r\n //Drop canceled - revert the node to its original position.\r\n bindDragStartEvents();\r\n }\r\n })\r\n\r\n //Promise rejected - revert the node to its original position.\r\n .catch(function () {\r\n bindDragStartEvents();\r\n })\r\n .finally(function () {\r\n\r\n //Replace placeholder with newly dropped element.\r\n hiddenPlaceElm.replaceWith(scope.$element);\r\n placeElm.remove();\r\n\r\n //Remove drag element if still in DOM.\r\n if (dragElm) {\r\n dragElm.remove();\r\n dragElm = null;\r\n }\r\n\r\n //Fire dragStope callback.\r\n scope.$treeScope.$callbacks.dragStop(dragEventArgs);\r\n scope.$$allowNodeDrop = false;\r\n dragInfo = null;\r\n\r\n //Restore cursor in Opera 12.16 and IE\r\n var oldCur = document.body.getAttribute('ui-tree-cursor');\r\n if (oldCur !== null) {\r\n $document.find('body').css({'cursor': oldCur});\r\n document.body.removeAttribute('ui-tree-cursor');\r\n }\r\n });\r\n });\r\n };\r\n\r\n dragStartEvent = function (e) {\r\n if (scope.dragEnabled()) {\r\n dragStart(e);\r\n }\r\n };\r\n\r\n dragMoveEvent = function (e) {\r\n dragMove(e);\r\n };\r\n\r\n dragEndEvent = function (e) {\r\n scope.$$allowNodeDrop = true;\r\n dragEnd(e);\r\n };\r\n\r\n dragCancelEvent = function (e) {\r\n dragEnd(e);\r\n };\r\n\r\n dragDelay = (function () {\r\n var to;\r\n\r\n return {\r\n exec: function (fn, ms) {\r\n if (!ms) {\r\n ms = 0;\r\n }\r\n this.cancel();\r\n to = $timeout(fn, ms);\r\n },\r\n cancel: function () {\r\n $timeout.cancel(to);\r\n }\r\n };\r\n })();\r\n\r\n keydownHandler = function (e) {\r\n if (e.keyCode === 27) {\r\n dragEndEvent(e);\r\n }\r\n };\r\n\r\n /**\r\n * Binds the mouse/touch events to enable drag start for this node.\r\n */\r\n //This is outside of bindDragMoveEvents because of the potential for a delay setting.\r\n bindDragStartEvents = function () {\r\n element.bind('touchstart mousedown', function (e) {\r\n //Don't call drag delay if no delay was specified.\r\n if (scope.dragDelay > 0) {\r\n dragDelay.exec(function () {\r\n dragStartEvent(e);\r\n }, scope.dragDelay);\r\n } else {\r\n dragStartEvent(e);\r\n }\r\n });\r\n element.bind('touchend touchcancel mouseup', function () {\r\n if (scope.dragDelay > 0) {\r\n dragDelay.cancel();\r\n }\r\n });\r\n };\r\n bindDragStartEvents();\r\n\r\n /**\r\n * Binds mouse/touch events that handle moving/dropping this dragged node\r\n */\r\n bindDragMoveEvents = function () {\r\n angular.element($document).bind('touchend', dragEndEvent);\r\n angular.element($document).bind('touchcancel', dragEndEvent);\r\n angular.element($document).bind('touchmove', dragMoveEvent);\r\n angular.element($document).bind('mouseup', dragEndEvent);\r\n angular.element($document).bind('mousemove', dragMoveEvent);\r\n angular.element($document).bind('mouseleave', dragCancelEvent);\r\n angular.element($document).bind('keydown', keydownHandler);\r\n };\r\n\r\n /**\r\n * Unbinds mouse/touch events that handle moving/dropping this dragged node.\r\n */\r\n unbindDragMoveEvents = function () {\r\n angular.element($document).unbind('touchend', dragEndEvent);\r\n angular.element($document).unbind('touchcancel', dragEndEvent);\r\n angular.element($document).unbind('touchmove', dragMoveEvent);\r\n angular.element($document).unbind('mouseup', dragEndEvent);\r\n angular.element($document).unbind('mousemove', dragMoveEvent);\r\n angular.element($document).unbind('mouseleave', dragCancelEvent);\r\n angular.element($document).unbind('keydown', keydownHandler);\r\n };\r\n }\r\n };\r\n }\r\n ]);\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n .directive('uiTreeNodes', ['treeConfig', '$window',\r\n function (treeConfig) {\r\n return {\r\n require: ['ngModel', '?^uiTreeNode', '^uiTree'],\r\n restrict: 'A',\r\n scope: true,\r\n controller: 'TreeNodesController',\r\n link: function (scope, element, attrs, controllersArr) {\r\n\r\n var config = {},\r\n ngModel = controllersArr[0],\r\n treeNodeCtrl = controllersArr[1],\r\n treeCtrl = controllersArr[2];\r\n\r\n angular.extend(config, treeConfig);\r\n if (config.nodesClass) {\r\n element.addClass(config.nodesClass);\r\n }\r\n\r\n if (treeNodeCtrl) {\r\n treeNodeCtrl.scope.$childNodesScope = scope;\r\n scope.$nodeScope = treeNodeCtrl.scope;\r\n } else {\r\n // find the root nodes if there is no parent node and have a parent ui-tree\r\n treeCtrl.scope.$nodesScope = scope;\r\n }\r\n scope.$treeScope = treeCtrl.scope;\r\n\r\n if (ngModel) {\r\n ngModel.$render = function () {\r\n scope.$modelValue = ngModel.$modelValue;\r\n };\r\n }\r\n\r\n scope.$watch(function () {\r\n return attrs.maxDepth;\r\n }, function (val) {\r\n if ((typeof val) == 'number') {\r\n scope.maxDepth = val;\r\n }\r\n });\r\n\r\n scope.$watch(function () {\r\n return attrs.nodropEnabled;\r\n }, function (newVal) {\r\n if ((typeof newVal) != 'undefined') {\r\n scope.nodropEnabled = true;\r\n }\r\n }, true);\r\n\r\n }\r\n };\r\n }\r\n ]);\r\n})();\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular.module('ui.tree')\r\n\r\n /**\r\n * @ngdoc service\r\n * @name ui.tree.service:UiTreeHelper\r\n * @requires ng.$document\r\n * @requires ng.$window\r\n *\r\n * @description\r\n * angular-ui-tree.\r\n */\r\n .factory('UiTreeHelper', ['$document', '$window', 'treeConfig',\r\n function ($document, $window, treeConfig) {\r\n return {\r\n\r\n /**\r\n * A hashtable used to storage data of nodes\r\n * @type {Object}\r\n */\r\n nodesData: {},\r\n\r\n setNodeAttribute: function (scope, attrName, val) {\r\n if (!scope.$modelValue) {\r\n return null;\r\n }\r\n var data = this.nodesData[scope.$modelValue.$$hashKey];\r\n if (!data) {\r\n data = {};\r\n this.nodesData[scope.$modelValue.$$hashKey] = data;\r\n }\r\n data[attrName] = val;\r\n },\r\n\r\n getNodeAttribute: function (scope, attrName) {\r\n if (!scope.$modelValue) {\r\n return null;\r\n }\r\n var data = this.nodesData[scope.$modelValue.$$hashKey];\r\n if (data) {\r\n return data[attrName];\r\n }\r\n return null;\r\n },\r\n\r\n /**\r\n * @ngdoc method\r\n * @methodOf ui.tree.service:$nodrag\r\n * @param {Object} targetElm angular element\r\n * @return {Bool} check if the node can be dragged.\r\n */\r\n nodrag: function (targetElm) {\r\n if (typeof targetElm.attr('data-nodrag') != 'undefined') {\r\n return targetElm.attr('data-nodrag') !== 'false';\r\n }\r\n return false;\r\n },\r\n\r\n /**\r\n * Get the event object for touches.\r\n * \r\n * @param {MouseEvent|TouchEvent} e MouseEvent or TouchEvent that kicked off dragX method.\r\n * @return {MouseEvent|TouchEvent} Object returned as original event object.\r\n */\r\n eventObj: function (e) {\r\n var obj = e;\r\n if (e.targetTouches !== undefined) {\r\n //Set obj equal to the first Touch object in the TouchList.\r\n obj = e.targetTouches.item(0);\r\n //Logic to set obj to original TouchEvent.\r\n } else if (e.originalEvent !== undefined && e.originalEvent.targetTouches !== undefined) {\r\n obj = e.originalEvent.targetTouches.item(0);\r\n }\r\n return obj;\r\n },\r\n\r\n /**\r\n * Generate object used to store data about node being moved.\r\n * \r\n * {angular.$scope} node Scope of the node that is being moved.\r\n */\r\n dragInfo: function (node) {\r\n return {\r\n source: node,\r\n sourceInfo: {\r\n cloneModel: node.$treeScope.cloneEnabled === true ? angular.copy(node.$modelValue) : undefined,\r\n nodeScope: node,\r\n index: node.index(),\r\n nodesScope: node.$parentNodesScope\r\n },\r\n index: node.index(),\r\n\r\n //Slice(0) just duplicates an array.\r\n siblings: node.siblings().slice(0),\r\n parent: node.$parentNodesScope,\r\n\r\n //Reset parent to source parent.\r\n resetParent: function() {\r\n this.parent = node.$parentNodesScope;\r\n },\r\n\r\n //Move the node to a new position, determining where the node will be inserted to when dropped happens here.\r\n moveTo: function (parent, siblings, index) {\r\n this.parent = parent;\r\n\r\n //Duplicate siblings array.\r\n this.siblings = siblings.slice(0);\r\n\r\n //If source node is in the target nodes\r\n var i = this.siblings.indexOf(this.source);\r\n if (i > -1) {\r\n this.siblings.splice(i, 1);\r\n if (this.source.index() < index) {\r\n index--;\r\n }\r\n }\r\n\r\n this.siblings.splice(index, 0, this.source);\r\n this.index = index;\r\n },\r\n\r\n //Get parent nodes nodeScope.\r\n parentNode: function () {\r\n return this.parent.$nodeScope;\r\n },\r\n\r\n //Get previous sibling node.\r\n prev: function () {\r\n if (this.index > 0) {\r\n return this.siblings[this.index - 1];\r\n }\r\n\r\n return null;\r\n },\r\n\r\n //Get next sibling node.\r\n next: function () {\r\n if (this.index < this.siblings.length - 1) {\r\n return this.siblings[this.index + 1];\r\n }\r\n\r\n return null;\r\n },\r\n\r\n //Return what cloneEnabled is set to on uiTree.\r\n isClone: function () {\r\n return this.source.$treeScope.cloneEnabled === true;\r\n },\r\n\r\n //Returns a copy of node passed in.\r\n clonedNode: function (node) {\r\n return angular.copy(node);\r\n },\r\n\r\n //Returns true if parent or index have changed (move happened within any uiTree).\r\n isDirty: function () {\r\n return this.source.$parentNodesScope != this.parent ||\r\n this.source.index() != this.index;\r\n },\r\n\r\n //Return whether node has a new parent (set on moveTo method).\r\n isForeign: function () {\r\n return this.source.$treeScope !== this.parent.$treeScope;\r\n },\r\n\r\n //Sets arguments passed to user callbacks.\r\n eventArgs: function (elements, pos) {\r\n return {\r\n source: this.sourceInfo,\r\n dest: {\r\n index: this.index,\r\n nodesScope: this.parent\r\n },\r\n elements: elements,\r\n pos: pos\r\n };\r\n },\r\n\r\n //Method that actually manipulates the node being moved.\r\n apply: function () {\r\n\r\n var nodeData = this.source.$modelValue;\r\n\r\n //Nodrop enabled on tree or parent\r\n if (this.parent.nodropEnabled || this.parent.$treeScope.nodropEnabled) {\r\n return;\r\n }\r\n\r\n //Node was dropped in the same place - do nothing.\r\n if (!this.isDirty()) {\r\n return;\r\n }\r\n\r\n //CloneEnabled and cross-tree so copy and do not remove from source.\r\n if (this.isClone() && this.isForeign()) {\r\n this.parent.insertNode(this.index, this.sourceInfo.cloneModel);\r\n //Any other case, remove and reinsert.\r\n } else {\r\n this.source.remove();\r\n this.parent.insertNode(this.index, nodeData);\r\n }\r\n }\r\n };\r\n },\r\n\r\n /**\r\n * @ngdoc method\r\n * @name ui.tree#height\r\n * @methodOf ui.tree.service:UiTreeHelper\r\n *\r\n * @description\r\n * Get the height of an element.\r\n *\r\n * @param {Object} element Angular element.\r\n * @returns {String} Height\r\n */\r\n height: function (element) {\r\n return element.prop('scrollHeight');\r\n },\r\n\r\n /**\r\n * @ngdoc method\r\n * @name ui.tree#width\r\n * @methodOf ui.tree.service:UiTreeHelper\r\n *\r\n * @description\r\n * Get the width of an element.\r\n *\r\n * @param {Object} element Angular element.\r\n * @returns {String} Width\r\n */\r\n width: function (element) {\r\n return element.prop('scrollWidth');\r\n },\r\n\r\n /**\r\n * @ngdoc method\r\n * @name ui.tree#offset\r\n * @methodOf ui.nestedSortable.service:UiTreeHelper\r\n *\r\n * @description\r\n * Get the offset values of an element.\r\n *\r\n * @param {Object} element Angular element.\r\n * @returns {Object} Object with properties width, height, top and left\r\n */\r\n offset: function (element) {\r\n var boundingClientRect = element[0].getBoundingClientRect();\r\n\r\n return {\r\n width: element.prop('offsetWidth'),\r\n height: element.prop('offsetHeight'),\r\n top: boundingClientRect.top + ($window.pageYOffset || $document[0].body.scrollTop || $document[0].documentElement.scrollTop),\r\n left: boundingClientRect.left + ($window.pageXOffset || $document[0].body.scrollLeft || $document[0].documentElement.scrollLeft)\r\n };\r\n },\r\n\r\n /**\r\n * @ngdoc method\r\n * @name ui.tree#positionStarted\r\n * @methodOf ui.tree.service:UiTreeHelper\r\n *\r\n * @description\r\n * Get the start position of the target element according to the provided event properties.\r\n *\r\n * @param {Object} e Event\r\n * @param {Object} target Target element\r\n * @returns {Object} Object with properties offsetX, offsetY, startX, startY, nowX and dirX.\r\n */\r\n positionStarted: function (e, target) {\r\n var pos = {},\r\n pageX = e.pageX,\r\n pageY = e.pageY;\r\n\r\n //Check to set correct data for TouchEvents\r\n if (e.originalEvent && e.originalEvent.touches && (e.originalEvent.touches.length > 0)) {\r\n pageX = e.originalEvent.touches[0].pageX;\r\n pageY = e.originalEvent.touches[0].pageY;\r\n }\r\n pos.offsetX = pageX - this.offset(target).left;\r\n pos.offsetY = pageY - this.offset(target).top;\r\n pos.startX = pos.lastX = pageX;\r\n pos.startY = pos.lastY = pageY;\r\n pos.nowX = pos.nowY = pos.distX = pos.distY = pos.dirAx = 0;\r\n pos.dirX = pos.dirY = pos.lastDirX = pos.lastDirY = pos.distAxX = pos.distAxY = 0;\r\n return pos;\r\n },\r\n\r\n positionMoved: function (e, pos, firstMoving) {\r\n\r\n var pageX = e.pageX,\r\n pageY = e.pageY,\r\n newAx;\r\n\r\n //If there are multiple touch points, choose one to use as X and Y.\r\n if (e.originalEvent && e.originalEvent.touches && (e.originalEvent.touches.length > 0)) {\r\n pageX = e.originalEvent.touches[0].pageX;\r\n pageY = e.originalEvent.touches[0].pageY;\r\n }\r\n\r\n //Mouse position last event.\r\n pos.lastX = pos.nowX;\r\n pos.lastY = pos.nowY;\r\n\r\n //Mouse position this event.\r\n pos.nowX = pageX;\r\n pos.nowY = pageY;\r\n\r\n //Distance mouse moved between events. \r\n pos.distX = pos.nowX - pos.lastX;\r\n pos.distY = pos.nowY - pos.lastY;\r\n\r\n //Direction mouse was moving. \r\n pos.lastDirX = pos.dirX;\r\n pos.lastDirY = pos.dirY;\r\n\r\n //Direction mouse is now moving (on both axis). \r\n pos.dirX = pos.distX === 0 ? 0 : pos.distX > 0 ? 1 : -1;\r\n pos.dirY = pos.distY === 0 ? 0 : pos.distY > 0 ? 1 : -1;\r\n\r\n //Axis mouse is now moving on. \r\n newAx = Math.abs(pos.distX) > Math.abs(pos.distY) ? 1 : 0;\r\n\r\n //Do nothing on first move.\r\n if (firstMoving) {\r\n pos.dirAx = newAx;\r\n pos.moving = true;\r\n return;\r\n }\r\n\r\n //Calc distance moved on this axis (and direction). \r\n if (pos.dirAx !== newAx) {\r\n pos.distAxX = 0;\r\n pos.distAxY = 0;\r\n } else {\r\n pos.distAxX += Math.abs(pos.distX);\r\n if (pos.dirX !== 0 && pos.dirX !== pos.lastDirX) {\r\n pos.distAxX = 0;\r\n }\r\n pos.distAxY += Math.abs(pos.distY);\r\n if (pos.dirY !== 0 && pos.dirY !== pos.lastDirY) {\r\n pos.distAxY = 0;\r\n }\r\n }\r\n pos.dirAx = newAx;\r\n },\r\n\r\n elementIsTreeNode: function (element) {\r\n return typeof element.attr('ui-tree-node') !== 'undefined';\r\n },\r\n\r\n elementIsTreeNodeHandle: function (element) {\r\n return typeof element.attr('ui-tree-handle') !== 'undefined';\r\n },\r\n elementIsTree: function (element) {\r\n return typeof element.attr('ui-tree') !== 'undefined';\r\n },\r\n elementIsTreeNodes: function (element) {\r\n return typeof element.attr('ui-tree-nodes') !== 'undefined';\r\n },\r\n elementIsPlaceholder: function (element) {\r\n return element.hasClass(treeConfig.placeholderClass);\r\n },\r\n elementIsDropzone: function (element) {\r\n return element.hasClass(treeConfig.dropzoneClass);\r\n },\r\n elementContainsTreeNodeHandler: function (element) {\r\n return element[0].querySelectorAll('[ui-tree-handle]').length >= 1;\r\n },\r\n treeNodeHandlerContainerOfElement: function (element) {\r\n return findFirstParentElementWithAttribute('ui-tree-handle', element[0]);\r\n }\r\n };\r\n }\r\n ]);\r\n\r\n // TODO: optimize this loop\r\n //(Jcarter): Suggest adding a parent element property on uiTree, then all these bubble\r\n // to can trigger to stop when they reach the parent.\r\n function findFirstParentElementWithAttribute(attributeName, childObj) {\r\n //Undefined if the mouse leaves the browser window\r\n if (childObj === undefined) {\r\n return null;\r\n }\r\n var testObj = childObj.parentNode,\r\n count = 1,\r\n //Check for setAttribute due to exception thrown by Firefox when a node is dragged outside the browser window\r\n res = (typeof testObj.setAttribute === 'function' && testObj.hasAttribute(attributeName)) ? testObj : null;\r\n while (testObj && typeof testObj.setAttribute === 'function' && !testObj.hasAttribute(attributeName)) {\r\n testObj = testObj.parentNode;\r\n res = testObj;\r\n //Stop once we reach top of page.\r\n if (testObj === document.documentElement) {\r\n res = null;\r\n break;\r\n }\r\n count++;\r\n }\r\n return res;\r\n }\r\n\r\n})();","function vhCaregiverMenu() {\r\n function controller($scope, $state, $window, $rootScope, CaregiverMenuService, ConfigurationsService, AuthorizationService, lodash) {\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $rootScope.$watch('caregiverId', function (newValue, oldValue) {\r\n if (newValue !== oldValue) {\r\n loadCaregiverInfo();\r\n }\r\n });\r\n\r\n $scope.logout = function () {\r\n AuthorizationService.logout().then(\r\n function (logoutUrl) {\r\n AuthorizationService.isAuthorized().then(\r\n function (isAuthorized) {\r\n $rootScope.isAuthorized = isAuthorized;\r\n $state.go('login');\r\n if(logoutUrl.length > 0) {\r\n $window.location.href = logoutUrl;\r\n }\r\n location.reload();\r\n },\r\n function (errorMessage) {\r\n location.reload();\r\n }\r\n );\r\n },\r\n function (errorMessage) {\r\n location.reload();\r\n }\r\n );\r\n };\r\n\r\n $scope.gotoProfile = function () {\r\n $state.go('caregivers.caregiver', { caregiverId: AuthorizationService.getCaregiver().Id });\r\n };\r\n\r\n loadCaregiverInfo();\r\n }\r\n\r\n function loadCaregiverInfo() {\r\n AuthorizationService.isAuthorized().then(function(isAuthorized){\r\n if(isAuthorized) {\r\n var caregiver = AuthorizationService.getCaregiver();\r\n if (caregiver !== null && caregiver !== undefined) {\r\n $scope.caregiver = caregiver;\r\n setPhoto(caregiver);\r\n\r\n //Do not show profile link if user is only a kit logistics user\r\n $scope.showProfileLink = true;\r\n ConfigurationsService.getConfig().then(function (data) {\r\n var config = data;\r\n });\r\n\r\n $scope.isAuthorized = true;\r\n }\r\n }\r\n });\r\n }\r\n\r\n function setPhoto(caregiver) {\r\n $scope.caregiverImage = caregiver.Photo;\r\n\r\n if ($scope.caregiverImage === undefined || $scope.caregiverImage === null || $scope.caregiverImage.length < 1) {\r\n if (caregiver.Gender === \"Female\") {\r\n $scope.caregiverImage = \"layout/img/female.png\";\r\n } else {\r\n $scope.caregiverImage = \"layout/img/male.png\";\r\n }\r\n } else {\r\n $scope.caregiverImage = \"data:image/png;base64,\" + caregiver.Photo;\r\n }\r\n }\r\n\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n templateUrl: 'components/vh-caregiver-menu/vh-caregiver-menu.tpl.html'\r\n };\r\n}\r\n\r\nangular.module('vh-caregiver-menu').directive('vhCaregiverMenu', vhCaregiverMenu);\r\n","function CaregiverMenuService($q, repository, AuthorizationService) {\r\n var caregiverRepo = repository.new('Caregiver');\r\n\r\n function GetCaregiver() {\r\n var q = $q.defer();\r\n\r\n var caregiverId = AuthorizationService.getCaregiver();\r\n if(caregiverId){\r\n caregiverRepo.get(caregiverId).then(function(response){\r\n var caregiver = response.data;\r\n q.resolve(caregiver);\r\n });\r\n }\r\n else{\r\n q.resolve(caregiverId);\r\n }\r\n\r\n return q.promise;\r\n }\r\n\r\n return {\r\n getCaregiver: GetCaregiver\r\n }\r\n}\r\n\r\nangular.module(\"vh-caregiver-menu\").service('CaregiverMenuService', CaregiverMenuService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-caregiver-menu/vh-caregiver-menu.tpl.html',\n '
  • \"Caregiver\" {{caregiver.Last_Name}}, {{caregiver.First_Name}}
  • ');\n}]);\n}(window, document, window.angular));","class vhExportDirective {\r\n constructor() {\r\n\r\n \r\n this.restrict = 'E';\r\n this.scope = {\r\n itemType: '@',\r\n ids: '=',\r\n singleId: '=',\r\n text: '@',\r\n exporting: '=',\r\n filename: '='\r\n };\r\n\r\n this.controllerAs = 'vm';\r\n this.controller = 'vhExportController';\r\n\r\n this.template = ()=>'';\r\n }\r\n \r\n}\r\n\r\nclass vhExportDirectiveIcon {\r\n constructor() {\r\n\r\n \r\n this.restrict = 'E';\r\n this.scope = {\r\n itemType: '@',\r\n ids: '=',\r\n text: '@',\r\n exporting: '=',\r\n filename: '='\r\n };\r\n\r\n this.controllerAs = 'vm';\r\n this.controller = 'vhExportController';\r\n\r\n this.template = ()=>'';\r\n }\r\n \r\n}\r\n\r\nlet urls = {\r\n rule : '/api/export/rules',\r\n cards: '/api/export/cards',\r\n tiles: '/api/export/librarytiles',\r\n program: '/api/export/programs'\r\n}\r\n\r\nclass vhExportController {\r\n\r\n constructor($scope, $http, vhSweetAlert){\r\n \r\n \r\n this.singleId = $scope.singleId;\r\n this.text = $scope.text;\r\n this.exported = $scope.exported;\r\n this.itemType = $scope.itemType;\r\n this.filename = $scope.filename;\r\n\r\n this.$http = $http;\r\n this.vhSweetAlert = vhSweetAlert;\r\n\r\n $scope.$watch('singleId', id => {\r\n this.singleId = id;\r\n this.ids = (this.ids && this.ids.length > 0) ? this.ids : this.singleId ? [this.singleId] : [];\r\n });\r\n\r\n\r\n\r\n $scope.$watch('ids', ids => {\r\n this.ids = ids;\r\n });\r\n\r\n $scope.$watch('singleId', id => {\r\n this.singleId = id;\r\n this.ids = (this.ids && this.ids.length > 0) ? this.ids : this.singleId ? [this.singleId] : [];\r\n });\r\n\r\n $scope.$watch('text', text => {\r\n this.text = text;\r\n });\r\n\r\n }\r\n\r\n export(){\r\n\r\n var _fileName = this.filename;\r\n\r\n function _extractFileName(headerContentDisposition) {\r\n\r\n var filename = _fileName;\r\n \r\n var disposition = headerContentDisposition;\r\n if (disposition && disposition.indexOf('attachment') !== -1) {\r\n\r\n var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\r\n var matches = filenameRegex.exec(filename || disposition);\r\n if (matches != null && matches[1]) { \r\n filename = matches[1].replace(/['\"]/g, '');\r\n }\r\n }\r\n\r\n return filename;\r\n }\r\n\r\n function _getFileObject(response){\r\n var headersFn = response.headers;\r\n var headers = headersFn();\r\n\r\n var filename = _extractFileName(headers['content-disposition']);\r\n var contentType = headers['content-type'];\r\n\r\n var data = response.data;\r\n\r\n return { filename, contentType, data};\r\n\r\n }\r\n\r\n var _post = (url, args)=>{\r\n return this.$http.post(url, JSON.stringify(args)).then(_getFileObject);\r\n }\r\n\r\n\r\n var _promise = null;\r\n\r\n if(urls[this.itemType])\r\n {\r\n _promise = _post(urls[this.itemType], Array.isArray(this.ids) ? this.ids : [this.ids]);\r\n }\r\n\r\n if(_promise)\r\n {\r\n _promise.then((file)=>{\r\n \r\n\r\n \r\n try {\r\n var a = document.createElement('a');\r\n\r\n var blob = new Blob([JSON.stringify(file.data)], { type: file.contentType });\r\n var url = window.URL.createObjectURL(blob); \r\n \r\n a.setAttribute('href', url);\r\n a.setAttribute(\"download\", file.filename);\r\n a.click(); \r\n a = null;\r\n\r\n var notifications = [];\r\n\r\n var pluralize = (word)=> {\r\n\r\n switch(`${word}`.toLowerCase()){\r\n case 'cards':\r\n case 'card':\r\n return 'Card(s)';\r\n case 'rules':\r\n case 'rule':\r\n return 'Rule(s)';\r\n case 'tiles':\r\n case 'tile':\r\n return 'Library tile(s)';\r\n case 'healthtips':\r\n case 'healthtip':\r\n return 'Healthtip(s)'; \r\n case 'populations':\r\n case 'population': \r\n case 'programs':\r\n case 'program':\r\n return 'Program(s)'; \r\n }\r\n\r\n return word;\r\n }\r\n\r\n for(var prop in file.data){\r\n if(prop.indexOf(this.itemType) > -1 && file.data && file.data[prop] && Array.isArray(file.data[prop]) && file.data[prop].length > 0)\r\n notifications.push(`${file.data[prop].length} ${pluralize(prop)}`);\r\n }\r\n\r\n this.vhSweetAlert.success('Exported', `Successfully exported ${notifications.join(', ')}.`); \r\n\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n\r\n \r\n })\r\n .catch((ex)=>{\r\n console.log(ex);\r\n })\r\n .finally(()=>{\r\n \r\n });\r\n \r\n }\r\n\r\n if(this.exporting){\r\n this.exporting(_promise || Promise.reject('Invalid export type.'));\r\n }\r\n }\r\n\r\n \r\n\r\n}\r\n\r\n\r\nangular.module(\"vh.components\").directive(\"vhExport\", ()=> new vhExportDirective());\r\nangular.module(\"vh.components\").directive(\"vhExportIcon\", ()=> new vhExportDirectiveIcon());\r\nangular.module('vh.components').controller('vhExportController',['$scope', '$http', 'vhSweetAlert', function($scope, $rootScope, vhSweetAlert){ return new vhExportController(...arguments) }]);\r\n\r\n","function CardImportPreview(){\r\n return { \r\n scope: {\r\n data: '=',\r\n items: '=',\r\n existingItem: '=',\r\n programs: '=',\r\n expanded: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/card-import-preview.tpl.html\",\r\n controllerAs: 'vm',\r\n controller: function($scope){\r\n \r\n $scope.$watch('expanded', value => {\r\n this.expanded = value == false ? false : true;\r\n });\r\n this.expanded = $scope.expanded == false ? false : true; \r\n this.data = $scope.data; \r\n this.items = this.data.cards;\r\n\r\n this.expandAll = (event)=>{\r\n event.stopPropagation();\r\n \r\n if(!this.expanded)\r\n this.expanded = true;\r\n\r\n this.items.forEach(item => item.expanded = true);\r\n }\r\n\r\n this.collapseAll = (event)=>{\r\n event.stopPropagation();\r\n this.items.forEach(item => item.expanded = false);\r\n }\r\n\r\n this.removeCard = (event, uid)=>{\r\n event.stopPropagation();\r\n var index = this.items.findIndex(x => x.cardUId == uid);\r\n if (index > -1) {\r\n $scope.removedSuccess = true;\r\n $scope.removeMsg = \"Successfully removed Pathway \" + uid + \".\";\r\n this.items.splice(index, 1);\r\n }\r\n }\r\n\r\n $scope.getProgramDisplay = (program)=>{\r\n var programs = $scope.programs;\r\n\r\n if(!program.populationUId)\r\n return null;\r\n\r\n var item = programs.find(x => x.populationUId == (program.programUId || program.populationUId));\r\n\r\n if(!item){\r\n return `${program.programName} is missing in this portal.`\r\n }\r\n\r\n if(item && item.populationName != program.programName){\r\n return `${program.programName} exists but is called ${item.populationName} in this portal.`\r\n }\r\n\r\n return program.programName;\r\n\r\n }\r\n \r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"cardImportPreview\", CardImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/card-import-preview.tpl.html',\n '
    Card(s): {{(vm.items || []).length}}
    {{removeMsg}}
    Card: {{item.name}}
    Programs:

    ');\n}]);\n}(window, document, window.angular));","function MissingImportPreview(){\r\n return { \r\n scope: {\r\n missing: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/missing-import-preview.tpl.html\",\r\n controllerAs: 'vm',\r\n controller: function($scope){\r\n \r\n \r\n this.missing = $scope.missing;\r\n this.missingObjects = [];\r\n for(var prop in this.missing){\r\n this.missingObjects.push(prop);\r\n }\r\n\r\n $scope.$watch('missing', data => {\r\n this.missing = data || {};\r\n this.missingObjects = [];\r\n for(var prop in this.missing){\r\n this.missingObjects.push(prop);\r\n }\r\n })\r\n\r\n\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"missingImportPreview\", MissingImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/missing-import-preview.tpl.html',\n ' 0\">
    The following data is not currently in this portal and will be created with this import.
    {{item}}
    {{row}}
    ');\n}]);\n}(window, document, window.angular));","function PathwaysImportPreview(){\r\n return { \r\n scope: {\r\n items: '=',\r\n expanded: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/pathways-import-preview.tpl.html\",\r\n controllerAs: 'vm',\r\n controller: function($scope, $filter, ScheduleService){\r\n\r\n $scope.$watch('expanded', value => {\r\n this.expanded = value == false ? false : true;\r\n });\r\n\r\n this.expanded = $scope.expanded == false ? false : true;\r\n this.items = $scope.items; \r\n\r\n this.expandAll = (event)=>{\r\n event.stopPropagation();\r\n \r\n if(!this.expanded)\r\n this.expanded = true;\r\n\r\n this.items.forEach(item => item.expanded = true);\r\n }\r\n\r\n this.collapseAll = (event)=>{\r\n event.stopPropagation();\r\n this.items.forEach(item => item.expanded = false);\r\n }\r\n\r\n this.removePathway = (event, uid)=>{\r\n event.stopPropagation();\r\n var index = this.items.findIndex(x => x.surveyTemplateUId == uid);\r\n if (index > -1) {\r\n $scope.removedSuccess = true;\r\n $scope.removeMsg = \"Successfully removed Pathway \" + uid + \".\";\r\n this.items.splice(index, 1);\r\n }\r\n }\r\n\r\n function _toAntiCamel(o){\r\n\r\n var newO, origKey, newKey, value\r\n if (o instanceof Array) {\r\n return o.map(function(value) {\r\n if (typeof value === \"object\") {\r\n value = _toAntiCamel(value)\r\n }\r\n return value\r\n })\r\n } else {\r\n newO = {}\r\n for (origKey in o) {\r\n if (o.hasOwnProperty(origKey)) {\r\n newKey = (origKey.charAt(0).toUpperCase() + origKey.slice(1) || origKey).toString()\r\n value = o[origKey]\r\n if (value instanceof Array || (value !== null && value.constructor === Object)) {\r\n value = _toAntiCamel(value)\r\n }\r\n newO[newKey] = value\r\n }\r\n }\r\n }\r\n return newO\r\n };\r\n\r\n $scope._toAntiCamel = _toAntiCamel;\r\n\r\n ScheduleService.getMilestones().then((response) => {\r\n this.milestones = response.data;\r\n \r\n }).then(()=>{\r\n this.items = $scope.items;\r\n\r\n \r\n\r\n\r\n });\r\n\r\n\r\n this.getGetMilestoneName = (milestoneId) => {\r\n var result = '';\r\n if(!this.milestones) {\r\n return result;\r\n }\r\n if(!milestoneId) {\r\n return result;\r\n };\r\n\r\n return (this.milestones.find(x => x.MilestoneId == milestoneId) || {}).Name || '';\r\n\r\n }\r\n\r\n \r\n \r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"pathwaysImportPreview\", PathwaysImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/pathways-import-preview.tpl.html',\n '
    Pathway(s): {{(vm.items || []).length}}
    {{removeMsg}}
    Pathway: {{item.name}}
    Display Order: {{item.promptOrder}}
    {{_toAntiCamel(item.surveySchedule) | schedule : vm.getMilestoneName(item.surveySchedule.milestoneId) }}
    ');\n}]);\n}(window, document, window.angular));","function ProgramImportPreview(){\r\n return { \r\n scope: {\r\n items: '=',\r\n expanded: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/program-import-preview.tpl.html\",\r\n controllerAs: 'vm',\r\n controller: function($scope, ConfigurationsService){\r\n \r\n\r\n $scope.$watch('expanded', value => {\r\n this.expanded = value == false ? false : true;\r\n });\r\n\r\n this.expanded = $scope.expanded === false ? false : true;\r\n this.items = $scope.items;\r\n\r\n \r\n this.expandAll = (event)=>{\r\n event.stopPropagation();\r\n \r\n if(!this.expanded)\r\n this.expanded = true;\r\n\r\n this.items.forEach(item => item.expanded = true);\r\n }\r\n\r\n this.collapseAll = (event)=>{\r\n event.stopPropagation();\r\n this.items.forEach(item => item.expanded = false);\r\n }\r\n\r\n $scope._toggleClass = value => value ? 'fa-toggle-on' : 'fa-toggle-off';\r\n\r\n this.getProgramPauseSetting = item => {\r\n \r\n switch (item.programPauseSetting) {\r\n case 1:\r\n //return the global setting\r\n return \"(\" + this.globalProgramPauseSetting + \")\";\r\n case 2:\r\n return \"Yes\";\r\n case 3:\r\n return \"No\"\r\n default:\r\n return null;\r\n }\r\n };\r\n\r\n this.removeProgram = (event, uid)=>{\r\n event.stopPropagation();\r\n var index = this.items.findIndex(x => x.populationUId == uid);\r\n if (index > -1) {\r\n $scope.removedSuccess = true;\r\n $scope.removeMsg = \"Successfully removed Program \" + uid + \".\";\r\n this.items.splice(index, 1);\r\n }\r\n }\r\n\r\n ConfigurationsService.getConfig().then((data) => {\r\n \r\n this.defaultHours = data.OverdueAlertHours;\r\n\r\n if (data.EnableOverDueAlerts === true) {\r\n this.globalAlerts = true\r\n }else{\r\n this.globalAlerts = false;\r\n }\r\n\r\n this.globalMessaging = data[\"PatientMessagingEnabled\"];\r\n this.globalProgramPauseSetting = data[\"ProgramDaysPauseWhenPatientIsInactive\"];\r\n\r\n\r\n\r\n \r\n });\r\n\r\n \r\n\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"programImportPreview\", ProgramImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/program-import-preview.tpl.html',\n '
    Program(s): {{(vm.items || []).length}}
    {{removeMsg}}
    Program: {{item.populationName}}
    DefaultEnabledEnable AlertsTablet RemindersPatient MessagesOverdue Alert HoursProgram PauseDays Til Non-Responder
    {{item.overdueAlertHours || \\'Default\\'}}{{item.daysTilNonResponder || 0}}
    ');\n}]);\n}(window, document, window.angular));","function QuestionCategoryImportPreview(){\r\n return { \r\n scope: {\r\n item: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/question-category-preview.tpl.html\",\r\n controllerAs: 'vm',\r\n controller: function($scope){\r\n \r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"questionCategoryImportPreview\", QuestionCategoryImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/question-category-preview.tpl.html',\n '

    Category: {{item.name}} ({{item.surveyQuestions.length}} questions)

    ');\n}]);\n}(window, document, window.angular));","function QuestionImportPreview(){\r\n return { \r\n scope: {\r\n data: '=',\r\n items: '=',\r\n expanded: '=',\r\n isHealthTip: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/question-preview.tpl.html\",\r\n controllerAs: 'vm',\r\n controller: function($scope){\r\n \r\n this.expanded = $scope.expanded == false ? false : true;\r\n this.data = $scope.data;\r\n this.items = this.data.healthTipQuestions; \r\n\r\n\r\n $scope.$watch('expanded', value => {\r\n this.expanded = value == false ? false : true;\r\n });\r\n \r\n \r\n this.expandAll = (event)=>{\r\n event.stopPropagation();\r\n \r\n if(!this.expanded)\r\n this.expanded = true;\r\n\r\n this.items.forEach(item => item.expanded = true);\r\n }\r\n\r\n this.collapseAll = (event)=>{\r\n event.stopPropagation();\r\n this.items.forEach(item => item.expanded = false);\r\n }\r\n\r\n this.removeHealthTip = (event, uid)=>{\r\n event.stopPropagation();\r\n \r\n if(ContainsKeyValue(this.data.pathways, \"surveyQuestionUId\", uid)){\r\n $scope.removedSuccess = false;\r\n $scope.removeMsg = \"Can't remove a Health Tip that is contained in a Pathway being imported.\";\r\n }\r\n else{\r\n var index = this.data.healthTips.findIndex(x => x.question.surveyQuestionUId == uid);\r\n if (index > -1) {\r\n $scope.removedSuccess = true;\r\n $scope.removeMsg = \"Successfully removed Health Tip \" + uid + \".\";\r\n this.data.healthTips.splice(index, 1);\r\n }\r\n \r\n var index2 = this.items.findIndex(x => x.surveyQuestionUId == uid);\r\n if (index2 > -1) {\r\n this.items.splice(index2, 1);\r\n }\r\n }\r\n }\r\n\r\n var ContainsKeyValue = function( obj, key, value ){\r\n if( obj[key] === value ) return true;\r\n for( all in obj )\r\n {\r\n if( obj[all] != null && obj[all][key] === value ){\r\n return true;\r\n }\r\n if( typeof obj[all] == \"object\" && obj[all]!= null ){\r\n var found = ContainsKeyValue( obj[all], key, value );\r\n if( found == true ) return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n const surveyQuestionType = {\r\n BloodSugar:\t1,\r\n BloodPressure: 2,\r\n PulseOx: 3,\r\n Weight:\t4,\r\n Number:\t5,\r\n SingleSelection: 6,\r\n MultiSelection:\t7,\r\n HealthTip:\t8,\r\n Video:\t9,\r\n Yes_No:\t10,\r\n Temperature: 11,\r\n Spirometer:\t13,\r\n Pulse:\t14,\r\n Oxygen:\t15,\r\n Steps:\t16,\r\n CustomResponse:\t17,\r\n HbA1c:\t18,\r\n ControlInhaler:\t19,\r\n RescueInhaler:\t20,\r\n Sleep:\t21\r\n };\r\n\r\n $scope.getOptionHtml = ($index, questionType, option) => {\r\n if (option && option.optionTexts)\r\n {\r\n var html = option.optionTexts['en'];\r\n switch (questionType) {\r\n case surveyQuestionType.HealthTip:\r\n return html;\r\n default:\r\n return `${$index + 1}. ${html}`;\r\n }\r\n }\r\n };\r\n\r\n $scope.getQuestionText = (question) => {\r\n if (question.surveyQuestionTypeId == 8) return question.name;\r\n question.questionTexts = question.questionTexts || {};\r\n return question.questionTexts['en'];\r\n };\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"questionImportPreview\", QuestionImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/question-preview.tpl.html',\n '
    {{isHealthTip ? \\'Health Tip(s)\\' : \\'Question(s)\\'}}: {{(vm.items || []).length}}
    {{removeMsg}}
    {{isHealthTip ? \\'Health Tip\\' : \\'Question\\'}}
    ');\n}]);\n}(window, document, window.angular));","function RuleImportPreview(){\r\n return { \r\n scope: {\r\n import: '=',\r\n expanded: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/rule-import-preview.tpl.html\",\r\n controllerAs: 'vm',\r\n controller: function($scope, ruleEventTypes, ruleActionTypes, surveyStatuses, patientStatuses, cardTypes, GoDevicesService){\r\n\r\n $scope.$watch('expanded', value => {\r\n this.expanded = value == false ? false : true;\r\n });\r\n\r\n this.import = $scope.import;\r\n\r\n this.expanded = $scope.expanded === false ? false : true;\r\n\r\n this.expandAll = (event)=>{\r\n event.stopPropagation();\r\n \r\n if(!this.expanded)\r\n this.expanded = true;\r\n\r\n this.import.rules.forEach(item => item.expanded = true);\r\n }\r\n\r\n this.collapseAll = (event)=>{\r\n event.stopPropagation();\r\n this.import.rules.forEach(item => item.expanded = false);\r\n }\r\n\r\n this.removeRule = (event, uid)=>{\r\n event.stopPropagation();\r\n var index = this.import.rules.findIndex(x => x.ruleUId == uid);\r\n if (index > -1) {\r\n $scope.removedSuccess = true;\r\n $scope.removeMsg = \"Successfully removed Rule \" + uid + \".\";\r\n this.import.rules.splice(index, 1);\r\n }\r\n }\r\n\r\n \r\n }\r\n };\r\n}\r\n\r\nangular\r\n .module(\"vh.components\")\r\n .directive(\"ruleImportPreview\", RuleImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/rule-import-preview.tpl.html',\n '
    Rule(s): {{vm.import.rules.length}}
    {{removeMsg}}
    Rule: 0 }\">{{item.name || item.display}} Conditions ({{item.conditionCount}}) Actions ({{item.actionCount}})
    0 }\">
    ElseIf ({{condition.condition}}) Actions ({{condition.ruleActions.length}})
    0 }\">{{action.actionDescription}}
    {{error}}
    ');\n}]);\n}(window, document, window.angular));","function TileImportPreview(){\r\n return { \r\n scope: {\r\n data: '=',\r\n items: '=',\r\n existingItems: '=',\r\n programs: '=',\r\n videos: '=' ,\r\n healthTips: '=',\r\n expanded: '=' \r\n },\r\n transclude: true,\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/tile-import-preview.tpl.html\",\r\n controllerAs: 'vm',\r\n controller: function($scope){ \r\n \r\n $scope.$watch('expanded', value => {\r\n this.expanded = value == false ? false : true;\r\n });\r\n \r\n this.expanded = $scope.expanded == false ? false : true;\r\n this.data = $scope.data; \r\n this.items = this.data.tiles; \r\n \r\n\r\n \r\n this.expandAll = (event)=>{\r\n event.stopPropagation();\r\n \r\n if(!this.expanded)\r\n this.expanded = true;\r\n\r\n this.items.forEach(item => item.expanded = true);\r\n }\r\n\r\n this.collapseAll = (event)=>{\r\n event.stopPropagation();\r\n this.items.forEach(item => item.expanded = false);\r\n }\r\n\r\n this.removeTile = (event, item)=>{\r\n event.stopPropagation();\r\n var index = this.items.findIndex(x => x == item);\r\n if (index > -1) {\r\n $scope.removedSuccess = true;\r\n $scope.removeMsg = \"Successfully removed tile \" + item.resourceLibraryCategoryUId + \".\";\r\n this.items.splice(index, 1);\r\n }\r\n }\r\n\r\n var ContainsKeyValue = function( obj, key, value ){\r\n if( obj[key] === value ) return true;\r\n for( all in obj )\r\n {\r\n if( obj[all] != null && obj[all][key] === value ){\r\n return true;\r\n }\r\n if( typeof obj[all] == \"object\" && obj[all]!= null ){\r\n var found = ContainsKeyValue( obj[all], key, value );\r\n if( found == true ) return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n $scope.getVideo = videoUId => {\r\n return ($scope.videos || []).find(x => x.videoUId == videoUId);\r\n };\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"tileImportPreview\", TileImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/tile-import-preview.tpl.html',\n '
    Library Tile(s): {{(vm.items || []).length}}
    {{removeMsg}}
    Library Tile: {{item.name}}
    {{resource.name}}
    Duration: {{resource.duration}}
    {{resource.name}}
    Duration: {{resource.duration}}
    ');\n}]);\n}(window, document, window.angular));","function VideoImportPreview(){\r\n return { \r\n scope: {\r\n data: '=',\r\n items: \"=\",\r\n languages: '=',\r\n expanded: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/previews/video-import-preview.tpl.html\",\r\n controllerAs: \"vm\",\r\n controller: function($scope){\r\n\r\n $scope.$watch('expanded', value => {\r\n this.expanded = value == false ? false : true;\r\n });\r\n this.expanded = $scope.expanded == false ? false : true;\r\n this.data = $scope.data; \r\n this.items = this.data.videos;\r\n\r\n this.expandAll = (event)=>{\r\n event.stopPropagation();\r\n \r\n if(!this.expanded)\r\n this.expanded = true;\r\n\r\n this.items.forEach(item => item.expanded = true);\r\n }\r\n\r\n this.collapseAll = (event)=>{\r\n event.stopPropagation();\r\n this.items.forEach(item => item.expanded = false);\r\n }\r\n\r\n this.removeVideo = (event, uid)=>{\r\n event.stopPropagation();\r\n\r\n if(ContainsKeyValue(this.data.pathways, \"videoUId\", uid)){\r\n $scope.removedSuccess = false;\r\n $scope.removeMsg = \"Can't remove a video that is contained in a Pathway being imported.\";\r\n }\r\n else{\r\n var index = this.items.findIndex(x => x.videoUId == uid);\r\n if (index > -1) {\r\n $scope.removedSuccess = true;\r\n $scope.removeMsg = \"Successfully removed tile \" + uid + \".\"; \r\n this.items.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n var ContainsKeyValue = function( obj, key, value ){\r\n if( obj[key] === value ) return true;\r\n for( all in obj )\r\n {\r\n if( obj[all] != null && obj[all][key] === value ){\r\n return true;\r\n }\r\n if( typeof obj[all] == \"object\" && obj[all]!= null ){\r\n var found = ContainsKeyValue( obj[all], key, value );\r\n if( found == true ) return true;\r\n }\r\n }\r\n return false;\r\n }\r\n \r\n $scope.getLanguageName = languageId => (($scope.languages || []).find(x => x.LanguageId == languageId) || {}).Name;\r\n\r\n $scope.getThumbnail = (video, file) => {\r\n\r\n var thumbnail = video.thumbnails.find(x => x.languageId == file.languageId) || { getURL: ()=> '/content/video_thumbnail.png' };\r\n return thumbnail.getURL();\r\n }\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"videoImportPreview\", VideoImportPreview);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/previews/video-import-preview.tpl.html',\n '
    Video(s): {{(vm.items || []).length}}
    {{removeMsg}}
    Video: {{item.name}}
    Video Provider: {{item.contentProviderName}}
    Files:
    File NameDurationLanguageThumbnail
    {{file.fileName}}{{file.videoLengthSeconds | secondsToDateTime | date:\\'mm:ss\\'}}{{file.language}}
    ');\n}]);\n}(window, document, window.angular));","class ImportExportModel {\r\n\r\n constructor(entity = {}) {\r\n function getURL(){\r\n if((this.cdnThumbnailUrl || '').length > 0){\r\n return this.cdnThumbnailUrl;\r\n }\r\n if((this.thumbnailData || '').length > 0){\r\n return 'data:image/png;base64,' + this.thumbnailData;\r\n }\r\n return '/content/video_thumbnail.png';\r\n };\r\n\r\n entity = entity;\r\n\r\n this.exportedBy = entity.exportedBy || entity.ExportedBy;\r\n this.exportedFrom = entity.exportedFrom || entity.ExportedFrom;\r\n this.exportedDateTime_UTC = entity.exportedDateTime_UTC || entity.ExportedDateTime_UTC;\r\n\r\n this.cards = (entity.cards || entity.Cards || []);\r\n this.overwrite = entity.overwrite == null ? true : entity.overwrite;\r\n this.questions = ( entity.questions || entity.Questions || []);\r\n this.videos = (entity.videos || entity.Videos || []);\r\n this.videos.forEach(v => {\r\n v.thumbnails.forEach(x => x.getURL = ()=>{ return getURL.call(x); })\r\n });\r\n this.tiles = (entity.tiles || entity.Tiles || []);\r\n this.healthTips = (entity.healthTips || entity.HealthTips || []);\r\n\r\n this.healthTipQuestions = [];\r\n if(this.healthTips.length > 0){\r\n for(var i = 0; i < this.healthTips.length; i++) {\r\n this.healthTipQuestions.push(this.healthTips[i].question);\r\n }\r\n }\r\n\r\n this.rules = (entity.rules || entity.Rules || []);\r\n this.pathways = (entity.pathways || entity.Pathways || []);\r\n this.programs = (entity.programs || entity.Programs || []);\r\n\r\n }\r\n\r\n hasData(){\r\n return this.cards && this.cards.length;\r\n }\r\n\r\n getImport(){\r\n \r\n var value = JSON.parse(JSON.stringify(this));\r\n\r\n value.cards = (value.cards || []);\r\n value.cards.forEach(x => {\r\n x.overwrite = x.overwrite || this.overwrite;\r\n delete x.Card;\r\n x.cardId = x.overwrite ? x.cardId : -1;\r\n x.cardUId = x.overwrite ? x.cardUId : null;\r\n x.cardContents = (x.cardContents || []);\r\n x.programs = (x.programs || []);\r\n x.availableLanguages = (x.availableLanguages || []);\r\n });\r\n\r\n value.videos = (value.videos || []);\r\n value.videos.forEach(x => {\r\n x.overwrite = x.overwrite || this.overwrite;\r\n x.videoUId = x.overwrite ? x.videoUId : null;\r\n x.videoFiles = (x.videoFiles || []);\r\n });\r\n\r\n value.tiles = (value.tiles || []);\r\n value.pathways = (value.pathways || []);\r\n value.programs = (value.programs || []); \r\n\r\n return value;\r\n }\r\n}\r\n\r\n\r\nconst importTypes = {\r\n card : 1,\r\n video: 2,\r\n surveyQuestion: 3,\r\n healthTip: 4,\r\n libraryTile: 5,\r\n rule: 6\r\n};\r\n\r\nclass ImportController {\r\n\r\n\r\n constructor(CardsService, VideosService, CategoriesService, ResourceLibraryService, HealthTipsService, RulesService, EditConfigurationsService, $scope, $rootScope, settings, ruleEventTypes, ruleActionTypes, surveyStatuses, patientStatuses, cardTypes, GoDevicesService, ResponseTransformers) {\r\n\r\n this.sectionSort = [\r\n 'program',\r\n 'healthtip',\r\n 'video',\r\n 'card', \r\n 'rule', \r\n 'pathway',\r\n 'libraryTile'\r\n\r\n ];\r\n\r\n this.errors = [];\r\n\r\n this.$rootScope = $rootScope;\r\n this.$scope = $scope;\r\n this.settings = settings();\r\n\r\n this.sectionSort = [this.settings.itemType].concat(this.sectionSort.filter( x => x != this.settings.itemType));\r\n\r\n this.showSelectFile = true;\r\n this.showInvalidFile = false;\r\n this.showFileData = false;\r\n \r\n this.CardsService = CardsService;\r\n this.VideosService = VideosService;\r\n this.CategoriesService = CategoriesService;\r\n this.ResourceLibraryService = ResourceLibraryService;\r\n this.HealthTipsService = HealthTipsService;\r\n this.RulesService = RulesService;\r\n this.EditConfigurationsService = EditConfigurationsService;\r\n\r\n this.eventTypes = ruleEventTypes; \r\n this.actionTypes = ruleActionTypes; \r\n this.surveyStatuses = surveyStatuses;\r\n this.patientStatuses = patientStatuses; \r\n this.cardTypes = cardTypes; \r\n this.GoDevicesService = GoDevicesService;\r\n this.ResponseTransformers = ResponseTransformers;\r\n\r\n this.active = importTypes[this.settings.itemType] || 1;\r\n\r\n this.expandAll = false;\r\n\r\n this.modal = this.settings.modal;\r\n this.data = {};\r\n this.isValid = true;\r\n this.loading = false;\r\n this.contentRemoved = false;\r\n this.existing = [];\r\n this.getValidationData = Promise.resolve([]);\r\n\r\n this.missingData = {};\r\n\r\n this.getValidationData = \r\n this.settings.itemType == 'card' ? CardsService.getValidationData() :\r\n this.settings.itemType == 'libraryTile' ? ResourceLibraryService.getValidationData()\r\n : Promise.resolve({});\r\n \r\n this.getValidationData.then(data => {\r\n this.languages = data.languages || []; \r\n this.programs = data.programs || [];\r\n this.milestones = data.milestones || [];\r\n this.videos = data.videos || [];\r\n });\r\n\r\n\r\n \r\n this.fileUploader = this.CardsService.getFileUploader();\r\n\r\n this.handleFileSelect = this.handleFileSelect.bind(this);\r\n\r\n this.modal.opened.then(_ => {\r\n window.setTimeout(_ => {\r\n document\r\n .getElementById(\"importFile\")\r\n .addEventListener(\"change\", this.handleFileSelect, false);\r\n }, 500);\r\n });\r\n }\r\n\r\n \r\n\r\n\r\n findCard(uid){\r\n return this.cards.find(x => x.cardUId == uid);\r\n }\r\n\r\n itemTypeIs(){\r\n var args = [...arguments];\r\n if(Array.isArray(args)){\r\n return args.find(x => x === this.settings.itemType) != null;\r\n }\r\n return false;\r\n }\r\n\r\n ok() {\r\n this.uploading = true;\r\n\r\n var localData = new ImportExportModel(JSON.parse(JSON.stringify(this.data))).getImport();\r\n \r\n var promises = [\r\n this.itemTypeIs('card') && this.data && this.data.cards ? this.CardsService.importCards(localData) : Promise.resolve([]),\r\n this.itemTypeIs('video') && this.data && this.data.videos ? this.VideosService.importVideos(localData) : Promise.resolve([]),\r\n this.itemTypeIs('surveyQuestion') && this.data && this.data.questions ? this.CategoriesService.importQuestionCategories(localData) : Promise.resolve([]),\r\n this.itemTypeIs('healthTip') && this.data && this.data.healthTipQuestions ? this.HealthTipsService.importHealthTips(localData) : Promise.resolve([]),\r\n this.itemTypeIs('libraryTile') && this.data && this.data.tiles ? this.ResourceLibraryService.importResourceLibraryCategories(localData) : Promise.resolve([]),\r\n this.itemTypeIs('rule') && this.data && this.data.rules ? this.RulesService.importRules(localData) : Promise.resolve([]),\r\n this.itemTypeIs('program') && this.data && this.data.rules ? this.EditConfigurationsService.importPrograms(localData) : Promise.resolve([])\r\n ];\r\n\r\n Promise.all(promises)\r\n .then(data => {\r\n \r\n for(var i = 0; i < data.length; i++)\r\n data[i] = (data[i].data || data[i]);\r\n\r\n data = data.map(x => x).flat();\r\n \r\n \r\n if(this.itemTypeIs('card'))\r\n this.$rootScope.$emit('vh:coachcardsupdated');\r\n\r\n this.uploading = false;\r\n var results = [].concat(...data);\r\n \r\n this.modal.close(results);\r\n });\r\n\r\n \r\n }\r\n\r\n cancel() {\r\n this.exportedBy = null;\r\n this.exportedFrom = null;\r\n this.exportedDateTime_UTC = null;\r\n\r\n this.data = {};\r\n this.modal.dismiss(\"cancel\");\r\n }\r\n\r\n hasData(){\r\n var hasData = this.data != null && !this.uploading;\r\n\r\n switch (this.settings.itemType) {\r\n case 'card':\r\n return hasData && (this.data.cards || []).length > 0;\r\n case 'video':\r\n return hasData && (this.data.videos || []).length > 0;\r\n case 'libraryTile':\r\n return hasData && (this.data.tiles || []).length > 0;\r\n case 'healthTip':\r\n return hasData && (this.data.healthTipQuestions || []).length > 0;\r\n case 'rules':\r\n return hasData && (this.data.rules || []).length > 0;\r\n case 'program':\r\n return hasData && (this.data.programs || []).length > 0;\r\n }\r\n\r\n return hasData;\r\n }\r\n\r\n enableOkButton() {\r\n return this.hasData() && (!this.errors || this.errors.length == 0);\r\n }\r\n\r\n removeAllContent(){\r\n this.data.pathways = [];\r\n this.data.cards = [];\r\n this.data.videos = [];\r\n this.data.tiles = [];\r\n this.data.healthTipQuestions = [];\r\n this.data.healthTips = [];\r\n this.contentRemoved = true;\r\n }\r\n \r\n handleFileSelect(evt) {\r\n var vm = this;\r\n vm.isValid = true;\r\n\r\n var validate = () => {\r\n \r\n if(this.settings.itemType == 'libraryTile'){\r\n \r\n this.getValidationData.then(data =>{\r\n\r\n var importingUIds = this.data.videos.map(x => x.videoUId);\r\n var missingUIds = importingUIds.filter(x => data.videos.find(v => v.videoUId == x) == null);\r\n var missingVideos = this.data.videos.filter(x => missingUIds.find(id => id == x.videoUId)).map(x => x.name);\r\n \r\n var missingData = {};\r\n if(missingVideos.length > 0)\r\n missingData['Videos'] = [...new Set(missingVideos)];\r\n\r\n this.missingData = missingData;\r\n \r\n window.setTimeout(()=>{\r\n vm.$scope.$parent.$apply();\r\n }, 500);\r\n })\r\n\r\n }\r\n\r\n\r\n };\r\n \r\n\r\n function _toCamel(o){\r\n var self = this;\r\n var newO, origKey, newKey, value\r\n if (o instanceof Array) {\r\n return o.map(function(value) {\r\n if (typeof value === \"object\") {\r\n value = _toCamel(value)\r\n }\r\n return value\r\n })\r\n } else {\r\n newO = {}\r\n for (origKey in o) {\r\n if (o.hasOwnProperty(origKey)) {\r\n newKey = (origKey.charAt(0).toLowerCase() + origKey.slice(1) || origKey).toString()\r\n value = o[origKey]\r\n if (value instanceof Array || (value !== null && value.constructor === Object)) {\r\n value = _toCamel(value)\r\n }\r\n newO[newKey] = value\r\n }\r\n }\r\n }\r\n return newO\r\n }\r\n\r\n\r\n \r\n\r\n vm.data = {};\r\n\r\n var files = evt.target.files; // FileList object\r\n\r\n for (var i = 0, f; (f = files[i]); i++) {\r\n\r\n var reader = new FileReader();\r\n\r\n reader.addEventListener('loadstart', ()=>{ \r\n vm.loading = true;\r\n vm.$scope.$parent.$apply();\r\n });\r\n\r\n reader.addEventListener('loadend', ()=>{ \r\n vm.loading = false;\r\n validate();\r\n vm.$scope.$parent.$apply();\r\n });\r\n\r\n // Closure to capture the file information.\r\n reader.onload = (function(theFile) {\r\n return function(e) {\r\n var data = vm.ResponseTransformers.transform$Ref(e.target.result);\r\n vm.errors = [];\r\n\r\n Promise.all([vm.GoDevicesService.GetAllEnabled(), vm.RulesService.getSQLCommands()]).then((promises) => {\r\n\r\n var deviceModels = promises[0];\r\n var sqlCommands = promises[1];\r\n\r\n if (data.rules) {\r\n data.rules.forEach(rule => {\r\n rule.conditionCount = rule.ruleConditions.length;\r\n\r\n var actions = [];\r\n\r\n rule.ruleConditions.forEach(condition => {\r\n actions = actions.concat(condition.ruleActions);\r\n })\r\n\r\n rule.actionCount = actions.length;\r\n\r\n actions.forEach(action => {\r\n action.actionDescription = (vm.actionTypes.find(x => x.value == action.actionName) || {}).name || 'Unknown';\r\n\r\n action.actionData = (action.actionData || '').length == 0 ? '{}' : action.actionData;\r\n\r\n var actionData = JSON.parse(action.actionData);\r\n\r\n action.errors = [];\r\n\r\n var pathway = null;\r\n var pathwayName = 'Unknown';\r\n\r\n if(actionData.TemplateUId)\r\n pathway = (data.pathways || []).find(x => x.surveyTemplateUId == actionData.TemplateUId);\r\n\r\n pathwayName = (pathway || {}).name || pathwayName;\r\n\r\n switch(action.actionName){\r\n case 'AddPathwayAction':\r\n action.actionDescription = action.actionDescription.replace('pathway', 'pathway (' + pathwayName + ')');\r\n\r\n if(!pathway)\r\n action.errors.push(`Unable to find pathway (${data.TemplateUId || 'null'}) in import file.`);\r\n\r\n break;\r\n case 'ChangePathwayStatusAction':\r\n action.actionDescription = action.actionDescription.replace('pathway', 'pathway (' + pathwayName + ')');\r\n action.actionDescription += ' (';\r\n action.actionDescription += (vm.surveyStatuses.find(x => x.value == actionData.SurveyStatusId) || {}).name || 'Unknown';\r\n action.actionDescription += ')';\r\n\r\n if(!pathway)\r\n action.errors.push(`Unable to find pathway (${actionData.TemplateUId || 'null'})`);\r\n\r\n if(!vm.surveyStatuses.find(x => x.value == actionData.SurveyStatusId))\r\n action.errors.push(`Unable to find survey status (${actionData.SurveyStatusId || 'null'})`);\r\n\r\n break;\r\n case 'AddPatientAlertAction':\r\n action.actionDescription = action.actionDescription.replace('alert', 'alert (' + actionData.AlertText + ')');\r\n break;\r\n case 'ExecuteSQLCommandAction':\r\n action.actionDescription += `: ${actionData.DisplayText || ''}`;\r\n if (!sqlCommands.find(x => x.RuleSQLCommandUId == actionData.RuleSQLCommandUId)) {\r\n action.errors.push(`SQL command not found in this portal: (${actionData.RuleSQLCommandUId}) ${actionData.DisplayText}.`)\r\n }\r\n break;\r\n case 'ChangePatientProgramAction':\r\n // action.actionDescription = action.actionDescription.replace('alert', 'alert (' + data.AlertText + ')');\r\n break;\r\n case 'ChangePatientStatusAction':\r\n action.actionDescription += ' (';\r\n action.actionDescription += (vm.patientStatuses.find(x => x.value == actionData.StatusId) || {}).name || 'Unknown';\r\n action.actionDescription += ')';\r\n\r\n if(!vm.patientStatuses.find(x => x.value == actionData.StatusId))\r\n action.errors.push(`Unable to find patient status (${actionData.StatusId || 'null'})`);\r\n\r\n break;\r\n case 'AddPatientCardAction':\r\n case 'ReplacePatientCardAction':\r\n case 'RemovePatientCardAction':\r\n action.actionDescription = action.actionDescription.replace('card', 'card (' + ((vm.cardTypes.find(x => x.value == actionData.CardTypeId) || {}).name || 'Unknown') + ')');\r\n\r\n if(action.actionName != 'RemovePatientCardAction'){\r\n switch(actionData.CardTypeId){\r\n case 3:\r\n action.actionDescription += ' with (';\r\n action.actionDescription += ((data.videos || []).find(x => actionData.SurveyVideoUId && x.videoUId == actionData.SurveyVideoUId) || {}).name || 'Unknown';\r\n action.actionDescription += ')';\r\n\r\n if(!(data.videos || []).find(x => actionData.SurveyVideoUId && x.videoUId == actionData.SurveyVideoUId))\r\n action.errors.push(`Unable to find Video (${actionData.SurveyVideoUId || 'null'}) in import file.`);\r\n break;\r\n\r\n case 4:\r\n action.actionDescription += ' with (';\r\n var healthTipQuestion = ((data.healthTips || []).find(x => actionData.HealthTipUId && x.question.surveyQuestionUId == actionData.HealthTipUId) || {}).question;\r\n action.actionDescription += healthTipQuestion ? healthTipQuestion.name : 'Unknown';\r\n action.actionDescription += ')';\r\n\r\n if(!(data.healthTips || []).find(x => actionData.HealthTipUId && x.question.surveyQuestionUId == actionData.HealthTipUId))\r\n action.errors.push(`Unable to find Healthtip (${actionData.HealthTipUId || 'null'}) in import file.`);\r\n break;\r\n\r\n case 5:\r\n var card = (data.cards || []).find(x => actionData.CardUId && x.cardUId == actionData.CardUId);\r\n action.actionDescription += ' with (';\r\n action.actionDescription += (card || {}).name || 'Unknown';\r\n action.actionDescription += ')';\r\n\r\n if(!card)\r\n action.errors.push(`Unable to find coach card (${actionData.CardUId || 'null'}) in import file.`);\r\n break;\r\n }\r\n }\r\n\r\n break;\r\n case 'AddLibraryTileAction':\r\n action.actionDescription = action.actionDescription.replace('library tile', `library tile (${((data.tiles || []).find(x => x.resourceLibraryCategoryUId == actionData.LibraryCategoryUId) || {}).name || 'Unknown'})`)\r\n\r\n if(!(data.tiles || []).find(x => x.resourceLibraryCategoryUId == actionData.LibraryCategoryUId))\r\n action.errors.push(`Unable to find library tile (${actionData.LibraryCategoryUId || 'null'})`);\r\n break;\r\n case 'RemoveLibraryTileAction':\r\n action.actionDescription = action.actionDescription.replace('library tile', `library tile (${((data.tiles || []).find(x => x.resourceLibraryCategoryUId == actionData.LibraryCategoryUId) || {}).name || 'Unknown'})`)\r\n\r\n if(!(data.tiles || []).find(x => x.resourceLibraryCategoryUId == actionData.LibraryCategoryUId))\r\n action.errors.push(`Unable to find library tile (${actionData.LibraryCategoryUId || 'null'})`);\r\n break;\r\n case 'SendEmailRuleAction':\r\n action.actionDescription += ' (' + (actionData.Subject || 'No Subject') + ')';\r\n break;\r\n case 'ManagePatientDeviceAction':\r\n action.actionDescription += ' (' + actionData.ManageDeviceAction + ' ' + (actionData.DeviceModelId || 'Unknown') + ')';\r\n break;\r\n case 'ManagePatientTagAction': \r\n action.actionDescription += ' (' + actionData.ManageTagAction + ' ' + (actionData.Tag || 'Unknown') + ')';\r\n break;\r\n }\r\n\r\n\r\n vm.errors = vm.errors.concat(action.errors);\r\n });\r\n });\r\n\r\n var actions = data.rules.map(x => x.ruleConditions).flat().map(x => x.ruleActions).flat()\r\n .filter(x => x.actionName == 'ManagePatientDeviceAction'\r\n || ((x.actionName == 'AddPatientCardAction'\r\n || x.actionName == 'ReplacePatientCardAction'\r\n || x.actionName == 'RemovePatientCardAction') && JSON.parse(x.actionData).CardTypeId == 2)\r\n );\r\n\r\n var distinct = (value,index,self)=>self.indexOf(value) === index;\r\n\r\n actions.forEach(action => {\r\n var data = JSON.parse(action.actionData);\r\n\r\n action.errors = action.errors || [];\r\n\r\n action.actionDescription = (vm.actionTypes.find(x => x.value == action.actionName) || {}).name || 'Unknown';\r\n\r\n action.actionDescription = action.actionDescription.replace('card', `card (${(vm.cardTypes.find(x => x.value == data.CardTypeId) || {}).name})`)\r\n\r\n var device = (deviceModels.find(x => x.DeviceModelId == (data.DeviceModelId || data.DeviceModelEnumId)) || {}).DeviceName || 'Unknown';\r\n\r\n action.actionDescription += ' (' + ( (data.ManageDeviceAction || '') + ' ' + device).trim() + ')';\r\n\r\n if(!deviceModels.find(x => x.DeviceModelId == (data.DeviceModelId || data.DeviceModelEnumId)))\r\n action.errors.push(`Device ${(data.DeviceModelId || data.DeviceModelEnumId)} not found or not enabled in this portal.`)\r\n\r\n vm.errors = vm.errors.concat(action.errors);\r\n\r\n vm.errors = vm.errors.filter(distinct);\r\n });\r\n\r\n data.rules.forEach(rule =>{\r\n\r\n rule.ruleConditions.forEach(x => {\r\n x.ruleActions.forEach(a => a.errors = a.errors.filter(distinct));\r\n x.errors = (x.ruleActions.map(a => a.errors) || []).flat().filter(distinct) ;\r\n });\r\n\r\n rule.errors = (rule.ruleConditions.map(c => c.errors) || []).flat().filter(distinct) ;\r\n })\r\n }\r\n });\r\n\r\n if(vm.settings.itemType == 'card' && Array.isArray(data)){\r\n data = _toCamel({ cards: data })\r\n data.cards.forEach( card => {\r\n card.programs = card.programs || card.populations;\r\n card.programs.forEach(p => {\r\n p.programId = p.programId || p.populationId;\r\n p.programUId = p.programUId || p.populationUId; \r\n p.programName = p.programName || p.populationName; \r\n });\r\n })\r\n }\r\n\r\n vm.data = new ImportExportModel(data);\r\n\r\n if(!vm.data)\r\n vm.isValid = false;\r\n \r\n if(vm.data){\r\n vm.isValid = (vm.itemTypeIs('card') && vm.data.cards && vm.data.cards.length > 0) //card check\r\n || (vm.itemTypeIs('video') && vm.data.videos && vm.data.videos.length > 0) //video check\r\n || (vm.itemTypeIs('surveyQuestion') && vm.data.questions && vm.data.questions.length > 0) //surveyQuestion check\r\n || (vm.itemTypeIs('healthTip') && vm.data.healthTipQuestions && vm.data.healthTipQuestions.length > 0) //healthTip check\r\n || (vm.itemTypeIs('libraryTile') && vm.data.tiles && vm.data.tiles.length > 0) //libraryTile check\r\n || (vm.itemTypeIs('rule') && vm.data.rules && vm.data.rules.length > 0) //rules check\r\n || (vm.itemTypeIs('program') && vm.data.programs && vm.data.programs.length > 0) //programs check\r\n ; \r\n\r\n vm.showSelectFile = false;\r\n\r\n vm.showFileData = vm.isValid;\r\n\r\n vm.showInvalidFile = !vm.isValid;\r\n\r\n \r\n if(vm.itemTypeIs('card')){\r\n vm.getValidationData.then(data =>{\r\n \r\n var allCards = data.cards;\r\n vm.existing = [];\r\n vm.data.cards.forEach(card => {\r\n vm.existing.push(allCards.find(x => x.cardUId == card.cardUId));\r\n });\r\n\r\n });\r\n }\r\n\r\n }\r\n };\r\n })(f);\r\n\r\n // Read in the image file as a data URL.\r\n reader.readAsText(f);\r\n }\r\n \r\n }\r\n}\r\n\r\nfunction ImportControllerFactory(CardsService, VideosService, CategoriesService, ResourceLibraryService, HealthTipsService, RulesService, EditConfigurationsService, $scope, $rootScope, settings, ruleEventTypes, ruleActionTypes, surveyStatuses, patientStatuses, cardTypes, GoDevicesService, ResponseTransformers) {\r\n return new ImportController(...arguments);\r\n}\r\n\r\nangular\r\n .module(\"vh.components\")\r\n .controller(\"ImportController\", ImportControllerFactory);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/vh-import-modal.tpl.html',\n '

    Import

    Invalid Import File

    {{vm.progress}}%

    Loading...

    Exported From:
    Exported By:
    Exported Date Time:{{vm.data.exportedDateTime_UTC | datetime : \\'datetime\\'}}
    0\" class=\"alert alert-danger\">
    {{item}}
    Invalid file.
    Please select a file.
    The following data is in the import file.
    0\" items=\"vm.data.programs\"> 0\" import=\"vm.data\"> 0\" items=\"vm.data.pathways\"> 0\" data=\"vm.data\" existing-items=\"vm.existing\" videos=\"vm.data.videos\" health-tips=\"vm.healthTipQuestions\"> 0\" data=\"vm.data\" programs=\"vm.programs\"> 0\" data=\"vm.data\" languages=\"vm.languages\"> 0\" is-health-tip=\"true\" data=\"vm.data\">
    ');\n}]);\n}(window, document, window.angular));","function VhImportDirective($uibModal, $rootScope, vhSweetAlert){\r\n return { \r\n scope: {\r\n itemType: '@',\r\n mode: '@',\r\n text: '@',\r\n imported: '='\r\n },\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-import/vh-import.tpl.html\",\r\n controller: function($scope){\r\n \r\n $scope.mode = $scope.mode || 'button';\r\n\r\n $scope.onClick = ($event)=>{\r\n $event.stopPropagation();\r\n\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'components/vh-import/vh-import-modal.tpl.html',\r\n controller: 'ImportController as vm',\r\n backdrop: 'static',\r\n size: 'md',\r\n resolve: {\r\n settings : function () {\r\n return function(){\r\n return {\r\n modal: modalInstance,\r\n itemType: $scope.itemType \r\n }; \r\n };\r\n }\r\n }\r\n });\r\n \r\n modalInstance.result.then(function (data) {\r\n \r\n var alertMessage = '';\r\n\r\n if((data.cards && data.cards.length > 0) || (data.Cards && data.Cards.length > 0)){\r\n alertMessage += `${(data.cards || data.Cards).length} card${((data.cards || data.Cards).length > 1 ? 's were' : ' was')} successfully imported.`;\r\n $rootScope.$emit('vh:coachcardsupdated');\r\n }\r\n\r\n if(Array.isArray(data)){\r\n var pluralize = (word, count) => {\r\n\r\n switch(`${word}`.toLowerCase())\r\n {\r\n case 'rule':\r\n return 'Rule(s)';\r\n case 'card':\r\n return 'Card(s)';\r\n case 'video':\r\n return 'Video(s)'; \r\n case 'program':\r\n return 'Program(s)'; \r\n case 'health tip':\r\n return 'Health Tip(s)'; \r\n case 'library tile category':\r\n return 'Library Tile(s)'; \r\n case 'pathway':\r\n return 'Pathways(s)'; \r\n case 'milestone':\r\n return 'Milestone(s)'; \r\n }\r\n \r\n\r\n return word;\r\n }\r\n\r\n data.forEach(result => {\r\n \r\n if(result.updated > 0)\r\n alertMessage += `Successfully updated ${result.updated} ${pluralize(result.category, result.updated)}.
    ` \r\n \r\n if(result.added > 0)\r\n alertMessage += `Successfully added ${result.added} ${pluralize(result.category, result.added)}.
    ` \r\n\r\n });\r\n }\r\n\r\n if(alertMessage.length > 0){\r\n vhSweetAlert.success({html: true, title :'Imported', text: alertMessage, confirmButtonText: 'OK', cancelButtonText: 'Cancel'});\r\n }\r\n\r\n if($scope.imported)\r\n $scope.imported();\r\n\r\n }, function () {\r\n });\r\n\r\n };\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.components\").directive(\"vhImport\", VhImportDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-import/vh-import.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function vhLanguageTabsDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-language/vh-language-tabs.tpl.html\",\r\n scope: {\r\n languages: \"=\",\r\n usedLanguages: \"=?\",\r\n language: \"=\",\r\n onSelectionChange: \"&\"\r\n },\r\n link: function (scope, elm, attr) {\r\n scope.displayLanguages = scope.usedLanguages;\r\n var allLanguages = scope.languages;\r\n scope.language = scope.language || scope.languages[0];\r\n scope.unusedLanguages = [];\r\n if (scope.displayLanguages && scope.displayLanguages.length != allLanguages.length) {\r\n var displayedIds = lodash.pluck(scope.displayLanguages, \"LanguageId\");\r\n scope.unusedLanguages = lodash.filter(allLanguages, function (l) {\r\n return !lodash.contains(displayedIds, l.LanguageId);\r\n });\r\n } else {\r\n scope.displayLanguages = allLanguages;\r\n }\r\n if ( scope.displayLanguages != undefined){\r\n scope.displayLanguages[0].active = true;\r\n }\r\n\r\n // HACK: onselecteion change is called on load, double clicking on the same language tab causes content to sometimes reload/ switch\r\n // We only want to change tabs /content if a new tab is selected\r\n var load = 0;\r\n scope.selectLanguage = function (newLanguage) {\r\n if(scope.language.LanguageId == undefined && newLanguage.LanguageId == scope.language) return;\r\n\r\n if(scope.language.LanguageId == newLanguage.LanguageId && load > 0) return;\r\n \r\n scope.language = newLanguage;\r\n scope.onSelectionChange({selectedLanguageId: scope.language.LanguageId});\r\n newLanguage.active = true;\r\n load++;\r\n };\r\n\r\n scope.addLanguage = function (language) {\r\n scope.displayLanguages.push(language);\r\n lodash.remove(scope.unusedLanguages,language);\r\n scope.language = language;\r\n scope.onSelectionChange({selectedLanguageId: language.LanguageId});\r\n language.active = true;\r\n };\r\n }\r\n };\r\n}\r\nangular.module(\"vh.language\").directive(\"vhLanguageTabs\", vhLanguageTabsDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-language/vh-language-tabs.tpl.html',\n '
  • 0\">
  • ');\n}]);\n}(window, document, window.angular));","function LanguageDirective() {\r\n return {\r\n restrict: \"A\",\r\n require: \"ngModel\",\r\n link: function (scope, elem, attrs, ngModelController) {\r\n scope.currentLanguage = 'en';\r\n ngModelController.$render = function () {\r\n scope.currentLanguage = ngModelController.$viewValue;\r\n }\r\n },\r\n controller: function ($scope) {\r\n this.scope = $scope;\r\n }\r\n }\r\n}\r\nangular.module(\"vh.language\").directive(\"vhLanguage\", LanguageDirective);\r\n","function vhListItemOptionInfo($timeout, $filter,ConfigurationRepository, EditConfigurationsService,PatientChartService) {\r\n return {\r\n restrict: \"E\",\r\n require: [\"^optionContainer\", \"?^vhListItemOptions\", \"?^vhLanguage\",\"?^vhSlider\"],\r\n templateUrl: \"components/vh-list-item/vh-list-item-option-info.tpl.html\",\r\n scope: {\r\n optionSelected: \"&\",\r\n isReason: \"=\",\r\n isSubReason: \"=\",\r\n itemType: \"=?\"\r\n },\r\n link: function (scope, elem, attrs, ctrls) {\r\n var listOptionsController = ctrls[1];\r\n var optionContainerController = ctrls[0];\r\n scope.option = optionContainerController.option;\r\n scope.option.maxlength = scope.option.maxlength || 100; // default\r\n scope.option.descriptionMaxlength = scope.option.descriptionMaxlength || 255; // default\r\n scope.optionid = scope.option.id;\r\n scope.saveToMedicalHistory = optionContainerController.option.saveToMedicalHistory;\r\n scope.enableNotes = optionContainerController.option.enableNotes;\r\n scope.requireNotes = optionContainerController.option.requireNotes;\r\n scope.saveToMedicalHistory = optionContainerController.option.saveToMedicalHistory;\r\n scope.showDefault = attrs.showDefault !== undefined;\r\n scope.editable = attrs.editable !== undefined;\r\n scope.hasDescription = attrs.hasDescription !== undefined;\r\n scope.descriptionSpacer = attrs.descriptionSpacer;\r\n scope.enabledatetimepicker = attrs.enabledatetimepicker !== undefined;\r\n scope.enableWriteToChart = attrs.enablewritetochart !== undefined;\r\n\r\n if(attrs.customToggle !== undefined){\r\n scope.option.customToggle = scope.option.customToggle || false;\r\n scope.customToggleLabel = attrs.customToggleLabel;\r\n }\r\n \r\n scope.editableLabel = scope.editable && attrs.genLabel === undefined;\r\n scope.noEnabling = attrs.noEnabling !== undefined;\r\n scope.showEnableNotes = attrs.enableNotes !== undefined;\r\n scope.showRequireNotes = attrs.requireNotes !== undefined;\r\n scope.showSaveToMedicalHistory = attrs.saveToMedicalHistory !== undefined;\r\n\r\n scope.savePatientStatusPMHSlider = function savePatientStatusPMHSlider(){\r\n scope.option.saveToMedicalHistory = !scope.option.saveToMedicalHistory;\r\n listOptionsController.optionEnabledChanged(scope.option);\r\n };\r\n\r\n scope.savePatientStatusEnableNotes = function savePatientStatusEnableNotes(){\r\n scope.option.enableNotes = !scope.option.enableNotes;\r\n scope.option.requireNotes = false; //set default off\r\n scope.requireNotes = false; \r\n listOptionsController.optionEnabledChanged(scope.option);\r\n };\r\n\r\n scope.savePatientStatusRequireNotes = function savePatientStatusRequireNotes(){\r\n if(scope.option.enableNotes || scope.enableNotes) { \r\n scope.option.requireNotes = !scope.option.requireNotes;\r\n listOptionsController.optionEnabledChanged(scope.option);\r\n }\r\n };\r\n\r\n scope.saveToMedicalHistoryBool = function(){\r\n return scope.saveToMedicalHistory === true;\r\n };\r\n\r\n if (scope.option.temp) {\r\n scope.option.label = scope.option.label || \"New Provider\";\r\n if (attrs.customAdd !== undefined) {\r\n listOptionsController.selectOption(scope.option);\r\n } else {\r\n scope.option.label = \"\";\r\n scope.labelForm.$show();\r\n }\r\n }\r\n\r\n if (scope.option.labelFilter) {\r\n scope.$watch('option.label', function (newValue) {\r\n scope.filteredLabel = $filter(scope.option.labelFilter)(scope.option.label);\r\n });\r\n } else {\r\n scope.$watch('option.label', function() {\r\n scope.filteredLabel = scope.option.label;\r\n });\r\n }\r\n\r\n scope.selectOption = function (event) {\r\n if (!angular.element(event.currentTarget).hasClass(\"option-level\")) {\r\n return;\r\n }\r\n scope.optionSelected({option:scope.option});\r\n listOptionsController.selectOption(scope.option);\r\n };\r\n\r\n scope.defaultToggled = function () {\r\n if (scope.option.enabled && !scope.option.temp) {\r\n listOptionsController.optionDefaultToggled(scope.option);\r\n }\r\n };\r\n\r\n scope.customSliderToggled = function(id, value) {\r\n scope.option.customToggle = value;\r\n listOptionsController.optionEnabledChanged(scope.option);\r\n };\r\n\r\n scope.enabledToggled = function () {\r\n if (scope.option.temp !== undefined) {\r\n return;\r\n }\r\n scope.option.enabled = !scope.option.enabled;\r\n listOptionsController.optionEnabledChanged(scope.option);\r\n };\r\n\r\n scope.setTimePicker = function(id, value){\r\n scope.option.canbackdate =value;\r\n savepicker(scope.option.label,scope.option.canbackdate);\r\n };\r\n\r\n scope.setWriteToChart = function(){\r\n scope.option.writetochart= !scope.option.writetochart;\r\n saveWriteToChart(scope.option.label,scope.option.writetochart);\r\n };\r\n\r\n function savepicker(status,canbackdate){\r\n ConfigurationRepository.canBackDate(status,canbackdate);\r\n }\r\n\r\n function saveWriteToChart(status,writetochart){\r\n ConfigurationRepository.WriteToChart(status,writetochart);\r\n \r\n }\r\n\r\n scope.labelChanged = function (newLabel) {\r\n if (!newLabel || newLabel.length < 1 || newLabel === scope.option.label) {\r\n return false;\r\n }\r\n scope.option.label = newLabel;\r\n listOptionsController.optionLabelChanged(scope.option, newLabel);\r\n };\r\n\r\n scope.descriptionChanged = function (newDescription) {\r\n if (!newDescription || newDescription.length < 1 || newDescription === scope.option.description) {\r\n return false;\r\n }\r\n scope.option.description = newDescription;\r\n listOptionsController.optionDescriptionChanged(scope.option, newDescription);\r\n };\r\n\r\n scope.cancelEdit = function () {\r\n if (scope.option.temp && attrs.customAdd === undefined) {\r\n listOptionsController.cancel(scope.option);\r\n }\r\n };\r\n\r\n scope.showEnableNotes = function () {\r\n return scope.option && scope.option.enabled && scope.showEnableNotes && (scope.isSubReason || (scope.isReason && scope.option.options && scope.option.options.filter(o => o.enabled).length == 0));\r\n }\r\n\r\n scope.showRequireNotes = function () {\r\n return scope.option && scope.option.enabled && scope.enableNotes && scope.showRequireNotes && (scope.isSubReason || (scope.isReason && scope.option.options && scope.option.options.filter(o => o.enabled).length == 0));\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"vh-list-item\").directive(\"vhListItemOptionInfo\", vhListItemOptionInfo);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-list-item/vh-list-item-option-info.tpl.html',\n '
    {{option.label || \\'(no option)\\'}} {{filteredLabel}} {{option.label || \\'(no option)\\'}} ({{option.abbreviation}}) {{descriptionSpacer}} {{option.description || \\'(no description)\\'}} {{descriptionSpacer}} {{option.description || \\'(no description)\\'}} disabled
    {{option.options.length}}
    Enable
    Code:{{option.code}}
    ');\n}]);\n}(window, document, window.angular));","function vhListItemOptionsDirective(lodash, $q) {\r\n return {\r\n restrict: \"E\",\r\n require: [\"^vhListItem\", \"?^optionContainer\"],\r\n scope: {\r\n itemOptions: \"=?\",\r\n optionChanged: \"&\",\r\n optionAdded: \"&\",\r\n languages: \"=\",\r\n tabOptions: \"=?\"\r\n },\r\n transclude: true,\r\n templateUrl: 'components/vh-list-item/vh-list-item-options.tpl.html',\r\n link: function ($scope, e, a, cs) {\r\n if (cs[1] != null && $scope.itemOptions == undefined) {\r\n $scope.itemOptions = cs[1].option.options;\r\n $scope.parentOption = cs[1].option;\r\n }\r\n $scope.editable = a.editable !== undefined;\r\n $scope.static = a.static !== undefined;\r\n $scope.newOptionLabel = '';\r\n $scope.multilingual = $scope.languages !== undefined;\r\n $scope.sortable = a.sortable !== undefined;\r\n $scope.noAdd = a.noAdd !== undefined;\r\n \r\n if ($scope.multilingual) {\r\n lodash($scope.itemOptions).map(function (o) {\r\n o.languageId = 1;\r\n languageSwitchedMap(o);\r\n }).value();\r\n\r\n $scope.optionLanguages = $scope.languages;\r\n $scope.selectedLanguage = 1;\r\n }\r\n\r\n if($scope.tabOptions) {\r\n $scope.itemOptions.forEach(function(o) {\r\n o.parent = $scope.parentOption;\r\n });\r\n $scope.$watch('parentOption.selected', function() {\r\n if($scope.parentOption.selected === true && typeof $scope.tabOptions.reset !== 'undefined') {\r\n $scope.tabOptions.reset();\r\n }\r\n });\r\n }\r\n\r\n $scope.ordering = a.orderBy;\r\n\r\n var displayLanguageIds = lodash($scope.itemOptions).pluck(\"labels\").flatten().pluck(\"languageId\").uniq().value();\r\n var languages = lodash.filter($scope.languages, function (l) {\r\n return lodash.contains(displayLanguageIds, l.LanguageId);\r\n });\r\n if (languages.length === 0) {\r\n $scope.displayLanguages = [lodash.find($scope.languages, {LanguageId: 1})];\r\n }\r\n\r\n function languageSwitchedMap(o) {\r\n var text = lodash.find(o.labels, {languageId: o.languageId}) || {label: '', languageId: o.languageId};\r\n o.label = text.label;\r\n }\r\n\r\n $scope.showOptions = function () {\r\n return cs[1] == null || cs[1].option.selected;\r\n\r\n };\r\n\r\n $scope.getDisplayLanguages = function (option) {\r\n return $scope.displayLanguages;\r\n };\r\n\r\n $scope.selectLanguage = function (languageId) {\r\n $scope.cancelAddOption();\r\n $scope.selectedLanguage = languageId;\r\n lodash.map($scope.itemOptions, function (o) {\r\n o.languageId = languageId;\r\n var text = lodash.find(o.labels, {languageId: o.languageId}) || {\r\n label: undefined,\r\n languageId: o.languageId\r\n };\r\n o.label = text.label;\r\n });\r\n\r\n };\r\n\r\n $scope.selectTab = function (tabId) {\r\n $scope.cancelAddOption();\r\n $scope.selectedTab = tabId;\r\n\r\n $scope.itemOptions.forEach(function (o) {\r\n o.visible = o.tabId === tabId;\r\n if(!o.visible) {\r\n o.selected = false;\r\n }\r\n });\r\n };\r\n\r\n $scope.subdragControlListeners = {\r\n accept: function (sourceItemHandleScope, destSortableScope) {\r\n return sourceItemHandleScope.itemScope.sortableScope.$id === destSortableScope.$id;\r\n },\r\n orderChanged: function (event) {\r\n var option = event.source.itemScope.option;\r\n var oldIndex = event.source.index;\r\n var newIndex = event.dest.index;\r\n if (oldIndex !== newIndex) {\r\n if (!$scope.parentOption) {\r\n option.sortOrder = newIndex + 1;\r\n } else {\r\n var sortOrder = 1;\r\n $scope.parentOption.options.forEach(opt => {\r\n if (opt.sortOrder != sortOrder) {\r\n opt.sortOrder = sortOrder;\r\n $scope.optionChanged({ option: opt, parent: $scope.parentOption });\r\n }\r\n sortOrder++;\r\n });\r\n }\r\n }\r\n }\r\n };\r\n\r\n $scope.clickedAddOption = function () {\r\n if (!lodash.any($scope.itemOptions, {temp: true})) {\r\n var option = {\r\n parent: $scope.parentOption,\r\n enabled: true,\r\n label: \" \",\r\n description: \"\",\r\n temp: true\r\n };\r\n\r\n if($scope.selectedTab) {\r\n option.tabId = $scope.selectedTab;\r\n }\r\n\r\n $scope.itemOptions.push(option);\r\n }\r\n };\r\n\r\n $scope.cancelAddOption = function () {\r\n lodash.remove($scope.itemOptions, {temp: true});\r\n };\r\n\r\n $scope.addOption = function (label) {\r\n if (!label || label.length < 1) {\r\n $scope.cancelAddOption();\r\n return false;\r\n }\r\n $scope.newOptionLabel = label;\r\n var addingResponse = $scope.optionAdded({addedName: label, parent: $scope.parentOption});\r\n $q.when(addingResponse).then(function () {\r\n $scope.cancelAddOption();\r\n });\r\n };\r\n },\r\n controller: function ($scope) {\r\n this.selectOption = function (option) {\r\n var isSelected = option.selected;\r\n\r\n lodash.map($scope.itemOptions, function (o) {\r\n o.selected = false;\r\n return o;\r\n });\r\n\r\n if (option.temp) {\r\n option.selected = true;\r\n } else {\r\n option.selected = !isSelected;\r\n $scope.cancelAddOption();\r\n }\r\n\r\n };\r\n\r\n this.optionDefaultToggled = function (option) {\r\n if (option.isDefault) {\r\n option.isDefault = false;\r\n } else {\r\n lodash.map($scope.itemOptions, function (o) {\r\n o.isDefault = false;\r\n return o;\r\n });\r\n option.isDefault = true;\r\n }\r\n $scope.optionChanged({option: option, parent: $scope.parentOption});\r\n\r\n };\r\n\r\n this.optionLabelChanged = function (option, newLabel) {\r\n if (option.temp) {\r\n $scope.addOption(newLabel);\r\n } else {\r\n if ($scope.multilingual) {\r\n var label = lodash.find(option.labels, {languageId: option.languageId});\r\n if (label) {\r\n label.label = newLabel;\r\n } else {\r\n option.labels.push({\r\n languageId: option.languageId,\r\n label: newLabel\r\n });\r\n }\r\n }\r\n $scope.optionChanged({option: option, parent: $scope.parentOption});\r\n }\r\n\r\n };\r\n\r\n this.optionEnabledChanged = function (option) { //reusing for multiple sliders\r\n $scope.optionChanged({option: option, parent: $scope.parentOption}); //from config tpl cvm.changedStatusReason\r\n };\r\n\r\n this.optionDescriptionChanged = function (option) {\r\n $scope.optionChanged({option: option, parent: $scope.parentOption});\r\n };\r\n\r\n this.cancel = function (option) {\r\n if (option.temp) {\r\n $scope.cancelAddOption();\r\n }\r\n\r\n };\r\n\r\n this.add = function (option) {\r\n\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"vh-list-item\")\r\n .directive(\"vhListItemOptions\", vhListItemOptionsDirective)\r\n .directive(\"optionContainer\", function () {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n option: \"=\",\r\n clicked:\"&\"\r\n },\r\n transclude: true,\r\n template: '
    ',\r\n controller: function ($scope) {\r\n $scope.optionClicked = function(){\r\n $scope.$parent.selectedOption($scope.option);\r\n };\r\n this.option = $scope.option;\r\n this.updateLabel = function (label) {\r\n this.option.label = label;\r\n $scope.option.label = label;\r\n };\r\n }\r\n };\r\n })\r\n .directive(\"vhListItemOption\", function () {\r\n return {\r\n restrict: \"E\",\r\n require: \"^optionContainer\",\r\n transclude: true,\r\n template: \"\",\r\n link: function (scope, elem, attrs, optionContainer) {\r\n scope.option = optionContainer.option;\r\n\r\n scope.updateLabel = function (label) {\r\n optionContainer.option.label = label;\r\n };\r\n }\r\n }\r\n });\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-list-item/vh-list-item-options.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function vhListItemDirective () {\r\n function controller($scope, $element, $timeout) {\r\n\r\n // Options\r\n $scope.optionsIsOpen = false;\r\n\r\n $scope.optionsToggle = function () {\r\n $scope.optionsIsOpen = !$scope.optionsIsOpen;\r\n };\r\n\r\n // Patient selection\r\n $scope.selected = false;\r\n\r\n $scope.select = function () {\r\n console.log( 'vhListItem.select()' );\r\n $scope.selected = true;\r\n };\r\n\r\n $scope.selectToggle = function () {\r\n\r\n console.log( 'vhListItem.selectToggle()' );\r\n\r\n $scope.selected = !$scope.selected;\r\n };\r\n\r\n // Add select listener\r\n $scope.$on( 'selectAll', function ( e ) {\r\n console.log( 'Selecting All' );\r\n $scope.selected = true;\r\n } );\r\n\r\n $scope.$on( 'selectNone', function ( e ) {\r\n console.log( 'Selecting None' );\r\n $scope.selected = false;\r\n });\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n transclude: true,\r\n scope: {\r\n item: \"=item\"\r\n },\r\n templateUrl: 'components/vh-list-item/vh-list-item.tpl.html',\r\n };\r\n}\r\nangular.module(\"vh-list-item\").directive( 'vhListItem', vhListItemDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-list-item/vh-list-item.tpl.html',\n '
    {{item.label}} disabled
    {{item.description}}
    ');\n}]);\n}(window, document, window.angular));","function vhListTabsDirective() {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-list-item/vh-list-tabs.tpl.html\",\r\n scope: {\r\n tabOptions: \"=\",\r\n onSelectionChange: \"&\",\r\n selectedTab: \"=\"\r\n },\r\n link: function (scope, elm, attr) {\r\n var selectedTab = scope.tabOptions.tabs[0];\r\n selectedTab.active = true;\r\n\r\n scope.tabOptions.reset = function() {\r\n selectedTab.active = false;\r\n scope.tabOptions.tabs[0].active = true;\r\n selectedTab = scope.tabOptions.tabs[0];\r\n };\r\n\r\n scope.selectTab = function(tab) {\r\n selectedTab = tab;\r\n scope.onSelectionChange({selectedTab: tab.id});\r\n };\r\n }\r\n }\r\n}\r\nangular.module(\"vh-list-item\").directive(\"vhListTabs\", vhListTabsDirective);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-list-item/vh-list-tabs.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","function vhMultiselect() {\r\n return {\r\n restrict: 'E',\r\n templateUrl: 'components/vh-multiselect/vh-multiselect.tpl.html',\r\n bindToController: true,\r\n controllerAs: 'ctrl',\r\n require: \"ngModel\",\r\n transclude: true,\r\n\r\n scope: {\r\n options: '=',\r\n optionLabel: '@',\r\n key: '@',\r\n placeholder: '@',\r\n searchEnabled: '=?',\r\n onActionClick: '&'\r\n },\r\n\r\n link: function (scope, elem, attrs, ngModelController) {\r\n if (!ngModelController) return;\r\n\r\n scope.ctrl.init(ngModelController);\r\n\r\n ngModelController.$isEmpty = function(value) {\r\n if (angular.isArray(value)) return value.length === 0;\r\n return angular.isUndefined(value) || value === null || value === '' || isNaN(value);\r\n };\r\n },\r\n\r\n controller: function ($scope, $element, $attrs, $timeout) {\r\n const self = this;\r\n this.searchEnabled = !!this.searchEnabled;\r\n this.searchText = '';\r\n this.selectedOptions = [];\r\n this.customActions = [];\r\n this.status = {\r\n isOpen: false\r\n };\r\n\r\n this.init = function(ngModel) {\r\n self.dropdownWidth = $element[0].clientWidth - 20;\r\n self.ngModel = ngModel;\r\n\r\n //Watch for external model changes \r\n $scope.$watchCollection(function() { return self.ngModel.$modelValue; }, function(newValue, oldValue) {\r\n self.selectedOptions = angular.isDefined(newValue) ? newValue : [];\r\n });\r\n }\r\n\r\n this.inputKeydown = function($event) {\r\n switch ($event.keyCode) {\r\n case 9: // close on tab\r\n self.status.isOpen = false;\r\n break;\r\n case 13: // toggle dropdown on enter\r\n if (self.searchText.length === 0) {\r\n self.status.isOpen = !self.status.isOpen;\r\n if (!self.status.isOpen) {\r\n $timeout(self.focus, 0); // focus on close\r\n }\r\n }\r\n break;\r\n case 27:\r\n if (self.status.isOpen) {\r\n $timeout(self.focus, 0); // focus on close\r\n }\r\n break;\r\n }\r\n }\r\n\r\n this.toggled = function(isOpen) {\r\n if (!isOpen && self.ngModel) {\r\n self.ngModel.$setTouched();\r\n self.searchText = '';\r\n }\r\n if (isOpen) {\r\n self.focusSearchInput();\r\n }\r\n }\r\n\r\n this.getSelections = function() {\r\n if (self.selectedOptions.length === 0) {\r\n return self.placeholder;\r\n }\r\n\r\n return self.selectedOptions.map(o => o[self.optionLabel]).join(', ');\r\n }\r\n\r\n this.isOptionSelected = function(option) {\r\n if (self.key) {\r\n return self.selectedOptions.findIndex(o => o[self.key] == option[self.key]) >= 0;\r\n }\r\n return self.selectedOptions.includes(option);\r\n }\r\n\r\n this.addSelection = function(option) {\r\n if (!self.isOptionSelected(option)) {\r\n self.selectedOptions.push(option);\r\n self.updateModel();\r\n }\r\n }\r\n\r\n this.removeSelection = function(option) {\r\n const index = self.key ? self.selectedOptions.findIndex(o => o[self.key] == option[self.key]) : self.selectedOptions.indexOf(option);\r\n if (index < 0) return undefined;\r\n let removedItem = self.selectedOptions.splice(index, 1);\r\n self.updateModel();\r\n return removedItem;\r\n }\r\n\r\n this.updateModel = function() {\r\n self.ngModel.$setViewValue(self.selectedOptions.slice());\r\n }\r\n\r\n this.selectOption = function(option, $event) {\r\n self.addSelection(option);\r\n self.status.isOpen = false;\r\n }\r\n\r\n this.toggleOption = function(option, $event) {\r\n $event.stopPropagation();\r\n\r\n if ($event.target.checked) {\r\n self.addSelection(option);\r\n } else {\r\n self.removeSelection(option);\r\n }\r\n }\r\n\r\n this.focus = function() {\r\n var el = $element[0].querySelector(\"div.vh-multiselect .vh-multiselect-input\");\r\n el.focus();\r\n }\r\n\r\n this.focusSearchInput = function() {\r\n if (self.searchEnabled) {\r\n var searchEl = $element[0].querySelector(\"div.vh-multiselect input[type='search']\");\r\n if (searchEl) searchEl.focus();\r\n }\r\n }\r\n\r\n this.search = function() {\r\n if (self.searchText.length > 0) {\r\n self.searchText = '';\r\n }\r\n self.focusSearchInput();\r\n }\r\n\r\n this.addCustomAction = function(action) {\r\n self.customActions.push(action);\r\n }\r\n\r\n this.removeCustomAction = function(action) {\r\n const index = self.customActions.indexOf(action);\r\n if (index >= 0) {\r\n self.customActions.splice(index, 1);\r\n }\r\n }\r\n\r\n this.actionClicked = function(action, $event) {\r\n if (self.onActionClick) {\r\n self.onActionClick({$action: action, $event: $event});\r\n if ($event.isDefaultPrevented()) {\r\n return;\r\n }\r\n }\r\n if (action && angular.isFunction(action.onClick)) {\r\n action.onClick({$event: $event});\r\n }\r\n if (!$event.isDefaultPrevented()) {\r\n self.status.isOpen = false;\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nfunction vhMultiselectAction() {\r\n return {\r\n restrict: 'E',\r\n require: \"^^vhMultiselect\",\r\n scope: {\r\n icon: '@',\r\n label: '@',\r\n onClick: '&'\r\n },\r\n link: function (scope, elem, attrs, ctrl) {\r\n const action = {\r\n icon: scope.icon,\r\n label: scope.label,\r\n onClick: scope.onClick\r\n };\r\n\r\n ctrl.addCustomAction(action);\r\n\r\n scope.$on('$destroy', function () {\r\n ctrl.removeCustomAction(action);\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('vh.components')\r\n .directive('vhMultiselect', vhMultiselect)\r\n .directive('vhMultiselectAction', vhMultiselectAction);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-multiselect/vh-multiselect.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","function VhPageInfo() {\r\n return {\r\n restrict: \"E\",\r\n require: \"^vhPaging\",\r\n templateUrl: \"components/vh-paging/vh-page-info.tpl.html\",\r\n link: function (scope, elem, attrs, vhPaging) {\r\n scope.vhPaging = vhPaging.scope;\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.paging\").directive(\"vhPageInfo\", VhPageInfo);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-paging/vh-page-info.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function VhPageSizeDirective() {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n pageSizes: \"=?\"\r\n },\r\n require: [\"^vhPaging\", \"ngModel\"],\r\n templateUrl: \"components/vh-paging/vh-page-size.tpl.html\",\r\n link: function (scope, elem, attrs, ctrls) {\r\n scope.vhPaging = ctrls[0].scope;\r\n var ngModelCtrl = ctrls[1];\r\n if (scope.pageSizes === undefined) {\r\n scope.pageSizes = [25,50,75];\r\n }\r\n\r\n ngModelCtrl.$render = function () {\r\n scope.vhPaging.pageSize = ngModelCtrl.$viewValue;\r\n };\r\n\r\n scope.pageChanged = function () {\r\n ngModelCtrl.$setViewValue(scope.vhPaging.pageSize);\r\n };\r\n }\r\n };\r\n}\t\r\n\r\nangular.module(\"vh.paging\").directive(\"vhPageSize\", VhPageSizeDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-paging/vh-page-size.tpl.html',\n '
    pageSizes[0]\">
    ');\n}]);\n}(window, document, window.angular));","function VhPaginationDirective() {\r\n return {\r\n restrict: \"E\",\r\n require: [\"^vhPaging\", \"ngModel\"],\r\n templateUrl: \"components/vh-paging/vh-pagination.tpl.html\",\r\n link: function (scope, elem, attrs, ctrls) {\r\n scope.vhPaging = ctrls[0].scope;\r\n var ngModelCtrl = ctrls[1];\r\n\r\n ngModelCtrl.$render = function () {\r\n scope.vhPaging.pageNumber = ngModelCtrl.$viewValue;\r\n };\r\n\r\n scope.pageChanged = function () {\r\n ngModelCtrl.$setViewValue(scope.vhPaging.pageNumber);\r\n };\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh.paging\").directive(\"vhPagination\", VhPaginationDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-paging/vh-pagination.tpl.html',\n '
      1\" num-pages=\"vhPaging.pages\">
    ');\n}]);\n}(window, document, window.angular));","function VhPhone($window, ConfigurationsService) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-phone/vh-phone.tpl.html\",\r\n require: \"ngModel\",\r\n scope: {\r\n selectedCountry: '=?',\r\n ngDisabled: '=',\r\n name: '@',\r\n label: '@',\r\n extName: '@',\r\n extLabel: '@',\r\n },\r\n link: function (scope, elem, attrs, ctrl) {\r\n var config = ConfigurationsService.configParams;\r\n var bcCountries = $window.bcCountries;\r\n var libphonenumber = $window.libphonenumber;\r\n var phoneUtil = libphonenumber.PhoneNumberUtil.getInstance();\r\n scope.ext = attrs.ext !== undefined;\r\n scope.showPhoneIcon = attrs.showPhoneIcon !== undefined;\r\n scope.allCountries = getCountries(config.SupportedCountries.split(' '));\r\n scope.displayNumber = {};\r\n scope.displayNumber.value = \"\";\r\n scope.extDisplayNumber = {};\r\n scope.extDisplayNumber.value = \"\";\r\n scope.selectedCountry = bcCountries.getCountryByIso2Code(config.DefaultCountry.toLowerCase());\r\n\r\n ctrl.$render = function() {\r\n //This happens when control is first loaded with a given phone number\r\n if (ctrl.$viewValue) {\r\n const components = ctrl.$viewValue.split(\"x\");\r\n const numberNoExt = components[0].replace(/\\D/g,'');\r\n if (!isValid(numberNoExt)) {\r\n scope.selectedCountry = bcCountries.getCountryByIso2Code(config.DefaultCountry.toLowerCase());\r\n scope.displayNumber.value = numberNoExt;\r\n // If we have an extension, remember to append it\r\n if (components.length > 1 && components[1].length > 1) {\r\n scope.extDisplayNumber.value = getPhoneExtension(ctrl.$viewValue);\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}x${scope.extDisplayNumber.value}`.replace(/[^x\\d]/g,''));\r\n }\r\n else {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}`.replace(/\\D/g,''));\r\n }\r\n } else {\r\n // Fix any erroneous extensions\r\n if (components.length > 1 && components[1].length < 2) {\r\n ctrl.$setViewValue(components[0].replace(/\\D/g,''));\r\n }\r\n \r\n scope.selectedCountry = getCountryFromNumber(ctrl.$viewValue);\r\n scope.displayNumber.value = getPhoneDigits(ctrl.$viewValue);\r\n scope.extDisplayNumber.value = getPhoneExtension(ctrl.$viewValue);\r\n }\r\n } else {\r\n scope.displayNumber.value = null;\r\n }\r\n\r\n scope.placeholderNumber = getPlaceholder();\r\n scope.placeholderExtension = scope.extLabel;\r\n };\r\n\r\n ctrl.$validators.phoneNumber = function(model, view) {\r\n if (!model || scope.displayNumber.value.length === 0) {\r\n return true;\r\n }\r\n return isValid(model);\r\n }\r\n\r\n ctrl.$validators.extension = function(model, view) {\r\n if (!model || (scope.extDisplayNumber.value != null && scope.extDisplayNumber.value.length === 0)) {\r\n return true;\r\n }\r\n const components = model.split(\"x\");\r\n\r\n if (components.length > 1) {\r\n return isValidExtension(components[1]);\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n\r\n scope.selectCountry = function(country) {\r\n //This happens when a new country is selected\r\n var d = scope.selectedCountry.dialCode + scope.displayNumber.value;\r\n scope.selectedCountry = country;\r\n scope.displayNumber.value = getPhoneDigits(scope.selectedCountry.dialCode + scope.displayNumber.value);\r\n if (scope.displayNumber.value.length === 0) {\r\n ctrl.$setViewValue(null);\r\n } else {\r\n ctrl.$setValidity('phoneNumber', isValidNumber(scope.displayNumber.value, scope.selectedCountry.iso2Code));\r\n // If we have an extension, remember to append it\r\n if (components.length > 1) {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}x${scope.extDisplayNumber.value}`.replace(/[^x\\d]/g,''));\r\n }\r\n else {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}`.replace(/\\D/g,''));\r\n }\r\n }\r\n ctrl.$setDirty();\r\n scope.placeholderNumber = getPlaceholder();\r\n };\r\n\r\n scope.isCountrySelected = function(country) {\r\n return country.iso2Code == scope.selectedCountry.iso2Code;\r\n };\r\n\r\n scope.changed = function() {\r\n //This happens when end user types into phone field\r\n if (scope.displayNumber.value.length === 0) {\r\n ctrl.$setViewValue(null);\r\n return;\r\n }\r\n if (!isValid(scope.selectedCountry.dialCode + scope.displayNumber.value)) {\r\n // If we have an extension, remember to append it\r\n if (scope.extDisplayNumber.value != null && scope.extDisplayNumber.value.length > 0 && isValidExtension(scope.extDisplayNumber.value)) {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}x${scope.extDisplayNumber.value}`.replace(/[^x\\d]/g,''));\r\n }\r\n else {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}`.replace(/\\D/g,''));\r\n }\r\n return;\r\n } else {\r\n scope.displayNumber.value = getPhoneDigits(scope.selectedCountry.dialCode + scope.displayNumber.value);\r\n // If we have an extension, remember to append it\r\n if (scope.extDisplayNumber.value != null && scope.extDisplayNumber.value.length > 0 && isValidExtension(scope.extDisplayNumber.value)) {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}x${scope.extDisplayNumber.value}`.replace(/[^x\\d]/g,''));\r\n }\r\n else {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}`.replace(/\\D/g,''));\r\n }\r\n }\r\n ctrl.$validate();\r\n }\r\n\r\n scope.extChanged = function() {\r\n //This happens when end user types into phone field\r\n if (scope.displayNumber.value) {\r\n if (scope.extDisplayNumber.value != null && scope.extDisplayNumber.value.length === 0) {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}`.replace(/\\D/g,''));\r\n ctrl.$setValidity('extension', true);\r\n return;\r\n }\r\n if (!isValidExtension(scope.extDisplayNumber.value) || scope.extDisplayNumber.value === undefined) {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}`.replace(/\\D/g,''));\r\n ctrl.$setValidity('extension', false);\r\n return;\r\n } else {\r\n ctrl.$setViewValue(`${scope.selectedCountry.dialCode}${scope.displayNumber.value}x${scope.extDisplayNumber.value}`.replace(/[^x\\d]/g,''));\r\n ctrl.$setValidity('extension', true);\r\n }\r\n ctrl.$validate();\r\n }\r\n }\r\n\r\n function getCountries(codes) {\r\n var preferredCountries = [];\r\n\r\n for (var i = 0; i < codes.length; i++) {\r\n var country = bcCountries.getCountryByIso2Code(codes[i].toLowerCase());\r\n if (country) { preferredCountries.push(country); }\r\n }\r\n\r\n return preferredCountries;\r\n };\r\n\r\n function getPhoneDigits(number) {\r\n if (!number || number.length == 0) {\r\n return \"\";\r\n }\r\n number = number.split(\"x\")[0];\r\n number = number.replace(/\\D/g,'');\r\n var digits = number;\r\n try {\r\n\r\n var dialCode = bcCountries.getDialCodeByDigits(number);\r\n\r\n if (dialCode.length > 0 && number.indexOf(dialCode) === 0) {\r\n digits = number.substring(dialCode.length);\r\n }\r\n\r\n var iso2Code = bcCountries.getIso2CodeByDigits(number);\r\n var numberObj = phoneUtil.parseAndKeepRawInput(digits, iso2Code);\r\n var countryCode = phoneUtil.getRegionCodeForNumber(numberObj);\r\n if (isValidNumber(digits, countryCode)) {\r\n let result = phoneUtil.format(numberObj, libphonenumber.PhoneNumberFormat.NATIONAL);\r\n if (countryCode.toLowerCase() === 'vi' && result.length > 8) {\r\n return result.substring(result.length - 8);\r\n }\r\n return result;\r\n } else {\r\n return digits;\r\n }\r\n } catch (e) {\r\n return digits;\r\n }\r\n }\r\n\r\n function getPhoneExtension(fullNumber) {\r\n const components = fullNumber.split(\"x\");\r\n\r\n if (components.length > 1) {\r\n var digits = components[1].replace(/\\D/g,'');\r\n if (isValidExtension(digits)) {\r\n return digits;\r\n }\r\n }\r\n\r\n return \"\";\r\n }\r\n\r\n function isValidExtension(ext) {\r\n return ext.length >= 2 && ext.length <= 6;\r\n }\r\n\r\n function getCountryFromNumber(number) {\r\n if (number) {\r\n number = number.replace(/\\D/g,'');\r\n }\r\n if (!number || number.length == 0) {\r\n return bcCountries.getCountryByIso2Code(config.DefaultCountry.toLowerCase());\r\n }\r\n //This iso2Code may not be actual country - If it's a 1, it could be US or Canada\r\n var iso2Code = bcCountries.getIso2CodeByDigits(number);\r\n var numberObj;\r\n //Get the actual country (region) countrycode\r\n var countryCode;\r\n var country = bcCountries.getCountryByIso2Code(iso2Code);\r\n //If number passed in was only country code, return that country\r\n if (country && country.dialCode === number) {\r\n return country;\r\n }\r\n\r\n try {\r\n numberObj = phoneUtil.parseAndKeepRawInput(number, iso2Code);\r\n countryCode = phoneUtil.getRegionCodeForNumber(numberObj);\r\n } catch (e) {\r\n return bcCountries.getCountryByIso2Code(config.DefaultCountry.toLowerCase() || 'us');\r\n }\r\n\r\n\r\n if (!countryCode || countryCode.length === 0) {\r\n return bcCountries.getCountryByIso2Code(config.DefaultCountry.toLowerCase() || 'us');\r\n }\r\n\r\n country = bcCountries.getCountryByIso2Code(countryCode.toLowerCase());\r\n if (country) {\r\n return country;\r\n } else {\r\n return bcCountries.getCountryByIso2Code(config.DefaultCountry.toLowerCase() || 'us');\r\n }\r\n }\r\n\r\n function getPlaceholder() {\r\n var temp = phoneUtil.getExampleNumber(scope.selectedCountry.iso2Code);\r\n return phoneUtil.format(temp, libphonenumber.PhoneNumberFormat.NATIONAL);\r\n }\r\n\r\n function isSupportedCountry(iso2Code) {\r\n return config.SupportedCountries.toLowerCase().indexOf(iso2Code.toLowerCase()) >= 0;\r\n }\r\n\r\n function isValid(number) {\r\n if (!number || number.length === 0) {\r\n return true;\r\n }\r\n const components = number.split(\"x\");\r\n var digits = bcCountries.getDigits(components[0]);\r\n const country = getCountryFromNumber(digits);\r\n\r\n //Remove country code from number for validating\r\n var dialCode = bcCountries.getDialCodeByDigits(digits);\r\n\r\n if (dialCode.length > 0 && digits.indexOf(dialCode) === 0) {\r\n digits = digits.substring(dialCode.length);\r\n }\r\n\r\n if (!country || country.dialCode != dialCode) {\r\n return false;\r\n }\r\n\r\n return isValidNumber(digits, country.iso2Code);\r\n }\r\n\r\n function isValidExtension(ext) {\r\n return !ext || ext === \"\" || (ext.length >= 2 && ext.length <= 6);\r\n }\r\n\r\n //digits parameter must not include country code\r\n function isValidNumber(digits, iso2Code) {\r\n if (!isSupportedCountry(iso2Code)) {\r\n return false;\r\n }\r\n try {\r\n var numberObj = phoneUtil.parseAndKeepRawInput(digits, iso2Code);\r\n return phoneUtil.isValidNumber(numberObj) && phoneUtil.isValidNumberForRegion(numberObj, iso2Code);\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n },\r\n controller: function () {\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"vh-phone\").directive(\"vhPhone\", VhPhone);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-phone/vh-phone.tpl.html',\n '
    1\">
    ');\n}]);\n}(window, document, window.angular));","function vhRulesParserService($window) {\r\n 'use strict';\r\n \r\n var \r\n COMMA_CODE = 44, // ','\r\n PERIOD_CODE = 46, // '.'\r\n SQUOTE_CODE = 39, // single quote\r\n DQUOTE_CODE = 34, // double quotes\r\n OPAREN_CODE = 40, // (\r\n CPAREN_CODE = 41, // )\r\n OCURLY_CODE = 123, // {\r\n CCURLY_CODE = 125, // } \r\n\r\n throwError = function(message, index) {\r\n var error = new Error(message + ' at character ' + index);\r\n error.index = index;\r\n error.description = message;\r\n throw error;\r\n },\r\n\r\n // Operations\r\n // ----------\r\n\r\n open_ops = { '\\'' : true, '\"' : true, '(' : true, '[' : true, '{' : true },\r\n\r\n unary_ops = {'-': true, '!': true, '~': true, '+': true },\r\n \r\n // Also use a map for the binary operations but set their values to their\r\n // binary precedence for quick reference:\r\n // see [Order of operations](http://en.wikipedia.org/wiki/Order_of_operations#Programming_language)\r\n binary_ops = {\r\n '||': 1, \r\n '&&': 2, \r\n '|': 3, \r\n '^': 4, \r\n '&': 5,\r\n '=' : 6, \r\n '==': 6, \r\n '!=': 6, \r\n '===': 6, \r\n '!==': 6,\r\n '<': 7, \r\n '>': 7, \r\n '<=': 7, \r\n '>=': 7,\r\n '<<':8, \r\n '>>': 8, \r\n '>>>': 8,\r\n '+': 9, \r\n '-': 9,\r\n '*': 10, \r\n '/': 10, \r\n '%': 10\r\n },\r\n\r\n // Get return the longest key length of any object\r\n getMaxKeyLen = function(obj) {\r\n var max_len = 0, len;\r\n for(var key in obj) {\r\n if((len = key.length) > max_len && obj.hasOwnProperty(key)) {\r\n max_len = len;\r\n }\r\n }\r\n return max_len;\r\n },\r\n max_unop_len = getMaxKeyLen(unary_ops),\r\n max_binop_len = getMaxKeyLen(binary_ops),\r\n \r\n\r\n // Literals\r\n // ----------\r\n // Store the values to return for the various literals we may encounter\r\n literals = {\r\n 'true': true,\r\n 'false': false,\r\n 'null': null\r\n },\r\n \r\n // Returns the precedence of a binary operator or `0` if it isn't a binary operator\r\n binaryPrecedence = function(op_val) {\r\n return binary_ops[op_val] || 0;\r\n },\r\n\r\n // `ch` is a character code in the next three functions\r\n isDecimalDigit = function(ch) {\r\n return (ch >= 48 && ch <= 57); // 0...9\r\n },\r\n \r\n isIdentifierStart = function(ch) {\r\n return (ch === 36) || (ch === 95) || // `$` and `_`\r\n (ch >= 65 && ch <= 90) || // A...Z\r\n (ch >= 97 && ch <= 122) || // a...z\r\n (ch === OCURLY_CODE ) || // {\r\n (ch >= 128 && !binary_ops[String.fromCharCode(ch)]); // any non-ASCII that is not an operator\r\n },\r\n \r\n isIdentifierPart = function(ch) {\r\n return (ch === 36) || (ch === 95) || // `$` and `_`\r\n (ch >= 65 && ch <= 90) || // A...Z\r\n (ch >= 97 && ch <= 122) || // a...z\r\n (ch >= 48 && ch <= 57) || // 0...9\r\n (ch === OCURLY_CODE ) || // {\r\n (ch >= 128 && !binary_ops[String.fromCharCode(ch)]); // any non-ASCII that is not an operator\r\n };\r\n\r\n function isIE11() {\r\n var rv = -1;\r\n if ($window.navigator.appName == 'Microsoft Internet Explorer')\r\n {\r\n var ua = $window.navigator.userAgent;\r\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\r\n if (re.exec(ua) != null)\r\n rv = parseFloat( RegExp.$1 );\r\n }\r\n else if ($window.navigator.appName == 'Netscape')\r\n {\r\n var ua = $window.navigator.userAgent;\r\n var re = new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\");\r\n if (re.exec(ua) != null)\r\n rv = parseFloat( RegExp.$1 );\r\n }\r\n\r\n return rv == 11;\r\n }\r\n\r\n function isInArray(arr, value) {\r\n if (isIE11()) {\r\n return arr.indexOf(value) > -1;\r\n }\r\n return arr.includes(value);\r\n }\r\n \r\n \r\n var isSpace = function(chCode){\r\n var retVal = false;\r\n if (chCode === 32 || chCode === 9 || chCode === 10 || chCode === 13){\r\n retVal = true;\r\n }\r\n return retVal;\r\n }; \r\n \r\n\r\n // Parsing\r\n // -------\r\n // `expr` is a string with the passed in expression\r\n function parser(expr) {\r\n console.log( expr );\r\n // `index` stores the character number we are currently at while `length` is a constant\r\n // All of the gobbles below will modify `index` as we move along\r\n var index = 0,\r\n nodes = [], \r\n ch_i, \r\n node,\r\n charAtFunc = expr.charAt,\r\n charCodeAtFunc = expr.charCodeAt,\r\n exprI = function(i) { return charAtFunc.call(expr, i); },\r\n exprICode = function(i) { return charCodeAtFunc.call(expr, i); },\r\n length = expr.length,\r\n\r\n\r\n // An individual part of a binary expression:\r\n // e.g. {DayOfMonth} == ({LastDayOfMonth} - 7)\r\n gobbleToken = function() {\r\n var ch, to_check, tc_len;\r\n\r\n gobbleSpaces();\r\n ch = exprICode(index);\r\n \r\n var binaryOp = gobbleBinaryOp();\r\n if ( binaryOp ){\r\n return binaryOp;\r\n } else if(isDecimalDigit(ch) || ch === PERIOD_CODE) {\r\n // a dot `.` can start off a numeric literal\r\n return gobbleNumericLiteral();\r\n } else if(ch === SQUOTE_CODE || ch === DQUOTE_CODE) {\r\n // Single or double quotes\r\n return gobbleStringLiteral();\r\n } else if(ch === OCURLY_CODE){\r\n // Curly Brace\r\n return gobbleVariable();\r\n }else if (ch === OPAREN_CODE){\r\n ++index;\r\n return '(';\r\n }else if (ch === CPAREN_CODE){\r\n ++index;\r\n return ')';\r\n } else {\r\n to_check = expr.substr(index, max_unop_len);\r\n tc_len = to_check.length;\r\n while(tc_len > 0) {\r\n if(unary_ops.hasOwnProperty(to_check)) {\r\n index += tc_len;\r\n return gobbleToken();\r\n }\r\n to_check = to_check.substr(0, --tc_len);\r\n }\r\n }\r\n \r\n return false;\r\n },\r\n\r\n // Push `index` up to the next non-space character\r\n gobbleSpaces = function() {\r\n var ch = exprICode(index);\r\n // space or tab\r\n while(ch === 32 || ch === 9 || ch === 10 || ch === 13) {\r\n ch = exprICode(++index);\r\n }\r\n },\r\n\r\n // Search for the operation portion of the string (e.g. `+`, `===`)\r\n // Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\r\n // and move down from 3 to 2 to 1 character until a matching binary operation is found\r\n // then, return that binary operation\r\n gobbleBinaryOp = function() {\r\n gobbleSpaces();\r\n var biop, to_check = expr.substr(index, max_binop_len), tc_len = to_check.length;\r\n while(tc_len > 0) {\r\n if(binary_ops.hasOwnProperty(to_check)) {\r\n index += tc_len;\r\n return to_check;\r\n }\r\n to_check = to_check.substr(0, --tc_len);\r\n }\r\n return false;\r\n },\r\n \r\n // Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\r\n // keep track of everything in the numeric literal and then calling `parseFloat` on that string\r\n gobbleNumericLiteral = function() {\r\n var number = '', ch, chCode;\r\n while(isDecimalDigit(exprICode(index))) {\r\n number += exprI(index++);\r\n }\r\n\r\n if(exprICode(index) === PERIOD_CODE) { // can start with a decimal marker\r\n number += exprI(index++);\r\n\r\n while(isDecimalDigit(exprICode(index))) {\r\n number += exprI(index++);\r\n }\r\n }\r\n\r\n ch = exprI(index);\r\n if(ch === 'e' || ch === 'E') { // exponent marker\r\n number += exprI(index++);\r\n ch = exprI(index);\r\n if(ch === '+' || ch === '-') { // exponent sign\r\n number += exprI(index++);\r\n }\r\n while(isDecimalDigit(exprICode(index))) { //exponent itself\r\n number += exprI(index++);\r\n }\r\n if(!isDecimalDigit(exprICode(index-1)) ) {\r\n throwError('Expected exponent (' + number + exprI(index) + ')', index);\r\n }\r\n }\r\n\r\n\r\n chCode = exprICode(index);\r\n // Check to make sure this isn't a variable name that start with a number (123abc)\r\n if(isIdentifierStart(chCode)) {\r\n throwError('Variable names cannot start with a number (' +\r\n number + exprI(index) + ')', index);\r\n } else if(chCode === PERIOD_CODE) {\r\n throwError('Unexpected period', index);\r\n }\r\n\r\n return parseFloat(number);\r\n },\r\n\r\n // Parses a string literal, staring with single or double quotes with basic support for escape codes\r\n // e.g. `\"Monday\"`, `'Tuesday'`\r\n gobbleStringLiteral = function() {\r\n var str = '', quote = exprI(index++), closed = false, ch;\r\n\r\n while(index < length) {\r\n ch = exprI(index++);\r\n if(ch === quote) {\r\n closed = true;\r\n break;\r\n } else if(ch === '\\\\') {\r\n // Check for all of the common escape codes\r\n ch = exprI(index++);\r\n switch(ch) {\r\n case 'n': str += '\\n'; break;\r\n case 'r': str += '\\r'; break;\r\n case 't': str += '\\t'; break;\r\n case 'b': str += '\\b'; break;\r\n case 'f': str += '\\f'; break;\r\n case 'v': str += '\\x0B'; break;\r\n default : str += ch;\r\n }\r\n } else {\r\n str += ch;\r\n }\r\n }\r\n\r\n if(!closed) {\r\n throwError('Unclosed quote after \"'+str+'\"', index);\r\n }\r\n return str;\r\n },\r\n \r\n // Parses a string literal, staring with curly brace\r\n // e.g. '{DayOfMonth}', '{LastDayOfMonth}'\r\n gobbleVariable = function() {\r\n var str = '', closed = false, ch;\r\n\r\n while(index < length) {\r\n ch = exprI(index++);\r\n if(ch === '}') {\r\n closed = true;\r\n str += ch;\r\n break;\r\n } else {\r\n str += ch;\r\n }\r\n }\r\n\r\n if(!closed) {\r\n throwError('Unclosed curly brace after \"'+str+'\"', index);\r\n }\r\n return str;\r\n }; \r\n \r\n while(index < length) {\r\n // Try to gobble each expression individually\r\n if((node = gobbleToken())) {\r\n nodes.push(node);\r\n } else if(index < length) {\r\n throwError('Unexpected \"' + exprI(index) + '\"', index);\r\n }\r\n }\r\n\r\n console.log( nodes );\r\n //var postFix = ConvertInfixToPostfix(nodes);\r\n //console.log( postFix );\r\n return nodes;\r\n }\r\n \r\n function parserFn(expr){\r\n var index = 0;\r\n var node = \"\";\r\n var nodes = [];\r\n var length = expr.length;\r\n var charAtFunc = expr.charAt;\r\n var charCodeAtFunc = expr.charCodeAt; \r\n var nextChar = function(i) { return charAtFunc.call(expr, i); };\r\n var nextCharCode = function(i) { return charCodeAtFunc.call(expr, i); };\r\n\r\n // Push `index` up to the next non-space character\r\n var gobbleSpaces = function() {\r\n var ch = nextCharCode(index);\r\n // space or tab\r\n while(isSpace(ch)) {\r\n ch = nextCharCode(++index);\r\n }\r\n }; \r\n\r\n var isDelimiter = function(chCode){\r\n var retVal = false;\r\n if ( isSpace(chCode) || chCode === COMMA_CODE ||\r\n chCode === OPAREN_CODE || chCode === CPAREN_CODE || \r\n chCode === SQUOTE_CODE || chCode === DQUOTE_CODE ){\r\n retVal = true;\r\n }\r\n return retVal;\r\n }\r\n // Tokens are seprated by [space], Parentheses, Comma, Single or Double Quotes\r\n var gobbleToken = function() {\r\n var chCode;\r\n var token = \"\";\r\n\r\n gobbleSpaces();\r\n \r\n chCode = nextCharCode(index);\r\n while(index < length && !isDelimiter(chCode) ){\r\n token += nextChar(index++);\r\n chCode = nextCharCode(index);\r\n }\r\n\r\n if ( chCode === SQUOTE_CODE || chCode === DQUOTE_CODE ){\r\n token = gobbleStringLiteral();\r\n }\r\n\r\n if (index < length && isDelimiter(chCode)){\r\n index++; // eat the delimiter\r\n }\r\n return token;\r\n };\r\n\r\n // Parses a string literal, staring with single or double quotes\r\n // e.g. `\"Monday\"`, `'Tuesday'`\r\n var gobbleStringLiteral = function() {\r\n var str = '';\r\n var quote = nextChar(index++);\r\n var closed = false;\r\n var ch;\r\n\r\n while(index < length) {\r\n ch = nextChar(index++);\r\n if(ch === quote) {\r\n closed = true;\r\n break;\r\n } \r\n else {\r\n str += ch;\r\n }\r\n }\r\n\r\n if(!closed) {\r\n throwError('Unclosed quote after \"'+str+'\"', index);\r\n }\r\n return str;\r\n }; \r\n\r\n while(index < length) {\r\n if((node = gobbleToken())) {\r\n nodes.push(node);\r\n } else if(index < length) {\r\n throwError('Unexpected \"' + exprI(index) + '\"', index);\r\n }\r\n }\r\n return nodes;\r\n }\r\n\r\n function ConvertInfixToPostfix(postfixList){\r\n var returnList = new Array();\r\n var operatorStack = new Array();\r\n var position = 0;\r\n for (var i = position; i < postfixList.length; i++) \r\n {\r\n var item = postfixList[i];\r\n if (item === '(')\r\n {\r\n i = ConvertInfixToPostfixBracket(i, postfixList, returnList);\r\n }\r\n else if (item === '||' || item === '&&')\r\n {\r\n while (operatorStack.length > 0)\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n operatorStack.push(item);\r\n }\r\n else if (item === '>' || item === '>=' || item === '<' || item === '<=' || item === '=' || item === '==' || item == '!=')\r\n {\r\n var peek = operatorStack.length > 0 ? operatorStack[operatorStack.length-1] : null;\r\n if (peek === '*' || peek === '/' || peek === '%')\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n else if (operatorStack.length > 0 && (peek === '+' || peek === '-'))\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n operatorStack.push(item);\r\n }\r\n else if (item === '+' || item === '-')\r\n {\r\n var peek = operatorStack.length > 0 ? operatorStack[operatorStack.length-1] : null;\r\n if (peek === '*' || peek === '/' || peek === '%')\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n operatorStack.push(item);\r\n }\r\n else if (item === '*' || item === '/' || item === '%')\r\n {\r\n operatorStack.push(item);\r\n } \r\n else if (typeof item == \"number\" || typeof item == \"string\" || typeof item == \"boolean\")\r\n {\r\n returnList.push(item);\r\n }\r\n \r\n position++;\r\n }\r\n while (operatorStack.length > 0)\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n return returnList;\r\n } \r\n\r\n function ConvertInfixToPostfixBracket(position, postfixList, returnList){\r\n var operatorStack = new Array();\r\n var i = 0;\r\n for (i = position + 1; i < postfixList.length; i++)\r\n {\r\n var item = postfixList[i];\r\n if (item === ')')\r\n {\r\n break;\r\n }\r\n\r\n if (item === '(')\r\n {\r\n i = ConvertInfixToPostfixBracket(i, postfixList, returnList);\r\n }\r\n else if (item === '||' || item === '&&')\r\n {\r\n while (operatorStack.length > 0)\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n operatorStack.push(item);\r\n }\r\n else if (item === '>' || item === '>=' || item === '<' || item === '<=' || item === '=' || item === '==' || item == '!=' )\r\n {\r\n var peek = operatorStack.length > 0 ? operatorStack[operatorStack.length-1] : null;\r\n if (peek === '*' || peek === '/' || peek === '%')\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n if (operatorStack.length > 0 && (item === '+' || item === '-'))\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n operatorStack.push(item);\r\n }\r\n else if (item === '+' || item === '-')\r\n {\r\n var peek = operatorStack.length > 0 ? operatorStack[operatorStack.length-1] : null;\r\n if (peek === '*' || peek === '/' || peek === '%')\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n operatorStack.push(item);\r\n }\r\n else if (item === '*' || item === '/' || item === '%')\r\n {\r\n operatorStack.push(item);\r\n }\r\n else if (typeof item == \"number\" || typeof item == \"string\" || typeof item == \"boolean\")\r\n {\r\n returnList.push(item);\r\n }\r\n position++;\r\n }\r\n\r\n while (operatorStack.length > 0)\r\n {\r\n var node = operatorStack.pop();\r\n returnList.push(node);\r\n }\r\n return i;\r\n }\r\n\r\n function Evaluate(postfixList, data) {\r\n var valueStack = new Array();\r\n for (var i = 0; i < postfixList.length; i++) {\r\n var item = postfixList[i];\r\n\r\n if ( binary_ops[item] === undefined){\r\n valueStack.push(item);\r\n //if (typeof item == \"number\" || typeof item == \"string\" || typeof item == \"boolean\") {\r\n // valueStack.push(item);\r\n //} \r\n }\r\n else{\r\n var result = false;\r\n var secondoperand = getOperandValue(valueStack.pop(), data);\r\n var firstoperand = getOperandValue(valueStack.pop(), data);\r\n if (item === '+') {\r\n if (typeof firstoperand == \"number\" && typeof secondoperand == \"number\") {\r\n result = firstoperand + secondoperand;\r\n }\r\n }\r\n else if (item === '-') {\r\n if (typeof firstoperand == \"number\" && typeof secondoperand == \"number\") {\r\n result = firstoperand - secondoperand;\r\n }\r\n } \r\n else if (item === '*') {\r\n if (typeof firstoperand == \"number\" && typeof secondoperand == \"number\") {\r\n result = irstoperand * secondoperand;\r\n }\r\n }\r\n else if (item === '/') {\r\n if (typeof firstoperand == \"number\" && typeof secondoperand == \"number\") {\r\n result = firstoperand / secondoperand;\r\n }\r\n } \r\n else if (item === '%') {\r\n if (typeof firstoperand == \"number\" && typeof secondoperand == \"number\") {\r\n result = firstoperand % secondoperand;\r\n }\r\n } \r\n else if (item === '=' || item === '==') {\r\n result = processEquals(firstoperand, secondoperand); \r\n }\r\n else if (item === '!=') {\r\n result = processNotEquals(firstoperand, secondoperand); \r\n } \r\n else if (item === '<=') {\r\n result = processLessThenEquals(firstoperand, secondoperand); \r\n } \r\n else if (item === '>=') {\r\n result = processGreaterThenEquals(firstoperand, secondoperand); \r\n } \r\n else if (item === '<') {\r\n result = processLessThen(firstoperand, secondoperand); \r\n } \r\n else if (item === '>') {\r\n result = processGreaterThen(firstoperand, secondoperand); \r\n } \r\n else if (item === '&&') {\r\n result = firstoperand && secondoperand;\r\n } \r\n else if (item === '||') {\r\n result = firstoperand || secondoperand;\r\n }\r\n valueStack.push(result);\r\n } \r\n }\r\n return valueStack.pop();\r\n }\r\n \r\n function getOperandValue(operand, data){\r\n var retVal = operand;\r\n if ( angular.isString(operand) ){\r\n if ( operand.startsWith('{') ){\r\n var variable = operand.substring(1,operand.length-1).replace(/\\s/g,'');\r\n retVal = data[variable];\r\n if (retVal == undefined){\r\n retVal = null;\r\n }\r\n else if( isDateVariable(variable) ){\r\n retVal = new Date(Date.parse(retVal));\r\n }\r\n }\r\n }\r\n\r\n if ( angular.isString(retVal) ){ \r\n // all strings are trimmed and made lower case\r\n retVal = retVal.toLowerCase().replace(/\\s/g,'')\r\n }\r\n return retVal;\r\n }\r\n\r\n function isDateVariable(Variable){\r\n var retVal = false;\r\n switch(Variable){\r\n case 'Today':\r\n case 'Birthday':\r\n retVal = true;\r\n break;\r\n }\r\n return retVal;\r\n }\r\n\r\n function processEquals(firstoperand, secondoperand){\r\n var retVal = false;\r\n if ( Array.isArray(firstoperand) ){\r\n retVal = isInArray(firstoperand, secondoperand);\r\n }\r\n else if ( Array.isArray(secondoperand) ){\r\n retVal = isInArray(secondoperand, firstoperand);\r\n } \r\n else if ( angular.isDate(firstoperand) || angular.isDate(secondoperand) ){\r\n var firstDate = angular.isDate(firstoperand) ? firstoperand : new Date(Date.parse(firstoperand));\r\n var secondDate = angular.isDate(secondoperand) ? secondoperand : new Date(Date.parse(secondoperand));\r\n if (firstDate.getMonth() == secondDate.getMonth() && firstDate.getDate() == secondDate.getDate()){\r\n retVal = true;\r\n }\r\n }\r\n else if ( firstoperand != null && secondoperand != null ){\r\n retVal = firstoperand == secondoperand;\r\n }\r\n return retVal;\r\n }\r\n \r\n function processNotEquals(firstoperand, secondoperand){\r\n var retVal = false;\r\n if ( Array.isArray(firstoperand) ){\r\n retVal = !isInArray(firstoperand, secondoperand);\r\n }\r\n else if ( Array.isArray(secondoperand) ){\r\n retVal = !isInArray(secondoperand, firstoperand);\r\n } \r\n else if ( firstoperand != null && secondoperand != null ){\r\n retVal = firstoperand != secondoperand;\r\n }\r\n return retVal;\r\n } \r\n\r\n function processLessThenEquals(firstoperand, secondoperand){\r\n var retVal = false;\r\n if ( Array.isArray(firstoperand) ){\r\n retVal = false;\r\n }\r\n else if ( Array.isArray(secondoperand) ){\r\n retVal = false;\r\n } \r\n else if ( firstoperand != null && secondoperand != null ){\r\n retVal = firstoperand <= secondoperand;\r\n }\r\n return retVal;\r\n }\r\n \r\n function processGreaterThenEquals(firstoperand, secondoperand){\r\n var retVal = false;\r\n if ( Array.isArray(firstoperand) ){\r\n retVal = false;\r\n }\r\n else if ( Array.isArray(secondoperand) ){\r\n retVal = false;\r\n } \r\n else if ( firstoperand != null && secondoperand != null ){\r\n retVal = firstoperand >= secondoperand;\r\n }\r\n return retVal;\r\n } \r\n \r\n function processLessThen(firstoperand, secondoperand){\r\n var retVal = false;\r\n if ( Array.isArray(firstoperand) ){\r\n retVal = false;\r\n }\r\n else if ( Array.isArray(secondoperand) ){\r\n retVal = false;\r\n } \r\n else if ( firstoperand != null && secondoperand != null ){\r\n retVal = firstoperand < secondoperand;\r\n }\r\n return retVal;\r\n } \r\n \r\n function processGreaterThen(firstoperand, secondoperand){\r\n var retVal = false;\r\n if ( Array.isArray(firstoperand) ){\r\n retVal = false;\r\n }\r\n else if ( Array.isArray(secondoperand) ){\r\n retVal = false;\r\n } \r\n else if ( firstoperand != null && secondoperand != null ){\r\n retVal = firstoperand > secondoperand;\r\n }\r\n return retVal;\r\n } \r\n \r\n function toOrdinal(value){\r\n // Start with the most common extension.\r\n var extension = \"th\";\r\n\r\n // Examine the last 2 digits.\r\n var last_digits = value % 100;\r\n\r\n // If the last digits are 11, 12, or 13, use th. Otherwise:\r\n if (last_digits < 11 || last_digits > 13)\r\n {\r\n // Check the last digit.\r\n switch (last_digits % 10)\r\n {\r\n case 1:\r\n extension = \"st\";\r\n break;\r\n case 2:\r\n extension = \"nd\";\r\n break;\r\n case 3:\r\n extension = \"rd\";\r\n break;\r\n }\r\n }\r\n\r\n return value + extension; \r\n }\r\n\r\n function addBPReading(systolic, diastolic, conditionValues){\r\n conditionValues.Systolic = systolic;\r\n conditionValues.Diastolic = diastolic;\r\n conditionValues.BPReadingCount = (conditionValues.BPReadings ? conditionValues.BPReadings.length :0) + 1;\r\n var systolicTotal = conditionValues.Systolic;\r\n var diastolicTotal = conditionValues.Diastolic;\r\n var iterator = 0;\r\n if(conditionValues && conditionValues.BPReadings && conditionValues.BPReadings.length){\r\n iterator = conditionValues.BPReadings.length;\r\n }\r\n for(var i = 0; i < iterator; i++){\r\n systolicTotal += conditionValues.BPReadings[i].Systolic;\r\n diastolicTotal += conditionValues.BPReadings[i].Diastolic;\r\n }\r\n conditionValues.BPAverage = Math.round(systolicTotal/conditionValues.BPReadingCount) + '/' + Math.round(diastolicTotal/conditionValues.BPReadingCount);\r\n }\r\n\r\n function addTag(tagValue, conditionValues){\r\n if ( angular.isArray(tagValue) ){\r\n for(var i = 0; i < tagValue.length; i++){\r\n addTag(tagValue[i], conditionValues);\r\n }\r\n }\r\n else if ( angular.isString(tagValue) ){\r\n if (tagValue.length > 0){\r\n var tags = tagValue.split(\";\");\r\n for(var i = 0; i < tags.length; i++){\r\n var value = tags[i];\r\n if (isInArray(value, '(')){\r\n var parts = parserFn(value);\r\n if ( parts.length > 0){\r\n switch(parts[0].toLowerCase()){\r\n case 'initquiz':\r\n processInitQuiz(parts, conditionValues);\r\n break;\r\n case 'addpoints':\r\n processAddPoints(parts, conditionValues);\r\n break;\r\n case 'subtractpoints':\r\n processSubtractPoints(parts, conditionValues);\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n conditionValues.Tags.push(value.toLowerCase().replace(/\\s/g,''))\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n function updateQuizValues(name, maxPoints, points, data){\r\n var maxName = name + 'Max';\r\n var totalName = name + 'Total';\r\n var scoreName = name + 'Score'; \r\n \r\n //Add these points to the running total\r\n if (data[totalName] == undefined){\r\n data[totalName] = points;\r\n }\r\n else{\r\n data[totalName] += points;\r\n } \r\n\r\n //Get total possible points for this quiz or set a default\r\n if (maxPoints == undefined || maxPoints < 1){\r\n maxPoints = 100;\r\n }\r\n if (data[maxName] == undefined){\r\n data[maxName] = maxPoints; \r\n }\r\n var max = data[maxName];\r\n\r\n //Compute the current score for this quiz\r\n if (max > 0){\r\n data[scoreName] = Math.round(data[totalName] / max * 100);\r\n } \r\n else{\r\n data[scoreName] = 0;\r\n }\r\n }\r\n\r\n function processInitQuiz(parts, data) {\r\n if (parts.length == 3) { // initQuiz( 'QuizName', maxPoints )\r\n var name = parts[1]\r\n var maxPoints = parseInt(parts[2]);\r\n updateQuizValues(name, maxPoints, 0, data);\r\n }\r\n } \r\n\r\n function processAddPoints(parts, data){\r\n if ( parts.length == 3 && angular.isString(parts[1])){ // addPoints( 'QuizName', points )\r\n var name = parts[1]\r\n var value = parseInt(parts[2]);\r\n updateQuizValues(name, 0, value, data);\r\n }\r\n } \r\n\r\n function processSubtractPoints(parts, data){\r\n if ( parts.length == 3 && angular.isString(parts[1])){ // subtractPoints( 'QuizName', points )\r\n var name = parts[1]\r\n var value = parseInt(parts[2]);\r\n updateQuizValues(name, 0, -value, data);\r\n }\r\n }\r\n\r\n function replaceVariables(text, data){\r\n // Replace variables in the Question Text\r\n for(var item in data){\r\n var varName = \"{\" + item + \"}\";\r\n var varValue = data[item];\r\n // try and match on mixed case\r\n while( isInArray(text, varName)){\r\n text = text.replace(varName, varValue);\r\n }\r\n\r\n // try and match on all lower case\r\n varName = varName.toLowerCase();\r\n while( isInArray(text, varName)){\r\n text = text.replace(varName, varValue);\r\n }\r\n\r\n // try and match on all upper case\r\n varName = varName.toLocaleUpperCase(); \r\n while( isInArray(text, varName)){\r\n text = text.replace(varName, varValue);\r\n }\r\n }\r\n return text;\r\n }\r\n\r\n return {\r\n parser: parser,\r\n parserFn: parserFn,\r\n evaluate : Evaluate,\r\n toOrdinal : toOrdinal,\r\n addBPReading : addBPReading,\r\n addTag :addTag,\r\n replaceVariables: replaceVariables\r\n }\r\n}\r\n\r\nangular.module(\"vh.rules.parser\", []).service('vhRulesParserService', vhRulesParserService);\r\n","function MultiSelectDirective(lodash) {\r\n return {\r\n restrict: \"A\",\r\n scope: {\r\n selected: \"=vhMultiSelect\"\r\n },\r\n require: \"vhSelect\",\r\n link: function (scope, elem, attrs, selectCtrl) {\r\n // current selectable items\r\n var currentSelectables = {}; // key = trackByValue, value = selectable\r\n\r\n // object that acts on behalf of the select directive to determine\r\n // what to select and not select\r\n var delegate = {\r\n clickedSelectable: clickedSelectable,\r\n removeSelectable: removeSelectable,\r\n addSelectable: addSelectable\r\n };\r\n selectCtrl.delegate = delegate;\r\n\r\n // watch collection and determine what to select and unselect\r\n scope.$watchCollection(\"selected\", function (newValue) {\r\n if (newValue === undefined) {\r\n return;\r\n }\r\n var removeCurrentSelected = {};\r\n angular.extend(removeCurrentSelected, currentSelectables);\r\n for(var i = 0;i < newValue.length; i++) {\r\n var value = newValue[i];\r\n var key = selectCtrl.getSelectableKey(value);\r\n // if its new and old, ignore it\r\n if (currentSelectables[key]) {\r\n delete removeCurrentSelected[key];\r\n } else {\r\n // add to current selected elements and select element\r\n var selectable = selectCtrl.selectables[key];\r\n select(selectable, key);\r\n }\r\n }\r\n angular.forEach(removeCurrentSelected, unselect);\r\n });\r\n\r\n function clickedSelectable(selectable) {\r\n var key = selectCtrl.getSelectableKey(selectable.item);\r\n if (currentSelectables[key]) {\r\n lodash.remove(scope.selected, selectable.item);\r\n unselect(selectable, key);\r\n } else {\r\n scope.selected.push(selectable.item);\r\n select(selectable, key);\r\n }\r\n }\r\n\r\n function select(selectable, key) {\r\n currentSelectables[key] = selectable;\r\n selectCtrl.select(selectable);\r\n }\r\n\r\n function unselect(selectable, key) {\r\n delete currentSelectables[key];\r\n selectCtrl.unselect(selectable);\r\n }\r\n\r\n // only if element is being removed from dom\r\n function removeSelectable(selectable) {\r\n var key = selectCtrl.getSelectableKey(selectable.item);\r\n delete currentSelectables[key];\r\n lodash.remove(scope.selected, selectable.item);\r\n }\r\n\r\n function addSelectable(selectable) {\r\n var selectableKey = selectCtrl.getSelectableKey(selectable.item);\r\n var isSelected = lodash.any(scope.selected, function (s) {\r\n return selectCtrl.getSelectableKey(s) === selectableKey;\r\n });\r\n if (isSelected) {\r\n select(selectable, selectableKey);\r\n }\r\n }\r\n\r\n }\r\n };\r\n}\r\nangular.module(\"vh.select\")\r\n.directive(\"vhMultiSelect\", MultiSelectDirective);\r\n","function vhSingleSelectDirective() {\r\n return {\r\n restict: \"A\",\r\n require: [\"vhSelect\", \"ngModel\"],\r\n scope: true,\r\n link: function (scope, elem, attrs, ctrls) {\r\n var selectCtrl = ctrls[0];\r\n var ngModelCtrl = ctrls[1];\r\n var currentSelectable = null;\r\n var delegate = {\r\n clickedSelectable: clickedSelectable,\r\n removeSelectable: removeSelectable,\r\n addSelectable: addSelectable\r\n };\r\n selectCtrl.delegate = delegate;\r\n\r\n ngModelCtrl.$render = function () {\r\n if (currentSelectable !== null) {\r\n selectCtrl.unselect(currentSelectable);\r\n }\r\n if (ngModelCtrl.$viewValue === undefined) {\r\n currentSelectable = null;\r\n } else {\r\n var newSelected = selectCtrl.selectables[ngModelCtrl.$viewValue];\r\n if (newSelected !== undefined) {\r\n currentSelectable = newSelected;\r\n selectCtrl.select(currentSelectable);\r\n }\r\n }\r\n };\r\n\r\n function clickedSelectable(selectable) {\r\n if (currentSelectable !== selectable) {\r\n if (currentSelectable !== null) {\r\n selectCtrl.unselect(currentSelectable);\r\n }\r\n currentSelectable = selectable;\r\n selectCtrl.select(selectable);\r\n ngModelCtrl.$setViewValue(currentSelectable.item);\r\n } else if (currentSelectable !== null) {\r\n selectCtrl.unselect(currentSelectable);\r\n currentSelectable = null;\r\n ngModelCtrl.$setViewValue(null);\r\n }\r\n }\r\n\r\n function addSelectable(selectable) {\r\n var value = selectCtrl.getSelectableKey(selectable.item);\r\n if (ngModelCtrl.$viewValue !== undefined && selectCtrl.getSelectableKey(ngModelCtrl.$viewValue) === value) {\r\n selectCtrl.select(selectable);\r\n currentSelectable = selectable;\r\n }\r\n }\r\n\r\n function removeSelectable(selectable) {\r\n if (currentSelectable === selectable) {\r\n currentSelectable = null;\r\n ngModelCtrl.$setViewValue(null);\r\n }\r\n }\r\n }\r\n };\r\n}\r\nangular.module(\"vh.select\")\r\n.directive(\"vhSingleSelect\", vhSingleSelectDirective);\r\n","function vhSliderDirective() {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-slider/vh-slider.tpl.html\",\r\n scope: {\r\n enabled: \"@?\",\r\n spacing: \"=?\",\r\n editable: \"=?\",\r\n enableTooltip: \"=?\",\r\n itemId: \"=?\",\r\n labelValue: \"=?\",\r\n slidervalue:\"=\",\r\n disableTooltip:\"=?\",\r\n onSelectionChange : \"&\"\r\n },\r\n controller: function($scope){\r\n $scope.enabledToggled = function() {\r\n $scope.slidervalue = !$scope.slidervalue;\r\n $scope.onSelectionChange({'id':$scope.itemId, 'value': $scope.slidervalue });\r\n }\r\n }\r\n }\r\n}\r\nangular.module(\"vh-slider\").directive(\"vhSlider\", vhSliderDirective);\r\n\r\n\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-slider/vh-slider.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","angular.module(\"vh.ui.avatar\", []).directive('vhUiAvatar', function($window, $timeout) {\r\n function link(scope, elem, attrs) {\r\n // Defaults\r\n scope.placeholder = attrs.placeholder || 'generic';\r\n var autosize = scope.$eval(attrs.autosize);\r\n autosize = autosize !== undefined ? autosize : true;\r\n var autosizeflag = scope.$eval(attrs.autosizeflag);\r\n var plusate = scope.$eval(attrs.pulsate) || false;\r\n\r\n // Functions\r\n function getRandomInt(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n }\r\n\r\n // Set the image\r\n if (scope.image) {\r\n if (scope.image == 'randomMale' || scope.image == 'randomFemale') {\r\n var randMax = 27;\r\n var gender = 'male';\r\n if (scope.image.indexOf(\"Female\") > -1) {\r\n randMax = 13;\r\n gender = 'female';\r\n }\r\n var randIllustrated = getRandomInt(1, randMax);\r\n\r\n elem.addClass('illustrated');\r\n elem.addClass(gender + '-' + randIllustrated);\r\n } else {\r\n scope.imageStyle = {backgroundImage: 'url(' + scope.image + ')'};\r\n }\r\n }\r\n\r\n // Set the autosizeflag\r\n if (autosizeflag) {\r\n elem.addClass('autosizeflag');\r\n }\r\n\r\n // Add a margin below if it has labels or sublabels\r\n if (scope.label && scope.sublabel) {\r\n elem.css('margin-bottom', '25px');\r\n } else if (scope.label) {\r\n elem.css('margin-bottom', '18px');\r\n }\r\n\r\n if (attrs.desaturate) {\r\n elem.addClass('desaturate');\r\n }\r\n\r\n if (autosize) {\r\n angular.element($window).on(\"resize\", resize);\r\n $timeout(resize);\r\n scope.$on(\"$destroy\", function () {\r\n angular.element($window).off(\"resize\", resize);\r\n });\r\n }\r\n\r\n function resize() {\r\n if (autosize) {\r\n var newSize = elem.children()[0].offsetWidth;\r\n scope.panelStyle = {width: newSize + \"px\", height: newSize+\"px\"};\r\n scope.labelsStyle = {width: newSize + \"px\"};\r\n }\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n image: \"@\",\r\n label: \"@?\",\r\n sublabel: \"@?\",\r\n gender: \"@?\"\r\n },\r\n template: \r\n '
    ' +\r\n '
    ' +\r\n '
    ' +\r\n '
    ' +\r\n '
    ' +\r\n '
    {{label}}
    ' +\r\n '
    {{sublabel}}
    ' +\r\n '
    ' +\r\n '
    '\r\n };\r\n\r\n});\r\n","\r\nvar vhChartinjects = ['$scope', 'SurveyParameterType','AlertSeverityLevel', 'AlertStatus', 'MonitoringEventsService', 'PermissionService', '$timeout'];\r\nvar vhChartScope = { \r\n // specific to angular chart js\r\n chartData: '=',\r\n chartLabels: '=', // in angular 2 typescript this would be on the class as @input() chartLabels: string[]\r\n chartOptions: '=',\r\n chartSeries: '=',\r\n chartColors: '=',\r\n chartDatasetOverride: '=',\r\n \r\n // custom \r\n expanded: '=',\r\n backgroundColor: '@',\r\n startDate: '=',\r\n endDate: '=',\r\n selectedDate: '=',\r\n showGraphHeader: '='\r\n};\r\nvar vhChartProperties = {\r\n startDate: { default: new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()), watch(newValue) { this.updateDates(); } },\r\n endDate: { default: new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()).addDays(-14), watch(newValue) { this.updateDates(); } },\r\n viewStart: { default: new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()) },\r\n viewEnd: { default: new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()).addDays(-14) },\r\n selectedDate: { default: null},\r\n showGraphHeader: { default: false },\r\n alerts: {default: []},\r\n allowCollapse: { default: true},\r\n allowAlertSelect: { \r\n\r\n default: {\r\n default: false,\r\n canWriteNotifications: false,\r\n canWriteAlerts: false,\r\n setEnabled: function(value){\r\n this.default = value === true;\r\n },\r\n setPermissions: function(canWriteNotifications, canWriteAlerts){\r\n this.canWriteNotifications = canWriteNotifications;\r\n this.canWriteAlerts = canWriteAlerts;\r\n },\r\n canClick: function(alertLevel, alertStatus){\r\n\r\n var isNew = alertStatus == 'New' || alertStatus == 'new' || alertStatus == 1 || alertStatus == '1';\r\n var isNotification = alertLevel == 'Notification' || alertLevel == 'notification' || alertLevel == 4 || alertLevel == '4';\r\n\r\n return this.default && isNew && isNotification ? this.canWriteNotifications : this.canWriteAlerts;\r\n }\r\n }\r\n \r\n },\r\n pointRadius: { default: 3 },\r\n alertRadius: { default: 4 },\r\n expanded: { default: true },\r\n chartData: { required: true, watch(){ this.convertBiometricInfoToDatasets(); }},\r\n chartColors: { default: ['#BEBEBE', '#B1B1B1', '#A3A3A3', '#979797'] },\r\n chartLabels: {},\r\n chartSeries: { required: false},\r\n radius: {\r\n default: {\r\n default: 3,\r\n alert: 4,\r\n collapsed: 2,\r\n alertCollapsed: 3,\r\n fromAlertLevel: function(alertLevel, collapsed = false, selected = false){\r\n switch(alertLevel){\r\n case 'Notification':\r\n case 'notification':\r\n case '4':\r\n case 4:\r\n case 'Medium':\r\n case 'medium':\r\n case '2':\r\n case 2:\r\n case 'Danger':\r\n case 'danger':\r\n case '1':\r\n case 1:\r\n return collapsed ? this.alertCollapsed + (selected ? 1 : 0) : this.alert + (selected ? 2 : 0);\r\n default:\r\n return collapsed ? this.collapsed + (selected ? 1 : 0) : this.default + (selected ? 2 : 0);\r\n } \r\n }\r\n\r\n }\r\n },\r\n colors: { \r\n default: {\r\n backgroundColor: '#ffffff',\r\n line: '#DEDEDE',\r\n default: '#7b91b6',\r\n primary: '#3871D0',\r\n info: '#BBBBBF',\r\n warning: '#FEC037',\r\n danger: '#A62317',\r\n fromAlertLevel: function(alertLevel){\r\n switch(alertLevel){\r\n case 'Notification':\r\n case 'notification':\r\n case '4':\r\n case 4:\r\n return this.primary;\r\n case 'Medium':\r\n case 'medium':\r\n case '2':\r\n case 2:\r\n return this.warning;\r\n case 'High':\r\n case 'high':\r\n case 'Danger':\r\n case 'danger':\r\n case '1':\r\n case 1:\r\n return this.danger;\r\n // case 'None':\r\n // case 'none':\r\n // case '3':\r\n // case 3:\r\n // return this.info; \r\n default:\r\n return this.default;\r\n }\r\n }\r\n } \r\n }\r\n }\r\n\r\nclass VhUiBiometricGraphDirective {\r\n\r\n constructor(){\r\n\r\n this.restrict = 'E';\r\n this.scope = vhChartScope;\r\n this.controllerAs = 'graph';\r\n this.controller = 'vhUiBiometricGraphController';\r\n this.templateUrl = \"components/vh-ui-biometric-graph/vh-ui-biometric-graph.tpl.html\";\r\n\r\n }\r\n\r\n \r\n}\r\n\r\nclass VhUiBiometricGraphController {\r\n \r\n // I would love to move this functionality to something that can be injected/imported\r\n constructor(){ // removed parameters so we can dynamically inject by changing the injects array at the top of file\r\n\r\n // set properties based on passed in injected parameters\r\n [...arguments].forEach((argument, index) => this[vhChartinjects[index]] = argument);\r\n\r\n Object.keys(vhChartProperties).forEach(prop => {\r\n var property = vhChartProperties[prop];\r\n var scopeValue = this.$scope[prop];\r\n \r\n if(property.required && scopeValue == null)\r\n throw `Attribute ${prop} is required`\r\n \r\n // set the property to the scope value or the default value defined above\r\n this[prop] = scopeValue || property.default;\r\n \r\n // if we have watch logic set up a $scope watch to update local data\r\n if(property.watch){\r\n this.$scope.$watch(prop, newValue => {\r\n this[prop] = newValue;\r\n Reflect.apply(property.watch, this, [newValue])\r\n });\r\n }else{ // else let's set up a default that will update our controller values when scope values change\r\n //this.$scope.$watch(prop, newValue => this[prop] = newValue);\r\n }\r\n });\r\n\r\n this.data = [[]];\r\n \r\n this.chart = new Promise(res => {\r\n this.resolveChart = res;\r\n });\r\n\r\n this.initializeOptions(); \r\n \r\n this.allowAlertSelect.setEnabled(true);\r\n this.allowAlertSelect.setPermissions(this.PermissionService.userHasPermission(['PatientNotificationsWrite']), this.PermissionService.userHasPermission(['PatientAlertsWrite']));\r\n \r\n var graph = this;\r\n this.events = {\r\n chartCreated: (chart)=> {\r\n graph._chart = chart;\r\n graph.resolveChart(chart);\r\n graph.updatePoints();\r\n },\r\n destroy: (chart)=> { \r\n graph._chart = null;\r\n graph.chart = new Promise(res => {\r\n graph.resolveChart = res;\r\n }) \r\n },\r\n afterDatasetsUpdate: (chart)=>{\r\n\r\n \r\n \r\n if(chart.data.datasets.length > 1)\r\n {\r\n chart.data.datasets.forEach((dataset, index)=>{\r\n dataset.fill = index-1;\r\n });\r\n graph.updatePoints(chart);\r\n }\r\n \r\n \r\n },\r\n beforeDatasetDrawx: (chart, args)=>{\r\n if(this.selected && args.easingValue == 1){\r\n \r\n const offset = (this.alertRadius / 2) + 2;\r\n const { index: dataIndex, meta } = args;\r\n const points = meta.data;\r\n const { length: dsLength } = chart.data.datasets;\r\n const adjustedMap = []; // keeps track of adjustments to prevent double offsets\r\n\r\n points.forEach((point, pointIndex)=>{\r\n //console.log(point) \r\n });\r\n \r\n \r\n }\r\n \r\n }\r\n };\r\n \r\n this.chartOptions.backgroundColor = this.backgroundColor;\r\n this.chartOptions.plugins.datalabels.formatter = (value, context) => {\r\n return value.hide || !this.expanded ? '' : `${value.y}`; // !this.expanded ? '' : value.y;\r\n }\r\n \r\n this.MonitoringEventsService.onExpandCurrentGraphs((expanding) => {\r\n this.expanded = expanding;\r\n\r\n if(this._chart)\r\n { \r\n this.updateMargins();\r\n this.updateChart();\r\n }\r\n });\r\n\r\n this.MonitoringEventsService.onBiometricsLoaded((data)=>{\r\n var chartData = data.find(x => x.name == this.id);\r\n this.chartData = chartData;\r\n this.convertBiometricInfoToDatasets();\r\n });\r\n\r\n this.MonitoringEventsService.onDisplayTypeChanged((dataType) => {\r\n this.expanded = true;\r\n });\r\n\r\n }\r\n\r\n _getAlertSeverityLevel(idOrName){\r\n if(typeof idOrName == 'string')\r\n return this.AlertSeverityLevel[Object.keys(this.AlertSeverityLevel)==idOrName];\r\n else\r\n return Object.keys(this.AlertSeverityLevel).find(key => this.AlertSeverityLevel[key] == idOrName);\r\n }\r\n\r\n initializeOptions(){\r\n\r\n var graph = this;\r\n\r\n this.chartOptions = {\r\n maintainAspectRatio: false,\r\n spanGaps: true,\r\n animation: {\r\n duration: 500\r\n },\r\n onClick: function(event, elements){\r\n\r\n var dataPoints = elements.map(x => graph.data[x._datasetIndex][x._index]);\r\n\r\n if(dataPoints.length == 0){\r\n if(graph.allowCollapse){\r\n graph.toggleExpand();\r\n } \r\n return;\r\n }\r\n \r\n var canClick = dataPoints.find(x => x.hasAlerts && graph.allowAlertSelect.canClick(x.alertLevel, x.alertStatus) ) != null;\r\n if(canClick){\r\n dataPoints.forEach(x => x.selected = !x.selected);\r\n var alertIds = dataPoints.map(x => x.alerts).flat().map(x => x.PatientAlertId);\r\n var alerts = graph.alerts.filter(x => alertIds.indexOf(x.PatientAlertId) > -1);\r\n alerts.forEach(x => {\r\n x.selected = dataPoints[0].selected;\r\n x.updateSelected();\r\n }); \r\n graph.updatePoints();\r\n }\r\n },\r\n plugins: {\r\n // Change options for ALL labels of THIS CHART\r\n datalabels: {\r\n display: 'true',\r\n align: 'top',\r\n offset: 2,\r\n font: {\r\n size: 10,\r\n } \r\n },\r\n vhEvents: {\r\n \r\n },\r\n filler: {\r\n propagate: false\r\n }\r\n },\r\n layout: {\r\n padding: {\r\n top: 20,\r\n topCollapsed: 10,\r\n topExpanded: 20,\r\n right: 0,\r\n left: 0,\r\n bottom: 5\r\n }\r\n },\r\n scales: { \r\n xAxes: [{\r\n display: false,\r\n gridLines: {\r\n color: 'transparent',\r\n drawOnChartArea: false\r\n },\r\n bounds: 'ticks',\r\n type: 'time',\r\n time: {\r\n unit: 'minute',\r\n round: 'minute',\r\n minUnit: 'minute',\r\n }, \r\n ticks: {\r\n display: false,\r\n source: 'labels',\r\n min: new Date(),\r\n max: new Date(),\r\n stepSize: 1440 \r\n }\r\n }],\r\n yAxes: [{\r\n display: false, //this will remove all the y-axis grid lines\r\n gridLines: {\r\n color: 'transparent',\r\n drawBorder: false,\r\n drawOnChartArea: false\r\n },\r\n ticks: {\r\n display: false,\r\n min: 0,\r\n max: 0\r\n }\r\n }]\r\n },\r\n tooltips: {\r\n // Disable the on-canvas tooltip\r\n enabled: false,\r\n mode: 'index',\r\n caretPadding: 2,\r\n caretSize: 5,\r\n fontSize: '10px',\r\n callbacks: {\r\n title(tooltipItems, data){\r\n var firstItem = data.datasets[tooltipItems[0].datasetIndex].data.find(x => x.unit) || {};\r\n var unit = tooltipItems.length > 0 && data.datasets.length > 0 &&\r\n data.datasets[tooltipItems[0].datasetIndex].data.length > 0 && firstItem.unit ? `${firstItem.unit}` : ''\r\n \r\n unit = graph.chartOptions.title.toLowerCase() == unit.toLowerCase() ? '' : unit;\r\n unit = unit.length > 0 ? ` (${unit})` : '';\r\n\r\n tooltipItems.forEach(_ => {\r\n var item = data.datasets[_.datasetIndex].data[_.index];\r\n _.label = moment(item.actualX).format('MM/DD/YYYY hh:mm')\r\n _.xLabel = moment(item.actualX).format('MM/DD/YYYY hh:mm')\r\n });\r\n\r\n tooltipItems = tooltipItems.map(x => x.label).filter((value, index, self)=> { return self.indexOf(value) === index });\r\n\r\n var titles = [`${this._chartInstance.options.title} ${unit}`, ...tooltipItems];\r\n return titles;\r\n },\r\n label(tooltipItem, data){\r\n var labels = [];\r\n data.datasets.forEach(dataset => {\r\n var item = dataset.data[tooltipItem.index]; \r\n labels.push(item); \r\n });\r\n return labels;\r\n }\r\n }, \r\n custom(tooltipModel, data) {\r\n \r\n if(graph.dragging){\r\n return null;\r\n }\r\n\r\n // Tooltip Element\r\n var tooltipEl = document.getElementById('chartjs-tooltip');\r\n \r\n \r\n \r\n // Create element on first render\r\n if (!tooltipEl) {\r\n tooltipEl = document.createElement('div');\r\n tooltipEl.className = \"\";\r\n tooltipEl.id = 'chartjs-tooltip';\r\n tooltipEl.innerHTML = '
    ';\r\n document.body.appendChild(tooltipEl);\r\n }\r\n \r\n // Hide if no tooltip\r\n if (tooltipModel.opacity === 0 || tooltipModel.dataPoints.find(x => x.isFirst || x.isLast)) {\r\n tooltipEl.style.opacity = 0;\r\n return;\r\n }\r\n \r\n // Set caret Position\r\n tooltipEl.classList.remove('above', 'below', 'no-transform');\r\n if (tooltipModel.yAlign) {\r\n tooltipEl.classList.add(tooltipModel.yAlign);\r\n } else {\r\n tooltipEl.classList.add('no-transform');\r\n }\r\n \r\n function getBody(bodyItem) {\r\n return (bodyItem.lines || []);\r\n }\r\n \r\n // Set Text\r\n if (tooltipModel.body) {\r\n var titleLines = tooltipModel.title || [];\r\n var bodyLines = tooltipModel.body.map(getBody).flat().filter((value, index, self)=> { return self.map(x => JSON.stringify(x)).indexOf(JSON.stringify(value)) === index });\r\n \r\n var innerHtml = '';\r\n \r\n titleLines.forEach(function(title) {\r\n innerHtml += '' + title + '';\r\n });\r\n innerHtml += '';\r\n \r\n var cellStyle = 'vertical-align:top;padding:5px;';\r\n var legendStyle = 'display:inline-block;width:20px;height:20px;text-align:center;verticle-align:middle;color:#ffffff;font-size:larger;';\r\n var hidden = false;\r\n var alerts = [];\r\n bodyLines.forEach(item => {\r\n hidden = hidden || item.hide === true;\r\n\r\n if(!item.hide){\r\n var label = `${item.toopTipLabel}`.trim();\r\n var style = `${legendStyle}background:${item.legendColor};`;\r\n style += '; border-color: #ffffff';\r\n style += '; border-width: 1px';\r\n var span = '
    ';\r\n innerHtml += `${span}${label}`;\r\n \r\n alerts = alerts.concat(item.alerts || []).filter((value, index, self)=> { return self.map(x => JSON.stringify(x)).indexOf(JSON.stringify(value)) === index });\r\n \r\n }\r\n\r\n });\r\n\r\n if(!hidden){\r\n \r\n\r\n if(alerts.length > 0){\r\n var addedAlerts = [];\r\n innerHtml += `
    `;\r\n\r\n alerts.forEach((alert, index) => {\r\n\r\n var iconColor = graph.colors.fromAlertLevel(alert.AlertSeverityLevel);\r\n \r\n if(addedAlerts.indexOf(alert.PatientAlertId) == -1){\r\n addedAlerts.push(alert.PatientAlertId);\r\n innerHtml += `
    ` + \r\n `
    ${alert.Message}`;\r\n }\r\n\r\n });\r\n }\r\n }\r\n innerHtml += '';\r\n \r\n var tableRoot = tooltipEl.querySelector('table');\r\n tableRoot.innerHTML = innerHtml;\r\n \r\n \r\n }\r\n \r\n // `this` will be the overall tooltip\r\n var position = this._chart.canvas.getBoundingClientRect();\r\n \r\n // Display, position, and set styles for font\r\n tooltipEl.style.opacity = hidden ? 0 : 1;\r\n tooltipEl.style.position = 'absolute';\r\n tooltipEl.style.left = position.left + window.pageXOffset + tooltipModel.caretX + 'px';\r\n tooltipEl.style.top = position.top + window.pageYOffset + tooltipModel.caretY + 10 + 'px';\r\n tooltipEl.style.fontFamily = tooltipModel._bodyFontFamily;\r\n tooltipEl.style.fontSize = tooltipModel.bodyFontSize + 'px';\r\n tooltipEl.style.fontStyle = tooltipModel._bodyFontStyle;\r\n tooltipEl.style.padding = tooltipModel.yPadding + 'px ' + tooltipModel.xPadding + 'px';\r\n tooltipEl.style.pointerEvents = 'none';\r\n }\r\n }, \r\n }\r\n \r\n }\r\n\r\n getData(datasetIndex, dataIndex){\r\n return this.data[datasetIndex][dataIndex];\r\n };\r\n\r\n _distinct(arr){\r\n return (arr || []).filter((value, index, self)=> { return self.map(x => JSON.stringify(x)).indexOf(JSON.stringify(value)) === index });\r\n }\r\n\r\n get datasets(){\r\n return this._chart.data.datasets;\r\n }\r\n\r\n get events(){\r\n return this._chart && this._chart.options ? this._chart.options.plugins.vhEvents : this.chartOptions.plugins.vhEvents;\r\n }\r\n\r\n set events(value){\r\n this._chart && this._chart.options ? this._chart.options.plugins.vhEvents = value : this.chartOptions.plugins.vhEvents = value;\r\n }\r\n \r\n get hasData(){\r\n return (this.data || []).map(x => x).flat().length > 0;\r\n }\r\n\r\n get maxY(){\r\n return this.chartOptions.scales.yAxes[0].ticks.max;\r\n }\r\n\r\n set maxY(value){\r\n this.chartOptions.scales.yAxes[0].ticks.max = value;\r\n }\r\n\r\n get minY(){\r\n return this.chartOptions.scales.yAxes[0].ticks.min;\r\n }\r\n\r\n set minY(value){\r\n this.chartOptions.scales.yAxes[0].ticks.min = value;\r\n }\r\n\r\n get maxX(){\r\n return this.chartOptions.scales.xAxes[0].ticks.max;\r\n }\r\n\r\n set maxX(value){\r\n this.chartOptions.scales.xAxes[0].ticks.max = value;\r\n }\r\n\r\n get minX(){\r\n return this.chartOptions.scales.xAxes[0].ticks.min;\r\n }\r\n\r\n set minX(value){\r\n this.chartOptions.scales.xAxes[0].ticks.min = value;\r\n }\r\n\r\n get dataPointWidth() {\r\n return this.expanded ? 30 : 15;\r\n }\r\n\r\n get dataPointsMargin(){\r\n return 2; //hours\r\n }\r\n\r\n stopPropogation($event){\r\n if($event){\r\n var method = ($event.stopPropogation || $event.stopImmediatePropagation);\r\n if(method)\r\n method();\r\n }\r\n }\r\n\r\n updatePoints(chart){\r\n\r\n this.chart.then((_chart)=>{\r\n chart = chart || _chart;\r\n chart.data.datasets.forEach((dataset, index) => {\r\n\r\n if(typeof dataset.pointHoverBackgroundColor != 'function'){\r\n\r\n dataset.pointHoverBackgroundColor = (context)=>{\r\n var dataPoint = this.getData(context.datasetIndex,context.dataIndex);\r\n return dataPoint.legendColor;\r\n };\r\n \r\n dataset.pointHoverBorderColor = (context)=>{\r\n var dataPoint = this.getData(context.datasetIndex,context.dataIndex);\r\n return dataPoint.legendColor;\r\n };\r\n \r\n dataset.pointBorderColor = (context)=>{\r\n var dataPoint = this.getData(context.datasetIndex,context.dataIndex);\r\n return dataPoint.pointColor;\r\n };\r\n \r\n dataset.pointBorderColor = (context)=>{\r\n var dataPoint = this.getData(context.datasetIndex,context.dataIndex);\r\n return dataPoint.pointColor;\r\n };\r\n \r\n dataset.pointStyle = (context)=>{\r\n var dataPoint = this.getData(context.datasetIndex,context.dataIndex);\r\n return dataPoint.pointStyle;\r\n };\r\n \r\n dataset.pointBackgroundColor = (context)=>{\r\n var dataPoint = this.getData(context.datasetIndex,context.dataIndex);\r\n return dataPoint.fillColor;\r\n };\r\n \r\n dataset.pointRadius = (context)=>{\r\n var dataPoint = this.getData(context.datasetIndex,context.dataIndex);\r\n return dataPoint.pointRadius;\r\n };\r\n \r\n }\r\n \r\n \r\n\r\n });\r\n }); \r\n }\r\n\r\n updateChart(){\r\n if(this._chartTimeout)\r\n return;\r\n\r\n this._chartTimeout = this.$timeout(()=>{\r\n this.chart.then(()=>{\r\n this._chart.update();\r\n this.updatePoints();\r\n });\r\n\r\n this._chartTimeout = null;\r\n }, 250);\r\n }\r\n\r\n changeView(start, end){\r\n\r\n if(this.selectedDate){\r\n start = this.selectedDate.clone();\r\n end = this.selectedDate.clone().addDays(1);\r\n\r\n }else if(this.selected == start)\r\n {\r\n start = null;\r\n end = null;\r\n }\r\n \r\n\r\n this.selected = start;\r\n this.viewStart = (start || this._minX).clone().removeTime();\r\n this.viewEnd = (end || this._maxX).clone().removeTime();\r\n \r\n var minX = this.viewStart.clone();\r\n var maxX = this.viewEnd.clone().addDays(this.selected ? 0 : 1);\r\n\r\n var data = this._allData; \r\n\r\n if(this.selected && data){\r\n \r\n this.chartOptions.scales.xAxes[0].ticks.stepSize = 1440;\r\n data = data.map(dataset => dataset.filter(x => x.actualX >= this.viewStart && x.actualX <= this.viewEnd || x.hide))\r\n\r\n data.forEach((dataset) => {\r\n dataset.forEach((point, pointIndex)=>{\r\n var overLapping = dataset.filter((point2, index) => index > pointIndex && point2.x < point.x.clone().addHours(1) );\r\n if(overLapping.length > 0){\r\n overLapping.forEach((x, index) => {\r\n x.addHours(1);\r\n var furtherUpdates = dataset.filter((point2, index2) => index2 > index && !point2.hide);\r\n furtherUpdates.forEach(p => p.addHours(1));\r\n });\r\n }\r\n });\r\n });\r\n \r\n\r\n }else if(data) {\r\n this.chartOptions.scales.xAxes[0].ticks.stepSize = 1440;\r\n\r\n data.forEach((dataset, datasetIndex) => {\r\n dataset.forEach(dataPoint => dataPoint.reset());\r\n });\r\n }\r\n \r\n this.data = data;\r\n\r\n this.minX = minX;\r\n this.maxX = maxX;\r\n\r\n this.updateChart();\r\n \r\n }\r\n\r\n updateMargins(){\r\n this.chartOptions.layout.padding.top = this.expanded ? \r\n this.chartOptions.layout.padding.topExpanded : \r\n this.chartOptions.layout.padding.topCollapsed;\r\n }\r\n\r\n updateDates(){\r\n this.dates = [];\r\n var date = this.startDate.removeTime();\r\n while(date <= this.endDate){\r\n this.dates.push(date);\r\n date = date.clone().addDays(1);\r\n }\r\n this.minX = this.startDate.removeTime();\r\n this.maxX = this.endDate.removeTime();\r\n }\r\n\r\n formatDate(date){\r\n return moment(date).format('MM/DD');\r\n }\r\n\r\n toggleExpand($event){\r\n this.stopPropogation($event);\r\n this.expanded = !this.expanded;\r\n\r\n this.updateMargins();\r\n this.updateChart();\r\n }\r\n\r\n convertBiometricInfoToDatasets(){\r\n if(this.chartData){\r\n \r\n var graph = this;\r\n\r\n if(this.data && this.data.length > 0)\r\n {\r\n this.data.splice(1);\r\n\r\n this.data.forEach(dataset => {\r\n dataset.splice(0, dataset.length);\r\n });\r\n }\r\n\r\n this.alerts = [];\r\n\r\n var biometricInfo = this.chartData;\r\n \r\n \r\n this._minX = this.startDate.clone();\r\n this._maxX = this.endDate.clone();\r\n \r\n var ignoredParameterTypes = ['ReadingType',\r\n 'Survey',\r\n 'Video',\r\n 'Health Tip',\r\n 'ReadingDeviceModel',\r\n 'UnitType', 'Address1',\r\n 'Address2',\r\n 'City',\r\n 'State',\r\n 'Zip',\r\n 'Information',\r\n 'Date',\r\n 'Time'];\r\n\r\n var idToParameterTypeName = (id)=>{\r\n return Object.keys(this.SurveyParameterType).find(key => this.SurveyParameterType[key] == id);\r\n }\r\n \r\n var isParameterTypeDisplayed = (id)=>{\r\n return ignoredParameterTypes.indexOf(idToParameterTypeName(id)) == -1;\r\n }\r\n\r\n this.chartSeries = biometricInfo.parameterTypes\r\n .filter(isParameterTypeDisplayed)\r\n .map(x => idToParameterTypeName(x));\r\n \r\n\r\n var addMargins = (dataset, min, max) => {\r\n \r\n // get first and last y values\r\n \r\n var firstY = dataset.length > 0 ? dataset[0].y : 0;\r\n var lastY = dataset.length > 0 ? dataset[dataset.length - 1].y : 0;\r\n \r\n dataset.unshift({\r\n _adjustment: 0,\r\n hide: true,\r\n y: firstY,\r\n x: min,\r\n legendColor: 'transparent',\r\n pointColor: 'transparent',\r\n fillColor: 'transparent',\r\n pointStyle: 'circle',\r\n pointRadius: 1,\r\n get actualX(){\r\n if(this.x)\r\n return this.x.clone().addHours(-this._adjustment);\r\n },\r\n addHours(hours){\r\n this._adjustment += hours;\r\n return this.x.addHours(hours);\r\n },\r\n reset(){\r\n this.x.addHours(-this._adjustment);\r\n this._adjustment = 0;\r\n }\r\n });\r\n \r\n dataset.push({\r\n _adjustment: 0,\r\n hide: true,\r\n y: lastY,\r\n x: max,\r\n legendColor: 'transparent',\r\n pointColor: 'transparent',\r\n fillColor: 'transparent',\r\n pointStyle: 'circle',\r\n pointRadius: 1,\r\n get actualX(){\r\n if(this.x)\r\n return this.x.clone().addHours(-this._adjustment);\r\n },\r\n addHours(hours){\r\n this._adjustment += hours;\r\n return this.x.addHours(hours);\r\n },\r\n reset(){\r\n this.x.addHours(-this._adjustment);\r\n this._adjustment = 0;\r\n },\r\n });\r\n };\r\n\r\n var data = [];\r\n \r\n // each day\r\n biometricInfo.readings.map((r, index) => {\r\n // can have multiple readings\r\n return r.readings.filter(x => !x.isDeleted).map((reading, readingIndex) => {\r\n // which can have multip values\r\n var values = reading.response.Values;\r\n var alerts = reading.alerts;\r\n var tooltipMessages = reading.tooltipMessages;\r\n \r\n var unitTypeValue = (values.find(x => idToParameterTypeName(x.SurveyParameterTypeId) == 'UnitType') || {}).Value;\r\n \r\n // only create datapoints for allowed parameter types\r\n values.filter(v => isParameterTypeDisplayed(v.SurveyParameterTypeId))\r\n .forEach((value, valueIndex)=>{ \r\n \r\n // if we haven't added a dataset add it now\r\n if(data.length == valueIndex){\r\n data.push([]);\r\n }\r\n\r\n // convert alert severity level id to status\r\n\r\n var hide = false;\r\n var parameterType = idToParameterTypeName(value.SurveyParameterTypeId);\r\n \r\n alerts = alerts.filter(x => x.AlertStatusId == this.AlertStatus.New);\r\n this.alerts.push(alerts);\r\n this.alerts = this.alerts.flat();\r\n \r\n \r\n var alertKeys = ('PatientAlertId,AlertTypeId,AlertSeverityLevel,' + \r\n 'Message,Category,IconUrl,CreatedDateTime_UTC,' +\r\n 'icon,selected')\r\n .split(',');\r\n\r\n data[valueIndex].push({\r\n _adjustment: 0,\r\n datasetIndex: valueIndex,\r\n hide,\r\n selected: false,\r\n alertLevel: reading.alertLevel, \r\n alertStatus: reading.alertStatus,\r\n get actualX(){\r\n if(this.x)\r\n return this.x.clone().addHours(-this._adjustment);\r\n },\r\n addHours(hours = 1){\r\n this._adjustment += hours;\r\n return this.x.addHours(1);\r\n },\r\n reset(){\r\n this.x.addHours(-this._adjustment);\r\n this._adjustment = 0;\r\n },\r\n alerts: alerts.map(a => {\r\n \r\n var alert = {};\r\n alertKeys.forEach(key => {\r\n alert[key] = a[key];\r\n })\r\n \r\n return alert;\r\n }),\r\n tooltipMessages,\r\n toopTipLabel: `${value.Value} ${unitTypeValue || parameterType}`,\r\n y: value.Value,\r\n x: new Date(value.ObservationDateTime_UTC),\r\n unit: reading.unit,\r\n parameterType: parameterType,\r\n get hasAlerts(){\r\n return this.alerts.length > 0;\r\n },\r\n get legendColor(){\r\n return graph.colors.fromAlertLevel(this.alertLevel);\r\n },\r\n get pointStyle(){\r\n return this.selected ? 'rectRounded' : 'circle';\r\n },\r\n get pointColor(){\r\n return graph.colors.fromAlertLevel(this.alertLevel)\r\n },\r\n get fillColor(){\r\n return this.selected ? graph.colors.fromAlertLevel(this.alertLevel) : '#ffffff'\r\n },\r\n get pointRadius() {\r\n return graph.radius.fromAlertLevel(this.alertLevel, !graph.expanded, this.selected);\r\n }\r\n });\r\n\r\n });\r\n \r\n\r\n return data;\r\n });\r\n });\r\n\r\n data.forEach((dataset, datasetIndex)=>{\r\n dataset.sort((a, b)=> a.x > b.x ? 1 : -1);\r\n addMargins(dataset, this._minX.clone().addDays(-3), this._maxX.clone().addDays(3));\r\n });\r\n \r\n this.id = biometricInfo.name;\r\n this.chartOptions.title = this.id; \r\n \r\n var flattendData = data.map(_ => _.map(__ => __.y)).flat();\r\n\r\n this.minY = Math.min(...flattendData) - 10;\r\n this.maxY = Math.max(...flattendData) + 10;\r\n \r\n this._allData = data;\r\n \r\n this.changeView(null, null);\r\n \r\n\r\n }\r\n }\r\n\r\n\r\n}\r\n\r\n\r\nangular.module('vh.components')\r\n.directive('vhUiBiometricGraph', ()=> new VhUiBiometricGraphDirective())\r\n.controller('vhUiBiometricGraphController',[...vhChartinjects, function(){ return new VhUiBiometricGraphController(...arguments) }]);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-ui-biometric-graph/vh-ui-biometric-graph.tpl.html',\n '
    {{graph.formatDate(date)}}
    ');\n}]);\n}(window, document, window.angular));","function VhUiContentUidDirective(PermissionService, $timeout) {\r\n\r\n var defaultChunk = 4;\r\n\r\n return {\r\n restrict: \"E\",\r\n templateUrl: 'components/vh-ui-content-uid/vh-ui-content-uid.tpl.html',\r\n replace: false,\r\n scope: {\r\n uid: \"=\" ,\r\n openLeft: \"=\" ,\r\n buttonMode: \"=\" \r\n },\r\n link: function (scope, elem) {\r\n //#region Initialization\r\n \r\n function setTooltip(){\r\n var uid = scope.uid || '';\r\n if(uid.length <= defaultChunk || uid == '(empty)')\r\n scope.expandToolTip = uid;\r\n else\r\n scope.expandToolTip = uid.slice(0, defaultChunk) + '-' + uid.slice(uid.length - defaultChunk);\r\n }\r\n\r\n \r\n scope.showUid = false;\r\n scope.isToggled = false;\r\n scope.openRight = !scope.openLeft;\r\n\r\n scope.$watch('uid', function(){\r\n loadDirective();\r\n //#endregion\r\n })\r\n\r\n \r\n function loadDirective() {\r\n \r\n setTooltip();\r\n\r\n scope.identifier = (scope.uid || '').length > 0 ? scope.uid : '(empty)';\r\n \r\n scope.toggleUid = function($event){\r\n $event.stopPropagation();\r\n scope.isToggled = !scope.isToggled;\r\n };\r\n \r\n \r\n scope.copyUid = function($event, uid){\r\n $event.stopPropagation();\r\n var textArea = document.createElement(\"textarea\");\r\n textArea.value = uid;\r\n elem[0].appendChild(textArea);\r\n textArea.select();\r\n document.execCommand(\"Copy\");\r\n textArea.remove();\r\n \r\n scope.uidToolTip = 'Copied to clipboard! ';\r\n $timeout(setTooltip , 2000);\r\n }\r\n\r\n scope.showUid = PermissionService.userHasPermission(['ContentUIDRead']);\r\n \r\n }\r\n\r\n },\r\n controller: function () {\r\n\r\n }\r\n };\r\n}\r\n\r\n\r\nangular.module('vh.ui.content.uid',[]).directive('vhUiContentUid', VhUiContentUidDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-ui-content-uid/vh-ui-content-uid.tpl.html',\n '
    UID
    UID ');\n}]);\n}(window, document, window.angular));","angular.module(\"vh.ui.header\", []).directive('vhUiHeader', function($window) {\r\n\r\n function controller($scope, $element, $attrs) {\r\n var surroundElem = $element;\r\n var headerElem = angular.element(surroundElem.children()[0]);\r\n var status = $scope.$eval($attrs.status);\r\n var type = $scope.$eval($attrs.type) || '';\r\n\r\n if (status) {\r\n headerElem.addClass(status);\r\n }\r\n\r\n if ($scope.$eval($attrs.menu) === true) {\r\n headerElem.addClass('menued');\r\n }\r\n\r\n if ($scope.$eval($attrs.selectable) === true) {\r\n headerElem.addClass('selectable');\r\n }\r\n\r\n if ($scope.$eval($attrs.selected) === true) {\r\n headerElem.addClass('selected');\r\n }\r\n\r\n if (type !== '') {\r\n headerElem.addClass('vh-ui-header-' + type);\r\n }\r\n }\r\n\r\n function link(scope, elem, attrs) {\r\n var surroundElem = elem;\r\n var headerElem = angular.element(elem.children()[0]);\r\n var fixedMinWidth = scope.$eval(attrs.fixedMinWidth);\r\n var fixableRegistered = false;\r\n if (attrs.gradient) {\r\n headerElem.addClass('gradient');\r\n }\r\n\r\n if (scope.$eval(attrs.fixable)) {\r\n if (fixedMinWidth) {\r\n angular.element($window).on(\"resize\", resized);\r\n resized();\r\n } else {\r\n fixable();\r\n }\r\n }\r\n\r\n function resized() {\r\n var lessThanMinWidth = ($window.innerWidth < fixedMinWidth);\r\n if (lessThanMinWidth && fixableRegistered) {\r\n unfixable();\r\n } else if (!lessThanMinWidth && !fixableRegistered) {\r\n fixable();\r\n }\r\n }\r\n\r\n function fixable() {\r\n headerElem.addClass('fixable');\r\n scrolled();\r\n\r\n angular.element($window).on(\"scroll\", scrolled);\r\n scope.$on(\"$destroy\", function () {\r\n angular.element($window).off(\"scroll\", scrolled);\r\n });\r\n fixableRegistered = true;\r\n }\r\n\r\n function unfixable() {\r\n headerElem.removeClass('fixable');\r\n angular.element($window).off(\"scroll\", scrolled);\r\n pageIsOffsetBy(0);\r\n fixableRegistered = false;\r\n }\r\n\r\n function scrolled() {\r\n pageIsOffsetBy($window.pageYOffset);\r\n }\r\n\r\n function pageIsOffsetBy(offset) {\r\n var pageHeading = angular.element(document.getElementsByClassName(\"page-heading\")[0]);\r\n var wrapperContent = angular.element(document.getElementsByClassName(\"wrapper-content\")[0]);\r\n var bodyHideNav = angular.element(document.body).hasClass(\"hide-nav\");\r\n\r\n // Fade out the page header\r\n //*****The lower offset limit here was changed from 20 pixels to 50 to \"fix\" what appears to\r\n //be a bug in Microsoft Edge. See IHCP-4724.\r\n if (offset >= 50 && offset <= 90) {\r\n var newOp = 1 - (offset * 0.01) - 0.25;\r\n\r\n pageHeading.css('opacity', newOp);\r\n } else {\r\n pageHeading.css('opacity', 1);\r\n }\r\n\r\n // Fix the header\r\n //*****The lower offset limit here was changed from 20 pixels to 50 to \"fix\" what appears to\r\n //be a bug in Microsoft Edge. See IHCP-4724\r\n if (offset > 50) {\r\n if(!bodyHideNav){\r\n surroundElem.addClass('fixed');\r\n wrapperContent.css('padding-top', '166px');\r\n } \r\n // Hide the Page/Section Header\r\n pageHeading.addClass(\"ng-hide\");\r\n\r\n } else {\r\n surroundElem.removeClass('fixed');\r\n wrapperContent.css('padding-top', '');\r\n pageHeading.removeClass(\"ng-hide\");\r\n }\r\n }\r\n\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n template: '
    ' +\r\n '
    ',\r\n };\r\n\r\n})\r\n\r\n// Sections\r\n\r\n.directive('vhUiHeaderSections', function($window, $state) {\r\n return {\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n template: '
    '\r\n };\r\n\r\n})\r\n\r\n\r\n// Section\r\n\r\n.directive('vhUiHeaderSection', function($window, $state) {\r\n function link(scope, elem, attrs) {\r\n var width = attrs.width;\r\n var minWidth = attrs.minWidth;\r\n var maxWidth = attrs.maxWidth;\r\n var constrain = scope.$eval(attrs.contrain);\r\n\r\n if (scope.status) {\r\n elem.addClass(scope.status);\r\n }\r\n\r\n if (attrs.status !== undefined) {\r\n scope.$watch('status', function (newStatus, oldStatus) {\r\n if (oldStatus) {\r\n elem.removeClass(oldStatus);\r\n elem.addClass(newStatus);\r\n }\r\n });\r\n }\r\n\r\n if (scope.$eval(attrs.filled) === true) {\r\n elem.addClass('filled');\r\n }\r\n\r\n if (scope.$eval(attrs.linked)) {\r\n elem.addClass('linked');\r\n }\r\n if (scope.$eval(attrs.gradient)) {\r\n elem.addClass('gradient');\r\n }\r\n\r\n if (width) {\r\n elem.css('width', width);\r\n if (constrain) {\r\n elem.css('max-width', width);\r\n elem.css('min-width', width);\r\n }\r\n }\r\n\r\n if (minWidth) {\r\n elem.css('min-width', minWidth);\r\n }\r\n if (maxWidth) {\r\n elem.css('max-width', maxWidth);\r\n }\r\n\r\n if (constrain) {\r\n elem.css('white-space', 'no-wrap');\r\n }\r\n\r\n\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n scope: {\r\n status: \"@?\"\r\n },\r\n template: '
    '\r\n };\r\n\r\n})\r\n\r\n\r\n// Menu\r\n\r\n.directive('vhUiHeaderMenu', function($window, $state) {\r\n return {\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n template: '
    '\r\n };\r\n})\r\n\r\n// Menu Item\r\n\r\n.directive('vhUiHeaderMenuItem', function($window, $state) {\r\n function link(scope, elem, attrs) {\r\n var width = attrs.width;\r\n if (width) {\r\n elem.css('width', width);\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n scope: {\r\n id: \"@\",\r\n width: \"@\"\r\n },\r\n\r\n template: '
    '\r\n };\r\n\r\n})\r\n\r\n// Sub-Menu\r\n\r\n.directive('vhUiHeaderSubmenu', function($window, $state) {\r\n return {\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n template: '
    '\r\n };\r\n\r\n})\r\n\r\n// Sub-Menu Item\r\n\r\n.directive('vhUiHeaderSubmenuItem', function($window, $state) {\r\n function link(scope, elem, attrs) {\r\n var width = attrs.width;\r\n if (width) {\r\n elem.css('width', width);\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n template: '
    '\r\n };\r\n\r\n});\r\n","angular.module(\"vh.ui.metricgraph\", []).directive('vhUiMetricgraph', function () {\r\n\r\n // A way for directives to interact using the exposed API.\r\n function controller($scope, $rootScope, $window, $element, $timeout, lodash) {\r\n\r\n if (angular.isUndefined($scope.days)) $scope.days = 14;\r\n if (angular.isUndefined($scope.debug)) $scope.debug = false;\r\n if (angular.isUndefined($scope.data)) $scope.data = [];\r\n if (angular.isUndefined($scope.data2)) $scope.data2 = [];\r\n if (angular.isUndefined($scope.id)) $scope.id = 'vh-ui-metricgraph';\r\n if (angular.isUndefined($scope.showLabels)) $scope.showLabels = false;\r\n if (angular.isUndefined($scope.showAllLabels)) $scope.showAllLabels = false;\r\n if (angular.isUndefined($scope.showBaseline)) $scope.showBaseline = false;\r\n if (angular.isUndefined($scope.showDays)) $scope.showDays = false;\r\n if (angular.isUndefined($scope.showFill)) $scope.showFill = true;\r\n if (angular.isUndefined($scope.plotEnds)) $scope.plotEnds = false;\r\n if (angular.isUndefined($scope.interpolation)) $scope.interpolation = 'linear';\r\n if (angular.isUndefined($scope.showZoom)) $scope.showZoom = true;\r\n if (angular.isUndefined($scope.zoom)) $scope.zoom = false;\r\n if (angular.isUndefined($scope.partial)) $scope.partial = 'none';\r\n if (angular.isUndefined($scope.datamin)) $scope.datamin = 0;\r\n if (angular.isUndefined($scope.datamax)) $scope.datamax = 0;\r\n\r\n // Globals\r\n var svgPalette, svgPaletteView, viewHeight, viewWidth, yMin, yMax, yMinRange, yMaxRange, xMin, xMax, yRange, yDomain;\r\n\r\n $scope.zoomToggle = function(fn) {\r\n $scope.zoom = !$scope.zoom;\r\n $timeout($scope.update, 100);\r\n };\r\n\r\n // Create function to remove nodes based on value\r\n Array.prototype.removeValue = function(name, value) {\r\n array = lodash.map(this, function(v, i) {\r\n return v[name] === value ? null : v;\r\n });\r\n this.length = 0; //clear original array\r\n this.push.apply(this, array); //push all elements except the one we want to delete\r\n };\r\n\r\n $scope.svgDraw = function() {\r\n\r\n // Set the dimensions\r\n viewWidth = $element[0].offsetWidth;\r\n viewHeight = $element[0].offsetHeight;\r\n\r\n // Get the Domain - Y\r\n yMax = d3.max($scope.data, function(d) {\r\n return d.value;\r\n });\r\n yMin = d3.min($scope.data, function(d) {\r\n return d.value;\r\n });\r\n\r\n // -- Check the second data set\r\n if ($scope.data2.length > 0) {\r\n\r\n var yMin2 = d3.min($scope.data2, function(d) {\r\n return d.value;\r\n });\r\n var yMax2 = d3.max($scope.data2, function(d) {\r\n return d.value;\r\n });\r\n\r\n if (parseFloat(yMin2) < parseFloat(yMin)) yMin = parseFloat(yMin2);\r\n if (parseFloat(yMax2) > parseFloat(yMax)) yMax = parseFloat(yMax2);\r\n\r\n }\r\n\r\n var domainPadder;\r\n if ($scope.showLabels) {\r\n domainPadder = .3;\r\n } else {\r\n domainPadder = .05;\r\n }\r\n yDomain = [parseFloat(yMin) - (parseFloat(yMin) * domainPadder), parseFloat(yMax) + (parseFloat(yMax) * domainPadder)];\r\n\r\n\r\n // Draw the chart\r\n $scope.svgDrawChart = function() {\r\n\r\n // Remove all SVGs in the directive.\r\n d3.select($element[0]).select(\".vh-ui-metricgraph-data\").selectAll(\"svg\").remove();\r\n\r\n // Create the palette container.\r\n svgPalette = d3.select($element[0]).select(\".vh-ui-metricgraph-data\")\r\n .append(\"svg\")\r\n .attr(\"height\", viewHeight)\r\n .attr(\"width\", viewWidth)\r\n .attr(\"class\", \"vh-ui-metricgraph-canvas\");\r\n\r\n // Draw the view\r\n svgPaletteView = svgPalette.append(\"g\")\r\n .attr(\"height\", viewHeight)\r\n .attr(\"width\", viewWidth)\r\n .attr(\"class\", \"vh-ui-metricgraph-view\");\r\n\r\n };\r\n\r\n // Draw the days\r\n $scope.svgDrawDays = function() {\r\n\r\n if ($scope.showDays) {\r\n\r\n // Draw the Days\r\n var svgPaletteDays = svgPaletteView.append(\"g\")\r\n .attr(\"x\", 0)\r\n .attr(\"y\", 0)\r\n .attr(\"width\", viewWidth)\r\n .attr(\"height\", viewHeight)\r\n .attr(\"class\", \"vh-ui-metricgraph-days\");\r\n\r\n var svgPaletteDaysContainer = svgPaletteDays.append(\"rect\")\r\n .attr(\"x\", 0)\r\n .attr(\"y\", 0)\r\n .attr(\"width\", viewWidth)\r\n .attr(\"height\", viewHeight)\r\n .attr(\"stroke\", \"none\")\r\n .attr(\"fill\", \"none\");\r\n\r\n var i, day;\r\n\r\n var startX = 0;\r\n\r\n for (i = 0; i < $scope.days; i++) {\r\n\r\n day = {};\r\n\r\n var dayWidth = (viewWidth / $scope.days);\r\n var width = dayWidth;\r\n var height = viewHeight;\r\n\r\n // Draw the day\r\n var svgPaletteDay = svgPaletteDays.append(\"g\")\r\n .attr(\"class\", \"vh-ui-metricgraph-day\")\r\n .attr(\"width\", width)\r\n .attr(\"height\", height);\r\n\r\n // Draw the border\r\n day.dimensionsX1 = startX;\r\n day.dimensionsY1 = 0;\r\n day.dimensionsX2 = startX;\r\n day.dimensionsY2 = height;\r\n\r\n var newBackground = svgPaletteDay.append(\"rect\")\r\n .attr(\"x\", startX)\r\n .attr(\"y\", 0)\r\n .attr(\"width\", width)\r\n .attr(\"height\", height)\r\n .attr(\"class\", \"vh-ui-metricgraph-day-background\");\r\n\r\n var newBorder = svgPaletteDay.append(\"line\")\r\n .attr(\"x1\", day.dimensionsX1)\r\n .attr(\"y1\", day.dimensionsY1)\r\n .attr(\"x2\", day.dimensionsX2)\r\n .attr(\"y2\", day.dimensionsY2)\r\n .attr(\"class\", \"vh-ui-metricgraph-day-border\");\r\n\r\n startX = startX + dayWidth;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n // Draw the series\r\n $scope.svgDrawSeries = function(data, series) {\r\n\r\n var visibleData = data.filter(function( obj ) {\r\n return obj.state !== 'declined';\r\n });\r\n\r\n var series = (typeof series !== 'undefined') ? series : 1;\r\n\r\n var dayWidth = (viewWidth / $scope.days);\r\n\r\n var margin = {\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n left: 0\r\n },\r\n width = viewWidth - margin.left - margin.right,\r\n height = viewHeight - margin.top - margin.bottom;\r\n\r\n var x = d3.scaleTime()\r\n .range([0, width]);\r\n\r\n var y = d3.scaleLinear()\r\n .range([height, 0]);\r\n\r\n var xAxis = d3.axisBottom()\r\n .scale(x);\r\n\r\n var yAxis = d3.axisLeft()\r\n .scale(y);\r\n\r\n var fillStart;\r\n if (series == 1) {\r\n fillStart = 0;\r\n } else {\r\n fillStart = height;\r\n }\r\n\r\n var line = d3.line()\r\n .defined(function(d) {\r\n return d;\r\n })\r\n .x(function(d) {\r\n return x(d.date);\r\n })\r\n .y(function(d) {\r\n return y(d.value);\r\n })\r\n .curve(d3.curveCatmullRom);\r\n\r\n var area = d3.area()\r\n .defined(line.defined())\r\n .x(line.x())\r\n .y1(line.y())\r\n .y0(y(fillStart))\r\n .curve(d3.curveCatmullRom);\r\n\r\n if ($scope.showBaseline) {\r\n var baseline = d3.area()\r\n .x(function(d) {\r\n return x(d.date);\r\n })\r\n .y(function(d) {\r\n return y(d.baseline);\r\n })\r\n .curve(d3.curveCatmullRom);\r\n }\r\n\r\n var circleAttrs = {\r\n cx: function(d) {\r\n return xScale(d.x);\r\n },\r\n cy: function(d) {\r\n return yScale(d.y);\r\n },\r\n r: 20\r\n };\r\n\r\n var svg = d3.select($element[0]).select(\".vh-ui-metricgraph-view\")\r\n .append(\"g\")\r\n .attr(\"width\", viewWidth)\r\n .attr(\"height\", viewHeight)\r\n .attr(\"class\", \"vh-ui-metricgraph-set\")\r\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\r\n // Determine the domain of values to include in the graph\r\n x.domain(d3.extent(visibleData, function(d) {\r\n return d.date;\r\n }));\r\n y.domain(yDomain);\r\n\r\n // Massage the plot data\r\n var plotData = visibleData;\r\n\r\n // Remove the Declines\r\n // plotData.removeValue('state', 'declined');\r\n plotData = plotData.filter(function( obj ) {\r\n return obj.state !== 'declined';\r\n });\r\n\r\n // Remove the End\r\n if ($scope.partial == 'end' || $scope.partial == 'both') {\r\n\r\n // plotData.removeValue('state', 'end');\r\n plotData = plotData.filter(function( obj ) {\r\n return obj.state !== 'end';\r\n });\r\n\r\n }\r\n\r\n // Remove the Start\r\n if ($scope.partial == 'start' || $scope.partial == 'both') {\r\n\r\n // plotData.removeValue('state', 'start');\r\n plotData = plotData.filter(function( obj ) {\r\n return obj.state !== 'start';\r\n });\r\n }\r\n\r\n // Draw the plot\r\n var plot = svg.append(\"g\")\r\n .attr(\"class\", \"plot\");\r\n\r\n // Draw the Plot- Line\r\n var plotLine = plot.append(\"path\")\r\n .datum(plotData)\r\n .attr(\"class\", \"line\")\r\n .attr(\"d\", line);\r\n\r\n // Draw the Plot- Area\r\n if ($scope.showFill) {\r\n var plotFill = plot.append(\"path\")\r\n .datum(plotData)\r\n .attr(\"class\", \"area\")\r\n .attr(\"d\", area);\r\n }\r\n\r\n // Draw the Baseline\r\n if ($scope.showBaseline) {\r\n var plotBaseline = svg.append(\"path\")\r\n .datum(visibleData)\r\n .attr(\"class\", \"baseline\")\r\n .attr(\"d\", baseline);\r\n }\r\n\r\n // Draw the Baseline label\r\n if ($scope.showLabels && $scope.showBaseline) {\r\n var plotBaselineLabels = svg.append(\"text\")\r\n .attr(\"transform\", \"translate(\" + ((dayWidth * .0) + 5) + \",\" + (y(visibleData[0].baseline) - 6) + \")\")\r\n .attr(\"dy\", \".35em\")\r\n .attr(\"text-anchor\", \"start\")\r\n .attr(\"class\", \"baseline-label\")\r\n .text(\"Baseline: \" + visibleData[0].baseline + \" \" + visibleData[0].units);\r\n }\r\n\r\n // Draw the Value\r\n var value = svg.selectAll(\"g.value\")\r\n .data(visibleData)\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\", \"value\");\r\n\r\n // Draw the Value- Point\r\n var valuePoint = value.append(\"circle\")\r\n .attr(\"cy\", function(d, i) {\r\n return y(d.value);\r\n })\r\n .attr(\"cx\", function(d, i) {\r\n return x(d.date);\r\n })\r\n .attr(\"r\", function(d, i) {\r\n return 5;\r\n })\r\n .attr(\"class\", function(d, i) {\r\n return \"point status-\" + d.status + \" state-\" + d.state;\r\n })\r\n .attr(\"value\", function(d, i) {\r\n return d.value;\r\n })\r\n .attr(\"date\", function(d, i) {\r\n return d.date;\r\n });\r\n\r\n // Draw the Value- Text\r\n if ($scope.showLabels || $scope.showAllLabels) {\r\n var valueText = value.append(\"text\")\r\n .attr(\"y\", function(d) {\r\n return y(d.value) - 6;\r\n })\r\n .attr(\"x\", function(d) {\r\n return x(d.date);\r\n })\r\n .attr(\"class\", function(d, i) {\r\n return \"label status-\" + d.status + \" state-\" + d.state;\r\n })\r\n .text(\r\n function(d, i) {\r\n if (d.status == 'warning' || d.status == 'danger' || $scope.showAllLabels) {\r\n return d.value;\r\n }\r\n }\r\n );\r\n }\r\n\r\n function type(d) {\r\n d.date = formatDate.parse(d.date);\r\n d.value = +d.value;\r\n d.baseline = +d.baseline;\r\n d.units = d.units;\r\n d.status = d.status;\r\n d.state = d.state;\r\n return d;\r\n }\r\n\r\n };\r\n $scope.svgDrawChart();\r\n $scope.svgDrawDays($scope.pageSize);\r\n $scope.svgDrawSeries($scope.data);\r\n if ($scope.data2.length > 0) {\r\n\r\n $scope.svgDrawSeries($scope.data2, 2);\r\n }\r\n\r\n };\r\n\r\n // Add the window resize listener\r\n angular.element($window).bind('resize', function() {\r\n $scope.update();\r\n $timeout($scope.update, 200);\r\n });\r\n\r\n $scope.update = function() {\r\n // Show loading/refresh spinner- check first\r\n\r\n if (d3.select($element[0]).select(\".loading\") == false) {\r\n var loader = angular.element('
    ');\r\n $element.append(loader);\r\n }\r\n\r\n // Remove the blank values\r\n $scope.data.removeValue('value', '');\r\n\r\n // Return out if no days to chart or chart hasn't made it back yet.\r\n if ($scope.data.length < 1) return false;\r\n\r\n // Get the total entries\r\n $scope.total = $scope.data.length;\r\n\r\n // Get the first and last dates\r\n $scope.dateStart = $scope.data[0].date;\r\n $scope.dateEnd = $scope.data[$scope.total - 1].date;\r\n\r\n // Get the min and max\r\n $scope.datamin = parseFloat(yMin).toFixed(2);\r\n $scope.datamax = parseFloat(yMax).toFixed(2);\r\n\r\n // Draw the chart and contents\r\n $scope.svgDraw();\r\n\r\n // Remove the loader\r\n d3.select($element[0]).selectAll(\".loading\").remove();\r\n };\r\n\r\n $timeout($scope.update, 0);\r\n\r\n $scope.$watch('data', function() {\r\n $timeout($scope.update, 100); // Wait for the data to init\r\n }, true);\r\n\r\n $scope.$watch('data2', function() {\r\n $timeout($scope.update, 100); // Wait for the data to init\r\n }, true);\r\n\r\n $scope.$watch('interpolation', function() {\r\n $scope.update();\r\n });\r\n\r\n $scope.$watch('zoom', function(newVal, oldVal){\r\n if(newVal != oldVal) {\r\n $timeout($scope.update, 100);\r\n }\r\n });\r\n }\r\n\r\n function link(scope, element) {\r\n if (scope.plotEnds == false) {\r\n element.addClass('hideEnds');\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n data: \"=\",\r\n data2: \"=\",\r\n id: \"=\",\r\n showLabels: \"=\",\r\n showAllLabels: \"=\",\r\n showFill: \"=\",\r\n zoom: \"=\"\r\n },\r\n template: '
    ' +\r\n '
    ' +\r\n\r\n '
    ' +\r\n '
    ' +\r\n '
    '\r\n };\r\n});\r\n","angular.module(\"vh.ui.sparknav\", []).directive('vhUiSparknav', function () {\r\n\r\n function link(scope, elem, attrs) {\r\n scope.navHeight = elem[0].offsetHeight;\r\n scope.navWidth = elem[0].offsetWidth;\r\n }\r\n\r\n function controller($scope, $element, $timeout, $filter, lodash) {\r\n\r\n $scope.$watchCollection('data', function (data) {\r\n if (data) {\r\n loadController();\r\n }\r\n });\r\n\r\n $scope.tooltipTemplateUrl = 'components/vh-ui-sparknav/vh-ui-sparknav.tooltip.tpl.html';\r\n\r\n function loadController() {\r\n $scope.start = $scope.data.length - ($scope.quantity - 1);\r\n\r\n $scope.quantityTotal = $scope.data.length;\r\n\r\n // Set the individual day widths\r\n $scope.dayWidth = (100 / $scope.data.length).toFixed(2);\r\n\r\n // Set the visible area width\r\n $scope.visibleWidth = $scope.dayWidth * ($scope.steps + 1);\r\n\r\n setMonthStartPoints();\r\n\r\n $scope.update();\r\n }\r\n\r\n $scope.atStart = false;\r\n $scope.atEnd = true;\r\n $scope.slidePosX = false;\r\n\r\n function setMonthStartPoints() {\r\n var currentMonth = '';\r\n\r\n $scope.data.forEach(function(d){\r\n var month = $filter('date')(d.date, 'MMM');\r\n\r\n if(currentMonth.length == 0 || currentMonth != month) {\r\n d.monthLabel = month;\r\n currentMonth = month;\r\n }\r\n });\r\n }\r\n\r\n $scope.getDayHeight = function (value) {\r\n var retVal = 0;\r\n if (value.score != '') {\r\n retVal = ($scope.navHeight * (value.score / 100)).toFixed(2);\r\n }\r\n\r\n return retVal;\r\n };\r\n\r\n $scope.slide = function ($event) {\r\n // var draggableObject = document.getElementById('draggable');\r\n // draggableObject.style.top = $event.pageY + 'px';\r\n // draggableObject.style.left = $event.pageX + 'px';\r\n };\r\n\r\n function setClasses(start) {\r\n for(var i = 0; i < $scope.data.length; i++){\r\n $scope.data[i].start = i == start - 1;\r\n\r\n var end = start + $scope.steps - 2;\r\n $scope.data[i].inactive = i < start - 1 || i > end;\r\n\r\n $scope.data[i].end = i == end;\r\n }\r\n }\r\n\r\n $scope.previous = function() {\r\n $scope.data[$scope.start - 1].start = false;\r\n var end = $scope.start + $scope.steps - 2;\r\n $scope.data[end].end = false;\r\n\r\n $scope.start = $scope.start - ($scope.quantity / 2);\r\n $scope.update();\r\n };\r\n\r\n $scope.next = function() {\r\n $scope.data[$scope.start - 1].start = false;\r\n var end = $scope.start + $scope.steps - 2;\r\n $scope.data[end].end = false;\r\n\r\n $scope.start = end + 2;\r\n $scope.update();\r\n };\r\n\r\n $scope.navigate = function(value) {\r\n $scope.data[$scope.start - 1].start = false;\r\n var end = $scope.start + $scope.steps - 2;\r\n $scope.data[end].end = false;\r\n\r\n var start = $scope.data.indexOf(value);\r\n var startOffset = ($scope.quantity / 2 - 1);\r\n start = start - startOffset;\r\n\r\n $scope.start = start;\r\n $scope.update();\r\n };\r\n\r\n $scope.update = function () {\r\n if ($scope.data.length < 1) {\r\n return false;\r\n }\r\n\r\n // Check if at start\r\n if ($scope.start <= 1) {\r\n $scope.start = 1;\r\n $scope.atStart = true;\r\n } else {\r\n $scope.atStart = false;\r\n }\r\n\r\n // Check if at end\r\n if ($scope.start >= ($scope.quantityTotal - ($scope.quantity - 1))) {\r\n $scope.start = $scope.quantityTotal - ($scope.quantity - 1);\r\n $scope.atEnd = true;\r\n } else {\r\n $scope.atEnd = false;\r\n }\r\n\r\n setClasses($scope.start);\r\n\r\n if ($scope.rightWidth < 0) {\r\n $scope.rightWidth = 0;\r\n }\r\n\r\n // Get the dates\r\n $scope.dateStart = $scope.data[$scope.start - 1].date;\r\n\r\n // start - 1 for 0 based index and steps - 1 for the correct amount of dates\r\n $scope.dateEnd = $scope.data[$scope.start + $scope.steps - 2].date;\r\n\r\n $scope.closeToStart = $scope.start <= 1;\r\n\r\n // // Check if close to start\r\n // var controlLeftWidth = document.querySelectorAll(\".vh-ui-sparknav-controller-left\")[0].clientWidth;\r\n // $scope.closeToStart = controlLeftWidth <= 40;\r\n //\r\n // // Check if close to end\r\n // var controlRightWidth = document.querySelectorAll(\".vh-ui-sparknav-controller-right\")[0].clientWidth;\r\n // $scope.closeToEnd = controlRightWidth <= 40;\r\n\r\n // Check if navigation needed\r\n $scope.showNav = $scope.quantityTotal > $scope.quantity;\r\n\r\n if ($scope.quantityTotal > 180) {\r\n $element.addClass(\"tinybars\");\r\n } else if ($scope.quantityTotal > 60) {\r\n $element.addClass(\"smallbars\");\r\n }\r\n\r\n debounceUpdate();\r\n };\r\n\r\n var timeout;\r\n\r\n function debounceUpdate() {\r\n var later = function () {\r\n timeout = null;\r\n $scope.updateNav({startDate: $scope.dateStart, endDate: $scope.dateEnd});\r\n };\r\n\r\n if (timeout) {\r\n $timeout.cancel(timeout);\r\n }\r\n\r\n timeout = $timeout(later, 250);\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n data: \"=\",\r\n updateNav: '&',\r\n quantity: \"=\",\r\n steps: \"=\",\r\n debug: \"=\"\r\n },\r\n templateUrl: 'components/vh-ui-sparknav/vh-ui-sparknav.tpl.html'\r\n }\r\n});\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-ui-sparknav/vh-ui-sparknav.tooltip.tpl.html',\n '
    {{value.score}}
    {{value.date | datetime : \"date\"}}
    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-ui-sparknav/vh-ui-sparknav.tpl.html',\n '
    0}\" ng-style=\"{\\'height\\': getDayHeight(value) + \\'px\\'}\">
    {{value.monthLabel}}
    ');\n}]);\n}(window, document, window.angular));","function formatter(text) {\r\n var retval = '';\r\n if (angular.isString(text)) {\r\n if (text.length > 0) {\r\n if (text.length >= 9) {\r\n retval = text.substring(0, 3) + \"-\" + text.substring(3, 5) + \"-\" + text.substring(5, text.length);\r\n } else if (text.length === 4) {\r\n retval = '***-**-' + text;\r\n } else {\r\n retval = text;\r\n }\r\n }\r\n }\r\n\r\n return retval;\r\n}\r\n\r\nfunction parser(val) {\r\n var val = val || '';\r\n var retval = [];\r\n\r\n for (var i = 0; i < val.length; i++) {\r\n\r\n if (isFinite(val[i])) {\r\n retval.push(val[i]);\r\n }\r\n\r\n if (val[i].toLowerCase() === 'p') {\r\n retval.push(val[i]);\r\n }\r\n\r\n }\r\n\r\n return retval.join('');\r\n}\r\n\r\nfunction isValid(val) {\r\n var val = val || '';\r\n var pcount = val.split('').filter(function (c) { return c.toLowerCase() === 'p'; }).length;\r\n return (pcount <= 1) && (val.length === 0 || val.length === getMax(val));\r\n}\r\n\r\nfunction getMax(val) {\r\n return val.toLowerCase().indexOf('p') > -1 ? 10 : 9;\r\n}\r\n\r\nfunction viewParse(arrType, val) {\r\n var retval = val;\r\n for(var i = 0; i < arrType.length; i++) {\r\n retval = arrType[i](val);\r\n }\r\n return retval;\r\n}\r\n\r\nfunction vhSsn() {\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n link: function (scope, elem, attrs, ctrl) {\r\n ctrl.$formatters.push(formatter);\r\n ctrl.$parsers.push(parser);\r\n\r\n elem.bind('blur', function(){\r\n ctrl.$setViewValue(viewParse(ctrl.$formatters, ctrl.$modelValue));\r\n ctrl.$setValidity('format', isValid(ctrl.$modelValue));\r\n ctrl.$render();\r\n });\r\n\r\n elem.bind('focus', function() {\r\n ctrl.$setViewValue(viewParse(ctrl.$parsers, ctrl.$modelValue));\r\n ctrl.$render();\r\n });\r\n\r\n }\r\n }\r\n}\r\n\r\nangular.module('vh-ssn',[]).directive('vhSsn', vhSsn);\r\n","angular.module(\"vh.ui.status\", []).directive('vhUiStatus', function($window) {\r\n function link(scope, elem, attrs) {\r\n var label = null;\r\n var type = attrs.type || 'blank';\r\n var newIcon = '
    ' +\r\n '
    ';\r\n if (type == 'blank' && attrs.type2) {\r\n newIcon = '
    ' +\r\n '
    '\r\n }\r\n var size = attrs.size || '30px';\r\n elem.append(newIcon);\r\n\r\n addLabel(scope.label, '', false);\r\n if (attrs.urgent) {\r\n elem.addClass('urgent');\r\n }\r\n\r\n scope.$watch('label', function(label) { \r\n addLabel(label, '', false);\r\n });\r\n scope.$watch('alertSeverityColor', function(alertSeverityColor) {\r\n addLabel('', alertSeverityColor, true);\r\n });\r\n scope.$watch('status', function (newStatus, oldStatus) {\r\n if (oldStatus) {\r\n elem.removeClass(oldStatus);\r\n }\r\n elem.addClass(newStatus);\r\n });\r\n\r\n function addLabel(labelText, alertSeverityColor, skipLabel) {\r\n var newLabelText = labelText || '';\r\n if (label === null) {\r\n label = angular.element('
    ' + newLabelText +\r\n '
    ' + newLabelText + '
    ');\r\n\r\n elem.append(label);\r\n elem.css('margin-bottom', '12px');\r\n } else {\r\n if(!skipLabel) {\r\n label.text(newLabelText);\r\n }\r\n }\r\n\r\n if(alertSeverityColor) {\r\n label.addClass(alertSeverityColor);\r\n }\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n status: \"@\",\r\n label: \"@\",\r\n alertSeverityColor: \"@\",\r\n },\r\n template: '
    ' +\r\n '
    '\r\n };\r\n\r\n})\r\n.directive('vhUiStatusBar', function($window) {\r\n return {\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n template: '
    ' +\r\n '
    '\r\n };\r\n\r\n}).filter(\"alertToStatus\", function () {\r\n return function (newValue) {\r\n if (newValue === 1) {\r\n return \"danger\";\r\n } else if (newValue === 2) {\r\n return \"warning\";\r\n } else {\r\n return \"normal\";\r\n }\r\n };\r\n});\r\n","/**\r\n * * Tag Picker\r\n * The ng-model attribute passed in is a string.\r\n * This is converted to an array and edited by the ui-select control.\r\n * Then, upon change, it is converted back to a string and bound to the model\r\n * @param {Dependency} TemplatesService \r\n * @param {Dependency} lodash \r\n * @param {Scope} ngModel Delimited string of tags (passed into and out of directive)\r\n * @param {Scope} tagListArray Source of tags for the dropdown\r\n * @param {Scope} placeHolder text to appear when no tags are selected\r\n * @param {Scope} tagArray Chosen tags (internal model for the ui-select)\r\n * @param {Attribute} tagList() Callback to get the list of tags to choose from (optional; defaults to survey tags)\r\n * @param {Attribute} ngChange() Callback when the model changes \r\n */\r\nfunction VhTags(TemplatesService, lodash) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"components/vh-ui-tags/vh-ui-tags.tpl.html\",\r\n replace: false,\r\n require: \"ngModel\",\r\n scope: {\r\n tagList: \"&\", // the choices for the combo\r\n placeHolder: \"@\", // the choices for the combo\r\n tagDelimiter: \"@\",\r\n ngDisabled: \"=\",\r\n maxlength: \"@\"\r\n },\r\n link: function (scope, elem, attrs, ngModelController, $timeout) {\r\n //#region Initialization\r\n var vm = {};\r\n scope.vm = vm;\r\n\r\n loadDirective();\r\n\r\n function loadDirective() {\r\n vm.tagArray = [];\r\n vm.tagListArray = [];\r\n vm.tagDelimiter = scope.tagDelimiter || ';';\r\n vm.placeHolder = scope.placeHolder || 'Select Tags...';\r\n loadTagList();\r\n\r\n\r\n // logic to add tag on click out of the control VIVY-1677\r\n if(elem && elem.length > 0){ \r\n window.setTimeout(()=>{ // allow input to be created before attaching to blur event\r\n var input = elem.find('input'); // find the first input\r\n if(input && input.length > 0){ // if there is an input then attache to the on blur event\r\n input[0].onblur = function(){ \r\n var self = this; // save \"this\" reference\r\n var value = self.value; // get the value from the input\r\n window.setTimeout(()=>{ // allow the angular events to execute before testing for value in tags\r\n if(value.length > 0 && vm.tagArray.indexOf(value) == -1){ // if there is a value and that value doesn't exist in the tags\r\n vm.tagArray.push(value); // add the value to the tags\r\n self.value = ''; // clear the search\r\n scope.$digest(); // force angular to refresh the control\r\n }\r\n });\r\n } \r\n }\r\n }, 500);\r\n } \r\n\r\n }\r\n //#endregion\r\n\r\n //#region Methods\r\n function loadTagList() {\r\n var tagListReturnValue = scope.tagList();\r\n if(tagListReturnValue) {\r\n vm.tagListArray = tagListReturnValue;\r\n }\r\n else {\r\n TemplatesService.getSurveyTags().then(function(surveyTags) {\r\n vm.tagListArray = surveyTags;\r\n });\r\n }\r\n }\r\n\r\n vm.cleanTag = function(tag) {\r\n return tag.replace(/[;]/g, '');\r\n }\r\n //#endregion\r\n\r\n //#region Event Handlers\r\n\r\n ngModelController.$render = function() {\r\n // load the model into the control\r\n if(ngModelController.$modelValue) {\r\n // tag string to array\r\n vm.tagArray = ngModelController.$modelValue.split(vm.tagDelimiter);\r\n }\r\n }; \r\n\r\n // (Handle changes within the control's model)\r\n scope.$watchCollection(\"vm.tagArray\", function (newCollection, oldCollection, scope) {\r\n // load the control back into the model\r\n if(newCollection !== oldCollection) {\r\n // convert tag array back to string\r\n var tagString = lodash(newCollection).map(function(tag) {\r\n return tag.trim();\r\n }).value().join(vm.tagDelimiter);\r\n\r\n // check max length\r\n if(tagString.length > scope.maxlength) {\r\n vm.tagArray = oldCollection;\r\n } else {\r\n ngModelController.$setViewValue(tagString);\r\n }\r\n }\r\n });\r\n //#endregion\r\n },\r\n controller: function () {\r\n\r\n }\r\n };\r\n}\r\n\r\n\r\nangular.module('vh.ui.tags',[]).directive('vhTags', VhTags);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('components/vh-ui-tags/vh-ui-tags.tpl.html',\n '
    {{$item}} {{tag}}
    ');\n}]);\n}(window, document, window.angular));","function vhUomConversionService() {\r\n function convertToLb(weightKg) {\r\n //Round x.01 and x.99 to nearest whole integer\r\n var val = +(Math.round((weightKg*2.2046228) + \"e+2\") + \"e-2\");\r\n if (parseInt((val*100)) % 100 === 99) {\r\n return Math.ceil(val);\r\n } else if (parseInt((val*100)) % 100 === 1) {\r\n return Math.floor(val);\r\n } else {\r\n return val;\r\n }\r\n }\r\n\r\n function convertToKg(weightLb) {\r\n return +(Math.round((weightLb/2.2046228) + \"e+2\") + \"e-2\");\r\n }\r\n\r\n function convertToF(celciusTemp) {\r\n return round((celciusTemp * (9/5)+32), 2);\r\n }\r\n\r\n function convertToC(fahrenheitTemp) {\r\n return round(((fahrenheitTemp -32) * 5/9), 1);\r\n }\r\n\r\n function convertToMmolL(bloodSugar) {\r\n return round((bloodSugar / 18), 1);\r\n }\r\n\r\n function convertToMgdL(bloodSugar) {\r\n return round((bloodSugar * 18), 0);\r\n }\r\n\r\n function round(value, decimals) {\r\n return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);\r\n }\r\n\r\n return {\r\n convertToLb: convertToLb,\r\n convertToKg: convertToKg,\r\n convertToF: convertToF,\r\n convertToC: convertToC,\r\n convertToMmolL: convertToMmolL,\r\n convertToMgdL: convertToMgdL\r\n }\r\n}\r\n\r\nangular.module(\"vh.uom.conversion\", []).service('vhUomConversionService', vhUomConversionService);\r\n","function DateUtilities() {\r\n\r\n var _getServerUTCDateTimeToDateInMillisecondsForTimezone = function (serverUTCDateTime, timeZoneAndroidId) {\r\n //First, since the CreatedDtUTC is a zero-hour-offset UTC time, first change it to its server timezone\r\n var serverLocalizedUTCCreatedDateTime = moment.utc(serverUTCDateTime).tz('America/Chicago');\r\n //Then get just the date in milliseconds from the localized datetime\r\n var localizedCreatedDateInMilliseconds = _getDateInMillisecondsForTimezone(serverLocalizedUTCCreatedDateTime, timeZoneAndroidId);\r\n\r\n return localizedCreatedDateInMilliseconds;\r\n };\r\n\r\n var _getDateInMilliseconds = function(localizedDatetime) {\r\n //Get the milliseconds for just the date part without any browser timezone translation\r\n return moment.utc(moment(localizedDatetime).utcOffset(0, true).format('L'), 'MM/DD/YYYY').valueOf();\r\n };\r\n\r\n var _getDateInMillisecondsForTimezone = function(dateTime, timeZoneAndroidId) {\r\n //Translate the time to the passed-in timezone. This way if the time was 12:30am CST but the passed-in timezone was in MST, we'd use the previous day\r\n var localizedDateTime = moment.tz(dateTime, timeZoneAndroidId);\r\n return _getDateInMilliseconds(localizedDateTime);\r\n };\r\n\r\n var _isValidDate = function(d) {\r\n return d instanceof Date && !isNaN(d);\r\n }\r\n\r\n\r\n return {\r\n\r\n getServerUTCDateTimeToDateInMillisecondsForTimezone: _getServerUTCDateTimeToDateInMillisecondsForTimezone,\r\n getDateInMilliseconds: _getDateInMilliseconds,\r\n getDateInMillisecondsForTimezone: _getDateInMillisecondsForTimezone,\r\n isValidDate: _isValidDate\r\n };\r\n}\r\n\r\nangular.module('app').factory('DateUtilities', DateUtilities);\r\n","function TagUtilities() {\r\n return {\r\n\r\n cleanUpTags: function (currentTags) {\r\n if (!currentTags) {\r\n return '';\r\n }\r\n\r\n var splitTags = currentTags.split(';');\r\n var tags = '';\r\n\r\n for (i = 0; i < splitTags.length; i++) {\r\n var tag = splitTags[i];\r\n if (!tag) {\r\n continue;\r\n }\r\n\r\n if (tag[0] === '.') {\r\n tag = tag.substring(1, tag.length);\r\n }\r\n\r\n if (tag && tag.slice(tag.length - 1) === '.') {\r\n tag = tag.substring(0, tag.length - 1);\r\n }\r\n\r\n if (!tag) {\r\n continue;\r\n }\r\n tags += tag + ';';\r\n }\r\n \r\n return tags.substring(0, tags.length - 1);\r\n }\r\n \r\n };\r\n}\r\n\r\nangular.module('app').factory('TagUtilities', TagUtilities);\r\n","function VideoControls() {\r\n return {\r\n restrict: 'A',\r\n link: function (scope, element, attrs) {\r\n addPause();\r\n scope.$watch(attrs.videoControls, function () {\r\n addPause();\r\n });\r\n\r\n function addPause() {\r\n var controls = scope.$eval(attrs.videoControls);\r\n controls.pause = function () {\r\n element[0].pause();\r\n };\r\n }\r\n }\r\n };\r\n}\r\nangular.module('videocontrols', []).directive('videoControls', VideoControls);\r\n","function AboutController($rootScope, VersionService) {\r\n var vm = this;\r\n vm.version = {};\r\n\r\n function loadController () {\r\n VersionService.getVersionDisplayInfo().then(function (version) {\r\n vm.version = version;\r\n });\r\n }\r\n\r\n loadController();\r\n\r\n}\r\n\r\nangular.module('app').controller('AboutController', AboutController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('layout/about.modal.html',\n '
    Vivify Care Team Portal
    Version {{vm.version.Version}}
    Remote Patient Monitoring
    Vivify Health Inc.
    1311 West President George Bush Highway
    Richardson, TX 75080
    {{vm.version.REF}}
    DI: {{vm.version.DI}}
    PI: {{vm.version.PI}}
    {{vm.version.ManufactureDate}}
    ');\n}]);\n}(window, document, window.angular));","function BodyController($rootScope, $scope, AuthorizationService, $window, $document, $timeout, ConfigurationsService) {\r\n var vm = this;\r\n var thresholds = {\r\n xs: {width: 480, classIndex: 0},\r\n sm: {width: 768, classIndex: 1},\r\n md: {width: 1024, classIndex: 2},\r\n lg: {width: 1280, classIndex: 3},\r\n xl: {width: 1600, classIndex: 4},\r\n xxl: {widoth: 1601, classIndex: 5}\r\n };\r\n var classes = [\"body-xs\", \"body-small\", \"body-medium\", \"body-large\", \"body-xl\", \"body-xxl\"];\r\n\r\n vm.isAuthorized = undefined;\r\n vm.isSelectable = true;\r\n vm.showTwoFactorSetup = false;\r\n\r\n vm.showBackToTop = true;\r\n\r\n window.onscroll = function() {scrollFunction()};\r\n \r\n function scrollFunction() {\r\n var body = angular.element($document[0].body);\r\n if(document.body.scrollTop > 135 || document.documentElement.scrollTop > 135){\r\n if(!body.hasClass('vh-scrolled'))\r\n body.addClass('vh-scrolled');\r\n } else {\r\n if(body.hasClass('vh-scrolled'))\r\n body.removeClass('vh-scrolled');\r\n }\r\n\r\n }\r\n\r\n\r\n function scrollIt(destination, duration = 200, easing = 'linear', callback) {\r\n\r\n const easings = {\r\n linear(t) {\r\n return t;\r\n },\r\n easeInQuad(t) {\r\n return t * t;\r\n },\r\n easeOutQuad(t) {\r\n return t * (2 - t);\r\n },\r\n easeInOutQuad(t) {\r\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\r\n },\r\n easeInCubic(t) {\r\n return t * t * t;\r\n },\r\n easeOutCubic(t) {\r\n return (--t) * t * t + 1;\r\n },\r\n easeInOutCubic(t) {\r\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\r\n },\r\n easeInQuart(t) {\r\n return t * t * t * t;\r\n },\r\n easeOutQuart(t) {\r\n return 1 - (--t) * t * t * t;\r\n },\r\n easeInOutQuart(t) {\r\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t;\r\n },\r\n easeInQuint(t) {\r\n return t * t * t * t * t;\r\n },\r\n easeOutQuint(t) {\r\n return 1 + (--t) * t * t * t * t;\r\n },\r\n easeInOutQuint(t) {\r\n return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t;\r\n }\r\n };\r\n \r\n var lastScrollValue = 0;\r\n const start = window.pageYOffset;\r\n const startTime = 'now' in window.performance ? performance.now() : new Date().getTime();\r\n \r\n const documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);\r\n const windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;\r\n const destinationOffset = typeof destination === 'number' ? destination : destination.offsetTop;\r\n const destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset);\r\n \r\n if ('requestAnimationFrame' in window === false) {\r\n window.scroll(0, 0);\r\n if (callback) {\r\n callback();\r\n }\r\n return;\r\n }\r\n \r\n function scroll() {\r\n const now = 'now' in window.performance ? performance.now() : new Date().getTime();\r\n const time = Math.min(1, ((now - startTime) / duration));\r\n const timeFunction = easings[easing](time);\r\n\r\n if(lastScrollValue == Math.ceil((timeFunction * (destinationOffsetToScroll - start)) + start))\r\n lastScrollValue = -1;\r\n else\r\n lastScrollValue = Math.ceil((timeFunction * (destinationOffsetToScroll - start)) + start);\r\n\r\n window.scroll(0, Math.ceil((timeFunction * (destinationOffsetToScroll - start)) + start));\r\n \r\n if (lastScrollValue == -1 || window.pageYOffset === destinationOffsetToScroll) {\r\n window.scroll(0, 0);\r\n lastScrollValue = 0;\r\n\r\n if (callback) {\r\n callback();\r\n }\r\n return;\r\n }\r\n \r\n requestAnimationFrame(scroll);\r\n }\r\n \r\n scroll();\r\n }\r\n \r\n\r\n\r\n \r\n // When the user clicks on the button, scroll to the top of the document\r\n window.scrolltoTop = () => {\r\n\r\n if(window.pageYOffset === 0)\r\n return;\r\n\r\n scrollIt(\r\n document.querySelector('#bodyelement'),\r\n 300,\r\n 'easeOutQuad'\r\n );\r\n\r\n }\r\n\r\n ConfigurationsService.getConfig().then(function(){\r\n vm.isSelectable = ConfigurationsService.configParams.PortalTextSelectEnabled;\r\n });\r\n\r\n AuthorizationService.isAuthorized().then(function(isAuthorized){\r\n vm.isAuthorized = !!isAuthorized; // convert to bool\r\n\r\n if( vm.isAuthorized == true){\r\n AuthorizationService.twoFactorSetupRequired().then(function(data){\r\n vm.showTwoFactorSetup = data;\r\n });\r\n }\r\n });\r\n\r\n $rootScope.$watch('isAuthorized', function(newVal, oldVal){\r\n if (newVal === undefined && oldVal === undefined) {\r\n return;\r\n }\r\n vm.isAuthorized = !!newVal;\r\n if (vm.isAuthorized == false){\r\n vm.showTwoFactorSetup = false;\r\n }\r\n });\r\n\r\n $rootScope.$watch('showTwoFactorSetup', function(newVal, oldVal){\r\n if (newVal === undefined && oldVal === undefined) {\r\n return;\r\n }\r\n vm.showTwoFactorSetup = !!newVal;\r\n }); \r\n\r\n handleResize();\r\n\r\n angular.element($window).on(\"resize\",debounce(handleResize, 250));\r\n\r\n function debounce(action, delay) {\r\n var timeout = null;\r\n return function () {\r\n if (timeout !== null) {\r\n $timeout.cancel(timeout);\r\n }\r\n timeout = $timeout(action, delay).then(function () {\r\n timeout = null;\r\n });\r\n };\r\n }\r\n\r\n function handleResize() {\r\n var body = $document.find(\"body\");\r\n var windowWidth = $window.innerWidth;\r\n var classIndex = 0;\r\n if (windowWidth <= thresholds.sm.width) {\r\n classIndex = thresholds.sm.classIndex;\r\n } else if (windowWidth <= thresholds.md.width) {\r\n classIndex = thresholds.md.classIndex;\r\n } else if (windowWidth <= thresholds.lg.width) {\r\n classIndex = thresholds.lg.classIndex;\r\n } else if (windowWidth <= thresholds.xl.width) {\r\n classIndex = thresholds.xl.classIndex;\r\n } else {\r\n classIndex = thresholds.xxl.classIndex;\r\n }\r\n body.addClass(classes[classIndex]);\r\n body.removeClass(classes.slice(0, classIndex).join(\" \") + \" \" + classes.slice(classIndex+1).join(\" \"));\r\n if (windowWidth <= thresholds.xs.width) {\r\n body.addClass(classes[thresholds.xs.classIndex]);\r\n }\r\n }\r\n\r\n //Back-to-Top-Button Drag and Drop\r\n\r\n\r\n (function initBackToTopButton () {\r\n var btn = document.querySelector('.back-to-top-btn');\r\n \r\n btn.addEventListener('dragstart', handleDragStart, false);\r\n btn.addEventListener('dragenter', handleDragEnter, false);\r\n btn.addEventListener('dragover', handleDragOver, false);\r\n btn.addEventListener('dragleave', handleDragLeave, false);\r\n btn.addEventListener('drop', handleDrop, false);\r\n btn.addEventListener('dragend', handleDragEnd, false);\r\n })();\r\n\r\n function handleDragStart(e) {\r\n this.style.opacity = '0.4';\r\n }\r\n\r\n function handleDragOver(e) {\r\n if (e.preventDefault) {\r\n e.preventDefault(); // Necessary. Allows us to drop.\r\n }\r\n \r\n e.dataTransfer.dropEffect = 'move';\r\n console.log(`x: ${e.clientX}, y: ${e.clientY}`);\r\n\r\n return false;\r\n }\r\n \r\n function handleDragEnter(e) {\r\n //method stub\r\n }\r\n \r\n function handleDragLeave(e) {\r\n //method stub\r\n }\r\n\r\n function handleDrop(e) { \r\n if (e.stopPropagation) {\r\n e.stopPropagation(); // stops the browser from redirecting.\r\n } \r\n return false;\r\n }\r\n \r\n function handleDragEnd(e) {\r\n var btn = document.querySelector('.back-to-top-btn');\r\n btn.style.left = `${e.clientX}px`;\r\n btn.style.top = `${e.clientY}px`; \r\n }\r\n}\r\n\r\nangular.module('app').controller('BodyController', BodyController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('layout/body.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","var footerController = function(VersionService) {\r\n var vm = this;\r\n VersionService.getVersion().then(function (version) { vm.details = version; });\r\n};\r\nangular.module('app').controller('footerController', footerController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('layout/footer.tpl.html',\n '
    Version {{vm.details}}
    © 2009-2021 Vivify Health | All Rights Reserved | Patents Pending | Part Number: CTPPN001
    ');\n}]);\n}(window, document, window.angular));","var headerController = function ($rootScope, $interval, ConfigurationsService, ccowService, MessageService, AuthorizationService,\r\n lodash, $state, PatientListService, HelpService, PermissionService, $timeout, $sce, LoginNotificationService,\r\n LocalStorageService) {\r\n var vm = this;\r\n vm.callRequestCount = 0;\r\n vm.kitMessageCount = 0;\r\n vm.messageCount = 0;\r\n vm.virtualVisitInWaitingRoomCount = 0;\r\n vm.previousPatient = previousPatient;\r\n vm.nextPatient = nextPatient;\r\n var messagePollerLock = false; // Is currently in Loop state (prevent multiple loops)\r\n var messagePollerToggle = false; // On or Off\r\n var visitPollerLock = false; // Is currently in loop state (prevents multiple loops)\r\n var visitPollerToggle = false; // On or Off\r\n\r\n vm.patientList = {};\r\n vm.currentPatientIndex = -1\r\n vm.currentPatientArrayIndex = -1;\r\n vm.nextPagePatientIds = null;\r\n vm.nextPagePatientArrayIndex = -1;\r\n vm.nextPageNumber = null;\r\n vm.showLoginNotification = false;\r\n vm.loginNotification = {};\r\n vm.caregiver = AuthorizationService.getCaregiver();\r\n vm.shouldShowAgreement = LocalStorageService.get(\"showAgreement\");\r\n vm.messagePollingEnabled = true;\r\n vm.visitPollingEnabled = true;\r\n\r\n var listener1 = $rootScope.$on(\"vh:patientSelected\", function (event, patientId) {\r\n if ($state.current.name.substr(0, 16) == 'patients.patient' ){\r\n if (patientId > 0){\r\n vm.currentPatientArrayIndex = lodash.findIndex(vm.patientList.patientIds, function(o) { return o == patientId; } );\r\n\r\n // This is to handle the edge case where user has pressed the Previous/Next button on a patient which will causes \r\n // the currentPatientIndex to cross to the next page (new array of patient ids), but the patient was dirty and the user\r\n // cancels the navigation and stays on the current patient index in the first page (array), but we have already loaded the second page.\r\n // Now they finally move to the prev/next patient on the second page, we need to do the page (patient id array) swap here.\r\n if ( vm.nextPagePatientIds != null )\r\n {\r\n if ( vm.currentPatientArrayIndex == -1 ){\r\n // See if this patient is in the new page and if so move to that page\r\n vm.currentPatientArrayIndex = lodash.findIndex(vm.nextPagePatientIds, function(o) { return o == patientId; } );\r\n vm.patientList.patientIds = vm.nextPagePatientIds;\r\n vm.patientList.pageNumber = vm.nextPageNumber;\r\n vm.nextPagePatientIds = null;\r\n vm.nextPagePatientArrayIndex = -1;\r\n vm.nextPageNumber = null;\r\n }\r\n else{\r\n // Looks like they didn't advance to the next page so clear out the next page data and stay on current page\r\n vm.nextPagePatientIds = null;\r\n vm.nextPagePatientArrayIndex = -1;\r\n vm.nextPageNumber = null;\r\n }\r\n }\r\n updatePatientIndex();\r\n }\r\n }\r\n else{\r\n vm.currentPatientIndex = -1\r\n vm.currentPatientArrayIndex = -1;\r\n }\r\n });\r\n\r\n var listener2 = $rootScope.$on(\"vh:patientListChanged\", function (event, patientList) {\r\n vm.patientList = patientList;\r\n vm.currentPatientIndex = -1\r\n vm.currentPatientArrayIndex = -1;\r\n });\r\n\r\n vh:\r\n\r\n $rootScope.$watch('helpUrlFlags', function(newVal, oldVal) { \r\n if (newVal === undefined) {\r\n return;\r\n }\r\n vm.getHelpUrlSet = newVal.getHelpUrlSet;\r\n vm.vivifyUniversityUrlSet = newVal.vivifyUniversityUrlSet;\r\n vm.supportVendor = newVal.supportVendor;\r\n });\r\n\r\n $rootScope.$on(\"$destroy\", function() {\r\n listener1();\r\n listener2();\r\n });\r\n\r\n var getUnreadMessageCount = function(pulling = false) {\r\n MessageService.getUnreadMessageCount().then(function(data) {\r\n vm.messageCount = (data && data.MessageCount) ? data.MessageCount : 0;\r\n vm.kitMessageCount = (data && data.LogisticsCount) ? data.LogisticsCount : 0;\r\n vm.callRequestNowCount = (data && data.CallRequestNowCount) ? data.CallRequestNowCount : 0;\r\n vm.callRequestLaterCount = (data && data.CallRequestLaterCount) ? data.CallRequestLaterCount : 0;\r\n vm.callRequestCount = vm.callRequestNowCount + vm.callRequestLaterCount;\r\n if (pulling == true){\r\n setTimeout(() => {\r\n messagePollerLock = false;\r\n startMessagePoller();\r\n }, 300000);\r\n }\r\n });\r\n\r\n }\r\n var getVirtualVisitWaitingRoomCounts = function(pulling = false) {\r\n PatientListService.getVirtualVisitCounts().then(function (data) {\r\n vm.virtualVisitInWaitingRoomCount = data || [];\r\n if(pulling == true){\r\n setTimeout(() => {\r\n visitPollerLock = false;\r\n startVisitPoller();\r\n }, 15000);\r\n }\r\n });\r\n }\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n var callToEnabled = data[\"CallToEnabled\"];\r\n var caregiverMessagingEnabled = data[\"CaregiverMessagingEnabled\"]; \r\n var patientMessagingEnabled = data[\"PatientMessagingEnabled\"];\r\n var logisticsMessagingEnabled = data[\"LogisticsMessagingEnabled\"];\r\n vm.messagePollingEnabled = callToEnabled || patientMessagingEnabled || caregiverMessagingEnabled || logisticsMessagingEnabled;\r\n vm.visitPollingEnabled = callToEnabled;\r\n vm.showCallRequestAlert = callToEnabled && PermissionService.userHasPermission([\"PatientCall\"]);\r\n vm.showCaregiverMessageAlert = caregiverMessagingEnabled;\r\n vm.showPatientMessageAlert = patientMessagingEnabled;\r\n vm.showKitShipAlert = logisticsMessagingEnabled;\r\n });\r\n \r\n loadController();\r\n $timeout(function () { \r\n checkEulas();\r\n }, 6000); \r\n\r\n function loadController() {\r\n loadSites();\r\n getUnreadMessageCount();\r\n getVirtualVisitWaitingRoomCounts();\r\n\r\n LoginNotificationService.getForCurrentUser().then(function(data){\r\n if (data != null){\r\n vm.loginNotification.saveResponse = function(value){ LoginNotificationService.saveResponse(data.LoginNotificationId, value); vm.showLoginNotification = false; };\r\n vm.loginNotification.html = data.MessageHtml; //$sce.trustAsHtml(data.MessageHtml); \r\n // wait 5 seconds to display notification\r\n $timeout(function () { \r\n vm.showLoginNotification = true;\r\n }, 5000); \r\n }\r\n });\r\n }\r\n\r\n // this is only for sso users.\r\n function checkEulas() {\r\n if(vm.shouldShowAgreement && vm.caregiver.AuthorizationModeId === 3) {\r\n AuthorizationService.openAgreementModals(vm.caregiver);\r\n }\r\n }\r\n\r\n $rootScope.$watch('isAuthorized', function (newVal, oldVal) {\r\n if(newVal === true && vm.messagePollingEnabled) {\r\n messagePollerToggle = true;\r\n startMessagePoller();\r\n } else {\r\n stopMessagePoller();\r\n }\r\n if(newVal === true && vm.visitPollingEnabled) {\r\n visitPollerToggle = true;\r\n startVisitPoller();\r\n } else {\r\n stopVisitPoller();\r\n }\r\n });\r\n\r\n // when user reads messages in messenger, refresh header now rather than waiting on $interval\r\n $rootScope.$on('vh:refreshmessengercount', function(e) { \r\n getUnreadMessageCount(); \r\n });\r\n\r\n vm.showUserGuides = function() {\r\n HelpService.showUserGuides();\r\n };\r\n\r\n vm.showGetHelp = function() {\r\n HelpService.showGetHelp();\r\n };\r\n\r\n vm.showVivifyUniversity = function() {\r\n HelpService.showVivifyUniversity();\r\n };\r\n\r\n vm.showAbout = function() {\r\n HelpService.showAbout();\r\n }\r\n\r\n vm.showConnectedIcon = function() {\r\n if (ccowService.isCcowEnabled() && ccowService.contextorState() === 2) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n vm.showDisconnectedIcon = function() {\r\n if (ccowService.isCcowEnabled() && ccowService.contextorState() != 2) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n vm.rejoinPatientContext = function() {\r\n ccowService.joinContext();\r\n }\r\n\r\n vm.navigateShipPage = function() {\r\n $state.go(\"kit_logistics.logistics.filtered\", {filterBy: 'myUnreadMessages'}, {reload: true});\r\n }\r\n\r\n vm.navigatevirtualVisitInWaitingRoom = function () {\r\n $state.go(\"patients.list\", { filterBy: 'virtualVisitInWaitingRoom' }, { reload: true });\r\n }\r\n\r\n vm.navigateMessageAudit = function() {\r\n $state.go(\"patients.list\", {filterBy: 'unreadMessages'}, {reload: true});\r\n }\r\n \r\n vm.navigateCallRequests = function() {\r\n $state.go(\"patients.list\", {filterBy: 'callRequests'}, {reload: true});\r\n }\r\n\r\n vm.changeSites = function(SiteId){\r\n AuthorizationService.changeSite(SiteId).then(function(data) {\r\n LocalStorageService.store('vh-siteId', SiteId);\r\n location.replace(\"/\");\r\n });\r\n }\r\n\r\n var startMessagePoller = function() {\r\n if(messagePollerToggle == true && messagePollerLock == false) {\r\n messagePollerLock = true;\r\n getUnreadMessageCount(true);\r\n }\r\n }\r\n\r\n var stopMessagePoller = function() {\r\n messagePollerToggle == false; // This will kill the cycle after the current loop\r\n }\r\n\r\n var startVisitPoller = function() {\r\n if(visitPollerToggle == true && visitPollerLock == false) {\r\n visitPollerLock = true;\r\n getVirtualVisitWaitingRoomCounts(true);\r\n }\r\n }\r\n\r\n var stopVisitPoller = function() {\r\n visitPollerToggle = false; // This will kill the cycle after the current loop\r\n }\r\n\r\n function loadSites(){\r\n AuthorizationService.getSites().then(function(data){\r\n vm.sites = lodash.filter(data, function(o) { return o.IsAssigned === true; } );\r\n }); \r\n } \r\n\r\n function updatePatientIndex(){\r\n if ( vm.currentPatientArrayIndex == -1 ){\r\n vm.currentPatientIndex = -1;\r\n }\r\n else{\r\n // offset currentPatientIndex by what page we are in the patient list\r\n vm.currentPatientIndex = (vm.patientList.pageLength * (vm.patientList.pageNumber - 1) + vm.currentPatientArrayIndex) + 1;\r\n }\r\n }\r\n\r\n function previousPatient(){\r\n if (vm.currentPatientArrayIndex > 0){\r\n $state.go(selectNewState(), { patientId: vm.patientList.patientIds[vm.currentPatientArrayIndex - 1] });\r\n }\r\n else if ( vm.currentPatientIndex > 1 && vm.patientList.pageNumber > 1){\r\n // fetch next page of patient list\r\n vm.nextPageNumber = vm.patientList.pageNumber - 1;\r\n vm.nextPagePatientArrayIndex = vm.patientList.pageLength - 1;\r\n loadPatientListPage();\r\n } \r\n }\r\n\r\n function nextPatient(){\r\n if ((vm.currentPatientArrayIndex + 1) < vm.patientList.patientIds.length ){\r\n $state.go(selectNewState(), { patientId: vm.patientList.patientIds[vm.currentPatientArrayIndex + 1] });\r\n }\r\n else if ( vm.currentPatientIndex < vm.patientList.totalPatients){\r\n // fetch next page of patient list\r\n vm.nextPageNumber = vm.patientList.pageNumber + 1;\r\n vm.nextPagePatientArrayIndex = 0;\r\n loadPatientListPage();\r\n }\r\n }\r\n\r\n function selectNewState(){\r\n console.log($state.current.name);\r\n\r\n var newState = 'patients.patient.monitoring';\r\n\r\n switch($state.current.name){\r\n case 'patients.patient.demographics':\r\n case 'patients.patient.monitoring':\r\n case 'patients.patient.parameters':\r\n case 'patients.patient.healthsummary':\r\n case 'patients.patient.clinicalhistory':\r\n case 'patients.patient.activity':\r\n case 'patients.patient.time_log.detail':\r\n {\r\n newState = $state.current.name\r\n break;\r\n }\r\n\r\n case 'patients.patient.chart':\r\n case 'patients.patient.chart.create':\r\n {\r\n newState = 'patients.patient.chart'\r\n break;\r\n }\r\n\r\n case 'patients.patient.medications':\r\n case 'patients.patient.medications.master':\r\n case 'patients.patient.medications.create':\r\n {\r\n newState = 'patients.patient.medications'\r\n break;\r\n }\r\n \r\n case 'patients.patient.forms':\r\n case 'patients.patient.forms.form':\r\n case 'patients.patient.forms.create':\r\n {\r\n newState = 'patients.patient.forms'\r\n break;\r\n }\r\n \r\n case 'patients.patient.careplan.surveys':\r\n case 'patients.patient.careplan.surveys.survey':\r\n case 'patients.patient.careplan.surveys.survey.edit':\r\n {\r\n newState = 'patients.patient.careplan.surveys'\r\n break;\r\n } \r\n\r\n case 'patients.patient.directentry': // not all patients will have a direct entry tab so go to monitoring tab\r\n default:\r\n {\r\n newState = 'patients.patient.monitoring';\r\n }\r\n\r\n }\r\n return newState;\r\n }\r\n\r\n function loadPatientListPage() {\r\n if (vm.patientList.filters.searchText.length > 0) {\r\n PatientListService.searchPatients(vm.patientList.pageLength, vm.nextPageNumber, vm.patientList.filters.searchText, vm.patientList.filters.SortBy)\r\n .then(loadPatientListPageComplete);\r\n } else {\r\n PatientListService.getPatientList(vm.patientList.pageLength, vm.nextPageNumber, vm.patientList.filters.SortBy, vm.patientList.filters)\r\n .then(loadPatientListPageComplete);\r\n }\r\n } \r\n\r\n function loadPatientListPageComplete(result) {\r\n // Store the next page data here\r\n // We will actually move to the next page in $rootScope.$on(\"vh:patientSelected\")\r\n // We delay to the vh:patientSelected handler incase the user cancels the navigation due to patient screen being dirty.\r\n vm.nextPagePatientIds = lodash.map(result.PatientHeaders, 'PatientId');\r\n vm.patientList.totalPatients = result.TotalPatients;\r\n $state.go(selectNewState(), { patientId: vm.nextPagePatientIds[vm.nextPagePatientArrayIndex] });\r\n }\r\n};\r\nangular.module('app').controller('headerController', headerController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('layout/header.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","\r\nfunction HelpService($rootScope, $transitions, $state, ServiceNowService, AuthorizationService, lodash, ConfigurationsService, PatientHeaderService, $uibModal) {\r\n var _helpUrl = '';\r\n var _vivifyUniversityUrl = '';\r\n var _zendDeskKey = null;\r\n var _zendeskPatientFieldId = null;\r\n var _zendeskKitFieldId = null;\r\n var _selectedPatient = null;\r\n var _selectedKit = null;\r\n\r\n var _helpUrls = [\r\n { state: 'patients.list', url: 'Content/B_Procedure%20Topics/Manage%20Patient%20List.htm' },\r\n { state : 'patients.patient.demographics', url : 'Content/A_Introduction%20Topics/Managing%20Profiles.htm?Highlight=profile'},\r\n { state : 'patients.patient.monitoring', url : 'Content/B_Procedure%20Topics/Monitor%20Patient%20Biometrics.htm'},\r\n { state : 'patients.patient.parameters', url : 'Content/B_Procedure%20Topics/Change%20Biometric%20Parameters.htm'},\r\n { state : 'patients.patient.directentry', url : 'Content/B_Procedure%20Topics/Add%20Direct%20Entry%20Data.htm'},\r\n { state : 'patients.patient.careplan.surveys', url : 'Content/Pathways/Add%20a%20Pathway%20to%20Patient.htm'},\r\n { state : 'patients.patient.careplan.surveys.survey', url : 'Content/Pathways/Add%20a%20Pathway%20to%20Patient.htm'},\r\n { state : 'patients.patient.careplan.surveys.survey.edit', url : 'Content/Pathways/Add%20a%20Pathway%20to%20Patient.htm'},\r\n { state : 'patients.patient.healthsummary', url : 'Content/B_Procedure%20Topics/View%20Health%20Summary.htm'},\r\n { state : 'patients.patient.chart', url : 'Content/B_Procedure%20Topics/Manage%20Patient%20Chart%20Notes.htm?Highlight=Chart'},\r\n { state : 'patients.patient.medications', url : 'Content/B_Procedure%20Topics/Manage%20Patient%20Medications.htm?Highlight=medications'},\r\n { state : 'patients.patient.clinicalhistory', url : 'Content/B_Procedure%20Topics/Manage%20Patient%20Past%20Medical%20History%20(PMHx).htm'},\r\n { state : 'patients.patient.forms', url : 'Content/B_Procedure%20Topics/Manage%20Patient%20Forms.htm'},\r\n { state : 'patients.patient.activity', url : 'Content/B_Procedure%20Topics/Viewing%20Patient%20History.htm'},\r\n { state : 'patients.patient.time_log.detail', url : 'Content/B_Procedure%20Topics/Patient%20Time%20Log.htm?Highlight=audit'},\r\n\r\n { state : 'invites', url : 'Content/Invites/Managing%20Invites.htm'},\r\n { state : 'caregivers', url : 'Content/Home%20Pages/Home_CareTeam.htm'},\r\n { state : 'caregivers.caregiver', url : 'Content/Home%20Pages/Home_CareTeam.htm'},\r\n { state : 'caregivers.caregiver.edit', url : 'Content/Home%20Pages/Home_CareTeam.htm'},\r\n \r\n { state : 'caregivers.create', url : 'Content/B_Procedure%20Topics/Care%20Team/Create%20%20New%20Care%20Team%20Member.htm'},\r\n { state : 'reports', url : 'Content/Home%20Pages/Home_Reports.htm'},\r\n { state : 'reports.folder.report', url : 'Content/Home%20Pages/Home_Reports.htm'},\r\n { state : 'content.templates', url : 'Content/A_Introduction%20Topics/Managing%20Pathways.htm'},\r\n { state : 'content.categories', url : 'Content/B_Procedure%20Topics/Content/Managing%20Questions.htm'},\r\n { state : 'content.healthtips', url : 'Content/B_Procedure%20Topics/Content/Managing%20Health%20Tips.htm'},\r\n { state : 'content.healthscore', url : 'Content/B_Procedure%20Topics/Understanding%20Health%20Score.htm?Highlight=health%20index%20score'},\r\n { state : 'content.chart', url : 'Content/B_Procedure%20Topics/Content/Managing%20Chart%20Content.htm'},\r\n { state : 'content.library', url : 'Content/B_Procedure%20Topics/Content/Managing%20Resource%20Library.htm'},\r\n { state : 'kit_logistics.logistics', url : 'Content/Kit%20Logistics/Kit%20Ship%20Pickup%20Page.htm'},\r\n { state : 'kit_logistics.receive-kits', url : 'Content/Kit%20Logistics/Receive%20Kits%20Page.htm'},\r\n { state : 'kit_logistics.locations', url : 'Content/Kit%20Logistics/Kit%20Locations%20Page.htm'},\r\n { state : 'kit_logistics.kits', url : 'Content/Kit%20Logistics/Kits%20Page.htm'},\r\n { state : 'configurations.lists', url : 'Content/Home%20Pages/Home_Configurations.htm'},\r\n { state : 'configurations.providers', url : 'Content/Configurations/Managing%20Providers.htm'}\r\n ];\r\n\r\n var host = window.location.href.split('/')[2].split('.').join('_');\r\n window.zESettings = window.zESettings || {\r\n webWidget: {\r\n position: { horizontal: 'right', vertical: 'bottom' },\r\n helpCenter: {\r\n tags:[host]\r\n },\r\n contactForm: {\r\n tags:[host],\r\n fields: [ { id: _zendeskPatientFieldId, prefill: { '*' : \"\"} }, { id: _zendeskKitFieldId, prefill: { '*' : \"\"} } ]\r\n },\r\n chat: {\r\n tags:[host]\r\n },\r\n talk: {\r\n tags:[host]\r\n }\r\n \r\n }\r\n };\r\n\r\n this.showGetHelp = _showGetHelp;\r\n this.showUserGuides = _showUserGuides;\r\n this.showAbout = _showAbout;\r\n\r\n $rootScope.$on('vh:patientSelected', function(event, patientId, patient){\r\n _selectedKit = null;\r\n _selectedPatient = patient;\r\n _updateZendeskPatientKit('patient');\r\n\r\n });\r\n\r\n $rootScope.$on(\"vh:kitSelected\", function(event, kit){\r\n _selectedKit = kit;\r\n _selectedPatient = null;\r\n\r\n\r\n if(_selectedKit && _selectedKit.PatientId && !_selectedPatient){\r\n \r\n PatientHeaderService.getPatientHeader(_selectedKit.PatientId).then(function (data) {\r\n return PatientHeaderService.mapPatient(data.PatientHeader);\r\n }).then(function (patient) {\r\n _selectedPatient = patient;\r\n _updateZendeskPatientKit('kit');\r\n });\r\n \r\n }\r\n _updateZendeskPatientKit('kit');\r\n });\r\n\r\n\r\n ConfigurationsService.getConfig()\r\n .then(function(data){\r\n _zendeskPatientFieldId = data.ZendeskPatientFieldId;\r\n _zendeskKitFieldId = data.ZendeskKitFieldId;\r\n\r\n ConfigurationsService.getProtectedConfig().then(function(protectedData){\r\n if((protectedData.ZendeskKey || '').length > 0)\r\n {\r\n _zendDeskKey = protectedData.ZendeskKey;\r\n _setupZendesk();\r\n }\r\n })\r\n });\r\n\r\n function _setupZendesk(){\r\n\r\n var host = window.location.href.split('/')[2].split('.').join('_');\r\n window.zESettings = window.zESettings || {\r\n webWidget: {\r\n position: { horizontal: 'right', vertical: 'bottom' },\r\n helpCenter: {\r\n tags:[host]\r\n },\r\n contactForm: {\r\n tags:[host],\r\n fields: [ { id: _zendeskPatientFieldId, prefill: { '*' : \"\"} }, { id: _zendeskKitFieldId, prefill: { '*' : \"\"} } ]\r\n },\r\n chat: {\r\n tags:[host]\r\n },\r\n talk: {\r\n tags:[host]\r\n }\r\n \r\n }\r\n };\r\n\r\n if(!window.zE && _zendDeskKey){\r\n window.zE||(function(e,t,s){var n=window.zE=window.zEmbed=function(){n._.push(arguments)}, a=n.s=e.createElement(t),r=e.getElementsByTagName(t)[0];n.set=function(e){ n.set._.push(e)},n._=[],n.set._=[],a.async=true,a.setAttribute(\"charset\",\"utf-8\"), a.src=\"https://static.zdassets.com/ekr/asset_composer.js?key=\"+s, n.t=+new Date,a.type=\"text/javascript\",r.parentNode.insertBefore(a,r)})(document,\"script\",_zendDeskKey);\r\n }\r\n\r\n }\r\n\r\n function _updateZendeskPatientKit(mode){\r\n \r\n mode = mode || 'pateint';\r\n\r\n _setupZendesk();\r\n\r\n if(window.zE){\r\n\r\n var value = '';\r\n\r\n if(mode == 'patient')\r\n {\r\n if(_selectedPatient)\r\n {\r\n // set patient ID\r\n zESettings.webWidget.contactForm.fields[0] = { id: _zendeskPatientFieldId || zESettings.webWidget.contactForm.fields[0].id, prefill: { '*' : _selectedPatient.id } };\r\n\r\n if(_selectedPatient.kitNumber)\r\n zESettings.webWidget.contactForm.fields[1] = { id: _zendeskKitFieldId || zESettings.webWidget.contactForm.fields[1].id, prefill: { '*' : _selectedPatient.kitNumber} }; \r\n\r\n }\r\n else{\r\n zESettings.webWidget.contactForm.fields[0] = { id: _zendeskPatientFieldId || zESettings.webWidget.contactForm.fields[0].id, prefill: { '*' : '' } };\r\n zESettings.webWidget.contactForm.fields[1] = { id: _zendeskKitFieldId || zESettings.webWidget.contactForm.fields[1].id, prefill: { '*' : ''} }; \r\n }\r\n }\r\n\r\n if(mode == 'kit')\r\n {\r\n if(_selectedKit){\r\n zESettings.webWidget.contactForm.fields[1] = { id: _zendeskKitFieldId || zESettings.webWidget.contactForm.fields[1].id, prefill: { '*' : _selectedKit.KitNo} }; \r\n }else {\r\n zESettings.webWidget.contactForm.fields[1] = { id: _zendeskKitFieldId || zESettings.webWidget.contactForm.fields[1].id, prefill: { '*' : ''} }; \r\n }\r\n\r\n if(_selectedPatient)\r\n {\r\n zESettings.webWidget.contactForm.fields[0] = { id: _zendeskPatientFieldId || zESettings.webWidget.contactForm.fields[0].id, prefill: { '*' : _selectedPatient.id } };\r\n }\r\n }\r\n \r\n\r\n \r\n window.zE('webWidget','updateSettings', zESettings);\r\n\r\n }\r\n\r\n }\r\n\r\n //If these options are used -- Chrome and Edge will open in a new tab. Firefox and IE will open in a new window.\r\n //var _windowOpenOptions = 'left=300,top=5,menubar,toolbar,location,status,resizable,scrollbars,titlebar';\r\n //Open with no menu options and no page forward/back options, this will be mostly the same for all browsers and will open in a new window instead of a tab\r\n var _windowOpenOptions = 'left=300,top=5,location=0,menubar=0,status=0,titlebar=0,toolbar=1,resizable=1,scrollbars=1';\r\n\r\n\r\n function _showUserGuides(routeInfo) {\r\n if(!routeInfo) { routeInfo = $state.current.name; }\r\n var url = _helpUrl;\r\n var helpUrl = lodash.find(_helpUrls, function(o) { return o.state === routeInfo; } );\r\n console.log(routeInfo);\r\n if ( helpUrl != undefined){\r\n url = _helpUrl.replace(\"Default.htm\", helpUrl.url);\r\n }\r\n window.open(url, 'UserGuides', _windowOpenOptions); return false;\r\n }\r\n\r\n function _getKeywords(){\r\n\r\n var search = window.location.href.split('#')[1].split('/');\r\n var removeKeyWords = ['careplan'];\r\n var replaceKeyWords = { 'survey': 'pathway' , 'clinicalhistory':'pmhx' };\r\n\r\n var keywords = [];\r\n\r\n for(var i = 0; i < search.length; i++){\r\n if(isNaN(parseInt(search[i])) && removeKeyWords.indexOf(search[i].toLowerCase()) == -1){\r\n keywords.push( replaceKeyWords[search[i].toLowerCase()] || search[i].toLowerCase());\r\n }\r\n }\r\n\r\n return keywords.join(' ').trim();\r\n }\r\n\r\n function _showGetHelp() {\r\n\r\n if($rootScope.helpUrlFlags.supportVendor == 'ServiceNow'){\r\n ServiceNowService.show();\r\n return;\r\n }\r\n\r\n\r\n if(!window.zE){\r\n _setupZendesk();\r\n _showGetHelp();\r\n }\r\n\r\n if(!window.zE || !_zendDeskKey)\r\n return;\r\n\r\n var host = window.location.href.split('/')[2].split('.').join('_');\r\n\r\n window.zE('webWidget','reset');\r\n var caregiver = AuthorizationService.getCaregiver();\r\n if (caregiver !== null && caregiver !== undefined) {\r\n window.zE('webWidget','prefill', { name: { value: caregiver.DisplayName, readonly: true }, email: {value: caregiver.Email, readonly: true}, phone: { value: caregiver.Phone }}); \r\n window.zE('webWidget', 'identify', {name: caregiver.DisplayName, email: caregiver.Email, organization: host});\r\n }\r\n _updateZendeskPatientKit();\r\n window.zE('webWidget','open'); \r\n\r\n window.zE('webWidget', 'helpCenter:setSuggestions', {url: true, search: _getKeywords()});\r\n\r\n \r\n }\r\n\r\n function _hideGetHelp(){\r\n\r\n if(!window.zE)\r\n return;\r\n\r\n window.zE('webWidget','close'); \r\n }\r\n\r\n this.showVivifyUniversity = function showTraining() {\r\n //TODO: Create configuration setting and load the URL from there like we do for help\r\n window.open(_vivifyUniversityUrl, 'Training', _windowOpenOptions);\r\n }\r\n\r\n $rootScope.$watch('isAuthorized', function (newVal, oldVal) {\r\n if (!_helpUrl && newVal === true) {\r\n ConfigurationsService.getConfig().then(function (data) {\r\n if (data.HelpUrl) {\r\n var timestamp = Math.floor(new Date().getTime()/1000);\r\n _helpUrl = data.HelpUrl + '?' + timestamp;\r\n }\r\n if (data.VivifyUniversityUrl) {\r\n _vivifyUniversityUrl = data.VivifyUniversityUrl;\r\n }\r\n\r\n\r\n\r\n ConfigurationsService.getProtectedConfig().then(function(protectedData){\r\n var helpUrlFlags = {\r\n vivifyUniversityUrlSet: _vivifyUniversityUrl.length > 0,\r\n getHelpUrlSet: (protectedData.ZendeskKey || '').length > 0,\r\n supportVendor: data.SupportVendor\r\n };\r\n \r\n $rootScope.helpUrlFlags = helpUrlFlags;\r\n });\r\n });\r\n }\r\n });\r\n\r\n // closes the support control if they navigate away\r\n $transitions.onSuccess({}, (trans)=>{\r\n \r\n if(trans.$to().url && trans.$to().url.toString().toLowerCase().indexOf('/login') > -1)\r\n {\r\n _hideGetHelp();\r\n }\r\n // do not need suggestions to run twice when navigating to patients demo screen\r\n else if(trans.$to().url && trans.$to().name && window.zE && trans.$to().url.toString().toLowerCase() != \"/demographics\"){\r\n // need to delay checking the href until after we have navigated\r\n window.setTimeout(function(){\r\n window.zE('webWidget', 'helpCenter:setSuggestions', {url: true, search: _getKeywords()});\r\n }, 500);\r\n }\r\n });\r\n\r\n function _showAbout() {\r\n $uibModal.open({\r\n templateUrl: 'layout/about.modal.html',\r\n controller: 'AboutController as vm',\r\n animation: true,\r\n backdrop: 'true',\r\n size: 'lg',\r\n windowClass: 'about-modal'\r\n });\r\n \r\n }\r\n\r\n}\r\n\r\nangular.module('app').service('HelpService', HelpService);\r\n","function LogoDirective($rootScope, $http, $timeout) {\r\n\r\n function link(scope, elem, attrs, ngModel) {\r\n \r\n //var url = '/api/media/custom/images/logo.png';\r\n var url = scope.url;\r\n \r\n\r\n setImgSrc();\r\n\r\n function setImgSrc() {\r\n scope.src = url;\r\n }\r\n\r\n $rootScope.$on('vh:logoupdate', function () {\r\n scope.src = undefined;\r\n $http.get(url).then(function () {\r\n $timeout(function () {\r\n setImgSrc();\r\n });\r\n });\r\n });\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n replace: true,\r\n template: '\"\"',\r\n scope: {\r\n url: '@'\r\n }\r\n };\r\n\r\n}\r\n\r\nangular.module('app').directive('logoDirective', LogoDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('layout/logo.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","var navigationController = function ($transitions,$rootScope, $state, $q, $filter, lodash, PermissionService, ConfigurationsService, NavigationService, AuthorizationService, HelpService, BIService, hasHideNav) {\r\n var vm = this;\r\n var navRoutes = [];\r\n vm.dashboardData = null;\r\n vm.reportData = null;\r\n vm.navItems = [];\r\n vm.selectedStateName = \"\";\r\n vm.templategroups = [];\r\n vm.resourceLibraryGroups = [];\r\n vm.clickSubNav = clickSubNav;\r\n vm.populationClicked = populationClicked;\r\n vm.cardPopulationClicked = cardPopulationClicked;\r\n vm.biometricsPopulationClicked = biometricsPopulationClicked;\r\n vm.reportClicked = reportClicked;\r\n vm.dashboardClicked = dashboardClicked;\r\n vm.isBiFolderSelected = isBiFolderSelected;\r\n vm.isBIDashboardSelected = isBIDashboardSelected;\r\n vm.isBIReportSelected = isBIReportSelected;\r\n vm.isTemplateGroup = isTemplateGroup;\r\n vm.isLibraryGroup = isLibraryGroup;\r\n vm.isCardGroup = isCardGroup;\r\n vm.isBiometricGroup = isBiometricGroup;\r\n vm.isSubLevelItemSelected = isSubLevelItemSelected;\r\n vm.userId = AuthorizationService.getCaregiver().Id; \r\n \r\n\r\n \r\n hasHideNav();\r\n \r\n var navType = \"\";\r\n\r\n if ($state.$current.name !== '' && $state.$current.name !== 'login' && $state.$current.name !== 'consume') {\r\n getRoutes($state.$current);\r\n }\r\n\r\n $transitions.onSuccess({}, (trans)=>{\r\n getRoutes(trans.$to());\r\n });\r\n\r\n $rootScope.$on(\"updateSelfServiceReportsChange\", function () {\r\n BIService.getSelfServiceFolder().then(function (reports) {\r\n vm.reportData = reports;\r\n updateSelfServiceReports(vm.reportData);\r\n });\r\n });\r\n\r\n \r\n \r\n $rootScope.$on('vh:coachcardsupdated', function(){\r\n NavigationService.refreshCardGroups()\r\n .then(function(cardgroups){\r\n\r\n vm.cardgroups = cardgroups.sort((a,b)=>{\r\n if(a.CardGroupId == -2)\r\n return 1;\r\n \r\n if(a.CardGroupId == -1 && b.CardGroupId > -2)\r\n return 1;\r\n\r\n if(a.CardGroupName > b.CardGroupName)\r\n return 1;\r\n\r\n if(a.CardGroupName < b.CardGroupName)\r\n return -1;\r\n \r\n if(a.CardGroupName == b.CardGroupName)\r\n return 0;\r\n });\r\n\r\n vm.cardgroups = cardgroups;\r\n });\r\n console.log('card groups updated');\r\n });\r\n\r\n \r\n function getRoutes(toState) {\r\n var nextNavType = \"admin\";\r\n if ($state.current.name === \"kit_logistics.deliveries\") {\r\n nextNavType = \"logistics\";\r\n }\r\n\r\n if ($state.current.name === \"kit_logistics.kits\") {\r\n vm.navItems = [];\r\n } else if (vm.navItems.length > 0 && nextNavType == navType) {\r\n return;\r\n }\r\n\r\n vm.navItems = [];\r\n if (nextNavType == 'logistics') {\r\n createLogisticsNav();\r\n } else {\r\n createAdminNav();\r\n }\r\n\r\n if ($state.is(\"content.templates\")) {\r\n vm.templategroups = NavigationService.getTemplateGroups();\r\n } else if ($state.is('content.library')) {\r\n vm.resourceLibraryGroups = NavigationService.getResourceLibraryGroups();\r\n } else if ($state.is(\"content.cards\")) {\r\n vm.cardgroups = NavigationService.getCardGroups();\r\n } else if ($state.is(\"site.biometrics\")) {\r\n vm.biometricGroups = NavigationService.getBiometricGroups();\r\n }\r\n }\r\n\r\n var _helpUrlFlags = {};\r\n\r\n $rootScope.$watch('helpUrlFlags', function (newVal, oldVal) {\r\n if (newVal === undefined) {\r\n return;\r\n }\r\n _helpUrlFlags = newVal;\r\n addUniversityAndGetHelpNav(newVal);\r\n });\r\n\r\n function addHelpNav() {\r\n /*\r\n var subItems = [];\r\n\r\n subItems.push(\r\n {\r\n name: 'help.userGuides',\r\n data: {\r\n displayName: 'User Guides'\r\n }\r\n });\r\n\r\n vm.navItems.push(\r\n { \r\n name: 'help',\r\n data: {\r\n displayName: 'Help',\r\n displayIcon: 'fa-question-circle'\r\n },\r\n subItems: subItems\r\n });\r\n */\r\n\r\n vm.navItems.push(\r\n {\r\n name: 'help.userGuides',\r\n data: {\r\n displayName: 'Help',\r\n displayIcon: 'fa-question-circle'\r\n },\r\n subItems: []\r\n\r\n });\r\n\r\n }\r\n\r\n function addUniversityAndGetHelpNav(helpUrlFlags) {\r\n if ((vm.navItems.length > 0) && (helpUrlFlags.hasOwnProperty('vivifyUniversityUrlSet'))) {\r\n //Assume that this is the last array element\r\n var helpNavItem = vm.navItems[vm.navItems.length - 1];\r\n if ((helpNavItem.name === 'help') || (helpNavItem.name === 'help.userGuides')) {\r\n \r\n if (helpUrlFlags.supportVendor == 'ServiceNow' || helpUrlFlags.getHelpUrlSet || helpUrlFlags.vivifyUniversityUrlSet) {\r\n helpNavItem.name = 'help';\r\n helpNavItem.data.displayName = 'Help';\r\n helpNavItem.data.displayIcon = 'fa-question-circle';\r\n\r\n var subItems = [];\r\n\r\n if (helpUrlFlags.supportVendor == 'ServiceNow' || helpUrlFlags.getHelpUrlSet) {\r\n subItems.push(\r\n {\r\n name: 'help.getHelp',\r\n data: {\r\n displayName: 'Customer Support'\r\n }\r\n });\r\n };\r\n\r\n subItems.push(\r\n {\r\n name: 'help.userGuides',\r\n data: {\r\n displayName: 'User Guide'\r\n }\r\n });\r\n\r\n if (helpUrlFlags.vivifyUniversityUrlSet) {\r\n subItems.push(\r\n {\r\n name: 'help.vivifyUniversity',\r\n data: {\r\n displayName: 'Vivify University'\r\n }\r\n });\r\n };\r\n\r\n subItems.push(\r\n {\r\n name: 'help.about',\r\n data: {\r\n displayName: 'About'\r\n }\r\n }\r\n )\r\n helpNavItem.subItems = subItems;\r\n }\r\n };\r\n }\r\n }\r\n\r\n\r\n function createLogisticsNav() {\r\n navType = \"logistics\";\r\n navRoutes = [\r\n 'kit_logistics',\r\n 'kit_logistics.kits',\r\n 'kit_logistics.move_kits',\r\n 'kit_logistics.locations'\r\n ];\r\n\r\n ConfigurationsService.getConfig().then(function (data) {\r\n if (data.isEmaEnabled === true) {\r\n navRoutes.push('kit_logistics.provisioning');\r\n }\r\n if (data.KitLogisticsLevel === 'ShipOnly' || data.KitLogisticsLevel === 'PickUpOnly' || data.KitLogisticsLevel === 'Full') {\r\n navRoutes.push('kit_logistics.logistics');\r\n }\r\n });\r\n\r\n buildNavigation();\r\n }\r\n\r\n function addDashboards(biFolder) {\r\n if (vm.navItems && vm.navItems.length) {\r\n\r\n var rootNavItem = lodash.find(vm.navItems, function (o) { return o.name == 'dashboards'; });\r\n\r\n if (rootNavItem) {\r\n\r\n rootNavItem.subItems = [];\r\n\r\n if (biFolder && biFolder.Folders && biFolder.Folders.length) {\r\n for (var i = 0; i < biFolder.Folders.length; i++) {\r\n if (biFolder.Folders[i].Reports && biFolder.Folders[i].Reports.length && biFolder.Folders[i].Reports.length > 0) {\r\n\r\n rootNavItem.subItems.push(\r\n {\r\n name: 'dashboards.folder',\r\n data: {\r\n displayName: biFolder.Folders[i].DisplayName,\r\n requiredPermissions: [\"DashboardRead\"],\r\n folder: biFolder.Folders[i]\r\n },\r\n params: {\r\n folderId: biFolder.Folders[i].FolderId\r\n }\r\n }\r\n );\r\n }\r\n }\r\n }\r\n\r\n if (biFolder && biFolder.Reports && biFolder.Reports.length) {\r\n for (var i = 0; i < biFolder.Reports.length; i++) {\r\n\r\n rootNavItem.subItems.push(\r\n {\r\n name: 'dashboards.folder.dashboard',\r\n data: {\r\n displayName: biFolder.Reports[i].DisplayName,\r\n requiredPermissions: [\"DashboardRead\",\"CCMRPMBilling\"],\r\n report: biFolder.Reports[i]\r\n },\r\n params: {\r\n folderId: biFolder.FolderId,\r\n biReportId: biFolder.Reports[i].ReportId\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n function addReports(biFolder) {\r\n if (vm.navItems && vm.navItems.length) {\r\n\r\n var rootNavItem = lodash.find(vm.navItems, function (o) { return o.name == 'reports'; });\r\n\r\n if (rootNavItem) {\r\n\r\n rootNavItem.subItems = [];\r\n\r\n if (biFolder && biFolder.Folders && biFolder.Folders.length) {\r\n for (var i = 0; i < biFolder.Folders.length; i++) {\r\n if ((biFolder.Folders[i].Reports && biFolder.Folders[i].Reports.length && biFolder.Folders[i].Reports.length > 0) || biFolder.Folders[i].ForceShowFolder) {\r\n\r\n if (biFolder.Folders[i].FolderTypeEnum == BIService.folderTypeEnum.SelfService) {\r\n biFolder.Folders[i].Reports = biFolder.Folders[i].Reports.filter(function (report) {\r\n return report.IsPublished == true || report.ReportOwnerId == vm.userId;\r\n });\r\n }\r\n\r\n rootNavItem.subItems.push(\r\n {\r\n name: 'reports.folder',\r\n data: {\r\n displayName: biFolder.Folders[i].DisplayName,\r\n requiredPermissions: [\"ReportRead\"],\r\n folder: biFolder.Folders[i]\r\n },\r\n params: {\r\n folderId: biFolder.Folders[i].FolderId,\r\n isSelfService: biFolder.Folders[i].FolderTypeEnum == BIService.folderTypeEnum.SelfService\r\n }\r\n }\r\n );\r\n }\r\n }\r\n }\r\n\r\n if (biFolder && biFolder.Reports && biFolder.Reports.length) {\r\n for (var i = 0; i < biFolder.Reports.length; i++) {\r\n\r\n rootNavItem.subItems.push(\r\n {\r\n name: 'reports.folder.report',\r\n data: {\r\n displayName: biFolder.Reports[i].DisplayName,\r\n requiredPermissions: [\"ReportRead\"],\r\n report: biFolder.Reports[i]\r\n },\r\n params: {\r\n folderId: biFolder.FolderId,\r\n biReportId: biFolder.Reports[i].ReportId\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n function updateSelfServiceReports(biFolder) {\r\n if (vm.navItems && vm.navItems.length) {\r\n\r\n var reportItem = lodash.find(vm.navItems, function (o) { return o.name == 'reports'; });\r\n var selfServiceIndex = reportItem.subItems.map(function (e) { return e.params.isSelfService; }).indexOf(true);\r\n\r\n reportItem.subItems.splice(selfServiceIndex, 1);\r\n for (var j = 0; j < biFolder.length; j++) {\r\n biFolder[j].Reports = biFolder[j].Reports.filter(function (report) {\r\n return report.IsPublished == true || report.ReportOwnerId == vm.userId;\r\n });\r\n reportItem.subItems.push(\r\n {\r\n name: 'reports.folder',\r\n data: {\r\n displayName: biFolder[j].DisplayName,\r\n requiredPermissions: [\"ReportRead\"],\r\n folder: biFolder[j]\r\n },\r\n params: {\r\n folderId: biFolder[j].FolderId,\r\n isSelfService: true\r\n }\r\n }\r\n );\r\n }\r\n }\r\n }\r\n\r\n function createAdminNav() {\r\n navType = \"admin\";\r\n //Do not add routes that are 3 layers deep\r\n navRoutes = [\r\n 'dashboards',\r\n 'caregivers',\r\n 'caregivers.current',\r\n 'reports',\r\n 'content',\r\n 'content.chart',\r\n 'content.cards',\r\n 'content.healthtips',\r\n 'content.templates',\r\n 'content.categories',\r\n 'content.library',\r\n 'content.videos',\r\n 'kit_logistics',\r\n 'kit_logistics.kits',\r\n 'kit_logistics.move_kits',\r\n 'kit_logistics.locations',\r\n 'kit_logistics.receive-kits',\r\n 'site',\r\n 'site.biometrics',\r\n 'site.hospitals',\r\n 'site.payers',\r\n 'site.profileFields',\r\n 'site.programDurations',\r\n 'site.populationGroups',\r\n 'site.populations',\r\n 'site.providerGroups',\r\n 'site.referrals',\r\n 'site.settings',\r\n 'site.specialhandling',\r\n 'configurations',\r\n 'configurations.alerttypes',\r\n 'configurations.currentproceduralterminologycodes',\r\n 'configurations.careManagementTypes',\r\n 'configurations.GoConfigurations',\r\n 'configurations.byod',\r\n 'configurations.HomeConfigurations',\r\n 'configurations.kit',\r\n 'configurations.ivr',\r\n 'configurations.lists',\r\n 'configurations.patientheaderconfiguration',\r\n 'configurations.providers',\r\n 'system',\r\n 'system.titles',\r\n 'system.email',\r\n 'system.emailServers',\r\n 'system.forms',\r\n 'system.go_devices',\r\n 'system.languages',\r\n 'system.loginNotification',\r\n 'system.logo',\r\n 'system.networkoperator',\r\n 'system.patientIdentifierFields',\r\n 'system.pickup',\r\n 'system.rules',\r\n 'system.securityroles',\r\n 'system.serviceLevels',\r\n 'system.settings',\r\n 'system.sites',\r\n 'system.sms',\r\n 'system.webhooks'\r\n ];\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n if (data.isEmaEnabled === true) {\r\n navRoutes.push('kit_logistics.provisioning');\r\n }\r\n if (data.KitLogisticsLevel === 'ShipOnly' || data.KitLogisticsLevel === 'PickUpOnly' || data.KitLogisticsLevel === 'Full') {\r\n navRoutes.push('kit_logistics.logistics');\r\n }\r\n if (data.EnableDynamicBiometrics === true) {\r\n navRoutes.splice(0, 0, 'system.biometricAlerts');\r\n }\r\n if (data.EnableWebRpm === true) {\r\n navRoutes.splice(0, 0, 'invites');\r\n navRoutes.splice(1, 0, 'invites.invites');\r\n }\r\n if(data.CareTeamMemberMassUploadToolEnabled === true)\r\n {\r\n navRoutes.push('configurations.caregiverUpload')\r\n }\r\n\r\n buildNavigation();\r\n });\r\n }\r\n\r\n function buildNavigation() {\r\n BIService.getRootFolder('Dashboards').then(function (dashboards) {\r\n vm.dashboardData = dashboards;\r\n // Sort the reports alphabetically\r\n if (vm.dashboardData !== null && vm.dashboardData !== undefined)\r\n {\r\n vm.dashboardData.Reports = $filter('orderBy')(vm.dashboardData.Reports, 'DisplayName');\r\n }\r\n \r\n BIService.getRootFolder('Reports').then(function (reports) {\r\n vm.reportData = reports;\r\n\r\n //First add top level items\r\n angular.forEach(getTopLevelRoutes(), function (route) {\r\n var state = $state.get(route);\r\n if (state && (!state.data.requiredPermissions || PermissionService.userHasPermission(state.data.requiredPermissions))) {\r\n state.subItems = [];\r\n vm.navItems.push(state);\r\n if ($state.includes(state.name)) {\r\n vm.selectedStateName = state.name;\r\n }\r\n }\r\n });\r\n\r\n vm.navItems = vm.navItems.filter((item, index, self)=> self.map(x => x.url).indexOf(item.url) === index);\r\n\r\n //Add sub-level items\r\n angular.forEach(getSubLevelRoutes(), function (route) {\r\n var state = $state.get(route);\r\n var navItem = getTopLevelRouteFromSubRoute(route);\r\n if (navItem && state) {\r\n if (!state.data.requiredPermissions || PermissionService.userHasPermission(state.data.requiredPermissions)) {\r\n if (state.data.defaultParamValues) {\r\n angular.forEach(state.data.defaultParamValues, function (paramValues) {\r\n navItem.subItems.push({\r\n url: state.url,\r\n name: state.name,\r\n params: paramValues.params,\r\n data: {\r\n displayName: paramValues.displayName\r\n }\r\n });\r\n if ($state.includes(state.name, state.data.defaultParamValues[0])) {\r\n navItem.selectedSubStateName = navItem.subItems[navItem.subItems.length - 1].name;\r\n }\r\n });\r\n } else {\r\n navItem.subItems.push(state);\r\n if ($state.includes(state.name)) {\r\n navItem.selectedSubStateName = state.name;\r\n }\r\n }\r\n }\r\n navItem.subItems = navItem.subItems.filter((item, index, self)=> self.map(x => x.url).indexOf(item.url) === index);\r\n }\r\n });\r\n\r\n addDashboards(vm.dashboardData);\r\n addReports(vm.reportData);\r\n\r\n //Don't show top level items if top level doesn't link anywhere or doesn't have subItems\r\n if (vm.navItems.length > 0) {\r\n vm.navItems = lodash.filter(vm.navItems, function (q) {\r\n return q.subItems.length > 0 || q.views;\r\n });\r\n }\r\n\r\n //Append help nav items\r\n addHelpNav();\r\n addUniversityAndGetHelpNav(_helpUrlFlags);\r\n });\r\n });\r\n }\r\n\r\n function shouldShowThirdLevelNavItem(state) {\r\n var detail = $state.get(state);\r\n return PermissionService.userHasPermission(detail.data.requiredPermissions);\r\n }\r\n\r\n function getTopLevelRoutes() {\r\n return lodash.filter(navRoutes, function(q) { return q.indexOf(\".\") < 0; });\r\n }\r\n\r\n function getSubLevelRoutes() {\r\n return lodash.filter(navRoutes, function(q) { return q.indexOf(\".\") > -1; });\r\n }\r\n\r\n function getTopLevelRouteFromSubRoute(subRoute) {\r\n return lodash.find(vm.navItems, function(q) { return subRoute.lastIndexOf(q.name, 0) === 0; });\r\n }\r\n\r\n function clickSubNav(route) {\r\n switch(route.name) {\r\n case 'content.cards':\r\n if (PermissionService.userHasPermission([\"CoachCardRead\"])) {\r\n vm.cardgroups = NavigationService.getCardGroups();\r\n $state.go(\"content.cards\", {cardGroupId: undefined});\r\n }\r\n break;\r\n case 'content.templates':\r\n if (PermissionService.userHasPermission([\"MasterCareplansRead\"])) {\r\n vm.templategroups = NavigationService.getTemplateGroups();\r\n $state.go(\"content.templates\", {templateGroupId: undefined});\r\n }\r\n break;\r\n case 'content.library':\r\n if (PermissionService.userHasPermission([\"ResourceLibraryRead\"])) {\r\n vm.resourceLibraryGroups = NavigationService.getResourceLibraryGroups();\r\n $state.go(\"content.library\", {groupId: undefined});\r\n }\r\n break;\r\n case 'site.biometrics':\r\n if (PermissionService.userHasPermission([\"PatientParametersRead\"])) {\r\n vm.biometricGroups = NavigationService.getBiometricGroups();\r\n $state.go(\"site.biometrics\", {populationId: undefined});\r\n }\r\n break;\r\n case 'help.userGuides':\r\n HelpService.showUserGuides();\r\n break;\r\n case 'help.getHelp':\r\n HelpService.showGetHelp();\r\n break;\r\n case 'help.vivifyUniversity':\r\n HelpService.showVivifyUniversity();\r\n break;\r\n case 'help.about':\r\n HelpService.showAbout();\r\n break;\r\n default:\r\n $state.go(route.name, route.params);\r\n }\r\n }\r\n\r\n function populationClicked(population) {\r\n $state.go(population.name, population.params);\r\n }\r\n\r\n function cardPopulationClicked(population) {\r\n $state.go(population.name, population.params);\r\n }\r\n\r\n function biometricsPopulationClicked(population) {\r\n $state.go(population.name, population.params);\r\n }\r\n\r\n function reportClicked(report) {\r\n var param = { folderId: report.FolderId, biReportId: report.ReportId };\r\n $state.go('reports.folder.report', param);\r\n }\r\n\r\n function dashboardClicked(Dashboard) {\r\n var param = { folderId: Dashboard.FolderId, biReportId: Dashboard.ReportId };\r\n $state.go('dashboards.folder.dashboard', param);\r\n }\r\n\r\n function isBiFolderSelected(routeName, params) {\r\n var result = false;\r\n\r\n if (routeName) {\r\n\r\n if (params) {\r\n result = $state.includes(routeName, params);\r\n }\r\n else {\r\n result = $state.includes(routeName);\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function isBIDashboardSelected(dashboard) {\r\n\r\n var params = { folderId: dashboard.FolderId, biReportId: dashboard.ReportId };\r\n var routeName = 'dashboards.folder.dashboard';\r\n var result = false;\r\n\r\n if (routeName) {\r\n\r\n if (params) {\r\n result = $state.includes(routeName, params);\r\n }\r\n else {\r\n result = $state.includes(routeName);\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function isBIReportSelected(report) {\r\n\r\n var params = { folderId: report.FolderId, biReportId: report.ReportId };\r\n var routeName = 'reports.folder.report';\r\n var result = false;\r\n\r\n if (routeName) {\r\n\r\n if (params) {\r\n result = $state.includes(routeName, params);\r\n }\r\n else {\r\n result = $state.includes(routeName);\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function isSubLevelItemSelected(routeName, params) {\r\n var result = false;\r\n\r\n if (routeName) {\r\n\r\n if (params) {\r\n result = $state.includes(routeName, params);\r\n }\r\n else {\r\n result = $state.includes(routeName);\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function isTemplateGroup(templateGroup) {\r\n return $state.includes(templateGroup.name, templateGroup.params);\r\n }\r\n\r\n function isLibraryGroup(libraryGroup) {\r\n return $state.includes(libraryGroup.name, libraryGroup.params);\r\n }\r\n\r\n function isCardGroup(cardGroup) {\r\n cardGroup = cardGroup || { name: 'content.cards', params: {} };\r\n return $state.includes(cardGroup.name, {cardGroupId: cardGroup.params.cardGroupId});\r\n }\r\n\r\n function isBiometricGroup(biometricGroup) {\r\n return $state.is(biometricGroup.name, biometricGroup.params);\r\n }\r\n\r\n};\r\nangular.module('app').controller('navigationController', navigationController);\r\n","function NavigationService(TemplateGroupRepository, PopulationsRepository, CardGroupRepository, ResourceLibraryRepository, BiometricsService, lodash, PermissionService) {\r\n var templateGroups = [];\r\n var resourceLibraryGroups = [];\r\n var cardGroups = [];\r\n var biometricGroups = []; // these are just populations\r\n\r\n var includeDisabledItems = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n\r\n return {\r\n getTemplateGroups: function() {\r\n if (templateGroups.length === 0) {\r\n refreshGroups();\r\n }\r\n return templateGroups;\r\n },\r\n\r\n refreshTemplateGroups: function() {\r\n refreshGroups();\r\n },\r\n\r\n getCardGroups: function() {\r\n if (cardGroups.length === 0) {\r\n _refreshCardGroups();\r\n }\r\n return cardGroups;\r\n },\r\n\r\n refreshCardGroups: function() {\r\n return _refreshCardGroups();\r\n },\r\n\r\n getResourceLibraryGroups: function() {\r\n if (resourceLibraryGroups.length === 0) {\r\n _refreshResourceLibraryGroups();\r\n }\r\n return resourceLibraryGroups;\r\n },\r\n\r\n refreshResourceLibraryGroups: function() {\r\n _refreshResourceLibraryGroups();\r\n },\r\n\r\n getBiometricGroups: function() {\r\n if (biometricGroups.length === 0) {\r\n refreshBiometricGroups();\r\n }\r\n return biometricGroups;\r\n },\r\n\r\n refreshBiometricGroups: function() {\r\n refreshBiometricGroups();\r\n }\r\n };\r\n\r\n function refreshBiometricGroups() {\r\n return BiometricsService.getBiometricGroups().then(function(data) {\r\n //Remove all biometricGroups groups and re-add\r\n biometricGroups.splice(0, biometricGroups.length);\r\n biometricGroups.push({\r\n name: \"site.biometrics\",\r\n displayName: 'Default',\r\n displayNameSecondLine: 'groupNameSecondLine',\r\n params: {\r\n populationId: -1,\r\n populationName: 'Default'\r\n }\r\n });\r\n lodash.map(data, function(population) {\r\n biometricGroups.push({\r\n name: \"site.biometrics\",\r\n displayName: population.PopulationName,\r\n displayNameSecondLine: 'groupNameSecondLine',\r\n params: {\r\n populationId: population.PopulationId,\r\n populationName: population.PopulationName\r\n }\r\n });\r\n });\r\n });\r\n }\r\n\r\n function _refreshCardGroups() {\r\n return CardGroupRepository.getAll().then(function(data) {\r\n //Remove all card groups and re-add\r\n cardGroups.splice(0, cardGroups.length);\r\n lodash.map(data, function(p) {\r\n\r\n var groupName = p.CardGroupName;\r\n var groupNameSecondLine = \"\";\r\n if (groupName.length >= 19 && groupName.length < 25) {\r\n spaceIndex = groupName.lastIndexOf(\" \");\r\n groupName = groupName.slice(0, spaceIndex);\r\n groupNameSecondLine = p.CardGroupName.slice(spaceIndex);\r\n }\r\n cardGroups.push({\r\n name: \"content.cards\",\r\n IsEnabled: p.IsEnabled,\r\n displayName: groupName,\r\n displayNameSecondLine: groupNameSecondLine,\r\n params: { cardGroupId: p.CardGroupId },\r\n cardCount: p.CardCount\r\n });\r\n });\r\n\r\n cardGroups = [...cardGroups.filter(x => x.IsEnabled), ...cardGroups.filter(x => includeDisabledItems && !x.IsEnabled)]\r\n\r\n return cardGroups;\r\n });\r\n }\r\n\r\n async function refreshGroups() {\r\n\r\n var pops = await PopulationsRepository.getAll({ enabledOnly: false });\r\n\r\n\r\n TemplateGroupRepository.getAll().then(function(data) {\r\n //Remove all template groups and re-add\r\n templateGroups.splice(0, templateGroups.length);\r\n\r\n var groups = data.map(p => {\r\n\r\n var groupName = p.TemplateGroupName;\r\n var pop = pops.find(x => x.PopulationId === p.TemplateGroupId) || { IsEnabled: true };\r\n\r\n var groupNameSecondLine = \"\";\r\n if (groupName.length >= 19 && groupName.length < 25) {\r\n spaceIndex = groupName.lastIndexOf(\" \");\r\n groupName = groupName.slice(0, spaceIndex);\r\n groupNameSecondLine = p.TemplateGroupName.slice(spaceIndex);\r\n }\r\n\r\n return {\r\n name: \"content.templates\",\r\n displayName: `${groupName}`,\r\n displayNameSecondLine: groupNameSecondLine,\r\n params: { templateGroupId: p.TemplateGroupId },\r\n templateCount: p.TemplateCount,\r\n IsEnabled: pop.IsEnabled != false\r\n };\r\n\r\n });\r\n\r\n templateGroups.push(...groups.filter(x => x.IsEnabled));\r\n templateGroups.push(...groups.filter(x => includeDisabledItems && !x.IsEnabled));\r\n });\r\n }\r\n\r\n function _refreshResourceLibraryGroups() {\r\n return ResourceLibraryRepository.getResourceLibraryGroups().then(function(data) {\r\n //Remove all groups and re-add\r\n resourceLibraryGroups.splice(0, resourceLibraryGroups.length);\r\n\r\n const mapGroups = g => ({\r\n name: 'content.library',\r\n displayName: g.GroupName,\r\n groupCount: g.GroupCount,\r\n isEnabled: g.IsEnabled,\r\n params: {\r\n groupId: g.GroupId,\r\n groupName: g.GroupName\r\n }\r\n });\r\n\r\n\r\n resourceLibraryGroups.push(...data.filter(g => g.IsEnabled).map(mapGroups));\r\n resourceLibraryGroups.push(...data.filter(g => includeDisabledItems && !g.IsEnabled).map(mapGroups));\r\n\r\n return resourceLibraryGroups;\r\n });\r\n }\r\n}\r\n\r\nangular.module('app').factory('NavigationService', NavigationService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('layout/navigation.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('layout/unauthorized.tpl.html',\n '
    Unauthorized Error

    Something went wrong. You can try the \\'Go Back\\' button below or logout and back in to try and resolve this issue.

    ');\n}]);\n}(window, document, window.angular));","function VersionService($http, $filter) {\r\n\r\n function GetVersion() {\r\n var version = {\r\n date: \"1-1-2015 12:23:12\",\r\n version: \"1.0\",\r\n commitHash: \"abcdef\"\r\n };\r\n\r\n var details = '';\r\n\r\n return getPlatformVersion().then(function(platformversion) {\r\n return $http.get(\"version.json\").then(function (response) {\r\n version = response.data;\r\n var versionArray = version.version.split('.');\r\n return platformversion + '/.' + versionArray[2];\r\n });\r\n });\r\n }\r\n\r\n function getPlatformVersion() {\r\n var details = '';\r\n return $http.get(\"/api/version\").then(function (response) {\r\n version = response.data.split(' ')[0];\r\n var arr = version\r\n .replace('_', '')\r\n .split('.')\r\n .filter(n => n !== '00' && n !== 0 && n !== '0');\r\n\r\n return arr.join('.');\r\n });\r\n }\r\n \r\n function GetVersionDisplayInfo() {\r\n return $http.get(\"/api/version/about\").then(function (response) {\r\n var version = {};\r\n version = response.data\r\n\r\n return version;\r\n });\r\n }\r\n\r\n return {\r\n getVersion: GetVersion,\r\n getVersionDisplayInfo: GetVersionDisplayInfo\r\n };\r\n }\r\n\r\n angular.module('app').service('VersionService', VersionService);\r\n","function AnalyticsFactory($http) {\r\n function cleanLogText(text) {\r\n text = text || \"\";\r\n return text.replace(/\\|/g, \"PIPE\");\r\n }\r\n\r\n function contextToString(context) {\r\n if (!angular.isDefined(context)) {\r\n return;\r\n }\r\n if (angular.isString(context)) {\r\n return context;\r\n }\r\n var stringValue = \"\";\r\n angular.forEach(context, function (v,k) {\r\n stringValue += \"{\" + k + \":\" + v + \"}\";\r\n });\r\n return stringValue;\r\n }\r\n\r\n\r\n function Analytics(domain, patientId) {\r\n this.domain = domain;\r\n this.patientId = patientId;\r\n this.domainInstance = Math.floor(Math.random() * 5000);\r\n this.logTemplate = {PatientId: patientId};\r\n }\r\n\r\n Analytics.prototype.log = function(action, context) {\r\n var cleanAction = cleanLogText(action);\r\n var cleanContext = cleanLogText(contextToString(context));\r\n var log = [this.domain, this.domainInstance, cleanAction, cleanContext].join(\"|\");\r\n var data = angular.extend({Log: log}, this.logTemplate);\r\n return $http.post(\"/api/GeneralLog\", data);\r\n };\r\n\r\n return Analytics;\r\n}\r\n\r\nangular.module(\"vh.analytics\").factory(\"AnalyticsFactory\", AnalyticsFactory); \r\n","function AuthorizationService($http, $rootScope, $window, $filter, $state, $uibModalStack, $q, $location, LocalStorageService, IdleService, KeepAliveRepository, TimeLogSessionAutoService, PatientListService, PermissionService, vhSweetAlert, CaregiversService, $timeout, LoginService, $uibModal, ConfigurationsService, ccowService, BIService) {\r\n\r\n function GetCaregiver() {\r\n return LocalStorageService.get('vh-caregiver');\r\n }\r\n\r\n function HasPopulatedPortalTexts(){\r\n var isValid = false;\r\n for(var text in ConfigurationsService.configParams.PortalTexts){\r\n if(text.valueOf.length>0){\r\n isValid=true;\r\n }\r\n }\r\n return isValid;\r\n }\r\n\r\n function IsAuthorized() {\r\n return $q(function (resolve) {\r\n return KeepAliveRepository.get().then(function (data) {\r\n if (data) {\r\n var caregiver = GetCaregiver();\r\n if (caregiver === undefined || caregiver === null) {\r\n return SetCaregiver().then(function () {\r\n return resolve(data);\r\n });\r\n } else {\r\n if (caregiver.CaregiverLastLogins && caregiver.CaregiverLastLogins.length === 0 ) {\r\n if (ConfigurationsService.configParams.PortalTexts && ConfigurationsService.configParams.PortalTexts.length > 0 && HasPopulatedPortalTexts()) {\r\n OpenAgreementModals(caregiver);\r\n return resolve(false);\r\n }\r\n else {\r\n ValidateUserAfterAgreement(caregiver.Id);\r\n $rootScope.isAuthorized = true;\r\n return SetCaregiver().then(function () {\r\n return resolve(data);\r\n });\r\n }\r\n return resolve(data);\r\n }\r\n return resolve(data);\r\n }\r\n } else {\r\n return resolve(data);\r\n }\r\n });\r\n });\r\n }\r\n\r\n function GetLoginMessages() {\r\n return $http.get('/api/Authorization/Messages').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n function OpenAgreementModals(caregiver) {\r\n var agreements = ConfigurationsService.configParams.PortalTexts.slice(0);\r\n //remove agreements with no text in them\r\n agreements = agreements.filter(function(agreement){\r\n return agreement.Value.length>0;\r\n })\r\n\r\n angular.element($window).on('beforeunload', onBeforeUnload);\r\n angular.element($window).on('unload', onBeforeUnload);\r\n\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/authorization/login/agreement.modal.html',\r\n controller: 'AgreementModalController as vm',\r\n backdrop: 'static',\r\n keyboard: false,\r\n resolve: {\r\n template: function () {\r\n return {\r\n Caregiver: caregiver,\r\n currentAgreement: agreements.shift(),\r\n nextAgreements: agreements\r\n };\r\n }\r\n }\r\n });\r\n if(caregiver.AuthorizationModeId == 3) {\r\n LocalStorageService.remove('showAgreement');\r\n LocalStorageService.store('showAgreement', false);\r\n }\r\n }\r\n\r\n function SetCaregiver() {\r\n return $q(function (resolve, reject) {\r\n return $http.get('/api/caregiver').then(function (response) {\r\n if (response.data !== null) {\r\n LocalStorageService.store('vh-caregiver', response.data.Caregiver);\r\n LocalStorageService.store('showAgreement', response.data.AuthenticationResponse.ShowAgreement);\r\n LocalStorageService.remove('timeLogSession');\r\n if ($rootScope.isAuthorized || (response.data.Caregiver.CaregiverLastLogins && response.data.Caregiver.CaregiverLastLogins.length > 0)) {\r\n return loadPermissions().then(function () {\r\n return resolve(response.data);\r\n });\r\n }\r\n }\r\n return reject();\r\n });\r\n });\r\n }\r\n\r\n function onBeforeUnload(event) {\r\n if (!$rootScope.isAuthorized || $rootScope.isAuthorized === false) {\r\n PatientListService.resetSessionFilters();\r\n CaregiversService.resetSessionFilters();\r\n $uibModalStack.dismissAll('logout');\r\n vhSweetAlert.closeAll();\r\n $http.post('/api/Authorization/Logout').then(function () {\r\n PermissionService.clearUserPermissions();\r\n\r\n LocalStorageService.remove('vh-permissions');\r\n LocalStorageService.remove('vh-caregiver');\r\n LocalStorageService.remove('showAgreement');\r\n LocalStorageService.remove('timeLogSession');\r\n\r\n $rootScope.isAuthorized = false;\r\n TimeLogSessionAutoService.stop();\r\n });\r\n\r\n event.returnValue = \"Are you sure?\";\r\n return \"Are you sure?\";\r\n }\r\n }\r\n\r\n function Login(username, password, twoFactorCode, siteId) {\r\n var model = {\r\n User_Name: username,\r\n Password: password,\r\n TwoFactorCode: twoFactorCode,\r\n SiteId: siteId\r\n };\r\n\r\n return $http.post('/api/Authorization/Login', model).then(function (response) {\r\n var auth = response.data.AuthenticationResponse;\r\n\r\n // Prompt user to enter Two-Factor Authentication code\r\n if (response.data.TwoFactorCodeRequired){\r\n return response.data;\r\n }\r\n\r\n // Prompt user to setup Two-Factor Authentication\r\n if (response.data.TwoFactorSetupRequired && !auth.IsExpired){\r\n LoginService.setLoginRedirect('/twoFactorSetup');\r\n $rootScope.showTwoFactorSetup = true;\r\n LocalStorageService.store('vh-caregiver', response.data.Caregiver);\r\n LocalStorageService.remove('timeLogSession');\r\n return loadPermissions().then(function () {\r\n return response.data;\r\n }); \r\n }\r\n\r\n var agreements = ConfigurationsService.configParams.PortalTexts.slice(0);\r\n if (response.data.Caregiver !== null && (auth.IsPassowrdChangeSuccessful || (auth.IsAuthorized && !auth.IsExpired)) && (!auth.ShowAgreement || agreements.length == 0)) {\r\n LocalStorageService.store('vh-caregiver', response.data.Caregiver);\r\n LocalStorageService.remove('timeLogSession');\r\n return loadPermissions().then(function () {\r\n return response.data;\r\n });\r\n }\r\n else if (response.data.Caregiver !== null && (auth.IsPassowrdChangeSuccessful || (auth.IsAuthorized && !auth.IsExpired)) && (auth.ShowAgreement && agreements.length > 0)) {\r\n $rootScope.isAuthorized = false;\r\n OpenAgreementModals(response.data.Caregiver);\r\n return response.data;\r\n }\r\n else {\r\n logOutUser();\r\n return response.data;\r\n }\r\n });\r\n }\r\n\r\n function loadPermissions() {\r\n return new $q(function (resolve) {\r\n return PermissionService.loadUserPermissions().then(function () {\r\n IdleService.init();\r\n $rootScope.isAuthorized = true;\r\n RedirectAfterLogin();\r\n return resolve();\r\n });\r\n });\r\n }\r\n\r\n function ValidateUserAfterAgreement(caregiverId) {\r\n return $http.post('/api/Authorization/lastlogin?caregiverId=' + caregiverId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function RedirectAfterLogin() {\r\n if (ccowService.isCcowEnabled() === true && PermissionService.userHasPermission(['PatientListRead'])) {\r\n ccowService.contextPatientChange();\r\n }\r\n\r\n if (!$state.is(\"login\") && !$state.is(\"consume\") && !$state.is(\"reset\")) {\r\n return;\r\n }\r\n\r\n var url = LoginService.getLoginRedirect();\r\n if (url.length > 0) {\r\n url = url.replace(\"#\", \"\");\r\n LoginService.setLoginRedirect('');\r\n $location.path(url);\r\n } else {\r\n if (PermissionService.userHasPermission(['PatientListRead'])) {\r\n $state.go('patients.list');\r\n } else if (PermissionService.userHasPermission(['DashboardRead'])) {\r\n $state.go('dashboards');\r\n } else if (PermissionService.userHasPermission(['CaregiversRead'])) {\r\n $state.go('caregivers');\r\n } else if (PermissionService.userHasPermission(['MasterCareplansRead'])) {\r\n $state.go('content.templates');\r\n } else if (PermissionService.userHasPermission(['KitsRead'])) {\r\n $state.go('kit_logistics.kits');\r\n } else if (PermissionService.userHasPermission(['KitLogisticsRead']) && (ConfigurationsService.configParams.KitLogisticsLevel === 'Full' || ConfigurationsService.configParams.KitLogisticsLevel === 'ShipOnly')) {\r\n $state.go('kit_logistics.logistics');\r\n } else if (PermissionService.userHasPermission(['ReceiveKitsRead'])) {\r\n $state.go('kit_logistics.receive-kits');\r\n } else if (PermissionService.userHasPermission(['ReportsRead'])) {\r\n $state.go('reports');\r\n } else if (PermissionService.userHasPermission(['MasterCareplansRead'])) {\r\n $state.go('content');\r\n } else {\r\n $state.go('patients.list'); // default, even though user will get unauthorized message\r\n }\r\n }\r\n }\r\n\r\n function requestResetPassword(username) {\r\n var request = {\r\n User_Name: username,\r\n };\r\n return $http.post('/api/Authorization/RequestPasswordReset', request).then(\r\n function(response) {\r\n return response.status;\r\n }\r\n );\r\n }\r\n\r\n function requestUsername(email) {\r\n var request = {\r\n Email: email,\r\n };\r\n return $http.post('/api/Authorization/RequestUsername', request).then(function (response) {\r\n return response.status;\r\n });\r\n }\r\n\r\n function validateResetToken(token) {\r\n return $http.post('/api/Authorization/ValidateResetToken?token=' + token).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function ChangePassword(caregiver, passwordRequest) {\r\n var request = {\r\n Caregiver: caregiver,\r\n PasswordRequest: passwordRequest\r\n };\r\n\r\n return $http.post('/api/Authorization/ChangePassword', request).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function Logout() {\r\n BIService.deleteExagoApi();\r\n return $q(function(resolve){\r\n return logOutUser().then(function(logoutUrl){\r\n return resolve(logoutUrl);\r\n });\r\n });\r\n }\r\n\r\n function logOutUser() {\r\n return $q(function(resolve){\r\n PatientListService.resetSessionFilters();\r\n CaregiversService.resetSessionFilters();\r\n $uibModalStack.dismissAll('logout');\r\n vhSweetAlert.closeAll();\r\n return $http.post('/api/Authorization/Logout').then(function (logoutUrl) {\r\n\r\n PermissionService.clearUserPermissions();\r\n\r\n LocalStorageService.remove('vh-permissions');\r\n LocalStorageService.remove('vh-caregiver');\r\n LocalStorageService.remove('timeLogSession');\r\n\r\n if(logoutUrl.length > 0) {\r\n LocalStorageService.store('vh-logout-url', logoutUrl);\r\n }\r\n\r\n $rootScope.isAuthorized = false;\r\n $rootScope.showTwoFactorSetup = false;\r\n TimeLogSessionAutoService.stop();\r\n return resolve(logoutUrl);\r\n });\r\n });\r\n }\r\n\r\n function getSites() {\r\n return $http.get('/api/Site/User/0').then(\r\n function (response) {\r\n return response.data;\r\n }); \r\n }\r\n\r\n function changeSite(siteId){\r\n var data = {};\r\n data.SiteId = siteId;\r\n return $http.post('/api/Authorization/ChangeSite', data).then(\r\n function (response) {\r\n return response.data;\r\n }); \r\n \r\n }\r\n\r\n function twoFactorSetupRequired(){\r\n return $http.get('/api/CaregiverTwoFactor/Setup').then(\r\n function (response) {\r\n return response.data;\r\n }); \r\n }\r\n\r\n return {\r\n changePassword: ChangePassword,\r\n openAgreementModals: OpenAgreementModals,\r\n getCaregiver: GetCaregiver,\r\n getLoginMessages: GetLoginMessages,\r\n isAuthorized: IsAuthorized,\r\n login: Login,\r\n logout: Logout,\r\n redirectAfterLogin: RedirectAfterLogin,\r\n setCaregiver: SetCaregiver,\r\n ValidateUserAfterAgreement: ValidateUserAfterAgreement,\r\n getSites: getSites,\r\n changeSite: changeSite,\r\n twoFactorSetupRequired : twoFactorSetupRequired,\r\n requestResetPassword : requestResetPassword,\r\n validateResetToken : validateResetToken,\r\n requestUsername : requestUsername,\r\n };\r\n}\r\n\r\nangular.module('authorization').service('AuthorizationService', AuthorizationService);\r\n","function AgreementModalController($rootScope, $scope, template, $uibModalInstance, $uibModal, PermissionService, LocalStorageService, AuthorizationService, IdleService, DirtyPage) {\r\n var vm = this;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.Caregiver = template.Caregiver;\r\n vm.agreed = false;\r\n vm.currentAgreement = template.currentAgreement;\r\n vm.nextAgreements = template.nextAgreements;\r\n vm.isDirty = false;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n DirtyPage.registerDirtyChecker(\"agreement\", checkIfDirty);\r\n \r\n $scope.$on(\"$destroy\", function () {\r\n DirtyPage.unregisterDirtyChecker(\"agreement\");\r\n });\r\n }\r\n\r\n function checkIfDirty() {\r\n return vm.isDirty;\r\n }\r\n\r\n function ok() {\r\n $uibModalInstance.dismiss('ok');\r\n vm.isDirty = true;\r\n\r\n if (!vm.nextAgreements || vm.nextAgreements.length == 0) {\r\n vm.isDirty = false;\r\n\r\n AuthorizationService.ValidateUserAfterAgreement(vm.Caregiver.Id).then(function(response) {\r\n vm.Caregiver.CaregiverLastLogins[0] = response;\r\n LocalStorageService.store('vh-caregiver', vm.Caregiver);\r\n LocalStorageService.remove('timeLogSession');\r\n PermissionService.loadUserPermissions().then(function () {\r\n IdleService.init();\r\n $rootScope.isAuthorized = true;\r\n AuthorizationService.redirectAfterLogin();\r\n \r\n });\r\n });\r\n } \r\n else {\r\n var nextAgreement = '';\r\n if (vm.nextAgreements.length > 0) {\r\n nextAgreement = vm.nextAgreements.shift();\r\n }\r\n\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/authorization/login/agreement.modal.html',\r\n controller: 'AgreementModalController as vm',\r\n backdrop: 'static',\r\n keyboard: false,\r\n resolve: {\r\n template: function () {\r\n return {\r\n Caregiver: vm.Caregiver,\r\n currentAgreement: nextAgreement,\r\n nextAgreements: vm.nextAgreements\r\n };\r\n }\r\n }\r\n });\r\n }\r\n // $uibModalInstance.dismiss('cancel');\r\n // open next modal?\r\n // when last, enter paintlList page, and put entry into LastLogin\r\n }\r\n\r\n function cancel() {\r\n vm.isDirty = false;\r\n $uibModalInstance.dismiss('cancel');\r\n AuthorizationService.logout();\r\n }\r\n}\r\nangular.module('authorization').controller('AgreementModalController', AgreementModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/authorization/login/agreement.modal.html',\n '

    {{vm.currentAgreement.Title | pascalSpacing}}

    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/authorization/login/info.modal.html',\n '');\n}]);\n}(window, document, window.angular));","function LoginController($scope, $rootScope, $uibModal, $state, AuthorizationService, VersionService, CookieService, ConfigurationsService, $location, vhSweetAlert, $transitions) {\r\n\r\n var vm = this;\r\n vm.isAuthorized = $rootScope.isAuthorized;\r\n if (vm.isAuthorized) {\r\n AuthorizationService.redirectAfterLogin();\r\n }\r\n vm.messages = {};\r\n vm.hasPrivacyMessage = false;\r\n vm.hasTermsMessage = false;\r\n vm.unsupportedBrowser = false;\r\n\r\n vm.forgotPassword = false;\r\n\r\n\r\n if ($rootScope.authWatcher == null) {\r\n $rootScope.authWatcher = $rootScope.$watch('isAuthorized', function (newVal, oldVal) {\r\n vm.isAuthorized = newVal;\r\n // if(newVal) {\r\n // AuthorizationService.redirectAfterLogin();\r\n // }\r\n });\r\n }\r\n\r\n\r\n vm.loginInfo = {\r\n isExpired: false,\r\n hasErrors: false,\r\n errorMessages: []\r\n };\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n AuthorizationService.getLoginMessages().then(function (data) {\r\n vm.messages = data;\r\n vm.welcomeMessage = data.LoginWelcomeMessage;\r\n vm.bannerMessage = data.BannerMessage;\r\n\r\n vm.hasPrivacyMessage = data.PrivacyMessage && data.PrivacyMessage.length > 0;\r\n vm.hasTermsMessage = data.TermsAndConditionsMessage && data.TermsAndConditionsMessage.length > 0;\r\n });\r\n\r\n\r\n\r\n ConfigurationsService.getConfig().then(function (data) {\r\n vm.AuthorizationModes = data.AuthorizationModes;\r\n vm.EnableCTPPasswordReset = data.EnableCTPPasswordReset;\r\n vm.showLocalLogin = true;\r\n if (!data.ShowLocalAlways) {\r\n if (vm.AuthorizationModes != undefined && vm.AuthorizationModes.length > 0) {\r\n vm.showLocalLogin = false;\r\n }\r\n }\r\n });\r\n\r\n VersionService.getVersion().then(function (version) {\r\n vm.version = version;\r\n });\r\n\r\n //Detect if we are on an unsupported (IE) browser\r\n if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > -1) {\r\n vm.unsupportedBrowser = true;\r\n }\r\n\t\t\r\n\t\t//Check for transitions to Reset\r\n $transitions.onSuccess({}, (trans) => {\r\n var toState = trans.$to();\r\n vm.reset = toState.name == 'reset';\r\n if (vm.reset) { // user is reseting password\r\n\t\t\t\tvar token = $state.params.token;\r\n\t\t\t\tcheckTokenForPasswordReset(token);\r\n }\r\n });\r\n\t\t\r\n\t\t//Check for loading the page directly to Reset\r\n\t\tif (!vm.isAuthorized && $location.path().includes('/Reset')) { // user is reseting password\r\n\t\t\tvm.reset = true;\r\n\t\t\tvar token = $location.path().substring(7);\r\n\t\t\tcheckTokenForPasswordReset(token);\r\n\t\t}\r\n }\r\n\t\r\n\tfunction checkTokenForPasswordReset(token) {\r\n\t\tif (token) {\r\n\t\t\tvm.loginInfo.token = token;\r\n\t\t\tAuthorizationService.validateResetToken(vm.loginInfo.token).then(function(caregiver) {\r\n\t\t\t\tif (caregiver.Id == -1) {\r\n\t\t\t\t\tvar alertMessage = \"The password reset link used has expired or is invalid. Please return to the login page and redo your password reset.\";\r\n\t\t\t\t\tvhSweetAlert.error('Error', alertMessage).then(function() {\r\n\t\t\t\t\t\tbackToLogin();\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvm.loginInfo.isExpired = true;\r\n\t\t\t\t\tvm.loginInfo.username = caregiver.User_Name;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tbackToLogin();\r\n\t\t}\r\n\t}\r\n\r\n function backToLogin() {\r\n vm.loginInfo.isExpired = false;\r\n vm.reset = false;\r\n $state.go('login');\r\n }\r\n\r\n vm.showMessage = function (type) {\r\n var messageInfo = {};\r\n\r\n if (type === 'Privacy') {\r\n messageInfo.title = 'Privacy';\r\n messageInfo.message = vm.messages.PrivacyMessage;\r\n }\r\n else if (type === 'Terms') {\r\n messageInfo.title = 'Terms and Conditions';\r\n messageInfo.message = vm.messages.TermsAndConditionsMessage;\r\n }\r\n\r\n $uibModal.open({\r\n templateUrl: 'modules/authorization/login/info.modal.html',\r\n controller: 'LoginInfoController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n info: function () {\r\n return angular.copy(messageInfo);\r\n }\r\n }\r\n });\r\n };\r\n}\r\n\r\nangular.module('authorization.login').controller('LoginController', LoginController);\r\n","function LoginService(ConfigurationsService) {\r\n\r\n var passwordLength = 8,\r\n loginRedirect = '',\r\n errors = [\r\n 'Passwords must contain characters from at least three (3) of these groupings: lowercase letters, uppercase letters, numeric, and special characters.',\r\n 'Passwords must not contain repeating or sequential four (4) or more characters or numbers.', //1234\r\n 'Passwords must not contain sequences of three (3) or more characters from the User Name.',\r\n 'Passwords must not contain a sequence of four (4) or more characters or numbers more than once.' //1234123\r\n ];\r\n\r\n init();\r\n\r\n function init() {\r\n return getPasswordConfiguration();\r\n }\r\n\r\n function getErrorWithpasswordLength() {\r\n return 'Your password must be at least ' + getPasswordLength() + ' characters long.'\r\n }\r\n\r\n function getPasswordConfiguration() {\r\n return ConfigurationsService.getConfig().then(function(){\r\n if(ConfigurationsService.configParams !== undefined \r\n && ConfigurationsService.configParams !== null \r\n && ConfigurationsService.configParams.PasswordLength !== undefined \r\n && ConfigurationsService.configParams.PasswordLength !== null) {\r\n passwordLength = ConfigurationsService.configParams.PasswordLength;\r\n }\r\n return;\r\n }).catch(function(){\r\n return;\r\n });\r\n }\r\n\r\n function getPasswordLength() {\r\n return passwordLength;\r\n }\r\n\r\n function GetAllNewPasswordErrorMessages() {\r\n return errors;\r\n }\r\n\r\n function ValidateNewPassword(username, password) {\r\n var errorMsg = [];\r\n\r\n if(password === undefined){\r\n return errorMsg;\r\n }\r\n\r\n var groupings = 0;\r\n\r\n if (!hasMinLength(password)) {\r\n errorMsg.push(getErrorWithpasswordLength());\r\n }\r\n\r\n if (hasNumeric(password)) {\r\n groupings++;\r\n }\r\n if (hasUpperAlpha(password)) {\r\n groupings++;\r\n }\r\n if (hasLowerAlpha(password)) {\r\n groupings++;\r\n }\r\n if (hasSpecialChars(password)) {\r\n groupings++;\r\n }\r\n\r\n if (groupings < 3) {\r\n errorMsg.push(errors[0]);\r\n }\r\n\r\n if (hasRepeatingChars(password)) {\r\n errorMsg.push(errors[1]);\r\n }\r\n\r\n if (hasSequence(password) || hasSequence(password.split('').reverse().join(''))) {\r\n errorMsg.push(errors[1]);\r\n }\r\n\r\n if (hasUserNameChars(password, username)) {\r\n errorMsg.push(errors[2]);\r\n }\r\n\r\n if (hasRepeatingSequence(password)) {\r\n errorMsg.push(errors[3]);\r\n }\r\n\r\n return errorMsg;\r\n }\r\n\r\n function hasMinLength(value) {\r\n return value && value.length && value.length >= passwordLength;\r\n }\r\n\r\n function hasUpperAlpha(value) {\r\n var match = value.match(/[A-Z]/);\r\n return match && match.length > 0;\r\n }\r\n\r\n function hasLowerAlpha(value) {\r\n var match = value.match(/[a-z]/);\r\n return match && match.length > 0;\r\n }\r\n\r\n function hasNumeric(value) {\r\n var match = value.match(/[0-9]/);\r\n return match && match.length > 0;\r\n }\r\n\r\n function hasSpecialChars(value) {\r\n var match = value.match(/[!@#$%_\\^\\&\\*\\-\\.\\?]/);\r\n return match && match.length > 0;\r\n }\r\n\r\n // Password must not contain more than 4 repeating characters\r\n function hasRepeatingChars(value) {\r\n var repeating = false;\r\n\r\n for (var i = 0; i < value.length; i++) {\r\n if (i + 4 > value.length) {\r\n break;\r\n }\r\n\r\n for(var j = 0; j < 5; j++){\r\n if(value[i] === value[i + j] || value[i + j] === undefined){\r\n repeating = true;\r\n }\r\n else {\r\n repeating = false;\r\n break;\r\n }\r\n }\r\n\r\n if(repeating === true){\r\n break;\r\n }\r\n }\r\n\r\n return repeating;\r\n }\r\n\r\n function hasUserNameChars(value, userName) {\r\n var hasChars = false;\r\n value = value.toLowerCase();\r\n userName = userName.toLowerCase();\r\n\r\n for (var i = 0; i < userName.length; i++) {\r\n if (i + 3 > userName.length) {\r\n break;\r\n }\r\n\r\n var userNamePart = userName.substring(i, i + 3);\r\n if (value.indexOf(userNamePart) > -1) {\r\n hasChars = true;\r\n }\r\n }\r\n\r\n return hasChars;\r\n }\r\n\r\n // Password must not contain a sequence of four or more characters more than once\r\n function hasRepeatingSequence(value) {\r\n var repeating = false;\r\n\r\n for (var i = 0; i < value.length; i++) {\r\n if (i + 4 > value.length) {\r\n break;\r\n }\r\n\r\n var val = value.substring(i, i + 4).replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\r\n var match = value.match(val);\r\n if(match !== null && match.length > 1){\r\n repeating = true;\r\n break;\r\n }\r\n }\r\n\r\n for (var i = 0; i < value.length-1; i++) {\r\n if (i + 4 > value.length + 1) {\r\n break;\r\n }\r\n \r\n var stringToCheck = value.substring(i, i+4);\r\n for(var j = i+1; j < value.length-1; j++) {\r\n var stringToCheckAgaint = value.substring(j, j+4);\r\n if(stringToCheck === stringToCheckAgaint) {\r\n repeating = true;\r\n }\r\n }\r\n \r\n }\r\n\r\n return repeating;\r\n }\r\n\r\n function hasSequence(s) {\r\n // Check for sequential numerical characters\r\n for(var i in s) {\r\n if (+s[+i+1] == +s[i]+1 && +s[+i+2] == +s[i]+2 && +s[+i+3] == +s[i]+3) {\r\n return true;\r\n }\r\n }\r\n\r\n // Check for sequential alphabetical characters\r\n for(var i in s) {\r\n if (String.fromCharCode(s.charCodeAt(i)+1) == s[+i+1] && \r\n String.fromCharCode(s.charCodeAt(i)+2) == s[+i+2] &&\r\n String.fromCharCode(s.charCodeAt(i)+3) == s[+i+3]) {\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n }\r\n\r\n function GetLoginRedirect() {\r\n return loginRedirect;\r\n }\r\n\r\n function SetLoginRedirect(redirectURL) {\r\n loginRedirect = redirectURL;\r\n }\r\n\r\n return {\r\n validateNewPassword: ValidateNewPassword,\r\n getAllNewPasswordErrorMessages: GetAllNewPasswordErrorMessages,\r\n getLoginRedirect: GetLoginRedirect,\r\n setLoginRedirect: SetLoginRedirect\r\n };\r\n}\r\n\r\nangular.module('authorization.login').service('LoginService', LoginService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/authorization/login/login.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","function LoginInfoController(info, $uibModalInstance) {\r\n var vm = this;\r\n\r\n vm.title = info.title;\r\n vm.message = info.message;\r\n\r\n vm.ok = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\n\r\nangular.module('authorization.login').controller('LoginInfoController', LoginInfoController);\r\n","function PasswordConfirmDirective() {\r\n function link(scope, elem, attrs, ngModel) {\r\n ngModel.$validators.passwordConfirm = function(modelValue) {\r\n return modelValue == scope.matchTarget;\r\n };\r\n\r\n scope.$watch(\"matchTarget\", function() {\r\n ngModel.$validate();\r\n });\r\n }\r\n\r\n return {\r\n link: link,\r\n require: 'ngModel',\r\n scope: {\r\n matchTarget: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module('authorization.login').directive('passwordConfirm', PasswordConfirmDirective);","function PasswordExpiredDirective() {\r\n\r\n function controller($scope, $state, $templateRequest, AuthorizationService, LoginService, vhSweetAlert) {\r\n\r\n $scope.oldPasswordError = '';\r\n $scope.newPasswordErrors = [];\r\n $scope.confirmPasswordError = '';\r\n $scope.isValidationError = false;\r\n \r\n $scope.loginInfo.resetExpired = function () {\r\n $scope.oldPassword = '';\r\n $scope.newPassword = '';\r\n $scope.confirmPassword = '';\r\n\r\n $scope.loginInfo.errorMessages.length = 0;\r\n $scope.loginInfo.hasErrors = false;\r\n\r\n $scope.hasNewPasswordValidationErrors = false;\r\n };\r\n\r\n $scope.loginInfo.resetExpired();\r\n\r\n $scope.passwordChange = function () {\r\n $scope.loginInfo.errorMessages = [];\r\n $scope.validateOldPassword();\r\n $scope.validateNewPassword();\r\n $scope.validateConfirmPassword();\r\n\r\n if ($scope.loginInfo.errorMessages.length == 0) {\r\n var caregiver = AuthorizationService.getCaregiver();\r\n var request = {\r\n NewPassword: $scope.newPassword,\r\n Password: $scope.loginInfo.password,\r\n UserName: $scope.loginInfo.username,\r\n Token: $scope.loginInfo.token\r\n };\r\n\r\n AuthorizationService.changePassword(caregiver, request).then(function (response) {\r\n if (!response.IsPasswordChangeSuccessful) {\r\n $scope.isNewPasswordError = true;\r\n\r\n $scope.loginInfo.errorMessages.length = 0;\r\n $scope.isValidationError = true;\r\n $scope.loginInfo.errorMessages.push(response.ErrorMessage);\r\n }\r\n else {\r\n $scope.loginInfo.isExpired = false;\r\n if($scope.reset)\r\n vhSweetAlert.success('Success', \"Your password has been updated.\")\r\n AuthorizationService.login($scope.loginInfo.username, $scope.newPassword, $scope.loginInfo.twoFactorCode).then(function (response) {\r\n if (response.TwoFactorCodeRequired){\r\n $scope.showLocalLogin = false;\r\n $scope.showTwoFactorLogin = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n else {\r\n $scope.isValidationError = true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n $scope.validateOldPassword = function () {\r\n var message = 'Old password is incorrect.';\r\n\r\n removeMessage(message);\r\n\r\n $scope.isOldPasswordError = false;\r\n\r\n if ($scope.oldPassword !== $scope.loginInfo.password && !$scope.reset) {\r\n $scope.loginInfo.errorMessages.push(message);\r\n $scope.isOldPasswordError = true;\r\n }\r\n };\r\n\r\n $scope.validateNewPassword = function () {\r\n $scope.loginInfo.errorMessages = [];\r\n\r\n $scope.loginInfo.errorMessages = LoginService.validateNewPassword($scope.loginInfo.username, $scope.newPassword);\r\n \r\n $scope.hasNewPasswordValidationErrors = $scope.loginInfo.errorMessages.length > 0;\r\n\r\n $scope.isNewPasswordError = $scope.loginInfo.errorMessages.length > 0;\r\n\r\n if ($scope.confirmPassword.length > 0) {\r\n $scope.validateConfirmPassword();\r\n }\r\n };\r\n\r\n $scope.validateConfirmPassword = function () {\r\n var message = 'New and confirmed passwords do not match.';\r\n\r\n removeMessage(message);\r\n\r\n $scope.isConfirmPasswordError = false;\r\n\r\n if ($scope.newPassword !== $scope.confirmPassword) {\r\n $scope.loginInfo.errorMessages.push(message);\r\n $scope.isConfirmPasswordError = true;\r\n }\r\n };\r\n\r\n $scope.displayPasswordRules = function () {\r\n vhSweetAlert({\r\n title: \"New Password\",\r\n templateUrl: 'modules/authorization/login/password-expired.rules.tpl.html'\r\n });\r\n };\r\n\r\n $scope.cancel = function ($event) {\r\n $scope.loginInfo.username = '';\r\n $scope.loginInfo.isExpired = false;\r\n $event.stopPropagation();\r\n if ($scope.reset) {\r\n $scope.reset = false;\r\n $state.go('login');\r\n }\r\n };\r\n\r\n function removeMessage(message) {\r\n var index = $scope.loginInfo.errorMessages.indexOf(message);\r\n if (index > -1) {\r\n $scope.loginInfo.errorMessages.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n loginInfo: '=',\r\n reset: '='\r\n },\r\n templateUrl: 'modules/authorization/login/password-expired.tpl.html'\r\n }\r\n}\r\n\r\nangular.module('authorization.login').directive('passwordExpired', PasswordExpiredDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/authorization/login/password-expired.rules.tpl.html',\n '
    • Passwords must contain characters from at least three (3) of these groupings: lowercase letters, uppercase letters, numeric, and special characters.
    • Passwords must not contain repeating or sequential four (4) or more characters or numbers.
    • Passwords must not contain sequences of three (3) or more characters from the User Name.
    • Passwords must not contain a sequence of four (4) or more characters or numbers more than once.
    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/authorization/login/password-expired.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function PasswordLoginDirective() {\r\n\r\n function controller($scope, $window, AuthorizationService, $document) {\r\n\r\n $scope.loginInfo.username = '';\r\n $scope.loginInfo.password = '';\r\n $scope.loginInfo.twoFactorCode = '';\r\n $scope.loginInfo.errorMessages = []; \r\n $scope.isLoginError = false;\r\n $scope.showTwoFactorLogin = false; \r\n\r\n $scope.capsLockEnabled = null;\r\n bindingForCapsLock();\r\n\r\n $scope.validateUsername = function() {\r\n var message = 'You must provide your username.';\r\n\r\n removeMessage(message);\r\n\r\n $scope.isUsernameEmpty = false;\r\n\r\n if($scope.loginInfo.username === undefined || $scope.loginInfo.username.length === 0){\r\n $scope.loginInfo.errorMessages.push(message);\r\n $scope.isUsernameEmpty = true;\r\n }\r\n };\r\n\r\n $scope.validatePassword = function() {\r\n var message = 'You must provide your password.';\r\n\r\n removeMessage(message);\r\n\r\n\r\n $scope.isPasswordEmpty = false;\r\n\r\n if($scope.loginInfo.password === undefined || $scope.loginInfo.password.length === 0){\r\n $scope.loginInfo.errorMessages.push(message);\r\n $scope.isPasswordEmpty = true;\r\n }\r\n };\r\n\r\n $scope.validateTwoFactorCode = function() {\r\n var message = 'You must provide your two factor code.';\r\n\r\n removeMessage(message);\r\n\r\n $scope.isTwoFactorCode = false;\r\n\r\n if($scope.loginInfo.twoFactorCode === undefined || $scope.loginInfo.twoFactorCode.length === 0){\r\n $scope.loginInfo.errorMessages.push(message);\r\n $scope.isTwoFactorCode = true;\r\n }\r\n };\r\n\r\n $scope.showAdmin = function(evt) {\r\n evt.preventDefault();\r\n $scope.showLocalLogin = true;\r\n }\r\n\r\n $scope.loginAuthorization = function(evt, authorizationModelId) {\r\n evt.stopPropagation();\r\n $window.location.href='/SSOAuthorization/Login?authorizationModeId=' + authorizationModelId;\r\n }\r\n\r\n $scope.login = function (evt) {\r\n evt.stopPropagation();\r\n $scope.loginInfo.errorMessages = [];\r\n\r\n $scope.validateUsername();\r\n $scope.validatePassword();\r\n var isValid = !$scope.isUsernameEmpty && !$scope.isPasswordEmpty;\r\n\r\n if (isValid && $scope.showTwoFactorLogin){\r\n $scope.validateTwoFactorCode();\r\n isValid = !$scope.isTwoFactorCode;\r\n }\r\n\r\n if(isValid) {\r\n $scope.loginInfo.errorMessages = [];\r\n\r\n AuthorizationService.login($scope.loginInfo.username, $scope.loginInfo.password, $scope.loginInfo.twoFactorCode).then(function (response) {\r\n var auth = response.AuthenticationResponse;\r\n \r\n if (response.TwoFactorCodeRequired){\r\n $scope.showTwoFactorLogin = true;\r\n setTimeout(function(){\r\n document.getElementById(\"twoFactorCode\").focus()\r\n },0); \r\n }\r\n else if (auth.IsAuthorized && auth.IsExpired) {\r\n $scope.showTwoFactorLogin = false; \r\n $scope.loginInfo.isExpired = true;\r\n }\r\n else if ((auth.IsLocked || auth.IsAccountLocked) && parseInt(auth.LockMinutesRemaining) > 0) {\r\n $scope.showTwoFactorLogin = false;\r\n $scope.loginInfo.password = '';\r\n $scope.loginInfo.twoFactorCode = '';\r\n $scope.isUsernameEmpty = true;\r\n $scope.isPasswordEmpty = true;\r\n var lockMessage = 'Your account has been blocked. Please try after ' + auth.LockMinutesRemaining + ' minute(s).';\r\n $scope.isLoginError = true;\r\n $scope.loginInfo.errorMessages.push(lockMessage);\r\n }\r\n else if ((auth.IsLocked || auth.IsAccountLocked) && parseInt(auth.LockMinutesRemaining) === 0) {\r\n $scope.showTwoFactorLogin = false;\r\n $scope.loginInfo.password = '';\r\n $scope.loginInfo.twoFactorCode = '';\r\n $scope.isUsernameEmpty = true;\r\n $scope.isPasswordEmpty = true;\r\n var lockMessage = auth.ErrorMessage && auth.ErrorMessage.length > 0 ? auth.ErrorMessage : 'Your account is locked due to inactivity, please contact your user administrator';\r\n $scope.isLoginError = true;\r\n $scope.loginInfo.errorMessages.push(lockMessage);\r\n }\r\n else if (auth.IsAuthorized && auth.ShowAgreement) {\r\n $scope.showTwoFactorLogin = false;\r\n $scope.loginInfo.password = '';\r\n $scope.loginInfo.twoFactorCode = '';\r\n $scope.isUsernameEmpty = true;\r\n $scope.isPasswordEmpty = true;\r\n var invalidInformationMessage = 'Agreement to the terms is required for access.';\r\n $scope.isLoginError = true;\r\n $scope.loginInfo.errorMessages.push(invalidInformationMessage);\r\n }\r\n else {\r\n $scope.showTwoFactorLogin = false;\r\n $scope.loginInfo.password = '';\r\n $scope.loginInfo.twoFactorCode = '';\r\n $scope.isUsernameEmpty = true;\r\n $scope.isPasswordEmpty = true;\r\n var invalidInformationMessage = 'Invalid username or password.';\r\n $scope.isLoginError = true;\r\n $scope.loginInfo.errorMessages.push(invalidInformationMessage);\r\n }\r\n });\r\n }\r\n };\r\n\r\n $scope.forgotCredentials = function(event){\r\n event.stopPropagation()\r\n $scope.forgotPassword = true\r\n }\r\n\r\n function removeMessage(message){\r\n var index = $scope.loginInfo.errorMessages.indexOf(message);\r\n if(index > -1)\r\n {\r\n $scope.loginInfo.errorMessages.splice(index, 1); \r\n } \r\n }\r\n\r\n function bindingForCapsLock () {\r\n $document.bind(\"keydown\", function (event) {\r\n if (event.keyCode == 20 && $scope.capsLockEnabled !== null) {\r\n setCapsLockEnabled(!$scope.capsLockEnabled);\r\n } \r\n });\r\n \r\n $document.bind(\"keypress\", function (event) {\r\n var code = event.charCode || event.keyCode;\r\n var shift = event.shiftKey;\r\n \r\n if (code > 96 && code < 123) { setCapsLockEnabled(false); }\r\n if (code > 64 && code < 91 && !shift) { setCapsLockEnabled(true); }\r\n });\r\n }; \r\n\r\n function setCapsLockEnabled(value){\r\n $scope.capsLockEnabled = value;\r\n $scope.$apply();\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n loginInfo: \"=\",\r\n authorizationModes: '=',\r\n showLocalLogin: '=',\r\n forgotPassword: '=',\r\n passwordResetEnabled: '=',\r\n },\r\n templateUrl: 'modules/authorization/login/password-login.tpl.html'\r\n };\r\n}\r\n\r\nangular.module('authorization.login').directive('passwordLogin', PasswordLoginDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/authorization/login/password-login.tpl.html',\n '
    Login with Local Account
    ');\n}]);\n}(window, document, window.angular));","function PasswordResetDirective() {\r\n function controller($scope, $window, AuthorizationService, $document, vhSweetAlert) {\r\n $scope.loginInfo.errorMessages = [];\r\n $scope.resetInfo = {\r\n inputField: 'Username',\r\n title: 'Password',\r\n data: '',\r\n }\r\n\r\n $scope.changeField = function(field){\r\n // if title == password, input = username\r\n // if title == username, input = email\r\n $scope.resetInfo.inputField = field === 'Password' ? 'Username' : 'Email Address';\r\n $scope.resetInfo.title = field;\r\n $scope.resetInfo.data = '';\r\n $scope.loginInfo.errorMessages = []; \r\n }\r\n\r\n $scope.validateResetInfo = function() {\r\n var data = $scope.resetInfo.data;\r\n $scope.loginInfo.errorMessages = $scope.resetInfo.inputField === 'Username' ?\r\n validateUsername(data) : validateEmail(data);\r\n }\r\n\r\n $scope.reset = function(event){\r\n event.stopPropagation();\r\n $scope.validateResetInfo();\r\n var alertMessage = $scope.resetInfo.inputField === 'Email Address' ? \r\n 'Request successfully submitted. If your email address matches the one provided in your account, you will receive an email containing your username. You will now be redirected to the forgot password page.' :\r\n 'Request successfully submitted. If your username matches the one provided in your account, you will receive an email with instructions to reset your password. You will now be redirected to the login page.';\r\n var api_call = $scope.resetInfo.inputField === 'Username' ? AuthorizationService.requestResetPassword : AuthorizationService.requestUsername\r\n var ret_call = $scope.resetInfo.inputField === 'Username' ? $scope.backToLogin : $scope.changeField\r\n if($scope.loginInfo.errorMessages.length === 0)\r\n {\r\n api_call($scope.resetInfo.data).then(function(res){\r\n if(res !== 200)\r\n return;\r\n vhSweetAlert.success('Success', alertMessage).then(function(){\r\n ret_call('Password')\r\n })\r\n })\r\n }\r\n }\r\n\r\n $scope.backToLogin = function(){\r\n $scope.forgotPassword = false;\r\n }\r\n\r\n function validateEmail(data){\r\n var ret = [];\r\n if(!(data.includes('@') && data.includes('.')))\r\n ret.push('You must provide your email address.');\r\n return ret;\r\n }\r\n\r\n function validateUsername(data){\r\n return data.length === 0 ? ['You must provide your username.'] : [];\r\n }\r\n\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n loginInfo: \"=\",\r\n authorizationModes: '=',\r\n forgotPassword: '=',\r\n },\r\n templateUrl: 'modules/authorization/login/password-reset.tpl.html'\r\n }\r\n}\r\n\r\nangular.module('authorization.login').directive('passwordReset', PasswordResetDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/authorization/login/password-reset.tpl.html',\n '

    Forgot {{resetInfo.title}}

    ');\n}]);\n}(window, document, window.angular));","function PasswordValidateDirective(LoginService) {\r\n function link(scope, elem, attrs, ngModel) {\r\n ngModel.$validators.passwordValidate = function(modelValue) {\r\n var errors = LoginService.validateNewPassword(scope.userName, modelValue);\r\n return errors.length == 0;\r\n };\r\n }\r\n\r\n return {\r\n link: link,\r\n require: 'ngModel',\r\n scope: {\r\n userName: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module('authorization.login').directive('passwordValidate', PasswordValidateDirective);","function ResetLoginErrorDirective($timeout){\r\n return {\r\n link: function(scope, elem, attrs) {\r\n scope.$watch('resetLoginErrors', function(newVal, oldVal){\r\n if(scope.resetLoginErrors.length > 0){\r\n var oldErrorClass = 'rotate-text-' + oldVal.length;\r\n var newErrorClass = 'rotate-text-' + newVal.length;\r\n\r\n elem.removeClass(oldErrorClass);\r\n $timeout(function(){\r\n elem.addClass(newErrorClass);\r\n });\r\n }\r\n }, true);\r\n },\r\n scope: {\r\n resetLoginErrors: '='\r\n }\r\n }\r\n}\r\n\r\nangular.module('authorization.login').directive('resetLoginErrors', ResetLoginErrorDirective);","function TwoFactorLoginSetupController($uibModal, CaregiversService, AuthorizationService, $rootScope, $state, $window, vhSweetAlert) {\r\n var vm = this;\r\n vm.openTwoFactorModal = openTwoFactorModal;\r\n vm.logout = logout;\r\n \r\n function openTwoFactorModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/caregivers/twoFactorSetup.modal.html',\r\n controller: 'TwoFactorSetupModalController as vm',\r\n size: 'lg',\r\n keyboard: false,\r\n backdrop: 'static',\r\n resolve: {\r\n caregiver: function() {\r\n return AuthorizationService.getCaregiver();\r\n },\r\n TwoFactorSecret : function(){\r\n return CaregiversService.getTwoFactorSecret();\r\n },\r\n NewSecret : function(){\r\n return CaregiversService.getNewTwoFactorSecret();\r\n }, \r\n loginPending : function(){\r\n return true;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (data) {\r\n if ( data != 1){\r\n logout();\r\n }\r\n }); \r\n } \r\n\r\n\r\n function logout() {\r\n AuthorizationService.logout().then(\r\n function (logoutUrl) {\r\n AuthorizationService.isAuthorized().then(\r\n function (isAuthorized) {\r\n $rootScope.isAuthorized = isAuthorized;\r\n $rootScope.showTwoFactorSetup = false;\r\n $state.go('login');\r\n if(logoutUrl.length > 0) {\r\n $window.location.href = logoutUrl;\r\n }\r\n location.reload();\r\n },\r\n function (errorMessage) {\r\n location.reload();\r\n }\r\n );\r\n },\r\n function (errorMessage) {\r\n location.reload();\r\n }\r\n );\r\n }; \r\n\r\n }\r\nangular.module('twoFactorSetup').controller('TwoFactorLoginSetupController', TwoFactorLoginSetupController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/authorization/twoFactorLoginSetup/twoFactorLoginSetup.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","function BIIFrameService($http, $q, $timeout, $location, $rootScope, $window) {\r\n var exagoApi = null;\r\n var exagoSession = null;\r\n var executionStatusEnum = { Unknown: 0, Initializing: 1, Refreshing: 2, Executing: 3, Starting: 4, Visualizing: 5, Complete: 6, Error: 7 }\r\n\r\n var editreportController = null;\r\n var editdirectiveController = null;\r\n init();\r\n\r\n return {\r\n getExagoApi: getExagoApi,\r\n deleteExagoApi: deleteExagoApi,\r\n executionStatusEnum: executionStatusEnum,\r\n raiseCreateReportFinish: raiseCreateReportFinish,\r\n setReportController: setReportController,\r\n editreportController: editreportController,\r\n raiseDesignerLoaded: raiseDesignerLoaded,\r\n setDirectiveController: setDirectiveController,\r\n editdirectiveController: editdirectiveController\r\n };\r\n\r\n function init() {\r\n $window.addEventListener('message', function (event) {\r\n if (event.data == \"designerLoaded\") {\r\n if (editreportController != null) {\r\n var reportMessage = {\r\n \"type\": \"reportInfo\",\r\n \"isEdit\": editreportController.isEdit,\r\n \"ExagoPath\": editreportController.selectedReport != null ? editreportController.selectedReport.ExagoFullPath : \"\"\r\n };\r\n\r\n \r\n event.source.window.postMessage(reportMessage, '*');\r\n }\r\n }\r\n else if (event.data.type == \"reportInfo\") {\r\n if (editdirectiveController != null) {\r\n editdirectiveController.processReport(event.data);\r\n }\r\n }\r\n else if (event.data == \"reportCreated\") {\r\n if (editreportController != null) {\r\n editreportController.ReportDesignerChanged(null, 0, true, editreportController.folderId); //Sending 0 which is SaveReport\r\n }\r\n }\r\n });\r\n }\r\n\r\n\r\n function setReportController(reportController) {\r\n editreportController = reportController;\r\n }\r\n\r\n function setDirectiveController(directiveController) {\r\n editdirectiveController = directiveController;\r\n }\r\n\r\n function createSession() {\r\n var sessionRequest = {\r\n HttpProtocol: $location.protocol(),\r\n HttpHost: $location.host(),\r\n HttpPort: $location.port(),\r\n ReportParams: []\r\n };\r\n\r\n return $http.post(\r\n '/api/BISessionReportAdmin',\r\n sessionRequest\r\n ).then(function (response) {\r\n exagoSession = response.data;\r\n return exagoSession;\r\n }, function (errorMessage) {\r\n exagoSession = null;\r\n console.error(errorMessage);\r\n return;\r\n });\r\n }\r\n\r\n function deleteSession() {\r\n cachedReports = {}; // clear cache\r\n if (exagoSession) {\r\n return $http({\r\n method: 'DELETE',\r\n url: '/api/BISession/' + exagoSession.Id\r\n }).then(function (response) {\r\n exagoSession = null;\r\n return;\r\n }, function (errorMessage) {\r\n exagoSession = null;\r\n console.log(errorMessage);\r\n return;\r\n });\r\n }\r\n }\r\n\r\n function getExagoApi() {\r\n return $q(function (resolve, reject) {\r\n if (exagoApi) {\r\n resolve(exagoApi);\r\n } else {\r\n $timeout(function () {\r\n createSession().then(\r\n function (session) {\r\n exagoApi = new ExagoApi(\r\n session.ExagoBaseURL,\r\n session.ApiKey,\r\n function () {\r\n resolve(exagoApi);\r\n },\r\n true\r\n );\r\n\r\n },\r\n function (reason) {\r\n reject(reason);\r\n }\r\n );\r\n });\r\n }\r\n });\r\n }\r\n\r\n function deleteExagoApi() {\r\n deleteSession();\r\n if (exagoApi) {\r\n exagoApi.DisposePage();\r\n exagoApi = null;\r\n }\r\n }\r\n\r\n\r\n \r\n function raiseCreateReportFinish() {\r\n if ($window.parent !== $window) {\r\n $window.parent.postMessage('reportCreated', '*');\r\n }\r\n }\r\n\r\n function raiseDesignerLoaded() {\r\n if ($window.parent !== $window) {\r\n $window.parent.postMessage('designerLoaded', '*');\r\n }\r\n }\r\n \r\n\r\n \r\n\r\n\r\n}\r\n\r\nangular.module('bi').factory('BIIFrameService', BIIFrameService);\r\n\r\n","function biReportDesignerIframeDirective() {\r\n\r\n return {\r\n scope: {\r\n initalAction: '@', // Run, Refresh, Edit, Create, Schedule, ViewSchedules, FullUI\r\n startingaction: '=',\r\n statusChangeCallback: '=onstatuschange',\r\n loadinghtml: '@',\r\n showloadingspinner: '='\r\n },\r\n controller: 'biReportDesignerIframeController',\r\n controllerAs: 'biReportDesignerIframeCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/bi-report.tpl.html',\r\n link: function afterLink($scope, element, attributes, biReportDesignerIframeCtrl) {\r\n biReportDesignerIframeCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biReportDesignerIframeController($scope, $timeout, BIIFrameService) {\r\n\r\n //Private \r\n var watchers = [];\r\n var biApi = null;\r\n var exagoContainer = document.querySelector('#ExagoWindow');\r\n\r\n //Public\r\n var biReportDesignerIframeCtrl = this;\r\n\r\n biReportDesignerIframeCtrl.initalAction = $scope.initalAction;\r\n biReportDesignerIframeCtrl.startingaction = $scope.startingaction;\r\n biReportDesignerIframeCtrl.statusChangeCallback = $scope.statusChangeCallback;\r\n biReportDesignerIframeCtrl.loadinghtml = $scope.loadinghtml;\r\n biReportDesignerIframeCtrl.showloadingspinner = $scope.showloadingspinner;\r\n\r\n\r\n biReportDesignerIframeCtrl.init = init;\r\n biReportDesignerIframeCtrl.reportLoading = false;\r\n biReportDesignerIframeCtrl.displayLoadingSpinner = displayLoadingSpinner;\r\n biReportDesignerIframeCtrl.executionStatusEnum = BIIFrameService.executionStatusEnum.Unknown;\r\n biReportDesignerIframeCtrl.processReport = processReport;\r\n\r\n function init() {\r\n $scope.$on(\"$destroy\", onDestroy);\r\n $timeout(function () {\r\n BIIFrameService.getExagoApi().then(function (api) {\r\n biApi = api;\r\n BIIFrameService.setDirectiveController(biReportDesignerIframeCtrl);\r\n BIIFrameService.raiseDesignerLoaded();\r\n });\r\n }, 0);\r\n\r\n }\r\n\r\n function processReport(reportMessage) {\r\n if (reportMessage.isEdit) {\r\n editReport(reportMessage.ExagoPath);\r\n }\r\n else {\r\n createReport();\r\n }\r\n\r\n }\r\n\r\n\r\n function onDestroy() {\r\n\r\n if (biApi) {\r\n biApi.DisposeContainerContent(exagoContainer);\r\n }\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n\r\n\r\n\r\n\r\n function editReport(ExagoFullPath) {\r\n if (biReportDesignerIframeCtrl.reportLoading === false) {\r\n if (biApi) {\r\n biApi.DisposeContainerContent(exagoContainer);\r\n biApi.EditReport(exagoContainer, ExagoFullPath, null, onReportError);\r\n }\r\n }\r\n }\r\n\r\n function onReportError(container, errorMessage) {\r\n biReportDesignerIframeCtrl.reportLoading = false;\r\n }\r\n\r\n\r\n\r\n function createReport() {\r\n if (biReportDesignerIframeCtrl.reportLoading === false) {\r\n if (biApi) {\r\n biApi.DisposeContainerContent(exagoContainer);\r\n var reportTypes = biApi.GetAllowedReportTypes();\r\n if (reportTypes) {\r\n biApi.NewReport(exagoContainer, reportTypes[0]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n $scope.$on('OnDisposeContainer', function (event, next, current) {\r\n $scope.biReportDesignerIframeCtrl.reportLoading = false;\r\n if (!$scope.$$phase) {\r\n $scope.$apply();\r\n }\r\n });\r\n\r\n\r\n $scope.OnCreateReportFinish = function (clientInfo) {\r\n BIIFrameService.raiseCreateReportFinish();\r\n }\r\n\r\n function displayLoadingSpinner() {\r\n var retVal = false;\r\n\r\n if (\r\n biReportDesignerIframeCtrl.showloadingspinner == true &&\r\n (\r\n biReportDesignerIframeCtrl.executionStatusEnum == BIIFrameService.executionStatusEnum.Unknown ||\r\n biReportDesignerIframeCtrl.executionStatusEnum == BIIFrameService.executionStatusEnum.Initializing ||\r\n biReportDesignerIframeCtrl.executionStatusEnum == BIIFrameService.executionStatusEnum.Refreshing ||\r\n biReportDesignerIframeCtrl.executionStatusEnum == BIIFrameService.executionStatusEnum.Executing ||\r\n biReportDesignerIframeCtrl.executionStatusEnum == BIIFrameService.executionStatusEnum.Starting\r\n )\r\n ) {\r\n retVal = true;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n}\r\n\r\nangular.module('bi').directive('biReportDesignerIframe', [biReportDesignerIframeDirective]);\r\n\r\nangular.module('bi').controller('biReportDesignerIframeController', ['$scope', '$timeout', 'BIIFrameService', biReportDesignerIframeController]);","function biReportDirective() {\r\n\r\n return {\r\n scope: {\r\n initalAction: '@', // Run, Refresh, Edit, Create, Schedule, ViewSchedules, FullUI\r\n startingaction: '=',\r\n report: '=',\r\n statusChangeCallback: '=onstatuschange',\r\n loadinghtml: '@',\r\n showloadingspinner: '=',\r\n reportDesignerCallback: '=onreportdesignerchange',\r\n reportController: \"=reportcontroller\"\r\n\r\n },\r\n controller: 'biReportController',\r\n controllerAs: 'biReportCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/bi-report.tpl.html',\r\n link: function afterLink($scope, element, attributes, biReportCtrl) {\r\n biReportCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biReportController($scope, $state, $transitions, $timeout, $uibModal, BIService, ReportsService, vhSweetAlert, AuthorizationService) {\r\n\r\n //Private \r\n var watchers = [];\r\n var biApi = null;\r\n var exagoContainer = document.querySelector('#ExagoWindow');\r\n var currentReportInstance = null;\r\n\r\n //Public\r\n var biReportCtrl = this;\r\n\r\n biReportCtrl.initalAction = $scope.initalAction;\r\n biReportCtrl.startingaction = $scope.startingaction;\r\n biReportCtrl.report = $scope.report;\r\n biReportCtrl.statusChangeCallback = $scope.statusChangeCallback;\r\n biReportCtrl.loadinghtml = $scope.loadinghtml;\r\n biReportCtrl.showloadingspinner = $scope.showloadingspinner;\r\n biReportCtrl.reportDesignerCallback = $scope.reportDesignerCallback;\r\n biReportCtrl.reportController = $scope.reportController;\r\n\r\n biReportCtrl.init = init;\r\n biReportCtrl.reportLoading = false;\r\n biReportCtrl.isStateChanging = false;\r\n biReportCtrl.ifLoadFullUI = false;\r\n biReportCtrl.navigateToPatientListByIdList = navigateToPatientListByIdList;\r\n biReportCtrl.exportExcelOnlyReport = exportExcelOnlyReport;\r\n biReportCtrl.displayLoadingSpinner = displayLoadingSpinner;\r\n biReportCtrl.executionStatusEnum = BIService.executionStatusEnum.Unknown;\r\n function init() {\r\n\r\n if ($state.current.name == \"reports.folder.edit\") {\r\n if ($state.params.isEdit) {\r\n biReportCtrl.initalAction = \"Edit\";\r\n }\r\n else {\r\n biReportCtrl.initalAction = \"Create\";\r\n }\r\n }\r\n SetExecutionStatus(BIService.executionStatusEnum.Initializing);\r\n $scope.$on(\"$destroy\", onDestroy);\r\n\r\n watchers.push($scope.$on('$locationChangeStart', function (event, next, current) {\r\n if (biReportCtrl.reportLoading === true) {\r\n event.preventDefault();\r\n }\r\n }));\r\n // watchers.push($transitions.onStart({}, (trans) => {\r\n // var toState = trans.to();\r\n // var toParams = toState.params;\r\n\r\n // if (biReportCtrl.reportLoading === true) {\r\n // return false;\r\n // }\r\n // else {\r\n // if (biReportCtrl.ifLoadFullUI && biReportCtrl.isStateChanging == false && document.getElementsByClassName(\"wrReportOptionsBtn\").length > 0) {\r\n\r\n // vhSweetAlert.verify('Are you sure?', 'If you leave this page you will lose all unsaved changes. Are you sure you want to leave?', 'Leave')\r\n // .then(function (isConfirm) {\r\n // if (isConfirm) {\r\n // biReportCtrl.isStateChanging = true;\r\n // trans.router.stateService.transitionTo(toState.name, toParams, { reload: true });\r\n // biReportCtrl.isStateChanging = false;\r\n // }\r\n // });\r\n\r\n // return false;\r\n // }\r\n // }\r\n // }));\r\n\r\n watchers.push($scope.$watch('biReportCtrl.loadinghtml', setLoadingContent));\r\n\r\n watchers.push($scope.$on('biExecuteReport', executeReport));\r\n watchers.push($scope.$on('biRefreshReport', refreshReport));\r\n watchers.push($scope.$on('biEditReport', editReport));\r\n watchers.push($scope.$on('biCreateReport', createReport));\r\n watchers.push($scope.$on('biScheduleReport', scheduleReport));\r\n watchers.push($scope.$on('biViewSchedules', viewSchedules));\r\n watchers.push($scope.$on('biLoadFullUI', loadFullUI));\r\n watchers.push($scope.$on('biDeleteReport', deleteReport));\r\n\r\n $timeout(function () {\r\n BIService.getExagoApi().then(function (api) {\r\n biApi = api;\r\n performInitalAction();\r\n });\r\n }, 0);\r\n\r\n\r\n }\r\n\r\n function setLoadingContent(newValue, oldValue, scope) {\r\n if (newValue != null && exagoContainer != null) {\r\n exagoContainer.innerHTML = newValue;\r\n }\r\n }\r\n\r\n function performInitalAction() {\r\n switch (biReportCtrl.initalAction) {\r\n case 'Run':\r\n executeReport();\r\n break;\r\n case 'Refresh':\r\n refreshReport();\r\n break;\r\n case 'Edit':\r\n editReport();\r\n break;\r\n case 'Delete':\r\n deleteReport();\r\n break;\r\n case 'Create':\r\n createReport();\r\n break;\r\n case 'Schedule':\r\n scheduleReport();\r\n break;\r\n case 'ViewSchedules':\r\n viewSchedules();\r\n break;\r\n case 'FullUI':\r\n loadFullUI();\r\n break;\r\n }\r\n }\r\n\r\n function onReportProgress(container, updateType) {\r\n var instanceStatus = ReportsService.ReportInstanceStatus.Running;\r\n switch (updateType) {\r\n case \"executionstart\":\r\n biReportCtrl.reportLoading = true;\r\n SetExecutionStatus(BIService.executionStatusEnum.Starting);\r\n break;\r\n case \"initialcontentload\":\r\n SetExecutionStatus(BIService.executionStatusEnum.Visualizing);\r\n biReportCtrl.reportLoading = false;\r\n instanceStatus = ReportsService.ReportInstanceStatus.Complete;\r\n isRenderingComplete();\r\n break;\r\n default:\r\n SetExecutionStatus(BIService.executionStatusEnum.Unknown);\r\n biReportCtrl.reportLoading = false;\r\n instanceStatus = ReportsService.ReportInstanceStatus.Error;\r\n console.log(updateType);\r\n break;\r\n }\r\n\r\n if (instanceStatus != 0) {\r\n currentReportInstance.Status = instanceStatus;\r\n ReportsService.updateReportInstance(currentReportInstance);\r\n }\r\n }\r\n\r\n function onReportError(container, errorMessage) {\r\n SetExecutionStatus(BIService.executionStatusEnum.Error);\r\n biReportCtrl.reportLoading = false;\r\n currentReportInstance.Status = ReportsService.ReportInstanceStatus.Error;\r\n currentReportInstance.ErrorMessage = errorMessage;\r\n ReportsService.updateReportInstance(currentReportInstance);\r\n console.error(errorMessage);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n if (biApi) {\r\n biApi.DisposeContainerContent(exagoContainer);\r\n }\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n\r\n function executeReport(event, exportFormat, action) {\r\n\r\n SetExecutionStatus(BIService.executionStatusEnum.Executing);\r\n\r\n\r\n\r\n if (biReportCtrl.reportLoading === false) {\r\n biReportCtrl.reportLoading = true;\r\n\r\n // Need to finish getReportInstanceParams() and use that function instead\r\n // of an empty array for the ReportInstanceParams property.\r\n currentReportInstance =\r\n {\r\n ReportInstanceId: -1,\r\n ReportTypeId: null,\r\n BIReportId: biReportCtrl.report.ReportId,\r\n ReportPath: biReportCtrl.report.ExagoFullPath,\r\n Status: ReportsService.ReportInstanceStatus.Running,\r\n CreatedDateTime_UTC: new Date(), // use new date, this will get seralized to utc when saved.\r\n ErrorMessage: null,\r\n ExportType: exportFormat,\r\n ActionType: action,\r\n ReportInstanceParams: []\r\n\r\n };\r\n if (!exportFormat) {\r\n exportFormat = \"html\";\r\n }\r\n ReportsService.createReportInstance(currentReportInstance).then(function (newInstance) {\r\n currentReportInstance = newInstance;\r\n currentReportInstance.ExportType = exportFormat;\r\n currentReportInstance.ActionType = action;\r\n if (biApi) {\r\n if (!biReportCtrl.loadinghtml) {\r\n biApi.DisposeContainerContent(exagoContainer);\r\n }\r\n\r\n if (biReportCtrl.report && biReportCtrl.report.ExagoFullPath) {\r\n\r\n // send the instance ID back to server\r\n var exagoParams = getExagoParams();\r\n exagoParams.push({ Name: \"ReportInstanceId\", Value: newInstance.ReportInstanceId, PromptText: null }); // send to back end for execution\r\n var reportOptions = {\r\n Udf: null,\r\n UpdateCallback: onReportProgress,\r\n ErrorCallback: onReportError,\r\n NewFilters: [],\r\n PromptingFilterValues: [],\r\n Parameters: exagoParams\r\n };\r\n\r\n biApi.ExecuteReport(exagoContainer, exportFormat, biReportCtrl.report.ExagoFullPath, reportOptions, onReportProgress, onReportError);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n function getExagoParams() {\r\n exagoParams = [];\r\n var filterSelectedString = \"\";\r\n angular.forEach(biReportCtrl.report.Parameters, function (biParam) {\r\n switch (biParam.InputTypeEnum) {\r\n\r\n\r\n case BIService.inputTypeEnum.DateRange:\r\n case BIService.inputTypeEnum.MonthRange:\r\n {\r\n\r\n filterSelectedString = setExagoDateRangeParams(biParam, exagoParams, filterSelectedString)\r\n break;\r\n }\r\n case BIService.inputTypeEnum.Date: {\r\n\r\n break;\r\n }\r\n case BIService.inputTypeEnum.SingleSelectList: {\r\n filterSelectedString = setExagoExagoSingleSelectListParam(biParam, exagoParams, filterSelectedString);\r\n break;\r\n }\r\n case BIService.inputTypeEnum.MultiSelectList: {\r\n filterSelectedString = setExagoExagoMultiSelectListParam(biParam, exagoParams, filterSelectedString);\r\n break;\r\n }\r\n case BIService.inputTypeEnum.SingleSelectTypeAhead: {\r\n filterSelectedString = setExagoSingleSelectTypeAheadParam(biParam, exagoParams, filterSelectedString);\r\n break;\r\n }\r\n case BIService.inputTypeEnum.MultiSelectCheck:\r\n case BIService.inputTypeEnum.MultiSelectTypeAhead: {\r\n filterSelectedString = setExagoMultiSelectTypeAheadParam(biParam, exagoParams, filterSelectedString);\r\n break;\r\n }\r\n case BIService.inputTypeEnum.CheckBox: {\r\n setExagoCheckBoxParam(biParam, exagoParams);\r\n break;\r\n }\r\n case BIService.inputTypeEnum.NoteText: {\r\n setExagoNoteTextParam(biParam, exagoParams);\r\n break;\r\n }\r\n default: {\r\n exagoParams.push({\r\n Name: biParam.ExagoParameterName,\r\n Value: biParam.SelectedValue,\r\n PromptText: null\r\n });\r\n break;\r\n }\r\n }\r\n });\r\n\r\n var reportFilterSelectedParams = exagoParams.filter(function (parameter) {\r\n return parameter.Name == \"ReportFilterSelected\";\r\n });\r\n if (reportFilterSelectedParams.length > 0) {\r\n if (filterSelectedString != \"\" && filterSelectedString.charAt(filterSelectedString.length - 2) == \",\") {\r\n filterSelectedString = filterSelectedString.slice(0, -2);\r\n }\r\n\r\n //If more than 2500 characters truncate and add note\r\n if (filterSelectedString.length > 2500) {\r\n filterSelectedString = filterSelectedString.substring(0, 2499) + \" ...(selected filters too long to display)\";\r\n }\r\n\r\n reportFilterSelectedParams[0].Value = filterSelectedString;\r\n }\r\n return exagoParams;\r\n }\r\n\r\n function setExagoCheckBoxParam(biParam, exagoParams) {\r\n\r\n exagoParams.push({\r\n Name: biParam.ExagoParameterName,\r\n Value: biParam.SelectedValue,\r\n PromptText: null\r\n });\r\n }\r\n\r\n function setExagoNoteTextParam(biParam, exagoParams) {\r\n var noteText = \"\";\r\n if (biParam.SelectedValue != undefined && biParam.SelectedValue != \"\") {\r\n noteText = biParam.SelectedValue.replace(/[\\n]/g, '\\r');\r\n }\r\n\r\n exagoParams.push({\r\n Name: biParam.ExagoParameterName,\r\n Value: noteText,\r\n PromptText: null\r\n });\r\n\r\n exagoParams.push({\r\n Name: 'CareTeamMember',\r\n Value: AuthorizationService.getCaregiver().DisplayName,\r\n PromptText: null\r\n });\r\n\r\n }\r\n\r\n\r\n function setExagoExagoSingleSelectListParam(biParam, exagoParams, filterSelectedString) {\r\n\r\n var selectedValues = [];\r\n\r\n if (biParam.SelectedValue) {\r\n for (var i = 0; i < biParam.Options.length; i++) {\r\n var Option = biParam.Options[i];\r\n if (Option.Value === biParam.SelectedValue) {\r\n selectedValues.push({ DisplayValue: Option.Name, Value: Option.Value })\r\n filterSelectedString += biParam.DisplayName + \":\" + Option.Name + \", \"\r\n }\r\n }\r\n }\r\n\r\n exagoParams.push({\r\n Name: biParam.ExagoParameterName,\r\n Value: JSON.stringify(selectedValues),\r\n PromptText: null\r\n });\r\n\r\n return filterSelectedString;\r\n\r\n\r\n }\r\n\r\n function setExagoExagoMultiSelectListParam(biParam, exagoParams, filterSelectedString) {\r\n\r\n var selectedValues = [];\r\n\r\n biParam.Options.forEach(function (option) {\r\n if (option.selected) {\r\n selectedValues.push({ DisplayValue: option.Name, Value: option.Value });\r\n }\r\n });\r\n\r\n if (biParam.Options.length == selectedValues.length) {\r\n //Clear if all\r\n selectedValues = [];\r\n selectedValues.push({ DisplayValue: \"All\", Value: \"\" })\r\n }\r\n\r\n if (selectedValues.length > 0) {\r\n filterSelectedString += biParam.DisplayName + \":\";\r\n selectedValues.forEach(function (option) {\r\n filterSelectedString += option.DisplayValue + \", \";\r\n });\r\n }\r\n\r\n exagoParams.push({\r\n Name: biParam.ExagoParameterName,\r\n Value: JSON.stringify(selectedValues),\r\n PromptText: null\r\n });\r\n return filterSelectedString;\r\n\r\n }\r\n\r\n function setExagoSingleSelectTypeAheadParam(biParam, exagoParams, filterSelectedString) {\r\n\r\n var selectedValues = [];\r\n\r\n if (biParam.SelectedValue && biParam.SelectedValue.data && biParam.SelectedValue.value) {\r\n\r\n selectedValues.push({ DisplayValue: biParam.SelectedValue.value, Value: biParam.SelectedValue.data })\r\n filterSelectedString += biParam.DisplayName + \":\" + biParam.SelectedValue.value + \", \"\r\n }\r\n\r\n exagoParams.push({\r\n Name: biParam.ExagoParameterName,\r\n Value: JSON.stringify(selectedValues),\r\n PromptText: null\r\n });\r\n return filterSelectedString;\r\n\r\n }\r\n\r\n function setExagoMultiSelectTypeAheadParam(biParam, exagoParams, filterSelectedString) {\r\n\r\n var selectedValues = [];\r\n var addParameterName = false;\r\n\r\n if (biParam.Options.length == 0 && biParam.InputTypeEnum == BIService.inputTypeEnum.MultiSelectCheck && biParam.SelectedValue == \"All\") {\r\n filterSelectedString += biParam.DisplayName + \": \";\r\n selectedValues.push({ DisplayValue: \"All\", Value: \"\" })\r\n filterSelectedString += \"All\" + \", \";\r\n }\r\n else {\r\n for (var i = 0; i < biParam.Options.length; i++) {\r\n var Option = biParam.Options[i];\r\n if (!addParameterName) {\r\n filterSelectedString += biParam.DisplayName + \":\";\r\n addParameterName = true;\r\n }\r\n selectedValues.push({ DisplayValue: Option.Name, Value: Option.Value })\r\n filterSelectedString += Option.Name + \", \";\r\n }\r\n }\r\n\r\n exagoParams.push({\r\n Name: biParam.ExagoParameterName,\r\n Value: JSON.stringify(selectedValues),\r\n PromptText: null\r\n });\r\n return filterSelectedString;\r\n }\r\n\r\n function setExagoDateRangeParams(biParam, exagoParams, filterSelectedString) {\r\n\r\n var dateRelative = [];\r\n var dateRangeStart = '';\r\n var dateRangeEnd = '';\r\n\r\n if (biParam.SelectedValue) {\r\n for (var i = 0; i < biParam.Options.length; i++) {\r\n var Option = biParam.Options[i];\r\n if (Option.Value === biParam.SelectedValue) {\r\n dateRelative.push({ DisplayValue: Option.Name, Value: Option.Value })\r\n\r\n filterSelectedString += \"Date Range: \" + Option.Name + \" \";\r\n }\r\n }\r\n }\r\n\r\n if (biParam.CustomStartDate) {\r\n if (biParam.InputTypeEnum == BIService.inputTypeEnum.MonthRange) {\r\n dateRangeStart = new Date(biParam.CustomStartDate.getFullYear(), biParam.CustomStartDate.getMonth(), 1);\r\n }\r\n else {\r\n dateRangeStart = biParam.CustomStartDate;\r\n\r\n }\r\n\r\n }\r\n\r\n if (biParam.CustomEndDate) {\r\n dateRangeEnd = biParam.CustomEndDate\r\n }\r\n\r\n exagoParams.push({\r\n Name: 'DateRelative',\r\n Value: JSON.stringify(dateRelative),\r\n PromptText: null\r\n });\r\n\r\n exagoParams.push({\r\n Name: 'DateRangeStart',\r\n Value: dateRangeStart,\r\n PromptText: null\r\n });\r\n\r\n exagoParams.push({\r\n Name: 'DateRangeEnd',\r\n Value: dateRangeEnd,\r\n PromptText: null\r\n });\r\n\r\n if (dateRangeStart != \"\") {\r\n filterSelectedString += \"(Start: \" + dateRangeStart.toLocaleDateString() + \", \";\r\n }\r\n if (dateRangeEnd != \"\") {\r\n filterSelectedString += \"End: \" + dateRangeEnd.toLocaleDateString() + \"), \";\r\n }\r\n return filterSelectedString;\r\n }\r\n\r\n function getReportInstanceParams() {\r\n // Still need to finishe this so that we can save the selected parameter values\r\n // to the reportinstance params table for exago reqports.\r\n params = [];\r\n\r\n angular.forEach(reportParams, function (param) {\r\n var reportInstanceParamModel = {\r\n ReportInstanceParamId: -1,\r\n ReportInstanceId: -1,\r\n ReportParamId: param.ReportParamId,\r\n Value: param.Value,\r\n DisplayValue: param.Value,\r\n ReportParamDataTypeId: param.ReportParamDataTypeId\r\n };\r\n\r\n params.push(reportInstanceParamModel);\r\n });\r\n\r\n return params;\r\n }\r\n\r\n function displayLoadingSpinner() {\r\n var retVal = false;\r\n\r\n if (\r\n biReportCtrl.showloadingspinner == true &&\r\n (\r\n biReportCtrl.executionStatusEnum == BIService.executionStatusEnum.Unknown ||\r\n biReportCtrl.executionStatusEnum == BIService.executionStatusEnum.Initializing ||\r\n biReportCtrl.executionStatusEnum == BIService.executionStatusEnum.Refreshing ||\r\n biReportCtrl.executionStatusEnum == BIService.executionStatusEnum.Executing ||\r\n biReportCtrl.executionStatusEnum == BIService.executionStatusEnum.Starting ||\r\n biReportCtrl.executionStatusEnum == BIService.executionStatusEnum.Visualizing\r\n )\r\n ) {\r\n retVal = true;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function SetExecutionStatus(executionStatusEnum) {\r\n biReportCtrl.executionStatusEnum = executionStatusEnum;\r\n\r\n if (biReportCtrl.statusChangeCallback) {\r\n biReportCtrl.statusChangeCallback(exagoContainer, executionStatusEnum);\r\n }\r\n }\r\n\r\n // loop till the widget \"data-hourglass\" spinners is gone\r\n function isRenderingComplete() {\r\n // ignore first exago which is the cached image\r\n var spinner = exagoContainer.querySelector('div[data-hourglass]');\r\n if (spinner == null) {\r\n\r\n // Remove loadingHtml\r\n while (biReportCtrl.loadinghtml && biReportCtrl.loadinghtml.length > 0 && exagoContainer && exagoContainer.children && exagoContainer.children.length > 1) {\r\n exagoContainer.removeChild(exagoContainer.firstChild);\r\n }\r\n\r\n SetExecutionStatus(BIService.executionStatusEnum.Complete); // loaded in main exago window\r\n biReportCtrl.reportLoading = false;\r\n }\r\n else $timeout(isRenderingComplete, 500); // keep trying\r\n }\r\n\r\n function refreshReport() {\r\n SetExecutionStatus(BIService.executionStatusEnum.Refreshing);\r\n if (biApi && biReportCtrl.reportLoading === false) {\r\n var exagoRefreshBtn = document.querySelector('.wrDashboardExecuteRefreshButton');\r\n var refreshed = false;\r\n\r\n if (exagoRefreshBtn) {\r\n try {\r\n exagoRefreshBtn.click();\r\n refreshed = true;\r\n isRenderingComplete(); // update cache to match (and show Timestamp)\r\n }\r\n catch (ex) {\r\n }\r\n }\r\n\r\n if (!refreshed) {\r\n executeReport();\r\n }\r\n }\r\n }\r\n\r\n function editReport() {\r\n if (biReportCtrl.reportLoading === false) {\r\n if (biApi) {\r\n biApi.DisposeContainerContent(exagoContainer);\r\n if (biReportCtrl.report && biReportCtrl.report.ExagoFullPath) {\r\n biApi.EditReport(exagoContainer, biReportCtrl.report.ExagoFullPath, null, onReportError);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function deleteReport() {\r\n if (biReportCtrl.reportLoading === false) {\r\n BIService.deleteReport(biReportCtrl.report.ReportId).then(function () {\r\n biReportCtrl.reportDesignerCallback(exagoContainer, BIService.reportDesignerStatusEnum.DeleteReport, true, biReportCtrl.report.FolderId);\r\n }\r\n );\r\n }\r\n }\r\n\r\n function createReport() {\r\n if (biReportCtrl.reportLoading === false) {\r\n if (biApi) {\r\n\r\n biApi.DisposeContainerContent(exagoContainer);\r\n\r\n var reportTypes = biApi.GetAllowedReportTypes();\r\n\r\n if (reportTypes) {\r\n if (reportTypes.length > 1) {\r\n\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/dashboard/selectreportype.modal.html',\r\n controller: 'SelectReportTypeController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n reportTypes: function () {\r\n return angular.copy(reportTypes);\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (reportType) {\r\n biApi.NewReport(exagoContainer, reportType);\r\n });\r\n } else if (reportTypes.length == 1) {\r\n biApi.NewReport(exagoContainer, reportTypes[0]);\r\n }\r\n\r\n }\r\n }\r\n }\r\n }\r\n\r\n function scheduleReport() {\r\n if (biReportCtrl.reportLoading === false) {\r\n if (biApi) {\r\n biApi.DisposeContainerContent(exagoContainer);\r\n if (biReportCtrl.report && biReportCtrl.report.ExagoFullPath) {\r\n biApi.ScheduleReportWizard(exagoContainer, biReportCtrl.report.ExagoFullPath, null, onReportError);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function viewSchedules() {\r\n if (biReportCtrl.reportLoading === false) {\r\n if (biApi) {\r\n biApi.DisposeContainerContent(exagoContainer);\r\n biApi.ScheduleReportManager(exagoContainer, onReportError);\r\n }\r\n }\r\n }\r\n\r\n function loadFullUI() {\r\n if (biReportCtrl.reportLoading === false) {\r\n biReportCtrl.ifLoadFullUI = false;\r\n if (biApi) {\r\n biReportCtrl.ifLoadFullUI = true;\r\n biApi.DisposeContainerContent(exagoContainer);\r\n biApi.LoadFullUI(exagoContainer);\r\n }\r\n }\r\n }\r\n\r\n function navigateToPatientListByIdList(clientInfo) {\r\n if (displayLoadingSpinner())\r\n return;\r\n var biClickData = null;\r\n\r\n if (clientInfo && clientInfo.uiElement) {\r\n biClickData = getClickDataFromReportCell(clientInfo)\r\n }\r\n\r\n if (biClickData && biClickData.patientIds.length > 0) {\r\n $state.go(\"patients.list\", { filterBy: 'biClick', value: biClickData }, { reload: true });\r\n }\r\n\r\n }\r\n\r\n function exportExcelOnlyReport(clientInfo) {\r\n if (biReportCtrl.reportController) {\r\n biReportCtrl.reportController.exportExcelOnlyReport(clientInfo.dashboardItem.title);\r\n }\r\n }\r\n\r\n function getClickDataFromReportCell(clientInfo) {\r\n var biClickData = null;\r\n var idListDataElement = clientInfo.uiElement.closest(\".vh-id-list\");\r\n if (idListDataElement) {\r\n var idListAngularDataElement = angular.element(idListDataElement);\r\n if (idListAngularDataElement) {\r\n var idListAttr = idListAngularDataElement.attr(\"data-id-list\");\r\n if (idListAttr) {\r\n var idList = JSON.parse(idListAttr);\r\n\r\n if (idList) {\r\n var options = clientInfo.dashboardItem ? clientInfo.dashboardItem.htmlViewer._options : clientInfo.contextObject._options;\r\n var clickText = GetClickLabel(clientInfo.uiElement);\r\n var clickFilters = getFilters(options)\r\n biClickData = {\r\n reportInstanceId: currentReportInstance.ReportInstanceId,\r\n reportName: options.ReportInfo.Name,\r\n executionId: clientInfo.internal.executionId,\r\n cellText: clickText,\r\n filters: clickFilters,\r\n patientIds: idList\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return biClickData;\r\n }\r\n\r\n function getFilters(options) {\r\n if (options.ExternalFilters && options.ExternalFilters.Filters)\r\n return JSON.stringify(options.ExternalFilters);\r\n return \"\";\r\n }\r\n\r\n $scope.OnCreateReportFinish = function (clientInfo) {\r\n if (biReportCtrl.reportDesignerCallback) {\r\n if (biReportCtrl.reportController) {\r\n var isSelfService = biReportCtrl.reportController.isSelfService;\r\n var folderId = biReportCtrl.reportController.folderId;\r\n if (isSelfService) {\r\n biReportCtrl.reportDesignerCallback(exagoContainer, BIService.reportDesignerStatusEnum.SaveReport, isSelfService, folderId);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // this function wraps the client-side code (see src\\modules\\reports\\report.rdl.directive.js)\r\n $scope.OnClick_Navigate_PatientList_ByChartLabel = function (clientInfo) {\r\n if (currentReportInstance && currentReportInstance.ReportInstanceId) {\r\n //var clientInfoJson = JSON.stringify(clientInfo.dashboardItem, getCircularReplacer());\r\n\r\n var cellId = null;\r\n if (clientInfo.uiElement) {\r\n $scope.OnClick_Navigate_PatientList_ByGridLabel(clientInfo);\r\n return;\r\n }\r\n\r\n if (clientInfo.chartData && clientInfo.chartData.selectedPointId) {\r\n cellId = getCellIdFromWidget(clientInfo.reportWidgets)\r\n }\r\n\r\n // series\r\n var chartSeriesValue;\r\n if (clientInfo.chartSeriesDataPoint)\r\n chartSeriesValue = clientInfo.chartSeriesDataPoint.seriesname\r\n\r\n // point label\r\n var chartLabelValue;\r\n if (clientInfo.chartItemDataPoint)\r\n chartLabelValue = clientInfo.chartItemDataPoint.label\r\n\r\n // exago callback is wrong...\r\n if (!chartSeriesValue || !chartLabelValue) {\r\n var selectedPointId = clientInfo.chartData.selectedPointId;\r\n for (var widget in clientInfo.contextObject._widgetParcels) {\r\n // data\r\n var dataArray = clientInfo.contextObject._widgetParcels[widget].data.data;\r\n for (index1 = 0; index1 < dataArray.length; index1++) {\r\n // points\r\n var pointsArray = dataArray[index1].points;\r\n for (index2 = 0; index2 < pointsArray.length; index2++) {\r\n // chart selection\r\n if (pointsArray[index2].id === selectedPointId) {\r\n chartSeriesValue = dataArray[index1].name;\r\n chartLabelValue = pointsArray[index2].label;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!clientInfo.dashboard || !chartLabelValue)\r\n return;\r\n\r\n var options = clientInfo.dashboardItem ? clientInfo.dashboardItem.htmlViewer._options : clientInfo.contextObject._options;\r\n var biClickData = {\r\n cellId: cellId,\r\n reportInstanceId: currentReportInstance.ReportInstanceId,\r\n reportName: options.ReportInfo.Name,\r\n executionId: clientInfo.internal.executionId,\r\n chartLabelValue: chartLabelValue,\r\n chartSeriesValue: chartSeriesValue,\r\n //cellText: clientInfo.uiElement.innerText,\r\n filters: getFilters(options)\r\n };\r\n\r\n // close exago toolTip\r\n // window.document.getElementById(\"fusioncharts-tooltip-element\").style.display = \"none\";\r\n\r\n // Navigate\r\n var args = [\"OnClickToPatientList\", JSON.stringify(biClickData)]\r\n NavigateToPatientList(clientInfo, biClickData, args);\r\n }\r\n }\r\n\r\n function getCellIdFromUIElement(uiElement) {\r\n var cellId = null;\r\n var tableDataElement = uiElement.closest(\"td\");\r\n if (tableDataElement) {\r\n cellId = tableDataElement.getAttribute(\"data-id\");\r\n }\r\n return cellId;\r\n }\r\n\r\n function getCellIdFromWidget(reportWidgets) {\r\n var cellId = null;\r\n\r\n if (reportWidgets) {\r\n for (var widgetId in reportWidgets) {\r\n if (widgetId) {\r\n var widget = reportWidgets[widgetId];\r\n if (widget.chartData && widget.chartData.selectedPointId && widget.chartContainer) {\r\n cellId = getCellIdFromUIElement(widget.chartContainer);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return cellId;\r\n }\r\n\r\n function NavigateToPatientList(clientInfo, biClickData, args) {\r\n // Use server-side action event (clientInfo.ServerCallback doesn't work)\r\n var eventName = args[0]\r\n , actionArgs = JSON.stringify({\r\n EventName: eventName,\r\n ExecutionId: clientInfo.internal.executionId,\r\n ReportData: clientInfo.includeReportData ? clientInfo.internal.reportData : null,\r\n ReportName: clientInfo.internal.reportName,\r\n ReportType: clientInfo.internal.reportType,\r\n ReportSaveDataJson: clientInfo.includeReportSaveData && null != clientInfo.internal.reportSaveData ? JSON.stringify(clientInfo.internal.reportSaveData) : null,\r\n UdfData: clientInfo.internal.udfData,\r\n ExportType: clientInfo.internal.exportType\r\n })\r\n , userArgs = Utilities.GetActionArguments(args, 1)\r\n , thisObj = biClickData;\r\n Utilities.AjaxRequest(\"Callbacks.Core.ExecuteAction\", actionArgs, userArgs,\r\n function (response) {\r\n thisObj.patientIds = response.value.UserResponse;\r\n if (thisObj.patientIds.length > 0) {\r\n $state.go(\"patients.list\", { filterBy: 'biClick', value: thisObj }, { reload: true });\r\n }\r\n },\r\n function (response) {\r\n }\r\n );\r\n }\r\n\r\n function recursiveGetLabel(element, labelClass) {\r\n if (element == null || element.className == null)\r\n return null;\r\n var classNames = element.className.split(\" \");\r\n if (classNames.indexOf(labelClass) != -1)\r\n return element.innerHTML;\r\n\r\n var label;\r\n for (var i = 0; i < element.childNodes.length; ++i) {\r\n label = recursiveGetLabel(element.childNodes[i], labelClass);\r\n if (label != null)\r\n break;\r\n }\r\n return label;\r\n }\r\n\r\n function GetClickLabel(element) {\r\n var labelClass = null;\r\n while (element != null) {\r\n var classNames = element.className.split(\" \");\r\n if (classNames.indexOf(\"vh-dashboard-tile-info\") != -1)\r\n labelClass = \"vh-dashboard-tile-info-label\"\r\n else if (classNames.indexOf(\"vh-dashboard-tile-card\") != -1)\r\n labelClass = \"vh-dashboard-tile-card-label\"\r\n else if (classNames.indexOf(\"vh-dashboard-tile-pair\") != -1)\r\n labelClass = \"vh-dashboard-tile-pair-label\"\r\n\r\n if (labelClass != null)\r\n break; // found root element\r\n element = element.parentElement;\r\n }\r\n\r\n if (element == null) // click event is on something other than a vh card/info\r\n return \"\";\r\n\r\n var label;\r\n for (var i = 0; i < element.childNodes.length; ++i) {\r\n label = recursiveGetLabel(element.childNodes[i], labelClass);\r\n if (label != null)\r\n break;\r\n }\r\n\r\n return label;\r\n }\r\n\r\n $scope.$on('OnDisposeContainer', function (event, next, current) {\r\n $scope.biReportCtrl.reportLoading = false;\r\n if (!$scope.$$phase) {\r\n setTimeout(() => { $scope.$apply(); }, 100);\r\n }\r\n });\r\n\r\n $scope.OnClick_Navigate_PatientList_ByGridLabel = function (clientInfo) {\r\n if (displayLoadingSpinner())\r\n return;\r\n\r\n var cellId = getCellIdFromUIElement(clientInfo.uiElement);\r\n\r\n var options = clientInfo.dashboardItem ? clientInfo.dashboardItem.htmlViewer._options : clientInfo.contextObject._options;\r\n\r\n // find a keyword for what was clicked on - used to search report definition (Ok even if Profile Field)\r\n var clickText = GetClickLabel(clientInfo.uiElement);\r\n if (clickText == null || clickText.length == 0)\r\n return;\r\n\r\n var biClickData = {\r\n cellId: cellId,\r\n reportInstanceId: currentReportInstance.ReportInstanceId,\r\n reportName: options.ReportInfo.Name,\r\n executionId: clientInfo.internal.executionId,\r\n //chartLabelValue: \"\",\r\n //chartSeriesValue: \"\"\r\n cellText: clickText,\r\n filters: getFilters(options)\r\n };\r\n\r\n // Navigate\r\n var args = [\"OnClickToPatientList\", JSON.stringify(biClickData)]\r\n NavigateToPatientList(clientInfo, biClickData, args);\r\n }\r\n\r\n // this alllows JSON.stringify for circular structures (clientInfo)\r\n const getCircularReplacer = () => {\r\n const seen = new WeakMap();\r\n return (key, value) => {\r\n if (typeof value === \"object\" && value !== null) {\r\n if (seen.has(value)) {\r\n var valueKey = seen.get(value);\r\n return '[Duplicate] ' + seen.get(value); // return field name from already existing data\r\n }\r\n seen.set(value, key);\r\n }\r\n return value;\r\n };\r\n };\r\n}\r\n\r\nangular.module('bi').directive('biReport', [biReportDirective]);\r\n\r\nangular.module('bi').controller('biReportController', ['$scope', '$state', '$transitions', '$timeout', '$uibModal', 'BIService', 'ReportsService', 'vhSweetAlert', 'AuthorizationService', biReportController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/bi-report.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function BIReportEdit($state, $transitions, $window, $uibModal, $scope, BIService, $rootScope, $timeout, vhSweetAlert, BIIFrameService) {\r\n var rvm = this;\r\n rvm.BIService = BIService;\r\n rvm.ReportDesignerChanged = ReportDesignerChanged;\r\n rvm.folderId = $state.params.folderId;\r\n rvm.isSelfService = $state.params.isSelfService;\r\n rvm.cancel = cancel;\r\n rvm.save = save;\r\n rvm.selectedReport = $state.params.report;\r\n rvm.isEdit = $state.params.isEdit;\r\n rvm.showSave = false;\r\n rvm.showCancel = true;\r\n rvm.originalReportName = $state.params.report.DisplayName;\r\n rvm.BIIFrameService = BIIFrameService;\r\n rvm.isStateChanging = false;\r\n rvm.alert = undefined;\r\n rvm.showErrorMessage = false;\r\n\r\n init();\r\n\r\n function init() {\r\n if (rvm.isEdit) {\r\n rvm.showSave = true;\r\n }\r\n rvm.BIIFrameService.setReportController(rvm);\r\n }\r\n\r\n function cancel() {\r\n $timeout(function () {\r\n $state.transitionTo(\"reports.folder\", $state.params, { reload: true });\r\n }, 200);\r\n }\r\n\r\n function save() {\r\n $timeout(function () {\r\n document.getElementById(\"exagoIframe\").contentDocument.querySelector(\"div[data-key='save']\").click();\r\n $scope.clicked = true;\r\n }, 0);\r\n\r\n\r\n }\r\n\r\n function ReportDesignerChanged(container, reportDesignerStatusEnum, isSelfService, folderId) {\r\n switch (reportDesignerStatusEnum) {\r\n case BIService.reportDesignerStatusEnum.SaveReport:\r\n {\r\n if (rvm.isEdit && rvm.originalReportName != rvm.selectedReport.DisplayName) {\r\n var response = BIService.renameReport(getExagoFullReportPath(rvm.originalReportName), getExagoFullReportPath(rvm.selectedReport.DisplayName)).then(function (returnObj) {\r\n rvm.alert = undefined;\r\n if (returnObj.Success == false) {\r\n var alertError = { text: returnObj.ErrorMessage, type: 'danger' };\r\n rvm.alert = alertError\r\n rvm.showErrorMessage = true;\r\n return;\r\n }\r\n\r\n rvm.selectedReport.ExagoFullPath = getExagoFullReportPath(rvm.selectedReport.DisplayName);\r\n rvm.selectedReport.ExagoFileName = rvm.selectedReport.DisplayName;\r\n $rootScope.$broadcast(\"updateSelfServiceReportsChange\");\r\n //$scope.$apply();\r\n\r\n $timeout(function () {\r\n $state.transitionTo(\"reports.folder\", $state.params, { reload: true });\r\n }, 200);\r\n\r\n });\r\n\r\n\r\n\r\n }\r\n else {\r\n if (rvm.showSave) {\r\n $timeout(function () {\r\n $state.transitionTo(\"reports.folder\", $state.params, { reload: true });\r\n }, 200);\r\n }\r\n else {\r\n rvm.showSave = true;\r\n rvm.showCancel = false;\r\n $rootScope.$broadcast(\"updateSelfServiceReportsChange\");\r\n $scope.$apply();\r\n }\r\n }\r\n\r\n break;\r\n }\r\n }\r\n return;\r\n }\r\n\r\n function getExagoFullReportPath(reportName) {\r\n var currentReportFullPath = rvm.selectedReport.ExagoFullPath;\r\n var extractedReportPath = currentReportFullPath.substring(0, currentReportFullPath.indexOf(rvm.selectedReport.ExagoFileName));\r\n return extractedReportPath + reportName;\r\n }\r\n\r\n // $transitions.onStart({}, (trans) => { \r\n // var toState = trans.to();\r\n // var toParams = toState.params;\r\n \r\n // if (rvm.isStateChanging == false && $scope.clicked != true){\r\n \r\n // vhSweetAlert.verify('Are you sure?', 'If you leave this page you will lose all unsaved changes. Are you sure you want to leave?', 'Leave')\r\n // .then(function (isConfirm) {\r\n // if (isConfirm) {\r\n // rvm.isStateChanging = true;\r\n // $state.go(toState.name, toParams, { reload: true });\r\n // rvm.isStateChanging = false;\r\n // }\r\n // });\r\n // $scope.clicked = false;\r\n // return false;\r\n // }\r\n // });\r\n}\r\nangular.module(\"bi\").controller(\"BIReportEditController\", BIReportEdit);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/bi-reportedit.tpl.html',\n '
    {{rvm.isEdit ? \\'Edit Report\\' : \\'Add Report\\'}}
    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/bi-reporteditiframe.tpl.html',\n '

    {{rvm.isEdit ? \\'Edit Report\\' : \\'Add Report\\'}}

    {{rvm.alert.text}}
    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/bi-ssreports.tpl.html',\n '

    Self-Service Report Management

    Published Reports {{publishedReports.length}} {{publishedReports.length}}
    No published reports.
    No results returned.

    Unpublished Reports {{unpublishedReports.length}} {{unpublishedReports.length}}

    No unpublished reports.

    {{rvm.selectedReport.DisplayName}}
    ');\n}]);\n}(window, document, window.angular));","function BIService($http, $q, $timeout, $location, moment, PendingService, PermissionService, $rootScope, $window, FileUploader) {\r\n var file = null;\r\n var exagoApi = null;\r\n var exagoSession = null;\r\n var fileUploader = fileUploader;\r\n var folderTypeEnum = { Root: 0, Default: 1, Custom: 2, SelfService: 3 };\r\n var folderSubTypeEnum = { Reports: 1, Dashboards: 2, DashboardWidgets: 3, Templates: 4 };\r\n var reportTypeEnum = { Default: 1, Custom: 2, Legacy: 3 };\r\n var reportSubTypeEnum = { SsrsExcel: 1, PatientTimeLog: 2, UsageMonitor: 3, Unknown: 4, PatientSummary: 5, BIAdvanced: 6, BIExpress: 7, BIDashboard: 8, BIChained: 9, BIVisulization: 10, BIExpressView: 11 };\r\n var executionStatusEnum = { Unknown: 0, Initializing: 1, Refreshing: 2, Executing: 3, Starting: 4, Visualizing: 5, Complete: 6, Error: 7, TooManyRecords: 8 }\r\n var reportDesignerStatusEnum = { SaveReport: 0, DeleteReport: 1 };\r\n var cachedReports = {};\r\n var bigSpinner = '
    ';\r\n var inputTypeEnum = { DateRange: 1, Date: 2, SingleSelectList: 3, MultiSelectList: 4, SingleSelectTypeAhead: 5, MultiSelectTypeAhead: 6, Month: 7, PatientTypeList :8, Text: 9, NoteText: 10, CheckBox: 11, MonthRange:12, MultiSelectCheck:13};\r\n\r\n return {\r\n getExagoApi: getExagoApi,\r\n deleteExagoApi: deleteExagoApi,\r\n getExagoParams: getExagoParams,\r\n getRootFolder: getRootFolder,\r\n folderTypeEnum: folderTypeEnum,\r\n folderSubTypeEnum: folderSubTypeEnum,\r\n reportTypeEnum: reportTypeEnum,\r\n reportSubTypeEnum: reportSubTypeEnum,\r\n getReport: getReport,\r\n executionStatusEnum: executionStatusEnum,\r\n bigSpinner: bigSpinner,\r\n setCachedReportContent: setCachedReportContent,\r\n getCachedReportContent: getCachedReportContent,\r\n inputTypeEnum: inputTypeEnum,\r\n computeDateRange: computeDateRange,\r\n getSelfServiceReports: getSelfServiceReports,\r\n savePublishState: savePublishState,\r\n getSelfServiceFolder: getSelfServiceFolder,\r\n reportDesignerStatusEnum: reportDesignerStatusEnum,\r\n deleteReport: deleteReport,\r\n renameReport: renameReport,\r\n getTypeaheadData: getTypeaheadData,\r\n createReportRequest: createReportRequest,\r\n getReportStatus: getReportStatus, \r\n getReportDefinition: getReportDefinition,\r\n getFileUploader: getFileUploader,\r\n importReport: importReport,\r\n copyReport: copyReport,\r\n getExtendedReportStatus: getExtendedReportStatus,\r\n getReportByDisplayName: getReportByDisplayName\r\n };\r\n\r\n function createSession() {\r\n var sessionRequest = {\r\n HttpProtocol: $location.protocol(),\r\n HttpHost: $location.host(),\r\n HttpPort: $location.port(),\r\n ReportParams: []\r\n };\r\n\r\n return $http.post(\r\n '/api/BISession',\r\n sessionRequest\r\n ).then(function (response) {\r\n exagoSession = response.data;\r\n return exagoSession;\r\n }, function (errorMessage) {\r\n exagoSession = null;\r\n console.error(errorMessage);\r\n return;\r\n });\r\n }\r\n\r\n function getExagoParams(reportParams) {\r\n exagoParams = [];\r\n\r\n angular.forEach(reportParams, function (reportParam) {\r\n\r\n var exagoParam = {\r\n Name: reportParam.ReportParam.Name,\r\n Value: reportParam.Value,\r\n PromptText: null\r\n };\r\n\r\n exagoParams.push(exagoParam);\r\n });\r\n\r\n return exagoParams;\r\n }\r\n\r\n function getTypeaheadData(dataSource, searchString) {\r\n searchString = searchString || '';\r\n if ((dataSource != \"\" ||dataSource.length > 0) && searchString.length > 0) {\r\n return $http.post\r\n (\r\n '/api/AutoComplete/DataSource/',\r\n {\r\n DataSource: dataSource,\r\n SearchText: searchString\r\n }\r\n ).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n }\r\n\r\n function deleteSession() {\r\n cachedReports = {}; // clear cache\r\n if (exagoSession) {\r\n return $http({\r\n method: 'DELETE',\r\n url: '/api/BISession/' + exagoSession.Id\r\n }).then(function (response) {\r\n exagoSession = null;\r\n return;\r\n }, function (errorMessage) {\r\n exagoSession = null;\r\n console.log(errorMessage);\r\n return;\r\n });\r\n }\r\n }\r\n\r\n function getExagoApi() {\r\n return $q(function (resolve, reject) {\r\n if (exagoApi) {\r\n $rootScope.$broadcast('OnExagoSessionLoaded');\r\n resolve(exagoApi);\r\n } else {\r\n $timeout(function () {\r\n createSession().then(\r\n function (session) {\r\n exagoApi = new ExagoApi(\r\n session.ExagoBaseURL,\r\n session.ApiKey,\r\n function () {\r\n $rootScope.$broadcast('OnExagoSessionLoaded');\r\n resolve(exagoApi);\r\n },\r\n true\r\n );\r\n\r\n exagoApi.OnDisposeContainer = function (container) {\r\n $rootScope.$broadcast('OnDisposeContainer');\r\n };\r\n\r\n\r\n },\r\n function (reason) {\r\n reject(reason);\r\n }\r\n );\r\n });\r\n }\r\n });\r\n }\r\n\r\n function deleteExagoApi() {\r\n deleteSession();\r\n if (exagoApi) {\r\n exagoApi.DisposePage();\r\n exagoApi = null;\r\n }\r\n }\r\n\r\n function getRootFolder(listType) {\r\n\r\n /*\r\n /api/bi/folder?root=true&subType={folderSubType}\r\n */\r\n var folderSubType = folderSubTypeEnum[listType];\r\n\r\n if ((folderSubType == folderSubTypeEnum.Dashboards && PermissionService.userHasPermission([\"DashboardRead\"])) || (folderSubType == folderSubTypeEnum.Reports && PermissionService.userHasPermission([\"ReportsRead\"]))) {\r\n return PendingService.promise('/bi/folder/' + folderSubType, () => $http.get('/api/bi/folder?biFolderSubTypeEnum=' + folderSubType))\r\n .then(response => response.data, reason => {\r\n console.error(reason);\r\n return reason;\r\n });\r\n } else {\r\n return $q(function (resolve, reject) {\r\n resolve(null);\r\n });\r\n }\r\n }\r\n\r\n\r\n function getSelfServiceFolder() {\r\n\r\n\r\n var selfServiceFolderType = folderTypeEnum['SelfService'];\r\n\r\n if (PermissionService.userHasPermission([\"ReportsRead\"])) {\r\n return PendingService.promise('get self service folder', () => $http.get('/api/bi/folders?biFolderTypeEnum=' + selfServiceFolderType))\r\n .then(response => response.data, reason => {\r\n console.error(reason);\r\n return reason;\r\n });\r\n } else {\r\n return $q(function (resolve, reject) {\r\n resolve(null);\r\n });\r\n }\r\n }\r\n\r\n\r\n function getReportDefinition(biReportId) {\r\n $http({\r\n url: '/api/bi/getreportdefinition?biReportId=' + biReportId,\r\n method: \"GET\",\r\n responseType: 'arraybuffer'\r\n }).then(function ({data, status, headers, config}) {\r\n\r\n if (file !== null) {\r\n $window.URL.revokeObjectURL(file);\r\n }\r\n\r\n file = new Blob([data]);\r\n\r\n var fileName = headers('Content-Disposition').split('=')[1];\r\n\r\n if ($window.navigator.msSaveBlob) {\r\n $window.navigator.msSaveBlob(file, fileName);\r\n }\r\n else {\r\n var a = document.createElement('a');\r\n a.href = $window.URL.createObjectURL(file);\r\n a.target = '_blank';\r\n a.download = fileName;\r\n a.click();\r\n }\r\n });\r\n }\r\n\r\n function getFileUploader() {\r\n var fileUploader = new FileUploader({\r\n url: '/api/ImportTemplate'\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function (item, options) {\r\n var i = item.name.indexOf('.wr');\r\n return i !== -1;\r\n }\r\n });\r\n return fileUploader;\r\n }\r\n\r\n function getReport(biReportId) {\r\n\r\n /*\r\n /api/bi/report?biReportId={biReportId}\r\n */\r\n\r\n return $http({\r\n method: 'GET',\r\n url: '/api/bi/report?biReportId=' + biReportId\r\n }).then(function (response) {\r\n var report = response.data;\r\n return report;\r\n }, function (reason) {\r\n console.error(reason);\r\n return reason;\r\n });\r\n }\r\n\r\n\r\n\r\n function setCachedReportContent(report, content) {\r\n cachedReports[report] = { content: content, timeStamp: Date.now() };\r\n }\r\n\r\n function getCachedReportContent(report) {\r\n // remove old cache\r\n var expirationTimeStamp = Date.now() - 900000; // 15 min ago (900,000 ms)\r\n var tmp;\r\n for (var key in cachedReports) {\r\n tmp = cachedReports[key];\r\n if (tmp != null && tmp.timeStamp < expirationTimeStamp) {\r\n cachedReports[key] = null;\r\n }\r\n }\r\n\r\n return cachedReports[report];\r\n }\r\n\r\n function computeDateRange(relativeDate) {\r\n var dateRange = { Start: null, End: null };\r\n\r\n switch (relativeDate) {\r\n case \"Today\": {\r\n dateRange.Start = moment().startOf('day').toDate();\r\n dateRange.End = moment().endOf('day').toDate();\r\n break;\r\n }\r\n case \"Yesterday\": {\r\n dateRange.Start = moment().subtract('1', 'day').startOf('day').toDate();\r\n dateRange.End = moment().subtract('1', 'day').endOf('day').toDate();\r\n break;\r\n }\r\n case \"ThisCalendarWeek\": {\r\n dateRange.Start = moment().startOf('week').toDate();\r\n dateRange.End = moment().endOf('day').toDate();\r\n break;\r\n }\r\n case \"LastCalendarWeek\": {\r\n dateRange.Start = moment().subtract('1', 'weeks').startOf('week').toDate();\r\n dateRange.End = moment().subtract('1', 'weeks').endOf('week').toDate();\r\n break;\r\n }\r\n case \"LastTwoCalendarWeeks\": {\r\n dateRange.Start = moment().subtract('2', 'weeks').startOf('week').toDate();\r\n dateRange.End = moment().subtract('1', 'weeks').endOf('week').toDate();\r\n break;\r\n }\r\n case \"ThisCalendarMonth\": {\r\n dateRange.Start = moment().startOf('month').toDate();;\r\n dateRange.End = moment().endOf('day').toDate();\r\n break;\r\n }\r\n case \"LastCalendarMonth\": {\r\n dateRange.Start = moment().subtract('1', 'months').startOf('month').toDate();;\r\n dateRange.End = moment().subtract('1', 'months').endOf('month').toDate();\r\n break;\r\n }\r\n case \"ThisCalendarYear\": {\r\n dateRange.Start = moment().startOf('year').toDate();\r\n dateRange.End = moment().endOf('day').toDate();\r\n break;\r\n }\r\n case \"LastCalendarYear\": {\r\n dateRange.Start = moment().subtract('1', 'years').startOf('year').toDate();\r\n dateRange.End = moment().subtract('1', 'years').endOf('year').toDate();\r\n break;\r\n }\r\n }\r\n\r\n return dateRange;\r\n }\r\n\r\n function getSelfServiceReports(folderId) {\r\n if (PermissionService.userHasPermission([\"ReportDesigner\"])) {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/bi/getSelfServiceReports?folderId=' + folderId\r\n }).then(function (response) {\r\n var reports = response.data;\r\n return reports;\r\n });\r\n } else {\r\n return $q(function (resolve, reject) {\r\n resolve(null);\r\n });\r\n }\r\n }\r\n\r\n function savePublishState(report) {\r\n if (PermissionService.userHasPermission([\"ReportDesigner\"])) {\r\n var p = $q.defer()\r\n $http({\r\n url: '/api/bi/savePublishState',\r\n method: 'POST',\r\n data: report\r\n }).then(function (response) {\r\n return p.resolve(response.data);\r\n });\r\n } else {\r\n return $q(function (resolve, reject) {\r\n resolve(null);\r\n });\r\n }\r\n return p.promise;\r\n }\r\n\r\n function renameReport(oldName, newName) {\r\n if (PermissionService.userHasPermission([\"ReportDesigner\"])) {\r\n var p = $q.defer()\r\n var parameters = { oldName: oldName, newName: newName, udf: \"\" };\r\n $http({\r\n url: '/api/bi/report',\r\n method: 'PUT',\r\n data: parameters\r\n }).then(function (response) {\r\n return p.resolve(response.data);\r\n });\r\n } else {\r\n return $q(function (resolve, reject) {\r\n resolve(null);\r\n });\r\n }\r\n return p.promise;\r\n }\r\n\r\n function deleteReport(reportId) {\r\n var p = $q.defer()\r\n $http({\r\n url: '/api/bi/report/' + reportId,\r\n method: 'DELETE'\r\n }).then(function (response) {\r\n return p.resolve(response);\r\n });\r\n return p.promise;\r\n }\r\n\r\n function getReportStatus(reportGuid) {\r\n return $http.get(\"/api/report/status?reportId=\" + reportGuid).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getExtendedReportStatus(reportGuid) {\r\n return $http.get(\"/api/report/extendedstatus?reportId=\" + reportGuid).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getReportByDisplayName(displayName) {\r\n var genericRequest =\r\n {\r\n ReportName: displayName\r\n };\r\n return $http.post('/api/bi/getreportbydisplayname', genericRequest).then(function (response) {\r\n return response;\r\n });\r\n }\r\n\r\n function createReportRequest (reportExecRequest) {\r\n return $http.post(\"/api/report\", reportExecRequest).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function importReport(reportImportRequest) {\r\n return $http.post('/api/bi/importreport', reportImportRequest).then(function (response) {\r\n return response;\r\n });\r\n }\r\n\r\n function copyReport(reportCopyRequest) {\r\n return $http.post('/api/bi/copyreport', reportCopyRequest).then(function (response) {\r\n return response;\r\n });\r\n }\r\n}\r\n\r\nangular.module('bi').factory('BIService', BIService);\r\n\r\n","function CopyReportModalController(BIService, PermissionService, $uibModalInstance, $scope, $rootScope, $timeout, $state, modalName, originalReportId)\r\n{\r\n var rvm = this;\r\n\r\n rvm.isIENine = false;\r\n rvm.valid = false;\r\n rvm.progress = 0;\r\n rvm.progressStep = 0;\r\n rvm.validating = false;\r\n rvm.loading = false;\r\n rvm.uploading = false;\r\n rvm.validationData = null;\r\n rvm.caption = \"\";\r\n rvm.$uibModalInstance = $uibModalInstance;\r\n rvm.PermissionService = PermissionService;\r\n rvm.BIService = BIService;\r\n rvm.$scope = $scope;\r\n rvm.$rootScope = $rootScope;\r\n rvm.$timeout = $timeout;\r\n rvm.$state = $state;\r\n rvm.modalName = modalName;\r\n rvm.reportDefinition = \"\";\r\n rvm.alerts = [];;\r\n rvm.originalReportId = originalReportId;\r\n\r\n return {\r\n enableCancelButton: enableCancelButton,\r\n enableOkButton: enableOkButton,\r\n getValidationData: getValidationData,\r\n validate: validate,\r\n ok: ok,\r\n cancel: cancel,\r\n modalName: rvm.modalName,\r\n originalReportId: rvm.originalReportId,\r\n uploading: rvm.uploading,\r\n alerts: rvm.alerts\r\n };\r\n\r\n \r\n\r\n function _reset() {\r\n rvm.valid = false;\r\n rvm.progress = 0;\r\n rvm.progressStep = 0;\r\n rvm.validating = false;\r\n rvm.loading = false;\r\n rvm.uploading = false;\r\n rvm.validationData = null;\r\n rvm.alerts = [];\r\n }\r\n\r\n\r\n function _forceUpdate() {\r\n window.setTimeout(() => {\r\n rvm.$scope.$parent.$apply();\r\n }, 100);\r\n }\r\n\r\n function getValidationData() {\r\n rvm.loading = true;\r\n return rvm.validationData;\r\n }\r\n\r\n\r\n function enableCancelButton() {\r\n return !rvm.uploading;\r\n }\r\n\r\n function enableOkButton() {\r\n return !rvm.uploading && (copyReport.reportName.value != undefined && copyReport.reportName.value != \"\");\r\n }\r\n\r\n function validate() {\r\n rvm.valid = false;\r\n rvm.validating = true;\r\n }\r\n\r\n function ok() {\r\n // upload with feedback\r\n rvm.uploading = true;\r\n\r\n var reportCopyRequest =\r\n {\r\n ReportName: copyReport.reportName.value,\r\n OriginalReportId: rvm.originalReportId\r\n };\r\n rvm.BIService.copyReport(reportCopyRequest).then(function (response) {\r\n if (response.data.Success) {\r\n _reset();\r\n rvm.$uibModalInstance.close();\r\n rvm.$rootScope.$broadcast(\"updateSelfServiceReportsChange\");\r\n }\r\n else { \r\n var alertError = { text: response.data.ErrorMessage, type: 'danger' };\r\n if (rvm.alerts.length == 0 || (rvm.alerts.length > 0 && rvm.alerts[0].text.indexOf(response.data.ErrorMessage) === -1)) {\r\n rvm.alerts.push(alertError);\r\n } \r\n rvm.uploading = false;\r\n _forceUpdate();\r\n return;\r\n }\r\n\r\n });\r\n\r\n\r\n }\r\n\r\n function cancel() {\r\n _reset();\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n}\r\n\r\nfunction CopyReportModalControllerFactory(BIService, PermissionService, $uibModalInstance, $scope, $rootScope, $timeout, $state, modalName, originalReportId) {\r\n return new CopyReportModalController(BIService, PermissionService, $uibModalInstance, $scope, $rootScope, $timeout, $state, modalName, originalReportId);\r\n}\r\n\r\nangular\r\n .module(\"bi\")\r\n .controller(\"CopyReportModalController\", CopyReportModalControllerFactory);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/copyreport.modal.html',\n '

    {{vm.modalName}}

    {{alert.text}}
    {{vm.progress}}%
    ');\n}]);\n}(window, document, window.angular));","function ImportReportModalController(BIService, PermissionService, $uibModalInstance, $scope, $rootScope, $timeout, $state, modalName)\r\n{\r\n var rvm = this;\r\n\r\n rvm.isIENine = false;\r\n rvm.valid = false;\r\n rvm.progress = 0;\r\n rvm.progressStep = 0;\r\n rvm.validating = false;\r\n rvm.loading = false;\r\n rvm.uploading = false;\r\n rvm.validationData = null;\r\n rvm.fileSelected = false;\r\n rvm.fileNameValidationError = { text: \"File name has illegal characters.\", type: 'danger' };\r\n rvm.caption = \"\";\r\n rvm.$uibModalInstance = $uibModalInstance;\r\n rvm.PermissionService = PermissionService;\r\n rvm.BIService = BIService;\r\n rvm.$scope = $scope;\r\n rvm.$rootScope = $rootScope;\r\n rvm.$timeout = $timeout;\r\n rvm.$state = $state;\r\n rvm.modalName = modalName;\r\n rvm.reportDefinition = \"\";\r\n rvm.alerts = [];\r\n\r\n rvm.$uibModalInstance.opened.then(_ => {\r\n var changeHandler = (evt) => {\r\n var files = evt.target.files; // FileList object\r\n for (var i = 0, f; (f = files[i]); i++) {\r\n var reader = new FileReader();\r\n\r\n // Closure to capture the file information.\r\n reader.onload = ((theFile) => {\r\n return (e) => {\r\n rvm.caption = `Importing ${theFile.name}.`;\r\n rvm.reportDefinition = e.target.result;\r\n rvm.fileSelected = true;\r\n _forceUpdate();\r\n }\r\n })(f);\r\n\r\n // Read in the image file as a data URL.\r\n reader.readAsText(f);\r\n }\r\n };\r\n\r\n window.setTimeout(_ => {\r\n var element = document.getElementById('report-file-input');\r\n element.removeEventListener('change', changeHandler);\r\n element.addEventListener('change', changeHandler, false);\r\n }\r\n , 500);\r\n });\r\n\r\n return {\r\n fileUploader: rvm.BIService.getFileUploader(),\r\n enableCancelButton: enableCancelButton,\r\n enableOkButton: enableOkButton,\r\n getValidationData: getValidationData,\r\n validate: validate,\r\n ok: ok,\r\n cancel: cancel,\r\n modalName: rvm.modalName,\r\n uploading: rvm.uploading,\r\n alerts: rvm.alerts\r\n };\r\n\r\n \r\n\r\n function _reset() {\r\n rvm.valid = false;\r\n rvm.progress = 0;\r\n rvm.progressStep = 0;\r\n rvm.validating = false;\r\n rvm.loading = false;\r\n rvm.uploading = false;\r\n rvm.validationData = null;\r\n rvm.alerts = [];\r\n }\r\n\r\n\r\n function _forceUpdate() {\r\n window.setTimeout(() => {\r\n rvm.$scope.$parent.$apply();\r\n }, 100);\r\n }\r\n\r\n function getValidationData() {\r\n rvm.loading = true;\r\n return rvm.validationData;\r\n }\r\n\r\n\r\n function enableCancelButton() {\r\n return !rvm.uploading;\r\n }\r\n\r\n function enableOkButton() {\r\n return !rvm.uploading && rvm.fileSelected && (importReport.reportName.value != undefined && importReport.reportName.value != \"\");\r\n }\r\n\r\n function validate() {\r\n rvm.valid = false;\r\n rvm.validating = true;\r\n }\r\n\r\n function ok() {\r\n // upload with feedback\r\n rvm.uploading = true;\r\n\r\n var reportImportRequest =\r\n {\r\n ReportName: importReport.reportName.value,\r\n ReportDefinition: rvm.reportDefinition\r\n };\r\n rvm.BIService.importReport(reportImportRequest).then(function (response) {\r\n if (response.data.Success) {\r\n _reset();\r\n rvm.$uibModalInstance.close();\r\n rvm.$rootScope.$broadcast(\"updateSelfServiceReportsChange\");\r\n }\r\n else {\r\n var alertError = { text: response.data.ErrorMessage, type: 'danger' };\r\n if (rvm.alerts.length == 0 || (rvm.alerts.length > 0 && rvm.alerts[0].text.indexOf(response.data.ErrorMessage) === -1)) {\r\n rvm.alerts.push(alertError);\r\n } \r\n rvm.uploading = false;\r\n _forceUpdate();\r\n return;\r\n }\r\n\r\n });\r\n\r\n\r\n }\r\n\r\n function cancel() {\r\n _reset();\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n}\r\n\r\nfunction ImportReportModalControllerFactory(BIService, PermissionService, $uibModalInstance, $scope, $rootScope,$timeout, $state, modalName) {\r\n return new ImportReportModalController(BIService, PermissionService, $uibModalInstance, $scope, $rootScope,$timeout, $state, modalName);\r\n}\r\n\r\nangular\r\n .module(\"bi\")\r\n .controller(\"ImportReportModalController\", ImportReportModalControllerFactory);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/importreport.modal.html',\n '

    {{vm.modalName}}

    {{alert.text}}
    {{vm.progress}}%
    ');\n}]);\n}(window, document, window.angular));","function biParamCheckboxDirective() {\r\n\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamCheckboxController',\r\n controllerAs: 'biParamCheckboxCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-checkbox.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamCheckboxCtrl) {\r\n biParamCheckboxCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamCheckboxController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n\r\n //Private \r\n var watchers = [];\r\n var isDirty = false;\r\n\r\n\r\n //Public\r\n var biParamCheckboxCtrl = this;\r\n\r\n biParamCheckboxCtrl.formCtrl = $scope.formCtrl;\r\n biParamCheckboxCtrl.param = $scope.param;\r\n biParamCheckboxCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParamCheckboxCtrl.init = init;\r\n biParamCheckboxCtrl.parameterChanged = parameterChanged;\r\n biParamCheckboxCtrl.isChecked = false;\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n function parameterChanged(biParam) {\r\n\r\n isDirty = true;\r\n biParam.param.SelectedValue = biParamCheckboxCtrl.isChecked ? \"1\" : \"0\";\r\n\r\n if (biParamCheckboxCtrl.paramChangeCallback) {\r\n biParamCheckboxCtrl.paramChangeCallback(biParamCheckboxCtrl.param);\r\n }\r\n }\r\n\r\n}\r\n\r\nangular.module('bi').directive('biParamCheckbox', [biParamCheckboxDirective]);\r\n\r\nangular.module('bi').controller('biParamCheckboxController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamCheckboxController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-checkbox.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function biParamDaterangeDirective() {\r\n\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n dateformat: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamDateRangeController',\r\n controllerAs: 'biParamDateRangeCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-daterange.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamDateRangeCtrl) {\r\n biParamDateRangeCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamDateRangeController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n\r\n //Private \r\n var watchers = [];\r\n\r\n\r\n //Public\r\n var biParamDateRangeCtrl = this;\r\n\r\n biParamDateRangeCtrl.formCrtl = $scope.formCrtl;\r\n biParamDateRangeCtrl.param = $scope.param;\r\n biParamDateRangeCtrl.dateformat = $scope.dateformat;\r\n biParamDateRangeCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParamDateRangeCtrl.init = init;\r\n biParamDateRangeCtrl.calendarChanged = calendarChanged;\r\n biParamDateRangeCtrl.relativeDateChanged = relativeDateChanged;\r\n biParamDateRangeCtrl.openStartCalendar = openStartCalendar;\r\n biParamDateRangeCtrl.openEndCalendar = openEndCalendar;\r\n biParamDateRangeCtrl.showValidationError = showValidationError;\r\n biParamDateRangeCtrl.isDateOnly = isDateOnly;\r\n biParamDateRangeCtrl.isDateRange = isDateRange;\r\n biParamDateRangeCtrl.isInvalidDateRange = isInvalidDateRange;\r\n biParamDateRangeCtrl.startCalendarOpen = false;\r\n biParamDateRangeCtrl.endCalendarOpen = false;\r\n biParamDateRangeCtrl.dateOptions = {\r\n showWeeks: false,\r\n maxDate: new Date()\r\n };\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n biParamDateRangeCtrl.relativeDateChanged();\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n function openStartCalendar($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n biParamDateRangeCtrl.startCalendarOpen = true;\r\n biParamDateRangeCtrl.endCalendarOpen = false;\r\n }\r\n\r\n function openEndCalendar($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n biParamDateRangeCtrl.startCalendarOpen = false;\r\n biParamDateRangeCtrl.endCalendarOpen = true;\r\n\r\n }\r\n\r\n function relativeDateChanged() {\r\n if (!biParamDateRangeCtrl.param.SelectedValue || (biParamDateRangeCtrl.param.SelectedValue && biParamDateRangeCtrl.param.SelectedValue != \"Custom\")) {\r\n var dateRange = BIService.computeDateRange(biParamDateRangeCtrl.param.SelectedValue);\r\n biParamDateRangeCtrl.param.CustomStartDate = dateRange.Start;\r\n biParamDateRangeCtrl.param.CustomEndDate = dateRange.End;\r\n dateRangeChanged();\r\n }\r\n }\r\n function calendarChanged() {\r\n biParamDateRangeCtrl.param.SelectedValue = \"Custom\";\r\n dateRangeChanged();\r\n }\r\n\r\n function isDateOnly() {\r\n return biParamDateRangeCtrl.param.InputTypeEnum == BIService.inputTypeEnum.Date;\r\n }\r\n function isDateRange() {\r\n return biParamDateRangeCtrl.param.InputTypeEnum == BIService.inputTypeEnum.DateRange;\r\n }\r\n\r\n\r\n function dateRangeChanged() {\r\n if (biParamDateRangeCtrl.paramChangeCallback) {\r\n biParamDateRangeCtrl.paramChangeCallback(biParamDateRangeCtrl.param);\r\n }\r\n }\r\n\r\n function showValidationError() {\r\n var retval = false;\r\n\r\n var formCrtl = biParamDateRangeCtrl.formCtrl;\r\n if (formCrtl) {\r\n var relativeDateCtrl = formCrtl.dateRangeRelativeDate;\r\n var startDateCtrl = formCrtl.dateRangeStartDate;\r\n var endDateCtrl = formCrtl.dateRangeEndDate;\r\n\r\n if (!relativeDateCtrl.$pristine || !startDateCtrl.$pristine || !endDateCtrl.$pristine || formCrtl.$submitted) {\r\n\r\n if (relativeDateCtrl.$error &&\r\n relativeDateCtrl.$error.required) {\r\n retval = true;\r\n }\r\n\r\n if (startDateCtrl.$error &&\r\n startDateCtrl.$error.required) {\r\n retval = true;\r\n }\r\n\r\n if (endDateCtrl.$error &&\r\n endDateCtrl.$error.required) {\r\n retval = true;\r\n }\r\n }\r\n }\r\n\r\n return retval;\r\n }\r\n function isInvalidDateRange() {\r\n biParamDateRangeCtrl.errorMessage = \"\";\r\n var retval = false;\r\n if (isDateRange()) {\r\n var formCrtl = biParamDateRangeCtrl.formCtrl;\r\n if (formCrtl) {\r\n if (formCrtl.$error == \"error\") {\r\n formCrtl.$error = {};\r\n }\r\n if (biParamDateRangeCtrl.param.CustomStartDate > biParamDateRangeCtrl.param.CustomEndDate) {\r\n retval = true;\r\n biParamDateRangeCtrl.errorMessage = \"End date must be after start date.\";\r\n formCrtl.$error = \"error\";\r\n }\r\n\r\n }\r\n }\r\n return retval;\r\n }\r\n}\r\n\r\nangular.module('bi').directive('biParamDaterange', [biParamDaterangeDirective]);\r\n\r\nangular.module('bi').controller('biParamDateRangeController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamDateRangeController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-daterange.tpl.html',\n '
    {{ biParamDateRangeCtrl.errorMessage}}
    Date Range is required
    ');\n}]);\n}(window, document, window.angular));","function biParamMonthSelectDirective() {\r\n\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n dateformat: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamMonthSelectorController',\r\n controllerAs: 'biParamMonthSelectorCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-month-select.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamMonthSelectorCtrl) {\r\n biParamMonthSelectorCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamMonthSelectorController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n //Private \r\n var watchers = [];\r\n\r\n\r\n //Public\r\n var biParamMonthSelectorCtrl = this;\r\n biParamMonthSelectorCtrl.formCtrl = $scope.formCtrl;\r\n biParamMonthSelectorCtrl.param = $scope.param;\r\n biParamMonthSelectorCtrl.dateformat = $scope.dateformat;\r\n biParamMonthSelectorCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n biParamMonthSelectorCtrl.init = init;\r\n biParamMonthSelectorCtrl.calendarChanged = calendarChanged;\r\n biParamMonthSelectorCtrl.openStartCalendar = openStartCalendar;\r\n biParamMonthSelectorCtrl.openEndCalendar = openEndCalendar;\r\n\r\n biParamMonthSelectorCtrl.showValidationError = showValidationError;\r\n biParamMonthSelectorCtrl.isInvalidMonthRange = isInvalidMonthRange;\r\n biParamMonthSelectorCtrl.isMonthOnly = isMonthOnly;\r\n biParamMonthSelectorCtrl.isMonthRange = isMonthRange;\r\n biParamMonthSelectorCtrl.startCalendarOpen = false;\r\n biParamMonthSelectorCtrl.endCalendarOpen = false;\r\n\r\n if (isMonthOnly()) {\r\n var lastMonth = new Date();\r\n lastMonth.setMonth(lastMonth.getMonth() - 1);\r\n biParamMonthSelectorCtrl.param.CustomStartDate = lastMonth;\r\n }\r\n biParamMonthSelectorCtrl.dateOptions = {\r\n showWeeks: false,\r\n maxDate: new Date(),\r\n 'minMode': 'month'\r\n };\r\n\r\n function init() {\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n function openStartCalendar($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n biParamMonthSelectorCtrl.startCalendarOpen = true;\r\n biParamMonthSelectorCtrl.endCalendarOpen = false;\r\n }\r\n function openEndCalendar($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n biParamMonthSelectorCtrl.startCalendarOpen = false;\r\n biParamMonthSelectorCtrl.endCalendarOpen = true;\r\n\r\n }\r\n function calendarChanged() {\r\n if (biParamMonthSelectorCtrl.paramChangeCallback) {\r\n biParamMonthSelectorCtrl.paramChangeCallback(biParamMonthSelectorCtrl.param);\r\n }\r\n }\r\n function isMonthOnly() {\r\n return biParamMonthSelectorCtrl.param.InputTypeEnum == BIService.inputTypeEnum.Month;\r\n }\r\n function isMonthRange() {\r\n return biParamMonthSelectorCtrl.param.InputTypeEnum == BIService.inputTypeEnum.MonthRange;\r\n }\r\n function showValidationError() {\r\n var retval = false;\r\n var formCrtl = biParamMonthSelectorCtrl.formCtrl;\r\n if (formCrtl) {\r\n var startmonthCtrl = formCrtl.StartMonth;\r\n var endmonthCtrl = formCrtl.EndMonth;\r\n if (startmonthCtrl != undefined && endmonthCtrl != undefined) {\r\n if (!startmonthCtrl.$pristine || !endmonthCtrl.$pristine || formCrtl.$submitted) {\r\n\r\n if (startmonthCtrl.$error &&\r\n startmonthCtrl.$error.required) {\r\n retval = true;\r\n }\r\n if (isMonthRange() && endmonthCtrl.$error &&\r\n endmonthCtrl.$error.required) {\r\n retval = true;\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n return retval;\r\n }\r\n function isInvalidMonthRange() {\r\n biParamMonthSelectorCtrl.errorMessage = \"\";\r\n var retval = false;\r\n var formCrtl = biParamMonthSelectorCtrl.formCtrl;\r\n if (formCrtl) {\r\n if (formCrtl.$error == \"error\") {\r\n formCrtl.$error = {};\r\n }\r\n if ($scope.biParamMonthSelectorCtrl.param.CustomStartDate > $scope.biParamMonthSelectorCtrl.param.CustomEndDate) {\r\n retval = true;\r\n biParamMonthSelectorCtrl.errorMessage = \"End Month must be after start Month.\";\r\n formCrtl.$error = \"error\";\r\n }\r\n }\r\n return retval;\r\n }\r\n}\r\n\r\nangular.module('bi').directive('biParamMonthSelect', [biParamMonthSelectDirective]);\r\n\r\nangular.module('bi').controller('biParamMonthSelectorController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamMonthSelectorController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-month-select.tpl.html',\n '
    Start
    Month
    End
    Month is required
    {{biParamMonthSelectorCtrl.errorMessage}}
    ');\n}]);\n}(window, document, window.angular));","function biParamMultiSelectCheckDirective() {\r\n\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamMultiSelectCheckController',\r\n controllerAs: 'biParamMultiSelectCheckCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-multi-select-check.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamMultiSelectCheckCtrl) {\r\n biParamMultiSelectCheckCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamMultiSelectCheckController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n //Private \r\n var watchers = [];\r\n var isDirty = false;\r\n //Public\r\n var biParamMultiSelectCheckCtrl = this;\r\n\r\n biParamMultiSelectCheckCtrl.formCtrl = $scope.formCtrl;\r\n biParamMultiSelectCheckCtrl.param = $scope.param;\r\n biParamMultiSelectCheckCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParamMultiSelectCheckCtrl.init = init;\r\n $scope.Options = biParamMultiSelectCheckCtrl.param.Options;\r\n $scope.searchEnabled = true;\r\n biParamMultiSelectCheckCtrl.searchEnabled = true;\r\n $scope.placeholder = \"None\";\r\n biParamMultiSelectCheckCtrl.param.Options = [];\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n watchers = [];\r\n }\r\n}\r\n\r\nangular.module('bi').directive('biParamMultiSelectCheck', [biParamMultiSelectCheckDirective]);\r\n\r\nangular.module('bi').controller('biParamMultiSelectCheckController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamMultiSelectCheckController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-multi-select-check.tpl.html',\n '
    {{biParamMultiSelectCheckCtrl.param.DisplayName}} is required
    ');\n}]);\n}(window, document, window.angular));","function biParamMultiSelectTypeAheadDirective() {\r\n\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamMultiSelectTypeAheadController',\r\n controllerAs: 'biParamMultiSelectTypeAheadCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-multi-select-type-ahead.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamMultiSelectTypeAheadCtrl) {\r\n biParamMultiSelectTypeAheadCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamMultiSelectTypeAheadController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n\r\n //Private \r\n var watchers = [];\r\n var isDirty = false;\r\n\r\n //Public\r\n var biParamMultiSelectTypeAheadCtrl = this;\r\n\r\n biParamMultiSelectTypeAheadCtrl.formCtrl = $scope.formCtrl;\r\n biParamMultiSelectTypeAheadCtrl.param = $scope.param;\r\n biParamMultiSelectTypeAheadCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParamMultiSelectTypeAheadCtrl.init = init;\r\n biParamMultiSelectTypeAheadCtrl.getTypeaheadData = getTypeaheadData;\r\n biParamMultiSelectTypeAheadCtrl.showTagList = false;\r\n biParamMultiSelectTypeAheadCtrl.availableTags = [];\r\n biParamMultiSelectTypeAheadCtrl.onRemoveItem = onRemoveItem;\r\n biParamMultiSelectTypeAheadCtrl.onSelectItem = onSelectItem;\r\n biParamMultiSelectTypeAheadCtrl.parameterChanged = parameterChanged;\r\n\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n function parameterChanged(option) {\r\n\r\n isDirty = true;\r\n\r\n if (biParamMultiSelectTypeAheadCtrl.paramChangeCallback) {\r\n biParamMultiSelectTypeAheadCtrl.paramChangeCallback(biParamMultiSelectTypeAheadCtrl.param);\r\n }\r\n }\r\n\r\n\r\n function getTypeaheadData(searchText) {\r\n if (searchText.length > 0) {\r\n biParamMultiSelectTypeAheadCtrl.availableTags = [];\r\n BIService.getTypeaheadData(biParamMultiSelectTypeAheadCtrl.param.DataSource, searchText).then(function (results) {\r\n results.forEach(function (item) {\r\n var option = { 'Name': item.value, 'Value': item.data };\r\n if (biParamMultiSelectTypeAheadCtrl.param.Options.filter(function (selectedOption) {\r\n return selectedOption.Value === option.Value;\r\n }).length == 0) {\r\n biParamMultiSelectTypeAheadCtrl.availableTags.push(option);\r\n }\r\n });\r\n });\r\n }\r\n else {\r\n biParamMultiSelectTypeAheadCtrl.availableTags = [];\r\n }\r\n }\r\n\r\n function onSelectItem(item, model) {\r\n biParamMultiSelectTypeAheadCtrl.parameterChanged(item);\r\n }\r\n\r\n function onRemoveItem(item, model) {\r\n biParamMultiSelectTypeAheadCtrl.parameterChanged(item);\r\n }\r\n\r\n\r\n}\r\n\r\nangular.module('bi').directive('biParamMultiSelectTypeAhead', [biParamMultiSelectTypeAheadDirective]);\r\n\r\nangular.module('bi').controller('biParamMultiSelectTypeAheadController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamMultiSelectTypeAheadController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-multi-select-type-ahead.tpl.html',\n '
    {{$item.Name}}{{option.Name}}
    {{biParamMultiSelectTypeAheadCtrl.param.DisplayName}} is required
    ');\n}]);\n}(window, document, window.angular));","function biParamMultiselectlistDirective() {\r\n\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamMultiSelectListController',\r\n controllerAs: 'biParamMultiSelectListCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-multiselectlist.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamMultiSelectListCtrl) {\r\n biParamMultiSelectListCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamMultiSelectListController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n\r\n //Private \r\n var watchers = [];\r\n var isDirty = false;\r\n\r\n\r\n //Public\r\n var biParamMultiSelectListCtrl = this;\r\n\r\n biParamMultiSelectListCtrl.formCtrl = $scope.formCtrl;\r\n biParamMultiSelectListCtrl.param = $scope.param;\r\n biParamMultiSelectListCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParamMultiSelectListCtrl.init = init;\r\n biParamMultiSelectListCtrl.parameterChanged = parameterChanged;\r\n biParamMultiSelectListCtrl.isRequired = isRequired;\r\n biParamMultiSelectListCtrl.showValidationError = showValidationError;\r\n\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n\r\n // Default all multi-select options to selected.\r\n for (var i = 0; i < biParamMultiSelectListCtrl.param.Options.length; i++) {\r\n biParamMultiSelectListCtrl.param.Options[i].selected = true;\r\n }\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n function isRequired() {\r\n\r\n var hasSelectedOption = false;\r\n\r\n for (var i = 0; i < biParamMultiSelectListCtrl.param.Options.length && hasSelectedOption == false; i++) {\r\n if (biParamMultiSelectListCtrl.param.Options[i].selected == true) {\r\n hasSelectedOption = true;\r\n }\r\n }\r\n\r\n var retVal = biParamMultiSelectListCtrl.param.IsRequired && hasSelectedOption == false;\r\n return retVal;\r\n }\r\n\r\n function parameterChanged(option) {\r\n\r\n isDirty = true;\r\n\r\n if (biParamMultiSelectListCtrl.paramChangeCallback) {\r\n biParamMultiSelectListCtrl.paramChangeCallback(biParamMultiSelectListCtrl.param);\r\n }\r\n }\r\n\r\n function showValidationError() {\r\n var retval = false;\r\n\r\n var formCrtl = biParamMultiSelectListCtrl.formCtrl;\r\n if (formCrtl) {\r\n\r\n if (isDirty || formCrtl.$submitted) {\r\n\r\n if (biParamMultiSelectListCtrl.isRequired()) {\r\n retval = true;\r\n }\r\n\r\n }\r\n }\r\n\r\n return retval;\r\n }\r\n}\r\n\r\nangular.module('bi').directive('biParamMultiselectlist', [biParamMultiselectlistDirective]);\r\n\r\nangular.module('bi').controller('biParamMultiSelectListController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamMultiSelectListController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-multiselectlist.tpl.html',\n '
    {{option.Name}}
    {{biParamMultiSelectListCtrl.param.DisplayName}} is required
    ');\n}]);\n}(window, document, window.angular));","function biParamNotetextDirective() {\r\n\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamNotetextController',\r\n controllerAs: 'biParamNotetextCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-notetext.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamNotetextCtrl) {\r\n biParamNotetextCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamNotetextController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n\r\n //Private \r\n var watchers = [];\r\n var isDirty = false;\r\n\r\n\r\n //Public\r\n var biParamNotetextCtrl = this;\r\n\r\n biParamNotetextCtrl.formCtrl = $scope.formCtrl;\r\n biParamNotetextCtrl.param = $scope.param;\r\n biParamNotetextCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParamNotetextCtrl.init = init;\r\n biParamNotetextCtrl.parameterChanged = parameterChanged;\r\n biParamNotetextCtrl.noteText = \"\";\r\n\r\n\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n function parameterChanged(biParam) {\r\n\r\n isDirty = true;\r\n biParam.param.SelectedValue = biParamNotetextCtrl.noteText;\r\n\r\n if (biParamNotetextCtrl.paramChangeCallback) {\r\n biParamNotetextCtrl.paramChangeCallback(biParamNotetextCtrl.param);\r\n }\r\n }\r\n\r\n\r\n\r\n}\r\n\r\nangular.module('bi').directive('biParamNotetext', [biParamNotetextDirective]);\r\n\r\nangular.module('bi').controller('biParamNotetextController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamNotetextController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-notetext.tpl.html',\n '
    {{biParamNotetextCtrl.param.DisplayName}} is required
    ');\n}]);\n}(window, document, window.angular));","function biParamSingleSelectTypeAheadDirective() {\r\n\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamSingleSelectTypeAheadController',\r\n controllerAs: 'biParamSingleSelectTypeAheadCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-single-select-type-ahead.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamSingleSelectTypeAheadCtrl) {\r\n biParamSingleSelectTypeAheadCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamSingleSelectTypeAheadController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n\r\n //Private \r\n var watchers = [];\r\n var searchList = [];\r\n\r\n //Public\r\n var biParamSingleSelectTypeAheadCtrl = this;\r\n\r\n biParamSingleSelectTypeAheadCtrl.formCtrl = $scope.formCtrl;\r\n biParamSingleSelectTypeAheadCtrl.param = $scope.param;\r\n biParamSingleSelectTypeAheadCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParamSingleSelectTypeAheadCtrl.init = init;\r\n biParamSingleSelectTypeAheadCtrl.onBlur = onBlur;\r\n biParamSingleSelectTypeAheadCtrl.parameterChanged = parameterChanged;\r\n biParamSingleSelectTypeAheadCtrl.showValidationError = showValidationError;\r\n biParamSingleSelectTypeAheadCtrl.getTypeaheadData = getTypeaheadData;\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onBlur() {\r\n biParamSingleSelectTypeAheadCtrl.formCtrl.$setValidity('validation', isValid());\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n async function getTypeaheadData(searchText) {\r\n searchList = await BIService.getTypeaheadData(biParamSingleSelectTypeAheadCtrl.param.DataSource, searchText);\r\n return searchList;\r\n }\r\n\r\n function parameterChanged() {\r\n if (biParamSingleSelectTypeAheadCtrl.paramChangeCallback) {\r\n biParamSingleSelectTypeAheadCtrl.paramChangeCallback(biParamSingleSelectTypeAheadCtrl.param);\r\n }\r\n }\r\n\r\n function isValid() {\r\n var formCrtl = biParamSingleSelectTypeAheadCtrl.formCtrl;\r\n var singleSelectTypeAheadCtrl = formCrtl[biParamSingleSelectTypeAheadCtrl.param.ExagoParameterName];\r\n var notFound = true;\r\n for (var i = 0; i < searchList.length; i++) {\r\n if (searchList[i].value == singleSelectTypeAheadCtrl.$viewValue) {\r\n notFound = false;\r\n }\r\n }\r\n if (notFound && (biParamSingleSelectTypeAheadCtrl.param.IsRequired == true && singleSelectTypeAheadCtrl.$viewValue != \"\")) {\r\n return false;\r\n }\r\n\r\n if (searchList.length > 0 && singleSelectTypeAheadCtrl.$viewValue == searchList[0].value) {\r\n biParamSingleSelectTypeAheadCtrl.param.SelectedValue = searchList[0];\r\n return true;\r\n }\r\n return true;\r\n }\r\n\r\n function showValidationError() {\r\n var retval = false;\r\n var formCrtl = biParamSingleSelectTypeAheadCtrl.formCtrl;\r\n if (formCrtl) {\r\n if (formCrtl.$submitted) {\r\n return !isValid();\r\n }\r\n }\r\n\r\n return retval;\r\n }\r\n}\r\n\r\nangular.module('bi').directive('biParamSingleSelectTypeAhead', [biParamSingleSelectTypeAheadDirective]);\r\n\r\nangular.module('bi').controller('biParamSingleSelectTypeAheadController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamSingleSelectTypeAheadController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-single-select-type-ahead.tpl.html',\n '
    {{biParamSingleSelectTypeAheadCtrl.param.DisplayName}} is required
    ');\n}]);\n}(window, document, window.angular));","function biParamSingleselectlistDirective() {\r\n\r\n return {\r\n scope: true,\r\n bindToController: {\r\n formCtrl: '=',\r\n param: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamSingleSelectListController',\r\n controllerAs: 'biParamSingleSelectListCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-param-singleselectlist.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamSingleSelectListCtrl) {\r\n biParamSingleSelectListCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamSingleSelectListController($scope, $state, $timeout, $uibModal, BIService, ReportsService) {\r\n\r\n //Private \r\n var watchers = [];\r\n //Public\r\n var biParamSingleSelectListCtrl = this;\r\n biParamSingleSelectListCtrl.init = init;\r\n biParamSingleSelectListCtrl.parameterChanged = parameterChanged;\r\n biParamSingleSelectListCtrl.showValidationError = showValidationError;\r\n\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n function parameterChanged(biParam) {\r\n\r\n if (biParam.param.ExagoParameterName == \"Biometric\") {\r\n var skipReason = $scope.biParametersCtrl.parameters.filter(e => {\r\n return e.ExagoParameterName == \"SkipReason\";\r\n })[0];\r\n skipReason.Options = biParam.param.Options.filter(e => { return e.Value == biParam.param.SelectedValue })[0].BiSubOptionsModel;\r\n skipReason.SelectedValue = \"0\";\r\n }\r\n else if (biParam.param.ExagoParameterName == \"MonitoringStatuses\") {\r\n var statusReason = $scope.biParametersCtrl.parameters.filter(e => {\r\n return e.ExagoParameterName == \"StatusReason\";\r\n })[0];\r\n statusReason.Options = biParam.param.Options.filter(e => { return e.Value == biParam.param.SelectedValue })[0].BiSubOptionsModel;\r\n statusReason.SelectedValue = \"All\";\r\n }\r\n if (biParamSingleSelectListCtrl != undefined && biParamSingleSelectListCtrl.paramChangeCallback) {\r\n biParamSingleSelectListCtrl.paramChangeCallback(biParamSingleSelectListCtrl.param);\r\n }\r\n }\r\n\r\n function showValidationError() {\r\n var retval = false;\r\n\r\n var formCrtl = biParamSingleSelectListCtrl.formCtrl;\r\n if (formCrtl) {\r\n var singleSelectListCtrl = formCrtl[biParamSingleSelectListCtrl.param.ExagoParameterName];\r\n\r\n if (!singleSelectListCtrl.$pristine || formCrtl.$submitted) {\r\n\r\n if (singleSelectListCtrl.$error &&\r\n singleSelectListCtrl.$error.required) {\r\n retval = true;\r\n }\r\n\r\n }\r\n }\r\n\r\n return retval;\r\n }\r\n}\r\n\r\nangular.module('bi').directive('biParamSingleselectlist', [biParamSingleselectlistDirective]);\r\n\r\nangular.module('bi').controller('biParamSingleSelectListController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', biParamSingleSelectListController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-param-singleselectlist.tpl.html',\n '
    {{biParamSingleSelectListCtrl.param.DisplayName}} is required
    ');\n}]);\n}(window, document, window.angular));","function biParametersDirective() {\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n parameters: '=',\r\n parameterChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParametersController',\r\n controllerAs: 'biParametersCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/bi-parameters.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParametersCtrl) {\r\n biParametersCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParametersController($scope, $state, $timeout, $uibModal, BIService, ConfigurationsService, ReportsService) {\r\n\r\n //Private \r\n var watchers = [];\r\n\r\n //Public\r\n var biParametersCtrl = this;\r\n\r\n biParametersCtrl.formCtrl = $scope.formCtrl;\r\n biParametersCtrl.parameters = $scope.parameters;\r\n biParametersCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParametersCtrl.init = init;\r\n biParametersCtrl.inputTypeEnum = BIService.inputTypeEnum;\r\n biParametersCtrl.isDateRangeParam = isDateRangeParam;\r\n biParametersCtrl.isSingleSelectListParam = isSingleSelectListParam;\r\n biParametersCtrl.isMultiSelectListParam = isMultiSelectListParam;\r\n biParametersCtrl.isSingleSelectTypeAheadParam = isSingleSelectTypeAheadParam;\r\n biParametersCtrl.isMultiSelectTypeAheadParam = isMultiSelectTypeAheadParam;\r\n biParametersCtrl.isMonthParam = isMonthParam;\r\n biParametersCtrl.isPatientTypeList = isPatientTypeList;\r\n biParametersCtrl.isCheckBoxParam = isCheckBoxParam;\r\n biParametersCtrl.isNoteTextParam = isNoteTextParam;\r\n biParametersCtrl.isMultiSelectCheck = isMultiSelectCheck;\r\n biParametersCtrl.ParameterChanged = ParameterChanged;\r\n biParametersCtrl.dateformat = ConfigurationsService.configParams.DateFormat;\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n\r\n $scope.filter = {\r\n PatientTimeLogPatientId: '',\r\n PatientTimeLogAdditionalTime: ''\r\n }\r\n\r\n function ParameterChanged(param) {\r\n if (biParametersCtrl.parameterChangeCallback) {\r\n biParametersCtrl.parameterChangeCallback(param);\r\n }\r\n }\r\n\r\n\r\n function isDateRangeParam(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.DateRange || param.InputTypeEnum == BIService.inputTypeEnum.Date;\r\n }\r\n\r\n function isSingleSelectListParam(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.SingleSelectList;\r\n }\r\n\r\n function isMultiSelectListParam(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.MultiSelectList;\r\n }\r\n\r\n function isSingleSelectTypeAheadParam(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.SingleSelectTypeAhead && param.Description != 'Time Log Patient';\r\n }\r\n function isMultiSelectCheck(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.MultiSelectCheck;\r\n }\r\n function isMultiSelectTypeAheadParam(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.MultiSelectTypeAhead;\r\n }\r\n function isMonthParam(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.Month || BIService.inputTypeEnum.MonthRange;\r\n }\r\n function isPatientTypeList(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.PatientTypeList;\r\n }\r\n\r\n function isCheckBoxParam(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.CheckBox;\r\n }\r\n\r\n function isNoteTextParam(param) {\r\n return param.InputTypeEnum == BIService.inputTypeEnum.NoteText;\r\n }\r\n\r\n}\r\n\r\nangular.module('bi').directive('biParameters', [biParametersDirective]);\r\n\r\nangular.module('bi').controller('biParametersController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ConfigurationsService', 'ReportsService', biParametersController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/bi-parameters.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function biParamPatientTimeLogDirective() {\r\n return {\r\n scope: {\r\n formCtrl: '=',\r\n param: '=',\r\n dateformat: '=',\r\n paramChangeCallback: '=onparameterchange'\r\n },\r\n controller: 'biParamPatientTimeLogController',\r\n controllerAs: 'biParamPatientTimeLogCtrl',\r\n restrict: 'E',\r\n templateUrl: 'modules/bi/parameters/timelog/bi-param-patient-time-log.tpl.html',\r\n link: function afterLink($scope, element, attributes, biParamPatientTimeLogCtrl) {\r\n biParamPatientTimeLogCtrl.init();\r\n }\r\n };\r\n\r\n};\r\n\r\nfunction biParamPatientTimeLogController($scope, $state, $timeout, $uibModal, BIService, ReportsService, vhSweetAlert) {\r\n //Private \r\n var watchers = [];\r\n\r\n\r\n //Public\r\n var biParamPatientTimeLogCtrl = this;\r\n\r\n biParamPatientTimeLogCtrl.formCtrl = $scope.formCtrl;\r\n biParamPatientTimeLogCtrl.param = $scope.param;\r\n biParamPatientTimeLogCtrl.dateformat = $scope.dateformat;\r\n biParamPatientTimeLogCtrl.paramChangeCallback = $scope.paramChangeCallback;\r\n\r\n biParamPatientTimeLogCtrl.init = init;\r\n biParamPatientTimeLogCtrl.parameterChanged = parameterChanged;\r\n biParamPatientTimeLogCtrl.showValidationError = showValidationError;\r\n\r\n function init() {\r\n\r\n $scope.$on(\"$destroy\", onDestroy);\r\n }\r\n\r\n function onDestroy() {\r\n\r\n for (var i = 0; i < watchers.length; i++) {\r\n watchers[i]();\r\n }\r\n\r\n watchers = [];\r\n }\r\n function parameterChanged(biParam) {\r\n\r\n if (biParamPatientTimeLogCtrl != undefined && biParamPatientTimeLogCtrl.paramChangeCallback) {\r\n biParamPatientTimeLogCtrl.paramChangeCallback(biParamPatientTimeLogCtrl.param);\r\n $scope.filter.PatientTimeLogAdditionalTime = '';\r\n $scope.filter.PatientTimeLogPatientId = '';\r\n }\r\n }\r\n $scope.filter = {\r\n PatientTimeLogPatientId: '',\r\n PatientTimeLogAdditionalTime: ''\r\n }\r\n\r\n\r\n function validateTime() {\r\n $scope.additionalTime = $scope.filter.PatientTimeLogAdditionalTime;\r\n if ($scope.filter.PatientTimeLogAdditionalTime % 30 === 0) {\r\n return true;\r\n }\r\n else {\r\n var errorMessage = 'Any extra time must be in increments of 30.';\r\n return false;\r\n }\r\n }\r\n function validatePatient() {\r\n var valid = true;\r\n $scope.filter.PatientTimeLogAdditionalTime = '';\r\n $scope.$apply();\r\n biParamPatientTimeLogCtrl.paramChangeCallback($scope.filter.PatientTimeLogPatientId);\r\n if ($scope.biParamPatientTimeLogCtrl.param.SelectedValue == 'Single' && $scope.filter.PatientTimeLogPatientId.length) {\r\n //patient not found\r\n var errorMessage = 'Patient ' + $scope.filter.PatientTimeLogPatientId + ' not found. Please try a different name.';\r\n vhSweetAlert.error('Error', errorMessage);\r\n valid = false;\r\n }\r\n return valid;\r\n }\r\n // this.AdditionalTime = 0;\r\n\r\n\r\n $scope.validateName = function () {\r\n $timeout(function () {\r\n validatePatient()\r\n }, 200);\r\n };\r\n\r\n $scope.getPatientTypeaheadData = function (val) {\r\n if (val.length > 0) {\r\n //8 is datasource id for patient\r\n return BIService.getTypeaheadData(8, val).then(function (data) {\r\n return data;\r\n })\r\n }\r\n }\r\n\r\n $scope.validateAdditionalTime = function () {\r\n $timeout(function () {\r\n $scope.filter.PatientTimeLogPatientId = '';\r\n $scope.$apply();\r\n biParamPatientTimeLogCtrl.paramChangeCallback($scope.filter.PatientTimeLogAdditionalTime);\r\n if ($scope.biParamPatientTimeLogCtrl.param.SelectedValue == \"All (CCM - Over 60 Min)\") {\r\n if (!validateTime()) {\r\n vhSweetAlert.error('Error', 'Additional time must be an increment of 30 minutes.')\r\n $scope.filter.PatientTimeLogAdditionalTime = '';\r\n\r\n }\r\n }\r\n }, 200);\r\n };\r\n function showValidationError() {\r\n var retval = false;\r\n var formCrtl = biParamPatientTimeLogCtrl.formCtrl;\r\n if (formCrtl) {\r\n var singleSelectListCtrl = formCrtl['patient'];\r\n\r\n if (!singleSelectListCtrl.$pristine || formCrtl.$submitted) {\r\n\r\n if (singleSelectListCtrl.$error &&\r\n singleSelectListCtrl.$error.required) {\r\n retval = true;\r\n }\r\n\r\n }\r\n }\r\n\r\n return retval;\r\n }\r\n\r\n\r\n}\r\n\r\nangular.module('bi').directive('biParamPatientTimeLog', [biParamPatientTimeLogDirective]);\r\n\r\nangular.module('bi').controller('biParamPatientTimeLogController', ['$scope', '$state', '$timeout', '$uibModal', 'BIService', 'ReportsService', 'vhSweetAlert', biParamPatientTimeLogController]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/bi/parameters/timelog/bi-param-patient-time-log.tpl.html',\n '
    Patient is required
    ');\n}]);\n}(window, document, window.angular));","function CaregiverRow($state, CaregiversService, vhSweetAlert, PermissionService, $sce, AuthorizationService, lodash) {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n \"caregiver\": \"=\",\r\n \"crvm\": \"=\"\r\n },\r\n templateUrl: \"modules/caregivers/caregiver_row.tpl.html\",\r\n link: function (scope, element, attrs) {\r\n crvm=scope.crvm; //from original page scope\r\n scope.userCanEditCaregiverList = false;\r\n if ( PermissionService.userHasPermission([\"CaregiversWrite\"]) || scope.caregiver.Id == AuthorizationService.getCaregiver().Id )\r\n {\r\n scope.userCanEditCaregiverList = true;\r\n }\r\n\r\n scope.actions = [];\r\n\r\n scope.actions.push({\r\n actionName: 'caregiverProfile',\r\n action: openEditModal,\r\n actionIcon: 'fa-user',\r\n actionText: 'Edit Profile'\r\n });\r\n\r\n if(scope.userCanEditCaregiverList || scope.caregiver.Id == crvm.currentCaregiver.Id){\r\n scope.actions.push({\r\n actionName: 'caregiverPassword',\r\n action: openPasswordModal,\r\n actionIcon: 'fa-gears',\r\n actionText: 'Change Password'\r\n });\r\n }\r\n\r\n if(crvm.currentCaregiver.Id != scope.caregiver.Id){\r\n var text;\r\n var newAction;\r\n var newIcon;\r\n \r\n if(scope.caregiver.IsDeleted == false) {\r\n text = 'Disable Profile',\r\n newAction = deletePrompt,\r\n newIcon = 'fa-trash'\r\n\r\n } else {\r\n text = 'Enable Profile',\r\n newAction = enablePrompt,\r\n newIcon = 'fa-undo'\r\n }\r\n\r\n scope.actions.push({\r\n actionName: 'caregiverProfileDelete',\r\n action: newAction,\r\n actionIcon: newIcon,\r\n actionText: text\r\n });\r\n }\r\n\r\n function deleteProfile() {\r\n CaregiversService.deleteCaregiver(scope.caregiver.Id)\r\n .then(function (data) {\r\n if(data){\r\n for(var i=0;i$&'));\r\n }\r\n }\r\n\r\n function openEditModal() {\r\n $state.go('caregivers.caregiver.edit', {caregiverId: scope.caregiver.Id});\r\n }\r\n\r\n function openPasswordModal() {\r\n crvm.openPasswordModal(scope.caregiver);\r\n }\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"caregivers\").directive(\"caregiverRow\", CaregiverRow);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/caregivers/caregiver_row.tpl.html',\n '
    \"image\"
    {{caregiver.Last_Name}}, {{caregiver.First_Name}} {{caregiver.CaregiverTitle.Name}} 
    Phone: {{caregiver.Phone1 | tel}}
    Email: {{caregiver.Email}}
    User Name: {{caregiver.User_Name}}
    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/caregivers/caregiver-search-keywords.tpl.html',\n '
    • Authorization Mode
    • Browser
    • User ID (number)
    • Create Date (date)
    • Created By
    • {{crvm.formfields.Email}}
    • Expire Password Now (yes|no)
    • Failed Login Attempts (number)
    • First / Middle / Last Name
    • {{crvm.formfields.Gender}}
    • {{crvm.formfields.HospitalId}}
    • Last Login (date)
    • Logged In (yes|no)
    • Name
    • Patient ID (number)
    • Phone / {{crvm.formfields.Phone1}} / {{crvm.formfields.Phone2}} (number)
    • Receive Email (yes|no)
    • Role
    • Show In Timelog (yes|no)
    • Site
    • {{crvm.formfields.Provider_Specialty}}
    • Third Party (yes|no)
    • {{crvm.formfields.TimeZoneId}}
    • Title
    • User Name

    Search supports the following operators: =, >, <, !, &, and |. Date fields also support relative date keywords: Today, Tomorrow, Yesterday, This Week, Last Week, This Month, Last Month, This Year, Last Year.

    ');\n}]);\n}(window, document, window.angular));","function CaregiversController(CaregiversService, $uibModal, isAll, AuthorizationService, $state, $scope, vhSweetAlert, WebFormFieldRepository) {\r\n var crvm = this;\r\n crvm.openPasswordModal = openPasswordModal;\r\n crvm.performSearch = performSearch;\r\n crvm.pageChanged = pageChanged;\r\n crvm.gotoCaregiver = gotoCaregiver;\r\n crvm.gotoNewCaregiver = gotoNewCaregiver;\r\n crvm.currentPage = 1;\r\n crvm.startCaregiver = 1;\r\n crvm.isAll = isAll;\r\n crvm.refresh = loadController;\r\n crvm.searchKeywords = searchKeywords;\r\n crvm.switchFilter = switchFilter;\r\n crvm.filterByText = '';\r\n\r\n setFilters();\r\n loadController();\r\n\r\n function loadController() {\r\n crvm.currentCaregiver = AuthorizationService.getCaregiver();\r\n\r\n if(crvm.isAll){\r\n\r\n CaregiversService.getCaregivers(crvm.pageSize,crvm.currentPage,crvm.searchText,crvm.sortOrder, crvm.activated)\r\n .then(function (data) {\r\n crvm.caregiversAll = data.Records;\r\n crvm.numCaregivers = data.TotalRecords;\r\n crvm.startCaregiver = Math.min(1,crvm.numCaregivers);\r\n crvm.endCaregiver = Math.min(crvm.pageSize,crvm.numCaregivers);\r\n });\r\n }\r\n else{\r\n crvm.caregiversAll = [crvm.currentCaregiver];\r\n crvm.numCaregivers = 1;\r\n crvm.endCaregiver = 1;\r\n }\r\n\r\n crvm.formfields = { };\r\n\r\n WebFormFieldRepository.get().then(function(fields) {\r\n for (let field of fields) {\r\n crvm.formfields[field.FieldName] = field.FieldLabel;\r\n }\r\n });\r\n }\r\n\r\n function setFilters() {\r\n var filter = CaregiversService.getSessionFilters();\r\n if (!filter) { filter = {} }\r\n crvm.pageSize = filter.pageSize || 25;\r\n crvm.searchText = filter.searchText || '';\r\n crvm.sortOrder = filter.sortOrder || 'Last Name';\r\n crvm.activated = filter.activated || 'true';\r\n crvm.filterByText = filter.filterByText || 'Active'\r\n }\r\n\r\n function saveFilters() {\r\n var filter = {\r\n pageSize: crvm.pageSize,\r\n searchText: crvm.searchText,\r\n sortOrder: crvm.sortOrder,\r\n activated: crvm.activated,\r\n filterByText: crvm.filterByText\r\n }\r\n CaregiversService.saveFiltersToSession(filter);\r\n }\r\n\r\n function gotoCaregiver(cg){\r\n $state.go('caregivers.caregiver', {caregiverId: cg.Id});\r\n }\r\n\r\n function gotoNewCaregiver(){\r\n $state.go('caregivers.create', {});\r\n }\r\n\r\n function searchKeywords(){\r\n vhSweetAlert({\r\n title: \"Search Keywords\",\r\n templateUrl: 'modules/caregivers/caregiver-search-keywords.tpl.html',\r\n scope: $scope\r\n });\r\n }\r\n\r\n function performSearch(){\r\n crvm.currentPage = 1;\r\n CaregiversService.getCaregivers(crvm.pageSize,crvm.currentPage,crvm.searchText,crvm.sortOrder, crvm.activated)\r\n .then(function (data) {\r\n crvm.lastSearch = crvm.searchText;\r\n crvm.sortOrder = crvm.sortOrder;\r\n crvm.activated = crvm.activated;\r\n handleData(data);\r\n saveFilters();\r\n });\r\n }\r\n\r\n function pageChanged(){\r\n if(crvm.lastSearch==undefined || crvm.lastSearch==\"\"){\r\n CaregiversService.getCaregivers(crvm.pageSize,crvm.currentPage,crvm.searchText,crvm.sortOrder, crvm.activated)\r\n .then(function (data) {\r\n handleData(data);\r\n saveFilters();\r\n });\r\n }\r\n else{\r\n CaregiversService.getCaregivers(crvm.pageSize,crvm.currentPage,crvm.lastSearch, crvm.sortOrder, crvm.activated)\r\n .then(function (data) {\r\n handleData(data);\r\n saveFilters();\r\n });\r\n }\r\n }\r\n\r\n function switchFilter(filterBy) {\r\n crvm.filterByText = filterBy;\r\n }\r\n\r\n function handleData(data){\r\n crvm.caregiversAll = data.Records;\r\n crvm.numCaregivers = data.TotalRecords;\r\n crvm.startCaregiver = Math.min((crvm.currentPage-1)*crvm.pageSize+1,crvm.numCaregivers);\r\n crvm.endCaregiver = Math.min(crvm.startCaregiver+crvm.pageSize-1,crvm.numCaregivers);\r\n }\r\n\r\n function openPasswordModal(caregiver) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/caregivers/changepassword.modal.html',\r\n controller: 'ChangePasswordModalController as vm',\r\n keyboard: false,\r\n resolve: {\r\n template: function() {\r\n return {\r\n Caregiver: caregiver\r\n };\r\n }\r\n }\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module(\"caregivers\").controller(\"CaregiversController\", CaregiversController);\r\n","function CaregiversService($http, $window, WebFormFieldRepository, Pluralize) {\r\n return {\r\n getCaregivers: function (pageSize, page, searchText, sortOrder, activated) {\r\n if (searchText == undefined) { searchText = \"\"; }\r\n if (sortOrder == undefined) { sortOrder = \"\"; }\r\n if (activated == undefined) { activated = \"\"; }\r\n return $http.get('/api/caregiver?pageSize=' + pageSize + '&page=' + page + '&searchText=' + encodeURIComponent(searchText) + '&sortOrder=' + encodeURIComponent(sortOrder) + '&activated=' + activated).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getCaregiverById: function (caregiverId, checkForVivifyUniversity) {\r\n\r\n if(caregiverId==undefined) {caregiverId=0;}\r\n return $http.get('/api/Caregiver/'+caregiverId + '/'+ (checkForVivifyUniversity === true)).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getCaregiverRoles: function (caregiverId) {\r\n if (caregiverId == undefined) { caregiverId = 0; }\r\n return $http.get('/api/Caregiver/' + caregiverId + '/roles').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n postCaregiver: function (caregiver) {\r\n if (caregiver.Id == undefined || caregiver.Id == 0) {\r\n return $http.post('/api/Caregiver', caregiver).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n else {\r\n return $http.put('/api/Caregiver/' + caregiver.Id, caregiver).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n },\r\n\r\n deleteCaregiver: function (caregiverId) {\r\n if (caregiverId == undefined) { caregiverId = 0; }\r\n return $http.delete('/api/Caregiver/' + caregiverId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getDefaultLogisticsMessages: function (caregiverId) {\r\n return $http.get('/api/Caregiver/GetDefaultLogisticsMessages').then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getAllSecurityRoles: function () {\r\n return $http.get('/api/SecurityRole').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n\r\n getTitles: function () {\r\n return $http.get('/api/CaregiverTitle').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n isTitleRequired: function () {\r\n return $http.get('/api/CaregiverTitle/IsRequired').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getSpecialties: function () {\r\n return $http.get('/api/CaregiverSpecialty').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getTimeZones: function () {\r\n return $http.get('/api/TimeZone').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getHospitals: function (caregiverId) {\r\n if (caregiverId == undefined) { caregiverId = 0; }\r\n return $http.get('/api/Hospital/' + caregiverId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getSites: function (caregiverId) {\r\n if (caregiverId == undefined) { caregiverId = 0; }\r\n return $http.get('/api/Site/User/' + caregiverId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getHospitalsLabel: function () {\r\n return WebFormFieldRepository.getByFieldName('HospitalId').then(function (fieldLabelModel) {\r\n return Pluralize(fieldLabelModel.FieldLabel);\r\n });\r\n },\r\n\r\n getAuthorizationModesForUser: function () {\r\n return $http.get('/api/AuthorizationMode').then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n saveFiltersToSession: function (filters) {\r\n $window.sessionStorage.setItem(\"caregiverfilters\", angular.toJson(filters));\r\n },\r\n\r\n getSessionFilters: function () {\r\n return angular.fromJson($window.sessionStorage.getItem(\"caregiverfilters\"));\r\n },\r\n\r\n resetSessionFilters: function () {\r\n $window.sessionStorage.setItem(\"caregiverfilters\", null);\r\n },\r\n\r\n IsHL7IdentExists: function (caregiverId, HL7Ident) {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/Caregiver/' + caregiverId,\r\n params: {\r\n HL7Ident: HL7Ident\r\n }\r\n })\r\n .then(function (response) {\r\n return response.data;\r\n })\r\n .catch(function () {\r\n return false;\r\n });\r\n },\r\n\r\n unlockCaregiver: function (caregiverId) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/Caregiver/' + caregiverId + '/Unlock'\r\n })\r\n .then(function (res) {\r\n return res.data;\r\n })\r\n .catch(function (err) {\r\n return false;\r\n });\r\n },\r\n\r\n getTwoFactorSecret: function () {\r\n return $http.get('/api/CaregiverTwoFactor').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getNewTwoFactorSecret: function () {\r\n return $http.get('/api/CaregiverTwoFactor/New').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n SaveTwoFactorSecret: function (data) {\r\n return $http.post('/api/CaregiverTwoFactor', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n SendTwoFactorCode: function (data) {\r\n return $http.post('/api/CaregiverTwoFactor/TestCode', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n deleteMyTwoFactor: function () {\r\n return $http.delete('/api/CaregiverTwoFactor').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n deleteTwoFactor: function (caregiverId) {\r\n return $http.delete('/api/CaregiverTwoFactor/' + caregiverId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n }\r\n}\r\n\r\nangular.module(\"caregivers\")\r\n .factory(\"CaregiversService\", CaregiversService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/caregivers/caregivers.tpl.html',\n '

    Care Team

    1. Viewing {{crvm.startCaregiver}}-{{crvm.endCaregiver}} of {{crvm.numCaregivers}}
    ');\n}]);\n}(window, document, window.angular));","function ChangePasswordModalController(template, $uibModalInstance, $sce, $scope, LoginService, $templateRequest, vhSweetAlert, AuthorizationService) {\r\n var vm = this;\r\n vm.template = template;\r\n vm.Caregiver = vm.template.Caregiver;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.setPasswordValidity = setPasswordValidity;\r\n vm.passRules = passRules;\r\n vm.Caregiver.ExpirePasswordNow = false;\r\n vm.isLoggedInUser = vm.Caregiver.Id == AuthorizationService.getCaregiver().Id;\r\n vm.errorMessage = '';\r\n vm.currentpassword = '';\r\n vm.passwordDontMatch = false;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n }\r\n\r\n function setPasswordValidity(){\r\n $scope.changepassword.password2.$setValidity(\"confirmation\",vm.password1==vm.password2);\r\n if(vm.password1 !== vm.password2) {\r\n vm.passwordDontMatch = true;\r\n } else {\r\n vm.passwordDontMatch = false;\r\n }\r\n\r\n vm.errorMessages = LoginService.validateNewPassword(vm.Caregiver.User_Name,vm.password1);\r\n $scope.changepassword.password1.$setValidity(\"validation\",vm.errorMessages.length==0);\r\n }\r\n\r\n function passRules(){\r\n vhSweetAlert({\r\n title: \"New Password\",\r\n templateUrl: 'modules/authorization/login/password-expired.rules.tpl.html'\r\n });\r\n }\r\n\r\n function validate(){\r\n return !$scope.changepassword.$invalid;\r\n }\r\n\r\n function ok() {\r\n vm.isSubmitting=true;\r\n vm.isSubmitted=true;\r\n if (validate()) {\r\n var request = {\r\n Password: vm.currentpassword,\r\n NewPassword: vm.password1,\r\n ExpireNow: vm.Caregiver.ExpirePasswordNow\r\n };\r\n\r\n AuthorizationService.changePassword(vm.Caregiver, request).then(function (response) {\r\n if (response.IsPasswordChangeSuccessful && response.ErrorMessage.length == 0) {\r\n //password successfully changed by admin permissions user\r\n $uibModalInstance.close(template);\r\n } else {\r\n vm.errorMessages.push(response.ErrorMessage);\r\n }\r\n });\r\n }\r\n vm.isSubmitting=false;\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('caregivers').controller('ChangePasswordModalController', ChangePasswordModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/caregivers/changepassword.modal.html',\n '

    {{vm.Caregiver.DisplayName}}

    0}\" ng-show=\"vm.errorMessages.length > 0\">
    {{error}}
    Passwords do not match
    ');\n}]);\n}(window, document, window.angular));","function EditCaregiverModalController(caregiver, $state, $stateParams, CaregiversService, WebhooksService, $scope, $window, LoginService, $templateRequest, vhSweetAlert, PermissionService, lodash, AuthorizationService, SmoothScroll, AdditionalIdentifiers, ConfigurationsService) {\r\n var vm = this;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.getEnabledClass = getEnabledClass;\r\n vm.isHospitalsValid = isHospitalsValid;\r\n vm.isSitesValid = isSitesValid;\r\n vm.file_changed = file_changed;\r\n vm.setPasswordValidity = setPasswordValidity;\r\n vm.passRules = passRules;\r\n vm.clearFields = clearFields;\r\n vm.filename_changed = filename_changed;\r\n vm.isHideText = isHideText;\r\n vm.maxImageDim = 100;\r\n vm.previous_filename = \"\";\r\n vm.Caregiver = {};\r\n vm.hospitalsLabel = 'Facilities';\r\n vm.errorMessages = [];\r\n vm.passwordConfirmErrors = [];\r\n vm.Photo = null;\r\n vm.hasCaregiverWrite = PermissionService.userHasPermission(['CaregiversWrite']);\r\n vm.hasHospitalsReadAll = PermissionService.userHasPermission(['HospitalsReadAll']);\r\n vm.hasSitesReadAll = PermissionService.userHasPermission(['SitesReadAll']);\r\n vm.facilityIsEditable = facilityIsEditable;\r\n vm.sitesIsEditable = sitesIsEditable;\r\n vm.passwordErrors = [];\r\n vm.AdditionalIdentifiers = AdditionalIdentifiers;\r\n vm.checkHL7Ident = checkHL7Ident;\r\n vm.ShowTwoFactorRequired = ConfigurationsService.configParams.TwoFactorLogin;\r\n vm.EmailAlertsForCareTeamMembersDefault = ConfigurationsService.EmailAlertsForCareTeamMembersDefault;\r\n\r\n // vivify university logic \r\n vm.enableUniversity = ConfigurationsService.configParams.VivifyUniversityEnabled;\r\n \r\n // -----------------------------\r\n\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.isNew = $stateParams.isNew;\r\n vm.caregiverId = $stateParams.caregiverId;\r\n vm.Caregiver = caregiver;\r\n vm.Caregiver.Gender = vm.Caregiver.Gender || 'Female';\r\n if (vm.Caregiver.Photo != undefined) {\r\n vm.Photo = vm.Caregiver.Photo;\r\n }\r\n setPhoto();\r\n if (vm.isNew) {\r\n //vm.Caregiver.AuthorizationModeId = 1;\r\n vm.Caregiver.ExpirePasswordNow = true;\r\n vm.Caregiver.ReceiveEmail = ConfigurationsService.configParams.EmailAlertsForCareTeamMembersDefault;\r\n vm.Caregiver.IsThirdParty = false;\r\n vm.Caregiver.IsShownInTimeLog = false;\r\n vm.Caregiver.TimeZoneId = 5;\r\n vm.Caregiver.TwoFactorRequired = ConfigurationsService.configParams.TwoFactorDefault;\r\n }\r\n\r\n CaregiversService.getSpecialties()\r\n .then(function (data) {\r\n vm.specialties = data;\r\n });\r\n\r\n CaregiversService.getTitles()\r\n .then(function (data) {\r\n vm.titles = data;\r\n if (vm.isNew) {\r\n const defaultTitle = vm.titles.find(title => title.IsDefault);\r\n if (defaultTitle) {\r\n vm.Caregiver.CaregiverTitleId = defaultTitle.Id;\r\n }\r\n }\r\n });\r\n\r\n CaregiversService.isTitleRequired()\r\n .then(function (data) {\r\n vm.isTitleRequired = true;\r\n });\r\n\r\n CaregiversService.getTimeZones()\r\n .then(function (data) {\r\n vm.zones = data;\r\n });\r\n\r\n CaregiversService.getHospitals(vm.caregiverId)\r\n .then(function (data) {\r\n vm.hospitals = data;\r\n if (vm.isNew) {\r\n for (var i = 0; i < vm.hospitals.length; i++) {\r\n vm.hospitals[i].IsAssigned = false;\r\n }\r\n }\r\n });\r\n\r\n CaregiversService.getSites(vm.caregiverId)\r\n .then(function (data) {\r\n vm.sites = data;\r\n if (vm.isNew) {\r\n for (var i = 0; i < vm.sites.length; i++) {\r\n vm.sites[i].IsAssigned = false;\r\n }\r\n }\r\n for (var i = 0; i < vm.sites.length; i++) {\r\n if (vm.sites[i].IsCurrent) {\r\n vm.sites[i].IsAssigned = true;\r\n }\r\n }\r\n });\r\n\r\n CaregiversService.getHospitalsLabel()\r\n .then(function (data) {\r\n vm.hospitalsLabel = data;\r\n })\r\n\r\n CaregiversService.getDefaultLogisticsMessages(vm.caregiverId)\r\n .then(function (data) {\r\n if (vm.isNew) {\r\n vm.Caregiver.ReceiveLogisticsMessages = data;\r\n }\r\n });\r\n\r\n CaregiversService.getAllSecurityRoles()\r\n .then(function (data) {\r\n vm.roles = data;\r\n vm.caregiverRoles = {};\r\n if (vm.isNew) {\r\n for (var i = 0; i < vm.roles.length; i++) {\r\n vm.caregiverRoles[vm.roles[i].SecurityRoleId] = false;\r\n }\r\n }\r\n else {\r\n var caregiverSecurityRoleIds = lodash.pluck(vm.Caregiver.SecurityRoles, \"SecurityRoleId\");\r\n angular.forEach(vm.roles, function (role) {\r\n vm.caregiverRoles[role.SecurityRoleId] = false;\r\n if (lodash.contains(caregiverSecurityRoleIds, role.SecurityRoleId)) {\r\n vm.caregiverRoles[role.SecurityRoleId] = true;\r\n }\r\n });\r\n }\r\n });\r\n\r\n CaregiversService.getAuthorizationModesForUser()\r\n .then(function (data) {\r\n vm.AuthorizationModes = data;\r\n\r\n var idx = -1;\r\n\r\n if (!vm.isNew) {\r\n idx = lodash.findIndex(data, { AuthorizationModeId: vm.Caregiver.AuthorizationModeId });\r\n } else {\r\n idx = lodash.findIndex(data, { ObjectName: 'PortalAuthorization' });\r\n }\r\n\r\n if (idx > -1) {\r\n vm.Caregiver.AuthorizationMode = data[idx];\r\n }\r\n });\r\n\r\n vm.Caregiver.CreateUniversityUser = vm.isNew ? vm.enableUniversity && ConfigurationsService.configParams.VivifyUniversityUserDefault === true :\r\n vm.enableUniversity && vm.Caregiver.VivifyUniCreateDateUTC !== null && vm.Caregiver.VivifyUniSuspendDateUTC === null;\r\n\r\n }\r\n\r\n function toggleCreateUniversityUser(){\r\n if(vm.enableUniversity){\r\n vm.Caregiver.CreateUniversityUser = !vm.Caregiver.CreateUniversityUser;\r\n }\r\n }\r\n vm.toggleCreateUniversityUser = toggleCreateUniversityUser;\r\n\r\n function setPhoto() {\r\n vm.Caregiver.caregiverImage = vm.Caregiver.Photo;\r\n\r\n if (vm.Caregiver.caregiverImage === undefined || vm.Caregiver.caregiverImage === null || vm.Caregiver.caregiverImage.length < 1) {\r\n if (vm.Caregiver.Gender === \"Female\") {\r\n vm.Caregiver.caregiverImage = \"layout/img/female.png\";\r\n } else {\r\n vm.Caregiver.caregiverImage = \"layout/img/male.png\";\r\n }\r\n } else {\r\n vm.Caregiver.caregiverImage = \"data:image/png;base64,\" + vm.Caregiver.Photo;\r\n }\r\n }\r\n\r\n function facilityIsEditable() {\r\n var isEditable = false;\r\n if (vm.hasCaregiverWrite && (vm.hasHospitalsReadAll || AuthorizationService.getCaregiver().Id !== caregiver.Id)) {\r\n isEditable = true;\r\n }\r\n return isEditable;\r\n }\r\n\r\n function sitesIsEditable() {\r\n var isEditable = false;\r\n if (vm.hasCaregiverWrite && (vm.hasSitesReadAll || AuthorizationService.getCaregiver().Id !== caregiver.Id)) {\r\n isEditable = true;\r\n }\r\n return isEditable;\r\n }\r\n\r\n function getEnabledClass(isEnabled) { //toggle on or off the visual toggle switch\r\n var retVal = isEnabled ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n return retVal;\r\n }\r\n\r\n function clearFields() {\r\n vm.Photo = '';\r\n document.getElementById('photo').value = '';\r\n vm.Caregiver.Photo = \"\";\r\n }\r\n\r\n function isHideText() {\r\n return !document.getElementById('photo').value && !!vm.Photo;\r\n }\r\n\r\n function filename_changed() {\r\n filename = document.getElementById('photo').value;\r\n if (vm.previous_filename != undefined && vm.previous_filename.length > 0 && (filename == undefined || filename.length == 0)) {\r\n clearFields();\r\n }\r\n vm.previous_filename = filename;\r\n }\r\n $scope.filename_changed = function () {\r\n $scope.$apply(filename_changed);\r\n };\r\n\r\n function file_changed() {\r\n var header = vm.Photo.substring(0, vm.Photo.indexOf(',') + 1);\r\n\r\n if (header.indexOf(\"image\") != -1) {\r\n var sourceImage = new Image();\r\n sourceImage.src = vm.Photo;\r\n sourceImage.onload = function () {\r\n if (Math.max(sourceImage.width, sourceImage.height) > vm.maxImageDim) {\r\n //width=Math.min(sourceImage.width*vm.maxImageDim/sourceImage.height,sourceImage.width);\r\n if (sourceImage.height > sourceImage.width) {\r\n width = Math.round(sourceImage.width * vm.maxImageDim / sourceImage.height);\r\n height = vm.maxImageDim;\r\n }\r\n else {\r\n width = vm.maxImageDim;\r\n height = Math.round(sourceImage.height * vm.maxImageDim / sourceImage.width);\r\n }\r\n\r\n resizeImage(vm.Photo, width, height, function (dataURL) {\r\n var data = dataURL.substring(dataURL.indexOf(',') + 1, dataURL.length);\r\n vm.Caregiver.Photo = data;\r\n });\r\n }\r\n else {\r\n var data = vm.Photo.substring(vm.Photo.indexOf(',') + 1, vm.Photo.length);\r\n vm.Caregiver.Photo = data;\r\n }\r\n };\r\n\r\n }\r\n else {\r\n vm.Photo = \"\";\r\n }\r\n }\r\n\r\n function resizeImage(url, width, height, callback) {//resize data url\r\n var sourceImage = new Image();\r\n\r\n sourceImage.onload = function () {\r\n var canvas = document.createElement(\"canvas\");\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n canvas.getContext(\"2d\").drawImage(sourceImage, 0, 0, width, height);\r\n\r\n callback(canvas.toDataURL());\r\n }\r\n\r\n sourceImage.src = url;\r\n }\r\n\r\n function passRules() {\r\n vhSweetAlert({\r\n title: \"New Password\",\r\n templateUrl: 'modules/authorization/login/password-expired.rules.tpl.html'\r\n });\r\n }\r\n\r\n function isHospitalsValid() {\r\n if (vm.hospitals) {\r\n for (var i = 0; i < vm.hospitals.length; i++) {\r\n if (vm.hospitals[i].IsAssigned) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n function isSitesValid() {\r\n if (vm.sites) {\r\n for (var i = 0; i < vm.sites.length; i++) {\r\n if (vm.sites[i].IsAssigned) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n function setError(arr, err, isAdd) {\r\n var idx = arr.indexOf(err);\r\n if (isAdd) {\r\n if (idx === -1) {\r\n arr.unshift(err);\r\n }\r\n } else {\r\n if (idx > -1) {\r\n arr.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n function setPasswordValidity() {\r\n if (vm.Caregiver.AuthorizationMode.ObjectName !== 'VivifyAuthorization' && !vm.Caregiver.AuthorizationMode.IsExternal && vm.isNew) {\r\n var confirmErrors = [\r\n 'Password confirm in required.',\r\n 'Password does not match the confirm password.',\r\n 'Password is required.'\r\n ];\r\n\r\n vm.passwordErrors = LoginService.validateNewPassword(vm.Caregiver.User_Name || '', vm.Caregiver.Password);\r\n\r\n if (vm.Caregiver.Password === undefined || vm.Caregiver.Password.length === 0) {\r\n setError(vm.passwordErrors, confirmErrors[2], true);\r\n } else {\r\n setError(vm.passwordErrors, confirmErrors[2], false);\r\n }\r\n\r\n if (vm.confirm === undefined || vm.confirm.length === 0) {\r\n setError(vm.passwordConfirmErrors, confirmErrors[0], true);\r\n } else {\r\n setError(vm.passwordConfirmErrors, confirmErrors[0], false);\r\n }\r\n\r\n $scope.caregiverForm.passconfirm.$setValidity(\"confirm\", vm.confirm === vm.Caregiver.Password);\r\n\r\n if (vm.confirm !== vm.Caregiver.Password) {\r\n setError(vm.passwordConfirmErrors, confirmErrors[1], true);\r\n } else {\r\n setError(vm.passwordConfirmErrors, confirmErrors[1], false);\r\n }\r\n\r\n $scope.caregiverForm.CG_password.$setValidity(\"validation\", vm.passwordErrors.length == 0);\r\n }\r\n }\r\n\r\n function scrollToAnchor(anchor) {\r\n if (anchor) {\r\n SmoothScroll.scroll(anchor);\r\n }\r\n }\r\n\r\n function checkHL7Ident(hl7Ident) {\r\n CaregiversService.IsHL7IdentExists(vm.Caregiver.Id || 0, hl7Ident).then(function (data) {\r\n $scope.caregiverForm.HL7Ident.$setValidity('exists', !data);\r\n });\r\n }\r\n\r\n function ok() {\r\n setPasswordValidity();\r\n $scope.caregiverForm.$setSubmitted();\r\n if ($scope.caregiverForm.$invalid) {\r\n var errorType = Object.keys($scope.caregiverForm.$error)[0];\r\n if (errorType) {\r\n scrollToAnchor($scope.caregiverForm.$error[errorType][0].$name);\r\n }\r\n return false;\r\n }\r\n\r\n if (!isHospitalsValid()) {\r\n scrollToAnchor('facilities');\r\n return false;\r\n }\r\n\r\n if (!isSitesValid()) {\r\n scrollToAnchor('sites');\r\n return false;\r\n }\r\n\r\n vm.Caregiver.SecurityRoles = [];\r\n for (var i = 0; i < vm.roles.length; i++) {\r\n if (vm.caregiverRoles[vm.roles[i].SecurityRoleId]) {\r\n vm.Caregiver.SecurityRoles.push({ SecurityRoleId: vm.roles[i].SecurityRoleId });\r\n }\r\n }\r\n\r\n vm.Caregiver.CaregiverHospitals = [];\r\n for (var i = 0; i < vm.hospitals.length; i++) {\r\n if (vm.hospitals[i].IsAssigned) {\r\n vm.Caregiver.CaregiverHospitals.push({ Id: vm.hospitals[i].Id });\r\n }\r\n }\r\n\r\n var caregiverPreSites = vm.Caregiver.CaregiverSites;\r\n\r\n vm.Caregiver.CaregiverSites = [];\r\n for (var i = 0; i < vm.sites.length; i++) {\r\n if (vm.sites[i].IsAssigned) {\r\n vm.Caregiver.CaregiverSites.push({ SiteId: vm.sites[i].SiteId });\r\n }\r\n }\r\n\r\n var caregiverPostSites = vm.Caregiver.CaregiverSites;\r\n\r\n caregiverCopy = angular.copy(vm.Caregiver);\r\n delete caregiverCopy.caregiverImage;\r\n\r\n caregiverCopy.AuthorizationModeId = caregiverCopy.AuthorizationMode.AuthorizationModeId;\r\n delete caregiverCopy.AuthorizationMode;\r\n\r\n return CaregiversService.postCaregiver(caregiverCopy)\r\n .then(function (data) {\r\n $scope.caregiverForm.$setPristine();\r\n\r\n if (vm.caregiverId == undefined || vm.caregiverId == 0) {\r\n $state.go('caregivers');\r\n } else {\r\n $state.go('caregivers.caregiver', { caregiverId: vm.caregiverId, successMessage: 'Changes have been saved!' }, { reload: true }).then(function () {\r\n if (caregiverPreSites.length !== caregiverPostSites.length\r\n && AuthorizationService.getCaregiver().Id === parseInt(vm.caregiverId)) {\r\n $window.location.reload();\r\n }\r\n });\r\n }\r\n }).catch(function (rejection) {\r\n if (rejection.status === 400) {\r\n rejection.preventDefault();\r\n if (rejection.data.ModelState) {\r\n vm.errorMessages = lodash.where(rejection.data.ModelState, function (o) {\r\n return o[0][0]; // returns first array item of each property in ModelState\r\n }).join(' ');\r\n } else {\r\n vm.errorMessages = rejection.data.ErrorMessage || 'Invalid data was submitted';\r\n }\r\n $window.scrollTo(0, 0);\r\n }\r\n });\r\n }\r\n\r\n function cancel() {\r\n $scope.caregiverForm.$setPristine();\r\n if (!vm.caregiverId || vm.caregiverId == 0) {\r\n $state.go('caregivers');\r\n } else {\r\n $state.go('caregivers.caregiver', { caregiverId: vm.caregiverId });\r\n }\r\n }\r\n}\r\nangular.module('caregivers').controller('EditCaregiverModalController', EditCaregiverModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/caregivers/editCaregiver.tpl.html',\n '
    0\"> Error! {{vm.errorMessages}}
    User Information
    \"image\"
    First Name is required
    Last Name is required
    Title is required
    Authorization Mode is required
    HL7 Identifier assigned to another caregiver
    Portal Information
    User Name is required
    {{vm.passwordErrors[0]}}
    {{vm.passwordConfirmErrors[0]}}
    0\" ng-click=\"vm.clearFields()\">
    One or more {{vm.hospitalsLabel}} must be assigned
    One or more Sites must be assigned
    Contact Information
    Email Address is required
    Mobile Phone is invalid
    Extension is invalid
    Other Phone is invalid
    Extension is invalid
    Notifications
    User Audit
    {{vm.Caregiver.CreatedDtUTC | date:vm.dateFormat}}
    {{vm.Caregiver.CreatedBy.DisplayName}}
    {{vm.Caregiver.LastEnabledDtUTC | date:vm.dateFormat}}  
    {{vm.Caregiver.LastDisabledDtUTC | date:vm.dateFormat}}  
    ');\n}]);\n}(window, document, window.angular));","function TwoFactorSetupModalController(caregiver, TwoFactorSecret, NewSecret, $uibModalInstance, CaregiversService, AuthorizationService, ConfigurationsService, loginPending) {\r\n var vm = this;\r\n vm.Caregiver = caregiver;\r\n vm.loginPending = loginPending;\r\n vm.Caregiver.TwoFactorSecret = TwoFactorSecret != null ? TwoFactorSecret : NewSecret;\r\n vm.ok = ok;\r\n vm.next = next;\r\n vm.back = back;\r\n vm.cancel = cancel;\r\n vm.isLoggedInUser = vm.Caregiver.Id == AuthorizationService.getCaregiver().Id;\r\n vm.errorMessage = '';\r\n vm.SelectedTypeId = 0;\r\n vm.wizardStep = 1;\r\n vm.code = '';\r\n vm.enableNextBtn = false;\r\n vm.onChange = onChange;\r\n vm.resendTestCode = resendTestCode;\r\n vm.doneBtnText = 'Done';\r\n\r\n vm.twoFactorUri = \"otpauth://totp/\" + vm.Caregiver.User_Name + \"?secret=\" + vm.Caregiver.TwoFactorSecret + \"&issuer=Vivify\";\r\n\r\n vm.helpUrl = ConfigurationsService.configParams.HelpUrl;\r\n vm.Help = vm.helpUrl.replace(\"Default.htm\", \"Content/A_Introduction%20Topics/MultiFactor%20Authentication.htm#Choosing\");\r\n vm.TotpHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/A_Introduction%20Topics/MultiFactor%20Authentication.htm#Authenti\");\r\n vm.SmsHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/A_Introduction%20Topics/MultiFactor%20Authentication.htm#Text\"); \r\n vm.EmailHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/A_Introduction%20Topics/MultiFactor%20Authentication.htm#Email\"); \r\n\r\n vm.TwoFactorTypes = [\r\n {\r\n Id : 2,\r\n Name : 'Time-based One-time Password (TOTP)'\r\n },\r\n {\r\n Id : 3,\r\n Name : 'Send Token via SMS'\r\n },\r\n {\r\n Id : 4,\r\n Name : 'Send Token via Email'\r\n }\r\n ]\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n if ( vm.loginPending ){\r\n // If Two-Factor setup is launched when user is logging in, then show text that user will have to\r\n // log in again after setting up Two-Factor\r\n vm.doneBtnText = 'Login';\r\n }\r\n }\r\n\r\n function onChange(){\r\n vm.errorMessage = '';\r\n vm.enableNextBtn = false;\r\n switch(vm.wizardStep){\r\n case 1:\r\n {\r\n if ( vm.SelectedTypeId != 0 ){\r\n vm.enableNextBtn = true;\r\n }\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.enableNextBtn = true;\r\n break;\r\n }\r\n case 3:\r\n {\r\n if (vm.code.length >= 6){\r\n vm.enableNextBtn = true;\r\n }\r\n break;\r\n }\r\n }\r\n SetFocus(); \r\n }\r\n\r\n function next(){\r\n switch(vm.wizardStep){\r\n case 1:\r\n {\r\n if ( vm.SelectedTypeId == 2 ){\r\n vm.wizardStep = 2;\r\n }\r\n else{\r\n SendTestCode();\r\n vm.code = '';\r\n vm.wizardStep = 3;\r\n }\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.code = '';\r\n vm.wizardStep = 3;\r\n break;\r\n }\r\n case 3:\r\n {\r\n TestAndSaveSecret();\r\n break;\r\n }\r\n } \r\n onChange();\r\n }\r\n\r\n function back(){\r\n vm.wizardStep--;\r\n if ( vm.SelectedTypeId != 2 && vm.wizardStep == 2){\r\n // SelectedTypeId 2 has an extra step, \r\n // so skip step 2 dor SelectedTypeId 3 and 4 so\r\n // Enter Code screen is step 3 for all three SelectedTypeId type\r\n vm.wizardStep = 1;\r\n } \r\n onChange();\r\n } \r\n\r\n function ok() {\r\n $uibModalInstance.close(data.TwoFactorTypeId);\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function TestAndSaveSecret(){\r\n data = {};\r\n data.TwoFactorTypeId = vm.SelectedTypeId;\r\n data.TwoFactorCode = vm.code;\r\n data.TwoFactorSecret = vm.Caregiver.TwoFactorSecret;\r\n CaregiversService.SaveTwoFactorSecret(data).then(function(response){\r\n if ( response == true){\r\n vm.wizardStep = 4;\r\n }\r\n else{\r\n vm.errorMessage = \"Code did not match\";\r\n SetFocus();\r\n }\r\n }); \r\n }\r\n\r\n function resendTestCode(){\r\n SendTestCode();\r\n if( vm.SelectedTypeId == 3){\r\n setTimeout(function(){\r\n document.getElementById(\"smsCode\").focus()\r\n },0);\r\n } else if( vm.SelectedTypeId == 4){\r\n setTimeout(function(){\r\n document.getElementById(\"emailCode\").focus()\r\n },0); \r\n } \r\n }\r\n\r\n function SendTestCode(){\r\n data = {};\r\n data.TwoFactorTypeId = vm.SelectedTypeId;\r\n data.TwoFactorCode = 0;\r\n data.TwoFactorSecret = vm.Caregiver.TwoFactorSecret;\r\n CaregiversService.SendTwoFactorCode(data).then(function(response){\r\n\r\n });\r\n }\r\n\r\n function SetFocus(){\r\n var inputId = null;\r\n if( vm.SelectedTypeId == 3){\r\n inputId = \"smsCode\";\r\n } \r\n else if( vm.SelectedTypeId == 4){\r\n inputId = \"emailCode\";\r\n } \r\n else if( vm.SelectedTypeId == 2){\r\n inputId = \"totpCode\";\r\n } \r\n\r\n if ( inputId != null ){\r\n setTimeout(function(){\r\n document.getElementById(inputId).focus()\r\n },0);\r\n }\r\n }\r\n}\r\nangular.module('caregivers').controller('TwoFactorSetupModalController', TwoFactorSetupModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/caregivers/twoFactorSetup.modal.html',\n '

    Two-Factor Login for {{vm.Caregiver.DisplayName}}

    Choose a Security Method

    Add extra security to your account with two-factor login. Each time you log in, we will ask for a second security code to be entered.

    Authentication App

    Set up an app like Google Authenticator or Microsoft Authenticator to generate login codes.

    Text Message

    We\\'ll text you a login code to
    {{vm.Caregiver.Phone1 | tel}}.

    Email Message

    We\\'ll email you a login code to
    {{vm.Caregiver.Email}}.

    Set up via Third Party Authenticator

    Please use your authentication app (such as Google Authenticator or Microsoft Authenticator) to scan this QR code.

    Or enter this code into your authentication app
    {{vm.Caregiver.TwoFactorSecret | code }}
    Enter Code

    Please enter the code you see on your authentication app.

    {{vm.errorMessage}}
    Enter Code

    Enter the 6-digit code we sent to {{vm.Caregiver.Phone1 | tel}} to finish setting up two-factor login.

    {{vm.errorMessage}}
    Enter Code

    Enter the 6-digit code we sent to {{vm.Caregiver.Email}} to finish setting up two-factor login.

    {{vm.errorMessage}}

    Two-Factor Login Is On

    We\\'ll now ask for a login code each time you log in.

    Now that Two-Factor Login is on, you will need to log in again.

    ');\n}]);\n}(window, document, window.angular));","function ViewCaregiverModalController(caregiver, $state, $stateParams, CaregiversService, PermissionService, AuthorizationService, $uibModal, vhSweetAlert, ConfigurationsService) {\r\n var vm = this;\r\n vm.Caregiver = caregiver;\r\n vm.Caregiver.Gender = vm.Caregiver.Gender || 'Female';\r\n vm.gotoEditCaregiver = gotoEditCaregiver;\r\n vm.openPasswordModal = openPasswordModal;\r\n vm.successMessage = $stateParams.successMessage;\r\n vm.caregiverId = $stateParams.caregiverId;\r\n vm.userCanEditCaregiverList = false;\r\n vm.userCanChangePassword = !vm.Caregiver.AuthorizationModeIsExternal;\r\n vm.unlockCaregiver = unlockCaregiver;\r\n vm.twoFactorBtnClicked = twoFactorBtnClicked;\r\n vm.dateFormat = \"EEE MMM d, yyyy HH:mm\";\r\n vm.hospitalsLabel = 'Facilities';\r\n vm.userIsSelf = vm.caregiverId == AuthorizationService.getCaregiver().Id;\r\n vm.TwoFactorLoginEnabled = ConfigurationsService.configParams.TwoFactorLogin;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n initTwoFactorButton();\r\n setPhoto();\r\n if (PermissionService.userHasPermission([\"CaregiversWrite\"]) || vm.userIsSelf) {\r\n vm.userCanEditCaregiverList = true;\r\n }\r\n\r\n if (ConfigurationsService.configParams.DateFormat.toLowerCase() === \"dd/mm/yyyy\") {\r\n vm.dateFormat = \"EEE d MMM, yyyy HH:mm\";\r\n }\r\n\r\n CaregiversService.getHospitalsLabel()\r\n .then(function (data) {\r\n vm.hospitalsLabel = data;\r\n });\r\n }\r\n\r\n\r\n function setPhoto() {\r\n vm.Caregiver.caregiverImage = vm.Caregiver.Photo;\r\n\r\n if (vm.Caregiver.caregiverImage === undefined || vm.Caregiver.caregiverImage === null || vm.Caregiver.caregiverImage.length < 1) {\r\n if (vm.Caregiver.Gender === \"Female\") {\r\n vm.Caregiver.caregiverImage = \"layout/img/female.png\";\r\n } else {\r\n vm.Caregiver.caregiverImage = \"layout/img/male.png\";\r\n }\r\n } else {\r\n vm.Caregiver.caregiverImage = \"data:image/png;base64,\" + vm.Caregiver.Photo;\r\n }\r\n }\r\n\r\n function gotoEditCaregiver(cg) {\r\n $state.go('caregivers.caregiver.edit', { caregiverId: vm.Caregiver.Id });\r\n }\r\n\r\n function openPasswordModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/caregivers/changepassword.modal.html',\r\n controller: 'ChangePasswordModalController as vm',\r\n keyboard: false,\r\n resolve: {\r\n template: function () {\r\n return {\r\n Caregiver: vm.Caregiver\r\n };\r\n }\r\n }\r\n });\r\n }\r\n\r\n function unlockCaregiver() {\r\n CaregiversService.unlockCaregiver(vm.Caregiver.Id).then(function (data) {\r\n if (data) {\r\n vm.Caregiver.ShowUnlockButton = false;\r\n } else {\r\n vhSweetAlert({\r\n title: 'Error',\r\n text: 'An error has occured'\r\n });\r\n }\r\n });\r\n }\r\n\r\n function openTwoFactorModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/caregivers/twoFactorSetup.modal.html',\r\n controller: 'TwoFactorSetupModalController as vm',\r\n size: 'lg',\r\n keyboard: false,\r\n backdrop: 'static',\r\n resolve: {\r\n caregiver: function () {\r\n return vm.Caregiver;\r\n },\r\n TwoFactorSecret: function () {\r\n return CaregiversService.getTwoFactorSecret();\r\n },\r\n NewSecret: function () {\r\n return CaregiversService.getNewTwoFactorSecret();\r\n },\r\n loginPending: function () {\r\n return false;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (data) {\r\n vm.Caregiver.TwoFactorTypeId = data;\r\n initTwoFactorButton();\r\n });\r\n }\r\n\r\n function resetTwoFactorModal() {\r\n var msg = 'By Resetting Two-Factor Login, this user will be prompted to setup Two-Factor Login the next time they log into the Care Team Portal.'\r\n if (vm.userIsSelf) {\r\n msg = 'By Resetting Two-Factor Login, you will be prompted to setup Two-Factor Login the next time you log into the Care Team Portal.'\r\n }\r\n\r\n vhSweetAlert.verify('Are you sure?', msg, 'Reset Two-Factor Login')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n if (vm.userIsSelf) {\r\n CaregiversService.deleteMyTwoFactor();\r\n } else {\r\n CaregiversService.deleteTwoFactor(vm.Caregiver.Id);\r\n }\r\n vm.Caregiver.TwoFactorTypeId = 1;\r\n initTwoFactorButton();\r\n }\r\n });\r\n }\r\n\r\n function turnoffTwoFactorModal() {\r\n vhSweetAlert.verify('Are you sure?', 'By turning off Two-Factor Login, you will no longer be prompted to enter a Two-Factor code when logging in.', 'Turn Off Two-Factor Login')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n if (vm.userIsSelf) {\r\n CaregiversService.deleteMyTwoFactor();\r\n } else {\r\n CaregiversService.deleteTwoFactor(vm.Caregiver.Id);\r\n }\r\n vm.Caregiver.TwoFactorTypeId = 1;\r\n initTwoFactorButton();\r\n }\r\n });\r\n }\r\n\r\n function twoFactorBtnClicked() {\r\n if (vm.Caregiver.TwoFactorTypeId != 1) {\r\n if (vm.Caregiver.TwoFactorRequired) {\r\n resetTwoFactorModal();\r\n } else {\r\n turnoffTwoFactorModal();\r\n }\r\n }\r\n else if (vm.userIsSelf && vm.Caregiver.TwoFactorTypeId == 1) {\r\n openTwoFactorModal();\r\n }\r\n }\r\n\r\n function initTwoFactorButton() {\r\n vm.twoFactorBtnText = '';\r\n\r\n if (vm.TwoFactorLoginEnabled) {\r\n if (vm.Caregiver.TwoFactorTypeId != 1) {\r\n if (vm.Caregiver.TwoFactorRequired) {\r\n vm.twoFactorBtnText = 'Reset Two-Factor Login';\r\n } else {\r\n vm.twoFactorBtnText = 'Turn off Two-Factor Login';\r\n }\r\n }\r\n else if (vm.userIsSelf && vm.Caregiver.TwoFactorTypeId == 1) {\r\n vm.twoFactorBtnText = 'Enable Two-Factor Login';\r\n }\r\n }\r\n else if (vm.Caregiver.TwoFactorTypeId != 1) {\r\n vm.twoFactorBtnText = 'Turn off Two-Factor Login';\r\n }\r\n }\r\n}\r\nangular.module('caregivers').controller('ViewCaregiverModalController', ViewCaregiverModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/caregivers/viewCaregiver.tpl.html',\n '
    User Information
    \"image\"

    {{vm.Caregiver.DisplayName}}

    0\">({{vm.Caregiver.SpecialtyName}})
    {{vm.Caregiver.Email}}
    0\">Mobile: {{vm.Caregiver.Phone1 | tel}}
    0\">Other: {{vm.Caregiver.Phone2 | tel}}
    {{vm.Caregiver.TimeZoneName}}
    0\">Authorization Mode: {{vm.Caregiver.AuthorizationModeName}}
    1\">Using Two Factor Authenication (APP) (SMS) (Email)
    0\">HL7 Identity: {{vm.Caregiver.HL7Ident}}

    {{vm.hospitalsLabel}}

    {{hospital.FacilityName}}

    Sites

    {{site.Name}}

    Roles

    {{role.Name}}
    Portal Information
    {{vm.Caregiver.User_Name}}
    {{vm.Caregiver.ReceiveEmail ? \\'Yes\\' : \\'No\\'}}
    {{vm.Caregiver.TwoFactorRequired ? \\'Yes\\' : \\'No\\'}}
    {{vm.Caregiver.IsThirdParty ? \\'Yes\\' : \\'No\\'}}
    {{vm.Caregiver.IsShownInTimeLog ? \\'Yes\\' : \\'No\\'}}
    {{vm.Caregiver.IsClinical ? \\'Yes\\' : \\'No\\'}}
    {{vm.Caregiver.ReceiveLogisticsMessages ? \\'Yes\\' : \\'No\\'}}
    {{vm.Caregiver.AuthorizationModeName}}  
    {{login | date:vm.dateFormat}}  
    {{vm.Caregiver.LastIntendedUseAgreement | date:vm.dateFormat}}  
    {{vm.Caregiver.LastConfidentialityAgreement | date:vm.dateFormat}}  
    {{vm.Caregiver.LastFailedLoginTimeUTC | date:vm.dateFormat}}  
    {{vm.Caregiver.FailedLoginAttempts}}  
    {{vm.Caregiver.PasswordLastResetUTC | date:vm.dateFormat}}  
    {{vm.Caregiver.VivifyUniUsername}}  
    {{vm.Caregiver.VivifyUniCreateDateUTC | date:vm.dateFormat}}  
    {{vm.Caregiver.VivifyUniSuspendDateUTC | date:vm.dateFormat}}  

     

     

    ');\n}]);\n}(window, document, window.angular));","function AlertTypeEditCtrl($scope, $uibModalInstance, alertType, severityLevels, alertClasses, AlertClass, AlertSeverityLevel) {\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.alertType = alertType;\r\n $scope.alertClasses = alertClasses;\r\n $scope.changeAlertClass = changeAlertClass;\r\n $scope.cancel = cancel;\r\n $scope.save = save;\r\n loadSeverityLevels();\r\n }\r\n\r\n function changeAlertClass(){\r\n if(alertType.AlertClassId == AlertClass.Notification) {\r\n alertType.AlertSeverityLevelId = AlertSeverityLevel.Notification;\r\n }\r\n else {\r\n alertType.AlertSeverityLevelId = AlertSeverityLevel.Medium;\r\n }\r\n loadSeverityLevels();\r\n }\r\n\r\n function loadSeverityLevels() {\r\n $scope.severityLevels = severityLevels.slice();\r\n if(alertType.AlertClassId == AlertClass.Alert) {\r\n $scope.severityLevels.splice(2,2); // remove None and N/A\r\n }\r\n }\r\n \r\n function cancel() {\r\n $uibModalInstance.close();\r\n }\r\n\r\n function save() {\r\n if($scope.alertTypeForm.$valid) {\r\n $uibModalInstance.close($scope.alertType);\r\n }\r\n }\r\n}\r\n\r\nangular.module('configurations.alerttypes').controller('AlertTypeEditCtrl', AlertTypeEditCtrl);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/alerttypes/alerttypeEdit.tpl.html',\n '

    Alert Type

    Enabled
    ');\n}]);\n}(window, document, window.angular));","function AlertTypesCtrl($uibModal, alerttypes, AlertType, AlertTypesService, PermissionService) {\r\n\r\n var vm = this;\r\n\r\n loadController();\r\n\r\n function loadController(){\r\n vm.alerttypes = alerttypes;\r\n vm.severityLevels = ['High', 'Medium', 'None', 'N/A'];\r\n vm.alertClasses = ['Alert', 'Notification'];\r\n vm.CanEdit = PermissionService.userHasPermission([\"AlertTypeWrite\"]);\r\n\r\n vm.openEdit = openEdit;\r\n vm.toggleEnabled = toggleEnabled;\r\n vm.canAlertTypeBeDisabled = canAlertTypeBeDisabled;\r\n }\r\n\r\n function toggleEnabled(alertType, $event) {\r\n alertType.IsEnabled = !alertType.IsEnabled;\r\n AlertTypesService.updateAlertType(alertType);\r\n $event.stopPropagation();\r\n }\r\n\r\n function openEdit(alertType) {\r\n alertType.canDisable = canAlertTypeBeDisabled(alertType);\r\n if (vm.CanEdit === false) {\r\n return;\r\n }\r\n $uibModal.open({\r\n controller: 'AlertTypeEditCtrl',\r\n templateUrl: 'modules/configurations/alerttypes/alerttypeEdit.tpl.html',\r\n size: 'mdsm',\r\n resolve: {\r\n alertType: function() {\r\n return Object.assign({}, alertType);\r\n },\r\n severityLevels: function() {\r\n return vm.severityLevels;\r\n },\r\n alertClasses: function() {\r\n return vm.alertClasses;\r\n }\r\n }\r\n }).result.then(function(alertType){\r\n if(alertType !== undefined) {\r\n AlertTypesService.updateAlertType(alertType).then(function(data){\r\n AlertTypesService.getAlertTypes().then(function(data) {\r\n vm.alerttypes = data;\r\n });\r\n });\r\n }\r\n });\r\n }\r\n\r\n function canAlertTypeBeDisabled(alertType) {\r\n switch(alertType.AlertTypeId) {\r\n case AlertType.General:\r\n case AlertType.SkipWeight:\r\n case AlertType.SkipBloodPressure:\r\n case AlertType.SkipBloodSugar:\r\n case AlertType.SkipPulse:\r\n case AlertType.SkipOxygen:\r\n case AlertType.SkipTemperature:\r\n case AlertType.SkipSpirometer:\r\n case AlertType.SkipSteps:\r\n return false;\r\n default:\r\n return true;\r\n }\r\n }\r\n}\r\n\r\nangular.module('configurations.alerttypes').controller('AlertTypesCtrl', AlertTypesCtrl);\r\n","function AlertTypesService($http) {\r\n\r\n var service = {\r\n getAlertTypes: getAlertTypes,\r\n updateAlertType: updateAlertType\r\n }\r\n\r\n return service; \r\n\r\n function getAlertTypes() {\r\n return $http.get('/api/alerttype?isConfigurable=true').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateAlertType(alertType) {\r\n return $http.put('/api/alerttype', alertType).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module('configurations.alerttypes').service('AlertTypesService', AlertTypesService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/alerttypes/alerttypes.tpl.html',\n '

    Alert Types

    Name

    Class

    Enabled

    Severity

    {{alertType.DisplayText}}
    {{vm.alertClasses[alertType.AlertClassId - 1]}}
    {{vm.severityLevels[alertType.AlertSeverityLevelId - 1]}}
    ');\n}]);\n}(window, document, window.angular));","function CurrentProceduralTerminologyCodeEditCtrl($scope, $rootScope, cptCode, careManagementTypes, cptCodeList, CurrentProceduralTerminologyCodesService, PermissionService) {\r\n\r\n $scope.cancel = cancel;\r\n $scope.save = save;\r\n $scope.swallowInput = swallowInput;\r\n $scope.isPositive = isPositive;\r\n \r\n loadController();\r\n\r\n function loadController() {\r\n $scope.isActive = true;\r\n $scope.cptCode = angular.copy(cptCode);\r\n $scope.careManagementTypes = careManagementTypes;\r\n $scope.readOnlyCareManagementType = (careManagementTypes.find(cmt => cmt.Id == cptCode.CareManagementTypeId) || {}).Acronym;\r\n $scope.canEdit = PermissionService.userHasPermission([\"CurrentProceduralTerminologyCodeWrite\"]);\r\n }\r\n\r\n function cancel() {\r\n $scope.cptCode = angular.copy(cptCode);\r\n $scope.cptCodeForm.$setPristine();\r\n $scope.cptCodeForm.$errors = [];\r\n }\r\n\r\n function save() {\r\n $scope.cptCodeForm.$errors = [];\r\n\r\n if ($scope.cptCodeForm.$valid && $scope.cptCode !== undefined) {\r\n // check if code in use\r\n if (cptCodeList.some(cpt => cpt.Code === $scope.cptCode.Code && cpt.CPTCodeId != $scope.cptCode.CPTCodeId)) {\r\n $scope.cptCodeForm.$errors.push('Code already exists');\r\n return;\r\n }\r\n\r\n return CurrentProceduralTerminologyCodesService.updateCurrentProceduralTerminologyCode($scope.cptCode).then(function(response) {\r\n $scope.cptCodeForm.$setPristine();\r\n cptCode = response[0];\r\n $scope.cptCode = angular.copy(cptCode);\r\n\r\n $rootScope.$emit('vh:cptCodeUpdated'); \r\n $scope.isActive = false;\r\n return response;\r\n });\r\n }\r\n }\r\n\r\n function swallowInput($event) {\r\n if ($event.key === '-') {\r\n $event.preventDefault();\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n function isPositive($event) {\r\n const regEx = /[a-zA-Z]/g;\r\n if ($event.originalEvent.clipboardData.getData('text/plain').includes('-') || regEx.test($event.originalEvent.clipboardData.getData('text/plain'))) {\r\n $event.preventDefault();\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\nangular.module('configurations.currentproceduralterminologycodes').controller('CurrentProceduralTerminologyCodeEditCtrl', CurrentProceduralTerminologyCodeEditCtrl);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/billingcodes/currentproceduralterminologycodeEdit.tpl.html',\n '
    Billing Code Details
    Required {{err}}

    {{criteria.Name | pascalSpacing}}: {{criteria.Value}}

    ');\n}]);\n}(window, document, window.angular));","function CurrentProceduralTerminologyCodesCtrl(cptCodeList, careManagementTypes, $rootScope, $uibModal, lodash, CurrentProceduralTerminologyCodesService) {\r\n\r\n var vm = this;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.cptCodeList = cptCodeList;\r\n vm.careManagementTypes = careManagementTypes;\r\n\r\n vm.orderChanged = orderChanged;\r\n vm.getAcronym = getAcronym;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged,\r\n accept: accept\r\n };\r\n\r\n $rootScope.$on('vh:cptCodeUpdated', getcptCodeList);\r\n }\r\n\r\n function accept(sourceItemHandleScope, destSortableScope, destItemScope) {\r\n return vm.canEdit && sourceItemHandleScope.sortableScope.modelValue[0].SiteId === destSortableScope.modelValue[0].SiteId;\r\n }\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n resort(list);\r\n CurrentProceduralTerminologyCodesService.updateAll(list);\r\n }\r\n\r\n function resort(list) {\r\n for(var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n }\r\n\r\n function getcptCodeList() {\r\n CurrentProceduralTerminologyCodesService.getCurrentProceduralTerminologyCodes().then(function (data) {\r\n vm.cptCodeList = data;\r\n\r\n cptCodeList.splice(0);\r\n cptCodeList.push(...data);\r\n });\r\n }\r\n\r\n function getAcronym(cmtId) {\r\n if (cmtId == null || !vm.careManagementTypes) return '';\r\n let result = vm.careManagementTypes.find(cmt => cmt.Id === cmtId);\r\n if (result != null) {\r\n return result.Acronym;\r\n }\r\n else {\r\n return '';\r\n }\r\n }\r\n}\r\n\r\nangular.module('configurations.currentproceduralterminologycodes')\r\n .controller('CurrentProceduralTerminologyCodesCtrl', CurrentProceduralTerminologyCodesCtrl);\r\n","function CurrentProceduralTerminologyCodesService(repository, lodash, $http) {\r\n\r\n var service = {\r\n getCurrentProceduralTerminologyCodes: getCurrentProceduralTerminologyCodes,\r\n createCurrentProceduralTerminologyCode: createCurrentProceduralTerminologyCode,\r\n updateCurrentProceduralTerminologyCode: updateCurrentProceduralTerminologyCode,\r\n updateAll: updateAll\r\n };\r\n\r\n var currentProceduralTerminologyCodeRepo = repository.new(\"CurrentProceduralTerminologyCode\");\r\n\r\n return service; \r\n\r\n function getCurrentProceduralTerminologyCodes() {\r\n return currentProceduralTerminologyCodeRepo.getList().then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function createCurrentProceduralTerminologyCode(currentProceduralTerminologyCode){\r\n return $http.post('/api/currentProceduralTerminologyCode', currentProceduralTerminologyCode).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateCurrentProceduralTerminologyCode(currentProceduralTerminologyCode){\r\n let list = [];\r\n list.push(currentProceduralTerminologyCode);\r\n return $http.put('/api/currentProceduralTerminologyCode', lodash.map(list, mapCurrentProceduralTerminologyCode))\r\n .then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateAll(currentProceduralTerminologyCodes){\r\n return $http.put('/api/currentProceduralTerminologyCode', lodash.map(currentProceduralTerminologyCodes, mapCurrentProceduralTerminologyCode))\r\n .then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function mapCurrentProceduralTerminologyCode(opt) {\r\n return {\r\n CPTCodeId: opt.CPTCodeId,\r\n Code: opt.Code,\r\n Description: opt.Description,\r\n IsEnabled: opt.IsEnabled,\r\n SortOrder: opt.SortOrder,\r\n FacilityFee: opt.FacilityFee,\r\n NonFacilityFee: opt.NonFacilityFee,\r\n CareManagementTypeId: opt.CareManagementTypeId\r\n };\r\n }\r\n}\r\n\r\nangular.module('configurations.currentproceduralterminologycodes').service('CurrentProceduralTerminologyCodesService', CurrentProceduralTerminologyCodesService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/billingcodes/currentproceduralterminologycodes.tpl.html',\n '

    Billing Codes

    Billing Codes
    {{cptCode.Code}} {{vm.getAcronym(cptCode.CareManagementTypeId)}}
    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/caregiverUpload/accordion-template.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","\r\nfunction CaregiverUploadController(vhSweetAlert, $uibModal, $state, CaregiverUploadService, ConfigurationsService, WebhooksService, PermissionService, $window, $scope, $filter) {\r\n var vm = this;\r\n vm.tab = 1;\r\n vm.headVisible = false;\r\n vm.cancel = cancel;\r\n vm.submit = submit;\r\n vm.loadLogList = loadLogList;\r\n vm.getDisplayTime = getDisplayTime;\r\n vm.downloadLog = downloadLog;\r\n vm.pageChanged = pageChanged;\r\n vm.numCellsEditing = 0;\r\n vm.currentPage = 1;\r\n vm.deleteEntry = deleteEntry;\r\n vm.submitEdit = submitEdit;\r\n vm.updateAffectedRecord = updateAffectedRecord;\r\n vm.getRoleNames = getRoleNames;\r\n vm.getSiteAndHospitalNames = getSiteAndHospitalNames;\r\n vm.isTitleRequired = false;\r\n vm.recordsSubmitted = false;\r\n //vm.ShowTwoFactorRequired = ConfigurationsService.configParams.TwoFactorLogin;\r\n vm.hasCaregiverWrite = PermissionService.userHasPermission(['CaregiversWrite']);\r\n vm.checkTitle = checkTitle;\r\n vm.setFormDirty = setFormDirty;\r\n vm.setFormPristine = setFormPristine;\r\n vm.getStatusIcon = getStatusIcon;\r\n vm.refreshRecords = refreshRecords;\r\n vm.pageSize = 25;\r\n vm.pageNumber = 1;\r\n vm.currentPage = 1;\r\n vm.done = done;\r\n vm.changedSort = changedSort;\r\n vm.validString = validString;\r\n vm.genders= ['Female', 'Male'];\r\n vm.openLogTab = openLogTab;\r\n\r\n loadData();\r\n setFilters();\r\n\r\n\r\n vm.setVivifyUniversityDefault = function () {\r\n ConfigurationsService.getConfig().then(function(){\r\n vm.enableUniversity = ConfigurationsService.configParams.VivifyUniversityEnabled;\r\n \r\n vm.data.Records.forEach(x => {\r\n if(x.VivifyUniversity === null){\r\n x.VivifyUniversity = vm.enableUniversity && ConfigurationsService.configParams.VivifyUniversityUserDefault === true;\r\n }\r\n });\r\n }); \r\n };\r\n\r\n\r\n function refreshRecords() {\r\n CaregiverUploadService.getCaregiverRecords(vm.data.CaregiverMassUploadLogId).then(function (data) {\r\n vm.data = data;\r\n vm.setVivifyUniversityDefault();\r\n })\r\n }\r\n\r\n function loadLogList() {\r\n if(vm.pageSize * (vm.currentPage - 1) > vm.numUploads)\r\n vm.currentPage = 1;\r\n CaregiverUploadService.getLogList(vm.pageSize, vm.currentPage, vm.sortOrder).then(function (data) {\r\n vm.logs = data.data.Records;\r\n vm.numUploads = data.data.TotalRecords;\r\n saveFilters();\r\n })\r\n }\r\n\r\n function getDisplayTime(time) {\r\n var timezone = moment.tz.guess();\r\n return moment(time).tz(timezone).format('M/D/YYYY, h:mm A z');\r\n }\r\n\r\n function checkTitle(data){\r\n if(vm.titles.includes(data) === false){\r\n return \"Invalid value\";\r\n }\r\n }\r\n\r\n function validString(data){\r\n if(data === null || data.match(/^\\s*$/) !== null){\r\n return \"Invalid value\";\r\n }\r\n }\r\n\r\n function setFormDirty(){\r\n $scope.emptyForm.$setDirty();\r\n vm.numCellsEditing++;\r\n }\r\n\r\n function setFormPristine(){\r\n if(vm.numCellsEditing === 1){\r\n $scope.emptyForm.$setPristine();\r\n }\r\n vm.numCellsEditing--;\r\n }\r\n\r\n function submitEdit(data, record) {\r\n vm.setFormPristine();\r\n CaregiverUploadService.updateRecord(record).then(function(affectedRecords) {\r\n affectedRecords.forEach(vm.updateAffectedRecord);\r\n });\r\n return true;\r\n }\r\n\r\n function deleteEntry(record) {\r\n vhSweetAlert.verify(\"Are you sure\", \"Are you sure you want to delete the following record and its contents?\").then(function (confirmed) {\r\n if (confirmed) {\r\n const index = vm.data.Records.indexOf(record);\r\n if (index > -1) {\r\n CaregiverUploadService.deleteRecord(record).then(function (affectedRecords) {\r\n affectedRecords.forEach(vm.updateAffectedRecord);\r\n // remove deleted record\r\n if(record.Status=='Ready')\r\n vm.data.CaregiversReady--;\r\n vm.data.Records.splice(index, 1);\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n function updateAffectedRecord(newRecord) {\r\n var currentRecordIndex = vm.data.Records.findIndex(rec => rec.CaregiverMassUploadRecordId === newRecord.CaregiverMassUploadRecordId);\r\n if(currentRecordIndex !== -1)\r\n {\r\n if(vm.data.Records[currentRecordIndex].Status !== newRecord.Status)\r\n newRecord.Status === 'Ready' ? vm.data.CaregiversReady++ : vm.data.CaregiversReady--;\r\n vm.data.Records[currentRecordIndex] = newRecord;\r\n }\r\n }\r\n\r\n function saveFilters() {\r\n var filter = {\r\n pageSize: vm.pageSize,\r\n }\r\n CaregiverUploadService.saveFiltersToSession(filter);\r\n }\r\n\r\n function pageChanged() {\r\n loadLogList();\r\n }\r\n\r\n function setFilters() {\r\n var filter = CaregiverUploadService.getSessionFilters();\r\n if (!filter) { filter = {} }\r\n vm.pageSize = filter.pageSize || 25;\r\n vm.sortOrder = filter.sortOrder || 'UploadDate DESC';\r\n }\r\n\r\n function changedSort(sortOrder) {\r\n vm.sortOrder = sortOrder;\r\n loadLogList();\r\n }\r\n\r\n function loadData() {\r\n CaregiverUploadService.getCaregiverRecords().then(function (data) {\r\n vm.data = data;\r\n vm.setVivifyUniversityDefault();\r\n });\r\n\r\n CaregiverUploadService.isTitleRequired().then(function(data) {\r\n vm.isTitleRequired = data;\r\n });\r\n\r\n CaregiverUploadService.getCaregiverHospitalsBySite().then(function (data) {\r\n vm.sites = data;\r\n for (var i = 0; i < vm.sites.length; i++) {\r\n vm.sites[i].IsAssigned = false;\r\n }\r\n });\r\n\r\n CaregiverUploadService.getAllSecurityRoles().then(function (data) {\r\n vm.roles = data;\r\n vm.caregiverRoles = {};\r\n for (var i = 0; i < vm.roles.length; i++) {\r\n vm.caregiverRoles[vm.roles[i].SecurityRoleId] = false;\r\n }\r\n });\r\n\r\n CaregiverUploadService.getTitles().then(function (data) {\r\n vm.titles = [];\r\n for (var i = 0; i < data.length; i++) {\r\n vm.titles.push(data[i].Name);\r\n }\r\n });\r\n\r\n CaregiverUploadService.getSpecialties().then(function (data) {\r\n vm.specialties = [];\r\n for (var i = 0; i < data.length; i++) {\r\n vm.specialties.push(data[i].Name);\r\n }\r\n });\r\n\r\n CaregiverUploadService.getTimeZones().then(function (data) {\r\n vm.timeZones = [];\r\n for (var i = 0; i < data.length; i++) {\r\n vm.timeZones.push({\r\n responseVal: data[i].Abbreviation,\r\n displayVal: data[i].DisplayValue,\r\n });\r\n }\r\n });\r\n\r\n }\r\n\r\n function cancel() {\r\n CaregiverUploadService.deleteCaregiverRecords().then(function () {\r\n vm.refreshRecords();\r\n });\r\n }\r\n\r\n function downloadLog(CaregiverMassUploadLogId) {\r\n CaregiverUploadService.getLogFile(CaregiverMassUploadLogId).then(function(data) {\r\n vm.log = data;\r\n })\r\n }\r\n\r\n function submit() {\r\n CaregiverUploadService.submit().then(function() {\r\n vm.recordsSubmitted = true;\r\n vm.refreshRecords();\r\n })\r\n }\r\n\r\n function getRoleNames(rolesString) {\r\n if (rolesString) {\r\n var roleIds = rolesString.split(\",\");\r\n var roleNames = [];\r\n roleIds.forEach(function(id) {\r\n roleNames.push(vm.roles.find(role => role.SecurityRoleId == id).Name);\r\n });\r\n return roleNames.join(\", \");\r\n }\r\n }\r\n\r\n function getSiteAndHospitalNames(sitesString, hospitalsString) {\r\n if (sitesString && hospitalsString) {\r\n var siteIds = sitesString.split(\",\");\r\n var hospitalIds = hospitalsString.split(\",\");\r\n var selectedSites = [];\r\n var siteStrings = [];\r\n siteIds.forEach(function(id) {\r\n selectedSites.push(vm.sites.find(site => site.SiteId == id));\r\n });\r\n for (var i = 0; i < selectedSites.length; i++) {\r\n var currentSite = selectedSites[i];\r\n var selectedHospitalNames = [];\r\n currentSite.Hospitals.forEach(function (hospital) {\r\n if (hospitalIds.includes(hospital.Id.toString())) {\r\n selectedHospitalNames.push(hospital.FacilityName);\r\n }\r\n })\r\n siteStrings.push(currentSite.Name + \": \" + selectedHospitalNames.join(\", \"));\r\n }\r\n return siteStrings.join(\"\\n\");\r\n }\r\n }\r\n\r\n function getStatusIcon(status) {\r\n if (status === 'Failed'){\r\n return 'fa fa-times-circle fa-2x';\r\n }\r\n if (status === 'Processing' || status === 'Pending'){\r\n return 'fa fa-spinner fa-pulse fa-check fa-2x';\r\n }\r\n if(status === 'Success'){\r\n return 'fa fa-check-circle fa-2x';\r\n }\r\n }\r\n\r\n function done() {\r\n clearData();\r\n openLogTab();\r\n }\r\n\r\n function openLogTab() {\r\n vm.tab = 2;\r\n loadLogList();\r\n }\r\n\r\n function clearData() {\r\n vm.data.Records = [];\r\n vm.data.CaregiverMassUploadLogId = 0;\r\n vm.recordsSubmitted = false;\r\n }\r\n\r\n vm.openUploadModal = openUploadModal;\r\n function openUploadModal(fileAlreadyUploaded) {\r\n var dlg = $uibModal.open({\r\n templateUrl: 'modules/configurations/caregiverUpload/caregiverUpload.modal.html',\r\n controller: 'UploadModalController as vm',\r\n windowClass: 'upload-modal-window',\r\n backdrop: 'static',\r\n size: 'lg',\r\n resolve: {\r\n isFileAlreadyUploaded: function() {\r\n return fileAlreadyUploaded;\r\n },\r\n logSettings: function() {\r\n return vm.data.Settings;\r\n }\r\n }\r\n })\r\n dlg.result.then(function(value) {\r\n if(value)\r\n {\r\n clearData();\r\n refreshRecords();\r\n }\r\n })\r\n }\r\n\r\n}\r\n\r\nangular.module(\"configurations.caregiverUpload\").controller(\"CaregiverUploadController\", CaregiverUploadController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/caregiverUpload/caregiverUpload.modal.html',\n '

    Upload


    Download Template File

    Edit Selected Values

    Please select a file.
    The parameters below will be applied to all records within the file.
    {{vm.errorMessage}}
    {{vm.passwordErrors[0]}}
    At least one Facility and one Site must be assigned.
    ');\n}]);\n}(window, document, window.angular));","function CaregiverUploadService($http, $window, FileUploader) {\r\n\r\n var FILTERKEY = 'CargiverMassUploadfilters';\r\n\r\n return {\r\n getCaregiverRoles: function (caregiverId) {\r\n if (caregiverId == undefined) { caregiverId = 0; }\r\n return $http.get('/api/Caregiver/' + caregiverId + '/roles').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getDefaultLogisticsMessages: function (caregiverId) {\r\n return $http.get('/api/Caregiver/GetDefaultLogisticsMessages').then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n getAllSecurityRoles: function () {\r\n return $http.get('/api/SecurityRole').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n isTitleRequired: function () {\r\n return $http.get('/api/CaregiverTitle/IsRequired').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getTitles: function () {\r\n return $http.get('/api/CaregiverTitle').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getSpecialties: function () {\r\n return $http.get('/api/CaregiverSpecialty').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getTimeZones: function () {\r\n return $http.get('/api/TimeZone').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getFileUploader: function () {\r\n var fileUploader = new FileUploader({\r\n url: '/api/CaregiverMassUpload'\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function (item, options) {\r\n var type = item.type;\r\n return (type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || type === 'application/vnd.ms-excel' || type === \".csv\");\r\n }\r\n });\r\n fileUploader.filters.push({\r\n name: 'sizeFilter',\r\n fn: function (item, options) {\r\n var size = item.size;\r\n return (size <= 1000000); // file <= 1 mb\r\n }\r\n })\r\n\r\n return fileUploader;\r\n },\r\n getCaregiverRecords: function (logId = 0) {\r\n return $http.get('/api/CaregiverMassUpload/' + logId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n updateRecord: function(record) {\r\n return $http.put('/api/CaregiverMassUpload/UpdateRecord/' + record.CaregiverMassUploadRecordId, record).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n deleteRecord: function(record) {\r\n return $http.delete('/api/CaregiverMassUpload/DeleteRecord/' + record.CaregiverMassUploadRecordId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n updateLogSettings: function(settings) {\r\n return $http.put('/api/CaregiverMassUpload/UpdateLogSettings/', settings).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n deleteCaregiverRecords: function () {\r\n return $http.delete('/api/CaregiverMassUpload/').then(\r\n function (response) {\r\n return response\r\n }\r\n )\r\n },\r\n getLogList: function (pageSize, pageNumber, sortOrder) {\r\n return $http({\r\n methode: 'GET',\r\n url: '/api/CaregiverMassUpload/LogList',\r\n params: {\r\n pageSize: pageSize,\r\n pageNumber: pageNumber,\r\n sortBy: sortOrder,\r\n }\r\n }).then(function(response) {\r\n return response;\r\n }).catch(function (err) {\r\n return [];\r\n });\r\n },\r\n saveFiltersToSession: function(filters) {\r\n $window.sessionStorage.setItem(FILTERKEY, angular.toJson(filters));\r\n },\r\n getSessionFilters: function () {\r\n return angular.fromJson($window.sessionStorage.getItem(FILTERKEY));\r\n },\r\n submit: function () {\r\n return $http.put('/api/CaregiverMassUpload/Submit').then(\r\n function (response) {\r\n return response;\r\n });\r\n },\r\n getLogFile: function (id) {\r\n return $http({\r\n url: '/api/CaregiverMassUpload/ExportedResults/' + id,\r\n method: 'GET',\r\n responseType: 'arraybuffer'\r\n }).then(function ({data, status, headers, config}) {\r\n var file = new Blob([data]);\r\n var fileName = headers('Content-Disposition').split('=')[1];\r\n var fileURL = URL.createObjectURL(file);\r\n var link = $window.document.createElement('a');\r\n link.href = fileURL;\r\n link.target = '_blank';\r\n link.download = fileName;\r\n $window.document.body.appendChild(link);\r\n link.click();\r\n });\r\n },\r\n getTemplateFile: function (id) {\r\n return $http({\r\n url: '/api/CaregiverMassUpload/UploadTemplate/',\r\n method: 'GET',\r\n responseType: 'arraybuffer'\r\n }).then(function ({data, status, headers, config}) {\r\n var file = new Blob([data]);\r\n var fileName = headers('Content-Disposition').split('=')[1];\r\n var fileURL = URL.createObjectURL(file);\r\n var link = $window.document.createElement('a');\r\n link.href = fileURL;\r\n link.target = '_blank';\r\n link.download = fileName;\r\n $window.document.body.appendChild(link);\r\n link.click();\r\n });\r\n },\r\n getCaregiverHospitalsBySite: function() {\r\n return $http.get('/api/CaregivermassUpload/CaregiverHospitalsBySite').then(function(response) {\r\n return response.data;\r\n })\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"configurations\")\r\n .factory(\"CaregiverUploadService\", CaregiverUploadService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/caregiverUpload/caregiverUpload.tpl.html',\n '

    Care Team Member Upload Tool

    Refresh
    Please review the records below and correct any errors before submitting.
    Please review the records below before submitting.

    {{vm.data.CaregiversReady}} of {{vm.data.Records.length}} record(s) are ready to be created.
    For records submitted with errors, the system will attempt to default values based on the system settings. Records with errors in required fields will not be created unless corrected.

    Displaying instances of records.

    The records were submitted.

    Selected Values
    Default Password{{vm.data.Settings.Password}}
    Require Two-Factor Login{{vm.data.Settings.TwoFactorRequired}}
    Third Party Caregiver{{vm.data.Settings.IsThirdParty}}
    Show Time in Time Logs{{vm.data.Settings.IsShownInTimeLog}}
    Receive Email Alerts{{vm.data.Settings.ReceiveEmail}}
    Receive Logistics Messages{{vm.data.Settings.ReceiveLogisticsMessages}}
    Roles{{vm.getRoleNames(vm.data.Settings.Roles)}}
    Sites and Facilities{{vm.getSiteAndHospitalNames(vm.data.Settings.Sites, vm.data.Settings.Hospitals)}}
    0\" class=\"table table-bordered table-scroll\" ng-class=\"{\\'processing-table\\': vm.recordsSubmitted, \\'table-scroll\\': !vm.recordsSubmitted}\">
    StatusFirst NameLast NameTitleSpecialtyGenderHL7 IdentEmail AddressMobile PhoneOther PhoneTime ZoneUsernameVivify University
    {{record.Status}}
    {{record.First_Name || \" \"}}
    {{record.Last_Name || \" \"}}
    {{record.Title || \" \"}}
    {{record.Specialty || \" \"}}
    {{record.Gender || \" \"}}
    {{record.HL7Ident || \" \"}}
    {{record.Email || \"  \"}}
    {{record.Phone1 ||\"  \"}}
    {{record.Phone2 || \"  \"}}
    {{record.TimeZone|| \" \"}}
    {{record.User_Name || \" \"}}
    {{record.VivifyUniversity || false}}
    No current upload found. Upload a new file to get started.
    No previous uploads found
    0\" class=\"table log-table\" style=\"table-layout: fixed;\">
    StatusDateUploaded ByUploaded File# Users Attempted# Users CreatedExported Results
    {{log.Status}}{{vm.getDisplayTime(log.CreatedDateTime_UTC)}}{{ log.CreatedBy }}{{ log.FileName }}{{log.CaregiversAttempted}}{{log.CaregiversSuccessful}}
    No previous uploads found
    ');\n}]);\n}(window, document, window.angular));","function UploadModalController(isFileAlreadyUploaded, logSettings, $uibModalInstance, $scope, vhSweetAlert, CaregiverUploadService, ConfigurationsService, PermissionService, AuthorizationService, LoginService) {\r\n var vm = this;\r\n vm.isFileAlreadyUploaded = isFileAlreadyUploaded;\r\n vm.cancel = cancel;\r\n vm.saveUploadedFile = saveUploadedFile;\r\n vm.saveEditedLogSettings = saveEditedLogSettings;\r\n vm.defaultPassword = \"\";\r\n vm.IsThirdParty = false;\r\n vm.ReceiveEmail = false;\r\n vm.IsShownInTimeLog = false;\r\n ConfigurationsService.getConfig().then(configParams => vm.ShowTwoFactorRequired = configParams.TwoFactorLogin);\r\n ConfigurationsService.getConfig().then(configParams => vm.TwoFactorRequired = configParams.TwoFactorDefault);\r\n vm.hasCaregiverWrite = PermissionService.userHasPermission(['CaregiversWrite']);\r\n vm.hasHospitalsReadAll = PermissionService.userHasPermission(['HospitalsReadAll']);\r\n vm.hasSitesReadAll = PermissionService.userHasPermission(['SitesReadAll']);\r\n vm.facilityIsEditable = facilityIsEditable;\r\n vm.sitesIsEditable = sitesIsEditable;\r\n vm.getEnabledClass = getEnabledClass;\r\n vm.fileItem = null;\r\n vm.isFileUploading = false;\r\n vm.fileError = false;\r\n vm.isSitesValid = isSitesValid;\r\n vm.isHospitalsValid = isHospitalsValid;\r\n vm.passwordErrors = [];\r\n vm.setPasswordValidity = setPasswordValidity;\r\n vm.passRules = passRules;\r\n vm.fileUploader = CaregiverUploadService.getFileUploader();\r\n vm.openAccordion = openAccordion;\r\n vm.headerClicked = null;\r\n vm.downloadTemplate = downloadTemplate;\r\n\r\n loadData();\r\n\r\n function safeApply(fn) {\r\n var phase = $scope.$$phase;\r\n if (phase == '$apply' || phase == '$digest') {\r\n if (fn && (typeof (fn) === 'function')) {\r\n fn();\r\n }\r\n } else {\r\n setTimeout(()=>{ $scope.$apply(); }, 100);\r\n }\r\n };\r\n\r\n function openAccordion(site, event) {\r\n var isOpen = site.IsOpen;\r\n if (site.IsOpen) {\r\n if (!site.IsAssigned) {\r\n isOpen = false\r\n }\r\n }\r\n else {\r\n if (site.IsAssigned) {\r\n isOpen = true;\r\n }\r\n }\r\n event.stopPropagation();\r\n vm.sites.forEach(function (s) {\r\n s.IsOpen = false;\r\n })\r\n site.IsOpen = isOpen;\r\n safeApply();\r\n }\r\n\r\n loadData();\r\n\r\n function loadData() {\r\n CaregiverUploadService.isTitleRequired().then(function (reqTitle) {\r\n vm.importFileToolTip = \"The upload file must contain the following columns: First Name, Last Name, \" + (reqTitle ? \"Title, \" : \"\") + \"Email Address, Mobile Phone.\";\r\n });\r\n\r\n CaregiverUploadService.getCaregiverHospitalsBySite().then(function (data) {\r\n console.log(data);\r\n vm.sites = data;\r\n\r\n if (isFileAlreadyUploaded && logSettings && logSettings.Hospitals) {\r\n vm.selectedHospitals = logSettings.Hospitals.split(\",\");\r\n }\r\n vm.sites.forEach(function (site) {\r\n site.IsOpen = false;\r\n site.IsAssigned = false;\r\n if (isFileAlreadyUploaded && logSettings && vm.selectedHospitals) {\r\n site.Hospitals.forEach(function (hospital) {\r\n if (vm.selectedHospitals.includes(hospital.Id.toString())) {\r\n hospital.IsAssigned = true;\r\n }\r\n })\r\n }\r\n })\r\n\r\n if (isFileAlreadyUploaded && logSettings && logSettings.Sites) {\r\n logSettings.Sites.split(\",\").forEach(function (id) {\r\n vm.sites.find(site => site.SiteId === parseInt(id)).IsAssigned = true;\r\n });\r\n }\r\n\r\n $scope.$watch('vm.headerClicked', function () {\r\n if (vm.headerClicked === null)\r\n return;\r\n $scope.accordion.groups.forEach(function (group) {\r\n if (group.panelId === vm.headerClicked) {\r\n $scope.accordion.closeOthers(group);\r\n }\r\n })\r\n vm.headerClicked = null;\r\n })\r\n })\r\n\r\n CaregiverUploadService.getDefaultLogisticsMessages().then(function (data) {\r\n vm.ReceiveLogisticsMessages = data;\r\n if (isFileAlreadyUploaded && logSettings)\r\n applyLogSettings();\r\n });\r\n\r\n CaregiverUploadService.getAllSecurityRoles().then(function (data) {\r\n vm.roles = data;\r\n vm.caregiverRoles = {};\r\n for (var i = 0; i < vm.roles.length; i++) {\r\n vm.caregiverRoles[vm.roles[i].SecurityRoleId] = false;\r\n }\r\n if (isFileAlreadyUploaded && logSettings && logSettings.Roles) {\r\n logSettings.Roles.split(\",\").forEach(function (id) {\r\n vm.caregiverRoles[id] = true;\r\n });\r\n }\r\n });\r\n }\r\n\r\n function applyLogSettings() {\r\n vm.IsThirdParty = logSettings.IsThirdParty;\r\n vm.ReceiveEmail = logSettings.ReceiveEmail;\r\n vm.IsShownInTimeLog = logSettings.IsShownInTimeLog;\r\n vm.TwoFactorRequired = logSettings.TwoFactorRequired;\r\n vm.ReceiveLogisticsMessages = logSettings.ReceiveLogisticsMessages;\r\n vm.defaultPassword = logSettings.Password;\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.close(false);\r\n }\r\n\r\n function scrollToError(id) {\r\n document.getElementById(id).scrollIntoView();\r\n }\r\n \r\n function downloadTemplate(CaregiverMassUploadLogId) {\r\n CaregiverUploadService.getTemplateFile().then(function(data) {\r\n vm.log = data;\r\n })\r\n }\r\n\r\n function saveUploadedFile() {\r\n if (!validate())\r\n return;\r\n if (vm.fileItem) {\r\n saveSettings();\r\n\r\n vm.fileItem.formData = [{\r\n SettingsModel: JSON.stringify(vm.settingsModel)\r\n }];\r\n\r\n vm.fileItem.onBeforeUpload = function () {\r\n vm.isFileUploading = true;\r\n }\r\n\r\n vm.fileItem.onComplete = function (response, status, headers) {\r\n vm.isFileUploading = false;\r\n }\r\n\r\n vm.fileItem.onSuccess = function (response, status, headers) {\r\n $uibModalInstance.close(true);\r\n };\r\n\r\n vm.fileItem.onError = function (response, status, headers) {\r\n $scope.fileUploadForm.$setPristine();\r\n vm.fileError = true;\r\n if (status === 409) {\r\n if (response.ErrorMessage !== undefined) {\r\n vm.errorMessage = response.ErrorMessage;\r\n } else {\r\n vm.errorMessage = \"An error occurred while processing the file.\";\r\n }\r\n scrollToError('fileUpload');\r\n }\r\n }\r\n\r\n vm.fileItem.upload()\r\n }\r\n else return;\r\n }\r\n\r\n function saveEditedLogSettings() {\r\n if (!validate()) {\r\n return;\r\n }\r\n saveSettings();\r\n\r\n CaregiverUploadService.updateLogSettings(vm.settingsModel).then(function (data) {\r\n $uibModalInstance.close(true);\r\n }).catch(function (rejection) {\r\n if(rejection.status === 409) {\r\n rejection.preventDefault();\r\n vhSweetAlert.error(\"Error Editing Settings\", rejection.data.ErrorMessage).then(function(isConfirm) {\r\n if (isConfirm) {\r\n cancel();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n function saveSettings() {\r\n vm.selectedRoles = [];\r\n for (var i = 0; i < vm.roles.length; i++) {\r\n if (vm.caregiverRoles[vm.roles[i].SecurityRoleId]) {\r\n vm.selectedRoles.push(vm.roles[i].SecurityRoleId);\r\n }\r\n }\r\n\r\n vm.selectedHospitals = [];\r\n vm.selectedSites = [];\r\n for (var i = 0; i < vm.sites.length; i++) {\r\n if (vm.sites[i].IsAssigned) {\r\n vm.selectedSites.push(vm.sites[i].SiteId);\r\n vm.sites[i].Hospitals.forEach(function (hospital) {\r\n if (hospital.IsAssigned)\r\n vm.selectedHospitals.push(hospital.Id);\r\n })\r\n }\r\n }\r\n\r\n vm.settingsModel = {\r\n TwoFactorRequired: vm.TwoFactorRequired, IsThirdParty: vm.IsThirdParty, IsShownInTimeLog: vm.IsShownInTimeLog,\r\n ReceiveEmail: vm.ReceiveEmail, ReceiveLogisticsMessages: vm.ReceiveLogisticsMessages, Password: vm.defaultPassword,\r\n Roles: vm.selectedRoles.toString(), Hospitals: vm.selectedHospitals.toString(), Sites: vm.selectedSites.toString()\r\n };\r\n }\r\n\r\n function validate() {\r\n setPasswordValidity();\r\n $scope.fileUploadForm.$setSubmitted();\r\n if (isHospitalsValid() && isSitesValid() && !$scope.fileUploadForm.MassUpload_Password.$invalid) {\r\n return true;\r\n }\r\n else if ($scope.fileUploadForm.MassUpload_Password.$invalid) {\r\n scrollToError('password');\r\n }\r\n else if (!isHospitalsValid()) {\r\n scrollToError('facilities');\r\n }\r\n else if (!isSitesValid()) {\r\n scrollToError('sites');\r\n }\r\n return false;\r\n }\r\n\r\n function isHospitalsValid() {\r\n if (vm.sites) {\r\n for (var i = 0; i < vm.sites.length; i++) {\r\n var currentSite = vm.sites[i];\r\n if (!currentSite.Hospitals) // no hospitals that creator can see for this site.\r\n return true;\r\n for (var j = 0; j < currentSite.Hospitals.length; j++) {\r\n if (currentSite.Hospitals[j].IsAssigned) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n function isSitesValid() {\r\n if (vm.sites) {\r\n for (var i = 0; i < vm.sites.length; i++) {\r\n if (vm.sites[i].IsAssigned) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n function setPasswordValidity() {\r\n vm.passwordErrors = LoginService.validateNewPassword('', vm.defaultPassword);\r\n $scope.fileUploadForm.MassUpload_Password.$setValidity(\"validation\", vm.passwordErrors.length === 0);\r\n }\r\n\r\n function passRules() {\r\n vhSweetAlert({\r\n title: \"New Password\",\r\n templateUrl: 'modules/authorization/login/password-expired.rules.tpl.html'\r\n });\r\n }\r\n\r\n vm.fileUploader.onAfterAddingFile = function (fileItem) {\r\n vm.fileError = false;\r\n vm.fileItem = fileItem;\r\n }\r\n\r\n vm.fileUploader.onWhenAddingFileFailed = function (item, filter, options) {\r\n vm.fileUploader.clearQueue();\r\n vm.fileItem = null;\r\n vm.fileError = true;\r\n if (filter.name == \"typeFilter\") {\r\n vm.errorMessage = \"The upload file is not of type Excel or CSV.\";\r\n } else if (filter.name == \"sizeFilter\") {\r\n vm.errorMessage = \"The upload file exceeds the maximum file size of 1 MB\";\r\n } else {\r\n vm.errorMessage = \"The file could not be uploaded successfully\";\r\n }\r\n }\r\n\r\n function facilityIsEditable() {\r\n var isEditable = false;\r\n if (vm.hasCaregiverWrite && (vm.hasHospitalsReadAll || AuthorizationService.getCaregiver().Id !== undefined)) {\r\n isEditable = true;\r\n }\r\n return isEditable;\r\n }\r\n\r\n function sitesIsEditable() {\r\n var isEditable = false;\r\n if (vm.hasCaregiverWrite && (vm.hasSitesReadAll || AuthorizationService.getCaregiver().Id !== undefined)) {\r\n isEditable = true;\r\n }\r\n return isEditable;\r\n }\r\n\r\n function getEnabledClass(isEnabled) { //toggle on or off the visual toggle switch\r\n var retVal = isEnabled ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n return retVal;\r\n }\r\n\r\n function passRules(){\r\n vhSweetAlert({\r\n title: \"New Password\",\r\n templateUrl: 'modules/authorization/login/password-expired.rules.tpl.html'\r\n });\r\n }\r\n}\r\n\r\nangular.module(\"configurations.caregiverUpload\").controller(\"UploadModalController\", UploadModalController);","\r\nfunction CareManagementTypesController($scope, $uibModal, careManagementTypes, CareManagementTypesService) {\r\n var vm = this;\r\n\r\n vm.careManagementTypes = careManagementTypes;\r\n\r\n vm.dragListeners = {\r\n orderChanged: function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n \r\n for (var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n \r\n CareManagementTypesService.updateAll(list);\r\n }\r\n };\r\n\r\n vm.toggleIsClinicalTimeMeasured = function (model, $event) {\r\n $event.stopPropagation();\r\n model.IsClinicalTimeMeasured = !model.IsClinicalTimeMeasured;\r\n CareManagementTypesService.update(model);\r\n }\r\n\r\n vm.toggleIsEnabled = function (model, $event) {\r\n $event.stopPropagation();\r\n model.IsEnabled = !model.IsEnabled;\r\n CareManagementTypesService.update(model);\r\n }\r\n\r\n vm.getToggleClass = function(toggleValue) {\r\n return toggleValue ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n }\r\n\r\n vm.openEdit = function (careManagementType) {\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/careManagementTypes/careManagementTypesEdit.tpl.html',\r\n controller: 'CareManagementTypesEditController',\r\n controllerAs: 'vm',\r\n resolve: {\r\n careManagementType: () => angular.copy(careManagementType)\r\n }\r\n }).result.then(function (model) {\r\n if (!model) return;\r\n\r\n var idx = vm.careManagementTypes.indexOf(careManagementType);\r\n if (idx >= 0) {\r\n vm.careManagementTypes[idx] = model;\r\n }\r\n else {\r\n vm.careManagementTypes.push(model);\r\n }\r\n });\r\n }\r\n}\r\n\r\n\r\nfunction CareManagementTypesEditController($scope, $uibModalInstance, careManagementType, CareManagementTypesService) {\r\n var vm = this;\r\n\r\n vm.careManagementType = careManagementType || CareManagementTypesService.create();\r\n\r\n vm.save = function save() {\r\n vm.careManagementForm.$setSubmitted();\r\n \r\n if (vm.careManagementForm.$valid) {\r\n CareManagementTypesService.update(vm.careManagementType).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n\r\n vm.cancel = function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n}\r\n\r\n\r\nangular.module('configurations.careManagementTypes')\r\n .controller('CareManagementTypesController', CareManagementTypesController)\r\n .controller('CareManagementTypesEditController', CareManagementTypesEditController);\r\n","function CareManagementTypesService($http) {\r\n const resourceUrl = '/api/CareManagementType';\r\n const blankCareManagementType = {\r\n Name: '',\r\n Acronym: '',\r\n IsClinicalTimeMeasured: false,\r\n IsEnabled: true\r\n };\r\n\r\n function getResponseData(response) {\r\n return response.data;\r\n }\r\n\r\n return {\r\n create: () => Object.assign({}, blankCareManagementType),\r\n getAll: (enabledOnly) => $http.get(resourceUrl, { params: { enabledOnly: !!enabledOnly }}).then(getResponseData),\r\n update: (model) => $http.post(resourceUrl, model).then(getResponseData),\r\n updateAll: (list) => $http.put(resourceUrl, list).then(getResponseData)\r\n }\r\n}\r\n\r\nangular.module('configurations.careManagementTypes').factory('CareManagementTypesService', CareManagementTypesService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/careManagementTypes/careManagementTypes.tpl.html',\n '

    Care Management Types

    Acronym

    Name

    Clinical Time Measured

    Enabled

    {{careManagementType.Acronym}}
    {{careManagementType.Name}}
    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/careManagementTypes/careManagementTypesEdit.tpl.html',\n '

    {{vm.careManagementType.Id != null ? \\'Edit Care Management Type\\' : \\'Add Care Management Type\\'}}

    *Required
    *Required
    Clinical Time Measured
    Enabled
    ');\n}]);\n}(window, document, window.angular));","function ConfigurationsController(configurationContent, lodash, EditConfigurationsService, PermissionService, vhSweetAlert, $timeout, $uibModal, TagUtilities, AlertClass, ResourceLibraryService) {\r\n\r\n //#region Initialization \r\n var cvm = this;\r\n loadController();\r\n\r\n function loadController() {\r\n cvm.specialties = configurationContent.CaregiverSpecialties;\r\n cvm.caregiverTitles = configurationContent.CaregiverTitles;\r\n }\r\n //#endregion\r\n\r\n //#region Helper Functions\r\n function setParent(parentOption) {\r\n if(parentOption.options) {\r\n parentOption.options.forEach(function(childOption) {\r\n childOption.parent = parentOption;\r\n setParent(childOption);\r\n });\r\n }\r\n }\r\n\r\n cvm.cleanTag = function(tag) {\r\n return tag.replace(/[;,]/g, '');\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Pathway Alert Change Reasons\r\n cvm.hasPathwayAlertChangeReasonsRead = PermissionService.userHasPermission([\"ConfigurationPathwayAlertChangeReasonRead\"]);\r\n cvm.hasPathwayAlertChangeReasonsWrite = PermissionService.userHasPermission([\"ConfigurationPathwayAlertChangeReasonWrite\"]);\r\n if (cvm.hasPathwayAlertChangeReasonsWrite) {\r\n cvm.hasMessageInterventionsRead = true;\r\n }\r\n\r\n cvm.pathwayAlertChangeReasonsList = {\r\n id: \"pathwayAlertChangeReaons\",\r\n label: \"Pathway Alert Change Reasons\",\r\n labelhint: \"Character limit for message intervention is 300.\",\r\n description: \"List of reasons for pathway alert changes.\",\r\n icon: \"fa-sitemap\",\r\n default: \"first\",\r\n editable: cvm.hasPathwayAlertChangeReasonsWrite,\r\n enabled: true,\r\n optionsEditable: cvm.hasPathwayAlertChangeReasonsWrite,\r\n options: []\r\n };\r\n\r\n function mapPathwayAlertChangeReason(src) {\r\n return {\r\n icon: \"fa-bookmark-o\",\r\n editable: cvm.hasPathwayAlertChangeReasonsWrite,\r\n id: src.PathwayAlertChangeReasonId,\r\n label: src.Text,\r\n enabled: src.IsEnabled,\r\n sortOrder: src.SortOrder,\r\n programs: src.Programs\r\n };\r\n }\r\n\r\n function getPathwayAlertChangeReasonsList() {\r\n EditConfigurationsService.getPathwayAlertChangeReasons().then(function (data) {\r\n cvm.pathwayAlertChangeReasonsList.options = data.map(mapPathwayAlertChangeReason); //generalize mapMessageIntervention\r\n });\r\n }\r\n \r\n getPathwayAlertChangeReasonsList();\r\n\r\n function addPathwayAlertChangeReason(option) {\r\n var item = {\r\n PathwayAlertChangeReasonId: 0,\r\n Text: option.label,\r\n SortOrder: cvm.pathwayAlertChangeReasonsList.options.length,\r\n IsEnabled: option.enabled,\r\n Programs: option.programs\r\n };\r\n EditConfigurationsService.createPathwayAlertChangeReason(item).then(function(response) {\r\n getPathwayAlertChangeReasonsList();\r\n });\r\n } \r\n\r\n function updatePathwayAlertChangeReason(option) {\r\n var item = {\r\n PathwayAlertChangeReasonId: option.id,\r\n Text: option.label,\r\n SortOrder: option.sortOrder,\r\n IsEnabled: option.enabled,\r\n Programs: option.programs\r\n };\r\n EditConfigurationsService.updatePathwayAlertChangeReason(item).then(function (response) {\r\n getPathwayAlertChangeReasonsList();\r\n });\r\n }\r\n\r\n cvm.addPathwayAlertChangeReason = addPathwayAlertChangeReason;\r\n cvm.updatePathwayAlertChangeReason = updatePathwayAlertChangeReason;\r\n //#endregion\r\n\r\n //#region Patient Status\r\n var hasdeleteReasonListRead = PermissionService.userHasPermission([\"ConfigurationPatientStatusRead\"]);\r\n var monitoringStatusList = lodash.map(configurationContent.MonitoringStatuses, function (s) {\r\n return {\r\n id: s.Id,\r\n label: s.Status,\r\n icon: \"fa-bookmark-o\",\r\n enabled: !s.IsDeleted,\r\n editable: false,\r\n isDefault: s.IsDefault,\r\n sortOrder: s.SortOrder,\r\n canbackdate: s.CanBackDate,\r\n enableNotes: s.EnableNotes,\r\n requireNotes: s.RequireNotes,\r\n saveToMedicalHistory: s.SaveToMedicalHistory,\r\n writetochart: s.WriteToChart,\r\n options: lodash.map(s.StatusChangeReasons, function (r) {\r\n return {\r\n id: r.StatusChangeReasonId,\r\n label: r.Reason,\r\n icon: \"fa-bookmark-o\",\r\n enabled: r.IsEnabled,\r\n enableNotes: r.EnableNotes,\r\n requireNotes: r.RequireNotes,\r\n editable: true,\r\n sortOrder: r.SortOrder,\r\n isDefault: r.IsDefault,\r\n saveToMedicalHistory: r.SaveToMedicalHistory,\r\n options: lodash.map(r.StatusChangeSubReasons, function (sr) {\r\n return {\r\n id: sr.StatusChangeSubReasonId,\r\n label: sr.Reason,\r\n icon: \"fa-bookmark-o\",\r\n enabled: sr.IsEnabled,\r\n enableNotes: sr.EnableNotes,\r\n requireNotes: sr.RequireNotes,\r\n editable: true,\r\n sortOrder: sr.SortOrder,\r\n saveToMedicalHistory: sr.SaveToMedicalHistory\r\n };\r\n })\r\n };\r\n })\r\n };\r\n });\r\n\r\n cvm.patientStatusList = {\r\n id: \"status\",\r\n label: \"Patient Status\",\r\n labelhint: \"Character limit for status reason is 100.\",\r\n description: \"List of patient statuses with sub-status reason codes used to determine states and actions for a patient.\",\r\n icon: \"fa-sitemap\",\r\n default: \"invited\",\r\n editable: true,\r\n enabled: true,\r\n canread:hasdeleteReasonListRead,\r\n optionsEditable: true,\r\n options: monitoringStatusList\r\n };\r\n\r\n cvm.changedStatusReason = changedStatusReason;\r\n function changedStatusReason(changedStatusReason, forStatus) {\r\n var status = lodash.find(configurationContent.MonitoringStatuses, {Id: forStatus.id});\r\n var apiReason = lodash.find(status.StatusChangeReasons, {StatusChangeReasonId: changedStatusReason.id});\r\n apiReason.IsDefault = changedStatusReason.isDefault;\r\n apiReason.SortOrder = changedStatusReason.sortOrder;\r\n apiReason.Reason = changedStatusReason.label;\r\n apiReason.IsEnabled = changedStatusReason.enabled;\r\n apiReason.EnableNotes = changedStatusReason.enableNotes;\r\n apiReason.RequireNotes = changedStatusReason.requireNotes;\r\n apiReason.SaveToMedicalHistory = changedStatusReason.saveToMedicalHistory;\r\n EditConfigurationsService.updateStatusChangeReason(changedStatusReason.id, apiReason).then(function () {\r\n lodash.map(forStatus.options, function (o, i) {\r\n o.sortOrder = i + 1;\r\n });\r\n });\r\n }\r\n\r\n cvm.addedStatusChangeReason = addedStatusChangeReason;\r\n function addedStatusChangeReason(reasonLabel, option) {\r\n var maxSort = 0;\r\n for (var i = 0; i < option.options.length; i++) {\r\n if (option.options[i] && option.options[i].sortOrder && option.options[i].sortOrder > maxSort) {\r\n maxSort = option.options[i].sortOrder;\r\n }\r\n }\r\n var apiReason = {\r\n Reason: reasonLabel,\r\n SortOrder: maxSort + 1,\r\n IsEnabled: true,\r\n MonitoringStatusId: option.id,\r\n IsDefault: false\r\n };\r\n return EditConfigurationsService.addStatusChangeReason(apiReason).then(function (reason) {\r\n var status = lodash.find(configurationContent.MonitoringStatuses, {Id: option.id});\r\n status.StatusChangeReasons.push(reason);\r\n option.options.push({\r\n id: reason.StatusChangeReasonId,\r\n label: reason.Reason,\r\n icon: \"fa-bookmark-o\",\r\n enabled: reason.IsEnabled,\r\n editable: true,\r\n sortOrder: reason.SortOrder,\r\n isDefault: reason.IsDefault,\r\n options: []\r\n });\r\n });\r\n }\r\n\r\n cvm.changedStatusSubReason = changedStatusSubReason;\r\n function changedStatusSubReason(changedStatusSubReason, forReason) {\r\n var apiReason = lodash.find(lodash.map(configurationContent.MonitoringStatuses, m => m.StatusChangeReasons).flat(), {StatusChangeReasonId: forReason.id})\r\n var apiSubReason = lodash.find(apiReason.StatusChangeSubReasons, {StatusChangeSubReasonId: changedStatusSubReason.id});\r\n apiSubReason.SortOrder = changedStatusSubReason.sortOrder;\r\n apiSubReason.Reason = changedStatusSubReason.label;\r\n apiSubReason.IsEnabled = changedStatusSubReason.enabled;\r\n apiSubReason.EnableNotes = changedStatusSubReason.enableNotes;\r\n apiSubReason.RequireNotes = changedStatusSubReason.requireNotes;\r\n EditConfigurationsService.updateStatusChangeSubReason(apiSubReason.StatusChangeSubReasonId, apiSubReason).then(function () {\r\n lodash.map(apiReason.options, function (o, i) {\r\n o.sortOrder = i + 1;\r\n });\r\n });\r\n }\r\n\r\n cvm.addedStatusChangeSubReason = addedStatusChangeSubReason;\r\n function addedStatusChangeSubReason(reasonLabel, option) {\r\n var maxSort = 0;\r\n for (var i = 0; i < option.options.length; i++) {\r\n if (option.options[i] && option.options[i].sortOrder && option.options[i].sortOrder > maxSort) {\r\n maxSort = option.options[i].sortOrder;\r\n }\r\n }\r\n var apiSubReason = {\r\n Reason: reasonLabel,\r\n SortOrder: maxSort + 1,\r\n IsEnabled: true,\r\n StatusChangeReasonId: option.id\r\n };\r\n return EditConfigurationsService.addStatusChangeSubReason(apiSubReason).then(function (subReason) {\r\n var reason = lodash.find(lodash.map(configurationContent.MonitoringStatuses, m => m.StatusChangeReasons).flat(), {StatusChangeReasonId: option.id})\r\n reason.StatusChangeSubReasons.push(subReason);\r\n option.options.push({\r\n id: subReason.StatusChangeSubReasonId,\r\n label: subReason.Reason,\r\n icon: \"fa-bookmark-o\",\r\n enabled: subReason.IsEnabled,\r\n editable: true,\r\n sortOrder: subReason.SortOrder\r\n });\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region Skip Biometric Reading Reasons\r\n var hasskipBiometricTypesRead = PermissionService.userHasPermission([\"ConfigurationSkipBiometricRead\"]);\r\n cvm.skipBiometricTypes = {\r\n id: \"skipTypes\",\r\n label: \"Skip Biometric Reading Reasons\",\r\n description: \"List of reasons to skip a specific biometric reading.\",\r\n icon: \"fa-sitemap\",\r\n editable: false,\r\n enabled: true,\r\n optionsEditable: true,\r\n canread:hasskipBiometricTypesRead,\r\n options: [{\r\n id: \"bpSkip\",\r\n label: \"Skip Blood Pressure Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 1,\r\n options: mapSkips(configurationContent.BloodPressureSkipReasons),\r\n questionType: 2\r\n }, {\r\n id: \"pulseSkip\",\r\n label: \"Skip Pulse Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 2,\r\n options: mapSkips(configurationContent.PulseSkipReasons),\r\n questionType: 14\r\n }, {\r\n id: \"oxygenSkip\",\r\n label: \"Skip Oxygen Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 3,\r\n options: mapSkips(configurationContent.OxygenSkipReasons),\r\n questionType: 15\r\n }, {\r\n id: \"weightSkip\",\r\n label: \"Skip Weight Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 4,\r\n options: mapSkips(configurationContent.WeightSkipReasons),\r\n questionType: 4\r\n }, {\r\n id: \"glucometerSkip\",\r\n label: \"Skip Glucose Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 5,\r\n options: mapSkips(configurationContent.GlucoseSkipReasons),\r\n questionType: 1\r\n }, {\r\n id: \"thermometerSkip\",\r\n label: \"Skip Temperature Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 6,\r\n options: mapSkips(configurationContent.TemperatureSkipReasons),\r\n questionType: 11\r\n }, {\r\n id: \"spirometerSkip\",\r\n label: \"Skip Spirometer Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 7,\r\n options: mapSkips(configurationContent.SpirometerSkipReasons),\r\n questionType: 13\r\n }, {\r\n id: \"stepsSkip\",\r\n label: \"Skip Steps Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 7,\r\n options: mapSkips(configurationContent.StepsSkipReasons),\r\n questionType: 16\r\n }, {\r\n id: \"hba1cSkip\",\r\n label: \"Skip HbA1c Reasons\",\r\n icon: \"fa-stethoscope\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 7,\r\n options: mapSkips(configurationContent.HbA1cSkipReasons),\r\n questionType: 18\r\n }]\r\n };\r\n\r\n function mapSkips(list) {\r\n return lodash.map(list, function (r) {\r\n return {\r\n id: r.SkipBiometricReasonId,\r\n labels: lodash.map(r.SkipBiometricReasonTexts, mapSkipLabel),\r\n enabled: r.IsEnabled,\r\n editable: true,\r\n sortOrder: r.SortOrder,\r\n icon: \"fa-bookmark-o\",\r\n reason: r\r\n };\r\n });\r\n }\r\n\r\n function mapSkipLabel(skipReasonTextModel) {\r\n return {\r\n label: skipReasonTextModel.Text,\r\n languageId: skipReasonTextModel.LanguageId,\r\n text: skipReasonTextModel\r\n };\r\n }\r\n\r\n cvm.skipOptionAdded = skipOptionAdded;\r\n function skipOptionAdded(label, inItem) {\r\n var apiReason = {\r\n SurveyQuestionTypeId: inItem.questionType,\r\n SortOrder: inItem.options.length + 1,\r\n IsEnabled: true,\r\n SkipBiometricReasonTexts: [{\r\n Text: label,\r\n LanguageId: 1\r\n }]\r\n };\r\n\r\n return EditConfigurationsService.addSkipBiometricReason(apiReason).then(function (reason) {\r\n inItem.options.push({\r\n id: reason.SkipBiometricReasonId,\r\n labels: lodash.map(reason.SkipBiometricReasonTexts, mapSkipLabel),\r\n enabled: reason.IsEnabled,\r\n editable: true,\r\n sortOrder: reason.SortOrder,\r\n icon: \"fa-bookmark-o\",\r\n reason: reason,\r\n label: lodash.find(reason.SkipBiometricReasonTexts, {LanguageId: 1}).Text,\r\n languageId: 1\r\n });\r\n });\r\n }\r\n\r\n cvm.skipOptionChanged = skipOptionChanged;\r\n function skipOptionChanged(changedSuboption, inOption) {\r\n var reason = changedSuboption.reason;\r\n reason.IsEnabled = changedSuboption.enabled;\r\n reason.SortOrder = changedSuboption.sortOrder;\r\n reason.SkipBiometricReasonTexts = lodash.map(changedSuboption.labels, function (l) {\r\n var text = l.text || {LanguageId: changedSuboption.languageId};\r\n text.Text = l.label;\r\n return text;\r\n });\r\n EditConfigurationsService.updateSkipBiometricReason(reason.SkipBiometricReasonId, reason).then(function (response) {\r\n lodash.map(inOption.options, function (o, i) {\r\n o.sortOrder = i + 1;\r\n });\r\n changedSuboption.labels = lodash.map(response.SkipBiometricReasonTexts, mapSkipLabel);\r\n });\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Install Methods\r\n cvm.installMethodChanged = function (option, parent) {\r\n var originalOption = lodash.filter(cvm.installMethods.options, {id: option.id});\r\n var changedOption = originalOption[0];\r\n changedOption.Id = option.id;\r\n changedOption.Text = option.label;\r\n changedOption.SortOrder = option.sortOrder;\r\n changedOption.IsEnabled = option.enabled;\r\n changedOption.IsDefault = option.isDefault;\r\n EditConfigurationsService.updateInstallMethod(changedOption);\r\n };\r\n\r\n cvm.installMethods = {\r\n id: \"status22\",\r\n label: \"Install Methods\",\r\n description: \"Configure the order and text label that the user will see for install methods.\",\r\n icon: \"fa-sitemap\",\r\n default: \"first\",\r\n editable: true,\r\n enabled: true,\r\n optionsEditable: true,\r\n options: []\r\n };\r\n\r\n if( PermissionService.userHasPermission([\"InstallMethodConfigRead\",\"InstallMethodConfigWrite\"])){// Fixing Alexe's but that made it so this page ended up needing thse two permissions to load;\r\n EditConfigurationsService.getInstallMethods().then(mapInstallMethods);\r\n }\r\n\r\n function mapInstallMethods(response) {\r\n installMethods = response;\r\n for (var i = 0; i < response.length; i++) {\r\n var installMethod = response[i];\r\n\r\n var installOption = {\r\n id: installMethod.Id, label: installMethod.Text, sortOrder: installMethod.SortOrder, enabled: installMethod.IsEnabled, isDefault: installMethod.IsDefault, icon: \"fa-sitemap\", editable: true, questionType: 2,\r\n\r\n };\r\n cvm.installMethods.options[installOption.sortOrder - 1] = installOption;\r\n }\r\n }\r\n //#endregion\r\n\r\n //#region Provider Roles\r\n var hasProviderRoleRead = PermissionService.userHasPermission([\"ProviderRoleRead\"]);\r\n cvm.hasProviderRoleWrite = PermissionService.userHasPermission([\"ProviderRoleWrite\"]);\r\n \r\n cvm.primaryCaregiverRoles = {\r\n id: \"caregiverroles\",\r\n label: \"Provider Roles\",\r\n description: \"Configure the order and text label that the user will see for Provider Roles.\",\r\n icon: \"fa-sitemap\",\r\n default: \"first\",\r\n editable: true,\r\n enabled: true,\r\n optionsEditable: true,\r\n options: []\r\n };\r\n\r\n function mapPersonalCaregiverRole(role) {\r\n return {\r\n id: role.PersonalCaregiverRoleId,\r\n label: role.Text,\r\n sortOrder: role.SortOrder,\r\n enabled: role.Enabled,\r\n isDefault: role.IsDefault,\r\n customToggle: role.IsReferrer,\r\n icon: \"fa-sitemap\",\r\n editable: true\r\n };\r\n }\r\n\r\n if (hasProviderRoleRead || cvm.hasProviderRoleWrite) {\r\n EditConfigurationsService.getPrimaryCaregiverRoles().then(function (roles) {\r\n roles\r\n .map(mapPersonalCaregiverRole)\r\n .forEach(function (role) {\r\n cvm.primaryCaregiverRoles.options.push(role);\r\n });\r\n });\r\n }\r\n\r\n cvm.personalCaregiverRoleAdded = function (addedName) {\r\n var newRole = lodash.find(cvm.primaryCaregiverRoles.options, {'temp': true});\r\n\r\n var role = {\r\n Text: addedName,\r\n SortOrder: cvm.primaryCaregiverRoles.options.length + 1,\r\n IsDefault: false,\r\n IsReferrer: newRole.customToggle,\r\n Enabled: true\r\n };\r\n EditConfigurationsService.createPrimaryCaregiverRole(role).then(function (newRole) {\r\n cvm.primaryCaregiverRoles.options.push(mapPersonalCaregiverRole(newRole));\r\n });\r\n\r\n };\r\n\r\n cvm.personCaregiverRoleChanged = function () {\r\n\r\n var roles = cvm.primaryCaregiverRoles.options.map(function (option, i) {\r\n return {\r\n PersonalCaregiverRoleId: option.id,\r\n Text: option.label,\r\n SortOrder: i + 1,\r\n IsDefault: option.isDefault,\r\n IsReferrer: option.customToggle,\r\n Enabled: option.enabled\r\n };\r\n });\r\n\r\n EditConfigurationsService.updatePrimaryCaregiverRole(roles);\r\n };\r\n //#endregion\r\n\r\n //#region Comorbidities\r\n cvm.hasConfigComorbidityRead = PermissionService.userHasPermission([\"ConfigurationComorbidityRead\"]);\r\n cvm.hasConfigComorbidityWrite = PermissionService.userHasPermission([\"ConfigurationComorbidityWrite\"]);\r\n \r\n cvm.comorbiditiesList = {\r\n id: \"Comorbidities\",\r\n label: \"Comorbidities\",\r\n description: \"List of comorbidities that are relevant for patients in various clinical scenarios.\",\r\n icon: \"fa-sitemap\",\r\n default: \"first\",\r\n editable: true,\r\n enabled: true,\r\n optionsEditable: true,\r\n options: []\r\n };\r\n\r\n if (cvm.hasConfigComorbidityRead) {\r\n getComorbidityList();\r\n }\r\n \r\n if (cvm.hasConfigComorbidityWrite) {\r\n EditConfigurationsService.getTags().then(function(response) {\r\n cvm.tagList = response;\r\n })\r\n }\r\n\r\n function getComorbidityList() {\r\n return EditConfigurationsService.getComorbidityList().then(function(results) {\r\n cvm.comorbiditiesList.options = results.map(mapComorbidity);\r\n });\r\n }\r\n\r\n function mapComorbidity(opt) {\r\n return {\r\n id: opt.ComorbidityId,\r\n label: opt.Name,\r\n enabled: opt.IsEnabled,\r\n sortOrder: opt.SortOrder,\r\n tags: opt.Tags ? opt.Tags.split(';') : [],\r\n icon: \"fa-bookmark-o\",\r\n editable: true\r\n };\r\n }\r\n\r\n cvm.addComorbidity = function addComorbidity(name) {\r\n var item = {\r\n Name: name,\r\n SortOrder: cvm.comorbiditiesList.options.length,\r\n IsEnabled: true,\r\n Tags: null\r\n };\r\n var promise = EditConfigurationsService.updateComorbidity(item);\r\n promise.then(getComorbidityList);\r\n return promise;\r\n };\r\n\r\n cvm.updateComorbidity = function updateComorbidity(option) {\r\n var item = {\r\n ComorbidityId: option.id,\r\n Name: option.label,\r\n IsEnabled: option.enabled,\r\n SortOrder: option.sortOrder,\r\n Tags: null\r\n }\r\n if (option.tags && option.tags.length > 0) {\r\n item.Tags = TagUtilities.cleanUpTags(option.tags.join(';'));\r\n }\r\n var promise = EditConfigurationsService.updateComorbidity(item);\r\n return promise.then(function (response) {\r\n if (response == false) {\r\n return $timeout(function() {\r\n vhSweetAlert.error('Unable to disable', 'The comorbidity can\\'t be disabled');\r\n }, 100);\r\n }\r\n return response;\r\n });\r\n };\r\n\r\n //#endregion\r\n\r\n //#region Educational Materials\r\n var hasEducationalMaterialRead = PermissionService.userHasPermission([\"EducationalMaterialRead\"]);\r\n var hasEducationalMaterialWrite = PermissionService.userHasPermission([\"EducationalMaterialWrite\"]);\r\n\r\n cvm.educationalMaterialChanged = function (option, parent) {\r\n var originalOption = lodash.filter(cvm.EducationalMaterials.options, {id: option.id});\r\n var changedOption = originalOption[0];\r\n changedOption.EducationalMaterialId = option.id;\r\n changedOption.Name = option.label;\r\n changedOption.SortOrder = option.SortOrder;\r\n changedOption.Disabled = !option.enabled;\r\n EditConfigurationsService.updateEducationalMaterials(changedOption);\r\n };\r\n\r\n function addedEducationalMaterial(addedName, parent) {\r\n var EducationalMaterialObject = {\r\n CreatedBy_Id: \"\",\r\n CreatedDateTime_UTC: \"\",\r\n Disabled: \"\",\r\n Enabled: null,\r\n SortOrder: 0,\r\n editable: true,\r\n icon: \"fa fa-book\",\r\n label: \"\",\r\n selected: false,\r\n id: null\r\n };\r\n\r\n return EditConfigurationsService.addEducationalMaterial(addedName).then(function (result) {\r\n configurationContent.EducationalMaterialModels.push(result);\r\n EducationalMaterialObject.CreatedBy_Id = result.CreatedBy_Id;\r\n EducationalMaterialObject.CreatedDateTime_UTC = result.CreatedDateTime_UTC;\r\n EducationalMaterialObject.Disabled = result.Disabled;\r\n EducationalMaterialObject.enabled = !result.enabled;\r\n EducationalMaterialObject.label = result.Name;\r\n EducationalMaterialObject.SortOrder = result.SortOrder;\r\n EducationalMaterialObject.id = result.EducationalMaterialId;\r\n\r\n parent.push(EducationalMaterialObject);\r\n });\r\n\r\n\r\n }\r\n\r\n var eduMaterialsOptions = lodash.map(configurationContent.EducationalMaterialModels, function (ed) {\r\n return {\r\n CreatedBy_Id: ed.CreatedBy_Id,\r\n CreatedDateTime_UTC: ed.CreatedDateTime_UTC,\r\n Disabled: ed.Disabled,\r\n SortOrder: ed.SortOrder,\r\n label: ed.Name,\r\n icon: \"fa fa-book\",\r\n editable: true,\r\n enabled: !ed.Disabled,\r\n id: ed.EducationalMaterialId\r\n }\r\n });\r\n cvm.EducationalMaterials = {\r\n id: \"EducationalMaterials\",\r\n label: \"Educational Materials\",\r\n description: \"List of educational materials that should be included when shipping a kit.\",\r\n icon: \"fa-sitemap\",\r\n editable: true,\r\n enabled: true,\r\n options: eduMaterialsOptions,\r\n optionsEditable: true,\r\n hasRead: hasEducationalMaterialRead,\r\n hasWrite: hasEducationalMaterialWrite\r\n };\r\n cvm.addedEducationalMaterial = addedEducationalMaterial;\r\n //#endregion\r\n\r\n //#region Time Log Delete Reasons\r\n var hasdeleteReasonListRead = PermissionService.userHasPermission([\"ConfigurationDeleteReasonRead\"]);\r\n \r\n var deleteTimeLogReasons = lodash.map(configurationContent.DeleteTimeLogReasons, function (d) {\r\n return {\r\n id: d.DeleteTimeLogReasonId,\r\n label: d.Text,\r\n icon: \"fa-bookmark-o\",\r\n enabled: d.IsEnabled,\r\n isDefault: d.IsDefault,\r\n editable: true,\r\n sortOrder: d.SortOrder\r\n };\r\n });\r\n\r\n cvm.deleteReasonList = {\r\n id: \"deleteReasons\",\r\n label: \"Delete Reasons\",\r\n description: \"List of reasons for deleting an entry.\",\r\n icon: \"fa-sitemap\",\r\n editable: false,\r\n enabled: true,\r\n optionsEditable: true,\r\n canread:hasdeleteReasonListRead,\r\n options: [{\r\n id: \"timeLogReasons\",\r\n label: \"Time Log Reasons\",\r\n icon: \"fa-bookmark-o\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: 1,\r\n options: deleteTimeLogReasons\r\n }]\r\n };\r\n\r\n\r\n \r\n cvm.changedDeleteReason = changedDeleteReason;\r\n cvm.addedDeleteReason = addedDeleteReason;\r\n cvm.skipDirectiveLanguages = configurationContent.PatientLanguages;\r\n cvm.deleteReasonsConfig = {\r\n showSuboptions: true,\r\n optionsHaveDefault: false\r\n };\r\n\r\n function changedDeleteReason(changedReason, forOption) {\r\n if (forOption.id === 'timeLogReasons') {\r\n var apiReason = lodash.find(configurationContent.DeleteTimeLogReasons, {DeleteTimeLogReasonId: changedReason.id});\r\n\r\n apiReason.IsDefault = changedReason.isDefault;\r\n apiReason.SortOrder = changedReason.sortOrder;\r\n apiReason.Text = changedReason.label;\r\n apiReason.IsEnabled = changedReason.enabled;\r\n\r\n EditConfigurationsService.updateDeleteTimeLogReason(changedReason.id, apiReason).then(function () {\r\n lodash.map(forOption.options, function (o, i) {\r\n o.sortOrder = i + 1;\r\n });\r\n });\r\n }\r\n }\r\n\r\n function addedDeleteReason(reasonLabel, option) {\r\n if (option.id === 'timeLogReasons') {\r\n var apiReason = {\r\n Text: reasonLabel,\r\n SortOrder: option.options.length + 1,\r\n IsEnabled: true,\r\n IsDefault: false\r\n };\r\n return EditConfigurationsService.addDeleteTimeLogReason(apiReason).then(function (reason) {\r\n configurationContent.DeleteTimeLogReasons.push(reason);\r\n option.options.push({\r\n id: reason.DeleteTimeLogReasonId,\r\n label: reason.Text,\r\n icon: \"fa-bookmark-o\",\r\n enabled: reason.IsEnabled,\r\n editable: true,\r\n sortOrder: reason.SortOrder,\r\n isDefault: reason.IsDefault\r\n });\r\n });\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Biometric Thresholds Change Reasons\r\n var hasBiometricThresholdsChangeReasonsRead = PermissionService.userHasPermission([\"BiometricThresholdsChangeReasonsRead\"]);\r\n\r\n function changedBiometricThresholdsChangeReason(option) {\r\n var changedOption = {\r\n BiometricThresholdsChangeReasonId: option.id,\r\n Text: option.label,\r\n SortOrder: option.sortOrder,\r\n IsEnabled: option.enabled,\r\n IsDefault: option.isDefault,\r\n Programs: option.inputs.populations\r\n };\r\n EditConfigurationsService.updateBiometricThresholdsChangeReasons(changedOption);\r\n };\r\n\r\n function addedBiometricThresholdsChangeReasons(addedName, parent) {\r\n var apiReason = {\r\n Text: addedName.inputs.text,\r\n SortOrder: parent.options.length + 1,\r\n IsEnabled: true,\r\n IsDefault: false,\r\n Programs: addedName.inputs.populations\r\n };\r\n\r\n return EditConfigurationsService.addBiometricThresholdsChangeReason(apiReason).then(function (result) {\r\n configurationContent.BiometricThresholdsChangeReasons.push(result);\r\n lodash.remove(parent.options, {temp: true});\r\n result.Programs = apiReason.Programs;\r\n parent.options.push(mapReason(result));\r\n });\r\n }\r\n\r\n function biometricThresholdsChangeReasonsOptions() {\r\n return lodash.map(configurationContent.BiometricThresholdsChangeReasons, function (d) {\r\n return mapReason(d);\r\n });\r\n }\r\n\r\n function mapReason(reason) {\r\n var programs = [];\r\n if (reason.Programs && reason.Programs.length > 0) {\r\n programs = lodash.filter(cvm.populationList, function(population) { \r\n return lodash.any(reason.Programs, {PopulationId: population.PopulationId});\r\n });\r\n }\r\n else {\r\n // if it has no programs, add All Patients population\r\n programs = [cvm.allPatients];\r\n }\r\n\r\n return {\r\n id: reason.BiometricThresholdsChangeReasonId,\r\n label: reason.Text,\r\n icon: \"fa-bookmark-o\",\r\n enabled: reason.IsEnabled,\r\n isDefault: reason.IsDefault,\r\n editable: true,\r\n sortOrder: reason.SortOrder,\r\n inputs: {\r\n text: reason.Text,\r\n populations: programs\r\n },\r\n visible: true\r\n };\r\n }\r\n\r\n cvm.addedBiometricThresholdsChangeReasons = addedBiometricThresholdsChangeReasons;\r\n cvm.changedBiometricThresholdsChangeReason = changedBiometricThresholdsChangeReason;\r\n //#endregion\r\n\r\n //#region Interventions for Alerts / Notifications\r\n var hasInterventionsRead = PermissionService.userHasPermission([\"ConfigurationInterventionsRead\"]);\r\n cvm.hasInterventionsWrite = PermissionService.userHasPermission([\"ConfigurationInterventionsWrite\"]);\r\n\r\n cvm.alertTypes = lodash.map(configurationContent.AlertInterventions.AlertTypes, function (alertType) {\r\n return {\r\n id: alertType.AlertTypeId,\r\n name: alertType.DisplayText,\r\n sortOrder: alertType.SortOrder,\r\n enabled: alertType.IsEnabled,\r\n class: alertType.AlertClassId\r\n };\r\n });\r\n\r\n cvm.alertTypes.push({\r\n id: null,\r\n name: 'All',\r\n sortOrder: 0,\r\n enabled: true\r\n });\r\n\r\n cvm.interventionTabOptions = {\r\n tabs: [\r\n {\r\n id: 2,\r\n text: \"Accepted\",\r\n active: true\r\n }, {\r\n id: 3,\r\n text: \"Rejected\",\r\n active: false\r\n }\r\n ]\r\n };\r\n\r\n ResourceLibraryService.getPopulations().then(function (data) {\r\n cvm.populationList = data;\r\n cvm.allPatients = lodash.find(cvm.populationList, function (p) { return p.IsAllPatients; });\r\n cvm.interventionTagList = []; \r\n\r\n cvm.alertInterventionsList = {\r\n id: \"alert-interventions\",\r\n label: \"Interventions for Alerts\",\r\n labelhint: \"Character limit for alert intervention is 300.\",\r\n description: \"List of interventions for alerts.\",\r\n icon: \"fas fa-exclamation-circle\",\r\n editable: false,\r\n enabled: true,\r\n optionsEditable: true,\r\n hasReadPermission: hasInterventionsRead,\r\n alertClassId: AlertClass.Alert,\r\n options: lodash.map(lodash.where(cvm.alertTypes, {'enabled': true, 'class': AlertClass.Alert}), function (alertType) {\r\n return {\r\n id: alertType.id,\r\n label: alertType.name,\r\n icon: \"fas fa-exclamation\",\r\n editable: false,\r\n enabled: true,\r\n sortOrder: alertType.sortOrder,\r\n options: mapInterventions(alertType.id),\r\n };\r\n }).concat([{\r\n id: null,\r\n label: 'All',\r\n icon: \"far fa-exclamation\",\r\n editable: true,\r\n enabled: true,\r\n sortOrder: 0,\r\n options: mapInterventions(null, AlertClass.Alert),\r\n }])\r\n };\r\n setParent(cvm.alertInterventionsList);\r\n\r\n cvm.notificationInterventionsList = {\r\n id: \"notification-interventions\",\r\n label: \"Interventions for Notifications\",\r\n labelhint: \"Character limit for notification intervention is 300.\",\r\n description: \"List of interventions for notifications.\",\r\n icon: \"fas fa-bell\",\r\n editable: false,\r\n enabled: true,\r\n optionsEditable: true,\r\n hasReadPermission: hasInterventionsRead,\r\n alertClassId: AlertClass.Notification,\r\n options: lodash.map(lodash.where(cvm.alertTypes, {'enabled': true, 'class': AlertClass.Notification}), function (alertType) {\r\n return {\r\n id: alertType.id,\r\n label: alertType.name,\r\n icon: \"far fa-bell\",\r\n tabId: 2,\r\n editable: true,\r\n enabled: true,\r\n sortOrder: alertType.sortOrder,\r\n options: mapInterventions(alertType.id),\r\n };\r\n }).concat([{\r\n id: null,\r\n label: 'All',\r\n icon: \"far fa-bell\",\r\n tabId: 2,\r\n editable: true,\r\n enabled: true,\r\n sortOrder: 0,\r\n options: mapInterventions(null, AlertClass.Notification),\r\n }])\r\n };\r\n setParent(cvm.notificationInterventionsList);\r\n\r\n cvm.BiometricThresholdsChangeReasons = {\r\n id: \"BiometricThresholdsChangeReasons\",\r\n label: \"Biometric Thresholds Change Reasons\",\r\n description: \"List of reasons for changing a biometric threshold.\",\r\n icon: \"fa-sitemap\",\r\n editable: true,\r\n enabled: true,\r\n options: biometricThresholdsChangeReasonsOptions(),\r\n optionsEditable: true,\r\n canRead: hasBiometricThresholdsChangeReasonsRead\r\n };\r\n setParent(cvm.BiometricThresholdsChangeReasons);\r\n });\r\n\r\n function mapInterventions(alertTypeId, alertClassId) {\r\n var interventions;\r\n\r\n if (alertTypeId && alertTypeId !== null) {\r\n interventions = lodash.filter(configurationContent.AlertInterventions.Interventions, function (intervention) {\r\n return intervention.AlertTypeId === alertTypeId;\r\n });\r\n }\r\n else {\r\n interventions = lodash.filter(configurationContent.AlertInterventions.Interventions, function (intervention) {\r\n return (!intervention.AlertTypeId || intervention.AlertTypeId === null) &&\r\n intervention.AlertClassId == alertClassId;\r\n });\r\n }\r\n\r\n return lodash.map(interventions, function (intervention) {\r\n var populations = [];\r\n if (intervention.Programs.length > 0) {\r\n populations = lodash.filter(cvm.populationList, function(population) { \r\n return lodash.any(intervention.Programs, {PopulationId: population.PopulationId});\r\n });\r\n }\r\n else {\r\n // if it has no populations, add All Patients population\r\n populations = [cvm.allPatients];\r\n }\r\n\r\n if (intervention.Tags.length) {\r\n cvm.interventionTagList = lodash.union(cvm.interventionTagList, intervention.Tags);\r\n }\r\n\r\n return {\r\n id: intervention.InterventionId,\r\n classId: intervention.AlertClassId,\r\n tabId: intervention.AlertStatusId,\r\n typeId: intervention.AlertTypeId,\r\n label: intervention.Text,\r\n inputs: {\r\n text: intervention.Text,\r\n populations: populations,\r\n tags: intervention.Tags\r\n },\r\n icon: \"fa-bookmark-o\",\r\n enabled: intervention.IsEnabled,\r\n isDefault: false,\r\n visible: true,\r\n editable: cvm.hasInterventionsWrite,\r\n sortOrder: intervention.SortOrder\r\n };\r\n });\r\n }\r\n\r\n cvm.interventionChanged = interventionChanged;\r\n function interventionChanged(intervention, inOption) {\r\n var apiIntervention = mapToApiIntervention(intervention);\r\n cvm.interventionTagList = lodash.union(cvm.interventionTagList, apiIntervention.Tags);\r\n\r\n EditConfigurationsService.updateIntervention(apiIntervention).then(function () {\r\n lodash.map(inOption.options, function (o, i) {\r\n o.sortOrder = i + 1;\r\n });\r\n });\r\n }\r\n\r\n cvm.interventionAdded = interventionAdded;\r\n function interventionAdded(intervention) {\r\n var apiIntervention = mapToApiIntervention(intervention);\r\n cvm.interventionTagList = lodash.union(cvm.interventionTagList, apiIntervention.Tags);\r\n\r\n EditConfigurationsService.addIntervention(apiIntervention).then(function (newIntervention) {\r\n var interventionList = intervention.parent.parent.id == 'notification-interventions' ? cvm.notificationInterventionsList : cvm.alertInterventionsList;\r\n interventionList.options.forEach(function (alertType) {\r\n if (intervention.typeId == alertType.id || (intervention.typeId == null && alertType.id == null)) {\r\n lodash.remove(alertType.options, {temp: true});\r\n intervention.id = newIntervention.InterventionId;\r\n intervention.label = intervention.inputs.text;\r\n delete intervention.temp;\r\n alertType.options.push(intervention);\r\n }\r\n });\r\n });\r\n }\r\n\r\n function mapToApiIntervention(intervention) {\r\n return {\r\n InterventionId: intervention.id,\r\n AlertClassId: intervention.classId,\r\n AlertStatusId: intervention.tabId,\r\n AlertTypeId: intervention.typeId,\r\n Text: intervention.inputs.text,\r\n Tags: intervention.inputs.tags,\r\n Programs: lodash.map(intervention.inputs.populations, function(population) {\r\n return {\r\n PopulationId: population.PopulationId\r\n };\r\n }),\r\n SortOrder: intervention.sortOrder,\r\n IsEnabled: intervention.enabled\r\n };\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Interventions for Messages\r\n cvm.hasMessageInterventionsRead = PermissionService.userHasPermission([\"MessageInterventionsRead\"]);\r\n cvm.hasMessageInterventionsWrite = PermissionService.userHasPermission([\"MessageInterventionsWrite\"]);\r\n if (cvm.hasMessageInterventionsWrite) {\r\n cvm.hasMessageInterventionsRead = true;\r\n }\r\n\r\n cvm.messageInterventionList = {\r\n id: \"msgInterventions\",\r\n label: \"Interventions for Messaging\",\r\n labelhint: \"Character limit for message intervention is 300.\",\r\n description: \"List of interventions for messaging.\",\r\n icon: \"fa-sitemap\",\r\n default: \"first\",\r\n editable: cvm.hasMessageInterventionsWrite,\r\n enabled: true,\r\n optionsEditable: cvm.hasMessageInterventionsWrite,\r\n options: []\r\n };\r\n\r\n function mapMessageIntervention(src) {\r\n return {\r\n icon: \"fa-bookmark-o\",\r\n editable: cvm.hasMessageInterventionsWrite,\r\n id: src.MessageInterventionId,\r\n label: src.Text,\r\n enabled: src.IsEnabled,\r\n sortOrder: src.SortOrder,\r\n programs: src.Programs\r\n };\r\n }\r\n\r\n function getMessageInterventionList() {\r\n EditConfigurationsService.getMessageInterventions().then(function (data) {\r\n cvm.messageInterventionList.options = lodash.map(data, mapMessageIntervention);\r\n });\r\n }\r\n \r\n getMessageInterventionList();\r\n\r\n function addMessageIntervention(option) {\r\n var item = {\r\n MessageInterventionId: 0,\r\n Text: option.label,\r\n SortOrder: cvm.messageInterventionList.options.length,\r\n IsEnabled: option.enabled,\r\n Programs: option.programs\r\n };\r\n EditConfigurationsService.createMessageIntervention(item).then(function(response) {\r\n getMessageInterventionList();\r\n });\r\n } \r\n\r\n function updateMessageIntervention(option) {\r\n var item = {\r\n MessageInterventionId: option.id,\r\n Text: option.label,\r\n SortOrder: option.sortOrder,\r\n IsEnabled: option.enabled,\r\n Programs: option.programs\r\n };\r\n EditConfigurationsService.updateMessageIntervention(item).then(function (response) {\r\n getMessageInterventionList();\r\n });\r\n }\r\n\r\n cvm.addMessageIntervention = addMessageIntervention;\r\n cvm.updateMessageIntervention = updateMessageIntervention;\r\n //#endregion\r\n\r\n //#region Form Variable Transforms\r\n cvm.hasTransformsRead = PermissionService.userHasPermission([\"ConfigurationsTransformsRead\"]);\r\n cvm.hasTransformsWrite = PermissionService.userHasPermission([\"ConfigurationsTransformsWrite\"]);\r\n\r\n cvm.formVariableTransformList = {\r\n id: \"mainList\",\r\n label: \"Form Variable Transforms\",\r\n description: \"Configure how to display form variables on a patient form\",\r\n icon: \"fa-sitemap\",\r\n default: \"first\",\r\n editable: true,\r\n enabled: true,\r\n optionsEditable: true,\r\n options: lodash.map(configurationContent.FormVariableTransforms, function (v) {\r\n return {\r\n id: v.FormVariableTransformId,\r\n label: v.Text,\r\n icon: \"fa-bookmark-o\",\r\n enabled: v.IsEnabled,\r\n editable: true,\r\n sortOrder: v.SortOrder,\r\n options: lodash.map(v.FormVariableTransformDetails, function (d) {\r\n return {\r\n id: d.FormVariableTransformDetailId,\r\n parentId: v.FormVariableTransformId,\r\n label: d.SourceValue + ' ' + d.TargetValue,\r\n inputs: {\r\n sourceValue: d.SourceValue,\r\n targetValue: d.TargetValue,\r\n },\r\n icon: \"fa-bookmark-o\",\r\n enabled: d.IsEnabled,\r\n editable: true,\r\n sortOrder: d.SortOrder\r\n };\r\n })\r\n };\r\n })\r\n };\r\n\r\n cvm.variableTransformAdded = variableTransformAdded;\r\n cvm.variableTransformUpdated = variableTransformUpdated;\r\n cvm.variableTransformDetailAdded = variableTransformDetailAdded;\r\n cvm.variableTransformDetailUpdated = variableTransformDetailUpdated;\r\n\r\n function variableTransformAdded(addedName, parent) {\r\n var model = {\r\n label: addedName,\r\n sortOrder: cvm.formVariableTransformList.options.length,\r\n enabled: true\r\n };\r\n\r\n EditConfigurationsService.createFormVariableTransform(model).then(function (variableTransform) {\r\n model.id = variableTransform.FormVariableTransformId;\r\n model.icon = \"fa-bookmark-o\";\r\n model.editable = true;\r\n model.options = [];\r\n\r\n lodash.remove(cvm.formVariableTransformList.options, {temp: true});\r\n cvm.formVariableTransformList.options.push(model);\r\n });\r\n }\r\n\r\n function variableTransformUpdated(option, parent) {\r\n EditConfigurationsService.updateFormVariableTransform(option);\r\n }\r\n\r\n function variableTransformDetailAdded(option) {\r\n\r\n EditConfigurationsService.createFormVariableTransformDetail(option).then(function (variableTransformDetail) {\r\n option.id = variableTransformDetail.FormVariableTransformDetailId;\r\n\r\n lodash.remove(option.parent.options, {temp: true});\r\n delete option.temp;\r\n option.parent.options.push(option);\r\n });\r\n }\r\n\r\n function variableTransformDetailUpdated(option) {\r\n EditConfigurationsService.updateFormVariableTransformDetail(option);\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Milestones\r\n cvm.hasConfigMilestoneRead = PermissionService.userHasPermission([\"ConfigurationMilestoneRead\"]);\r\n cvm.hasConfigMilestoneWrite = PermissionService.userHasPermission([\"ConfigurationMilestoneWrite\"]);\r\n\r\n cvm.milestoneList = {\r\n id: \"Milestones\",\r\n label: \"Milestones\",\r\n description: \"List of key dates or events that are relevant for patients in various clinical scenarios.\",\r\n icon: \"fa-sitemap\",\r\n default: \"first\",\r\n editable: cvm.hasConfigMilestoneWrite,\r\n enabled: true,\r\n optionsEditable: cvm.hasConfigMilestoneWrite,\r\n options: []\r\n };\r\n\r\n function mapMilestone(opt) {\r\n return {\r\n id: opt.MilestoneId,\r\n uid: opt.MilestoneUId,\r\n label: opt.Name,\r\n icon: \"fa-bookmark-o\",\r\n editable: cvm.hasConfigMilestoneWrite,\r\n enabled: opt.IsEnabled,\r\n sortOrder: opt.SortOrder,\r\n MilestonePopulations: opt.MilestonePopulations\r\n };\r\n }\r\n\r\n function getMilestoneList() {\r\n EditConfigurationsService.getMilestones().then(function (data) {\r\n cvm.milestoneList.options = lodash.map(data, function (opt) {\r\n return mapMilestone(opt);\r\n });\r\n });\r\n }\r\n\r\n getMilestoneList();\r\n\r\n function addMilestone(addedName) {\r\n var item = {\r\n MilestoneId: 0,\r\n Name: addedName,\r\n IsEnabled: true,\r\n SortOrder: cvm.milestoneList.options.length\r\n };\r\n EditConfigurationsService.createMilestone(item).then(function(response) {\r\n getMilestoneList();\r\n });\r\n } \r\n\r\n function updateMilestone(option) {\r\n var item = {\r\n MilestoneId: option.id,\r\n Name: option.label,\r\n SortOrder: option.sortOrder,\r\n IsEnabled: option.enabled,\r\n MilestonePopulations: option.MilestonePopulations\r\n };\r\n EditConfigurationsService.updateMilestone(item).then(function (response) {\r\n if (response == false)\r\n $timeout(function() {\r\n vhSweetAlert.error('Unable to disable', 'The milestone couldnt be disabled because it has survey schedules which refer to it');\r\n }, 100);\r\n getMilestoneList();\r\n });\r\n }\r\n\r\n cvm.addMilestone = addMilestone;\r\n cvm.updateMilestone = updateMilestone;\r\n\r\n function openMilestoneModal(milestone) {\r\n if(milestone.id === undefined) return;\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/configurations/milestoneEdit.modal.html',\r\n controller: 'MilestoneEditController as vm',\r\n keyboard: false,\r\n size: 'sm',\r\n resolve: { milestone: milestone }\r\n });\r\n modalInstance.result.then(function (result) {\r\n getMilestoneList();\r\n }, function () {});\r\n }\r\n\r\n cvm.openMilestoneModal = openMilestoneModal;\r\n //#endregion\r\n\r\n}\r\n\r\nangular.module(\"configurations\").controller(\"ConfigurationsController\", ConfigurationsController);\r\n","function ConfigurationsService(ConfigurationRepository, $q, $http, PendingService) {\r\n return {\r\n configParams: null,\r\n getConfig: function() {\r\n var that = this;\r\n if (this.configParams !== null) {\r\n return $q.when(this.configParams);\r\n } else {\r\n return PendingService.promise('get portal config', () => $http.get(\"/api/cgp/GetPortalConfig\"))\r\n .then(function(response) {\r\n that.configParams = response.data;\r\n return that.configParams;\r\n });\r\n }\r\n },\r\n getConfigRankings: function(id) {\r\n var url = `/api/configuration/rankings/${id}`\r\n return $http.get(url).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n protectedConfigParams: null,\r\n getProtectedConfig: function() {\r\n var that = this;\r\n if (this.protectedConfigParams !== null) {\r\n return $q.when(this.protectedConfigParams);\r\n } else {\r\n return PendingService.promise('get protected portal config', () => $http.get(\"/api/cgp/GetProtectedPortalConfig\"))\r\n .then(function(response) {\r\n that.protectedConfigParams = response.data;\r\n return that.protectedConfigParams;\r\n });\r\n }\r\n },\r\n\r\n clearPortalConfig: function() {\r\n this.configParams = null;\r\n this.getConfig();\r\n this.protectedConfigParams = null;\r\n this.getProtectedConfig();\r\n }\r\n };\r\n}\r\n\r\n//Ensure that portal config values are available on every state change\r\nangular.module('configurations').factory('ConfigurationsService', ConfigurationsService)\r\n.run(function ($rootScope, $transitions, ConfigurationsService, $state) {\r\n return new Promise((resolve, reject)=>{\r\n if(ConfigurationsService.configParams !==null)\r\n resolve(ConfigurationsService);\r\n else\r\n ConfigurationsService.getConfig().then(()=>{\r\n resolve(ConfigurationsService);\r\n })\r\n });\r\n});\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/configurations.tpl.html',\n '

    All Lists

    1. Viewing 1 - 11 of 11
    {{tag}}
    {{tag}}
    {{$item}} {{tag}}
    ');\n}]);\n}(window, document, window.angular));","function AddGoConfigurationController(availablePopulations, canAssignDisabledItems, showDisabled, $uibModalInstance, $scope, \r\n availableConfigurations, HospitalAvailable, availableProgramGroups, Providers, availableSites, ProviderGroup, PatientDemographicsProvidersService, lodash) {\r\n var vm = this;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.selectedPopulation = null;\r\n vm.canAssignDisabledItems = canAssignDisabledItems;\r\n vm.showDisabled = showDisabled;\r\n vm.availableConfigurations = availableConfigurations// Map the configurations\r\n vm.HospitalAvailable = HospitalAvailable //Map Hospital\r\n vm.availableProgramGroups = availableProgramGroups // Map program groups\r\n vm.availableSites = availableSites; //Map Sites\r\n vm.Providers = Providers;//Map Providers\r\n vm.ProviderGroup = ProviderGroup;//Map ProviderGroup\r\n vm.providerList = providerList;\r\n vm.selectProvider = selectProvider;\r\n\r\n this.availablePopulations = () => availablePopulations.filter(x => this.showDisabled || x.IsEnabled);\r\n\r\n function selectProvider(provider) {\r\n vm.selectedPopulation = provider\r\n vm.selectedProvider = provider\r\n }\r\n function ok() {\r\n if ($scope.addGoPop.$valid) {\r\n params = {};\r\n if (vm.CType.type == 'PV')\r\n params.PopulationId = vm.selectedPopulation.ProviderMasterId;\r\n else if (vm.CType.type == 'H' || vm.CType.type == 'PG' || vm.CType.type=='PVG')\r\n params.PopulationId = vm.selectedPopulation.Id;\r\n else if (vm.CType.type == 'S')\r\n params.PopulationId = vm.selectedPopulation.SiteId;\r\n else\r\n params.PopulationId = vm.selectedPopulation.PopulationId;\r\n params.type = vm.CType.type;\r\n params.showDisabled = vm.showDisabled \r\n $uibModalInstance.close(params);\r\n }\r\n }\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n function providerList(search) {\r\n var Provider = [];\r\n return PatientDemographicsProvidersService.getProvidersAsync(search).then(function (result) {\r\n if (result != null && result.length > 0) {\r\n angular.forEach(result, function (value, key) {\r\n if (lodash.find(Providers, { ProviderId: value.ProviderId })) {\r\n Provider.push(value);\r\n }\r\n\r\n })\r\n result = Provider\r\n return result;\r\n }\r\n })\r\n \r\n }\r\n\r\n\r\n\r\n}\r\nangular.module('site.biometrics').controller('AddGoConfigurationController', AddGoConfigurationController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/addconfiguration.modal.html',\n '

    Select Configuration

    Show Disabled Programs
    {{vm.CType.Name}}{{configuration.Name}}
    {{vm.selectedPopulation.PopulationName}}(disabled){{population.PopulationName}}(disabled)
    {{vm.selectedPopulation.FacilityName}}{{facility.FacilityName}}
    {{vm.selectedPopulation.Name}}{{progGroups.Name}}
    {{vm.selectedPopulation.Name}}{{site.Name}}
    {{vm.selectedPopulation.Name}}{{group.Name}}
    ');\n}]);\n}(window, document, window.angular));","function AddPopulationController(availablePopulations, canAssignDisabledItems, showDisabled, $uibModalInstance, lodash, $scope) {\r\n var vm = this;\r\n \r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.selectedPopulation = null;\r\n vm.canAssignDisabledItems = canAssignDisabledItems;\r\n vm.showDisabled = showDisabled;\r\n\r\n this.availablePopulations = () => availablePopulations.filter(x => this.showDisabled || x.IsEnabled);\r\n \r\n function ok() {\r\n if ($scope.addPop.$valid) {\r\n $uibModalInstance.close({populationId: vm.selectedPopulation.PopulationId, showDisabled: vm.showDisabled});\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('configurations.content').controller('AddPopulationController', AddPopulationController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/addpopulation.modal.html',\n '

    Select Program

    Show Disabled Programs
    {{vm.selectedPopulation.PopulationName}}(disabled){{population.PopulationName}}(disabled)
    ');\n}]);\n}(window, document, window.angular));","function ConfigContentController(webRpmContent, kitContent, multiLingualContent, availableLanguages, availablePopulations, contentConfig, WelcomeVideoService, ConfigurationContentService, lodash, $uibModal, vhSweetAlert, SlideshowService, PopulationSettingsService, PermissionService) {\r\n var bcvm = this;\r\n var originalVideoId = null;\r\n var configTypeEnum = contentConfig.configTypeEnum;\r\n bcvm.pageType = contentConfig.configTypeText;\r\n bcvm.configTypeEnum = configTypeEnum;\r\n \r\n\r\n\r\n bcvm.showDisabled = false;\r\n bcvm.canAssignDisabledItems = PermissionService.canAssignDisabledItems = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n\r\n //for videos\r\n bcvm.welcomeVideoPopulations = webRpmContent.WelcomeVideos ? lodash(webRpmContent.WelcomeVideos).groupBy(\"PopulationId\").mapValues(lodash.first).value() : false;\r\n bcvm.defaultWelcomeVideo = bcvm.welcomeVideoPopulations[null];\r\n\r\n // for slideshow\r\n bcvm.slideshowPopulations = kitContent.Slideshows ? lodash(kitContent.Slideshows).groupBy(\"PopulationId\").value() : false;\r\n updateSlideshowImages(0);\r\n\r\n // for kit settings\r\n bcvm.settingsPopulations = kitContent.KitConfigurations\r\n ? lodash(kitContent.KitConfigurations).pluck(\"PopulationConfigurations\").flatten().value() : false;\r\n\r\n // for byod settings\r\n if(!bcvm.settingsPopulations) {\r\n bcvm.settingsPopulations = webRpmContent.WebRpmConfigurations\r\n ? lodash(webRpmContent.WebRpmConfigurations).pluck(\"PopulationConfigurations\").flatten().value() : false; \r\n }\r\n \r\n bcvm.defaultSettings = kitContent.KitConfigurations\r\n ? lodash(kitContent.KitConfigurations).map(mapConfig).value() : false;\r\n \r\n if(!bcvm.defaultSettings) {\r\n bcvm.defaultSettings = webRpmContent.WebRpmConfigurations\r\n ? lodash(webRpmContent.WebRpmConfigurations).map(mapConfig).value() : false; \r\n }\r\n\r\n\r\n\r\n bcvm.contentTextOrDefault = (content)=>{\r\n\r\n var lookup = [];\r\n \r\n for(var key in content.populationContent){\r\n var value = content.populationContent[key]\r\n lookup.push({key: key, value : value});\r\n }\r\n\r\n var defaultContent = (lookup.find(x => x.key == 'null' || x.key == null) || {value : null}).value;\r\n \r\n var selectedContent = (lookup.find(x => x.key == bcvm.selectedPopulationId) || {value : defaultContent }).value;\r\n\r\n if(!selectedContent[bcvm.language] && defaultContent && defaultContent[bcvm.language])\r\n selectedContent = defaultContent;\r\n\r\n var contentExists = selectedContent && selectedContent[bcvm.language];\r\n \r\n return !contentExists ? '' : selectedContent[bcvm.language].Text;\r\n }\r\n\r\n \r\n\r\n //data\r\n if(Array.isArray(availablePopulations))\r\n bcvm.availablePopulations = [...availablePopulations.filter(x => x.IsEnabled),...availablePopulations.filter(x => !x.IsEnabled)];\r\n else\r\n bcvm.availablePopulations = availablePopulations;\r\n\r\n\r\n \r\n\r\n bcvm.selectedPopulationId = null;\r\n bcvm.selectedPopulation = null;\r\n // for multilingual\r\n\r\n multiLingualContent = multiLingualContent || kitContent.MultiLingualContent || webRpmContent.MultiLingualContent;\r\n bcvm.multiLingualTypes = lodash(multiLingualContent)\r\n .groupBy(\"ContentTypeId\")\r\n .mapValues(function (m) {\r\n var aValue = m[0];\r\n var contentType = aValue.ContentType;\r\n return {\r\n contentTypeId: contentType.ContentTypeId,\r\n description: contentType.Description,\r\n title: contentType.Title,\r\n sortOrder: contentType.SortOrder,\r\n maxLength: contentType.MaxLength,\r\n contentDataTypeId: contentType.ConfigurationDataTypeId,\r\n populationContent: lodash(m).groupBy(\"PopulationId\").mapValues(function (p) {\r\n return lodash(p).groupBy(\"LanguageId\").mapValues(lodash.first).value();\r\n }).value()\r\n };\r\n }\r\n ).values().value();\r\n\r\n bcvm.contentPopulations = populationsWithContent();\r\n bcvm.availableLanguages = availableLanguages;\r\n var usedLanguageIds = lodash(multiLingualContent).pluck(\"LanguageId\").uniq().value();\r\n bcvm.usedLanguages = lodash.filter(bcvm.availableLanguages, function(l) {\r\n return lodash.contains(usedLanguageIds, l.LanguageId);\r\n });\r\n\r\n // functions\r\n bcvm.selectPopulation = selectPopulation;\r\n bcvm.deletePopulation = deletePopulation;\r\n bcvm.setCurrentLanguageText = setCurrentLanguageText;\r\n bcvm.addedVideo = addedVideo;\r\n bcvm.changedVideo = changedVideo;\r\n bcvm.deletedVideo = deletedVideo;\r\n bcvm.editEntry = editEntry;\r\n bcvm.deleteEntry = deleteEntry;\r\n bcvm.addPopulation = addPopulation;\r\n bcvm.addEntry = addEntry;\r\n bcvm.updatePopulation = updatePopulation;\r\n\r\n this.toggleDisabled = () => {\r\n this.showDisabled = !bcvm.showDisabled;\r\n };\r\n\r\n function populationsWithContent() {\r\n var content = webRpmContent.WelcomeVideos ? webRpmContent.WelcomeVideos.concat(multiLingualContent) : multiLingualContent;\r\n content = kitContent.Slideshows ? kitContent.Slideshows.concat(content) : content;\r\n content = bcvm.settingsPopulations ? bcvm.settingsPopulations.concat(content) : content;\r\n var value = lodash(content)\r\n .pluck(\"PopulationId\")\r\n .compact()\r\n .uniq()\r\n .map(function (id) {\r\n var match = lodash.find(bcvm.availablePopulations, { PopulationId: id });\r\n if (match)\r\n match.configId = match.PopulationId;\r\n \r\n return match;\r\n })\r\n .filter(function(thing){\r\n return thing != undefined;\r\n })\r\n .value();\r\n\r\n value = [...value.filter(x => x.IsEnabled), ...value.filter(x => !x.IsEnabled)]\r\n\r\n // if(!bcvm.showDisabled){\r\n // value = value.filter(x => x.IsEnabled);\r\n // }\r\n\r\n \r\n \r\n return value;\r\n }\r\n\r\n function setCurrentLanguageText(languageId) {\r\n bcvm.language = languageId;\r\n }\r\n\r\n function mapConfig(config) {\r\n config.PopulationConfigurations = lodash(config.PopulationConfigurations).groupBy(\"PopulationId\").mapValues(lodash.first).value();\r\n return config;\r\n }\r\n\r\n function selectPopulation(population) {\r\n updateSlideshowImages(population == undefined || population.PopulationId === undefined || population.PopulationId === null ? 0 : population.PopulationId);\r\n if (!population) {\r\n bcvm.selectedconfigId = null;\r\n bcvm.selectedPopulation = null;\r\n }\r\n else \r\n bcvm.selectedPopulation = lodash.find(bcvm.availablePopulations, { PopulationId: population.PopulationId });\r\n \r\n }\r\n\r\n function updateSlideshowImages(populationId) {\r\n if(!bcvm.slideshowPopulations[populationId]) {\r\n bcvm.slideshowPopulations[populationId] = [];\r\n }\r\n }\r\n\r\n function deletePopulation(populationId) {\r\n if (configTypeEnum != 2 && configTypeEnum != 1)\r\n ConfigurationContentService.deleteAllMultiLingualContent(populationId, configTypeEnum);\r\n var welcomeVideo = bcvm.welcomeVideoPopulations[populationId];\r\n var slideshow = bcvm.slideshowPopulations[populationId];\r\n var populationSettings = bcvm.defaultSettings;\r\n \r\n if (welcomeVideo) {\r\n WelcomeVideoService.deleteWelcomeVideo(welcomeVideo.WelcomeVideoId);\r\n delete bcvm.welcomeVideoPopulations[welcomeVideo];\r\n }\r\n\r\n if(slideshow) {\r\n slideshow.forEach(function(image){\r\n SlideshowService.remove(image.ImageName, populationId);\r\n });\r\n\r\n delete bcvm.slideshowPopulations[populationId];\r\n }\r\n var ConfigType = configTypeEnum == 1 ? true : false;\r\n if (populationSettings) {\r\n var DeleteConfigSetting = configTypeEnum == 2 || configTypeEnum == 1 ? PopulationSettingsService.deleteSettingsConfiguration(populationId, false, ConfigType): PopulationSettingsService.deleteSettings(populationId) \r\n DeleteConfigSetting.then(function () {\r\n populationSettings.forEach(function(setting){\r\n if(setting.PopulationConfigurations[populationId]){\r\n delete setting.PopulationConfigurations[populationId];\r\n }\r\n });\r\n });\r\n }\r\n }\r\n\r\n function addedVideo(videoId) {\r\n WelcomeVideoService.createWelcomeVideo({\r\n VideoId: videoId,\r\n PopulationId: bcvm.selectedPopulationId,\r\n IsDefault : bcvm.selectedPopulationId === null\r\n }).then(function (newWelcomeVideo) {\r\n bcvm.welcomeVideoPopulations[bcvm.selectedPopulationId] = newWelcomeVideo;\r\n });\r\n }\r\n\r\n function changedVideo(welcomeVideo, videoId){\r\n WelcomeVideoService.updateWelcomeVideo({\r\n WelcomeVideoId: welcomeVideo.WelcomeVideoId,\r\n VideoId: videoId,\r\n }).then(function (newWelcomeVideo) {\r\n bcvm.welcomeVideoPopulations[bcvm.selectedPopulationId] = newWelcomeVideo;\r\n });\r\n }\r\n\r\n function deletedVideo(welcomeVideo){\r\n WelcomeVideoService.deleteWelcomeVideo(welcomeVideo.WelcomeVideoId);\r\n delete bcvm.welcomeVideoPopulations[welcomeVideo.PopulationId];\r\n }\r\n\r\n function addPopulation(){\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/addpopulation.modal.html',\r\n controller: 'AddPopulationController as vm',\r\n keyboard: false,\r\n resolve: {\r\n canAssignDisabledItems: () => bcvm.canAssignDisabledItems,\r\n showDisabled: () => bcvm.showDisabled,\r\n availablePopulations: function () {\r\n var programs = bcvm.availablePopulations.filter(x => !bcvm.contentPopulations.find(cp => cp.PopulationId == x.PopulationId));\r\n return programs;\r\n }\r\n }\r\n }).result.then(function ({populationId, showDisabled}) {\r\n bcvm.showDisabled = showDisabled;\r\n var filter = lodash.find(availablePopulations, { PopulationId: populationId });\r\n filter.configId = filter.PopulationId;\r\n bcvm.contentPopulations.push(filter);\r\n bcvm.selectedPopulationId = populationId;\r\n selectConfiguration(populationId);\r\n });\r\n }\r\n\r\n function selectConfiguration(populationId) {\r\n updateSlideshowImages(populationId === undefined || populationId === null ? 0 : populationId);\r\n bcvm.selectedPopulation = lodash.find(bcvm.availablePopulations, { PopulationId: populationId });\r\n }\r\n\r\n function addEntry(contentType) {\r\n var contentTypeGroup = lodash.find(bcvm.multiLingualTypes, {contentTypeId: contentType});\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/editcontent.modal.html',\r\n controller: 'EditContentController as vm',\r\n keyboard: false,\r\n resolve: {\r\n content: function() {\r\n return {\r\n title: contentTypeGroup.title,\r\n maxLength: contentTypeGroup.maxLength,\r\n text: '',\r\n dataTypeId: contentTypeGroup.contentDataTypeId\r\n };\r\n }\r\n }\r\n }).result.then(function (parameters) {\r\n ConfigurationContentService.addMultiLingualContent({\r\n PopulationId: bcvm.selectedPopulationId,\r\n ConfigTypeEnum: configTypeEnum,\r\n LanguageId: bcvm.language,\r\n ContentTypeId: contentType,\r\n Text: parameters.contentText,\r\n }).then(function (content) {\r\n var populationContent = contentTypeGroup.populationContent[bcvm.selectedPopulationId];\r\n if (!populationContent) {\r\n contentTypeGroup.populationContent[bcvm.selectedPopulationId] = {};\r\n populationContent = contentTypeGroup.populationContent[bcvm.selectedPopulationId];\r\n }\r\n populationContent[bcvm.language] = content;\r\n bcvm.contentPopulations = [...bcvm.contentPopulations];\r\n });\r\n });\r\n }\r\n\r\n function editEntry(content){\r\n var population = content.populationContent[bcvm.selectedPopulationId];\r\n if (!population) return;\r\n var model = population[bcvm.language];\r\n var text = model.Text;\r\n var dataTypeId = model.ContentType.ConfigurationDataTypeId\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/editcontent.modal.html',\r\n controller: 'EditContentController as vm',\r\n keyboard: false,\r\n resolve: {\r\n content: function() {\r\n return {\r\n title: content.title,\r\n maxLength: content.maxLength,\r\n text: text,\r\n dataTypeId: dataTypeId\r\n };\r\n }\r\n }\r\n }).result.then(function (parameters) {\r\n model.Text = parameters.contentText;;\r\n ConfigurationContentService.updateMultiLingualContent(model);\r\n });\r\n }\r\n\r\n function deleteEntry(content) {\r\n vhSweetAlert.verify(\"Are you sure\", \"Are you sure you want to revert entry to default?\").then(function (confirmed) {\r\n if (confirmed) {\r\n ConfigurationContentService.deleteMultiLingualContent(bcvm.selectedPopulationId, configTypeEnum, content.contentTypeId);\r\n delete content.populationContent[bcvm.selectedPopulationId];\r\n bcvm.contentPopulations = [...bcvm.contentPopulations]; \r\n }\r\n });\r\n }\r\n\r\n function updatePopulation(populations) {\r\n // will be for resort...\r\n }\r\n}\r\n\r\nangular.module(\"configurations.content\").controller(\"ConfigContentController\", ConfigContentController);\r\n","function ConfigurationContentService($http, lodash, PatientLanguageRepository) {\r\n\r\n function getKitContent() {\r\n return $http.get(\"/api/cgp/configurations/kit\").then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getWebRpmContent() {\r\n return $http.get(\"/api/cgp/configurations/webrpm\").then(function(response){\r\n return response.data;\r\n });\r\n }\r\n function getGoConfigurationWebRpmContent(goSetting) {\r\n return $http.get(\"/api/cgp/configurations/webrpmGoConfiguration\", {\r\n params: {\r\n goSetting: goSetting\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n \r\n function getHomeKitContent(goSetting) {\r\n return $http.get(\"/api/cgp/Homeconfigurations/kit\", {\r\n params: {\r\n goSetting: goSetting\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n function getHospital() {\r\n return $http.get(\"/api/HospitalSettings\").then(function (response) {\r\n var data =response.data.filter(x => x.IsEnabled);\r\n return data;\r\n });\r\n }\r\n\r\n function getMultiLingualContent(configTypeEnum) {\r\n return $http.get(\"/api/MultiLingualContent\").then(function (response) {\r\n return lodash.filter(response.data, {ContentType: {ConfigTypeEnum: configTypeEnum}});\r\n });\r\n }\r\n\r\n function updateMultiLingualContent(multiLingualContent) {\r\n return $http.post(\"/api/MultiLingualContent/\", multiLingualContent).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateAgreementContent(agreementContent) {\r\n return $http.post(\"/api/Agreement/\", agreementContent).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function addMultiLingualContent(multiLingualContent) {\r\n return $http.post(\"/api/MultiLingualContent\", multiLingualContent).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteMultiLingualContentConfiguration(request) {\r\n return $http.post(\"/api/DelMultilingualContent\", request).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteAgreementMultiLingualContentConfiguration(request) {\r\n return $http.post(\"/api/Agreement/DeleteAgreements\", request).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteAllMultiLingualContentConfiguration(populationId, configTypeEnum, options) {\r\n\r\n options = options || { PopulationId : populationId };\r\n var request = angular.copy(options) || {};\r\n request.contentType = { ConfigTypeEnum: configTypeEnum }\r\n\r\n return $http.post(\"/api/DelMultilingualContent\", request).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function deleteAllMultiLingualContent(populationId, configTypeEnum, hospitalId) {\r\n return $http.delete(\"/api/Population/\" + populationId + \"/MultiLingualContent\", {\r\n params: {\r\n configTypeEnum: configTypeEnum,\r\n hospitalId: hospitalId \r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteMultiLingualContent(populationId, configTypeEnum, contentTypeId) {\r\n return $http.delete(\"/api/Population/\" + populationId + \"/MultiLingualContent\", {\r\n params: {\r\n configTypeEnum: configTypeEnum,\r\n contentType: contentTypeId\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function GetProviders() {\r\n return $http({\r\n methode: 'GET',\r\n url: '/api/provider/List',\r\n params: {\r\n pageSize: 100,\r\n page: 1,\r\n }\r\n }).then(function (res) {\r\n var data = res.data;\r\n if (res.data && res.data.Records) {\r\n var filterRecords = lodash.filter(res.data.Records, { IsEnabled: true })\r\n return filterRecords;\r\n }\r\n }).catch(function (err) {\r\n console.log(err);\r\n return [];\r\n });\r\n }\r\n\r\n function getAvailableLanguages() {\r\n return PatientLanguageRepository.getAll();\r\n }\r\n\r\n function getAvailablePopulations(options){\r\n options = options || {enabledOnly: true};\r\n return $http.get(\"/api/Population\", {params: options }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateConfigurationRankings(service, sync, request){\r\n var url = `/api/configuration/${service}/rankings/${sync}`;\r\n return $http.post(url, request).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getConfigurationRankings(opt){\r\n var url = `/api/configuration/${opt.ConfigService}/rankings`\r\n return $http.get(url).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function getAgreements(opt) {\r\n var url = `/api/Agreement/get`\r\n return $http.get(url, {\r\n params: {\r\n serviceType: opt\r\n }}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function addAgreement(request) {\r\n var url = `/api/Agreement/SaveAgreement`\r\n return $http.post(url,request).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function deleteAgreement(request) {\r\n var url = `/api/Agreement/DeleteAgreement`\r\n return $http.post(url, request).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function deleteAllAgreements(request) {\r\n var url = `/api/Agreement/DeleteAllAgreement`\r\n return $http.post(url, request).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n return {\r\n getKitContent: getKitContent,\r\n getWebRpmContent: getWebRpmContent,\r\n getAvailableLanguages: getAvailableLanguages,\r\n getMultiLingualContent: getMultiLingualContent,\r\n updateMultiLingualContent: updateMultiLingualContent,\r\n addMultiLingualContent: addMultiLingualContent,\r\n deleteMultiLingualContent: deleteMultiLingualContent,\r\n deleteAllMultiLingualContent: deleteAllMultiLingualContent,\r\n getAvailablePopulations: getAvailablePopulations,\r\n getGoConfigurationWebRpmContent: getGoConfigurationWebRpmContent,\r\n getHospital: getHospital,\r\n deleteMultiLingualContentConfiguration: deleteMultiLingualContentConfiguration,\r\n deleteAllMultiLingualContentConfiguration: deleteAllMultiLingualContentConfiguration,\r\n GetProviders: GetProviders,\r\n getHomeKitContent: getHomeKitContent,\r\n getConfigurationRankings: getConfigurationRankings,\r\n updateConfigurationRankings: updateConfigurationRankings,\r\n getAgreements: getAgreements,\r\n addAgreement: addAgreement,\r\n deleteAgreement: deleteAgreement,\r\n deleteAllAgreements: deleteAllAgreements\r\n };\r\n\r\n}\r\n\r\nangular.module(\"configurations.content\").factory(\"ConfigurationContentService\", ConfigurationContentService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/content.tpl.html',\n '

    {{bcvm.pageType}}

    {{bcvm.pageType}} Configuration

    Patient Programs Show Disabled Programs
    {{bcvm.selectedPopulation.PopulationName || \\'Default\\'}} (disabled) Settings
    {{bcvm.pageType}}
    {{bcvm.pageType}} Configuration
    {{bcvm.pageType}} Text
    {{content.title}}
    (From Default Settings)
    ');\n}]);\n}(window, document, window.angular));","function EditContentController(content, $uibModalInstance, lodash, $scope, ApkSanitizer, $window, PermissionService, vhSweetAlert, $uibModalStack) {\r\n var vm = this;\r\n vm.dataTypeHtml = 5;\r\n vm.content = content;\r\n if (!vm.content.maxLength) {\r\n vm.content.maxLength = -1;\r\n }\r\n vm.dataType = content.dataTypeId;\r\n if (content.type==\"Agreement\") {\r\n vm.agreementTitle = content.title;\r\n vm.agreementSubTitle = content.subTitle;\r\n vm.TextPlaceholder = \"Agreement Content\"\r\n vm.AType = content.SelectedAgrementType \r\n \r\n }\r\n vm.contentText = content.text;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.checkAgreementFlow = function () {\r\n \r\n\r\n if (vm.content.disableNewAgreementFlow || (vm.contentText == content.text && vm.agreementTitle == content.title && vm.agreementSubTitle == content.subTitle)) {\r\n vm.ShowSaveMsg = false;\r\n ok();\r\n } else {\r\n vm.ShowSaveMsg = true;\r\n }\r\n }\r\n vm.advancedUser = PermissionService.userHasPermission([\"HealthTipsWriteAdvanced\"]);\r\n vm.tools = buildToolbar(buildOtherTools(vm.advancedUser, $window.FileReader));\r\n\r\n\r\n function buildToolbar(otherTools) {\r\n let textSizeTools = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];\r\n let textStyleTools = ['bold', 'italics', 'underline'];\r\n let listTools = ['ul', 'ol'];\r\n let textAlignTools = ['justifyLeft', 'justifyCenter', 'justifyRight'];\r\n return [textSizeTools, textStyleTools, listTools, textAlignTools, otherTools];\r\n }\r\n\r\n function buildOtherTools(advancedUser, fileReader) {\r\n let otherTools = ['fontColor'];\r\n if (fileReader !== undefined) {\r\n otherTools.push('insertImage');\r\n }\r\n if (advancedUser) {\r\n otherTools.push('html');\r\n }\r\n return otherTools;\r\n }\r\n\r\n function onPaste(html) {\r\n var el = angular.element('
    ' + html + '
    ');\r\n if (ApkSanitizer.includesMedia(el)) {\r\n vhSweetAlert.error(\"Oops...\", \"Cannot paste images, videos or other media into health tips. Upload images with the image icon.\");\r\n return '';\r\n }\r\n return ApkSanitizer.sanitizeTags(el);\r\n }\r\n\r\n function ok() {\r\n if ($scope.editContent.$valid) {\r\n if (vm.contentText !== content.text || vm.agreementTitle != content.title || vm.agreementSubTitle != content.subTitle || (vm.AType && content.SelectedAgrementType && vm.AType.AgreementType != content.SelectedAgrementType.AgreementType)) {\r\n var params = {\r\n agreementTitle: vm.agreementTitle != content.title ? vm.agreementTitle : '',\r\n contentText: vm.contentText != content.text ? vm.contentText : '',\r\n agreementSubTitle: vm.agreementSubTitle != content.subTitle ? vm.agreementSubTitle : '',\r\n agrementType: vm.AType && content.SelectedAgrementType && vm.AType.AgreementType != content.SelectedAgrementType.AgreementType ? vm.AType : ''\r\n }\r\n $uibModalInstance.close(params);\r\n } else {\r\n cancel();\r\n }\r\n }\r\n }\r\n\r\n function cancel() {\r\n if (vm.content.type != \"Agreement\" || (vm.contentText == content.text && vm.agreementTitle == content.title && vm.agreementSubTitle == content.subTitle && (vm.AType && content.SelectedAgrementType && vm.AType.AgreementType == content.SelectedAgrementType.AgreementType))) {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n else {\r\n var modalConfirm = {\r\n html: true,\r\n type: \"warning\",\r\n showCancelButton: true,\r\n cancelButtonText: 'Cancel',\r\n confirmButtonText: 'Yes',\r\n title: 'Are you sure?',\r\n text: `You have unsaved changes. Are you sure you want to close this window.`\r\n };\r\n vhSweetAlert.verify(modalConfirm)\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n $uibModalStack.dismissAll('closing');\r\n }\r\n });\r\n }\r\n }\r\n}\r\nangular.module('configurations.content').controller('EditContentController', EditContentController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/editcontent.modal.html',\n '

    {{vm.content.title}}

    {{vm.AType.AgreementType}} Select Type...{{types.AgreementType}}
    Text required
    {{vm.content.message}}
    ');\n}]);\n}(window, document, window.angular));","function GoConfigurationController(webRpmContent, kitContent, multiLingualContent, availableLanguages, availablePopulations, contentConfig, WelcomeVideoService,\r\n ConfigurationContentService, lodash, $uibModal, vhSweetAlert, SlideshowService, PopulationSettingsService, PermissionService,\r\n HospitalSettings, ProgramGroupSettings, Providers, SiteSettings, ProviderGroup, ConfigurationRankings, Agreements, AgreementsEnum, ConfigurationsService) {\r\n var bcvm = this;\r\n var originalVideoId = null;\r\n var configTypeEnum = contentConfig.configTypeEnum;\r\n bcvm.isHomeNewAgreementFlow = ConfigurationsService.configParams.HomeUseAgreementsTypeWorkflow;\r\n bcvm.isGoNewAgreementFlow = ConfigurationsService.configParams.GoUseAgreementTypeWorkflow\r\n bcvm.pageType = contentConfig.configTypeText;\r\n bcvm.showDisabled = false;\r\n bcvm.canAssignDisabledItems = PermissionService.canAssignDisabledItems = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n bcvm.HospitalSettings = HospitalSettings;//Map the hospitals\r\n bcvm.ProgramGroupSettings = ProgramGroupSettings; //Map the program group enums\r\n bcvm.Providers = Providers;// map providers\r\n bcvm.SiteSettings = SiteSettings ? lodash.filter(SiteSettings, { IsCurrent: true }) : false; // map sites\r\n bcvm.ProviderGroup = ProviderGroup ? lodash.filter(ProviderGroup, { IsEnabled: true }) : false; // map providers\r\n //for videos\r\n bcvm.welcomeVideoPopulations = webRpmContent.WelcomeVideos ? lodash(webRpmContent.WelcomeVideos).groupBy(\"PopulationId\").mapValues(lodash.first).value() : false;\r\n bcvm.defaultWelcomeVideo = bcvm.welcomeVideoPopulations[null];\r\n bcvm.configurationRankings = ConfigurationRankings;\r\n bcvm.isSortable = PermissionService.userHasPermission(['ConfigurationsWrite']) || false;\r\n bcvm.addAgreementEntry = addAgreementEntry\r\n bcvm.editAgreementEntry = editAgreementEntry\r\n\r\n\r\n // for kit settings\r\n bcvm.settingsPopulations = kitContent.KitConfigurations\r\n ? lodash(kitContent.KitConfigurations).pluck(\"PopulationConfigurations\").flatten().value() : false;\r\n\r\n // for byod settings\r\n if (!bcvm.settingsPopulations) {\r\n bcvm.settingsPopulations = webRpmContent.WebRpmConfigurations\r\n ? lodash(webRpmContent.WebRpmConfigurations).pluck(\"PopulationConfigurations\").flatten().value() : false;\r\n }\r\n\r\n bcvm.defaultSettings = kitContent.KitConfigurations\r\n ? lodash(kitContent.KitConfigurations).map(mapConfigurations).value() : false;\r\n\r\n if (!bcvm.defaultSettings) {\r\n bcvm.defaultSettings = webRpmContent.WebRpmConfigurations\r\n ? lodash(webRpmContent.WebRpmConfigurations).map(mapConfigurations).value() : false;\r\n }\r\n\r\n bcvm.contentTextOrDefault = (content,type) => {\r\n\r\n var lookup = [];\r\n\r\n if (type == 'Text') {\r\n for (var key in content.populationContent) {\r\n var value = content.populationContent[key]\r\n lookup.push({ key: key, value: value });\r\n }\r\n }\r\n if (type == 'Title') {\r\n for (var key in content.populationTitle) {\r\n var value = content.populationTitle[key]\r\n lookup.push({ key: key, value: value });\r\n }\r\n }\r\n if (type == 'Subtitle') {\r\n for (var key in content.populationSubTitle) {\r\n var value = content.populationSubTitle[key]\r\n lookup.push({ key: key, value: value });\r\n }\r\n }\r\n var defaultContent = (lookup.find(x => x.key == 'null' || x.key == null) || { value: null }).value;\r\n\r\n var selectedContent = (lookup.find(x => x.key == bcvm.selectedconfigId) || { value: defaultContent }).value;\r\n\r\n if (selectedContent && !selectedContent[bcvm.language] && defaultContent && defaultContent[bcvm.language])\r\n selectedContent = defaultContent;\r\n\r\n var contentExists = selectedContent && selectedContent[bcvm.language];\r\n if (type == 'Title') {\r\n var value = !contentExists ? selectedContent && selectedContent[bcvm.DefaultLanguage] && selectedContent[bcvm.DefaultLanguage].Text : selectedContent[bcvm.language].Text;\r\n if (!value) {\r\n value = defaultContent && defaultContent[bcvm.DefaultLanguage] && defaultContent[bcvm.DefaultLanguage].Text ? defaultContent[bcvm.DefaultLanguage].Text:''\r\n }\r\n return value\r\n }\r\n return !contentExists ? '' : selectedContent[bcvm.language].Text;\r\n }\r\n\r\n //data\r\n if (Array.isArray(availablePopulations))\r\n bcvm.availablePopulations = [...availablePopulations.filter(x => x.IsEnabled), ...availablePopulations.filter(x => !x.IsEnabled)];\r\n else\r\n bcvm.availablePopulations = availablePopulations;\r\n\r\n \r\n bcvm.selectedconfigId = null;\r\n bcvm.selectedPopulationId = null;\r\n bcvm.selectedPopulation = null;\r\n bcvm.contentPopulations = populationsWithContent();\r\n\r\n // for multilingual\r\n multiLingualContent = multiLingualContent || kitContent.MultiLingualContent || webRpmContent.MultiLingualContent;\r\n bcvm.AgreementContentTypeid = AgreementsEnum;\r\n\r\n //Filter Out Agreement Content\r\n multiLingualContent = lodash.filter(multiLingualContent, function (l) {\r\n return !lodash.contains(lodash(bcvm.AgreementContentTypeid).pluck(\"Id\").uniq().value(), l.ContentTypeId);\r\n });\r\n multiLingualContent = MapConfigIdtomultiLingualContent(multiLingualContent);\r\n bcvm.multiLingualTypes = lodash(multiLingualContent)\r\n .groupBy(\"ContentTypeId\")\r\n .mapValues(function (m) {\r\n var aValue = m[0];\r\n var contentType = aValue.ContentType;\r\n return {\r\n contentTypeId: contentType.ContentTypeId,\r\n description: contentType.Description,\r\n title: contentType.Title,\r\n sortOrder: contentType.SortOrder,\r\n maxLength: contentType.MaxLength,\r\n contentDataTypeId: contentType.ConfigurationDataTypeId,\r\n populationContent: lodash(m).groupBy(\"configId\").mapValues(function (p) {\r\n return lodash(p).groupBy(\"LanguageId\").mapValues(lodash.first).value();\r\n }).value()\r\n };\r\n }\r\n ).values().value();\r\n bcvm.AgrementTypes = Agreements.AppAgreementTypeModel\r\n var AgreementContent = MapConfigIdtomultiLingualContent(Agreements.AppAgreementMultilingualContentModel);\r\n\r\n //Map Agreements\r\n bcvm.Agreements = MapAgreements(AgreementContent)\r\n \r\n\r\n //for videos\r\n\r\n bcvm.defaultWelcomeVideo = mapDefaultVideo();\r\n bcvm.welcomeVideoPopulations = webRpmContent.WelcomeVideos ? mapWelcomeVideos() : false;\r\n\r\n // for slideshow\r\n bcvm.slideshowPopulations = kitContent.Slideshows ? lodash(MapConfigIdtomultiLingualContent(kitContent.Slideshows)).groupBy(\"configId\").value() : false;\r\n bcvm.slideshowPopulations[null] = lodash.filter(kitContent.Slideshows, p => p.PopulationId == 0 && p.HospitalId == null)\r\n\r\n\r\n bcvm.availableLanguages = availableLanguages;\r\n bcvm.DefaultLanguage = bcvm.DefaultLanguage = lodash.find(availableLanguages, { IsDefault: true }) != null ? lodash.find(availableLanguages, { IsDefault: true }).LanguageId : null\r\n var usedLanguageIds = lodash(multiLingualContent).pluck(\"LanguageId\").uniq().value();\r\n bcvm.usedLanguages = lodash.filter(bcvm.availableLanguages, function (l) {\r\n return lodash.contains(usedLanguageIds, l.LanguageId);\r\n });\r\n\r\n // functions\r\n bcvm.selectPopulation = selectPopulation;\r\n bcvm.deletePopulation = deletePopulation;\r\n bcvm.setCurrentLanguageText = setCurrentLanguageText;\r\n bcvm.addedVideo = addedVideo;\r\n bcvm.changedVideo = changedVideo;\r\n bcvm.deletedVideo = deletedVideo;\r\n bcvm.editEntry = editEntry;\r\n bcvm.deleteEntry = deleteEntry;\r\n bcvm.DeleteAgreement = DeleteAgreement\r\n bcvm.addPopulation = addPopulation;\r\n bcvm.addEntry = addEntry;\r\n bcvm.updatePopulation = updatePopulation;\r\n\r\n this.toggleDisabled = () => {\r\n this.showDisabled = !bcvm.showDisabled;\r\n };\r\n function pluckContent(type, content) {\r\n var value = lodash(content)\r\n .pluck(type.Name)\r\n .compact()\r\n .uniq()\r\n .map(function (id) {\r\n var findmatch = GetSelectedPopulation(id, type.type);\r\n if (findmatch != null) {\r\n var findOption = getSelectedConfigRanking(bcvm.configurationRankings, id, type.type);\r\n findmatch.Ranking = (findOption != null) ? findOption.Ranking : 999; // push to the bottom\r\n }\r\n\r\n return findmatch;\r\n })\r\n .filter(function (thing) {\r\n return thing != undefined;\r\n })\r\n .value();\r\n return value;\r\n }\r\n function populationsWithContent() {\r\n\r\n var content = webRpmContent.WelcomeVideos ? webRpmContent.WelcomeVideos.concat(multiLingualContent) : multiLingualContent;\r\n content = kitContent.Slideshows ? kitContent.Slideshows.concat(content) : content;\r\n content = bcvm.settingsPopulations ? bcvm.settingsPopulations.concat(content) : content;\r\n content = webRpmContent.MultiLingualContent ? webRpmContent.MultiLingualContent.concat(content) : content;\r\n content = kitContent.MultiLingualContent ? kitContent.MultiLingualContent.concat(content) : content;\r\n\r\n var types = [{ Name: \"PopulationId\", type: \"P\" }, { Name: \"ProgramGroupId\", type: \"PG\" },\r\n { Name: \"HospitalId\", type: \"H\" }, { Name: \"ProviderId\", type: \"PV\" },\r\n { Name: \"ProviderGroupId\", type: \"PVG\" }, { Name: 'SiteId', type: 'S' }]\r\n\r\n var value = [];\r\n angular.forEach(types, function (type, key) {\r\n var Pluckcontent = pluckContent(type, content);\r\n value = Pluckcontent ? value.concat(Pluckcontent) : value\r\n });\r\n\r\n // sort the list\r\n value.sort((a, b) => a.Ranking - b.Ranking);\r\n setPopulationPriority(value, true);\r\n updatePopulation(value, true);\r\n\r\n return value;\r\n }\r\n\r\n function setPopulationPriority(population, resort) {\r\n var count = 1;\r\n angular.forEach(population, function (v, key) {\r\n //v.configId = count;\r\n if (resort) v.configId = count;\r\n v.IsStatic = false;\r\n if (resort) v.Ranking = count;\r\n\r\n if (v.type === 'S' && !v.IsCurrent) {\r\n v.Ranking = 999;\r\n v.IsStatic = true;\r\n }\r\n\r\n count++;\r\n })\r\n }\r\n\r\n function setCurrentLanguageText(languageId) {\r\n bcvm.language = languageId;\r\n }\r\n\r\n function mapWelcomeVideos() {\r\n var WelcomeVideos = [];\r\n angular.forEach(bcvm.contentPopulations, function (v, k) {\r\n var match = filterConfiguration(webRpmContent.WelcomeVideos, v)\r\n if (match && match.length > 0)\r\n WelcomeVideos[v.configId] = match[0];\r\n })\r\n WelcomeVideos[null] = mapDefaultVideo();\r\n return WelcomeVideos;\r\n }\r\n function mapDefaultVideo() {\r\n return lodash.find(webRpmContent.WelcomeVideos, p => p.PopulationId == null && p.HospitalId == null && p.ProgramGroupId == null && p.ProviderId == null && p.ProviderGroupId == null && p.SiteId == null)\r\n }\r\n\r\n function MapConfigIdtomultiLingualContent(multiLingualContent) {\r\n angular.forEach(multiLingualContent, function (v, k) {\r\n if (!v.configId && v.PopulationId == null && v.HospitalId == null && v.ProgramGroupId == null\r\n && v.ProviderId == null && v.ProviderGroupId == null && v.ProviderGroupId == null && v.SiteId==null) {\r\n v.configId = null;\r\n }\r\n })\r\n angular.forEach(bcvm.contentPopulations, function (population, key) {\r\n var match = filterConfiguration(multiLingualContent, population)\r\n if (match) {\r\n angular.forEach(match, function (v, k) {\r\n v.configId = population.configId;\r\n });\r\n }\r\n })\r\n return multiLingualContent\r\n }\r\n function filterConfiguration(list, population) {\r\n var match = []\r\n if (population.type === 'H') {\r\n match = lodash.filter(list, { HospitalId: population.Id })\r\n }\r\n else if (population.type === 'PG') {\r\n match = lodash.filter(list, { ProgramGroupId: population.Id })\r\n }\r\n else if (population.type == 'PV')\r\n match = lodash.filter(list, { ProviderId: population.ProviderMasterId })\r\n else if (population.type == 'S')\r\n match = lodash.filter(list, { SiteId: population.SiteId })\r\n else if (population.type == 'PVG')\r\n match = lodash.filter(list, { ProviderGroupId: population.Id })\r\n else {\r\n match = lodash.filter(list, { PopulationId: population.PopulationId })\r\n }\r\n return match;\r\n }\r\n\r\n function mapConfig(config) {\r\n config.PopulationConfigurations = lodash(config.PopulationConfigurations).groupBy(\"PopulationId\").mapValues(lodash.first).value();\r\n return config;\r\n }\r\n function mapConfigurations(config) {\r\n // TODO: ... \r\n var PopulationConfigurations = lodash(config.PopulationConfigurations).filter(x => x.PopulationId != null).groupBy(\"PopulationId\").mapValues(lodash.first).value();\r\n var HospitalConfigurations = lodash(config.PopulationConfigurations).filter(x => x.HospitalId != null).groupBy(\"HospitalId\").mapValues(lodash.first).value();\r\n var ProgramGoupConfigurations = lodash(config.PopulationConfigurations).filter(x => x.ProgramGroupId != null).groupBy(\"ProgramGroupId\").mapValues(lodash.first).value();\r\n var ProviderConfigurations = lodash(config.PopulationConfigurations).filter(x => x.ProviderId != null).groupBy(\"ProviderId\").mapValues(lodash.first).value();\r\n var SiteConfigurations = lodash(config.PopulationConfigurations).filter(x => x.SiteId != null).groupBy(\"SiteId\").mapValues(lodash.first).value();\r\n var ProviderGroupConfigurations = lodash(config.PopulationConfigurations).filter(x => x.ProviderGroupId != null).groupBy(\"ProviderGroupId\").mapValues(lodash.first).value();\r\n var configurations = [];\r\n angular.forEach(PopulationConfigurations, function (val, key) {\r\n configurations.push(val);\r\n })\r\n angular.forEach(HospitalConfigurations, function (val, key) {\r\n configurations.push(val);\r\n })\r\n angular.forEach(ProgramGoupConfigurations, function (val, key) {\r\n configurations.push(val);\r\n })\r\n angular.forEach(ProviderConfigurations, function (val, key) {\r\n configurations.push(val);\r\n })\r\n angular.forEach(SiteConfigurations, function (val, key) {\r\n configurations.push(val);\r\n })\r\n angular.forEach(ProviderGroupConfigurations, function (val, key) {\r\n configurations.push(val);\r\n })\r\n\r\n config.PopulationConfigurations = configurations\r\n return config;\r\n }\r\n function selectPopulation(population) {\r\n updateSlideshowImages(population && population.configId ? population.configId : 0);\r\n\r\n if (!population) {\r\n bcvm.selectedconfigId = null;\r\n return bcvm.selectedPopulation = null;\r\n }\r\n var id = '';\r\n if (population.type == 'H' || population.type == 'PG' || population.type == 'PVG')\r\n id = population.Id;\r\n else if (population.type == 'S')\r\n id = population.SiteId;\r\n else if (population.type == 'PV')\r\n id = population.ProviderMasterId;\r\n else\r\n id = population.PopulationId;\r\n\r\n bcvm.selectedPopulation = GetSelectedPopulation(id, population.type)\r\n bcvm.selectedconfigId = bcvm.selectedPopulation ? bcvm.selectedPopulation.configId : null;\r\n if (bcvm.selectedPopulation && bcvm.selectedPopulation.PopulationId) {\r\n bcvm.selectedPopulationId = bcvm.selectedPopulation.PopulationId;\r\n }\r\n }\r\n\r\n function updateSlideshowImages(populationId) {\r\n if (!bcvm.slideshowPopulations[populationId]) {\r\n bcvm.slideshowPopulations[populationId] = [];\r\n }\r\n }\r\n\r\n function deletePopulation(populationId) {\r\n\r\n var options = returnRequest();\r\n ConfigurationContentService.deleteAllMultiLingualContentConfiguration(populationId, configTypeEnum, options);\r\n var welcomeVideo = bcvm.welcomeVideoPopulations[bcvm.selectedPopulation.configId];\r\n var slideshow = bcvm.slideshowPopulations[bcvm.selectedconfigId];\r\n var populationSettings = bcvm.defaultSettings;\r\n\r\n if (welcomeVideo) {\r\n WelcomeVideoService.deleteWelcomeVideo(welcomeVideo.WelcomeVideoId);\r\n delete bcvm.welcomeVideoPopulations[bcvm.selectedPopulation.configId];\r\n }\r\n\r\n angular.forEach(bcvm.multiLingualTypes, function (val, key) {\r\n if (val.populationContent && val.populationContent[bcvm.selectedconfigId])\r\n delete bcvm.multiLingualTypes[key].populationContent[bcvm.selectedconfigId]\r\n })\r\n var DeleteAgreements=[]\r\n angular.forEach(bcvm.Agreements, function (val, key) {\r\n if (!val.populationTitle[null] && !val.populationSubTitle[null] || !val.populationContent[null]) {\r\n DeleteAgreements.push(val.AppAgreementId)\r\n }\r\n\r\n if (val.populationContent && val.populationContent[bcvm.selectedconfigId]) {\r\n delete bcvm.Agreements[key].populationContent[bcvm.selectedconfigId]\r\n }\r\n if (val.populationContent && val.populationTitle[bcvm.selectedconfigId]) {\r\n delete bcvm.Agreements[key].populationTitle[bcvm.selectedconfigId]\r\n }\r\n if (val.populationContent && val.populationSubTitle[bcvm.selectedconfigId]) {\r\n delete bcvm.Agreements[key].populationSubTitle[bcvm.selectedconfigId]\r\n }\r\n })\r\n ConfigurationContentService.deleteAllAgreements(DeleteAgreements)\r\n\r\n if (slideshow) {\r\n slideshow.forEach(function (image) {\r\n var request = returnRequest();\r\n SlideshowService.removeSlide(image.ImageName, bcvm.selectedPopulation.type == \"P\" ? populationId : null, request);\r\n });\r\n\r\n delete bcvm.slideshowPopulations[bcvm.selectedPopulation.configId];\r\n }\r\n var ConfigType = configTypeEnum == 1 ? true : false;\r\n\r\n var canDeletePopulation = (selectedPopulation, v) => {\r\n return (selectedPopulation.Id && selectedPopulation.type === \"H\" && v.HospitalId === populationId) ||\r\n (selectedPopulation.Id && selectedPopulation.type === \"PG\" && v.ProgramGroupId === populationId) ||\r\n (selectedPopulation.ProviderMasterId && selectedPopulation.type === \"PV\" && v.ProviderId === populationId) ||\r\n (selectedPopulation.PopulationId && selectedPopulation.type === \"P\" && v.PopulationId === populationId) ||\r\n (selectedPopulation.SiteId && selectedPopulation.type === \"S\" && v.SiteId === populationId);\r\n }\r\n\r\n if (populationSettings) {\r\n var request = returnRequest();\r\n var DeleteConfigSetting = PopulationSettingsService.deleteSettingsConfiguration(populationId, true, ConfigType, request)\r\n DeleteConfigSetting.then(function () {\r\n populationSettings.forEach(function (setting) {\r\n angular.forEach(setting.PopulationConfigurations, function (v, k) {\r\n if ((bcvm.selectedPopulation.Id != null && bcvm.selectedPopulation.type == \"H\" && v.HospitalId == populationId) ||\r\n (bcvm.selectedPopulation.Id != null && bcvm.selectedPopulation.type == \"PG\" && v.ProgramGroupId == populationId) ||\r\n (bcvm.selectedPopulation.ProviderMasterId != null && bcvm.selectedPopulation.type == \"PV\" && v.ProviderId == populationId) ||\r\n (bcvm.selectedPopulation.PopulationId != null && bcvm.selectedPopulation.type == \"P\" && v.PopulationId == populationId) ||\r\n (bcvm.selectedPopulation.SiteId != null && bcvm.selectedPopulation.type == \"S\" && v.SiteId == populationId) ||\r\n (bcvm.selectedPopulation.Id != null && bcvm.selectedPopulation.type == \"PVG\" && v.ProviderGroupId == populationId)) {\r\n delete setting.PopulationConfigurations[k];\r\n }\r\n })\r\n });\r\n lodash.remove(bcvm.contentPopulations, { configId: bcvm.selectedconfigId })\r\n bcvm.selectPopulation(null)\r\n });\r\n }\r\n\r\n }\r\n\r\n function addedVideo(videoId) {\r\n var request = returnRequest();\r\n request.VideoId = videoId;\r\n request.IsDefault = bcvm.selectedconfigId === null\r\n WelcomeVideoService.createWelcomeVideo(request).then(function (newWelcomeVideo) {\r\n bcvm.welcomeVideoPopulations[bcvm.selectedconfigId] = newWelcomeVideo;\r\n });\r\n }\r\n\r\n function changedVideo(welcomeVideo, videoId) {\r\n WelcomeVideoService.updateWelcomeVideo({\r\n WelcomeVideoId: welcomeVideo.WelcomeVideoId,\r\n VideoId: videoId,\r\n }).then(function (newWelcomeVideo) {\r\n bcvm.welcomeVideoPopulations[bcvm.selectedconfigId] = newWelcomeVideo;\r\n });\r\n }\r\n\r\n function deletedVideo(welcomeVideo) {\r\n WelcomeVideoService.deleteWelcomeVideo(welcomeVideo.WelcomeVideoId);\r\n delete bcvm.welcomeVideoPopulations[bcvm.selectedconfigId];\r\n }\r\n\r\n function addPopulation() {\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/addconfiguration.modal.html',\r\n controller: 'AddGoConfigurationController as vm',\r\n keyboard: false,\r\n resolve: {\r\n canAssignDisabledItems: () => bcvm.canAssignDisabledItems,\r\n showDisabled: () => bcvm.showDisabled,\r\n availablePopulations: function () {\r\n var programs = bcvm.availablePopulations.filter(x => !bcvm.contentPopulations.find(cp => cp.PopulationId == x.PopulationId));\r\n return programs;\r\n },\r\n availableConfigurations: function () {\r\n return [{ Name: \"Hospital\", type: \"H\" },\r\n { Name: \"Program\", type: \"P\" },\r\n { Name: \"Program Group\", type: \"PG\" },\r\n { Name: \"Provider\", type: \"PV\" },\r\n { Name: \"Provider Group\", type: \"PVG\" },\r\n { Name: \"Site\", type: \"S\" },];\r\n },\r\n HospitalAvailable: function () {\r\n var hospitals = bcvm.HospitalSettings ? bcvm.HospitalSettings.filter(x => !bcvm.contentPopulations.find(cp => cp.Id == x.Id && cp.type == 'H')) : [];\r\n return hospitals;\r\n },\r\n availableProgramGroups: function () {\r\n var programGroups = bcvm.ProgramGroupSettings ? bcvm.ProgramGroupSettings.filter(x => !bcvm.contentPopulations.find(cp => cp.Id == x.Id && cp.type == 'PG') && x.IsEnabled) : [];\r\n return programGroups;\r\n },\r\n Providers: function () {\r\n var Providers = bcvm.Providers ? bcvm.Providers.filter(x => !bcvm.contentPopulations.find(cp => cp.ProviderMasterId == x.ProviderMasterId) && x.IsEnabled) : [];\r\n return Providers;\r\n },\r\n availableSites: function () {\r\n var sites = bcvm.SiteSettings ? bcvm.SiteSettings.filter(s => !bcvm.contentPopulations.find(cp => cp.SiteId == s.SiteId && cp.type === 'S')) : [];\r\n return sites;\r\n },\r\n ProviderGroup: function () {\r\n var ProviderGroup = bcvm.ProviderGroup ? bcvm.ProviderGroup.filter(x => !bcvm.contentPopulations.find(cp => cp.Id == x.Id && cp.type == 'PVG')) : [];\r\n return ProviderGroup;\r\n }\r\n\r\n }\r\n }).result.then(function (parameters) {\r\n bcvm.showDisabled = parameters.showDisabled\r\n var filter = GetSelectedPopulation(parameters.PopulationId, parameters.type)\r\n // reset the configId\r\n\r\n var maxValue = Math.max.apply(Math, bcvm.contentPopulations.map(function (o) {\r\n return o.configId;\r\n }));\r\n maxValue = maxValue > 0 ? maxValue : bcvm.contentPopulations.length + 1;\r\n filter.configId = maxValue + 1;\r\n filter.Ranking = bcvm.contentPopulations.length + 1;;\r\n bcvm.contentPopulations.push(filter);\r\n\r\n bcvm.selectedconfigId = filter.configId;\r\n bcvm.selectedPopulationId = parameters.PopulationId;\r\n selectConfiguration(parameters.PopulationId, parameters.type);\r\n\r\n // sync sort order\r\n var content = bcvm.contentPopulations.filter(x => x.IsEnabled);\r\n setPopulationPriority(content);\r\n updatePopulation(content);\r\n\r\n });\r\n }\r\n\r\n function getSelectedConfigRanking(options, id, type) {\r\n\r\n var selectedPopulation = ''\r\n if (type == \"H\") {\r\n selectedPopulation = lodash.find(options, { HospitalId: id, Type: type });\r\n }\r\n else if (type == \"PV\") {\r\n selectedPopulation = lodash.find(options, { ProviderId: id, Type: type });\r\n }\r\n else if (type == \"PG\") {\r\n selectedPopulation = lodash.find(options, { ProgramGroupId: id, Type: type });\r\n }\r\n else if (type == \"P\") {\r\n selectedPopulation = lodash.find(options, { PopulationId: id, Type: type });\r\n }\r\n else if (type == \"PVG\") {\r\n selectedPopulation = lodash.find(options, { ProviderGroupId: id, Type: type });\r\n }\r\n else if (type === 'S') {\r\n selectedPopulation = lodash.find(options, { SiteId: id, Type: type });\r\n }\r\n return selectedPopulation\r\n }\r\n\r\n function GetSelectedPopulation(populationId, type) {\r\n var selectedPopulation = ''\r\n if (type == \"H\") {\r\n selectedPopulation = lodash.find(bcvm.HospitalSettings, { Id: populationId });\r\n selectedPopulation ? selectedPopulation.PopulationName = selectedPopulation.FacilityName : null;\r\n }\r\n else if (type == \"PV\") {\r\n selectedPopulation = lodash.find(bcvm.Providers, { ProviderMasterId: populationId });\r\n selectedPopulation ? selectedPopulation.PopulationName = selectedPopulation.FullName : null;\r\n }\r\n else if (type == \"PG\") {\r\n selectedPopulation = lodash.find(bcvm.ProgramGroupSettings, { Id: populationId });\r\n selectedPopulation ? selectedPopulation.PopulationName = selectedPopulation.Name : null;\r\n }\r\n else if (type == \"P\") {\r\n selectedPopulation = lodash.find(bcvm.availablePopulations, { PopulationId: populationId });\r\n }\r\n else if (type == \"PVG\") {\r\n selectedPopulation = lodash.find(bcvm.ProviderGroup, { Id: populationId });\r\n selectedPopulation ? selectedPopulation.PopulationName = selectedPopulation.Name : null;\r\n }\r\n else if (type === 'S') {\r\n selectedPopulation = lodash.find(bcvm.SiteSettings, { SiteId: populationId });\r\n selectedPopulation ? selectedPopulation.PopulationName = selectedPopulation.Name : null;\r\n }\r\n selectedPopulation ? selectedPopulation.type = type : null\r\n return selectedPopulation\r\n }\r\n\r\n function selectConfiguration(populationId, type) {\r\n updateSlideshowImages(populationId === undefined || populationId === null ? 0 : populationId);\r\n bcvm.selectedPopulation = GetSelectedPopulation(populationId, type)\r\n }\r\n function DeleteAgreement(content) {\r\n vhSweetAlert.verify(\"Are you sure\", \"Deleting this agreement will remove it from this configuration and cannot be undone.\").then(function (confirmed) {\r\n if (confirmed) {\r\n var AppAgreementId = 0\r\n\r\n if (!content.populationTitle[null] && !content.populationSubTitle[null] || !content.populationContent[null]) {\r\n AppAgreementId = content.AppAgreementId\r\n }\r\n var request = []\r\n if (content.populationTitle[bcvm.selectedconfigId]) {\r\n request = mapAgreementDeleteRequest(request, content.populationTitle[bcvm.selectedconfigId])\r\n }\r\n if (content.populationSubTitle[bcvm.selectedconfigId]) {\r\n mapAgreementDeleteRequest(request, content.populationSubTitle[bcvm.selectedconfigId])\r\n }\r\n if (content.populationContent[bcvm.selectedconfigId]) {\r\n mapAgreementDeleteRequest(request, content.populationContent[bcvm.selectedconfigId])\r\n }\r\n request.map(c => {\r\n c.AppAgreementId = AppAgreementId\r\n })\r\n ConfigurationContentService.deleteAgreement(request).then(function (data) {\r\n delete content.populationContent[bcvm.selectedconfigId]\r\n delete content.populationTitle[bcvm.selectedconfigId]\r\n delete content.populationSubTitle[bcvm.selectedconfigId]\r\n if (AppAgreementId > 0) {\r\n delete bcvm.Agreements.filter(x => x.AppAgreementId == AppAgreementId)\r\n }\r\n bcvm.Agreements = [...bcvm.Agreements]\r\n\r\n })\r\n\r\n\r\n }\r\n });\r\n }\r\n function mapAgreementDeleteRequest(req, content) {\r\n angular.forEach(content, function (v, k) {\r\n req.push(v)\r\n })\r\n return req;\r\n }\r\n function mapMultiContentId(content, type) {\r\n if (type == 'Title') {\r\n return content.populationTitle[bcvm.selectedconfigId][bcvm.language].MultiLingualContentId\r\n }\r\n else if (type == 'SubTitle') {\r\n return content.populationSubTitle[bcvm.selectedconfigId][bcvm.language].MultiLingualContentId\r\n }\r\n else {\r\n return content.populationContent[bcvm.selectedconfigId][bcvm.language].MultiLingualContentId\r\n }\r\n }\r\n function addAgreementEntry(contentTypeId) {\r\n var contentTypeGroup = lodash.find(bcvm.Agreements, { AppAgreementId: contentTypeId });\r\n var text\r\n if (contentTypeGroup != null) {\r\n var sd = contentTypeGroup.populationTitle[bcvm.selectedconfigId] ? contentTypeGroup.populationTitle[bcvm.selectedconfigId] : contentTypeGroup.populationTitle[null]\r\n var model = sd[bcvm.language];\r\n if (!model && contentTypeGroup.populationTitle[null]) {\r\n model = contentTypeGroup.populationTitle[null][bcvm.language]\r\n }\r\n text = model ? model.Text : sd[bcvm.DefaultLanguage] ? sd[bcvm.DefaultLanguage].Text : null;\r\n }\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/editcontent.modal.html',\r\n controller: 'EditContentController as vm',\r\n keyboard: false,\r\n resolve: {\r\n content: function () {\r\n return {\r\n title: contentTypeGroup != null ? text : '',\r\n text: '',\r\n dataTypeId: 4,\r\n subTitle: '',\r\n SelectedAgrementType: contentTypeGroup && bcvm.AgrementTypes.find(x => x.AgreementTypeId == contentTypeGroup.AgreementTypeId) ? bcvm.AgrementTypes.find(x => x.AgreementTypeId == contentTypeGroup.AgreementTypeId) : { 'AgreementType': '' },\r\n type: contentConfig.agreementType,\r\n AgreementId: contentTypeGroup && contentTypeGroup.AppAgreementId ? contentTypeGroup.AppAgreementId : null,\r\n message: contentTypeGroup && contentTypeGroup.AppAgreementId ? \"This will replace the current agreement and will force patients to agree to the saved version.\" : bcvm.selectedconfigId ?\"This will create an agreement and force patients to agree to the saved version\" : \"This will create an agreement that cannot be deleted and force patients to agree to the saved version\",\r\n disableNewAgreementFlow: (configTypeEnum === 1 && !bcvm.isHomeNewAgreementFlow) || (configTypeEnum === 2&& !bcvm.isGoNewAgreementFlow),\r\n agreementTypes: bcvm.AgrementTypes\r\n\r\n \r\n \r\n };\r\n }\r\n }\r\n }).result.then(function (parameters) {\r\n\r\n var agrementType=[]\r\n var request = bcvm.AgreementContentTypeid.map(c => {\r\n var cf = returnRequest(bcvm.selectedPopulation);\r\n cf.ConfigTypeEnum = configTypeEnum;\r\n cf.LanguageId = bcvm.language\r\n cf.Text = mapText(c.Type, parameters)\r\n cf.ContentTypeId = c.Id;\r\n cf.AppAgreementId = contentTypeGroup ? contentTypeGroup.AppAgreementId : 0\r\n return cf;\r\n });\r\n\r\n request = request.filter(x => x.Text != '')\r\n if (parameters.agrementType != '') {\r\n var agreement = parameters.agrementType\r\n agreement.AgreementId = contentTypeGroup && contentTypeGroup.AppAgreementId ? contentTypeGroup.AppAgreementId : 0\r\n agreement.ServiceType = configTypeEnum\r\n agrementType.push(agreement)\r\n }\r\n var addagrementRequest = {\r\n AppAgreementMultilingualContentModel: request,\r\n AppAgreementTypeModel: agrementType\r\n }\r\n\r\n ConfigurationContentService.addAgreement(addagrementRequest).then(function (content) {\r\n var AgreementsMap = MapAgreements(content)\r\n var match = contentTypeGroup ? lodash.findIndex(bcvm.Agreements, function (o) { return o.AppAgreementId == contentTypeGroup.AppAgreementId; }) : null;\r\n if (match != null)\r\n bcvm.Agreements[match] = AgreementsMap[0]\r\n else\r\n bcvm.Agreements.push(...AgreementsMap)\r\n })\r\n });\r\n }\r\n function mapText(type, parameters) {\r\n if (type == 'Title') {\r\n return parameters.agreementTitle\r\n }\r\n else if (type == 'SubTitle') {\r\n return parameters.agreementSubTitle\r\n }\r\n else {\r\n return parameters.contentText\r\n }\r\n }\r\n function editAgreementEntry(content) {\r\n var population = content.populationContent[bcvm.selectedconfigId];\r\n var populationSubtitle = content.populationSubTitle[bcvm.selectedconfigId];\r\n var populationTitle = content.populationTitle[bcvm.selectedconfigId] \r\n var populationTitleDefault = content.populationTitle[null]\r\n if (!population) return;\r\n var model = population[bcvm.language];\r\n var modelSubTitle = populationSubtitle && populationSubtitle[bcvm.language] ? populationSubtitle[bcvm.language] : undefined;\r\n var title = content.populationTitle[bcvm.selectedconfigId] != undefined ? populationTitle[bcvm.language] : undefined\r\n var modelTitle = populationTitle && populationTitle[bcvm.language] ? populationTitle[bcvm.language] : undefined;\r\n\r\n var modelTitleDefault\r\n if (modelTitle == undefined && populationTitleDefault && populationTitleDefault[bcvm.language]) {\r\n modelTitleDefault = populationTitleDefault[bcvm.language]\r\n }\r\n if (modelTitleDefault == undefined && populationTitle && populationTitle[bcvm.DefaultLanguage]) {\r\n modelTitleDefault = populationTitle[bcvm.DefaultLanguage]\r\n }\r\n if (modelTitleDefault == undefined && populationTitleDefault && populationTitleDefault[bcvm.DefaultLanguage]) {\r\n modelTitleDefault = populationTitleDefault[bcvm.DefaultLanguage]\r\n }\r\n var languageContent = [title, modelSubTitle, model]\r\n var dataTypeId = model.ContentType ? model.ContentType.ConfigurationDataTypeId:null\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/editcontent.modal.html',\r\n controller: 'EditContentController as vm',\r\n keyboard: false,\r\n resolve: {\r\n content: function () {\r\n return {\r\n title: modelTitle ? modelTitle.Text : modelTitleDefault.Text,\r\n maxLength: content.maxLength,\r\n text: model.Text,\r\n subTitle: modelSubTitle && modelSubTitle.Text ? modelSubTitle.Text : undefined,\r\n SelectedAgrementType: bcvm.AgrementTypes.find(x => x.AgreementTypeId == content.AgreementTypeId) ? bcvm.AgrementTypes.find(x => x.AgreementTypeId == content.AgreementTypeId) : { 'AgreementType': '' },\r\n dataTypeId: dataTypeId,\r\n type: content.AppAgreementId != null ? contentConfig.agreementType : null,\r\n message:\"This will replace the current agreement and will force patients to agree to the saved version.\",\r\n disableNewAgreementFlow: (configTypeEnum === 1 && !bcvm.isHomeNewAgreementFlow) || ((configTypeEnum === 2 && !bcvm.isGoNewAgreementFlow)),\r\n agreementTypes: bcvm.AgrementTypes\r\n };\r\n }\r\n }\r\n }).result.then(function (parameters) {\r\n var agrementType=[]\r\n var request = bcvm.AgreementContentTypeid.map(c => {\r\n var cf = languageContent.find(x => x != null && x.ContentTypeId == c.Id)\r\n if (cf)\r\n cf.Text = mapText(c.Type, parameters)\r\n else {\r\n cf = returnRequest(bcvm.selectedPopulation);\r\n cf.ConfigTypeEnum = configTypeEnum;\r\n cf.LanguageId = bcvm.language\r\n cf.Text = mapText(c.Type, parameters)\r\n cf.ContentTypeId = c.Id;\r\n cf.AppAgreementId = content.AppAgreementId\r\n }\r\n return cf\r\n\r\n })\r\n request = request.filter(x => x.Text != '')\r\n if (parameters.agrementType != '') {\r\n var agreement = parameters.agrementType\r\n agreement.AgreementId = content.AppAgreementId\r\n agreement.ServiceType=configTypeEnum\r\n agrementType.push(agreement)\r\n }\r\n var addagrementRequest = {\r\n AppAgreementMultilingualContentModel: request,\r\n AppAgreementTypeModel: agrementType\r\n }\r\n ConfigurationContentService.addAgreement(addagrementRequest).then(function (data) {\r\n var AgreementsMap = MapAgreements(data)\r\n var match = content ? lodash.findIndex(bcvm.Agreements, function (o) { return o.AppAgreementId == content.AppAgreementId; }) : null;\r\n if (match != null)\r\n bcvm.Agreements[match] = AgreementsMap[0]\r\n else\r\n bcvm.Agreements.push(...AgreementsMap)\r\n })\r\n })\r\n }\r\n\r\n function MapAgreements(content) {\r\n Agreements = MapConfigIdtomultiLingualContent(content);\r\n AgreementsMap = lodash(Agreements)\r\n .groupBy(\"AppAgreementId\")\r\n .mapValues(function (m) {\r\n var aValue = m[0];\r\n var contentType = aValue.AppAgreement;\r\n var filterbyagreementTitle = m.filter(x => x.ContentTypeId == bcvm.AgreementContentTypeid.find(x => x.Type == 'Title').Id);\r\n var filterbyagreementDescription = m.filter(x => x.ContentTypeId == bcvm.AgreementContentTypeid.find(x => x.Type == 'Text').Id)\r\n var filterbyagreementSubTitle = m.filter(x => x.ContentTypeId == bcvm.AgreementContentTypeid.find(x => x.Type == 'SubTitle').Id);\r\n return {\r\n AppAgreementId: contentType && contentType.AppAgreementId ? contentType.AppAgreementId : undefined,\r\n AgreementTypeId: contentType && contentType.AgreementTypeId ? contentType.AgreementTypeId : undefined,\r\n populationTitle: lodash(filterbyagreementTitle).groupBy(\"configId\").mapValues(function (p) {\r\n return lodash(p).groupBy(\"LanguageId\").mapValues(lodash.first).value();\r\n }).value(),\r\n populationSubTitle: lodash(filterbyagreementSubTitle).groupBy(\"configId\").mapValues(function (p) {\r\n return lodash(p).groupBy(\"LanguageId\").mapValues(lodash.first).value();\r\n }).value(),\r\n populationContent: lodash(filterbyagreementDescription).groupBy(\"configId\").mapValues(function (p) {\r\n return lodash(p).groupBy(\"LanguageId\").mapValues(lodash.first).value();\r\n }).value()\r\n };\r\n }\r\n ).values().value()\r\n return AgreementsMap\r\n }\r\n function addEntry(contentType) {\r\n var contentTypeGroup = lodash.find(bcvm.multiLingualTypes, { contentTypeId: contentType });\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/editcontent.modal.html',\r\n controller: 'EditContentController as vm',\r\n keyboard: false,\r\n resolve: {\r\n content: function () {\r\n return {\r\n title: contentTypeGroup.title,\r\n maxLength: contentTypeGroup.maxLength,\r\n text: '',\r\n dataTypeId: contentTypeGroup.contentDataTypeId,\r\n };\r\n }\r\n }\r\n }).result.then(function (parameters) {\r\n var request = returnRequest();\r\n request.ConfigTypeEnum = configTypeEnum;\r\n request.LanguageId = bcvm.language\r\n request.Text = parameters.contentText;\r\n request.ContentTypeId = contentType;\r\n ConfigurationContentService.addMultiLingualContent(request).then(function (content) {\r\n var populationContent = contentTypeGroup.populationContent[bcvm.selectedconfigId];\r\n if (!populationContent) {\r\n contentTypeGroup.populationContent[bcvm.selectedconfigId] = {};\r\n populationContent = contentTypeGroup.populationContent[bcvm.selectedconfigId];\r\n }\r\n populationContent[bcvm.language] = content;\r\n bcvm.contentPopulations = [...bcvm.contentPopulations];\r\n });\r\n });\r\n }\r\n\r\n function editEntry(content) {\r\n var population = content.populationContent[bcvm.selectedconfigId];\r\n if (!population) return;\r\n var model = population[bcvm.language];\r\n var text = model.Text;\r\n var dataTypeId = model.ContentType ? model.ContentType.ConfigurationDataTypeId:null\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/editcontent.modal.html',\r\n controller: 'EditContentController as vm',\r\n keyboard: false,\r\n resolve: {\r\n content: function () {\r\n return {\r\n title: content.AppAgreementId != null ? content.AgreementTitle : content.title,\r\n maxLength: content.maxLength,\r\n text: text,\r\n dataTypeId: dataTypeId,\r\n type: content.AppAgreementId != null ? contentConfig.agreementType : null\r\n };\r\n }\r\n }\r\n }).result.then(function (parameters) {\r\n model.Text = parameters.contentText;\r\n ConfigurationContentService.updateMultiLingualContent(model);\r\n if (content.AppAgreementId) {\r\n model.AppAgreement.AgreementTitle = parameters.agreementTitle;\r\n content.AgreementTitle == parameters.agreementTitle;\r\n ConfigurationContentService.updateAgreementContent(model.AppAgreement)\r\n }\r\n });\r\n }\r\n function returnRequest(selectedPopulation) {\r\n\r\n selectedPopulation = selectedPopulation || bcvm.selectedPopulation;\r\n\r\n var request = {\r\n PopulationId: selectedPopulation && selectedPopulation.type === 'P' ? selectedPopulation.PopulationId : null,\r\n HospitalId: selectedPopulation && selectedPopulation.type === 'H' ? selectedPopulation.Id : null,\r\n ProgramGroupId: selectedPopulation && selectedPopulation.type === 'PG' ? selectedPopulation.Id : null,\r\n ProviderId: selectedPopulation && selectedPopulation.type === 'PV' ? selectedPopulation.ProviderMasterId : null,\r\n SiteId: selectedPopulation && selectedPopulation.type === 'S' ? selectedPopulation.SiteId : null,\r\n ProviderGroupId: selectedPopulation && selectedPopulation.type === 'PVG' ? selectedPopulation.Id : null,\r\n }\r\n return request;\r\n }\r\n function deleteEntry(content) {\r\n vhSweetAlert.verify(\"Are you sure\", \"Are you sure you want to revert entry to default?\").then(function (confirmed) {\r\n if (confirmed) {\r\n var request = returnRequest(bcvm.selectedPopulation);\r\n request.ContentTypeId = content.contentTypeId;\r\n request.ContentType = { ConfigTypeEnum: configTypeEnum }\r\n request.LanguageId = bcvm.language ? bcvm.language : 0\r\n ConfigurationContentService.deleteMultiLingualContentConfiguration(request);\r\n delete content.populationContent[bcvm.selectedconfigId][request.LanguageId];\r\n bcvm.contentPopulations = [...bcvm.contentPopulations];\r\n }\r\n });\r\n }\r\n\r\n function updatePopulation(populations, sync) {\r\n\r\n var service = (configTypeEnum == 2) ? 'go' : (configTypeEnum == 1) ? 'home' : null;\r\n if (!service) return;\r\n\r\n var request = populations.map(c => {\r\n var cf = returnRequest(c);\r\n cf.ConfigService = service;\r\n cf.Ranking = c.Ranking;\r\n cf.Type = c.type;\r\n cf.SiteId = c.SiteId;\r\n return cf;\r\n });\r\n if (bcvm.isSortable) {\r\n ConfigurationContentService.updateConfigurationRankings(service, sync || false, request);\r\n }\r\n\r\n }\r\n}\r\n\r\nangular.module(\"configurations.content\").controller(\"GoConfigurationController\", GoConfigurationController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/goconfigurations.tpl.html',\n '

    {{bcvm.pageType}} Configurations

    Patient Configurations Show Disabled Programs
    {{bcvm.selectedPopulation.PopulationName || \\'Default\\'}} (disabled) Settings
    {{bcvm.pageType}} Configurations
    {{bcvm.pageType}} Text
    {{content.title}}
    (From Default Settings)
     (Id :{{content.AppAgreementId}})
    (From Default Settings)
    0 && bcvm.language == bcvm.DefaultLanguage\">
    Agreement Title
    (From Default Settings)
    Agreement Content
    ');\n}]);\n}(window, document, window.angular));","function ContentPopulationsDirective(lodash, vhSweetAlert) {\r\n return {\r\n restrict: \"E\", \r\n template: '',\r\n scope: {\r\n showDisabled: \"=\",\r\n viewPopulations: \"=\",\r\n selectedPopulationId: \"=\",\r\n sorteable: \"=\",\r\n selectedPopulation: \"&\",\r\n deletedPopulation: \"&\",\r\n updatedPopulation: \"&\"\r\n },\r\n controllerAs: 'vm',\r\n controller: function name($scope) {\r\n var vm = this;\r\n this.showDisabled = $scope.showDisabled;\r\n this.viewPopulations = $scope.viewPopulations;\r\n\r\n var getViewablePopulation = () => $scope.viewPopulations.filter(x => (x.IsEnabled && !x.IsStatic) || (this.showDisabled && !x.IsStatic))\r\n var getStaticPopulation = () => $scope.viewPopulations.filter(x => (x.IsStatic));\r\n\r\n this.filteredPopulations = getViewablePopulation();\r\n this.staticPopulations = getStaticPopulation();\r\n \r\n vm.dragListeners = {\r\n orderChanged: orderChanged,\r\n };\r\n\r\n init = () => {\r\n var selectedItem = null;\r\n var list = ($scope.sorteable) ? getViewablePopulation() : null;\r\n if (list) selectedItem = list[0];\r\n \r\n $scope.selectPopulation(selectedItem);\r\n }\r\n\r\n $scope.getTemplateUrl = function () {\r\n var sorteable = ($scope.sorteable) ? '.sortable' : '';\r\n return `modules/configurations/content/populations${sorteable}.tpl.html`;\r\n }\r\n\r\n $scope.$watch('showDisabled', showDisabled => {\r\n this.showDisabled = showDisabled;\r\n this.filteredPopulations = getViewablePopulation();\r\n });\r\n\r\n $scope.$watch('viewPopulations', (newPopulations, oldPopulations) => {\r\n this.filteredPopulations = getViewablePopulation();\r\n this.staticPopulations = getStaticPopulation();\r\n });\r\n\r\n $scope.$watch('selectedPopulationId', _ => {\r\n this.filteredPopulations = getViewablePopulation();\r\n this.staticPopulations = getStaticPopulation();\r\n });\r\n\r\n $scope.selectPopulation = function (population) {\r\n $scope.selectedPopulationId = population ? population.configId : null;\r\n $scope.selectedPopulation({ populationId: population });\r\n };\r\n\r\n $scope.isConfigurationActive = function (population) {\r\n if (population.type && population.type === 'S')\r\n return !population.IsCurrent;\r\n \r\n return !population.IsEnabled;\r\n }\r\n\r\n $scope.returnTypeName = function (type) {\r\n var types = [{ Name: \"Program\", type: \"P\" }, \r\n { Name: \"Hospital\", type: \"H\" }, \r\n { Name: \"Program Group\", type: \"PG\" }, \r\n { Name: \"Provider\", type: \"PV\" }, \r\n { Name: \"Provider Group\", type: \"PVG\" }, \r\n { Name: \"Site\", type: \"S\" }]\r\n var filter=types.filter(x => x.type == type).map(function (x) {\r\n return x.Name;\r\n })\r\n return filter.length > 0? filter[0]:null;\r\n }\r\n \r\n $scope.deletePopulation = function (population) {\r\n vhSweetAlert.verify(\"Are you sure?\", \"Do you want to delete \" + population.PopulationName + \"?\", \"Delete\")\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n var pendingId = getPopulationId(population);\r\n $scope.deletedPopulation({ populationId: pendingId });\r\n removePopulation(population, pendingId);\r\n\r\n if ($scope.selectedPopulationId === pendingId && population.PopulationId) {\r\n // there a watch on this and will filter the results ...\r\n $scope.selectedPopulationId = null;\r\n $scope.selectedPopulation({populationId: null});\r\n } \r\n }\r\n });\r\n };\r\n\r\n vm.orderChanged = orderChanged;\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n for(var i = 0; i < list.length; i++) {\r\n list[i].Ranking = i + 1;\r\n\r\n var item = $scope.viewPopulations.filter(a => a.configId == list[i].configId);\r\n if (item){\r\n item.Ranking = list[i].Ranking;\r\n }\r\n }\r\n\r\n // sort the list\r\n $scope.viewPopulations.sort((a, b) => a.Ranking - b.Ranking);\r\n for (var i = 0; i < $scope.viewPopulations.length; i++) {\r\n $scope.viewPopulations[i].Ranking = i + 1;\r\n\r\n var item = $scope.viewPopulations.filter(a => a.configId == $scope.viewPopulations[i].configId);\r\n if (item) {\r\n item.Ranking = $scope.viewPopulations[i].Ranking;\r\n }\r\n }\r\n $scope.updatedPopulation({ populations: $scope.viewPopulations });\r\n\r\n }\r\n\r\n function getPopulationId(population){\r\n var pendingId;\r\n\r\n if (population.type === 'PV')\r\n pendingId = population.ProviderMasterId;\r\n else if (population.SiteId && population.type === 'S')\r\n pendingId = population.SiteId;\r\n else if (population.type == 'H' || population.type == 'PG' || population.type=='PVG')\r\n pendingId = population.Id;\r\n else {\r\n pendingId = population.PopulationId; \r\n }\r\n\r\n return pendingId;\r\n }\r\n\r\n function removePopulation(population, pendingId) {\r\n // type can be H - Hospital | PG - ProgramGroup | S - Site | PV - Provider \r\n if (population.type === 'H' || population.type === 'PG')\r\n lodash.remove($scope.viewPopulations, { Id: pendingId, type: population.type });\r\n else if (population.type === 'PV')\r\n lodash.remove($scope.viewPopulations, { ProviderMasterId: pendingId, type: population.type })\r\n else if (population.type === 'S')\r\n lodash.remove($scope.viewPopulations, { SiteId: pendingId, type: population.type })\r\n else \r\n lodash.remove($scope.viewPopulations, { PopulationId: pendingId });\r\n }\r\n\r\n \r\n init();\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"configurations.content\").directive(\"contentPopulations\", ContentPopulationsDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/populations.sortable.tpl.html',\n '

     {{population.PopulationName}} - {{returnTypeName(population.type)}} (disabled)

     Default Settings

     {{population.PopulationName}} - {{returnTypeName(population.type)}} (disabled)

    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/populations.tpl.html',\n '

     Default Settings

     {{population.PopulationName}} - {{returnTypeName(population.type)}} (disabled)

     {{population.PopulationName}} - {{returnTypeName(population.type)}} (disabled)

    ');\n}]);\n}(window, document, window.angular));","function EditPopulationSettingController(setting, PermissionService, SettingsService, PopulationSettingsService, $uibModalInstance) {\r\n var vm = this;\r\n\r\n vm.setting = setting;\r\n loadController();\r\n\r\n function loadController() {\r\n vm.canEditSettings = PermissionService.userHasPermission([\"ConfigurationsWrite\"]);\r\n\r\n vm.saveSetting = saveSetting;\r\n vm.cancelEditing = cancelEditing;\r\n }\r\n\r\n function saveSetting(isValid) {\r\n vm.alerts = [];\r\n\r\n if(isValid) {\r\n save();\r\n }\r\n }\r\n\r\n function cancelEditing() {\r\n if(vm.fileUploader.uploading) {\r\n vm.fileUploader.cancelAll();\r\n }\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n vm.fileUploader = PopulationSettingsService.getFileUploader();\r\n vm.fileUploader.onWhenAddingFileFailed = onWhenAddingFileFailed;\r\n vm.fileUploader.onAfterAddingFile = onAfterAddingFile;\r\n\r\n vm.setting.fileUploader = vm.fileUploader;\r\n\r\n var theFile;\r\n var noNameError = {text: \"Image name required\", type: 'danger'};\r\n var nameLengthError = {text: \"Image name must be 50 characters or less\", type: 'danger'};\r\n var fileNameValidationError = {text: \"File name has illegal characters.\", type: 'danger'};\r\n var fileNameExistsError = {text: 'File name already exists.', type: 'danger'};\r\n\r\n function save() {\r\n if(vm.setting.ConfigurationDataTypeId === SettingsService.settingTypeMap.filepath){\r\n uploadMedia();\r\n }\r\n else {\r\n PopulationSettingsService.saveSetting(vm.setting.populationSetting).then(function(result){\r\n vm.setting.populationSetting.Value = result.Value;\r\n $uibModalInstance.close(result);\r\n });\r\n }\r\n }\r\n\r\n function validatePath() {\r\n var retVal = true;\r\n\r\n if (!isValidFileName(vm.fileName)) {\r\n vm.alerts.push(fileNameValidationError);\r\n retVal = false;\r\n }\r\n\r\n if(vm.fileName.length > 50) {\r\n vm.alerts.push(nameLengthError);\r\n retVal = false;\r\n }\r\n\r\n if(vm.fileName.length === 0) {\r\n vm.alerts.push(noNameError);\r\n retVal = false;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function uploadMedia() {\r\n if(validatePath()) {\r\n var resourceName = vm.fileName.split('.')[0],\r\n fileParts = theFile.file.name.split('.'),\r\n fileExtention = fileParts[fileParts.length -1];\r\n\r\n theFile.formData = [{PopulationId: vm.setting.populationSetting.PopulationId, ConfigurationId: vm.setting.populationSetting.ConfigurationId, ResourceScope: 'custom', ResourceType: 'Population', ResourceName: resourceName + '.' + fileExtention }];\r\n theFile.upload();\r\n }\r\n }\r\n\r\n function isValidFileName(name) {\r\n var fileNameRegEx = /^[A-Za-z0-9\\._-]*$/;\r\n return fileNameRegEx.test(name);\r\n }\r\n\r\n function onAfterAddingFile(fileItem) {\r\n var fileName = fileItem.file.name;\r\n\r\n if (fileName.length > 20) {\r\n fileName = fileName.slice(0,20);\r\n fileName += '...';\r\n }\r\n vm.fileName = fileName;\r\n vm.alerts = [];\r\n if (theFile) {\r\n vm.fileUploader.removeFromQueue(theFile);\r\n }\r\n\r\n if(!validatePath()) {\r\n return;\r\n }\r\n\r\n theFile = fileItem;\r\n theFile.onProgress = function (progress) {\r\n if (progress == 100) {\r\n progress = 99;\r\n }\r\n vm.progress = progress;\r\n };\r\n\r\n theFile.onSuccess = function (response, status, headers) {\r\n vm.setting.populationSetting.Value = response.ImageName;\r\n\r\n $uibModalInstance.close(response);\r\n };\r\n\r\n theFile.onError = function (response, status, headers) {\r\n var errorText;\r\n if (vm.isIENine) {\r\n errorText = response;\r\n } else {\r\n errorText = response.ErrorMessage;\r\n }\r\n vm.alerts = [{text: errorText, type: 'danger'}];\r\n };\r\n };\r\n\r\n function onWhenAddingFileFailed(item, filter, options) {\r\n vm.fileUploader.clearQueue();\r\n theFile = null;\r\n vm.fileName = null;\r\n var alertText;\r\n if (filter.name == \"typeFilter\") {\r\n alertText = \"Could not add image. File must be an image format\";\r\n } else if (filter.name == \"sizeFilter\") {\r\n alertText = \"Could not add image. File size must be less than 50MB\";\r\n } else if (filter.name == \"emptyFilter\") {\r\n alertText = \"Cannot upload an empty file.\";\r\n }\r\n vm.alerts = [{text: alertText, type: 'danger'}];\r\n };\r\n}\r\n\r\nangular.module('configurations').controller('EditPopulationSettingController', EditPopulationSettingController);\r\n","function PopulationSettingValueInput($compile, $window, SettingsService) {\r\n function linker(scope, element, attrs) {\r\n if ($window.FileReader === undefined) {\r\n scope.tools = [\r\n ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'],\r\n ['bold', 'italics', 'underline'],\r\n ['ul', 'ol'],\r\n ['justifyLeft', 'justifyCenter', 'justifyRight'],\r\n ['fontColor']\r\n ];\r\n } else {\r\n scope.tools = [\r\n ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'],\r\n ['bold', 'italics', 'underline'],\r\n ['ul', 'ol'],\r\n ['justifyLeft', 'justifyCenter', 'justifyRight'],\r\n ['fontColor', 'insertImage']\r\n ];\r\n }\r\n\r\n var template = getTemplate(scope.model.ConfigurationDataTypeId, scope.model.ValidValues, scope);\r\n\r\n var input = $compile(template)(scope);\r\n\r\n element.replaceWith(input);\r\n }\r\n\r\n function getTemplate(type, validValues, scope) {\r\n var retVal = '';\r\n\r\n var typeMap = SettingsService.settingTypeMap;\r\n\r\n switch (type) {\r\n case typeMap.int:\r\n case typeMap.double:\r\n case typeMap.onedecimal:\r\n if (validValues.length > 0) {\r\n var minMax = validValues.split(',');\r\n retVal = ' 0) {\r\n scope.options = validValues.split(',');\r\n retVal = '';\r\n }\r\n break;\r\n case typeMap.email:\r\n retVal = '';\r\n break;\r\n case typeMap.filepath:\r\n retVal = '';\r\n break;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n return {\r\n restrict: 'E',\r\n require: 'ngModel',\r\n scope: {\r\n model: '=ngModel'\r\n },\r\n link: linker\r\n };\r\n}\r\n\r\nangular.module('configurations').directive('populationSettingValueInput', PopulationSettingValueInput);\r\n","function PopulationSettingsDirective($uibModal, lodash, vhSweetAlert, SettingsService, PopulationSettingsService) {\r\n\r\n function controller($scope){\r\n $scope.getDescription = function(setting) {\r\n var retVal = 'No description.';\r\n\r\n if(setting.Description) {\r\n if (setting.Description !== null && setting.Description !== undefined){\r\n retVal = setting.Description;\r\n }\r\n }\r\n\r\n return retVal;\r\n };\r\n\r\n $scope.getValue = function(setting) {\r\n var retVal = setting.Value;\r\n\r\n if($scope.selectedPopulation === undefined || $scope.selectedPopulation === null){\r\n return retVal;\r\n }\r\n\r\n var populationSetting = findPopulationSettings($scope.selectedPopulation, setting);\r\n if(populationSetting && populationSetting.Value){\r\n retVal = populationSetting.Value;\r\n }\r\n\r\n return retVal;\r\n };\r\n\r\n $scope.canDelete = function(){\r\n var items = lodash($scope.defaultSettings).filter(function(setting){\r\n return $scope.hasValue(setting);\r\n }).value();\r\n\r\n return items.length > 0;\r\n };\r\n\r\n $scope.hasValue = function(setting){\r\n if($scope.selectedPopulation === undefined || $scope.selectedPopulation === null){\r\n return false;\r\n }\r\n\r\n var populationSetting = findPopulationSettings($scope.selectedPopulation, setting);\r\n return !!(populationSetting && populationSetting.Value);\r\n };\r\n\r\n $scope.isImage = function(setting) {\r\n return setting.ConfigurationDataTypeId === SettingsService.settingTypeMap.filepath;\r\n };\r\n\r\n $scope.delete = function(setting) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete population setting ' + setting.Param + '?').then(function(isConfirm){\r\n if(isConfirm) {\r\n\r\n var populationSetting = findPopulationSettings($scope.selectedPopulation, setting);\r\n if (!populationSetting) return; // nothing to be delete\r\n\r\n var promise;\r\n if (setting.ConfigurationDataTypeId === SettingsService.settingTypeMap.filepath) {\r\n promise = PopulationSettingsService.deleteMedia(populationSetting);\r\n } else {\r\n promise = PopulationSettingsService.deleteSetting(populationSetting);\r\n }\r\n\r\n promise.then(function (result) {\r\n angular.forEach(setting.PopulationConfigurations, function (v, k) {\r\n var population = getPopulationSetting($scope.selectedPopulation, v);\r\n if (population){\r\n delete setting.PopulationConfigurations[k];\r\n }\r\n })\r\n });\r\n }\r\n });\r\n };\r\n\r\n getPopulationSetting = (selectedPopulation, setting) => {\r\n\r\n if (!setting) return null;\r\n\r\n if (selectedPopulation.type === 'H' && selectedPopulation.Id === setting.HospitalId)\r\n return setting;\r\n else if (selectedPopulation.type === 'PG' && selectedPopulation.Id === setting.ProgramGroupId){\r\n return setting;\r\n }\r\n else if (selectedPopulation.type === 'PV' && selectedPopulation.ProviderMasterId === setting.ProviderId) {\r\n return setting;\r\n }\r\n else if (selectedPopulation.type === 'S' && selectedPopulation.SiteId === setting.SiteId) {\r\n return setting;\r\n }\r\n else if (selectedPopulation.type === 'PVG' && selectedPopulation.Id === setting.ProviderGroupId) {\r\n return setting;\r\n } \r\n else if (selectedPopulation.PopulationId && selectedPopulation.PopulationId === setting.PopulationId) {\r\n return setting;\r\n }\r\n }\r\n \r\n findPopulationSettings = (selectedPopulation, setting) => {\r\n\r\n if (!$scope.selectedPopulation) return null;\r\n\r\n if (selectedPopulation.type === 'H'){\r\n return lodash.find(setting.PopulationConfigurations, { HospitalId: $scope.selectedPopulation.Id });\r\n } else if (selectedPopulation.type === 'PG') {\r\n return lodash.find(setting.PopulationConfigurations, { ProgramGroupId: $scope.selectedPopulation.Id });\r\n }\r\n else if (selectedPopulation.type === 'PV') {\r\n return lodash.find(setting.PopulationConfigurations, { ProviderId: $scope.selectedPopulation.ProviderMasterId });\r\n }\r\n else if (selectedPopulation.type === 'S') {\r\n return lodash.find(setting.PopulationConfigurations, { SiteId: $scope.selectedPopulation.SiteId });\r\n }\r\n else if (selectedPopulation.type === 'PVG') {\r\n return lodash.find(setting.PopulationConfigurations, { ProviderGroupId: $scope.selectedPopulation.Id });\r\n }\r\n else {\r\n return lodash.find(setting.PopulationConfigurations, { PopulationId: $scope.selectedPopulation.PopulationId });\r\n }\r\n }\r\n\r\n $scope.editValue = function(setting) {\r\n var populationSetting;\r\n\r\n SettingConfig = findPopulationSettings($scope.selectedPopulation, setting);\r\n if (!SettingConfig) {\r\n populationSetting = {\r\n ConfigurationId: setting.Id,\r\n PopulationId: $scope.selectedPopulation.PopulationId ? $scope.selectedPopulation.PopulationId:null,\r\n HospitalId: $scope.selectedPopulation.type === 'H' && $scope.selectedPopulation.Id ? $scope.selectedPopulation.Id :null,\r\n ProgramGroupId: $scope.selectedPopulation.type === 'PG' && $scope.selectedPopulation.Id ? $scope.selectedPopulation.Id : null,\r\n ProviderId: $scope.selectedPopulation.ProviderMasterId ? $scope.selectedPopulation.ProviderMasterId : null,\r\n SiteId: $scope.selectedPopulation.type === 'S' && $scope.selectedPopulation.SiteId ? $scope.selectedPopulation.SiteId : null,\r\n ProviderGroupId: $scope.selectedPopulation.type === 'PVG' && $scope.selectedPopulation.Id ? $scope.selectedPopulation.Id : null, \r\n Value: setting.Value\r\n };\r\n }\r\n else {\r\n populationSetting = SettingConfig;\r\n }\r\n\r\n setting.populationSetting = populationSetting;\r\n\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/configurations/content/populationsettings/populationsettings.modal.html',\r\n controller: 'EditPopulationSettingController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n setting: function () {\r\n return setting;\r\n }\r\n }\r\n }).result.then(function (result) {\r\n setting.PopulationConfigurations[$scope.selectedPopulation.configId] = result;\r\n });\r\n }\r\n\r\n\r\n }\r\n\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/configurations/content/populationsettings/populationsettings.tpl.html\",\r\n scope: {\r\n selectedPopulation: '=',\r\n defaultSettings: '='\r\n },\r\n controller: controller\r\n }\r\n}\r\n\r\nangular.module(\"configurations\").directive(\"populationSettings\", PopulationSettingsDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/populationsettings/populationsettings.modal.html',\n '

    {{vm.setting.Param}}

    {{vm.progress}}%
    ');\n}]);\n}(window, document, window.angular));","function PopulationSettingsService($http, FileUploader) {\r\n\r\n function getFileUploader() {\r\n var fileUploader = new FileUploader({\r\n url: '/api/Configuration/Population/media'\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function(item, options) {\r\n var type = item.type;\r\n return (type == 'image/png');\r\n }\r\n });\r\n\r\n return fileUploader;\r\n }\r\n\r\n function deleteMedia(populationConfiguration) {\r\n return $http.post('/api/Configuration/Population/media/delete', populationConfiguration).then(function(result){\r\n return result;\r\n });\r\n }\r\n\r\n function deleteSetting(populationConfiguration) {\r\n return $http.post('/api/Configuration/Population/delete', populationConfiguration).then(function(result){\r\n return result.data;\r\n });\r\n }\r\n\r\n function deleteSettings(populationId) {\r\n return $http.delete('/api/Configuration/Population/' + populationId + '/delete');\r\n }\r\n\r\n function deleteSettingsConfiguration(populationId, identity, type, option) {\r\n \r\n if (option && (option.HospitalId || option.ProviderId || option.ProgramGroupId || option.SiteId || option.ProviderGroupId)) {\r\n populationId = null;\r\n }\r\n else {\r\n option = {};\r\n option.PopulationId = populationId\r\n }\r\n\r\n var request = option;\r\n request.Identity = identity;\r\n request.Type = type;\r\n return $http.post('/api/Configuration/Population/deleteAllConfig', request);\r\n }\r\n\r\n function saveSetting(populationSetting) {\r\n return $http.post('/api/Configuration/Population', populationSetting).then(function(result){\r\n return result.data;\r\n });\r\n }\r\n\r\n return {\r\n getFileUploader: getFileUploader,\r\n deleteMedia: deleteMedia,\r\n deleteSetting: deleteSetting,\r\n deleteSettings: deleteSettings,\r\n saveSetting: saveSetting,\r\n deleteSettingsConfiguration: deleteSettingsConfiguration\r\n }\r\n}\r\n\r\nangular.module('configurations').factory('PopulationSettingsService', PopulationSettingsService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/populationsettings/populationsettings.tpl.html',\n '
    Settings
    {{setting.Param}}{{getValue(setting)}}
    ');\n}]);\n}(window, document, window.angular));","function SelectVideoController(videos, selectedVideoId, $uibModalInstance, $scope) {\r\n var vm = this;\r\n vm.videos = videos;\r\n vm.VideoId = selectedVideoId;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n\r\n function ok() {\r\n if ($scope.selectVideo.$valid) {\r\n $uibModalInstance.close(vm.VideoId);\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('configurations.content').controller('SelectVideoController', SelectVideoController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/selectvideo.modal.html',\n '

    Select Video

    ');\n}]);\n}(window, document, window.angular));","function ContentSlideshowDirective($uibModal, PermissionService, SlideshowService, vhSweetAlert) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/configurations/content/slideshow/slideshow.tpl.html\",\r\n scope: {\r\n selectedPopulation: \"=\",\r\n images: \"=\",\r\n selectPopulation: \"=\"\r\n },\r\n link: function(scope, elem, attrs) {\r\n\r\n scope.canEdit = PermissionService.userHasPermission(['MediaWrite']);\r\n scope.addSlideshowImageModal = addSlideshowImageModal;\r\n scope.selectImage = selectImage;\r\n scope.deleteImage = deleteImage;\r\n\r\n function selectImage(image) {\r\n scope.selectedImage = image;\r\n }\r\n\r\n function getPopulationId(selectedPopulation) {\r\n if(selectedPopulation !== undefined && selectedPopulation !== null) {\r\n return selectedPopulation.PopulationId || 0;\r\n }\r\n return 0;\r\n }\r\n\r\n function deleteImage(image) {\r\n var request = {\r\n HospitalId: scope.selectedPopulation && scope.selectedPopulation.Id && scope.selectedPopulation.type == \"H\" ? scope.selectedPopulation.Id : null,\r\n ProgramGroupId: scope.selectedPopulation && scope.selectedPopulation.Id && scope.selectedPopulation.type == \"PG\" ? scope.selectedPopulation.Id : null,\r\n ProviderId: scope.selectedPopulation && scope.selectedPopulation.ProviderMasterId && scope.selectedPopulation.type == \"PV\" ? scope.selectedPopulation.ProviderMasterId : null,\r\n ProviderGroupId: scope.selectedPopulation && scope.selectedPopulation.Id && scope.selectedPopulation.type == \"PVG\" ? scope.selectedPopulation.Id : null,\r\n SiteId: scope.selectedPopulation && scope.selectedPopulation.SiteId && scope.selectedPopulation.type == \"S\" ? scope.selectedPopulation.SiteId : null,\r\n }\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete image' + image.ImageName + '?').then(function (isConfirm) {\r\n if (isConfirm) {\r\n if (scope.selectedPopulation && (scope.selectedPopulation.Id || scope.selectedPopulation.ProviderMasterId || scope.selectedPopulation.SiteId)) {\r\n SlideshowService.removeSlide(image.ImageName, getPopulationId(scope.selectedPopulation), request).then(function (data) {\r\n if (data.success) {\r\n var idx = scope.images.indexOf(image);\r\n if (idx > -1) {\r\n scope.images.splice(idx, 1);\r\n }\r\n }\r\n });\r\n } else {\r\n SlideshowService.remove(image.ImageName, getPopulationId(scope.selectedPopulation)).then(function (data) {\r\n if (data.success) {\r\n var idx = scope.images.indexOf(image);\r\n if (idx > -1) {\r\n scope.images.splice(idx, 1);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n function addSlideshowImageModal() {\r\n $uibModal.open({\r\n controller: \"SlideshowAddCtrl\",\r\n templateUrl: \"modules/configurations/content/slideshow/slideshowAdd.modal.html\",\r\n resolve: {\r\n selectedPopulation:function() {\r\n return scope.selectedPopulation;\r\n },\r\n currentList: function () {\r\n return scope.images;\r\n }\r\n }\r\n }).result.then(function(){\r\n var populationId = getPopulationId(scope.selectedPopulation);\r\n var request = {\r\n HospitalId: scope.selectedPopulation && scope.selectedPopulation.Id && scope.selectedPopulation.type && scope.selectedPopulation.type == \"H\" ? scope.selectedPopulation.Id : null,\r\n ProgramGroupId: scope.selectedPopulation && scope.selectedPopulation.Id && scope.selectedPopulation.type && scope.selectedPopulation.type == \"PG\" ? scope.selectedPopulation.Id : null,\r\n ProviderId: scope.selectedPopulation && scope.selectedPopulation.ProviderMasterId && scope.selectedPopulation.type && scope.selectedPopulation.type == \"PV\" ? scope.selectedPopulation.ProviderMasterId : null,\r\n ProviderGroupId: scope.selectedPopulation && scope.selectedPopulation.Id && scope.selectedPopulation.type && scope.selectedPopulation.type == \"PVG\" ? scope.selectedPopulation.Id : null,\r\n SiteId: scope.selectedPopulation && scope.selectedPopulation.SiteId && scope.selectedPopulation.type && scope.selectedPopulation.type == \"S\" ? scope.selectedPopulation.SiteId : null,\r\n }\r\n SlideshowService.getPopulation(populationId, request).then(function (populationImages) {\r\n scope.images = populationImages;\r\n });\r\n });\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"configurations\").directive(\"contentSlideshow\", ContentSlideshowDirective);","function SlideshowService($http, FileUploader) {\r\n return {\r\n getPopulation: function (populationId, request) {\r\n populationId = populationId || 0;\r\n return $http({\r\n method: 'GET',\r\n url: '/api/Slideshow',\r\n params: {\r\n populationId: populationId,\r\n hospitalId: request && request.HospitalId ? request.HospitalId : null,\r\n programGroupId: request && request.ProgramGroupId ? request.ProgramGroupId : null,\r\n ProviderId: request && request.ProviderId ? request.ProviderId : null,\r\n ProviderGroupId: request && request.ProviderGroupId ? request.ProviderGroupId : null,\r\n SiteId: request && request.SiteId ? request.SiteId : null,\r\n },\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n },\r\n\r\n get: function() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/SlideShow/GetAll'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n },\r\n\r\n remove: function(imageName, populationId) {\r\n return $http.delete('/api/slideshow', {\r\n params: {\r\n resourceScope: 'custom',\r\n resourceType: 'SlideShow',\r\n resourceName: imageName,\r\n populationId: populationId\r\n }\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n },\r\n removeSlide: function (imageName, populationId, request) {\r\n var sendRequest = {\r\n resourceScope: 'custom',\r\n resourceType: 'SlideShow',\r\n resourceName: imageName,\r\n PopulationId: populationId,\r\n HospitalId: request.HospitalId,\r\n ProgramGroupId: request.ProgramGroupId,\r\n ProviderId: request.ProviderId,\r\n ProviderGroupId: request.ProviderGroupId,\r\n SiteId: request.SiteId\r\n }\r\n return $http.post('/api/slideshow/DeleteHomeSlide/', sendRequest).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n\r\n getFileUploader: function() {\r\n var fileUploader = new FileUploader({\r\n url: '/api/slideshow'\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function(item, options) {\r\n var type = item.type;\r\n return (type == 'image/png');\r\n }\r\n });\r\n\r\n\r\n return fileUploader;\r\n }\r\n };\r\n}\r\n\r\nangular.module('configurations').factory('SlideshowService', SlideshowService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/slideshow/slideshow.tpl.html',\n '
    Slideshow

    No results returned

    {{image.ImageName}}
    ');\n}]);\n}(window, document, window.angular));","function SlideshowAddCtrl($scope, $uibModalInstance, selectedPopulation, currentList, SlideshowService, lodash) {\r\n \r\n $scope.slideshowImageName = \"\";\r\n\r\n $scope.cancel = cancel;\r\n $scope.changed = changed;\r\n $scope.validate = validate;\r\n $scope.ok = ok;\r\n \r\n $scope.fileUploader = SlideshowService.getFileUploader(); \r\n $scope.fileUploader.onWhenAddingFileFailed = onWhenAddingFileFailed; \r\n $scope.fileUploader.onAfterAddingFile = onAfterAddingFile; \r\n \r\n var theFile;\r\n var noNameError = {text: \"Image name required\", type: 'danger'};\r\n var nameLengthError = {text: \"Image name must be 50 characters or less\", type: 'danger'};\r\n var fileNameValidationError = {text: \"File name has illegal characters.\", type: 'danger'};\r\n var fileNameExistsError = {text: 'File name already exists.', type: 'danger'};\r\n\r\n activate();\r\n\r\n function activate() {\r\n $scope.hospitalId = null;\r\n $scope.ProgramGroupId = null;\r\n $scope.populationId = 0;\r\n $scope.ProviderId = null;\r\n $scope.ProviderGroupId = null;\r\n $scope.SiteId = null;\r\n if (selectedPopulation !== undefined && selectedPopulation !== null && selectedPopulation.PopulationId) {\r\n $scope.populationId = selectedPopulation.PopulationId;\r\n }\r\n else if (selectedPopulation !== undefined && selectedPopulation !== null && selectedPopulation.type != undefined && selectedPopulation.type==\"H\"&& selectedPopulation.Id) {\r\n $scope.hospitalId = selectedPopulation.Id;\r\n }\r\n else if (selectedPopulation !== undefined && selectedPopulation !== null && selectedPopulation.type != undefined && selectedPopulation.type == \"PG\" && selectedPopulation.Id) {\r\n $scope.ProgramGroupId = selectedPopulation.Id;\r\n }\r\n else if (selectedPopulation !== undefined && selectedPopulation !== null && selectedPopulation.type != undefined && selectedPopulation.type == \"PV\" && selectedPopulation.ProviderMasterId) {\r\n $scope.ProviderId = selectedPopulation.ProviderMasterId;\r\n }\r\n else if (selectedPopulation !== undefined && selectedPopulation !== null && selectedPopulation.type != undefined && selectedPopulation.type == \"PVG\" && selectedPopulation.Id) {\r\n $scope.ProviderGroupId = selectedPopulation.Id;\r\n }\r\n else if (selectedPopulation !== undefined && selectedPopulation !== null && selectedPopulation.type != undefined && selectedPopulation.type == \"S\" && selectedPopulation.SiteId) {\r\n $scope.SiteId = selectedPopulation.SiteId;\r\n }\r\n }\r\n\r\n function changed () {\r\n $scope.alerts = [];\r\n validate();\r\n }\r\n\r\n function validate() {\r\n var retVal = true;\r\n\r\n if (!isValidFileName($scope.slideshowImageName)) {\r\n $scope.alerts.push(fileNameValidationError);\r\n retVal = false;\r\n }\r\n\r\n if(isFilenameExists($scope.slideshowImageName)) {\r\n $scope.alerts.push(fileNameExistsError);\r\n retVal = false;\r\n }\r\n\r\n if($scope.slideshowImageName.length > 50) {\r\n $scope.alerts.push(nameLengthError);\r\n retVal = false;\r\n }\r\n\r\n if($scope.slideshowImageName.length === 0) {\r\n $scope.alerts.push(noNameError);\r\n retVal = false;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function ok() {\r\n if($scope.slideshowImageName.length > 50) {\r\n $scope.alerts.push(nameLengthError);\r\n return;\r\n }\r\n\r\n if(validate()) {\r\n var resourceName = $scope.slideshowImageName.split('.')[0],\r\n fileParts = theFile.file.name.split('.'),\r\n fileExtention = fileParts[fileParts.length -1]\r\n\r\n theFile.formData = [{\r\n PopulationId: $scope.populationId, ResourceScope: 'custom', ResourceType: 'Slideshow', ResourceName: resourceName + '.' + fileExtention, HospitalId: $scope.hospitalId, ProgramGroupId: $scope.ProgramGroupId, ProviderId: $scope.ProviderId,\r\n ProviderGroupId: $scope.ProviderGroupId, SiteId: $scope.SiteId\r\n }];\r\n theFile.upload();\r\n }\r\n }\r\n\r\n function cancel() {\r\n if($scope.fileUploader.uploading) {\r\n $scope.fileUploader.cancelAll();\r\n }\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function isValidFileName(name) {\r\n var fileNameRegEx = /^[A-Za-z0-9\\._-]*$/;\r\n return fileNameRegEx.test(name);\r\n }\r\n\r\n function isFilenameExists(name) {\r\n var _name = name.split('.')[0];\r\n if (currentList == undefined) {\r\n return false;\r\n }\r\n var list = currentList.map(function(image){\r\n return image.ImageName.split('.')[0];\r\n });\r\n\r\n return list.indexOf(_name) > -1;\r\n }\r\n\r\n function onAfterAddingFile(fileItem) {\r\n var fileName = fileItem.file.name;\r\n\r\n if (fileName.length > 20) {\r\n fileName = fileName.slice(0,20);\r\n fileName += '...';\r\n }\r\n $scope.fileName = fileName;\r\n $scope.alerts = [];\r\n if (theFile) {\r\n $scope.fileUploader.removeFromQueue(theFile);\r\n }\r\n\r\n if($scope.slideshowImageName.length === 0) {\r\n $scope.slideshowImageName = fileName;\r\n }\r\n\r\n if(!validate()) {\r\n return;\r\n }\r\n\r\n theFile = fileItem;\r\n theFile.onProgress = function (progress) {\r\n if (progress == 100) {\r\n progress = 99;\r\n }\r\n $scope.progress = progress;\r\n };\r\n\r\n theFile.onSuccess = function (response, status, headers) {\r\n $uibModalInstance.close(response);\r\n };\r\n\r\n theFile.onError = function (response, status, headers) {\r\n var errorText;\r\n if ($scope.isIENine) {\r\n errorText = response;\r\n } else {\r\n errorText = response.ErrorMessage;\r\n }\r\n $scope.alerts = [{text: errorText, type: 'danger'}];\r\n };\r\n };\r\n\r\n function onWhenAddingFileFailed(item, filter, options) {\r\n $scope.fileUploader.clearQueue();\r\n theFile = null;\r\n $scope.fileName = null;\r\n var alertText;\r\n if (filter.name == \"typeFilter\") {\r\n alertText = \"Could not add image. File must be an image format\";\r\n } else if (filter.name == \"sizeFilter\") {\r\n alertText = \"Could not add image. File size must be less than 50MB\";\r\n } else if (filter.name == \"emptyFilter\") {\r\n alertText = \"Cannot upload an empty file.\";\r\n }\r\n $scope.alerts = [{text: alertText, type: 'danger'}];\r\n };\r\n\r\n}\r\n\r\nangular.module('configurations').controller('SlideshowAddCtrl', SlideshowAddCtrl);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/slideshow/slideshowAdd.modal.html',\n '

    Add Image to Slideshow

    {{alert.text}}
    {{progress}}%
    ');\n}]);\n}(window, document, window.angular));","function SlideshowImageDirective(vhSweetAlert, SlideshowService, $state, PermissionService) {\r\n \r\n function link(scope, elem, attrs, ngModel) {\r\n console.log(scope.selectedImage);\r\n \r\n scope.canDeleteImage = PermissionService.userHasPermission(['MediaWrite']);\r\n\r\n scope.deleteImage = deleteImage;\r\n\r\n function deleteImage() {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete ' + scope.selectedImage.ImageName, 'Delete').then(function(answer){\r\n if(answer) {\r\n SlideshowService.remove(scope.selectedImage.ImageName).then(function(data){\r\n scope.selectedImage = undefined;\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n scope: {\r\n selectedImage: '='\r\n },\r\n templateUrl: 'modules/configurations/content/slideshow/slideshowImage.tpl.html'\r\n };\r\n\r\n}\r\n\r\nangular.module('configurations').directive('slideshowImage', SlideshowImageDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/slideshow/slideshowImage.tpl.html',\n '
    {{selectedImage}}
    {{selectedImage.ImageName}}
    ');\n}]);\n}(window, document, window.angular));","function WelcomeVideoDirective(WelcomeVideoService) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/configurations/content/welcomevideo.tpl.html\",\r\n scope: {\r\n video: \"=\",\r\n defaultVideo: \"=\",\r\n addedVideo: \"&\",\r\n deletedVideo: \"&\",\r\n changedVideo: \"&\"\r\n },\r\n bindToController: true,\r\n controllerAs: \"vm\",\r\n controller: function ($uibModal, vhSweetAlert) {\r\n var vm = this;\r\n vm.addVideo = function () {\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/selectvideo.modal.html',\r\n controller: 'SelectVideoController as vm',\r\n keyboard: false,\r\n resolve: {\r\n videos: function () {\r\n return WelcomeVideoService.getAvailableVideos();\r\n },\r\n selectedVideoId : function (){\r\n return null;\r\n }\r\n }\r\n }).result.then(function (videoId) {\r\n vm.addedVideo({videoId: videoId});\r\n });\r\n };\r\n\r\n vm.deleteVideo = function () {\r\n var videoName = vm.video.Video.Name;\r\n var welcomeVideoId = vm.video.WelcomeVideoId;\r\n vhSweetAlert.verify(\"Are you sure?\", \"Do you want to delete \" + videoName + \"?\", \"Delete\")\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n vm.deletedVideo({welcomeVideo: vm.video});\r\n }\r\n });\r\n\r\n };\r\n\r\n vm.editVideo = function () {\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/selectvideo.modal.html',\r\n controller: 'SelectVideoController as vm',\r\n keyboard: false,\r\n resolve: {\r\n videos: function () {\r\n return WelcomeVideoService.getAvailableVideos();\r\n },\r\n selectedVideoId : function (){\r\n return vm.video.Video.VideoId;\r\n }\r\n }\r\n }).result.then(function (videoId) {\r\n vm.changedVideo({welcomeVideo: vm.video, videoId: videoId});\r\n });\r\n\r\n };\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"configurations.content\").directive(\"welcomeVideo\", WelcomeVideoDirective);\r\n","function WelcomeVideoService($http) {\r\n function getWelcomeVideos() {\r\n return $http.get('/api/WelcomeVideo').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getAvailableVideos() {\r\n return $http.get('/api/Video').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteWelcomeVideo(welcomeVideoId) {\r\n return $http.delete(\"/api/WelcomeVideo/\" + welcomeVideoId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateWelcomeVideo(welcomeVideo) {\r\n return $http.post(\"/api/WelcomeVideo/\" + welcomeVideo.WelcomeVideoId, welcomeVideo).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function createWelcomeVideo(welcomeVideo) {\r\n return $http.put(\"/api/WelcomeVideo\", welcomeVideo).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getAvailableVideos: getAvailableVideos,\r\n createWelcomeVideo: createWelcomeVideo,\r\n updateWelcomeVideo: updateWelcomeVideo,\r\n deleteWelcomeVideo: deleteWelcomeVideo,\r\n getWelcomeVideos: getWelcomeVideos\r\n };\r\n\r\n}\r\n\r\nangular.module(\"configurations.content\").factory(\"WelcomeVideoService\", WelcomeVideoService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/content/welcomevideo.tpl.html',\n '
    Welcome Video
    No video  {{vm.video.Video.Name || vm.defaultVideo.Video.Name}}  (default)
    ');\n}]);\n}(window, document, window.angular));","function EditConfigurationsService(repository, $http, TagRepository) {\r\n var contentRepo = repository.new(\"cgp/configuration\");\r\n var statusChangeReasonRepo = repository.new(\"StatusChangeReason\");\r\n var statusChangeSubReasonRepo = repository.new(\"StatusChangeSubReason\");\r\n var skipReasonRepo = repository.new(\"SkipBiometricReason\");\r\n var deleteTimeLogReasonRepo = repository.new(\"DeleteTimeLogReason\");\r\n var providerRepo = repository.new(\"Provider\");\r\n var interventionRepo = repository.new(\"Intervention\");\r\n var biometricThresholdsChangeReasonRepo = repository.new(\"BiometricThresholdsChangeReason\");\r\n var installMethodRepo = repository.new(\"InstallMethod\");\r\n var emailServerRepo = repository.new(\"EmailServer\");\r\n var populationsRepo = repository.new(\"Population\");\r\n var personalCaregiverRoleRepo = repository.new(\"PersonalCaregiverRole\");\r\n var messageInterventionRepo = repository.new(\"MessageIntervention\");\r\n var milestoneRepo = repository.new(\"Milestone\");\r\n var currentProceduralTerminologyCodeRepo = repository.new(\"CurrentProceduralTerminologyCode\");\r\n var pathwayAlertChangeReasonRepo = repository.new(\"PathwayAlertChangeReason\");\r\n\r\n function getConfigurationContent() {\r\n return contentRepo.getList().then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getStatusChangeReason(id){\r\n var promise = statusChangeReasonRepo.get(id);\r\n return promise;\r\n }\r\n\r\n function updateStatusChangeReasonShowSaveToPMHSlider(id, value) {\r\n var getPromise = getStatusChangeReason(id);\r\n\r\n var updatePromise = getPromise.then(function(response) {\r\n var oldReason = response.data;\r\n oldReason.SaveToMedicalHistory = value;\r\n return updatePromise = statusChangeReasonRepo.update(oldReason.Id, oldReason);\r\n\r\n });\r\n return updatePromise;\r\n }\r\n\r\n function updateStatusChangeReasonEnableNotes(id, value) {\r\n var getPromise = getStatusChangeReason(id);\r\n\r\n var updatePromise = getPromise.then(function(response) {\r\n var oldReason = response.data;\r\n oldReason.EnableNotes = value;\r\n if(!oldReason.EnableNotes) oldReason.RequireNotes = false;\r\n return updatePromise = statusChangeReasonRepo.update(oldReason.Id, oldReason);\r\n });\r\n return updatePromise;\r\n }\r\n\r\n function updateStatusChangeReasonRequireNotes(id, value) {\r\n var getPromise = getStatusChangeReason(id);\r\n\r\n var updatePromise = getPromise.then(function(response) {\r\n var oldReason = response.data;\r\n oldReason.RequireNotes = value;\r\n return updatePromise = statusChangeReasonRepo.update(oldReason.Id, oldReason);\r\n });\r\n return updatePromise;\r\n }\r\n\r\n function updateStatusChangeReason(id, reason) {\r\n return statusChangeReasonRepo.update(id, reason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function addStatusChangeReason(reason) {\r\n return statusChangeReasonRepo.create(reason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getStatusChangeSubReason(id){\r\n var promise = statusChangeSubReasonRepo.get(id);\r\n return promise;\r\n }\r\n \r\n function updateStatusChangeSubReasonShowSaveToPMHSlider(id, value) {\r\n var getPromise = getStatusChangeSubReason(id);\r\n \r\n var updatePromise = getPromise.then(function(response) {\r\n var oldReason = response.data;\r\n oldReason.SaveToMedicalHistory = value;\r\n return updatePromise = statusChangeSubReasonRepo.update(oldReason.Id, oldReason);\r\n \r\n });\r\n return updatePromise;\r\n }\r\n \r\n function updateStatusChangeSubReasonEnableNotes(id, value) {\r\n var getPromise = getStatusChangeSubReason(id);\r\n \r\n var updatePromise = getPromise.then(function(response) {\r\n var oldReason = response.data;\r\n oldReason.EnableNotes = value;\r\n if(!oldReason.EnableNotes) oldReason.RequireNotes = false;\r\n return updatePromise = statusChangeSubReasonRepo.update(oldReason.Id, oldReason);\r\n });\r\n return updatePromise;\r\n }\r\n \r\n function updateStatusChangeSubReasonRequireNotes(id, value) {\r\n var getPromise = getStatusChangeSubReason(id);\r\n \r\n var updatePromise = getPromise.then(function(response) {\r\n var oldReason = response.data;\r\n oldReason.RequireNotes = value;\r\n return updatePromise = statusChangeSubReasonRepo.update(oldReason.Id, oldReason);\r\n });\r\n return updatePromise;\r\n }\r\n \r\n function updateStatusChangeSubReason(id, reason) {\r\n return statusChangeSubReasonRepo.update(id, reason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n \r\n function addStatusChangeSubReason(reason) {\r\n return statusChangeSubReasonRepo.create(reason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n \r\n function addSkipBiometricReason(reason) {\r\n return skipReasonRepo.create(reason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateSkipBiometricReason(id, reason) {\r\n return skipReasonRepo.update(id, reason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function addDeleteTimeLogReason(reason) {\r\n return deleteTimeLogReasonRepo.create(reason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateDeleteTimeLogReason(id, reason) {\r\n return deleteTimeLogReasonRepo.update(id, reason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateBiometricThresholdsChangeReasons(biometricThresholdsChangeReason){\r\n return $http.put('/api/BiometricThresholdsChangeReason/', biometricThresholdsChangeReason).then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n }\r\n\r\n function addBiometricThresholdsChangeReason(biometricThresholdsChangeReason){\r\n return biometricThresholdsChangeReasonRepo.create(biometricThresholdsChangeReason).then(\r\n function(response) {\r\n return response.data;\r\n }\r\n );\r\n }\r\n\r\n function updateIntervention(intervention) {\r\n return interventionRepo.update(intervention.InterventionId, intervention).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function addIntervention(intervention) {\r\n return interventionRepo.create(intervention).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n ///begin install methods\r\n function updateInstallMethod(installMethod) {\r\n return installMethodRepo.update(installMethod.id, installMethod).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getInstallMethods() {\r\n return installMethodRepo.getList().then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function createFormVariableTransform(formVariableTransform) {\r\n var model = {\r\n FormVariableTransformId: 0,\r\n Text: formVariableTransform.label,\r\n IsEnabled: formVariableTransform.enabled,\r\n SortOrder: formVariableTransform.sortOrder\r\n };\r\n\r\n return $http.post('/api/FormVariableTransform', model).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateFormVariableTransform(formVariableTransform) {\r\n var model = {\r\n FormVariableTransformId: formVariableTransform.id,\r\n Text: formVariableTransform.label,\r\n IsEnabled: formVariableTransform.enabled,\r\n SortOrder: formVariableTransform.sortOrder\r\n };\r\n\r\n return $http.put('/api/FormVariableTransform/' + model.FormVariableTransformId, model).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function createFormVariableTransformDetail(formVariableTransformDetail) {\r\n var model = {\r\n FormVariableTransformDetailId: 0,\r\n FormVariableTransformId: formVariableTransformDetail.parentId,\r\n SourceValue: formVariableTransformDetail.inputs.sourceValue,\r\n TargetValue: formVariableTransformDetail.inputs.targetValue,\r\n SortOrder: formVariableTransformDetail.sortOrder,\r\n IsEnabled: formVariableTransformDetail.enabled\r\n };\r\n\r\n return $http.post('/api/FormVariableTransform/detail', model).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateFormVariableTransformDetail(formVariableTransformDetail) {\r\n var model = {\r\n FormVariableTransformDetailId: formVariableTransformDetail.id,\r\n FormVariableTransformId: formVariableTransformDetail.parentId,\r\n SourceValue: formVariableTransformDetail.inputs.sourceValue,\r\n TargetValue: formVariableTransformDetail.inputs.targetValue,\r\n SortOrder: formVariableTransformDetail.sortOrder,\r\n IsEnabled: formVariableTransformDetail.enabled\r\n };\r\n\r\n return $http.put('/api/FormVariableTransform/detail/' + model.FormVariableTransformDetailId, model).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function populationsList(options) {\r\n var params = Object.assign({ enabledOnly: true, allSites: false, clearCache: true }, options || {});\r\n return $http.get('/api/Population', { params: params }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updatePopulation(populationId, population) {\r\n return populationsRepo.update(populationId, population).then(function(response){\r\n return response.data;\r\n })\r\n }\r\n\r\n function deletePopulation(populationId) {\r\n return $http({\r\n method: 'DELETE',\r\n url: '/api/Population/' + populationId,\r\n data: populationId\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPopulationCount() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/Population/PatientCount'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updatePopulationList(populations) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/Population',\r\n data: populations\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getSpecialHandlingList() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/SpecialHandling'\r\n })\r\n .then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateSpecialHandling(list) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/SpecialHandling',\r\n data: list\r\n })\r\n .then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteSpecialHandling(SpecialHandlingId) {\r\n return $http({\r\n method: 'DELETE',\r\n url: '/api/SpecialHandling/' + SpecialHandlingId\r\n })\r\n .then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateEducationalMaterials(educationalMaterial){\r\n return $http.put('/api/EducationalMaterial/UpdateEducationalMaterial',educationalMaterial).then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n }\r\n\r\n function addEducationalMaterial(name){\r\n return $http.post('/api/EducationalMaterial/AddEducationalMaterial',{Name:name}).then(\r\n function(response) {\r\n return response.data;\r\n }\r\n );\r\n }\r\n\r\n function getPrimaryCaregiverRoles() {\r\n return personalCaregiverRoleRepo.getList().then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updatePrimaryCaregiverRole(primaryCaregiverRoles) {\r\n return $http.put('/api/PersonalCaregiverRole', primaryCaregiverRoles).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getCaregiverTitles() {\r\n return $http.get('/api/cgp/configuration/caregivertitles').then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function createPrimaryCaregiverRole(primaryCaregiverRole) {\r\n return personalCaregiverRoleRepo.create(primaryCaregiverRole).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getMessageInterventions() {\r\n return messageInterventionRepo.get(false).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function createMessageIntervention(messageIntervention) {\r\n return messageInterventionRepo.create(messageIntervention);\r\n }\r\n\r\n function updateMessageIntervention(messageIntervention) {\r\n return messageInterventionRepo.update(messageIntervention.MessageInterventionId, messageIntervention);\r\n }\r\n\r\n function getMilestones() {\r\n return milestoneRepo.getList().then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function importMilestones(milestones){\r\n return $http.post('/api/import/milestones', milestones).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function importPrograms(programs){\r\n return $http.post('/api/import/programs', programs).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function createMilestone(milestone){\r\n return $http.post('/api/Milestone', milestone).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateMilestone(milestone){\r\n return $http.put('/api/Milestone', milestone).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getComorbidityList() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/Comorbidity'\r\n })\r\n .then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateComorbidity(comorbidity) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/Comorbidity',\r\n data: comorbidity\r\n })\r\n .then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getTags() {\r\n return TagRepository.getSurveyTags();\r\n }\r\n\r\n function importPrograms(data){\r\n return $http.post('/api/import/programs', data).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPathwayAlertChangeReasons () {\r\n return pathwayAlertChangeReasonRepo.getList().then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function createPathwayAlertChangeReason (pathwayAlertChangeReason) {\r\n return $http.post('/api/pathwayAlertChangeReason', pathwayAlertChangeReason).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updatePathwayAlertChangeReason (pathwayAlertChangeReason) {\r\n return $http.put('/api/pathwayAlertChangeReason', pathwayAlertChangeReason).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getConfigurationContent: getConfigurationContent,\r\n updateStatusChangeReasonShowSaveToPMHSlider: updateStatusChangeReasonShowSaveToPMHSlider,\r\n updateStatusChangeReasonEnableNotes: updateStatusChangeReasonEnableNotes,\r\n updateStatusChangeReasonRequireNotes: updateStatusChangeReasonRequireNotes,\r\n updateStatusChangeReason:updateStatusChangeReason,\r\n addStatusChangeReason: addStatusChangeReason,\r\n updateStatusChangeSubReasonShowSaveToPMHSlider: updateStatusChangeSubReasonShowSaveToPMHSlider,\r\n updateStatusChangeSubReasonEnableNotes: updateStatusChangeSubReasonEnableNotes,\r\n updateStatusChangeSubReasonRequireNotes: updateStatusChangeSubReasonRequireNotes,\r\n updateStatusChangeSubReason:updateStatusChangeSubReason,\r\n addStatusChangeSubReason: addStatusChangeSubReason,\r\n addSkipBiometricReason: addSkipBiometricReason,\r\n updateSkipBiometricReason: updateSkipBiometricReason,\r\n addDeleteTimeLogReason: addDeleteTimeLogReason,\r\n updateDeleteTimeLogReason: updateDeleteTimeLogReason,\r\n updateBiometricThresholdsChangeReasons:updateBiometricThresholdsChangeReasons,\r\n addBiometricThresholdsChangeReason:addBiometricThresholdsChangeReason,\r\n updateIntervention: updateIntervention,\r\n addIntervention: addIntervention,\r\n updateInstallMethod : updateInstallMethod,\r\n updateEducationalMaterials:updateEducationalMaterials,\r\n getInstallMethods : getInstallMethods,\r\n updateSpecialHandling: updateSpecialHandling,\r\n getSpecialHandlingList: getSpecialHandlingList,\r\n deleteSpecialHandling: deleteSpecialHandling,\r\n populationsList: populationsList,\r\n updatePopulation: updatePopulation,\r\n importPrograms: importPrograms,\r\n updatePopulationList: updatePopulationList,\r\n addEducationalMaterial:addEducationalMaterial,\r\n getPrimaryCaregiverRoles: getPrimaryCaregiverRoles,\r\n updatePrimaryCaregiverRole: updatePrimaryCaregiverRole,\r\n createPrimaryCaregiverRole: createPrimaryCaregiverRole,\r\n createFormVariableTransform: createFormVariableTransform,\r\n updateFormVariableTransform: updateFormVariableTransform,\r\n createFormVariableTransformDetail: createFormVariableTransformDetail,\r\n updateFormVariableTransformDetail: updateFormVariableTransformDetail,\r\n getCaregiverTitles: getCaregiverTitles,\r\n getMessageInterventions: getMessageInterventions,\r\n createMessageIntervention: createMessageIntervention,\r\n updateMessageIntervention: updateMessageIntervention,\r\n getMilestones: getMilestones,\r\n createMilestone: createMilestone,\r\n updateMilestone: updateMilestone,\r\n importMilestones: importMilestones,\r\n getComorbidityList: getComorbidityList,\r\n updateComorbidity: updateComorbidity,\r\n getTags: getTags,\r\n deletePopulation: deletePopulation,\r\n getPopulationCount: getPopulationCount,\r\n importPrograms: importPrograms,\r\n getPathwayAlertChangeReasons: getPathwayAlertChangeReasons,\r\n createPathwayAlertChangeReason: createPathwayAlertChangeReason,\r\n updatePathwayAlertChangeReason: updatePathwayAlertChangeReason\r\n };\r\n}\r\n\r\nangular.module(\"configurations\").service(\"EditConfigurationsService\", EditConfigurationsService);\r\n","function InterventionFormDirective(lodash, $filter, PermissionService) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^optionContainer\",\r\n templateUrl: \"modules/configurations/interventionform.tpl.html\",\r\n scope: {\r\n interventionChanged: \"&\",\r\n interventionAdded: \"&\",\r\n populationList: \"=\",\r\n tagList: \"=?\"\r\n },\r\n link: function (scope, elem, attrs, optionContainerController) {\r\n \r\n scope.hasTagWrite = PermissionService.userHasPermission([\"PatientTagWrite\"]);\r\n scope.tagList = scope.tagList || [];\r\n scope.option = optionContainerController.option;\r\n var allPatients = lodash.find(scope.populationList, function (p) { return p.IsAllPatients; });\r\n scope.lodash = lodash;\r\n if (scope.option.temp) {\r\n\r\n optionContainerController.updateLabel('New Intervention');\r\n\r\n scope.option = {\r\n tabId: scope.option.tabId || 2,\r\n typeId: scope.option.parent.id,\r\n label: 'New Intervention',\r\n inputs: {\r\n text: '',\r\n populations: [allPatients],\r\n tags: []\r\n },\r\n icon: \"fa-bookmark-o\",\r\n enabled: true,\r\n isDefault: false,\r\n visible: true,\r\n editable: true,\r\n selected: true,\r\n temp: true,\r\n classId: scope.option.parent.parent.alertClassId,\r\n parent: scope.option.parent,\r\n sortOrder: scope.option.parent.options.length\r\n };\r\n }\r\n\r\n var lastSelectedPrograms = angular.copy(scope.option.inputs.populations);\r\n\r\n scope.$watch('option.inputs.text', function() {\r\n if(!scope.option.temp) {\r\n optionContainerController.updateLabel(scope.option.inputs.text);\r\n }\r\n });\r\n\r\n scope.populationsChanged = function() {\r\n var lodash = scope.lodash;\r\n // if it was just All Patients and they added something else\r\n if (lastSelectedPrograms.length == 1 && lastSelectedPrograms[0].IsAllPatients && scope.option.inputs.populations.length > 1) {\r\n //remove All Patients\r\n var copySelected = angular.copy(scope.option.inputs.populations);\r\n lodash.remove(copySelected, p => p.IsAllPatients);\r\n scope.option.inputs.populations = copySelected;\r\n }\r\n // if it was just other programs and they added All Patients\r\n else if(lodash.find(lastSelectedPrograms, p => p.IsAllPatients) === undefined &&\r\n lodash.find(scope.option.inputs.populations, p => p.IsAllPatients) !== undefined) {\r\n //add All Patients, remove all others\r\n scope.option.inputs.populations = [allPatients];\r\n }\r\n // must have a population on this screen\r\n else if(scope.option.inputs.populations.length == 0) {\r\n // default to All Patients\r\n scope.option.inputs.populations = [allPatients];\r\n }\r\n \r\n // remember old selection in order to track changes\r\n lastSelectedPrograms = angular.copy(scope.option.inputs.populations);\r\n }\r\n \r\n scope.clickSave = function () {\r\n if (scope.interventionForm.$valid) {\r\n if (scope.option.temp) {\r\n scope.interventionAdded({intervention: scope.option, inOption: scope.option.parent.options});\r\n } else {\r\n scope.interventionChanged({intervention: scope.option, inOption: scope.option.parent.options});\r\n }\r\n scope.option.selected = false;\r\n scope.interventionForm.$setPristine();\r\n }\r\n };\r\n\r\n scope.cleanTag = function(tag) {\r\n return tag.replace(/[;,]/g, '');\r\n }\r\n \r\n }\r\n }\r\n}\r\n\r\nangular.module(\"configurations\").directive(\"interventionForm\", InterventionFormDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/interventionform.tpl.html',\n '
    {{$item.PopulationName}}{{population.PopulationName}}
    {{$item}} {{tag}}
    ');\n}]);\n}(window, document, window.angular));","function MessageInterventionFormDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^optionContainer\",\r\n templateUrl: \"modules/configurations/messageinterventionform.tpl.html\",\r\n scope: {\r\n programList: \"=\",\r\n onUpdated: \"&\",\r\n onAdded: \"&\"\r\n },\r\n controller: function($scope) {\r\n\r\n $scope.allPatientsProgram = lodash.find($scope.programList, p => p.IsAllPatients);\r\n\r\n $scope.cleanTag = function(tag) {\r\n return tag.replace(/[;,]/g, '');\r\n }\r\n\r\n $scope.programsChanged = function() {\r\n var intervention = $scope.option;\r\n\r\n // if it was just All Patients and they added something else\r\n if ($scope.lastSelectedPrograms.length == 1 && $scope.lastSelectedPrograms[0].IsAllPatients && intervention.programs.length > 1) {\r\n //remove All Patients\r\n var copySelected = angular.copy(intervention.programs);\r\n lodash.remove(copySelected, p => p.IsAllPatients);\r\n intervention.programs = copySelected;\r\n }\r\n // if it was just other programs and they added All Patients\r\n else if(lodash.find($scope.lastSelectedPrograms, p => p.IsAllPatients) === undefined &&\r\n lodash.find(intervention.programs, p => p.IsAllPatients) !== undefined) {\r\n //add All Patients, remove all others\r\n intervention.programs = [$scope.allPatientsProgram];\r\n }\r\n // must have a population on this screen\r\n else if(intervention.programs == 0) {\r\n // default to All Patients\r\n intervention.programs = [$scope.allPatientsProgram];\r\n }\r\n \r\n // remember old selection in order to track changes\r\n $scope.lastSelectedPrograms = angular.copy(intervention.programs);\r\n }\r\n\r\n $scope.clickSave = function() {\r\n if ($scope.messageInterventionForm.$valid) {\r\n if ($scope.option.temp) {\r\n $scope.option.temp = false;\r\n $scope.onAdded({ option: $scope.option });\r\n } else {\r\n $scope.onUpdated({ option: $scope.option });\r\n }\r\n $scope.option.selected = false;\r\n $scope.messageInterventionForm.$setPristine();\r\n }\r\n }\r\n },\r\n link: function postLink (scope, elem, attrs, optionContainerController) {\r\n scope.option = optionContainerController.option;\r\n\r\n if (scope.option.temp) {\r\n scope.option = {\r\n label: '',\r\n icon: \"fa-bookmark-o\",\r\n enabled: true,\r\n editable: true,\r\n selected: true,\r\n temp: true,\r\n programs: [scope.allPatientsProgram],\r\n maxlength: 300\r\n };\r\n } else {\r\n // VIVY-7661: programs.length *MAY* be zero if on a new site\r\n // if (scope.option.programs.length === 0) {\r\n // scope.option.programs = [scope.allPatientsProgram];\r\n // }\r\n }\r\n\r\n scope.lastSelectedPrograms = angular.copy(scope.option.programs);\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"configurations\").directive(\"messageInterventionForm\", MessageInterventionFormDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/messageinterventionform.tpl.html',\n '
    {{$item.PopulationName}}{{program.PopulationName}}
    ');\n}]);\n}(window, document, window.angular));","function MilestoneEditController($uibModalInstance, EditConfigurationsService, milestone, $injector){//, populations){\r\n var vm = this;\r\n vm.milestone = milestone;\r\n vm.populations = [];\r\n var allPatients = {PopulationName: 'All Patients', PopulationId: 0};\r\n var vhSweetAlert = $injector.get('vhSweetAlert');\r\n loadController();\r\n\r\n function loadController() {\r\n EditConfigurationsService.populationsList().then(function (data) {\r\n data.unshift(allPatients);\r\n vm.populations = data;\r\n });\r\n\r\n if(vm.milestone.MilestonePopulations === undefined || vm.milestone.MilestonePopulations.length == 0){\r\n vm.milestone.MilestonePopulations = [allPatients];\r\n }\r\n }\r\n\r\n vm.ok = function(isValid) {\r\n if(isValid) {\r\n var index = vm.milestone.MilestonePopulations.indexOf(allPatients);\r\n console.log(\"Population Index\" + index);\r\n if(index > -1){\r\n vm.milestone.MilestonePopulations.splice(index, 1);\r\n }\r\n \r\n var item = {\r\n MilestoneId: vm.milestone.id,\r\n Name: vm.milestone.label,\r\n SortOrder: vm.milestone.sortOrder,\r\n IsEnabled: vm.milestone.enabled,\r\n MilestonePopulations: vm.milestone.MilestonePopulations\r\n };\r\n \r\n EditConfigurationsService.updateMilestone(item).then(function (response) {\r\n if (response == false)\r\n {\r\n setTimeout(function() {\r\n // TODO: Wordsmith\r\n vhSweetAlert.error('Unable to edit', 'The milestone could not be edited. Does it have survey schedules which refer to it?');\r\n }, 100);\r\n }\r\n $uibModalInstance.close(vm.milestone);\r\n });\r\n }\r\n }\r\n\r\n vm.cancel = function(){\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\n\r\nangular.module(\"configurations\").controller(\"MilestoneEditController\", MilestoneEditController);\r\n\r\n\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/milestoneEdit.modal.html',\n '

    Edit {{vm.milestone.label}} Milestone

    {{$item.PopulationName}}{{population.PopulationName}}
    ');\n}]);\n}(window, document, window.angular));","function MonitoringConfigurationService($http, PopulationSettingsService) {\r\n\r\n var service = {\r\n getMonitoringConfigurations: getMonitoringConfigurations,\r\n saveConfigurations: saveConfigurations,\r\n deleteConfigurations: deleteConfigurations\r\n }\r\n\r\n return service; \r\n\r\n function getMonitoringConfigurations() {\r\n return $http.get(\"/api/cgp/configurations/monitoring\").then(function(response){\r\n\r\n response.data.Configurations.forEach(x => {\r\n x.getValueFor = (programId) => {\r\n return (x.PopulationConfigurations.find(x => x.PopulationId == programId) || x).Value;\r\n }\r\n });\r\n\r\n response.data.getValueFor = (configName, programId) => {\r\n var config = response.data.Configurations.find(x => `${x.Param}`.toLowerCase() == `${configName}`.toLowerCase());\r\n \r\n if(config)\r\n return config.getValueFor(programId);\r\n\r\n return null;\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveConfigurations(configurations){\r\n var promises = [];\r\n configurations.forEach(x => promises.push(PopulationSettingsService.saveSetting(x)));\r\n return Promise.all(promises).then(responses => {\r\n return responses.flat();\r\n });\r\n }\r\n\r\n function deleteConfigurations(configurations) {\r\n var promises = [];\r\n configurations.forEach(x => promises.push(PopulationSettingsService.deleteSetting(x)));\r\n return Promise.all(promises).then(responses => {\r\n return responses.flat();\r\n });\r\n }\r\n\r\n\r\n}\r\n\r\nangular.module('configurations.monitoringconfiguration').service('MonitoringConfigurationService', MonitoringConfigurationService);\r\n","function PatientHeaderConfigurationCtrl($uibModal, patientHeaderConfigurations, availablePopulations, PatientHeaderConfigurationService, vhSweetAlert, lodash, PermissionService) {\r\n var vm = this;\r\n\r\n\r\n vm.showDisabled = false;\r\n vm.canAssignDisabledItems = PermissionService.canAssignDisabledItems = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n \r\n\r\n vm.availablePopulations = availablePopulations;\r\n vm.defaultPatientHeaderConfigurations = patientHeaderConfigurations.DefaultPatientHeaderConfigurations;\r\n\r\n var contentPopulationIds = lodash.pluck(patientHeaderConfigurations.PopulationPatientHeaderConfigurations, \"PopulationId\");\r\n vm.contentPopulations = populationsWithContent();\r\n \r\n lodash.filter(availablePopulations, function(population) {\r\n return lodash.contains(contentPopulationIds, population.PopulationId);\r\n });\r\n\r\n \r\n vm.selectedPatientHeaderConfigurations = vm.defaultPatientHeaderConfigurations;\r\n vm.selectedPopulationId = null;\r\n vm.selectPopulation = null;\r\n \r\n vm.addPopulation = addPopulation;\r\n vm.deletePopulation = deletePopulation;\r\n vm.selectPopulation = selectPopulation;\r\n vm.toggle = toggle;\r\n\r\n \r\n function populationsWithContent() {\r\n var value = availablePopulations.\r\n filter(x => contentPopulationIds.find(y => x.PopulationId === y)).map(function (x) {\r\n x.configId = x.PopulationId;\r\n return x;\r\n })\r\n // var value = availablePopulations.filter(x => contentPopulationIds.find(y => x.PopulationId === y));\r\n \r\n value = [...value.filter(x => x.IsEnabled), ...value.filter(x => !x.IsEnabled)];\r\n\r\n \r\n return value;\r\n }\r\n\r\n\r\n function selectPopulation(population) {\r\n populationId = !population ? null : population.PopulationId // get population id from population\r\n //Selected a population\r\n if (populationId) {\r\n vm.selectedPopulationId = populationId;\r\n vm.selectedPopulation = lodash.find(vm.availablePopulations, {PopulationId: populationId});\r\n\r\n //Set the name field for each selected population patient header configuration.\r\n var selectedConfigurations = lodash.filter(patientHeaderConfigurations.PopulationPatientHeaderConfigurations, {PopulationId: populationId});\r\n lodash.forEach(selectedConfigurations, function(config) {\r\n var patientHeader = lodash.find(vm.defaultPatientHeaderConfigurations, {PatientHeaderConfigurationId: config.PatientHeaderConfigurationId});\r\n if (patientHeader) {\r\n config.Name = patientHeader.Name;\r\n }\r\n });\r\n vm.selectedPatientHeaderConfigurations = selectedConfigurations;\r\n }\r\n //Selected the default\r\n else {\r\n vm.selectedPopulationId = null;\r\n vm.selectedPopulation = null;\r\n\r\n vm.selectedPatientHeaderConfigurations = vm.defaultPatientHeaderConfigurations;\r\n }\r\n }\r\n\r\n this.toggleDisabled = () => {\r\n this.showDisabled = !vm.showDisabled;\r\n };\r\n\r\n function addPopulation(){\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/addpopulation.modal.html',\r\n controller: 'AddPopulationController as vm',\r\n keyboard: false,\r\n resolve: {\r\n canAssignDisabledItems: ()=> vm.canAssignDisabledItems,\r\n showDisabled: ()=> vm.showDisabled,\r\n availablePopulations: function () {\r\n return lodash.filter(vm.availablePopulations, function (p) {\r\n return !lodash.any(vm.contentPopulations, {PopulationId: p.PopulationId});\r\n });\r\n }\r\n }\r\n }).result.then(function ({populationId, showDisabled}) {\r\n vm.showDisabled = showDisabled;\r\n var match = lodash.find(availablePopulations, { PopulationId: populationId })\r\n if (!match) {\r\n match.configId = match.populationId\r\n }\r\n vm.contentPopulations.push(match);\r\n \r\n var newPatientHeaderConfigurations = [];\r\n lodash.forEach(vm.defaultPatientHeaderConfigurations, function(defaultConfig) {\r\n var newConfig = {\r\n PatientHeaderConfigurationId: defaultConfig.PatientHeaderConfigurationId,\r\n PopulationId: populationId,\r\n IsEnabled: defaultConfig.IsEnabled\r\n };\r\n newPatientHeaderConfigurations.push(newConfig);\r\n });\r\n \r\n PatientHeaderConfigurationService.savePopulationPatientHeaderConfigurations(newPatientHeaderConfigurations)\r\n .then(function(data) {\r\n lodash.forEach(data, function(newConfig) {\r\n patientHeaderConfigurations.PopulationPatientHeaderConfigurations.push(newConfig);\r\n });\r\n\r\n selectPopulation(lodash.find(availablePopulations, { PopulationId: populationId }));\r\n });\r\n });\r\n }\r\n\r\n function deletePopulation(populationId) {\r\n lodash.remove(patientHeaderConfigurations.PopulationPatientHeaderConfigurations, {PopulationId: populationId})\r\n PatientHeaderConfigurationService.deletePopulation(populationId);\r\n }\r\n\r\n function toggle(item, prop) {\r\n item[prop] = !item[prop];\r\n\r\n //Saving a population configuration\r\n if (vm.selectedPopulationId) {\r\n PatientHeaderConfigurationService.savePopulationPatientHeaderConfiguration(item);\r\n }\r\n //Saving a default configuration\r\n else {\r\n PatientHeaderConfigurationService.saveDefaultPatientHeaderConfiguration(item);\r\n }\r\n }\r\n\r\n}\r\n\r\nangular.module('configurations.patientheaderconfiguration').controller('PatientHeaderConfigurationCtrl', PatientHeaderConfigurationCtrl);\r\n","function PatientHeaderConfigurationService($http) {\r\n\r\n var service = {\r\n getPatientHeaderConfigurations: getPatientHeaderConfigurations,\r\n saveDefaultPatientHeaderConfiguration: saveDefaultPatientHeaderConfiguration,\r\n savePopulationPatientHeaderConfigurations: savePopulationPatientHeaderConfigurations,\r\n savePopulationPatientHeaderConfiguration: savePopulationPatientHeaderConfiguration,\r\n deletePopulation: deletePopulation\r\n }\r\n\r\n return service; \r\n\r\n function getPatientHeaderConfigurations() {\r\n return $http.get('/api/PatientHeaderConfiguration').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveDefaultPatientHeaderConfiguration(defaultPatientHeaderConfiguration) {\r\n return $http.post('/api/DefaultPatientHeaderConfiguration', defaultPatientHeaderConfiguration).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function savePopulationPatientHeaderConfigurations(populationPatientHeadersConfigurations) {\r\n return $http.post('/api/PopulationPatientHeaderConfiguration', populationPatientHeadersConfigurations).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function savePopulationPatientHeaderConfiguration(populationPatientHeadersConfiguration) {\r\n return $http.post('/api/PopulationPatientHeaderConfiguration', [populationPatientHeadersConfiguration]).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deletePopulation(populationId) {\r\n return $http.delete('/api/PopulationPatientHeaderConfiguration?populationId=' + populationId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n}\r\n\r\nangular.module('configurations.patientheaderconfiguration').service('PatientHeaderConfigurationService', PatientHeaderConfigurationService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/patientheaderconfiguration/patientheaderconfiguration.tpl.html',\n '

    Patient Header Configuration

    Patient Programs Show Disabled Programs
    {{vm.selectedPopulation.PopulationName || \\'Default\\'}} settings

    Icon Name

    Enabled

    {{item.Name}}
    ');\n}]);\n}(window, document, window.angular));","function ProviderFormDirective(lodash, $filter) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^optionContainer\",\r\n templateUrl: \"modules/configurations/providerform.tpl.html\",\r\n scope: {\r\n caregiverTitles: \"=\",\r\n specialties: \"=\",\r\n providerGroups: \"=\",\r\n providerSaved: \"&\",\r\n providerAdded: \"&\"\r\n },\r\n link: function (scope, elem, attrs, optionContainerController) {\r\n scope.provider = optionContainerController.option.providerInfo;\r\n scope.option = optionContainerController.option;\r\n if (scope.provider) {\r\n updateLabel();\r\n } else if (scope.option.temp) {\r\n scope.provider = {\r\n FirstName: \"\",\r\n LastName: \"\",\r\n MiddleInitial: \"\",\r\n CaregiverTitleId: null,\r\n CaregiverSpecialtyId: null,\r\n PhoneNumber1: \"\",\r\n PhoneNumber2: \"\",\r\n MobileNumber: \"\",\r\n AnsweringServiceNumber: \"\",\r\n FaxNumber: \"\",\r\n EmailAddress: \"\",\r\n ProviderGroupId: null,\r\n IsEnabled: true,\r\n AddressOne: \"\",\r\n AddressTwo: \"\",\r\n City: \"\",\r\n State: \"\",\r\n ZipCode: \"\"\r\n }\r\n }\r\n\r\n scope.clickSave = function () {\r\n if (scope.providerForm.$valid) {\r\n scope.provider.CaregiverTitle = null;\r\n scope.provider.CaregiverSpecialty = null;\r\n scope.provider.ProviderGroup = null;\r\n updateLabel();\r\n parsePhoneProperty(\"PhoneNumber1\");\r\n parsePhoneProperty(\"PhoneNumber2\");\r\n parsePhoneProperty(\"FaxNumber\");\r\n parsePhoneProperty(\"MobileNumber\");\r\n parsePhoneProperty(\"AnsweringServiceNumber\");\r\n if (scope.option.temp) {\r\n scope.providerAdded({provider: scope.provider});\r\n\r\n } else {\r\n scope.providerSaved({provider: scope.provider});\r\n }\r\n scope.option.selected = false;\r\n }\r\n }\r\n\r\n function parsePhoneProperty(prop) {\r\n var current = scope.provider[prop];\r\n if (current !== null && current !== undefined && current.length > 0) {\r\n scope.provider[prop] = current.replace(/\\D/g, \"\");\r\n }\r\n }\r\n\r\n function updateLabel() {\r\n var title = null;\r\n if (scope.provider.CaregiverTitle != null) {\r\n title = {\r\n id: scope.provider.CaregiverTitle.Id,\r\n name: scope.provider.CaregiverTitle.Name\r\n };\r\n } else if (scope.provider.CaregiverTitleId > 0) {\r\n var titleObject = lodash.find(scope.caregiverTitles, {Id: scope.provider.CaregiverTitleId});\r\n title = {\r\n id: titleObject.Id,\r\n name: titleObject.Name\r\n };\r\n }\r\n scope.option.label = {\r\n firstName: scope.provider.FirstName,\r\n lastName: scope.provider.LastName,\r\n mi: scope.provider.MiddleInitial,\r\n title: title\r\n };\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"configurations\").directive(\"providerForm\", ProviderFormDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/providerform.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function EditProviderController($scope, ProviderService, provider, configurationContent, $uibModalInstance, webformfields) {\r\n var vm = this;\r\n vm.provider = provider;\r\n\r\n vm.configurationContent = configurationContent;\r\n vm.webformfields = webformfields;\r\n\r\n vm.cancel = cancel;\r\n vm.save = save;\r\n\r\n function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n\r\n function save() {\r\n $scope.providerForm.$setSubmitted(true);\r\n if($scope.providerForm.$valid) {\r\n if(vm.provider !== undefined) {\r\n if(vm.provider.ProviderId !== undefined && vm.provider.ProviderId > 0) {\r\n ProviderService.save(vm.provider).then(function(){\r\n $uibModalInstance.close();\r\n });\r\n } else {\r\n vm.provider.IsEnabled = true;\r\n ProviderService.add(vm.provider).then(function(){\r\n $uibModalInstance.close();\r\n });\r\n }\r\n }\r\n }\r\n }\r\n\r\n $scope.checkHl7Ident = function(hl7Ident, formElement) {\r\n ProviderService.checkHl7Ident(hl7Ident, formElement);\r\n };\r\n}\r\n\r\nangular.module(\"configurations.providers\").controller(\"EditProviderController\", EditProviderController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/providers/editProvider.modal.html',\n '

    Provider

    {{vm.webformfields.Provider_LastName.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_MiddleName.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_FirstName.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_Title.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_OtherName.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_License.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_Hl7Ident.FieldLabel}}
    *Required
    Provider with HL7 Identifier already exists
    {{vm.webformfields.Provider_Specialty.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_Group.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_Address1.FieldLabel}}
    *Required
    *Required
    {{vm.webformfields.Provider_City.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_State.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_Zip.FieldLabel}}
    *Required
    {{vm.webformfields.Provider_Phone1.FieldLabel}}
    Phone is invalid
    *Required
    {{vm.webformfields.Provider_Phone2.FieldLabel}}
    Phone 2 is invalid
    *Required
    {{vm.webformfields.Provider_PhoneMobile.FieldLabel}}
    Mobile Phone is invalid
    *Required
    {{vm.webformfields.Provider_Fax.FieldLabel}}
    Fax is invalid
    *Required
    {{vm.webformfields.Provider_AnsweringService.FieldLabel}}
    Answering Service Number is invalid
    *Required
    {{vm.webformfields.Provider_Email.FieldLabel}}
    *Required
    ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/providers/provider-search-keyword.tpl.html',\n '
    • First Name
    • Last Name
    • Email
    • City
    • State
    • Zip
    • HL7 Ident

    Search supports the following operators: =, >, <, !, &, and |.

    ');\n}]);\n}(window, document, window.angular));","function ProviderService($http, $window, repository) {\r\n\r\n var FILTERKEY = 'providerfilters';\r\n var providerRepo = repository.new(\"Provider\");\r\n\r\n var service = {\r\n add: add,\r\n getAll: getAll,\r\n getSessionFilters: getSessionFilters,\r\n save: save,\r\n saveFiltersToSession: saveFiltersToSession,\r\n getProviderByHl7Ident: getProviderByHl7Ident,\r\n checkHl7Ident: checkHl7Ident\r\n }\r\n\r\n return service;\r\n\r\n function add(provider) {\r\n return providerRepo.create(provider).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getAll(pageSize, page, searchText, sortOrder) {\r\n if (searchText == undefined) { searchText = \"\"; }\r\n if (sortOrder == undefined) { sortOrder = \"\"; }\r\n return $http({\r\n methode: 'GET',\r\n url: '/api/provider/List',\r\n params: {\r\n pageSize: pageSize,\r\n page: page,\r\n searchText: searchText,\r\n sortOrder: sortOrder\r\n }\r\n }).then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n console.log(err);\r\n return [];\r\n });\r\n }\r\n\r\n function getSessionFilters() {\r\n return angular.fromJson($window.sessionStorage.getItem(FILTERKEY));\r\n }\r\n\r\n function save(provider) {\r\n console.log(provider)\r\n return providerRepo.update(provider.Id, provider).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveFiltersToSession(filters) {\r\n $window.sessionStorage.setItem(FILTERKEY, angular.toJson(filters));\r\n }\r\n\r\n function getProviderByHl7Ident(hl7Ident) {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/Provider',\r\n params: {\r\n hl7Ident: hl7Ident\r\n }\r\n })\r\n .then(function(response){\r\n return response.data;\r\n })\r\n /*\r\n .catch(function(){\r\n return null;\r\n })\r\n */\r\n ;\r\n }\r\n\r\n function checkUnsavedProviders(hl7Ident, unsavedProviders, formElement) {\r\n var duplicatesFound = false;\r\n if ((unsavedProviders !== undefined) && (unsavedProviders !== null))\r\n {\r\n if ((hl7Ident !== undefined) && (hl7Ident !== null) && (hl7Ident != ''))\r\n {\r\n var foundCount = 0;\r\n for (var i = 0; i < unsavedProviders.length; i++)\r\n {\r\n if (unsavedProviders[i] === hl7Ident)\r\n {\r\n foundCount++\r\n }\r\n }\r\n //We allow only one (the current value) to be in the list of providers\r\n duplicatesFound = foundCount > 1;\r\n }\r\n }\r\n \r\n formElement.$setValidity('exists', !duplicatesFound);\r\n\r\n return duplicatesFound;\r\n }\r\n\r\n function refreshUnsavedProviders(oldHl7Ident, hl7Ident, formElement, unsavedProviders, unsavedProviderFormFields) {\r\n if ((unsavedProviders !== undefined) && (unsavedProviders !== null))\r\n {\r\n //Clear out the old value\r\n if ((unsavedProviders !== undefined) && (unsavedProviders !== null)) {\r\n var i = unsavedProviders.indexOf(oldHl7Ident);\r\n if (i > -1) {\r\n unsavedProviders.splice(i, 1);\r\n }\r\n }\r\n\r\n //Clear out the old field reference\r\n if ((unsavedProviderFormFields !== undefined) && (unsavedProviderFormFields !== null))\r\n {\r\n var fieldIndex = unsavedProviderFormFields.indexOf(formElement);\r\n if (fieldIndex > -1) {\r\n unsavedProviderFormFields.splice(fieldIndex, 1);\r\n }\r\n }\r\n\r\n //Only add back the new value and the field reference if there is a value in it\r\n if ((hl7Ident !== undefined) && (hl7Ident !== null) && (hl7Ident != '')) {\r\n //Add the hl7Ident to the list so we check it also before it is saved\r\n unsavedProviders.push(hl7Ident);\r\n\r\n //If the field has a value, add it to the list of fields to inspect and check for problems\r\n if ((unsavedProviderFormFields !== undefined) && (unsavedProviderFormFields !== null)) {\r\n unsavedProviderFormFields.push(formElement);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function checkHl7Ident(hl7Ident, formElement, oldHl7Ident, unsavedProviders, unsavedProviderFormFields) {\r\n refreshUnsavedProviders(oldHl7Ident, hl7Ident, formElement, unsavedProviders, unsavedProviderFormFields);\r\n\r\n //First, check the current field\r\n checkUnsavedProviders(hl7Ident, unsavedProviders, formElement);\r\n\r\n //Now, refresh all the remaining unsaved form fields since removing a value from the collection could cause another form field to no longer \r\n //have a validation error\r\n //Only do this is the current element is valid (one other will be invalid, so find it)\r\n if (formElement.$valid) {\r\n if ((unsavedProviderFormFields !== undefined) && (unsavedProviderFormFields !== null)) {\r\n unsavedProviderFormFields.forEach(function(unsavedFormField) {\r\n //We will check the current form element in the API below\r\n if (unsavedFormField !== formElement)\r\n {\r\n checkUnsavedProviders(unsavedFormField.$viewValue, unsavedProviders, unsavedFormField);\r\n }\r\n });\r\n }\r\n }\r\n\r\n //Now actually check the platform to see if we have a duplicate saved Hl7Ident\r\n if ((hl7Ident !== undefined) && (hl7Ident !== null) && (hl7Ident != ''))\r\n {\r\n getProviderByHl7Ident(hl7Ident).then(function(data){\r\n //If the unsaved provider check set the form field to invalid, this may reset it to valid\r\n //but that's okay since one field should be valid if there are other duplicates.\r\n formElement.$setValidity('dataExists', !data);\r\n });\r\n }\r\n else {\r\n //The field is blank, clear any validity errors\r\n formElement.$setValidity('dataExists', true);\r\n formElement.$setValidity('exists', true);\r\n }\r\n }\r\n \r\n}\r\n\r\nangular.module('configurations.providers').factory('ProviderService', ProviderService);","function ProvidersController(ProviderService, vhSweetAlert, $uibModal, configurationContent, webformfields) {\r\n\r\n var vm = this;\r\n\r\n vm.configurationContent = configurationContent;\r\n vm.webformfields = [];\r\n defineWebformFields(webformfields);\r\n\r\n vm.isAll = true;\r\n vm.currentPage = 1;\r\n vm.startProvider = 1;\r\n vm.providers = [];\r\n\r\n vm.editProvider = editProvider;\r\n vm.pageChanged = pageChanged;\r\n vm.search = search;\r\n vm.setSortOrder = setSortOrder;\r\n vm.showSearchHelper = showSearchHelper;\r\n vm.setSearchText = setSearchText;\r\n vm.toggleProvider = toggleProvider;\r\n\r\n activate();\r\n filterProviderGroups();\r\n \r\n function activate() {\r\n setFilters();\r\n getProviders();\r\n }\r\n\r\n function filterProviderGroups() {\r\n var groups \r\n = configurationContent.ProviderGroups.filter(function(group) { return group.IsEnabled });\r\n vm.configurationContent.ProviderGroups = groups;\r\n }\r\n\r\n function toggleProvider(provider) {\r\n console.log(provider);\r\n provider.IsEnabled = !provider.IsEnabled;\r\n ProviderService.save(provider);\r\n }\r\n\r\n function defineWebformFields(fields) {\r\n if (fields) {\r\n for (var i = 0; i < fields.length; i++) {\r\n vm.webformfields[fields[i].FieldName] = fields[i];\r\n }\r\n }\r\n }\r\n\r\n function editProvider(provider) {\r\n $uibModal.open({\r\n controller: 'EditProviderController as vm',\r\n templateUrl: 'modules/configurations/providers/editProvider.modal.html',\r\n size: 'lg',\r\n resolve: {\r\n provider: function() {\r\n return provider;\r\n },\r\n configurationContent: function () {\r\n return vm.configurationContent;\r\n },\r\n webformfields: function() {\r\n return vm.webformfields;\r\n }\r\n }\r\n }).result\r\n .then(function(result){ \r\n getProviders();\r\n });\r\n }\r\n\r\n function getProviders() {\r\n ProviderService.getAll(vm.pageSize, vm.currentPage, vm.searchText, vm.sortOrder).then(function (data) {\r\n vm.providers = data.Records;\r\n vm.numProviders = data.TotalRecords;\r\n vm.startProvider = Math.min((vm.currentPage - 1) * vm.pageSize + 1, vm.numProviders);\r\n vm.endProvider = Math.min(vm.startProvider + vm.pageSize - 1, vm.numProviders);\r\n\r\n saveFilters();\r\n\r\n });\r\n\r\n }\r\n\r\n function pageChanged() {\r\n search();\r\n }\r\n\r\n function saveFilters() {\r\n var filter = {\r\n pageSize: vm.pageSize,\r\n searchText: vm.searchText,\r\n sortOrder: vm.sortOrder\r\n }\r\n ProviderService.saveFiltersToSession(filter);\r\n }\r\n\r\n function search() {\r\n getProviders();\r\n }\r\n\r\n function setFilters() {\r\n var filter = ProviderService.getSessionFilters();\r\n if (!filter) { filter = {} }\r\n vm.pageSize = filter.pageSize || 25;\r\n vm.searchText = filter.searchText || '';\r\n vm.sortOrder = filter.sortOrder || 'Last Name';\r\n }\r\n\r\n function setSearchText(searchText) {\r\n vm.searchText = searchText;\r\n search();\r\n }\r\n\r\n function setSortOrder(sortOrder) {\r\n vm.sortOrder = sortOrder;\r\n search();\r\n }\r\n\r\n function showSearchHelper() {\r\n vhSweetAlert({\r\n title: 'Search Keywords',\r\n templateUrl: 'modules/configurations/providers/provider-search-keyword.tpl.html'\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module(\"configurations.providers\").controller(\"ProvidersController\", ProvidersController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/providers/providers.tpl.html',\n '

    Providers

    1. Viewing {{vm.startProvider}}-{{vm.endProvider}} of {{vm.numProviders}}
    {{provider.LastName}}, {{provider.FirstName}} {{provider.MiddleInitial}}   {{provider.CaregiverTitle.Name}}
    {{provider.AddressOne}} , {{provider.AddressTwo}}
    {{provider.City}} {{provider.State}}, {{provider.ZipCode}}
    {{vm.webformfields.Provider_Specialty.FieldLabel}}: {{provider.CaregiverSpecialty.Name}}
    {{vm.webformfields.Provider_Group.FieldLabel}}: {{provider.ProviderGroup.Name}}
    {{vm.webformfields.Provider_License.FieldLabel}}: {{provider.License}} {{vm.webformfields.Provider_Hl7Ident.FieldLabel}}: {{provider.Hl7Ident}}
    {{vm.webformfields.Provider_Phone1.FieldLabel}}: {{provider.PhoneNumber1 | tel}}
    {{vm.webformfields.Provider_Phone2.FieldLabel}}: {{provider.PhoneNumber2 | tel}}
    {{vm.webformfields.Provider_PhoneMobile.FieldLabel}}: {{provider.MobileNumber | tel}}
    {{vm.webformfields.Provider_Fax.FieldLabel}}: {{provider.FaxNumber | tel}}
    {{vm.webformfields.Provider_AnsweringService.FieldLabel}}: {{provider.AnsweringServiceNumber | tel}}
    {{vm.webformfields.Provider_Email.FieldLabel}}: {{provider.EmailAddress}}
    ');\n}]);\n}(window, document, window.angular));","function ReasonFormDirective(lodash, $filter, PermissionService) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^optionContainer\",\r\n templateUrl: \"modules/configurations/reasonform.tpl.html\",\r\n scope: {\r\n reasonChanged: \"&\",\r\n reasonAdded: \"&\",\r\n populationList: \"=\"\r\n },\r\n link: function (scope, elem, attrs, optionContainerController) {\r\n \r\n scope.hasTagWrite = PermissionService.userHasPermission([\"PatientTagWrite\"]);\r\n scope.option = optionContainerController.option;\r\n var allPatients = lodash.find(scope.populationList, function (p) { return p.IsAllPatients; });\r\n scope.lodash = lodash;\r\n if (scope.option.temp) {\r\n\r\n optionContainerController.updateLabel('New Reason');\r\n\r\n scope.option = {\r\n label: 'New Reason',\r\n inputs: {\r\n text: '',\r\n populations: [allPatients]\r\n },\r\n icon: \"fa-bookmark-o\",\r\n enabled: true,\r\n isDefault: false,\r\n visible: true,\r\n editable: true,\r\n selected: true,\r\n temp: true,\r\n sortOrder: 0\r\n };\r\n }\r\n\r\n var lastSelectedPrograms = angular.copy(scope.option.inputs.populations);\r\n\r\n scope.$watch('option.inputs.text', function() {\r\n if(!scope.option.temp) {\r\n optionContainerController.updateLabel(scope.option.inputs.text);\r\n }\r\n });\r\n\r\n scope.populationsChanged = function() {\r\n var lodash = scope.lodash;\r\n // if it was just All Patients and they added something else\r\n if (lastSelectedPrograms.length == 1 && lastSelectedPrograms[0].IsAllPatients && scope.option.inputs.populations.length > 1) {\r\n //remove All Patients\r\n var copySelected = angular.copy(scope.option.inputs.populations);\r\n lodash.remove(copySelected, p => p.IsAllPatients);\r\n scope.option.inputs.populations = copySelected;\r\n }\r\n // if it was just other programs and they added All Patients\r\n else if(lodash.find(lastSelectedPrograms, p => p.IsAllPatients) === undefined &&\r\n lodash.find(scope.option.inputs.populations, p => p.IsAllPatients) !== undefined) {\r\n //add All Patients, remove all others\r\n scope.option.inputs.populations = [allPatients];\r\n }\r\n // must have a population on this screen\r\n else if(scope.option.inputs.populations.length == 0) {\r\n // default to All Patients\r\n scope.option.inputs.populations = [allPatients];\r\n }\r\n \r\n // remember old selection in order to track changes\r\n lastSelectedPrograms = angular.copy(scope.option.inputs.populations);\r\n }\r\n \r\n scope.clickSave = function () {\r\n if (scope.reasonForm.$valid) {\r\n if (scope.option.temp) {\r\n scope.reasonAdded({reason: scope.option, inOption: scope.option.parent});\r\n } else {\r\n scope.reasonChanged({reason: scope.option});\r\n }\r\n scope.option.selected = false;\r\n scope.reasonForm.$setPristine();\r\n }\r\n }; \r\n }\r\n }\r\n}\r\n\r\nangular.module(\"configurations\").directive(\"reasonForm\", ReasonFormDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/reasonform.tpl.html',\n '
    {{$item.PopulationName}}{{population.PopulationName}}
    ');\n}]);\n}(window, document, window.angular));","function TransformFormDirective(lodash, $filter) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^optionContainer\",\r\n templateUrl: \"modules/configurations/transformform.tpl.html\",\r\n scope: {\r\n transformDetailChanged: \"&\",\r\n transformDetailAdded: \"&\"\r\n },\r\n link: function (scope, elem, attrs, optionContainerController) {\r\n scope.option = optionContainerController.option;\r\n\r\n if (scope.option.temp) {\r\n\r\n optionContainerController.updateLabel('New Variable Transform');\r\n\r\n scope.option = {\r\n id: 0,\r\n parentId: scope.option.parent.id,\r\n label: 'New Variable Transform',\r\n inputs: {\r\n sourceValue: '',\r\n targetValue: ''\r\n },\r\n icon: \"fa-bookmark-o\",\r\n enabled: true,\r\n isDefault: false,\r\n visible: true,\r\n editable: true,\r\n selected: true,\r\n temp: true,\r\n parent: scope.option.parent,\r\n sortOrder: scope.option.parent.options.length\r\n };\r\n } else {\r\n optionContainerController.updateLabel(scope.option.inputs.sourceValue + ' = ' + scope.option.inputs.targetValue);\r\n }\r\n\r\n scope.clickSave = function () {\r\n if (scope.transformForm.$valid) {\r\n if (scope.option.id === 0) {\r\n scope.transformDetailAdded({option: scope.option});\r\n } else {\r\n scope.transformDetailChanged({option: scope.option});\r\n }\r\n scope.option.selected = false;\r\n optionContainerController.updateLabel(scope.option.inputs.sourceValue + ' = ' + scope.option.inputs.targetValue);\r\n }\r\n };\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"configurations\").directive(\"transformForm\", TransformFormDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/configurations/transformform.tpl.html',\n '
    ');\n}]);\n}(window, document, window.angular));","function AddCategoryModalController($uibModalInstance, categories, isEdit, showPopulations, category, lodash, vhSweetAlert, ContentChartService) {\r\n var vm = this;\r\n vm.categoryName = '';\r\n\r\n vm.categoryPopulations = [];\r\n vm.lastSelectedPrograms = [];\r\n vm.availablePopulations = [];\r\n vm.populationsChanged = populationsChanged;\r\n vm.showPopulations = showPopulations;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.titleText = 'Add New Category';\r\n vm.bodyText = 'Enter New Category Name:';\r\n\r\n if (isEdit===true) {\r\n vm.titleText = 'Edit Category Name';\r\n vm.bodyText = 'Enter New Category Name';\r\n vm.categoryName = category.Name;\r\n vm.category = category;\r\n }\r\n\r\n init();\r\n\r\n function init() {\r\n ContentChartService.getPopulations().then(function (data) {\r\n vm.allPatients = lodash.find(data, function (p) { return p.IsAllPatients; });\r\n vm.availablePopulations = data;\r\n });\r\n if (isEdit) {\r\n ContentChartService.getCategoryPopulations(vm.category.MasterChartCategoryId).then(function (data) {\r\n vm.categoryPopulations = data;\r\n vm.lastSelectedPrograms = angular.copy(vm.categoryPopulations);\r\n });\r\n }\r\n }\r\n\r\n function populationsChanged() {\r\n // if it was just All Patients and they added something else\r\n if (vm.lastSelectedPrograms.length == 1 && vm.lastSelectedPrograms[0].IsAllPatients && vm.categoryPopulations.length > 1) {\r\n //remove All Patients\r\n var copySelected = angular.copy(vm.categoryPopulations);\r\n lodash.remove(copySelected, p => p.IsAllPatients);\r\n vm.categoryPopulations = copySelected;\r\n }\r\n // if it was just other programs and they added All Patients\r\n else if(lodash.find(vm.lastSelectedPrograms, p => p.IsAllPatients) === undefined &&\r\n lodash.find(vm.categoryPopulations, p => p.IsAllPatients) !== undefined) {\r\n //add All Patients, remove all others\r\n vm.categoryPopulations = [vm.allPatients];\r\n }\r\n\r\n // remember old selection in order to track changes\r\n vm.lastSelectedPrograms = angular.copy(vm.categoryPopulations);\r\n }\r\n\r\n function ok(isValid) {\r\n\r\n if (isValid) {\r\n var categoryIndex = lodash.findIndex(categories, function(chr) { return chr.Name.trim().toUpperCase() == vm.categoryName.trim().toUpperCase();});\r\n if (!isEdit && categoryIndex >= 0) {\r\n vhSweetAlert.error('A category with that name already exists');\r\n } else {\r\n $uibModalInstance.close(vm);\r\n }\r\n }\r\n\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('content').controller('AddCategoryModalController', AddCategoryModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/addcategory.modal.html',\n '

    {{vm.titleText}}

    {{vm.bodyText }}

    Program(s):{{$item.PopulationName}}{{population.PopulationName}}
    ');\n}]);\n}(window, document, window.angular));","function AddEntryModalController($uibModalInstance, lodash, vhSweetAlert, isEdit, entry, categories) {\r\n var vm = this;\r\n vm.entryText = '';\r\n\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.titleText = 'Add New Entry';\r\n vm.bodyText = 'Enter New Chart Entry:';\r\n vm.isEdit = isEdit;\r\n vm.categories = categories;\r\n vm.selectedCategory = selectedCategory;\r\n vm.entry = entry;\r\n\r\n if (vm.isEdit===true) {\r\n vm.titleText = 'Edit Entry';\r\n vm.bodyText = 'Enter New Entry Text';\r\n vm.entryText = entry.Text;\r\n } else {\r\n vm.entry = {};\r\n }\r\n\r\n function ok() {\r\n vm.entry.Text = vm.entryText;\r\n $uibModalInstance.close(vm.entry);\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function selectedCategory(newCategory) {\r\n if (angular.isDefined(newCategory)) {\r\n if (newCategory) {\r\n vm.entry.MasterChartCategoryId = newCategory.MasterChartCategoryId;\r\n vm.entry.SortOrder = lodash(vm.categories).filter({MasterChartCategoryId: newCategory.MasterChartCategoryId}).pluck('MasterChartEntries').flatten().pluck('SortOrder').max() + 1;\r\n } else {\r\n vm.entry.MasterChartCategoryId = null;\r\n }\r\n }\r\n return lodash.find(vm.categories, function (c) { return c.MasterChartCategoryId == vm.entry.MasterChartCategoryId; });\r\n }\r\n}\r\nangular.module('content').controller('AddEntryModalController', AddEntryModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/addentry.modal.html',\n '

    {{vm.titleText}}

    Enter Category

    {{vm.bodyText}}

    ');\n}]);\n}(window, document, window.angular));","function AddEditCardController(\r\n $uibModalInstance,\r\n lodash,\r\n CardsService,\r\n PermissionService,\r\n card,\r\n isCopy\r\n) {\r\n vm = this;\r\n\r\n\r\n // initial settings\r\n vm.languageId = 1;\r\n vm.submitted = false;\r\n vm.defaultContent = {};\r\n vm.errors = {};\r\n\r\n // used for ui-select controls\r\n vm.selectedStatus = null;\r\n vm.selectedIcon = \"\";\r\n vm.selectedStatus = \"\";\r\n\r\n // setup view model function references\r\n vm.setCurrentLanguage = _setCurrentLanguage;\r\n vm.statusChanged = _statusChanged;\r\n vm.ok = _ok;\r\n vm.cancel = _cancel;\r\n vm.iconChanged = _iconChanged;\r\n vm.fontChanged = _fontChanged;\r\n vm.getSelectedFont = _getSelectedFont;\r\n vm.getIconClass = _getIconClass;\r\n vm.getHeroColor = _getHeroColor;\r\n \r\n vm.canAssignDisabledItems = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n vm.showDisabled = false;\r\n\r\n // ui-select value lists\r\n vm.icons = [];\r\n CardsService.getIcons().then(icons => vm.icons = icons);\r\n\r\n\r\n vm.cardStatus = [\r\n { Name: \"Default\", Value: 1 },\r\n { Name: \"Positive\", Value: 2 },\r\n { Name: \"Warning\", Value: 3 },\r\n { Name: \"Negative\", Value: 4 }\r\n ];\r\n\r\n // make sure we have a card object if nothing was passed into the modal\r\n vm.card = card || {\r\n CardId: -1,\r\n CardStatusId: 1,\r\n Name: null,\r\n Icon: null,\r\n CardContents: [],\r\n Populations: []\r\n };\r\n \r\n if(isCopy)\r\n {\r\n vm.card.CardId = -1;\r\n delete vm.card.CardUId;\r\n vm.card = JSON.parse(JSON.stringify(vm.card));\r\n vm.card.Name = vm.card.Name + ' - copy';\r\n vm.card.CardContents.forEach(x => x.CardId = -1);\r\n }\r\n \r\n // in case we ever use the modal for editing cards\r\n vm.modalHeader = vm.card.CardId == -1 ? \"Add New Coach Card\" : \"Edit Coach Card\";\r\n // setup defaults based on current card values \r\n vm.card.CardStatusId = vm.card.CardStatusId || 1;\r\n vm.card.Populations = vm.card.Populations || [];\r\n vm.selectedStatus = lodash.find(vm.cardStatus, function(x){ return x.Value == vm.card.CardStatusId });\r\n\r\n\r\n // set selected icon based on the card icon\r\n var icon = (vm.card.Icon || '').split(' ');\r\n vm.selectedIcon = lodash.find(icon, function(x) {\r\n return x.indexOf(\"fa-\") > -1 || x.indexOf(\"vh-ui-glyph-\") > -1;\r\n });\r\n\r\n // set the current language\r\n if (vm.card.CardId != -1) {\r\n _setCurrentLanguage(vm.languageId);\r\n }\r\n\r\n // get the list of available languages and create card content objects for missing languages\r\n CardsService.getLanguages().then(function(data) {\r\n vm.availableLanguages = data;\r\n\r\n // temporary content array\r\n var tmpContents = [];\r\n // loop through the returned language data\r\n lodash(data)\r\n .forEach(function(language) {\r\n // get the existing card content for the language\r\n var content = lodash(vm.card.CardContents).find(function(x) {\r\n return x.LanguageId == language.LanguageId;\r\n });\r\n\r\n // if the card content exists add it to the temporary content array\r\n // ensure that the card content has the correct card id\r\n if (content) {\r\n content.CardId = vm.card.CardId;\r\n tmpContents.push(content);\r\n } else { // if the card content doesn't exist create a new card content for the language...this will be filtered out on save if no data is added to it\r\n tmpContents.push({\r\n CardContentId: -1,\r\n CardId: vm.card.CardId,\r\n LanguageId: language.LanguageId,\r\n Title: null,\r\n Subtitle: null,\r\n Information: null,\r\n Value: null,\r\n Units: null\r\n });\r\n }\r\n })\r\n .value();\r\n\r\n // this logic gets a list of available languages\r\n // then looks for any card contents where the languages isn't in the list \r\n // of enabled languages and adds the card content in anyway\r\n // this way we don't lose any previosuly configured card content records\r\n // for languages that have been disabled\r\n var activeLanguageIds = lodash.map(vm.availableLanguages, \"LanguageId\");\r\n var disabledCardContents = lodash.filter(vm.card.CardContents, function(x) {\r\n return activeLanguageIds.indexOf(x.LanguageId) == -1;\r\n });\r\n\r\n lodash.forEach(disabledCardContents, function(x) {\r\n tmpContents.push(x);\r\n });\r\n\r\n // set the default content to the first card content record\r\n vm.defaultContent = tmpContents[0];\r\n vm.languageId = tmpContents[0].LanguageId;\r\n\r\n // set the card.CardContents to the composed temporary card contents\r\n vm.card.CardContents = tmpContents;\r\n\r\n // set the selected content to the first card content record\r\n vm.selectedContent = tmpContents[0];\r\n\r\n });\r\n\r\n // get the list of available populations\r\n \r\n\r\n vm.toggleDisabled = ()=>{\r\n vm.showDisabled=!vm.showDisabled;\r\n updatePopulationList();\r\n }\r\n\r\n updatePopulationList();\r\n\r\n vm.isInSelection = (item) => {\r\n vm.card.Populations.find(x => x.PopulationId === item.PopulationId);\r\n }\r\n\r\n function updatePopulationList(){\r\n CardsService.getPopulations().then(function(data) {\r\n vm.populations = [...data.filter(x => x.IsEnabled)]\r\n if(vm.showDisabled){\r\n vm.populations.push(...data.filter(x => !x.IsEnabled))\r\n }else{\r\n vm.populations.push(...data.filter(x => !x.IsEnabled && vm.isInSelection(x)))\r\n }\r\n }); \r\n }\r\n\r\n\r\n \r\n\r\n // gets the hero css color class based on card status id\r\n function _getHeroColor(cardStatusId) {\r\n\r\n cardStatusId != null ? cardStatusId : vm.card.CardStatusId;\r\n\r\n var retVal = \"DefaultCard\";\r\n switch (cardStatusId || 1) {\r\n case 1:\r\n retVal = \"DefaultCard\";\r\n break;\r\n case 2:\r\n retVal = \"PositiveCard\";\r\n break;\r\n case 3:\r\n retVal = \"WarningCard\";\r\n break;\r\n case 4:\r\n retVal = \"NegativeCard\";\r\n break;\r\n }\r\n return retVal;\r\n }\r\n\r\n\r\n // updates the selected language and chooses the correct card content to display/edit\r\n function _setCurrentLanguage(languageId) {\r\n vm.languageId = languageId;\r\n vm.selectedContent = _getSelectedCardContent();\r\n return vm;\r\n }\r\n\r\n // gets the current selected card content based on the selected language id\r\n // language is changed by clicking the language tabs on the modal\r\n function _getSelectedCardContent() {\r\n return (\r\n lodash(vm.card.CardContents).find(function(x) {\r\n return x.LanguageId == vm.languageId;\r\n }) || {}\r\n );\r\n }\r\n\r\n // update the card status id based on the status dropdown on the modal\r\n function _statusChanged() {\r\n vm.card.CardStatusId = vm.selectedStatus.Value; \r\n return vm;\r\n }\r\n\r\n // this looks at passed in icon or the selected icon on the modal\r\n // and returns the correct font fa or vh\r\n function _getSelectedFont(icon){\r\n icon = icon || vm.selectedIcon || '';\r\n\r\n return icon.indexOf('fa-') > -1 ? 'fa' : icon.indexOf('vh-ui-glyph') > -1 ? 'vh' : '';\r\n }\r\n\r\n // a helper method that creates the string needed to display the icon on the \r\n // hero card on the modal\r\n function _getIconClass(icon){\r\n \r\n icon = icon || vm.selectedIcon || '';\r\n\r\n if (_getSelectedFont(icon) === \"fa\")\r\n return \"fa \" + vm.selectedIcon ;\r\n else \r\n return \"vh-ui-glyph \" + vm.selectedIcon;\r\n }\r\n\r\n // handles updating the card.Icon property when the icon ui-select\r\n // is changed on the modal\r\n function _iconChanged() {\r\n vm.selectedIcon = vm.selectedIcon || '';\r\n if (vm.selectedIcon.length > 0) {\r\n if (_getSelectedFont() === \"fa\")\r\n vm.card.Icon =\r\n \"HeroIcon fa \" + vm.selectedIcon + \" HeroIconPos2\";\r\n else vm.card.Icon = \"HeroIcon vh-ui-glyph \" + vm.selectedIcon;\r\n }\r\n else{\r\n vm.card.Icon = '';\r\n }\r\n return vm;\r\n }\r\n\r\n // triggered when one of the font buttons is clicked\r\n // this sets a default icon for whichever button was clicked\r\n function _fontChanged(font) {\r\n font = font || _getSelectedFont();\r\n\r\n if (font == \"vh\") {\r\n vm.card.Icon = \"HeroIcon vh-ui-glyph vh-ui-glyph-item-glucose\";\r\n vm.selectedIcon = \"vh-ui-glyph-item-glucose\";\r\n } else {\r\n vm.card.Icon = \"HeroIcon fa fa-thermometer-full HeroIconPos2\";\r\n vm.selectedIcon = \"fa-thermometer-full\";\r\n }\r\n return vm;\r\n }\r\n\r\n // the ok button click\r\n function _ok() {\r\n vm.submitted = true;\r\n\r\n // error object used to determine what errors to display on the modal\r\n vm.errors = {};\r\n\r\n // validation helper function\r\n // loops through strings passed in and \r\n // trims them...adds them together...trims that..and returns the length\r\n var trim = function(){\r\n var value = '';\r\n\r\n for(var x in arguments){\r\n value+= (arguments[x] || '').trim();\r\n }\r\n\r\n return value.trim();\r\n };\r\n\r\n // card name validation. We don't submit if there is no name\r\n if(trim(vm.card.Name).length == 0){\r\n vm.errors.Name = 'Card name is required';\r\n }\r\n\r\n // use the trim method to make sure that at least one of the following properties\r\n // is set to a value\r\n var content = vm.defaultContent;\r\n if(trim(content.Title, content.Subtitle, content.Information, content.Value, content.Units).length == 0){\r\n vm.errors.card = 'You must enter either Card Title, Subtitle, Information, Value or Units.';\r\n }\r\n\r\n // exit out of the function if there are any errors\r\n if(Object.keys(vm.errors).length > 0)\r\n return;\r\n\r\n // filter out all card contents that are new but have no card content\r\n vm.card.CardContents = lodash.filter(vm.card.CardContents, function(content){\r\n return (content.CardContentId || -1) > -1 || trim(content.Title, content.Subtitle, content.Information, content.Value, content.Units).length > 0;\r\n })\r\n\r\n vm.card.Populations.forEach(population => {\r\n population.CardTblPopulationId == 0 ? -1 : population.CardTblPopulationId;\r\n });\r\n\r\n\r\n // close the modal \r\n $uibModalInstance.close(vm.card);\r\n\r\n }\r\n\r\n // the cancel button click\r\n function _cancel() {\r\n $uibModalInstance.dismiss(\"cancel\");\r\n }\r\n}\r\nangular\r\n .module(\"content.cards\")\r\n .controller(\"AddEditCardController\", AddEditCardController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/cards/addeditcard.modal.html',\n '

    {{vm.modalHeader}}


    Show Disabled Programs
    {{$item.PopulationName}} (disabled){{population.PopulationName}}(disabled) 0\" ng-click=\"vm.card.Populations = []\">
    {{$select.selected}}
    -1 ? \\'Font Awesome\\' : \\'Vivify Font action\\' }} : {{icon}}\" tooltip-placement=\"bottom\" tooltip-append-to-body=\"true\"> -1 ? \\'fa \\' : \\'vh-ui-glyph \\')}}{{icon}}\">
    (view icons) (view icons)
    {{$select.selected.Name}}
    {{item.Name}}
    1\">

    {{vm.selectedContent.Value}} {{vm.selectedContent.Units}}

    ');\n}]);\n}(window, document, window.angular));","\r\nfunction CardsController(CardsService, $rootScope, lodash, $uibModal, PermissionService, $stateParams, $state, $sce, vhSweetAlert, $http) {\r\n \r\n var vm = this;\r\n\r\n vm.userCanReadCard = PermissionService.userHasPermission([\"CoachCardRead\"]);\r\n vm.userCanWriteCard = PermissionService.userHasPermission([\"CoachCardWrite\"]);\r\n vm.userCanEditRules = PermissionService.userHasPermission([\"RuleWrite\"]);\r\n vm.cards = [];\r\n vm.itemsSelected = [];\r\n\r\n vm.addCard = _addCard;\r\n vm.editCard = _editCard\r\n vm.copyCard = _copyCard;\r\n vm.selectToggle = _selectToggle;\r\n vm.isSelected = _isSelected;\r\n vm.toggle = _toggle;\r\n vm.export = _export;\r\n vm.showImportModal =_showImportModal;\r\n\r\n var defaultLanguageId = 1;\r\n vm.currentPage = 1;\r\n vm.maxSize = 5;\r\n vm.pageSize = CardsService.getPageSize();\r\n vm.totalItems = 0;\r\n vm.LanguageId = defaultLanguageId;\r\n vm.searchTextBox = '';\r\n vm.activeSearch = false;\r\n vm.noSearchResults = false;\r\n vm.searchText = '';\r\n vm.selectedCard = {};\r\n vm.currentLanguage = \"\";\r\n vm.currentLanguageIndex = 0;\r\n vm.languages = [];\r\n vm.selectedCardRules = [];\r\n vm.contentIndex = 0;\r\n vm.groupName = '';\r\n \r\n vm.searching = false;\r\n\r\n \r\n loadController();\r\n\r\n\r\n\r\n function loadController() {\r\n if ($stateParams.cardGroupId > -2) {\r\n vm.cardGroupId = $stateParams.cardGroupId;\r\n CardsService.getCardGroupByPage(vm.currentPage, vm.pageSize, $stateParams.cardGroupId).then(function(group){\r\n vm.cards = group.Cards;\r\n lodash.forEach(vm.cards, function(data) {\r\n data.selected = false;\r\n })\r\n vm.totalItems = group.CardCount;\r\n });\r\n } else {\r\n\r\n vm.cardGroupId = $stateParams.cardGroupId;\r\n\r\n CardsService.getCards().then(function(data){\r\n\r\n var start = 0;\r\n var end = start + vm.pageSize;\r\n\r\n vm.cards = data.slice(start, end);\r\n \r\n lodash.forEach(vm.cards, function(data) {\r\n data.selected = false;\r\n })\r\n\r\n vm.totalItems = data.length;\r\n vm.pageChanged();\r\n });\r\n\r\n }\r\n\r\n\r\n CardsService.getCardGroups()\r\n .then(data => {\r\n switch(vm.cardGroupId || ''){\r\n case -1:\r\n vm.groupName = 'Unassigned';\r\n break;\r\n case '':\r\n vm.groupName = '';\r\n break;\r\n default:\r\n vm.groupName = (data.find(x => x.CardGroupId == vm.cardGroupId) || {}).CardGroupName;\r\n break;\r\n }\r\n })\r\n \r\n }\r\n\r\n function _extractFileName(headerContentDisposition) {\r\n var filename = \"\";\r\n var disposition = headerContentDisposition;\r\n if (disposition && disposition.indexOf('attachment') !== -1) {\r\n var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\r\n var matches = filenameRegex.exec(disposition);\r\n if (matches != null && matches[1]) { \r\n filename = matches[1].replace(/['\"]/g, '');\r\n }\r\n }\r\n return filename;\r\n }\r\n\r\n function _export(card){\r\n\r\n \r\n var ids = card != null ? [card.CardUId] : vm.itemsSelected.map(function (x) {\r\n return x.CardId\r\n });\r\n\r\n if(ids.length == 0)\r\n return;\r\n\r\n $http.post('/api/export/cards', JSON.stringify(ids))\r\n .then(function successCallback(response) {\r\n var headersFn = response.headers;\r\n var headers = headersFn();\r\n\r\n var filename = _extractFileName(headers['content-disposition']);\r\n var contentType = headers['content-type'];\r\n \r\n var a = document.createElement('a');\r\n try {\r\n var blob = new Blob([JSON.stringify(response.data)], { type: contentType });\r\n var url = window.URL.createObjectURL(blob);\r\n \r\n vhSweetAlert.success('Exported', `Successfully exported ${(vm.itemsSelected || []).length} cards.`);\r\n\r\n a.setAttribute('href', url);\r\n a.setAttribute(\"download\", filename);\r\n a.click(); \r\n\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n }, function errorCallback(error) {\r\n console.log('Something went wrong!!!')\r\n });\r\n \r\n }\r\n\r\n function _toggle($event, card){\r\n \r\n $event.stopPropagation();\r\n\r\n if(_isSelected(card)){\r\n vm.itemsSelected = vm.itemsSelected.filter(x => x.CardId != card.CardId);\r\n } else {\r\n vm.itemsSelected.push(card);\r\n }\r\n\r\n }\r\n\r\n function _isSelected(card){\r\n return vm.itemsSelected.find(x => x.CardId == card.CardId) != null;\r\n }\r\n \r\n function _selectToggle(){\r\n \r\n if(vm.itemsSelected.length > 0)\r\n {\r\n vm.itemsSelected = [];\r\n }\r\n else\r\n {\r\n CardsService.getCards().then(allData => {\r\n var data = allData;\r\n if(vm.cardGroupId == -2){\r\n data = allData;\r\n } else if(vm.cardGroupId && vm.cardGroupId != -1){\r\n data = data.filter(card => card.Populations.find(p => p.PopulationId == vm.cardGroupId) != null)\r\n }else if (vm.cardGroupId == -1){\r\n data = data.filter(card => card.Populations.length == 0);\r\n }\r\n\r\n if((vm.searchTextBox || '').length > 0){\r\n data = data.filter(card => card.Name.toLowerCase().indexOf(vm.searchTextBox.toLowerCase()) > -1);\r\n }\r\n\r\n data.forEach(card => {\r\n card.CardContents = card.CardContents.sort((a,b) => (a.LanguageId > b.LanguageId ? 1 : a.LanguageId < b.LanguageId ? -1 : 0));\r\n })\r\n\r\n vm.itemsSelected = data;\r\n });\r\n \r\n }\r\n }\r\n\r\n function _addCard() {\r\n _showCardModal();\r\n }\r\n\r\n function _editCard(card) {\r\n _showCardModal(card);\r\n }\r\n\r\n function _copyCard(card) {\r\n _showCardModal(card, true);\r\n }\r\n\r\n function _showImportModal(){\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/cards/cardimport.modal.html',\r\n controller: 'CardImportController as vm',\r\n backdrop: 'static',\r\n size: 'md',\r\n resolve: {\r\n settings : function () {\r\n return function(){\r\n return {\r\n modal: modalInstance\r\n }; \r\n };\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (cards) {\r\n vm.itemsSelected = [];\r\n vhSweetAlert.success('Imported Coach Cards', `${cards.length} card${(cards.length > 1 ? 's were' : ' was')} successfully imported.`);\r\n $rootScope.$emit('vh:coachcardsupdated');\r\n }, function () {\r\n });\r\n }\r\n\r\n vm.selectCard = function (cardId) {\r\n CardsService.getCard(cardId)\r\n .then(function (card) {\r\n if (card) {\r\n if (vm.languages.length > 0)\r\n {\r\n removeMissingLanguagesFromCardContent(card);\r\n }\r\n vm.selectedCard = card;\r\n vm.setLanguageId(defaultLanguageId);\r\n\r\n vm.selectedCard.CardContents = \r\n vm.selectedCard.CardContents.sort((a, b) => {\r\n if(a.LanguageId == 0) return -1;\r\n if(a.LanguageId > b.LanguageId) return 1;\r\n if(a.LanguageId < b.LanguageId) return -1;\r\n if(a.LanguageId == b.LanguageId) return 0;\r\n })\r\n\r\n window.setTimeout(() => {\r\n vm.contentIndex = 0; \r\n });\r\n \r\n CardsService.getRulesForCard(cardId)\r\n .then(function(rules) {\r\n if (rules) {\r\n vm.selectedCardRules = rules;\r\n }\r\n }\r\n );\r\n $state.go('content_cards_card', {CardId: card.CardId});\r\n }\r\n })\r\n };\r\n\r\n CardsService.getLanguages().then(function (data) {\r\n vm.languages = data;\r\n\r\n if (!lodash.isEmpty(vm.selectCard))\r\n {\r\n removeMissingLanguagesFromCardContent();\r\n }\r\n });\r\n\r\n function removeMissingLanguagesFromCardContent(card)\r\n {\r\n card.CardContents.forEach(cc => {\r\n var contentLanguageId = cc.LanguageId;\r\n var language = vm.languages.find(l => l.LanguageId === contentLanguageId);\r\n if (language != undefined) {\r\n cc.enabled = true;\r\n }\r\n });\r\n }\r\n\r\n // cannot use $stateParams because of bug with ui-router,\r\n // if child state uses parent's controller, the childs stateParams are\r\n // not passed to this controller\r\n if ($state.params.CardId) {\r\n vm.selectCard($state.params.CardId);\r\n }\r\n\r\n vm.performSearch = function () {\r\n if(vm.searchTextBox.length > 0) {\r\n vm.searching = true;\r\n vm.selectCategoryId = 0;\r\n $state.go(\"content.cards\");\r\n vm.searchText = vm.searchTextBox;\r\n CardsService.searchCards(vm.searchText).then(function (cards) {\r\n vm.cards = cards;\r\n vm.totalItems = cards.CardCount;\r\n vm.activeSearch = true;\r\n vm.selectedCard = {};\r\n if (vm.cards.length < 1 ) {\r\n vm.noSearchResults = true;\r\n } else {\r\n vm.noSearchResults = false;\r\n }\r\n window.setTimeout(()=>{ vm.searching = false; }, 500);\r\n });\r\n }\r\n };\r\n\r\n vm.setPage = function(pageNo){\r\n vm.currentPage = pageNo;\r\n }\r\n\r\n vm.pageChanged = function() {\r\n\r\n if(vm.searching)\r\n return;\r\n\r\n if(vm.cardGroupId > -2)\r\n {\r\n CardsService.getCardGroupByPage(vm.currentPage, vm.pageSize, vm.cardGroupId).then(function(data){\r\n vm.cards = data.Cards;\r\n vm.totalItems = data.CardCount;\r\n }) \r\n }\r\n else {\r\n\r\n CardsService.getCards().then(function(data){\r\n var start = (vm.currentPage - 1) * vm.pageSize;\r\n var end = start + vm.pageSize;\r\n \r\n vm.cards = data;\r\n\r\n vm.cards = vm.cards.slice(start, end);\r\n\r\n lodash.forEach(vm.cards, function(data) {\r\n data.selected = false;\r\n })\r\n vm.totalItems = data.length;\r\n });\r\n\r\n }\r\n\r\n \r\n };\r\n\r\n var loadAllCards = function (page) {\r\n vm.currentPage = page || 1;\r\n if(vm.cardGroupId > -2)\r\n {\r\n CardsService.getCardGroupByPage(vm.currentPage, vm.pageSize, $stateParams.cardGroupId).then(function (data) {\r\n vm.cards = data.Cards;\r\n vm.totalItems = data.CardCount;\r\n vm.noSearchResults = (vm.cards.length < 1);\r\n });\r\n }\r\n else {\r\n CardsService.getCards().then(function(data){\r\n var start = (vm.currentPage - 1) * vm.pageSize;\r\n var end = start + vm.pageSize;\r\n\r\n vm.cards = data;\r\n\r\n vm.cards = vm.cards.slice(start, end);\r\n\r\n lodash.forEach(vm.cards, function(data) {\r\n data.selected = false;\r\n });\r\n\r\n vm.totalItems = data.length;\r\n });\r\n }\r\n };\r\n\r\n vm.clearSearch = function () {\r\n vm.searchText = '';\r\n vm.searchTextBox = '';\r\n vm.activeSearch = false;\r\n vm.noSearchResults = false;\r\n loadAllCards();\r\n };\r\n \r\n vm.highlight = function (text) {\r\n if (!vm.activeSearch || vm.searchText.length < 1) {\r\n return $sce.trustAsHtml(text);\r\n } else {\r\n return $sce.trustAsHtml(text.replace(new RegExp(vm.searchText, 'gi'), '$&'));\r\n }\r\n };\r\n\r\n vm.getRuleName = function (rule) {\r\n if (rule.Name) {\r\n return $sce.trustAsHtml(rule.Name);\r\n } else {\r\n return $sce.trustAsHtml('(' + rule.RuleId + ') ' + rule.Display);\r\n }\r\n }\r\n\r\n vm.getLanguageName = function(languageId) {\r\n var name = '';\r\n var language = vm.languages.find(l => l.LanguageId === languageId);\r\n if (language != undefined)\r\n {\r\n name = language.Name;\r\n }\r\n else\r\n {\r\n //We should never see this since the content will only have the enabled flag if the language exists\r\n return 'Content not enabled or language missing - ' + languageId;\r\n }\r\n return name;\r\n }\r\n\r\n vm.getHeroColor = function(cardStatusId) {\r\n return CardsService.getHeroColor(cardStatusId);\r\n }\r\n\r\n vm.setLanguageId = function (languageId) {\r\n vm.LanguageId = languageId;\r\n\r\n vm.currentLanguageIndex = vm.selectedCard.CardContents.findIndex(c => c.LanguageId == languageId);\r\n }\r\n\r\n vm.deleteCard = function (card) {\r\n\r\n if(vm.selectedCardRules.length > 0){\r\n\r\n vhSweetAlert.error(\"Cannot Delete Coach Card\", `This Coach Card is linked to ${vm.selectedCardRules.length} rule(s). Please remove this card from those rules to be able to delete.`);\r\n return;\r\n }\r\n\r\n\r\n\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete ' + card.Name + '?', 'Delete')\r\n .then(isConfirm => {\r\n if (isConfirm) {\r\n $state.go('content.cards');\r\n vm.selectedCard = {};\r\n CardsService.deleteCard(card).then(data => {\r\n vm.cards = vm.cards.filter(c => c.CardId != card.CardId);\r\n $rootScope.$emit('vh:coachcardsupdated');\r\n });\r\n }\r\n });\r\n };\r\n\r\n function _showCardModal(card, isCopy) {\r\n isCopy = isCopy === true;\r\n\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/cards/addeditcard.modal.html',\r\n controller: 'AddEditCardController as vm',\r\n backdrop: 'static',\r\n size: 'md',\r\n resolve: {\r\n card: function () {\r\n return card;\r\n },\r\n isCopy : function(){\r\n return isCopy && card !== undefined && card !== null;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (card) {\r\n \r\n var cards = [card];\r\n\r\n CardsService.saveCards(cards)\r\n .then(function(data){\r\n \r\n lodash.forEach(data, function(editedCard) {\r\n var cardIndex = lodash.findIndex(vm.cards, function (x) { return x.CardId == editedCard.id; }); \r\n \r\n if(cardIndex > -1){\r\n vm.cards[cardIndex] = editedCard;\r\n }else\r\n {\r\n vm.cards.push(editedCard);\r\n }\r\n });\r\n \r\n\r\n }).finally(function(){\r\n $rootScope.$emit('vh:coachcardsupdated');\r\n loadAllCards(vm.currentPage);\r\n });\r\n\r\n }, function () {\r\n });\r\n }\r\n}\r\n\r\nangular.module('content.cards').controller('CardsController', CardsController);\r\n","\r\nclass CardsService {\r\n constructor(\r\n CardGroupRepository,\r\n CardsRepository,\r\n PatientLanguageRepository,\r\n PopulationsRepository,\r\n IconsRepository,\r\n FileUploader\r\n ) {\r\n this.CardGroupRepository = CardGroupRepository;\r\n this.CardsRepository = CardsRepository;\r\n this.PatientLanguageRepository = PatientLanguageRepository;\r\n this.PopulationsRepository = PopulationsRepository;\r\n this.IconsRepository = IconsRepository;\r\n this.pageSize = 100;\r\n this.FileUploader = FileUploader;\r\n\r\n \r\n }\r\n\r\n\r\n\r\n getCardGroups() {\r\n return this.CardGroupRepository.getAll();\r\n }\r\n\r\n deleteCard(card){\r\n return this.CardsRepository.deleteCard(card);\r\n }\r\n\r\n saveCards(cards) {\r\n return this.CardsRepository.saveCards(cards);\r\n }\r\n\r\n importCards(cards) {\r\n return this.CardsRepository.importCards(cards);\r\n }\r\n\r\n getValidationData() {\r\n return this.CardsRepository.validationData();\r\n }\r\n\r\n getLanguages() {\r\n return this.PatientLanguageRepository.getAll();\r\n }\r\n\r\n getPopulations() {\r\n return this.PopulationsRepository.getAll({ enabledOnly: false });\r\n }\r\n\r\n getIcons() {\r\n return this.IconsRepository.getAll();\r\n }\r\n\r\n getCards() {\r\n return this.CardsRepository.getCards();\r\n }\r\n\r\n getCard(cardId) {\r\n return this.CardsRepository.get(cardId);\r\n }\r\n\r\n getRulesForCard(cardId) {\r\n return this.CardsRepository.getRulesForCard(cardId);\r\n }\r\n\r\n getCardGroupByPage(pageNumber, pageSize, cardGroupId){\r\n return this.CardGroupRepository.getByPageNumber(pageNumber, pageSize, cardGroupId);\r\n }\r\n \r\n getPageSize(){\r\n return this.pageSize;\r\n }\r\n\r\n searchCards(searchText) {\r\n return this.CardsRepository.searchCards(searchText);\r\n }\r\n\r\n getHeroColor(cardStatusId) {\r\n cardStatusId = cardStatusId || 1;\r\n switch (cardStatusId) {\r\n case 2:\r\n return \"PositiveCard\";\r\n case 3:\r\n return \"WarningCard\";\r\n case 4:\r\n return \"NegativeCard\";\r\n case 1:\r\n default:\r\n return \"DefaultCard\";\r\n }\r\n }\r\n \r\n getFileUploader() {\r\n var fileUploader = new this.FileUploader({\r\n url: ''\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function(item, options) {\r\n var i = item.name.indexOf('.json');\r\n return i !== -1;\r\n }\r\n });\r\n\r\n return fileUploader;\r\n }\r\n}\r\n\r\n function cardServiceFactory(\r\n CardGroupRepository,\r\n CardsRepository,\r\n PatientLanguageRepository,\r\n PopulationsRepository,\r\n IconsRepository,\r\n FileUploader) { return new CardsService(...arguments); \r\n };\r\n\r\n\r\nangular.module(\"app\").factory(\"CardsService\", cardServiceFactory);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/cards/cards.tpl.html',\n '

    Coach Cards

    1. {{vm.totalItems}} Coach Card(s) for {{vm.groupName}}

      No results returned

      Coach Card

      {{vm.selectedCard.CardContents[vm.currentLanguageIndex].Value}} {{vm.selectedCard.CardContents[vm.currentLanguageIndex].Units}}

      Used In {{vm.selectedCardRules.length}} Rule{{vm.rules.length == 1 ? \\'\\' : \\'s\\'}}
      ');\n}]);\n}(window, document, window.angular));","function CategoriesController(\r\n CategoriesService, \r\n TemplatesService, \r\n $sce, \r\n $state, \r\n $stateParams, \r\n lodash, \r\n PermissionService, \r\n $uibModal, \r\n vhSweetAlert, \r\n contentLock, \r\n $scope, \r\n $timeout, \r\n $http,\r\n lockStatusEnum) {\r\n\r\n $scope.lockStatusEnum = lockStatusEnum;\r\n\r\n var vm = this;\r\n vm.categories = [];\r\n vm.selectedCategory = {};\r\n vm.activeSearch = false;\r\n vm.searchText = '';\r\n vm.LanguageId = 1; //only show English for now\r\n vm.Language = 'en';\r\n vm.surveyQuestions = [];\r\n vm.ShowOptions = true;\r\n\r\n vm.currentPage = 1;\r\n vm.expandedAll = false;\r\n vm.toggleExpand = toggleExpand;\r\n vm.pageSize = 20;\r\n vm.total = 1;\r\n vm.showNoResultsLabel = false;\r\n vm.userCanAddCategory = PermissionService.userHasPermission([\"SurveyQuestionsWrite\"]);\r\n vm.userCanDeleteCategory = PermissionService.userHasPermission([\"MasterCareplanCategoryDelete\"]);\r\n vm.userCanEditCategory = PermissionService.userHasPermission([\"SurveyQuestionsWrite\"]);\r\n vm.userCanAddEditQuestion = PermissionService.userHasPermission([\"SurveyQuestionsWrite\"]);\r\n var userCanDeleteQuestion = PermissionService.userHasPermission([\"MasterCareplanQuestionDelete\"]);\r\n vm.showDeleteIcon = showDeleteIcon;\r\n vm.selectCategory = selectCategory;\r\n vm.getQuestionsByCategory = getQuestionsByCategory;\r\n vm.performSearch = performSearch;\r\n vm.clearSearch = clearSearch;\r\n vm.expandNode = expandNode;\r\n vm.collapseNode = collapseNode;\r\n vm.expandAllNodes = expandAllNodes;\r\n vm.collapseAllNodes = collapseAllNodes;\r\n vm.highlight = highlight;\r\n vm.deleteCategory = deleteCategory;\r\n vm.saveCategory = saveCategory;\r\n vm.checkCategoryName = checkCategoryName;\r\n vm.showOptions = showOptions;\r\n vm.showSiteMapIcon = showSiteMapIcon;\r\n vm.addCategory = addCategory;\r\n vm.addQuestion = addQuestion;\r\n vm.editQuestion = editQuestion;\r\n vm.showInternalName = showInternalName;\r\n vm.showEditQuestion = showEditQuestion;\r\n vm.nestQuestion = nestQuestion;\r\n vm.isBiometricQuestion = TemplatesService.isBiometricQuestion;\r\n vm.isHealthTip = TemplatesService.isHealthTipQuestion;\r\n vm.deleteQuestion = deleteQuestion;\r\n vm.searchOrderExpression = searchOrderExpression;\r\n vm.toggleUid = toggleUid;\r\n vm.isToggled = isToggled;\r\n vm.copyUid = copyUid;\r\n vm.uidToolTip = 'Click to copy to clipboard.';\r\n\r\n vm.showUid = false;\r\n vm.isSelected = _isSelected;\r\n vm.itemsSelected = [];\r\n vm.toggle = _toggle;\r\n vm.isSelected = _isSelected;\r\n vm.selectToggle = _selectToggle;\r\n vm.export = _export;\r\n vm.disableExportButton = _disableExportButton\r\n\r\n vm.disableDeleteButton = _disabledDeleteButton;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n vm.showUid = PermissionService.userHasPermission(['ContentUIDRead']);\r\n\r\n CategoriesService.getAllCategories().then(function (data) {\r\n vm.categories = data;\r\n vm.categories.push({\r\n SurveyQuestionCategoryId: 0,\r\n Name: 'Uncategorized',\r\n });\r\n if ($stateParams.SurveyQuestionCategoryId) {\r\n vm.selectedCategory = lodash.find(vm.categories, function (q) { return q.SurveyQuestionCategoryId == $stateParams.SurveyQuestionCategoryId; });\r\n vm.getQuestionsByCategory();\r\n } else {\r\n vm.selectedCategory = {};\r\n }\r\n });\r\n\r\n vm.categoriesOptions = {\r\n accept: function (src, dest, destIndex) {\r\n if (destIndex == vm.categories.length - 1) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n },\r\n dropped: function (event) {\r\n var category = event.source.nodeScope.$modelValue;\r\n category.SortOrder = event.dest.index;\r\n CategoriesService.saveCategory(category);\r\n }\r\n };\r\n }\r\n\r\n function _disableExportButton () {\r\n return !vm.itemsSelected.length;\r\n }\r\n\r\n function _disabledDeleteButton () {\r\n return !vm.userCanDeleteCategory || vm.selectedCategory.SurveyQuestionCategoryId == 0 || vm.selectedCategory.SurveyQuestionCategoryId == null;\r\n }\r\n\r\n function _extractFileName(headerContentDisposition) {\r\n var filename = \"\";\r\n var disposition = headerContentDisposition;\r\n if (disposition && disposition.indexOf('attachment') !== -1) {\r\n var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\r\n var matches = filenameRegex.exec(disposition);\r\n if (matches != null && matches[1]) { \r\n filename = matches[1].replace(/['\"]/g, '');\r\n }\r\n }\r\n return filename;\r\n }\r\n\r\n function _export(category){\r\n\r\n \r\n var ids = vm.itemsSelected.map(function (x) { return x.SurveyQuestionCategoryId; });\r\n\r\n if(ids.length == 0)\r\n return;\r\n\r\n $http.post('/api/export/surveyquestions', JSON.stringify(ids), { responseType: 'arraybuffer' })\r\n .then(function successCallback(response) {\r\n var headersFn = response.headers;\r\n var headers = headersFn();\r\n var data = response.data;\r\n \r\n var filename = _extractFileName(headers['content-disposition']);\r\n var contentType = headers['content-type'];\r\n \r\n var a = document.createElement('a');\r\n try {\r\n var blob = new Blob([data], { type: contentType });\r\n var url = window.URL.createObjectURL(blob);\r\n \r\n a.setAttribute('href', url);\r\n a.setAttribute(\"download\", filename);\r\n a.click(); \r\n\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n }, function errorCallback(error) {\r\n console.log('Something went wrong!!!')\r\n });\r\n \r\n }\r\n\r\n\r\n\r\n function _toggle($event, category){\r\n \r\n $event.stopPropagation();\r\n\r\n if(_isSelected(category)){\r\n vm.itemsSelected = vm.itemsSelected.filter(x => x.SurveyQuestionCategoryId != category.SurveyQuestionCategoryId);\r\n } else {\r\n vm.itemsSelected.push(category);\r\n }\r\n }\r\n\r\n function _isSelected(category){\r\n return vm.itemsSelected.find(x => x.SurveyQuestionCategoryId == category.SurveyQuestionCategoryId) != null;\r\n }\r\n \r\n function _selectToggle(){\r\n \r\n if(vm.itemsSelected.length > 0)\r\n {\r\n vm.itemsSelected = [];\r\n }\r\n else\r\n {\r\n CategoriesService.getAllCategories().then(allData => {\r\n var data = allData;\r\n\r\n data.push({\r\n SurveyQuestionCategoryId: 0,\r\n Name: 'Uncategorized'\r\n });\r\n\r\n if((vm.searchTextBox || '').length > 0){\r\n data = data.filter(category => category.Name.toLowerCase().indexOf(vm.searchTextBox.toLowerCase()) > -1);\r\n }\r\n\r\n vm.itemsSelected = data;\r\n }); \r\n }\r\n }\r\n\r\n function searchOrderExpression(question) {\r\n return TemplatesService.isBiometricQuestion(question) ? 0 : 1;\r\n }\r\n\r\n function selectCategory(surveyQuestionCategoryId) {\r\n vm.expandedAll = false;\r\n vm.currentPage = 1;\r\n TemplatesService.clearQuestionsCache();\r\n $state.go('content.categories.category', {SurveyQuestionCategoryId: surveyQuestionCategoryId});\r\n vm.selectedCategory = vm.categories.find( function (q) { return q.SurveyQuestionCategoryId == surveyQuestionCategoryId; });\r\n return vm.getQuestionsByCategory();\r\n }\r\n\r\n function getQuestionsByCategory() {\r\n vm.expandedAll = false;\r\n vm.loading = true;\r\n vm.showNoResultsLabel = false;\r\n vm.surveyQuestions = [];\r\n if (vm.selectedCategory.SurveyQuestionCategoryId === 0) {\r\n return TemplatesService.getUncategorizedQuestions(vm.searchText, vm.LanguageId, vm.pageSize, vm.currentPage).then(function (data) {\r\n vm.surveyQuestions = data.SearchResults.map(x => contentLock(x, (y, z) => TemplatesService.clearQuestionsCache()));\r\n vm.total = data.ResultsCount;\r\n if (vm.total === 0) {\r\n vm.showNoResultsLabel = true;\r\n }\r\n vm.loading = false;\r\n });\r\n } else {\r\n return TemplatesService.searchQuestions(vm.searchText, vm.selectedCategory.SurveyQuestionCategoryId, vm.LanguageId, vm.pageSize, vm.currentPage).then(function (data) {\r\n vm.surveyQuestions = data.SearchResults.map(x => contentLock(x, (y, z) => TemplatesService.clearQuestionsCache()));\r\n vm.total = data.ResultsCount;\r\n if (vm.total === 0) {\r\n vm.showNoResultsLabel = true;\r\n }\r\n vm.loading = false;\r\n });\r\n }\r\n }\r\n\r\n function performSearch() {\r\n vm.loading = true;\r\n if (vm.searchTextBox && vm.searchTextBox.length > 0) {\r\n vm.searchText = vm.searchTextBox;\r\n vm.selectedCategory = {};\r\n $state.go('content.categories');\r\n CategoriesService.searchCategories(vm.searchText).then(function (data) {\r\n vm.activeSearch = true;\r\n vm.categories = data;\r\n vm.searched = true;\r\n vm.loading = false;\r\n });\r\n }\r\n }\r\n\r\n function clearSearch() {\r\n vm.searched = false;\r\n vm.activeSearch = false;\r\n vm.searchText = '';\r\n vm.selectedCategory = {};\r\n vm.searchTextBox = '';\r\n $state.go('content.categories');\r\n loadController();\r\n }\r\n\r\n function expandNode(node) {\r\n node.expand();\r\n }\r\n\r\n function collapseNode(node) {\r\n node.collapse();\r\n }\r\n\r\n function expandAllNodes() {\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.$broadcast('angular-ui-tree:expand-all');\r\n }\r\n\r\n function collapseAllNodes() {\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.$broadcast('angular-ui-tree:collapse-all');\r\n }\r\n\r\n function toggleExpand() {\r\n vm.expandedAll = !vm.expandedAll;\r\n if (vm.expandedAll)\r\n expandAllNodes()\r\n else\r\n collapseAllNodes();\r\n }\r\n\r\n function escapeRegexp (queryToEscape) {\r\n return queryToEscape.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\r\n }\r\n\r\n function highlight(text) {\r\n if (!text || text.length == 0) {\r\n return '';\r\n }\r\n\r\n var guidRegex = /[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}/;\r\n if(text.match(guidRegex)){\r\n text = text.slice(0,4) + \"-\" + text.slice(text.length-4);\r\n }\r\n\r\n if (!vm.activeSearch || vm.searchText.length < 1) {\r\n return $sce.trustAsHtml(text);\r\n }\r\n return $sce.trustAsHtml(text.replace(new RegExp(escapeRegexp(vm.searchText), 'gi'), '$&')); //$& inserts the whole match\r\n }\r\n\r\n function deleteCategory(categoryId) {\r\n var category = lodash.where(vm.categories, { SurveyQuestionCategoryId : categoryId })[0];\r\n\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete the ' + category.Name + ' category?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n CategoriesService.deleteCategory(categoryId);\r\n lodash.remove(vm.categories, function (st) { return st.SurveyQuestionCategoryId == categoryId; });\r\n $state.go('content.categories');\r\n vm.selectedCategory = {};\r\n }\r\n });\r\n }\r\n\r\n function deleteQuestion(question) {\r\n // Check to see if question is assigned to a pathway.\r\n TemplatesService.getTemplatesByQuestionId(question.SurveyQuestionId).then(function(response) {\r\n if(response.data && response.data.length == 0){\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this master question?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n CategoriesService.deleteMasterQuestion(question.SurveyQuestionId).then(function (data) {\r\n lodash.remove(vm.surveyQuestions, question);\r\n if (vm.surveyQuestions.length === 0 && vm.currentPage > 1) {\r\n vm.currentPage--;\r\n getQuestionsByCategory();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n else if(response.data) {\r\n vhSweetAlert.error('Unable to Delete', `This question cannot be deleted because it is assigned to ${response.data.length} pathway${response.data.length === 1 ? '' : 's'}.`);\r\n }\r\n else {\r\n vhSweetAlert.error('Unable to Delete', `There was an issue when attempting to delete.`);\r\n }\r\n });\r\n }\r\n\r\n\r\n function toggleUid(question){\r\n \r\n if(vm.toggled != question)\r\n vm.toggled = question;\r\n else\r\n vm.toggled = null;\r\n }\r\n\r\n function isToggled(question){\r\n return vm.toggled == question;\r\n }\r\n\r\n function copyUid(uid){\r\n\r\n var textArea = document.createElement(\"textarea\");\r\n textArea.value = uid;\r\n document.body.appendChild(textArea);\r\n textArea.select();\r\n document.execCommand(\"Copy\");\r\n textArea.remove();\r\n\r\n vm.uidToolTip = 'Copied to clipboard! ';\r\n window.setTimeout(()=>{\r\n vm.uidToolTip = 'Click to copy to clipboard.';\r\n }, 2000);\r\n\r\n }\r\n\r\n\r\n function saveCategory() {\r\n CategoriesService.saveCategory(vm.selectedCategory);\r\n }\r\n\r\n function checkCategoryName(data) {\r\n if (data.length <= 0) {\r\n return \"Must enter a category name\";\r\n }\r\n }\r\n\r\n function showOptions(question) {\r\n return !TemplatesService.isBiometricQuestion(question) && !TemplatesService.isHealthTipQuestion(question) && question.SurveyQuestionTypeId != 17;\r\n }\r\n\r\n function showSiteMapIcon(question) {\r\n return !TemplatesService.isBiometricQuestion(question) &&\r\n !TemplatesService.isHealthTipQuestion(question) && vm.userCanAddEditQuestion === true && question.SurveyQuestionTypeId != 17;\r\n }\r\n\r\n function showDeleteIcon(question) {\r\n return !TemplatesService.isBiometricQuestion(question) &&\r\n !TemplatesService.isHealthTipQuestion(question) &&\r\n userCanDeleteQuestion;\r\n }\r\n\r\n function addCategory() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/addcategory.modal.html',\r\n controller: 'AddCategoryModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n categories: function () {\r\n return vm.categories;\r\n },\r\n isEdit: false, \r\n showPopulations: false,\r\n category: null\r\n }\r\n\r\n });\r\n modalInstance.result.then(function (model) {\r\n var surveyQuestionCategory = {};\r\n surveyQuestionCategory.Name = model.categoryName;\r\n\r\n CategoriesService.createCategory(surveyQuestionCategory).then(function (data) {\r\n vm.categories.splice(vm.categories.length - 1, 0, data);\r\n selectCategory(data.SurveyQuestionCategoryId);\r\n //vm.categories.push(data);\r\n });\r\n }, function () {\r\n });\r\n }\r\n\r\n function addQuestion() {\r\n $scope.preselectedCategoryId = vm.selectedCategory.SurveyQuestionCategoryId;\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addquestion.modal.html',\r\n controller: 'AddQuestionModalController as vm',\r\n backdrop: 'static',\r\n scope: $scope,\r\n resolve: {\r\n tags: function() {\r\n return TemplatesService.getSurveyTags()\r\n },\r\n question: function () {\r\n return null;\r\n },\r\n disableEdits: function () {\r\n return false;\r\n },\r\n saveFunction: function() {\r\n return TemplatesService.createQuestion;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (question) {\r\n if (question.SurveyQuestionCategoryId == undefined) {\r\n vm.selectCategory(0).then(function() {\r\n goToLastQuestion();\r\n });\r\n }\r\n else if (question.SurveyQuestionCategoryId != vm.selectedCategory.SurveyQuestionCategoryId) {\r\n vm.selectCategory(question.SurveyQuestionCategoryId).then(function() {\r\n goToLastQuestion();\r\n });\r\n } else {\r\n goToLastQuestion();\r\n }\r\n }, function () {\r\n });\r\n }\r\n\r\n function goToLastQuestion() {\r\n var lastPage = Math.ceil(vm.total / vm.pageSize);\r\n if (vm.total % vm.pageSize === 0) {\r\n lastPage += 1;\r\n }\r\n vm.currentPage = lastPage;\r\n\r\n vm.getQuestionsByCategory().then(function() {\r\n $timeout(function() {\r\n var treeScope = angular.element(document.getElementById(\"question-tree\")).scope();\r\n var questionNodes = treeScope.$nodesScope.childNodes();\r\n var newQuestionNode = questionNodes[questionNodes.length -1];\r\n newQuestionNode.expand();\r\n }, 1000);\r\n });\r\n }\r\n\r\n function editQuestion(question) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addquestion.modal.html',\r\n controller: 'AddQuestionModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n tags: function() {\r\n return TemplatesService.getSurveyTags();\r\n },\r\n question: function () {\r\n return question;\r\n },\r\n disableEdits: function () {\r\n return false;\r\n },\r\n saveFunction: function() {\r\n return TemplatesService.saveQuestion;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function() {\r\n vm.getQuestionsByCategory();\r\n }, function () {\r\n });\r\n }\r\n\r\n function showInternalName(question) {\r\n return TemplatesService.isHealthTipQuestion(question);\r\n }\r\n\r\n function showEditQuestion(question) {\r\n return !TemplatesService.isBiometricQuestion(question) && !TemplatesService.isHealthTipQuestion(question);\r\n }\r\n\r\n function nestQuestion(question) {\r\n $state.go('content.categories.category.question', { SurveyQuestionId: question.SurveyQuestionId });\r\n }\r\n}\r\n\r\nangular.module('content.categories').controller('CategoriesController', CategoriesController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/categories/categories.tpl.html',\n '

      Questions

      Categories

      No results returned

      0\">
      1. 0 && vm.activeSearch == false && vm.userCanEditCategory\">
      = 0\">
      Questions
      0\" onbeforesave=\"vm.checkCategoryName($data)\" onaftersave=\"vm.saveCategory()\">{{ vm.selectedCategory.Name }} {{ vm.selectedCategory.Name }}
        vm.pageSize\" num-pages=\"vm.numPages\" boundary-links=\"true\" rotate=\"false\" max-size=\"5\" ng-change=\"vm.getQuestionsByCategory()\">

      Loading...

      No questions exist in this category

      0\">
      ');\n}]);\n}(window, document, window.angular));","function NestQuestionController(\r\n $scope,\r\n $q,\r\n $sce,\r\n $stateParams,\r\n $uibModal,\r\n lodash,\r\n vhSweetAlert,\r\n TemplatesService,\r\n CategoriesService,\r\n lockStatusEnum\r\n) {\r\n\r\n$scope.lockStatusEnum = lockStatusEnum;\r\n\r\nvar vm = this;\r\nvm.searchTextBox = '';\r\nvm.searchText = '';\r\nvm.categories = [];\r\nvm.selectedCategory = { SurveyQuestionCategoryId: 0, Name: \"All Categories\" };\r\nvm.searchResultQuestion = [];\r\nvm.mainCategory = {};\r\nvm.expandedAll = false;\r\n\r\nvm.selectedQuestions = [];\r\nvm.LanguageId = 1; //only show English for now\r\nvm.Language = 'en';\r\n\r\nvm.noSearchResults = false;\r\n\r\n//paging\r\nvm.currentPage = 1;\r\nvm.pageSize = 20;\r\nvm.total = 1;\r\n\r\nvm.showOptions = showOptions;\r\nvm.showInternalName = showInternalName;\r\nvm.buttonSearch = buttonSearch;\r\nvm.performSearch = performSearch;\r\nvm.highlight = highlight;\r\nvm.removeQuestion = removeQuestion;\r\nvm.expandNode = expandNode;\r\nvm.collapseNode = collapseNode;\r\nvm.expandAllNodes = expandAllNodes;\r\nvm.collapseAllNodes = collapseAllNodes;\r\nvm.addQuestion = addQuestion;\r\nvm.editQuestion = editQuestion;\r\nvm.showEditQuestionIcon = showEditQuestionIcon;\r\nvm.flash = flash;\r\nvm.toggleExpand = toggleExpand;\r\nvm.isHealthTip = TemplatesService.isHealthTipQuestion;\r\nvm.isBiometricQuestion = TemplatesService.isBiometricQuestion;\r\n\r\nvar flashQuestion = null;\r\n\r\nloadController();\r\n\r\nfunction loadController() {\r\n if ($stateParams.SurveyQuestionId) {\r\n refreshQuestion();\r\n }\r\n\r\n CategoriesService.getAllCategories().then(function (data) {\r\n vm.categories = data;\r\n vm.categories.unshift(vm.selectedCategory);\r\n vm.mainCategory = lodash.where(vm.categories, { SurveyQuestionCategoryId : parseInt($stateParams.SurveyQuestionCategoryId) })[0];\r\n vm.buttonSearch();\r\n });\r\n\r\n vm.treeOptions = {\r\n\r\n beforeDrag: function(src) {\r\n if (angular.isDefined(src.$modelValue.SurveyParameterTypeId)) return false; //TODO: postpone save // is option\r\n if (angular.isDefined(src.$modelValue.SurveyQuestionId) && src.$modelValue.SurveyQuestionId === vm.selectedQuestions[0].SurveyQuestionId) return false;\r\n return true; // is child question\r\n },\r\n\r\n accept: function (src, dest, destIndex) {\r\n \r\n var srcModel = src.$modelValue;\r\n var destModel = dest.$modelValue;\r\n var parentModel = dest.$parent.$modelValue;\r\n\r\n if (srcModel.SurveyParameterTypeId) { //If source is an option\r\n //Can only move an option if within the same question, and not nested to another option\r\n return false; //TODO: disable moving options for now, until we can postpone saving\r\n return destModel.indexOf(srcModel) >= 0;\r\n }\r\n else if (srcModel.SurveyQuestionId) { //If source is a question\r\n if (srcModel.SurveyQuestionId === vm.selectedQuestions[0].SurveyQuestionId) return false; // prevent adding question to itself\r\n if (parentModel && parentModel.ChildQuestions) {\r\n // reject if question is already added to parent\r\n if (lodash.some(parentModel.ChildQuestions, 'SurveyQuestionId', srcModel.SurveyQuestionId)) {\r\n return false;\r\n }\r\n }\r\n return (dest.depth() < 3 && parentModel && parentModel.SurveyParameterTypeId); // can only insert as child of an option\r\n }\r\n else {\r\n //Should never get here\r\n return false;\r\n }\r\n },\r\n\r\n dropped: function (event) {\r\n var src = event.source.nodeScope.$modelValue;\r\n var srcParent = event.source.nodeScope.$parentNodeScope.$modelValue;\r\n var destParent = event.dest.nodesScope.$parent.$modelValue;\r\n var srcIndex = event.source.index;\r\n var destIndex = event.dest.index;\r\n\r\n //If moving an option\r\n if (src.SurveyParameterTypeId) {\r\n // TODO: save changes when options re-ordered\r\n //var question = findQuestion(vm.selectedQuestions, event.source.nodeScope.$modelValue.SurveyQuestionId);\r\n //saveQuestion();\r\n } else if (src.SurveyQuestionId) {\r\n if (destParent && destParent.SurveyParameterTypeId) {\r\n //If moving a nested question onto another question option\r\n if (destParent !== srcParent || destIndex !== srcIndex) {\r\n saveQuestion();\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n vm.searchTreeOptions = {\r\n\r\n accept: function (src, dest, destIndex) {\r\n //Do not allow items from question to be dropped into search result\r\n if (src.$treeScope.SearchResults == false) {\r\n return false;\r\n } else if (!dest.$parent.$modelValue) {\r\n return true;\r\n }\r\n },\r\n\r\n dropped: function (event) {\r\n //Do not fire when dragging a question back into the same position it came from\r\n if (event.dest.nodesScope.$treeScope.SearchResults == false) {\r\n var question = event.source.nodeScope.$modelValue;\r\n var destParent = event.dest.nodesScope.$parent.$modelValue;\r\n var index = event.dest.index;\r\n\r\n if (destParent && destParent.SurveyParameterTypeId) {\r\n //If moving a question onto another question option\r\n TemplatesService.setQuestionAsTemp(question);\r\n saveQuestion().then(function(success){\r\n //Remove the question if it failed to save\r\n if (!success) {\r\n var question = vm.selectedQuestions[0];\r\n for(var i = 0; i < question.SurveyOptions.length; i++){\r\n var option = question.SurveyOptions[i];\r\n if(option.SurveyResponseOptionId === destParent.SurveyResponseOptionId){\r\n for(var j = 0; j < option.ChildQuestions.length; j++){\r\n var child = option.ChildQuestions[j];\r\n if (child.SurveyQuestionId === question.SurveyQuestionId){\r\n option.ChildQuestions.splice(j, 1);\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n };\r\n\r\n}\r\n\r\nfunction expandNode(node) {\r\n node.expand();\r\n}\r\n\r\nfunction collapseNode(node) {\r\n node.collapse();\r\n}\r\n\r\nfunction expandAllNodes() {\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.$broadcast('angular-ui-tree:expand-all');\r\n}\r\n\r\nfunction collapseAllNodes() {\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.$broadcast('angular-ui-tree:collapse-all');\r\n}\r\n\r\nfunction toggleExpand() {\r\n vm.expandedAll = !vm.expandedAll;\r\n if (vm.expandedAll)\r\n expandAllNodes()\r\n else\r\n collapseAllNodes();\r\n}\r\n\r\nfunction showEditQuestionIcon(question) {\r\n return !TemplatesService.isBiometricQuestion(question) && !TemplatesService.isHealthTipQuestion(question) && !question.isTemp;\r\n}\r\n\r\nfunction refreshQuestion() {\r\n CategoriesService.getQuestion($stateParams.SurveyQuestionId).then(function(data) {\r\n vm.selectedQuestions = [];\r\n vm.selectedQuestions.push(data);\r\n var treeScope = angular.element(document.getElementById(\"tree-template\")).scope();\r\n treeScope.SearchResults = false;\r\n });\r\n}\r\n\r\nfunction flash(index) {\r\n if (flashQuestion !== null && index == vm.selectedQuestions[0].SurveyOptions[vm.selectedQuestions[0].SurveyOptions.length -1].ChildQuestions.length -1) {\r\n flashQuestion = null;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\nfunction showOptions(question) {\r\n return !TemplatesService.isBiometricQuestion(question) && !TemplatesService.isHealthTipQuestion(question) && !TemplatesService.isCustomResponseQuestion(question);\r\n}\r\n\r\nfunction showInternalName(question) {\r\n return TemplatesService.isHealthTipQuestion(question);\r\n}\r\n\r\nfunction buttonSearch() {\r\n vm.currentPage = 1;\r\n vm.performSearch();\r\n}\r\n\r\nfunction performSearch() {\r\n vm.searchText = vm.searchTextBox.replace(new RegExp('[^a-zA-Z0-9 ]','g'), '');\r\n questionCategoryId = 0;\r\n if (vm.selectedCategory) {\r\n questionCategoryId = vm.selectedCategory.SurveyQuestionCategoryId;\r\n }\r\n\r\n TemplatesService.searchQuestions(vm.searchText, questionCategoryId, vm.LanguageId, vm.pageSize, vm.currentPage).then(function (data) {\r\n // remove question from search results\r\n var selectedQuestionId = vm.selectedQuestions.length > 0 ? vm.selectedQuestions[0].SurveyQuestionId : parseInt($stateParams.SurveyQuestionId, 10);\r\n lodash.remove(data.SearchResults, q => q.SurveyQuestionId === selectedQuestionId);\r\n\r\n vm.surveyQuestions = data.SearchResults;\r\n \r\n vm.total = data.ResultsCount;\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.SearchResults = true;\r\n vm.expandedAll = false;\r\n\r\n if (vm.surveyQuestions.length == 0) {\r\n vm.noSearchResults = true;\r\n }\r\n else {\r\n vm.noSearchResults = false;\r\n }\r\n });\r\n}\r\n\r\nfunction highlight(text) {\r\n if (!text || text.length == 0) {\r\n return '';\r\n }\r\n\r\n var guidRegex = /[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}/;\r\n if(text.match(guidRegex)){\r\n text = text.slice(0,4) + \"-\" + text.slice(text.length-4);\r\n }\r\n\r\n if (vm.searchText.length < 1) {\r\n return $sce.trustAsHtml(text);\r\n }\r\n return $sce.trustAsHtml(text.replace(new RegExp(vm.searchText, 'gi'), '$&'));\r\n}\r\n\r\nfunction removeQuestion(question, parentOption) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this question?','Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n lodash.remove(parentOption.ChildQuestions, child => child.SurveyQuestionId == question.SurveyQuestionId);\r\n saveQuestion();\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Save the currently selected question\r\n * @returns {Promise} Returns promise with boolean success\r\n */\r\nfunction saveQuestion() {\r\n const surveyQuestion = vm.selectedQuestions[0];\r\n\r\n return TemplatesService.saveQuestion(surveyQuestion)\r\n .then((response) => true, (error) => {\r\n\r\n if (error.data && error.data.ErrorMessage) {\r\n vhSweetAlert.error(error.data.ErrorMessage);\r\n }\r\n else if (error.data && error.data.ModelState.questionId) {\r\n vhSweetAlert.error(error.data.ModelState.questionId[0]);\r\n }\r\n\r\n return false;\r\n });\r\n}\r\n\r\nfunction addQuestion() {\r\n var parentQuestion = vm.selectedQuestions[0];\r\n $scope.preselectedCategoryId = parentQuestion.SurveyQuestionCategoryId;\r\n $scope.disableCategory = true;\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addquestion.modal.html',\r\n controller: 'AddQuestionModalController as vm',\r\n backdrop: 'static',\r\n scope: $scope,\r\n resolve: {\r\n tags: function() {\r\n return TemplatesService.getSurveyTags()\r\n },\r\n question: function () {\r\n return null;\r\n },\r\n disableEdits: function () {\r\n return false;\r\n },\r\n saveFunction: function() {\r\n return TemplatesService.createQuestion;\r\n }\r\n }\r\n });\r\n\r\n return modalInstance.result.then(function (question) {\r\n //Append new question to the last option of the question\r\n return addNestedQuestion(question, null, -1);\r\n });\r\n}\r\n\r\nfunction addNestedQuestion(question, parentOption, index) {\r\n var parentQuestion = vm.selectedQuestions[0];\r\n if (parentOption == null) { // add to last option if not specified\r\n parentOption = parentQuestion.SurveyOptions[parentQuestion.SurveyOptions.length - 1];\r\n }\r\n var optionIndex = parentQuestion.SurveyOptions.indexOf(parentOption);\r\n\r\n parentOption.ChildQuestions = parentOption.ChildQuestions || [];\r\n if (index < 0) { // append to end if index not specified\r\n index = parentOption.ChildQuestions.length;\r\n }\r\n\r\n if (parentOption.ChildQuestions.indexOf(question) < 0) {\r\n parentOption.ChildQuestions.push(question);\r\n }\r\n\r\n // TODO: Check if nested question is same as parent\r\n\r\n return saveQuestion().then(function(success) {\r\n if(success){\r\n flashQuestion = question;\r\n }\r\n });\r\n}\r\n\r\nfunction editQuestion(question) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addquestion.modal.html',\r\n controller: 'AddQuestionModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n tags: function() {\r\n return TemplatesService.getSurveyTags()\r\n },\r\n question: function () {\r\n return question;\r\n },\r\n disableEdits: function () {\r\n return false;\r\n },\r\n saveFunction: function() {\r\n return TemplatesService.saveQuestion;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (question) {\r\n refreshQuestion();\r\n }, function () {\r\n });\r\n}\r\n\r\nfunction findQuestion(questions, questionId) {\r\n var question = lodash.find(questions, function (q) { return q.SurveyQuestionId === questionId; });\r\n\r\n if (!question) {\r\n for (var i = 0; i < questions.length; i++) {\r\n for (var j = 0; j < questions[i].SurveyOptions.length; j++) {\r\n if (questions[i].SurveyOptions[j].ChildQuestions.length > 0) {\r\n question = findQuestion(questions[i].SurveyOptions[j].ChildQuestions, questionId);\r\n if (question) {\r\n return question;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n return question;\r\n }\r\n}\r\n\r\n}\r\n\r\nangular.module('content.categories').controller('NestQuestionController', NestQuestionController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/categories/nestquestion.tpl.html',\n '
      {{vm.mainCategory.Name}}
      0\">
        0\">
      Questions
        vm.pageSize\" ng-model=\"vm.currentPage\" boundary-links=\"true\" rotate=\"false\" max-size=\"5\" ng-change=\"vm.performSearch()\">

      No results returned

      0\" ui-tree=\"vm.searchTreeOptions\" data-drag-enabled=\"true\" data-nodrop-enabled=\"true\" empty-place-holder-enabled=\"false\">
      ');\n}]);\n}(window, document, window.angular));","function MediaPreviewController(media, $sce, $uibModalInstance, TemplatesService) {\r\n mpvm = this;\r\n mpvm.title = media.title;\r\n mpvm.html = '';\r\n mpvm.done = done;\r\n mpvm.mediaType = media.type;\r\n mpvm.controls = {};\r\n if (angular.isString(media.sources))\r\n {\r\n mpvm.sources = { 'en': media.sources };\r\n } else {\r\n mpvm.sources = media.sources;\r\n }\r\n mpvm.selectedLanguage = 'en';\r\n mpvm.languages = {};\r\n mpvm.html = getHtml;\r\n mpvm.DisplayCondition = media.DisplayCondition;\r\n mpvm.videoSrc = videoSrc();\r\n\r\n TemplatesService.getAvailableLanguagesMap().then(function (data) {\r\n mpvm.languages = data;\r\n });\r\n\r\n mpvm.selectLanguage = function(source) {\r\n mpvm.selectedLanguage = source;\r\n mpvm.videoSrc = videoSrc();\r\n var player = document.getElementsByTagName('video')[0];\r\n if(player) {\r\n player.load(); \r\n }\r\n }\r\n\r\n function getSourceForLanguage() \r\n {\r\n return mpvm.sources[mpvm.selectedLanguage];\r\n }\r\n\r\n function getHtml() {\r\n return $sce.trustAsHtml(getSourceForLanguage());\r\n }\r\n\r\n function videoSrc() {\r\n if (mpvm.controls.pause !== undefined) {\r\n mpvm.controls.pause();\r\n }\r\n return $sce.trustAsResourceUrl(getSourceForLanguage());\r\n }\r\n\r\n function done() {\r\n if (mpvm.controls.pause !== undefined) {\r\n mpvm.controls.pause();\r\n }\r\n $uibModalInstance.dismiss();\r\n }\r\n}\r\n\r\nangular.module('content.mediapreview').controller('MediaPreviewController', MediaPreviewController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/components/mediapreview/mediapreview.modal.html',\n '

      {{mpvm.title}}

      ');\n}]);\n}(window, document, window.angular));","angular.module(\"content.question\").directive('questionContainer', function () {\r\n return {\r\n restrict: \"A\",\r\n scope: false,\r\n link: function (scope, elem, attrs) {\r\n scope.$watch(attrs.questionContainer, function (newValue) {\r\n scope.question = newValue;\r\n if(scope.question.IsIncompatible) {\r\n elem.addClass(\"incompatible\");\r\n }\r\n });\r\n },\r\n controller: function ($scope) {\r\n this.question = $scope.question;\r\n }\r\n }\r\n});\r\n","angular.module(\"content.question\").directive('questionDisplay', function (lodash, PatientSurveyService) {\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n transclude: true,\r\n template: [\r\n '
      ',\r\n '',\r\n '
      '\r\n ].join('')\r\n }\r\n});\r\n","angular.module(\"content.question\").directive(\"questionEdit\", function () {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n onEdit: \"&\"\r\n },\r\n require: \"^questionContainer\",\r\n replace: true,\r\n template: '',\r\n link: function (scope, elem, attrs, questionContainerController) {\r\n scope.question = questionContainerController.question;\r\n scope.clickedEdit = function () {\r\n scope.onEdit({question: questionContainerController.question});\r\n }\r\n }\r\n }\r\n});\r\n","angular.module(\"content.question\").directive(\"questionEraser\", function () {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n onDelete: \"&\",\r\n isDisabled: \"=\"\r\n },\r\n require: \"^questionContainer\",\r\n //replace: true,\r\n template: '',\r\n link: function (scope, elem, attrs, questionContainerController) {\r\n elem.addClass(scope.isDisabled === true ? 'element-disabled' : ''); \r\n scope.question = questionContainerController.question;\r\n scope.clickedDelete = scope.isDisabled === true ? () => {} : function () {\r\n scope.onDelete({question: questionContainerController.question});\r\n }\r\n }\r\n }\r\n});\r\n","angular.module(\"content.question\").directive(\"questionIcon\", function (PatientSurveyService) {\r\n return {\r\n restrict: \"E\",\r\n require: [\"^questionContainer\", \"^?uiTreeNode\"],\r\n scope: true,\r\n template: function (tElement, tAttrs) {\r\n var collapseIcon =\r\n ['',\r\n '',\r\n ''].join('');\r\n\r\n var biometricIcon = '';\r\n var healthTipIcon = '';\r\n\r\n var template = [];\r\n if (tAttrs.collapsable !== undefined) {\r\n template.push(collapseIcon);\r\n }\r\n if (tAttrs.showBio != undefined) {\r\n template.push(biometricIcon);\r\n }\r\n template.push(healthTipIcon);\r\n return template.join('');\r\n },\r\n link: function (scope, elem, attrs, controllers) {\r\n var questionContainerController = controllers[0];\r\n var uiTreeNodeController = controllers[1];\r\n scope.nodeScope = uiTreeNodeController.scope;\r\n scope.toggleExpand = function () {\r\n if (scope.nodeScope.collapsed) {\r\n scope.nodeScope.expand();\r\n } else {\r\n scope.nodeScope.collapse();\r\n }\r\n }\r\n scope.question = questionContainerController.question;\r\n scope.isBiometricQuestion = PatientSurveyService.isBiometricQuestion(scope.question);\r\n scope.isHealthTip = PatientSurveyService.isHealthTipQuestion(scope.question);\r\n scope.isCustomResponseQuestion = scope.question.SurveyQuestionTypeId === 17;\r\n }\r\n }\r\n});\r\n","angular.module(\"content.question\").directive('questionOption', function (lodash) {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n option: \"=\",\r\n index: \"=\",\r\n alertEditable: \"=?\",\r\n alertChanged: \"&?\"\r\n },\r\n require: \"^?vhLanguage\",\r\n template: function(tElement, tAttrs) {\r\n var template = [\r\n '
      {{index + 1 | alphaCounter}}. 
      ',\r\n '',\r\n ' ',\r\n ' ',\r\n '',\r\n '',\r\n '
      ']\r\n );\r\n\r\n return template.join('');\r\n },\r\n link: function (scope, elem, attr, languageController) {\r\n scope.optionText = '';\r\n var defaultLanguage = 'en';\r\n if (languageController) {\r\n languageController.scope.$watch('currentLanguage', changeText);\r\n } else {\r\n changeText(defaultLanguage);\r\n }\r\n\r\n function changeText(language) {\r\n var optionTexts = scope.option.OptionTexts;\r\n var lang;\r\n if(language != undefined) {\r\n lang = language.replace(/-/g, '_');\r\n }\r\n var textModel = lang != undefined ? optionTexts[lang] : optionTexts[language];\r\n if (textModel) {\r\n scope.optionText = textModel;\r\n elem.removeClass('text-not-translated');\r\n } else {\r\n scope.optionText = optionTexts[defaultLanguage];\r\n elem.addClass('text-not-translated');\r\n }\r\n }\r\n\r\n scope.showVideoButton = scope.option.VideoId > 0;\r\n }\r\n }\r\n});\r\n","angular.module(\"content.question\").directive(\"questionText\", function (lodash, $sce) {\r\n return {\r\n restrict: \"E\",\r\n require: [\"^questionContainer\", \"^?vhLanguage\"],\r\n template: function (tElement, tAttrs) {\r\n var template = [' ',\r\n '(',\r\n '',\r\n '',\r\n '',\r\n '',\r\n ''\r\n ]);\r\n return template.join('');\r\n },\r\n link: function (scope, element, attrs, controllers) {\r\n\r\n var guidRegex = /[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}/;\r\n if(scope.question.ContentId && scope.question.ContentId.match(guidRegex)){\r\n scope.contentId = scope.question.ContentId.slice(0,4) + \"-\" + scope.question.ContentId.slice(scope.question.ContentId.length-4);\r\n }\r\n else {\r\n scope.contentId = scope.question.ContentId;\r\n }\r\n \r\n var questionContainerController = controllers[0];\r\n var languageController = controllers[1];\r\n var defaultLanguage = 'en';\r\n var healthTipType = 8;\r\n\r\n scope.question = questionContainerController.question;\r\n\r\n if (languageController) {\r\n languageController.scope.$watch('currentLanguage', changeText);\r\n }\r\n\r\n changeText(defaultLanguage);\r\n function changeText(newLanguage) {\r\n // Display internal name for health tips\r\n if (scope.question.SurveyQuestionTypeId == healthTipType) {\r\n scope.questionText = scope.question.Name;\r\n return;\r\n }\r\n var lang;\r\n if(newLanguage != undefined) {\r\n lang = newLanguage.replace(/-/g, '_');\r\n }\r\n \r\n var questionTexts = scope.question.QuestionTexts;\r\n var textModel = lang != undefined ? questionTexts[lang] : questionTexts[newLanguage];\r\n if (textModel) {\r\n scope.questionText = textModel;\r\n element.removeClass(\"text-not-translated\");\r\n } else {\r\n defaultTextModel = questionTexts[defaultLanguage];\r\n if (defaultTextModel) {\r\n scope.questionText = defaultTextModel;\r\n }\r\n element.addClass(\"text-not-translated\");\r\n }\r\n }\r\n if (scope.question.IsIncompatible) {\r\n var incompatibleTexts = {\r\n 1: \"Not compatible with +Go.\",\r\n 2: \"Not translated in patient's language.\",\r\n 3: \"Not compatible with +Home.\",\r\n 4: \"Not compatible with +Voice.\",\r\n 5: \"Not compatible with CMP.\",\r\n 6: \"Content Suppressed.\",\r\n 7:\"Pathway Not Completed.\"\r\n };\r\n var toolTipTexts = [];\r\n angular.forEach(scope.question.IncompatibilityIds, function (o) {\r\n toolTipTexts.push(incompatibleTexts[o]);\r\n });\r\n scope.tooltipText = $sce.trustAsHtml(toolTipTexts.join(' \\n '));\r\n }\r\n }\r\n };\r\n});\r\n","//\"use strict\";\r\n\r\nfunction ScheduleController(ConfigurationsService, $filter, ScheduleService, $timeout, $scope, PermissionService, $state, $stateParams, PatientSurveyService) {\r\n\r\n var vm = this;\r\n vm.schedule = JSON.parse(\r\n `{\r\n \"DefaultProgramDuration\": 90,\r\n \"MilestoneId\": null,\r\n \"DueTime\": {\r\n \"SchedulePromptTimeOfDay\": -2208934800000,\r\n \"StartMinutesBeforePrompt\": 120,\r\n \"LateMinutesAfterPrompt\": 120,\r\n \"EndMinutesAfterPrompt\": 899,\r\n \"Description\": \"During a calendar day, a pathway’s timing is dictated by four different time factors\",\r\n \"StartMinutesBeforePromptDescription\": \"The amount of time before the Due Time that a patient can start a pathway. It is measured in minutes. For example, if the Start Time is set to 120 minutes, the patient can complete their pathway 2 hours before the Due Time.\",\r\n \"SchedulePromptTimeOfDayDescription\": \"The time of day the patient is prompted to complete their pathway(s).\",\r\n \"LateMinutesAfterPromptDescription\": \"The amount of time after the Due Time that a pathway is considered late. This is measured in minutes. At the Late Time, the patient is reminded to complete their pathway. For example, if the Late Time is set to 120 minutes and the patient has not completed their pathway, the patient will receive a reminder 120 minutes after the Due Time.\",\r\n \"EndMinutesAfterPromptDescription\": \"This represents the amount of time after the Due Time that the pathway expires. It is measured in minutes. A pathway’s End Time cannot be set for later than 11:59 p.m. of the calendar day.\",\r\n \"StartMinutesBeforePromptTime\": -2208942000000,\r\n \"LateMinutesAfterPromptTime\": -2208927600000,\r\n \"EndMinutesAfterPromptTime\": -2208880860000\r\n },\r\n \"StartDate\": {\r\n \"Type\": 1,\r\n \"Immediate\": {\r\n \"Description\": \"This is equivalent to Program Day 1. When a patient accepts their EULA, the patient will see this pathway immediately.\",\r\n \"Delay\": false,\r\n \"Days\": 0 \r\n },\r\n \"ProgramDay\": {\r\n \"HelpTopic\": \"pathway#Pathways\",\r\n \"Type\": 1,\r\n \"Day\": 2,\r\n \"DaysBefore\": 1,\r\n \"v56Logic\": false,\r\n \"Description\": \"This option is chosen when the pathway should start on a specific program day, a number of days before the program ends or on the Program End Date.\"\r\n },\r\n \"MilestoneDay\": {\r\n \"HelpTopic\": \"pathway#Pathways2\",\r\n \"Day\": 1,\r\n \"Before\": 1,\r\n \"Recompute\": true,\r\n \"Description\": \"This option is only visible if a Milestone(s) (e.g., surgery date, hospital discharge date) has been configured in the Care Team Portal. The pathway will be scheduled based on the selected Milestone’s date within the patient’s record.\"\r\n },\r\n \"SpecificDate\": {\r\n \"HelpTopic\": \"pathway#Adding\",\r\n \"Date\": null,\r\n \"Description\": \"This option is chosen when you want a pathway to start on a specific calendar day. If the pathway is configured to recompute the schedule when the patient’s program start date is changed, selecting this option will NOT recompute and the patient’s pathway schedule will NOT be updated.\"\r\n },\r\n \"DayOfWeek\": {\r\n \"Sunday\": false,\r\n \"Monday\": false,\r\n \"Tuesday\": false,\r\n \"Wednesday\": false,\r\n \"Thursday\": false,\r\n \"Friday\": false,\r\n \"Saturday\": false,\r\n \"Weeks\": 0,\r\n \"Delay\": false,\r\n \"Description\": \"Select this option when the pathway should start on a particular day of the week.\"\r\n },\r\n \"Description\": \"This represents the date the pathway first becomes active and available\"\r\n },\r\n \"RecurrencePattern\": {\r\n \"Type\": 1,\r\n \"Daily\": {\r\n \"Type\": 1,\r\n \"Days\": 1,\r\n \"Description\": \"The pathway plays every X number of days or only on weekdays.\"\r\n },\r\n \"Weekly\": {\r\n \"Weeks\": 1,\r\n \"Type\": 2,\r\n \"Sunday\": false,\r\n \"Monday\": false,\r\n \"Tuesday\": false,\r\n \"Wednesday\": false,\r\n \"Thursday\": false,\r\n \"Friday\": false,\r\n \"Saturday\": false,\r\n \"Description\": \"The pathway will play every X number of weeks, every X number of weeks on the day the pathway first started or every X number of weeks on selected days of the week.\"\r\n },\r\n \"Monthly\": {\r\n \"Months\": 1,\r\n \"Type\": 1,\r\n \"DayOfMonth\": 1,\r\n \"Ordinal\": 1,\r\n \"OrdinalDay\": 0,\r\n \"Description\": \"The pathway will be played every X number of months, every X number of months on the day of the month the pathway first started, every X number of months on a selected day in the month or every X number of months on a specific day and week in the month.\"\r\n }\r\n },\r\n \"EndDate\": {\r\n \"Type\": 1,\r\n \"None\": {\r\n \"Description\": \"\"\r\n },\r\n \"After\": {\r\n \"Type\": 1,\r\n \"Completed\": 1,\r\n \"Presented\": 1,\r\n \"Description\": \"This option will allow you to choose when the pathway will no longer be available to the patient, e.g., after the patient has completed it X time(s) or after the pathway has been presented X time(s).\"\r\n },\r\n \"ProgramDay\": {\r\n \"Type\": 3,\r\n \"Day\": 30,\r\n \"DaysBefore\": 5,\r\n \"Description\": \"This option allows you to choose when you want the pathway to end on a specific program day, the number of days before the program ends or on the Program End Date.\"\r\n },\r\n \"SpecificDate\": {\r\n \"Date\": null,\r\n \"Type\": 1,\r\n \"Days\": 0,\r\n \"Description\": \"This option allows you to choose when you want a pathway to end on a calendar day or after a certain number of calendar days following the pathway start date.\"\r\n },\r\n \"MilestoneDay\": {\r\n \"HelpTopic\": \"pathway#Pathways2\",\r\n \"Day\": 1,\r\n \"Before\": 1,\r\n \"Recompute\": true,\r\n \"Description\": \"The pathway’s conclusion is based on the selected Milestone’s date within the patient’s record (e.g., surgery date, hospital discharge date).\"\r\n },\r\n \"Description\": \"This represents the day the pathway is discontinued – when the pathway will no longer be available to the patient\"\r\n }\r\n }`\r\n );\r\n \r\n vm.scheduleToEdit = $scope.$parent.ruleAction.ActionData !== '' \r\n ? JSON.parse($scope.$parent.ruleAction.ActionData).Schedule \r\n : JSON.parse(\r\n `{\r\n \"SurveyScheduleId\": 436,\r\n \"SurveyTemplateId\": 436,\r\n \"SchedulePromptTimeOfDay\": \"09:00:00\",\r\n \"StartMinutesBeforePrompt\": 120,\r\n \"LateMinutesAfterPrompt\": 120,\r\n \"EndMinutesAfterPrompt\": 899,\r\n \"StartDateOldLogic\": false,\r\n \"StartDateType\": 1,\r\n \"StartDateSubType\": 0,\r\n \"StartDateValue\": null,\r\n \"StartDateInterval\": 0,\r\n \"StartDateRecompute\": false,\r\n \"StartDateSunday\": false,\r\n \"StartDateMonday\": false,\r\n \"StartDateTuesday\": false,\r\n \"StartDateWednesday\": false,\r\n \"StartDateThursday\": false,\r\n \"StartDateFriday\": false,\r\n \"StartDateSaturday\": false,\r\n \"RecurrenceType\": 1,\r\n \"RecurrenceSubType\": 1,\r\n \"RecurrenceInterval\": 1,\r\n \"RecurrenceSunday\": false,\r\n \"RecurrenceMonday\": false,\r\n \"RecurrenceTuesday\": false,\r\n \"RecurrenceWednesday\": false,\r\n \"RecurrenceThursday\": false,\r\n \"RecurrenceFriday\": false,\r\n \"RecurrenceSaturday\": false,\r\n \"RecurrenceDayOfMonth\": 0,\r\n \"RecurrenceOrdinal\": 0,\r\n \"RecurrenceOrdinalDay\": 0,\r\n \"EndDateType\": 1,\r\n \"EndDateSubType\": 0,\r\n \"EndDateInterval\": 0,\r\n \"EndDateMilestoneId\": null,\r\n \"EndDateMilestoneUId\": null,\r\n \"EndDateMilestoneName\": null,\r\n \"EndDateRecompute\": false,\r\n \"EndDateValue\": null,\r\n \"DefaultProgramDuration\": 0,\r\n \"MilestoneId\": null,\r\n \"MilestoneUId\": null,\r\n \"MilestoneName\": null,\r\n \"description\": \"Daily @ 9:00 AM\"\r\n }`\r\n );\r\n\r\n init();\r\n\r\n loadSchedule();\r\n\r\n //#region Initialization\r\n function init() {\r\n\r\n initViewModel();\r\n\r\n initSchedule();\r\n\r\n initCalendar();\r\n\r\n initTooltips();\r\n }\r\n\r\n function initViewModel() {\r\n // init parameters\r\n ScheduleService.getMilestones().then(function(response){\r\n vm.Milestones = response.data; \r\n });\r\n vm.isTemplate = false;\r\n vm.templateInfo = {name: ''};\r\n \r\n // New recurrence options were added in v5.7. These options need to added to the APK and thus will\r\n // be disabled in the portal until the APK is updated for the customer.\r\n vm.ShowNewRecurrenceOptions = ConfigurationsService.configParams.AdvancedPathwayScheduling;\r\n vm.monthFirstFormat = (\"MM/dd/yyyy\" == ConfigurationsService.configParams.DateFormat);\r\n\r\n vm.helpUrl = ConfigurationsService.configParams.HelpUrl;\r\n ///\"https://help.vivifyhealth.com/Vivify/v53/Content/Pathways/Add%20a%20Pathway%20Schedule.htm?Highlight=pathway#Pathways\";\r\n vm.StartDateHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/Pathways/Pathway%20Scheduling.htm#Start\");\r\n vm.RecurrenceHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/Pathways/Pathway%20Scheduling.htm#Recurrence\");\r\n vm.EndDateHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/Pathways/Pathway%20Scheduling.htm#End\");\r\n\r\n if(!vm.isTemplate){\r\n // different help link of viewing from the patient vs content\r\n vm.RecurrenceHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/Pathways/Add%20a%20Pathway%20to%20Patient.htm#Step2\");\r\n }\r\n\r\n\r\n vm.IsValid = true;\r\n\r\n return vm;\r\n }\r\n\r\n function initSchedule(){\r\n initMilestoneId();\r\n return vm.schedule;\r\n }\r\n\r\n function initMilestoneId() {\r\n vm.schedule.MilestoneId = null;\r\n\r\n if (vm.Milestones != null) {\r\n var activeMilestons = [];\r\n for(var i = 0; i < vm.Milestones.length; i++){\r\n if(vm.Milestones[i].IsEnabled === true){\r\n activeMilestons.push(vm.Milestones[i])\r\n }\r\n }\r\n vm.Milestones = activeMilestons;\r\n if (vm.Milestones.length > 0){\r\n vm.schedule.MilestoneId = vm.Milestones[0].MilestoneId;\r\n } \r\n }\r\n }\r\n\r\n function initCalendar() {\r\n vm.samplePathwayAdded = null;\r\n vm.SampleCalendar = {};\r\n vm.SampleCalendar.Months = [];\r\n vm.SampleCalendar.DateAdded = {};\r\n vm.SampleCalendar.Milestone = {};\r\n vm.SampleCalendar.StartDate = {};\r\n vm.SampleCalendar.FirstDate = {};\r\n vm.SampleCalendar.EndDate = {};\r\n vm.calendarLoaded = false;\r\n }\r\n\r\n function initTooltips() {\r\n\r\n // some tooltips are constant\r\n vm.schedule.DueTime.Description = \"During a calendar day, a pathway’s timing is dictated by four different time factors\";\r\n vm.schedule.DueTime.StartMinutesBeforePromptDescription = \"The amount of time before the Due Time that a patient can start a pathway. It is measured in minutes. For example, if the Start Time is set to 120 minutes, the patient can complete their pathway 2 hours before the Due Time.\"\r\n vm.schedule.DueTime.SchedulePromptTimeOfDayDescription = \"The time of day the patient is prompted to complete their pathway(s).\"\r\n vm.schedule.DueTime.LateMinutesAfterPromptDescription = \"The amount of time after the Due Time that a pathway is considered late. This is measured in minutes. At the Late Time, the patient is reminded to complete their pathway. For example, if the Late Time is set to 120 minutes and the patient has not completed their pathway, the patient will receive a reminder 120 minutes after the Due Time.\"\r\n vm.schedule.DueTime.EndMinutesAfterPromptDescription = \"This represents the amount of time after the Due Time that the pathway expires. It is measured in minutes. A pathway’s End Time cannot be set for later than 11:59 p.m. of the calendar day.\";\r\n\r\n vm.schedule.StartDate.Description = \"This represents the date the pathway first becomes active and available\";\r\n vm.schedule.StartDate.Immediate.Description = \"This is equivalent to Program Day 1. When a patient accepts their EULA, the patient will see this pathway immediately.\";\r\n vm.schedule.StartDate.ProgramDay.Description = \"This option is chosen when the pathway should start on a specific program day, a number of days before the program ends or on the Program End Date.\";\r\n vm.schedule.StartDate.MilestoneDay.Description = \"This option is only visible if a Milestone(s) (e.g., surgery date, hospital discharge date) has been configured in the Care Team Portal. The pathway will be scheduled based on the selected Milestone’s date within the patient’s record.\";\r\n vm.schedule.StartDate.SpecificDate.Description = \"This option is chosen when you want a pathway to start on a specific calendar day. If the pathway is configured to recompute the schedule when the patient’s program start date is changed, selecting this option will NOT recompute and the patient’s pathway schedule will NOT be updated.\";\r\n vm.schedule.StartDate.DayOfWeek.Description = \"Select this option when the pathway should start on a particular day of the week.\";\r\n\r\n vm.schedule.RecurrencePattern.Daily.Description = \"The pathway plays every X number of days or only on weekdays.\";\r\n vm.schedule.RecurrencePattern.Weekly.Description = \"The pathway will play every X number of weeks, every X number of weeks on the day the pathway first started or every X number of weeks on selected days of the week.\";\r\n vm.schedule.RecurrencePattern.Monthly.Description = \"The pathway will be played every X number of months, every X number of months on the day of the month the pathway first started, every X number of months on a selected day in the month or every X number of months on a specific day and week in the month.\";\r\n\r\n vm.schedule.EndDate.Description = \"This represents the day the pathway is discontinued – when the pathway will no longer be available to the patient\";\r\n vm.schedule.EndDate.None.Description = \"\";\r\n vm.schedule.EndDate.After.Description = \"This option will allow you to choose when the pathway will no longer be available to the patient, e.g., after the patient has completed it X time(s) or after the pathway has been presented X time(s).\";\r\n vm.schedule.EndDate.ProgramDay.Description = \"This option allows you to choose when you want the pathway to end on a specific program day, the number of days before the program ends or on the Program End Date.\";\r\n vm.schedule.EndDate.SpecificDate.Description = \"This option allows you to choose when you want a pathway to end on a calendar day or after a certain number of calendar days following the pathway start date.\";\r\n vm.schedule.EndDate.MilestoneDay.Description = \"The pathway’s conclusion is based on the selected Milestone’s date within the patient’s record (e.g., surgery date, hospital discharge date).\";\r\n\r\n vm.SampleCalendar.Description = \"This is a tool to assist the Content Administrator in setting the schedule for a pathway\";\r\n vm.SampleCalendar.DateAdded.Description = \"This represents the day the pathway was added to the patient to compute the sample schedule. You may click a different day in the calendar to change this date.\";\r\n vm.SampleCalendar.Milestone.Description = \"The milestone date for the patient used to compute this sample schedule. Click a day in the calendar to change this date.\";\r\n vm.SampleCalendar.StartDateDescription = \"The date the pathway first becomes active and available for a patient.\";\r\n vm.SampleCalendar.FirstDate.Description = \"The first date the pathway will play for the patient.\";\r\n vm.SampleCalendar.EndDateDescription = \"The last date the pathway is active for the patient.\";\r\n \r\n // some tooltips depend on whether it's a patient pathway or a template pathway\r\n if(vm.isTemplate) {\r\n \r\n\r\n }\r\n else {\r\n\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Load Schedule\r\n function loadSchedule() {\r\n\r\n loadDueTime();\r\n loadStartDate();\r\n loadRecurrencePattern();\r\n loadEndDate();\r\n \r\n return vm.schedule;\r\n }\r\n\r\n function loadDueTime(){\r\n vm.schedule.DueTime.SchedulePromptTimeOfDay = Date.parse('1900/01/01 ' + vm.scheduleToEdit.SchedulePromptTimeOfDay); //vm.scheduleToEdit.SchedulePromptTimeOfDay; \r\n vm.schedule.DueTime.StartMinutesBeforePrompt = vm.scheduleToEdit.StartMinutesBeforePrompt;\r\n vm.schedule.DueTime.LateMinutesAfterPrompt = vm.scheduleToEdit.LateMinutesAfterPrompt;\r\n vm.schedule.DueTime.EndMinutesAfterPrompt = vm.scheduleToEdit.EndMinutesAfterPrompt\r\n\r\n var minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.StartMinutesBeforePromptTime = minutes.setMinutes( minutes.getMinutes() - vm.schedule.DueTime.StartMinutesBeforePrompt);\r\n\r\n minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.LateMinutesAfterPromptTime = minutes.setMinutes( minutes.getMinutes() + vm.schedule.DueTime.LateMinutesAfterPrompt);\r\n\r\n minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.EndMinutesAfterPromptTime = minutes.setMinutes( minutes.getMinutes() + vm.schedule.DueTime.EndMinutesAfterPrompt);\r\n }\r\n\r\n function loadStartDate(){\r\n vm.schedule.StartDate.Type = vm.scheduleToEdit.StartDateType;\r\n if ( vm.scheduleToEdit.DefaultProgramDuration != 0){\r\n vm.schedule.DefaultProgramDuration = vm.scheduleToEdit.DefaultProgramDuration;\r\n }\r\n\r\n if (vm.scheduleToEdit.MilestoneId != null){\r\n vm.schedule.MilestoneId = vm.scheduleToEdit.MilestoneId;\r\n }\r\n\r\n switch(Number(vm.schedule.StartDate.Type)){\r\n case 1: //Immediate\r\n {\r\n vm.schedule.StartDate.Immediate.Days = vm.scheduleToEdit.StartDateInterval;\r\n if ( vm.schedule.StartDate.Immediate.Days > 0 ){\r\n vm.schedule.StartDate.Immediate.Delay = true;\r\n }\r\n break;\r\n }\r\n case 2: //Program Day\r\n {\r\n vm.schedule.StartDate.ProgramDay.Type = vm.scheduleToEdit.StartDateSubType;\r\n switch(Number(vm.schedule.StartDate.ProgramDay.Type)){\r\n case 1:\r\n {\r\n vm.schedule.StartDate.ProgramDay.Day = vm.scheduleToEdit.StartDateInterval;\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.schedule.StartDate.ProgramDay.DaysBefore = vm.scheduleToEdit.StartDateInterval;\r\n break;\r\n }\r\n }\r\n vm.schedule.StartDate.ProgramDay.Recompute = vm.scheduleToEdit.StartDateRecompute;\r\n vm.schedule.StartDate.ProgramDay.v56Logic = vm.scheduleToEdit.StartDateOldLogic; //for migration to v5.7 and to keep old logic\r\n break\r\n }\r\n case 3: // Milestone Day\r\n {\r\n vm.schedule.StartDate.MilestoneDay.Before = vm.scheduleToEdit.StartDateSubType;\r\n vm.schedule.StartDate.MilestoneDay.Day = vm.scheduleToEdit.StartDateInterval;\r\n vm.schedule.StartDate.MilestoneDay.Recompute = vm.scheduleToEdit.StartDateRecompute;\r\n break;\r\n }\r\n case 4: // Specific Date\r\n {\r\n if(vm.scheduleToEdit.StartDateValue != null) {\r\n vm.schedule.StartDate.SpecificDate.Date = getUtcPlusLocalOffsetDate(vm.scheduleToEdit.StartDateValue);\r\n }\r\n break;\r\n }\r\n case 5: // Day of Week\r\n {\r\n vm.schedule.StartDate.DayOfWeek.Sunday = vm.scheduleToEdit.StartDateSunday;\r\n vm.schedule.StartDate.DayOfWeek.Monday = vm.scheduleToEdit.StartDateMonday;\r\n vm.schedule.StartDate.DayOfWeek.Tuesday = vm.scheduleToEdit.StartDateTuesday;\r\n vm.schedule.StartDate.DayOfWeek.Wednesday = vm.scheduleToEdit.StartDateWednesday;\r\n vm.schedule.StartDate.DayOfWeek.Thursday = vm.scheduleToEdit.StartDateThursday;\r\n vm.schedule.StartDate.DayOfWeek.Friday = vm.scheduleToEdit.StartDateFriday;\r\n vm.schedule.StartDate.DayOfWeek.Saturday = vm.scheduleToEdit.StartDateSaturday;\r\n vm.schedule.StartDate.DayOfWeek.Weeks = vm.scheduleToEdit.StartDateInterval;\r\n if ( vm.schedule.StartDate.DayOfWeek.Weeks > 0 ){\r\n vm.schedule.StartDate.DayOfWeek.Delay = true;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function loadRecurrencePattern(){\r\n vm.schedule.RecurrencePattern.Type = vm.scheduleToEdit.RecurrenceType;\r\n switch(Number(vm.schedule.RecurrencePattern.Type)){\r\n case 1: // Daily\r\n {\r\n vm.schedule.RecurrencePattern.Daily.Type = vm.scheduleToEdit.RecurrenceSubType;\r\n vm.schedule.RecurrencePattern.Daily.Days = vm.scheduleToEdit.RecurrenceInterval;\r\n break;\r\n }\r\n case 2: // Weekly\r\n {\r\n vm.schedule.RecurrencePattern.Weekly.Type = vm.scheduleToEdit.RecurrenceSubType;\r\n vm.schedule.RecurrencePattern.Weekly.Weeks = vm.scheduleToEdit.RecurrenceInterval;\r\n vm.schedule.RecurrencePattern.Weekly.Sunday = vm.scheduleToEdit.RecurrenceSunday;\r\n vm.schedule.RecurrencePattern.Weekly.Monday = vm.scheduleToEdit.RecurrenceMonday;\r\n vm.schedule.RecurrencePattern.Weekly.Tuesday = vm.scheduleToEdit.RecurrenceTuesday;\r\n vm.schedule.RecurrencePattern.Weekly.Wednesday = vm.scheduleToEdit.RecurrenceWednesday;\r\n vm.schedule.RecurrencePattern.Weekly.Thursday = vm.scheduleToEdit.RecurrenceThursday;\r\n vm.schedule.RecurrencePattern.Weekly.Friday = vm.scheduleToEdit.RecurrenceFriday;\r\n vm.schedule.RecurrencePattern.Weekly.Saturday = vm.scheduleToEdit.RecurrenceSaturday; \r\n break;\r\n }\r\n case 3: // Monthly\r\n {\r\n vm.schedule.RecurrencePattern.Monthly.Type = vm.scheduleToEdit.RecurrenceSubType;\r\n vm.schedule.RecurrencePattern.Monthly.Months = vm.scheduleToEdit.RecurrenceInterval;\r\n vm.schedule.RecurrencePattern.Monthly.DayOfMonth = vm.scheduleToEdit.RecurrenceDayOfMonth;\r\n vm.schedule.RecurrencePattern.Monthly.Ordinal = vm.scheduleToEdit.RecurrenceOrdinal;\r\n vm.schedule.RecurrencePattern.Monthly.OrdinalDay = vm.scheduleToEdit.RecurrenceOrdinalDay; \r\n break;\r\n }\r\n }\r\n }\r\n\r\n function loadEndDate(){\r\n vm.schedule.EndDate.Type = vm.scheduleToEdit.EndDateType;\r\n switch(Number(vm.schedule.EndDate.Type)){\r\n case 1: //None\r\n {\r\n break;\r\n }\r\n case 2: // After\r\n {\r\n vm.schedule.EndDate.After.Type = vm.scheduleToEdit.EndDateSubType;\r\n switch(Number(vm.schedule.EndDate.After.Type)){\r\n case 1:\r\n {\r\n vm.schedule.EndDate.After.Completed = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.schedule.EndDate.After.Presented = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n case 3:\r\n {\r\n vm.schedule.EndDate.After.Days = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n } \r\n }\r\n case 3: //Program Day\r\n {\r\n vm.schedule.EndDate.ProgramDay.Type = vm.scheduleToEdit.EndDateSubType;\r\n vm.schedule.EndDate.ProgramDay.Recompute = vm.scheduleToEdit.EndDateRecompute;\r\n switch(Number(vm.schedule.EndDate.ProgramDay.Type)){\r\n case 1:\r\n {\r\n vm.schedule.EndDate.ProgramDay.Day = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.schedule.EndDate.ProgramDay.DaysBefore = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n }\r\n break\r\n }\r\n case 4: // Specific Date\r\n {\r\n vm.schedule.EndDate.SpecificDate.Type = vm.scheduleToEdit.EndDateSubType;\r\n switch(Number(vm.schedule.EndDate.SpecificDate.Type)){\r\n case 1:\r\n {\r\n vm.schedule.EndDate.SpecificDate.Date = getUtcPlusLocalOffsetDate(vm.scheduleToEdit.EndDateValue); \r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.schedule.EndDate.SpecificDate.Days = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n } \r\n break\r\n }\r\n case 5: // Milestone Day\r\n {\r\n vm.schedule.EndDate.MilestoneDay.Before = vm.scheduleToEdit.EndDateSubType;\r\n vm.schedule.EndDate.MilestoneDay.Day = vm.scheduleToEdit.EndDateInterval;\r\n vm.schedule.EndDate.MilestoneDay.Recompute = vm.scheduleToEdit.EndDateRecompute;\r\n break;\r\n } \r\n\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Save Schedule\r\n function save(){\r\n vm.NewSchedule = {};\r\n saveDueTime();\r\n saveStartDate();\r\n saveRecurrencePattern();\r\n saveEndDate();\r\n }\r\n\r\n function saveDueTime(){\r\n vm.NewSchedule.SchedulePromptTimeOfDay = $filter('date')(vm.schedule.DueTime.SchedulePromptTimeOfDay, 'HH:mm:ss');\r\n vm.NewSchedule.StartMinutesBeforePrompt = vm.schedule.DueTime.StartMinutesBeforePrompt;\r\n vm.NewSchedule.LateMinutesAfterPrompt = vm.schedule.DueTime.LateMinutesAfterPrompt;\r\n vm.NewSchedule.EndMinutesAfterPrompt = vm.schedule.DueTime.EndMinutesAfterPrompt;\r\n\r\n // if any of these dont have values the schedule is not valid\r\n if(\r\n vm.NewSchedule.SchedulePromptTimeOfDay == undefined || \r\n vm.NewSchedule.StartMinutesBeforePrompt == undefined ||\r\n vm.NewSchedule.LateMinutesAfterPrompt == undefined ||\r\n vm.NewSchedule.EndMinutesAfterPrompt == undefined \r\n ){\r\n vm.IsValid = false;\r\n }\r\n }\r\n\r\n function saveStartDate(){\r\n if( vm.schedule.DefaultProgramDuration > 0){\r\n vm.NewSchedule.DefaultProgramDuration = vm.schedule.DefaultProgramDuration; // same value is used for start date and end date fields.\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n\r\n vm.NewSchedule.MilestoneId = null; // same value us used for start date and end date fields.\r\n vm.NewSchedule.StartDateType = vm.schedule.StartDate.Type;\r\n vm.NewSchedule.StartDateSubType = 1;\r\n vm.NewSchedule.StartDateRecompute = false;\r\n vm.NewSchedule.StartDateValue = null;\r\n vm.NewSchedule.StartDateSunday = false;\r\n vm.NewSchedule.StartDateMonday = false;\r\n vm.NewSchedule.StartDateTuesday = false;\r\n vm.NewSchedule.StartDateWednesday = false;\r\n vm.NewSchedule.StartDateThursday = false;\r\n vm.NewSchedule.StartDateFriday = false;\r\n vm.NewSchedule.StartDateSaturday = false;\r\n vm.NewSchedule.StartDateInterval = 0;\r\n\r\n switch(Number(vm.schedule.StartDate.Type)){\r\n case 1: //Immediate\r\n {\r\n if( vm.schedule.StartDate.Immediate.Days >= 0 && vm.schedule.StartDate.Immediate.Days != null){\r\n if (vm.schedule.StartDate.Immediate.Delay){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.Immediate.Days;\r\n }\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n\r\n if(vm.schedule.EndDate.Type == 5) {\r\n vm.NewSchedule.StartDateRecompute = vm.schedule.StartDate.MilestoneDay.Recompute;\r\n }\r\n break;\r\n }\r\n case 2: //Program Day\r\n {\r\n vm.NewSchedule.StartDateSubType = vm.schedule.StartDate.ProgramDay.Type;\r\n vm.NewSchedule.StartDateRecompute = vm.schedule.StartDate.ProgramDay.Recompute;\r\n switch(Number(vm.schedule.StartDate.ProgramDay.Type)){\r\n case 1: // On Program day X\r\n {\r\n if( vm.schedule.StartDate.ProgramDay.Day >= 2){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.ProgramDay.Day;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n case 2: // X day(s) before end of program\r\n {\r\n if(vm.schedule.StartDate.ProgramDay.DaysBefore >= 0 && vm.schedule.StartDate.ProgramDay.DaysBefore != null){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.ProgramDay.DaysBefore;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n case 3: // Program End Date\r\n {\r\n break;\r\n }\r\n }\r\n vm.NewSchedule.StartDateOldLogic = vm.schedule.StartDate.ProgramDay.v56Logic;\r\n break\r\n }\r\n case 3: // Milestone Day\r\n {\r\n vm.NewSchedule.MilestoneId = vm.schedule.MilestoneId; // same value us used for start date and end date fields.\r\n vm.NewSchedule.StartDateSubType = vm.schedule.StartDate.MilestoneDay.Before;\r\n vm.NewSchedule.StartDateRecompute = vm.schedule.StartDate.MilestoneDay.Recompute;\r\n if( vm.schedule.StartDate.MilestoneDay.Day >= 0 && vm.schedule.StartDate.MilestoneDay.Day != null){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.MilestoneDay.Day;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n case 4: // Specific Date\r\n {\r\n if ( vm.schedule.StartDate.SpecificDate.Date != null){\r\n vm.NewSchedule.StartDateValue = getUtcDateAsString(vm.schedule.StartDate.SpecificDate.Date);\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break\r\n }\r\n case 5: // Day of Week\r\n {\r\n if( vm.schedule.StartDate.DayOfWeek.Weeks >= 0 && vm.schedule.StartDate.DayOfWeek.Weeks != null){\r\n if (vm.schedule.StartDate.DayOfWeek.Delay){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.DayOfWeek.Weeks;\r\n }\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n \r\n if(IsStartDayChecked()){\r\n vm.NewSchedule.StartDateSunday = vm.schedule.StartDate.DayOfWeek.Sunday;\r\n vm.NewSchedule.StartDateMonday = vm.schedule.StartDate.DayOfWeek.Monday;\r\n vm.NewSchedule.StartDateTuesday = vm.schedule.StartDate.DayOfWeek.Tuesday;\r\n vm.NewSchedule.StartDateWednesday = vm.schedule.StartDate.DayOfWeek.Wednesday;\r\n vm.NewSchedule.StartDateThursday = vm.schedule.StartDate.DayOfWeek.Thursday;\r\n vm.NewSchedule.StartDateFriday = vm.schedule.StartDate.DayOfWeek.Friday;\r\n vm.NewSchedule.StartDateSaturday = vm.schedule.StartDate.DayOfWeek.Saturday;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n } \r\n }\r\n }\r\n\r\n function IsStartDayChecked(){\r\n var retVal = false;\r\n if( vm.schedule.StartDate.DayOfWeek.Sunday ||\r\n vm.schedule.StartDate.DayOfWeek.Monday ||\r\n vm.schedule.StartDate.DayOfWeek.Tuesday ||\r\n vm.schedule.StartDate.DayOfWeek.Wednesday ||\r\n vm.schedule.StartDate.DayOfWeek.Thursday ||\r\n vm.schedule.StartDate.DayOfWeek.Friday ||\r\n vm.schedule.StartDate.DayOfWeek.Saturday ){\r\n retVal = true;\r\n }\r\n return retVal;\r\n }\r\n\r\n function saveRecurrencePattern(){\r\n vm.NewSchedule.RecurrenceType = vm.schedule.RecurrencePattern.Type;\r\n vm.NewSchedule.RecurrenceSubType = 1;\r\n vm.NewSchedule.RecurrenceInterval = 1;\r\n vm.NewSchedule.RecurrenceDayOfMonth = 1;\r\n vm.NewSchedule.RecurrenceSunday = false;\r\n vm.NewSchedule.RecurrenceMonday = false;\r\n vm.NewSchedule.RecurrenceTuesday = false;\r\n vm.NewSchedule.RecurrenceWednesday = false;\r\n vm.NewSchedule.RecurrenceThursday = false;\r\n vm.NewSchedule.RecurrenceFriday = false;\r\n vm.NewSchedule.RecurrenceSaturday = false;\r\n vm.NewSchedule.RecurrenceOrdinal = 1;\r\n vm.NewSchedule.RecurrenceOrdinalDay = 1;\r\n\r\n switch(Number(vm.schedule.RecurrencePattern.Type)){\r\n case 1: // Daily\r\n {\r\n vm.NewSchedule.RecurrenceSubType = vm.schedule.RecurrencePattern.Daily.Type;\r\n switch(Number(vm.schedule.RecurrencePattern.Daily.Type)){\r\n case 1: // Every X day(s)\r\n {\r\n if( vm.schedule.RecurrencePattern.Daily.Days >= 1){\r\n vm.NewSchedule.RecurrenceInterval = vm.schedule.RecurrencePattern.Daily.Days;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n case 2: // Every Weekday\r\n {\r\n vm.NewSchedule.RecurrenceMonday = true;\r\n vm.NewSchedule.RecurrenceTuesday = true;\r\n vm.NewSchedule.RecurrenceWednesday = true;\r\n vm.NewSchedule.RecurrenceThursday = true;\r\n vm.NewSchedule.RecurrenceFriday = true;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case 2: // Weekly\r\n {\r\n vm.NewSchedule.RecurrenceSubType = vm.schedule.RecurrencePattern.Weekly.Type;\r\n if (vm.schedule.RecurrencePattern.Weekly.Weeks >= 1){\r\n vm.NewSchedule.RecurrenceInterval = vm.schedule.RecurrencePattern.Weekly.Weeks;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n\r\n switch(Number(vm.schedule.RecurrencePattern.Weekly.Type)){\r\n case 1: // on the day the pathway started\r\n {\r\n break;\r\n }\r\n case 2: // on Su Mo Tu We Th Fr Sa\r\n {\r\n if(IsRecurrenceDayChecked()){\r\n vm.NewSchedule.RecurrenceSunday = vm.schedule.RecurrencePattern.Weekly.Sunday;\r\n vm.NewSchedule.RecurrenceMonday = vm.schedule.RecurrencePattern.Weekly.Monday;\r\n vm.NewSchedule.RecurrenceTuesday = vm.schedule.RecurrencePattern.Weekly.Tuesday;\r\n vm.NewSchedule.RecurrenceWednesday = vm.schedule.RecurrencePattern.Weekly.Wednesday;\r\n vm.NewSchedule.RecurrenceThursday = vm.schedule.RecurrencePattern.Weekly.Thursday;\r\n vm.NewSchedule.RecurrenceFriday = vm.schedule.RecurrencePattern.Weekly.Friday;\r\n vm.NewSchedule.RecurrenceSaturday = vm.schedule.RecurrencePattern.Weekly.Saturday;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n } \r\n break;\r\n }\r\n case 3: // Monthly\r\n {\r\n vm.NewSchedule.RecurrenceSubType = vm.schedule.RecurrencePattern.Monthly.Type;\r\n if(vm.schedule.RecurrencePattern.Monthly.Months >= 1){\r\n vm.NewSchedule.RecurrenceInterval = vm.schedule.RecurrencePattern.Monthly.Months;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n \r\n switch(Number(vm.schedule.RecurrencePattern.Monthly.Type)){\r\n case 1: // the patwhay start date\r\n {\r\n break;\r\n }\r\n case 2: // day X of the month\r\n {\r\n if( vm.schedule.RecurrencePattern.Monthly.DayOfMonth >= 1 && vm.schedule.RecurrencePattern.Monthly.DayOfMonth <=31 ){\r\n vm.NewSchedule.RecurrenceDayOfMonth = vm.schedule.RecurrencePattern.Monthly.DayOfMonth;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n case 3: // the XX DAY of the month\r\n {\r\n vm.NewSchedule.RecurrenceOrdinal = vm.schedule.RecurrencePattern.Monthly.Ordinal;\r\n vm.NewSchedule.RecurrenceOrdinalDay = vm.schedule.RecurrencePattern.Monthly.OrdinalDay;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function IsRecurrenceDayChecked(){\r\n var retVal = false;\r\n if ( vm.schedule.RecurrencePattern.Weekly.Sunday ||\r\n vm.schedule.RecurrencePattern.Weekly.Monday ||\r\n vm.schedule.RecurrencePattern.Weekly.Tuesday ||\r\n vm.schedule.RecurrencePattern.Weekly.Wednesday ||\r\n vm.schedule.RecurrencePattern.Weekly.Thursday ||\r\n vm.schedule.RecurrencePattern.Weekly.Friday ||\r\n vm.schedule.RecurrencePattern.Weekly.Saturday ){\r\n retVal = true;\r\n }\r\n return retVal;\r\n }\r\n\r\n function saveEndDate(){\r\n // // user override on patient schedule\r\n // if(!vm.isTemplate && vm.schedule.EndDate.SpecificDate.Date) {\r\n // vm.schedule.EndDate.Type = 4; // specific date\r\n // vm.NewSchedule.EndDate = vm.schedule.EndDate.SpecificDate.Date;\r\n // }\r\n\r\n vm.NewSchedule.EndDateType = vm.schedule.EndDate.Type;\r\n vm.NewSchedule.EndDateSubType = 1;\r\n vm.NewSchedule.EndDateInterval = 1;\r\n vm.NewSchedule.EndDateRecompute = false;\r\n vm.NewSchedule.EndDateValue = null; \r\n\r\n switch(Number(vm.schedule.EndDate.Type)){\r\n case 1: //None\r\n {\r\n break;\r\n }\r\n case 2: // After\r\n {\r\n vm.NewSchedule.EndDateSubType = vm.schedule.EndDate.After.Type;\r\n switch(Number(vm.schedule.EndDate.After.Type)){\r\n case 1: // Completed X time(s) by patient\r\n {\r\n if ( vm.schedule.EndDate.After.Completed >= 1 ){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.After.Completed;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n case 2: // Presented X time(s) to patient\r\n {\r\n if ( vm.schedule.EndDate.After.Presented >= 1){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.After.Presented;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n } \r\n break;\r\n }\r\n case 3: //Program Day\r\n {\r\n vm.NewSchedule.EndDateSubType = vm.schedule.EndDate.ProgramDay.Type;\r\n vm.NewSchedule.EndDateRecompute = vm.schedule.EndDate.ProgramDay.Recompute;\r\n switch(Number(vm.schedule.EndDate.ProgramDay.Type)){\r\n case 1: // On Program day X\r\n {\r\n if ( vm.schedule.EndDate.ProgramDay.Day >= 1){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.ProgramDay.Day;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n case 2: // X Day(s) before end of program\r\n {\r\n if(vm.schedule.EndDate.ProgramDay.DaysBefore >= 0 && vm.schedule.EndDate.ProgramDay.DaysBefore != null){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.ProgramDay.DaysBefore;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n case 3: // Program End Date\r\n {\r\n break;\r\n }\r\n }\r\n break\r\n }\r\n case 4: // Specific Date\r\n {\r\n vm.NewSchedule.EndDateSubType = vm.schedule.EndDate.SpecificDate.Type;\r\n switch(Number(vm.schedule.EndDate.SpecificDate.Type)){\r\n case 1: // On specific date\r\n {\r\n if(vm.schedule.EndDate.SpecificDate.Date){\r\n vm.NewSchedule.EndDateValue = getUtcDateAsString(vm.schedule.EndDate.SpecificDate.Date);\r\n }else{\r\n vm.IsValid = false;\r\n }\r\n \r\n break;\r\n }\r\n case 2: // X calendar day(s) after pathway start date\r\n {\r\n if(vm.schedule.EndDate.SpecificDate.Days >= 0 && vm.schedule.EndDate.SpecificDate.Days != null){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.SpecificDate.Days;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n } \r\n break\r\n }\r\n case 5: // Milestone Day\r\n {\r\n vm.NewSchedule.MilestoneId = vm.schedule.MilestoneId; // same value us used for start date and end date fields.\r\n vm.NewSchedule.EndDateSubType = vm.schedule.EndDate.MilestoneDay.Before;\r\n vm.NewSchedule.EndDateRecompute = vm.schedule.EndDate.MilestoneDay.Recompute;\r\n if( vm.schedule.EndDate.MilestoneDay.Day >= 0 && vm.schedule.EndDate.MilestoneDay.Day != null){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.MilestoneDay.Day;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n } \r\n }\r\n }\r\n\r\n function saveIds() {\r\n if(vm.isTemplate) {\r\n vm.NewSchedule.SurveyScheduleId = vm.scheduleToEdit.SurveyScheduleId;\r\n vm.NewSchedule.SurveyTemplateId = vm.scheduleToEdit.SurveyTemplateId;\r\n }\r\n else {\r\n vm.NewSchedule.PatientSurveyScheduleId = vm.scheduleToEdit.PatientSurveyScheduleId;\r\n vm.NewSchedule.PatientSurveyId = vm.scheduleToEdit.PatientSurveyId;\r\n }\r\n vm.NewSchedule.CreatedBy_Id = vm.scheduleToEdit.CreatedBy_Id;\r\n vm.NewSchedule.CreatedDateTime_UTC = vm.scheduleToEdit.CreatedDateTime_UTC;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Build Sample Schedule (shown on right side)\r\n function buildCalendar(){\r\n vm.IsValid = true;\r\n CalculateDisplayTimes();\r\n save();\r\n buildDescription();\r\n }\r\n\r\n vm.CalculateDisplayTimes = CalculateDisplayTimes;\r\n function CalculateDisplayTimes(){\r\n var minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.StartMinutesBeforePrompt = adjustMinutes(minutes, vm.schedule.DueTime.StartMinutesBeforePrompt, true);\r\n vm.schedule.DueTime.StartMinutesBeforePromptTime = minutes.setMinutes( minutes.getMinutes() - vm.schedule.DueTime.StartMinutesBeforePrompt);\r\n if(!vm.schedule.DueTime.StartMinutesBeforePromptTime){\r\n vm.ValidStartTime = false;\r\n vm.IsValid = false;\r\n }else{\r\n vm.ValidStartTime = true;\r\n }\r\n minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.LateMinutesAfterPrompt = adjustMinutes(minutes, vm.schedule.DueTime.LateMinutesAfterPrompt, false);\r\n vm.schedule.DueTime.LateMinutesAfterPromptTime = minutes.setMinutes( minutes.getMinutes() + vm.schedule.DueTime.LateMinutesAfterPrompt);\r\n if(!vm.schedule.DueTime.LateMinutesAfterPromptTime){\r\n vm.ValidLateTime = false;\r\n vm.IsValid = false;\r\n }else{\r\n vm.ValidLateTime = true;\r\n }\r\n minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.EndMinutesAfterPrompt = adjustMinutes(minutes, vm.schedule.DueTime.EndMinutesAfterPrompt, false);\r\n vm.schedule.DueTime.EndMinutesAfterPromptTime = minutes.setMinutes( minutes.getMinutes() + vm.schedule.DueTime.EndMinutesAfterPrompt);\r\n if(!vm.schedule.DueTime.EndMinutesAfterPromptTime){\r\n vm.ValidEndTime = false;\r\n vm.IsValid = false;\r\n }else{\r\n vm.ValidEndTime = true;\r\n }\r\n\r\n if(vm.schedule.DueTime.EndMinutesAfterPromptTime && vm.schedule.DueTime.LateMinutesAfterPromptTime && vm.schedule.DueTime.StartMinutesBeforePromptTime){\r\n vm.IsValid = true;\r\n }\r\n }\r\n \r\n function adjustMinutes(base, minutes, isBefore){\r\n if(minutes == undefined){\r\n return NaN;\r\n }\r\n var prompt = new Date(base);\r\n var copy = new Date(base);\r\n var addedTime = isBefore ? -minutes : minutes;\r\n var newTime = new Date(copy.setMinutes(copy.getMinutes() + addedTime)); \r\n if(isBefore && prompt.getDate() != newTime.getDate()){\r\n var copy = new Date(prompt);\r\n copy.setHours(0,0,0,0);\r\n var difference = moment(copy).diff(prompt, \"minutes\");\r\n return Math.abs(difference);\r\n }\r\n if (!isBefore && prompt.getDate() != newTime.getDate()){\r\n newTime.setHours(0,0,0,0);\r\n var difference = moment(prompt).diff(newTime, \"minutes\");\r\n return Math.abs(difference+1);\r\n }\r\n return Math.abs(minutes);\r\n }\r\n\r\n function buildDescription(){\r\n var milestoneName = getMilestoneName(vm.NewSchedule.MilestoneId);\r\n vm.schedule.description = {\r\n all: $filter('schedule')(vm.NewSchedule, milestoneName),\r\n start: $filter('schedule')(vm.NewSchedule, milestoneName, 'start'),\r\n end: $filter('schedule')(vm.NewSchedule, milestoneName, 'end'),\r\n recurrence: $filter('schedule')(vm.NewSchedule, '', 'recurrence'),\r\n time: $filter('schedule')(vm.NewSchedule, '', 'time')\r\n };\r\n }\r\n\r\n function getMilestoneName(milestoneId) {\r\n var result = '';\r\n if (milestoneId != null) {\r\n for(var i = 0; i < vm.Milestones.length; ++i){\r\n if(vm.Milestones[i].MilestoneId === milestoneId){\r\n result = vm.Milestones[i].Name;\r\n break;\r\n }\r\n }\r\n }\r\n \r\n return result;\r\n } \r\n\r\n function IsDueDate(date){\r\n var retVal = false;\r\n if ( vm.pathwayScheduleSampleResult != null && vm.pathwayScheduleSampleResult.DueDates != undefined){\r\n vm.pathwayScheduleSampleResult.DueDates.forEach(function(dueDateStr){\r\n var dueDate = new Date(dueDateStr)\r\n if ( dueDate.setHours(0,0,0,0) === date.setHours(0,0,0,0) ){ //compare date without time\r\n retVal = true;\r\n }\r\n });\r\n }\r\n return retVal;\r\n }\r\n\r\n function GetDaysInMonth(month,year) {\r\n return new Date(year, month+1, 0).getDate();\r\n }\r\n\r\n function GetTodayLocalMidnight(){\r\n var today = new Date ();\r\n var todayLocalMidnight = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0);\r\n return todayLocalMidnight;\r\n }\r\n\r\n function AddDays( date, days ){\r\n var retVal = null;\r\n var day = date.getDate();\r\n var month = date.getMonth();\r\n var year = date.getFullYear();\r\n var daysInMonth = GetDaysInMonth(month, year);\r\n\r\n if ( (day + days) <= daysInMonth ){\r\n day = day + days;\r\n retVal = new Date(year, month, day);\r\n }\r\n else{\r\n day = (day + days) - daysInMonth;\r\n month++;\r\n if(month > 11){\r\n month = 0;\r\n year++;\r\n } \r\n retVal = new Date(year, month, day);\r\n }\r\n return retVal;\r\n }\r\n\r\n function getUtcDateAsString(date){\r\n // avoid json serialization using browser timezone when converting to UTC \r\n return moment(date).format('YYYY-MM-DD[T00:00:00.000Z]'); \r\n }\r\n\r\n function getUtcPlusLocalOffsetDate(dateString){\r\n var utc = new Date(dateString);\r\n var utcPlusOffset = new Date( utc.setMinutes( utc.getTimezoneOffset()));\r\n return utcPlusOffset;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Event Handlers\r\n vm.onChange = onChange;\r\n var pendingRefresh = false;\r\n function onChange(){\r\n if (pendingRefresh) {\r\n $timeout.cancel(pendingRefresh);\r\n };\r\n pendingRefresh = $timeout(function() {\r\n buildCalendar();\r\n $scope.$parent.actionData.Schedule = vm.NewSchedule;\r\n pendingRefresh = false;\r\n }, 100);\r\n }\r\n\r\n vm.StartEditMode = false;\r\n vm.toggleStartEditMode = function(){\r\n vm.StartEditMode = !vm.StartEditMode;\r\n if(vm.StartEditMode){\r\n setTimeout(function(){\r\n document.getElementById(\"StartEdit\").focus()\r\n },0);\r\n }\r\n }\r\n\r\n vm.LateEditMode = false;\r\n vm.toggleLateEditMode = function(){\r\n vm.LateEditMode = !vm.LateEditMode;\r\n if(vm.LateEditMode){\r\n setTimeout(function(){\r\n document.getElementById(\"LateEdit\").focus()\r\n },0);\r\n }\r\n }\r\n\r\n vm.EndEditMode = false;\r\n vm.toggleEndEditMode = function(){\r\n vm.EndEditMode = !vm.EndEditMode;\r\n if(vm.EndEditMode){\r\n setTimeout(function(){\r\n document.getElementById(\"EndEdit\").focus()\r\n },0);\r\n }\r\n }\r\n\r\n //#endregion\r\n}\r\n \r\nangular.module('content.schedule').controller('ScheduleController', ScheduleController);\r\n","function schedule($filter, uibDateParser, ConfigurationsService, $uibModal) {\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n schedule: '=',\r\n scheduleChanged: '&',\r\n templateName: '=',\r\n isDisabled: '='\r\n },\r\n templateUrl: 'modules/content/careplan_editor/components/schedule/scheduleedit.tpl.html',\r\n controllerAs: 'vm',\r\n controller: function ($scope, ScheduleService, PatientSurveyService) {\r\n\r\n var vm = this;\r\n\r\n angular.element(document).find('schedule').addClass($scope.isDisabled === true ? 'element-disabled' : '');\r\n\r\n vm.dateFormat = ConfigurationsService.configParams.DateFormat;\r\n\r\n vm.schedule = getSchedule($scope.schedule);\r\n\r\n $scope.$watch(\"schedule.PatientSurveyScheduleId\", function () {\r\n if ($scope.schedule && $scope.schedule.PatientSurveyScheduleId > 0) {\r\n vm.schedule = getSchedule($scope.schedule);\r\n }\r\n });\r\n\r\n $scope.$watch(\"schedule.SurveyScheduleId\", function () {\r\n if ($scope.schedule && $scope.schedule.SurveyScheduleId > 0) {\r\n vm.schedule = getSchedule($scope.schedule);\r\n }\r\n });\r\n\r\n ScheduleService.getMilestones().then(function(response){\r\n $scope.milestones = response.data;\r\n vm.schedule = getSchedule($scope.schedule);\r\n });\r\n\r\n function getSchedule(schedule) {\r\n var result = null;\r\n if (schedule) {\r\n result = schedule;\r\n result.description = getScheduleDescription(result);\r\n }\r\n else {\r\n result = {\r\n description: 'Not set'\r\n };\r\n }\r\n return result;\r\n };\r\n\r\n function getScheduleDescription(schedule){\r\n return $filter('schedule')(schedule, getMilestoneName(schedule.MilestoneId));\r\n }\r\n\r\n function getMilestoneName(milestoneId) {\r\n var result = '';\r\n if(!$scope.milestones) {\r\n return result;\r\n }\r\n if(!milestoneId) {\r\n return result;\r\n };\r\n for(var i = 0; i <$scope.milestones.length; ++i){\r\n if($scope.milestones[i].MilestoneId === milestoneId){\r\n result = $scope.milestones[i].Name;\r\n break;\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n function saveSchedule(schedule) {\r\n if (!isTemplate(schedule)) {\r\n PatientSurveyService.savePatientSurveySchedule(schedule);\r\n }\r\n }\r\n\r\n $scope.OpenEditModal = $scope.isDisabled === true ? () => {} : function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/components/schedule/schedule.modal.html',\r\n controller: 'ScheduleModalController as vm',\r\n animation: false,\r\n backdrop: 'static',\r\n keyboard: false,\r\n size: 'lg',\r\n resolve: {\r\n scheduleToEdit: vm.schedule,\r\n isTemplate: isTemplate(vm.schedule),\r\n milestones: function(){\r\n return $scope.milestones;\r\n },\r\n templateInfo: {name: $scope.templateName},\r\n returnToSurveyEdit: true\r\n }\r\n });\r\n modalInstance.result.then(function (scheduleData) {\r\n vm.schedule = getSchedule(scheduleData);\r\n $scope.scheduleChanged({ schedule: vm.schedule });\r\n saveSchedule(vm.schedule);\r\n }, function () {});\r\n }\r\n\r\n function isTemplate(schedule) {\r\n return schedule.SurveyScheduleId > 0;\r\n }\r\n\r\n }\r\n };\r\n}\r\nangular.module('content.schedule').directive('schedule', schedule);","/**\r\n * @ngdoc filter\r\n * @name carplan_editor.schedule.filter:scheduleFilter\r\n * @requires lodash\r\n * @function\r\n * @description filter to format schedule into user friendly text\r\n * @param {Object} schedule, schedule to format. either PatientSurvey's or Template's schedules\r\n * @param {string=} milestoneName, a name of a milestone if this is needed in the description\r\n * @param {string=} part, [null | start | end | recurrence | time], which part of the description you want. If null or missing returns entire description.\r\n * @example\r\n *

      {{vm.schedule | schedule}}

      \r\n * would output: \"Daily @ 9:00 AM\" or \"From program day 2 until 5 days before end of program, weekly on Mondays, Tuesdays and Thursdays @ 8:30 AM\" etc.\r\n */\r\nfunction ScheduleFilter($filter, lodash) {\r\n\r\n return function (input, milestoneName, part) {\r\n var result = '';\r\n\r\n if (!input) {\r\n return result;\r\n }\r\n\r\n if (!milestoneName) {\r\n milestoneName = '';\r\n }\r\n\r\n if ( input.hasOwnProperty('StartDateType') ) {\r\n // check inputs\r\n input.StartDateType = parseInt(input.StartDateType);\r\n input.StartDateSubType = parseInt(input.StartDateSubType);\r\n input.EndDateType = parseInt(input.EndDateType);\r\n input.EndDateSubType = parseInt(input.EndDateSubType);\r\n input.RecurrenceType = parseInt(input.RecurrenceType);\r\n input.RecurrenceSubType = parseInt(input.RecurrenceSubType);\r\n\r\n if(!part || part == '' || part == 'all'){\r\n // From [Start Date Phrase] Until [End Date Phrase], [Recurrence Phrase] @ [Time Phrase]\r\n result = [startDatePhrase(input, milestoneName), endDatePhrase(input, milestoneName)].join(' ').trim();\r\n if(result != ''){\r\n result += ', ';\r\n }\r\n result += recurrencePhrase(input) + ' @ ' + timePhrase(input);\r\n }\r\n switch(part){\r\n case 'start':\r\n result = startDatePhrase(input, milestoneName);\r\n if(result == ''){\r\n result = 'Immediately';\r\n }\r\n break;\r\n case 'end':\r\n result = endDatePhrase(input, milestoneName);\r\n if(result == ''){\r\n result = 'None';\r\n }\r\n break;\r\n case 'recurrence':\r\n result = recurrencePhrase(input);\r\n break;\r\n case 'time':\r\n result = timePhrase(input);\r\n break;\r\n }\r\n result = result[0].toUpperCase() + result.slice(1); // capitalize first letter\r\n }\r\n return result;\r\n };\r\n\r\n function timePhrase(schedule) {\r\n var result = $filter('date')(new Date('1900/01/01 ' + schedule.SchedulePromptTimeOfDay), 'shortTime');\r\n return result;\r\n }\r\n\r\n function startDatePhrase(schedule, milestoneName) {\r\n var result = 'From ';\r\n\r\n switch(schedule.StartDateType) {\r\n case 1: // Immediate\r\n result = '';\r\n break;\r\n case 2: // ProgramDay\r\n switch(schedule.StartDateSubType) {\r\n case 1: // OnProgramDay\r\n result += 'program day ' + schedule.StartDateInterval;\r\n break;\r\n case 2: // DaysBeforeEndOfProgram\r\n result += schedule.StartDateInterval + ' ' + numericalForm('day', schedule.StartDateInterval) + ' before end of program';\r\n break;\r\n case 3: // ProgramEndDate\r\n result += 'program end date';\r\n break;\r\n case 4: // ProgramStartDate\r\n result += 'program start date';\r\n break;\r\n }\r\n break;\r\n case 3: // MilestoneDay\r\n result += schedule.StartDateInterval + \r\n ' ' + numericalForm('day', schedule.StartDateInterval) + \r\n ' ' + (schedule.StartDateSubType == 1 ? 'before' : 'after') + \r\n ' ' + milestoneName;\r\n break;\r\n case 4: // SpecificDate\r\n result += schedule.StartDateValue ? $filter('datetime')(schedule.StartDateValue, 'shortDate', 'UTC') : 'Specific Date';\r\n break;\r\n case 5: // DayOfWeek\r\n result = 'On or after the first ';\r\n var days = [];\r\n if(schedule.StartDateMonday) { days.push('Monday'); }\r\n if(schedule.StartDateTuesday) { days.push('Tuesday'); }\r\n if(schedule.StartDateWednesday) { days.push('Wednesday');}\r\n if(schedule.StartDateThursday) { days.push('Thursday'); }\r\n if(schedule.StartDateFriday) { days.push('Friday'); }\r\n if(schedule.StartDateSaturday) { days.push('Saturday'); }\r\n if(schedule.StartDateSunday) { days.push('Sunday'); }\r\n \r\n if(days.length > 2) {\r\n days = days.map(function(day) { \r\n return day.substring(0, 2); // just use first two letters of day name\r\n }); \r\n }\r\n\r\n var startDayOfWeekPhrase = '';\r\n if(days.length < 3) {\r\n startDayOfWeekPhrase = days.join(' or ');\r\n }\r\n else {\r\n startDayOfWeekPhrase = lodash.initial(days).join(', ') + ' or ' + lodash.last(days);\r\n }\r\n \r\n result += startDayOfWeekPhrase;\r\n\r\n if(schedule.StartDateInterval > 0) {\r\n result += ' in ' + schedule.StartDateInterval + ' ' + numericalForm('week', schedule.StartDateInterval);\r\n }\r\n\r\n break;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function recurrencePhrase(schedule) {\r\n var result = '';\r\n switch(schedule.RecurrenceType) {\r\n case 1: // Daily\r\n switch(schedule.RecurrenceSubType){\r\n case 1: // EveryXDay\r\n if(schedule.RecurrenceInterval == 1) {\r\n result = 'daily';\r\n }\r\n else {\r\n result += 'every ' + schedule.RecurrenceInterval + ' ' + numericalForm('day', schedule.RecurrenceInterval);\r\n }\r\n break;\r\n case 2: // Weekdays\r\n result += 'every weekday';\r\n break;\r\n }\r\n break;\r\n case 2: // Weekly\r\n if(schedule.RecurrenceInterval == 1){\r\n result += 'weekly on ';\r\n }\r\n else {\r\n result += 'every ' + schedule.RecurrenceInterval + ' weeks on ';\r\n }\r\n switch(schedule.RecurrenceSubType){\r\n case 1: // PathwayStartDay\r\n result += 'the day the pathway started';\r\n break;\r\n case 2: // OnWeekDays\r\n var days = [];\r\n if(schedule.RecurrenceMonday) { days.push('Monday'); }\r\n if(schedule.RecurrenceTuesday) { days.push('Tuesday'); }\r\n if(schedule.RecurrenceWednesday) { days.push('Wednesday');}\r\n if(schedule.RecurrenceThursday) { days.push('Thursday'); }\r\n if(schedule.RecurrenceFriday) { days.push('Friday'); }\r\n if(schedule.RecurrenceSaturday) { days.push('Saturday'); }\r\n if(schedule.RecurrenceSunday) { days.push('Sunday'); }\r\n \r\n if(days.length > 2) {\r\n days = days.map(function(day) { \r\n return day.substring(0, 2); // just use first two letters of day name\r\n }); \r\n }\r\n \r\n var recurrenceDayOfWeekPhrase = '';\r\n if(days.length < 3) {\r\n recurrenceDayOfWeekPhrase = days.join(' and ');\r\n }\r\n else {\r\n recurrenceDayOfWeekPhrase = lodash.initial(days).join(', ') + ' and ' + lodash.last(days);\r\n }\r\n \r\n result += recurrenceDayOfWeekPhrase;\r\n break;\r\n }\r\n break;\r\n case 3: // Monthly\r\n if(schedule.RecurrenceInterval == 1){\r\n result += 'monthly on ';\r\n }\r\n else {\r\n result += 'every ' + schedule.RecurrenceInterval + ' months on ';\r\n }\r\n switch(schedule.RecurrenceSubType){\r\n case 1: // PathwayStartDay\r\n result += 'the day the pathway started';\r\n break;\r\n case 2: // DayOfMonth\r\n result += 'the ' + ordinalSuffix(schedule.RecurrenceDayOfMonth) + ' day of the month';\r\n break;\r\n case 3: // OrdinalDay\r\n var ordinal = schedule.RecurrenceOrdinal == 5 ? 'last' : ordinalSuffix(schedule.RecurrenceOrdinal);\r\n var weekDays = new Array(7);\r\n weekDays[0] = \"Sunday\";\r\n weekDays[1] = \"Monday\";\r\n weekDays[2] = \"Tuesday\";\r\n weekDays[3] = \"Wednesday\";\r\n weekDays[4] = \"Thursday\";\r\n weekDays[5] = \"Friday\";\r\n weekDays[6] = \"Saturday\"; \r\n result += 'the ' + ordinal + ' ' + weekDays[schedule.RecurrenceOrdinalDay] + ' of the month';\r\n break;\r\n }\r\n break;\r\n\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function endDatePhrase(schedule, milestoneName) {\r\n var result = 'until ';\r\n switch(schedule.EndDateType) {\r\n case 1: // None\r\n result = '';\r\n break;\r\n case 2: // After\r\n switch(schedule.EndDateSubType){\r\n case 1: // CompletedXTimes\r\n result += 'completed ' + schedule.EndDateInterval + ' ' + numericalForm('time', schedule.EndDateInterval) + ' by patient';\r\n break;\r\n case 2: // PlayedXTimes\r\n result += 'presented ' + schedule.EndDateInterval + ' ' + numericalForm('time', schedule.EndDateInterval) + ' to patient';\r\n break;\r\n }\r\n break;\r\n case 3: // ProgramDay\r\n switch(schedule.EndDateSubType){\r\n case 1: // OnProgramDay\r\n result += 'program day ' + schedule.EndDateInterval;\r\n break;\r\n case 2: // DaysBeforeEndOfProgram\r\n result += schedule.EndDateInterval + ' ' + numericalForm('day', schedule.EndDateInterval) + ' before end of program';\r\n break;\r\n case 3: // ProgramEndDate\r\n result += 'program end date';\r\n }\r\n break;\r\n case 4: // SpecificDate\r\n switch(schedule.EndDateSubType){\r\n case 1: // \r\n result += schedule.EndDateValue ? $filter('datetime')(schedule.EndDateValue, 'shortDate', 'UTC') : 'Specific Date';\r\n break;\r\n case 2: // \r\n result += schedule.EndDateInterval + ' calendar ' + numericalForm('day', schedule.EndDateInterval) + ' after pathway start date';\r\n break;\r\n }\r\n break;\r\n case 5: // MilestoneDay\r\n result += schedule.EndDateInterval + \r\n ' ' + numericalForm('day', schedule.EndDateInterval) + \r\n ' ' + (schedule.EndDateSubType == 1 ? 'before' : 'after') + \r\n ' ' + milestoneName;\r\n break;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function numericalForm(text, count) {\r\n if(count != 1) {\r\n text += 's';\r\n }\r\n return text;\r\n }\r\n\r\n function ordinalSuffix(number) {\r\n var byTen = number % 10,\r\n byHundred = number % 100;\r\n if (byTen == 1 && byHundred != 11) {\r\n return number + \"st\";\r\n }\r\n if (byTen == 2 && byHundred != 12) {\r\n return number + \"nd\";\r\n }\r\n if (byTen == 3 && byHundred != 13) {\r\n return number + \"rd\";\r\n }\r\n return number + \"th\";\r\n }\r\n\r\n}\r\n\r\nangular.module('content.schedule').filter('schedule', ScheduleFilter);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/components/schedule/schedule.modal.html',\n '

      Pathway Schedule: {{vm.templateInfo.name}}

       Pathway Times
      {{vm.schedule.DueTime.StartMinutesBeforePromptTime | date:\\'shortTime\\'}}
      Mins
      {{vm.schedule.DueTime.LateMinutesAfterPromptTime | date:\\'shortTime\\'}}
      Mins
      {{vm.schedule.DueTime.EndMinutesAfterPromptTime | date:\\'shortTime\\'}}
      Mins
        Start Date
      {{vm.schedule.description.start}}
      0\" tooltip-popup-delay=\"700\" uib-tooltip=\"{{vm.schedule.StartDate.MilestoneDay.Description}}\" tooltip-placement=\"left\">
      Program Day Cannot be less than 2
      Value cannot be less than 0
      Program duration cannot be less than 1 day
      Program duration cannot be less than 1 day
      Value cannot be less than 0
       
      Days before or after cannot be less than 0
      {{(vm.scheduleToEdit.StartDate | datetime:\"date\":\"UTC\") || \\'None\\'}}
       Recurrence
      {{vm.schedule.description.recurrence}}
      Value cannot be less than 1
      Value cannot be less than 1
      Value cannot be less than 1
      Value must be between 1 and 31
       
       End Date
      {{vm.schedule.description.end}}
      0\" tooltip-popup-delay=\"700\" uib-tooltip=\"{{vm.schedule.EndDate.MilestoneDay.Description}}\" tooltip-placement=\"left\">
      Value must be greater than 1
      Value must be greater than 1
      Value must be 1 or greater
      Value cannot be lower than 0
      Value cannot be lower than 1
      Value cannot be lower than 1
      Value cannot be lower than 0
       
      Days before or after cannot be less than 0
      {{(vm.scheduleToEdit.EndDate | datetime:\"date\":\"UTC\") || \\'None\\'}}
      Sample Schedule
      Schedule not valid
      Date Added: {{vm.SampleCalendar.PathwayAdded}} Milestone: {{vm.SampleCalendar.MilestoneDate}}
      Start Date: {{vm.SampleCalendar.StartDate}}
      First Date: {{vm.SampleCalendar.FirstDueDate}}
      End Date: {{vm.SampleCalendar.EndDate}}
      {{month.Name}}
      SuMoTuWeThFrSa
      ');\n}]);\n}(window, document, window.angular));","function ScheduleService($http) {\r\n\r\n function getMilestones() {\r\n return $http({\r\n methode: 'GET',\r\n url: '/api/Milestone',\r\n });\r\n }\r\n\r\n function getMilestone(milestoneId) {\r\n return $http({\r\n methode: 'GET',\r\n url: '/api/Milestone/' + milestoneId,\r\n });\r\n }\r\n \r\n function CreateMilestone(milestone){\r\n return $http.post(\"/api/Milestone\", JSON.stringify(milestone)); \r\n }\r\n function DeleteMilestone(milestoneId){\r\n return $http.delete(\"/api/Milestone?milestoneId=\"+milestoneId); \r\n }\r\n function UpdateMilestone(milestone){\r\n return $http.put(\"/api/Milestone\",JSON.stringify(milestone));\r\n }\r\n\r\n function ComputeSampleSchedule(pathwayScheduleSample){\r\n return $http.post(\"/api/SurveySchedule/SampleSchedule\", pathwayScheduleSample).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getMilestones:getMilestones,\r\n getMilestone:getMilestone,\r\n CreateMilestone:CreateMilestone,\r\n DeleteMilestone:DeleteMilestone,\r\n UpdateMilestone:UpdateMilestone,\r\n ComputeSampleSchedule:ComputeSampleSchedule\r\n };\r\n\r\n}\r\n\r\nangular.module(\"content.schedule\").factory(\"ScheduleService\", ScheduleService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/components/schedule/scheduleedit.tpl.html',\n '
      Schedule
      {{vm.schedule.description}}
      ');\n}]);\n}(window, document, window.angular));","//\"use strict\";\r\n\r\nfunction ScheduleModalController($uibModalInstance, milestones, scheduleToEdit, isTemplate, templateInfo, ConfigurationsService, $filter, ScheduleService, $timeout, $scope, PermissionService, $state, $stateParams, PatientSurveyService, returnToSurveyEdit) {\r\n\r\n var vm = this;\r\n var userCanEditLockedPathways = PermissionService.userHasPermission([\"CanEditLockedPathways\"]);\r\n\r\n\r\n init();\r\n\r\n loadSchedule();\r\n\r\n //#region Initialization\r\n function init() {\r\n\r\n initViewModel();\r\n\r\n initSchedule();\r\n\r\n initCalendar();\r\n\r\n initTooltips();\r\n }\r\n\r\n function initViewModel() {\r\n // init parameters\r\n vm.Milestones = milestones;\r\n vm.scheduleToEdit = scheduleToEdit;\r\n vm.isTemplate = isTemplate;\r\n vm.templateInfo = templateInfo;\r\n \r\n // New recurrence options were added in v5.7. These options need to added to the APK and thus will\r\n // be disabled in the portal until the APK is updated for the customer.\r\n vm.ShowNewRecurrenceOptions = ConfigurationsService.configParams.AdvancedPathwayScheduling;\r\n vm.monthFirstFormat = (\"MM/dd/yyyy\" == ConfigurationsService.configParams.DateFormat);\r\n\r\n vm.helpUrl = ConfigurationsService.configParams.HelpUrl;\r\n ///\"https://help.vivifyhealth.com/Vivify/v53/Content/Pathways/Add%20a%20Pathway%20Schedule.htm?Highlight=pathway#Pathways\";\r\n vm.StartDateHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/Pathways/Pathway%20Scheduling.htm#Start\");\r\n vm.RecurrenceHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/Pathways/Pathway%20Scheduling.htm#Recurrence\");\r\n vm.EndDateHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/Pathways/Pathway%20Scheduling.htm#End\");\r\n\r\n if(!vm.isTemplate){\r\n // different help link of viewing from the patient vs content\r\n vm.RecurrenceHelp = vm.helpUrl.replace(\"Default.htm\", \"Content/Pathways/Add%20a%20Pathway%20to%20Patient.htm#Step2\");\r\n }\r\n\r\n\r\n vm.IsValid = true;\r\n\r\n return vm;\r\n }\r\n\r\n function initSchedule(){\r\n vm.schedule = {};\r\n vm.schedule.DefaultProgramDuration = 90;\r\n\r\n initMilestoneId();\r\n \r\n vm.schedule.DueTime = {};\r\n vm.schedule.DueTime.SchedulePromptTimeOfDay = null;\r\n vm.schedule.DueTime.StartMinutesBeforePrompt = null;\r\n vm.schedule.DueTime.LateMinutesAfterPrompt = null;\r\n vm.schedule.DueTime.EndMinutesAfterPrompt = null;\r\n \r\n vm.schedule.StartDate = {};\r\n vm.schedule.StartDate.Type = 1;\r\n \r\n vm.schedule.StartDate.Immediate = {};\r\n \r\n vm.schedule.StartDate.ProgramDay = {};\r\n vm.schedule.StartDate.ProgramDay.HelpTopic = \"pathway#Pathways\";\r\n vm.schedule.StartDate.ProgramDay.Type = 1;\r\n vm.schedule.StartDate.ProgramDay.Day = 2;\r\n vm.schedule.StartDate.ProgramDay.DaysBefore = 1;\r\n vm.schedule.StartDate.ProgramDay.v56Logic = false; //for migration to v5.7 and to keep old logic\r\n \r\n vm.schedule.StartDate.MilestoneDay = {};\r\n vm.schedule.StartDate.MilestoneDay.HelpTopic = \"pathway#Pathways2\";\r\n vm.schedule.StartDate.MilestoneDay.Day = 1;\r\n vm.schedule.StartDate.MilestoneDay.Before = 1;\r\n vm.schedule.StartDate.MilestoneDay.Recompute = true;\r\n \r\n vm.schedule.StartDate.SpecificDate = {};\r\n vm.schedule.StartDate.SpecificDate.HelpTopic = \"pathway#Adding\";\r\n vm.schedule.StartDate.SpecificDate.Date = null;\r\n \r\n vm.schedule.StartDate.DayOfWeek = {};\r\n vm.schedule.StartDate.DayOfWeek.Sunday = false;\r\n vm.schedule.StartDate.DayOfWeek.Monday = false;\r\n vm.schedule.StartDate.DayOfWeek.Tuesday = false;\r\n vm.schedule.StartDate.DayOfWeek.Wednesday = false;\r\n vm.schedule.StartDate.DayOfWeek.Thursday = false;\r\n vm.schedule.StartDate.DayOfWeek.Friday = false;\r\n vm.schedule.StartDate.DayOfWeek.Saturday = false;\r\n vm.schedule.StartDate.DayOfWeek.Weeks = 0;\r\n vm.schedule.StartDate.DayOfWeek.Delay = false;\r\n \r\n vm.schedule.RecurrencePattern = {};\r\n vm.schedule.RecurrencePattern.Type = 1;\r\n \r\n vm.schedule.RecurrencePattern.Daily = {};\r\n vm.schedule.RecurrencePattern.Daily.Type = 1;\r\n vm.schedule.RecurrencePattern.Daily.Days = 1;\r\n \r\n vm.schedule.RecurrencePattern.Weekly = {};\r\n vm.schedule.RecurrencePattern.Weekly.Weeks = 1;\r\n vm.schedule.RecurrencePattern.Weekly.Type = 2;\r\n vm.schedule.RecurrencePattern.Weekly.Sunday = false;\r\n vm.schedule.RecurrencePattern.Weekly.Monday = false;\r\n vm.schedule.RecurrencePattern.Weekly.Tuesday = false;\r\n vm.schedule.RecurrencePattern.Weekly.Wednesday = false;\r\n vm.schedule.RecurrencePattern.Weekly.Thursday = false;\r\n vm.schedule.RecurrencePattern.Weekly.Friday = false;\r\n vm.schedule.RecurrencePattern.Weekly.Saturday = false;\r\n \r\n vm.schedule.RecurrencePattern.Monthly = {};\r\n vm.schedule.RecurrencePattern.Monthly.Months = 1;\r\n vm.schedule.RecurrencePattern.Monthly.Type = 1;\r\n vm.schedule.RecurrencePattern.Monthly.DayOfMonth = 1;\r\n vm.schedule.RecurrencePattern.Monthly.Ordinal = 1;\r\n vm.schedule.RecurrencePattern.Monthly.OrdinalDay = 0; // Sunday = 0\r\n \r\n vm.schedule.EndDate = {};\r\n vm.schedule.EndDate.Type = 1;\r\n \r\n vm.schedule.EndDate.None = {};\r\n \r\n vm.schedule.EndDate.After = {};\r\n vm.schedule.EndDate.After.Type = 1;\r\n vm.schedule.EndDate.After.Completed = 1;\r\n vm.schedule.EndDate.After.Presented = 1;\r\n \r\n \r\n vm.schedule.EndDate.ProgramDay = {};\r\n vm.schedule.EndDate.ProgramDay.Type = 3;\r\n vm.schedule.EndDate.ProgramDay.Day = 30;\r\n vm.schedule.EndDate.ProgramDay.DaysBefore = 5;\r\n \r\n vm.schedule.EndDate.SpecificDate = {};\r\n vm.schedule.EndDate.SpecificDate.Date = null;\r\n vm.schedule.EndDate.SpecificDate.Type = 1;\r\n vm.schedule.EndDate.SpecificDate.Days = 0;\r\n \r\n vm.schedule.EndDate.MilestoneDay = {};\r\n vm.schedule.EndDate.MilestoneDay.HelpTopic = \"pathway#Pathways2\";\r\n vm.schedule.EndDate.MilestoneDay.Day = 1;\r\n vm.schedule.EndDate.MilestoneDay.Before = 1;\r\n vm.schedule.EndDate.MilestoneDay.Recompute = true;\r\n\r\n return vm.schedule;\r\n }\r\n\r\n function initMilestoneId() {\r\n vm.schedule.MilestoneId = null;\r\n\r\n if (vm.Milestones != null) {\r\n var activeMilestons = [];\r\n for(var i = 0; i < vm.Milestones.length; i++){\r\n if(vm.Milestones[i].IsEnabled === true){\r\n activeMilestons.push(vm.Milestones[i])\r\n }\r\n }\r\n vm.Milestones = activeMilestons;\r\n if (vm.Milestones.length > 0){\r\n vm.schedule.MilestoneId = vm.Milestones[0].MilestoneId;\r\n } \r\n }\r\n }\r\n\r\n function initCalendar() {\r\n vm.samplePathwayAdded = null;\r\n vm.SampleCalendar = {};\r\n vm.SampleCalendar.Months = [];\r\n vm.SampleCalendar.DateAdded = {};\r\n vm.SampleCalendar.Milestone = {};\r\n vm.SampleCalendar.StartDate = {};\r\n vm.SampleCalendar.FirstDate = {};\r\n vm.SampleCalendar.EndDate = {};\r\n vm.calendarLoaded = false;\r\n }\r\n\r\n function initTooltips() {\r\n\r\n // some tooltips are constant\r\n vm.schedule.DueTime.Description = \"During a calendar day, a pathway’s timing is dictated by four different time factors\";\r\n vm.schedule.DueTime.StartMinutesBeforePromptDescription = \"The amount of time before the Due Time that a patient can start a pathway. It is measured in minutes. For example, if the Start Time is set to 120 minutes, the patient can complete their pathway 2 hours before the Due Time.\"\r\n vm.schedule.DueTime.SchedulePromptTimeOfDayDescription = \"The time of day the patient is prompted to complete their pathway(s).\"\r\n vm.schedule.DueTime.LateMinutesAfterPromptDescription = \"The amount of time after the Due Time that a pathway is considered late. This is measured in minutes. At the Late Time, the patient is reminded to complete their pathway. For example, if the Late Time is set to 120 minutes and the patient has not completed their pathway, the patient will receive a reminder 120 minutes after the Due Time.\"\r\n vm.schedule.DueTime.EndMinutesAfterPromptDescription = \"This represents the amount of time after the Due Time that the pathway expires. It is measured in minutes. A pathway’s End Time cannot be set for later than 11:59 p.m. of the calendar day.\";\r\n\r\n vm.schedule.StartDate.Description = \"This represents the date the pathway first becomes active and available\";\r\n vm.schedule.StartDate.Immediate.Description = \"This is equivalent to Program Day 1. When a patient accepts their EULA, the patient will see this pathway immediately.\";\r\n vm.schedule.StartDate.ProgramDay.Description = \"This option is chosen when the pathway should start on a specific program day, a number of days before the program ends or on the Program End Date.\";\r\n vm.schedule.StartDate.MilestoneDay.Description = \"This option is only visible if a Milestone(s) (e.g., surgery date, hospital discharge date) has been configured in the Care Team Portal. The pathway will be scheduled based on the selected Milestone’s date within the patient’s record.\";\r\n vm.schedule.StartDate.SpecificDate.Description = \"This option is chosen when you want a pathway to start on a specific calendar day. If the pathway is configured to recompute the schedule when the patient’s program start date is changed, selecting this option will NOT recompute and the patient’s pathway schedule will NOT be updated.\";\r\n vm.schedule.StartDate.DayOfWeek.Description = \"Select this option when the pathway should start on a particular day of the week.\";\r\n\r\n vm.schedule.RecurrencePattern.Daily.Description = \"The pathway plays every X number of days or only on weekdays.\";\r\n vm.schedule.RecurrencePattern.Weekly.Description = \"The pathway will play every X number of weeks, every X number of weeks on the day the pathway first started or every X number of weeks on selected days of the week.\";\r\n vm.schedule.RecurrencePattern.Monthly.Description = \"The pathway will be played every X number of months, every X number of months on the day of the month the pathway first started, every X number of months on a selected day in the month or every X number of months on a specific day and week in the month.\";\r\n\r\n vm.schedule.EndDate.Description = \"This represents the day the pathway is discontinued – when the pathway will no longer be available to the patient\";\r\n vm.schedule.EndDate.None.Description = \"\";\r\n vm.schedule.EndDate.After.Description = \"This option will allow you to choose when the pathway will no longer be available to the patient, e.g., after the patient has completed it X time(s) or after the pathway has been presented X time(s).\";\r\n vm.schedule.EndDate.ProgramDay.Description = \"This option allows you to choose when you want the pathway to end on a specific program day, the number of days before the program ends or on the Program End Date.\";\r\n vm.schedule.EndDate.SpecificDate.Description = \"This option allows you to choose when you want a pathway to end on a calendar day or after a certain number of calendar days following the pathway start date.\";\r\n vm.schedule.EndDate.MilestoneDay.Description = \"The pathway’s conclusion is based on the selected Milestone’s date within the patient’s record (e.g., surgery date, hospital discharge date).\";\r\n\r\n vm.SampleCalendar.Description = \"This is a tool to assist the Content Administrator in setting the schedule for a pathway\";\r\n vm.SampleCalendar.DateAdded.Description = \"This represents the day the pathway was added to the patient to compute the sample schedule. You may click a different day in the calendar to change this date.\";\r\n vm.SampleCalendar.Milestone.Description = \"The milestone date for the patient used to compute this sample schedule. Click a day in the calendar to change this date.\";\r\n vm.SampleCalendar.StartDateDescription = \"The date the pathway first becomes active and available for a patient.\";\r\n vm.SampleCalendar.FirstDate.Description = \"The first date the pathway will play for the patient.\";\r\n vm.SampleCalendar.EndDateDescription = \"The last date the pathway is active for the patient.\";\r\n \r\n // some tooltips depend on whether it's a patient pathway or a template pathway\r\n if(vm.isTemplate) {\r\n \r\n\r\n }\r\n else {\r\n\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Load Schedule\r\n function loadSchedule() {\r\n\r\n loadDueTime();\r\n loadStartDate();\r\n loadRecurrencePattern();\r\n loadEndDate();\r\n \r\n return vm.schedule;\r\n }\r\n\r\n function loadDueTime(){\r\n vm.schedule.DueTime.SchedulePromptTimeOfDay = Date.parse('1900/01/01 ' + vm.scheduleToEdit.SchedulePromptTimeOfDay); //vm.scheduleToEdit.SchedulePromptTimeOfDay; \r\n vm.schedule.DueTime.StartMinutesBeforePrompt = vm.scheduleToEdit.StartMinutesBeforePrompt;\r\n vm.schedule.DueTime.LateMinutesAfterPrompt = vm.scheduleToEdit.LateMinutesAfterPrompt;\r\n vm.schedule.DueTime.EndMinutesAfterPrompt = vm.scheduleToEdit.EndMinutesAfterPrompt\r\n\r\n var minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.StartMinutesBeforePromptTime = minutes.setMinutes( minutes.getMinutes() - vm.schedule.DueTime.StartMinutesBeforePrompt);\r\n\r\n minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.LateMinutesAfterPromptTime = minutes.setMinutes( minutes.getMinutes() + vm.schedule.DueTime.LateMinutesAfterPrompt);\r\n\r\n minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.EndMinutesAfterPromptTime = minutes.setMinutes( minutes.getMinutes() + vm.schedule.DueTime.EndMinutesAfterPrompt);\r\n }\r\n\r\n function loadStartDate(){\r\n vm.schedule.StartDate.Type = vm.scheduleToEdit.StartDateType;\r\n if ( vm.scheduleToEdit.DefaultProgramDuration != 0){\r\n vm.schedule.DefaultProgramDuration = vm.scheduleToEdit.DefaultProgramDuration;\r\n }\r\n\r\n if (vm.scheduleToEdit.MilestoneId != null){\r\n vm.schedule.MilestoneId = vm.scheduleToEdit.MilestoneId;\r\n }\r\n\r\n switch(Number(vm.schedule.StartDate.Type)){\r\n case 1: //Immediate\r\n {\r\n break;\r\n }\r\n case 2: //Program Day\r\n {\r\n vm.schedule.StartDate.ProgramDay.Type = vm.scheduleToEdit.StartDateSubType;\r\n switch(Number(vm.schedule.StartDate.ProgramDay.Type)){\r\n case 1:\r\n {\r\n vm.schedule.StartDate.ProgramDay.Day = vm.scheduleToEdit.StartDateInterval;\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.schedule.StartDate.ProgramDay.DaysBefore = vm.scheduleToEdit.StartDateInterval;\r\n break;\r\n }\r\n }\r\n vm.schedule.StartDate.ProgramDay.Recompute = vm.scheduleToEdit.StartDateRecompute;\r\n vm.schedule.StartDate.ProgramDay.v56Logic = vm.scheduleToEdit.StartDateOldLogic; //for migration to v5.7 and to keep old logic\r\n break\r\n }\r\n case 3: // Milestone Day\r\n {\r\n vm.schedule.StartDate.MilestoneDay.Before = vm.scheduleToEdit.StartDateSubType;\r\n vm.schedule.StartDate.MilestoneDay.Day = vm.scheduleToEdit.StartDateInterval;\r\n vm.schedule.StartDate.MilestoneDay.Recompute = vm.scheduleToEdit.StartDateRecompute;\r\n break;\r\n }\r\n case 4: // Specific Date\r\n {\r\n if(vm.scheduleToEdit.StartDateValue != null) {\r\n vm.schedule.StartDate.SpecificDate.Date = getUtcPlusLocalOffsetDate(vm.scheduleToEdit.StartDateValue);\r\n }\r\n break;\r\n }\r\n case 5: // Day of Week\r\n {\r\n vm.schedule.StartDate.DayOfWeek.Sunday = vm.scheduleToEdit.StartDateSunday;\r\n vm.schedule.StartDate.DayOfWeek.Monday = vm.scheduleToEdit.StartDateMonday;\r\n vm.schedule.StartDate.DayOfWeek.Tuesday = vm.scheduleToEdit.StartDateTuesday;\r\n vm.schedule.StartDate.DayOfWeek.Wednesday = vm.scheduleToEdit.StartDateWednesday;\r\n vm.schedule.StartDate.DayOfWeek.Thursday = vm.scheduleToEdit.StartDateThursday;\r\n vm.schedule.StartDate.DayOfWeek.Friday = vm.scheduleToEdit.StartDateFriday;\r\n vm.schedule.StartDate.DayOfWeek.Saturday = vm.scheduleToEdit.StartDateSaturday;\r\n vm.schedule.StartDate.DayOfWeek.Weeks = vm.scheduleToEdit.StartDateInterval;\r\n if ( vm.schedule.StartDate.DayOfWeek.Weeks > 0 ){\r\n vm.schedule.StartDate.DayOfWeek.Delay = true;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function loadRecurrencePattern(){\r\n vm.schedule.RecurrencePattern.Type = vm.scheduleToEdit.RecurrenceType;\r\n switch(Number(vm.schedule.RecurrencePattern.Type)){\r\n case 1: // Daily\r\n {\r\n vm.schedule.RecurrencePattern.Daily.Type = vm.scheduleToEdit.RecurrenceSubType;\r\n vm.schedule.RecurrencePattern.Daily.Days = vm.scheduleToEdit.RecurrenceInterval;\r\n break;\r\n }\r\n case 2: // Weekly\r\n {\r\n vm.schedule.RecurrencePattern.Weekly.Type = vm.scheduleToEdit.RecurrenceSubType;\r\n vm.schedule.RecurrencePattern.Weekly.Weeks = vm.scheduleToEdit.RecurrenceInterval;\r\n vm.schedule.RecurrencePattern.Weekly.Sunday = vm.scheduleToEdit.RecurrenceSunday;\r\n vm.schedule.RecurrencePattern.Weekly.Monday = vm.scheduleToEdit.RecurrenceMonday;\r\n vm.schedule.RecurrencePattern.Weekly.Tuesday = vm.scheduleToEdit.RecurrenceTuesday;\r\n vm.schedule.RecurrencePattern.Weekly.Wednesday = vm.scheduleToEdit.RecurrenceWednesday;\r\n vm.schedule.RecurrencePattern.Weekly.Thursday = vm.scheduleToEdit.RecurrenceThursday;\r\n vm.schedule.RecurrencePattern.Weekly.Friday = vm.scheduleToEdit.RecurrenceFriday;\r\n vm.schedule.RecurrencePattern.Weekly.Saturday = vm.scheduleToEdit.RecurrenceSaturday; \r\n break;\r\n }\r\n case 3: // Monthly\r\n {\r\n vm.schedule.RecurrencePattern.Monthly.Type = vm.scheduleToEdit.RecurrenceSubType;\r\n vm.schedule.RecurrencePattern.Monthly.Months = vm.scheduleToEdit.RecurrenceInterval;\r\n vm.schedule.RecurrencePattern.Monthly.DayOfMonth = vm.scheduleToEdit.RecurrenceDayOfMonth;\r\n vm.schedule.RecurrencePattern.Monthly.Ordinal = vm.scheduleToEdit.RecurrenceOrdinal;\r\n vm.schedule.RecurrencePattern.Monthly.OrdinalDay = vm.scheduleToEdit.RecurrenceOrdinalDay; \r\n break;\r\n }\r\n }\r\n }\r\n\r\n function loadEndDate(){\r\n vm.schedule.EndDate.Type = vm.scheduleToEdit.EndDateType;\r\n switch(Number(vm.schedule.EndDate.Type)){\r\n case 1: //None\r\n {\r\n break;\r\n }\r\n case 2: // After\r\n {\r\n vm.schedule.EndDate.After.Type = vm.scheduleToEdit.EndDateSubType;\r\n switch(Number(vm.schedule.EndDate.After.Type)){\r\n case 1:\r\n {\r\n vm.schedule.EndDate.After.Completed = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.schedule.EndDate.After.Presented = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n case 3:\r\n {\r\n vm.schedule.EndDate.After.Days = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n } \r\n }\r\n case 3: //Program Day\r\n {\r\n vm.schedule.EndDate.ProgramDay.Type = vm.scheduleToEdit.EndDateSubType;\r\n vm.schedule.EndDate.ProgramDay.Recompute = vm.scheduleToEdit.EndDateRecompute;\r\n switch(Number(vm.schedule.EndDate.ProgramDay.Type)){\r\n case 1:\r\n {\r\n vm.schedule.EndDate.ProgramDay.Day = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.schedule.EndDate.ProgramDay.DaysBefore = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n }\r\n break\r\n }\r\n case 4: // Specific Date\r\n {\r\n vm.schedule.EndDate.SpecificDate.Type = vm.scheduleToEdit.EndDateSubType;\r\n switch(Number(vm.schedule.EndDate.SpecificDate.Type)){\r\n case 1:\r\n {\r\n vm.schedule.EndDate.SpecificDate.Date = getUtcPlusLocalOffsetDate(vm.scheduleToEdit.EndDateValue); \r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.schedule.EndDate.SpecificDate.Days = vm.scheduleToEdit.EndDateInterval;\r\n break;\r\n }\r\n } \r\n break\r\n }\r\n case 5: // Milestone Day\r\n {\r\n vm.schedule.EndDate.MilestoneDay.Before = vm.scheduleToEdit.EndDateSubType;\r\n vm.schedule.EndDate.MilestoneDay.Day = vm.scheduleToEdit.EndDateInterval;\r\n vm.schedule.EndDate.MilestoneDay.Recompute = vm.scheduleToEdit.EndDateRecompute;\r\n break;\r\n } \r\n\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Save Schedule\r\n function save(){\r\n vm.NewSchedule = {};\r\n saveDueTime();\r\n saveStartDate();\r\n saveRecurrencePattern();\r\n saveEndDate();\r\n }\r\n\r\n function saveDueTime(){\r\n vm.NewSchedule.SchedulePromptTimeOfDay = $filter('date')(vm.schedule.DueTime.SchedulePromptTimeOfDay, 'HH:mm:ss');\r\n vm.NewSchedule.StartMinutesBeforePrompt = vm.schedule.DueTime.StartMinutesBeforePrompt;\r\n vm.NewSchedule.LateMinutesAfterPrompt = vm.schedule.DueTime.LateMinutesAfterPrompt;\r\n vm.NewSchedule.EndMinutesAfterPrompt = vm.schedule.DueTime.EndMinutesAfterPrompt;\r\n\r\n // if any of these dont have values the schedule is not valid\r\n if(\r\n vm.NewSchedule.SchedulePromptTimeOfDay == undefined || \r\n vm.NewSchedule.StartMinutesBeforePrompt == undefined ||\r\n vm.NewSchedule.LateMinutesAfterPrompt == undefined ||\r\n vm.NewSchedule.EndMinutesAfterPrompt == undefined \r\n ){\r\n vm.IsValid = false;\r\n }\r\n }\r\n\r\n function saveStartDate(){\r\n if( vm.schedule.DefaultProgramDuration > 0){\r\n vm.NewSchedule.DefaultProgramDuration = vm.schedule.DefaultProgramDuration; // same value is used for start date and end date fields.\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n\r\n // user override on patient schedule\r\n if(!vm.isTemplate && vm.schedule.StartDate.SpecificDate.Date) {\r\n vm.schedule.StartDate.Type = 4; // specific date\r\n vm.NewSchedule.StartDate = vm.schedule.StartDate.SpecificDate.Date;\r\n } \r\n\r\n vm.NewSchedule.MilestoneId = null; // same value us used for start date and end date fields.\r\n vm.NewSchedule.StartDateType = vm.schedule.StartDate.Type;\r\n vm.NewSchedule.StartDateSubType = 1;\r\n vm.NewSchedule.StartDateRecompute = false;\r\n vm.NewSchedule.StartDateValue = null;\r\n vm.NewSchedule.StartDateSunday = false;\r\n vm.NewSchedule.StartDateMonday = false;\r\n vm.NewSchedule.StartDateTuesday = false;\r\n vm.NewSchedule.StartDateWednesday = false;\r\n vm.NewSchedule.StartDateThursday = false;\r\n vm.NewSchedule.StartDateFriday = false;\r\n vm.NewSchedule.StartDateSaturday = false;\r\n vm.NewSchedule.StartDateInterval = 0;\r\n\r\n switch(Number(vm.schedule.StartDate.Type)){\r\n case 1: //Immediate\r\n {\r\n if(vm.schedule.EndDate.Type == 5) {\r\n vm.NewSchedule.StartDateRecompute = vm.schedule.StartDate.MilestoneDay.Recompute;\r\n }\r\n break;\r\n }\r\n case 2: //Program Day\r\n {\r\n vm.NewSchedule.StartDateSubType = vm.schedule.StartDate.ProgramDay.Type;\r\n vm.NewSchedule.StartDateRecompute = vm.schedule.StartDate.ProgramDay.Recompute;\r\n switch(Number(vm.schedule.StartDate.ProgramDay.Type)){\r\n case 1: // On Program day X\r\n {\r\n if( vm.schedule.StartDate.ProgramDay.Day >= 2){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.ProgramDay.Day;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n case 2: // X day(s) before end of program\r\n {\r\n if(vm.schedule.StartDate.ProgramDay.DaysBefore >= 0 && vm.schedule.StartDate.ProgramDay.DaysBefore != null){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.ProgramDay.DaysBefore;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n case 3: // Program End Date\r\n {\r\n break;\r\n }\r\n }\r\n vm.NewSchedule.StartDateOldLogic = vm.schedule.StartDate.ProgramDay.v56Logic;\r\n break\r\n }\r\n case 3: // Milestone Day\r\n {\r\n vm.NewSchedule.MilestoneId = vm.schedule.MilestoneId; // same value us used for start date and end date fields.\r\n vm.NewSchedule.StartDateSubType = vm.schedule.StartDate.MilestoneDay.Before;\r\n vm.NewSchedule.StartDateRecompute = vm.schedule.StartDate.MilestoneDay.Recompute;\r\n if( vm.schedule.StartDate.MilestoneDay.Day >= 0 && vm.schedule.StartDate.MilestoneDay.Day != null){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.MilestoneDay.Day;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n case 4: // Specific Date\r\n {\r\n if ( vm.schedule.StartDate.SpecificDate.Date != null){\r\n vm.NewSchedule.StartDateValue = getUtcDateAsString(vm.schedule.StartDate.SpecificDate.Date);\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break\r\n }\r\n case 5: // Day of Week\r\n {\r\n if( vm.schedule.StartDate.DayOfWeek.Weeks >= 0 && vm.schedule.StartDate.DayOfWeek.Weeks != null){\r\n if (vm.schedule.StartDate.DayOfWeek.Delay){\r\n vm.NewSchedule.StartDateInterval = vm.schedule.StartDate.DayOfWeek.Weeks;\r\n }\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n \r\n if(IsStartDayChecked()){\r\n vm.NewSchedule.StartDateSunday = vm.schedule.StartDate.DayOfWeek.Sunday;\r\n vm.NewSchedule.StartDateMonday = vm.schedule.StartDate.DayOfWeek.Monday;\r\n vm.NewSchedule.StartDateTuesday = vm.schedule.StartDate.DayOfWeek.Tuesday;\r\n vm.NewSchedule.StartDateWednesday = vm.schedule.StartDate.DayOfWeek.Wednesday;\r\n vm.NewSchedule.StartDateThursday = vm.schedule.StartDate.DayOfWeek.Thursday;\r\n vm.NewSchedule.StartDateFriday = vm.schedule.StartDate.DayOfWeek.Friday;\r\n vm.NewSchedule.StartDateSaturday = vm.schedule.StartDate.DayOfWeek.Saturday;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n } \r\n }\r\n }\r\n\r\n function IsStartDayChecked(){\r\n var retVal = false;\r\n if( vm.schedule.StartDate.DayOfWeek.Sunday ||\r\n vm.schedule.StartDate.DayOfWeek.Monday ||\r\n vm.schedule.StartDate.DayOfWeek.Tuesday ||\r\n vm.schedule.StartDate.DayOfWeek.Wednesday ||\r\n vm.schedule.StartDate.DayOfWeek.Thursday ||\r\n vm.schedule.StartDate.DayOfWeek.Friday ||\r\n vm.schedule.StartDate.DayOfWeek.Saturday ){\r\n retVal = true;\r\n }\r\n return retVal;\r\n }\r\n\r\n function saveRecurrencePattern(){\r\n vm.NewSchedule.RecurrenceType = vm.schedule.RecurrencePattern.Type;\r\n vm.NewSchedule.RecurrenceSubType = 1;\r\n vm.NewSchedule.RecurrenceInterval = 1;\r\n vm.NewSchedule.RecurrenceDayOfMonth = 1;\r\n vm.NewSchedule.RecurrenceSunday = false;\r\n vm.NewSchedule.RecurrenceMonday = false;\r\n vm.NewSchedule.RecurrenceTuesday = false;\r\n vm.NewSchedule.RecurrenceWednesday = false;\r\n vm.NewSchedule.RecurrenceThursday = false;\r\n vm.NewSchedule.RecurrenceFriday = false;\r\n vm.NewSchedule.RecurrenceSaturday = false;\r\n vm.NewSchedule.RecurrenceOrdinal = 1;\r\n vm.NewSchedule.RecurrenceOrdinalDay = 1;\r\n\r\n switch(Number(vm.schedule.RecurrencePattern.Type)){\r\n case 1: // Daily\r\n {\r\n vm.NewSchedule.RecurrenceSubType = vm.schedule.RecurrencePattern.Daily.Type;\r\n switch(Number(vm.schedule.RecurrencePattern.Daily.Type)){\r\n case 1: // Every X day(s)\r\n {\r\n if( vm.schedule.RecurrencePattern.Daily.Days >= 1){\r\n vm.NewSchedule.RecurrenceInterval = vm.schedule.RecurrencePattern.Daily.Days;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n case 2: // Every Weekday\r\n {\r\n vm.NewSchedule.RecurrenceMonday = true;\r\n vm.NewSchedule.RecurrenceTuesday = true;\r\n vm.NewSchedule.RecurrenceWednesday = true;\r\n vm.NewSchedule.RecurrenceThursday = true;\r\n vm.NewSchedule.RecurrenceFriday = true;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case 2: // Weekly\r\n {\r\n vm.NewSchedule.RecurrenceSubType = vm.schedule.RecurrencePattern.Weekly.Type;\r\n if (vm.schedule.RecurrencePattern.Weekly.Weeks >= 1){\r\n vm.NewSchedule.RecurrenceInterval = vm.schedule.RecurrencePattern.Weekly.Weeks;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n\r\n switch(Number(vm.schedule.RecurrencePattern.Weekly.Type)){\r\n case 1: // on the day the pathway started\r\n {\r\n break;\r\n }\r\n case 2: // on Su Mo Tu We Th Fr Sa\r\n {\r\n if(IsRecurrenceDayChecked()){\r\n vm.NewSchedule.RecurrenceSunday = vm.schedule.RecurrencePattern.Weekly.Sunday;\r\n vm.NewSchedule.RecurrenceMonday = vm.schedule.RecurrencePattern.Weekly.Monday;\r\n vm.NewSchedule.RecurrenceTuesday = vm.schedule.RecurrencePattern.Weekly.Tuesday;\r\n vm.NewSchedule.RecurrenceWednesday = vm.schedule.RecurrencePattern.Weekly.Wednesday;\r\n vm.NewSchedule.RecurrenceThursday = vm.schedule.RecurrencePattern.Weekly.Thursday;\r\n vm.NewSchedule.RecurrenceFriday = vm.schedule.RecurrencePattern.Weekly.Friday;\r\n vm.NewSchedule.RecurrenceSaturday = vm.schedule.RecurrencePattern.Weekly.Saturday;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n } \r\n break;\r\n }\r\n case 3: // Monthly\r\n {\r\n vm.NewSchedule.RecurrenceSubType = vm.schedule.RecurrencePattern.Monthly.Type;\r\n if(vm.schedule.RecurrencePattern.Monthly.Months >= 1){\r\n vm.NewSchedule.RecurrenceInterval = vm.schedule.RecurrencePattern.Monthly.Months;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n \r\n switch(Number(vm.schedule.RecurrencePattern.Monthly.Type)){\r\n case 1: // the patwhay start date\r\n {\r\n break;\r\n }\r\n case 2: // day X of the month\r\n {\r\n if( vm.schedule.RecurrencePattern.Monthly.DayOfMonth >= 1 && vm.schedule.RecurrencePattern.Monthly.DayOfMonth <=31 ){\r\n vm.NewSchedule.RecurrenceDayOfMonth = vm.schedule.RecurrencePattern.Monthly.DayOfMonth;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n }\r\n case 3: // the XX DAY of the month\r\n {\r\n vm.NewSchedule.RecurrenceOrdinal = vm.schedule.RecurrencePattern.Monthly.Ordinal;\r\n vm.NewSchedule.RecurrenceOrdinalDay = vm.schedule.RecurrencePattern.Monthly.OrdinalDay;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function IsRecurrenceDayChecked(){\r\n var retVal = false;\r\n if ( vm.schedule.RecurrencePattern.Weekly.Sunday ||\r\n vm.schedule.RecurrencePattern.Weekly.Monday ||\r\n vm.schedule.RecurrencePattern.Weekly.Tuesday ||\r\n vm.schedule.RecurrencePattern.Weekly.Wednesday ||\r\n vm.schedule.RecurrencePattern.Weekly.Thursday ||\r\n vm.schedule.RecurrencePattern.Weekly.Friday ||\r\n vm.schedule.RecurrencePattern.Weekly.Saturday ){\r\n retVal = true;\r\n }\r\n return retVal;\r\n }\r\n\r\n function saveEndDate(){\r\n // user override on patient schedule\r\n if(!vm.isTemplate && vm.schedule.EndDate.SpecificDate.Date) {\r\n vm.schedule.EndDate.Type = 4; // specific date\r\n vm.NewSchedule.EndDate = vm.schedule.EndDate.SpecificDate.Date;\r\n }\r\n\r\n vm.NewSchedule.EndDateType = vm.schedule.EndDate.Type;\r\n vm.NewSchedule.EndDateSubType = 1;\r\n vm.NewSchedule.EndDateInterval = 1;\r\n vm.NewSchedule.EndDateRecompute = false;\r\n vm.NewSchedule.EndDateValue = null; \r\n\r\n switch(Number(vm.schedule.EndDate.Type)){\r\n case 1: //None\r\n {\r\n break;\r\n }\r\n case 2: // After\r\n {\r\n vm.NewSchedule.EndDateSubType = vm.schedule.EndDate.After.Type;\r\n switch(Number(vm.schedule.EndDate.After.Type)){\r\n case 1: // Completed X time(s) by patient\r\n {\r\n if ( vm.schedule.EndDate.After.Completed >= 1 ){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.After.Completed;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n case 2: // Presented X time(s) to patient\r\n {\r\n if ( vm.schedule.EndDate.After.Presented >= 1){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.After.Presented;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n } \r\n break;\r\n }\r\n case 3: //Program Day\r\n {\r\n vm.NewSchedule.EndDateSubType = vm.schedule.EndDate.ProgramDay.Type;\r\n vm.NewSchedule.EndDateRecompute = vm.schedule.EndDate.ProgramDay.Recompute;\r\n switch(Number(vm.schedule.EndDate.ProgramDay.Type)){\r\n case 1: // On Program day X\r\n {\r\n if ( vm.schedule.EndDate.ProgramDay.Day >= 1){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.ProgramDay.Day;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n case 2: // X Day(s) before end of program\r\n {\r\n if(vm.schedule.EndDate.ProgramDay.DaysBefore >= 0 && vm.schedule.EndDate.ProgramDay.DaysBefore != null){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.ProgramDay.DaysBefore;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n case 3: // Program End Date\r\n {\r\n break;\r\n }\r\n }\r\n break\r\n }\r\n case 4: // Specific Date\r\n {\r\n vm.NewSchedule.EndDateSubType = vm.schedule.EndDate.SpecificDate.Type;\r\n switch(Number(vm.schedule.EndDate.SpecificDate.Type)){\r\n case 1: // On specific date\r\n {\r\n if(vm.schedule.EndDate.SpecificDate.Date){\r\n vm.NewSchedule.EndDateValue = getUtcDateAsString(vm.schedule.EndDate.SpecificDate.Date);\r\n }else{\r\n vm.IsValid = false;\r\n }\r\n \r\n break;\r\n }\r\n case 2: // X calendar day(s) after pathway start date\r\n {\r\n if(vm.schedule.EndDate.SpecificDate.Days >= 0 && vm.schedule.EndDate.SpecificDate.Days != null){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.SpecificDate.Days;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n }\r\n break;\r\n }\r\n } \r\n break\r\n }\r\n case 5: // Milestone Day\r\n {\r\n vm.NewSchedule.MilestoneId = vm.schedule.MilestoneId; // same value us used for start date and end date fields.\r\n vm.NewSchedule.EndDateSubType = vm.schedule.EndDate.MilestoneDay.Before;\r\n vm.NewSchedule.EndDateRecompute = vm.schedule.EndDate.MilestoneDay.Recompute;\r\n if( vm.schedule.EndDate.MilestoneDay.Day >= 0 && vm.schedule.EndDate.MilestoneDay.Day != null){\r\n vm.NewSchedule.EndDateInterval = vm.schedule.EndDate.MilestoneDay.Day;\r\n }\r\n else{\r\n vm.IsValid = false;\r\n } \r\n break;\r\n } \r\n }\r\n }\r\n\r\n function saveIds() {\r\n if(vm.isTemplate) {\r\n vm.NewSchedule.SurveyScheduleId = vm.scheduleToEdit.SurveyScheduleId;\r\n vm.NewSchedule.SurveyTemplateId = vm.scheduleToEdit.SurveyTemplateId;\r\n }\r\n else {\r\n vm.NewSchedule.PatientSurveyScheduleId = vm.scheduleToEdit.PatientSurveyScheduleId;\r\n vm.NewSchedule.PatientSurveyId = vm.scheduleToEdit.PatientSurveyId;\r\n }\r\n vm.NewSchedule.CreatedBy_Id = vm.scheduleToEdit.CreatedBy_Id;\r\n vm.NewSchedule.CreatedDateTime_UTC = vm.scheduleToEdit.CreatedDateTime_UTC;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Build Sample Schedule (shown on right side)\r\n function buildCalendar(){\r\n vm.IsValid = true;\r\n CalculateDisplayTimes();\r\n save();\r\n\r\n if(vm.IsValid){\r\n var pathwayScheduleSample = {};\r\n pathwayScheduleSample.schedule = vm.NewSchedule;\r\n pathwayScheduleSample.referenceDates = {};\r\n var todayLocalMidnight = GetTodayLocalMidnight();\r\n var now = new Date();\r\n pathwayScheduleSample.referenceDates.Now_UTC = now;\r\n\r\n \r\n\r\n if ( isTemplate ){\r\n // this is a template so use default values\r\n if (vm.samplePathwayAdded == null){\r\n vm.samplePathwayAdded = todayLocalMidnight;\r\n }\r\n pathwayScheduleSample.referenceDates.PathwayAddedDateTime_UTC = vm.samplePathwayAdded;\r\n pathwayScheduleSample.referenceDates.ProgramStartDate = getUtcDateAsString(vm.samplePathwayAdded);\r\n pathwayScheduleSample.referenceDates.ProgramDurationDays = vm.NewSchedule.DefaultProgramDuration;\r\n pathwayScheduleSample.referenceDates.ProgramEffectiveDate = null; // will be set by server if null\r\n pathwayScheduleSample.referenceDates.PatientPathwayStartDate = null;\r\n pathwayScheduleSample.referenceDates.PatientPathwayEndDate = null;\r\n pathwayScheduleSample.referenceDates.LastPathwayDueDate = null; \r\n if ( vm.sampleMilestoneDate == null ){\r\n vm.sampleMilestoneDate = AddDays(todayLocalMidnight, 21);\r\n } \r\n if ( vm.NewSchedule.MilestoneId != null && vm.sampleMilestoneDate ){\r\n pathwayScheduleSample.referenceDates.MilestoneDates = {};\r\n pathwayScheduleSample.referenceDates.MilestoneDates[vm.NewSchedule.MilestoneId] = vm.sampleMilestoneDate\r\n } \r\n }\r\n else{\r\n // this is a patient so use real values\r\n vm.sampleMilestoneDate = null;\r\n vm.samplePathwayAdded = vm.scheduleToEdit.CreatedDateTime_UTC;\r\n pathwayScheduleSample.referenceDates.PathwayAddedDateTime_UTC = vm.scheduleToEdit.CreatedDateTime_UTC;\r\n pathwayScheduleSample.referenceDates.ProgramStartDate = null;\r\n pathwayScheduleSample.referenceDates.ProgramDurationDays = vm.NewSchedule.DefaultProgramDuration;\r\n pathwayScheduleSample.referenceDates.ProgramEffectiveDate = null; // will be set by server if null\r\n \r\n if ( vm.schedule.StartDate.SpecificDate.Date){\r\n pathwayScheduleSample.referenceDates.PatientPathwayStartDate = vm.schedule.StartDate.SpecificDate.Date;\r\n }\r\n else{\r\n pathwayScheduleSample.referenceDates.PatientPathwayStartDate = vm.scheduleToEdit.StartDate;\r\n }\r\n \r\n if ( vm.schedule.EndDate.SpecificDate.Date){\r\n pathwayScheduleSample.referenceDates.PatientPathwayEndDate = vm.schedule.EndDate.SpecificDate.Date;\r\n }\r\n else{\r\n pathwayScheduleSample.referenceDates.PatientPathwayEndDate = vm.scheduleToEdit.EndDate;\r\n }\r\n pathwayScheduleSample.referenceDates.LastPathwayDueDate = null; //vm.scheduleToEdit.LastDueDate; \r\n }\r\n\r\n\r\n\r\n \r\n ScheduleService.ComputeSampleSchedule(pathwayScheduleSample).then(function(data){\r\n vm.pathwayScheduleSampleResult = data;\r\n\r\n vm.SampleCalendar.PathwayAdded = null;\r\n vm.SampleCalendar.MilestoneDate = null;\r\n if (vm.schedule.StartDate.Type == 3 && vm.sampleMilestoneDate != null) // milestone\r\n {\r\n var milestoneDate = new Date(vm.sampleMilestoneDate) \r\n if(vm.monthFirstFormat){\r\n vm.SampleCalendar.MilestoneDate = (milestoneDate.getMonth() + 1) + \"/\" + milestoneDate.getDate();\r\n }else{\r\n vm.SampleCalendar.MilestoneDate = milestoneDate.getDate() + \"/\" + (milestoneDate.getMonth() + 1);\r\n }\r\n }\r\n else{\r\n if ( vm.samplePathwayAdded != null ){\r\n var pathwayAdded = new Date(vm.samplePathwayAdded) \r\n if(vm.monthFirstFormat){\r\n vm.SampleCalendar.PathwayAdded = (pathwayAdded.getMonth() + 1) + \"/\" + pathwayAdded.getDate();\r\n }else{\r\n vm.SampleCalendar.PathwayAdded = pathwayAdded.getDate() + \"/\" + (pathwayAdded.getMonth() + 1);\r\n }\r\n }\r\n }\r\n buildSampleMonths();\r\n vm.calendarLoaded = true;\r\n });\r\n }\r\n else{\r\n vm.pathwayScheduleSampleResult = {};\r\n vm.pathwayScheduleSampleResult.StartDate = null;\r\n vm.pathwayScheduleSampleResult.EndDate = null;\r\n vm.pathwayScheduleSampleResult.DueDates = [];\r\n vm.pathwayScheduleSampleResult.PathwayAdded = null;\r\n vm.pathwayScheduleSampleResult.MilestoneDate = null;\r\n buildSampleMonths();\r\n }\r\n buildDescription();\r\n }\r\n\r\n vm.CalculateDisplayTimes = CalculateDisplayTimes;\r\n function CalculateDisplayTimes(){\r\n var minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.StartMinutesBeforePrompt = adjustMinutes(minutes, vm.schedule.DueTime.StartMinutesBeforePrompt, true);\r\n vm.schedule.DueTime.StartMinutesBeforePromptTime = minutes.setMinutes( minutes.getMinutes() - vm.schedule.DueTime.StartMinutesBeforePrompt);\r\n if(!vm.schedule.DueTime.StartMinutesBeforePromptTime){\r\n vm.ValidStartTime = false;\r\n vm.IsValid = false;\r\n }else{\r\n vm.ValidStartTime = true;\r\n }\r\n minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.LateMinutesAfterPrompt = adjustMinutes(minutes, vm.schedule.DueTime.LateMinutesAfterPrompt, false);\r\n vm.schedule.DueTime.LateMinutesAfterPromptTime = minutes.setMinutes( minutes.getMinutes() + vm.schedule.DueTime.LateMinutesAfterPrompt);\r\n if(!vm.schedule.DueTime.LateMinutesAfterPromptTime){\r\n vm.ValidLateTime = false;\r\n vm.IsValid = false;\r\n }else{\r\n vm.ValidLateTime = true;\r\n }\r\n minutes = new Date(vm.schedule.DueTime.SchedulePromptTimeOfDay);\r\n vm.schedule.DueTime.EndMinutesAfterPrompt = adjustMinutes(minutes, vm.schedule.DueTime.EndMinutesAfterPrompt, false);\r\n vm.schedule.DueTime.EndMinutesAfterPromptTime = minutes.setMinutes( minutes.getMinutes() + vm.schedule.DueTime.EndMinutesAfterPrompt);\r\n if(!vm.schedule.DueTime.EndMinutesAfterPromptTime){\r\n vm.ValidEndTime = false;\r\n vm.IsValid = false;\r\n }else{\r\n vm.ValidEndTime = true;\r\n }\r\n\r\n if(vm.schedule.DueTime.EndMinutesAfterPromptTime && vm.schedule.DueTime.LateMinutesAfterPromptTime && vm.schedule.DueTime.StartMinutesBeforePromptTime){\r\n vm.IsValid = true;\r\n }\r\n }\r\n \r\n function adjustMinutes(base, minutes, isBefore){\r\n if(minutes == undefined){\r\n return NaN;\r\n }\r\n var prompt = new Date(base);\r\n var copy = new Date(base);\r\n var addedTime = isBefore ? -minutes : minutes;\r\n var newTime = new Date(copy.setMinutes(copy.getMinutes() + addedTime)); \r\n if(isBefore && prompt.getDate() != newTime.getDate()){\r\n var copy = new Date(prompt);\r\n copy.setHours(0,0,0,0);\r\n var difference = moment(copy).diff(prompt, \"minutes\");\r\n return Math.abs(difference);\r\n }\r\n if (!isBefore && prompt.getDate() != newTime.getDate()){\r\n newTime.setHours(0,0,0,0);\r\n var difference = moment(prompt).diff(newTime, \"minutes\");\r\n return Math.abs(difference+1);\r\n }\r\n return Math.abs(minutes);\r\n }\r\n\r\n \r\n\r\n function buildSampleMonths(){\r\n var today = null;\r\n if(!vm.isTemplate){ //if patient schedule we want to generate the sample based on the actual start date instead of \"today\"\r\n try {\r\n var scheduleStart = new Date(vm.pathwayScheduleSampleResult.StartDate);\r\n today = scheduleStart;\r\n } catch (error) {\r\n console.error(\"Cant parse Start Date: \",error); \r\n }\r\n }else{\r\n today = GetTodayLocalMidnight();\r\n }\r\n\r\n vm.SampleCalendar.Months = [];\r\n if ( vm.pathwayScheduleSampleResult.StartDate == null ){\r\n vm.SampleCalendar.StartDate = \"Pending\";\r\n }\r\n else{\r\n var startDate = new getUtcPlusLocalOffsetDate(vm.pathwayScheduleSampleResult.StartDate);\r\n if(vm.monthFirstFormat){\r\n vm.SampleCalendar.StartDate = (startDate.getMonth() + 1) + \"/\" + startDate.getDate();\r\n }else{\r\n vm.SampleCalendar.StartDate = startDate.getDate() + \"/\" + (startDate.getMonth() + 1);\r\n }\r\n\r\n if ( vm.pathwayScheduleSampleResult.EndDate == null ){\r\n vm.SampleCalendar.EndDate = \"N/A\";\r\n }\r\n else{\r\n var endDate = new getUtcPlusLocalOffsetDate(vm.pathwayScheduleSampleResult.EndDate)\r\n if(vm.monthFirstFormat){\r\n vm.SampleCalendar.EndDate = (endDate.getMonth() + 1) + \"/\" + endDate.getDate();\r\n }else{\r\n vm.SampleCalendar.EndDate = endDate.getDate() + \"/\" + (endDate.getMonth() + 1);\r\n }\r\n }\r\n \r\n if ( vm.pathwayScheduleSampleResult.DueDates == null || vm.pathwayScheduleSampleResult.DueDates.length == 0){\r\n vm.SampleCalendar.FirstDueDate = \"N/A\";\r\n }\r\n else{\r\n var firstDueDate = new Date(vm.pathwayScheduleSampleResult.DueDates[0])\r\n if(vm.monthFirstFormat){\r\n vm.SampleCalendar.FirstDueDate = (firstDueDate.getMonth() + 1) + \"/\" + firstDueDate.getDate();\r\n }else{\r\n vm.SampleCalendar.FirstDueDate = firstDueDate.getDate() + \"/\" + (firstDueDate.getMonth() + 1);\r\n }\r\n } \r\n }\r\n\r\n var month = today.getMonth();\r\n var year = today.getFullYear();\r\n for(var i = 0; i < 12; i++){\r\n var sampleMonth = buildSampleMonth( month, year)\r\n vm.SampleCalendar.Months.push(sampleMonth);\r\n month++;\r\n if(month > 11){\r\n month = 0;\r\n year++;\r\n }\r\n }\r\n }\r\n \r\n function buildSampleMonth( month, year){\r\n var retVal = {}\r\n var thisMonth = new Date( year, month, 1);\r\n var dayOfWeek = thisMonth.getDay();\r\n var daysInMonth = GetDaysInMonth(month, year);\r\n retVal.Name = thisMonth.toLocaleString('en-us', { month: 'long' }); // Name of month\r\n retVal.Weeks = [ [], [], [], [], [], [] ]; \r\n \r\n var weekIndex = 0;\r\n var dayCnt = 1;\r\n for(i = 0; i < 42; i++){\r\n var day = {};\r\n if ( i >= dayOfWeek && dayCnt <= daysInMonth ){\r\n day.label = \"\" + dayCnt;\r\n day.Date = new Date( year, month, dayCnt);\r\n day.isDueDate = IsDueDate(day.Date);\r\n dayCnt++;\r\n }\r\n else{\r\n day.label = \" \";\r\n day.isDueDate =false;\r\n } \r\n retVal.Weeks[weekIndex].push(day);\r\n if ( (i+1) % 7 == 0){\r\n weekIndex++;\r\n }\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function buildDescription(){\r\n var milestoneName = getMilestoneName(vm.NewSchedule.MilestoneId);\r\n vm.schedule.description = {\r\n all: $filter('schedule')(vm.NewSchedule, milestoneName),\r\n start: $filter('schedule')(vm.NewSchedule, milestoneName, 'start'),\r\n end: $filter('schedule')(vm.NewSchedule, milestoneName, 'end'),\r\n recurrence: $filter('schedule')(vm.NewSchedule, '', 'recurrence'),\r\n time: $filter('schedule')(vm.NewSchedule, '', 'time')\r\n };\r\n }\r\n\r\n function getMilestoneName(milestoneId) {\r\n var result = '';\r\n if (milestoneId != null) {\r\n for(var i = 0; i < vm.Milestones.length; ++i){\r\n if(vm.Milestones[i].MilestoneId === milestoneId){\r\n result = vm.Milestones[i].Name;\r\n break;\r\n }\r\n }\r\n }\r\n \r\n return result;\r\n } \r\n\r\n function IsDueDate(date){\r\n var retVal = false;\r\n if ( vm.pathwayScheduleSampleResult != null && vm.pathwayScheduleSampleResult.DueDates != undefined){\r\n vm.pathwayScheduleSampleResult.DueDates.forEach(function(dueDateStr){\r\n var dueDate = new Date(dueDateStr)\r\n if ( dueDate.setHours(0,0,0,0) === date.setHours(0,0,0,0) ){ //compare date without time\r\n retVal = true;\r\n }\r\n });\r\n }\r\n return retVal;\r\n }\r\n\r\n function GetDaysInMonth(month,year) {\r\n return new Date(year, month+1, 0).getDate();\r\n }\r\n\r\n function GetTodayLocalMidnight(){\r\n var today = new Date ();\r\n var todayLocalMidnight = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0);\r\n return todayLocalMidnight;\r\n }\r\n\r\n function AddDays( date, days ){\r\n var retVal = null;\r\n var day = date.getDate();\r\n var month = date.getMonth();\r\n var year = date.getFullYear();\r\n var daysInMonth = GetDaysInMonth(month, year);\r\n\r\n if ( (day + days) <= daysInMonth ){\r\n day = day + days;\r\n retVal = new Date(year, month, day);\r\n }\r\n else{\r\n day = (day + days) - daysInMonth;\r\n month++;\r\n if(month > 11){\r\n month = 0;\r\n year++;\r\n } \r\n retVal = new Date(year, month, day);\r\n }\r\n return retVal;\r\n }\r\n\r\n function getUtcDateAsString(date){\r\n // avoid json serialization using browser timezone when converting to UTC \r\n return moment(date).format('YYYY-MM-DD[T00:00:00.000Z]'); \r\n }\r\n\r\n function getUtcPlusLocalOffsetDate(dateString){\r\n var utc = new Date(dateString);\r\n var utcPlusOffset = new Date( utc.setMinutes( utc.getTimezoneOffset()));\r\n return utcPlusOffset;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Event Handlers\r\n vm.ok = ok;\r\n function ok(isValid) {\r\n save();\r\n saveIds();\r\n\r\n $uibModalInstance.close( vm.NewSchedule );\r\n }\r\n\r\n vm.cancel = cancel;\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n\r\n if(returnToSurveyEdit){\r\n if (!userCanEditLockedPathways && $stateParams.PatientSurveyId) {\r\n PatientSurveyService.setLastEditedPatientSurveyId($stateParams.PatientSurveyId);\r\n $state.go('patients.patient.careplan.surveys');\r\n }\r\n } \r\n }\r\n\r\n vm.onChange = onChange;\r\n var pendingRefresh = false;\r\n function onChange(){\r\n if (pendingRefresh) {\r\n $timeout.cancel(pendingRefresh);\r\n };\r\n pendingRefresh = $timeout(function() {\r\n buildCalendar();\r\n pendingRefresh = false;\r\n }, 100);\r\n }\r\n\r\n vm.SetSamplePathwayAddDate = SetSamplePathwayAddDate;\r\n function SetSamplePathwayAddDate(date){\r\n if (vm.schedule.StartDate.Type == 3) // milestone\r\n {\r\n vm.samplePathwayAdded = null;\r\n vm.sampleMilestoneDate = date;\r\n }\r\n else{\r\n vm.samplePathwayAdded = date;\r\n vm.sampleMilestoneDate = null;\r\n }\r\n onChange();\r\n }\r\n\r\n vm.StartEditMode = false;\r\n vm.toggleStartEditMode = function(){\r\n vm.StartEditMode = !vm.StartEditMode;\r\n if(vm.StartEditMode){\r\n setTimeout(function(){\r\n document.getElementById(\"StartEdit\").focus()\r\n },0);\r\n }\r\n }\r\n\r\n vm.LateEditMode = false;\r\n vm.toggleLateEditMode = function(){\r\n vm.LateEditMode = !vm.LateEditMode;\r\n if(vm.LateEditMode){\r\n setTimeout(function(){\r\n document.getElementById(\"LateEdit\").focus()\r\n },0);\r\n }\r\n }\r\n\r\n vm.EndEditMode = false;\r\n vm.toggleEndEditMode = function(){\r\n vm.EndEditMode = !vm.EndEditMode;\r\n if(vm.EndEditMode){\r\n setTimeout(function(){\r\n document.getElementById(\"EndEdit\").focus()\r\n },0);\r\n }\r\n }\r\n\r\n $uibModalInstance.rendered.then(function(){\r\n //this is to focus the promptTime editor on load\r\n var input = document.getElementById(\"promptTime\").getElementsByTagName(\"input\")[0];\r\n input.focus();\r\n })\r\n \r\n //#endregion\r\n}\r\n \r\nangular.module('content.schedule').controller('ScheduleModalController', ScheduleModalController);\r\n","angular.module(\"content.tree_extensions\").directive(\"treeExpandCollapse\", function () {\r\n return {\r\n restrict: \"A\",\r\n require: \"^uiTree\",\r\n link: function (scope, elem, attrs, uiTreeController) {\r\n scope.expandedAll = false;\r\n elem.on(\"click\", function () {\r\n scope.$apply(function () {\r\n scope.expandedAll = !scope.expandedAll;\r\n if (scope.expandedAll) {\r\n scope.$broadcast('angular-ui-tree:expand-all');\r\n } else {\r\n scope.$broadcast('angular-ui-tree:collapse-all');\r\n }\r\n });\r\n });\r\n }\r\n };\r\n});\r\n","function EditPathwaysController($uibModalInstance, pathwayCount, vhSweetAlert) {\r\n var vm = this;\r\n vm.myTime = new Date(200, 1, 1, 9, 0, 0);\r\n vm.count = pathwayCount.count;\r\n vm.unpublished = pathwayCount.unpublished;\r\n vm.action = 1;\r\n\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n\r\n function ok() {\r\n var msg = 'Are you sure you want to change the time for ' + vm.count + ' pathway(s)?';\r\n if ( vm.action == 2){\r\n msg = 'Are you sure you want to change the status for ' + vm.count + ' pathway(s) to discontinued?';\r\n }\r\n vhSweetAlert.verify('Are you sure?', msg, 'Yes')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $uibModalInstance.close( { action : vm.action, time : vm.myTime } );\r\n }\r\n }\r\n );\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.close();\r\n }\r\n}\r\n\r\nangular.module('content.templates').controller('EditPathwaysController', EditPathwaysController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/editpathways.modal.html',\n '

      Edit {{vm.count}} Pathways

      0\">You have {{vm.unpublished}} unpublished pathway(s) selected.
      0\">Only published pathways will be updated.
      ');\n}]);\n}(window, document, window.angular));","function AddHealthTipController($uibModalInstance, $window, vhSweetAlert, lodash, HealthTipsService, ApkSanitizer, PermissionService, TemplatesService, healthTip) {\r\n vm = this;\r\n vm.defaultLanguageId = \"en\";\r\n vm.languageId = vm.defaultLanguageId;\r\n vm.healthTip = {\r\n id: 0,\r\n name: '',\r\n categoryId: null,\r\n nameTexts: {\r\n en: ''\r\n },\r\n texts: {\r\n en: ''\r\n }\r\n};\r\n vm.activeTab = 0;\r\n vm.isNew = true;\r\n vm.submitted = false;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.isDefaultLanguage = isDefaultLanguage;\r\n vm.setCurrentLanguageText = setCurrentLanguageText;\r\n vm.titleChanged = titleChanged;\r\n vm.onPaste = onPaste;\r\n vm.advancedUser = PermissionService.userHasPermission([\"HealthTipsWriteAdvanced\"]);\r\n vm.userCanEditTags = PermissionService.userHasPermission([\"PathwayTagWrite\"]);\r\n vm.userCanEditRules = PermissionService.userHasPermission([\"PathwayConditionWrite\", \"RuleWrite\"]);\r\n vm.userCanEditContentId = PermissionService.userHasPermission([\"SecurityAccessLevelModerateWrite\"]);\r\n vm.textColor = {\r\n \"color\": \"red\",\r\n }\r\n\r\n var maxFileSize = 0;\r\n\r\n vm.languageDictionary = {\r\n en: \"English\",\r\n es: \"Spanish\",\r\n it: \"Italian\",\r\n fr_ca: \"Canadian French\"\r\n }\r\n\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n var textSizeTools = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];\r\n var textStyleTools = ['bold', 'italics', 'underline'];\r\n var listTools = ['ul', 'ol'];\r\n var textAlignTools = ['justifyLeft', 'justifyCenter', 'justifyRight'];\r\n var otherTools = ['fontColor'];\r\n if ($window.FileReader !== undefined) {\r\n otherTools.push('insertImage');\r\n }\r\n if (vm.advancedUser) {\r\n otherTools.push('html');\r\n }\r\n\r\n vm.tools = [textSizeTools, textStyleTools, listTools, textAlignTools, otherTools];\r\n\r\n vm.isNew = (healthTip == null || healthTip == undefined);\r\n if (vm.isNew) {\r\n vm.modalHeader = 'Add Health Tip';\r\n } else {\r\n vm.modalHeader = 'Edit Health Tip';\r\n vm.healthTip = angular.copy(healthTip);\r\n }\r\n\r\n HealthTipsService.getHealthTipMaxSize().then(function(value) {\r\n maxFileSize = value * 1000;\r\n });\r\n\r\n HealthTipsService.getQuestionCategories().then(function(data) {\r\n vm.categories = data;\r\n });\r\n\r\n TemplatesService.getAvailableLanguages().then(function (data) {\r\n lodash(data).forEach(function (language) {\r\n var languageCode = language.Code.replace('-', '_');\r\n\r\n var existingDictionaryLanguage = vm.languageDictionary[languageCode];\r\n if (!existingDictionaryLanguage) {\r\n vm.languageDictionary[languageCode] = language.Name;\r\n }\r\n\r\n var existingTipLanguage = vm.healthTip.texts[languageCode];\r\n if (!existingTipLanguage) {\r\n vm.healthTip.texts[languageCode] = '';\r\n }\r\n\r\n existingTipLanguage = vm.healthTip.nameTexts[languageCode];\r\n if (!existingTipLanguage) {\r\n vm.healthTip.nameTexts[languageCode] = '';\r\n }\r\n }).value();\r\n });\r\n\r\n vm.healthTip.EnglishTitle = lodash.find(vm.healthTip.nameTexts, { languageId: vm.defaultLanguageId });\r\n\r\n }\r\n\r\n function isDefaultLanguage() {\r\n return vm.healthTipNameText && vm.healthTipNameText.languageId == vm.defaultLanguageId;\r\n }\r\n\r\n function setCurrentLanguageText(languageId) {\r\n vm.languageId = languageId || 'en';\r\n vm.healthTipText = lodash.find(vm.healthTip.texts, {languageId: languageId});\r\n vm.healthTipNameText = lodash.find(vm.healthTip.nameTexts, {languageId: languageId});\r\n\r\n if (vm.healthTipText && !vm.healthTipNameText) {\r\n vm.healthTipNameText = {\r\n text: '',\r\n languageId: vm.healthTipText.languageId,\r\n languageName: vm.healthTipText.languageName\r\n };\r\n }\r\n }\r\n\r\n function titleChanged(oldValue) {\r\n // if (vm.isDefaultLanguage() && vm.healthTip.name === oldValue) {\r\n // //copy title as name if match\r\n // // vm.healthTip.name = vm.healthTipNameText.text || '';\r\n // }\r\n }\r\n\r\n function onPaste(html) {\r\n var el = angular.element('
      ' + html + '
      ');\r\n if (ApkSanitizer.includesMedia(el)) {\r\n vhSweetAlert.error(\"Oops...\", \"Cannot paste images, videos or other media into health tips. Upload images with the image icon.\");\r\n return '';\r\n }\r\n return ApkSanitizer.sanitizeTags(el);\r\n }\r\n\r\n function ok(isValid) {\r\n vm.submitted = true;\r\n var defaultHealthTip = vm.healthTip.texts[vm.defaultLanguageId];\r\n var defaultHealthTipName = vm.healthTip.nameTexts[vm.defaultLanguageId]; \r\n\r\n if (defaultHealthTip && defaultHealthTip.length > 0 && defaultHealthTipName && defaultHealthTipName.length > 0) {\r\n if (isValid) {\r\n if (vm.healthTip.texts && vm.healthTip.texts[vm.languageId].length > maxFileSize) {\r\n vm.validError = 'Health Tip text is too long. Please remove images or text';\r\n isValid = false;\r\n } else if (!vm.healthTip.texts || !vm.healthTip.nameTexts[vm.languageId] || vm.healthTip.texts[vm.languageId].length < 1 || vm.healthTip.nameTexts[vm.languageId].length < 1) {\r\n vm.validError = 'Health Tip name, patient-facing title and text are required'\r\n isValid = false;\r\n }\r\n\r\n if (isValid) {\r\n var languageCount = Object.keys(vm.healthTip.texts).length;\r\n lodash(vm.healthTip.texts).remove(function (text) { return !text.text || text.text.length <= 0; }).value();\r\n if (Object.keys(vm.healthTip.texts) < languageCount) {\r\n lodash(vm.healthTip.nameTexts).remove(function (text) { return !text.text || text.text.length <= 0; }).value();\r\n }\r\n\r\n //vm.healthTip.Tags = TagUtilities.cleanUpTags(vm.healthTip.Tags);\r\n\r\n var promise;\r\n\r\n if (vm.isNew) {\r\n promise = HealthTipsService.createHealthTip(vm.healthTip);\r\n } else {\r\n promise = HealthTipsService.saveHealthTip(vm.healthTip);\r\n }\r\n \r\n promise.then(function (tipData) {\r\n $uibModalInstance.close(tipData);\r\n }, function(error) {\r\n if (error.data && error.data.ModelState && error.data.ModelState.ContentId && error.data.ModelState.ContentId[0]) {\r\n vhSweetAlert.error('Error', error.data.ModelState.ContentId[0]);\r\n }\r\n else{\r\n vm.validError = error.message || error;\r\n if (error.languageId) {\r\n var tabIndex = lodash.findIndex(vm.healthTip.texts, {languageId: error.languageId});\r\n vm.activeTab = tabIndex;\r\n }\r\n }\r\n });\r\n }\r\n } else {\r\n vm.validError = 'Health Tip name, patient-facing title and health tip text are required';\r\n }\r\n }\r\n else {\r\n vm.validError = vm.languageDictionary[vm.defaultLanguageId] + ' Health Tip name, patient-facing title and health tip text are required';\r\n vm.activeTab = 0;\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('content.healthtips').controller('AddHealthTipController', AddHealthTipController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/healthtips/addhealthtip.modal.html',\n '

      {{vm.modalHeader}}

      Name is required
      Content ID can only contain letters, numbers, hyphens, and underscores
      Title is required
      Replace with file:
      {{tag}}

      {{vm.healthTip.DisplayCondition}}
      ');\n}]);\n}(window, document, window.angular));","function ApkSanitizer(lodash, $q, $document) {\r\n var tipBodyPrefix = '';\r\n var tipBodySuffix = '';\r\n\r\n var removeTag = function(element, tag) {\r\n var tags = element.find(tag);\r\n angular.forEach(tags, function (t) {\r\n el = angular.element(t);\r\n el.replaceWith(el.html());\r\n });\r\n };\r\n\r\n var removeStyling = function (element) {\r\n angular.forEach(element, function (e) {\r\n subEl = angular.element(e);\r\n subEl.removeAttr('class');\r\n var color = subEl.css('color');\r\n var alignment = subEl.css('text-align');\r\n subEl.removeAttr('style');\r\n subEl.css('color', color);\r\n subEl.css('text-align', alignment);\r\n var children = subEl.children();\r\n if (children) {\r\n removeStyling(children);\r\n }\r\n });\r\n };\r\n\r\n var removeWrapperTags = function (text) {\r\n var parsedText = text;\r\n if (text.indexOf(tipBodyPrefix) >= 0) {\r\n parsedText.replace(tipBodyPrefix, '');\r\n }\r\n if (text.indexOf(tipBodySuffix) >= 0) {\r\n parsedText.replace(tipBodyPrefix, '');\r\n }\r\n return parsedText;\r\n };\r\n\r\n var addWrapperTags = function (text) {\r\n var wrappedText = text;\r\n if (text.indexOf(tipBodyPrefix) < 0) {\r\n wrappedText = tipBodyPrefix + wrappedText;\r\n }\r\n if (text.indexOf(tipBodySuffix) < 0) {\r\n wrappedText = wrappedText + tipBodySuffix;\r\n }\r\n return wrappedText;\r\n };\r\n\r\n var queueImageSrc = function (imgs) {\r\n var queue = []\r\n var b64ImgSrcs = lodash.filter(imgs, function (i) {\r\n if (i.src.length > 11) {\r\n return i.src.substring(0,11) != 'data:image/'\r\n }\r\n return false;\r\n });\r\n\r\n angular.forEach(b64ImgSrcs, function (im) {\r\n queue.push(imageSrcToBase64(im));\r\n });\r\n return $q.all(queue);\r\n }\r\n\r\n var imageSrcToBase64 = function (angularImg) {\r\n var deffered = $q.defer();\r\n var img = new Image()\r\n img.setAttribute(\"crossOrigin\", \"anonymous\");\r\n img.onload = function (e) {\r\n var canvas = $document[0].createElement(\"canvas\");\r\n var width = this.width;\r\n var height = this.height;\r\n\r\n if (width > 400) {\r\n width = 400;\r\n height = 400 * this.height / this.width;\r\n }\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n var ctx = canvas.getContext(\"2d\");\r\n ctx.drawImage(this, 0, 0, width, height);\r\n angularImg.src = canvas.toDataURL(\"image/png\");\r\n deffered.resolve();\r\n }\r\n img.onloaderror = function () {\r\n deffered.reject();\r\n }\r\n img.src = angularImg.src;\r\n return deffered.promise;\r\n }\r\n\r\n var formatImageTags = function (htmlText, containerWidth) {\r\n var htmlElement = angular.element('' + htmlText + '');\r\n var images = htmlElement.find('img');\r\n angular.forEach(images, function (i) {\r\n var image = angular.element(i);\r\n var cssWidth = image.css('width');\r\n if (cssWidth === '' || cssWidth.indexOf('px', cssWidth.length - 2) !== -1) {\r\n var percentWidth;\r\n if (image.attr('width') === '' || image.attr('width') === undefined) {\r\n percentWidth = Math.round(image[0].naturalWidth/containerWidth * 100);\r\n } else {\r\n var width = image.attr('width').replace(/\\D/g,'');\r\n percentWidth = Math.round(image.attr('width')/containerWidth * 100);\r\n }\r\n lessPercent = Math.min(percentWidth, 100);\r\n image.css('width', lessPercent + '%');\r\n }\r\n image.removeAttr('width');\r\n });\r\n\r\n return htmlElement.html();\r\n };\r\n\r\n\r\n return {\r\n includesMedia: function (html) {\r\n return (html.find('img').length > 0 || html.find('video').length > 0 || html.find('iframe').length > 0);\r\n },\r\n\r\n //Removes styling except for text color, removes anchors\r\n sanitizeTags: function (element) {\r\n removeTag(element, 'a');\r\n removeStyling(element);\r\n var htmlString = element.html().trim();\r\n if (htmlString === \"\") {\r\n htmlString = \"\";\r\n }\r\n return htmlString;\r\n },\r\n\r\n hasValidImages: function (htmlText) {\r\n var isValid = true;\r\n var element = angular.element(htmlText);\r\n var images = element.find('img');\r\n var validSrc = /^data:/;\r\n angular.forEach(images, function (i) {\r\n var image = angular.element(i);\r\n var src = image.attr('src');\r\n if (!validSrc.test(src)) {\r\n isValid = false;\r\n }\r\n });\r\n return isValid;\r\n },\r\n\r\n // convert web's html to be compatible with apk\r\n sanitizeForApk: function (htmlText, containerWidth) {\r\n var imagedText = formatImageTags(htmlText, containerWidth);\r\n var wrappedText = addWrapperTags(imagedText);\r\n return wrappedText;\r\n },\r\n\r\n // convert apk html to be compatible with website\r\n sanitizeForWeb: removeWrapperTags\r\n };\r\n}\r\n\r\nangular.module('content.healthtips').factory('ApkSanitizer', ApkSanitizer);","function HealthTipsController(healthTipsObj, HealthTipsService, PermissionService, lodash, vhSweetAlert, $state, $sce, $uibModal, TemplatesService, ResourceLibraryService, $http) {\r\n var vm = this;\r\n\r\n var defaultLanguageCode = \"en\";\r\n vm.currentPage = 1;\r\n vm.maxSize = 5;\r\n vm.pageSize = HealthTipsService.getPageSize();\r\n vm.healthTips = healthTipsObj.tips;\r\n vm.totalItems = healthTipsObj.count;\r\n\r\n vm.LanguageCode = defaultLanguageCode;\r\n vm.searchTextBox = '';\r\n vm.activeSearch = false;\r\n vm.noSearchResults = false;\r\n vm.searchText = '';\r\n vm.selectedTip = {};\r\n vm.categories = [];\r\n vm.selectCategoryId = 0;\r\n vm.userCanAddHealthTip = PermissionService.userHasPermission([\"HealthTipsWrite\"]);\r\n vm.userCanEditHealthTips = PermissionService.userHasPermission([\"HealthTipsWrite\"]);\r\n vm.userCanDeleteHealthTips = PermissionService.userHasPermission([\"HealthTipsWrite\"]);\r\n vm.userCanImportHealthTips = PermissionService.userHasPermission([\"HealthTipsWriteAdvanced\"]);\r\n vm.userCanExportHealthTips = PermissionService.userHasPermission([\"HealthTipsWriteAdvanced\"]);\r\n vm.userCanDownloadHealthTip = PermissionService.userHasPermission([\"HealthTipsWriteAdvanced\"]);\r\n vm.setLanguageCode = setLanguageCode;\r\n vm.optionText = getCurrentLanguageText;\r\n vm.showImageEditor = showImageEditor;\r\n vm.resetThumbnail = resetThumbnail;\r\n vm.currentLanguage = \"\";\r\n vm.languages = [];\r\n vm.languageDictionary = {\r\n en: \"English\",\r\n es: \"Spanish\",\r\n it: \"Italian\",\r\n fr_ca: \"Canadian French\"\r\n }\r\n\r\n vm.thumbnailUrl = {};\r\n vm.portraitUrl = {};\r\n vm.landscapeUrl = {};\r\n\r\n vm.contentIndex = 0\r\n\r\n vm.showUid = false;\r\n\r\n vm.toggleUid = toggleUid;\r\n vm.isToggled = isToggled;\r\n vm.copyUid = copyUid;\r\n vm.uidToolTip = 'Click to copy to clipboard.';\r\n vm.toggledItem = null;\r\n\r\n vm.itemsSelected = [];\r\n vm.toggleHealthTipSelection = toggleHealthTipSelection;\r\n vm.getHealthTips = getHealthTips;\r\n\r\n function getHealthTips() {\r\n HealthTipsService.getHealthTipsByPage(vm.currentPage, vm.pageSize, vm.selectCategoryId)\r\n .then(function(data) {\r\n vm.itemsSelected = data.tips.map(x => x.id);\r\n });\r\n };\r\n\r\n function toggleHealthTipSelection($event, id) {\r\n $event.stopPropagation();\r\n if (vm.isSelected(id)) {\r\n vm.itemsSelected = vm.itemsSelected.filter(x => x != id);\r\n } else {\r\n vm.itemsSelected.push(id);\r\n }\r\n }\r\n\r\n\r\n vm.selectToggle = () => {\r\n if (vm.itemsSelected.length > 0) {\r\n vm.itemsSelected = [];\r\n } else {\r\n vm.healthTips.map(ht => {\r\n vm.itemsSelected.push(ht.id)\r\n });\r\n //getHealthTips();\r\n }\r\n }\r\n\r\n vm.checkAllOnPage = ($event) => {\r\n $event.stopPropagation();\r\n if (vm.itemsSelected.length > 0) {\r\n vm.itemsSelected = [];\r\n } else {\r\n vm.healthTips.map(ht => {\r\n vm.itemsSelected.push(ht.id)\r\n });\r\n\r\n }\r\n }\r\n\r\n vm.isSelected = (id) => {\r\n return vm.itemsSelected.includes(id);\r\n };\r\n\r\n function _extractFileName(headerContentDisposition) {\r\n var filename = \"\";\r\n var disposition = headerContentDisposition;\r\n if (disposition && disposition.indexOf('attachment') !== -1) {\r\n var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\r\n var matches = filenameRegex.exec(disposition);\r\n if (matches != null && matches[1]) {\r\n filename = matches[1].replace(/['\"]/g, '');\r\n }\r\n }\r\n return filename;\r\n }\r\n\r\n vm.export = () => {\r\n\r\n var ids = vm.itemsSelected;\r\n\r\n if (ids.length == 0)\r\n return;\r\n\r\n $http.post('/api/export/healthtips', JSON.stringify(ids), { responseType: 'arraybuffer' })\r\n .then(function successCallback(response) {\r\n var headersFn = response.headers;\r\n var headers = headersFn();\r\n var data = response.data;\r\n\r\n var filename = _extractFileName(headers['content-disposition']);\r\n var contentType = headers['content-type'];\r\n\r\n var a = document.createElement('a');\r\n try {\r\n var blob = new Blob([data], { type: contentType });\r\n var url = window.URL.createObjectURL(blob);\r\n\r\n a.setAttribute('href', url);\r\n a.setAttribute(\"download\", filename);\r\n a.click();\r\n\r\n\r\n vhSweetAlert.success('Exported', `Successfully exported ${(vm.itemsSelected || []).length} Health Tip${(vm.itemsSelected || []).length < 2 ? '' : 's'}.`);\r\n\r\n\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n }, function errorCallback(error) {\r\n console.log('Something went wrong!!!')\r\n });\r\n\r\n }\r\n\r\n vm.selectTip = function(tipId) {\r\n HealthTipsService.getHealthTip(tipId).then(function(tip) {\r\n if (tip) {\r\n $state.go('content.healthtips.healthtip', { TipQuestionId: tip.id });\r\n vm.selectedTip = tip;\r\n vm.LanguageCode = defaultLanguageCode;\r\n\r\n vm.thumbnailUrl = {};\r\n vm.portraitUrl = {};\r\n vm.landscapeUrl = {};\r\n lodash.forOwn(vm.selectedTip.texts, function(_, language) {\r\n vm.thumbnailUrl[language] = \"/content/healthtip_thumbnail.png\";\r\n vm.portraitUrl[language] = \"/content/healthtip_portrait.png\";\r\n vm.landscapeUrl[language] = \"/content/healthtip_landscape.png\";\r\n });\r\n\r\n ResourceLibraryService.getResourceThumbnailImages(vm.selectedTip.id, 1).then(function(thumbnailImages) {\r\n lodash.forOwn(vm.selectedTip.texts, function(_, languageCode) {\r\n var language = lodash.find(vm.languages, { Code: languageCode });\r\n var itemImages = lodash.find(thumbnailImages, { LanguageId: language.LanguageId });\r\n if (itemImages) {\r\n if (itemImages.ThumbnailUrl) vm.thumbnailUrl[languageCode] = itemImages.ThumbnailUrl;\r\n if (itemImages.PortraitUrl) vm.portraitUrl[languageCode] = itemImages.PortraitUrl;\r\n if (itemImages.LandscapeUrl) vm.landscapeUrl[languageCode] = itemImages.LandscapeUrl;\r\n }\r\n });\r\n });\r\n\r\n window.setTimeout(_ => {\r\n vm.contentIndex = 0;\r\n });\r\n }\r\n });\r\n\r\n };\r\n\r\n ResourceLibraryService.getLanguages().then(function(data) {\r\n vm.languages = data;\r\n for (var l in vm.languages) {\r\n if (vm.languages[l].Code) {\r\n var languageCode = vm.languages[l].Code.replace('-', '_');\r\n var existingDictionaryLanguage = vm.languageDictionary[languageCode];\r\n if (!existingDictionaryLanguage) {\r\n vm.languageDictionary[languageCode] = vm.languages[l].Name;\r\n }\r\n }\r\n }\r\n });\r\n\r\n // cannot use $stateParams because of bug with ui-router,\r\n // if child state uses parent's controller, the childs stateParams are\r\n // not passed to this controller\r\n if ($state.params.TipQuestionId) {\r\n vm.selectTip($state.params.TipQuestionId);\r\n }\r\n\r\n init();\r\n\r\n function init() {\r\n\r\n vm.showUid = PermissionService.userHasPermission(['ContentUIDRead']);\r\n\r\n HealthTipsService.getQuestionCategories().then(function(data) {\r\n vm.categories = [{ Name: \"All Categories\", SurveyQuestionCategoryId: 0 }].concat(data);\r\n });\r\n }\r\n\r\n\r\n function toggleUid(healthTip) {\r\n\r\n if (vm.toggledItem != healthTip)\r\n vm.toggledItem = healthTip;\r\n else\r\n vm.toggledItem = null;\r\n }\r\n\r\n function isToggled(healthTip) {\r\n return vm.toggledItem == healthTip;\r\n }\r\n\r\n function copyUid(uid) {\r\n\r\n var textArea = document.createElement(\"textarea\");\r\n textArea.value = uid;\r\n document.body.appendChild(textArea);\r\n textArea.select();\r\n document.execCommand(\"Copy\");\r\n textArea.remove();\r\n\r\n vm.uidToolTip = 'Copied to clipboard! ';\r\n window.setTimeout(() => {\r\n vm.uidToolTip = 'Click to copy to clipboard.';\r\n }, 2000);\r\n\r\n }\r\n\r\n vm.performSearch = function() {\r\n if (vm.searchTextBox.length > 0) {\r\n vm.selectCategoryId = 0;\r\n $state.go(\"content.healthtips\");\r\n vm.searchText = vm.searchTextBox;\r\n HealthTipsService.searchHealthTips(vm.searchText).then(function(tips) {\r\n vm.healthTips = tips;\r\n vm.totalItems = tips.ResultsCount;\r\n vm.activeSearch = true;\r\n vm.selectedTip = {};\r\n if (vm.healthTips.length < 1) {\r\n vm.noSearchResults = true;\r\n } else {\r\n vm.noSearchResults = false;\r\n }\r\n });\r\n }\r\n };\r\n\r\n vm.onCategoryIdChanged = function() {\r\n loadAllHealthTips();\r\n }\r\n\r\n vm.setPage = function(pageNo) {\r\n vm.currentPage = pageNo;\r\n }\r\n\r\n vm.pageChanged = function() {\r\n HealthTipsService.getHealthTipsByPage(vm.currentPage, vm.pageSize, vm.selectCategoryId).then(function(data) {\r\n vm.healthTips = data.tips;\r\n vm.totalItems = data.count;\r\n })\r\n };\r\n\r\n var loadAllHealthTips = function() {\r\n HealthTipsService.getHealthTipsByPage(1, vm.pageSize, vm.selectCategoryId).then(function(data) {\r\n vm.currentPage = 1;\r\n vm.healthTips = data.tips;\r\n vm.totalItems = data.count;\r\n vm.noSearchResults = (vm.healthTips.length < 1);\r\n });\r\n };\r\n\r\n vm.clearSearch = function() {\r\n vm.searchText = '';\r\n vm.searchTextBox = '';\r\n vm.activeSearch = false;\r\n vm.noSearchResults = false;\r\n loadAllHealthTips();\r\n };\r\n\r\n function escapeRegexp (queryToEscape) {\r\n return queryToEscape.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\r\n }\r\n \r\n vm.highlight = function(text) {\r\n if (!text || text.length == 0) {\r\n return '';\r\n }\r\n\r\n var guidRegex = /[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}/;\r\n if (text.match(guidRegex)) {\r\n text = text.slice(0, 4) + \"-\" + text.slice(text.length - 4);\r\n }\r\n\r\n if (!vm.activeSearch || vm.searchText.length < 1) {\r\n return $sce.trustAsHtml(text);\r\n } else {\r\n return $sce.trustAsHtml(text.replace(new RegExp(escapeRegexp(vm.searchText), 'gi'), '$&'));\r\n }\r\n };\r\n\r\n vm.optionHtml = function() {\r\n var languageText = getCurrentLanguageText(vm.selectedTip);\r\n if (languageText) {\r\n vm.currentLanguage = languageText.languageName;\r\n return $sce.trustAsHtml(languageText.text);\r\n }\r\n };\r\n\r\n function getCurrentLanguageText(tip) {\r\n var languageText = {\r\n languageName: vm.languageDictionary[vm.LanguageCode],\r\n text: tip.texts[vm.LanguageCode]\r\n };\r\n return languageText;\r\n }\r\n\r\n function setLanguageCode(languageCode) {\r\n vm.LanguageCode = languageCode.replace('-', '_');\r\n }\r\n\r\n var showTipModal = function(tip) {\r\n var isEdit = (tip !== undefined && tip !== null);\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/healthtips/addhealthtip.modal.html',\r\n controller: 'AddHealthTipController as vm',\r\n backdrop: 'static',\r\n size: 'md',\r\n resolve: {\r\n tags: function() {\r\n return TemplatesService.getSurveyTags();\r\n },\r\n healthTip: function() {\r\n return tip;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function(tipData) {\r\n if (isEdit) {\r\n var healthTipIndex = lodash.findIndex(vm.healthTips, function(h) { return h.id == tipData.id; });\r\n vm.healthTips[healthTipIndex] = tipData;\r\n } else {\r\n vm.healthTips.push(tipData);\r\n }\r\n vm.selectTip(tipData.id);\r\n vm.LanguageCode = defaultLanguageCode;\r\n }, function() {});\r\n };\r\n\r\n vm.addHealthTip = function() {\r\n showTipModal();\r\n };\r\n\r\n vm.editHealthTip = function(tip) {\r\n showTipModal(tip);\r\n };\r\n\r\n vm.deleteHealthTip = function(tip) {\r\n vhSweetAlert.verify('Are You Sure?', 'Are you sure you want to delete ' + tip.name + '. This will also remove it from any surveys it is included in.', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $state.go('content.healthtips');\r\n vm.selectedTip = {};\r\n HealthTipsService.deleteHealthTip(tip.id).then(function(data) {\r\n lodash.remove(vm.healthTips, function(h) { return h.id == tip.id; });\r\n });\r\n }\r\n });\r\n };\r\n\r\n vm.getImageUrl = function() {\r\n var imageType = 1;\r\n switch (imageType) {\r\n case 1:\r\n return \"/content/healthtip_thumbnail.png\";\r\n case 2:\r\n return \"/content/healthtip_portrait.png\";\r\n case 3:\r\n return \"/content/healthtip_landscape.png\";\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n function showImageEditor(imgType) {\r\n var language = lodash.find(vm.languages, { Code: vm.LanguageCode });\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/images/image.editor.modal.html',\r\n controller: 'ImageEditorModalController as vme',\r\n backdrop: 'static',\r\n resolve: {\r\n imgUrl: function() { return vm.thumbnailUrl[vm.LanguageCode] },\r\n imgType: imgType,\r\n resourceType: 1, // healthtip\r\n resourceId: vm.selectedTip.id,\r\n languageId: function() { return language.LanguageId; },\r\n languageCode: function() { return language.Code; }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(imgUrl) {\r\n if (null == imgUrl) return;\r\n switch (imgType) {\r\n case 1:\r\n vm.thumbnailUrl[vm.LanguageCode] = imgUrl + \"?\" + new Date().getTime();\r\n break;\r\n case 2:\r\n vm.portraitUrl[vm.LanguageCode] = imgUrl + \"?\" + new Date().getTime();\r\n break;\r\n case 3:\r\n vm.landscapeUrl[vm.LanguageCode] = imgUrl + \"?\" + new Date().getTime();\r\n break;\r\n }\r\n });\r\n }\r\n\r\n function resetThumbnail() {\r\n\r\n vhSweetAlert.verify('Are You Sure?', 'Are you sure you want to set this health tip to use the default thumbnail?', 'Restore')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n ResourceLibraryService.deleteThumbnail(vm.selectedTip.id, 1, vm.LanguageCode).then(x => {\r\n vm.thumbnailUrl = {};\r\n vm.portraitUrl = {};\r\n vm.landscapeUrl = {};\r\n\r\n lodash.forOwn(vm.selectedTip.texts, function(_, language) {\r\n vm.thumbnailUrl[language] = \"/content/healthtip_thumbnail.png\";\r\n vm.portraitUrl[language] = \"/content/healthtip_portrait.png\";\r\n vm.landscapeUrl[language] = \"/content/healthtip_landscape.png\";\r\n });\r\n\r\n ResourceLibraryService.getResourceThumbnailImages(vm.selectedTip.id, 1).then(function(thumbnailImages) {\r\n lodash.forOwn(vm.selectedTip.texts, function(_, languageCode) {\r\n var language = lodash.find(vm.languages, { Code: languageCode });\r\n var itemImages = lodash.find(thumbnailImages, { LanguageId: language.LanguageId });\r\n if (itemImages) {\r\n if (itemImages.ThumbnailUrl) vm.thumbnailUrl[languageCode] = itemImages.ThumbnailUrl;\r\n if (itemImages.PortraitUrl) vm.portraitUrl[languageCode] = itemImages.PortraitUrl;\r\n if (itemImages.LandscapeUrl) vm.landscapeUrl[languageCode] = itemImages.LandscapeUrl;\r\n }\r\n });\r\n });\r\n });\r\n }\r\n });\r\n\r\n }\r\n}\r\nangular.module('content.healthtips').controller('HealthTipsController', HealthTipsController);","function HealthTipsService(lodash, QuestionRepository, ConfigurationRepository, QuestionCategoryRepository, ApkSanitizer, $q) {\r\n var healthTipQuestionTypeId = 8;\r\n var maxSizeConfigName = 'HealthTipSizeMax';\r\n var healthTipWidth = 536;\r\n var defaultLanguage = 'en';\r\n var selectedTipQuestion = {};\r\n var pageSize = 100;\r\n\r\n var getQuestionOptionText = function (question, language) {\r\n var retVal = null;\r\n var surveyOption = question.SurveyOptions[0];\r\n if (surveyOption) {\r\n var optionTexts = surveyOption.OptionTexts;\r\n if (optionTexts) {\r\n retVal = optionTexts[language];\r\n }\r\n }\r\n return retVal;\r\n };\r\n\r\n var tipFromTipQuestion = function (tipQuestion, language) {\r\n var tipName = tipQuestion.Name;\r\n var nameTexts = tipQuestion.QuestionTexts || {};\r\n var bodyText = getQuestionOptionText(tipQuestion, language);\r\n var tipTexts = {};\r\n var option = {\r\n AlertSeverityLevelId: 3,\r\n TimeToReadSeconds: tipQuestion.SurveyOptions.length > 0 ? tipQuestion.SurveyOptions[0].TimeToReadSeconds : 0,\r\n OptionTexts: {}\r\n };\r\n\r\n if (tipQuestion.SurveyOptions != null && tipQuestion.SurveyOptions.length > 0) {\r\n tipTexts = tipQuestion.SurveyOptions[0].OptionTexts;\r\n if (tipQuestion.SurveyOptions.length > 1) {\r\n option = tipQuestion.SurveyOptions[1];\r\n }\r\n }\r\n\r\n if (tipName === null) {\r\n tipName = '';\r\n }\r\n var body = bodyText || '';\r\n if (body === null) {\r\n body = '';\r\n } else {\r\n body = ApkSanitizer.sanitizeForWeb(body);\r\n }\r\n\r\n return {\r\n id: tipQuestion.SurveyQuestionId,\r\n uid: tipQuestion.SurveyQuestionUId,\r\n name: tipName,\r\n contentId: tipQuestion.ContentId,\r\n text: body,\r\n nameTexts: nameTexts,\r\n texts: tipTexts,\r\n categoryId: tipQuestion.SurveyQuestionCategoryId,\r\n DisplayCondition : tipQuestion.DisplayCondition,\r\n Tags : tipQuestion.Tags,\r\n option : option\r\n };\r\n };\r\n\r\n var tipsFromTipsQuestions = function (data) {\r\n var tips = [];\r\n tips.ResultsCount = data.ResultsCount;\r\n angular.forEach(data.SearchResults, function (tipQuestion) {\r\n //Question search will return questions that have health tips as nested questions, we need to filter those out\r\n if (tipQuestion.SurveyQuestionTypeId == healthTipQuestionTypeId) {\r\n tips.push(tipFromTipQuestion(tipQuestion, defaultLanguage));\r\n }\r\n });\r\n return tips;\r\n };\r\n\r\n var updateHealthTip = function (tipQuestion, healthTip) {\r\n if (!healthTip.name) {\r\n return $q.reject({ message: 'Name is required' });\r\n }\r\n\r\n tipQuestion.Name = healthTip.name;\r\n tipQuestion.ContentId = healthTip.contentId;\r\n tipQuestion.DisplayCondition = healthTip.DisplayCondition;\r\n tipQuestion.Tags = healthTip.Tags;\r\n\r\n var promises = Object.keys(healthTip.texts).map(function (languageId) {\r\n return updateTipQuestion(tipQuestion, healthTip, languageId);\r\n\r\n });\r\n // var promises = lodash.map(healthTip.texts, function (healthTipText) {\r\n // return updateTipQuestion(tipQuestion, healthTip, healthTipText.languageId);\r\n // });\r\n\r\n return $q.all(promises);\r\n }\r\n\r\n var updateTipQuestion = function (tipQuestion, tip, language) {\r\n var healthTipNameText = tip.nameTexts[language];\r\n var healthTipText = tip.texts[language];\r\n if (!healthTipNameText || !healthTipText) {\r\n return $q.reject({ message: 'Title and Text are required', language: language });\r\n }\r\n\r\n tipQuestion.QuestionTexts[language] = healthTipNameText;\r\n\r\n var sanitizedText = ApkSanitizer.sanitizeForApk(healthTipText, healthTipWidth);\r\n tipQuestion.SurveyOptions[0].OptionTexts[language] = sanitizedText;\r\n tipQuestion.SurveyOptions[0].TimeToReadSeconds = tip.TimeToReadSeconds;\r\n tipQuestion.SurveyQuestionCategoryId = tip.categoryId;\r\n };\r\n\r\n return {\r\n importHealthTips: function (data) {\r\n var promise = QuestionRepository.importHealthTips(data);\r\n return promise;\r\n },\r\n\r\n getHealthTipsByPage: function (pageNumber, pageSize, categoryId){\r\n var promise = QuestionRepository.searchQuestionsByTypeAndPageNumber(pageNumber, pageSize, categoryId)\r\n .then(function (data) {\r\n //Returns health tips and the count of total health tips\r\n var tips = [];\r\n angular.forEach(data.SearchResults, function (tipQuestion) {\r\n tips.push(tipFromTipQuestion(tipQuestion, defaultLanguage));\r\n });\r\n return {\r\n tips: tips,\r\n count: data.ResultsCount,\r\n };\r\n });\r\n\r\n return promise;\r\n },\r\n\r\n getHealthTip: function (tipId) {\r\n var promise = QuestionRepository.get(tipId).then(function (tipQuestion) {\r\n selectedTipQuestion = tipQuestion;\r\n return tipFromTipQuestion(tipQuestion, defaultLanguage);\r\n });\r\n return promise;\r\n },\r\n\r\n getHealthTips: function () {\r\n var promise = QuestionRepository.getHealthTips()\r\n .then(function (data) {\r\n //Returns health tips and the count of total health tips\r\n var tips = [];\r\n angular.forEach(data.SearchResults, function (tipQuestion) {\r\n tips.push(tipFromTipQuestion(tipQuestion, defaultLanguage));\r\n });\r\n return {\r\n tips: tips,\r\n count: data.ResultsCount,\r\n };\r\n });\r\n\r\n return promise;\r\n },\r\n\r\n getPageSize:function(){\r\n return pageSize;\r\n },\r\n\r\n searchHealthTips: function (searchText) {\r\n var promise = QuestionRepository.searchQuestionsByType(searchText, healthTipQuestionTypeId, 0).then(tipsFromTipsQuestions);\r\n return promise;\r\n },\r\n\r\n createHealthTip: function (healthTip) {\r\n healthTipQuestion = {\r\n Name: healthTip.name,\r\n ContentId: healthTip.contentId,\r\n DisplayCondition : healthTip.createHealthTip,\r\n Tags : healthTip.Tags,\r\n SurveyQuestionTypeId: 8,\r\n QuestionTexts: {},\r\n SurveyOptions: [{\r\n OptionTexts: {},\r\n SurveyParameterTypeId: 10,\r\n AlertSeverityLevelId: 3\r\n }]\r\n };\r\n updateHealthTip(healthTipQuestion, healthTip);\r\n var promise = QuestionRepository.create(healthTipQuestion).then(function (data) {\r\n return tipFromTipQuestion(data, defaultLanguage);\r\n });\r\n return promise;\r\n },\r\n\r\n saveHealthTip: function (healthTip) {\r\n updateHealthTip(selectedTipQuestion, healthTip);\r\n var promise = QuestionRepository.save(selectedTipQuestion).then(function (data) {\r\n return tipFromTipQuestion(data, defaultLanguage);\r\n });\r\n return promise;\r\n },\r\n\r\n getQuestionCategories: function () {\r\n var promise = QuestionCategoryRepository.getAll();\r\n return promise;\r\n },\r\n\r\n getHealthTipMaxSize: function () {\r\n return ConfigurationRepository.getByParamName(maxSizeConfigName).then(function (data) {\r\n return data.Value;\r\n });\r\n },\r\n\r\n deleteHealthTip: function (tipId) {\r\n var promise = QuestionRepository.delete(tipId);\r\n return promise;\r\n }\r\n };\r\n}\r\nangular.module('content.healthtips').factory('HealthTipsService', HealthTipsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/healthtips/healthtips.tpl.html',\n '

      Health Tips

      1. {{vm.totalItems}} Health Tip{{vm.totalItems !== 1 ? \\'s\\' : \\'\\'}}
      Health Tip
      ( )
      \"Thumbnail\" {{vm.selectedTip.nameTexts[vm.LanguageCode]}}

      File Size: {{vm.selectedTip.texts[vm.LanguageCode].length | fileSizeUnitFilter}}

      Time to Read: {{vm.selectedTip.option.TimeToReadSeconds | secondsToDateTime | date:\\'mm:ss\\'}}

      Thumbnail ({{vm.currentLanguage}})
      \"Thumbnail\"
      ');\n}]);\n}(window, document, window.angular));","function SurveyScheduleOrderFilter (lodash) {\r\n function isDaily(survey) {\r\n return survey.SurveySchedule.RecurrenceInterval == 1 && survey.SurveySchedule.IsOneTime === false;\r\n }\r\n\r\n function sortByPromptOrder(a, b) {\r\n if (a.PromptOrder > b.PromptOrder) {\r\n return 1;\r\n } else if (b.PromptOrder > a.PromptOrder) {\r\n return -1;\r\n } else {\r\n return sortByName(a, b)\r\n }\r\n return 0;\r\n }\r\n\r\n function sortByName(a, b) {\r\n var aName = a.Name.toLowerCase();\r\n var bName = b.Name.toLowerCase();\r\n if (aName > bName) return 1;\r\n if (bName > aName) return -1;\r\n return 0;\r\n }\r\n\r\n function sortByTimeOfDay(a, b) {\r\n var aTime = a.SurveySchedule.SchedulePromptTimeOfDay.split(':');\r\n var bTime = b.SurveySchedule.SchedulePromptTimeOfDay.split(':');\r\n var ahour = aTime[0];\r\n var aminute = aTime[1];\r\n var bhour = bTime[0];\r\n var bminute = bTime[1];\r\n\r\n if (ahour > bhour) {\r\n return 1;\r\n } else if (bhour > ahour) {\r\n return -1;\r\n } else if (aminute > bminute) {\r\n return 1;\r\n } else if (bminute > aminute) {\r\n return -1;\r\n } else {\r\n return sortByPromptOrder(a, b);\r\n }\r\n }\r\n\r\n function sortByStartDate (a, b) {\r\n var astartDate = Date.parse(a.SurveySchedule.StartDate);\r\n var bstartDate = Date.parse(b.SurveySchedule.StartDate);\r\n if (astartDate > bstartDate) {\r\n return 1;\r\n } else if (bstartDate > astartDate) {\r\n return -1;\r\n } else {\r\n return sortByTimeOfDay(a, b);\r\n }\r\n }\r\n\r\n return function (obj) {\r\n var dailySurveys = lodash.filter(obj, isDaily);\r\n var oneTime = lodash.filter(obj, function (survey) {\r\n return survey.SurveySchedule.IsOneTime;\r\n });\r\n var weekly = lodash.filter(obj, function (survey) {\r\n return !isDaily(survey) && !survey.SurveySchedule.IsOneTime;\r\n });\r\n\r\n dailySurveys.sort(sortByTimeOfDay);\r\n oneTime.sort(sortByStartDate);\r\n weekly.sort(sortByTimeOfDay);\r\n\r\n var returnArray = dailySurveys.concat(weekly.concat(oneTime));\r\n return returnArray;\r\n };\r\n}\r\n\r\nangular.module('content.patientsurvey').filter('orderBySchedule', SurveyScheduleOrderFilter);\r\n","function OverdueAlertSelectionDirective(PatientSurveyService) {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n \"schedule\": \"=\"\r\n },\r\n template: [\r\n ''\r\n ].join(\"\"),\r\n link: function (scope, element, attrs) {\r\n var noneOption = {\r\n label: \"None\",\r\n value: \"none\"\r\n };\r\n scope.overdueTime = null;\r\n scope.$watch(\"schedule\", function (newValue) {\r\n if (newValue && newValue.SchedulePromptTimeOfDay) {\r\n setOptions(newValue);\r\n if (newValue.IsOverdueAlertEnabled) {\r\n scope.overdueTime = newValue.OverdueMinutesAfterPrompt;\r\n } else {\r\n scope.overdueTime = noneOption.value;\r\n }\r\n }\r\n }, true);\r\n\r\n scope.overdueTimeChanged = function () {\r\n if (scope.overdueTime === noneOption.value) {\r\n scope.schedule.IsOverdueAlertEnabled = false;\r\n } else {\r\n scope.schedule.IsOverdueAlertEnabled = true;\r\n scope.schedule.OverdueMinutesAfterPrompt = scope.overdueTime;\r\n }\r\n PatientSurveyService.savePatientSurveySchedule(scope.schedule);\r\n };\r\n\r\n function setOptions(schedule) {\r\n var times = [noneOption];\r\n var minutes = schedule.SchedulePromptTimeOfDay.substring(3,5);\r\n for (var i = 1; i <= 12; i++) {\r\n var hourOfDay = i + Number(schedule.SchedulePromptTimeOfDay.substring(0,2));\r\n var label = i.toString() + \"h (\";\r\n if (hourOfDay < 12) {\r\n label += hourOfDay.toString() + \":\" + minutes + \" AM)\";\r\n } else if (hourOfDay === 12) {\r\n label += \"12:\" + minutes + \" PM)\";\r\n } else if (hourOfDay > 12 && hourOfDay < 24){\r\n label += (hourOfDay - 12).toString() + \":\" + minutes + \" PM)\";\r\n } else if (hourOfDay === 24) {\r\n label += \"12:\" + minutes + \" AM)\";\r\n } else {\r\n label += (hourOfDay - 24).toString() + \":\" + minutes + \" AM)\";\r\n }\r\n\r\n times.push({\r\n label: label,\r\n value: i * 60\r\n });\r\n }\r\n\r\n scope.times = times;\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"content.patientsurvey\").directive(\"overdueAlertSelection\", OverdueAlertSelectionDirective);\r\n","function PatientSurveyController(PatientCareplanContent,\r\n patientContent,\r\n PatientSurveyService,\r\n $state,\r\n vhSweetAlert,\r\n PermissionService,\r\n PatientSurvey,\r\n AvailableLanguages,\r\n $scope,\r\n $uibModal,\r\n ConfigurationsService,\r\n ScheduleService,\r\n $filter,\r\n lockStatusEnum) {\r\n var vm = this;\r\n $scope.lockStatusEnum = lockStatusEnum;\r\n vm.patientId = patientContent.PatientHeader.PatientId;\r\n vm.selectedPatientSurvey = {};\r\n vm.selectedPatientSurvey.ScheduleText = '';\r\n vm.showPushToTableButton = false;\r\n vm.AvailableLanguages = AvailableLanguages;\r\n\r\n vm.userCanDeletePatientSurvey = PermissionService.userHasPermission([\"PatientCareplanWrite\"]);\r\n vm.userCanChangePatientPathwayStatus = PermissionService.userHasPermission([\"PatientPathwayStatusWrite\"]);\r\n vm.userCanReadWritePathwayAlertChangeReason = PermissionService.userHasPermission([\"PathwayAlertChangeReasonRead\", \"PathwayAlertChangeReasonWrite\"]);\r\n vm.userCanEditLockedPathways = PermissionService.userHasPermission([\"CanEditLockedPathways\"]);\r\n vm.userCanEditPatientPathwaySchedule = PermissionService.userHasPermission([\"PatientPathwayScheduleEdit\"]);\r\n\r\n vm.showOptions = showOptions;\r\n vm.deletePatientSurvey = deletePatientSurvey;\r\n vm.overdueAlertTime = overdueAlertTime;\r\n vm.changeStatus = changeStatus;\r\n\r\n vm.getMilestoneName = getMilestoneName;\r\n\r\n $scope.toggleShowOptions = toggleShowOptions;\r\n $scope.defaultOptionLimit = 5;\r\n function toggleShowOptions(question){\r\n if(!question.optionLimit || question.optionLimit == $scope.defaultOptionLimit){\r\n question.optionLimit = question.SurveyOptions.length;\r\n }else{\r\n question.optionLimit = $scope.defaultOptionLimit;\r\n }\r\n }\r\n\r\n\r\n vm.ShowHistory = ShowHistory;\r\n loadController();\r\n\r\n\r\n function loadController() {\r\n vm.selectedPatientSurvey = PatientSurvey;\r\n\r\n vm.showEditPathwayBtn = (vm.userCanEditLockedPathways || // Vivify Support\r\n vm.userCanReadWritePathwayAlertChangeReason || // Clinical 2\r\n vm.selectedPatientSurvey.LockStatus != lockStatusEnum.Locked) && // Is an Unlocked Pathways\r\n (vm.selectedPatientSurvey.StatusId != 3 && vm.selectedPatientSurvey.StatusId != 6);\r\n // Content Admin\r\n vm.showEditPathwayScheduleBtn = vm.userCanEditPatientPathwaySchedule &&\r\n vm.selectedPatientSurvey.LockStatus === $scope.lockStatusEnum.Locked.value &&\r\n !vm.showEditPathwayBtn;\r\n\r\n // incase someone changes the patient id in the url but doesn't change the patient survey id unselect the pathway\r\n if ( vm.selectedPatientSurvey.PatientId != vm.patientId){\r\n $state.go('patients.patient.careplan.surveys');\r\n }\r\n }\r\n\r\n function showOptions(question) {\r\n return !PatientSurveyService.isBiometricQuestion(question) && !PatientSurveyService.isHealthTipQuestion(question);\r\n }\r\n\r\n function deletePatientSurvey(patientSurveyId) {\r\n vhSweetAlert.verify('Are you sure?',\r\n `Are you sure you want to delete ${vm.selectedPatientSurvey.Name} from patient ${patientContent.patient.name.firstName} ${patientContent.patient.name.lastName}?`, 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $scope.$emit('patientsurveydeleted', patientSurveyId);\r\n $state.go('patients.patient.careplan.surveys');\r\n PatientSurveyService.deletePatientSurvey(vm.patientId, patientSurveyId);\r\n }\r\n }\r\n );\r\n }\r\n\r\n function changeStatus(patientSurveyId, statusId){\r\n vm.selectedPatientSurvey.StatusId = statusId;\r\n $scope.$emit('patientsurveystatuschanged', patientSurveyId, statusId);\r\n PatientSurveyService.setPatientSurveyStatus(vm.patientId, patientSurveyId, statusId);\r\n }\r\n\r\n vm.toggleLanguage = function(language) {\r\n vm.Language = language;\r\n };\r\n\r\n function overdueAlertTime() {\r\n var schedule = vm.selectedPatientSurvey.SurveySchedule;\r\n if (schedule && schedule.OverdueMinutesAfterPrompt != null && schedule.IsOverdueAlertEnabled) {\r\n var overdueTime = new Date('1900/01/01 ' + schedule.SchedulePromptTimeOfDay);\r\n overdueTime.setMinutes(overdueTime.getMinutes() + schedule.OverdueMinutesAfterPrompt);\r\n return overdueTime;\r\n }\r\n }\r\n\r\n function getMilestoneName(milestoneId) {\r\n if (milestoneId != null) {\r\n for(var i = 0; i <$scope.milestones.length; ++i){\r\n if($scope.milestones[i].MilestoneId === milestoneId){\r\n return $scope.milestones[i].Name;\r\n }\r\n }\r\n }\r\n\r\n return \"\";\r\n }\r\n\r\n function ShowHistory() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/patientsurvey/patientsurveyhistory.modal.html',\r\n controller: 'PatientSurveyHistoryController as vm',\r\n keyboard: false,\r\n size: 'lg',\r\n resolve: {\r\n HistoryData: function(){\r\n return PatientSurveyService.getPatientSurveyHistory(vm.patientId, vm.selectedPatientSurvey.PatientSurveyId).then( function (data) { return data; })\r\n },\r\n Milestones: function(){\r\n return $scope.milestones;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function () {\r\n }, function () {});\r\n }\r\n\r\n\r\n ////#region schedule modal\r\n vm.dateFormat = ConfigurationsService.configParams.DateFormat;\r\n\r\n $scope.schedule = vm.schedule = vm.selectedPatientSurvey.SurveySchedule;\r\n\r\n $scope.$watch(\"schedule.PatientSurveyScheduleId\", function () {\r\n if ($scope.schedule && $scope.schedule.PatientSurveyScheduleId > 0) {\r\n vm.schedule = getSchedule($scope.schedule);\r\n }\r\n });\r\n\r\n $scope.$watch(\"schedule.SurveyScheduleId\", function () {\r\n if ($scope.schedule && $scope.schedule.SurveyScheduleId > 0) {\r\n vm.schedule = getSchedule($scope.schedule);\r\n }\r\n });\r\n\r\n ScheduleService.getMilestones().then(function(response){\r\n $scope.milestones = response.data;\r\n vm.schedule = getSchedule($scope.schedule);\r\n });\r\n\r\n function getSchedule(schedule) {\r\n var result = null;\r\n if (schedule) {\r\n result = schedule;\r\n result.description = getScheduleDescription(result);\r\n }\r\n else {\r\n result = {\r\n description: 'Not set'\r\n };\r\n }\r\n return result;\r\n };\r\n\r\n function getScheduleDescription(schedule){\r\n return $filter('schedule')(schedule, getMilestoneName(schedule.MilestoneId));\r\n }\r\n\r\n function getMilestoneName(milestoneId) {\r\n var result = '';\r\n if(!$scope.milestones) {\r\n return result;\r\n }\r\n if(!milestoneId) {\r\n return result;\r\n };\r\n for(var i = 0; i <$scope.milestones.length; ++i){\r\n if($scope.milestones[i].MilestoneId === milestoneId){\r\n result = $scope.milestones[i].Name;\r\n break;\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n function saveSchedule(schedule) {\r\n // if (!isTemplate(schedule)) {\r\n PatientSurveyService.savePatientSurveySchedule(schedule);\r\n // }\r\n }\r\n\r\n $scope.OpenEditModal = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/components/schedule/schedule.modal.html',\r\n controller: 'ScheduleModalController as vm',\r\n animation: false,\r\n backdrop: 'static',\r\n keyboard: false,\r\n size: 'lg',\r\n resolve: {\r\n scheduleToEdit: vm.schedule,\r\n isTemplate: isTemplate(vm.schedule),\r\n milestones: function(){\r\n return $scope.milestones;\r\n },\r\n templateInfo: {name: vm.selectedPatientSurvey.SurveyTexts[\"en\"]},\r\n returnToSurveyEdit: false\r\n }\r\n });\r\n modalInstance.result.then(function (scheduleData) {\r\n vm.schedule = getSchedule(scheduleData);\r\n //$scope.scheduleChanged({ schedule: vm.schedule });\r\n vm.schedule.PatientSurveyScheduleId = $scope.schedule.PatientSurveyScheduleId;\r\n vm.schedule.PatientSurveyId = $scope.schedule.PatientSurveyId;\r\n saveSchedule(vm.schedule);\r\n }, function () {\r\n //$state.go(patients.patient.careplan.surveys.survey.edit, {patientId : vm.patientId, PatientSurveyId : vm.selectedPatientSurvey.PatientSurveyId});\r\n });\r\n }\r\n\r\n function isTemplate(schedule) {\r\n return schedule.PatientSurveyScheduleId > 0;\r\n }\r\n ////#endregion schedule modal\r\n}\r\n\r\nangular.module('content.patientsurvey').controller('PatientSurveyController', PatientSurveyController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/patientsurvey/patientsurvey.tpl.html',\n '
      {{vm.selectedPatientSurvey.Name}}{{ vm.selectedPatientSurvey.SurveySchedule | schedule : vm.getMilestoneName(vm.selectedPatientSurvey.SurveySchedule.MilestoneId) }}
      0\" vh-language=\"\" ng-model=\"vm.Language.Code\">
      No questions exist in this survey.
      ');\n}]);\n}(window, document, window.angular));","function PatientSurveyAlertChangeController($uibModalInstance, PatientSurveyService, data) {\r\n var vm = this;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.isOtherSelected = isOtherSelected;\r\n vm.isInvalid = isInvalid;\r\n vm.PatientId = data.PatientId;\r\n vm.PatientSurvey = data.PatientSurvey;\r\n vm.alertChangeReasons = [];\r\n vm.selectedReasons = [];\r\n vm.otherReasonText = '';\r\n var otherReason = { Text: 'Other', isOther: true };\r\n\r\n PatientSurveyService.getPatientSurveyAlertChangeReasons()\r\n .then((response) => {\r\n vm.alertChangeReasons = response.filter(includeReason);\r\n vm.alertChangeReasons.push(otherReason)\r\n\r\n if (vm.alertChangeReasons.length == 1) {\r\n vm.selectedReasons = [otherReason];\r\n }\r\n });\r\n\r\n function includeReason(reason) {\r\n return reason.IsEnabled && reason.Programs.some((program) => program.IsAllPatients || program.PopulationId === data.PopulationId);\r\n }\r\n\r\n function isOtherSelected() {\r\n return vm.selectedReasons.includes(otherReason);\r\n }\r\n\r\n function submitAlertChangeReason() {\r\n let reason = vm.selectedReasons.map((r) => r.Text).join(', ');\r\n if (vm.isOtherSelected()) {\r\n reason = reason.replace('Other', vm.otherReasonText);\r\n }\r\n\r\n let logText = `Question(s) in pathway \"${vm.PatientSurvey.Name}\" alert(s) updated. Reason: ${reason}`;\r\n return logText;\r\n }\r\n\r\n function isInvalid() {\r\n return vm.selectedReasons.length == 0 || (vm.isOtherSelected() && !vm.otherReasonText);\r\n }\r\n\r\n function ok() {\r\n var logText;\r\n if (vm.selectedReasons.length > 0) {\r\n logText = submitAlertChangeReason();\r\n }\r\n\r\n $uibModalInstance.close(logText);\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('Canceled');\r\n }\r\n}\r\n\r\nangular.module('content.patientsurvey').controller('PatientSurveyAlertChangeController', PatientSurveyAlertChangeController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/patientsurvey/patientsurveyalertchange.modal.html',\n '

      Reason for Pathway Alert Change(s)

      Select reasons

      ');\n}]);\n}(window, document, window.angular));","function PatientSurveyEditController(PatientCareplanEditContent, $scope, $q, $stateParams, $state, lodash, vhSweetAlert,\r\n PatientSurveyService, ResourceLibraryService, CategoriesService, TemplatesService, PermissionService, SmoothScroll,\r\n PatientHeaderService, DirtyPage, patientContent, $timeout, $uibModal) {\r\n var vm = this;\r\n vm.searchTextBox = '';\r\n vm.searchText = '';\r\n vm.activeSearch = false;\r\n vm.categories = [];\r\n vm.selectedCategory = { SurveyQuestionCategoryId: 0, Name: \"All Categories\" };\r\n vm.searchResultQuestions = [];\r\n vm.alertsChanged = false;\r\n vm.isDirty = false;\r\n\r\n //paging\r\n vm.currentPage = 1;\r\n vm.pageSize = 20;\r\n vm.total = 1;\r\n\r\n vm.patient = {};\r\n vm.patientSurvey = {};\r\n vm.patientSurvey.SurveyQuestions = [];\r\n vm.patientSurvey.SurveySchedule = {};\r\n vm.patientSurvey.SurveySchedule.PatientSurveyScheduleId = 0;\r\n vm.LanguageId = 1; //only show English for now\r\n vm.languages = [];\r\n vm.titleLanguage = 'en';\r\n vm.noSearchResults = false;\r\n vm.showPushToTableButton = false;\r\n vm.showSendPathwayStartMessageButton = patientContent.patient.serviceLevelTypeId == 9 &&\r\n\r\n patientContent.patient.hasSurveysDue && PermissionService.userHasPermission([\"PatientDemographicsWrite\"]);\r\n\r\n vm.userCanEditSchedule = PermissionService.userHasPermission([\"PatientCareplanWrite\", \"PatientCareplanScheduleWrite\"]);\r\n vm.userCanEditLockedPathwaySchedule = PermissionService.userHasPermission([\"PatientPathwayScheduleEdit\"]);\r\n vm.userCanEditPatientSurvey = PermissionService.userHasPermission([\"PatientCareplanWrite\"]);\r\n vm.userCanEditLockedPathways = PermissionService.userHasPermission([\"CanEditLockedPathways\"]);\r\n var flashQuestion = null;\r\n\r\n vm.flash = flash;\r\n vm.isValidTitle = isValidTitle;\r\n vm.showOptions = showOptions;\r\n vm.buttonSearch = buttonSearch;\r\n vm.clearSearch = clearSearch;\r\n vm.performSearch = performSearch;\r\n vm.removeQuestion = removeQuestion;\r\n vm.pushToTablet = pushToTablet;\r\n vm.sendPathwayStartMessage = sendPathwayStartMessage;\r\n vm.addQuestionToSurvey = addQuestionToSurvey;\r\n vm.checkSurveyName = checkSurveyName;\r\n vm.selectLanguage = selectLanguage;\r\n vm.scheduleChanged = scheduleChanged;\r\n vm.numNewQuestions = 0;\r\n\r\n $scope.toggleShowOptions = toggleShowOptions;\r\n $scope.defaultOptionLimit = 5;\r\n\r\n vm.treeOptions = {\r\n\r\n beforeDrag: function(src) {\r\n if (vm.restricted) return;\r\n\r\n if (src.$modelValue.SurveyParameterTypeId) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n\r\n accept: function (src, dest, destIndex) {\r\n if (vm.restricted) return;\r\n\r\n if (src.$modelValue.SurveyParameterTypeId) { //If source is an option\r\n return false;\r\n }\r\n else if (src.$modelValue.SurveyQuestionId) { //If source is a question\r\n if (dest.$parent.$modelValue && dest.$parent.$modelValue.SurveyParameterTypeId) {\r\n return true;\r\n }\r\n else if (!dest.$parent.$modelValue) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n //Should never get here\r\n return true;\r\n }\r\n },\r\n\r\n dropped: function (event) {\r\n if (vm.restricted) return;\r\n\r\n //If moving an option\r\n if (event.source.nodeScope.$modelValue.SurveyParameterTypeId) {\r\n // Removing the ability to reorder options so it should never get here.\r\n return;\r\n } else if (event.source.nodeScope.$modelValue.SurveyQuestionId) {\r\n //Check that we aren't dropping question in the same place\r\n if (event.source.index != event.dest.index ||\r\n (event.dest.nodesScope.$parent.$modelValue &&\r\n event.dest.nodesScope.$parent.$modelValue.$$hashKey != event.source.nodeScope.$parentNodeScope.$modelValue.$$hashKey)) {\r\n vm.setDirty();\r\n }\r\n }\r\n }\r\n\r\n };\r\n\r\n vm.searchTreeOptions = {\r\n\r\n accept: function (src, dest, destIndex) {\r\n //Do not allow items from template to be dropped into search result\r\n if (src.$treeScope.SearchResults == false) {\r\n return false;\r\n } else {\r\n if (!dest.$parent.$modelValue) {\r\n return true;\r\n }\r\n }\r\n },\r\n\r\n dropped: function (event) {\r\n //Do not fire when dragging a question back into the same position it came from\r\n if (event.dest.nodesScope.$treeScope.SearchResults == false) {\r\n var question = event.source.nodeScope.$modelValue;\r\n delete question.$id;\r\n question.PatientSurveyQuestionId = vm.numNewQuestions++;\r\n TemplatesService.removeContentIds(question);\r\n vm.setDirty();\r\n }\r\n }\r\n\r\n };\r\n\r\n\r\n\r\n if (PatientCareplanEditContent == null) {\r\n $state.go('patients.patient.careplan.surveys');\r\n } else {\r\n loadController();\r\n }\r\n\r\n function loadController() {\r\n DirtyPage.registerDirtyChecker(\"PatientPathwayEdit\", checkIfDirty);\r\n\r\n $scope.$on(\"$destroy\", function () {\r\n DirtyPage.unregisterDirtyChecker(\"PatientPathwayEdit\");\r\n });\r\n\r\n vm.patient = PatientCareplanEditContent.Patient;\r\n showHidePushButton(PatientCareplanEditContent.HasDirtySurveys);\r\n\r\n if (PatientCareplanEditContent.PatientSurvey) {\r\n surveySelected(PatientCareplanEditContent.PatientSurvey);\r\n }\r\n\r\n if (vm.userCanEditPatientSurvey) {\r\n CategoriesService.getAllCategories().then(function (data) {\r\n vm.categories = data;\r\n vm.categories.unshift(vm.selectedCategory);\r\n vm.buttonSearch();\r\n });\r\n ResourceLibraryService.getLanguages().then(function (data) {\r\n vm.languages = data;\r\n selectEnglish();\r\n });\r\n }\r\n\r\n vm.restricted = (!vm.userCanEditLockedPathways && vm.patientSurvey.LockStatus !== 0);\r\n\r\n if (vm.restricted) {\r\n let y = document.querySelector('.block-editable');\r\n y.classList.add('element-disabled')\r\n }\r\n }\r\n\r\n function toggleShowOptions(question){\r\n if(!question.optionLimit || question.optionLimit == $scope.defaultOptionLimit){\r\n question.optionLimit = question.SurveyOptions.length;\r\n }else{\r\n question.optionLimit = $scope.defaultOptionLimit;\r\n }\r\n }\r\n\r\n function selectEnglish() {\r\n var english = vm.languages.filter(function(language) {\r\n return language.Code === \"en\";\r\n })[0];\r\n selectLanguage(english);\r\n }\r\n\r\n function selectLanguage(language) {\r\n vm.selectedLanguage = language;\r\n vm.titleLanguage = language.Code.replace('-', '_');\r\n }\r\n\r\n function isValidTitle() {\r\n var surveyTitle = vm.patientSurvey.SurveyTexts['en'];\r\n return !vm.isDirty || (surveyTitle && surveyTitle.length > 0);\r\n }\r\n\r\n function checkSurveyName(data) {\r\n if (data.length <= 0) {\r\n return \"Must enter a care plan name\";\r\n }\r\n }\r\n\r\n function flash(index) {\r\n if (flashQuestion !== null && index == vm.patientSurvey.SurveyQuestions.length - 1) {\r\n flashQuestion = null;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n function refreshSurvey() {\r\n PatientSurveyService.getPatientSurvey($stateParams.patientId, $stateParams.PatientSurveyId).then(surveySelected);\r\n }\r\n\r\n function surveySelected(survey) {\r\n vm.patientSurvey = survey;\r\n vm.patientSurvey.TagArray = [];\r\n if (vm.patientSurvey.Tags != null){\r\n vm.patientSurvey.TagArray = vm.patientSurvey.Tags.split(';');\r\n }\r\n var treeScope = angular.element(document.getElementById(\"tree-template\")).scope();\r\n treeScope.SearchResults = false;\r\n }\r\n\r\n function showOptions(question) {\r\n return !PatientSurveyService.isBiometricQuestion(question)\r\n && !PatientSurveyService.isHealthTipQuestion(question)\r\n && question.SurveyQuestionTypeId != 17;\r\n }\r\n\r\n function buttonSearch() {\r\n vm.currentPage = 1;\r\n vm.performSearch();\r\n }\r\n\r\n function clearSearch() {\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.SearchResults = false;\r\n vm.activeSearch = false;\r\n vm.searchTextBox = '';\r\n vm.currentPage = 1;\r\n vm.performSearch();\r\n }\r\n\r\n function performSearch() {\r\n vm.searchText = vm.searchTextBox;\r\n vm.activeSearch = vm.searchText.length > 0;\r\n questionCategoryId = 0;\r\n if (vm.selectedCategory) {\r\n questionCategoryId = vm.selectedCategory.SurveyQuestionCategoryId;\r\n }\r\n PatientSurveyService.searchQuestionsForPatient(vm.patient.Id, vm.searchText, questionCategoryId, vm.LanguageId, vm.pageSize, vm.currentPage).then(function (data) {\r\n vm.searchResultQuestions = data.SearchResults;\r\n vm.total = data.ResultsCount;\r\n vm.noSearchResults = vm.searchResultQuestions.length === 0;\r\n\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.SearchResults = true;\r\n\r\n flagSearchedQuestions();\r\n });\r\n }\r\n\r\n function pushToTablet() {\r\n PatientSurveyService.pushSurveyToTablet($stateParams.patientId);\r\n vhSweetAlert.success('Tablet Push', 'Patient survey changes have been pushed to the patient\\'s tablet');\r\n showHidePushButton(false);\r\n }\r\n\r\n function sendPathwayStartMessage() {\r\n PatientHeaderService.sendPathwayStartMessage($stateParams.patientId);\r\n vhSweetAlert.success('Text Message Sent', 'A pathway due message has been sent to the patient.');\r\n }\r\n\r\n function removeQuestion(question, parentQuestions, index) {\r\n var text;\r\n if (PatientSurveyService.isHealthTipQuestion(question)) {\r\n text = 'Are you sure you want to remove this health tip?';\r\n } else {\r\n text = 'Are you sure you want to remove this question?';\r\n }\r\n vhSweetAlert.verify('Are you sure?', text, 'Remove').then(function(isConfirm) {\r\n if (isConfirm) {\r\n if(parentQuestions == undefined)\r\n vm.patientSurvey.SurveyQuestions.splice(index, 1);\r\n else {\r\n parentQuestions.splice(index, 1);\r\n }\r\n vm.setDirty();\r\n flagSearchedQuestions();\r\n }\r\n });\r\n }\r\n\r\n function removeQuestionFromQuestionList(questions, questionId) {\r\n //Recursively find the questionid in list of nested question/options and remove it\r\n lodash.forEach(questions, function (question) {\r\n lodash.forEach(question.SurveyOptions, function (option) {\r\n if (option.ChildQuestions && option.ChildQuestions.length > 0) {\r\n removeQuestionFromQuestionList(option.ChildQuestions, questionId);\r\n }\r\n });\r\n });\r\n lodash.remove(questions, function (question) { return question.PatientSurveyQuestionId === questionId; });\r\n }\r\n\r\n function addQuestionToSurvey(question) {\r\n var newQuestion = angular.copy(question);\r\n delete newQuestion.$id;\r\n delete newQuestion.ExistsInTemplate;\r\n newQuestion.PatientSurveyQuestionId = vm.numNewQuestions++;\r\n newQuestion.IsNew = true;\r\n\r\n vm.patientSurvey.SurveyQuestions.push(newQuestion);\r\n vm.setDirty();\r\n\r\n var scrollElement;\r\n if (vm.patientSurvey.SurveyQuestions.length > 1) {\r\n scrollElement = 'question' + (vm.patientSurvey.SurveyQuestions.length-2).toString();\r\n } else {\r\n scrollElement = \"tree-template\";\r\n }\r\n\r\n SmoothScroll.scroll(scrollElement, 'bottom');\r\n\r\n flashQuestion = newQuestion;\r\n flagSearchedQuestions();\r\n }\r\n\r\n vm.setDirty = function setDirty() {\r\n vm.isDirty = true;\r\n }\r\n\r\n function checkIfDirty() {\r\n return vm.isDirty;\r\n }\r\n\r\n vm.isValid = function() {\r\n return vm.patientSurvey.SurveyQuestions.length > 0 && isValidTitle();\r\n }\r\n\r\n vm.savePatientSurvey = function() {\r\n if(vm.alertsChanged) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/patientsurvey/patientsurveyalertchange.modal.html',\r\n controller: 'PatientSurveyAlertChangeController as vm',\r\n keyboard: false,\r\n resolve: {\r\n data: {\r\n PatientId: patientContent.PatientHeader.PatientId,\r\n PatientSurvey: vm.patientSurvey,\r\n PopulationId: patientContent.PatientHeader.PopulationId,\r\n }\r\n }\r\n });\r\n \r\n return modalInstance.result.then(function(logText) {\r\n // Set IDs of new questions to 0 so API knows what to do with them.\r\n vm.patientSurvey.SurveyQuestions.forEach(question => {\r\n if (question.IsNew === true) {\r\n delete question.IsNew;\r\n question.PatientSurveyQuestionId = 0;\r\n }\r\n });\r\n PatientSurveyService.submitPatientSurveyAlertChangeReason(patientContent.PatientHeader.PatientId, logText);\r\n return savePatientSurvey().then(vm.cancel);\r\n }, function() {\r\n //Gets here if the modal is canceled out of/closed\r\n vhSweetAlert.error('Changes not saved!', \"You've selected cancel, so changes you made were not saved\");\r\n });\r\n }\r\n else {\r\n // Set IDs of new questions to 0 so API knows what to do with them.\r\n vm.patientSurvey.SurveyQuestions.forEach(question => {\r\n if (question.IsNew === true) {\r\n delete question.IsNew;\r\n question.PatientSurveyQuestionId = 0;\r\n }\r\n });\r\n return savePatientSurvey().then(vm.cancel);\r\n }\r\n }\r\n\r\n vm.cancel = function() {\r\n vm.isDirty = false;\r\n PatientSurveyService.setLastEditedPatientSurveyId($stateParams.PatientSurveyId);\r\n $state.go('patients.patient.careplan.surveys');\r\n }\r\n\r\n function savePatientSurvey() {\r\n var patientSurvey = {\r\n PatientSurveyId: vm.patientSurvey.PatientSurveyId,\r\n Name: vm.patientSurvey.Name,\r\n StatusId: vm.patientSurvey.StatusId,\r\n PromptOrder: vm.patientSurvey.PromptOrder,\r\n SurveyTexts: vm.patientSurvey.SurveyTexts,\r\n SurveyQuestions: vm.patientSurvey.SurveyQuestions,\r\n Tags: vm.patientSurvey.Tags\r\n };\r\n\r\n return PatientSurveyService.savePatientSurvey(vm.patient.Id, patientSurvey)\r\n .then(function() {\r\n showHidePushButton(true);\r\n })\r\n .catch(function(err) {\r\n refreshSurvey();\r\n });\r\n }\r\n\r\n function findQuestion(questions, questionId) {\r\n var question = lodash.find(questions, function (q) { return q.SurveyQuestionId == questionId; });\r\n\r\n if (!question) {\r\n for (var i = 0; i < questions.length; i++) {\r\n for (var j = 0; j < questions[i].SurveyOptions.length; j++) {\r\n if (questions[i].SurveyOptions[j].ChildQuestions && questions[i].SurveyOptions[j].ChildQuestions.length > 0) {\r\n question = findQuestion(questions[i].SurveyOptions[j].ChildQuestions, questionId);\r\n if (question) {\r\n return question;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n return question;\r\n }\r\n }\r\n\r\n function flagSearchedQuestions() {\r\n //Mark searched questions with ExistsInTemplate property to true if a clone of that question exists in the template\r\n //so searched questions with a clone in the template will show up as dimmed\r\n for (var i = 0; i < vm.searchResultQuestions.length; i++) {\r\n var surveyQuestionId = vm.searchResultQuestions[i].SurveyQuestionId;\r\n var question = findQuestion(vm.patientSurvey.SurveyQuestions, surveyQuestionId);\r\n vm.searchResultQuestions[i].ExistsInTemplate = !!question;\r\n }\r\n }\r\n\r\n function showHidePushButton(showButton) {\r\n //Do not show push button if patient has no kit\r\n if (vm.patient.KitNo.length > 0) {\r\n vm.showPushToTableButton = showButton;\r\n } else {\r\n vm.showPushToTableButton = false;\r\n }\r\n }\r\n\r\n function scheduleChanged() {\r\n showHidePushButton(true);\r\n vm.setDirty();\r\n }\r\n\r\n vm.alertChanged = function() {\r\n vm.alertsChanged = true;\r\n vm.setDirty();\r\n }\r\n}\r\n\r\nangular.module('content.patientsurvey').controller('PatientSurveyEditController', PatientSurveyEditController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/patientsurvey/patientsurveyedit.tpl.html',\n '
      Pathway
      {{ vm.patientSurvey.Name }}
      Display Order:
      English title is required
      {{tag}}
      Add a new question or drag and drop questions here.
      = 0\" data-drag-enabled=\"vm.userCanEditPatientSurvey\">
        0\">
      Available Questions
        vm.pageSize\" ng-model=\"vm.currentPage\" max-size=\"5\" rotate=\"false\" boundary-links=\"true\" next-text=\"Next\" previous-text=\"Previous\" ng-change=\"vm.performSearch()\" num-pages=\"vhPaging.pages\">

      No results returned

      0\">
      ');\n}]);\n}(window, document, window.angular));","function PatientSurveyHistoryController($uibModalInstance, HistoryData, Milestones, $filter) {\r\n var vm = this;\r\n vm.ok = ok;\r\n vm.HistoryData = HistoryData;\r\n vm.Milestones = Milestones\r\n\r\n init();\r\n\r\n function init()\r\n {\r\n for(i = 0; i < vm.HistoryData.PatientSurveyCompliances.length; i++)\r\n {\r\n if (vm.HistoryData.PatientSurveyCompliances[i].CompletedOn_UTC != null){\r\n var historyRow = {};\r\n \r\n historyRow.TypeId = 10;\r\n historyRow.Text = \"Pathway questions were completed for this day\";\r\n historyRow.CreatedDateTime_UTC = vm.HistoryData.PatientSurveyCompliances[i].CompletedOn_UTC;\r\n historyRow.CreatedByLastName = \"System\";\r\n vm.HistoryData.PatientSurveyHistory.push(historyRow);\r\n }\r\n }\r\n\r\n switch(vm.HistoryData.StatusId){\r\n case 1: vm.HistoryData.Status = \"Active\"; break;\r\n case 2: vm.HistoryData.Status = \"Inactive\"; break;\r\n case 3: vm.HistoryData.Status = \"Discontinued\"; break;\r\n case 4: vm.HistoryData.Status = \"RuleBased\"; break;\r\n case 5: vm.HistoryData.Status = \"Pending\"; break;\r\n case 6: vm.HistoryData.Status = \"Deleted\"; break;\r\n case 7: vm.HistoryData.Status = \"Paused\"; break;\r\n }\r\n\r\n vm.HistoryData.StartDate = null;\r\n vm.HistoryData.NextDueDate = null;\r\n vm.HistoryData.EndDate = null;\r\n\r\n vm.HistoryData.AddedDate = new Date(vm.HistoryData.PatientSurveySchedules[0].CreatedDateTime_UTC);\r\n if(vm.HistoryData.PatientSurveySchedules[0].StartDate != null){\r\n vm.HistoryData.StartDate = parseJustDate(vm.HistoryData.PatientSurveySchedules[0].StartDate);\r\n }\r\n if(vm.HistoryData.PatientSurveyDue.length > 0){\r\n vm.HistoryData.NextDueDate = parseJustDate(vm.HistoryData.PatientSurveyDue[0].SurveyDate);\r\n }\r\n if(vm.HistoryData.PatientSurveySchedules[0].EndDate != null){\r\n vm.HistoryData.EndDate = parseJustDate(vm.HistoryData.PatientSurveySchedules[0].EndDate);\r\n }\r\n\r\n buildDescription();\r\n }\r\n\r\n function buildDescription(){\r\n var milestoneName = getMilestoneName(vm.HistoryData.PatientSurveySchedules[0].MilestoneId);\r\n vm.HistoryData.description = {\r\n all: $filter('schedule')(vm.HistoryData.PatientSurveySchedules[0], milestoneName),\r\n start: $filter('schedule')(vm.HistoryData.PatientSurveySchedules[0], milestoneName, 'start'),\r\n end: $filter('schedule')(vm.HistoryData.PatientSurveySchedules[0], milestoneName, 'end'),\r\n recurrence: $filter('schedule')(vm.HistoryData.PatientSurveySchedules[0], '', 'recurrence'),\r\n time: $filter('schedule')(vm.HistoryData.PatientSurveySchedules[0], '', 'time'),\r\n oldLogic : vm.HistoryData.PatientSurveySchedules[0].StartDateOldLogic\r\n };\r\n } \r\n\r\n function getMilestoneName(milestoneId) {\r\n var retVal = \"\";\r\n if (milestoneId != null) {\r\n for(var i = 0; i

      Pathway History for {{vm.HistoryData.Name}}

      StatusAddedStartNext DueEnd
      {{vm.HistoryData.Status}}{{vm.HistoryData.AddedDate | date : \"EEE, MMM d, yyyy\"}}N/A{{vm.HistoryData.StartDate | date : \"EEE, MMM d, yyyy\"}}None {{vm.HistoryData.NextDueDate | date : \"EEE, MMM d, yyyy\"}}None{{vm.HistoryData.EndDate | date : \"EEE, MMM d, yyyy\"}}None
       Pathway Times Start Date Recurrence End Date
      {{vm.HistoryData.description.time}}{{vm.HistoryData.description.start}} {{vm.HistoryData.description.recurrence}}{{vm.HistoryData.description.end}}
      DateTimeTypeHistoryAuthor
      {{row.CreatedDateTime_UTC | datetime}} {{row.CreatedDateTime_UTC | date : \"HH:mm\"}}{{row.TypeId | pathwayHistoryType}}{{row.CreatedByLastName}}, {{row.CreatedByFirstName}} {{row.CreatedByTitle}}
      ');\n}]);\n}(window, document, window.angular));","function PatientSurveyKitHistoryController($uibModalInstance, patientId, patientName, PatientSurveyService) {\r\n var vm = this;\r\n\r\n vm.patientId = patientId;\r\n vm.patientName = patientName;\r\n vm.pageSize = 10;\r\n vm.historyDetail = {};\r\n vm.historyDetailVisible = {};\r\n\r\n gotoPage(1);\r\n\r\n function getKitHistory() {\r\n PatientSurveyService.getPatientSurveyKitHistory(vm.patientId, vm.pageSize, vm.currentPage).then( function (data) { \r\n vm.KitHistory = data; \r\n vm.pageCount = Math.floor( (vm.KitHistory.TotalCount / vm.pageSize) + 1 );\r\n }); \r\n }\r\n\r\n\r\n\r\n vm.showHistoryDetail = showHistoryDetail;\r\n function showHistoryDetail(row) {\r\n vm.historyDetailVisible[row.Index] = !vm.historyDetailVisible[row.Index];\r\n if(vm.historyDetailVisible[row.Index] && !vm.historyDetail[row.Index]) {\r\n PatientSurveyService.getPatientSurveyKitHistoryDetail(vm.patientId, row.KitNo, row.SyncTime_UTC).then( function (data) { \r\n vm.historyDetail[row.Index] = data; \r\n }); \r\n }\r\n }\r\n\r\n vm.gotoPage = gotoPage;\r\n function gotoPage(pageNumber) {\r\n vm.currentPage = pageNumber;\r\n getKitHistory(pageNumber);\r\n }\r\n\r\n vm.ok = ok;\r\n function ok() {\r\n $uibModalInstance.close();\r\n }\r\n\r\n vm.range = range;\r\n function range(total) {\r\n var result = [];\r\n for (var i=1; i<=total; i++) {\r\n result.push(i);\r\n }\r\n return result;\r\n }\r\n\r\n}\r\n\r\nangular.module('content.patientsurvey').controller('PatientSurveyKitHistoryController', PatientSurveyKitHistoryController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/patientsurvey/patientsurveykithistory.modal.html',\n '

      Kit History for {{vm.patientName}}

       DateTimeKitCount
      {{row.SyncTime_UTC | datetime}} {{row.SyncTime_UTC | date : \"HH:mm\"}}
      Pathway NameSchedule
      ');\n}]);\n}(window, document, window.angular));","function PatientSurveysController($timeout, PatientCareplanContent, patientContent, PatientSurveyService, $stateParams, $state, $filter, lodash, vhSweetAlert, PermissionService, $scope, $q, PatientHeaderService, $uibModal, ScheduleService, lockStatusEnum) {\r\n var vm = this;\r\n\r\n $scope.lockStatusEnum = lockStatusEnum;\r\n\r\n // functions\r\n vm.selectPatientSurvey = selectPatientSurvey;\r\n vm.addTemplateToPatient = addTemplateToPatient;\r\n vm.selectSurveyTemplate = selectSurveyTemplate;\r\n vm.pushToTablet = pushToTablet;\r\n vm.sendPathwayStartMessage = sendPathwayStartMessage;\r\n vm.flash = flash;\r\n vm.checkAddTempaltesToPatient = checkAddTempaltesToPatient;\r\n vm.selectToggle = selectToggle;\r\n vm.itemsSelected = itemsSelected;\r\n vm.editPathways = editPathways;\r\n vm.showKitHistory = showKitHistory;\r\n vm.toggleExpansion = toggleExpansion;\r\n vm.refresh = refresh;\r\n vm.getMilestoneName = getMilestoneName;\r\n\r\n\r\n $scope.milestones = [];\r\n \r\n var addedSurvey = {}; \r\n\r\n loadController();\r\n\r\n $scope.$on('patientsurveydeleted', function (e, surveyId) {\r\n var survey = lodash.find(vm.patientSurveys, { PatientSurveyId: surveyId });\r\n if(survey != null){\r\n survey.StatusId = 6;\r\n setList(survey);\r\n } \r\n showHidePushButton(true);\r\n });\r\n\r\n $scope.$on('patientsurveystatuschanged', function (e, surveyId, statusid) {\r\n var survey = lodash.find(vm.patientSurveys, { PatientSurveyId: surveyId });\r\n if(survey != null){\r\n survey.StatusId = statusid;\r\n setList(survey);\r\n }\r\n showHidePushButton(true);\r\n });\r\n\r\n function loadController() {\r\n vm.patientSurveys = PatientCareplanContent.PatientSurveys;\r\n vm.surveyTemplates = [];\r\n vm.surveyTemplatesCount = 0;\r\n vm.LanguageId = 1;\r\n vm.SelectedGroup = null;\r\n vm.generalSurveyTemplates = [{ name: 'All Patient', templates: []}, { name: 'Unassigned', templates: []}];\r\n vm.patientId = patientContent.patient.id;\r\n vm.patientName = patientContent.patient.name.lastName + ', ' + patientContent.patient.name.firstName;\r\n vm.patientSurveyId = $state.params.PatientSurveyId;\r\n vm.showPushToTableButton = false;\r\n vm.showSendPathwayStartMessageButton = patientContent.patient.serviceLevelTypeId == 9 && patientContent.patient.hasSurveysDue && PermissionService.userHasPermission([\"PatientDemographicsWrite\"]);\r\n vm.userCanAddPatientSurvey = PermissionService.userHasPermission([\"PatientCareplanWrite\"]);\r\n vm.ShowYesterdaysPathways = false;\r\n vm.collapsed = {};\r\n vm.collapsed.today = vm.collapsed.yesterday = vm.collapsed.active = vm.collapsed.pending = false;\r\n vm.collapsed.inactive = vm.collapsed.discontinued = true;\r\n\r\n\r\n showHidePushButton(PatientCareplanContent.HasDirtySurveys);\r\n\r\n lodash.forEach(vm.patientSurveys, function(survey) {\r\n prepSurvey(survey);\r\n });\r\n\r\n\r\n vm.AvailableTemplates = PatientCareplanContent.AvailableTemplates;\r\n \r\n PatientCareplanContent.AvailableTemplates.map(function (template) {\r\n if(template.IsDefault) {\r\n addCategory('All Patients', template, -1);\r\n }\r\n\r\n if(!template.IsDefault && template.SurveyPatientPopulations.length === 0) {\r\n addCategory('Unassigned', template, -2);\r\n }\r\n\r\n template.SurveyPatientPopulations.map(function (population) {\r\n addCategory(population.PopulationName, template, 0);\r\n });\r\n\r\n });\r\n\r\n //Select the last edited patient survey\r\n var selectedPatientSurveyId = PatientSurveyService.getLastEditedPatientSurveyId();\r\n if (selectedPatientSurveyId > 0 && !$state.includes('patients.patient.careplan.surveys.survey') && vm.patientSurveys && vm.patientSurveys.length > 0) {\r\n vm.selectPatientSurvey(selectedPatientSurveyId);\r\n PatientSurveyService.setLastEditedPatientSurveyId(-1);\r\n }\r\n\r\n if ($state.params.templateId !== undefined && vm.surveyTemplates && vm.surveyTemplates.length > 0) {\r\n vm.selectSurveyTemplate($state.params.templateId);\r\n }\r\n\r\n PatientSurveyService.getTodaysPatientCareplans($stateParams.patientId).then(\r\n function (data) {\r\n vm.todaysCareplans = data;\r\n vm.lastKitSyncDatetimeTooltip = \"Last time patient's pathways' schedules synced on kit: \" + $filter('datetime')(vm.todaysCareplans.LastKitSyncDateTime_UTC, 'datetime');\r\n }\r\n );\r\n \r\n ScheduleService.getMilestones().then(function(response){\r\n $scope.milestones = response.data;\r\n });\r\n\r\n }\r\n\r\n function prepSurvey(survey){\r\n survey.SurveyDate = null;\r\n survey.selected = false;\r\n setList(survey);\r\n lodash.forEach(survey.PatientSurveyDue, function (surveyDue){\r\n if (surveyDue.EventTypeId == 2){\r\n survey.SurveyDate = parseJustDate(surveyDue.SurveyDate);\r\n } \r\n })\r\n }\r\n\r\n function setList(survey){\r\n switch(survey.StatusId){\r\n case 1: survey.ListId = 1; break; // Active\r\n case 2: survey.ListId = 3; break; // Inactive\r\n case 3: survey.ListId = 4; break; // Discontinued\r\n case 4: survey.ListId = 1; break; // RuleBases\r\n case 5: survey.ListId = 2; break; // Pending\r\n case 6: survey.ListId = 4; break; // Deleted\r\n case 7: survey.ListId = 2; break; // Paused\r\n }\r\n }\r\n\r\n function refresh(){\r\n PatientSurveyService.getPatientCareplanContent($stateParams.patientId).then(function(data){\r\n PatientCareplanContent = data;\r\n loadController();\r\n });\r\n }\r\n\r\n function selectToggle() {\r\n if (lodash.any(vm.patientSurveys, 'selected', true)) {\r\n lodash.forEach(vm.patientSurveys, function(data) {\r\n data.selected = false;\r\n })\r\n } else {\r\n expandAllNodes();\r\n lodash.forEach(vm.patientSurveys, function(data) {\r\n if(data.StatusId != 6){\r\n data.selected = true;\r\n } \r\n })\r\n }\r\n }\r\n\r\n function itemsSelected() {\r\n return lodash.any(vm.patientSurveys, 'selected', true);\r\n }\r\n\r\n function editPathways() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/editpathways.modal.html',\r\n controller: 'EditPathwaysController as vm',\r\n keyboard: false,\r\n size: 'sm',\r\n resolve: {\r\n pathwayCount: function() {\r\n return {\r\n count: lodash.filter(vm.patientSurveys, 'selected', true).length\r\n };\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (editData) {\r\n if ( editData.action == 1 && editData.time) {\r\n var changedSurveySchedules = [];\r\n lodash.forEach(vm.patientSurveys, function(data) {\r\n if (data.selected == true) {\r\n data.selected = false;\r\n data.SurveySchedule.SchedulePromptTimeOfDay = $filter('date')(editData.time, 'HH:mm:ss');\r\n changedSurveySchedules.push(data.SurveySchedule);\r\n }\r\n });\r\n\r\n PatientSurveyService.savePatientSurveySchedules(changedSurveySchedules).then(function (data) {\r\n showHidePushButton(true);\r\n });\r\n }\r\n else if (editData.action == 2){\r\n var changedSurveys = [];\r\n lodash.forEach(vm.patientSurveys, function(data) {\r\n if (data.selected == true) {\r\n data.selected = false;\r\n changedSurveys.push(data.PatientSurveyId);\r\n $scope.$emit('patientsurveystatuschanged', data.PatientSurveyId, 3);\r\n }\r\n });\r\n\r\n PatientSurveyService.discontinuePatientSurvey($stateParams.patientId, changedSurveys).then(function (data) {\r\n showHidePushButton(true);\r\n }); \r\n }\r\n }, function () {\r\n });\r\n }\r\n\r\n function showKitHistory() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/patientsurvey/patientsurveykithistory.modal.html',\r\n controller: 'PatientSurveyKitHistoryController as vm',\r\n keyboard: false,\r\n size: 'lg',\r\n resolve: {\r\n patientId: vm.patientId,\r\n patientName: function () {\r\n return vm.patientName;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function () {\r\n }, function () {});\r\n } \r\n\r\n function addCategory(name, template, order) {\r\n var found = lodash.find(vm.surveyTemplates, { name: name });\r\n if (found === undefined) {\r\n vm.surveyTemplates.push({ name: name, templates: [template], order: order });\r\n } else {\r\n found.order = order;\r\n found.templates.push(template);\r\n }\r\n vm.surveyTemplatesCount++;\r\n }\r\n\r\n function selectPatientSurvey(patientSurveyId) {\r\n vm.patientSurveyId = patientSurveyId;\r\n vm.surveyTemplateId = 0;\r\n $state.go('patients.patient.careplan.surveys.survey', { PatientSurveyId: patientSurveyId, 'isYesterday': vm.ShowYesterdaysPathways }); \r\n }\r\n\r\n function pushToTablet() {\r\n PatientSurveyService.pushSurveyToTablet($stateParams.patientId);\r\n vhSweetAlert.success('Tablet Push', 'Patient survey changes have been pushed to the patient\\'s tablet');\r\n showHidePushButton(false);\r\n }\r\n\r\n function selectSurveyTemplate(surveyTemplateId) {\r\n vm.patientSurveyId = 0;\r\n vm.surveyTemplateId = surveyTemplateId;\r\n lodash.forEach(vm.surveyTemplates, function (surveyTemplate) {\r\n lodash.forEach(surveyTemplate.templates, function (survey) {\r\n if (survey.SurveyTemplateId == surveyTemplateId) {\r\n surveyTemplate.collapsed = true;\r\n return;\r\n }\r\n })\r\n })\r\n $state.go('patients.patient.careplan.surveys.templates.template', { templateId: surveyTemplateId });\r\n }\r\n\r\n function checkAddTempaltesToPatient(surveyTemplates) {\r\n if(surveyTemplates.length > 9) {\r\n vhSweetAlert.verify('Are you sure?', 'This will add ' + surveyTemplates.length + ' pathways to this patient.', 'Add').then(function(isVerify){\r\n if(isVerify) {\r\n addTemplateToPatient(surveyTemplates);\r\n }\r\n });\r\n } else {\r\n addTemplateToPatient(surveyTemplates);\r\n }\r\n }\r\n\r\n function addTemplateToPatient(surveyTemplates) {\r\n\r\n var promises = [];\r\n var hasError = false;\r\n\r\n lodash.forEach(surveyTemplates, function (surveyTemplate) {\r\n promises.push(PatientSurveyService.createPatientSurvey($stateParams.patientId, surveyTemplate.SurveyTemplateId));\r\n })\r\n\r\n $q.all(promises).then(function (allData) {\r\n lodash.forEach(allData, function (data, idx) {\r\n if (data !== null) {\r\n prepSurvey(data)\r\n vm.patientSurveys.push(data);\r\n addedSurvey = data;\r\n if (allData.length - 1 === idx) {\r\n selectPatientSurvey(data.PatientSurveyId);\r\n showHidePushButton(true);\r\n }\r\n } else {\r\n hasError = true;\r\n }\r\n });\r\n });\r\n\r\n if (hasError) {\r\n vhSweetAlert.error('Survey error', 'One or more pathways could not be added to patient. These surveys were recently deleted or marked as inactive.');\r\n }\r\n }\r\n\r\n function showHidePushButton(showButton) {\r\n //Do not show push button if patient has no kit\r\n if (patientContent.patient.kitNumber !== null && patientContent.patient.kitNumber.length > 0) {\r\n vm.showPushToTableButton = showButton;\r\n } else {\r\n vm.showPushToTableButton = false;\r\n }\r\n }\r\n\r\n function flash(survey) {\r\n if (survey === addedSurvey) {\r\n addedSurvey = {};\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function sendPathwayStartMessage() {\r\n PatientHeaderService.sendPathwayStartMessage($stateParams.patientId);\r\n vhSweetAlert.success('Text Message Sent', 'A pathway due message has been sent to the patient.');\r\n }\r\n vm.reloadState = function () {\r\n vm.patientSurveyId = ''\r\n $state.go('patients.patient.careplan.surveys')\r\n }\r\n function getMilestoneName(milestoneId) {\r\n if (milestoneId != null) {\r\n for(var i = 0; i <$scope.milestones.length; ++i){\r\n if($scope.milestones[i].MilestoneId === milestoneId){\r\n return $scope.milestones[i].Name;\r\n }\r\n }\r\n }\r\n return \"\";\r\n }\r\n\r\n function toggleExpansion() {\r\n if (vm.toggleExpand) {\r\n expandAllNodes();\r\n }\r\n else {\r\n collapseAllNodes();\r\n }\r\n }\r\n\r\n function expandAllNodes() {\r\n vm.collapsed.today = vm.collapsed.yesterday = vm.collapsed.active = vm.collapsed.pending = vm.collapsed.inactive = vm.collapsed.discontinued = false;\r\n vm.toggleExpand = false;\r\n }\r\n\r\n function collapseAllNodes() {\r\n vm.collapsed.today = vm.collapsed.yesterday = vm.collapsed.active = vm.collapsed.pending = vm.collapsed.inactive = vm.collapsed.discontinued = true;\r\n vm.toggleExpand = true;\r\n } \r\n\r\n // JavaScript Date is the number of milliseconds since the epoch in UTC. So when it parses just Date (with no time)\r\n // it will default the time to midnight. The causes a problem when the Date is displayed using ToString()\r\n // because ToString() will convert the Date into the local timezone of the browser and can display the wrong day.\r\n // For example, new Date(\"2019-01-11\") is the same as new Date(\"2019-01-11T00:00:00Z\") and if your browser is in CST timezone\r\n // when you call ToString() it will subtract 6 hours from 2019-01-11 00:00 and thus display 2019-01-10 18:00. \r\n // To counter this, we need to add the timezone offset when we create the date object.\r\n function parseJustDate( dateStr ){\r\n var date = new Date(dateStr)\r\n var userTimezoneOffset = date.getTimezoneOffset() * 60000;\r\n return new Date(date.getTime() + userTimezoneOffset);\r\n } \r\n}\r\n\r\nangular.module('content.patientsurvey').controller('PatientSurveysController', PatientSurveysController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/patientsurvey/patientsurveys.tpl.html',\n '
      Patient Pathways
      Yesterday
      {{vm.todaysCareplans.YesterdayPathways.length}}
      Active {{Active.length}}
      Pending {{Pending.length}}
      Inactive {{Inactive.length}}
      Discontinued {{Discontinued.length}}
      Available {{vm.surveyTemplatesCount}}

       {{vm.SelectedGroup.name}}

      {{surveyTemplate.Name}} {{surveyTemplate.SurveySchedule | schedule : vm.getMilestoneName(surveyTemplate.SurveySchedule.MilestoneId) }}

      No Pathways

      {{surveyTemplate.Name}} {{surveyTemplate.SurveySchedule | schedule : vm.getMilestoneName(surveyTemplate.SurveySchedule.MilestoneId) }}

      No Pathways

      ');\n}]);\n}(window, document, window.angular));","function PatientSurveyTemplateController(Template, PatientSurveyService, AvailableLanguages, $scope) {\r\n vm = this;\r\n\r\n vm.selectedTemplate = Template;\r\n vm.showOptions = showOptions;\r\n vm.AvailableLanguages = AvailableLanguages;\r\n\r\n vm.getMilestoneName = getMilestoneName;\r\n\r\n function showOptions(question) {\r\n return !PatientSurveyService.isBiometricQuestion(question) && !PatientSurveyService.isHealthTipQuestion(question);\r\n }\r\n\r\n vm.toggleLanguage = function(language) {\r\n vm.Language = language;\r\n }; \r\n\r\n function getMilestoneName(milestoneId) {\r\n if (milestoneId != null) {\r\n for(var i = 0; i <$scope.milestones.length; ++i){\r\n if($scope.milestones[i].MilestoneId === milestoneId){\r\n return $scope.milestones[i].Name;\r\n }\r\n }\r\n }\r\n \r\n return \"\";\r\n }\r\n}\r\n\r\nangular.module(\"content.patientsurvey\").controller(\"PatientSurveyTemplateController\", PatientSurveyTemplateController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/patientsurvey/template.tpl.html',\n '
      {{vm.selectedTemplate.Name}}{{vm.selectedTemplate.SurveySchedule | schedule : vm.getMilestoneName(vm.selectedTemplate.SurveySchedule.MilestoneId) }}
      0\" vh-language=\"\" ng-model=\"vm.Language.Code\">
      No questions exist in this survey.
      ');\n}]);\n}(window, document, window.angular));","function CategoriesService(QuestionCategoryRepository, QuestionRepository) {\r\n\r\n return {\r\n\r\n importQuestionCategories: function(data){\r\n var promise = QuestionCategoryRepository.importQuestionCategories(data);\r\n return promise;\r\n },\r\n\r\n getAllCategories: function () {\r\n var promise = QuestionCategoryRepository.getAll();\r\n return promise;\r\n },\r\n\r\n createCategory: function (data) {\r\n var promise = QuestionCategoryRepository.create(data);\r\n return promise;\r\n },\r\n\r\n saveCategory: function (data) {\r\n var promise = QuestionCategoryRepository.save(data);\r\n return promise;\r\n },\r\n\r\n deleteCategory: function(categoryId) {\r\n QuestionCategoryRepository.delete(categoryId);\r\n },\r\n\r\n searchCategories: function(searchText) {\r\n var promise = QuestionCategoryRepository.searchCategories(searchText);\r\n return promise;\r\n },\r\n\r\n getQuestion: function(id) {\r\n var promise = QuestionRepository.get(id);\r\n return promise;\r\n },\r\n\r\n deleteMasterQuestion: function(id) {\r\n return QuestionRepository.delete(id);\r\n }\r\n };\r\n}\r\n\r\nangular.module('content.services').factory('CategoriesService', CategoriesService);\r\n","function PatientSurveyService(PatientSurveyRepository, PatientSurveyScheduleRepository, $http, $filter, ResponseTransformers) {\r\n var lastEditedPatientSurveyId = -1;\r\n var transform$Ref = ResponseTransformers.transform$Ref;\r\n return {\r\n getPatientCareplanContent: function (patientId) {\r\n var url = '/api/cgp/patient/' + patientId + '/careplan';\r\n return $http.get(url).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getTemplateForPatient: function (patientId, surveyTemplateId) {\r\n var url = '/api/cgp/patient/' + patientId + '/surveyTemplate/' + surveyTemplateId;\r\n return $http.get(url, {\r\n transformResponse: transform$Ref\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getTodaysPatientCareplans: function (patientId) {\r\n var url = '/api/cgp/patient/' + patientId + '/careplan/today';;\r\n return $http.get(url).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getPatientCareplanEditContent: function (patientId, patientSurveyId) {\r\n var url = '/api/cgp/patient/' + patientId + '/careplan/' + patientSurveyId + '/editcontent';\r\n return $http.get(url).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n searchQuestionsForPatient: function (patientId, searchText, categoryId, languageId, pageSize, page) {\r\n var self = this;\r\n var url = '/api/cgp/patient/' + patientId + '/surveyquestion';\r\n var params = {\r\n searchText: searchText,\r\n categoryId: categoryId,\r\n languageId: languageId,\r\n pageSize: pageSize,\r\n page: page\r\n };\r\n return $http.get(url, {\r\n params: params,\r\n transformResponse: transform$Ref\r\n }).then(function (response) {\r\n response.data.SearchResults = $filter('orderBy')(response.data.SearchResults, function (value) {\r\n return self.isBiometricQuestion(value) ? 0 : 1;\r\n });\r\n\r\n return response.data;\r\n });\r\n },\r\n\r\n getPatientSurvey: function (patientId, patientSurveyId, presentUnansweredQuestions) {\r\n var promise = PatientSurveyRepository.get(patientId, patientSurveyId, presentUnansweredQuestions);\r\n return promise;\r\n },\r\n\r\n createPatientSurvey: function (patientId, surveyTemplateId) {\r\n var promise = PatientSurveyRepository.create(patientId, surveyTemplateId);\r\n return promise;\r\n },\r\n\r\n savePatientSurvey: function (patientId, patientSurvey) {\r\n var promise = PatientSurveyRepository.save(patientId, patientSurvey);\r\n return promise;\r\n },\r\n\r\n deletePatientSurvey: function (patientId, patientSurveyId) {\r\n var promise = PatientSurveyRepository.delete(patientId, patientSurveyId);\r\n return promise;\r\n },\r\n\r\n assignTemplate: function(surveyTemplateId, preview) {\r\n var promise = PatientSurveyRepository.createByTemplate(surveyTemplateId, preview);\r\n return promise;\r\n },\r\n\r\n unassignTemplate: function(surveyTemplateId, preview) {\r\n var promise = PatientSurveyRepository.deleteByTemplate(surveyTemplateId, preview);\r\n return promise;\r\n },\r\n\r\n savePatientSurveySchedule: function (patientSurveySchedule) {\r\n var promise = PatientSurveyScheduleRepository.save(patientSurveySchedule);\r\n return promise;\r\n },\r\n\r\n savePatientSurveySchedules: function(patientSurveySchedules) {\r\n return PatientSurveyScheduleRepository.saveSchedules(patientSurveySchedules);\r\n },\r\n\r\n isBiometricQuestion: function (question) {\r\n if ((question.SurveyQuestionTypeId >= 1 && question.SurveyQuestionTypeId <= 4) ||\r\n (question.SurveyQuestionTypeId >= 11 && question.SurveyQuestionTypeId <= 16) ||\r\n (question.SurveyQuestionTypeId >= 18 && question.SurveyQuestionTypeId <= 21)) {\r\n return true;\r\n }\r\n return false;\r\n },\r\n\r\n isVideoQuestion: function (question) {\r\n return (question.SurveyQuestionTypeId == 9);\r\n },\r\n\r\n isHealthTipQuestion: function (question) {\r\n return (question.SurveyQuestionTypeId == 8);\r\n },\r\n\r\n pushSurveyToTablet: function(patientId) {\r\n var promise = PatientSurveyRepository.pushSurveyToTablet(patientId);\r\n return promise;\r\n },\r\n\r\n setPatientSurveyStatus: function (patientId, patientSurveyId, statusId){\r\n var promise = PatientSurveyRepository.setPatientSurveyStatus(patientId, patientSurveyId, statusId);\r\n return promise;\r\n },\r\n\r\n discontinuePatientSurvey: function (patientId, data){\r\n postData = {};\r\n for(var i = 0; i < data.length; i++){\r\n postData[data[i]] = 3;\r\n }\r\n var promise = PatientSurveyRepository.discontinuePatientSurvey(patientId, postData);\r\n return promise;\r\n },\r\n\r\n getPatientSurveyAlertChangeReasons: function() {\r\n return $http.get('/api/pathwayAlertChangeReason').then((response) => response.data);\r\n },\r\n\r\n submitPatientSurveyAlertChangeReason: function(patientId, changeReason) {\r\n let data = { Text: changeReason };\r\n return $http.post(`/api/Patient/${patientId}/profilehistory`, data).then((response) => response.data);\r\n },\r\n\r\n getPatientSurveyHistory: function (patientId, patientSurveyId) {\r\n var url = '/api/Patient/' + patientId + '/PatientSurvey/' + patientSurveyId + '/History';\r\n return $http.get(url).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getPatientSurveyKitHistory: function (patientId, pageSize, pageNumber) {\r\n var url = '/api/Patient/' + patientId + '/KitSyncHistory?PageSize=' + pageSize + '&PageNumber=' + pageNumber;\r\n return $http.get(url).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n getPatientSurveyKitHistoryDetail: function (patientId, kitNo, syncTime) {\r\n var url = '/api/Patient/' + patientId + '/KitSyncHistoryDetail/' + kitNo + '?syncTime=' + syncTime;\r\n return $http.get(url).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n setLastEditedPatientSurveyId: function(surveyId) {\r\n lastEditedPatientSurveyId = surveyId;\r\n },\r\n\r\n getLastEditedPatientSurveyId: function() {\r\n return lastEditedPatientSurveyId;\r\n }\r\n };\r\n}\r\n\r\nangular.module('content.services').factory('PatientSurveyService', PatientSurveyService);\r\n","function TemplatesService(TemplateRepository, QuestionRepository, QuestionTypeRepository, TemplateScheduleRepository, PopulationsRepository,\r\n PatientLanguageRepository, TagRepository, SurveyQuestionType, $filter, repository, $http, $q) {\r\n \r\n var templateGroupRepo = repository.new(\"TemplateGroup\");\r\n var lastEditedTemplateId = -1;\r\n var availableLanguages = [];\r\n\r\n function getAvailableLanguages() {\r\n if (availableLanguages.length > 0) {\r\n return $q.resolve(availableLanguages);\r\n }\r\n return PatientLanguageRepository.getAll().then(function(data) {\r\n availableLanguages = data;\r\n return data;\r\n })\r\n };\r\n\r\n return {\r\n\r\n importTemplates(templates){\r\n return TemplateRepository.importTemplates(templates);\r\n },\r\n getValidationData(){\r\n return TemplateRepository.getValidationData();\r\n }, \r\n getAllTemplates: function () {\r\n var promise = TemplateRepository.getAll();\r\n return promise;\r\n },\r\n\r\n getTemplateGroup: function (id) {\r\n return templateGroupRepo.get(id).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getTemplate: function (id) {\r\n var promise = TemplateRepository.get(id);\r\n return promise;\r\n },\r\n\r\n searchTemplates: function (searchText) {\r\n var promise = TemplateRepository.searchTemplates(searchText);\r\n return promise;\r\n },\r\n\r\n saveTemplate: function(surveyTemplate) {\r\n return TemplateRepository.save(surveyTemplate).then(function (response) {\r\n return response.data;\r\n })\r\n },\r\n\r\n deleteTemplate: function (surveyTemplateId) {\r\n return TemplateRepository.delete(surveyTemplateId);\r\n },\r\n\r\n getFileUploader: function () {\r\n return TemplateRepository.getFileUploader();\r\n },\r\n\r\n getQuestionTypes: function () {\r\n var promise = QuestionTypeRepository.getAll();\r\n return promise;\r\n },\r\n\r\n getUncategorizedQuestions: function(searchText, languageId, pageSize, page) {\r\n var promise = QuestionRepository.getUncategorized(searchText, languageId, pageSize, page);\r\n return promise;\r\n },\r\n\r\n clearQuestionsCache: function(){\r\n QuestionRepository.clearCache();\r\n },\r\n\r\n searchQuestions: function (searchText, categoryId, languageId, pageSize, page) {\r\n var self = this;\r\n var promise = QuestionRepository.searchQuestions(searchText, categoryId, languageId, pageSize, page).then(function (data) {\r\n data.SearchResults = $filter('orderBy')(data.SearchResults, function (value) {\r\n return self.isBiometricQuestion(value) ? 0 : 1;\r\n });\r\n\r\n return data;\r\n });\r\n return promise;\r\n },\r\n\r\n createQuestion: function (question) {\r\n var promise = QuestionRepository.create(question);\r\n return promise;\r\n },\r\n\r\n saveQuestion: function (question, templatesToUpdate) {\r\n var promise = QuestionRepository.save(question, templatesToUpdate);\r\n return promise;\r\n },\r\n\r\n lockQuestion: function(id, revisionId, templateId) {\r\n return $http.get(`/api/SurveyQuestion/${id}/${revisionId}/${templateId}/lock`).then(function(data) {\r\n return data;\r\n });\r\n },\r\n\r\n unlockQuestion: function(id, revisionId, templateId) {\r\n return $http.get(`/api/SurveyQuestion/${id}/${revisionId}/${templateId}/unlock`).then(function(data) {\r\n return data;\r\n });\r\n },\r\n\r\n lockPathway: function(id) {\r\n return $http.get(`/api/SurveyTemplate/${id}/lock`).then(function(data) {\r\n return data;\r\n });\r\n },\r\n\r\n unlockPathway: function(id) {\r\n return $http.get(`/api/SurveyTemplate/${id}/unlock`).then(function(data) {\r\n return data;\r\n });\r\n },\r\n\r\n deleteQuestion: function (questionId) {\r\n QuestionRepository.delete(questionId);\r\n },\r\n\r\n saveTemplateSchedule: function(surveySchedule) {\r\n var promise = TemplateScheduleRepository.save(surveySchedule);\r\n return promise;\r\n },\r\n\r\n saveTemplateSchedules: function(surveySchedules) {\r\n return $http.post(\"/api/SurveySchedule/UpdateSurveySchedules\", surveySchedules).then(function(data) {\r\n return data;\r\n });\r\n },\r\n\r\n getPopulations: function(options) {\r\n options = options || { enabledOnly: true, includeAllPatients: true };\r\n \r\n var promise = PopulationsRepository.getAll(options);\r\n return promise;\r\n },\r\n\r\n getFormsInPopulation: function(populationId){\r\n return $http.get('/api/population/' + populationId + '/forms').then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n isBiometricQuestion: function (question) {\r\n if ((question.SurveyQuestionTypeId >= 1 && question.SurveyQuestionTypeId <= 4) ||\r\n (question.SurveyQuestionTypeId >= 11 && question.SurveyQuestionTypeId <= 16) ||\r\n (question.SurveyQuestionTypeId >= 18 && question.SurveyQuestionTypeId <= 21)) {\r\n return true;\r\n }\r\n return false;\r\n },\r\n\r\n isVideoQuestion: function (question) {\r\n return (question.SurveyQuestionTypeId == SurveyQuestionType.Video);\r\n },\r\n\r\n isHealthTipQuestion: function (question) {\r\n return (question.SurveyQuestionTypeId == SurveyQuestionType.HealthTip);\r\n },\r\n\r\n isCustomResponseQuestion: function (question) {\r\n return (question.SurveyQuestionTypeId == 17);\r\n },\r\n\r\n isSingleSelectQuestion: function(question) {\r\n return (question.SurveyQuestionTypeId == SurveyQuestionType.SingleSelection || question.SurveyQuestionTypeId == SurveyQuestionType.YesNo);\r\n },\r\n\r\n isMultiSelectQuestion: function(question) {\r\n return (question.SurveyQuestionTypeId == SurveyQuestionType.MultiSelection);\r\n },\r\n\r\n setQuestionAsTemp: function (question) {\r\n var self = this;\r\n question.isTemp = true;\r\n angular.forEach(question.SurveyOptions, function (o) {\r\n angular.forEach(o.ChildQuestions, function (q) {\r\n self.setQuestionAsTemp(q);\r\n });\r\n });\r\n },\r\n\r\n removeContentIds: function(question) {\r\n var self = this;\r\n angular.forEach(question.SurveyOptions, function (o) {\r\n angular.forEach(o.ChildQuestions, function (q) {\r\n self.removeContentIds(q);\r\n });\r\n });\r\n },\r\n\r\n getAvailableLanguages: getAvailableLanguages,\r\n\r\n getAvailableLanguagesMap: function() {\r\n return getAvailableLanguages().then(function(data) {\r\n return data.reduce(function(map, language) {\r\n const code = language.Code.replace('-', '_');\r\n map[code] = language;\r\n return map;\r\n }, {});\r\n });\r\n },\r\n\r\n getRules: function(surveyTemplateId) {\r\n return $http.get('/api/rule?surveyTemplateId=' + surveyTemplateId).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getRulesForPathway: function(pathwayId) {\r\n return $http.get('/api/rule?pathwayId=' + pathwayId).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n saveRule: function(rule) {\r\n return $http.post(\"/api/rule\", rule).then(function(data) {\r\n return data;\r\n });\r\n },\r\n\r\n deleteRule: function (id) {\r\n return $http.delete('/api/rule/' + id);\r\n },\r\n\r\n getSurveyTags: function() {\r\n return TagRepository.getSurveyTags();\r\n },\r\n\r\n setLasstEditedTemplateId: function(templateId) {\r\n lastEditedTemplateId = templateId;\r\n },\r\n\r\n getLastEditedTemplateId: function() {\r\n return lastEditedTemplateId;\r\n },\r\n\r\n getTemplatesByQuestionId(id) {\r\n return QuestionRepository.getTemplates(id);\r\n },\r\n\r\n isQuestionAssignedToPatientPathway(id) {\r\n return QuestionRepository.isQuestionAssignedToPatientPathway(id);\r\n }\r\n };\r\n}\r\n\r\nangular.module('content.services').factory('TemplatesService', TemplatesService);\r\n","function VideosService(VideoRepository, FileUploader) {\r\n return {\r\n\r\n getAllVideos: function () {\r\n var promise = VideoRepository.getAllVideos();\r\n return promise;\r\n },\r\n getVideos: function (searchText, pageSize, page, contentProviderId) {\r\n var promise = VideoRepository.getVideos(searchText, pageSize, page, contentProviderId);\r\n return promise;\r\n },\r\n\r\n getVideo: function (videoId) {\r\n var promise = VideoRepository.getVideo(videoId);\r\n return promise;\r\n },\r\n\r\n saveVideo: function (video) {\r\n var promise = null;\r\n if(video.VideoId == 0) {\r\n promise = VideoRepository.create(video);\r\n } else {\r\n promise = VideoRepository.update(video);\r\n }\r\n return promise;\r\n }, \r\n importVideos(importData){\r\n return VideoRepository.importVideos(importData);\r\n },\r\n\r\n deleteVideo: function (videoId) {\r\n var promise = VideoRepository.delete(videoId);\r\n return promise;\r\n },\r\n\r\n getContentProviders: function(){\r\n var promise = VideoRepository.getContentProviders();\r\n return promise; \r\n },\r\n \r\n getFileUploader: function () {\r\n var fileUploader = new FileUploader({\r\n url: VideoRepository.videoUploadUrl\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function(item, options) {\r\n var type = item.type;\r\n return (type == 'video/mp4' || type == 'like/mp4');\r\n }\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'sizeFilter',\r\n fn: function(item, options) {\r\n return (item.size < 50000000 || item.size == null);\r\n }\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'emptyFilter',\r\n fn: function(item, options) {\r\n return (item.size > 0 || item.size == null);\r\n }\r\n });\r\n return fileUploader;\r\n }\r\n }\r\n}\r\n\r\nangular.module('content.services').factory('VideosService', VideosService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/templates/addquestion.modal.html',\n '

      {{vm.modalHeader}}

      {{vm.question.EnglishText.Text}}

      {{vm.question.SurveyQuestionType().Name}}

      Content Id can only contain letters, numbers, hyphens, and underscores

      {{vm.question.ContentId}}

      {{vm.question.SurveyQuestionCategory().Name}}

      {{tag}}

      {{vm.question.DisplayCondition}}
      Response Options Alert Level Tag
      Response Options TagAlert Level
      1. = 3 && $index != vm.question.SurveyOptions.length -1\">
        {{option.Tags || (vm.userCanEditTags && vm.canEdit() ? \\'click to edit\\' : \\'none\\')}}

      {{vm.selectedMilestone.Name}}

      ');\n}]);\n}(window, document, window.angular));","function AddQuestionModalController($scope, $uibModalInstance, $uibModal, TemplatesService, CategoriesService, vhSweetAlert, VideosService, PermissionService, ScheduleService, question, disableEdits, saveFunction, lodash, lockStatusEnum, contentLock, SurveyQuestionAttribute) { \r\n var vm = this;\r\n var videoQuestionOptionIndex = 0;\r\n var languages = [\r\n {language: 'en', languageName: 'English'},\r\n {language: 'es', languageName: 'Spanish'},\r\n {language: 'it', languageName: 'Italian'},\r\n {language: 'en_ca', languageName: 'Canadian English'},\r\n {language: 'fr_ca', languageName: 'Canadian French'}\r\n ];\r\n\r\n vm.questionAttributeTypes = {\r\n AlphaNumeric: { QuestionAttributeId: SurveyQuestionAttribute.AlphaNumeric, Name: 'Alpha Numeric (Go, CMP)' },\r\n Numeric: { QuestionAttributeId: SurveyQuestionAttribute.Numeric, Name: 'Numeric (Go, CMP)' },\r\n Address: { QuestionAttributeId: SurveyQuestionAttribute.Address, Name: 'Address (Go, CMP)' },\r\n Date: { QuestionAttributeId: SurveyQuestionAttribute.Date, Name: 'Date (CMP)' },\r\n DateMonthYear: { QuestionAttributeId: SurveyQuestionAttribute.DateMonthYear, Name: 'Date (MM/YYYY) (CMP)' },\r\n DateTime: { QuestionAttributeId: SurveyQuestionAttribute.DateTime, Name: 'Date and Time (CMP)' },\r\n Time: { QuestionAttributeId: SurveyQuestionAttribute.Time, Name: 'Time (CMP)' }\r\n };\r\n\r\n vm.questionAttributesEnum = SurveyQuestionAttribute;\r\n\r\n vm.limitEdits = disableEdits === true;\r\n vm.addCondition = false;\r\n vm.addTag = false;\r\n vm.modalHeader = \"Add New Question\";\r\n vm.questionHeader = \"Enter New Question Text\";\r\n vm.language = 'en';\r\n vm.languageName = \"English\";\r\n vm.languages = [];\r\n vm.categories = [];\r\n vm.questionTypes = [];\r\n vm.questionOptionsDisabled = false;\r\n vm.submitted = false;\r\n vm.videos = [];\r\n vm.showDelete = true;\r\n vm.disableCategoryList = false;\r\n vm.userCanEditTags = PermissionService.userHasPermission([\"PathwayTagWrite\"]);\r\n vm.userCanEditRules = PermissionService.userHasPermission([\"PathwayConditionWrite\", \"RuleWrite\"]);\r\n vm.userCanEditContentId = PermissionService.userHasPermission([\"SecurityAccessLevelModerateWrite\"]);;\r\n vm.maxLengthAttribute = 10;\r\n vm.maxValueAttribute = 10;\r\n vm.minValueAttribute = 0;\r\n vm.decimalValueAttribute = 0;\r\n vm.saveToMilestone = false;\r\n vm.allowPrevious = false;\r\n vm.allowFuture = false;\r\n vm.previousDays = 0;\r\n vm.futureDays = 0;\r\n\r\n vm.canEdit = ()=>{\r\n var canEdit = PermissionService.userHasPermission(['CanEditLockedQuestions']) || vm.question.LockStatus == lockStatusEnum.UnLocked;\r\n return canEdit;\r\n };\r\n\r\n/***********************/\r\n\r\n vm.ruleOperator = [\r\n { Text : '=', Name : 'Equal' },\r\n { Text : '&&', Name : 'And' },\r\n { Text : '||', Name : 'Or' },\r\n { Text : '>', Name : 'Great then' },\r\n { Text : '<', Name : 'Less then' },\r\n { Text : '>=', Name : 'Great then or Equal' },\r\n { Text : '<=', Name : 'Less then or Equal' },\r\n { Text : '!=', Name : 'Not equal' },\r\n { Text : '(', Name : '(' },\r\n { Text : ')', Name : ')' },\r\n { Text : '+', Name : 'Add' },\r\n { Text : '-', Name : 'Subtract' },\r\n { Text : '*', Name : 'Multiply' },\r\n { Text : '/', Name : 'Divide' },\r\n { Text : '%', Name : 'Modulo' }\r\n ];\r\n\r\n vm.ruleVariables = [\r\n { Text : '{FirstName}', Name : 'Patient First Name' },\r\n { Text : '{Birthday}', Name : 'Patient\\'s Birthdate' },\r\n { Text : '{Gender}', Name : 'Patient\\'s Gender' },\r\n\r\n { Text : '{PathwayPlayCount}', Name : 'Pathway Play Count' },\r\n { Text : '{BPReadingCount}', Name : 'BP Reading Count' },\r\n { Text : '{Systolic}', Name : 'Systolic' },\r\n { Text : '{Diastolic}', Name : 'Diastolic' },\r\n { Text : '{BPAverage}', Name : 'BP Average' },\r\n { Text : '{Tags}', Name : 'Tags for this pathway sesson' },\r\n { Text : '{Today}', Name : 'Today\\'s date' },\r\n { Text : '{Month}', Name : 'Current Month name' },\r\n { Text : '{DayOfWeek}', Name : 'Day of the week name' },\r\n { Text : '{DayOfMonth}', Name : 'Day of the month number' },\r\n { Text : '{LastDayOfMonth}', Name : 'Number of days in the current month' },\r\n { Text : '{ProgramDay}', Name : 'Program Day number' },\r\n { Text : '{LastDayOfProgram}', Name : 'Number of days in program' },\r\n { Text : '{AllTags}', Name : 'All tags' }\r\n ];\r\n\r\n vm.ruleChanged = function(){\r\n\r\n }\r\n\r\n vm.ruleSet = [];\r\n\r\n/***********************/\r\n\r\n vm.addRuleItem = function(text){\r\n if ( vm.question.DisplayCondition == null){\r\n vm.question.DisplayCondition = '';\r\n }\r\n if ( vm.question.DisplayCondition.slice(-1) != ' '){\r\n vm.question.DisplayCondition += ' ';\r\n }\r\n vm.question.DisplayCondition += text + ' ';\r\n }\r\n\r\n vm.question = contentLock({\r\n SurveyQuestionId: 0,\r\n SurveyQuestionCategoryId: null,\r\n SurveyQuestionTypeId: null,\r\n SurveyQuestionTypeName: '',\r\n SurveyOptions: [],\r\n QuestionTexts: {},\r\n EnglishText: '',\r\n LockStatus: lockStatusEnum.UnLocked,\r\n\r\n Text: function (newText) {\r\n if (angular.isDefined(newText)) {\r\n vm.question.QuestionTexts[vm.language] = newText;\r\n }\r\n return vm.question.QuestionTexts[vm.language];\r\n },\r\n\r\n SurveyQuestionType: function (newQuestionType) {\r\n if (angular.isDefined(newQuestionType) && newQuestionType !== null) {\r\n vm.question.SurveyQuestionTypeId = newQuestionType.TypeId;\r\n vm.question.SurveyQuestionTypeName = newQuestionType.Name;\r\n vm.question.QuestionAttributeId = newQuestionType.QuestionAttributeId;\r\n }\r\n\r\n if (vm.question.SurveyQuestionTypeId == 17) {\r\n var questionAttributeId;\r\n \r\n if (vm.question.QuestionAttributeId) {\r\n questionAttributeId = vm.question.QuestionAttributeId;\r\n }\r\n else {\r\n questionAttributeId = vm.questionAttributeType.QuestionAttributeId;\r\n }\r\n \r\n return lodash.find(vm.questionTypes, function(t) {\r\n return t.QuestionAttributeId === questionAttributeId\r\n });\r\n }\r\n \r\n return lodash.find(vm.questionTypes, function (t) {\r\n if (vm.question.SurveyQuestionTypeName) {\r\n return t.Name === vm.question.SurveyQuestionTypeName;\r\n }\r\n return t.TypeId === vm.question.SurveyQuestionTypeId;\r\n });\r\n },\r\n\r\n SurveyQuestionCategory: function (newCategory) {\r\n if (angular.isDefined(newCategory)) {\r\n if (newCategory) {\r\n vm.question.SurveyQuestionCategoryId = newCategory.SurveyQuestionCategoryId;\r\n } else {\r\n vm.question.SurveyQuestionCategoryId = null;\r\n }\r\n }\r\n return lodash.find(vm.categories, function (c) { return c.SurveyQuestionCategoryId == vm.question.SurveyQuestionCategoryId; });\r\n }\r\n });\r\n\r\n vm.englishOptionText = function(optionId) {\r\n var option = lodash.find(vm.question.SurveyOptions, function (o) { return o.SurveyOptionId == optionId; });\r\n return option ? option.OptionTexts['en'] : '';\r\n }\r\n\r\n Promise.all([\r\n CategoriesService.getAllCategories(),\r\n TemplatesService.getQuestionTypes(),\r\n TemplatesService.getAvailableLanguagesMap(),\r\n ScheduleService.getMilestones()\r\n ]).then(data => {\r\n let [categories, questionTypes, languages, milestones] = data;\r\n vm.categories = categories;\r\n vm.questionTypes = questionTypes.data;\r\n vm.languages = languages;\r\n vm.milestones = milestones.data;\r\n \r\n //Remove custom response option, Add in itemized custom response options\r\n vm.questionTypes = vm.questionTypes.filter(function(x) {\r\n return x.TypeId != 17;\r\n });\r\n\r\n for (key in vm.questionAttributeTypes) {\r\n const attribute = vm.questionAttributeTypes[key];\r\n vm.questionTypes.push({\r\n TypeId: 17,\r\n Name: attribute.Name,\r\n QuestionAttributeId: attribute.QuestionAttributeId\r\n });\r\n }\r\n\r\n //Edit mode. Initialize for editing existing question\r\n if (question != null) {\r\n\r\n question = contentLock(JSON.parse(JSON.stringify(question)),()=>{\r\n vm.modalHeader = \"Edit Question \" + (question.LockStatus != lockStatusEnum.UnLocked ? `(${question.LockStatus.description})` : ''); \r\n });\r\n\r\n vm.modalHeader = \"Edit Question \" + (question.LockStatus != lockStatusEnum.UnLocked ? `(${question.LockStatus.description})` : '');\r\n vm.questionHeader = \"Edit Question Text\";\r\n\r\n for (i = 0; i < question.SurveyOptions.length; i++) {\r\n question.SurveyOptions[i].Text = function (newText) {\r\n if (angular.isDefined(newText)) {\r\n this.OptionTexts[vm.language] = newText;\r\n }\r\n return this.OptionTexts[vm.language];\r\n }\r\n }\r\n\r\n for (const language in vm.languages) {\r\n var existingTipLanguage = vm.question.QuestionTexts[language];\r\n if (!existingTipLanguage) {\r\n vm.question.QuestionTexts[language] = '';\r\n for (const option of vm.question.SurveyOptions) {\r\n option.OptionTexts[language] = '';\r\n }\r\n }\r\n }\r\n\r\n if (TemplatesService.isVideoQuestion(question))\r\n {\r\n //find video index\r\n var videoIndex = lodash.findIndex(question.SurveyOptions, function(o) { return o.VideoId != null; });\r\n if (videoIndex > 0) {\r\n videoQuestionOptionIndex = videoIndex;\r\n }\r\n VideosService.getAllVideos().then(function (data){\r\n vm.videos = data;\r\n });\r\n }\r\n\r\n //If question type is a user input (custom response) question, populate existing question attributes\r\n lodash.forEach(question.SurveyQuestionAttributes, function(attribute) {\r\n switch(attribute.QuestionAttributeId) {\r\n case vm.questionAttributesEnum.AlphaNumeric:\r\n vm.questionAttributeType = vm.questionAttributeTypes.AlphaNumeric;\r\n break;\r\n case vm.questionAttributesEnum.Numeric:\r\n vm.questionAttributeType = vm.questionAttributeTypes.Numeric;\r\n break;\r\n case vm.questionAttributesEnum.MaxLength:\r\n vm.maxLengthAttribute = attribute.Value;\r\n break;\r\n case vm.questionAttributesEnum.DecimalPlacesAllowed:\r\n vm.decimalValueAttribute = attribute.Value;\r\n break;\r\n case vm.questionAttributesEnum.MaxValue:\r\n vm.maxValueAttribute = attribute.Value;\r\n break;\r\n case vm.questionAttributesEnum.MinValue:\r\n vm.minValueAttribute = attribute.Value;\r\n break;\r\n case vm.questionAttributesEnum.Address:\r\n vm.questionAttributeType = vm.questionAttributeTypes.Address;\r\n break;\r\n case vm.questionAttributesEnum.Date:\r\n vm.questionAttributeType = vm.questionAttributeTypes.Date;\r\n break;\r\n case vm.questionAttributesEnum.Time:\r\n vm.questionAttributeType = vm.questionAttributeTypes.Time;\r\n break;\r\n case vm.questionAttributesEnum.DateTime:\r\n vm.questionAttributeType = vm.questionAttributeTypes.DateTime;\r\n break;\r\n case vm.questionAttributesEnum.DateMonthYear:\r\n vm.questionAttributeType = vm.questionAttributeTypes.DateMonthYear;\r\n break;\r\n case vm.questionAttributesEnum.Milestone:\r\n vm.saveToMilestone = true;\r\n vm.selectedMilestone = lodash.find(vm.milestones, function(x) { return x.MilestoneId === attribute.Value});\r\n break;\r\n case vm.questionAttributesEnum.PreviousDaysAllowed:\r\n vm.allowPrevious = true;\r\n vm.previousDays = attribute.Value;\r\n break;\r\n case vm.questionAttributesEnum.FutureDaysAllowed:\r\n vm.allowFuture = true;\r\n vm.futureDays = attribute.Value;\r\n break;\r\n }\r\n });\r\n\r\n vm.originalQuestion = JSON.parse(JSON.stringify(question));\r\n\r\n //Add getters/setters back to question model\r\n question.Text = vm.question.Text;\r\n question.SurveyQuestionCategory = vm.question.SurveyQuestionCategory;\r\n question.SurveyQuestionType = vm.question.SurveyQuestionType;\r\n\r\n vm.question = question;\r\n\r\n vm.question.EnglishText = {Text: vm.question.QuestionTexts['en']};\r\n vm.question.EnglishText.Active = true;\r\n\r\n setOptionsEditable();\r\n\r\n if (!TemplatesService.isVideoQuestion(vm.question)) {\r\n vm.optionChanged();\r\n }\r\n\r\n } else if ($scope.preselectedCategoryId) {\r\n vm.question.SurveyQuestionCategoryId = $scope.preselectedCategoryId;\r\n }\r\n\r\n if ($scope.disableCategory && $scope.disableCategory === true) {\r\n vm.disableCategoryList = true;\r\n }\r\n });\r\n\r\n addEmptyOption = function () {\r\n var newOption = {\r\n Text: function (newText) {\r\n if (angular.isDefined(newText)) {\r\n newOption.OptionTexts[vm.language] = newText;\r\n }\r\n return newOption.OptionTexts[vm.language];\r\n }\r\n };\r\n\r\n if (!vm.limitEdits) {\r\n newOption.SurveyOptionId = 0;\r\n newOption.AlertSeverityLevelId = 3;\r\n newOption.SurveyParameterTypeId = 8; //todo: Type of Survey. Will add other types later\r\n newOption.SortOrder = 0;\r\n newOption.OptionTexts = {};\r\n for (const language of languages) {\r\n newOption.OptionTexts[language.language] = '';\r\n }\r\n vm.question.SurveyOptions.push(newOption);\r\n }\r\n }\r\n\r\n addNewOption = function (alertLevelId, texts) {\r\n var newOption = {\r\n Text: function (newText) {\r\n if (angular.isDefined(newText)) {\r\n newOption.OptionTexts[vm.language] = newText;\r\n }\r\n return newOption.OptionTexts[vm.language];\r\n }\r\n };\r\n newOption.SurveyOptionId = 0;\r\n newOption.AlertSeverityLevelId = alertLevelId;\r\n newOption.SortOrder = 0;\r\n newOption.SurveyParameterTypeId = 8; //todo: Type of Survey. Will add other types later\r\n var optionTexts = {};\r\n for (var i = 0; i < texts.length; i++) {\r\n var language = languages[i].language;\r\n optionTexts[language] = texts[i];\r\n }\r\n newOption.OptionTexts = optionTexts;\r\n vm.question.SurveyOptions.push(newOption);\r\n };\r\n\r\n removeEmptyOptions = function () {\r\n //Do not check last option, since that one will always be empty\r\n for (i = 0; i < vm.question.SurveyOptions.length - 1; i++) {\r\n //Find any option text that is not empty. If none found, remove option\r\n if (optionIsEmpty(vm.question.SurveyOptions[i])) {\r\n vm.question.SurveyOptions.splice(i, 1);\r\n }\r\n }\r\n };\r\n\r\n optionIsEmpty = function (option) {\r\n if (option && option.OptionTexts) {\r\n var texts = option.OptionTexts;\r\n for (const key in texts) {\r\n if (texts[key] && texts[key].length) return false;\r\n }\r\n return true;\r\n }\r\n return true;\r\n };\r\n\r\n setOptionsEditable = function () {\r\n vm.questionOptionsDisabled = true;\r\n switch (vm.question.SurveyQuestionTypeId) {\r\n case 6: //Single Select questions\r\n case 7: //multi select question\r\n case 9: //video question\r\n vm.questionOptionsDisabled = false;\r\n break;\r\n }\r\n };\r\n\r\n vm.ok = function (isValid) {\r\n vm.submitted = true;\r\n\r\n if (isValid && vm.optionsAreValid()) {\r\n //Remove last option if it's empty\r\n if (optionIsEmpty(vm.question.SurveyOptions[vm.question.SurveyOptions.length - 1]) && !TemplatesService.isVideoQuestion(vm.question)) {\r\n vm.question.SurveyOptions.splice(vm.question.SurveyOptions.length - 1, 1);\r\n }\r\n\r\n vm.question.SurveyQuestionAttributes = [];\r\n //Add Custom Response question attributes\r\n if (vm.question.SurveyQuestionTypeId === 17) {\r\n if (vm.questionAttributeType.QuestionAttributeId === vm.questionAttributesEnum.AlphaNumeric) {\r\n vm.question.SurveyQuestionAttributes.push(vm.questionAttributeTypes.AlphaNumeric);\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.MaxLength, Value: vm.maxLengthAttribute});\r\n } else if (vm.questionAttributeType.QuestionAttributeId === vm.questionAttributesEnum.Numeric) {\r\n vm.question.SurveyQuestionAttributes.push(vm.questionAttributeTypes.Numeric);\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.DecimalPlacesAllowed, Value: vm.decimalValueAttribute});\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.MaxValue, Value: vm.maxValueAttribute});\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.MinValue, Value: vm.minValueAttribute});\r\n } else if (vm.questionAttributeType.QuestionAttributeId === vm.questionAttributesEnum.Address) {\r\n vm.question.SurveyQuestionAttributes.push(vm.questionAttributeTypes.Address);\r\n } else if(vm.questionAttributeType.QuestionAttributeId === vm.questionAttributesEnum.DateTime) {\r\n vm.question.SurveyQuestionAttributes.push(vm.questionAttributeTypes.DateTime);\r\n if(vm.allowPrevious){\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.PreviousDaysAllowed, Value: vm.previousDays});\r\n }\r\n if(vm.allowFuture) {\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.FutureDaysAllowed, Value: vm.futureDays});\r\n }\r\n } else if(vm.questionAttributeType.QuestionAttributeId === vm.questionAttributesEnum.DateMonthYear) {\r\n vm.question.SurveyQuestionAttributes.push(vm.questionAttributeTypes.DateMonthYear);\r\n if(vm.allowPrevious){\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.PreviousDaysAllowed, Value: vm.previousDays});\r\n }\r\n if(vm.allowFuture) {\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.FutureDaysAllowed, Value: vm.futureDays});\r\n }\r\n } else if(vm.questionAttributeType.QuestionAttributeId === vm.questionAttributesEnum.Date) {\r\n vm.question.SurveyQuestionAttributes.push(vm.questionAttributeTypes.Date);\r\n if(vm.allowPrevious){\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.PreviousDaysAllowed, Value: vm.previousDays});\r\n }\r\n if(vm.allowFuture) {\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.FutureDaysAllowed, Value: vm.futureDays});\r\n }\r\n //Set milestone\r\n if(vm.saveToMilestone) {\r\n vm.question.SurveyQuestionAttributes.push({QuestionAttributeId: vm.questionAttributesEnum.Milestone, Value: parseInt(vm.selectedMilestone.MilestoneId, 10)});\r\n }\r\n } else if(vm.questionAttributeType.QuestionAttributeId === vm.questionAttributesEnum.Time) {\r\n vm.question.SurveyQuestionAttributes.push(vm.questionAttributeTypes.Time);\r\n }\r\n }\r\n\r\n if(saveFunction) {\r\n if (vm.question.SurveyQuestionId) {\r\n TemplatesService.getTemplatesByQuestionId(vm.question.SurveyQuestionId).then(function(response) {\r\n if (response.data && response.data.length > 0) {\r\n var customPathways = response.data.filter(template => template.CustomizedQuestion);\r\n\r\n if (customPathways.length > 0 && isRevisionModified()) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/updatecustomtemplate.modal.html',\r\n controller: 'UpdateCustomTemplateModalController as vm',\r\n backdrop: 'static',\r\n scope: $scope,\r\n resolve: {\r\n templates: function() {\r\n return customPathways;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (selectedTemplates) {\r\n var templatesToUpdate = response.data\r\n .filter(template => !template.CustomizedQuestion || selectedTemplates.includes(template.SurveyTemplateId))\r\n .map(template => template.SurveyTemplateId);\r\n \r\n vm.callSave(templatesToUpdate);\r\n }, function () {\r\n //VIVY-4117: Add back empty option if they cancel out of the custom template modal.\r\n if (!TemplatesService.isVideoQuestion(vm.question)) {\r\n vm.optionChanged();\r\n }\r\n });\r\n }\r\n else {\r\n //Update all templates with same revision as master\r\n var templatesToUpdate = response.data\r\n .filter(template => !template.CustomizedQuestion)\r\n .map(template => template.SurveyTemplateId);\r\n\r\n vm.callSave(templatesToUpdate);\r\n }\r\n }\r\n else {\r\n vm.callSave();\r\n }\r\n });\r\n }\r\n else {\r\n vm.callSave();\r\n }\r\n \r\n }\r\n else{\r\n $uibModalInstance.close(vm.question);\r\n }\r\n }\r\n };\r\n\r\n vm.callSave = function(templatesToUpdate) {\r\n var promise = saveFunction(vm.question, templatesToUpdate);\r\n \r\n promise.then(function(data) {\r\n $uibModalInstance.close(data);\r\n }, function(error){\r\n if(error.data.ModelState.ContentId){\r\n vhSweetAlert.error('Error', error.data.ModelState.ContentId[0]);\r\n }\r\n });\r\n }\r\n\r\n vm.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n vm.optionChanged = function () {\r\n //only add a new option if the last one is not empty\r\n if (!vm.canEdit() || vm.limitEdits || vm.questionOptionsDisabled || \r\n TemplatesService.isVideoQuestion(vm.question) ||\r\n (vm.question.SurveyOptions.length > 0 && optionIsEmpty(vm.question.SurveyOptions[vm.question.SurveyOptions.length - 1]))) {\r\n return;\r\n }\r\n addEmptyOption();\r\n };\r\n\r\n vm.optionLostFocus = function () {\r\n if (!TemplatesService.isVideoQuestion(vm.question)) {\r\n removeEmptyOptions();\r\n }\r\n }\r\n\r\n vm.removeOption = function (index) {\r\n if(!vm.canEdit())\r\n return;\r\n \r\n //Don't allow removing the last question\r\n if (vm.questionOptionsDisabled || TemplatesService.isVideoQuestion(vm.question) || optionIsEmpty(vm.question.SurveyOptions[index])) {\r\n return;\r\n }\r\n vm.question.SurveyOptions.splice(index, 1);\r\n };\r\n\r\n vm.optionsAreValid = function () {\r\n var isValid = true;\r\n if (vm.question.SurveyQuestionTypeId == null || vm.question.SurveyQuestionTypeId === 0) {\r\n isValid = false;\r\n }\r\n switch (vm.question.SurveyQuestionTypeId) {\r\n case 6:\r\n case 7:\r\n //First check for empty last option\r\n if (optionIsEmpty(vm.question.SurveyOptions[vm.question.SurveyOptions.length - 1])) {\r\n if (vm.question.SurveyOptions.length < 2) {\r\n isValid = false;\r\n }\r\n } else {\r\n if (vm.question.SurveyOptions.length < 1) {\r\n isValid = false;\r\n }\r\n }\r\n break;\r\n case 9:\r\n video = vm.question.SurveyOptions[videoQuestionOptionIndex].Video;\r\n if (!angular.isDefined(video) || !angular.isDefined(video.VideoId)) {\r\n isValid = false;\r\n }\r\n if (optionIsEmpty(vm.question.SurveyOptions[0]) || optionIsEmpty(vm.question.SurveyOptions[1])) {\r\n isValid = false;\r\n }\r\n break;\r\n case 17:\r\n if(vm.questionAttributeType.QuestionAttributeId === 8 || vm.questionAttributeType.QuestionAttributeId === 9 || vm.questionAttributeType.QuestionAttributeId === 10) {\r\n if(!vm.allowPrevious && !vm.allowFuture) {\r\n isValid = false;\r\n }\r\n }\r\n break;\r\n }\r\n return isValid;\r\n };\r\n\r\n resetVariables = function() {\r\n vm.allowPrevious = false;\r\n vm.previousDays = 0;\r\n vm.allowFuture = false;\r\n vm.futureDays = 0;\r\n vm.saveToMilestone = false;\r\n vm.selectedMilestone = null;\r\n }\r\n\r\n vm.questionTypeChanged = function () {\r\n resetVariables();\r\n setOptionsEditable();\r\n switch (vm.question.SurveyQuestionTypeId) {\r\n case 10: //Yes/No questions\r\n vm.question.SurveyOptions = [];\r\n addNewOption(3, ['Yes', 'Si', 'Si', 'Yes', 'Oui']);\r\n addNewOption(3, ['No', 'No', 'No', 'No', 'Non']);\r\n break;\r\n case 6:\r\n if (vm.question.SurveyQuestionTypeName == 'Likert Scale') {\r\n vm.question.SurveyOptions = [];\r\n addNewOption(3, ['Strongly Agree', 'Totalmente de Acuerdo', 'Sono Fortemente D\\'accordo', 'Strongly Agree', 'Tout a Fait D\\'accord']);\r\n addNewOption(3, ['Agree', 'De Acuerdo', 'Essere D\\'accordo', 'Agree', 'Se Mettre D\\'accord']);\r\n addNewOption(3, ['Neither Agree nor Disagree', 'Ni de Acuerdo ni en Desacuerdo', 'Ne D\\'accordo ne in Disaccordo', 'Neither Agree nor Disagree', 'Ni D\\'accord ni en Desaccord']);\r\n addNewOption(3, ['Disagree', 'Desacuerdo', 'Disaccordo', 'Disagree', 'Etre en Desaccord']);\r\n addNewOption(3, ['Strongly Disagree', 'Muy en Desacuerdo', 'Non sono Fortemente in Disaccordo', 'Strongly Disagree', 'Tout a Fait en Desaccord']);\r\n vm.optionChanged();\r\n } else {\r\n vm.optionChanged();\r\n }\r\n break;\r\n case 7: //multi select question\r\n vm.optionChanged();\r\n break;\r\n case 9:\r\n vm.showDelete = false;\r\n vm.question.SurveyOptions = [];\r\n addNewOption(1, ['Now', 'Ahora', 'Adesso', 'Now', 'A Present']);\r\n addNewOption(3, ['Later', 'Leugo', 'Dopo', 'Later', 'Plus Tard']);\r\n VideosService.getAllVideos().then(function (data) {\r\n vm.videos = data;\r\n });\r\n break;\r\n case 17:\r\n vm.question.SurveyOptions = [];\r\n vm.questionAttributeType = lodash.find(Object.values(vm.questionAttributeTypes), function(x) {return x.QuestionAttributeId == vm.question.QuestionAttributeId});\r\n break;\r\n }\r\n };\r\n\r\n vm.questionOptions = {\r\n //Do not allow dropping below the empty last option\r\n accept: function (src, dest, destIndex) {\r\n if (destIndex == vm.question.SurveyOptions.length - 1) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n };\r\n\r\n vm.showOptions = function () {\r\n return (vm.question.SurveyOptions.length > 0);\r\n };\r\n\r\n vm.selectedVideo = function(newVideo) {\r\n if (newVideo) {\r\n vm.question.SurveyOptions[videoQuestionOptionIndex].Video = newVideo;\r\n vm.question.SurveyOptions[videoQuestionOptionIndex].VideoId = newVideo.VideoId;\r\n }\r\n if (vm.question.SurveyOptions[videoQuestionOptionIndex].Video == null) {\r\n vm.question.SurveyOptions[videoQuestionOptionIndex].Video = lodash.find(vm.videos, function(v) { return v.VideoId==vm.question.SurveyOptions[videoQuestionOptionIndex].VideoId; });\r\n }\r\n return vm.question.SurveyOptions[videoQuestionOptionIndex].Video;\r\n };\r\n\r\n vm.showVideoSelection = function (option) {\r\n return (TemplatesService.isVideoQuestion(vm.question) && vm.question.SurveyOptions[videoQuestionOptionIndex] == option);\r\n };\r\n\r\n vm.setCurrentLanguageText = function(language) {\r\n vm.language = language;\r\n };\r\n\r\n function isRevisionModified() {\r\n var excludedProperties = ['ContentId', 'SurveyQuestionCategoryId'];\r\n\r\n var result = false;\r\n var updatedQuestion = JSON.parse(JSON.stringify(vm.question));\r\n var modified = getChanges(vm.originalQuestion, updatedQuestion);\r\n\r\n for (var key in modified) {\r\n if (!excludedProperties.includes(key)) {\r\n result = true;\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function getChanges(obj1, obj2) {\r\n var result = {};\r\n var keys = Object.keys(obj1);\r\n for (var key in obj2) {\r\n if (keys.includes(key)) {\r\n if (!lodash.isEqual(obj1[key], obj2[key])) {\r\n result[key] = obj2[key];\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n\r\n}\r\n\r\nangular.module('content.templates').controller('AddQuestionModalController', AddQuestionModalController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/templates/addrule.modal.html',\n '

      {{vm.modalHeader}}

      When

      If

      Then





      ');\n}]);\n}(window, document, window.angular));","function AddRuleModalController($scope, $uibModalInstance, rule, TemplateId, TemplatesService, TemplateName, lodash) {\r\n var vm = this;\r\n vm.rule = {};\r\n vm.TemplateId = TemplateId;\r\n vm.modalHeader = \"Add New Rule\";\r\n vm.addCondition = false;\r\n vm.promptForName = false;\r\n\r\n vm.updateDescription = updateDescription;\r\n\r\n vm.eventTypes = [ \r\n { Name : 'Patient completes any pathway.', Value : 'Vivify.Platform.Events.PatientSurveyCompletedEvent', DescriptionText: 'When patient completes any pathway' }, \r\n { Name : 'Patient\\'s status changes.', Value : 'Vivify.Platform.Events.PatientStatusUpdatedEvent', DescriptionText: 'When patient\\'s status changes' }, \r\n { Name : 'Patient is added.', Value : 'Vivify.Platform.Events.PatientAddedEvent', DescriptionText: 'When a patient is added' }\r\n ];\r\n \r\n vm.actionTypes = [\r\n { Name : 'Add \\'' + TemplateName + '\\' pathway to patient' , Value : 'AddPathwayAction', DescriptionText: 'add this pathway to patient' },\r\n { Name : 'Change \\'' + TemplateName + '\\' pathway status to' , Value : 'ChangePathwayStatus', DescriptionText: 'change the status of this pathway' },\r\n { Name : 'Add hero card' , Value : 'AddPatientCardAction', DescriptionText: 'add a new hero card to the patient card queue' },\r\n { Name : 'Add library tile', Value : 'AddLibraryTileAction', DescriptionText: 'add a tile to the patient\\'s resource library' },\r\n { Name : 'Remove library tile', Value : 'RemoveLibraryTileAction', DescriptionText: 'Remove a tile from the patient\\'s resource library' }\r\n ];\r\n \r\n vm.surveyStatuses = [\r\n { Name : 'Active', Value : 1 },\r\n { Name : 'Inactive', Value : 2 },\r\n { Name : 'Discontinued', Value : 3 }\r\n ] \r\n\r\n vm.cardStatus = [\r\n { Name : 'Default', Value : 1 },\r\n { Name : 'Positive', Value : 2 },\r\n { Name : 'Warning', Value : 3 },\r\n { Name : 'Negative', Value : 4 }\r\n ] \r\n \r\n\r\n vm.ruleOperator = [\r\n { Text : '=', Name : 'Equal' },\r\n { Text : '&&', Name : 'And' },\r\n { Text : '||', Name : 'Or' },\r\n { Text : '>', Name : 'Great then' },\r\n { Text : '<', Name : 'Less then' },\r\n { Text : '>=', Name : 'Great then or Equal' },\r\n { Text : '<=', Name : 'Less then or Equal' },\r\n { Text : '!=', Name : 'Not equal' },\r\n { Text : '(', Name : '(' },\r\n { Text : ')', Name : ')' },\r\n { Text : '+', Name : 'Add' },\r\n { Text : '-', Name : 'Subtract' },\r\n { Text : '*', Name : 'Multiply' },\r\n { Text : '/', Name : 'Divide' },\r\n { Text : '%', Name : 'Modulo' }\r\n ];\r\n\r\n vm.ruleVariables = [\r\n { Text : '{Tags}', Name : 'Tags for this pathway sesson', Type : 'string' },\r\n { Text : '{SurveyTemplateId}', Name : 'Pathway', Type : 'int' }\r\n \r\n ]; \r\n\r\n vm.changePathwayStatusData = { \r\n TemplateId : vm.TemplateId,\r\n PathwayName : '',\r\n SurveyStatusId : 0\r\n };\r\n\r\n vm.addPathwayActionData = {\r\n TemplateId : vm.TemplateId,\r\n StartDate : '',\r\n DueTime : '',\r\n EndDate : '',\r\n SurveyStatusId : 1,\r\n IsSunday : false,\r\n IsMonday : false,\r\n IsTuesday : false,\r\n IsWednesday : false,\r\n IsThursday : false,\r\n IsFriday : false,\r\n IsSaturday : false,\r\n OverrideDays : false,\r\n AllowDuplicateSurveyTemplates : false\r\n }\r\n\r\n vm.addPatientCardActionData = {};\r\n vm.addPatientCardActionData.Title = \"You Blood Sugar Is\";\r\n vm.addPatientCardActionData.Subtitle = \"Very High\";\r\n vm.addPatientCardActionData.Information = \"Last: 192 mg/dL      Average: 123 mg/dL\";\r\n vm.addPatientCardActionData.Icon = \"vh-ui-glyph vh-ui-glyph-item-glucose\";\r\n vm.addPatientCardActionData.CardTypeId= 5;\r\n vm.addPatientCardActionData.CardStatusId = 4;\r\n vm.addPatientCardActionData.Value = \"192\";\r\n vm.addPatientCardActionData.Units = \"mg/dL\";\r\n\r\n init();\r\n\r\n function init(){\r\n\r\n if (rule != null) {\r\n vm.modalHeader = \"Edit Rule\";\r\n //Create copy of rule, so we're editing copy\r\n angular.copy(rule, vm.rule);\r\n if ( vm.rule.RuleConditions.length > 0 && vm.rule.RuleConditions[0].RuleActions.length > 0){\r\n if (vm.rule.RuleConditions[0].RuleActions[0].ActionName == 'AddPathwayAction'){\r\n vm.addPathwayActionData = JSON.parse(vm.rule.RuleConditions[0].RuleActions[0].ActionData);\r\n vm.addPathwayActionData.TemplateId = vm.TemplateId;\r\n }\r\n else if (vm.rule.RuleConditions[0].RuleActions[0].ActionName == 'ChangePathwayStatus'){\r\n vm.changePathwayStatusData = JSON.parse(vm.rule.RuleConditions[0].RuleActions[0].ActionData);\r\n vm.changePathwayStatusData.TemplateId = vm.TemplateId;\r\n }\r\n }\r\n vm.promptForName = true;\r\n }\r\n else{\r\n vm.rule.SurveyTemplateId = vm.TemplateId;\r\n vm.rule.Display = \"\";\r\n vm.rule.Name = \"\";\r\n vm.rule.SortOrder = 1;\r\n vm.rule.RuleConditions = [];\r\n var ruleCondition = {};\r\n ruleCondition.Name = \"\";\r\n ruleCondition.Condition = \"\";\r\n ruleCondition.SortOrder = 1;\r\n ruleCondition.RuleActions = [];\r\n vm.rule.RuleConditions.push(ruleCondition);\r\n var ruleAction = {};\r\n ruleAction.Name = \"\";\r\n ruleAction.ActionName = \"\";\r\n ruleAction.ActionData = \"\";\r\n ruleAction.SortOrder = 1;\r\n ruleCondition.RuleActions.push(ruleAction);\r\n }\r\n }\r\n \r\n vm.addRuleItem = function(text){\r\n if ( vm.rule.RuleConditions[0].Condition == null){\r\n vm.rule.RuleConditions[0].Condition = '';\r\n }\r\n if ( vm.rule.RuleConditions[0].Condition.slice(-1) != ' '){\r\n vm.rule.RuleConditions[0].Condition += ' ';\r\n }\r\n vm.rule.RuleConditions[0].Condition += text + ' ';\r\n } \r\n\r\n function updateDescription(){\r\n\r\n var eventItem = lodash.find(vm.eventTypes, {Value: vm.rule.EventName});\r\n var actionItem = lodash.find(vm.actionTypes, {Value: vm.rule.RuleConditions[0].RuleActions[0].ActionName});\r\n\r\n if ( !vm.promptForName && eventItem != null && actionItem != null){\r\n if ( vm.rule.Display.length == 0){\r\n vm.rule.Display = eventItem.DescriptionText + ' ' + actionItem.DescriptionText;\r\n }\r\n vm.promptForName = true;\r\n }\r\n }\r\n\r\n vm.ok = function (isValid) {\r\n vm.submitted = true;\r\n if (isValid) {\r\n if ( vm.rule.RuleConditions.length > 0 && vm.rule.RuleConditions[0].RuleActions.length > 0){\r\n if (vm.rule.RuleConditions[0].RuleActions[0].ActionName == 'AddPathwayAction'){\r\n // make sure not null as it will cause a JSON parsing error in the rules engine\r\n\r\n if (vm.addPathwayActionData.OverrideDays == null) { vm.addPathwayActionData.OverrideDays = false; }\r\n if (vm.addPathwayActionData.IsSunday == null) { vm.addPathwayActionData.IsSunday = false; }\r\n if (vm.addPathwayActionData.IsMonday == null) { vm.addPathwayActionData.IsMonday = false; }\r\n if (vm.addPathwayActionData.IsTuesday == null) { vm.addPathwayActionData.IsTuesday = false; }\r\n if (vm.addPathwayActionData.IsWednesday == null) { vm.addPathwayActionData.IsWednesday = false; }\r\n if (vm.addPathwayActionData.IsThursday == null) { vm.addPathwayActionData.IsThursday = false; }\r\n if (vm.addPathwayActionData.IsFriday == null) { vm.addPathwayActionData.IsFriday = false; }\r\n if (vm.addPathwayActionData.IsSaturday == null) { vm.addPathwayActionData.IsSaturday = false; }\r\n vm.rule.RuleConditions[0].RuleActions[0].ActionData = JSON.stringify(vm.addPathwayActionData);\r\n }\r\n else if (vm.rule.RuleConditions[0].RuleActions[0].ActionName == 'ChangePathwayStatus'){\r\n vm.rule.RuleConditions[0].RuleActions[0].ActionData = JSON.stringify(vm.changePathwayStatusData);\r\n }\r\n }\r\n console.log(JSON.stringify(vm.rule));\r\n\r\n $uibModalInstance.close(vm.rule);\r\n }\r\n };\r\n\r\n vm.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n vm.getColor = function() {\r\n var retVal = 'blue';\r\n switch(vm.addPatientCardActionData.CardStatusId)\r\n {\r\n case 1:\r\n retVal = '#016F9F';\r\n break;\r\n case 2:\r\n retVal = '#249083';\r\n break;\r\n case 3:\r\n retVal = '#EDB911';\r\n break;\r\n case 4:\r\n retVal = '#BF0606';\r\n break;\r\n }\r\n return retVal;\r\n }\r\n}\r\n\r\nangular.module('content.templates')\r\n.filter('numberToString', function() {\r\n return function (id) {\r\n if (typeof(id) === \"number\") {\r\n id = id.toString(10);\r\n }\r\n return id;\r\n }\r\n})\r\n.controller('AddRuleModalController', AddRuleModalController);\r\n","function AddTemplateModalController($uibModalInstance, lodash, TemplatesService, PermissionService, template, contentLock) {\r\n var vm = this;\r\n vm.populations = [];\r\n vm.enabledPrograms = [];\r\n vm.disabledPrograms = [];\r\n vm.template = contentLock(angular.copy(template));\r\n vm.ok = ok;\r\n vm.template.EnableAlerts = true;\r\n vm.cancel = cancel;\r\n vm.defaultsChanged = defaultsChanged;\r\n vm.userCanWriteRules = PermissionService.userHasPermission([\"RuleWrite\"]);\r\n vm.userCanWriteTemplateTags = PermissionService.userHasPermission([\"PathwayTagWrite\"]);\r\n\r\n vm.showDisabledPrograms = false;\r\n vm.canAssignDisabledPrograms = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n vm.toggleShowDisabledPrograms = toggleShowDisabledPrograms;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n TemplatesService.getPopulations({ enabledOnly: !vm.canAssignDisabledPrograms }).then(function (data) {\r\n vm.enabledPrograms = data.filter(p => p.IsEnabled);\r\n vm.populations = vm.enabledPrograms;\r\n vm.disabledPrograms = data.filter(p => !p.IsEnabled);\r\n if(vm.template.SurveyPatientPopulations.length > 0) {\r\n var navigatedPopulation = lodash.find(vm.populations, function(p) { return lodash.includes(vm.template.SurveyPatientPopulations, p.PopulationId); });\r\n vm.selectedPopulations = [navigatedPopulation];\r\n vm.defaultsChanged();\r\n }\r\n });\r\n }\r\n\r\n function defaultsChanged() {\r\n var hasAllPatients = lodash.find(vm.template.SurveyPatientPopulations, p => p.IsAllPatients);\r\n var allPatients = lodash.find(vm.selectedPopulations, p => p.IsAllPatients);\r\n if (hasAllPatients !== undefined && allPatients !== undefined && vm.selectedPopulations.length > 1) {\r\n //remove All Patients\r\n var copySelected = angular.copy(vm.selectedPopulations);\r\n lodash.remove(copySelected, p => p.IsAllPatients);\r\n vm.selectedPopulations = copySelected;\r\n vm.template.SurveyPatientPopulations = vm.selectedPopulations;\r\n } else if (allPatients) {\r\n //add All Patients, remove all others\r\n vm.selectedPopulations = [allPatients];\r\n vm.template.SurveyPatientPopulations = [allPatients];\r\n } else if (vm.selectedPopulations.length < 1) {\r\n vm.template.SurveyPatientPopulations = [];\r\n } else {\r\n vm.template.SurveyPatientPopulations = vm.selectedPopulations;\r\n }\r\n }\r\n\r\n function ok(isValid) {\r\n if (isValid) {\r\n $uibModalInstance.close(vm.template);\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function toggleShowDisabledPrograms($event) {\r\n $event.stopPropagation();\r\n vm.showDisabledPrograms = !vm.showDisabledPrograms;\r\n updateProgramsList(vm.showDisabledPrograms);\r\n }\r\n\r\n function updateProgramsList(shouldFilter) {\r\n vm.populations = [];\r\n vm.populations = vm.showDisabledPrograms\r\n ? vm.enabledPrograms.concat(vm.disabledPrograms)\r\n : vm.enabledPrograms;\r\n }\r\n}\r\nangular.module('content.templates').controller('AddTemplateModalController', AddTemplateModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/templates/addtemplate.modal.html',\n '

      Add New Pathway

      {{$item.PopulationName}} (disabled){{population.PopulationName}} (disabled)
      ');\n}]);\n}(window, document, window.angular));","function EditBiometricQuestionController($uibModalInstance, lodash, PermissionService, question) {\r\n var vm = this;\r\n vm.question = question;\r\n vm.addCondition = false;\r\n vm.addTag = false;\r\n vm.modalHeader = \"Edit Biometric\";\r\n vm.userCanEditTags = PermissionService.userHasPermission([\"PathwayTagWrite\"]);\r\n vm.userCanEditConditions = PermissionService.userHasPermission([\"PathwayConditionWrite\", \"RuleWrite\"]);\r\n\r\n vm.ruleOperator = [\r\n { Text : '=', Name : 'Equal' },\r\n { Text : '&&', Name : 'And' },\r\n { Text : '||', Name : 'Or' },\r\n { Text : '>', Name : 'Great then' },\r\n { Text : '<', Name : 'Less then' },\r\n { Text : '>=', Name : 'Great then or Equal' },\r\n { Text : '<=', Name : 'Less then or Equal' },\r\n { Text : '!=', Name : 'Not equal' },\r\n { Text : '(', Name : '(' },\r\n { Text : ')', Name : ')' },\r\n { Text : '+', Name : 'Add' },\r\n { Text : '-', Name : 'Subtract' },\r\n { Text : '*', Name : 'Multiply' },\r\n { Text : '/', Name : 'Divide' },\r\n { Text : '%', Name : 'Modulo' }\r\n ];\r\n\r\n vm.ruleVariables = [\r\n { Text : '{FirstName}', Name : 'Patient First Name' },\r\n { Text : '{Birthday}', Name : 'Patient\\'s Birthdate' },\r\n { Text : '{Gender}', Name : 'Patient\\'s Gender' },\r\n\r\n { Text : '{PathwayPlayCount}', Name : 'Pathway Play Count' },\r\n { Text : '{BPReadingCount}', Name : 'BP Reading Count' },\r\n { Text : '{Systolic}', Name : 'Systolic' },\r\n { Text : '{Diastolic}', Name : 'Diastolic' },\r\n { Text : '{BPAverage}', Name : 'BP Average' },\r\n { Text : '{Tags}', Name : 'Tags for this pathway sesson' },\r\n { Text : '{Today}', Name : 'Today\\'s date' },\r\n { Text : '{Month}', Name : 'Current Month name' },\r\n { Text : '{DayOfWeek}', Name : 'Day of the week name' },\r\n { Text : '{DayOfMonth}', Name : 'Day of the month number' },\r\n { Text : '{LastDayOfMonth}', Name : 'Number of days in the current month' },\r\n { Text : '{ProgramDay}', Name : 'Program Day number' },\r\n { Text : '{LastDayOfProgram}', Name : 'Number of days in program' },\r\n { Text : '{AllTags}', Name : 'All tags' }\r\n ];\r\n\r\n vm.ruleChanged = function(){\r\n\r\n }\r\n \r\n vm.ruleSet = [];\r\n\r\n vm.addRuleItem = function(text){\r\n if ( vm.question.DisplayCondition == null){\r\n vm.question.DisplayCondition = '';\r\n }\r\n if ( vm.question.DisplayCondition.slice(-1) != ' '){\r\n vm.question.DisplayCondition += ' ';\r\n }\r\n vm.question.DisplayCondition += text + ' ';\r\n }\r\n\r\n vm.question.TagArray = [];\r\n \r\n vm.ok = function () {\r\n vm.submitted = true;\r\n $uibModalInstance.close(vm.question);\r\n };\r\n\r\n vm.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n}\r\n\r\nangular.module('content.templates').controller('EditBiometricQuestionController', EditBiometricQuestionController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/templates/editbiometric.modal.html',\n '

      {{vm.modalHeader}}

      {{tag}}

      {{vm.question.DisplayCondition}}
      ');\n}]);\n}(window, document, window.angular));","class ImportTemplateModalController {\r\n\r\n constructor(TemplatesService, PermissionService, ScheduleService, $uibModalInstance, $scope, $timeout, $state, NavigationService, VideosService, fileUploader, modalName, EditConfigurationsService, ResponseTransformers){\r\n \r\n this.TemplatesService = TemplatesService;\r\n this.ScheduleService = ScheduleService;\r\n this.$uibModalInstance = $uibModalInstance;\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$state = $state;\r\n this.NavigationService = NavigationService;\r\n this.VideosService = VideosService;\r\n this.fileUploader = fileUploader;\r\n this.modalName = modalName;\r\n this.PermissionService = PermissionService;\r\n this.EditConfigurationsService = EditConfigurationsService;\r\n\r\n this.fileNameValidationError = { text: \"File name has illegal characters.\", type: 'danger' };\r\n\r\n this._chunkSize = 5;\r\n\r\n this.pathways = [];\r\n this.alerts = [];\r\n this.missingMilestones = [];\r\n this.missingPrograms = [];\r\n this.missingVideos = [];\r\n this.isIENine = false;\r\n this.pathwayName = '';\r\n\r\n this.missingData = {};\r\n\r\n this.copyMode = false;\r\n\r\n this.valid = false;\r\n this.progress = 0;\r\n this.progressStep = 0;\r\n this.validating = false;\r\n this.loading = false;\r\n this.uploading = false;\r\n this.validationData = null;\r\n \r\n this.userCanUploadPrograms = PermissionService.userHasPermission([\"ConfigurationPopulationWrite\"]);\r\n this.userCanUploadMilestones = PermissionService.userHasPermission([\"ConfigurationMilestoneWrite\"]);\r\n this.userCanUploadVideos = PermissionService.userHasPermission([\"VideosWrite\"]);\r\n \r\n this.$uibModalInstance.opened.then( _ => {\r\n var changeHandler = (evt) => {\r\n \r\n var files = evt.target.files; // FileList object\r\n \r\n for (var i = 0, f; (f = files[i]); i++) {\r\n \r\n var reader = new FileReader();\r\n \r\n // Closure to capture the file information.\r\n reader.onload = ((theFile) => {\r\n return (e) => {\r\n\r\n var removeDeletedInfo = (obj) => {\r\n \r\n\r\n if(obj.deletedBy_Id)\r\n { obj.deletedBy_Id = null;\r\n console.log(obj);\r\n }\r\n\r\n if(obj.deletedDateTime_UTC)\r\n obj.deletedDateTime_UTC = null;\r\n \r\n\r\n for(var prop in obj){\r\n if(obj[prop] && typeof obj[prop] == 'object')\r\n obj[prop] = removeDeletedInfo(obj[prop]);\r\n else if(Array.isArray(obj[prop]))\r\n obj[prop].forEach((subObj, idx) => {\r\n obj[prop][idx] = removeDeletedInfo(subObj);\r\n } )\r\n }\r\n\r\n\r\n return obj;\r\n };\r\n\r\n var data = this._toCamel(removeDeletedInfo(ResponseTransformers.transform$Ref(e.target.result)));\r\n \r\n var pathways = this.pathways = data.pathways ? data.pathways : data ? [data] : [];\r\n\r\n this.count = pathways.length;\r\n \r\n this.caption = pathways.length > 1 ? `Importing (${this.count}) pathways.` :\r\n pathways.length == 1 ? `Importing ${pathways[0].name || pathways[0].Name}.`\r\n : null;\r\n \r\n this.validate();\r\n \r\n }})(f);\r\n \r\n // Read in the image file as a data URL.\r\n reader.readAsText(f);\r\n }\r\n \r\n };\r\n\r\n window.setTimeout(_ => {\r\n var element = document.getElementById('template-file-input');\r\n element.removeEventListener('change', changeHandler);\r\n element.addEventListener('change', changeHandler, false); }\r\n , 500);\r\n })\r\n\r\n\r\n\r\n }\r\n\r\n _chunk(array, size){\r\n return Array(Math.ceil(array.length/size)).fill().map((_,i) => array.slice(i*size,i*size+size));\r\n }\r\n\r\n _reset(){\r\n this.missingData = {};\r\n this.valid = false;\r\n this.progress = 0;\r\n this.progressStep = 0;\r\n this.validating = false;\r\n this.loading = false;\r\n this.uploading = false;\r\n this.count = 0;\r\n this.pathways = [];\r\n this.missingMilestones = [];\r\n this.missingPrograms = [];\r\n this.missingVideos = [];\r\n this.validationData = null;\r\n }\r\n\r\n _toCamel(o){\r\n var self = this;\r\n var newO, origKey, newKey, value\r\n if (o instanceof Array) {\r\n return o.map(function(value) {\r\n if (typeof value === \"object\") {\r\n value = self._toCamel(value)\r\n }\r\n return value\r\n })\r\n } else {\r\n newO = {}\r\n for (origKey in o) {\r\n if (o.hasOwnProperty(origKey)) {\r\n newKey = (origKey.charAt(0).toLowerCase() + origKey.slice(1) || origKey).toString()\r\n value = o[origKey]\r\n if (value instanceof Array || (value !== null && value.constructor === Object)) {\r\n value = self._toCamel(value)\r\n }\r\n newO[newKey] = value\r\n }\r\n }\r\n }\r\n return newO\r\n }\r\n\r\n // get a list of videos from question and subquestions\r\n _getVideos(question){\r\n var videos = [];\r\n question.surveyOptions.forEach(o => {\r\n if(o.video) {\r\n videos.push(o.video);\r\n }\r\n });\r\n\r\n (question.surveyQuestions ||[]).forEach(q => {\r\n videos.concat(this._getVideos(q));\r\n });\r\n \r\n return videos;\r\n }\r\n\r\n _distinctObjects(items, distinct){\r\n \r\n if(!items)\r\n return [];\r\n\r\n var ids = [...new Set(items.map(distinct))];\r\n var results = ids.map(id => items.find(x => distinct(x) == id) );\r\n \r\n return results || []\r\n }\r\n\r\n _forceUpdate(){\r\n window.setTimeout(()=> {\r\n this.$scope.$parent.$apply();\r\n }, 100);\r\n }\r\n\r\n\r\n upload() {\r\n\r\n var programs = JSON.parse(JSON.stringify(this.missingPrograms || []));\r\n programs.forEach(x => x.populationId = 0);\r\n\r\n\r\n var milestones = (this.missingMilestones || []).map(x => { return { name: x.name, milestoneUId: x.uid, milestoneId: x.id } });\r\n \r\n var milestonePromise = milestones.length > 0 ? \r\n this.EditConfigurationsService\r\n .importMilestones({ milestones: milestones }) : Promise.resolve({});\r\n \r\n var videos = this.missingVideos || [];\r\n\r\n var videoPromise = videos.length > 0 ? \r\n this.VideosService\r\n .importVideos({ videos: videos }) : Promise.resolve({});\r\n\r\n\r\n return new Promise((resolve, reject)=>{\r\n \r\n var results = []; \r\n milestonePromise.then(()=>{\r\n\r\n videoPromise.then(()=>{\r\n\r\n\r\n this.progress = 0;\r\n this._forceUpdate();\r\n \r\n var working = this._chunk(JSON.parse(JSON.stringify(this.pathways)), this._chunkSize);\r\n var progressSize = Math.floor(100 / working.length);\r\n \r\n if(this.pathways && this.pathways.length > 0 && this.pathways[0].surveyPatientPopulations && this.pathways[0].surveyPatientPopulations.length > 0)\r\n var populationId = (this.programs.find(x => x.populationUId == this.pathways[0].surveyPatientPopulations[0].populationUId) || {}).populationId;\r\n \r\n results.populationId = populationId;\r\n \r\n var uploadNext = () =>{\r\n if(working.length == 0)\r\n {\r\n resolve(results);\r\n return;\r\n }\r\n \r\n var item = working.shift();\r\n\r\n if(this.copyMode)\r\n {\r\n item.forEach(x => {\r\n x.surveyTemplateUId = null;\r\n x.name = `${x.name} - Copy`;\r\n });\r\n }\r\n\r\n\r\n \r\n this.TemplatesService.importTemplates({\r\n pathways: item\r\n }).then((result)=>{\r\n \r\n\r\n for(var index = 0; index < result.length; index++){\r\n var item = result[index];\r\n var existingResult = results.find(x => x.category == item.category);\r\n if(!existingResult)\r\n results.push(item);\r\n else{\r\n existingResult.added += item.added;\r\n existingResult.updated += item.updated;\r\n existingResult.deleted += item.deleted;\r\n existingResult.notifications = existingResult.notifications.concat(item.notifications);\r\n }\r\n }\r\n\r\n this.progress += progressSize;\r\n if(this.progress > 99)\r\n this.progress = 99;\r\n \r\n this._forceUpdate();\r\n \r\n uploadNext();\r\n });\r\n \r\n };\r\n \r\n uploadNext();\r\n\r\n })\r\n })\r\n \r\n \r\n })\r\n }\r\n\r\n getValidationData() {\r\n this.loading = true;\r\n return this.validationData || this.TemplatesService.getValidationData()\r\n .then(data => {\r\n this.milestones = data.milestones;\r\n this.programs = data.programs;\r\n this.videos = data.videos;\r\n this.loading = false;\r\n });\r\n }\r\n \r\n \r\n enableCancelButton(){\r\n return !this.uploading;\r\n }\r\n \r\n enableOkButton() {\r\n return !this.uploading && this.pathways && this.pathways.length > 0;\r\n }\r\n\r\n validate(){\r\n this.valid = false;\r\n this.validating = true;\r\n this.getValidationData().then(()=>{\r\n var pathways = this.pathways || [];\r\n\r\n var milestones = pathways.filter(p => p.surveySchedule).map(p => [{name: p.surveySchedule.milestoneName, uid: p.surveySchedule.milestoneUId, id: p.surveySchedule.milestoneId}, {name: p.surveySchedule.endDateMilestoneName, uid: p.surveySchedule.endDateMilestoneUId, id: p.surveySchedule.endDateMilestoneId}]\r\n .filter(x => x.uid != null || x.name != null)).flat(Infinity)\r\n\r\n var programs = pathways.map(p => p.surveyPatientPopulations).flat(Infinity);\r\n\r\n var videos = this._distinctObjects(pathways.map(p => (p.surveyQuestions || []).map(this._getVideos)).flat(Infinity), v => JSON.stringify(v));\r\n \r\n this.missingMilestones = this._distinctObjects((milestones || []).filter(x => !(this.milestones || []).find(_ => _.milestoneUId == x.uid || _.name == x.name)), m => m.uid);\r\n \r\n this.missingPrograms = []; //this._distinctObjects((programs || []).filter(x => !(this.programs || []).find(_ => _.populationUId == x.populationUId || _.populationName == x.populationName )), p => p.populationUId || p.populationName)\r\n\r\n this.missingVideos = this._distinctObjects((videos || []).filter(x => !(this.videos || []).find(_ => _.videoUId == x.videoUId || _.name == x.name )), v => v.videoId)\r\n\r\n var missingData = {};\r\n\r\n if(this.missingPrograms.length > 0)\r\n missingData['Program(s)'] = this.missingPrograms.map(x => x.populationName);\r\n \r\n if(this.missingMilestones.length > 0)\r\n missingData['Milestone(s)'] = this.missingMilestones.map(x => x.name);\r\n\r\n if(this.missingVideos.length > 0)\r\n missingData['Video(s)'] = this.missingVideos.map(x => x.name);\r\n\r\n this.missingData = missingData;\r\n \r\n this.validating = false;\r\n\r\n this.valid = this.missingPrograms.length == 0 && this.missingMilestones.length == 0 && this.missingVideos.length == 0;\r\n\r\n this._forceUpdate();\r\n });\r\n \r\n }\r\n\r\n ok() {\r\n // upload with feedback\r\n this.uploading = true;\r\n\r\n this.upload().then(result => {\r\n this._reset();\r\n this.$uibModalInstance.close(result);\r\n });\r\n \r\n }\r\n \r\n cancel() {\r\n this._reset();\r\n this.$uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n\r\n\r\n}\r\n\r\nfunction ImportTemplateModalControllerFactory(TemplatesService, PermissionService, ScheduleService, $uibModalInstance, $scope, $timeout, $state, NavigationService, VideosService, fileUploader, modalName, EditConfigurationsService, ResponseTransformers) {\r\n return new ImportTemplateModalController(...arguments);\r\n}\r\n\r\nangular\r\n .module(\"content.templates\")\r\n .controller(\"ImportTemplateModalController\", ImportTemplateModalControllerFactory);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/templates/importtemplate.modal.html',\n '

      {{vm.modalName}}

      0\">{{vm.count}} pathway(s) in file.

      {{alert.text}}
      {{vm.progress}}%
      ');\n}]);\n}(window, document, window.angular));","function TemplatesController(\r\n TemplatesService, \r\n PatientSurveyService,\r\n $q,\r\n $state,\r\n $scope, \r\n $http, \r\n $stateParams,\r\n $sce, \r\n lodash, \r\n $uibModal, \r\n vhSweetAlert, \r\n PermissionService, \r\n SmoothScroll, \r\n $timeout, \r\n NavigationService, \r\n $filter, \r\n vhRulesParserService, \r\n ScheduleService,\r\n contentLock,\r\n lockStatusEnum\r\n ) {\r\n\r\n\r\n $scope.lockStatusEnum = lockStatusEnum;\r\n \r\n var vm = this;\r\n vm.searchTextBox = '';\r\n vm.searchText = '';\r\n vm.noSearchResults = false;\r\n vm.surveyTemplates = [];\r\n vm.activeSearch = false;\r\n vm.selectedTemplates = [];\r\n\r\n vm.surveyTemplate = {};\r\n vm.DefaultLanguageId = 'en'; //Default to English\r\n vm.Language = { Code: 'en', Name: 'English' };\r\n vm.templateGroupId = 0\r\n vm.rules = [];\r\n\r\n vm.userCanDeleteTemplate = PermissionService.userHasPermission([\"MasterCareplansWrite\"]);\r\n vm.userCanAddTemplate = PermissionService.userHasPermission([\"MasterCareplansWrite\"]);\r\n vm.usercanPublishTemplate = PermissionService.userHasPermission([\"MasterCareplansWrite\"]);\r\n vm.userCanExportTemplate = PermissionService.userHasPermission([\"SurveyTemplateExport\"]);\r\n vm.usercanBulkAssign = PermissionService.userHasPermission([\"BulkPatientCareplanWrite\"]);\r\n vm.userCanImportTemplate = PermissionService.userHasPermission([\"SurveyTemplateImport\"]);\r\n vm.userCanEditRules = PermissionService.userHasPermission([\"RuleWrite\"]);\r\n vm.userCanEditTags = PermissionService.userHasPermission([\"PathwayTagWrite\"]);\r\n vm.userCanAddSaveSurveyQuestion = PermissionService.userHasPermission([\"SurveyQuestionsWrite\"]);\r\n vm.userCanLockQuestions = PermissionService.userHasPermission([\"CanLockQuestions\"]);\r\n vm.userCanEditLockedPathways = PermissionService.userHasPermission([\"CanEditLockedPathways\"]);\r\n vm.userCanEditLockedSchedules = PermissionService.userHasPermission([\"ContentPathwayScheduleEdit\"]);\r\n\r\n vm.ShowOptions = ShowOptions;\r\n vm.selectTemplate = selectTemplate;\r\n vm.performSearch = performSearch;\r\n vm.clearSearch = clearSearch;\r\n vm.deleteTemplate = deleteTemplate;\r\n vm.publishTemplate = publishTemplate;\r\n vm.unPublishTemplate = unPublishTemplate;\r\n vm.openAddModal = openAddModal;\r\n vm.showDefaults = showDefaults;\r\n vm.flashUnpublished = flashUnpublished;\r\n vm.assignTemplate = assignTemplate;\r\n vm.unassignTemplate = unassignTemplate;\r\n vm.importPathway = importPathway;\r\n vm.selectToggle = selectToggle;\r\n vm.itemsSelected = itemsSelected;\r\n vm.showSelectAllButton = showSelectAllButton;\r\n vm.editPathways = editPathways;\r\n vm.testConditions = testConditions;\r\n vm.resetConditions = resetConditions;\r\n\r\n vm.getMilestoneName = getMilestoneName;\r\n\r\n vm.editSchedule = function (template) {\r\n \r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/components/schedule/schedule.modal.html',\r\n controller: 'ScheduleModalController as vm',\r\n animation: false,\r\n backdrop: 'static',\r\n keyboard: false,\r\n size: 'lg',\r\n resolve: {\r\n scheduleToEdit: template.SurveySchedule,\r\n isTemplate: isTemplate(template.SurveySchedule),\r\n milestones: function(){\r\n return $scope.milestones;\r\n },\r\n templateInfo: {name: template.Name},\r\n returnToSurveyEdit: false\r\n }\r\n });\r\n modalInstance.result.then((scheduleData) => {\r\n saveSchedule(template.SurveySchedule).then((data) => {\r\n NavigationService.refreshTemplateGroups();\r\n template.SurveySchedule = getSchedule(scheduleData);\r\n vm.surveyTemplates.find(x => x.SurveyTemplateId == template.SurveyTemplateId).SurveySchedule = template.SurveySchedule;\r\n });\r\n \r\n }, function () {});\r\n } \r\n\r\n function isTemplate(schedule) {\r\n return schedule.SurveyScheduleId > 0;\r\n }\r\n\r\n function saveSchedule(schedule) {\r\n return TemplatesService.saveTemplateSchedules([schedule]);\r\n }\r\n\r\n function getSchedule(schedule) {\r\n var result = null;\r\n if (schedule) {\r\n result = schedule;\r\n result.description = getScheduleDescription(result);\r\n }\r\n else {\r\n result = {\r\n description: 'Not set'\r\n };\r\n }\r\n return result;\r\n };\r\n\r\n function getScheduleDescription(schedule){\r\n return $filter('schedule')(schedule, getMilestoneName(schedule.MilestoneId));\r\n }\r\n\r\n function getMilestoneName(milestoneId) {\r\n var result = '';\r\n if(!$scope.milestones) {\r\n return result;\r\n }\r\n if(!milestoneId) {\r\n return result;\r\n };\r\n for(var i = 0; i <$scope.milestones.length; ++i){\r\n if($scope.milestones[i].MilestoneId === milestoneId){\r\n result = $scope.milestones[i].Name;\r\n break;\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n\r\n vm.getRuleName = function (rule) {\r\n if (rule.Name) {\r\n return $sce.trustAsHtml(rule.Name);\r\n } else {\r\n return $sce.trustAsHtml('(' + rule.RuleId + ') ' + rule.Display);\r\n }\r\n }\r\n\r\n vm.disableExport = function(){\r\n return (vm.itemsSelected() == 0 && (!vm.surveyTemplate || !vm.surveyTemplate.SurveyTemplateId)) \r\n || vm.templateGroupId == null;\r\n }\r\n\r\n vm.exportPathways = function(){\r\n var selected = vm.surveyTemplates.filter(x => x.selected).map(x => x.SurveyTemplateId);\r\n\r\n if(!selected || selected.length == 0 && vm.surveyTemplate){\r\n selected = [vm.surveyTemplate.SurveyTemplateId]; \r\n }\r\n\r\n if(selected.length > 0)\r\n {\r\n $http.post('/api/export/pathways', JSON.stringify(selected))\r\n .then(function successCallback(response) {\r\n var headersFn = response.headers;\r\n var headers = headersFn();\r\n var data = response.data;\r\n \r\n var ticks = `${new Date().getTime()}`;\r\n var filename = `pathways-${(vm.templateGroupName || ticks).replace('\\'','')}.json`;\r\n var contentType = headers['content-type'];\r\n \r\n var a = document.createElement('a');\r\n try {\r\n var blob = new Blob([JSON.stringify(response.data)], { type: contentType });\r\n var url = window.URL.createObjectURL(blob);\r\n \r\n vhSweetAlert.success('Exported', `Successfully exported ${(data.pathways || (data ? [data] : [])).length} Pathway(s).`);\r\n\r\n a.setAttribute('href', url);\r\n a.setAttribute(\"download\", filename);\r\n a.click(); \r\n\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n }, function errorCallback(error) {\r\n console.log('Something went wrong!!!')\r\n });\r\n \r\n }\r\n }\r\n\r\n \r\n $scope.milestones = [];\r\n\r\n $scope.toggleShowOptions = toggleShowOptions;\r\n $scope.defaultOptionLimit = 5;\r\n function toggleShowOptions(question){\r\n if(!question.optionLimit || question.optionLimit == $scope.defaultOptionLimit){\r\n question.optionLimit = question.SurveyOptions.length;\r\n }else{\r\n question.optionLimit = $scope.defaultOptionLimit;\r\n }\r\n }\r\n\r\n\r\n var unpublishedSurveyId = 0;\r\n var unassignedGroupId = -1;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n //Select last edited survey template\r\n var lastEditedTempalteId = TemplatesService.getLastEditedTemplateId();\r\n if (lastEditedTempalteId > 0) {\r\n getSelectedTemplate(lastEditedTempalteId);\r\n TemplatesService.setLasstEditedTemplateId(-1);\r\n } else {\r\n vm.surveyTemplate = {};\r\n }\r\n\r\n if ($stateParams.templateGroupId >= -2) {\r\n vm.templateGroupId = $stateParams.templateGroupId;\r\n TemplatesService.getTemplateGroup($stateParams.templateGroupId).then(function (group) {\r\n vm.templateGroupName = group.TemplateGroupName;\r\n vm.surveyTemplates = group.Templates.map(x => contentLock(x, lockChanged));\r\n lodash.forEach(vm.surveyTemplates, function(data) {\r\n data.selected = false;\r\n })\r\n });\r\n } else {\r\n\r\n //TemplatesService.getAllTemplates().then(function (data) {\r\n // vm.surveyTemplates = data;\r\n //});\r\n }\r\n\r\n TemplatesService.getAvailableLanguages().then(function (data) {\r\n vm.AvailableLanguages = data;\r\n });\r\n\r\n ScheduleService.getMilestones().then(function(response){\r\n $scope.milestones = response.data;\r\n });\r\n\r\n }\r\n\r\n function mapContentLock(item) {\r\n (item.SurveyOptions || []).forEach(o => o.ChildQuestions = (o.ChildQuestions || []).map(mapContentLock));\r\n return contentLock(item, lockChanged); \r\n }\r\n\r\n function lockChanged(item, newValue){\r\n var itemIsQuestion = item.SurveyQuestionId != null;\r\n var itemIsTemplate = !itemIsQuestion;\r\n var templateId = item.SurveyTemplateId || vm.surveyTemplate.SurveyTemplateId;\r\n var isLocking = newValue == lockStatusEnum.Locked;\r\n \r\n let { lockQuestion, unlockQuestion, lockPathway, unlockPathway } = TemplatesService;\r\n var lockLogic = itemIsQuestion ? (isLocking ? lockQuestion : unlockQuestion ) : (isLocking ? lockPathway: unlockPathway);\r\n\r\n if(itemIsTemplate) {\r\n\r\n lockLogic(templateId).then(()=>{\r\n\r\n if(templateId)\r\n { \r\n\r\n $timeout(()=>{\r\n getSelectedTemplate(templateId);\r\n }, 0)\r\n \r\n vm.surveyTemplates.find(x => x.SurveyTemplateId == templateId).setLockStatus(newValue);\r\n }\r\n });\r\n } else if (itemIsQuestion) {\r\n\r\n try {\r\n lockLogic(item.SurveyQuestionId, item.SurveyQuestionRevisionId, templateId);\r\n \r\n // var question = vm.surveyTemplate.SurveyQuestions.filter(x => x.SurveyQuestionId == item.SurveyQuestionId &&\r\n // x.SurveyQuestionRevisionId == item.SurveyQuestionRevisionId)\r\n \r\n // question.map(x => x.se.setLockStatus(newValue)); \r\n \r\n $timeout(()=>{\r\n getSelectedTemplate(templateId);\r\n }, 0); \r\n } catch (e) {\r\n\r\n } \r\n }\r\n\r\n }\r\n\r\n vm.lockPathways = function lockPathways() {\r\n var selected = vm.surveyTemplates.filter(x => x.selected && x.LockStatus == 0).map(x => x.SurveyTemplateId);\r\n\r\n if (!selected || selected.length == 0 && vm.surveyTemplate && vm.surveyTemplate.SurveyTemplateId > 0) {\r\n selected = [vm.surveyTemplate.SurveyTemplateId];\r\n }\r\n\r\n if (selected.length > 0)\r\n {\r\n var promises = selected.map(templateId => TemplatesService.lockPathway(templateId));\r\n $q.all(promises).finally(function() {\r\n if (vm.surveyTemplate.SurveyTemplateId > 0)\r\n {\r\n TemplatesService.setLasstEditedTemplateId(vm.surveyTemplate.SurveyTemplateId);\r\n }\r\n loadController();\r\n });\r\n }\r\n }\r\n \r\n function selectToggle(group = 'both') {\r\n\r\n group = group || 'both';\r\n \r\n vm.surveyTemplates.forEach(item => item.selected = false);\r\n\r\n if(group === 'published'){\r\n vm.surveyTemplates.filter(x => x.IsPublished == true).forEach(item => item.selected = true);\r\n }else if (group === 'unpublished'){\r\n vm.surveyTemplates.filter(x => x.IsPublished != true).forEach(item => item.selected = true);\r\n } else if (group === 'both') {\r\n vm.surveyTemplates.forEach(item => item.selected = true);\r\n }\r\n\r\n }\r\n\r\n function itemsSelected(group) {\r\n\r\n if(group == 'published')\r\n vm.surveyTemplates.find(item => item.IsPublished && item.selected) != null\r\n if(group == 'unpublished')\r\n vm.surveyTemplates.find(item => !item.IsPublished && item.selected) != null\r\n\r\n return vm.surveyTemplates.find(item => item.selected) != null;\r\n }\r\n\r\n function showDefaults() {\r\n return vm.surveyTemplate.SurveyPatientPopulations.length > 0;\r\n }\r\n\r\n function ShowOptions(question) {\r\n return !TemplatesService.isBiometricQuestion(question) && !TemplatesService.isHealthTipQuestion(question);\r\n }\r\n\r\n function showSelectAllButton() {\r\n return ($stateParams.templateGroupId >= -2 || vm.activeSearch == true)\r\n }\r\n\r\n function editPathways() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/editpathways.modal.html',\r\n controller: 'EditPathwaysController as vm',\r\n keyboard: false,\r\n size: 'sm',\r\n resolve: {\r\n pathwayCount: function() {\r\n return {\r\n count: vm.surveyTemplates.find(x => x.selected && x.IsPublished).length,\r\n unpublished: vm.surveyTemplates.filter(x => x.selected && !x.IsPublished).length\r\n };\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (time) {\r\n if (time) {\r\n var changedSurveySchedules = [];\r\n vm.surveyTemplates.filter(item => item.IsPublished == true && item.selected).forEach(function(data) {\r\n if (data.selected == true) {\r\n data.selected = false;\r\n\r\n if(data.IsPublished) {\r\n data.SurveySchedule.SchedulePromptTimeOfDay = $filter('date')(time.time, 'HH:mm:ss');\r\n changedSurveySchedules.push(data.SurveySchedule);\r\n }\r\n }\r\n \r\n });\r\n\r\n vm.selectToggle('none');\r\n\r\n TemplatesService.saveTemplateSchedules(changedSurveySchedules).then(function (data) {\r\n NavigationService.refreshTemplateGroups();\r\n\r\n });\r\n }\r\n }, function () {\r\n });\r\n }\r\n\r\n function selectTemplate(surveyTemplateId) { \r\n if (vm.surveyTemplate.surveyTemplateId !== surveyTemplateId) {\r\n $state.go('content.templates.template', {SurveyTemplateId: surveyTemplateId});\r\n getSelectedTemplate(surveyTemplateId);\r\n }\r\n }\r\n\r\n function getSelectedTemplate(templateId) {\r\n vm.loadingSurvey = true;\r\n vm.surveyTemplate = {};\r\n TemplatesService.getTemplate(templateId).then(function (data) {\r\n vm.surveyTemplate = contentLock(data, lockChanged);\r\n\r\n\r\n\r\n vm.surveyTemplate.SurveyQuestions = vm.surveyTemplate.SurveyQuestions.map(mapContentLock);\r\n \r\n vm.surveyTemplate.TagArray = [];\r\n if (vm.surveyTemplate.Tags != null){\r\n vm.surveyTemplate.TagArray = vm.surveyTemplate.Tags.split(';');\r\n }\r\n vm.surveyTemplate.jsonText = JSON.stringify(vm.surveyTemplate);\r\n buildVariableList();\r\n });\r\n TemplatesService.getRulesForPathway(templateId).then(function (data) {\r\n vm.rules = data;\r\n });\r\n }\r\n\r\n function buildVariableList(){\r\n vm.surveyTemplate.VariableList = [];\r\n var conditions = lodash.pluck(vm.surveyTemplate.SurveyQuestions, 'PostFixDisplayCondition');\r\n if (conditions != null){\r\n lodash.each( conditions, function(condition){\r\n if (condition != null){\r\n try{\r\n var conditionArray = JSON.parse(condition);\r\n lodash.each( conditionArray, function(item){\r\n if ( typeof item === 'string' && item.startsWith('{') ){\r\n var variable = {};\r\n variable.Name = item.substring(1,item.length-1).replace(/\\s/g,'');\r\n variable.Value = \"\";\r\n var found = lodash.filter(vm.surveyTemplate.VariableList, { 'Name' : variable.Name }, 'Name' );\r\n if ( found.length == 0 ){\r\n vm.surveyTemplate.VariableList.push(variable)\r\n }\r\n }\r\n });\r\n }\r\n catch(e){}\r\n }\r\n }); \r\n }\r\n }\r\n\r\n function testConditions(){\r\n var conditionData = {};\r\n lodash.each( vm.surveyTemplate.VariableList, function(item){\r\n if(item.Value.indexOf(';') > -1) {\r\n conditionData[item.Name] = item.Value.toLowerCase().split(';').map(function(s) { \r\n return s.trim()\r\n });\r\n } else if (item.Value.indexOf(',') > -1 ) {\r\n conditionData[item.Name] = item.Value.toLowerCase().split(',').map(function(s) { \r\n return s.trim()\r\n });\r\n } else {\r\n conditionData[item.Name] = item.Value;\r\n }\r\n });\r\n lodash.each(vm.surveyTemplate.SurveyQuestions, function(question){\r\n question.DisplayQuestion = true;\r\n if (question.PostFixDisplayCondition != null){\r\n try{\r\n var conditionArray = JSON.parse(question.PostFixDisplayCondition);\r\n question.DisplayQuestion = vhRulesParserService.evaluate(conditionArray, conditionData);\r\n }\r\n catch(e){}\r\n }\r\n });\r\n }\r\n\r\n function resetConditions(){\r\n lodash.each(vm.surveyTemplate.SurveyQuestions, function(question){\r\n question.DisplayQuestion = true;\r\n });\r\n }\r\n\r\n function performSearch() {\r\n if (vm.searchTextBox.length > 0) {\r\n $state.go(\"content.templates\");\r\n vm.lasttemplateGroupId = vm.templateGroupId;\r\n if ( vm.templateGroupId == 0 ){\r\n vm.templateGroupId = unassignedGroupId;\r\n }\r\n vm.searchText = vm.searchTextBox;\r\n TemplatesService.searchTemplates(vm.searchText).then(function (data) {\r\n vm.surveyTemplates = data.map(x => contentLock(x, lockChanged));\r\n\r\n if (vm.surveyTemplates.length === 0) {\r\n vm.noSearchResults = true;\r\n }\r\n else {\r\n vm.noSearchResults = false;\r\n }\r\n vm.activeSearch = true;\r\n vm.surveyTemplate = {};\r\n });\r\n }\r\n }\r\n\r\n function clearSearch() {\r\n $state.go(\"content.templates\");\r\n TemplatesService.getAllTemplates().then(function (data) {\r\n vm.surveyTemplates = data;\r\n vm.noSearchResults = false;\r\n vm.activeSearch = false;\r\n vm.searchText = '';\r\n vm.searchTextBox = '';\r\n vm.surveyTemplate = {};\r\n vm.templateGroupId = vm.lasttemplateGroupId;\r\n vm.templateGroupName = '';\r\n });\r\n }\r\n\r\n function deleteTemplate(id) {\r\n var template = lodash.where(vm.surveyTemplates, { SurveyTemplateId : id })[0];\r\n\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete ' + template.Name + '?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n TemplatesService.deleteTemplate(id).then(function() {\r\n NavigationService.refreshTemplateGroups();\r\n });\r\n lodash.remove(vm.surveyTemplates, function (st) { return st.SurveyTemplateId == id; });\r\n\r\n $state.go('content.templates');\r\n vm.surveyTemplate = {};\r\n }\r\n }\r\n );\r\n }\r\n\r\n function saveTemplate(surveyTemplate) {\r\n var template = {};\r\n template.SurveyTemplateId = surveyTemplate.SurveyTemplateId;\r\n template.Name = surveyTemplate.Name;\r\n template.IsPublished = surveyTemplate.IsPublished;\r\n template.PromptOrder = surveyTemplate.PromptOrder;\r\n template.SurveyTypeId = surveyTemplate.SurveyTypeId;\r\n template.Tags = surveyTemplate.Tags;\r\n template.DefaultStatusId = surveyTemplate.DefaultStatusId;\r\n template.EnableAlerts = surveyTemplate.EnableAlerts;\r\n template.PatientDateEditEnabled = surveyTemplate.PatientDateEditEnabled;\r\n template.PatientPromptTimeEnabled = surveyTemplate.PatientPromptTimeEnabled;\r\n template.TemplateTexts = surveyTemplate.TemplateTexts;\r\n\r\n return TemplatesService.saveTemplate(template);\r\n }\r\n\r\n function publishTemplate(surveyTemplate) {\r\n if (surveyTemplate.IsPublished === false && vm.usercanPublishTemplate === true) {\r\n surveyTemplate.IsPublished = true;\r\n saveTemplate(surveyTemplate);\r\n selectTemplate(surveyTemplate.SurveyTemplateId);\r\n $timeout(function() {\r\n SmoothScroll.scroll('top');\r\n }, 0);\r\n }\r\n }\r\n\r\n function unPublishTemplate(surveyTemplate) {\r\n if (surveyTemplate.IsPublished === true && vm.usercanPublishTemplate === true) {\r\n surveyTemplate.IsPublished = false;\r\n surveyTemplate.selected = false;\r\n saveTemplate(surveyTemplate);\r\n unpublishedSurveyId = surveyTemplate.SurveyTemplateId;\r\n $timeout(function() {\r\n SmoothScroll.scroll('unpublished' + surveyTemplate.SurveyTemplateId);\r\n }, 0);\r\n }\r\n }\r\n\r\n function assignTemplate(id) {\r\n PatientSurveyService.assignTemplate(id, true)\r\n .then(function(data){\r\n vhSweetAlert.verify('Assign Pathways', 'Based on defaulted population(s), ' + data + ' patient(s) qualify for this pathway. Pathway assignment will only occur for those patient(s) that do not currently have this pathway.', 'Assign')\r\n .then(function(isConfirm){\r\n if(isConfirm) {\r\n PatientSurveyService.assignTemplate(id, false);\r\n }\r\n });\r\n });\r\n }\r\n\r\n function unassignTemplate(id) {\r\n PatientSurveyService.unassignTemplate(id, true)\r\n .then(function(data){\r\n vhSweetAlert.verify('Unassign Pathways', 'This pathway will be unassigned from ' + data + ' patient(s)', 'Unassign')\r\n .then(function(isConfirm){\r\n if(isConfirm) {\r\n PatientSurveyService.unassignTemplate(id, false);\r\n }\r\n });\r\n });\r\n }\r\n\r\n function openAddModal() {\r\n var populations = [];\r\n if ($stateParams.templateGroupId && parseInt($stateParams.templateGroupId) !== unassignedGroupId) {\r\n var popInt = parseInt($stateParams.templateGroupId);\r\n populations = [popInt];\r\n }\r\n\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addtemplate.modal.html',\r\n controller: 'AddTemplateModalController as vm',\r\n keyboard: false,\r\n resolve: {\r\n surveyTags: function() {\r\n return TemplatesService.getSurveyTags();\r\n },\r\n template: function() {\r\n return {\r\n Name: '',\r\n SurveyTemplateId: 0,\r\n SurveyTypeId: 1,\r\n DefaultStatusId: 1,\r\n SurveyPatientPopulations: populations,\r\n LockStatus: 0\r\n };\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (template) {\r\n TemplatesService.saveTemplate(template).then(function (data) {\r\n NavigationService.refreshTemplateGroups();\r\n if (data.SurveyPatientPopulations && data.SurveyPatientPopulations.length > 0) {\r\n $state.go('content.templates.template.edit', {SurveyTemplateId: data.SurveyTemplateId, templateGroupId: data.SurveyPatientPopulations[0].PopulationId});\r\n }\r\n else {\r\n $state.go('content.templates.template.edit', {SurveyTemplateId: data.SurveyTemplateId});\r\n }\r\n });\r\n }, function () {\r\n });\r\n\r\n }\r\n\r\n function flashUnpublished(survey) {\r\n if (survey.SurveyTemplateId === unpublishedSurveyId) {\r\n unpublishedSurveyId = 0;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n vm.toggleLanguage = function(language) {\r\n vm.Language = language;\r\n };\r\n\r\n vm.isSurveyMultiLingual = function(survey) {\r\n var retVal = false;\r\n var languageCount = 0;\r\n\r\n for (var i = 0; i < vm.AvailableLanguages.length; i++) {\r\n if (lodash.any(survey.AvailableLanguages, {LanguageId: vm.AvailableLanguages[i].LanguageId})) {\r\n languageCount++;\r\n }\r\n }\r\n\r\n if (languageCount >= 2) {\r\n retVal = true;\r\n }\r\n\r\n return retVal;\r\n };\r\n\r\n vm.getPatientSurveyCount = function(surveyTemplate) {\r\n var surveyTemplate = lodash.find(vm.surveyTemplates, function(o) {\r\n return o.SurveyTemplateId === surveyTemplate.SurveyTemplateId;\r\n });\r\n if (surveyTemplate !== undefined && surveyTemplate !== null) {\r\n return surveyTemplate.PatientSurveyCount;\r\n }\r\n }\r\n\r\n function importPathway() {\r\n \r\n var modalInstance = vm.modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/importtemplate.modal.html',\r\n controller: 'ImportTemplateModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n modal: function() {\r\n return vm.modalInstance;\r\n },\r\n currentList: function() {\r\n return vm.images;\r\n },\r\n fileUploader: function() {\r\n return TemplatesService.getFileUploader();\r\n },\r\n modalName: function() {\r\n return 'Import Pathway(s)';\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(data){\r\n NavigationService.refreshTemplateGroups();\r\n\r\n var alertMessage = '';\r\n\r\n\r\n\r\n // get errors\r\n var errors = data.map(x => x.errors).reduce((total,num)=> total + num);\r\n // get notifications\r\n var notifications = (data.map(x => x.notifications).flat(Infinity) || []).join('
      ');\r\n // population id\r\n var programId = data.populationId;\r\n // added ids\r\n var ids = ((data.find(x => x.category == 'Pathway') || {}).ids || []);\r\n\r\n var programResult = data.find(x => x.category == 'Program(s)');\r\n\r\n if(programResult && programResult.ids && programResult.ids.length > 0)\r\n programId = programResult.ids[0].populationId;\r\n\r\n\r\n \r\n if(Array.isArray(data)){\r\n var pluralize = (word, count) => {\r\n word = `${word}`.toLowerCase();\r\n\r\n if(word.indexOf('program') > -1){\r\n return 'Program(s)';\r\n }\r\n else if(word.indexOf('pathway') > -1){\r\n return 'Pathway(s)';\r\n }\r\n\r\n return word;\r\n }\r\n \r\n data.forEach(result => {\r\n \r\n if(result.updated > 0)\r\n alertMessage += `Successfully updated ${result.updated} ${pluralize(result.category, result.updated)}.
      ` \r\n \r\n if(result.added > 0)\r\n alertMessage += `Successfully added ${result.added} ${pluralize(result.category, result.added)}.
      ` \r\n \r\n });\r\n }\r\n \r\n\r\n if(errors > 0){\r\n vhSweetAlert.error({html: true, title:'Error Importing', text: alertMessage + notifications, confirmButtonText: 'OK'});\r\n } else {\r\n\r\n \r\n vhSweetAlert.success({html: true, title :'Imported', text: alertMessage, confirmButtonText: 'OK', cancelButtonText: 'Cancel'});\r\n \r\n if(programId){\r\n $state.go('content.templates',{templateGroupId: programId})\r\n \r\n }else if(ids && ids.length == 1)\r\n {\r\n $state.go('content.templates.template.edit', {SurveyTemplateId: ids[0]});\r\n }\r\n\r\n }\r\n \r\n }, function(){\r\n $state.go('content.templates', {SurveyTemplateId: null}, {reload: true});\r\n });\r\n }\r\n\r\n function getMilestoneName(milestoneId) {\r\n if (milestoneId != null) {\r\n for(var i = 0; i <$scope.milestones.length; ++i){\r\n if($scope.milestones[i].MilestoneId === milestoneId){\r\n return $scope.milestones[i].Name;\r\n }\r\n }\r\n }\r\n \r\n return \"\";\r\n }\r\n}\r\n\r\nangular.module('content.templates').controller('TemplatesController', TemplatesController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/templates/templates.tpl.html',\n '

      Pathways

      1. {{publishedTemplates.length}} Published Pathways for {{vm.templateGroupName}} {{publishedTemplates.length}} Published Pathways matching “{{vm.searchText}}”
      Published Pathways {{publishedTemplates.length}}
      No published pathways.
      No results returned.
      Unpublished Pathways {{unpublishedTemplates.length}}

      No unpublished pathways.

      0\">({{survey.PatientSurveyCount}})
      Select a Program to see Pathways.
      {{vm.surveyTemplate.SurveySchedule | schedule : vm.getMilestoneName(vm.surveyTemplate.SurveySchedule.MilestoneId) }}

      Defaulted For {{population.PopulationName}}, Display Order: {{vm.surveyTemplate.PromptOrder}} ({{vm.getPatientSurveyCount(vm.surveyTemplate)}})

      0) && vm.userCanEditRules\">
      {{tag}}
      0\" vh-language=\"\" ng-model=\"vm.Language.Code\">

      No questions exist in this pathway.

      Used In {{vm.rules.length}} Rule{{vm.rules.length == 1 ? \\'\\' : \\'s\\'}}
      ');\n}]);\n}(window, document, window.angular));","function TemplatesEditController($scope, $stateParams, $state, $uibModal, lodash, vhSweetAlert, SmoothScroll,\r\n TemplatesService, PatientSurveyService, CategoriesService, PermissionService, NavigationService,\r\n ConfigurationsService, ResourceLibraryService, DirtyPage, contentLock) {\r\n\r\n var vm = this;\r\n var flashQuestion = null;\r\n vm.searchTextBox = '';\r\n vm.searchText = '';\r\n vm.categories = [];\r\n vm.selectedCategory = { SurveyQuestionCategoryId: 0, Name: \"All Categories\" };\r\n vm.availableQuestions = [];\r\n vm.surveyTags = [];\r\n vm.tags = [];\r\n\r\n var setDirty = () => {\r\n vm.dirty = true;\r\n }\r\n\r\n vm.surveyTemplate = contentLock({\r\n SurveySchedule: {\r\n SurveyScheduleId: 0\r\n },\r\n SurveyQuestions: [],\r\n LockStatus: 0\r\n }, setDirty);\r\n\r\n vm.LanguageId = 1; //only show English for now\r\n vm.languages = [];\r\n vm.selectedLanguage = { Name: 'English', Code: 'en' };\r\n vm.noSearchResults = false;\r\n vm.activeSearch = false;\r\n vm.expandedAll = false;\r\n\r\n vm.populations = [];\r\n\r\n vm._selectedDeletedPopulations = [];\r\n vm.selectedPopulations = [];\r\n\r\n $scope.toggleShowOptions = toggleShowOptions;\r\n $scope.defaultOptionLimit = 5;\r\n\r\n //paging\r\n vm.currentPage = 1;\r\n vm.pageSize = 30;\r\n vm.total = 1;\r\n\r\n vm.flash = flash;\r\n vm.showOptions = showOptions;\r\n vm.buttonSearch = buttonSearch;\r\n vm.clearSearch = clearSearch;\r\n vm.performSearch = performSearch;\r\n vm.removeQuestion = removeQuestion;\r\n vm.addNewQuestion = addNewQuestion;\r\n vm.addQuestionToTemplate = addQuestionToTemplate;\r\n vm.populationsChanged = populationsChanged;\r\n vm.scheduleChanged = scheduleChanged;\r\n vm.saveTemplate = saveTemplate;\r\n vm.checkTemplateName = checkTemplateName;\r\n vm.editQuestion = editQuestion;\r\n vm.showEditQuestionIcon = showEditQuestionIcon;\r\n vm.editBiometricQuestion = editBiometricQuestion;\r\n vm.editNonBiometricQuestion = editNonBiometricQuestion;\r\n vm.toggleValue = toggleValue;\r\n vm.isHealthTipQuestion = isHealthTipQuestion;\r\n vm.addRule = addRule;\r\n vm.editRule = editRule;\r\n vm.deleteRule = deleteRule;\r\n vm.editHealthTip = editHealthTip;\r\n vm.toggleExpand = toggleExpand;\r\n vm.setDirty = setDirty;\r\n vm.cancel = cancel;\r\n\r\n vm.ok = ok;\r\n vm.dirty = false;\r\n vm.populationChanged = false;\r\n\r\n\r\n this.showDisabledItems = false;\r\n this.canAssignDisabledItems = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n this.canAssignFromAllSites = PermissionService.userHasPermission(['CanAssignFromAllSites']);\r\n this.toggleShowDisabled = () => {\r\n vm.showDisabledItems = !vm.showDisabledItems;\r\n //vm.populations = vm._populations.filter(x => x.IsEnabled || (vm.canAssignDisabledItems && vm.showDisabledItems) );\r\n };\r\n\r\n DirtyPage.registerDirtyChecker(\"TemplateEdit\", checkIfDirty);\r\n\r\n $scope.$on(\"$destroy\", function() {\r\n DirtyPage.unregisterDirtyChecker(\"TemplateEdit\");\r\n });\r\n\r\n vm.userCanEditHealthTips = PermissionService.userHasPermission([\"HealthTipsWrite\"]);\r\n vm.userCanEditRules = PermissionService.userHasPermission([\"RuleWrite\"]);\r\n vm.userCanEditTags = PermissionService.userHasPermission([\"PathwayTagWrite\"]);\r\n vm.userDisableEnableAlerts = PermissionService.userHasPermission([\"ToggleOverDueAlerts\"]);\r\n vm.userCanEditConditions = PermissionService.userHasPermission([\"PathwayConditionWrite\"]);\r\n vm.userCanEditQuestions = PermissionService.userHasPermission([\"SecurityAccessLevelModerateWrite\"]);\r\n vm.userCanAddSaveSurveyQuestion = PermissionService.userHasPermission([\"SurveyQuestionsWrite\"]);\r\n\r\n ConfigurationsService.getConfig().then(function() {\r\n if (!ConfigurationsService.configParams.EnableOverDueAlerts) {\r\n vm.userDisableEnableAlerts = false;\r\n }\r\n });\r\n\r\n\r\n vm.treeOptions = {\r\n\r\n beforeDrag: function(src) {\r\n if (src.$modelValue.SurveyParameterTypeId) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n\r\n accept: function(src, dest, destIndex) {\r\n if (src.$modelValue.SurveyParameterTypeId) { //If source is an option should never get here\r\n return false;\r\n } else if (src.$modelValue.SurveyQuestionId) { //If source is a question\r\n if (dest.$parent.$modelValue && dest.$parent.$modelValue.SurveyParameterTypeId) {\r\n return true;\r\n } else if (!dest.$parent.$modelValue) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n //Should never get here\r\n return true;\r\n }\r\n },\r\n\r\n dropped: function(event) {\r\n //If moving an option\r\n if (event.source.nodeScope.$modelValue.SurveyParameterTypeId) {\r\n // Removing the ability to reorder options so it should never get here.\r\n return;\r\n } else if (event.source.nodeScope.$modelValue.SurveyQuestionId) {\r\n vm.setDirty();\r\n }\r\n }\r\n\r\n };\r\n\r\n vm.searchTreeOptions = {\r\n\r\n accept: function(src, dest, destIndex) {\r\n //Do not allow items from template to be dropped into search result\r\n if (src.$treeScope.SearchResults == false) {\r\n return false;\r\n } else if (!dest.$parent.$modelValue) {\r\n return true;\r\n }\r\n },\r\n\r\n dropped: function(event) {\r\n //Do not fire when dragging a question back into the same position it came from\r\n if (event.dest.nodesScope.$treeScope.SearchResults == false ||\r\n event.dest.nodesScope.$treeScope.SearchResults === undefined) {\r\n var question = event.source.nodeScope.$modelValue;\r\n delete question.$id;\r\n TemplatesService.removeContentIds(question);\r\n vm.setDirty();\r\n }\r\n }\r\n\r\n };\r\n\r\n\r\n loadController();\r\n\r\n async function loadController() {\r\n vm.userCanEditHealthTips = PermissionService.userHasPermission([\"HealthTipsWrite\"]);\r\n vm.userCanEditRules = PermissionService.userHasPermission([\"RuleWrite\"]);\r\n vm.userCanEditTags = PermissionService.userHasPermission([\"PathwayTagWrite\"]);\r\n vm.userDisableEnableAlerts = PermissionService.userHasPermission([\"ToggleOverDueAlerts\"]);\r\n vm.userCanEditConditions = PermissionService.userHasPermission([\"PathwayConditionWrite\"]);\r\n vm.userCanEditQuestions = PermissionService.userHasPermission([\"SecurityAccessLevelModerateWrite\"]);\r\n\r\n vm.templateGroupId = $stateParams.templateGroupId === 0 ? -1 : $stateParams.templateGroupId ?? -1;\r\n if ($stateParams.SurveyTemplateId) {\r\n refreshTemplate();\r\n }\r\n\r\n var _getCategories = CategoriesService.getAllCategories();\r\n var _getPrograms = TemplatesService.getPopulations({ enabledOnly: false, includeAllPatients: true });\r\n\r\n\r\n\r\n vm.categories = await _getCategories;\r\n vm.categories.unshift(vm.selectedCategory);\r\n\r\n vm.buttonSearch();\r\n\r\n vm._populations = await _getPrograms;\r\n\r\n vm._populations = [].concat(vm._populations.filter(x => x.IsEnabled), vm._populations.filter(x => !x.IsEnabled))\r\n .filter(x => !vm.selectedPopulations.map(p => p.PopulationId).includes(x.PopulationId));\r\n\r\n\r\n vm.populations = vm._populations; //.filter(x => x.IsEnabled || (vm.canAssignDisabledItems && vm.showDisabledItems) );\r\n\r\n ResourceLibraryService.getLanguages().then(function(data) {\r\n lodash.forEach(data, function(language) {\r\n language.Code = language.Code.replace('-', '_');\r\n });\r\n vm.languages = data;\r\n selectEnglish();\r\n });\r\n\r\n TemplatesService.getSurveyTags().then(function(surveyTags) {\r\n vm.surveyTags = surveyTags;\r\n });\r\n\r\n refreshRules();\r\n }\r\n\r\n function refreshRules() {\r\n TemplatesService.getRules($stateParams.SurveyTemplateId).then(function(data) {\r\n vm.rules = data;\r\n });\r\n }\r\n\r\n function populationsChanged() {\r\n var hasAllPatients = lodash.find(vm.surveyTemplate.SurveyPatientPopulations, p => p.IsAllPatients);\r\n var allPatients = lodash.find(vm.selectedPopulations, p => p.IsAllPatients);\r\n if (hasAllPatients !== undefined && allPatients !== undefined && vm.selectedPopulations.length > 1) {\r\n //remove All Patients\r\n var copySelected = angular.copy(vm.selectedPopulations);\r\n lodash.remove(copySelected, p => p.IsAllPatients);\r\n vm.selectedPopulations = copySelected;\r\n vm.surveyTemplate.SurveyPatientPopulations = vm.selectedPopulations;\r\n vm.populations = vm.populations.filter(x => !vm.surveyTemplate.SurveyPatientPopulations.map(p => p.PopulationId).includes(x.PopulationId));\r\n } else if (allPatients) {\r\n //add All Patients, remove all others\r\n vm.selectedPopulations = [allPatients];\r\n vm.surveyTemplate.SurveyPatientPopulations = [allPatients];\r\n } else if (vm.selectedPopulations.length < 1) {\r\n vm.surveyTemplate.SurveyPatientPopulations = [];\r\n } else {\r\n vm.surveyTemplate.SurveyPatientPopulations = vm.selectedPopulations;\r\n }\r\n\r\n vm._selectedDeletedPopulations = vm._selectedDeletedPopulations.filter(x => vm.selectedPopulations.find(y => y.PopulationId === x.PopulationId));\r\n vm.setDirty();\r\n vm.populationChanged = true;\r\n }\r\n\r\n function scheduleChanged(newSchedule) {\r\n vm.surveyTemplate.SurveySchedule = newSchedule;\r\n vm.setDirty();\r\n }\r\n\r\n function flash(index) {\r\n if (flashQuestion !== null && index == vm.surveyTemplate.SurveyQuestions.length - 1) {\r\n flashQuestion = null;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n function mapContentLock(item) {\r\n (item.SurveyOptions || []).forEach(o => o.ChildQuestions = (o.ChildQuestions || []).map(mapContentLock));\r\n return contentLock(item, setDirty);\r\n }\r\n\r\n async function refreshTemplate() {\r\n var template = await TemplatesService.getTemplate($stateParams.SurveyTemplateId);\r\n\r\n vm.surveyTemplate = contentLock(template, setDirty);\r\n vm.originalTemplate = contentLock(angular.copy(template), setDirty);\r\n vm.surveyTemplate.SurveyQuestions = template.SurveyQuestions.map(mapContentLock);\r\n\r\n if (template.Tags) {\r\n vm.tags = template.Tags.split(';');\r\n }\r\n\r\n var treeScope = angular.element(document.getElementById(\"tree-template\")).scope();\r\n\r\n if (treeScope)\r\n treeScope.SearchResults = false;\r\n\r\n if (!vm.canAssignDisabled)\r\n vm._selectedDeletedPopulations = template.SurveyPatientPopulations.filter(x => !x.IsEnabled);\r\n\r\n var sortRoutine = name => (a, b) => ((a, b) => a > b ? 1 : b > a ? -1 : 0)(name ? a[name] : a, name ? b[name] : b);\r\n vm.selectedPopulations = template.SurveyPatientPopulations.filter(x => x.IsEnabled || vm.canAssignDisabledItems)\r\n .sort(sortRoutine('PopulationName'));\r\n\r\n }\r\n\r\n function selectEnglish() {\r\n var english = vm.languages.filter(function(language) {\r\n return language.Code === \"en\";\r\n })[0];\r\n selectLanguage(english);\r\n }\r\n\r\n vm.selectLanguage = selectLanguage;\r\n\r\n function selectLanguage(language) {\r\n vm.selectedLanguage = language;\r\n }\r\n\r\n function toggleShowOptions(question) {\r\n if (!question.optionLimit || question.optionLimit == $scope.defaultOptionLimit) {\r\n question.optionLimit = question.SurveyOptions.length;\r\n } else {\r\n question.optionLimit = $scope.defaultOptionLimit;\r\n }\r\n }\r\n\r\n function showOptions(question) {\r\n return !TemplatesService.isBiometricQuestion(question) && !TemplatesService.isHealthTipQuestion(question);\r\n }\r\n\r\n vm.done = function() {\r\n TemplatesService.setLasstEditedTemplateId($stateParams.SurveyTemplateId);\r\n if ($stateParams.SurveyTemplateId) {\r\n refreshTemplate();\r\n }\r\n \r\n vm.templateGroupId = vm.selectedPopulations.length > 0 ? vm.selectedPopulations[0].PopulationId : vm.templateGroupId === 0 ? -1 : vm.templateGroupId;\r\n \r\n \r\n\r\n $state.go('content.templates', { templateGroupId: vm.templateGroupId });\r\n }\r\n\r\n function ok() {\r\n vm.saveTemplate().then(function() {\r\n if (vm.populationChanged) {\r\n NavigationService.refreshTemplateGroups();\r\n }\r\n\r\n vm.populationChanged = false;\r\n vm.dirty = false;\r\n vm.done();\r\n });\r\n }\r\n\r\n function buttonSearch() {\r\n vm.currentPage = 1;\r\n vm.performSearch();\r\n }\r\n\r\n function clearSearch() {\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.SearchResults = false;\r\n vm.activeSearch = false;\r\n vm.searchTextBox = '';\r\n vm.currentPage = 1;\r\n vm.performSearch();\r\n }\r\n\r\n function performSearch() {\r\n vm.searchText = vm.searchTextBox.replace(new RegExp('[^a-zA-Z0-9 -_]', 'g'), '');\r\n vm.activeSearch = vm.searchText.length > 0;\r\n\r\n questionCategoryId = 0;\r\n if (vm.selectedCategory) {\r\n questionCategoryId = vm.selectedCategory.SurveyQuestionCategoryId;\r\n }\r\n\r\n TemplatesService.searchQuestions(vm.searchText, questionCategoryId, vm.LanguageId, vm.pageSize, vm.currentPage).then(function(data) {\r\n vm.availableQuestions = data.SearchResults;\r\n vm.total = data.ResultsCount;\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.SearchResults = true;\r\n\r\n vm.expandedAll = false;\r\n flagSearchedQuestions();\r\n\r\n if (vm.availableQuestions.length == 0) {\r\n vm.noSearchResults = true;\r\n } else {\r\n vm.noSearchResults = false;\r\n }\r\n });\r\n }\r\n\r\n function isHealthTipQuestion(question) {\r\n return TemplatesService.isHealthTipQuestion(question)\r\n }\r\n\r\n function removeQuestion(questions, index) {\r\n var question = questions[index];\r\n var text;\r\n if (TemplatesService.isHealthTipQuestion(question)) {\r\n text = 'Are you sure you want to remove this health tip?';\r\n } else {\r\n text = 'Are you sure you want to remove this question?';\r\n }\r\n\r\n return vhSweetAlert.verify('Are you sure?', text, 'Remove').then(function(isConfirm) {\r\n if (isConfirm) {\r\n questions.splice(index, 1);\r\n flagSearchedQuestions();\r\n vm.setDirty();\r\n }\r\n });\r\n }\r\n\r\n function addNewQuestion() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addquestion.modal.html',\r\n controller: 'AddQuestionModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n tags: function() {\r\n return TemplatesService.getSurveyTags();\r\n },\r\n question: function() {\r\n return null;\r\n },\r\n disableEdits: function() {\r\n return false;\r\n },\r\n saveFunction: function() {\r\n return TemplatesService.createQuestion;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function(question) {\r\n vm.addQuestionToTemplate(question);\r\n }, function() {});\r\n }\r\n\r\n function addQuestionToTemplate(question) {\r\n var sortOrder = 0;\r\n if (vm.surveyTemplate.SurveyQuestions && vm.surveyTemplate.SurveyQuestions.length > 0) {\r\n var lastSortedQuestion = lodash.max(vm.surveyTemplate.SurveyQuestions, function(question) { return question.SortOrder; });\r\n sortOrder = lastSortedQuestion.SortOrder + 1;\r\n } else {\r\n vm.surveyTemplate.SurveyQuestions = [];\r\n }\r\n\r\n var newQuestion = angular.copy(question);\r\n delete newQuestion.$id;\r\n delete newQuestion.ExistsInTemplate;\r\n newQuestion.SortOrder = sortOrder;\r\n\r\n newQuestion = mapContentLock(newQuestion);\r\n\r\n // Add to UI before actual question is created to prevent bugs with sort order\r\n // since sort order is determined by questions already in vm.surveytemplate\r\n TemplatesService.removeContentIds(newQuestion);\r\n vm.surveyTemplate.SurveyQuestions.push(newQuestion);\r\n vm.setDirty();\r\n\r\n flagSearchedQuestions();\r\n var scrollElement;\r\n if (vm.surveyTemplate.SurveyQuestions.length > 1) {\r\n scrollElement = 'question' + (vm.surveyTemplate.SurveyQuestions.length - 2).toString();\r\n } else {\r\n scrollElement = \"tree-template\";\r\n }\r\n SmoothScroll.scroll(scrollElement, 'bottom');\r\n flashQuestion = newQuestion;\r\n }\r\n\r\n function editHealthTip(surveyQuestionId) {\r\n $state.go('content.healthtips.healthtip', { TipQuestionId: surveyQuestionId });\r\n }\r\n\r\n vm.canEditPathway = () => {\r\n return vm.surveyTemplate.LockStatus == 0 || PermissionService.userHasPermission(['CanEditLockedPathways']);\r\n }\r\n\r\n\r\n function saveTemplate() {\r\n var template = {};\r\n template.SurveyTemplateId = vm.surveyTemplate.SurveyTemplateId;\r\n template.Name = vm.surveyTemplate.Name;\r\n template.SurveyTypeId = vm.surveyTemplate.SurveyTypeId;\r\n template.TemplateTexts = vm.surveyTemplate.TemplateTexts;\r\n template.SurveySchedule = vm.surveyTemplate.SurveySchedule;\r\n template.SurveyQuestions = vm.surveyTemplate.SurveyQuestions;\r\n template.SurveyPatientPopulations = [].concat(vm.surveyTemplate.SurveyPatientPopulations, vm._selectedDeletedPopulations);\r\n template.IsPublished = vm.surveyTemplate.IsPublished;\r\n template.PromptOrder = vm.surveyTemplate.PromptOrder;\r\n template.SMSText = vm.surveyTemplate.SMSText;\r\n template.DefaultStatusId = vm.surveyTemplate.DefaultStatusId;\r\n template.EnableAlerts = vm.surveyTemplate.EnableAlerts;\r\n template.Tags = vm.surveyTemplate.Tags;\r\n template.LockStatus = vm.surveyTemplate.LockStatus.value;\r\n \r\n\r\n _setLockStatusOnQuestions(template.SurveyQuestions);\r\n\r\n function _setLockStatusOnQuestions(questions) {\r\n questions.map(x => {\r\n x.LockStatus = template.LockStatus;\r\n\r\n x.SurveyOptions.map(option => __setLockStatusOnChildQuestions(option));\r\n\r\n function __setLockStatusOnChildQuestions(option) {\r\n if ((option.ChildQuestions || []).length == 0) {\r\n return;\r\n }\r\n\r\n option.ChildQuestions.map(childQuestion => {\r\n childQuestion.LockStatus = template.LockStatus;\r\n childQuestion.SurveyOptions.map(option => __setLockStatusOnChildQuestions(option));\r\n });\r\n\r\n }\r\n });\r\n }\r\n\r\n return TemplatesService.saveTemplate(template);\r\n }\r\n\r\n vm.isValidTitle = function() {\r\n if (vm.surveyTemplate && vm.surveyTemplate.TemplateTexts) {\r\n var title = vm.surveyTemplate.TemplateTexts['en'];\r\n return title && title.length > 0;\r\n }\r\n return false;\r\n }\r\n\r\n vm.deleteSurveyTitle = function() {\r\n vm.surveyTemplate.TemplateTexts[vm.selectedLanguage.Code] = '';\r\n selectEnglish();\r\n }\r\n\r\n function checkTemplateName(data) {\r\n if (data.length <= 0) {\r\n return \"Must enter a survey name\";\r\n }\r\n }\r\n\r\n function editQuestion(question) {\r\n if (PatientSurveyService.isBiometricQuestion(question)) {\r\n vm.editBiometricQuestion(question);\r\n } else {\r\n vm.editNonBiometricQuestion(question);\r\n }\r\n }\r\n\r\n function editBiometricQuestion(question) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/editbiometric.modal.html',\r\n controller: 'EditBiometricQuestionController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n tags: function() {\r\n return TemplatesService.getSurveyTags();\r\n },\r\n question: function() {\r\n return question;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function(question) {\r\n vm.setDirty();\r\n }, function() {});\r\n }\r\n\r\n function editNonBiometricQuestion(question) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addquestion.modal.html',\r\n controller: 'AddQuestionModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n tags: function() {\r\n return TemplatesService.getSurveyTags();\r\n },\r\n question: function() {\r\n return question;\r\n },\r\n disableEdits: function() {\r\n return true;\r\n },\r\n saveFunction: function() {\r\n return null;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function(result) {\r\n for (var i = 0; i < result.SurveyOptions.length; i++) {\r\n question.SurveyOptions[i].Tags = result.SurveyOptions[i].Tags;\r\n question.SurveyOptions[i].AlertSeverityLevelId = result.SurveyOptions[i].AlertSeverityLevelId;\r\n }\r\n\r\n question.DisplayCondition = result.DisplayCondition;\r\n question.Tags = result.Tags;\r\n question.LockStatus = result.LockStatus;\r\n question.SurveyQuestionAttributes = result.SurveyQuestionAttributes;\r\n\r\n vm.setDirty();\r\n\r\n console.log(vm.surveyTemplate)\r\n\r\n }, function() {});\r\n }\r\n\r\n\r\n function addRule() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addrule.modal.html',\r\n controller: 'AddRuleModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n rule: function() {\r\n return null;\r\n },\r\n TemplateId: function() {\r\n return $stateParams.SurveyTemplateId;\r\n },\r\n TemplateName: function() {\r\n return vm.surveyTemplate.Name;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function(rule) {\r\n TemplatesService.saveRule(rule).then(function(data) { refreshRules(); });\r\n }, function() {});\r\n }\r\n\r\n function editRule(rule) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/careplan_editor/templates/addrule.modal.html',\r\n controller: 'AddRuleModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n rule: function() {\r\n return rule;\r\n },\r\n TemplateId: function() {\r\n return $stateParams.SurveyTemplateId;\r\n },\r\n TemplateName: function() {\r\n return vm.surveyTemplate.Name;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function(rule) {\r\n TemplatesService.saveRule(rule).then(function(data) { refreshRules(); });\r\n }, function() {});\r\n }\r\n\r\n function deleteRule(rule) {\r\n var ruleId = rule.RuleId;\r\n var text = 'Are you sure you want to delete this rule?';\r\n vhSweetAlert.verify('Are you sure?', text, 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n TemplatesService.deleteRule(ruleId).then(function(data) { refreshRules(); });\r\n }\r\n });\r\n }\r\n\r\n function showEditQuestionIcon(question) {\r\n if (TemplatesService.isBiometricQuestion(question)) {\r\n return vm.userCanEditConditions || vm.userCanEditTags;\r\n } else {\r\n return !TemplatesService.isHealthTipQuestion(question) && !question.isTemp;\r\n }\r\n }\r\n\r\n function toggleValue(toggleinput) {\r\n vm.surveyTemplate[toggleinput] = !vm.surveyTemplate[toggleinput];\r\n vm.setDirty();\r\n }\r\n\r\n function flagSearchedQuestions() {\r\n //Mark searched questions with ExistsInTemplate property to true if a clone of that question exists in the template\r\n //so searched questions with a clone in the template will show up as dimmed\r\n for (var i = 0; i < vm.availableQuestions.length; i++) {\r\n var question = lodash.find(vm.surveyTemplate.SurveyQuestions, function(q) { return q.SurveyQuestionId == vm.availableQuestions[i].SurveyQuestionId; });\r\n if (question) {\r\n vm.availableQuestions[i].ExistsInTemplate = true;\r\n } else {\r\n vm.availableQuestions[i].ExistsInTemplate = false;\r\n }\r\n }\r\n }\r\n\r\n function expandAllNodes() {\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.$broadcast('angular-ui-tree:expand-all');\r\n }\r\n\r\n function collapseAllNodes() {\r\n var treeScope = angular.element(document.getElementById(\"tree-search\")).scope();\r\n treeScope.$broadcast('angular-ui-tree:collapse-all');\r\n }\r\n\r\n function toggleExpand() {\r\n vm.expandedAll = !vm.expandedAll;\r\n if (vm.expandedAll)\r\n expandAllNodes()\r\n else\r\n collapseAllNodes();\r\n }\r\n\r\n function setDirty() {\r\n vm.dirty = true;\r\n }\r\n\r\n function checkIfDirty() {\r\n return vm.dirty;\r\n }\r\n\r\n function cancel() {\r\n vm.dirty = false;\r\n vm.done();\r\n }\r\n}\r\n\r\nangular.module('content.templates').filter('CanSeeDisabled',\r\n (PermissionService) => function(items, showDisabled) {\r\n\r\n var canAssignDisabled = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n return (items || []).filter(x => x.IsEnabled || (canAssignDisabled && showDisabled));\r\n });\r\nangular.module('content.templates').controller('TemplatesEditController', TemplatesEditController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/templates/templatesedit.tpl.html',\n '
      Pathway
      {{vm.surveyTemplate.Name}}
      (not published) (published)
      English title is required
      Show Disabled Programs
      {{$item.PopulationName}} (disabled){{population.PopulationName}}(disabled)
      (Overdue Alerts Off) (Overdue Alerts On)
      {{rule.Display}}
      Add a new question or drag and drop questions here to build your new pathway.
      = 0\">
        0\">
      Available Questions
        vm.pageSize\" ng-model=\"vm.currentPage\" max-size=\"5\" rotate=\"false\" boundary-links=\"true\" next-text=\"Next\" previous-text=\"Previous\" ng-change=\"vm.performSearch()\" num-pages=\"vhPaging.pages\">

      No results returned

      Create New Question
        0\" ui-tree-nodes=\"\" ng-model=\"vm.availableQuestions\" data-type=\"question\">
      1. Create New Question
      ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/templates/updatecustomtemplate.modal.html',\n '

      {{vm.modalHeader}}

      There are some pathways with their own customized version of this question.
      Click the link to review these items to determine if they should be updated or not.

      Select the pathways you would like to update to the current version.
      (Nested questions will not be preserved)

      NOTE: This will not update patient pathways.

      1\">
      ');\n}]);\n}(window, document, window.angular));","function UpdateCustomTemplateModalController($scope, $uibModalInstance, templates) { \r\n var vm = this;\r\n vm.templates = templates;\r\n\r\n vm.modalHeader = 'Customized Pathways'\r\n vm.selectAll = false;\r\n\r\n vm.selectAllTemplates = function() {\r\n angular.forEach(vm.templates, function(template){\r\n template.selected = vm.selectAll;\r\n });\r\n }\r\n\r\n vm.checkboxChanged = function() {\r\n var allSelected = true;\r\n for(var i = 0; i < vm.templates.length; i++) {\r\n if(!vm.templates[i].selected) {\r\n allSelected = false;\r\n break;\r\n }\r\n }\r\n\r\n vm.selectAll = allSelected;\r\n }\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n vm.ok = function () {\r\n var selectedTemplates = vm.templates.filter(function(template) {\r\n return template.selected;\r\n }).map(function(x) {return x.SurveyTemplateId;});\r\n\r\n $uibModalInstance.close(selectedTemplates);\r\n }\r\n}\r\n\r\nangular.module('content.templates').controller('UpdateCustomTemplateModalController', UpdateCustomTemplateModalController);\r\n","function VideoController(video, $scope, $timeout, lodash, vhSweetAlert, $state, VideosService, PermissionService, $location, $sce, $uibModal, ResourceLibraryService) {\r\n var vm = this;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.video = video;\r\n vm.selectedFile = video.VideoFiles[0];\r\n vm.selectedLanguage = vm.selectedFile.LanguageId;\r\n \r\n vm.thumbnailUrl = [];\r\n vm.portraitUrl = [];\r\n vm.landscapeUrl = [];\r\n vm.contentProviders = [];\r\n vm.languages = [];\r\n \r\n VideosService.getContentProviders().then(function(data) {\r\n vm.contentProviders = data;\r\n }); \r\n\r\n ResourceLibraryService.getLanguages().then(function (data) {\r\n vm.languages = data;\r\n });\r\n\r\n\r\n angular.forEach(vm.video.VideoFiles, function() {\r\n vm.thumbnailUrl.push(\"/content/video_thumbnail.png\");\r\n vm.portraitUrl.push(\"/content/video_portrait.png\");\r\n vm.landscapeUrl.push(\"/content/video_landscape.png\");\r\n });\r\n \r\n ResourceLibraryService.getResourceThumbnailImages(vm.video.VideoId, 2).then(function (thumbnailImages) {\r\n for (var x = 0; x < vm.video.VideoFiles.length; x++) {\r\n var item = vm.video.VideoFiles[x];\r\n var itemImages = lodash.find(thumbnailImages, { LanguageId: item.LanguageId });\r\n if (itemImages) {\r\n if (itemImages.ThumbnailUrl) vm.thumbnailUrl[x] = itemImages.ThumbnailUrl;\r\n if (itemImages.PortraitUrl) vm.portraitUrl[x] = itemImages.PortraitUrl;\r\n if (itemImages.LandscapeUrl) vm.landscapeUrl[x] = itemImages.LandscapeUrl;\r\n }\r\n }\r\n });\r\n \r\n vm.canEditVideo = PermissionService.userHasPermission([\"VideosWrite\"]);\r\n \r\n }\r\n \r\n $scope.$watch(function () {\r\n var videoSource = document.getElementsByTagName('source')[0];\r\n if (angular.isDefined(videoSource)) {\r\n return videoSource.src;\r\n }\r\n }, function (){\r\n var videoElement = document.getElementsByTagName('video')[0];\r\n if (angular.isDefined(videoElement)) {\r\n videoElement.load();\r\n }\r\n });\r\n\r\n vm.checkVideoName = checkVideoName;\r\n function checkVideoName(data) {\r\n if (data.length <= 0) {\r\n return \"Must enter a survey name\";\r\n }\r\n }\r\n\r\n vm.saveVideo = saveVideo;\r\n function saveVideo() {\r\n VideosService.saveVideo(vm.video);\r\n }\r\n\r\n vm.selectTab = selectFile;\r\n function selectFile(videoFile) {\r\n vm.selectedFile = videoFile;\r\n vm.selectedLanguage = videoFile.LanguageId;\r\n }\r\n\r\n vm.fileUrl = fileUrl;\r\n var lastFileUrl = null;\r\n var lastTrustedFileUrl = null;\r\n function fileUrl(videoFile) {\r\n var fileName = '';\r\n if(vm.selectedFile == videoFile) {\r\n fileName = $location.protocol() + '://' + $location.host() + ($location.port() ? ':' + $location.port() : '') + videoFile.RelativeUrl + videoFile.FileName;\r\n }\r\n if(lastFileUrl != fileName){\r\n lastFileUrl = fileName;\r\n lastTrustedFileUrl = $sce.trustAsResourceUrl(fileName);\r\n }\r\n return lastTrustedFileUrl;\r\n }\r\n\r\n vm.editVideo = editVideo;\r\n function editVideo(video) {\r\n var editVideoModal = $uibModal.open( {\r\n templateUrl: 'modules/content/careplan_editor/videos/video.modal.html',\r\n controller: 'VideoModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n video: function() {\r\n return VideosService.getVideo(video.VideoId).then(function (data) {\r\n return data;\r\n });\r\n },\r\n contentProviders: function() {\r\n return vm.contentProviders;\r\n },\r\n languages: function() {\r\n return vm.languages;\r\n }\r\n }\r\n });\r\n\r\n editVideoModal.result.then(function (video){\r\n if (video.VideoId) {\r\n $state.go(\"content.videos.video\", {videoId: video.VideoId}, {reload: true});\r\n }\r\n }, function (){});\r\n } \r\n\r\n vm.deleteVideo = deleteVideo;\r\n function deleteVideo(video) {\r\n vhSweetAlert.verify('Are You Sure?', 'Are you sure you want to delete ' + video.Name, 'Delete')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n return VideosService.deleteVideo(video.VideoId);\r\n }\r\n return false;\r\n })\r\n .then(function(data) {\r\n if (data) {\r\n $state.go(\"content.videos\", undefined, {reload: true});\r\n }\r\n }).catch(function(rejection) {\r\n rejection.preventDefault();\r\n return $timeout(function() {\r\n return vhSweetAlert.error(\"Cannot Delete Video\", rejection.data.ErrorMessage);\r\n }, 100);\r\n });\r\n}\r\n\r\n vm.showImageEditor = showImageEditor;\r\n function showImageEditor(imgType, resource, index,) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/images/image.editor.modal.html',\r\n controller: 'ImageEditorModalController as vme',\r\n backdrop: 'static',\r\n resolve: {\r\n imgUrl: function(){ return vm.thumbnailUrl[index]; },\r\n imgType: imgType,\r\n resourceType: 2, // video\r\n resourceId: resource.VideoId,\r\n languageId: resource.LanguageId,\r\n languageCode: function() { return resource.LocaleCode }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (imgUrl) {\r\n if (null == imgUrl) return;\r\n switch (imgType) {\r\n case 1: vm.thumbnailUrl[index] = imgUrl + \"?\" + new Date().getTime(); break;\r\n case 2: vm.portraitUrl[index] = imgUrl + \"?\" + new Date().getTime(); break;\r\n case 3: vm.landscapeUrl[index] = imgUrl + \"?\" + new Date().getTime(); break;\r\n }\r\n });\r\n }\r\n\r\n vm.getImageUrl = getImageUrl;\r\n function getImageUrl() {\r\n var imageType = 1;\r\n switch (imageType) {\r\n case 1:\r\n return \"/content/video_thumbnail.png\";\r\n case 2:\r\n return \"/content/video_portrait.png\";\r\n case 3:\r\n return \"/content/video_landscape.png\";\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n vm.resetThumbnail = resetThumbnail;\r\n function resetThumbnail(){\r\n\r\n vhSweetAlert.verify('Are You Sure?', 'Are you sure you want to set this video to use the default thumbnail?', 'Restore')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n ResourceLibraryService.deleteThumbnail(vm.video.VideoId, 2, vm.selectedLanguage).then(x => {\r\n vm.thumbnailUrl = [];\r\n \r\n\r\n angular.forEach(vm.video.VideoFiles, function() {\r\n vm.thumbnailUrl.push(\"/content/video_thumbnail.png\");\r\n vm.portraitUrl.push(\"/content/video_portrait.png\");\r\n vm.landscapeUrl.push(\"/content/video_landscape.png\");\r\n });\r\n \r\n ResourceLibraryService.getResourceThumbnailImages(vm.video.VideoId, 2).then(function (thumbnailImages) {\r\n for (var x = 0; x < vm.video.VideoFiles.length; x++) {\r\n var item = vm.video.VideoFiles[x];\r\n var itemImages = lodash.find(thumbnailImages, { LanguageId: item.LanguageId });\r\n if (itemImages) {\r\n if (itemImages.ThumbnailUrl) vm.thumbnailUrl[x] = itemImages.ThumbnailUrl;\r\n if (itemImages.PortraitUrl) vm.portraitUrl[x] = itemImages.PortraitUrl;\r\n if (itemImages.LandscapeUrl) vm.landscapeUrl[x] = itemImages.LandscapeUrl;\r\n }\r\n }\r\n });\r\n\r\n });\r\n }\r\n });\r\n\r\n\r\n }\r\n\r\n}\r\nangular.module(\"content.videos\").controller(\"VideoController\", VideoController);","function VideoModalController(video, contentProviders, languages, FileUploader , VideosService ,$uibModalInstance, $location, $sce, lodash) {\r\n vm = this;\r\n\r\n const ENGLISH = 1;\r\n\r\n var nameLengthError = {text: \"Video name must be 50 characters or less\", type: 'danger'};\r\n var fileNameValidationError = {text: \"File name must have only letters, numbers, periods, dashes or hyphens.\", type: 'danger'};\r\n\r\n loadController();\r\n\r\n //#region Methods\r\n function loadController() {\r\n vm.video = video;\r\n vm.languages = languages;\r\n vm.contentProviders = contentProviders.filter(x => x.ContentProviderId != 0);\r\n\r\n vm.mode = video.VideoId == 0 ? 'add' : 'edit';\r\n vm.title = vm.mode == 'add' ? 'Add New Video' : 'Edit Video';\r\n\r\n vm.fileUploader = VideosService.getFileUploader();\r\n vm.fileInputValues = []; \r\n vm.progress = 0;\r\n vm.alerts = [];\r\n vm.isIENine = false;\r\n\r\n selectEnglish();\r\n\r\n }\r\n\r\n function selectEnglish() {\r\n var english = vm.languages.filter(function(language) {\r\n return language.Code === \"en\";\r\n })[0];\r\n selectLanguage(english);\r\n } \r\n\r\n vm.selectLanguage = selectLanguage;\r\n function selectLanguage(language) {\r\n vm.selectedLanguage = language;\r\n vm.selectedVideoFile = getVideoFile(vm.selectedLanguage);\r\n }\r\n\r\n vm.getVideoFile = getVideoFile;\r\n function getVideoFile(language) {\r\n var videoFileIndex = getVideoFileIndex(language);\r\n if(videoFileIndex == -1) {\r\n videoFileIndex = vm.video.VideoFiles.push({\r\n VideoFileId: 0,\r\n VideoId: vm.video.VideoId,\r\n FileName: null,\r\n LanguageId: language.LanguageId,\r\n VideoLengthSeconds: 0,\r\n Title: null\r\n });\r\n videoFileIndex--;\r\n }\r\n return vm.video.VideoFiles[videoFileIndex];\r\n }\r\n\r\n function getVideoFileIndex(language) {\r\n return vm.video.VideoFiles.findIndex(function(videoFile) { \r\n return videoFile.LanguageId == language.LanguageId;\r\n });\r\n }\r\n\r\n vm.fileUrl = fileUrl;\r\n let lastFileName = null;\r\n let lastResourceUrl = null;\r\n function fileUrl(videoFile) {\r\n var fileName = $location.protocol() + '://' + $location.host() + ($location.port() ? ':' + $location.port() : '') + videoFile.RelativeUrl + videoFile.FileName;\r\n if(lastFileName != fileName){\r\n lastFileName = fileName;\r\n lastResourceUrl = $sce.trustAsResourceUrl(fileName);\r\n return lastResourceUrl;\r\n }\r\n return lastResourceUrl;\r\n }\r\n\r\n function saveVideo() {\r\n removeEmptyVideoFiles();\r\n VideosService.saveVideo(vm.video).then(function(response){\r\n vm.video = response.data;\r\n $uibModalInstance.close(vm.video);\r\n });\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Event Handlers\r\n vm.fileUploader.onAfterAddingFile = function(fileItem) {\r\n if (!isValidFileName(fileItem.file.name)) {\r\n vm.alerts = [fileNameValidationError];\r\n vm.fileUploader.removeFromQueue(fileItem);\r\n return;\r\n }\r\n vm.alerts = [];\r\n // a file has been added to the queue\r\n vm.selectedVideoFile.FileName = fileItem.file.name;\r\n vm.selectedVideoFile.LanguageCode = vm.selectedLanguage.Code;\r\n if(!vm.selectedVideoFile.Title) {\r\n vm.selectedVideoFile.Title = fileNameToName(vm.selectedVideoFile.FileName);\r\n }\r\n if(!vm.video.Name && vm.selectedLanguage.LanguageId == ENGLISH) {\r\n vm.video.Name = fileNameToName(vm.selectedVideoFile.FileName);\r\n }\r\n\r\n\r\n fileItem.formData = [{LanguageCode: vm.selectedLanguage.Code}];\r\n fileItem.onProgress = function (progress) {\r\n if (progress == 100) {\r\n progress = 99;\r\n }\r\n vm.progress = progress;\r\n };\r\n\r\n fileItem.onSuccess = function (response, status, headers) {\r\n\r\n \r\n };\r\n\r\n fileItem.onError = function (response, status, headers) {\r\n var errorText;\r\n if (vm.isIENine) {\r\n errorText = response;\r\n } else {\r\n errorText = response.ErrorMessage;\r\n }\r\n vm.alerts = [{text: errorText, type: 'danger'}];\r\n };\r\n\r\n if (vm.isIENine) {\r\n vm.progress = 99;\r\n }\r\n };\r\n\r\n function isValidFileName(name) {\r\n var fileNameRegEx = /^[A-Za-z0-9\\._-]*$/;\r\n return fileNameRegEx.test(name);\r\n }\r\n\r\n function fileNameToName(fileName) {\r\n var badNameCharacters = /([\\._-]+|mp4|video)/gi;\r\n var camelCaseToSentence = /([a-z]|[A-Z]+)([A-Z])/g;\r\n return fileName.replace(badNameCharacters, ' ').replace(camelCaseToSentence, '$1 $2').trim();\r\n }\r\n\r\n vm.fileUploader.onWhenAddingFileFailed = function(item, filter, options) {\r\n //vm.fileUploader.clearQueue();\r\n vm.selectedVideoFile.FileName = null;\r\n var alertText;\r\n if (filter.name == \"typeFilter\") {\r\n alertText = \"Could not add video. File must be an mp4 file\";\r\n } else if (filter.name == \"sizeFilter\") {\r\n alertText = \"Could not add video. File size must be less than 50MB\";\r\n } else if (filter.name == \"emptyFilter\") {\r\n alertText = \"Cannot upload an empty file.\";\r\n }\r\n vm.alerts = [{text: alertText, type: 'danger'}];\r\n };\r\n\r\n vm.fileUploader.onCompleteAll = function() {\r\n saveVideo();\r\n };\r\n\r\n vm.ok = function () {\r\n if(vm.fileUploader.queue.length > 0) {\r\n vm.fileUploader.uploadAll();\r\n }\r\n else {\r\n saveVideo();\r\n }\r\n };\r\n\r\n vm.openFile = function(index) {\r\n document.getElementById('fileInput' + index).click();\r\n }\r\n\r\n vm.fileChange = function(fileInput) {\r\n var fileName = fileInput && fileInput.files && fileInput.files.length > 0 ? fileInput.files[0].name : '';\r\n var textInput = document.getElementById('fileName' + fileInput.dataset.index);\r\n clearPreviousFile(textInput);\r\n if (!isValidFileName(fileName)) {\r\n fileInput.value = null;\r\n textInput.classList.add(\"text-danger\");\r\n vm.alerts = [fileNameValidationError];\r\n }\r\n textInput.value = fileName; // show the name even if bad\r\n }\r\n\r\n function clearPreviousFile(textInput) {\r\n textInput.classList.remove(\"text-danger\");\r\n var fileItems = vm.fileUploader.queue.filter(function(fileItem){\r\n return fileItem.formData[0].LanguageCode == vm.selectedLanguage.Code;\r\n });\r\n if(fileItems.length) {\r\n vm.fileUploader.removeFromQueue(fileItems[0]);\r\n }\r\n vm.selectedVideoFile.FileName = null;\r\n }\r\n\r\n vm.canSave = function(form) {\r\n return (form.$pristine && vm.fileUploader.queue.length == 0) || vm.fileUploader.isUploading || form.$invalid;\r\n }\r\n\r\n function removeEmptyVideoFiles(){\r\n for(var i = vm.video.VideoFiles.length - 1; i >= 0; i--) {\r\n if(!vm.video.VideoFiles[i].FileName) {\r\n vm.video.VideoFiles.splice(i, 1);\r\n }\r\n }\r\n }\r\n\r\n vm.cancel = function () {\r\n if(vm.fileUploader.uploading) {\r\n vm.fileUploader.cancelAll();\r\n }\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n vm.nameChanged = function () {\r\n lodash.remove(vm.alerts, function (a) { return a === nameLengthError; });\r\n };\r\n //#endregion\r\n\r\n}\r\n\r\nangular.module('content.videos').controller('VideoModalController', VideoModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/videos/video.modal.html',\n '

      {{vm.title}}

      File Name: {{vm.getVideoFile(language).FileName || \\'None\\'}}
      Duration: {{vm.getVideoFile(language).VideoLengthSeconds | secondsToDateTime | date:\\'mm:ss\\'}}
      {{alert.text}}
      {{vm.progress}}%
      ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/videos/video.tpl.html',\n '
      {{vm.video.Name}}
      File Name: {{videoFile.FileName}}
      Video Provider: {{vm.video.ContentProviderName}}
      Duration: {{videoFile.VideoLengthSeconds | secondsToDateTime | date:\\'mm:ss\\'}}
      Thumbnail ({{videoFile.LanguageName}})
      ');\n}]);\n}(window, document, window.angular));","function VideosController(VideosService, PermissionService, ResourceLibraryService, lodash, vhSweetAlert, $sce, $filter, $uibModal, $state, $scope, $location, $http) {\r\n var vm = this;\r\n\r\n var activeSearch = false;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.videos = [];\r\n \r\n vm.itemsSelected = [];\r\n\r\n vm.currentPage = 1;\r\n vm.pageSize = 100;\r\n vm.total = 0;\r\n vm.searchText = '';\r\n vm.searchPlaceholder = 'Search Videos';\r\n vm.languageId = 1;\r\n vm.selectedVideoId = null;\r\n vm.contentProviders = [];\r\n vm.languages = [];\r\n vm.selectcontentProviderId = 0; \r\n\r\n VideosService.getContentProviders().then(function(data) {\r\n vm.contentProviders = [{ Name: 'All Content Providers', ContentProviderId: 0 }].concat(data);\r\n });\r\n\r\n ResourceLibraryService.getLanguages().then(function (data) {\r\n vm.languages = data;\r\n });\r\n\r\n getVideos();\r\n }\r\n\r\n vm.getVideos = getVideos;\r\n function getVideos() {\r\n VideosService.getVideos(vm.searchText, vm.pageSize, vm.currentPage, vm.selectcontentProviderId).then(function (data) {\r\n vm.videos = data.Results;\r\n vm.total = data.ResultsCount;\r\n });\r\n };\r\n\r\n vm.selectItem = function ($event, videoId) {\r\n $event.stopPropagation();\r\n vm.selectedVideoId = videoId;\r\n $state.go(\"content.videos.video\", {videoId: videoId});\r\n };\r\n\r\n vm.canAddVideo = function () {\r\n return PermissionService.userHasPermission([\"VideosWrite\"]);\r\n };\r\n\r\n vm.onContentProviderIdChanged = function() {\r\n vm.currentPage = 1;\r\n vm.getVideos(); \r\n } \r\n\r\n vm.search = function () {\r\n vm.selectcontentProviderId = 0;\r\n $state.go(\"content.videos\");\r\n activeSearch = true;\r\n vm.currentPage = 1;\r\n vm.getVideos();\r\n }\r\n vm.cancelSearch = function () {\r\n vm.searchText = '';\r\n activeSearch = false;\r\n vm.getVideos();\r\n }\r\n\r\n vm.highlight = function (text) {\r\n if (activeSearch && vm.searchText.length > 0) {\r\n return $sce.trustAsHtml(text.replace(new RegExp(vm.searchText, 'gi'), '$&'));\r\n } else {\r\n return $sce.trustAsHtml(text);\r\n }\r\n }\r\n\r\n vm.toggle = ($event, id)=>{\r\n $event.stopPropagation();\r\n if(vm.isSelected(id)){\r\n vm.itemsSelected = vm.itemsSelected.filter(x => x != id);\r\n } else {\r\n vm.itemsSelected.push(id);\r\n }\r\n }\r\n\r\n vm.isSelected = (id)=>{\r\n return vm.itemsSelected.find(x => x == id) != null;\r\n }\r\n \r\n vm.selectToggle = ()=>{\r\n if(vm.itemsSelected.length > 0)\r\n {\r\n vm.itemsSelected = [];\r\n }\r\n else\r\n {\r\n\r\n VideosService.getVideos(vm.searchText, -1, 1, vm.selectcontentProviderId).then(function (data) {\r\n vm.itemsSelected = data.Results.map(x => x.VideoId);\r\n });\r\n \r\n }\r\n }\r\n\r\n function _extractFileName(headerContentDisposition) {\r\n var filename = \"\";\r\n var disposition = headerContentDisposition;\r\n if (disposition && disposition.indexOf('attachment') !== -1) {\r\n var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\r\n var matches = filenameRegex.exec(disposition);\r\n if (matches != null && matches[1]) { \r\n filename = matches[1].replace(/['\"]/g, '');\r\n }\r\n }\r\n return filename;\r\n }\r\n\r\n vm.export = () => {\r\n \r\n var ids = vm.itemsSelected;\r\n\r\n if(ids.length == 0)\r\n return;\r\n\r\n $http.post('/api/export/videos', JSON.stringify(ids), { responseType: 'arraybuffer' })\r\n .then(function successCallback(response) {\r\n var headersFn = response.headers;\r\n var headers = headersFn();\r\n var data = response.data;\r\n \r\n var filename = _extractFileName(headers['content-disposition']);\r\n var contentType = headers['content-type'];\r\n \r\n var a = document.createElement('a');\r\n try {\r\n var blob = new Blob([data], { type: contentType });\r\n var url = window.URL.createObjectURL(blob);\r\n \r\n a.setAttribute('href', url);\r\n a.setAttribute(\"download\", filename);\r\n a.click(); \r\n\r\n\r\n vhSweetAlert.success('Exported', `Successfully exported ${(vm.itemsSelected || []).length} videos.`);\r\n \r\n\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n }, function errorCallback(error) {\r\n console.log('Something went wrong!!!')\r\n });\r\n \r\n }\r\n\r\n\r\n function createVideo() {\r\n return {\r\n VideoId: 0,\r\n Name: null,\r\n ContentProvider: null,\r\n VideoFiles: []\r\n };\r\n }\r\n\r\n vm.addVideoModal = function () {\r\n vm.selectedVideo = createVideo();\r\n var addVideoModal = $uibModal.open( {\r\n templateUrl: 'modules/content/careplan_editor/videos/video.modal.html',\r\n controller: 'VideoModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n video: function() {\r\n return vm.selectedVideo;\r\n },\r\n contentProviders: function() {\r\n return vm.contentProviders;\r\n },\r\n languages: function() {\r\n return vm.languages;\r\n }\r\n }\r\n });\r\n\r\n addVideoModal.result.then(function (video){\r\n if (video.VideoId) {\r\n vm.getVideos();\r\n $state.go(\"content.videos.video\", {videoId: video.VideoId});\r\n }\r\n }, function (){});\r\n }\r\n\r\n}\r\n\r\nangular.module('content.videos').controller('VideosController', VideosController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/careplan_editor/videos/videos.tpl.html',\n '

      Videos

      1. {{vm.total}} Videos
        1\" previous-text=\"‹\" next-text=\"›\" first-text=\"«\" last-text=\"»\">

      No results returned

      ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/chart/chart.tpl.html',\n '

      Chart Content

      Categories

      {{category.Name}}

      Chart Entries

      ');\n}]);\n}(window, document, window.angular));","function ChartController(chartContent, ContentChartService, vhSweetAlert, $state, lodash, PermissionService, $stateParams, $uibModal, $sce, $window, $interval) {\r\n var cvm = this;\r\n cvm.chartContent = chartContent.data.Response;\r\n cvm.search = {};\r\n cvm.search.activeSearch = false;\r\n cvm.search.searchTextBox = '';\r\n cvm.clearSearch = clearSearch;\r\n cvm.performSearch = performSearch;\r\n cvm.selectCategory = selectCategory;\r\n cvm.selectedCategory = {};\r\n cvm.addEntry = addEntry;\r\n cvm.addCategory = addCategory;\r\n cvm.editEntry = editEntry;\r\n cvm.editCategory = editCategory;\r\n cvm.userHasWritePermission = userHasWritePermission;\r\n cvm.highlight = highlight;\r\n cvm.deleteEntry = deleteEntry;\r\n cvm.deleteCategory = deleteCategory;\r\n\r\n var entityMap = {\r\n \"&\": \"&\",\r\n \"<\": \"<\",\r\n \">\": \">\",\r\n '\"': '"',\r\n \"'\": ''',\r\n \"/\": '/'\r\n };\r\n\r\n loadController();\r\n\r\n\r\n function loadController() {\r\n if ($stateParams.MasterChartCategoryId) {\r\n cvm.selectedCategory = lodash.find(cvm.chartContent, function (q) { return q.MasterChartCategoryId == $stateParams.MasterChartCategoryId; });\r\n } else {\r\n cvm.selectedCategory = {};\r\n }\r\n }\r\n\r\n function addEntry() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/addentry.modal.html',\r\n controller: 'AddEntryModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n isEdit: false,\r\n entry: null,\r\n categories: null\r\n }\r\n });\r\n modalInstance.result.then(function (entry) {\r\n var MasterChartEntryModel = {};\r\n MasterChartEntryModel.Text = entry.Text;\r\n MasterChartEntryModel.MasterChartCategoryId = cvm.selectedCategory.MasterChartCategoryId;\r\n\r\n ContentChartService.createEntry([MasterChartEntryModel]).then(function (data) {\r\n var selectedId = cvm.selectedCategory.MasterChartCategoryId;\r\n cvm.selectedCategory = null;\r\n refreshContent(selectedId);\r\n });\r\n }, function () {\r\n });\r\n }\r\n\r\n function addCategory() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/addcategory.modal.html',\r\n controller: 'AddCategoryModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n categories: function () {\r\n return cvm.chartContent;\r\n },\r\n isEdit: false,\r\n showPopulations: true,\r\n category: null\r\n }\r\n\r\n });\r\n modalInstance.result.then(function (category) {\r\n var masterChartCategoryModel = {};\r\n masterChartCategoryModel.Name = category.categoryName;\r\n masterChartCategoryModel.Populations = category.categoryPopulations;\r\n clearSearch().then(function() {\r\n ContentChartService.createCategory([masterChartCategoryModel]).then(function (data) {\r\n refreshContent(data.data[0].MasterChartCategoryId);\r\n });\r\n });\r\n }, function () {\r\n });\r\n }\r\n\r\n function editEntry(entry) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/addentry.modal.html',\r\n controller: 'AddEntryModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n isEdit: true,\r\n entry: entry,\r\n categories: function() { return chartContent.data.Response; }\r\n }\r\n });\r\n modalInstance.result.then(function (newEntry) {\r\n ContentChartService.editEntry([newEntry]).then(function (data) {\r\n if (entry.MasterChartCategoryId != cvm.selectedCategory.MasterChartCategoryId) {\r\n refreshContent();\r\n }\r\n });\r\n }, function () {\r\n });\r\n }\r\n\r\n function editCategory(category) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/content/addcategory.modal.html',\r\n controller: 'AddCategoryModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n categories: function () {\r\n return cvm.chartContent;\r\n },\r\n isEdit: true, \r\n showPopulations: true,\r\n category: category\r\n }\r\n\r\n });\r\n modalInstance.result.then(function (res) {\r\n category.Name = res.categoryName;\r\n category.Populations = res.categoryPopulations;\r\n ContentChartService.editCategory([category]).then(function (data) {\r\n selectCategory(data.data[0].MasterChartCategoryId);\r\n //Modify the main content and not just search results\r\n if (cvm.search.activeSearch === true) {\r\n var modifiedCat = lodash.find(chartContent.data.Response, function (q) { return q.MasterChartCategoryId == data.data[0].MasterChartCategoryId; });\r\n modifiedCat.Name = categoryName;\r\n }\r\n });\r\n });\r\n }\r\n\r\n function deleteEntry(entry) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this entry?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n entry.IsEnabled = false;\r\n ContentChartService.editEntry([entry]).then(function(data) {\r\n cvm.selectedCategory.MasterChartEntries = lodash.filter(cvm.selectedCategory.MasterChartEntries, function (q) { return q.IsEnabled === true; });\r\n if (cvm.search.activeSearch === true) {\r\n\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n function deleteCategory(category) {\r\n if (category.MasterChartEntries.length > 0) {\r\n vhSweetAlert.error(\"Cannot delete category\", 'Category ' + category.Name + ' is not empty. To delete it, first delete all entries in this category.');\r\n } else {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this category?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n category.IsEnabled = false;\r\n ContentChartService.editCategory([category]).then(function(data) {\r\n cvm.chartContent = lodash.filter(cvm.chartContent, function(q) { return q.IsEnabled === true; });\r\n chartContent.data.Response = lodash.filter(cvm.chartContent, function(q) { return q.IsEnabled === true; });\r\n cvm.selectedCategory = cvm.chartContent[0];\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n function selectCategory(chartCategoryId) {\r\n cvm.selectedCategory = lodash.find(cvm.chartContent, function (q) { return q.MasterChartCategoryId == chartCategoryId; });\r\n }\r\n\r\n function performSearch() {\r\n cvm.search.activeSearch = true;\r\n cvm.chartContent = [];\r\n angular.forEach(chartContent.data.Response, function(q) {\r\n var results = lodash.filter(q.MasterChartEntries, function(o) {\r\n return o.Text.toUpperCase().search(cvm.search.searchTextBox.toUpperCase()) > -1;\r\n });\r\n if (results.length > 0)\r\n {\r\n var filteredCategory = {};\r\n filteredCategory.MasterChartCategoryId = q.MasterChartCategoryId;\r\n filteredCategory.Name = q.Name;\r\n filteredCategory.MasterChartEntries = results;\r\n filteredCategory.IsEnabled = q.IsEnabled;\r\n filteredCategory.SortOrder = q.SortOrder;\r\n cvm.chartContent.splice(cvm.chartContent.length, 0, filteredCategory);\r\n }\r\n });\r\n var selectedCategory = lodash.find(cvm.chartContent, function(o) { return o.MasterChartCategoryId == cvm.selectedCategory.MasterChartCategoryId; });\r\n if (!selectedCategory) {\r\n cvm.selectedCategory = cvm.chartContent[0];\r\n } else {\r\n cvm.selectedCategory = selectedCategory;\r\n }\r\n }\r\n\r\n function clearSearch() {\r\n cvm.search.activeSearch = false;\r\n cvm.search.searchTextBox = '';\r\n return refreshContent().then(function() {\r\n cvm.selectedCategory = cvm.chartContent[0];\r\n });\r\n }\r\n\r\n function refreshContent(selectionId) {\r\n return ContentChartService.getChartContent().then(function(data) {\r\n chartContent = data;\r\n cvm.chartContent = data.data.Response;\r\n if (selectionId != undefined) {\r\n if (selectionId == 0) {\r\n selectionId = data.data.Response[data.data.Response.length - 1].MasterChartCategoryId;\r\n }\r\n selectCategory(selectionId);\r\n }\r\n });\r\n }\r\n\r\n function userHasWritePermission() {\r\n return PermissionService.userHasPermission(['ChartContentWrite']);\r\n }\r\n\r\n function highlight(text) {\r\n var t = text.replace(/[&<>\"'\\/]/g, function (s) {\r\n return entityMap[s];\r\n });\r\n\r\n if (!cvm.search.activeSearch || cvm.search.searchTextBox.length < 1) {\r\n return $sce.trustAsHtml(t);\r\n }\r\n return $sce.trustAsHtml(t.replace(new RegExp(cvm.search.searchTextBox, 'gi'), '$&'));\r\n }\r\n var interval;\r\n cvm.dragEntryControlListeners = {\r\n accept: function (sourceItemHandleScope, destSortableScope) {\r\n if (!sourceItemHandleScope.itemScope.category) {\r\n return true;\r\n }\r\n },\r\n orderChanged: function(event) {\r\n for (i = 0; i < cvm.selectedCategory.MasterChartEntries.length; i++) {\r\n cvm.selectedCategory.MasterChartEntries[i].SortOrder = i + 1;\r\n }\r\n ContentChartService.editEntry(cvm.selectedCategory.MasterChartEntries);\r\n },\r\n //dragmove and dragend are so that the screen will scroll when items are moved off-screen\r\n dragMove: function(itemPosition, containment, eventObj) {\r\n var below = eventObj.clientY > $window.innerHeight;\r\n var above = eventObj.clientY < 35;\r\n if (below || above) {\r\n if (!interval) {\r\n interval = $interval(function(){\r\n $window.scrollBy(0, below ? 20 : -20);\r\n },25);\r\n }\r\n } else {\r\n $interval.cancel(interval);\r\n interval = null;\r\n }\r\n },\r\n dragEnd: function () {\r\n if(interval) {\r\n $interval.cancel(interval);\r\n interval = null;\r\n }\r\n }\r\n\r\n };\r\n\r\n cvm.dragCategoryControlListeners = {\r\n accept: function (sourceItemHandleScope, destSortableScope) {\r\n if (!sourceItemHandleScope.itemScope.entry) {\r\n return true;\r\n }\r\n },\r\n orderChanged: function(event) {\r\n for (i = 0; i < cvm.chartContent.length; i++) {\r\n cvm.chartContent[i].SortOrder = i + 1;\r\n }\r\n ContentChartService.editCategory(cvm.chartContent);\r\n },\r\n //dragmove and dragend are so that the screen will scroll when items are moved off-screen\r\n dragMove: function(itemPosition, containment, eventObj) {\r\n var below = eventObj.clientY > $window.innerHeight;\r\n var above = eventObj.clientY < 35;\r\n if (below || above) {\r\n if (!interval) {\r\n interval = $interval(function(){\r\n $window.scrollBy(0, below ? 20 : -20);\r\n },25);\r\n }\r\n } else {\r\n $interval.cancel(interval);\r\n interval = null;\r\n }\r\n },\r\n dragEnd: function () {\r\n if(interval) {\r\n $interval.cancel(interval);\r\n interval = null;\r\n }\r\n }\r\n };\r\n}\r\nangular.module(\"content.chart\").controller(\"ContentChartController\", ChartController);\r\n","function ChartService($http, PopulationsRepository) {\r\n\r\n function GetChartContent() {\r\n return $http.get(\"/api/ChartContent/\").then(function(data) {\r\n return data;\r\n });\r\n }\r\n\r\n function getPopulations() {\r\n return PopulationsRepository.getAll({ enabledOnly: true, includeAllPatients: true });\r\n }\r\n\r\n function getCategoryPopulations(categoryId) {\r\n return $http.get(\"/api/ChartContent/\" + categoryId + \"/populations\").then(function(result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function CreateCategory(masterChartCategoryModel) {\r\n return $http.post(\"/api/ChartContent/Category\", masterChartCategoryModel).then(function(data) {\r\n return data;\r\n });\r\n }\r\n\r\n function EditCategory(masterChartCategoryModel) {\r\n return $http.put(\"/api/ChartContent/Category\", masterChartCategoryModel).then(function(data) {\r\n return data;\r\n });\r\n }\r\n\r\n function CreateEntry(masterChartEntryModel) {\r\n return $http.post(\"/api/ChartContent/Entry\", masterChartEntryModel).then(function(data) {\r\n return data;\r\n });\r\n }\r\n\r\n function EditEntry(masterChartEntryModel) {\r\n return $http.put(\"/api/ChartContent/Entry\", masterChartEntryModel).then(function(data) {\r\n return data;\r\n });\r\n }\r\n\r\n return {\r\n getChartContent: GetChartContent,\r\n getPopulations: getPopulations,\r\n getCategoryPopulations: getCategoryPopulations,\r\n createCategory: CreateCategory,\r\n editCategory: EditCategory,\r\n createEntry: CreateEntry,\r\n editEntry: EditEntry\r\n };\r\n}\r\n\r\nangular.module(\"content.chart\")\r\n.factory(\"ContentChartService\", ChartService);\r\n","function CroppieDirective() {\r\n // directive to attach Croppie to an Element\r\n return {\r\n restrict: \"A\",\r\n scope: false,\r\n link: function (scope, elem) {\r\n scope.vme.croppieReady(elem[0]);\r\n }\r\n };\r\n}\r\nangular.module(\"content\").directive(\"croppie\", CroppieDirective);\r\n","function ImageEditorModalController($scope, ResourceLibraryService, $uibModalInstance, imgUrl, imgType, resourceType, resourceId, languageId, languageCode) {\r\n var vme = this;\r\n vme.ok = ok;\r\n vme.cancel = cancel;\r\n vme.croppieReady = croppieReady;\r\n vme.fileSelected = fileSelected;\r\n vme.imgType = imgType;\r\n vme.hasFile = false;\r\n vme.zoom = 100;\r\n\r\n var tempFilename = null;\r\n \r\n\r\n vme.typeName = \"Thumbnail\";\r\n var viewPort = { width: 320, height: 320 };\r\n var boundary = { width: 427, height: 427 };\r\n var defaultImageUrl = getImageUrl(1);\r\n if (2 === imgType) {\r\n vme.typeName = \"Portrait\";\r\n viewPort = { width: 240, height: 320 };\r\n boundary = { width: 320, height: 427 };\r\n defaultImageUrl = getImageUrl(2);\r\n } else if (3 === imgType) {\r\n vme.typeName = \"Landscape\";\r\n viewPort = { width: 320, height: 180 };\r\n boundary = { width: 427, height: 320 };\r\n defaultImageUrl = getImageUrl(3);\r\n }\r\n\r\n // the following gets called by croppie.directive.js\r\n var croppie = null;\r\n function croppieReady(elem) {\r\n\r\n croppie = new Croppie(elem, {\r\n viewport: viewPort,\r\n boundary: boundary,\r\n showZoomer: true,\r\n enableOrientation: false,\r\n enableResize: false,\r\n enforceBoundary: true,\r\n update: function(croppie){\r\n vme.zoom = Math.floor(croppie.zoom * 100);\r\n $scope.$apply();\r\n }\r\n });\r\n\r\n croppie.bind({\r\n url: imgUrl || defaultImageUrl,\r\n orientation: 1,\r\n zoom: 1\r\n });\r\n }\r\n\r\n function ok() {\r\n // if (null === tempFilename) {\r\n // vhSweetAlert.error(\"No Image Selected\", \"No image has been selected to save.\");\r\n // return;\r\n // }\r\n\r\n // extract the cropped image....\r\n var opts = {\r\n type: 'blob',\r\n size: 'viewport',\r\n format: 'png',\r\n quality: 1,\r\n circle: false\r\n };\r\n croppie.result(opts).then(function (img) {\r\n\r\n // then upload...\r\n ResourceLibraryService.uploadImage(resourceType, resourceId, imgType, languageId, img).then(function (filename) {\r\n var resourceImage = {\r\n ResourceId: resourceId,\r\n Type: resourceType,\r\n LanguageId: languageId,\r\n ImageType: imgType,\r\n ImageUrl: \"/api/media/custom/thumbnails/\" + languageCode + \"/\" + filename\r\n };\r\n\r\n // and finally associate to the resource and cleanup\r\n ResourceLibraryService.updateResourceImage(resourceImage).then(function(imageUrl) {\r\n ResourceLibraryService.deleteTempFile(tempFilename);\r\n $uibModalInstance.close(imageUrl);\r\n\r\n // if you don't destroy(), then things get wonky on subsequent usage\r\n croppie.destroy();\r\n });\r\n });\r\n });\r\n }\r\n\r\n function cancel() {\r\n ResourceLibraryService.deleteTempFile(tempFilename);\r\n $uibModalInstance.close(null);\r\n\r\n // if you don't destroy(), then things get wonky on subsequent usage\r\n croppie.destroy();\r\n }\r\n\r\n function fileSelected(input) {\r\n // upload a temp file that we can edit/crop - resourceType == 0 means temporary\r\n // the temp file is cleaned up when cancel() or ok() is called\r\n ResourceLibraryService.uploadImage(0, resourceId, imgType, languageId, input.files[0]).then(function (filename) {\r\n tempFilename = filename;\r\n var url = \"/api/media/custom/TempUpload/\" + filename + \"?\" + new Date().getTime();\r\n vme.hasFile = true;\r\n \r\n croppie.bind({\r\n url: url,\r\n orientation: 1\r\n });\r\n });\r\n }\r\n\r\n function getImageUrl(imageType) {\r\n switch (imageType) {\r\n case 1:\r\n if (resourceType === 1) return \"/content/healthtip_thumbnail.png\";\r\n return \"/content/video_thumbnail.png\";\r\n case 2:\r\n if (resourceType === 1) return \"/content/healthtip_portrait.png\";\r\n return \"/content/video_portrait.png\";\r\n case 3:\r\n if (resourceType === 1) return \"/content/healthtip_landscape.png\";\r\n return \"/content/video_landscape.png\";\r\n default:\r\n return null;\r\n }\r\n }\r\n}\r\nangular.module('content').controller('ImageEditorModalController', ImageEditorModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/images/image.editor.modal.html',\n '
      {{vme.typeName || \\'Image\\' }} Editor
      Zoom: {{vme.zoom}}%
      ');\n}]);\n}(window, document, window.angular));","function AddTileResourceController(vhSweetAlert, lodash, $state, $stateParams, ResourceLibraryService) {\r\n var vm = this;\r\n \r\n vm.selectLanguage = selectLanguage;\r\n vm.searchResources = searchResources;\r\n vm.performSearch = performSearch;\r\n vm.clearSearch = clearSearch;\r\n vm.addResource = addResource;\r\n vm.isUtilized = isUtilized;\r\n\r\n vm.resources = [];\r\n vm.selectedCategory = null;\r\n vm.categoryResources = [];\r\n vm.originalCategoryResources = [];\r\n vm.languages = [];\r\n vm.languageIndex = 0;\r\n vm.activeSearch = false;\r\n vm.showButtons = false;\r\n vm.dragEnabled = true;\r\n vm.cancel = cancel;\r\n vm.done = done;\r\n vm.isDirty = 0;\r\n vm.currentPage = 1;\r\n vm.pageSize = 50;\r\n vm.totalItems = 0;\r\n vm.resourceOptions = {\r\n accept: function (src, dest, destIndex) {\r\n var source = src.$modelValue;\r\n var destList = dest.$modelValue;\r\n var exists = lodash.find(destList, function (o) {\r\n return o.ResourceId === source.ResourceId;\r\n });\r\n return !exists;\r\n },\r\n dropped: function (event) {\r\n checkIfDirty();\r\n }\r\n };\r\n\r\n vm.libraryOptions = {\r\n accept: function (src, dest, destIndex) {\r\n return false;\r\n },\r\n dropped: function (event) {\r\n checkIfDirty();\r\n }\r\n };\r\n\r\n var libraryCategoryId = $stateParams.tileId;\r\n var resourceType = $state.is('content.library.tile.healthtips') ? \"1\" : \"2\";\r\n if (resourceType === \"1\") {\r\n vm.resourceType = \"Health Tip\";\r\n } else {\r\n vm.resourceType = \"Video\";\r\n }\r\n\r\n loadController(libraryCategoryId);\r\n\r\n function loadController(libraryCategoryId) {\r\n ResourceLibraryService.getLanguages().then(function (data) {\r\n vm.languages = data;\r\n vm.languageIndex = 0;\r\n vm.selectedLanguage = vm.languages[0];\r\n\r\n ResourceLibraryService.getLibraryTile(libraryCategoryId).then(function (data) {\r\n vm.selectedCategory = data;\r\n });\r\n\r\n ResourceLibraryService.getTileResources(libraryCategoryId, vm.selectedLanguage.LanguageId).then(function (data) {\r\n vm.categoryResources = data;\r\n vm.originalCategoryResources = angular.copy(data);\r\n });\r\n\r\n ResourceLibraryService.getLibraryResources(vm.searchText, vm.currentPage, vm.pageSize, resourceType, vm.selectedLanguage.LanguageId).then(function (data) {\r\n vm.resources = data.Response;\r\n vm.totalItems = data.TotalCount;\r\n });\r\n });\r\n }\r\n \r\n function cancel() {\r\n if (vm.isDirty) {\r\n vhSweetAlert.verify('Are you sure?',\r\n 'You have made changes to this Library Tile. Cancel and discard changes?',\r\n 'Yes')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $state.go('content.library');\r\n }\r\n });\r\n } else {\r\n $state.go('content.library');\r\n }\r\n }\r\n\r\n function done() {\r\n ResourceLibraryService.updateTileResources(vm.selectedCategory.LibraryCategoryId, vm.categoryResources).then(function() {\r\n $state.go('content.library', [vm.selectedCategory]);\r\n });\r\n }\r\n function searchResources() {\r\n if (vm.searchText.length > 0) {\r\n vm.activeSearch = true;\r\n performSearch();\r\n } else {\r\n clearSearch();\r\n }\r\n }\r\n\r\n function clearSearch() {\r\n vm.activeSearch = false;\r\n vm.searchText = '';\r\n vm.resources = [];\r\n vm.currentPage = 1;\r\n performSearch();\r\n }\r\n\r\n function performSearch() {\r\n ResourceLibraryService.getLibraryResources(vm.searchText, vm.currentPage, vm.pageSize, resourceType, vm.selectedLanguage.LanguageId).then(function (data) {\r\n vm.resources = data.Response;\r\n vm.totalItems = data.TotalCount;\r\n });\r\n }\r\n\r\n function selectLanguage(item, index) {\r\n if (vm.isDirty) {\r\n vhSweetAlert.verify('Tile has changes',\r\n 'You cannot switch to another language until you save changes. Save changes now?',\r\n 'Yes')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n ResourceLibraryService.updateTileResources(vm.selectedCategory.LibraryCategoryId, vm.categoryResources).then(function () {\r\n vm.isDirty = false;\r\n switchLanguage(index, item);\r\n });\r\n }\r\n });\r\n } else {\r\n switchLanguage(index, item);\r\n }\r\n }\r\n\r\n function switchLanguage(index, item) {\r\n vm.languageIndex = index;\r\n vm.selectedLanguage = item;\r\n\r\n ResourceLibraryService.getTileResources(libraryCategoryId, vm.selectedLanguage.LanguageId).then(function (data) {\r\n vm.categoryResources = data;\r\n });\r\n performSearch();\r\n }\r\n\r\n function addResource(item) {\r\n if (isUtilized(item)) {\r\n vhSweetAlert.error(\"Unable to add Resource\", 'Item already exists as a Resource for this Tile.');\r\n return;\r\n }\r\n vm.categoryResources.push(item);\r\n checkIfDirty();\r\n }\r\n\r\n function isUtilized(item) {\r\n var exists = lodash.find(vm.categoryResources, function (o) {\r\n return o.ResourceId === item.ResourceId && o.Type === item.Type;\r\n });\r\n return exists;\r\n }\r\n function checkIfDirty() {\r\n var original = getResourceIdList(vm.originalCategoryResources);\r\n var current = getResourceIdList(vm.categoryResources);\r\n var result = lodash.difference(current, original);\r\n vm.isDirty = result.length > 0;\r\n }\r\n\r\n function getResourceIdList(arr) {\r\n var result = [];\r\n angular.forEach(arr, function(val) {\r\n result.push({resourceId: val.ResourceId, resourceType: val.Type});\r\n });\r\n return result;\r\n }\r\n}\r\nangular.module('content.library').controller(\"AddTileResourceController\", AddTileResourceController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/resource_library/add_resource/add.resource.tpl.html',\n '

      Resource Library - Add {{vm.resourceType}} Resource

      1. Selected Tile: {{ vm.selectedCategory.MultilingualText[vm.languageIndex].Text }}
      Available {{vm.resourceType}} Resources
        1. Time to Read: {{item.Duration}} Duration: {{item.Duration}}

        No results returned

        ');\n}]);\n}(window, document, window.angular));","function EditCategoryModalController(\r\n ResourceLibraryService,\r\n PermissionService,\r\n lodash,\r\n vhSweetAlert,\r\n $uibModalInstance,\r\n $uibModal,\r\n categories,\r\n category,\r\n languages,\r\n languageIndex) {\r\n var vm = this;\r\n\r\n vm.titleText = 'Edit Library Tile';\r\n vm.bodyText = 'Enter Library Tile Name';\r\n if (null == category) {\r\n category = createNewCategory(languages);\r\n vm.titleText = 'Add New Library Tile';\r\n vm.bodyText = 'Enter New Library Tile Name:';\r\n } else {\r\n category = angular.copy(category);\r\n }\r\n\r\n // must be in this order for edit to work\r\n vm.languageIndex = languageIndex;\r\n vm.category = category;\r\n // must be in this order for edit to work\r\n\r\n vm.languages = languages;\r\n vm.selectedLanguage = languages[languageIndex];\r\n vm.categoryPopulations = [];\r\n vm.lastSelectedPrograms = [];\r\n vm.availablePopulations = [];\r\n vm.enabledPrograms = [];\r\n vm.disabledPrograms = [];\r\n vm.populationsChanged = populationsChanged;\r\n \r\n vm.serviceChanged = serviceChanged;\r\n\r\n vm.categoryServices = [];\r\n vm.lastSelectedServices = [];\r\n vm.availableServices = [];\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.selectIcon = selectIcon;\r\n vm.selectLanguage = selectLanguage;\r\n\r\n vm.showDisabledPrograms = false;\r\n vm.canAssignDisabledPrograms = PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n vm.toggleShowDisabledPrograms = toggleShowDisabledPrograms;\r\n\r\n init();\r\n\r\n function init() {\r\n setPlaceholderText();\r\n ResourceLibraryService.getPopulations({ enabledOnly: !vm.canAssignDisabledPrograms }).then(function (data) {\r\n vm.allPatients = lodash.find(data, function (p) { return p.IsAllPatients; });\r\n vm.enabledPrograms = data.filter(p => p.IsEnabled);\r\n vm.availablePopulations = vm.enabledPrograms;\r\n vm.disabledPrograms = data.filter(p => !p.IsEnabled);\r\n\r\n if (vm.category.LibraryCategoryId > 0) {\r\n ResourceLibraryService.getTilePopulations(vm.category.LibraryCategoryId, !vm.canAssignDisabledPrograms).then(function (data) {\r\n vm.categoryPopulations = data;\r\n vm.lastSelectedPrograms = angular.copy(vm.categoryPopulations);\r\n });\r\n }\r\n });\r\n\r\n ResourceLibraryService.getLibraryServices().then(function (data) {\r\n vm.availableServices =data\r\n if (vm.category.LibraryCategoryId > 0) {\r\n ResourceLibraryService.getTileServices(vm.category.LibraryCategoryId ).then(function (data) {\r\n vm.categoryServices = data;\r\n vm.lastSelectedServices = angular.copy(vm.categoryServices);\r\n });\r\n }\r\n\r\n });\r\n \r\n }\r\n\r\n function populationsChanged() {\r\n // if it was just All Patients and they added something else\r\n if (vm.lastSelectedPrograms.length == 1 && vm.lastSelectedPrograms[0].IsAllPatients && vm.categoryPopulations.length > 1) {\r\n //remove All Patients\r\n var copySelected = angular.copy(vm.categoryPopulations);\r\n lodash.remove(copySelected, p => p.IsAllPatients);\r\n vm.categoryPopulations = copySelected;\r\n }\r\n // if it was just other programs and they added All Patients\r\n else if(lodash.find(vm.lastSelectedPrograms, p => p.IsAllPatients) === undefined &&\r\n lodash.find(vm.categoryPopulations, p => p.IsAllPatients) !== undefined) {\r\n //add All Patients, remove all others\r\n vm.categoryPopulations = [vm.allPatients];\r\n }\r\n // must have a population on this screen\r\n else if(vm.categoryPopulations.length == 0) {\r\n // default to All Patients\r\n vm.categoryPopulations = [vm.allPatients];\r\n }\r\n\r\n // remember old selection in order to track changes\r\n vm.lastSelectedPrograms = angular.copy(vm.categoryPopulations);\r\n }\r\n\r\n\r\n function serviceChanged() {\r\n \r\n // remember old selection in order to track changes\r\n vm.lastSelectedServices = angular.copy(vm.categoryServices);\r\n }\r\n\r\n function ok() {\r\n if (vm.category.MultilingualText.length > 0 && !vm.category.MultilingualText[0].Text) {\r\n var primaryLanguage = languages[languageIndex].Name;\r\n vhSweetAlert.error(\"Unable to save\", 'The primary language is ' + primaryLanguage + ' and you have not provided a Tile name. You must provide a Tile name for ' + primaryLanguage + '.');\r\n return;\r\n }\r\n\r\n if (vm.categoryPopulations.length == 0) {\r\n vhSweetAlert.error(\"Unable to save\", 'Tile cannot be published without selecting a program.');\r\n return;\r\n }\r\n\r\n if (vm.categoryServices.length == 0) {\r\n vhSweetAlert.error(\"Unable to save\", 'Tile cannot be saved without selecting a service level type.');\r\n return;\r\n }\r\n\r\n\r\n for (var index = 0; index < vm.category.MultilingualText.length; index++) {\r\n var text = vm.category.MultilingualText[index].Text || \"\";\r\n if (0 === text.length) continue;\r\n for (var x = 0; x < categories.length; x++) {\r\n var cat = categories[x];\r\n if (vm.category.LibraryCategoryId === cat.LibraryCategoryId) {\r\n continue;\r\n }\r\n var currentText = cat.MultilingualText[index].Text || \"\";\r\n if (currentText.toUpperCase() === text.toUpperCase()) {\r\n vhSweetAlert.error(\"Unable to save\", 'You have already given the same Tile name for ' + languages[index].Name + '. Names must be unique across Tiles and languages.');\r\n vm.languageIndex = index;\r\n vm.selectedLanguage = languages[index];\r\n return;\r\n }\r\n }\r\n }\r\n\r\n if (0 === vm.category.LibraryCategoryId) {\r\n ResourceLibraryService.createLibraryTile(vm.category).then(function(data) {\r\n vm.category = data;\r\n ResourceLibraryService.updateTileServices(vm.category.LibraryCategoryId, vm.categoryServices).then(function (data) {\r\n ResourceLibraryService.updateTilePopulations(vm.category.LibraryCategoryId, vm.categoryPopulations).then(function (data) {\r\n $uibModalInstance.close(vm.category);\r\n });\r\n });\r\n });\r\n } else {\r\n ResourceLibraryService.updateLibraryTile(vm.category).then(function (data) {\r\n vm.category = data;\r\n ResourceLibraryService.updateTileServices(vm.category.LibraryCategoryId, vm.categoryServices).then(function (data) {\r\n ResourceLibraryService.updateTilePopulations(vm.category.LibraryCategoryId, vm.categoryPopulations).then(function (data) {\r\n $uibModalInstance.close(vm.category);\r\n });\r\n });\r\n });\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.close(null);\r\n }\r\n\r\n function selectIcon() {\r\n var dlg = $uibModal.open({\r\n templateUrl: 'modules/content/resource_library/icon_picker/icon.picker.modal.html',\r\n controller: 'IconPickerController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n iconClass: function () { return vm.category; }\r\n }\r\n });\r\n dlg.result.then(function (result) {\r\n if (null != result) vm.category.Icon = result;\r\n });\r\n }\r\n\r\n function selectLanguage(item, index) {\r\n vm.languageIndex = index;\r\n vm.selectedLanguage = item;\r\n setPlaceholderText();\r\n }\r\n\r\n function setPlaceholderText() {\r\n vm.placeholderText =\r\n (!vm.category.MultilingualText[vm.languageIndex].Text && vm.languageIndex !== 0)\r\n ? vm.category.MultilingualText[0].Text\r\n : \"Library Tile Name\";\r\n }\r\n\r\n function createNewCategory(languages) {\r\n var multilingualText = new Array(languages.length);\r\n for (var index = 0; index < languages.length; index++) {\r\n multilingualText[index] = {\r\n \"CategoryTextId\": 0,\r\n \"LanguageId\": languages[index].LanguageId,\r\n \"Text\": null\r\n };\r\n }\r\n return {\r\n \"LibraryCategoryId\": 0,\r\n \"MultilingualText\": multilingualText,\r\n \"SortOrder\": 1,\r\n \"Icon\": \"fa-folder\"\r\n };\r\n }\r\n\r\n function toggleShowDisabledPrograms($event) {\r\n $event.stopPropagation();\r\n vm.showDisabledPrograms = !vm.showDisabledPrograms;\r\n updateProgramsList(vm.showDisabledPrograms);\r\n }\r\n\r\n function updateProgramsList(shouldFilter) {\r\n vm.availablePopulations = [];\r\n vm.availablePopulations = vm.showDisabledPrograms\r\n ? vm.enabledPrograms.concat(vm.disabledPrograms)\r\n : vm.enabledPrograms;\r\n }\r\n\r\n}\r\nangular.module('content.library').controller('EditCategoryModalController', EditCategoryModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/resource_library/category_editor/editcategory.modal.html',\n '

        {{vm.titleText}}

        {{vm.bodyText }} ({{vm.selectedLanguage.Name}})

         
        0\">
        Health Tips: {{vm.category.HealthTipCount}} Videos: {{vm.category.VideoCount}}
        This Library Tile is currently not published This Library Tile is published and available
        Program(s):{{$item.PopulationName}} (disabled){{population.PopulationName}} (disabled)
        Service Level Type(s):{{$item.Name}}{{Services.Name}}
        ');\n}]);\n}(window, document, window.angular));","function IconPickerController($uibModalInstance, iconClass) {\r\n var vm = this;\r\n vm.selectIcon = selectIcon;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.selectedIcon = null;\r\n vm.searchText = null;\r\n vm.searchIcons = searchIcons;\r\n vm.clearSearch = clearSearch;\r\n vm.activeSearch = false;\r\n \r\n // https://fontawesome.com/v4.7.0/icons/\r\n var iconClasses = [\r\n \"fa-500px\",\"fa-adjust\",\"fa-adn\",\"fa-align-center\",\"fa-align-justify\",\"fa-align-left\",\"fa-align-right\",\r\n \"fa-amazon\",\"fa-ambulance\",\"fa-anchor\",\"fa-android\",\"fa-angellist\",\"fa-angle-double-down\",\"fa-angle-double-left\",\r\n \"fa-angle-double-right\",\"fa-angle-double-up\",\"fa-angle-down\",\"fa-angle-left\",\"fa-angle-right\",\"fa-angle-up\",\r\n \"fa-apple\",\"fa-archive\",\"fa-area-chart\",\"fa-arrow-circle-down\",\"fa-arrow-circle-left\",\"fa-arrow-circle-o-down\",\r\n \"fa-arrow-circle-o-left\",\"fa-arrow-circle-o-right\",\"fa-arrow-circle-o-up\",\"fa-arrow-circle-right\",\r\n \"fa-arrow-circle-up\",\"fa-arrow-down\",\"fa-arrow-left\",\"fa-arrow-right\",\"fa-arrow-up\",\"fa-arrows\",\"fa-arrows-alt\",\r\n \"fa-arrows-h\",\"fa-arrows-v\",\"fa-asterisk\",\"fa-at\",\"fa-backward\",\"fa-balance-scale\",\"fa-ban\",\"fa-bar-chart\",\r\n \"fa-barcode\",\"fa-bars\",\"fa-battery-empty\",\"fa-battery-full\",\"fa-battery-half\",\"fa-battery-quarter\",\r\n \"fa-battery-three-quarters\",\"fa-bed\",\"fa-beer\",\"fa-behance\",\"fa-behance-square\",\"fa-bell\",\"fa-bell-o\",\r\n \"fa-bell-slash\",\"fa-bell-slash-o\",\"fa-bicycle\",\"fa-binoculars\",\"fa-birthday-cake\",\"fa-bitbucket\",\"fa-bitbucket-square\",\r\n \"fa-black-tie\",\"fa-bold\",\"fa-bolt\",\"fa-bomb\",\"fa-book\",\"fa-bookmark\",\"fa-bookmark-o\",\"fa-briefcase\",\"fa-btc\",\"fa-bug\",\r\n \"fa-building\",\"fa-building-o\",\"fa-bullhorn\",\"fa-bullseye\",\"fa-bus\",\"fa-buysellads\",\"fa-calculator\",\"fa-calendar\",\r\n \"fa-calendar-check-o\",\"fa-calendar-minus-o\",\"fa-calendar-o\",\"fa-calendar-plus-o\",\"fa-calendar-times-o\",\"fa-camera\",\r\n \"fa-camera-retro\",\"fa-car\",\"fa-caret-down\",\"fa-caret-left\",\"fa-caret-right\",\"fa-caret-square-o-down\",\r\n \"fa-caret-square-o-left\",\"fa-caret-square-o-right\",\"fa-caret-square-o-up\",\"fa-caret-up\",\"fa-cart-arrow-down\",\r\n \"fa-cart-plus\",\"fa-cc\",\"fa-cc-amex\",\"fa-cc-diners-club\",\"fa-cc-discover\",\"fa-cc-jcb\",\"fa-cc-mastercard\",\"fa-cc-paypal\",\r\n \"fa-cc-stripe\",\"fa-cc-visa\",\"fa-certificate\",\"fa-chain-broken\",\"fa-check\",\"fa-check-circle\",\"fa-check-circle-o\",\r\n \"fa-check-square\",\"fa-check-square-o\",\"fa-chevron-circle-down\",\"fa-chevron-circle-left\",\"fa-chevron-circle-right\",\r\n \"fa-chevron-circle-up\",\"fa-chevron-down\",\"fa-chevron-left\",\"fa-chevron-right\",\"fa-chevron-up\",\"fa-child\",\r\n \"fa-chrome\",\"fa-circle\",\"fa-circle-o\",\"fa-circle-o-notch\",\"fa-circle-thin\",\"fa-clipboard\",\"fa-clock-o\",\"fa-clone\",\r\n \"fa-cloud\",\"fa-cloud-download\",\"fa-cloud-upload\",\"fa-code\",\"fa-code-fork\",\"fa-codepen\",\"fa-coffee\",\"fa-cog\",\"fa-cogs\",\r\n \"fa-columns\",\"fa-comment\",\"fa-comment-o\",\"fa-commenting\",\"fa-commenting-o\",\"fa-comments\",\"fa-comments-o\",\"fa-compass\",\r\n \"fa-compress\",\"fa-connectdevelop\",\"fa-contao\",\"fa-copyright\",\"fa-creative-commons\",\"fa-credit-card\",\"fa-crop\",\r\n \"fa-crosshairs\",\"fa-css3\",\"fa-cube\",\"fa-cubes\",\"fa-cutlery\",\"fa-dashcube\",\"fa-database\",\"fa-delicious\",\"fa-desktop\",\r\n \"fa-deviantart\",\"fa-diamond\",\"fa-digg\",\"fa-dot-circle-o\",\"fa-download\",\"fa-dribbble\",\"fa-dropbox\",\"fa-drupal\",\"fa-eject\",\r\n \"fa-ellipsis-h\",\"fa-ellipsis-v\",\"fa-empire\",\"fa-envelope\",\"fa-envelope-o\",\"fa-envelope-square\",\"fa-eraser\",\"fa-eur\",\r\n \"fa-exchange\",\"fa-exclamation\",\"fa-exclamation-circle\",\"fa-exclamation-triangle\",\"fa-expand\",\"fa-expeditedssl\",\r\n \"fa-external-link\",\"fa-external-link-square\",\"fa-eye\",\"fa-eye-slash\",\"fa-eyedropper\",\"fa-facebook\",\"fa-facebook-official\",\r\n \"fa-facebook-square\",\"fa-fast-backward\",\"fa-fast-forward\",\"fa-fax\",\"fa-female\",\"fa-fighter-jet\",\"fa-file\",\r\n \"fa-file-archive-o\",\"fa-file-audio-o\",\"fa-file-code-o\",\"fa-file-excel-o\",\"fa-file-image-o\",\"fa-file-o\",\"fa-file-pdf-o\",\r\n \"fa-file-powerpoint-o\",\"fa-file-text\",\"fa-file-text-o\",\"fa-file-video-o\",\"fa-file-word-o\",\"fa-files-o\",\"fa-film\",\r\n \"fa-filter\",\"fa-fire\",\"fa-fire-extinguisher\",\"fa-firefox\",\"fa-flag\",\"fa-flag-checkered\",\"fa-flag-o\",\"fa-flask\",\r\n \"fa-flickr\",\"fa-floppy-o\",\"fa-folder\",\"fa-folder-o\",\"fa-folder-open\",\"fa-folder-open-o\",\"fa-font\",\"fa-fonticons\",\r\n \"fa-forumbee\",\"fa-forward\",\"fa-foursquare\",\"fa-frown-o\",\"fa-futbol-o\",\"fa-gamepad\",\"fa-gavel\",\"fa-gbp\",\"fa-genderless\",\r\n \"fa-get-pocket\",\"fa-gg\",\"fa-gg-circle\",\"fa-gift\",\"fa-git\",\"fa-git-square\",\"fa-github\",\"fa-github-alt\",\"fa-github-square\",\r\n \"fa-glass\",\"fa-globe\",\"fa-google\",\"fa-google-plus\",\"fa-google-plus-square\",\"fa-google-wallet\",\"fa-graduation-cap\",\"fa-gratipay\",\r\n \"fa-h-square\",\"fa-hacker-news\",\"fa-hand-lizard-o\",\"fa-hand-o-down\",\"fa-hand-o-left\",\"fa-hand-o-right\",\"fa-hand-o-up\",\r\n \"fa-hand-paper-o\",\"fa-hand-peace-o\",\"fa-hand-pointer-o\",\"fa-hand-rock-o\",\"fa-hand-scissors-o\",\"fa-hand-spock-o\",\"fa-hdd-o\",\r\n \"fa-header\",\"fa-headphones\",\"fa-heart\",\"fa-heart-o\",\"fa-heartbeat\",\"fa-history\",\"fa-home\",\"fa-hospital-o\",\"fa-hourglass\",\r\n \"fa-hourglass-end\",\"fa-hourglass-half\",\"fa-hourglass-o\",\"fa-hourglass-start\",\"fa-houzz\",\"fa-html5\",\"fa-i-cursor\",\r\n \"fa-ils\",\"fa-inbox\",\"fa-indent\",\"fa-industry\",\"fa-info\",\"fa-info-circle\",\"fa-inr\",\"fa-instagram\",\"fa-internet-explorer\",\r\n \"fa-ioxhost\",\"fa-italic\",\"fa-joomla\",\"fa-jpy\",\"fa-jsfiddle\",\"fa-key\",\"fa-keyboard-o\",\"fa-krw\",\"fa-language\",\"fa-laptop\",\r\n \"fa-lastfm\",\"fa-lastfm-square\",\"fa-leaf\",\"fa-leanpub\",\"fa-lemon-o\",\"fa-level-down\",\"fa-level-up\",\"fa-life-ring\",\r\n \"fa-lightbulb-o\",\"fa-line-chart\",\"fa-link\",\"fa-linkedin\",\"fa-linkedin-square\",\"fa-linux\",\"fa-list\",\"fa-list-alt\",\r\n \"fa-list-ol\",\"fa-list-ul\",\"fa-location-arrow\",\"fa-lock\",\"fa-long-arrow-down\",\"fa-long-arrow-left\",\"fa-long-arrow-right\",\r\n \"fa-long-arrow-up\",\"fa-magic\",\"fa-magnet\",\"fa-male\",\"fa-map\",\"fa-map-marker\",\"fa-map-o\",\"fa-map-pin\",\"fa-map-signs\",\r\n \"fa-mars\",\"fa-mars-double\",\"fa-mars-stroke\",\"fa-mars-stroke-h\",\"fa-mars-stroke-v\",\"fa-maxcdn\",\"fa-meanpath\",\"fa-medium\",\r\n \"fa-medkit\",\"fa-meh-o\",\"fa-mercury\",\"fa-microphone\",\"fa-microphone-slash\",\"fa-minus\",\"fa-minus-circle\",\"fa-minus-square\",\r\n \"fa-minus-square-o\",\"fa-mobile\",\"fa-money\",\"fa-moon-o\",\"fa-motorcycle\",\"fa-mouse-pointer\",\"fa-music\",\"fa-neuter\",\r\n \"fa-newspaper-o\",\"fa-object-group\",\"fa-object-ungroup\",\"fa-odnoklassniki\",\"fa-odnoklassniki-square\",\"fa-opencart\",\r\n \"fa-openid\",\"fa-opera\",\"fa-optin-monster\",\"fa-outdent\",\"fa-pagelines\",\"fa-paint-brush\",\"fa-paper-plane\",\"fa-paper-plane-o\",\r\n \"fa-paperclip\",\"fa-paragraph\",\"fa-pause\",\"fa-paw\",\"fa-paypal\",\"fa-pencil\",\"fa-pencil-square\",\"fa-pencil-square-o\",\r\n \"fa-phone\",\"fa-phone-square\",\"fa-picture-o\",\"fa-pie-chart\",\"fa-pied-piper\",\"fa-pied-piper-alt\",\"fa-pinterest\",\r\n \"fa-pinterest-p\",\"fa-pinterest-square\",\"fa-plane\",\"fa-play\",\"fa-play-circle\",\"fa-play-circle-o\",\"fa-plug\",\"fa-plus\",\r\n \"fa-plus-circle\",\"fa-plus-square\",\"fa-plus-square-o\",\"fa-power-off\",\"fa-print\",\"fa-puzzle-piece\",\"fa-qq\",\"fa-qrcode\",\r\n \"fa-question\",\"fa-question-circle\",\"fa-quote-left\",\"fa-quote-right\",\"fa-random\",\"fa-rebel\",\"fa-recycle\",\"fa-reddit\",\r\n \"fa-reddit-square\",\"fa-refresh\",\"fa-registered\",\"fa-renren\",\"fa-repeat\",\"fa-reply\",\"fa-reply-all\",\"fa-retweet\",\r\n \"fa-road\",\"fa-rocket\",\"fa-rss\",\"fa-rss-square\",\"fa-rub\",\"fa-safari\",\"fa-scissors\",\"fa-search\",\"fa-search-minus\",\r\n \"fa-search-plus\",\"fa-sellsy\",\"fa-server\",\"fa-share\",\"fa-share-alt\",\"fa-share-alt-square\",\"fa-share-square\",\r\n \"fa-share-square-o\",\"fa-shield\",\"fa-ship\",\"fa-shirtsinbulk\",\"fa-shopping-cart\",\"fa-sign-in\",\"fa-sign-out\",\"fa-signal\",\r\n \"fa-simplybuilt\",\"fa-sitemap\",\"fa-skyatlas\",\"fa-skype\",\"fa-slack\",\"fa-sliders\",\"fa-slideshare\",\"fa-smile-o\",\"fa-sort\",\r\n \"fa-sort-alpha-asc\",\"fa-sort-alpha-desc\",\"fa-sort-amount-asc\",\"fa-sort-amount-desc\",\"fa-sort-asc\",\"fa-sort-desc\",\r\n \"fa-sort-numeric-asc\",\"fa-sort-numeric-desc\",\"fa-soundcloud\",\"fa-space-shuttle\",\"fa-spinner\",\"fa-spoon\",\"fa-spotify\",\r\n \"fa-square\",\"fa-square-o\",\"fa-stack-exchange\",\"fa-stack-overflow\",\"fa-star\",\"fa-star-half\",\"fa-star-half-o\",\"fa-star-o\",\r\n \"fa-steam\",\"fa-steam-square\",\"fa-step-backward\",\"fa-step-forward\",\"fa-stethoscope\",\"fa-sticky-note\",\"fa-sticky-note-o\",\r\n \"fa-stop\",\"fa-street-view\",\"fa-strikethrough\",\"fa-stumbleupon\",\"fa-stumbleupon-circle\",\"fa-subscript\",\"fa-subway\",\r\n \"fa-suitcase\",\"fa-sun-o\",\"fa-superscript\",\"fa-table\",\"fa-tablet\",\"fa-tachometer\",\"fa-tag\",\"fa-tags\",\"fa-tasks\",\r\n \"fa-taxi\",\"fa-television\",\"fa-tencent-weibo\",\"fa-terminal\",\"fa-text-height\",\"fa-text-width\",\"fa-th\",\"fa-th-large\",\r\n \"fa-th-list\",\"fa-thumb-tack\",\"fa-thumbs-down\",\"fa-thumbs-o-down\",\"fa-thumbs-o-up\",\"fa-thumbs-up\",\"fa-ticket\",\"fa-times\",\r\n \"fa-times-circle\",\"fa-times-circle-o\",\"fa-tint\",\"fa-toggle-off\",\"fa-toggle-on\",\"fa-trademark\",\"fa-train\",\"fa-transgender\",\r\n \"fa-transgender-alt\",\"fa-trash\",\"fa-trash-o\",\"fa-tree\",\"fa-trello\",\"fa-tripadvisor\",\"fa-trophy\",\"fa-truck\",\"fa-try\",\"fa-tty\",\r\n \"fa-tumblr\",\"fa-tumblr-square\",\"fa-twitch\",\"fa-twitter\",\"fa-twitter-square\",\"fa-umbrella\",\"fa-underline\",\"fa-undo\",\"fa-university\",\r\n \"fa-unlock\",\"fa-unlock-alt\",\"fa-upload\",\"fa-usd\",\"fa-user\",\"fa-user-md\",\"fa-user-plus\",\"fa-user-secret\",\"fa-user-times\",\r\n \"fa-users\",\"fa-venus\",\"fa-venus-double\",\"fa-venus-mars\",\"fa-viacoin\",\"fa-video-camera\",\"fa-vimeo\",\"fa-vimeo-square\",\r\n \"fa-vine\",\"fa-vk\",\"fa-volume-down\",\"fa-volume-off\",\"fa-volume-up\",\"fa-weibo\",\"fa-weixin\",\"fa-whatsapp\",\"fa-wheelchair\",\r\n \"fa-wifi\",\"fa-wikipedia-w\",\"fa-windows\",\"fa-wordpress\",\"fa-wrench\",\"fa-xing\",\"fa-xing-square\",\"fa-y-combinator\",\r\n \"fa-yahoo\",\"fa-yelp\",\"fa-youtube\",\"fa-youtube-play\",\"fa-youtube-square\"\r\n ];\r\n\r\n vm.icons = createIcons(null);\r\n\r\n function createIcons(searchText) {\r\n var result = [];\r\n \r\n angular.forEach(iconClasses, function (className) {\r\n var include = true;\r\n if (searchText && searchText.length > 0) {\r\n if (-1 === className.indexOf(searchText.toLowerCase())) {\r\n include = false;\r\n }\r\n }\r\n if (include) {\r\n var item = {\r\n \"icon\": className,\r\n \"selected\": false\r\n };\r\n result.push(item);\r\n if (className === iconClass) {\r\n vm.selectedIcon = item;\r\n vm.selectedIcon.selected = true;\r\n }\r\n }\r\n });\r\n return result;\r\n }\r\n\r\n function ok() {\r\n $uibModalInstance.close(vm.selectedIcon.icon);\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.close(null);\r\n }\r\n\r\n function searchIcons() {\r\n if (!vm.searchText) return;\r\n vm.activeSearch = true;\r\n vm.icons = createIcons(vm.searchText);\r\n }\r\n function selectIcon(icon) {\r\n if (null != vm.selectedIcon) vm.selectedIcon.selected = false;\r\n icon.selected = !icon.selected;\r\n vm.selectedIcon = icon;\r\n }\r\n\r\n function clearSearch() {\r\n vm.activeSearch = false;\r\n vm.searchText = '';\r\n vm.icons = createIcons(null);\r\n }\r\n}\r\nangular.module('content.library').controller('IconPickerController', IconPickerController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/resource_library/icon_picker/icon.picker.modal.html',\n '

        Icon Picker

         
        ');\n}]);\n}(window, document, window.angular));","function ResourceLibraryController($uibModal, lodash, vhSweetAlert, $state, $stateParams, ResourceLibraryService, PermissionService, $http,$sce) {\r\n var vm = this,\r\n groupId = $stateParams.groupId,\r\n libraryCategoryId = $stateParams.tileId;\r\n\r\n vm.showUID = PermissionService.userHasPermission(['ContentUIDRead']);\r\n \r\n vm.userCanImportTiles = PermissionService.userHasPermission(['ResourceLibraryImport']);\r\n vm.userCanExportTiles = PermissionService.userHasPermission(['ResourceLibraryExport']);\r\n\r\n vm.userCanEditResourceLibrary = PermissionService.userHasPermission(['ResourceLibraryWrite']);\r\n vm.userCanReadResourceLibrary = PermissionService.userHasPermission(['ResourceLibraryRead']);\r\n\r\n vm.userCanEditRules = PermissionService.userHasPermission([\"RuleWrite\"]);\r\n\r\n vm.libraryGroupName = groupId ? $stateParams.groupName : '';\r\n vm.itemsSelected = [];\r\n vm.selectLanguage = selectLanguage;\r\n vm.selectCategory = selectCategory;\r\n vm.showCategoryEditor = showCategoryEditor;\r\n vm.addHealthTip = addHealthTip;\r\n vm.addVideo = addVideo;\r\n vm.deleteCategory = deleteCategory;\r\n vm.deleteCategoryResource = deleteCategoryResource;\r\n vm.performSearch = performSearch;\r\n vm.clearSearch = clearSearch;\r\n vm.togglePublish = togglePublish;\r\n vm.sortResources = sortResources;\r\n vm.isSelected = _isSelected;\r\n vm.selectToggle = _selectToggle;\r\n vm.toggle = _toggle;\r\n vm.export = _export;\r\n vm.getLibraryTiles = _getLibraryTiles;\r\n vm.getLanguageIndex = getLanguageIndex;\r\n\r\n vm.rules = [];\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.categories = [];\r\n vm.selectedCategory = null;\r\n vm.categoryResources = null;\r\n vm.userCanAddCategory = true;\r\n vm.languages = [];\r\n vm.languageIndex = 0;\r\n vm.searchText = '';\r\n vm.showButtons = true;\r\n vm.dragEnabled = false;\r\n vm.sortMode = true;\r\n vm.sortList = ['Display Order','Viewed','Favorited','Liked','Disliked'];\r\n vm.sortBy = 0;\r\n\r\n vm.categoriesOptions = {\r\n accept: function (src, dest, destIndex) {\r\n if (typeof src.category === \"undefined\") {\r\n return false;\r\n }\r\n return true;\r\n },\r\n dropped: function (event) {\r\n if (event.source && event.source.nodeScope) {\r\n var category = event.source.nodeScope.$modelValue;\r\n category.SortOrder = event.dest.index;\r\n ResourceLibraryService.updateLibraryTile(category);\r\n }\r\n }\r\n };\r\n \r\n vm.resourceOptions = {\r\n accept: function (src, dest, destIndex) {\r\n if (typeof src.category !== \"undefined\") {\r\n return false;\r\n }\r\n return true;\r\n },\r\n dropped: function (event) {\r\n if (!vm.sortMode) return;\r\n if (event.source && event.source.nodeScope) {\r\n var resource = event.source.nodeScope.$modelValue;\r\n resource.SortOrder = event.dest.index;\r\n // set sort order for all resources on this tile\r\n vm.categoryResources.forEach((item,index)=>{\r\n item.SortOrder = index;\r\n })\r\n // update all resource sort orders\r\n ResourceLibraryService.updateResourceSortOrders(vm.selectedCategory.LibraryCategoryId, vm.categoryResources);\r\n\r\n }\r\n }\r\n };\r\n \r\n ResourceLibraryService.getLanguages().then(function (data) {\r\n vm.languages = data;\r\n vm.selectedLanguage = vm.languages[0];\r\n\r\n ResourceLibraryService.getLibraryTiles(groupId).then(function (data) {\r\n angular.forEach(data, function (val) {\r\n val = preProcessCategory(val);\r\n vm.categories.push(val);\r\n });\r\n\r\n if (libraryCategoryId) {\r\n libraryCategoryId = parseInt(libraryCategoryId);\r\n var category = lodash.find(vm.categories, function(o) {\r\n return o.LibraryCategoryId === libraryCategoryId;\r\n });\r\n if (category) vm.selectCategory(category);\r\n }\r\n });\r\n });\r\n }\r\n\r\n function showCategoryEditor(evt, category) {\r\n if (evt) evt.cancelBubble = true;\r\n if (!category) category = null;\r\n\r\n var dlg = $uibModal.open({\r\n templateUrl: 'modules/content/resource_library/category_editor/editcategory.modal.html',\r\n controller: 'EditCategoryModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n categories: function() { return vm.categories },\r\n category: function () {\r\n return category;\r\n },\r\n languages: function () { return vm.languages },\r\n languageIndex: function () {\r\n if (null == category) return 0;\r\n return vm.languageIndex;\r\n }\r\n }\r\n });\r\n dlg.result.then(function (result) {\r\n if (!result) return;\r\n for (var x = 0; x < vm.categories.length; x++) {\r\n var t = vm.categories[x];\r\n if (result.LibraryCategoryId === t.LibraryCategoryId) {\r\n vm.categories[x] = preProcessCategory(result);\r\n vm.selectedCategory = vm.categories[x];\r\n return;\r\n }\r\n }\r\n vm.categories.push(preProcessCategory(result));\r\n });\r\n }\r\n\r\n function selectCategory(category) {\r\n vm.rules = [];\r\n vm.selectedCategory = category;\r\n vm.categoryResources = null;\r\n if (null == vm.selectedCategory) return;\r\n ResourceLibraryService.getTileResources(vm.selectedCategory.LibraryCategoryId, vm.selectedLanguage.LanguageId).then(function (data) {\r\n if (data && data.length > 0) {\r\n for (var x = 0; x < data.length; x++) {\r\n var item = data[x];\r\n item.Viewed = item.Counts.Viewed;\r\n item.Favorite = item.Counts.Favorite;\r\n item.ThumbsUp = item.Counts.ThumbsUp;\r\n item.ThumbsDown = item.Counts.ThumbsDown;\r\n }\r\n }\r\n vm.categoryResources = data;\r\n \r\n ResourceLibraryService.getRules(vm.selectedCategory.LibraryCategoryId)\r\n .then(rules => vm.rules = rules);\r\n });\r\n }\r\n\r\n vm.getRuleName = function (rule) {\r\n if (rule.Name) {\r\n return $sce.trustAsHtml(rule.Name);\r\n } else {\r\n return $sce.trustAsHtml('(' + rule.RuleId + ') ' + rule.Display);\r\n }\r\n }\r\n \r\n function addHealthTip() {\r\n if (null == vm.selectedCategory) return;\r\n $state.go(\"content.library.tile.healthtips\", { CategoryId: vm.selectedCategory.LibraryCategoryId });\r\n }\r\n\r\n function addVideo() {\r\n if (null == vm.selectedCategory) return;\r\n $state.go(\"content.library.tile.videos\", { CategoryId: vm.selectedCategory.LibraryCategoryId });\r\n }\r\n\r\n function deleteCategory(category) {\r\n selectCategory(category);\r\n\r\n if (null == vm.selectedCategory) return;\r\n\r\n if (null != vm.categoryResources && vm.categoryResources.length > 0) {\r\n vhSweetAlert.error(\"Cannot delete tile\", 'Tile ' + vm.selectedCategory.MultilingualText[vm.languageIndex].Text + ' is not empty. To delete it, first delete all resources in this tile.');\r\n return;\r\n }\r\n\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete the ' + vm.selectedCategory.MultilingualText[vm.languageIndex].Text + ' tile?', 'Delete')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n ResourceLibraryService.deleteLibraryTile(vm.selectedCategory.LibraryCategoryId).then(function () {\r\n var idx = vm.categories.indexOf(vm.selectedCategory);\r\n vm.categories.splice(idx, 1);\r\n vm.selectedCategory = null;\r\n $state.go(\"content.library\");\r\n });\r\n }\r\n });\r\n }\r\n\r\n function deleteCategoryResource(resource) {\r\n if (vm.selectedCategory.IsPublished) {\r\n vhSweetAlert.error(\"Cannot delete Resource\", 'This Tile has been published. You must un-published first before you can delete resources.');\r\n return;\r\n }\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this resource from the tile?', 'Delete')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n ResourceLibraryService.deleteTileResource(vm.selectedCategory.LibraryCategoryId, resource.Type, resource.ResourceId).then(function () {\r\n var idx = vm.categoryResources.indexOf(resource);\r\n vm.categoryResources.splice(idx, 1);\r\n if (resource.Type === 1) {\r\n vm.selectedCategory.HealthTipCount -= 1;\r\n } else {\r\n vm.selectedCategory.VideoCount -= 1;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n function selectLanguage(item, index) {\r\n vm.languageIndex = index;\r\n vm.selectedLanguage = item;\r\n if (null == vm.selectedCategory) return;\r\n ResourceLibraryService.getTileResources(vm.selectedCategory.LibraryCategoryId, vm.selectedLanguage.LanguageId).then(function (data) {\r\n vm.categoryResources = data;\r\n });\r\n }\r\n \r\n function preProcessCategory(category) {\r\n // make sure we have all supported languages,\r\n // and that they are in the correct order...\r\n var multilingualText = new Array(vm.languages.length);\r\n for (var x = 0; x < vm.languages.length; x++) {\r\n var t = find(category.MultilingualText, vm.languages[x]);\r\n if (null !== t) {\r\n multilingualText[x] = t;\r\n } else {\r\n multilingualText[x] = {\r\n \"CategoryTextId\": 0,\r\n \"LanguageId\": vm.languages[x].LanguageId,\r\n \"Text\": null\r\n };\r\n }\r\n }\r\n category.MultilingualText = multilingualText;\r\n\r\n if (category.Icon.length === 0) {\r\n category.Icon = \"fa fa-folder\";\r\n }\r\n return category;\r\n }\r\n\r\n function find(mTexts, lang) {\r\n for (var x = 0; x < mTexts.length; x++) {\r\n var t = mTexts[x];\r\n if (t.LanguageId === lang.LanguageId) return t;\r\n }\r\n return null;\r\n }\r\n\r\n function getLanguageIndex(mTexts) {\r\n for (var x = 0; x < mTexts.length; x++) {\r\n var t = mTexts[x];\r\n if (t.LanguageId === vm.selectedLanguage.LanguageId)\r\n return x;\r\n }\r\n return null;\r\n }\r\n\r\n function performSearch() {\r\n if (vm.searchText.length > 0) {\r\n vm.selectedCategory = null;\r\n vm.categories = null;\r\n ResourceLibraryService.searchLibrary(vm.searchText).then(function(data) {\r\n vm.activeSearch = true;\r\n vm.categories = data;\r\n });\r\n } else {\r\n clearSearch();\r\n }\r\n }\r\n\r\n function clearSearch() {\r\n vm.activeSearch = false;\r\n vm.searchText = '';\r\n vm.selectedCategory = null;\r\n loadController();\r\n }\r\n \r\n function togglePublish(evt, category) {\r\n if (evt) evt.cancelBubble = true;\r\n if (!category) return;\r\n\r\n if (0 === (category.VideoCount + category.HealthTipCount)) {\r\n vhSweetAlert.error(\"Empty Library\", \"Unable to publish an empty tile.\");\r\n return;\r\n }\r\n\r\n var postItem = angular.copy(category);\r\n postItem.IsPublished = !postItem.IsPublished;\r\n ResourceLibraryService.publishLibraryTile(postItem).then(function () {\r\n category.IsPublished = !category.IsPublished;\r\n });\r\n }\r\n\r\n function sortResources(sortIndex) {\r\n vm.sortMode = false;\r\n vm.sortBy = sortIndex;\r\n switch (vm.sortBy) {\r\n case 0:\r\n vm.sortMode = true;\r\n vm.categoryResources = lodash.sortBy(vm.categoryResources, \"SortOrder\");\r\n break;\r\n case 1:\r\n var temp = lodash.sortBy(vm.categoryResources, \"Viewed\"); \r\n vm.categoryResources = temp.reverse();\r\n break;\r\n case 2:\r\n var temp = lodash.sortBy(vm.categoryResources, \"Favorite\");\r\n vm.categoryResources = temp.reverse();\r\n break;\r\n case 3:\r\n var temp = lodash.sortBy(vm.categoryResources, \"ThumbsUp\");\r\n vm.categoryResources = temp.reverse();\r\n break;\r\n case 4:\r\n var temp = lodash.sortBy(vm.categoryResources, \"ThumbsDown\");\r\n vm.categoryResources = temp.reverse();\r\n break;\r\n }\r\n }\r\n\r\n function _extractFileName(headerContentDisposition) {\r\n var filename = \"\";\r\n var disposition = headerContentDisposition;\r\n if (disposition && disposition.indexOf('attachment') !== -1) {\r\n var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\r\n var matches = filenameRegex.exec(disposition);\r\n if (matches != null && matches[1]) { \r\n filename = matches[1].replace(/['\"]/g, '');\r\n }\r\n }\r\n return filename;\r\n }\r\n\r\n function _export(category){\r\n\r\n \r\n var ids = category != null ? [category.ResourceLibraryCategoryUId] : vm.itemsSelected.map(function (x) {\r\n return x.LibraryCategoryId;\r\n });\r\n\r\n if(ids.length == 0)\r\n return;\r\n\r\n $http.post('/api/export/librarytiles', JSON.stringify(ids), { responseType: 'arraybuffer' })\r\n .then(function successCallback(response) {\r\n var headersFn = response.headers;\r\n var headers = headersFn();\r\n var data = response.data;\r\n \r\n var filename = _extractFileName(headers['content-disposition']);\r\n var contentType = headers['content-type'];\r\n \r\n var a = document.createElement('a');\r\n try {\r\n var blob = new Blob([data], { type: contentType });\r\n var url = window.URL.createObjectURL(blob);\r\n \r\n vhSweetAlert.success('Exported', `Successfully exported ${(vm.itemsSelected || []).length} library tile${(vm.itemsSelected || []).length < 2 ? '' : 's'}.`);\r\n\r\n a.setAttribute('href', url);\r\n a.setAttribute(\"download\", filename);\r\n a.click(); \r\n\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n }, function errorCallback(error) {\r\n console.log('Something went wrong!!!')\r\n });\r\n \r\n }\r\n\r\n function _toggle($event, category){\r\n \r\n $event.stopPropagation();\r\n\r\n if(_isSelected(category)){\r\n vm.itemsSelected = vm.itemsSelected.filter(x => x.LibraryCategoryId != category.LibraryCategoryId);\r\n } else {\r\n vm.itemsSelected.push(category);\r\n }\r\n\r\n }\r\n\r\n function _isSelected(category){\r\n return vm.itemsSelected.find(x => x.LibraryCategoryId == category.LibraryCategoryId) != null;\r\n }\r\n \r\n function _selectToggle(){\r\n \r\n if(vm.itemsSelected.length > 0)\r\n {\r\n vm.itemsSelected = [];\r\n }\r\n else\r\n {\r\n ResourceLibraryService.getLibraryTiles().then(allData => {\r\n var data = allData;\r\n\r\n if((vm.searchText || '').length > 0){\r\n data = data.filter(category => category.Name.toLowerCase().indexOf(vm.searchText.toLowerCase()) > -1);\r\n }\r\n\r\n vm.itemsSelected = data;\r\n });\r\n \r\n }\r\n }\r\n\r\n function _getLibraryTiles() {\r\n\r\n ResourceLibraryService.getLibraryTiles(groupId).then(function (data) {\r\n vm.categories = [];\r\n angular.forEach(data, function (val) {\r\n val = preProcessCategory(val);\r\n vm.categories.push(val);\r\n });\r\n });\r\n }\r\n}\r\nangular.module('content.library').controller(\"ResourceLibraryController\", ResourceLibraryController);\r\n\r\n","function ResourceLibraryService(repository, ResourceLibraryRepository, PopulationsRepository, PendingService, NavigationService, $http) {\r\n var languageRepo = repository.new(\"PatientLanguage\");\r\n var categoriesRepo = repository.new(\"ResourceLibrary/tiles\");\r\n var ResourceLibraryRepository = ResourceLibraryRepository;\r\n\r\n function getValidationData(){\r\n\r\n return $http.get('/api/import/validation/tile').then((result)=>{\r\n return result.data;\r\n });\r\n }\r\n\r\n function getLanguages() {\r\n return languageRepo.getList().then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function getLibraryTiles(groupId) {\r\n var promise;\r\n \r\n if (groupId) {\r\n promise = $http.get('/api/ResourceLibrary/groups/' + groupId);\r\n } else {\r\n promise = PendingService.promise('getLibraryTiles', () => categoriesRepo.get());\r\n }\r\n\r\n return promise.then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function getLibraryTile(libraryCategoryId) {\r\n return categoriesRepo.get(libraryCategoryId).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function getLibraryServices() {\r\n return $http.get(`/api/ResourceLibrary/servicelevel`).then(result => result.data);\r\n }\r\n \r\n function getRules(libraryCategoryId) {\r\n return $http.get(`/api/ResourceLibrary/tiles/${libraryCategoryId}/Rules`).then(result => result.data);\r\n }\r\n \r\n function searchLibrary(filter) {\r\n var searchRepo = repository.new(\"ResourceLibrary/tiles/search\");\r\n return searchRepo.create('\"' + filter + '\"').then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function createLibraryTile(libraryTile) {\r\n return categoriesRepo.create(libraryTile).then(function(result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function updateLibraryTile(libraryTile) {\r\n return categoriesRepo.update(libraryTile.LibraryCategoryId, libraryTile).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function deleteLibraryTile(libraryCategoryId) {\r\n return categoriesRepo.remove(libraryCategoryId).then(function (result) {\r\n NavigationService.refreshResourceLibraryGroups();\r\n return result.data;\r\n });\r\n }\r\n\r\n function publishLibraryTile(libraryTile) {\r\n var url = libraryTile.IsPublished ? \"ResourceLibrary/tiles/publish\" : \"ResourceLibrary/tiles/unpublish\";\r\n var publishRepo = repository.new(url);\r\n return publishRepo.update(libraryTile.LibraryCategoryId).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function getLibraryResources(searchText, pageNumber, pageSize, resourceType, languageId) {\r\n var repo = repository.new(\"ResourceLibrary/\" + resourceType + \"/\" + languageId);\r\n var postData = {\r\n FilterBy: searchText,\r\n PageNumber: pageNumber,\r\n PageSize: pageSize\r\n };\r\n return repo.create(postData).then(function(result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function getTileResources(libraryCategoryId, languageId) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/resources\";\r\n var repo = repository.new(url);\r\n return repo.get(languageId).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function updateTileResources(libraryCategoryId, resources) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/resources\";\r\n var repo = repository.new(url);\r\n return repo.create(resources).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function deleteTileResource(libraryCategoryId, type, resourceId) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/resources/\" + type;\r\n var repo = repository.new(url);\r\n return repo.remove(resourceId).then(function(result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function deleteThumbnail(resourceId, type, languageId) {\r\n return ResourceLibraryRepository.deleteThumbnail(resourceId, type, languageId);\r\n }\r\n\r\n function getPopulations(options) {\r\n var params = Object.assign({ enabledOnly: true, includeAllPatients: true }, options);\r\n return PopulationsRepository.getAll(params);\r\n }\r\n\r\n function getTilePopulations(libraryCategoryId, enabledOnly) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/populations\";\r\n url += enabledOnly !== null ||enabledOnly !== undefined ? `/${enabledOnly}` : '';\r\n var repo = repository.new(url);\r\n return repo.getList().then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function getTileServices(libraryCategoryId) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/services\";\r\n var repo = repository.new(url);\r\n return repo.getList().then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n function updateTileServices(libraryCategoryId, tileServices) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/services\";\r\n var repo = repository.new(url);\r\n return repo.create(tileServices).then(function (result) {\r\n NavigationService.refreshResourceLibraryGroups();\r\n return result.data;\r\n });\r\n }\r\n function updateTilePopulations(libraryCategoryId, tilePopulations) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/populations\";\r\n var repo = repository.new(url);\r\n return repo.create(tilePopulations).then(function (result) {\r\n NavigationService.refreshResourceLibraryGroups();\r\n return result.data;\r\n });\r\n }\r\n\r\n function uploadImage(resourceType, resourceId, imgType, languageId, imgBytes) {\r\n var url = \"media/thumbnails/\" + resourceType + \"/\" + resourceId + \"/\" + imgType + \"/\" + languageId;\r\n var imgRepo = repository.new(url);\r\n\r\n var config = { headers: { \"Content-Type\": \"application/octet-stream\" } };\r\n return imgRepo.create(imgBytes, config).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n function deleteTempFile(filename) {\r\n if (null === filename) return null;\r\n\r\n var url = \"media/custom/TempUpload/\" + filename;\r\n var imgRepo = repository.new(url);\r\n return imgRepo.remove().then(function (response) {\r\n return response;\r\n });\r\n }\r\n\r\n function updateResourceImage(resourceImage) {\r\n var url = \"ResourceLibrary/thumbnails/\";\r\n var repo = repository.new(url);\r\n return repo.create(resourceImage).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function getResourceThumbnailImages(resourceId, resourceType) {\r\n var url = \"ResourceLibrary/thumbnails/\" + resourceId;\r\n var repo = repository.new(url);\r\n return repo.get(resourceType).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function updateResourceSortOrder(libraryCategoryId, resource) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/resources/sortorder\";\r\n var repo = repository.new(url);\r\n return repo.create(resource).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n // updates multiple resource sort orders\r\n function updateResourceSortOrders(libraryCategoryId, resources) {\r\n var url = \"ResourceLibrary/tiles/\" + libraryCategoryId + \"/resources/sortorders\";\r\n var repo = repository.new(url);\r\n return repo.create(resources).then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n function importResourceLibraryCategories(categories) {\r\n return ResourceLibraryRepository\r\n .importResourceLibraryCategories(categories)\r\n .then(data => {\r\n NavigationService.refreshResourceLibraryGroups();\r\n return data;\r\n });\r\n }\r\n\r\n return {\r\n getLanguages: getLanguages,\r\n getLibraryTiles: getLibraryTiles,\r\n getLibraryTile: getLibraryTile,\r\n createLibraryTile: createLibraryTile,\r\n updateLibraryTile: updateLibraryTile,\r\n publishLibraryTile: publishLibraryTile,\r\n deleteLibraryTile: deleteLibraryTile,\r\n deleteTileResource: deleteTileResource,\r\n getLibraryResources: getLibraryResources,\r\n getTileResources: getTileResources,\r\n getLibraryServices: getLibraryServices,\r\n\r\n \r\n updateTileResources: updateTileResources,\r\n searchLibrary: searchLibrary,\r\n getPopulations: getPopulations,\r\n getTilePopulations: getTilePopulations,\r\n getTileServices: getTileServices,\r\n updateTileServices:updateTileServices,\r\n updateTilePopulations: updateTilePopulations,\r\n uploadImage: uploadImage,\r\n deleteTempFile: deleteTempFile,\r\n updateResourceImage: updateResourceImage,\r\n getResourceThumbnailImages: getResourceThumbnailImages,\r\n updateResourceSortOrder: updateResourceSortOrder,\r\n updateResourceSortOrders: updateResourceSortOrders,\r\n deleteThumbnail: deleteThumbnail,\r\n importResourceLibraryCategories: importResourceLibraryCategories,\r\n getValidationData: getValidationData,\r\n getRules: getRules\r\n };\r\n}\r\nangular.module(\"content.library\").factory(\"ResourceLibraryService\", ResourceLibraryService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/resource_library/resource.library.tpl.html',\n '

        Resource Library

        1. {{vm.categories.length}} Tiles for {{vm.libraryGroupName}} {{vm.categories.length}} Tiles matching “{{vm.searchText}}”
        Library Tiles

        No Tiles

        0 || vm.activeSearch\">

        No results returned

        0\">
        1. {{category.MultilingualText.length > 0 ? category.MultilingualText[0].Text : \\'missing title\\'}}
          health tips: {{category.HealthTipCount}}    videos: {{category.VideoCount}} Published:
        ');\n}]);\n}(window, document, window.angular));","function TileResourcesDirective() {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n vm: '=viewModel'\r\n },\r\n templateUrl: \"modules/content/resource_library/tile.resources.tpl.html\",\r\n link: function(scope, elem, attr) {\r\n\r\n },\r\n controller: ($scope)=> {\r\n\r\n }\r\n };\r\n}\r\nangular.module(\"content.library\").directive(\"tileResources\", TileResourcesDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/content/resource_library/tile.resources.tpl.html',\n '
        {{vm.selectedCategory.MultilingualText[vm.languageIndex].Text || \\'Tile Resources\\'}}
        Sort:
        1. {{item.Name}}

        No resources exist for this Tile

        0\">
        1. {{item.SortOrder}}
          Time to Read: {{item.Duration}} Duration: {{item.Duration}}
           {{item.Counts.Viewed || 0}}
           {{item.Counts.Favorite || 0}}
           {{item.Counts.ThumbsUp || 0}}
           {{item.Counts.ThumbsDown || 0}}
        Used In {{vm.rules.length}} Rule{{vm.rules.length == 1 ? \\'\\' : \\'s\\'}}
        ');\n}]);\n}(window, document, window.angular));","function DashboardController(biReport, PermissionService, BIService, $scope, $http, $window) {\r\n\r\n //Private\r\n var hasModerateWrite = PermissionService.userHasPermission([\"SecurityAccessLevelModerateWrite\"]);\r\n var hasAdvancedWrite = PermissionService.userHasPermission([\"SecurityAccessLevelAdvancedWrite\"]);\r\n\r\n //Public \r\n var dashboardCtrl = this;\r\n\r\n dashboardCtrl.report = biReport;\r\n dashboardCtrl.executionStatusText = \"Initializing...\";\r\n dashboardCtrl.cachedHtml = \"\";\r\n\r\n dashboardCtrl.hasMissingReportPath = hasMissingReportPath;\r\n\r\n dashboardCtrl.DisplayRunBtn = DisplayRunBtn;\r\n dashboardCtrl.DisplayExportBtn = DisplayExportBtn;\r\n dashboardCtrl.DisplayCreateBtn = DisplayCreateBtn;\r\n dashboardCtrl.DisplayEditBtn = DisplayEditBtn;\r\n dashboardCtrl.DisplayScheduleBtn = DisplayScheduleBtn;\r\n dashboardCtrl.DisplayViewSchedulesBtn = DisplayViewSchedulesBtn;\r\n dashboardCtrl.DisplayFullUIBtn = DisplayFullUIBtn;\r\n dashboardCtrl.DisplayRefreshBtn = DisplayRefreshBtn;\r\n\r\n dashboardCtrl.RunBtnClicked = RunBtnClicked;\r\n dashboardCtrl.ExportBtnClicked = ExportBtnClicked;\r\n dashboardCtrl.CreateBtnClicked = CreateBtnClicked;\r\n dashboardCtrl.EditBtnClicked = EditBtnClicked;\r\n dashboardCtrl.ScheduleBtnClicked = ScheduleBtnClicked;\r\n dashboardCtrl.ViewSchedulesBtnClicked = ViewSchedulesBtnClicked;\r\n dashboardCtrl.FullUIBtnClicked = FullUIBtnClicked;\r\n dashboardCtrl.RefreshBtnClicked = RefreshBtnClicked;\r\n\r\n dashboardCtrl.isReportRunning = false;\r\n dashboardCtrl.lastRunDate = null;\r\n dashboardCtrl.excelOnlyReportGuid = null;\r\n dashboardCtrl.executionStatusEnum = BIService.executionStatusEnum;\r\n dashboardCtrl.executionStatus = dashboardCtrl.executionStatusEnum.Unknown;\r\n dashboardCtrl.errorMessage = null;\r\n dashboardCtrl.exportExcelOnlyReport = exportExcelOnlyReport;\r\n\r\n\r\n dashboardCtrl.StatusChanged = StatusChanged;\r\n\r\n if (biReport.cachedReport) {\r\n if (biReport.cachedReport.timeStamp) {\r\n dashboardCtrl.executionStatusText = formatLastUpdatedDate(biReport.cachedReport.timeStamp);\r\n }\r\n\r\n if (biReport.cachedReport.content) {\r\n dashboardCtrl.cachedHtml = biReport.cachedReport.content;\r\n }\r\n }\r\n \r\n function hasMissingReportPath() {\r\n return !dashboardCtrl.report || !dashboardCtrl.report.ExagoFullPath;;\r\n }\r\n\r\n function DisplayRunBtn() {\r\n return hasAdvancedWrite;\r\n }\r\n\r\n function DisplayExportBtn() {\r\n return hasAdvancedWrite;\r\n }\r\n\r\n function DisplayCreateBtn() {\r\n return hasAdvancedWrite;\r\n }\r\n\r\n function DisplayEditBtn() {\r\n return hasAdvancedWrite;\r\n }\r\n\r\n function DisplayScheduleBtn() {\r\n return hasAdvancedWrite;\r\n }\r\n\r\n function DisplayViewSchedulesBtn() {\r\n return hasAdvancedWrite;\r\n }\r\n\r\n function DisplayFullUIBtn() {\r\n return hasAdvancedWrite;\r\n }\r\n\r\n function DisplayRefreshBtn() {\r\n return true;\r\n }\r\n\r\n function RunBtnClicked() {\r\n $scope.$broadcast(\"biExecuteReport\");\r\n }\r\n\r\n function ExportBtnClicked(exportFormat) {\r\n $scope.$broadcast(\"biExecuteReport\", exportFormat);\r\n }\r\n\r\n function CreateBtnClicked() {\r\n $scope.$broadcast(\"biCreateReport\");\r\n }\r\n\r\n function EditBtnClicked() {\r\n $scope.$broadcast(\"biEditReport\");\r\n }\r\n\r\n function ScheduleBtnClicked() {\r\n $scope.$broadcast(\"biScheduleReport\");\r\n }\r\n\r\n function ViewSchedulesBtnClicked() {\r\n $scope.$broadcast(\"biViewSchedules\");\r\n }\r\n\r\n function FullUIBtnClicked() {\r\n $scope.$broadcast(\"biLoadFullUI\");\r\n }\r\n\r\n function RefreshBtnClicked() {\r\n $scope.$broadcast(\"biRefreshReport\");\r\n }\r\n\r\n function StatusChanged(container, executionStatusEnum) {\r\n switch (executionStatusEnum) {\r\n case BIService.executionStatusEnum.Unknown:\r\n {\r\n dashboardCtrl.executionStatusText = \"Progress Unknown...\";\r\n break;\r\n }\r\n case BIService.executionStatusEnum.Initializing:\r\n {\r\n dashboardCtrl.executionStatusText = \"Initializing...\";\r\n break;\r\n }\r\n case BIService.executionStatusEnum.Refreshing:\r\n {\r\n dashboardCtrl.executionStatusText = \"Refreshing...\";\r\n break;\r\n }\r\n case BIService.executionStatusEnum.Executing:\r\n {\r\n dashboardCtrl.executionStatusText = \"Executing...\";\r\n break;\r\n }\r\n case BIService.executionStatusEnum.Starting:\r\n {\r\n dashboardCtrl.executionStatusText = \"Starting...\";\r\n\r\n break;\r\n }\r\n case BIService.executionStatusEnum.Visualizing:\r\n {\r\n dashboardCtrl.executionStatusText = \"Visualizing...\";\r\n break;\r\n }\r\n case BIService.executionStatusEnum.Complete:\r\n {\r\n dashboardCtrl.executionStatusText = \"Last Updated \" + formatLastUpdatedDate(new Date());\r\n if (biReport && biReport.ExagoFullPath && container && container.lastChild && container.lastChild.outerHTML) {\r\n BIService.setCachedReportContent(biReport.ExagoFullPath, container.lastChild.outerHTML);\r\n }\r\n break;\r\n }\r\n case BIService.executionStatusEnum.Error:\r\n {\r\n dashboardCtrl.executionStatusText = \"Error...\";\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function formatLastUpdatedDate(lastupdated) {\r\n var options = { dateStyle: 'short', timeStyle: 'short' };\r\n return lastupdated.toLocaleString(undefined, options);\r\n }\r\n\r\n\r\n function exportExcelOnlyReport(displayName) {\r\n BIService.getReportByDisplayName(displayName).then(function (report) {\r\n reportExecRequest = {};\r\n reportExecRequest.ReportTypeId = report.data.LegacyReport.ReportTypeId;\r\n reportExecRequest.ReportActionType = \"Export\";\r\n reportExecRequest.ReportParams = \"{}\";\r\n return BIService.createReportRequest(reportExecRequest).then(function (data) {\r\n dashboardCtrl.excelOnlyReportGuid = data;\r\n dashboardCtrl.isReportRunning = true;\r\n handleReportRunning(report.reportTypeId);\r\n return data;\r\n });\r\n });\r\n }\r\n\r\n function getReportExtendedStatus(reportGuid) {\r\n return BIService.getExtendedReportStatus(reportGuid).then(function (data) {\r\n return data;\r\n });\r\n }\r\n\r\n function handleReportRunning(reportTypeId) {\r\n getReportExtendedStatus(dashboardCtrl.excelOnlyReportGuid).then(function (data) {\r\n if (data.Status === 0) {\r\n var t = setTimeout(function () {\r\n handleReportRunning(reportTypeId);\r\n }, 5000);\r\n } else if (data.Status == -99) {\r\n dashboardCtrl.isReportRunning = false;\r\n dashboardCtrl.executionStatus = dashboardCtrl.executionStatusEnum.TooManyRecords;\r\n dashboardCtrl.errorMessage = data.ErrorMessage;\r\n\r\n } else if (data.Status < 0) {\r\n dashboardCtrl.isReportRunning = false;\r\n dashboardCtrl.executionStatus = dashboardCtrl.executionStatusEnum.Error;\r\n } else if (data.Status === 1) {\r\n dashboardCtrl.isReportRunning = false;\r\n dashboardCtrl.lastRunDate = data.CreatedDateTime_UTC;\r\n exportReport(dashboardCtrl.excelOnlyReportGuid);\r\n }\r\n });\r\n }\r\n var file = null;\r\n\r\n function exportReport(reportGuid) {\r\n $http({\r\n url: \"/api/report/ExportToExcel?reportId=\" + reportGuid,\r\n method: \"GET\",\r\n responseType: 'arraybuffer'\r\n }).then(function ({data, status, headers, config}) {\r\n\r\n if (file !== null) {\r\n $window.URL.revokeObjectURL(file);\r\n }\r\n\r\n file = new Blob([data]);\r\n\r\n var fileName = headers('Content-Disposition').split('=')[1];\r\n\r\n if ($window.navigator.msSaveBlob) {\r\n $window.navigator.msSaveBlob(file, fileName);\r\n }\r\n else {\r\n var a = document.createElement('a');\r\n a.href = $window.URL.createObjectURL(file);\r\n a.target = '_blank';\r\n a.download = fileName;\r\n a.click();\r\n }\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module(\"dashboards\").controller(\"DashboardController\", DashboardController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/dashboard/dashboard.tpl.html',\n '

        {{dashboardCtrl.report.DisplayName}}

        1. {{dashboardCtrl.executionStatusText}}
        ');\n}]);\n}(window, document, window.angular));","function SelectReportTypeController(reportTypes, $uibModalInstance) {\r\n var vm = this;\r\n\r\n vm.reportTypes = reportTypes;\r\n vm.reportType = \"\";\r\n vm.okEnabled = false;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n }\r\n\r\n vm.selectionChanged = function () {\r\n if (vm.reportType && vm.reportType.length > 0) {\r\n vm.okEnabled = true;\r\n }\r\n }\r\n\r\n vm.reportTypeSelected = function (isValid) {\r\n if (isValid) {\r\n $uibModalInstance.close(vm.reportType);\r\n }\r\n }\r\n\r\n vm.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\n\r\nangular.module('dashboards').controller('SelectReportTypeController', SelectReportTypeController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/dashboard/selectreportype.modal.html',\n '

        Report Type

        ');\n}]);\n}(window, document, window.angular));","function EventsController($rootScope, $scope, $transitions, $state, $window, Idle, KeepAliveRepository, IdleService, AuthorizationService, $uibModal, AnalyticsFactory, LocalStorageService, DirtyPage) {\r\n var logger = new AnalyticsFactory(\"Idle\");\r\n $scope.events = [];\r\n $scope.isAuthorized = undefined;\r\n\r\n initializeAuthorization();\r\n\r\n $rootScope.$watch('isAuthorized', function (newVal, oldVal) {\r\n $scope.isAuthorized = newVal;\r\n });\r\n\r\n $transitions.onStart({}, (trans) => {\r\n var toState = trans.to();\r\n \r\n /*if(toState.name === 'consume') {\r\n LocalStorageService.remove('vh-permissions');\r\n LocalStorageService.remove('vh-caregiver');\r\n LocalStorageService.remove('timeLogSession');\r\n }*/\r\n\r\n if (toState.name === 'login' || toState.name === 'consume') {\r\n if ($scope.isAuthorized === undefined) {\r\n initializeAuthorization(toState.name);\r\n }\r\n else if ($scope.isAuthorized === true) {\r\n AuthorizationService.redirectAfterLogin();\r\n }\r\n }\r\n });\r\n\r\n $scope.$on('IdleStart', function () {\r\n // the user appears to have gone idle\r\n AuthorizationService.isAuthorized().then(function (isAuthorized) {\r\n if (isAuthorized) {\r\n $scope.warning = $uibModal.open({\r\n templateUrl: 'modules/idle/idle.modal.html',\r\n windowClass: 'modal-danger'\r\n });\r\n }\r\n });\r\n });\r\n\r\n $scope.$on('IdleTimeout', function () {\r\n logger.log(\"autologged off\");\r\n\r\n AuthorizationService.logout().then(\r\n function (logoutUrl) {\r\n AuthorizationService.isAuthorized().then(\r\n function (isAuthorized) { \r\n // Disable the onbeforeunload function so the dialog doesn't pop up\r\n $window.onbeforeunload = function () { };\r\n DirtyPage.unregisterAllDirtyCheckers();\r\n\r\n closeModal();\r\n $rootScope.isAuthorized = isAuthorized;\r\n $state.go('login');\r\n Idle.unwatch();\r\n if(logoutUrl.length > 0) {\r\n $window.location.href = logoutUrl;\r\n }\r\n\r\n location.reload();\r\n },\r\n function (errorMessage) {\r\n location.reload();\r\n }\r\n );\r\n },\r\n function (errorMessage) {\r\n location.reload();\r\n }\r\n );\r\n // the user has timed out (meaning idleDuration + timeout has passed without any activity)\r\n // this is where you'd log them\r\n });\r\n\r\n $scope.$on('IdleEnd', function () {\r\n // the user has come back from AFK and is doing stuff. if you are warning them, you can use this to hide the dialog\r\n closeModal();\r\n });\r\n\r\n $scope.$on('Keepalive', function () {\r\n // do something to keep the user's session alive\r\n KeepAliveRepository.get();\r\n });\r\n\r\n $window.addEventListener('storage', function(evt) {\r\n if (evt.key === 'vh-siteId' && evt.newValue !== evt.oldValue) {\r\n // the user switched sites in a different tab\r\n $window.location.replace(\"/\");\r\n }\r\n });\r\n\r\n function closeModal() {\r\n if ($scope.warning) {\r\n $scope.warning.close();\r\n $scope.warning = null;\r\n }\r\n }\r\n\r\n function initializeAuthorization(state) {\r\n if ($scope.isAuthorized === undefined) {\r\n AuthorizationService.isAuthorized().then(function (isAuthorized) {\r\n $scope.isAuthorized = isAuthorized;\r\n $rootScope.isAuthorized = isAuthorized;\r\n if (isAuthorized) {\r\n IdleService.init();\r\n if (state === 'login' || state === 'consume') {\r\n AuthorizationService.redirectAfterLogin();\r\n }\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('idle').controller('EventsController', EventsController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/idle/idle.modal.html',\n '
        Session Timeout
        Your session is about to timeout. You\\'ll be logged out in {{countdown}} seconds.
        Move/click your mouse or press a key to stay logged in.
        ');\n}]);\n}(window, document, window.angular));","function IdleService(Idle, ConfigurationsService, Keepalive){\r\n\r\n function Init(){\r\n var keepAliveIntervalPercentage = 0.25;\r\n var warningTimeFromTimeout = 120;\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n // configure Idle settings\r\n var timeoutInSeconds = data.Timeout/1000;\r\n var keepAliveInterval = timeoutInSeconds * keepAliveIntervalPercentage;\r\n\r\n Idle.setIdle(timeoutInSeconds - warningTimeFromTimeout); // in seconds\r\n Idle.setTimeout(warningTimeFromTimeout); // in seconds\r\n Keepalive.setInterval(keepAliveInterval); // in seconds\r\n Idle.watch();\r\n });\r\n }\r\n\r\n function Stop() {\r\n Idle.unwatch();\r\n }\r\n\r\n return {\r\n init: Init,\r\n stop: Stop\r\n\r\n };\r\n}\r\n\r\nangular.module('idle').service('IdleService', IdleService);\r\n","\r\nfunction EditPhoneModalController($uibModalInstance, $scope, phoneNumber,email, vhSweetAlert) {\r\n\r\n $scope.phoneNumber = phoneNumber;\r\n $scope.email = email;\r\n\r\n $scope.ok = function() {\r\n if (!$scope.phoneNumberForm.$valid) return false;\r\n\r\n var changedPhone = phoneNumber != $scope.phoneNumber;\r\n var changedEmail = email != $scope.email;\r\n var removedPhone = changedPhone && (!$scope.phoneNumber || $scope.phoneNumber.length < 1);\r\n var removedEmail = changedEmail && (!$scope.email || $scope.email.length < 1);\r\n changedPhone = changedPhone && !removedPhone;\r\n changedEmail = changedEmail && !removedEmail;\r\n\r\n var Alertmessage = \"\";\r\n\r\n if (changedPhone || changedEmail) {\r\n Alertmessage = \"Are you sure you want to save this change and resend the invitation for this patient?\";\r\n } else if (removedPhone) {\r\n Alertmessage = \"Are you sure you want to delete the service level phone number for this patient?\";\r\n } else if (removedEmail) {\r\n Alertmessage = \"Are you sure you want to delete the email address for this patient?\";\r\n }\r\n\r\n vhSweetAlert\r\n .verify(\"Are you sure?\",Alertmessage, \"Yes\")\r\n .then(function(isConfirmed) {\r\n if (isConfirmed) {\r\n $scope.phoneNumberForm.$setSubmitted(true);\r\n $uibModalInstance.close({newNumber: $scope.phoneNumber, newEmail: $scope.email});\r\n }\r\n });\r\n };\r\n\r\n $scope.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n $scope.isValid = function() {\r\n return $scope.phoneNumberForm.Phone.$invalid || $scope.phoneNumberForm.email.$invalid || ((!$scope.email || $scope.email.length < 1) && (!$scope.phoneNumber || $scope.phoneNumber.length < 1 ));\r\n }\r\n \r\n $scope.emailPattern = (function () {\r\n var regexp = /^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/;\r\n return {\r\n test: function (value) {\r\n return regexp.test(value);\r\n }\r\n };\r\n })();\r\n}\r\n\r\nangular.module('invites').controller('EditPhoneModalController',EditPhoneModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/invites/editphone.modal.html',\n '

        Edit Mobile Number / Email Address

        Mobile number is invalid
        Either mobile number or email address is required
        Email address is invalid
        ');\n}]);\n}(window, document, window.angular));","function InvitesPatientRow(InvitationStatusEnum, InvitesService, vhSweetAlert, $q, $window, $timeout, PermissionService, uibDateParser, $state, $uibModal,ConfigurationsService) {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n \"invitePatient\": \"=\",\r\n \"usePinValidation\": \"=\"\r\n },\r\n templateUrl: \"modules/invites/invites_patient_row.tpl.html\",\r\n link: function (scope, element, attrs) {\r\n scope.MESSAGEDETAILPAGESIZE = 10;\r\n scope.active = false;\r\n scope.invitePatient.InvitationHistory = {};\r\n scope.invitePatient.InvitationHistoryPage = 1;\r\n scope.userCanEditInviteList = PermissionService.userHasPermission([\"InviteListWrite\"]);\r\n scope.dateFormat = ConfigurationsService.configParams.DateFormat;\r\n\r\n scope.GoAllowPasswords = false;\r\n scope.showPen = false;\r\n scope.showTooltip = false;\r\n\r\n ConfigurationsService.getConfig().then(function (data) {\r\n scope.HybridAppEnabled = data.HybridAppEnabled === true;\r\n scope.GoAllowPasswords = data.GoAllowPasswords === true;\r\n scope.showPinInPatientHeader = data.ShowPinInPatientHeader === true;\r\n });\r\n\r\n if (scope.usePinValidation || !scope.userCanEditInviteList) {\r\n scope.dobEditable = false;\r\n scope.isDobDateMin = scope.invitePatient.DateOfBirth === '0001-01-01T00:00:00Z';\r\n } else {\r\n scope.dobEditable = true;\r\n scope.isDobDateMin = false;\r\n }\r\n\r\n scope.actions = [\r\n {\r\n actionName: 'editPhone',\r\n actionIcon: 'fa-mobile',\r\n action: editPhone,\r\n actionText: 'Change Number'\r\n },\r\n {\r\n actionName: 'resendInvitation',\r\n action: resendInvitation,\r\n actionIcon: 'fa-arrow-right',\r\n actionText: 'Resend Invitation',\r\n\r\n },\r\n {\r\n actionName: 'patientProfile',\r\n action: gotoPatientProfile,\r\n actionIcon: 'fa-user',\r\n actionText: 'Patient Profile'\r\n }\r\n ];\r\n\r\n if (scope.dobEditable) {\r\n scope.actions.push({\r\n actionName: 'editDob',\r\n action: scope.dobForm.$show.bind(scope.dobForm),\r\n actionIcon: 'fa-calendar',\r\n actionText: 'Change DoB'\r\n });\r\n }\r\n\r\n scope.actions.push({\r\n actionName: 'viewInvitationDetail',\r\n action: viewDetail,\r\n actionIcon: 'fa-book',\r\n actionText: 'View History'\r\n });\r\n\r\n setPhoto();\r\n statusUpdated();\r\n scope.$watch(scope.invitePatient.InvitationStatus, statusUpdated);\r\n\r\n scope.invitePatient.DateOfBirth = uibDateParser.parse(scope.invitePatient.DateOfBirth, \"yyyy-MM-ddTHH:mm:ss'Z'\");\r\n\r\n scope.savedDOB = function (newValue) {\r\n if (newValue === scope.invitePatient.DateOfBirth) {\r\n return true;\r\n }\r\n var newDate = Date.parse(newValue);\r\n if (isNaN(newDate) || newDate > new Date() || newDate < new Date(1866, 0, 1, 0, 0, 0, 0)) {\r\n vhSweetAlert.error(\"Invalid Date\", \"The date you entered is invalid\");\r\n return false;\r\n } else {\r\n vhSweetAlert.verify(\"Are you sure?\", \"Are you sure you want to change the date of birth for this patient?\", \"Yes\")\r\n .then(function(isConfirmed) {\r\n if (isConfirmed) {\r\n var newDob = newValue.toISOString();\r\n InvitesService.saveDateOfBirth(scope.invitePatient.PatientId, newDob);\r\n if (scope.invitePatient.InvitationStatus === InvitationStatusEnum.DobValidationFailed) {\r\n scope.invitePatient.InvitationStatus = InvitationStatusEnum.Invited;\r\n statusUpdated();\r\n }\r\n }\r\n }\r\n );\r\n //Return false here. We don't want Xeditable setting value to what was entered\r\n return true;\r\n }\r\n };\r\n\r\n function validateEmail(email) {\r\n var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(email);\r\n }\r\n\r\n scope.passwordSet = function(){\r\n return scope.invitePatient.HasPatientPassword;\r\n };\r\n\r\n scope.showPin = function() {\r\n\r\n if(!scope.showPinInPatientHeader)\r\n return false;\r\n\r\n if(scope.GoAllowPasswords === false) {\r\n return true;\r\n }\r\n return !scope.invitePatient.HasPatientPassword;\r\n };\r\n\r\n scope.saveEmail = function(newValue){ \r\n\r\n var messages = {\r\n resend : \"Are you sure you want to change the email address and resend invitation for this patient?\",\r\n remove: \"Are you sure you want to remove the email address for this patient?\"\r\n };\r\n\r\n \r\n\r\n var emptyValue = newValue.length == 0;\r\n var isActive = scope.invitePatient.InvitationStatus == 5;\r\n\r\n if(emptyValue && !scope.invitePatient.PhoneNumber){\r\n vhSweetAlert.error(\"Unable to remove Email\", \"Patient must have either a phone number or email address listed.\");\r\n return false;\r\n }\r\n\r\n if (newValue === scope.invitePatient.Email) {\r\n return true;\r\n }\r\n\r\n if(emptyValue && scope.invitePatient.PhoneNumber.length == 0){\r\n vhSweetAlert.error(\"Invalid Email\", \"Email address and phone number cannot both be empty\");\r\n return false;\r\n }\r\n \r\n if(!emptyValue && !validateEmail(newValue)){\r\n vhSweetAlert.error(\"Invalid Email\", \"The email address you entered is invalid\");\r\n return false;\r\n }else{\r\n var confirmMessage = (emptyValue)? messages.remove : messages.resend;\r\n return vhSweetAlert.verify(\"Are you sure?\",confirmMessage , \"Yes\")\r\n .then(\r\n function(isConfirmed){\r\n if(isConfirmed){ \r\n InvitesService.saveEmail(scope.invitePatient.PatientId, newValue)\r\n .then(\r\n function(res){\r\n if(res.data.Success){\r\n //dont resend if email was removed\r\n if(!emptyValue){\r\n InvitesService.resendWelcomeMessage(scope.invitePatient.InvitationId);\r\n }\r\n return true;\r\n }else{\r\n vhSweetAlert.error(\"Update Failed\", \"Unable to update email\");\r\n return false;\r\n }\r\n });\r\n }else{\r\n return false;\r\n }\r\n });\r\n\r\n }\r\n };\r\n\r\n scope.picker = { opened: false };\r\n\r\n scope.openPicker = openPicker;\r\n function openPicker() {\r\n $timeout(function() {\r\n scope.picker.opened = true;\r\n });\r\n }\r\n\r\n scope.closePicker = closePicker;\r\n function closePicker() {\r\n scope.picker.opened = false;\r\n }\r\n\r\n scope.detailToggle = function () {\r\n scope.active = !scope.active;\r\n\r\n if (scope.active === true) {\r\n scope.populateMessageDetail();\r\n }\r\n };\r\n\r\n function viewDetail()\r\n {\r\n scope.active = true;\r\n scope.populateMessageDetail();\r\n }\r\n\r\n\r\n scope.populateMessageDetail = function() {\r\n InvitesService.getInviteMessageHistory(scope.MESSAGEDETAILPAGESIZE, scope.invitePatient.InvitationHistoryPage - 1, scope.invitePatient.PatientId).then(function(data) {\r\n scope.invitePatient.InvitationHistory = data.Response;\r\n scope.invitePatient.InvitationHistoryCount = data.TotalCount;\r\n })\r\n }\r\n\r\n scope.showHidePen = function(show) {\r\n scope.showPen = show;\r\n }\r\n\r\n scope.showHideTooltip = function(show) {\r\n scope.showTooltip = show;\r\n }\r\n\r\n scope.editPhone = editPhone;\r\n function editPhone() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/invites/editphone.modal.html',\r\n controller: 'EditPhoneModalController',\r\n backdrop: 'static',\r\n resolve: {\r\n phoneNumber: function () {\r\n return scope.invitePatient.PhoneNumber;\r\n },\r\n email: function(){\r\n return scope.invitePatient.Email;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (newValues) {\r\n let newNumber = newValues.newNumber;\r\n let newEmail = newValues.newEmail;\r\n InvitesService.savePhoneNumber(scope.invitePatient.PatientServiceLevelId, newNumber);\r\n InvitesService.saveEmail(scope.invitePatient.PatientId, newEmail)\r\n .then(\r\n function(res){\r\n if(res.data.Success){\r\n //dont resend if email was removed\r\n if(!emptyValue){\r\n InvitesService.resendWelcomeMessage(scope.invitePatient.InvitationId);\r\n }\r\n return true;\r\n }else{\r\n vhSweetAlert.error(\"Update Failed\", \"Unable to update email\");\r\n return false;\r\n }\r\n });\r\n statusUpdated();\r\n scope.invitePatient.PhoneNumber = newNumber;\r\n scope.invitePatient.Email = newEmail;\r\n },\r\n function () {\r\n // Cancelled\r\n });\r\n }\r\n\r\n function statusUpdated() {\r\n if (scope.invitePatient.InvitationStatus === InvitationStatusEnum.Invited) {\r\n scope.statusClass = \"label-info\";\r\n scope.statusIcon = \"fa-question-circle\";\r\n scope.statusText = \"Invited\";\r\n scope.currentAction = scope.actions[2];\r\n } else if (scope.invitePatient.InvitationStatus === InvitationStatusEnum.DobValidationFailed) {\r\n scope.statusClass = \"label-danger\";\r\n scope.statusIcon = \"fa-exclamation-circle\";\r\n if (scope.usePinValidation) {\r\n scope.statusText = \"Failed PIN Validation\";\r\n scope.currentAction = scope.actions[1];\r\n } else {\r\n scope.statusText = \"Failed DOB Validation\";\r\n scope.currentAction = scope.actions[3];\r\n }\r\n\r\n } else if (scope.invitePatient.InvitationStatus === InvitationStatusEnum.WrongPerson) {\r\n scope.statusClass = \"label-danger\";\r\n scope.statusIcon = \"fa-exclamation-circle\";\r\n scope.statusText = \"Wrong Person\";\r\n scope.currentAction = scope.actions[0];\r\n } else if (scope.invitePatient.InvitationStatus === InvitationStatusEnum.OptedOut) {\r\n scope.statusClass = \"label-warning\";\r\n scope.statusIcon = \"fa-exclamation-circle\";\r\n scope.statusText = \"Opted Out\";\r\n } else if (scope.invitePatient.InvitationStatus === InvitationStatusEnum.OptedIn) {\r\n scope.statusClass = \"label-success\";\r\n scope.statusIcon = \"fa-check\";\r\n scope.statusText = \"Opted In\";\r\n scope.currentAction = scope.actions[2];\r\n } else if (scope.invitePatient.InvitationStatus === InvitationStatusEnum.Expired) {\r\n scope.statusClass = \"label-danger\";\r\n scope.statusIcon = \"fa-exclamation-circle\";\r\n scope.statusText = \"No Response\";\r\n scope.currentAction = scope.actions[1];\r\n }\r\n }\r\n\r\n function setPhoto() {\r\n scope.patientImage = scope.invitePatient.Photo;\r\n\r\n if (scope.patientImage === undefined || scope.patientImage === null || scope.patientImage.length < 1) {\r\n if (scope.invitePatient.Gender === \"Female\") {\r\n scope.patientImage = \"layout/img/female.png\";\r\n } else {\r\n scope.patientImage = \"layout/img/male.png\";\r\n }\r\n } else {\r\n scope.patientImage = \"data:image/png;base64,\" + scope.invitePatient.Photo;\r\n }\r\n }\r\n\r\n function resendInvitation() {\r\n vhSweetAlert.verify(\"Are you sure?\", \"Are you sure you want to resend the welcome message?\", \"Yes\")\r\n .then(function(isConfirm){\r\n if (isConfirm) {\r\n InvitesService.resendWelcomeMessage(scope.invitePatient.InvitationId);\r\n\r\n scope.invitePatient.InvitationStatus = InvitationStatusEnum.Invited;\r\n statusUpdated();\r\n }\r\n }\r\n );\r\n }\r\n\r\n scope.gotoPatientProfile = gotoPatientProfile;\r\n function gotoPatientProfile () {\r\n $state.go('patients.patient.demographics', {patientId: scope.invitePatient.PatientId});\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"invites\").directive(\"invitesPatientRow\", InvitesPatientRow);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/invites/invites_patient_row.tpl.html',\n '
        \"image\"{{invitePatient.LastName}}, {{invitePatient.FirstName}} 
        0\">{{invitePatient.Gender}} | DoB: {{invitePatient.DateOfBirth | datetime}} N/A {{invitePatient.DateOfBirth | datetime}} 0 && usePinValidation) || (invitePatient.PIN.length > 0 && HybridAppEnabled)\">| PIN: {{invitePatient.PIN}} Password Set | Username: {{invitePatient.UserName}} Pending...
        {{invitePatient.HospitalName}} 0\">{{invitePatient.Population}} No Program 0\">| {{invitePatient.PopulationGroup}}
        Mobile: {{invitePatient.PhoneNumber | tel}} {{ (invitePatient.PhoneNumber || \\'No Number\\')}} {{invitePatient.PhoneNumber | tel}} | Email: {{ (invitePatient.Email || \\'No Email\\')}}
        {{statusText}}
        {{invitePatient.InvitationStatusDateTime_UTC | datetime : \"datetime\"}}
        {{currentAction.actionText}}

        Text/Email History

        DateTimeStatusAuthor
        {{historyEntry.CreatedDtUTC | datetime}}{{historyEntry.CreatedDtUTC | date: \"HH:mm\"}}{{historyEntry.History_Text}}{{historyEntry.CaregiverName}}
        MESSAGEDETAILPAGESIZE\">
          ');\n}]);\n}(window, document, window.angular));","function InvitesController(firstPageInvites, InvitesService,vhSweetAlert,lodash,webformfields) {\r\n var ivm = this;\r\n ivm.filterName = \"All Invites\";\r\n ivm.currentPage = 1;\r\n ivm.pageSize = 25;\r\n ivm.activeSearch = false;\r\n ivm.webformfields = webformfields;\r\n var formfields = {\r\n FirstName: 'First Name',\r\n LastName: 'Last Name',\r\n Phone: 'Phone Number',\r\n Email: 'Email',\r\n Status: 'Invitation Status',\r\n PopulationGroupId: 'Population Group',\r\n PopulationId: 'Population',\r\n HospitalId: 'Hospital',\r\n PayerId: 'Payer'\r\n };\r\n\r\n for (let field of ivm.webformfields) {\r\n if (formfields.hasOwnProperty(field.FieldName)) {\r\n formfields[field.FieldName] = field.FieldLabel;\r\n }\r\n }\r\n\r\n ivm.sortBy = 'CREATEDDATE'\r\n ivm.filterBy = 'all';\r\n \r\n ivm.searchText = '';\r\n ivm.recordType = 'Current';\r\n\r\n ivm.pageChanged = pageChanged;\r\n ivm.callSearch = callSearch;\r\n ivm.openSearchHelp = openSearchHelp;\r\n\r\n ivm.filterSearch = function(text) {\r\n var matchingSearches = lodash(formfields)\r\n .filter(field => field.toUpperCase().indexOf(text.toUpperCase()) >= 0 || text == '.')\r\n .map(field => field + ' = ')\r\n .value(); \r\n\r\n return matchingSearches;\r\n }\r\n ivm.searchTextKeypressed = function(keyEvent) {\r\n \r\n if(keyEvent.which === 13) //Enter key pressed\r\n {\r\n ivm.callSearch();\r\n }\r\n };\r\n \r\n ivm.switchFilter = function(filterBy) {\r\n ivm.currentPage = 1;\r\n ivm.filterBy = filterBy;\r\n\tivm.callSearch();\r\n }\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n inviteContentChanged(firstPageInvites);\r\n }\r\n function callSearch() {\r\n ivm.activeSearch = true;\r\n ivm.pageChanged();\r\n }\r\n \r\n\r\n function pageChanged() {\r\n \r\n var searchText = 'filter=' + ivm.filterBy;\r\n\r\n\r\n if (ivm.searchText) {\r\n if (ivm.searchText.indexOf('=') < 0) {\r\n searchText += ' & DEFAULT = ' + ivm.searchText;\r\n }\r\n else {\r\n searchText += ' & ' + ivm.searchText;\r\n }\r\n\r\n }\r\n \r\n InvitesService.getInvites(searchText,ivm.sortBy,ivm.pageSize, ivm.currentPage).then(inviteContentChanged);\r\n }\r\n\r\n ivm.clearSearch = function() {\r\n ivm.searchText = '';\r\n\tivm.fileterBy = 'all';\r\n\tivm.currentPage = 1;\r\n ivm.activeSearch = false;\r\n ivm.pageChanged();\r\n }\r\n\r\n var modalText = `\r\n
          \r\n
            \r\n
          • ${formfields.FirstName}
          • \r\n
          • ${formfields.LastName}
          • \r\n
          • ${formfields.Phone}
          • \r\n
          • ${formfields.Email}
          • \r\n
          • ${formfields.Status}
          • \r\n
          • ${formfields.PopulationGroupId}
          • \r\n
          • ${formfields.PopulationId}
          • \r\n
          • ${formfields.HospitalId}
          • \r\n
          • ${formfields.PayerId}
          • \r\n
          \r\n

          By default if no key is entered, name will be searched.

          \r\n

          Search supports the = operator.
          Example: ${formfields.Phone} = 5555555555

          \r\n
          `;\r\n\t\r\n function openSearchHelp() {\r\n vhSweetAlert({ html:true, title:'Search Keywords', text:modalText});\r\n }\r\n\r\n function inviteContentChanged(content) {\r\n ivm.usingPinValidation = content.UsingPinValidation;\r\n ivm.currentPageInvites = content.Invites;\r\n ivm.totalInvites = content.TotalInvites;\r\n\r\n ivm.startInvite = (ivm.currentPage - 1) * ivm.pageSize + 1;\r\n ivm.endInvite = ivm.startInvite + ivm.currentPageInvites.length - 1;\r\n }\r\n\r\n}\r\n\r\nangular.module(\"invites\").controller(\"InvitesController\", InvitesController);\r\n","function InvitesService(repository, $http) {\r\n var inviteContentRepo = repository.new(\"cgp/invite\");\r\n\r\n function getInvites(searchText,sortBy,pageSize, page) {\r\n return inviteContentRepo.get({filterBy:searchText,sortBy:sortBy,pageSize: pageSize, page: page}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getInviteMessageHistory(pageSize, page, patientId) {\r\n return $http.get('/api/cgp/messagehistory?id=' + patientId + '&pageNumber=' + page + '&pageSize=' + pageSize).then(function(response) {\r\n return response.data;\r\n })\r\n }\r\n\r\n function savePhoneNumber(patientServiceLevelId, newPhoneNumber) {\r\n return $http.post(\"/api/patientservicelevel/\" + patientServiceLevelId + \"/phonenum\", '\"' + newPhoneNumber + '\"');\r\n }\r\n\r\n function saveDateOfBirth(patientId, newDOB) {\r\n var dob = moment(newDOB).format(\"YYYY-MM-DD\");\r\n return $http.post(\"/api/patient/\" + patientId + \"/dob\", '\"' + dob + '\"');\r\n }\r\n\r\n function saveEmail(patientId, newEmail) {\r\n return $http.post(\"/api/patient/\" + patientId + \"/email\", '\"'+newEmail+'\"');\r\n }\r\n\r\n function resendWelcomeMessage(invitationId) {\r\n return $http.post(\"/api/invitation/\" + invitationId + \"/resendwelcome\");\r\n }\r\n\r\n return {\r\n getInvites: getInvites,\r\n savePhoneNumber: savePhoneNumber,\r\n resendWelcomeMessage: resendWelcomeMessage,\r\n saveDateOfBirth: saveDateOfBirth,\r\n getInviteMessageHistory: getInviteMessageHistory,\r\n saveEmail: saveEmail\r\n };\r\n}\r\n\r\nangular.module(\"invites\")\r\n.factory(\"InvitesService\", InvitesService)\r\n.constant(\"InvitationStatusEnum\", {\r\n Invited: 1,\r\n DobValidationFailed: 2,\r\n WrongPerson: 3,\r\n OptedOut: 4,\r\n OptedIn: 5,\r\n Expired: 6\r\n});\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/invites/invites.tpl.html',\n '

          {{ivm.filterName}}

          1. Viewing {{ivm.startInvite}}-{{ivm.endInvite}} of {{ivm.totalInvites}}
          ');\n}]);\n}(window, document, window.angular));","function KitLogisticsUpdateKitDetailsController($q, $uibModalInstance, lodash, kits, KitService) {\r\n var vm = this;\r\n\r\n vm.kitCount = kits.length;\r\n vm.details = '';\r\n\r\n vm.cancel = cancel;\r\n vm.update = update;\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function update() {\r\n var kitContentPromises = [], promises = [];\r\n //get all kit contents\r\n lodash.forEach(kits, function(kit) {\r\n kitContentPromises.push(KitService.getKitContent(kit.KitId));\r\n });\r\n\r\n $q.all(kitContentPromises).then(function(kitContents){\r\n lodash.forEach(kitContents, function(kitContent){\r\n kitContent.Kit.Details = vm.details;\r\n promises.push(KitService.saveKit(kitContent.Kit));\r\n });\r\n \r\n //save all kits\r\n $q.all(promises).then(function(response){\r\n $uibModalInstance.close(response.data);\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module(\"kit_logistics.kits\").controller('KitLogisticsUpdateKitDetailsController', KitLogisticsUpdateKitDetailsController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/kits/details.modal.html',\n '

          Update {{vm.kitCount}} Kits Details

          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/kits/kit-search-keywords.tpl.html',\n '
          • Created (date)
          • Details
          • ICCID
          • IMEI
          • IMSI
          • Kit (number)
          • Kit Pool
          • Kit Return Location
          • Location
          • Network Operator
          • Patient Id (number)
          • Phone (number)
          • Status
          • Tablet Owner

          Search supports the following operators: =, >, <, !, &, and |. Date fields also support relative date keywords: Today, Yesterday, This Week, Last Week, This Month, Last Month, This Year, Last Year.

          ');\n}]);\n}(window, document, window.angular));","function KitController($rootScope, $scope, kitContent, portalConfig, lodash, KitService, $q, vhSweetAlert, PermissionService, ConfigurationsService) {\r\n var kvm = this;\r\n kitContent.CurrentKitLocation = kitContent.CurrentKitLocation || {};\r\n kitContent.Kit.KitStatus = kitContent.Kit.KitStatus || {};\r\n kvm.kit = kitContent.Kit;\r\n kvm.network = kitContent.Kit.NetworkOperatorId;\r\n kvm.owner = kitContent.Kit.TabletOwnerId;\r\n kvm.currentStatus = kitContent.Kit.KitStatus.KitStatusId;\r\n kvm.networks = kitContent.NetworkOperators;\r\n kvm.owners = kitContent.TabletOwners;\r\n kvm.kitStatuses = kitContent.KitStatuses;\r\n kvm.locations = kitContent.KitLocations;\r\n kvm.shippingLocations = lodash.filter(kitContent.KitLocations, {KitLocationTypeId: 1});\r\n kvm.reprocess = kitContent.KitShippingHistory;\r\n kvm.sipUrl = kitContent.SipUrl;\r\n kvm.emaCallsEnabled = kitContent.IsEmaCallEnabled;\r\n kvm.currentKitLocationId = kitContent.CurrentKitLocation ? kitContent.CurrentKitLocation.KitLocationId : 0;\r\n kvm.getTrackingURL = getTrackingURL;\r\n kvm.weight = getDeviceText(1);\r\n kvm.bp = getDeviceText(2);\r\n kvm.oxy = getDeviceText(3);\r\n kvm.bs = getDeviceText(8); \r\n kvm.temp = getDeviceText(13);\r\n kvm.spiro = getDeviceText(15);\r\n kvm.pedo = getDeviceText(16);\r\n kvm.spirometerEnabled = portalConfig.EnableSpirometerBiometric;\r\n kvm.pedometerEnabled = portalConfig.EnablePedometerBiometric;;\r\n kvm.kit.KitStatusId = kitContent.Kit.KitStatus.KitStatusId;\r\n kvm.saveKit = saveKit;\r\n kvm.defaultKitLocationId = kitContent.Kit.DefaultKitLocationId;\r\n kvm.defaultKitLocationName = lodash.find(kitContent.KitLocations, {KitLocationId: kitContent.Kit.DefaultKitLocationId})?.Name || \"\";\r\n kvm.phoneNo = kitContent.Kit.PhoneNo;\r\n kvm.phoneChanged = phoneChanged;\r\n kvm.clickedProvisionEma = provisionEma;\r\n kvm.details = kitContent.Kit.Details;\r\n kvm.kitTypeName = kitContent.Kit.KitTypeName;\r\n kvm.KitPoolName = kitContent.Kit.KitPoolName;\r\n kvm.LogPage = 1;\r\n kvm.fetchKitLog = fetchKitLog;\r\n\r\n fetchKitLog();\r\n\r\n kvm.userCanProvision = PermissionService.userHasPermission(\"ProvisionKits\");\r\n kvm.userCanEditNetworkTablet = PermissionService.userHasPermission(\"NetworkAndTabletWrite\");\r\n kvm.userCanEditKitStatus = PermissionService.userHasPermission(\"EditKitStatus\");\r\n kvm.userCanEditDetails = PermissionService.userHasPermission(\"KitDetailsWrite\");\r\n kvm.userCanEditLocation = PermissionService.userHasPermission(\"EditKitLocation\")\r\n kvm.userCanEditReturnLocation = PermissionService.userHasPermission(\"KitReturnLocationWrite\");\r\n bindEma(kitContent.KitCreatedByEma);\r\n\r\n $rootScope.$emit(\"vh:kitSelected\", kvm.kit);\r\n\r\n $scope.$on(\"$destroy\", function() { \r\n $rootScope.$emit(\"vh:kitSelected\", null );\r\n });\r\n\r\n\r\n function bindEma(created) {\r\n kvm.emaProvisioned = created;\r\n if (created) {\r\n kvm.emaProvisionText = \"Kit created successfully in EMA\";\r\n } else {\r\n kvm.emaProvisiontext = \"Failed to create kit in EMA\";\r\n }\r\n }\r\n\r\n function getTrackingURL(TrackingNumber) {\r\n var retVal = '';\r\n if (TrackingNumber && TrackingNumber.length > 0) {\r\n var url = ConfigurationsService.configParams.KitTrackingURL;\r\n url = url.replace(\"%%TRACKINGNUMBER%%\", TrackingNumber);\r\n retVal = url;\r\n }\r\n return retVal;\r\n };\r\n\r\n function getDeviceText(deviceId) {\r\n if (lodash.any(kvm.kit.Devices, {DeviceTypeId: deviceId})) {\r\n return \"BT\";\r\n }\r\n return \"-\";\r\n }\r\n\r\n function saveKit(kitForm) {\r\n kvm.kit.KitTypeId = (kvm.kit.KitTypeId ==0 ? null : kvm.kit.KitTypeId )\r\n var promises = [];\r\n if (kvm.network !== kvm.kit.NetworkOperatorId ||\r\n kvm.owner !== kvm.kit.TabletOwnerId ||\r\n kvm.details !== kvm.kit.Details) {\r\n kvm.kit.NetworkOperatorId = kvm.network;\r\n kvm.kit.TabletOwnerId = kvm.owner;\r\n kvm.kit.Details = kvm.details;\r\n promises.push(KitService.saveKit(kvm.kit).then(function (kit) {\r\n kvm.kit = kit;\r\n kvm.network = kit.NetworkOperatorId;\r\n kvm.owner = kit.TabletOwnerId;\r\n }));\r\n }\r\n\r\n if (kvm.currentStatus !== kitContent.Kit.KitStatus.KitStatusId ||\r\n kvm.currentKitLocationId !== (kitContent.CurrentKitLocation ? kitContent.CurrentKitLocation.KitLocationId : 0)) {\r\n if (kitContent.Kit.PatientId > 0 && kvm.currentStatus === 1 && kitContent.Kit.KitStatus.KitStatusUd !== 1) {\r\n vhSweetAlert.error(\"Error\", \"Cannot change a kit's status to Available when assigned to patient.\");\r\n } else {\r\n promises.push(KitService.moveKit(kvm.kit.Id, kvm.currentStatus, kvm.currentKitLocationId).then(function(){\r\n var foundStatus = lodash.find(kvm.kitStatuses, {KitStatusId: kvm.currentStatus});\r\n if(foundStatus !== undefined) {\r\n kitContent.Kit.KitStatus = foundStatus;\r\n }\r\n }));\r\n }\r\n }\r\n\r\n kitForm.$setPristine();\r\n return $q.all(promises);\r\n } \r\n\r\n function phoneChanged() {\r\n kvm.kit.PhoneNo = kvm.phoneNo;\r\n KitService.saveKit(kvm.kit);\r\n }\r\n\r\n function provisionEma() {\r\n KitService.provisionEma(kvm.kit.Id).then(function (transaction) {\r\n bindEma(transaction.Status.indexOf(\"Successful\") > -1);\r\n });\r\n }\r\n\r\n function fetchKitLog(){\r\n KitService.getKitLog(kvm.kit.KitNo, 100, kvm.LogPage).then(function (data) {\r\n kvm.KitLog = data;\r\n }); \r\n }\r\n}\r\nangular.module(\"kits.kit\").controller(\"KitController\", KitController);\r\n","function KitService($http) {\r\n function getKitContent(kitId) {\r\n return $http.get(\"/api/cgp/kit/content/\" + kitId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveKit(kit) {\r\n return $http.put(\"/api/kit/\" + kit.Id, kit).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function moveKit(kitId, kitStatus, kitLocation) {\r\n return $http.post(\"/api/KitLocation/MoveKit\", {\r\n KitId: kitId,\r\n KitStatusId: kitStatus,\r\n KitLocationId: kitLocation\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function provisionEma(kitId) {\r\n return $http.post(\"/api/KitProvisioning/\" + kitId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getKitLog(kitno, pageSize, page) {\r\n return $http.get(\"/api/kitlog/\" + kitno + \"?pageSize=\" + pageSize + \"&pageNumber=\" + page).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getKitContent: getKitContent,\r\n saveKit: saveKit,\r\n moveKit: moveKit,\r\n provisionEma: provisionEma,\r\n getKitLog: getKitLog\r\n };\r\n}\r\nangular.module(\"kits.kit\").factory(\"KitService\", KitService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/kits/kit/kit.tpl.html',\n '
          Kit: {{kvm.kit.KitNo}}
          Kit Log
          TimeTypeDetails
          {{item.LogDateTime_UTC | date:\\'short\\'}}{{item.KitLogType}}{{item.Description}}
          Devices
          WtBPSpO2BSTempSpiroSteps
          {{kvm.weight}}{{kvm.bp}}{{kvm.oxy}}{{kvm.bs}}{{kvm.temp}}{{kvm.spiro}}{{kvm.pedo}}
          Reprocessing
          Kit Return Location: {{kvm.defaultKitLocationName}}

          Most Recent Shipping Infomation

          Tablet Information
          IMEI: {{kvm.kit.IMEI}}
          ICCID: {{kvm.kit.ICCIDNo}}
          Phone Number: {{kvm.phoneNo | tel}}{{kvm.phoneNo | tel}}
          IMSI: {{kvm.kit.IMSINo}}
          SIP: {{kvm.sipUrl}}
          {{kvm.emaProvisionText}}
          ');\n}]);\n}(window, document, window.angular));","function KitsController(kitsContent, portalConfig, KitsService, lodash, $uibModal, PermissionService, vhSweetAlert, KitService) {\r\n var klvm = this;\r\n klvm.statuses = kitsContent.KitStatuses;\r\n klvm.locations = kitsContent.KitLocations;\r\n klvm.pageChanged = pageChanged;\r\n klvm.changedSort = changedSort;\r\n klvm.toggleSelectAll = toggleSelectAll;\r\n klvm.pageSize = kitsContent.filters.pageSize;\r\n klvm.page = kitsContent.filters.pageNumber;\r\n klvm.sortBy = kitsContent.filters.sortBy;\r\n klvm.moveKits = moveKitsSelected;\r\n klvm.updateKitDetail = updateKitDetail;\r\n klvm.updateSelectedKitDetail = updateSelectedKitDetail;\r\n klvm.moveKit = moveKit;\r\n klvm.searchKits = searchKits;\r\n klvm.searchText = '';\r\n klvm.canDeleteKits = PermissionService.userHasPermission(\"KitsDelete\");\r\n klvm.canMoveKits = PermissionService.userHasPermission(\"MoveKits\");\r\n klvm.canEditKitStatus = PermissionService.userHasPermission(\"EditKitStatus\");\r\n klvm.canUpdateDescription = PermissionService.userHasPermission(\"KitsWrite\");\r\n klvm.deleteKits = deletePrompt;\r\n klvm.makeAvailable = makeAvailable;\r\n klvm.showSpirometer = portalConfig.EnableSpirometerBiometric;\r\n klvm.showPedometer = portalConfig.EnablePedometerBiometric;\r\n klvm.refresh = refresh;\r\n klvm.searchKeywords = searchKeywords;\r\n\r\n klvm.sortings = [\r\n {key: \"KITNO=a\", name: \"Kit Number\"},\r\n {key: \"KITSTATUSNAME=a\", name: \"Kit Status\"},\r\n {key: \"KITLOCATIONNAME=a\", name: \"Kit Location\"}\r\n ];\r\n\r\n bindKitResults(kitsContent);\r\n\r\n function refresh(){\r\n var filters = {pageSize: 50, pageNumber: 1, sortBy: \"KITNO=a\"};\r\n return KitsService.getContent(filters).then(function (result) {\r\n result.filters = filters;\r\n bindKitResults(result);\r\n });\r\n }\r\n\r\n function searchKeywords(){\r\n vhSweetAlert({\r\n title: \"Search Keywords\",\r\n templateUrl: 'modules/kit_logistics/kits/kit-search-keywords.tpl.html'\r\n });\r\n }\r\n\r\n function bindKitResults(kitResults) {\r\n klvm.selectedKits = [];\r\n klvm.totalKits = kitResults.TotalCount || kitResults.TotalKits;\r\n klvm.kits = lodash.map(kitResults.Response || kitResults.Kits, function (k) {\r\n k.canMakeAvailable = canMakeAvailable(k);\r\n return k;\r\n });\r\n }\r\n\r\n function canMakeAvailable(kit) {\r\n return klvm.canEditKitStatus && !kit.HasPatientAssigned && (kit.KitStatusId === 4 ||\r\n kit.KitStatusId === 3 ||\r\n (kit.KitStatusId >= 8 && kit.KitStatusId <= 11) ||\r\n (kit.KitStatusId === 5 &&\r\n kit.KitLocation &&\r\n kit.KitLocation.KitLocationTypeId !== 2 &&\r\n kit.KitLocation.KitLocationTypeId !== 3) ||\r\n (kit.KitStatusId === 14)\r\n );\r\n }\r\n\r\n function pageChanged() {\r\n KitsService.getKits(klvm.pageSize, klvm.page, klvm.sortBy, klvm.searchText)\r\n .then(bindKitResults);\r\n }\r\n\r\n function changedSort(sortingId) {\r\n klvm.sortBy = sortingId;\r\n klvm.page = 1;\r\n pageChanged();\r\n }\r\n\r\n function toggleSelectAll() {\r\n if (klvm.selectedKits.length > 0) {\r\n klvm.selectedKits = [];\r\n } else {\r\n klvm.selectedKits = angular.copy(klvm.kits);\r\n }\r\n }\r\n\r\n function searchKits() {\r\n if (klvm.searchText.length < 1) {\r\n bindKitResults(kitsContent);\r\n }\r\n KitsService.getKits(klvm.pageSize, klvm.page, klvm.sortBy, klvm.searchText)\r\n .then(bindKitResults);\r\n }\r\n\r\n function deleteKits(kits) {\r\n KitsService.deleteKits(klvm.selectedKits).then(function () {\r\n pageChanged();\r\n });\r\n }\r\n\r\n function deleteKit(kit) {\r\n KitsService.deleteKit(kit).then(function () {\r\n pageChanged();\r\n });\r\n }\r\n\r\n function deletePrompt(kits) {\r\n var arrayKit = angular.isArray(kits);\r\n var anyPatients = false;\r\n if (arrayKit) {\r\n anyPatients = lodash.any(kits, function (k) {\r\n return k.PatientId > 0;\r\n });\r\n } else {\r\n anyPatients = kits.PatientId > 0;\r\n }\r\n if (anyPatients) {\r\n vhSweetAlert.error(\"Error\", \"Cannot delete kits assigned to patients.\");\r\n return;\r\n }\r\n\r\n var kitNumber = angular.isArray(kits) ? kits.length : 1;\r\n vhSweetAlert.verify(\"Are you sure?\", \"Do you want to delete \" + kitNumber + \" kit(s)?\", \"Delete\")\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n if (kitNumber > 1) {\r\n deleteKits(kits);\r\n } else {\r\n deleteKit(kits);\r\n }\r\n }\r\n }\r\n );\r\n }\r\n\r\n function makeAvailable(kit) {\r\n vhSweetAlert.verify(\"Are you sure?\", \"Do you want to make kit: \" + kit.KitNo + \" available?\", \"Yes\")\r\n .then(function (isConfirm) {\r\n return isConfirm && KitService.moveKit(kit.KitId, 1).then(function () {\r\n kit.KitStatusId = 1;\r\n kit.KitStatusName = \"Available\";\r\n kit.canMakeAvailable = false;\r\n });\r\n });\r\n }\r\n\r\n function updateKitDetail(kit) {\r\n updateKitsDetail([kit]);\r\n }\r\n\r\n function updateSelectedKitDetail() {\r\n updateKitsDetail(klvm.selectedKits);\r\n klvm.selectedKits = [];\r\n }\r\n\r\n function updateKitsDetail(kits) {\r\n var updateDetailModal = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/kits/details.modal.html',\r\n controller: 'KitLogisticsUpdateKitDetailsController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n kits: function(){\r\n return kits;\r\n }\r\n }\r\n });\r\n }\r\n\r\n function moveKit(kit) {\r\n moveKits([kit]);\r\n }\r\n\r\n function moveKitsSelected() {\r\n moveKits(klvm.selectedKits);\r\n klvm.selectedKits = [];\r\n }\r\n\r\n function moveKits(kits) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/kits/move_kits.modal.html',\r\n controller: 'KitLogisticsMoveKitsModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n kits: function() {\r\n return kits;\r\n },\r\n statusesAndLocations: function() {\r\n return kitsContent;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(updatedKits) {\r\n var changedKitStatusName = updatedKits.KitStatusId !== null ? lodash.find(klvm.statuses, {KitStatusId: updatedKits.KitStatusId}) !== undefined ? lodash.find(klvm.statuses, {KitStatusId: updatedKits.KitStatusId}).Name : null : null;\r\n var changedKitLocationName = updatedKits.KitLocationId !== null ? lodash.find(klvm.locations, {KitLocationId: updatedKits.KitLocationId}) !== undefined ? lodash.find(klvm.locations, {KitLocationId: updatedKits.KitLocationId}).Name : null: null;\r\n angular.forEach(klvm.kits, function (k) {\r\n if(lodash.any(updatedKits.KitIds, function (u) { return u === k.KitId; })) {\r\n k.KitStatusId = updatedKits.KitStatusId || k.KitStatusId;\r\n k.KitStatusName = changedKitStatusName || k.KitStatusName;\r\n k.KitLocationId = updatedKits.KitLocationId || k.KitLocationId;\r\n k.KitLocationName = changedKitLocationName || k.KitLocationName;\r\n k.canMakeAvailable = canMakeAvailable(k);\r\n }\r\n return k;\r\n });\r\n });\r\n }\r\n\r\n}\r\nangular.module(\"kit_logistics.kits\").controller(\"KitsController\", KitsController);\r\n","function KitsService($http, lodash) {\r\n function getContent(filters) {\r\n return $http.get(\"/api/cgp/kitlist/content\", {params: filters}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n \r\n function getKits(pageSize, page, sortBy, searchText) {\r\n return $http.get(\"/api/cgp/kitlist\", { params: {\r\n pageSize: pageSize,\r\n pageNumber: page,\r\n sortBy: sortBy,\r\n searchText: searchText\r\n }}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function moveKits(kitIds, locationId, statusId) {\r\n return $http.post('/api/KitLocation/MoveKits', {\r\n KitIds: kitIds,\r\n KitLocationId: locationId,\r\n KitStatusId: statusId\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteKits(kits) {\r\n if (angular.isArray(kits)) {\r\n return $http.delete(\"/api/Kit\", {params: {kitIds: lodash.pluck(kits, \"KitId\")}}).then(parseResponse);\r\n } else {\r\n return $http.delete(\"/api/Kit/\" + kits.KitId).then(parseResponse);\r\n }\r\n }\r\n\r\n function parseResponse(response) {\r\n return response.data;\r\n }\r\n\r\n return {\r\n getContent: getContent,\r\n getKits: getKits,\r\n moveKits: moveKits,\r\n deleteKits: deleteKits,\r\n deleteKit: deleteKits\r\n };\r\n}\r\nangular.module(\"kit_logistics.kits\")\r\n .factory(\"KitsService\", KitsService)\r\n .constant('KitStatus', {\r\n InUse: 'In Use',\r\n Shipped: 'Shipped'\r\n });\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/kits/kits.tpl.html',\n '

          Kits

            0\">
          1. Viewing {{(klvm.page-1)*klvm.pageSize+1}}-{{klvm.pageSize>klvm.kits.length?(klvm.kits.length + (klvm.pageSize * (klvm.page - 1))):(klvm.pageSize * klvm.page)}} of {{klvm.totalKits}}
          All Kits
          0 && (klvm.canDeleteKits || klvm.canMoveKits)\">
          Refresh
          0\">
          KitStatusLocationKit PoolBP Cuff SizeScale TypeWtBPSpO2BSTempSpiroStepsPatient
           {{kit.KitNo}}{{kit.KitStatusName}}{{kit.KitStatusName}}{{kit.KitLocationName}}{{kit.KitPoolName}}{{kit.BPCuffSize}}{{kit.ScaleType}}{{kit.WeightScale}}{{kit.BloodPressure}}{{kit.PulseOx}}{{kit.Glucometer}}{{kit.Thermometer}}{{kit.Spirometer}}{{kit.Pedometer}}{{kit.Last_Name}}{{kit.First_Name}}------
          No kits found
          ');\n}]);\n}(window, document, window.angular));","function MoveKitsModalController(kits, statusesAndLocations, $uibModalInstance, KitsService, lodash, PermissionService) {\r\n var vm = this;\r\n vm.canEditKitStatus = PermissionService.userHasPermission(\"EditKitStatus\");\r\n\r\n vm.kitCount = kits.length;\r\n\r\n vm.locations = lodash.chain(statusesAndLocations.KitLocations).map(function(l) {\r\n return { id: l.KitLocationId, name: l.Name };\r\n }).sortBy('name').value();\r\n\r\n vm.location = null;\r\n\r\n vm.statuses = lodash.map(statusesAndLocations.KitStatuses, function(s) {\r\n return { id: s.KitStatusId, name: s.Name };\r\n });\r\n vm.status = null;\r\n\r\n vm.moveKits = function() {\r\n // Persist the changes\r\n var kitIds = lodash.map(kits, function(k) { return k.KitId; });\r\n var locationId = vm.location !== null ? vm.location.id : null;\r\n var statusId = vm.status !== null ? vm.status.id : null;\r\n KitsService.moveKits(kitIds, locationId, statusId).then(function(updatedKits) {\r\n $uibModalInstance.close(updatedKits);\r\n }).catch(function(rejection){\r\n rejection.preventDefault();\r\n if(rejection.status === 409 && vm.kitCount === 1) {\r\n if(rejection.data.ErrorMessage !== undefined) {\r\n vm.err = rejection.data.ErrorMessage;\r\n } else {\r\n vm.err = \"An error occurred durring processing.\";\r\n }\r\n } else {\r\n $uibModalInstance.close(rejection);\r\n }\r\n });\r\n };\r\n\r\n vm.cancelEditing = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module(\"kit_logistics.kits\").controller('KitLogisticsMoveKitsModalController', MoveKitsModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/kits/move_kits.modal.html',\n '

          Move {{vm.kitCount}} Kits

          {{vm.err}}
          ');\n}]);\n}(window, document, window.angular));","function KitLogisticsEditLocationController(location, isNameEditable, locationTypeName, hospitalLabel, hospitals, $uibModalInstance, KitLogisticsLocationsService, lodash, Pluralize, $scope) {\r\n var vm = this;\r\n\r\n vm.isNewLocation = location.KitLocationId ? false : true;\r\n vm.isNameEditable = isNameEditable;\r\n vm.locationTypeName = locationTypeName;\r\n\r\n vm.location = {\r\n Name: location.Name\r\n };\r\n\r\n vm.hospitalLabelSingular = hospitalLabel;\r\n vm.hospitalLabelPlural = Pluralize(hospitalLabel);\r\n vm.hospitalOptions = [\r\n {\r\n Id: null,\r\n FacilityName: 'All ' + vm.hospitalLabelPlural\r\n }\r\n ].concat(lodash.map(hospitals, function(h) {\r\n return {\r\n Id: h.Id,\r\n FacilityName: h.FacilityName\r\n };\r\n }));\r\n\r\n // Determine whether all hospitals are selected\r\n function isHospitalAssociated(h) { return location.AssociatedHospitals ? lodash.any(location.AssociatedHospitals, { Id: h.Id }) : false; }\r\n var areAllHospitalsAssociated = lodash.all(hospitals, isHospitalAssociated);\r\n\r\n // If all hospitals are associated, then select the \"All Hospitals\" option\r\n if (areAllHospitalsAssociated) {\r\n vm.selectedHospitals = lodash.filter(vm.hospitalOptions, { Id: null });\r\n }\r\n // Otherwise, select the hospitals that are associated with this location\r\n else {\r\n vm.selectedHospitals = lodash.filter(vm.hospitalOptions, isHospitalAssociated);\r\n }\r\n\r\n // Watch for when the hospital selection changes\r\n $scope.$watch(function() {\r\n return vm.selectedHospitals;\r\n }, function(newValue, oldValue) {\r\n // Figure out if the user has selected the special \"All Hospitals\" option.\r\n var wasAllHospitalsOptionIncludedInOldSelection = lodash.any(oldValue, { Id: null });\r\n var isAllHospitalsOptionIncludedInNewSelection = lodash.any(newValue, { Id: null });\r\n var wasAllHospitalsOptionAdded = !wasAllHospitalsOptionIncludedInOldSelection && isAllHospitalsOptionIncludedInNewSelection;\r\n\r\n if (wasAllHospitalsOptionAdded) {\r\n // If they did add the \"All Hospitals\" option, then we want to remove all other options.\r\n vm.selectedHospitals = lodash.filter(vm.selectedHospitals, { Id: null });\r\n }\r\n else if (isAllHospitalsOptionIncludedInNewSelection && vm.selectedHospitals.length > 1) {\r\n // They already had \"All Hospitals\" selected and added another option, so we want to remove the \"All Hospitals\" option.\r\n vm.selectedHospitals = lodash.filter(vm.selectedHospitals, function(h) { return h.Id !== null; });\r\n }\r\n });\r\n\r\n vm.saveLocation = function(isValid) {\r\n if (isValid) {\r\n // Update the location name\r\n if (isNameEditable) {\r\n location.Name = vm.location.Name;\r\n }\r\n\r\n // Update the associated hospitals\r\n var associatedHospitals = [];\r\n if (lodash.any(vm.selectedHospitals, { Id: null })) {\r\n associatedHospitals = hospitals;\r\n }\r\n else {\r\n associatedHospitals = lodash.filter(hospitals, function(h) {\r\n return lodash.any(vm.selectedHospitals, { Id: h.Id });\r\n });\r\n }\r\n location.AssociatedHospitals = associatedHospitals;\r\n\r\n // Persist the changes\r\n KitLogisticsLocationsService.saveLocation(location).then(function(savedLocation) {\r\n $uibModalInstance.close(savedLocation);\r\n });\r\n }\r\n };\r\n\r\n vm.cancelEditing = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.locations').controller('KitLogisticsEditLocationController', KitLogisticsEditLocationController);\r\n\r\nfunction KitLogisticsUiSelectRequireAtLeastOneHospitalValidator() {\r\n return {\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attrs, ngModel) {\r\n ngModel.$validators.required = function (value) {\r\n return angular.isArray(value) && value.length > 0;\r\n };\r\n }\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.locations').directive('requireAtLeastOneHospital', KitLogisticsUiSelectRequireAtLeastOneHospitalValidator);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/locations/editlocation.modal.html',\n '

          {{vm.isNewLocation ? \"New\" : \"Edit\" }} {{vm.locationTypeName}} Location

          {{vm.location.Name}}
          {{$item.FacilityName}}{{hospital.FacilityName}}
          ');\n}]);\n}(window, document, window.angular));","function KitLogisticsLocationsController(locations, hospitalLabel, PermissionService, lodash, $uibModal) {\r\n var vm = this;\r\n\r\n vm.hospitalLabel = hospitalLabel;\r\n vm.canEditLocations = PermissionService.userHasPermission([\"KitLocationWrite\"]);\r\n\r\n vm.locationTypes = [\r\n {\r\n name: 'shipping',\r\n type: 1,\r\n canAddOrEditLocations: false, // Shipping Locations are read only on the Caregiver Portal regardless of permissions\r\n canEditHospitalAssociations: vm.canEditLocations,\r\n locations: lodash.filter(locations, { KitLocationTypeId: 1 })\r\n },\r\n {\r\n name: 'storage',\r\n type: 4,\r\n canAddOrEditLocations: vm.canEditLocations,\r\n canEditHospitalAssociations: vm.canEditLocations,\r\n locations: lodash.filter(locations, { KitLocationTypeId: 4 })\r\n }\r\n ];\r\n}\r\n\r\nangular.module('kit_logistics.locations').controller('KitLogisticsLocationsController', KitLogisticsLocationsController);\r\n","function KitLogisticsLocationsService(KitLocationRepository, HospitalRepository, WebFormFieldRepository, lodash) {\r\n return {\r\n getHospitalLabel: function() {\r\n return WebFormFieldRepository.getByFieldName('HospitalId').then(function(fieldLabelModel) {\r\n return fieldLabelModel.FieldLabel;\r\n });\r\n },\r\n\r\n getLocations: function() {\r\n return KitLocationRepository.getAll();\r\n },\r\n\r\n getHospitals: function() {\r\n return HospitalRepository.getAll();\r\n },\r\n\r\n saveLocation: function(location) {\r\n return KitLocationRepository.save(location);\r\n },\r\n\r\n deleteLocation: function(id) {\r\n return KitLocationRepository.delete(id);\r\n }\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.locations').factory('KitLogisticsLocationsService', KitLogisticsLocationsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/locations/locations.tpl.html',\n '

          Locations

          ');\n}]);\n}(window, document, window.angular));","function kitLogisticsLocationTypeEditor(KitLogisticsLocationsService, lodash, $uibModal, vhSweetAlert) {\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n ngModel: '=',\r\n hospitalLabel: '=',\r\n },\r\n templateUrl: 'modules/kit_logistics/locations/locationtypeeditor.tpl.html',\r\n controller: function($scope, KitLogisticsLocationsService, $uibModal, Pluralize) {\r\n $scope.hospitalLabelPlural = Pluralize($scope.hospitalLabel);\r\n\r\n if ($scope.ngModel.canAddOrEditLocations || $scope.ngModel.canEditHospitalAssociations) {\r\n $scope.editLocation = function(location) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/locations/editlocation.modal.html',\r\n controller: 'KitLogisticsEditLocationController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n location: function () {\r\n return angular.copy(location);\r\n },\r\n isNameEditable: function() {\r\n return $scope.ngModel.canAddOrEditLocations;\r\n },\r\n locationTypeName: function() {\r\n return $scope.ngModel.name;\r\n },\r\n hospitalLabel: function() {\r\n return $scope.hospitalLabel;\r\n },\r\n hospitals: function() {\r\n return KitLogisticsLocationsService.getHospitals();\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(updatedLocation) {\r\n angular.extend(location, updatedLocation);\r\n });\r\n };\r\n }\r\n\r\n if ($scope.ngModel.canAddOrEditLocations) {\r\n $scope.deleteLocation = function(location) {\r\n if (location.NumberOfKits > 0) {\r\n vhSweetAlert.error('Can\\'t delete ' + location.Name + '.', 'You cannot delete ' + location.Name + ' because there are kits currently located there. Please move the kits to a different location and try again.')\r\n }\r\n else {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete ' + location.Name + '?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n KitLogisticsLocationsService.deleteLocation(location.KitLocationId).then(function() {\r\n lodash.remove($scope.ngModel.locations, { KitLocationId: location.KitLocationId });\r\n });\r\n }\r\n }\r\n );\r\n }\r\n };\r\n\r\n $scope.addLocation = function(type) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/locations/editlocation.modal.html',\r\n controller: 'KitLogisticsEditLocationController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n location: function () {\r\n return { KitLocationTypeId: type };\r\n },\r\n isNameEditable: function() {\r\n return $scope.ngModel.canAddOrEditLocations;\r\n },\r\n locationTypeName: function() {\r\n return $scope.ngModel.name;\r\n },\r\n hospitalLabel: function() {\r\n return $scope.hospitalLabel;\r\n },\r\n hospitals: function() {\r\n return KitLogisticsLocationsService.getHospitals();\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(newLocation) {\r\n $scope.ngModel.locations.push(newLocation);\r\n });\r\n };\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.locations').directive('kitLogisticsLocationTypeEditor', kitLogisticsLocationTypeEditor);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/locations/locationtypeeditor.tpl.html',\n '
          {{ngModel.name}} locations
          0\" class=\"table table-bordered\" style=\"width: 100%;\">
          Location NameKitsAssigned {{hospitalLabelPlural}}
          {{location.Name}}{{location.NumberOfKits}}{{location.AssociatedHospitals[0].FacilityName}}
            1\">
          • {{hospital.FacilityName}}
          No {{ngModel.name}} locations defined.
          ');\n}]);\n}(window, document, window.angular));","function goDevicesShippingInfoController($scope, $uibModalInstance, patient, LogisticsService, goDevicesShippingInfoModel, WebFormFieldRepository) {\r\n\r\n var vm = this;\r\n vm.patient = patient;\r\n vm.disabledByStatus = true;\r\n\r\n if ( vm.patient.CurrentKitStatus == 'Ordered'){\r\n vm.disabledByStatus = false;\r\n }\r\n \r\n vm.Title = \"+Go Devices Shipping Information: \" + vm.patient.LastName + \", \" + vm.patient.FirstName;\r\n \r\n vm.shippingmodel = false;\r\n vm.webformfields = {};\r\n \r\n WebFormFieldRepository.get().then( function(x) {\r\n for(var i = 0; i 0) {\r\n vm.patient.City = vm.shippingmodel.City;\r\n }\r\n if(vm.shippingmodel.State && vm.shippingmodel.State.length > 0) {\r\n vm.patient.State = vm.shippingmodel.State;\r\n }\r\n if(vm.shippingmodel.ZipCode && vm.shippingmodel.ZipCode.length > 0) {\r\n vm.patient.ZipCode = vm.shippingmodel.ZipCode;\r\n }\r\n if(vm.shippingmodel.Phone && vm.shippingmodel.Phone.length > 0) {\r\n vm.patient.Phone = vm.shippingmodel.Phone;\r\n }\r\n if(vm.shippingmodel.Phone2 && vm.shippingmodel.Phone2.length > 0) {\r\n vm.patient.Phone2 = vm.shippingmodel.Phone2;\r\n }\r\n\r\n $uibModalInstance.close(\"\");\r\n }); \r\n }\r\n \r\n };\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss(\"cancel\");\r\n };\r\n \r\n}\r\n\r\nangular.module('kit_logistics.logistics').controller('goDevicesShippingInfoController', goDevicesShippingInfoController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/logistics/EditShipping/goDevicesShippingInfo.tpl.html',\n '

          {{vm.Title}}

          {{vm.webformfields.Address1.FieldLabel}} is required
          {{vm.webformfields.City.FieldLabel}} is required
          {{vm.webformfields.State.FieldLabel}} is required
          {{vm.webformfields.ZipCode.FieldLabel}} is required
          {{webFormFields.Phone1.FieldLabel}} is required
          ');\n}]);\n}(window, document, window.angular));","angular.module('kit_logistics.logistics').factory('goDevicesShippingInfoModel',function(lodash,ConfigurationsService,PatientServiceLevelService,ConfigurationContentService) {\r\n \r\n function goDevicesShippingInfoModel() {\r\n\r\n }\r\n\r\n goDevicesShippingInfoModel.prototype.getObjectToSave = function() {\r\n var retVal = this;// Incase of mapping needed in future\r\n\r\n return retVal;\r\n } \r\n\r\n goDevicesShippingInfoModel.prototype.setFromModel = function(input) {\r\n var vm = this;\r\n this.LogisticsOrderId = input.LogisticsOrderId;\r\n this.PatientId = input.PatientId;\r\n this.AddressLine1 = input.AddressLine1;\r\n this.AddressLine2 = input.AddressLine2;\r\n this.City = input.City;\r\n this.State = input.State;\r\n this.ZipCode = input.ZipCode;\r\n this.Phone = input.Phone;\r\n this.Phone2 = input.Phone2;\r\n this.OrderNumber = input.OrderNumber;\r\n this.CreatedBy_Id = input.CreatedBy_Id;\r\n this.CreatedDateTime_UTC = input.CreatedDateTime_UTC;\r\n this.DeletedDateTime_UTC = input.DeletedDateTime_UTC;\r\n this.DeletedBy_Id = input.DeletedBy_Id;\r\n this.LogisticsStatusId = input.LogisticsStatusId; \r\n }\r\n \r\n return goDevicesShippingInfoModel;\r\n})","function KitShippingInfoController($scope, $uibModalInstance, patient, LogisticsService, KitShippingInfoModel,\r\n EditConfigurationsService, PermissionService, WebFormFieldRepository, lodash) {\r\n\r\n var vm = this;\r\n vm.patient = patient;\r\n vm.disabledByStatus = true;\r\n\r\n if ( vm.patient.CurrentKitStatus == 'Ordered'){\r\n vm.disabledByStatus = false;\r\n }\r\n\r\n vm.Title = \"Kit Shipping Information\";\r\n if(vm.patient.IsPickup){\r\n vm.Title = \"Kit Pickup Information\";\r\n }\r\n\r\n vm.Title += \": \" + vm.patient.LastName + \", \" + vm.patient.FirstName + \" (Kit: \" + vm.patient.KitNo + \")\";\r\n vm.shippingmodel = false;\r\n vm.webformfields = {};\r\n \r\n WebFormFieldRepository.get().then( function(x) {\r\n for(var i = 0; i 0) {\r\n vm.patient.City = vm.shippingmodel.City;\r\n }\r\n if(vm.shippingmodel.State && vm.shippingmodel.State.length > 0) {\r\n vm.patient.State = vm.shippingmodel.State;\r\n }\r\n if(vm.shippingmodel.ZipCode && vm.shippingmodel.ZipCode.length > 0) {\r\n vm.patient.ZipCode = vm.shippingmodel.ZipCode;\r\n }\r\n if(vm.shippingmodel.InstallMethod && vm.shippingmodel.InstallMethod.Text && vm.shippingmodel.InstallMethod.Text.length > 0) {\r\n vm.patient.InstallMethod = vm.shippingmodel.InstallMethod.Text;\r\n }\r\n\r\n $uibModalInstance.close(\"\");\r\n }); \r\n }\r\n \r\n };\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss(\"cancel\");\r\n };\r\n\r\n vm.setFocus = function (event) {\r\n event.preventDefault();\r\n $scope.$broadcast('educationMaterials.focus');\r\n }; \r\n}\r\n\r\nangular.module('kit_logistics.logistics').controller('KitShippingInfoController', KitShippingInfoController);","angular.module('kit_logistics.logistics').factory('KitShippingInfoModel',function(lodash,ConfigurationsService,PatientServiceLevelService,ConfigurationContentService) {\r\n \r\n function KitShippingInfoModel(pickup) {\r\n this.availableEducationMaterials = [];\r\n this.availableLanguages = [];\r\n this.isPickup = pickup;\r\n this.numberofDays = 1;\r\n var kitPickUpdateFilter;\r\n this.kitPickUpdateFilter={};\r\n this.dateformat = ConfigurationsService.configParams.DateFormat.toUpperCase();\r\n ConfigurationsService.getConfig().then(function (data) {\r\n this.kitPickUpdateFilter = data[\"KitPickUpdateFilter\"];\r\n this.numberofDays = this.kitPickUpdateFilter - 1;\r\n });\r\n }\r\n //Formats date\r\n KitShippingInfoModel.prototype.formatDate = function(dateString) {\r\n return moment(dateString).add(new Date().getTimezoneOffset(), 'm').toDate();\r\n }\r\n\r\n KitShippingInfoModel.prototype.validatePickupDate = function(kitUpdateshippingForm) {\r\n if(!kitUpdateshippingForm.PickupDate.$dirty){\r\n kitUpdateshippingForm.PickupDate.$setValidity(\"businessDays\", true);//if they don't change this date do not invalidate it\r\n }\r\n \r\n if(kitUpdateshippingForm.PickupDate.$dirty) {\r\n var dateField = this.getNextBusinessDay(this.kitPickUpdateFilter);\r\n if (this.PickupDate && this.PickupDate < dateField) {\r\n $scope.form.PickupDate.$setValidity(\"businessDays\", false);\r\n }\r\n else if (!this.PickupDate || this.PickupDate === \"\") {\r\n if (kitUpdateshippingForm.PickupDate) {\r\n kitUpdateshippingForm.PickupDate.$setValidity(\"businessDays\", false);\r\n }\r\n }else{\r\n kitUpdateshippingForm.PickupDate.$setValidity(\"businessDays\", true);\r\n }\r\n\r\n }\r\n }\r\n\r\n KitShippingInfoModel.prototype.getObjectToSave = function() {\r\n var retVal = this;// Incase of mapping needed in future\r\n\r\n return retVal;\r\n } \r\n\r\n KitShippingInfoModel.prototype.validateWelcomeCallDate = function (kitUpdateshippingForm) {\r\n if(!kitUpdateshippingForm.WelcomeCallDate.$dirty){\r\n kitUpdateshippingForm.WelcomeCallDate.$setValidity(\"businessDays\", true);//if they don't change this date do not invalidate it\r\n }\r\n\r\n var dateField = this.getNextBusinessDay(ConfigurationsService.configParams.WelcomeCallDays);\r\n\r\n if (this.WelcomeCallDate && this.WelcomeCallDate < dateField && kitUpdateshippingForm.WelcomeCallDate.$dirty) {\r\n kitUpdateshippingForm.WelcomeCallDate.$setValidity(\"businessDays\", false);\r\n }\r\n if (!this.WelcomeCallDate || this.WelcomeCallDate === \"\") {\r\n if (kitUpdateshippingForm.WelcomeCallDate) {\r\n kitUpdateshippingForm.WelcomeCallDate.$setValidity(\"businessDays\", true);\r\n }\r\n }\r\n };\r\n \r\n var disabledDate = function(o) {\r\n var today = new Date();\r\n var day = o.date.getDay();\r\n var tempDate = new Date(o.date);\r\n var odate = o.date;\r\n odate.setHours(0, 0, 0, 0);\r\n\r\n if (odate < today) {\r\n return false;\r\n \r\n }\r\n if (day === 0 || day === 6) {\r\n return true;\r\n } else { return false; }\r\n };\r\n\r\n KitShippingInfoModel.prototype.installMethodChanged = function(installMethod) {\r\n this.InstallMethodId = this.InstallMethod.Id;\r\n }\r\n\r\n KitShippingInfoModel.prototype.getNextBusinessDay = function(OffSet) {\r\n var date = new Date();\r\n date.setHours(0, 0, 0, 0);\r\n if (OffSet) {\r\n var numberofDays = OffSet;\r\n while (numberofDays > 0) {\r\n var day = date.getDay();\r\n if (day !== 0 && day !== 6) {\r\n --numberofDays;\r\n }\r\n date.setDate(date.getDate() + 1);\r\n }\r\n // If the date lands on a weekend go to monday\r\n if (date.getDay() === 0) {\r\n date.setDate(date.getDate() + 1);\r\n } else if (date.getDay() === 6) {\r\n date.setDate(date.getDate() + 2);\r\n }\r\n }\r\n return date;\r\n\r\n }\r\n\r\n KitShippingInfoModel.prototype.setFromModel = function(input) {\r\n var vm = this;\r\n this.welcomeCallEnabled = ConfigurationsService.configParams.EnableWelcomeCall;\r\n this.KitShippingInfoId = input.KitShippingInfoId;\r\n this.PatientId = input.PatientId;\r\n this.KitId = input.KitId;\r\n this.AddressLine1 = input.AddressLine1;\r\n this.AddressLine2 = input.AddressLine2;\r\n this.City = input.City;\r\n this.State = input.State;\r\n this.ZipCode = input.ZipCode;\r\n this.Phone = input.Phone;\r\n this.Phone2 = input.Phone2;\r\n this.IsPickup = input.IsPickup;\r\n \r\n this.PickupTime = input.PickupTime;\r\n this.OrderNumber = input.OrderNumber;\r\n this.TrackingNumber = input.TrackingNumber;\r\n this.Note = input.Note;\r\n this.CreatedBy_Id = input.CreatedBy_Id;\r\n this.CreatedDateTime_UTC = input.CreatedDateTime_UTC;\r\n this.ModifiedBy_Id = input.ModifiedBy_Id;\r\n this.ModifiedDateTime_UTC = input.ModifiedDateTime_UTC;\r\n this.DeletedDateTime_UTC = input.DeletedDateTime_UTC;\r\n \r\n this.DeletedBy_Id = input.DeletedBy_Id;\r\n this.KitStatusId = input.KitStatusId;\r\n this.HasPendingShipOrder = input.HasPendingShipOrder;\r\n this.KitPickupOptionId = input.KitPickupOptionId; \r\n \r\n this.datepickerOptionsWelcomeCall = {\r\n dateDisabled:disabledDate,\r\n minDate: this.getNextBusinessDay(ConfigurationsService.configParams.WelcomeCallDays)\r\n };\r\n\r\n this.datepickerOptionsPickup = {\r\n dateDisabled: disabledDate,\r\n minDate: this.getNextBusinessDay(ConfigurationsService.configParams.KitPickUpdateFilter)\r\n };\r\n\r\n if(!this.isPickup) { // Stuff that is shipping only{\r\n this.InstallMethodId = input.InstallMethodId;\r\n this.InstallMethod = input.InstallMethod;\r\n this.InstallMethod = lodash.cloneDeep(input.InstallMethod);\r\n this.KitShippingEducationMaterial = lodash.cloneDeep(input.KitShippingEducationMaterial);\r\n this.PatientLanguageModel = input.PatientLanguageModel;\r\n this.EducationLanguageId = input.EducationLanguageId;\r\n this.PatientLanguageModel = lodash.cloneDeep(input.PatientLanguageModel);\r\n this.EducationalMaterialLanguage = lodash.cloneDeep(input.EducationalMaterialLanguage);\r\n var availableLanguages = this.availableLanguages;\r\n\r\n if(ConfigurationsService.configParams.EnableWelcomeCall) {\r\n if(input.WelcomeCallDate){\r\n this.WelcomeCallDate = this.formatDate(input.WelcomeCallDate);\r\n }\r\n this.WelcomeCallTime = input.WelcomeCallTime;\r\n }\r\n\r\n ConfigurationContentService.getAvailableLanguages().then(function(response) {\r\n this.availableLanguages = response;\r\n vm.availableLanguages = response;\r\n });\r\n \r\n PatientServiceLevelService.getEducationMaterials().then(function(response) {\r\n vm.availableEducationMaterials = response.data.filter(function(x){\r\n return x.Disabled == false;\r\n });\r\n });\r\n }else{//is pickup\r\n this.PickupDate = new Date(input.PickupDate);\r\n this.PickupDate = this.formatDate(input.PickupDate);\r\n }\r\n if(!this.InstallMethodId){\r\n this.InstallMethodId = 0;\r\n }\r\n if(!this.InstallMethod){\r\n this.InstallMethod = {\"Id\":0,\"Text\":\"None\"};\r\n }\r\n\r\n }\r\n \r\n return KitShippingInfoModel;\r\n})","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/logistics/EditShipping/KitShippingInfoModel.tpl.html',\n '

          {{vm.Title}}

          {{vm.webformfields.Address1.FieldLabel}} is required
          {{vm.webformfields.City.FieldLabel}} is required
          {{vm.webformfields.State.FieldLabel}} is required
          {{vm.webformfields.ZipCode.FieldLabel}} is required
          0 && vm.shippingmodel.availableEducationMaterials.length > 0\">
          {{webFormFields.Phone1.FieldLabel}} is required
          0\" class=\"form-group p-b-xs m-b-xs\">
          Welcome Call Date must be a business day in the configured range
          Pickup Date must be a business day in the configured range
          0 && vm.shippingmodel.availableEducationMaterials.length > 0\">
          {{$item.Name}}{{multioption.Name}}
          = 200\">{{250 - vm.shippingmodel.Note.length}} of 250 characters remaining
          ');\n}]);\n}(window, document, window.angular));","function LogisticsRow() {\r\n\r\n function controller($scope, $uibModal, LogisticsService, MessageService, ConfigurationsService, $state, PermissionService, vhSweetAlert ) {\r\n\r\n $scope.dateFormat = ConfigurationsService.configParams.DateFormat;\r\n $scope.active = false;\r\n $scope.statusText = 'Shipped';\r\n $scope.statusOrderedIcon = 'fa fa-plus-circle';\r\n $scope.statusProcessingIcon = 'fa fa-spinner';\r\n $scope.statusShippedIcon = 'fa fa-truck fa-flip-horizontal';\r\n $scope.statusDeliveredIcon = 'fa fa-flag-checkered fa-flip-horizontal';\r\n $scope.goDeviceTypes = [];\r\n $scope.showTooltip = false;\r\n\r\n $scope.logisticsMessagingEnabled = ConfigurationsService.configParams.LogisticsMessagingEnabled;\r\n //implement when patient block gets implemented, should hide patient block when false.\r\n $scope.patientMessagingEnabled = ConfigurationsService.configParams.PatientMessagingEnabled;\r\n\r\n $scope.detailExpand = function() {\r\n console.log(\"detail expanded\");\r\n if ($scope.active === false) {\r\n if ($scope.patient.LogisticsType == 1) {\r\n setKitAudits();\r\n setMessages();\r\n }\r\n else if ($scope.patient.LogisticsType == 2) {\r\n setGoDeviceAudits();\r\n }\r\n else if ($scope.patient.LogisticsType == 3) {\r\n setGoDeviceAudits();\r\n }\r\n }\r\n $scope.active = true;\r\n }\r\n\r\n function detailCollapse() {\r\n $scope.active = false;\r\n }\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n //console.log(\"load controller method\");\r\n setPhoto();\r\n setStatus();\r\n if ($scope.expandDetails === true) {\r\n $scope.detailExpand();\r\n }\r\n setGoDeviceTypes();\r\n $scope.showMarkAsDelivered = $scope.patient.AllDevicesShipped;\r\n }\r\n\r\n function setGoDeviceTypes() {\r\n if ($scope.patient.DeviceTypes) {\r\n $scope.goDeviceTypes = $scope.patient.DeviceTypes.split(\",\");\r\n }\r\n }\r\n\r\n function setPhoto() {\r\n $scope.patientImage = $scope.patient.Photo;\r\n\r\n if ($scope.patientImage === undefined || $scope.patientImage === null || $scope.patientImage.length < 1) {\r\n if ($scope.patient.Gender === \"Female\") {\r\n $scope.patientImage = \"layout/img/female.png\";\r\n } else {\r\n $scope.patientImage = \"layout/img/male.png\";\r\n }\r\n } else {\r\n $scope.patientImage = \"data:image/png;base64,\" + $scope.patient.Photo;\r\n }\r\n }\r\n\r\n function setKitAudits() {\r\n LogisticsService.getKitAudits($scope.patient.KitShippingInfoId).then(function (audits) {\r\n $scope.audits = audits;\r\n });\r\n }\r\n\r\n function setMessages(logisticsType) {\r\n if (logisticsType == 1) {\r\n MessageService.getKitShippingMessageGroup($scope.patient.KitShippingInfoId).then(function (messageGroup) {\r\n $scope.messageGroup = messageGroup;\r\n }); \r\n }\r\n else if (logisticsType == 3) {\r\n MessageService.getLogisticsOrderMessageGroup($scope.patient.LogisticsOrderId).then(function (messageGroup) {\r\n $scope.messageGroup = messageGroup;\r\n }); \r\n }\r\n }\r\n\r\n function setGoDeviceAudits() {\r\n LogisticsService.getGoDeviceAudits($scope.patient.LogisticsOrderId).then(function (audits) {\r\n $scope.audits = audits;\r\n });\r\n }\r\n\r\n $scope.detailToggle = function () {\r\n console.log(\"load controller method\");\r\n if ($scope.active === false) {\r\n if ($scope.patient.LogisticsType == 1) {\r\n setKitAudits();\r\n setMessages(1);\r\n }\r\n else if ($scope.patient.LogisticsType == 2) {\r\n setGoDeviceAudits();\r\n }\r\n else if ($scope.patient.LogisticsType == 3) {\r\n setGoDeviceAudits();\r\n setMessages(3);\r\n }\r\n }\r\n\r\n $scope.active = !$scope.active;\r\n };\r\n\r\n $scope.formatDate = function(date){\r\n var dateString = \"\";\r\n var dateField = new Date(date);\r\n if($scope.dateFormat === \"MM/dd/yyyy\"){\r\n dateString = dateString + (dateField.getMonth()+1) +\"/\"+ (dateField.getDate())+\"/\"+dateField.getFullYear() ;\r\n }\r\n else{\r\n dateString = dateString + (dateField.getDate()) +\"/\"+ (dateField.getMonth()+1) +\"/\"+dateField.getFullYear() ;\r\n }\r\n return dateString;\r\n };\r\n\r\n // Patient selection\r\n $scope.selected = false;\r\n\r\n $scope.select = function () {\r\n $scope.selected = true;\r\n };\r\n\r\n $scope.selectToggle = function () {\r\n $scope.selected = !$scope.selected;\r\n };\r\n\r\n // Add select listener\r\n $scope.$on('selectAll', function () {\r\n $scope.selected = true;\r\n });\r\n\r\n $scope.$on('selectNone', function () {\r\n $scope.selected = false;\r\n });\r\n\r\n $scope.getCaregiver = function (obj) {\r\n var name = '';\r\n\r\n var hasFirstName = obj.FirstName.trim().length > 0;\r\n\r\n if (obj.LastName.trim().length > 0) {\r\n name += obj.LastName;\r\n\r\n if(hasFirstName) {\r\n name += ', ';\r\n }\r\n }\r\n if (hasFirstName) {\r\n name += obj.FirstName;\r\n }\r\n if (obj.Title && obj.IsTitleClinical && obj.Title !== null && obj.Title.trim().length > 0 && obj.Title !== 'null'){\r\n name += ' ' + obj.Title;\r\n }\r\n\r\n return name;\r\n };\r\n\r\n $scope.getTrackingAuditDisplay = function (obj) {\r\n var retVal = '';\r\n if (obj.OrderNumber && obj.OrderNumber.length > 0) {\r\n retVal += 'Order: ' + obj.OrderNumber;\r\n }\r\n if (obj.TrackingNumber && obj.TrackingNumber.length > 0) {\r\n if (retVal.length > 0) {\r\n retVal += ', ';\r\n }\r\n\r\n\r\n }\r\n return retVal;\r\n };\r\n $scope.getTrackingURL = function (obj){\r\n var retVal = '';\r\n if (obj.TrackingNumber && obj.TrackingNumber.length > 0) {\r\n var url = ConfigurationsService.configParams.KitTrackingURL;\r\n url = url.replace(\"%%TRACKINGNUMBER%%\",obj.TrackingNumber);\r\n retVal = url;\r\n }\r\n return retVal;\r\n };\r\n\r\n $scope.getGoDeviceTrackingURL = function (obj){\r\n var retVal = '';\r\n if (obj.TrackingNumber && obj.TrackingNumber.length > 0) {\r\n var url = \"https://www.google.com/search?q=\" + obj.TrackingNumber;\r\n retVal = url;\r\n }\r\n return retVal;\r\n };\r\n\r\n $scope.getAddress = function () {\r\n var address = '';\r\n if ($scope.patient.AddressLine1 && $scope.patient.AddressLine1.length > 0) {\r\n address += $scope.patient.AddressLine1;\r\n }\r\n if ($scope.patient.AddressLine2 && $scope.patient.AddressLine2.length > 0) {\r\n address += ' ' + $scope.patient.AddressLine2;\r\n }\r\n if ($scope.patient.City && $scope.patient.City.length > 0) {\r\n address += ', ' + $scope.patient.City;\r\n }\r\n if ($scope.patient.State && $scope.patient.State.length > 0) {\r\n address += ', ' + $scope.patient.State;\r\n }\r\n if ($scope.patient.ZipCode && $scope.patient.ZipCode.length > 0) {\r\n address += ' ' + $scope.patient.ZipCode;\r\n }\r\n return address;\r\n };\r\n\r\n $scope.openMessenger = function(messageGroup, event) {\r\n\r\n if(event && $scope.active)\r\n event.stopPropagation();\r\n\r\n // Does this message have a group already? if so go ahead and open the messanger\r\n if(messageGroup && messageGroup.MessageGroupId){\r\n MessageService.openMessenger({groupId: messageGroup.MessageGroupId});\r\n }else{// If no group, create a group and open messanger on return\r\n if ($scope.patient.LogisticsType == 1) {\r\n MessageService.createGroup($scope.patient.KitShippingInfoId).then(function(data) {\r\n $scope.messageGroup = data;\r\n MessageService.openMessenger({groupId: data.MessageGroupId});\r\n });\r\n } else if ($scope.patient.LogisticsType == 3) {\r\n MessageService.createGroup_fulfillment($scope.patient.LogisticsOrderId).then(function(data) {\r\n $scope.messageGroup = data;\r\n MessageService.openMessenger({groupId: data.MessageGroupId});\r\n });\r\n }\r\n }}\r\n\r\n $scope.goToPatientProfile = function() {\r\n if (PermissionService.userHasPermission([\"PatientDemographicsRead\"])) {\r\n $state.go('patients.patient.demographics', {patientId: $scope.patient.Patient_Id});\r\n }\r\n }\r\n\r\n $scope.markAllMessagesRead = function(messageGroup) {\r\n MessageService.markMessagesAsRead(messageGroup.MessageGroupId);\r\n //Set unread message count as 0 for this kit ship record to clear the \"unread\" icon\r\n $scope.patient.UnreadMessageCount = 0;\r\n }\r\n\r\n //SHIP METHODS\r\n function setStatus() {\r\n $scope.statusText = $scope.patient.CurrentKitStatus;\r\n if ($scope.statusText === 'Order Pending') {\r\n $scope.statusClass = '';\r\n $scope.statusIcon = '';\r\n }\r\n else if ($scope.statusText === 'Ordered') {\r\n $scope.statusClass = 'label-danger';\r\n $scope.statusIcon = $scope.statusOrderedIcon;\r\n }\r\n else if ($scope.statusText === 'In Progress') {\r\n $scope.statusClass = 'label-warning';\r\n $scope.statusIcon = $scope.statusProcessingIcon;\r\n }\r\n else if ($scope.statusText === 'Shipped') {\r\n $scope.statusClass = 'label-success';\r\n $scope.statusIcon = $scope.statusShippedIcon;\r\n }\r\n else if ($scope.statusText === 'Delivered to Patient') {\r\n $scope.statusClass = 'label-success';\r\n $scope.statusIcon = $scope.statusDeliveredIcon;\r\n }\r\n else if ($scope.statusText === 'Picked Up') {\r\n $scope.statusClass = 'label-success';\r\n $scope.statusIcon = $scope.statusShippedIcon;\r\n }\r\n else if ($scope.statusText === 'Completed') {\r\n $scope.statusClass = '';\r\n $scope.statusIcon = '';\r\n }\r\n\r\n $scope.statusTextDisplay = $scope.statusText;\r\n if ($scope.statusText == \"Delivered to Patient\") {\r\n $scope.statusTextDisplay = \"Delivered\";\r\n }\r\n }\r\n\r\n $scope.rollbackStatus = function (status) {\r\n $scope.changeStatus(status).then(function () {\r\n if ($scope.patient.LogisticsType == 1) {\r\n LogisticsService.updateShipping($scope.patient.KitShippingInfoId, $scope.patient).then(function () {\r\n setKitAudits();\r\n });\r\n } else if ($scope.patient.LogisticsType == 2 || $scope.patient.LogisticsType == 3) {\r\n setGoDeviceAudits();\r\n }\r\n });\r\n };\r\n\r\n $scope.changeStatus = function (status) {\r\n $scope.patient.CurrentKitStatus = status;\r\n\r\n if ($scope.patient.LogisticsType == 1) {\r\n return LogisticsService.updateKitStatus($scope.patient.KitNo, getStatus(status)).then(function (history) {\r\n setStatus();\r\n \r\n if (status === 'Ordered') {\r\n $scope.patient.OrderedKitStatusCreatedDateTime_UTC = history.CreatedDateTime_UTC;\r\n $scope.patient.TrackingNumber = '';\r\n $scope.patient.OrderNumber = '';\r\n }\r\n else if (status === 'In Progress') {\r\n $scope.patient.ProcessingKitStatusCreatedDateTime_UTC = history.CreatedDateTime_UTC;\r\n $scope.patient.TrackingNumber = '';\r\n }\r\n $scope.patient.CurrentKitStatusCreatedDateTime_UTC = history.CreatedDateTime_UTC;\r\n });\r\n } else if ($scope.patient.LogisticsType == 2 || $scope.patient.LogisticsType == 3) {\r\n return LogisticsService.UpdateGoDeviceOrderStatus($scope.patient.LogisticsOrderId, getStatus(status)).then(function (history) {\r\n setStatus();\r\n if (status === 'Order Pending') {\r\n $scope.patient.OrderPendingStatusCreatedDateTime_UTC = history.CreatedDateTime_UTC;\r\n $scope.patient.TrackingNumber = '';\r\n $scope.patient.OrderNumber = '';\r\n }\r\n else if (status === 'Ordered') {\r\n $scope.patient.OrderedKitStatusCreatedDateTime_UTC = history.CreatedDateTime_UTC;\r\n $scope.patient.TrackingNumber = '';\r\n $scope.patient.OrderNumber = '';\r\n }\r\n else if (status === 'In Progress') {\r\n $scope.patient.ProcessingKitStatusCreatedDateTime_UTC = history.CreatedDateTime_UTC;\r\n $scope.patient.TrackingNumber = '';\r\n }\r\n else if (status === 'Delivered to Patient') {\r\n $scope.patient.DeliveredStatusCreatedDateTime_UTC = history.CreatedDateTime_UTC;\r\n }\r\n $scope.patient.CurrentKitStatusCreatedDateTime_UTC = history.CreatedDateTime_UTC;\r\n });\r\n }\r\n \r\n };\r\n\r\n // Shipping\r\n $scope.ship = function (isEditTracking) {\r\n var modalInstance;\r\n if ($scope.patient.LogisticsType == 1) {\r\n modalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/logistics/shipped-kits.ship.tpl.html',\r\n controller: 'KitLogisticsDeliveriesShipController as vm',\r\n resolve: {\r\n tracking: function () {\r\n return {\r\n OrderNumber: $scope.patient.OrderNumber,\r\n TrackingNumber: $scope.patient.TrackingNumber\r\n };\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (tracking) {\r\n LogisticsService.shipKitToPatient($scope.patient.KitId).then(function (response) {\r\n $scope.patient.CurrentKitStatus = \"Shipped\";\r\n setStatus();\r\n if (response != null) {\r\n $scope.patient.CurrentKitStatusCreatedDateTime_UTC = response.CreatedDateTime_UTC;\r\n }\r\n LogisticsService.updateShipping($scope.patient.KitShippingInfoId, tracking).then(function () {\r\n $scope.patient.OrderNumber = tracking.OrderNumber;\r\n $scope.patient.TrackingNumber = tracking.TrackingNumber;\r\n setKitAudits();\r\n });\r\n });\r\n });\r\n } else if ($scope.patient.LogisticsType == 2 || $scope.patient.LogisticsType == 3) {\r\n LogisticsService.GetLogisticsOrder($scope.patient.LogisticsOrderId).then(function (response) {\r\n modalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/logistics/shipped-goDevices.ship.tpl.html',\r\n controller: 'GoDevicesLogisticsDeliveriesShipController as vm',\r\n size: 'lgmd',\r\n resolve: {\r\n isEditTracking: isEditTracking,\r\n order: function () {\r\n return response;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (order) {\r\n LogisticsService.ShipGoDevicesToPatient(order).then(function (response) {\r\n if (response != null) {\r\n $scope.patient.CurrentKitStatus = \"Shipped\";\r\n setStatus();\r\n //Show the first shipped device datetime\r\n if ($scope.patient.ShipKitStatusCreatedDateTime_UTC) {\r\n $scope.patient.CurrentKitStatusCreatedDateTime_UTC = $scope.patient.ShipKitStatusCreatedDateTime_UTC;\r\n } else {\r\n $scope.patient.CurrentKitStatusCreatedDateTime_UTC = response.CreatedDateTime_UTC;\r\n }\r\n $scope.patient.OrderNumber = order.OrderNumber;\r\n \r\n //Only show Mark As Delivered when all devices have tracking number\r\n $scope.showMarkAsDelivered = true;\r\n order.DeviceOrders.forEach(function(deviceOrder) {\r\n if (!deviceOrder.TrackingNumber)\r\n $scope.showMarkAsDelivered = false;\r\n }); \r\n }\r\n if ($scope.active) {\r\n setGoDeviceAudits();\r\n }\r\n });\r\n });\r\n });\r\n }\r\n \r\n };\r\n\r\n\r\n $scope.AreYouSureThisHasBeenShipped = function(){\r\n vhSweetAlert.verify( \"\",ConfigurationsService.configParams.KitEditShippedWarning, \"Yes\")\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $scope.editShipping();\r\n }\r\n });\r\n }\r\n\r\n\r\n //Edit shipping\r\n $scope.editShipping = function (){\r\n var ShippingModalInstance;\r\n if ($scope.patient.LogisticsType == 1) {\r\n ShippingModalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/logistics/EditShipping/KitShippingInfoModel.tpl.html',\r\n controller: 'KitShippingInfoController as vm',\r\n backdrop: 'static',\r\n size: 'lgmd',\r\n windowClass: 'tempClass',\r\n resolve: {\r\n patient: $scope.patient\r\n }\r\n });\r\n } else {\r\n ShippingModalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/logistics/EditShipping/goDevicesShippingInfo.tpl.html',\r\n controller: 'goDevicesShippingInfoController as vm',\r\n backdrop: 'static',\r\n size: 'md',\r\n windowClass: 'tempClass',\r\n resolve: {\r\n patient: $scope.patient\r\n }\r\n });\r\n }\r\n \r\n ShippingModalInstance.result.then(function (response) {\r\n if ($scope.active) {\r\n if ($scope.patient.LogisticsType == 1) {\r\n setKitAudits();\r\n } else if ($scope.patient.LogisticsType == 2 || $scope.patient.LogisticsType == 3) {\r\n setGoDeviceAudits();\r\n }\r\n }\r\n },\r\n function () {\r\n //console.log(\"Canceled\");\r\n });\r\n };\r\n\r\n //This function currently is only used for Device orders\r\n $scope.order = function () {\r\n $scope.changeStatus('Ordered').then(function () {\r\n if ($scope.patient.LogisticsType == 2 || $scope.patient.LogisticsType == 3) {\r\n if ($scope.active) {\r\n setGoDeviceAudits();\r\n }\r\n }\r\n });\r\n }\r\n\r\n $scope.work = function () {\r\n var modalInstance;\r\n if ($scope.patient.LogisticsType == 1) {\r\n modalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/logistics/shipped-kits.work.tpl.html',\r\n controller: 'KitLogisticsDeliveriesWorkController as vm',\r\n resolve: {\r\n logisticsType: $scope.patient.LogisticsType,\r\n tracking: function () {\r\n return {\r\n OrderNumber: $scope.patient.OrderNumber,\r\n TrackingNumber: $scope.patient.TrackingNumber\r\n };\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (tracking) {\r\n $scope.changeStatus('In Progress').then(function () {\r\n LogisticsService.updateShipping($scope.patient.KitShippingInfoId, tracking).then(function () {\r\n $scope.patient.OrderNumber = tracking.OrderNumber;\r\n setKitAudits();\r\n });\r\n });\r\n });\r\n } else if ($scope.patient.LogisticsType == 2 || $scope.patient.LogisticsType == 3) {\r\n LogisticsService.GetLogisticsOrder($scope.patient.LogisticsOrderId).then(function (response) {\r\n modalInstance = $uibModal.open({\r\n templateUrl: 'modules/kit_logistics/logistics/shipped-goDevices.work.tpl.html',\r\n controller: 'GoDevicesLogisticsDeliveriesWorkController as vm',\r\n resolve: {\r\n order: function () {\r\n return response;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (order) {\r\n LogisticsService.MarkDeviceOrdersInProgress(order).then(function (response) {\r\n if (response != null) {\r\n $scope.patient.CurrentKitStatus = \"In Progress\";\r\n setStatus();\r\n $scope.patient.CurrentKitStatusCreatedDateTime_UTC = response.CreatedDateTime_UTC;\r\n }\r\n if ($scope.active) {\r\n setGoDeviceAudits();\r\n }\r\n });\r\n //});\r\n });\r\n });\r\n }\r\n \r\n };\r\n\r\n //This function currently is only used for +Go Device orders\r\n $scope.deliver = function () {\r\n $scope.changeStatus('Delivered to Patient').then(function () {\r\n if ($scope.patient.LogisticsType == 2 || $scope.patient.LogisticsType == 3) {\r\n if ($scope.active) {\r\n setGoDeviceAudits();\r\n }\r\n }\r\n });\r\n }\r\n\r\n //This function currently is only used for +Go Device orders\r\n $scope.complete = function () {\r\n $scope.changeStatus('Completed').then(function () {\r\n if ($scope.patient.LogisticsType == 2 || $scope.patient.LogisticsType == 3) {\r\n if ($scope.active) {\r\n setGoDeviceAudits();\r\n }\r\n }\r\n });\r\n }\r\n\r\n function getStatus(status) {\r\n var retVal = 5;\r\n\r\n if (status === 'Order Pending') {\r\n retVal = 16;\r\n }\r\n else if (status === 'Ordered') {\r\n retVal = 8;\r\n }\r\n else if (status === 'In Progress') {\r\n retVal = 9;\r\n }\r\n else if (status === 'Delivered to Patient') {\r\n retVal = 13;\r\n }\r\n else if (status === 'Completed') {\r\n retVal = 17;\r\n }\r\n else if (status === 'Picked Up') {\r\n retVal = 27;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n //PICKUP METHODS\r\n $scope.getStatusLabelClass = function(status) {\r\n if (status === 'Hold') {\r\n return 'label-warning';\r\n } else if (status === 'Lost') {\r\n return 'label-danger';\r\n } else if (status === 'Dirty') {\r\n return 'label-danger';\r\n } else if (status === 'Broken') {\r\n return 'label-danger';\r\n } else if (status === 'Reprocessing') {\r\n return 'label-warning';\r\n } else if (status === 'Shipped') {\r\n return 'label-success'\r\n } else if (status === 'Delivered to Logistics') {\r\n return 'label-warning';\r\n } else if (status === 'Delivered to Customer') {\r\n return 'label-success';\r\n } else if (status === 'Picked Up') {\r\n return 'label-success'\r\n }\r\n }\r\n\r\n $scope.getStatusIcon = function(status) {\r\n if (status === 'Hold') {\r\n return 'fa fa-spinner';\r\n } else if (status === 'Lost') {\r\n return 'fa fa-exclamation-triangle';\r\n } else if (status === 'Dirty') {\r\n return 'fa fa-plus-circle';\r\n } else if (status === 'Broken') {\r\n return 'fa fa-exclamation-circle';\r\n } else if (status === 'Reprocessing') {\r\n return 'fa fa-spinner';\r\n } else if (status === 'Shipped') {\r\n return 'fa fa-truck fa-flip-horizontal';\r\n } else if (status === 'Delivered to Logistics') {\r\n return 'fa fa-truck fa-flip-horizontal';\r\n } else if (status === 'Delivered to Customer') {\r\n return 'fa fa-truck fa-flip-horizontal';\r\n } else if (status === 'Picked Up') {\r\n return 'fa fa-truck fa-flip-horizontal';\r\n }\r\n }\r\n\r\n $scope.markProcessing = function() {\r\n LogisticsService.updateKitStatus($scope.patient.KitNo, 6).then(function(data) {\r\n if (data === null) {\r\n vhSweetAlert.error('Kit not found', 'Kit ' + $scope.patient.KitNo + ' not found.');\r\n }\r\n\r\n var tracking = {\r\n OrderNumber: $scope.patient.OrderNumber,\r\n TrackingNumber: $scope.patient.TrackingNumber\r\n }\r\n\r\n LogisticsService.updateShipping($scope.patient.KitShippingInfoId, tracking).then(function () {\r\n detailCollapse();\r\n $scope.patient.LastKitStatus2 = $scope.patient.LastKitStatus;\r\n $scope.patient.LastKitStatusCreatedDateTime_UTC2 = $scope.patient.LastKitStatusCreatedDateTime_UTC;\r\n $scope.patient.LastKitStatus = $scope.patient.CurrentKitStatus;\r\n $scope.patient.LastKitStatusCreatedDateTime_UTC = $scope.patient.CurrentKitStatusCreatedDateTime_UTC;\r\n $scope.patient.CurrentKitStatus = 'Reprocessing';\r\n $scope.patient.CurrentKitStatusCreatedDateTime_UTC = new Date();\r\n\r\n });\r\n });\r\n };\r\n\r\n $scope.markReceived = function() {\r\n LogisticsService.updateKitStatus($scope.patient.KitNo, 1).then(function(data) {\r\n if (data === null) {\r\n vhSweetAlert.error('Kit not found', 'Kit ' + $scope.patient.KitNo + ' not found.');\r\n } else {\r\n $scope.patient.CurrentKitStatus = 'Available';\r\n }\r\n });\r\n }\r\n\r\n $scope.removeKit = function() {\r\n LogisticsService.deleteKitShippingInfo($scope.patient.KitShippingInfoId).then(function(data) {\r\n if (data != null) {\r\n $scope.patient.CurrentKitStatus = 'Available';\r\n }\r\n });\r\n };\r\n\r\n $scope.markKitLost = function() {\r\n LogisticsService.updateKitStatus($scope.patient.KitNo, 11).then(function(data) {\r\n if (data === null) {\r\n vhSweetAlert.error('Kit not found', 'Kit ' + $scope.patient.KitNo + ' not found.');\r\n } else {\r\n $scope.patient.CurrentKitStatus = 'Lost';\r\n }\r\n });\r\n }\r\n\r\n $scope.hasGoDevice = function(id) {\r\n var retVal = false;\r\n if ($scope.goDeviceTypes) {\r\n $scope.goDeviceTypes.forEach(function (typeId) {\r\n if (typeId == id) {\r\n retVal = true;\r\n }\r\n });\r\n }\r\n return retVal;\r\n }\r\n\r\n $scope.showHideTooltip = function(show) {\r\n $scope.showTooltip = show;\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n patient: \"=deliveryPatient\",\r\n expandDetails: \"=\"\r\n },\r\n templateUrl: 'modules/kit_logistics/logistics/logistics-row/logistics-row.tpl.html'\r\n };\r\n}\r\n\r\nangular.module(\"kit_logistics.logistics\").directive(\"logisticsRow\", LogisticsRow);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/logistics/logistics-row/logistics-row.tpl.html',\n '

          \"image\"
          {{patient.LastName}}, {{patient.FirstName}} (Kit: {{patient.KitNo}} {{patient.KitDisplayDetails}})  0\"> 
          {{patient.ServiceLevel}} | Kit Type: {{patient.KitTypeName}}| Assigned: {{patient.ServiceLevelCreatedDateTime_UTC | datetime}} at {{patient.ServiceLevelCreatedDateTime_UTC | date : \"HH:mm\"}} | {{patient.InstallMethod}} {{patient.ServiceLevel}} | Unassigned: {{patient.ServiceLevelUnassignedTime_UTC | datetime}} at {{patient.ServiceLevelUnassignedTime_UTC | date : \"HH:mm\"}} | {{patient.KitPickupOption}} {{patient.ServiceLevel}} | Wt BP SpO2 BS Temp | Assigned: {{patient.ServiceLevelCreatedDateTime_UTC | datetime}} at {{patient.ServiceLevelCreatedDateTime_UTC | date : \"HH:mm\"}} {{patient.ServiceLevel}} | Assigned: {{patient.ServiceLevelCreatedDateTime_UTC | datetime}} at {{patient.ServiceLevelCreatedDateTime_UTC | date : \"HH:mm\"}} | Shipped: {{patient.CurrentKitStatusCreatedDateTime_UTC | datetime}} at {{patient.CurrentKitStatusCreatedDateTime_UTC | date : \"HH:mm\"}}
          {{patient.Hospital}} | {{ patient.Phone | tel}}| {{ patient.Phone2 | tel}} | {{getAddress()}}No Address
          Order Pending
          {{patient.OrderPendingStatusCreatedDateTime_UTC | datetime}} at {{patient.OrderPendingStatusCreatedDateTime_UTC | date : \"HH:mm\"}}
          Ordered
          {{patient.OrderedKitStatusCreatedDateTime_UTC | datetime}} at {{patient.OrderedKitStatusCreatedDateTime_UTC | date : \"HH:mm\"}}
          In Progress
          {{patient.ProcessingKitStatusCreatedDateTime_UTC | datetime}} at {{patient.ProcessingKitStatusCreatedDateTime_UTC | date : \"HH:mm\"}}
          Shipped
          {{patient.ShipKitStatusCreatedDateTime_UTC | datetime}} at {{patient.ShipKitStatusCreatedDateTime_UTC | date : \"HH:mm\"}}
          {{patient.CurrentKitStatusCreatedDateTime_UTC | datetime}} at {{patient.CurrentKitStatusCreatedDateTime_UTC | date: \"HH:mm\"}}
          Order: {{patient.OrderNumber}} Tracking: {{patient.TrackingNumber}}
          Mark Received Mark Delivered Mark as In Progress Ship To Patient
          Waiting for Use...
          {{patient.LastKitStatus2}}
          {{patient.LastKitStatusCreatedDateTime_UTC2 | datetime}} at {{patient.LastKitStatusCreatedDateTime_UTC2 | date : \"HH:mm\"}}
          {{patient.LastKitStatus}}
          {{patient.LastKitStatusCreatedDateTime_UTC | datetime}} at {{patient.LastKitStatusCreatedDateTime_UTC | date : \"HH:mm\"}}
          {{patient.CurrentKitStatus}}
          {{patient.CurrentKitStatusCreatedDateTime_UTC | datetime}} at {{patient.CurrentKitStatusCreatedDateTime_UTC | date: \"HH:mm\"}}
          Order: {{patient.OrderNumber}} Tracking: {{patient.TrackingNumber}}
          Reprocessing Receive Kit

          Delivery History

          Date / TimeActionByTracking
          {{audit.CreatedDateTime_UTC | datetime}} at {{audit.CreatedDateTime_UTC | date: \"HH:mm\"}} (Current){{getCaregiver(audit)}}{{getTrackingAuditDisplay(audit)}} {{audit.TrackingNumber}}
          Date / TimeDeviceStatusActionByTracking
          {{audit.CreatedDateTime_UTC | datetime}} at {{audit.CreatedDateTime_UTC | date: \"HH:mm\"}}{{audit.DeviceName}}{{audit.LogisticsStatus}} (Current){{getCaregiver(audit)}}{{audit.TrackingNumber}}

          Messages

          Date / TimeMessageBy Acknowledge / Send Message 0\" class=\"text-right\" width=\"15%\"> Mark All Messages Read
          {{message.CreatedDateTime_UTC | datetime}} at {{message.CreatedDateTime_UTC | date: \"HH:mm\"}}{{message.Text | dateInString}} (Current) Read by Logistics {{formatDate(message.DateReadBy)}} Read by {{message.ReadBy}} {{formatDate(message.DateReadBy)}}{{message.CreatedBy_Name}}
          ');\n}]);\n}(window, document, window.angular));","function LogisticsController(LogisticsService, ConfigurationsService, $window, $stateParams, vhSweetAlert, searchableFields, lodash) {\r\n var vm = this;\r\n vm.pageTitle = 'Ship/Pickup';\r\n vm.sortBy = 'numberDays';\r\n vm.sortByText = 'Status Date';\r\n vm.sortByDirection = 'DESC';\r\n if ($stateParams.filterBy == 'myUnreadMessages') {\r\n vm.filterBy = 'myUnreadMessages';\r\n vm.filterByText = 'My Unread Messages';\r\n }\r\n else if ($stateParams.filterBy == 'allUnreadMessages'){\r\n vm.filterBy = 'allUnreadMessages';\r\n vm.filterByText = 'All Unread Messages';\r\n } \r\n else {\r\n vm.filterBy = 'all';\r\n vm.filterByText = 'All';\r\n }\r\n vm.page = 1;\r\n vm.pageSize = 10;\r\n vm.searchText = '';\r\n vm.expandDetails = false;\r\n vm.recordType = 'Current';\r\n \r\n vm.searchableFields = {\r\n FirstName: 'First Name',\r\n LastName: 'Last Name',\r\n KitNumber: 'Kit Number',\r\n HospitalId: 'Hospital',\r\n Id: 'Patient Encounter ID',\r\n Status: 'Status',\r\n StatusChangeDate: 'Status Change Date',\r\n KitPickupOption: 'Pickup Option'\r\n };\r\n\r\n for (let field of searchableFields) {\r\n if (vm.searchableFields.hasOwnProperty(field.FieldName)) {\r\n vm.searchableFields[field.FieldName] = field.FieldLabel;\r\n }\r\n }\r\n\r\n var getUseMarkMessagesByCaregiver = function(){\r\n var promise = new Promise(function(resolve, reject){\r\n if(vm.useMarkMessagesByCaregiver != null){\r\n resolve(vm.useMarkMessagesByCaregiver);\r\n }else{\r\n ConfigurationsService.getConfig().then(function(data) {\r\n vm.useMarkMessagesByCaregiver = data.MarkLogisticsMessageAsReadForAllEnabled === false;\r\n resolve(vm.useMarkMessagesByCaregiver);\r\n });\r\n }\r\n });\r\n\r\n return promise;\r\n }\r\n\r\n vm.isAudit = function() {\r\n return vm.recordType == 'All';\r\n }\r\n\r\n vm.loadOrders = function() {\r\n\r\n var searchText = 'filter=' + vm.filterBy;\r\n \r\n // if(!vm.useMarkMessagesByCaregiver)\r\n searchText += ' & isAudit=' + vm.isAudit();\r\n\r\n if (vm.searchText) {\r\n if (vm.searchText.indexOf('=') < 0) {\r\n searchText += ' & DEFAULT = ' + vm.searchText;\r\n }\r\n else {\r\n searchText += ' & ' + vm.searchText;\r\n }\r\n\r\n }\r\n\r\n LogisticsService.GetKitShippingInfo(vm.page,vm.sortBy,vm.pageSize,searchText).then(function (data) {\r\n vm.deliveries = data.Response;\r\n vm.pageDisplay = {\r\n start: data.Response.length == 0 ? 0 : ((vm.page - 1) * 10) + 1,\r\n stop: data.TotalCount < ((vm.page - 1) * 10) + 10 ? data.TotalCount : ((vm.page - 1) * 10) + 10,\r\n total: data.TotalCount\r\n };\r\n\r\n $window.scrollTo(0, 0);\r\n });\r\n }\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n getUseMarkMessagesByCaregiver().then(useMarkMessagesByCaregiver => {\r\n if ($stateParams.patientId !== undefined) {\r\n vm.searchText = 'PatientId = ' + $stateParams.patientId;\r\n vm.sortBy = 'createdDate';\r\n vm.sortByText = 'Created Date';\r\n vm.sortByDirection = 'DESC';\r\n }\r\n if ($stateParams.filterBy !== undefined) {\r\n vm.filterBy = $stateParams.filterBy;\r\n }\r\n vm.loadOrders();\r\n });\r\n }\r\n\r\n vm.refresh = function() {\r\n vm.page = 1;\r\n vm.searchText = \"\";\r\n vm.expandDetails = false;\r\n vm.loadOrders();\r\n };\r\n\r\n vm.search = function() {\r\n vm.page = 1;\r\n vm.expandDetails = false;\r\n vm.activeSearch = vm.searchText.length > 0;\r\n\r\n if (vm.isAudit()) {\r\n //A special sort specifically for looking at historical records.\r\n vm.sortBy = 'createdDate';\r\n vm.sortByText = 'Created Date';\r\n vm.sortByDirection = 'DESC';\r\n } else {\r\n vm.sortBy = 'numberDays';\r\n vm.sortByText = 'Status Date';\r\n vm.sortByDirection = 'DESC';\r\n }\r\n vm.loadOrders();\r\n };\r\n\r\n vm.searchTextKeypressed = function(keyEvent) {\r\n if(keyEvent.which === 13) //Enter key pressed\r\n {\r\n vm.search();\r\n }\r\n };\r\n\r\n vm.switchSort = function(sortBy, sortByText, sortByDirection) {\r\n if (vm.filterBy == 'goDevices' && sortBy == 'kitNumber'){\r\n return;\r\n }\r\n vm.page = 1;\r\n vm.sortBy = sortBy;\r\n vm.sortByText = sortByText;\r\n vm.sortByDirection = sortByDirection;\r\n vm.expandDetails = false;\r\n vm.loadOrders();\r\n };\r\n\r\n vm.switchFilter = function(filterBy, filterByText) {\r\n if (filterBy == 'goDevices' && vm.sortBy == 'kitNumber'){\r\n vm.sortBy = 'numberDays';\r\n vm.sortByText = 'Status Date';\r\n vm.sortByDirection = 'DESC';\r\n }\r\n vm.page = 1;\r\n vm.filterBy = filterBy;\r\n vm.filterByText = filterByText;\r\n vm.expandDetails = false;\r\n vm.loadOrders();\r\n }\r\n\r\n vm.clearSearch = function() {\r\n vm.searchText = '';\r\n vm.search();\r\n }\r\n \r\n vm.filterSearch = function(text) {\r\n var matchingSearches = lodash(vm.searchableFields)\r\n .filter(field => field.toUpperCase().indexOf(text.toUpperCase()) >= 0 || text == '.')\r\n .map(field => field + ' = ')\r\n .value(); \r\n\r\n return matchingSearches;\r\n }\r\n\r\n var searchHelpTemplate = `\r\n
          \r\n
            \r\n
          • ${vm.searchableFields.FirstName}
          • \r\n
          • ${vm.searchableFields.LastName}
          • \r\n
          • ${vm.searchableFields.KitNumber} (number)
          • \r\n
          • ${vm.searchableFields.HospitalId}
          • \r\n
          • ${vm.searchableFields.Id} (number)
          • \r\n
          • ${vm.searchableFields.Status}
          • \r\n
          • ${vm.searchableFields.StatusChangeDate} (date)
          • \r\n
          • ${vm.searchableFields.KitPickupOption}
          • \r\n
          \r\n

          Searching without a key will try to match on Name (First or Last) that begins with the value, a Kit Number exactly, or an ${vm.searchableFields.Id} exactly.\r\n

          Search supports the = operator.
          Example: ${vm.searchableFields.KitNumber} = 100001

          \r\n
          `;\r\n\r\n vm.openSearchHelp = function() {\r\n vhSweetAlert({\r\n title: 'Search Keywords',\r\n html: true,\r\n text: searchHelpTemplate\r\n });\r\n }\r\n\r\n}\r\n\r\n\r\nangular.module('kit_logistics.logistics').controller('LogisticsController', LogisticsController);\r\n","function LogisticsService($http) {\r\n function GetKitShippingInfo(pageNumber,sortBy,pageSize,searchText) {\r\n return $http.get(\"/api/cgp/Logistics/GetLogistics\", {params: {pageSize: pageSize, pageNumber: pageNumber, filterBy: searchText, sortBy: sortBy}}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetSearchableFields() {\r\n return $http.get('/api/WebFormField').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetKitAudits(kitShippingInfoId) {\r\n return $http.get('/api/cgp/audit?id=' + kitShippingInfoId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetGoDeviceAudits(logisticsOrderId) {\r\n return $http.get('/api/cgp/logistics/deviceaudit/' + logisticsOrderId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function UpdateShipping(id, shipping) {\r\n return $http.post('/api/kitshippinginfo/' + id + '/tracking', JSON.stringify(shipping)).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function UpdateKitShippingModel(KitShippingInfoModel) {\r\n return $http.post('/api/kitshippinginfo', JSON.stringify(KitShippingInfoModel)).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function UpdateKitStatus(kitNo, status) {\r\n return $http.post('/api/KitStatus?kitNo=' + kitNo + '&kitStatus=' + status).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function UpdateGoDeviceOrderStatus(orderId, status) {\r\n return $http.post('/api/cgp/logistics/orders/' + orderId + '/status/' + status).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function ShipKitToPatient(id) {\r\n return $http.post('/api/KitLocation/MoveKit', {KitId: id, KitStatusId: 5, KitLocationTypeId: 3}).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function DeleteKitShippingInfo(kitShippingInfoId) {\r\n return $http.delete('/api/kitshippinginfo?kitShippingInfoId=' + kitShippingInfoId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetkitshippinginfoForKitInfoId(KitShippingInfoId){\r\n return $http.get('/api/kitshippinginfo?kitShippingInfoId='+KitShippingInfoId);\r\n }\r\n\r\n function GetLogisticsOrder(logisticsOrderId) {\r\n return $http.get('/api/cgp/logistics/orders/' + logisticsOrderId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function UpdateLogisticsOrderShippingInfo(logisticsOrderId, goDevicesShippingInfoModel) {\r\n return $http.post('/api/cgp/logistics/orders/' + logisticsOrderId + '/shippinginfo', JSON.stringify(goDevicesShippingInfoModel)).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function MarkDeviceOrdersInProgress(logisticsOrder) {\r\n return $http.put('/api/cgp/logistics/orders/process', JSON.stringify(logisticsOrder)).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function ShipGoDevicesToPatient(logisticsOrder) {\r\n return $http.put('/api/cgp/logistics/orders/ship', JSON.stringify(logisticsOrder)).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n GetKitShippingInfo: GetKitShippingInfo,\r\n GetSearchableFields: GetSearchableFields,\r\n getKitAudits: GetKitAudits,\r\n getGoDeviceAudits: GetGoDeviceAudits,\r\n updateShipping: UpdateShipping,\r\n updateKitStatus: UpdateKitStatus,\r\n shipKitToPatient: ShipKitToPatient,\r\n deleteKitShippingInfo: DeleteKitShippingInfo,\r\n GetkitshippinginfoForKitInfoId:GetkitshippinginfoForKitInfoId,\r\n UpdateKitShippingModel:UpdateKitShippingModel,\r\n GetLogisticsOrder: GetLogisticsOrder,\r\n UpdateLogisticsOrderShippingInfo: UpdateLogisticsOrderShippingInfo,\r\n UpdateGoDeviceOrderStatus: UpdateGoDeviceOrderStatus,\r\n MarkDeviceOrdersInProgress: MarkDeviceOrdersInProgress,\r\n ShipGoDevicesToPatient: ShipGoDevicesToPatient\r\n }\r\n}\r\nangular.module('kit_logistics.logistics').service('LogisticsService', LogisticsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/logistics/logistics.tpl.html',\n '

          {{vm.pageTitle}}

          1. Viewing {{vm.pageDisplay.start}}-{{vm.pageDisplay.stop}} of {{vm.pageDisplay.total}}
          ');\n}]);\n}(window, document, window.angular));","function GoDevicesLogisticsDeliveriesShipController(isEditTracking, order, $uibModalInstance) {\r\n var vm = this;\r\n \r\n vm.isEditTracking = isEditTracking;\r\n vm.logisticsOrder = order;\r\n vm.deviceOrders = vm.logisticsOrder.DeviceOrders;\r\n vm.isRequired = true;\r\n\r\n vm.onTrackingNumberChange = function() {\r\n vm.isRequired = true;\r\n vm.deviceOrders.forEach(function(order) {\r\n if (order.TrackingNumber)\r\n vm.isRequired = false;\r\n }); \r\n }\r\n\r\n vm.ok = function(isValid) {\r\n if(isValid) {\r\n $uibModalInstance.close(vm.logisticsOrder);\r\n }\r\n };\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.logistics').controller('GoDevicesLogisticsDeliveriesShipController', GoDevicesLogisticsDeliveriesShipController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/logistics/shipped-goDevices.ship.tpl.html',\n '

          +Go Devices Shipping

          Are you ready to ship the selected devices?

          Enter the tracking number you will be using to ship each device to the patient.

          DeviceOrder NumberTracking Number (at least one required)
          ');\n}]);\n}(window, document, window.angular));","function GoDevicesLogisticsDeliveriesWorkController(order, $uibModalInstance) {\r\n var vm = this;\r\n\r\n vm.logisticsOrder = order;\r\n vm.deviceOrders = vm.logisticsOrder.DeviceOrders;\r\n vm.isRequired = true;\r\n\r\n vm.onOrderNumberChange = function() {\r\n vm.isRequired = true;\r\n vm.deviceOrders.forEach(function(order) {\r\n if (order.OrderNumber)\r\n vm.isRequired = false;\r\n }); \r\n }\r\n\r\n vm.ok = function(isValid) {\r\n if(isValid) {\r\n $uibModalInstance.close(vm.logisticsOrder);\r\n }\r\n };\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.logistics').controller('GoDevicesLogisticsDeliveriesWorkController', GoDevicesLogisticsDeliveriesWorkController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/logistics/shipped-goDevices.work.tpl.html',\n '

          Work +Go Devices Order

          Are you ready to begin working the +Go Devices order?

          Enter the order number you will be using to process each device order.


           
          ');\n}]);\n}(window, document, window.angular));","function KitLogisticsDeliveriesShipController(tracking, $uibModalInstance) {\r\n var vm = this;\r\n\r\n vm.tracking = tracking;\r\n\r\n vm.ok = function(isValid) {\r\n if(isValid) {\r\n $uibModalInstance.close(vm.tracking);\r\n }\r\n };\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.logistics').controller('KitLogisticsDeliveriesShipController', KitLogisticsDeliveriesShipController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/logistics/shipped-kits.ship.tpl.html',\n '

          Kit Shipping

          Are you ready to ship the selected kit?

          Enter the tracking number you will be using to ship this kit to the patient.

          ');\n}]);\n}(window, document, window.angular));","function KitLogisticsDeliveriesWorkController(logisticsType, tracking, $uibModalInstance) {\r\n var vm = this;\r\n\r\n vm.tracking = tracking;\r\n\r\n vm.ok = function() {\r\n $uibModalInstance.close(vm.tracking);\r\n };\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.logistics').controller('KitLogisticsDeliveriesWorkController', KitLogisticsDeliveriesWorkController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/logistics/shipped-kits.work.tpl.html',\n '

          Work Kit Order

          Are you ready to begin working the kit order?

          Enter the order number you will be using to process this kit order.

          ');\n}]);\n}(window, document, window.angular));","function KitLogisticsProvisioningController(kits, KitLogisticsProvisioningService, lodash) {\r\n var vm = this;\r\n\r\n vm.kits = kits;\r\n vm.isProvisioning = false;\r\n vm.provisionKit = provisionKit;\r\n\r\n function provisionKit(kitId) {\r\n vm.isProvisioning = true;\r\n\r\n KitLogisticsProvisioningService.provisionKit(kitId).then(function (data) {\r\n var kitIndex = lodash.findIndex(vm.kits, function(kit) { return kit.KitId == kitId; });\r\n vm.kits[kitIndex].Status = data.Status;\r\n vm.isProvisioning = false;\r\n\r\n if (vm.kits[kitIndex].Status == 'Provisioning Successful') {\r\n vm.kits[kitIndex].textClass = 'provisionSuccessfulText';\r\n } else if (vm.ktis[kitIndex].Status == 'Provisioning Failed') {\r\n vm.kits[kitIndex].textClass = 'provisionFailedText';\r\n }\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module('kit_logistics.provisioning').controller('KitLogisticsProvisioningController', KitLogisticsProvisioningController);\r\n","function KitLogisticsProvisioningService(KitProvisioningRepository, lodash) {\r\n return {\r\n getKits: function() {\r\n return KitProvisioningRepository.getAll();\r\n },\r\n\r\n provisionKit: function(kitId) {\r\n return KitProvisioningRepository.provision(kitId);\r\n }\r\n };\r\n}\r\n\r\nangular.module('kit_logistics.provisioning').factory('KitLogisticsProvisioningService', KitLogisticsProvisioningService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/provisioning/provisioning.tpl.html',\n '

          No kits to provision.

          Kits to be provisioned
          Kit NumberIMEIICCIMSIStatus
          {{kit.KitNo}}{{kit.IMEI}}{{kit.ICC}}{{kit.IMSI}}{{kit.Status}}
          ');\n}]);\n}(window, document, window.angular));","function InboundKitsDirective(InboundService, $state, PermissionService) {\r\n return {\r\n replace: true,\r\n templateUrl: \"modules/kit_logistics/receive-kits/receive-kits-kits.tpl.html\",\r\n scope: {\r\n kit: \"=\",\r\n receiveKit: \"&\",\r\n undoKit: \"&\"\r\n },\r\n link: function(scope, elem, attrs) {\r\n scope.userHasWritePermission = function() {\r\n return PermissionService.userHasPermission(['ReceiveKitsWrite']);\r\n };\r\n }\r\n };\r\n}\r\nangular.module(\"kit_logistics.receive-kits\").directive(\"receiveKits\", InboundKitsDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/receive-kits/receive-kits-kits.tpl.html',\n '
          {{kit.KitNumber}}
          Tracking Number: {{kit.TrackingNumber}}
          Location: {{kit.LocationName}}
          Last Patient: {{kit.LastPatientName}}
          Inbound Delivered Received
          {{kit.ShippedDateTime_UTC | datetime}} at {{kit.ShippedDateTime_UTC | date: \"HH:mm\"}}
          {{kit.StatusChangeDate_UTC | datetime}} at {{kit.StatusChangeDate_UTC | date: \"HH:mm\"}}
          Receive Kit Undo');\n}]);\n}(window, document, window.angular));","function InboundController(inboundContent, InboundService, vhSweetAlert, $state, lodash, PermissionService) {\r\n var ivm = this;\r\n ivm.inboundKits = inboundContent.InboundKitDeliveries;\r\n ivm.availableKits = inboundContent.KitsAvailableToday;\r\n ivm.kitToReceive = \"\";\r\n ivm.receiveKit = receiveKit;\r\n ivm.undoKit = undoKit;\r\n ivm.refresh = refresh;\r\n ivm.inboundOrderBy = '-ShippedDateTime_UTC';\r\n ivm.orderInboundKits = orderInboundKits;\r\n ivm.receivedOrderBy = '-StatusChangeDate_UTC';\r\n ivm.orderReceivedKits = orderReceivedKits;\r\n ivm.userHasWritePermission = userHasWritePermission;\r\n\r\n function receiveKit(kitNumber) {\r\n var kitNumberToReceive = '';\r\n if (!kitNumber && ivm.kitToReceive.length === 0) {\r\n return;\r\n } else if (kitNumber !== undefined) {\r\n kitNumberToReceive = kitNumber;\r\n } else if (ivm.kitToReceive.length > 0) {\r\n kitNumberToReceive = ivm.kitToReceive;\r\n }\r\n\r\n var receivedKit = lodash.remove(ivm.inboundKits, function(kit) {\r\n return kit.KitNumber.toUpperCase() === kitNumberToReceive.toUpperCase();\r\n });\r\n\r\n if (receivedKit.length > 0) {\r\n ivm.availableKits.push(receivedKit[0]);\r\n }\r\n\r\n ivm.kitToReceive = \"\";\r\n\r\n InboundService.changeKitStatus(kitNumberToReceive, 1).then(function(data) {\r\n if (data === null) {\r\n vhSweetAlert.error('Kit not found', 'Kit ' + kitNumberToReceive + ' not found.')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n refresh();\r\n }\r\n }\r\n );\r\n } else {\r\n refresh();\r\n }\r\n }).catch(function(rejection) {\r\n if (rejection.status === 409) {\r\n rejection.preventDefault();\r\n vhSweetAlert.error(\"Error receiving kit\", rejection.data.ErrorMessage)\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n refresh();\r\n }\r\n }\r\n );\r\n }\r\n });\r\n }\r\n\r\n function undoKit(kit) {\r\n vhSweetAlert.verify('Are you sure?', \"Are you sure you want to undo the kit delivery?\", \"Undo\")\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n InboundService.changeKitStatus(kit.KitNumber, kit.LastKitStatusId).then(function (data) {\r\n refresh();\r\n });\r\n }\r\n });\r\n }\r\n\r\n function orderInboundKits(orderBy) {\r\n if (ivm.inboundOrderBy === 'ShippedDateTime_UTC' && orderBy === 'ShipDate') {\r\n ivm.inboundOrderBy = '-ShippedDateTime_UTC';\r\n } else if (ivm.inboundOrderBy === '-ShippedDateTime_UTC' && orderBy === 'ShipDate') {\r\n ivm.inboundOrderBy = 'ShippedDateTime_UTC';\r\n } else if (ivm.inboundOrderBy === 'KitNumber' && orderBy === 'KitNumber') {\r\n ivm.inboundOrderBy = '-KitNumber';\r\n } else if (ivm.inboundOrderBy === '-KitNumber' && orderBy === 'KitNumber') {\r\n ivm.inboundOrderBy = 'KitNumber';\r\n } else if (ivm.inboundOrderBy === '-LocationName' && orderBy === 'Location') {\r\n ivm.inboundOrderBy = 'LocationName';\r\n } else if (ivm.inboundOrderBy === 'LocationName' && orderBy === 'Location') {\r\n ivm.inboundOrderBy = '-LocationName';\r\n } else if (orderBy === 'ShipDate') {\r\n ivm.inboundOrderBy = 'ShippedDateTime_UTC';\r\n } else if (orderBy === 'KitNumber') {\r\n ivm.inboundOrderBy = 'KitNumber';\r\n } else if (orderBy === 'Location') {\r\n ivm.inboundOrderBy = 'LocationName';\r\n }\r\n }\r\n\r\n function orderReceivedKits(orderBy) {\r\n if (ivm.receivedOrderBy === 'StatusChangeDate_UTC' && orderBy === 'ShipDate') {\r\n ivm.receivedOrderBy = '-StatusChangeDate_UTC';\r\n } else if (ivm.receivedOrderBy === '-StatusChangeDate_UTC' && orderBy === 'ShipDate') {\r\n ivm.receivedOrderBy = 'StatusChangeDate_UTC';\r\n } else if (ivm.receivedOrderBy === 'KitNumber' && orderBy === 'KitNumber') {\r\n ivm.receivedOrderBy = '-KitNumber';\r\n } else if (ivm.receivedOrderBy === '-KitNumber' && orderBy === 'KitNumber') {\r\n ivm.receivedOrderBy = 'KitNumber';\r\n } else if (ivm.receivedOrderBy === '-LocationName' && orderBy === 'Location') {\r\n ivm.receivedOrderBy = 'LocationName';\r\n } else if (ivm.receivedOrderBy === 'LocationName' && orderBy === 'Location') {\r\n ivm.receivedOrderBy = '-LocationName';\r\n } else if (orderBy === 'ShipDate') {\r\n ivm.receivedOrderBy = 'StatusChangeDate_UTC';\r\n } else if (orderBy === 'KitNumber') {\r\n ivm.receivedOrderBy = 'KitNumber';\r\n } else if (orderBy === 'Location') {\r\n ivm.receivedOrderBy = 'LocationName';\r\n }\r\n }\r\n\r\n function refresh() {\r\n InboundService.getInboundContent().then(function(data) {\r\n inboundContent = data;\r\n ivm.inboundKits = inboundContent.InboundKitDeliveries;\r\n ivm.availableKits = inboundContent.KitsAvailableToday;\r\n });\r\n }\r\n\r\n function userHasWritePermission() {\r\n return PermissionService.userHasPermission(['ReceiveKitsWrite']);\r\n }\r\n\r\n}\r\nangular.module(\"kit_logistics.receive-kits\").controller(\"InboundController\", InboundController);\r\n","function InboundService($http) {\r\n function getInboundContent() {\r\n return $http.get(\"/api/cgp/delivery/inbound\").then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n \r\n function changeKitStatus(kitNo, status) {\r\n return $http.post('/api/KitStatus?kitNo=' + kitNo + '&kitStatus=' + status).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getInboundContent: getInboundContent,\r\n changeKitStatus: changeKitStatus\r\n };\r\n}\r\nangular.module(\"kit_logistics.receive-kits\").factory(\"InboundService\", InboundService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/kit_logistics/receive-kits/receive-kits.tpl.html',\n '

          Receive Kits

          Inbound Kits ({{ivm.inboundKits.length}})
          Received Kits ({{ivm.availableKits.length}})
          ');\n}]);\n}(window, document, window.angular));","function AddChartModalController(patientData, messageList, MessageService, PatientChartService, $uibModalInstance) {\r\n var vm = this;\r\n vm.patientData = patientData;\r\n vm.acceptNoteVisible = false;\r\n vm.messageList = messageList;\r\n vm.submittingGroup = true;\r\n vm.acceptNote = \"\";\r\n \r\n MessageService.getMessageInterventions(true).then(function (data) {\r\n let populationId = patientData.populationId;\r\n vm.messageInterventions = data && data.filter(function(intervention) {\r\n return intervention.Programs.findIndex(p => p.PopulationId === populationId || p.IsAllPatients === true) >= 0 ||\r\n intervention.Programs.length == 0;\r\n });\r\n vm.submittingGroup = false;\r\n });\r\n\r\n vm.toggleIntervention = function(item) {\r\n item.selected = !item.selected;\r\n }\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.close();\r\n }\r\n vm.accept = function () {\r\n vm.submittingGroup = true;\r\n\r\n var entryGroup = getAddEntryGroup();\r\n PatientChartService.addEntryGroup(vm.patientData.id, entryGroup).then(function(result) {\r\n entryGroup = result;\r\n\r\n entryGroup.MessagePatientChartEntries = getMessages();\r\n entryGroup.MessageInterventionPatientChartEntries = getMessageInterventions();\r\n if (vm.acceptNote.length > 0) {\r\n entryGroup.TextPatientChartEntries.push(getAcceptNote());\r\n }\r\n\r\n PatientChartService.updateEntryGroup(entryGroup.PatientId, entryGroup.PatientChartEntryGroupId, entryGroup)\r\n .then(function(result) {\r\n $uibModalInstance.close();\r\n }, vm.submittingGroup = false);\r\n }, vm.submittingGroup = false);\r\n }\r\n\r\n function getAddEntryGroup() {\r\n return {\r\n PatientId: vm.patientData.id,\r\n TextPatientChartEntries: [\r\n {\r\n PatientId: vm.patientData.id,\r\n Text: \"Patient-related messages selected and written to Chart.\"\r\n }\r\n ]\r\n };\r\n }\r\n\r\n function getMessageInterventions() {\r\n var result = [];\r\n angular.forEach(vm.messageInterventions, function(value) {\r\n if (value.selected) {\r\n var msg = {\r\n PatientId: vm.patientData.id,\r\n Text: value.Text,\r\n MessageInterventionId: value.MessageInterventionId\r\n }\r\n result.push(msg);\r\n }\r\n });\r\n return result;\r\n }\r\n\r\n function getAcceptNote() {\r\n return {\r\n PatientId: vm.patientData.id,\r\n Text: vm.acceptNote\r\n }\r\n }\r\n\r\n function getMessages() {\r\n var result = [];\r\n angular.forEach(vm.messageList, function (value) {\r\n var msg = {\r\n PatientId: vm.patientData.id,\r\n Text: value.Text,\r\n MessageId: value.MessageId\r\n }\r\n result.push(msg);\r\n });\r\n return result;\r\n }\r\n}\r\nangular.module(\"messaging\").controller(\"AddChartModalController\", AddChartModalController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/messaging/addchart.modal.html',\n '

          Selected Messages

          {{item.Text}}
          {{item.CreatedBy_Name}}  {{item.CreatedDateTime_UTC | datetime}} at {{item.CreatedDateTime_UTC | date: \"HH:mm\"}}

          Select Interventions

          ');\n}]);\n}(window, document, window.angular));","function MessageService($http, $rootScope, repository) {\r\n var messageInterventionRepo = repository.new(\"MessageIntervention\");\r\n\r\n function getMessageInterventions() {\r\n return messageInterventionRepo.get(true).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetPatientMessageGroup(patientId) {\r\n return $http.get('/api/Message/Patient/' + patientId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetKitShippingMessageGroup(kitShippingInfoId) {\r\n return $http.get('/api/Message/KitShipping/' + kitShippingInfoId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetLogisticsOrderMessageGroup(logisticsOrderId) {\r\n return $http.get('/api/Message/LogisticsOrder/' + logisticsOrderId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetMessageGroup(messageGroupId) {\r\n return $http.get('/api/Message/' + messageGroupId, { ignoreLoadingBar: true }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetMessageGroups(userId) {\r\n return $http.get('/api/Message', { ignoreLoadingBar: true }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetMessagesForGroup(messageGroupId) {\r\n return $http.get('/api/Message/GetMessagesForGroup?'+\"messageGroupId=\"+messageGroupId, { ignoreLoadingBar: true }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function AddPatientMessage(patientId, messageText) {\r\n return $http.post('/api/Message/Patient/' + patientId, {Text: messageText}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function AddMessage(messageGroupId, messageText) {\r\n return $http.post('/api/Message/' + messageGroupId, {Text: messageText}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function MarkMessagesAsRead(messageGroupId) {\r\n return $http.post('/api/Message/' + messageGroupId + '/Read').then(function () {\r\n $rootScope.$emit(\"vh:refreshmessengercount\");\r\n });\r\n }\r\n\r\n function GetUnreadMessageCount() {\r\n //If you change the api url also change in in our exception in app.config.js\r\n return $http.get('/api/Message/Unread/Count', { ignoreLoadingBar: true }).then(function (response) {\r\n return response.data;\r\n },function(data) {\r\n return { \"LogisticsCount\": 0, \"MessageCount\": 0};\r\n });\r\n }\r\n\r\n function OpenMessenger(params) {\r\n $rootScope.$emit(\"vh:openmessenger\", params);\r\n }\r\n\r\n function createGroup(kitShippingInfoId) {\r\n return $http.post('/api/Message/createGroup/' + kitShippingInfoId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function createGroup_Fulfillment(logisticsOrderId) {\r\n return $http.post('/api/Message/createGroup_Fulfillment/' + logisticsOrderId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getPatientMessageGroup: GetPatientMessageGroup,\r\n getKitShippingMessageGroup: GetKitShippingMessageGroup,\r\n getLogisticsOrderMessageGroup: GetLogisticsOrderMessageGroup,\r\n getMessageGroup: GetMessageGroup,\r\n GetMessagesForGroup:GetMessagesForGroup,\r\n getMessageGroups: GetMessageGroups,\r\n addMessage: AddMessage,\r\n addPatientMessage: AddPatientMessage,\r\n markMessagesAsRead: MarkMessagesAsRead,\r\n getUnreadMessageCount: GetUnreadMessageCount,\r\n openMessenger: OpenMessenger,\r\n createGroup: createGroup,\r\n createGroup_fulfillment: createGroup_Fulfillment,\r\n getMessageInterventions: getMessageInterventions\r\n };\r\n}\r\n\r\nangular.module('messaging').service('MessageService', MessageService);\r\n","function Messenger($window) {\r\n\r\n function controller($rootScope, $scope, $transitions, $uibModal, ConfigurationsService, $timeout, $interval, $q, $document, $anchorScroll, $state, MessageService, lodash, AuthorizationService, vhSweetAlert) {\r\n\r\n $scope.ParticipantNames = [];\r\n\r\n \r\n $scope.acceptMessages = function() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/messaging/addchart.modal.html',\r\n controller: 'AddChartModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n messageList: function () {\r\n return lodash.filter($scope.messageGroup.Messages, function (msg) {\r\n return msg.selected;\r\n });\r\n },\r\n patientData: function() {\r\n return $scope.patientData;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function () {\r\n startMessagePolling();\r\n $scope.selectedCount = 0;\r\n lodash.forEach($scope.messageGroup.Messages, function (msg) {\r\n msg.selected = false;\r\n })\r\n }, function () { });\r\n }\r\n\r\n $scope.messageGroupId = 0;\r\n var listener = $rootScope.$on('vh:openmessenger', function(e, params) {\r\n var messageGroupId = params.groupId || 0;\r\n var patientId = (params.patientData ? params.patientData.id : params.patientId) || 0;\r\n\r\n $scope.patientData = params.patientData;\r\n $scope.showGroupList = !!params.showGroups;\r\n $scope.menu = {};\r\n $scope.groups = [];\r\n\r\n if ($scope.showGroupList) {\r\n getMessageGroups().then(function() {\r\n if ($scope.groups.length == 0 && messageGroupId == 0 && patientId == 0) {\r\n $scope.closeMessenger();\r\n vhSweetAlert.error(\"No messages\", \"No messages currently exist.\");\r\n }\r\n else {\r\n $scope.menu.patientGroupsIsCollapsed = false;\r\n $scope.menu.kitShipGroupsIsCollapsed = false;\r\n $scope.menu.kitPickUpGroupsIsCollapsed = false;\r\n $scope.menu.caregiverGroupsIsCollapsed = false;\r\n $scope.showGroup(messageGroupId, patientId);\r\n startGroupPolling();\r\n }\r\n });\r\n } else {\r\n $scope.showGroup(messageGroupId, patientId);\r\n }\r\n });\r\n\r\n var removeStateHandler = $transitions.onStart({}, (trans) => {\r\n \r\n var toState = trans.to();\r\n var toParams = toState.params; \r\n \r\n if (!$scope.showMessenger || (toParams != null && toState.name.indexOf('patients.patient') >= 0 && toParams.patientId === String($scope.patientId))) return;\r\n\r\n if ($scope.newMessage.messageText === '') {\r\n $scope.closeMessenger();\r\n } else {\r\n e.preventDefault();\r\n vhSweetAlert.verify('Are you sure?', 'You have an unsent message. Selecting a new patient will cancel your message.')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $scope.closeMessenger();\r\n $state.go(toState.name, toParams);\r\n }\r\n });\r\n }\r\n });\r\n\r\n $scope.$on('$destroy', function() {\r\n stopMessagePolling();\r\n stopGroupPolling();\r\n removeResizeListener();\r\n listener();\r\n removeStateHandler();\r\n });\r\n\r\n $scope.showMessenger = false;\r\n $scope.newMessage = { messageText: \"\" };\r\n $scope.caregiverId = AuthorizationService.getCaregiver().Id;\r\n $scope.showNewGroup = false;\r\n $scope.settings = {};\r\n $scope.PatientName = \"\";\r\n $scope.KitNumber = \"\";\r\n\r\n\r\n ConfigurationsService.getConfig().then(function(data){\r\n $scope.settings.CaregiverMessagingEnabled = data[\"CaregiverMessagingEnabled\"];\r\n $scope.settings.PatientMessagingEnabled = data[\"PatientMessagingEnabled\"];\r\n $scope.settings.LogisticsMessagingEnabled = data[\"LogisticsMessagingEnabled\"];\r\n $scope.settings.MarkLogisticsMessageAsReadForAllEnabled = data[\"MarkLogisticsMessageAsReadForAllEnabled\"];\r\n });\r\n\r\n var messagePoller = undefined;\r\n var groupPoller = undefined;\r\n\r\n\r\n $scope.showGroup = function(messageGroupId, patientId) {\r\n \r\n var promise;\r\n if (patientId > 0) {\r\n $scope.patientId = patientId;\r\n promise = MessageService.getPatientMessageGroup(patientId);\r\n } else if (messageGroupId > 0) {\r\n $scope.selectedGroup = lodash($scope.groups).filter(function(g) { return g.MessageGroupId === $scope.messageGroupId; }).value()[0];\r\n promise = MessageService.getMessageGroup(messageGroupId);\r\n }\r\n \r\n if (promise) {\r\n promise.then(function (messageGroup) {\r\n $scope.messageGroup = messageGroup;\r\n $scope.messageGroupId = messageGroup.MessageGroupId;\r\n $scope.PatientName = messageGroup.PatientName;\r\n $scope.KitNumber = \" (Kit:\"+messageGroup.Name+\")\";\r\n $scope.selectedCount = 0;\r\n\r\n updateMessages();\r\n var self = lodash.find($scope.messageGroup.Participants, { CaregiverId: $scope.caregiverId });\r\n if (self) {\r\n self.ParticipantName = 'You';\r\n }\r\n\r\n var names = JSON.parse(JSON.stringify($scope.messageGroup.Participants));\r\n $scope.ParticipantNames = (names || []).map(p => {\r\n if(p.ParticipantName.indexOf(',') > 0){\r\n return p.ParticipantName.split(',').reverse().map(n => n.trim()).join(' ');\r\n };\r\n return p.ParticipantName;\r\n }) \r\n .join(', ');\r\n \r\n focusMessenger();\r\n startMessagePolling();\r\n \r\n var t = angular.element(document.getElementById(\"group-window\"))[0];\r\n if (t) {\r\n t.scrollTop=0;\r\n }\r\n });\r\n } else {\r\n focusMessenger();\r\n startMessagePolling();\r\n } \r\n }\r\n\r\n $scope.closeMessenger = function() {\r\n stopMessagePolling();\r\n stopGroupPolling();\r\n removeResizeListener();\r\n $scope.showMessenger = false;\r\n $scope.newMessage.messageText = \"\";\r\n $scope.patientData = $scope.patientId = null;\r\n }\r\n\r\n $scope.enterPressed = function() {\r\n if ($scope.newMessage.messageText != \"\") {\r\n var promise;\r\n if ($scope.patientId > 0) {\r\n promise = MessageService.addPatientMessage($scope.patientId, $scope.newMessage.messageText); \r\n } else if ($scope.messageGroupId > 0) {\r\n promise = MessageService.addMessage($scope.messageGroupId, $scope.newMessage.messageText); \r\n }\r\n\r\n if (!promise) return;\r\n\r\n promise.then(function(response) {\r\n if ($scope.messageGroup.UnreadCount > 0) {\r\n markMessagesAsRead(response.MessageGroupId);\r\n }\r\n\r\n $scope.messageGroup.MessageGroupId = response.MessageGroupId;\r\n $scope.messageGroup.Messages.push(response);\r\n\r\n $scope.newMessage.messageText = \"\";\r\n scrollToBottom();\r\n });\r\n }\r\n }\r\n\r\n $scope.markAsRead = function() {\r\n markMessagesAsRead($scope.messageGroup.MessageGroupId);\r\n focusMessenger();\r\n }\r\n\r\n var markMessagesAsRead = function(messageGroupId) {\r\n MessageService.markMessagesAsRead(messageGroupId).then(function () {\r\n if ($scope.patientId > 0) {\r\n $rootScope.$emit(\"vh:patientUpdated\", $scope.patientId);\r\n }\r\n var group = lodash($scope.groups).filter(function(g) { return g.MessageGroupId == messageGroupId;}).value()[0];\r\n if(group){\r\n group.UnreadByAnyMessageCount = 0;\r\n group.UnreadByCaregiverMessageCount = 0;\r\n }\r\n if (messageGroupId == $scope.messageGroup.MessageGroupId) {\r\n $scope.messageGroup.UnreadByAnyMessageCount = 0;\r\n $scope.messageGroup.UnreadByCaregiverMessageCount = 0;\r\n }\r\n if ($scope.patientData && $scope.patientData.unreadMessageCount > 0) {\r\n $scope.patientData.unreadMessageCount = 0;\r\n }\r\n $scope.messageGroup.UnreadCount = 0;\r\n });\r\n }\r\n\r\n $scope.toggleSelection = function(message) {\r\n if (message.selected) {\r\n message.selected = false;\r\n $scope.selectedCount--;\r\n } else {\r\n message.selected = true;\r\n $scope.selectedCount++;\r\n }\r\n\r\n $scope.selectedCount = Math.max(0, $scope.selectedCount);\r\n if ($scope.selectedCount > 0) {\r\n stopMessagePolling();\r\n } else {\r\n startMessagePolling();\r\n }\r\n }\r\n\r\n var getMessageGroups = function() {\r\n return MessageService.getMessageGroups().then(function (groups) {\r\n return $q(function(resolve) {\r\n $scope.groups = groups;\r\n if ($scope.messageGroupId && $scope.messageGroupId > 0) {\r\n $scope.selectedGroup = lodash(groups).filter(function(g) { return g.MessageGroupId === $scope.messageGroupId; }).value()[0];\r\n }\r\n\r\n $scope.patientGroups = lodash(groups).filter(function(g) { return g.IsPatientGroup === true;}).value();\r\n $scope.kitShipGroups = lodash(groups).filter(function(g) { return g.IsKitLogistics === true && g.IsKitPickup === false;}).value();\r\n $scope.kitPickUpGroups = lodash(groups).filter(function(g) { return g.IsKitLogistics === true && g.IsKitPickup === true;}).value();\r\n $scope.caregiverGroups = lodash(groups).filter(function(g) { return g.IsCaregiverGroup === true;}).value();\r\n sortMessageGroups();\r\n resolve();\r\n });\r\n });\r\n }\r\n\r\n var sortMessageGroups = function() {\r\n $scope.kitShipGroups = lodash.sortByOrder($scope.kitShipGroups, [\"UnreadByCaregiverMessageCount\", \"PatientName\"], [false, true]);\r\n $scope.kitPickUpGroups = lodash.sortByOrder($scope.kitPickUpGroups, [\"UnreadByCaregiverMessageCount\", \"PatientName\"], [false, true]);\r\n }\r\n\r\n var updateMessages = (messageGroupId)=>{\r\n messageGroupId = messageGroupId || $scope.messageGroupId || 0;\r\n if(messageGroupId > 0) {\r\n var currentMessageCount = 0;\r\n if($scope.messageGroup && $scope.messageGroup.Messages){\r\n var currentMessageCount = $scope.messageGroup.Messages.length;\r\n }\r\n //If group particpants is empty, then likely the message group was created and viewed before the participants were added\r\n //Thus we re-query the message group to populate the Participants\r\n if ($scope.messageGroup && (!$scope.messageGroup.Participants || $scope.messageGroup.Participants.length == 0)) {\r\n MessageService.getMessageGroup(messageGroupId).then(function (messageGroup) {\r\n $scope.messageGroup = messageGroup;\r\n \r\n var self = lodash.find($scope.messageGroup.Participants, { CaregiverId: $scope.caregiverId });\r\n if (self) {\r\n self.ParticipantName = 'You';\r\n }\r\n $scope.test = $scope.messageGroup.Participants;\r\n $scope.ParticipantNames = (names || []).map(p => {\r\n if(p.ParticipantName.indexOf(',') > 0){\r\n return p.ParticipantName.split(',').reverse().map(n => n.trim()).join(' ');\r\n };\r\n return p.ParticipantName;\r\n }) \r\n .join(', ');\r\n });\r\n }\r\n\r\n MessageService.GetMessagesForGroup(messageGroupId).then(function (messages) {\r\n if($scope.messageGroup) {\r\n $scope.messageGroup.Messages = messages;\r\n $scope.messageGroup.UnreadByAnyMessageCount = messages\r\n .filter(function(message) { return message.IsPatient || message.IsLogistics })\r\n .reduce(function(count, message) { return message.ReadByAnyUser ? count : count + 1 }, 0);\r\n $scope.messageGroup.UnreadByCaregiverMessageCount = messages\r\n .filter(function(message) { return message.IsPatient || message.IsLogistics })\r\n .reduce(function(count, message) { return message.ReadByCurrentUser ? count : count + 1 }, 0);\r\n\r\n $scope.messageGroup.UnreadCount = $scope.settings.MarkLogisticsMessageAsReadForAllEnabled ? \r\n $scope.messageGroup.UnreadByAnyMessageCount :\r\n $scope.messageGroup.UnreadByCaregiverMessageCount;\r\n if($scope.messageGroup.Messages.length - currentMessageCount > 0) {\r\n scrollToBottom();\r\n }\r\n }\r\n });\r\n }\r\n };\r\n var startMessagePolling = function() {\r\n if(!messagePoller) {\r\n messagePoller = $interval(function() {\r\n updateMessages();\r\n }, 15000);\r\n }\r\n }\r\n\r\n var stopMessagePolling = function() {\r\n if(messagePoller) {\r\n $interval.cancel(messagePoller);\r\n messagePoller = undefined;\r\n }\r\n }\r\n\r\n var startGroupPolling = function() {\r\n if(!groupPoller) {\r\n groupPoller = $interval(function() {\r\n getMessageGroups();\r\n }, 60000);\r\n }\r\n }\r\n\r\n var stopGroupPolling = function() {\r\n if(groupPoller) {\r\n $interval.cancel(groupPoller);\r\n groupPoller = undefined;\r\n }\r\n }\r\n\r\n var focusMessenger = function(loading) {\r\n $scope.loading = loading === true;\r\n if (!$scope.showMessenger) {\r\n addResizeListener();\r\n }\r\n\r\n $scope.showMessenger = true;\r\n\r\n scrollToBottom();\r\n $timeout(function() {\r\n var textInput = $document[0].getElementById('messageText');\r\n if(textInput) {\r\n textInput.focus();\r\n }\r\n }, 100);\r\n }\r\n\r\n var scrollToBottom = function() {\r\n $timeout(function() {\r\n $anchorScroll('end');\r\n }, 100);\r\n }\r\n\r\n var addResizeListener = function() {\r\n angular.element($window).on(\"resize\", $scope.onResize);\r\n }\r\n\r\n var removeResizeListener = function() {\r\n angular.element($window).off(\"resize\", $scope.onResize);\r\n }\r\n\r\n $scope.addMouseListener = function() {\r\n $document.on(\"mousemove\", $scope.drag);\r\n $document.on(\"mouseup\", $scope.mouseUp);\r\n }\r\n\r\n $scope.removeMouseListener = function() {\r\n $document.off(\"mousemove\", $scope.drag);\r\n $document.off(\"mouseup\", $scope.mouseUp);\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n templateUrl: 'modules/messaging/messenger.tpl.html',\r\n link: function(scope, element, attributes, controller) {\r\n var dragEnabled = false;\r\n\r\n scope.mouseUp = function() {\r\n dragEnabled = false;\r\n scope.removeMouseListener();\r\n }\r\n\r\n scope.mouseDown = function($event) {\r\n if ($event.button === 0) {\r\n $event.preventDefault();\r\n dragEnabled = true;\r\n scope.addMouseListener();\r\n }\r\n }\r\n\r\n scope.drag = function($event) {\r\n if (dragEnabled) {\r\n $event.preventDefault();\r\n scope.reposition($event.clientX - 20, $event.clientY - 20);\r\n }\r\n }\r\n\r\n scope.onResize = function() {\r\n var div = element[0].nextSibling;\r\n scope.reposition(div.offsetLeft, div.offsetTop);\r\n }\r\n\r\n scope.reposition = function(x, y) {\r\n var div = element[0].nextSibling;\r\n var minY = 45; \r\n var maxY = Math.max(0, $window.innerHeight - div.offsetHeight);\r\n var maxX = Math.max(0, $window.innerWidth - div.offsetWidth - 16);\r\n //constrain to window bounds\r\n var newY = Math.max(minY, Math.min(maxY, y));\r\n var newX = Math.max(0, Math.min(maxX, x));\r\n div.style.position = 'fixed';\r\n div.style.top = newY + 'px';\r\n div.style.left = newX + 'px';\r\n }\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"messaging\").directive(\"messenger\", Messenger)\r\n.filter('filterMessageGroups', function() {\r\n return function(items, id) {\r\n var res = [];\r\n if (items) {\r\n for (var i = 0; i
          {{PatientName}}{{KitNumber}}
          0\" tooltip-append-to-body=\"true\" tooltip-placement=\"bottom\" uib-tooltip=\"{{::ParticipantNames}}\">In Conversation
          {{participant.ParticipantName}},
          0\">{{selectedCount}} selected
          {{message.Text}}
          \"image\" {{message.CreatedDateTime_UTC | datetime}} at {{message.CreatedDateTime_UTC | date: \"HH:mm\"}}
          {{message.DateReadBy | datetime}} at {{message.DateReadBy | date: \"HH:mm\"}}
          0\" ng-click=\"markAsRead()\">Mark as Read
          ');\n}]);\n}(window, document, window.angular));","function ActivityController($stateParams, PermissionService, AlertClass) {\r\n var vm = this;\r\n vm.patientId = $stateParams.patientId;\r\n\r\n vm.toggleExpansion = toggleExpansion;\r\n vm.expanded = {all: false};\r\n expandAllNodes(false);\r\n vm.canViewRuleLog = PermissionService.userHasPermission(['PatientRuleLogRead'])\r\n vm.canViewTagHistory = PermissionService.userHasPermission(['PatientTagHxRead']);\r\n vm.canViewCardHistory = PermissionService.userHasPermission(['PatientCardsRead']);\r\n vm.canViewMessageHistory = true;\r\n vm.canExportAudit = PermissionService.userHasPermission(['PatientAuditExport']);\r\n vm.canViewGoAppHistory = PermissionService.userHasPermission(['PatientActivityRead']);\r\n vm.canViewCPTBillingHistory = PermissionService.userHasPermission(['PatientCPTCodeBillingRead']);\r\n vm.AlertClass = AlertClass;\r\n \r\n function toggleExpansion() {\r\n expandAllNodes(!vm.expanded.all);\r\n }\r\n\r\n function expandAllNodes(expanded) {\r\n vm.expanded.all = vm.expanded.reading = vm.expanded.survey = vm.expanded.notification = vm.expanded.alert = vm.expanded.profile = vm.expanded.rule = vm.expanded.tag = vm.expanded.card = vm.expanded.goapp = vm.expanded.message = vm.expanded.billingcodes = expanded;\r\n }\r\n\r\n}\r\n\r\nangular.module('patient.activity').controller('ActivityController', ActivityController);\r\n","function ActivityService($http, moment) {\r\n\r\n var dateFormatString = 'YYYY-MM-DD'\r\n\r\n function getProfileHistory(patientId, pageSize, pageNumber) {\r\n return $http({\r\n url: '/api/patient/' + patientId + '/activity/profilehistory?pageSize=' + pageSize + '&pageNumber=' + pageNumber,\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getReadingHistory(patientId, pageSize, pageNumber, startDate, endDate) {\r\n return $http({\r\n url: '/api/patient/' + patientId + '/activity/readinghistory?pageSize=' + pageSize + '&pageNumber=' + pageNumber\r\n + '&filterBy=STARTDATE=' + moment(startDate).format(dateFormatString) + ',ENDDATE=' + moment(endDate).format(dateFormatString),\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getSurveyHistory(patientId, pageSize, pageNumber, startDate, endDate) {\r\n return $http({\r\n url: '/api/patient/' + patientId + '/activity/surveyhistory?pageSize=' + pageSize + '&pageNumber=' + pageNumber\r\n + '&filterBy=STARTDATE=' + moment(startDate).format(dateFormatString) + ',ENDDATE=' + moment(endDate).format(dateFormatString),\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getAlertHistory(patientId, statusId, severityId, pageSize, pageNumber) {\r\n return $http({\r\n url: '/api/patient/' + patientId + '/activity/alerthistory?pageSize=' + pageSize + '&pageNumber=' + pageNumber\r\n + '&filterBy=STATUS=' + statusId + ',SEVERITY=' + severityId,\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getRuleHistory(patientId, pageSize, page) {\r\n return $http({\r\n url: '/api/rule/0/log?patientId=' + patientId + '&pageSize=' + pageSize + '&pageNumber=' + page,\r\n method: 'GET'\r\n }).then(function(res){\r\n return res.data;\r\n });\r\n }\r\n\r\n function addPatientTag(patientId, tags) {\r\n return $http.post('/api/patient/' + patientId + '/PatientTag', tags, null).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientTagHistory(patientId, pageSize, page) {\r\n return $http({\r\n url: '/api/patient/' + patientId + '/PatientTag?pageSize=' + pageSize + '&pageNumber=' + page,\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deletePatientTag(patientId, patientTagId) {\r\n return $http({\r\n url: '/api/patient/' + patientId + '/PatientTag?patientTagId=' + patientTagId,\r\n method: 'DELETE'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientCardHistory(patientId, pageSize, page, startDate, endDate){\r\n return $http({\r\n url:'/api/patient/'+patientId+'/activity/patientcardhistory?startDate='+startDate+'&endDate='+endDate+'&pageSize=' + pageSize + '&pageNumber=' + page,\r\n method:\"GET\"\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientMessageHistory(patientId, pageSize, page) {\r\n var url = '/api/message/patient/' + patientId + '/history?pageSize=' + pageSize + '&pageNumber=' + page;\r\n return $http.get(url).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getGoAppHistory(patientId, pageSize, page) {\r\n var url = '/api/patient/' + patientId + '/activity/patientactivity/?pageSize=' + pageSize + '&pageNumber=' + page;\r\n return $http.get(url).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getBilledCodesHistory(patientId, pageSize, pageNumber) {\r\n return $http({\r\n url: '/api/patient/' + patientId + '/CptCodeBilling/list?pageSize=' + pageSize + '&pageNumber=' + pageNumber,\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getProfileHistory: getProfileHistory,\r\n getReadingHistory: getReadingHistory,\r\n getSurveyHistory: getSurveyHistory,\r\n getAlertHistory: getAlertHistory,\r\n getRuleHistory: getRuleHistory,\r\n getPatientTagHistory: getPatientTagHistory,\r\n deletePatientTag: deletePatientTag,\r\n addPatientTag: addPatientTag,\r\n getPatientCardHistory: getPatientCardHistory,\r\n getPatientMessageHistory: getPatientMessageHistory,\r\n getGoAppHistory: getGoAppHistory,\r\n getBilledCodesHistory: getBilledCodesHistory\r\n };\r\n}\r\n\r\nangular.module('patient.activity').service('ActivityService', ActivityService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/activity.tpl.html',\n '
          Patient History
          Reading History
           Pathway History
          Alert History
          Notification History
          Profile History
          Rule History
          Tag History
          Patient Cards History
          Patient Message History
          +Go History
          Billed Codes
          ');\n}]);\n}(window, document, window.angular));","function AlertHistoryDirective($stateParams, lodash, ActivityService, AlertClass, AlertStatus, AlertSeverityLevel) {\r\n\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n \"alertClass\": \"=\"\r\n },\r\n replace: true,\r\n link: function(scope, element, attributes) { \r\n \r\n scope.AlertClass = AlertClass;\r\n scope.AlertStatus = AlertStatus;\r\n scope.AlertSeverityLevel = AlertSeverityLevel;\r\n\r\n scope.alertClassName = Object.getOwnPropertyNames(AlertClass)[scope.alertClass - 1];\r\n\r\n scope.alertHistoryPageChanged = function () {\r\n var pageSize = scope.alertHistoryPaging.pageSize;\r\n var page = scope.alertHistoryPaging.page - 1;\r\n\r\n ActivityService.getAlertHistory($stateParams.patientId, scope.alertFiltering.statusId, scope.alertFiltering.severityId, pageSize, page).then(function (data) {\r\n scope.alertHistory = data.Response;\r\n scope.alertHistoryTotal = data.TotalCount;\r\n });\r\n };\r\n\r\n scope.alertStatusName = function(alertHistoryRow) {\r\n if (alertHistoryRow.AlertSeverityLevelId == AlertSeverityLevel.Notification) {\r\n switch (alertHistoryRow.AlertStatusId) {\r\n case AlertStatus.Scheduled : return 'Scheduled';\r\n case AlertStatus.New : return 'Unacknowledged';\r\n default : return 'Acknowledged';\r\n }\r\n }\r\n else {\r\n return Object.getOwnPropertyNames(AlertStatus)[alertHistoryRow.AlertStatusId];\r\n }\r\n }\r\n\r\n scope.alertHistoryPaging = {\r\n page: 1,\r\n pageSize: 10\r\n };\r\n\r\n scope.alertFiltering = {\r\n statusId: AlertStatus.All,\r\n severityId: scope.alertClass == AlertClass.Alert ? AlertSeverityLevel.All : AlertSeverityLevel.Notification\r\n };\r\n\r\n scope.alertHistoryPageChanged();\r\n },\r\n templateUrl: \"modules/patient/activity/alerthistory.tpl.html\"\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.activity\").directive(\"alerthistory\", AlertHistoryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/alerthistory.tpl.html',\n '
          0\" class=\"ibox-content ibox-action form-horizontal\">
          0\" class=\"patient-notes table-responsive\">
          DateTimeStatusSeverityMessageStatused By
          {{row.AlertStatusSetDateTime_UTC | datetime}} {{row.AlertStatusSetDateTime_UTC | date : \"HH:mm\"}}{{alertStatusName(row)}}{{row.AlertSeverityName}}{{row.AlertStatusSetByName}}
          No {{alertClassName}} History
          0\" class=\"ibox-action form-horizontal ibox-content\">
          ');\n}]);\n}(window, document, window.angular));","function BilledCodesHistoryDirective($stateParams, ActivityService) {\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n link: function(scope, element, attributes) {\r\n scope.billedCodesHistoryPageChanged = function () {\r\n var pageSize = scope.billedCodesHistoryPaging.pageSize;\r\n var page = scope.billedCodesHistoryPaging.page - 1;\r\n\r\n ActivityService.getBilledCodesHistory($stateParams.patientId, pageSize, page).then(function (data) {\r\n scope.billedCodesHistory = data.Response;\r\n scope.billedCodesHistoryTotal = data.TotalCount;\r\n });\r\n };\r\n\r\n scope.billedCodesHistoryPaging = {\r\n page: 1,\r\n pageSize: 10\r\n };\r\n\r\n scope.billedCodesHistoryPageChanged();\r\n },\r\n templateUrl: \"modules/patient/activity/billedcodeshistory.tpl.html\"\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.activity\").directive(\"billedCodesHistory\", BilledCodesHistoryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/billedcodeshistory.tpl.html',\n '
          0\">
          Billed DateBilled TimeHistorySubmitted DateSubmitted TimeAuthor
          {{row.DateTime_UTC | datetime}} {{row.DateTime_UTC | date : \"HH:mm\"}}Code {{row.Code}} marked as billed{{row.CreatedDateTime_UTC | datetime}} {{row.CreatedDateTime_UTC | date : \"HH:mm\"}}{{row.Caregiver.First_Name}} {{row.Caregiver.Last_Name}}
          No Profile History
          ');\n}]);\n}(window, document, window.angular));","function GoAppHistoryDirective($stateParams, ActivityService, ConfigurationsService, lodash){\r\n \r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n link: function(scope, element, attributes){\r\n scope.paging = {\r\n page: 1,\r\n pageSize: 50\r\n };\r\n scope.historyTotal = 0;\r\n scope.history = [];\r\n\r\n var dateFormat = \"YYYY-MM-DD\";\r\n scope.historyPageChanged = function(){\r\n var pageSize = scope.historyPaging.pageSize;\r\n var page = scope.historyPaging.page - 1;\r\n\r\n ActivityService.getGoAppHistory($stateParams.patientId, pageSize, page).then(function (data) {\r\n scope.history = data.Response;\r\n scope.historyTotal = data.TotalCount;\r\n data.Response.map(function(activity){ \r\n var dateString = activity.CreatedDateTime_UTC;\r\n activity.CreatedDateTime_UTC = moment(dateString).format('L');\r\n activity.Time = moment(dateString).format('HH:mm');\r\n }); \r\n });\r\n };\r\n\r\n scope.getTitle = function(welcomeContent) {\r\n var features = [];\r\n if(!welcomeContent) {\r\n return \"\";\r\n }\r\n\r\n if(welcomeContent.EnableMessaging) {\r\n features.push(\"Messaging enabled\");\r\n }\r\n else {\r\n features.push(\"Messaging disabled\");\r\n }\r\n if(welcomeContent.RequestCallType) {\r\n features.push(\"Call request type \" + welcomeContent.RequestCallType)\r\n }\r\n if(welcomeContent.GoVirtualVisitsEnabled) {\r\n features.push(\"Virtual visits enabled\");\r\n }\r\n else {\r\n features.push(\"Virtual visits disabled\");\r\n }\r\n if(welcomeContent.EnableLibrary) {\r\n features.push(\"Resource library enabled\");\r\n }\r\n else {\r\n features.push(\"Resource library disabled\");\r\n }\r\n if(welcomeContent.GoAllowRememberMe) {\r\n features.push(\"Remember me enabled\");\r\n }\r\n else {\r\n features.push(\"Remember me disabled\");\r\n }\r\n if(welcomeContent.GoAllowStayLoggedIn) {\r\n features.push(\"Stay logged in enabled\");\r\n }\r\n else {\r\n features.push(\"Stay logged in disabled\");\r\n }\r\n if(welcomeContent.GoStayLoggedInDefault) {\r\n features.push(\"Stay logged in default enabled\");\r\n }\r\n else {\r\n features.push(\"Stay logged in default disabled\");\r\n }\r\n if(welcomeContent.EnableTrend) {\r\n features.push(\"Trending enabled\");\r\n }\r\n else {\r\n features.push(\"Trending disabled\");\r\n }\r\n if(welcomeContent.GoTechnicalIssueEnabled) {\r\n features.push(\"Technical issue enabled\");\r\n }\r\n else {\r\n features.push(\"Technical issue disabled\");\r\n }\r\n\r\n return features.join(\" | \");\r\n };\r\n\r\n scope.historyPaging = {\r\n page: 1,\r\n pageSize: 10\r\n };\r\n\r\n scope.handleDateChanged = function(){\r\n if(scope.loaded){\r\n scope.historyPageChanged();\r\n }\r\n };\r\n\r\n scope.historyPageChanged();\r\n\r\n },\r\n templateUrl: \"modules/patient/activity/goapphistory.tpl.html\"\r\n }\r\n}\r\n\r\nangular.module(\"patient.activity\").directive(\"goAppHistory\", GoAppHistoryDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/goapphistory.tpl.html',\n '
          0\">
          DateTimeActivity
          {{row.CreatedDateTime_UTC | datetime}} {{row.Time | date : \"HH:mm\"}}
          No +Go App History
          ');\n}]);\n}(window, document, window.angular));","function PatientCardHistoryDirective($stateParams, ActivityService, ConfigurationsService, lodash, GoDevicesService){\r\n \r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n link: function(scope, element, attributes){\r\n var now = new Date();\r\n scope.EndDate = new Date();\r\n scope.StartDate = now.setDate(now.getDate() - 14);\r\n scope.CardTypeId = 0;\r\n scope.paging = {\r\n page: 1,\r\n pageSize: 50\r\n };\r\n scope.cardTotal = 0;\r\n scope.patientCards = [];\r\n\r\n scope.cardStatus = {\r\n \"1\":\"Default\",\r\n \"2\":\"Positive\",\r\n \"3\":\"Warning\",\r\n \"4\":\"Negative\"\r\n };\r\n\r\n scope.cardType={\r\n \"1\":\"Pathway\",\r\n \"2\":\"BluetoothDevice\",\r\n \"3\":\"Video\",\r\n \"4\":\"HealthTip\",\r\n \"5\":\"Hero\"\r\n };\r\n \r\n \r\n scope.manageDeviceModels = [];\r\n GoDevicesService.GetAllEnabled().then(function(deviceModels) {\r\n deviceModels.forEach(element => {\r\n scope.manageDeviceModels.push({ Name: element.DeviceName, Value: element.DeviceModelId }); \r\n });\r\n });\r\n \r\n\r\n\r\n\r\n var dateFormat = \"YYYY-MM-DD\";\r\n scope.cardPageChanged = function(){\r\n \r\n var pageSize = scope.paging.pageSize;\r\n var page = scope.paging.page;\r\n ActivityService.getPatientCardHistory($stateParams.patientId, pageSize, page, moment(scope.StartDate).format(dateFormat),moment(scope.EndDate).format(dateFormat)).then(function(data){\r\n \r\n \r\n data.Response.map(function(card){ \r\n var dateString = card.CreatedDateTime_UTC;\r\n card.CreatedDateTime_UTC = moment(dateString).format('L');\r\n card.Time = moment(dateString).format('HH:mm');\r\n \r\n });\r\n scope.cardTotal = data.TotalCount;\r\n scope.patientCards = data.Response;\r\n scope.loaded = true;\r\n });\r\n };\r\n\r\n function formatDetailsDate(dateString){\r\n return moment(dateString).format('L HH:mm');\r\n }\r\n\r\n scope.handleDateChanged = function(){\r\n if(scope.loaded){\r\n scope.cardPageChanged();\r\n }\r\n };\r\n\r\n scope.getDetails = function(data){\r\n \r\n var details = null;\r\n let device = scope.manageDeviceModels.find(x => x.Value === data.DeviceModelEnumId)\r\n switch (data.CardTypeId) {\r\n case 2:\r\n details = \"Display Order: \"+ data.DisplayOrder+\", Start Time: \" +formatDetailsDate(data.StartTime_UTC)+\", End Time: \"+ formatDetailsDate(data.EndTime_UTC)+\", Device: \" + (device? device.Name : \"undefined\");\r\n break;\r\n case 3:\r\n details = \"Display Order: \"+ data.DisplayOrder+\", Start Time: \" +formatDetailsDate(data.StartTime_UTC)+\", End Time: \"+ formatDetailsDate(data.EndTime_UTC)+\", Survey Video Id: \"+data.VideoId;\r\n break;\r\n case 4:\r\n details = \"Display Order: \"+ data.DisplayOrder+\", Start Time: \" +formatDetailsDate(data.StartTime_UTC)+\", End Time: \"+ formatDetailsDate(data.EndTime_UTC)+\", Health Tip Id: \"+data.HealthTipId;\r\n break;\r\n case 5:\r\n details = \"Display Order: \"+ data.DisplayOrder+\", Start Time: \" +formatDetailsDate(data.StartTime_UTC)+\", End Time: \"+ formatDetailsDate(data.EndTime_UTC)+\", Title: \"+data.Title+\", Subtitle: \"+data.Subtitle+\", Information: \"+data.Information+\", Value: \"+data.Value+\", Units: \"+data.Units+\", Icon: \"+data.Icon;\r\n break;\r\n default:\r\n break;\r\n }\r\n return details;\r\n };\r\n\r\n\r\n scope.cardPageChanged();\r\n \r\n\r\n\r\n },\r\n templateUrl: \"modules/patient/activity/patientcardhistory.tpl.html\"\r\n }\r\n}\r\n\r\nangular.module(\"patient.activity\").directive(\"cardHistory\", PatientCardHistoryDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/patientcardhistory.tpl.html',\n '
          0\">
          DateTimeCard TypeStatusDetails
          {{row.CreatedDateTime_UTC}}{{row.Time}}{{cardType[row.CardTypeId]}}{{cardStatus[row.CardStatusId]}}{{getDetails(row)}}
          No Card History
          ');\n}]);\n}(window, document, window.angular));","function PatientMessageHistoryDirective($stateParams, ActivityService) {\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n link: function(scope, element, attributes) {\r\n scope.messageHistoryPageChanged = function () {\r\n var pageSize = scope.messageHistoryPaging.pageSize;\r\n var page = scope.messageHistoryPaging.page;\r\n\r\n ActivityService.getPatientMessageHistory($stateParams.patientId, pageSize, page).then(function (data) {\r\n scope.messageHistory = data.Response;\r\n scope.messageHistoryTotal = data.TotalCount;\r\n });\r\n };\r\n\r\n scope.messageHistoryPaging = {\r\n page: 1,\r\n pageSize: 10\r\n };\r\n\r\n scope.messageHistoryPageChanged();\r\n },\r\n templateUrl: \"modules/patient/activity/patientmessagehistory.tpl.html\"\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.activity\").directive(\"messageHistory\", PatientMessageHistoryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/patientmessagehistory.tpl.html',\n '
          No Message History
          0\">
          Date / TimeMessageBy
          {{message.CreatedDateTime_UTC | datetime}} at {{message.CreatedDateTime_UTC | date: \"HH:mm\"}}{{message.Text}} (Current)
          Read {{message.DateReadBy | datetime}} at {{message.DateReadBy | date: \"HH:mm\"}} by {{message.ReadBy}}
          {{message.CreatedBy_Name}}
          ');\n}]);\n}(window, document, window.angular));","function ProfileHistoryDirective($stateParams, ActivityService) {\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n link: function(scope, element, attributes) {\r\n scope.profileHistoryPageChanged = function () {\r\n var pageSize = scope.profileHistoryPaging.pageSize;\r\n var page = scope.profileHistoryPaging.page - 1;\r\n\r\n ActivityService.getProfileHistory($stateParams.patientId, pageSize, page).then(function (data) {\r\n scope.profileHistory = data.Response;\r\n scope.profileHistoryTotal = data.TotalCount;\r\n });\r\n };\r\n\r\n scope.profileHistoryPaging = {\r\n page: 1,\r\n pageSize: 10\r\n };\r\n\r\n scope.profileHistoryPageChanged();\r\n },\r\n templateUrl: \"modules/patient/activity/profilehistory.tpl.html\"\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.activity\").directive(\"profilehistory\", ProfileHistoryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/profilehistory.tpl.html',\n '
          0\">
          DateTimeHistoryAuthor
          {{row.CreatedDtUTC | datetime}} {{row.CreatedDtUTC | date : \"HH:mm\"}}{{row.CaregiverName}}
          No Profile History
          ');\n}]);\n}(window, document, window.angular));","function ReadingHistoryDirective($stateParams, ActivityService, ConfigurationsService, ConfigurationRepository) {\r\n\r\n var dateFormat = \"YYYY-MM-DD\";\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n link: function (scope, element, attributes) {\r\n // HACK: The data pickers cause readingHistoryPageChanged to get fired 2 extra times on load.\r\n // So we will use this counter to ignore the first 2\r\n var initializeCounter = 2;\r\n scope.readingHistoryPageChanged = function () {\r\n if (initializeCounter > 0) {\r\n initializeCounter -= 1;\r\n return;\r\n }\r\n var pageSize = scope.readingHistoryPaging.pageSize;\r\n var page = scope.readingHistoryPaging.page - 1;\r\n ActivityService.getReadingHistory($stateParams.patientId, pageSize, page, scope.readingHistoryStartDate, scope.readingHistoryEndDate).then(function (data) {\r\n scope.readingHistory = data.Response;\r\n\r\n scope.readingHistoryExcelSrc = {\r\n url: '/api/patient/' + $stateParams.patientId + '/activity/readinghistory/export?startDate=' + moment(scope.readingHistoryStartDate).format(dateFormat) + '&endDate=' + moment(scope.readingHistoryEndDate).format(dateFormat),\r\n method: 'GET'\r\n };\r\n scope.readingHistoryTotal = data.TotalCount;\r\n });\r\n };\r\n\r\n ConfigurationsService.getConfig().then(function (data) {\r\n scope.defaultTempUnit = data.DefaultTempUnit;\r\n scope.enableSpirometerBiometric = data.EnableSpirometerBiometric;\r\n scope.enablePedometerBiometric = data.EnablePedometerBiometric;\r\n scope.enableInhalerBiometric = data.EnableInhalerBiometrics;\r\n });\r\n\r\n ConfigurationRepository.getByParamName('ReportPHIWarningText').then(function (data) {\r\n scope.phiWarningText = data.Value;\r\n });\r\n\r\n scope.readingHistoryPaging = {\r\n page: 1,\r\n pageSize: 10\r\n };\r\n\r\n var tempDate = new Date();\r\n scope.readingHistoryStartDate = tempDate.setDate(tempDate.getDate() - 14);\r\n scope.readingHistoryEndDate = new Date();\r\n\r\n scope.readingHistoryPageChanged();\r\n },\r\n templateUrl: \"modules/patient/activity/readinghistory.tpl.html\"\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.activity\").directive(\"readinghistory\", ReadingHistoryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/readinghistory.tpl.html',\n '
          • MS Excel
          0\">
          DatePatient TimeAlertMethodDeviceBPHRSpO2WtBSHbA1cTempPEFFEV1FEV 1/6StepsControl UsesRescue UsesSleepAlert Message
          {{row.PatientDateTimeStr.slice(0, row.PatientDateTimeStr.indexOf(\\' \\')) | date}} {{row.PatientDateTimeStr.slice(row.PatientDateTimeStr.indexOf(\\' \\'))}}{{row.AlertSeverityName}} {{row.Device}}{{row.BP}}{{row.HR}}{{row.Oxygen}}{{row.Weight}}{{row.BloodSugar}}{{row.HbA1c}}{{row.Temperature.CelsiusValue}}{{row.Temperature.FahrenheitValueRounded}}{{row.PEF}}{{row.FEVOne}}{{row.FEVRatio}}{{row.Steps}}{{row.ControlClicks}}{{row.RescueClicks}}{{row.Sleep}}{{row.AlertMessage}}
          No Reading History
          0\">{{phiWarningText}}
          ');\n}]);\n}(window, document, window.angular));","function RuleHistory(ActivityService, $stateParams, ConfigurationRepository) {\r\n\r\n function link(scope) {\r\n\r\n scope.rulePageChanged = function () {\r\n var pageSize = scope.paging.pageSize;\r\n var page = scope.paging.page;\r\n\r\n ActivityService.getRuleHistory($stateParams.patientId, pageSize, page).then(function (data) {\r\n scope.ruleHistory = data.Response.map(function(rule) {\r\n rule.Data = {};\r\n rule.Data.Log = JSON.parse(rule.Note);\r\n if (rule.EventData.startsWith(\"{\")){\r\n rule.Data.Event = JSON.parse(rule.EventData);\r\n }\r\n if (rule.PatientData.startsWith(\"{\")){\r\n rule.Data.Data = JSON.parse(rule.PatientData);\r\n } \r\n return rule;\r\n });\r\n\r\n scope.ruleHistoryExcelSrc = {\r\n url: '/api/patient/' + $stateParams.patientId + '/activity/rulehistory/export',\r\n method: 'GET'\r\n };\r\n\r\n scope.ruleHistoryTotal = data.TotalCount;\r\n });\r\n };\r\n\r\n scope.paging = {\r\n page: 1,\r\n pageSize: 10\r\n };\r\n\r\n scope.rulePageChanged();\r\n\r\n ConfigurationRepository.getByParamName('ReportPHIWarningText').then(function (data) {\r\n scope.phiWarningText = data.Value;\r\n });\r\n }\r\n\r\n return {\r\n link: link,\r\n templateUrl: 'modules/patient/activity/rulehistory.tpl.html',\r\n restrict: 'E',\r\n replace: true\r\n };\r\n\r\n}\r\n\r\nangular.module('patient.activity').directive('ruleHistory', RuleHistory);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/rulehistory.tpl.html',\n '
          • MS Excel
          0\">
          DateTimeRule IdHistory
          {{row.CreatedDateTime_UTC | datetime}} {{row.CreatedDateTime_UTC | date : \"HH:mm\"}}{{row.RuleId}}    Event Data     Patient Data
          {{line}}
          No Rule History
          0\">{{phiWarningText}}
          ');\n}]);\n}(window, document, window.angular));","function SurveyHistoryDirective($stateParams, ActivityService, ConfigurationRepository) {\r\n\r\n var dateFormat = \"YYYY-MM-DD\";\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n link: function(scope, element, attributes) {\r\n // HACK: The data pickers cause readingHistoryPageChanged to get fired 2 extra times on load.\r\n // So we will use this counter to ignore the first 2\r\n var initializeCounter = 2;\r\n scope.surveyHistoryPageChanged = function () {\r\n if(initializeCounter > 0) {\r\n initializeCounter -= 1;\r\n return;\r\n }\r\n var pageSize = scope.surveyHistoryPaging.pageSize;\r\n var page = scope.surveyHistoryPaging.page - 1;\r\n\r\n ActivityService.getSurveyHistory($stateParams.patientId, pageSize, page, scope.surveyHistoryStartDate, scope.surveyHistoryEndDate).then(function (data) {\r\n scope.surveyHistory = data.Response;\r\n\r\n scope.surveyHistoryExcelSrc = {\r\n url: '/api/patient/' + $stateParams.patientId + '/activity/surveyhistory/export?startDate=' + moment(scope.surveyHistoryStartDate).format(dateFormat) + '&endDate=' + moment(scope.surveyHistoryEndDate).format(dateFormat),\r\n method: 'GET'\r\n };\r\n scope.surveyHistoryTotal = data.TotalCount;\r\n });\r\n };\r\n\r\n scope.surveyHistoryPaging = {\r\n page: 1,\r\n pageSize: 10\r\n };\r\n\r\n var tempDate = new Date();\r\n scope.surveyHistoryStartDate = tempDate.setDate(tempDate.getDate() - 14);\r\n scope.surveyHistoryEndDate = new Date();\r\n\r\n scope.surveyHistoryPageChanged();\r\n\r\n ConfigurationRepository.getByParamName('ReportPHIWarningText').then(function (data) {\r\n scope.phiWarningText = data.Value;\r\n });\r\n },\r\n templateUrl: \"modules/patient/activity/surveyhistory.tpl.html\"\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.activity\").directive(\"surveyhistory\", SurveyHistoryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/surveyhistory.tpl.html',\n '
          • MS Excel
          0\">
          DatePatient TimeAlertPathwayQuestionResponse
          {{row.PatientDateTimeStr.slice(0, row.PatientDateTimeStr.indexOf(\\' \\')) | date}} {{row.PatientDateTimeStr.slice(row.PatientDateTimeStr.indexOf(\\' \\'))}}{{row.AlertSeverityName}}{{row.SurveyName}}{{row.QuestionText}}{{row.QuestionAnswerText}}
          No Pathway History
          0\">{{phiWarningText}}
          ');\n}]);\n}(window, document, window.angular));","function TagHistoryDirective($stateParams, ActivityService, lodash, ConfigurationRepository) {\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n link: function(scope, element, attributes) {\r\n scope.tagHistoryPageChanged = function () {\r\n var pageSize = scope.tagHistoryPaging.pageSize;\r\n var page = scope.tagHistoryPaging.page;\r\n\r\n ActivityService.getPatientTagHistory($stateParams.patientId, pageSize, page).then(function (data) {\r\n scope.tagHistory = data.Response;\r\n\r\n scope.tagHistoryExcelSrc = {\r\n url: '/api/patient/' + $stateParams.patientId + '/activity/taghistory/export',\r\n method: 'GET'\r\n };\r\n\r\n scope.tagHistoryTotal = data.TotalCount;\r\n });\r\n };\r\n\r\n scope.tagHistoryPaging = {\r\n page: 1,\r\n pageSize: 50\r\n };\r\n\r\n scope.tagHistoryPageChanged();\r\n\r\n scope.deleteTag = function(tag) {\r\n ActivityService.deletePatientTag($stateParams.patientId, tag.PatientTagId).then(function (data) {\r\n lodash.find(scope.tagHistory, function(o) { return o.PatientTagId === tag.PatientTagId }).DeletedDateTime_UTC = data.DeletedDateTime_UTC;\r\n });\r\n };\r\n\r\n scope.newTagText = \"\";\r\n\r\n scope.addTag = function() {\r\n var tags = [];\r\n tags.push({ PatientId: $stateParams.patientId, Tag: scope.newTagText})\r\n\r\n ActivityService.addPatientTag($stateParams.patientId, tags).then(function (data) {\r\n scope.tagHistory.unshift(data[0]);\r\n scope.tagHistoryTotal = scope.tagHistory.length;\r\n scope.newTagText = \"\";\r\n scope.tagHistoryPageChanged();\r\n\r\n });\r\n }\r\n\r\n ConfigurationRepository.getByParamName('ReportPHIWarningText').then(function (data) {\r\n scope.phiWarningText = data.Value;\r\n });\r\n },\r\n templateUrl: \"modules/patient/activity/taghistory.tpl.html\"\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.activity\").directive(\"taghistory\", TagHistoryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/activity/taghistory.tpl.html',\n '
          • MS Excel
          0\">
          DateTimeTag
          {{row.CreatedByDateTime_UTC | datetime}} {{row.CreatedByDateTime_UTC | date : \"HH:mm\"}}
          No Tag History
          0\">{{phiWarningText}}
          ');\n}]);\n}(window, document, window.angular));","function CaregiverToPatientTimeService(moment) {\r\n\r\n // Used for converting from a caregiver browser timestamp to patients time\r\n\r\n function CalculatePatientTime(currentDate, patientTimeZone) {\r\n var rightNow = moment.tz(currentDate, moment.tz.guess()).format();\r\n var rightNowNoTimeZone = rightNow.substring(0, rightNow.lastIndexOf(\"-\"));\r\n var ptTime = moment.tz(rightNowNoTimeZone, patientTimeZone);\r\n return new Date(ptTime.format());\r\n }\r\n\r\n function CalculateCaregiverTime(currentDate, patientTimeZone) {\r\n var rightNow = moment.tz(currentDate, patientTimeZone).format();\r\n var rightNowNoTimeZone = rightNow.substring(0, rightNow.lastIndexOf(\"-\"));\r\n var caregiverTime = moment.tz(rightNowNoTimeZone, moment.tz.guess());\r\n return new Date(caregiverTime.format());\r\n }\r\n\r\n\r\n return {\r\n calculatePatientTime: CalculatePatientTime,\r\n calculateCaregiverTime: CalculateCaregiverTime\r\n }\r\n};\r\n\r\nangular.module(\"patient\").factory(\"CaregiverToPatientTimeService\", CaregiverToPatientTimeService);","function PatientChartController(chart, PatientChartService, $stateParams, lodash, vhSweetAlert, chartLogger, AlertSeverityLevel, AuthorizationService) {\r\n var vm = this;\r\n vm.patientId = $stateParams.patientId;\r\n vm.pageSize = 25;\r\n vm.pageNumber = 1;\r\n vm.pageChanged = pageChanged;\r\n vm.totalNotes = chart.TotalCount;\r\n vm.orderByDescending = true;\r\n vm.searchText = \"\";\r\n vm.toggleSort = toggleSort;\r\n vm.deleteNote = deleteNote;\r\n vm.canModifyNote = canModifyNote;\r\n vm.chartGroups = lodash.map(chart.Response, mapGroup);\r\n chartLogger.log(\"Page loaded\");\r\n vm.toggleNotesExpansion = toggleNotesExpansion;\r\n vm.AlertSeverityLevel = AlertSeverityLevel;\r\n\r\n\r\n toggleNotesExpansion(false);\r\n\r\n function toggleNotesExpansion(expanded) {\r\n vm.notesExpanded = expanded;\r\n vm.expandCollapseButtonTitle = expanded ? 'Collapse All' : 'Expand All';\r\n vm.expandCollapseButtonIcon = expanded ? 'compress' : 'expand';\r\n }\r\n\r\n function mapGroup(group) {\r\n\r\n if (group.CreatedBy) {\r\n group.createdByName = {\r\n firstName: group.CreatedBy.First_Name,\r\n lastName: group.CreatedBy.Last_Name,\r\n isClinical: group.CreatedBy.CaregiverTitle ? group.CreatedBy.CaregiverTitle.IsClinical : \"\"\r\n //title: mapTitle(group.CreatedBy.CaregiverTitle)\r\n };\r\n\r\n if(group.CreatedBy.Last_Name !== \"The Patient\"){\r\n group.createdByName.title = mapTitle(group.CreatedBy.CaregiverTitle);\r\n }\r\n }\r\n if (group.ChartGroupHistories && group.ChartGroupHistories.length > 0) {\r\n group.audits = lodash.map(group.ChartGroupHistories, function (h) {\r\n\r\n \r\n h.auditByName = {\r\n firstName: h.AuditBy.First_Name,\r\n lastName: h.AuditBy.Last_Name,\r\n isClinical:group.CreatedBy.CaregiverTitle.IsClinical,\r\n // title: mapTitle(h.AuditBy.CaregiverTitle)\r\n };\r\n if(h.AuditBy.Last_Name !== \"The Patient\" && group.CreatedBy.CaregiverTitle.IsClinical){\r\n h.auditByName.title = mapTitle(h.AuditBy.CaregiverTitle);\r\n }\r\n\r\n return h;\r\n });\r\n }\r\n if (group.PatientChartEntryGroupId === $stateParams.changedEntry) {\r\n group.recentlyChanged = true;\r\n }\r\n \r\n if (group.SourceName == 'NerveCenter') {\r\n group.SourceName = 'NC 2.0';\r\n group.canModify = false;\r\n }\r\n else {\r\n group.canModify = canModifyNote(group.CreatedById)\r\n }\r\n return group;\r\n }\r\n\r\n function canModifyNote(createdByid){\r\n\r\n return !vm.audit && createdByid == AuthorizationService.getCaregiver().Id;\r\n }\r\n\r\n function mapTitle(title) {\r\n if (title !== null ) {\r\n return {\r\n name: title.Name,\r\n id: title.Id\r\n };\r\n }\r\n }\r\n\r\n function pageChanged() {\r\n var filters = \"\";\r\n var orderBy = \"CREATEDDTUTC=\" + (vm.orderByDescending ? \"d\" : \"a\");\r\n if (vm.searchText) {\r\n filters += (vm.audit ? \"AUDITTEXT=\" : \"Text=\") + vm.searchText;\r\n }\r\n if (vm.audit) {\r\n PatientChartService.getChartAudit($stateParams.patientId, vm.pageSize, vm.pageNumber, orderBy, filters).then(function (response) {\r\n var audits = response.Response;\r\n vm.totalNotes = response.TotalCount;\r\n vm.chartGroups = lodash.map(response.Response, mapGroup);\r\n });\r\n } else {\r\n\r\n PatientChartService.getChart(vm.patientId, vm.pageSize, vm.pageNumber, orderBy, filters).then(function (response) {\r\n vm.chartGroups = lodash.map(response.Response, mapGroup);\r\n vm.totalNotes = response.TotalCount;\r\n });\r\n }\r\n }\r\n\r\n function toggleSort() {\r\n vm.orderByDescending = !vm.orderByDescending;\r\n pageChanged();\r\n }\r\n\r\n function deleteNote(group) {\r\n chartLogger.log(\"Clicked delete note\", {chartGroupId: group.PatientChartEntryGroupId});\r\n vhSweetAlert.verify(\"Are you sure?\", \"Are you sure you want to delete this note?\", \"Delete\").then(function (confirmed) {\r\n if (confirmed) {\r\n chartLogger.log(\"Confirmed delete note\");\r\n PatientChartService.deleteEntryGroup($stateParams.patientId, group.PatientChartEntryGroupId).then(function (success) {\r\n if (success) {\r\n lodash.remove(vm.chartGroups, group);\r\n lodash.remove(chart.Response,group);\r\n }\r\n });\r\n } else {\r\n chartLogger.log(\"Cancelled delete note\");\r\n }\r\n });\r\n }\r\n}\r\n\r\nangular.module('patient.chart').controller('PatientChartController',PatientChartController);\r\n","function PatientChartService($http) {\r\n\r\n function getChart(patientId, pageSize, pageNumber, orderBy, filters) {\r\n return $http.get(\"/api/Patient/\" + patientId + \"/chart\", {\r\n params: {\r\n pageSize: pageSize,\r\n pageNumber: pageNumber,\r\n filterBy: filters,\r\n sortBy: orderBy\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getEntryGroup(patientId, patientChartEntryGroupId) {\r\n return $http.get(\"/api/Patient/\" + patientId + \"/chart/\" + patientChartEntryGroupId)\r\n .then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getChartGroupsByRange(patientId, startDate, endDate) {\r\n var data = {\r\n startDate_UTC: startDate,\r\n endDate_UTC: endDate\r\n };\r\n return $http({\r\n url: \"/api/Patient/\" + patientId + \"/chart/range\",\r\n method: 'GET',\r\n params: data\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function addEntryGroup(patientId, entryGroup) {\r\n return $http.post(\"/api/Patient/\" + patientId + \"/chart\", entryGroup).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateEntryGroup(patientId, entryGroupId, entryGroup) {\r\n return $http.put(\"/api/Patient/\" + patientId + \"/chart/\" + entryGroupId, entryGroup).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteEntryGroup(patientId, entryGroupId) {\r\n return $http.delete(\"/api/Patient/\" + patientId + \"/chart/\" + entryGroupId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getMasterEntries(patientId, pageSize, pageNumber, searchText) {\r\n var filters = \"\";\r\n if (searchText) {\r\n filters += \"SEARCH=\"+searchText;\r\n }\r\n return $http.get(\"/api/ChartContent/\" + patientId + \"/Entry\", {\r\n params: {\r\n pageSize: pageSize,\r\n pageNumber: pageNumber,\r\n filterBy: filters\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getChartAudit(patientId, pageSize, pageNumber, sortOrder, filters) {\r\n return $http.get(\"/api/Patient/\" + patientId + \"/Chart/History\", {\r\n params: {\r\n pageNumber: pageNumber,\r\n pageSize: pageSize,\r\n sortBy: sortOrder,\r\n filterBy: filters\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getChart: getChart,\r\n getEntryGroup: getEntryGroup,\r\n getChartGroupsByRange: getChartGroupsByRange,\r\n getMasterEntries: getMasterEntries,\r\n getChartAudit: getChartAudit,\r\n addEntryGroup: addEntryGroup,\r\n updateEntryGroup: updateEntryGroup,\r\n deleteEntryGroup: deleteEntryGroup\r\n };\r\n\r\n}\r\n\r\nangular.module('patient.chart').service('PatientChartService', PatientChartService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/chart/chart.tpl.html',\n '
          Patient Notes
          0\">
          Date/TimeNoteAuthor
          {{group.CreatedDtUTC | datetime : \"datetime\"}}     
            \"\" {{ msg.MessageCreator }}  {{ msg.MessageCreatedUtc | datetime : \"datetime\" }}
          0\">
          DateChangesAuthor
          {{audit.AuditDateTime_UTC | datetime : \"datetime\"}} {{audit.auditByName.lastName}} 0) && (audit.auditByName.firstName && audit.auditByName.firstName.length > 0)\">, {{audit.auditByName.firstName}} {{audit.auditByName.title.name}}
          {{group.createdByName.lastName }}, {{group.createdByName.firstName }} {{group.createdByName.title.name }} ({{group.SourceName }}){{group.createdByName.lastName }}, {{group.createdByName.firstName }} {{group.createdByName.title.name }} ({{group.SourceName }})

          No chart notes found.

          ');\n}]);\n}(window, document, window.angular));","function EditEntryController(isEdit, entry, logger, $uibModalInstance, $scope) {\r\n var vm = this;\r\n\r\n vm.entryText = entry.Text;\r\n vm.isEdit = isEdit;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.textareaBlurred = blurred;\r\n vm.pageLeaveDirty = pageLeaveDirty;\r\n\r\n function ok() {\r\n $uibModalInstance.close({Text: vm.entryText});\r\n }\r\n\r\n function cancel() {\r\n logger.log(\"Canceled edit/add entry dialog\", {text: vm.entryText});\r\n $uibModalInstance.dismiss(\"cancel\");\r\n }\r\n\r\n function blurred() {\r\n logger.log(\"add free text blurred.\", {text: vm.entryText});\r\n }\r\n\r\n function pageLeaveDirty() {\r\n logger.log(\"attempt to leave page with dirty entry\", {text: vm.entryText});\r\n }\r\n\r\n $scope.$on(\"$destroy\", function () {\r\n logger.log(\"add free text modal is closed.\", {text: vm.entryText});\r\n });\r\n}\r\n\r\nangular.module(\"patient.chart\").controller(\"EditEntryController\", EditEntryController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/chart/editentry.tpl.html',\n '

          {{vm.isEdit ? \"Edit Chart Note\" : \"Add Chart Note\"}}

          ');\n}]);\n}(window, document, window.angular));","function PatientChartEntryController(entryGroup, masterEntries, PatientChartService, ConfigurationsService, lodash, $timeout, $uibModal, $stateParams, $state, DirtyPage, $scope, vhSweetAlert, logger) {\r\n var vm = this;\r\n vm.searchText = \"\";\r\n vm.searchChanged = searchChanged;\r\n vm.pageChanged = pageChanged;\r\n vm.notes = mapGroup(entryGroup);\r\n vm.alertNotes = entryGroup.AlertPatientChartEntries;\r\n vm.messageNotes = entryGroup.MessagePatientChartEntries || [];\r\n vm.addEntry = addEntry;\r\n vm.addCustomNote = addCustomNote;\r\n vm.saveNote = saveNote;\r\n vm.deleteNote = deleteNote;\r\n vm.editNote = editNote;\r\n vm.cancelSearch = cancelSearch;\r\n vm.cancel = cancel;\r\n vm.canSave = true;\r\n vm.showEmptyError = false;\r\n vm.noteIsEmpty = noteIsEmpty;\r\n vm.deleteMessage = deleteMessage;\r\n\r\n var delay = null;\r\n var searchDelay = 500;\r\n var originalNotes = angular.copy(vm.notes);\r\n var originalMsgNotesLength = vm.messageNotes.length;\r\n\r\n DirtyPage.registerDirtyChecker(\"ChartEntryForm\", checkerForDirty);\r\n\r\n $scope.$on(\"$destroy\", function () {\r\n logger.log(\"Left Page\");\r\n DirtyPage.unregisterDirtyChecker(\"ChartEntryForm\");\r\n });\r\n\r\n bindMasterEntries(masterEntries);\r\n logger.log(\"Page Loaded\", {EntryGroupId: entryGroup.PatientChartEntryGroupId});\r\n\r\n function checkerForDirty() {\r\n if (originalNotes.length !== vm.notes.length\r\n || originalMsgNotesLength !== vm.messageNotes.length) {\r\n logger.log(\"Attempt to leave with dirty page\");\r\n return true;\r\n }\r\n for(var i = 0; i < originalNotes.length; i++) {\r\n var other = vm.notes[i];\r\n var note = originalNotes[i];\r\n if (other.PatientChartEntryId !== note.PatientChartEntryId || other.Text != note.Text) {\r\n logger.log(\"Attempt to leave with dirty page\");\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n function bindMasterEntries(masterEntryResponse) {\r\n var usedMasterIds = lodash(vm.notes).pluck(\"MasterChartEntryId\").compact().value();\r\n\r\n ConfigurationsService.getConfig().then(function(configs){\r\n var collapse = !!configs.CollapsePatientChartNotes;\r\n\r\n vm.categories = masterEntryResponse.Response;\r\n vm.categories.forEach(function(category){\r\n category.collapsed = collapse;\r\n });\r\n if (usedMasterIds.length > 0) {\r\n lodash(vm.categories)\r\n .pluck(\"MasterChartEntries\")\r\n .flatten()\r\n .filter(function (e) {\r\n return lodash.contains(usedMasterIds, e.MasterChartEntryId);\r\n }).forEach(function (e) {\r\n e.inUse = true;\r\n }).value();\r\n }\r\n vm.totalMasterEntries = masterEntryResponse.TotalCount;\r\n vm.pageSize = masterEntryResponse.Request.PageSize;\r\n vm.pageNumber = masterEntryResponse.Request.PageNumber;\r\n });\r\n }\r\n\r\n function cancelSearch() {\r\n vm.searchText = '';\r\n vm.searchChanged();\r\n }\r\n\r\n function cancel() {\r\n logger.log(\"Clicked Cancel\");\r\n $state.go(\"^\");\r\n }\r\n\r\n function searchChanged() {\r\n if(vm.searchText.length <= 20) {\r\n if (delay !== null) {\r\n $timeout.cancel(delay);\r\n }\r\n delay = $timeout(search, searchDelay);\r\n delay.then(function () {\r\n delay = null;\r\n });\r\n }\r\n }\r\n\r\n function pageChanged() {\r\n if (delay === null) {\r\n search();\r\n }\r\n }\r\n\r\n function search() {\r\n PatientChartService.getMasterEntries($stateParams.patientId, vm.pageSize, vm.pageNumber, vm.searchText).then(bindMasterEntries);\r\n }\r\n\r\n function mapGroup(group) {\r\n var notes = lodash.map(group.InterventionPatientChartEntries, function (entry) {\r\n entry.editable = false;\r\n return entry;\r\n });\r\n notes = notes.concat(lodash.map(group.MessageInterventionPatientChartEntries, function (entry) {\r\n entry.editable = false;\r\n return entry;\r\n }));\r\n notes = notes.concat(lodash.map(group.TextPatientChartEntries, function (e) {\r\n e.editable = e.MasterChartEntryId === null || e.MasterChartEntryId === 0;\r\n return e;\r\n }));\r\n return notes;\r\n }\r\n\r\n function notesToString(notes) {\r\n return lodash(notes).pluck(\"Text\").value().join(\" \");\r\n }\r\n\r\n function saveNote() {\r\n logger.log(\"Clicked Save\", {oldEntry: notesToString(originalNotes), newEntry: notesToString(vm.notes)});\r\n\r\n if ($stateParams.patientChartEntryGroupId) {\r\n return updateNote();\r\n } else {\r\n return addNote();\r\n }\r\n }\r\n\r\n function updateNote() {\r\n entryGroup.InterventionPatientChartEntries = lodash.filter(vm.notes, \"InterventionId\");\r\n entryGroup.MessageInterventionPatientChartEntries = lodash.filter(vm.notes, \"MessageInterventionId\");\r\n var except = lodash.union(entryGroup.InterventionPatientChartEntries, entryGroup.MessageInterventionPatientChartEntries);\r\n entryGroup.TextPatientChartEntries = lodash.xor(vm.notes, except);\r\n vm.notes.forEach(function(note) {\r\n note.Text = decodeHtml(note.Text);\r\n });\r\n logger.log(\"Update Note\", {oldEntry: notesToString(originalNotes), newEntry: notesToString(vm.notes)});\r\n return PatientChartService.updateEntryGroup($stateParams.patientId, $stateParams.patientChartEntryGroupId, entryGroup).then(function (response) {\r\n logger.log(\"Update success\", {newEntry: notesToString(vm.notes)});\r\n vm.canSave = false;\r\n originalNotes = angular.copy(vm.notes);\r\n $state.go(\"^\", {changedEntry: response.PatientChartEntryGroupId}, {reload: true});\r\n });\r\n }\r\n\r\n function deleteNote(note) {\r\n logger.log(\"Clicked delete note entry.\", {note: note.Text});\r\n vhSweetAlert.verify(\"Are you sure?\", \"Are you sure you want to delete note: \" + formatLength(note.Text), \"Delete\").then(function (isConfirm) {\r\n if (isConfirm) {\r\n logger.log(\"Confirmed delete note\", {note: note.Text});\r\n lodash.remove(vm.notes, note);\r\n if (note.MasterChartEntryId) {\r\n var masterEntry = lodash(vm.categories).pluck(\"MasterChartEntries\")\r\n .flatten()\r\n .find({MasterChartEntryId: note.MasterChartEntryId});\r\n if (masterEntry) {\r\n masterEntry.inUse = false;\r\n }\r\n }\r\n } else {\r\n logger.log(\"Cancelled delete note\", {note: note.Text});\r\n }\r\n });\r\n }\r\n\r\n function deleteMessage(note) {\r\n logger.log(\"Clicked delete message entry.\", { note: note.Text });\r\n vhSweetAlert.verify(\"Are you sure?\", \"Are you sure you want to delete message: \" + formatLength(note.Text), \"Delete\").then(function (isConfirm) {\r\n if (isConfirm) {\r\n logger.log(\"Confirmed delete message\", { note: note.Text });\r\n lodash.remove(vm.messageNotes, note);\r\n } else {\r\n logger.log(\"Cancelled delete note\", { note: note.Text });\r\n }\r\n });\r\n }\r\n\r\n function formatLength(text){\r\n return (text.length > 300)? text.substring(0, 300) + \"...\" : text; \r\n }\r\n\r\n function addNote() {\r\n logger.log(\"Creating note\", {note: notesToString(vm.notes)});\r\n vm.notes.forEach(function(note) {\r\n note.Text = decodeHtml(note.Text);\r\n });\r\n return PatientChartService.addEntryGroup($stateParams.patientId, {\r\n PatientId: $stateParams.patientId,\r\n TextPatientChartEntries: vm.notes\r\n }).then(function (response) {\r\n logger.log(\"Note Created\", {noteId: response.PatientChartEntryGroupId, note: notesToString(vm.notes)});\r\n vm.canSave = false;\r\n originalNotes = angular.copy(vm.notes);\r\n $state.go(\"^\", {changedEntry: response.PatientChartEntryGroupId}, {reload: true});\r\n });\r\n }\r\n\r\n // Notes are rendered as html, adding a space if less than symbol is used with no space in between the following letter.\r\n function decodeHtml(str) {\r\n const regex = /[<]\\w+/g\r\n var newNote;\r\n if (regex.test(str)) {\r\n newNote = str.split('<').join('< ');\r\n return newNote;\r\n }\r\n return str;\r\n }\r\n\r\n\r\n function addEntry(masterContent) {\r\n vm.showEmptyError = false;\r\n logger.log(\"Add master note\", {currentNote: notesToString(vm.notes), addedNote: masterContent.Text});\r\n vm.notes.push({\r\n Text: masterContent.Text,\r\n MasterChartEntryId: masterContent.MasterChartEntryId,\r\n PatientId: $stateParams.patientId\r\n });\r\n masterContent.inUse = true;\r\n vm.searchText = \"\";\r\n search();\r\n }\r\n\r\n function editNote(note) {\r\n logger.log(\"Start edit note entry\", {originalNote: note.Text});\r\n openEditModal({Text: note.Text}, true).then(function (entry) {\r\n logger.log(\"Edit note entry finished\", {oldNote: note.Text, newNote: entry.Text});\r\n note.Text = entry.Text;\r\n });\r\n }\r\n\r\n function addCustomNote() {\r\n var text = vm.categories.length > 0 ? \"\" : vm.searchText || \"\";\r\n logger.log(\"Start add new entry\", {startText: text});\r\n openEditModal({Text: text}, false).then(function (entry) {\r\n logger.log(\"Finished add new entry\", {entry: entry.Text});\r\n entry.PatientId = $stateParams.patientId;\r\n entry.editable = true;\r\n vm.notes.push(entry);\r\n vm.showEmptyError = false;\r\n });\r\n }\r\n\r\n function openEditModal(entry, isEdit) {\r\n return $uibModal.open({\r\n templateUrl: \"modules/patient/chart/editentry.tpl.html\",\r\n controller: \"EditEntryController as vm\",\r\n backdrop: \"static\",\r\n resolve: {\r\n isEdit: isEdit,\r\n entry: entry,\r\n logger: logger\r\n }\r\n }).result;\r\n }\r\n\r\n function noteIsEmpty() {\r\n var isEmpty = false;\r\n if (vm.alertNotes != undefined) {\r\n if (vm.notes.length < 1 && vm.alertNotes.length < 1) {\r\n isEmpty = true;\r\n }\r\n } else if (vm.alertNotes == undefined && vm.notes.length < 1) {\r\n isEmpty = true;\r\n }\r\n return isEmpty;\r\n }\r\n}\r\n\r\nangular.module(\"patient.chart\").controller(\"PatientChartEntryController\", PatientChartEntryController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/chart/entry.tpl.html',\n '
          Add Quick Notes
           {{category.Name}}

          No Notes Found.

          Patient Note
          {{note.Text}}
          {{note.Text}}
            \"\" {{ msg.MessageCreator }}  {{ msg.MessageCreatedUtc | datetime : \"datetime\" }}

          Note cannot be empty.

          ');\n}]);\n}(window, document, window.angular));","function PatientDemographicsCaregiversService($http) {\r\n function getCaregivers() {\r\n return $http.get('/api/Caregiver/pickList').then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientCaregivers(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/monitoringCaregivers').then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function addPatientCaregiver(patientId, caregiverId) {\r\n var model = {\r\n PatientId: patientId,\r\n CaregiverId: caregiverId,\r\n IsDeleted: false\r\n };\r\n\r\n return $http.post('/api/Patient/' + patientId + '/monitoringCaregiver', model).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updatePatientCaregivers(patientId, model) {\r\n model.forEach(element => {\r\n element.PatientId = patientId;\r\n });\r\n \r\n return $http.post('/api/Patient/' + patientId + '/monitoringCaregivers', model).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function removePatientCaregiver(patientId, patientCaregiverId) {\r\n return $http.delete('/api/Patient/' + patientId + '/monitoringCaregiver/' + patientCaregiverId).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function assignPatientCaregivers(patientList, caregiverList) {\r\n const data = {\r\n patients: patientList,\r\n caregivers: caregiverList\r\n };\r\n return $http.put('/api/Patient/monitoringCaregivers/add', data).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function removePatientCaregivers(patientList, caregiverList) {\r\n const data = {\r\n patients: patientList,\r\n caregivers: caregiverList\r\n };\r\n return $http.put('/api/Patient/monitoringCaregivers/remove', data).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getCaregivers: getCaregivers,\r\n getPatientCaregivers: getPatientCaregivers,\r\n addPatientCaregiver: addPatientCaregiver,\r\n updatePatientCaregivers: updatePatientCaregivers,\r\n removePatientCaregiver: removePatientCaregiver,\r\n assignPatientCaregivers: assignPatientCaregivers,\r\n removePatientCaregivers: removePatientCaregivers\r\n }\r\n}\r\n\r\nangular.module(\"patient.demographics\").service(\"PatientDemographicsCaregiversService\", PatientDemographicsCaregiversService);\r\n","function CareteamModalController($uibModalInstance, $scope, $stateParams, $filter, lodash, monitoringCaregivers, PatientDemographicsCaregiversService) {\r\n\r\n var availableCaregivers = [];\r\n $scope.filteredAvailableCaregivers = [];\r\n $scope.careteam = {}; // binding directly to $scope does not work!! Must have a \"proxy\" object ($scope.careteam)\r\n PatientDemographicsCaregiversService.getCaregivers().then(function (data) {\r\n $scope.careteam.monitoringCaregivers = angular.copy($filter('orderBy')(monitoringCaregivers, 'DisplayName')) || [];\r\n availableCaregivers = data;\r\n filterVisibleList();\r\n });\r\n\r\n function filterVisibleList() {\r\n var result = [];\r\n angular.forEach(availableCaregivers,function(available) {\r\n available.CaregiverId = available.Id;\r\n if (lodash.findIndex($scope.careteam.monitoringCaregivers, function(existing) { return existing.CaregiverId == available.Id; }) == -1 ) {\r\n result.push(available);\r\n }\r\n });\r\n\r\n $scope.filteredAvailableCaregivers = result;\r\n }\r\n\r\n $scope.setFocus = function(event) {\r\n event.preventDefault();\r\n $scope.$broadcast('careteam.focus');\r\n };\r\n\r\n $scope.ok = function() {\r\n\r\n PatientDemographicsCaregiversService.updatePatientCaregivers($stateParams.patientId, $scope.careteam.monitoringCaregivers).then(function(result){\r\n $uibModalInstance.close();\r\n });\r\n \r\n };\r\n\r\n $scope.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('patient.demographics').controller('CareteamModalController',CareteamModalController);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/careteam.modal.html',\n '

          Care Team

          {{$item.DisplayName}}{{item.DisplayName}}
          A miminum of 1 Care Team Member is required
          ');\n}]);\n}(window, document, window.angular));","function DemographicsController($stateParams, $state, $scope, $window, $timeout, $uibModal, $rootScope, $q,\r\n lodash, vhSweetAlert, SmoothScroll, repository,\r\n DemographicsService, ConfigurationsService, AuthorizationService, PermissionService, ServiceLevelType,\r\n PatientServiceLevelService, PatientMilestoneService, PatientDemographicsCaregiversService,\r\n PatientDemographicSpecialHandlingService, PatientDemographicsProvidersService, EditConfigurationsService,\r\n PatientMilestoneState, ProviderGroups, demographics, patientDemographics, patientIdentifierFields, monitoringCaregivers,\r\n hasWritePermission, hasMaskedIdentifiersWritePermission, hasPatientHospitalUpdatePermission, hasProgramStartDateWritePermission,\r\n RequireAdditionalIdentifier, ShowPatientIdentifier, specialHandling, emergencyContacts, showPinInHeader, patientConfigurationRankings, currentSites) {\r\n\r\n var vm = this;\r\n var _patientMileStonePermission = PermissionService.userHasPermission(['PatientMilestoneRead']);\r\n\r\n loadController(patientDemographics);\r\n\r\n function loadController(patientDemographics) {\r\n\r\n if (!vm.patientId) {\r\n vm.patientId = $stateParams.patientId || 0;\r\n }\r\n\r\n vm.editMode = false || vm.patientId == 0;\r\n /* if demographics (lists) is undefined then we are on View screen */\r\n vm.webformfields = DemographicsService.getWebFormFields(demographics.WebFormFields);\r\n vm.races = demographics.Races;\r\n vm.languages = demographics.Languages;\r\n vm.religions = demographics.Religions;\r\n vm.populationgroups = demographics.PopulationGroups;\r\n if (currentSites != null && currentSites.length > 0) {\r\n var currentSiteId = currentSites[0].SiteId;\r\n vm.populations = demographics.Populations.filter(x => x.SiteId == currentSiteId);\r\n }\r\n else {\r\n vm.populations = demographics.Populations;\r\n } \r\n vm.hospitals = demographics.Hospitals;\r\n vm.programdurations = demographics.ProgramDurations;\r\n vm.patientProviders = [];\r\n vm.providergroups = [];\r\n vm.referrals = demographics.Referrals;\r\n vm.payers = demographics.Payers;\r\n vm.careManagementTypes = [];\r\n vm.timezones = demographics.TimeZones;\r\n vm.genders = ['Male', 'Female'];\r\n vm.patientDevices = [];\r\n\r\n vm.patientMilestoneState = new PatientMilestoneState(vm.patientId);\r\n vm.hasWritePermission = hasWritePermission;\r\n vm.hasMaskedIdentifiersWritePermission = hasMaskedIdentifiersWritePermission;\r\n vm.hasPatientHospitalUpdatePermission = hasPatientHospitalUpdatePermission;\r\n vm.hasProgramStartDateWritePermission = hasProgramStartDateWritePermission;\r\n vm.RequireAdditionalIdentifier = RequireAdditionalIdentifier;\r\n vm.monitoringCaregivers = monitoringCaregivers;\r\n vm.specialHandling = specialHandling;\r\n vm.patientIdentifierFields = patientIdentifierFields;\r\n vm.ShowPatientIdentifier = ShowPatientIdentifier;\r\n vm.validationEnabled = ConfigurationsService.configParams.ShowRequiredFieldMissing;\r\n vm.patientConfigurationRankings = patientConfigurationRankings;\r\n\r\n vm.contacts = emergencyContacts;\r\n vm.err = [];\r\n vm.showHl7Ident = false;\r\n vm.AddSecondaryProviderToProviderList = true;\r\n vm.showGoDeviceOrderStatus = false;\r\n vm.showHomeServiceLevelInfo = false;\r\n vm.photo = '';\r\n vm.clearPhoto = clearPhoto;\r\n vm.file_changed = file_changed;\r\n vm.maxImageDim = 100;\r\n vm.focusLastName = vm.patientId == 0;\r\n vm.enableEditing = true;\r\n\r\n if (vm.patientId > 0) {\r\n DemographicsService.getPatientDevices(vm.patientId).then(function (data) {\r\n vm.patientDevices = data;\r\n });\r\n }\r\n\r\n $scope.$watch('vm.isOther', function (val) {\r\n var provider = $window.document.getElementById('Provider');\r\n if (provider && val === true) {\r\n provider.focus();\r\n }\r\n });\r\n\r\n $scope.$watch('vm.patient.HospitalId', function (id) {\r\n var hospital = vm.hospitals.filter(function (hosp) {\r\n return hosp.Id == id;\r\n })[0];\r\n var caregiver = AuthorizationService.getCaregiver();\r\n\r\n if (hospital.IsThirdParty || caregiver.IsThirdParty) {\r\n vm.patient.IsThirdPartyMonitored = true;\r\n }\r\n });\r\n\r\n vm.GoAllowPasswords = false;\r\n if (ConfigurationsService.configParams['GoAllowPasswords']) {\r\n vm.GoAllowPasswords = ConfigurationsService.configParams['GoAllowPasswords']\r\n }\r\n\r\n vm.HL7UseVivifyID = false;\r\n if (ConfigurationsService.configParams['HL7UseVivifyID']) {\r\n vm.HL7UseVivifyID = ConfigurationsService.configParams['HL7UseVivifyID']\r\n }\r\n\r\n vm.datePickerOptionsDOB = {\r\n dateDisabled: disabledDate\r\n }\r\n\r\n vm.datePickerOptionsProgramStartDate = {\r\n dateDisabled: disabledProgramDate\r\n }\r\n\r\n $scope.dob = '';\r\n if (patientDemographics && patientDemographics.DOB) {\r\n var DateofBirth = angular.copy(patientDemographics.DOB);\r\n var d = new Date(Date.parse(DateofBirth));\r\n var day = d.getUTCDate();\r\n var month = d.getUTCMonth();\r\n var year = d.getUTCFullYear();\r\n $scope.dob = new Date(year, month, day);\r\n }\r\n if (vm.patient && vm.patient.DOB) {\r\n $scope.dob = angular.copy(vm.patient.DOB);\r\n }\r\n\r\n if (ConfigurationsService.configParams['UseExtendedGenderIds']) {\r\n vm.genders.push('Other');\r\n vm.genders.push('Unknown');\r\n }\r\n\r\n if (vm.patientId > 0) {\r\n getServiceLevel();\r\n }\r\n\r\n $scope.$on('ServiceLevelChanged', function (event, serviceLevelData) {\r\n serviceLevelChanged(serviceLevelData);\r\n });\r\n\r\n var serviceLevelUnassignedListener = $rootScope.$on('vh:serviceLevelUnassigned', function () {\r\n getPatient(vm.patientId);\r\n getServiceLevel();\r\n });\r\n $scope.$on('$destroy', serviceLevelUnassignedListener);\r\n\r\n $rootScope.$on('vh:monitoringStatusChange', updatePatientMonitoringStatus);\r\n $scope.$on('$destroy', updatePatientMonitoringStatus);\r\n\r\n\r\n ConfigurationsService.getConfig().then(function (data) {\r\n vm.isKitPickupEnabled = (data.KitLogisticsLevel === 'PickUpOnly' || data.KitLogisticsLevel === 'Full');\r\n vm.EnableAllThirdPartyMonitoring = data.EnableAllThirdPartyMonitoring === true;\r\n vm.UsePinValidation = data.UsePinValidation === true;\r\n vm.HybridAppEnabled = data.HybridAppEnabled === true;\r\n vm.ShowProviderHL7Ident = data.ShowProviderHL7Ident === true;\r\n vm.HL7UseVivifyID = data.HL7UseVivifyID;\r\n vm.AddSecondaryProviderToProviderList = data.AddSecondaryProviderToProviderList;\r\n\r\n if (!vm.patientId || vm.patientId === 0) {\r\n setDefaults(patientDemographics);\r\n }\r\n\r\n bindPatient(patientDemographics);\r\n if (vm.patient.UserName === null || vm.patient.UserName === undefined || vm.patient.UserName.length === 0) {\r\n handleUserNamePolling(vm.patient.ServiceLevelTypeId);\r\n }\r\n });\r\n\r\n vm.providergroups = ProviderGroups;\r\n }\r\n\r\n vm.passwordSet = function () {\r\n return vm.patient.HasPatientPassword;\r\n };\r\n\r\n vm.showPin = function () {\r\n\r\n if (!showPinInHeader)\r\n return false;\r\n\r\n if (vm.GoAllowPasswords === false) {\r\n return true;\r\n }\r\n return !vm.patient.HasPatientPassword;\r\n };\r\n\r\n vm.validateBirthDay = function () {\r\n if ($scope && $scope.patientDemographics && $scope.patientDemographics.DOB) {\r\n var today = new Date();\r\n if ($scope.dob && $scope.dob > today) {\r\n $scope.patientDemographics.DOB.$setValidity('future', false);\r\n\r\n } else {\r\n $scope.patientDemographics.DOB.$setValidity('future', true);\r\n }\r\n }\r\n }\r\n\r\n vm.updateTimeZone = function (id) {\r\n\r\n var hospitalTimeZone = lodash.find(vm.hospitals, function (o) {\r\n return o.Id == id;\r\n });\r\n\r\n vm.patient.TimeZoneId = hospitalTimeZone.TimeZoneId;\r\n }\r\n\r\n var disabledDate = function (o) {\r\n var day = new Date(o.date);\r\n var today = new Date();\r\n if (day < today) {\r\n return false;\r\n\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n vm.validateProgramStartDate = function () {\r\n\r\n if ($scope && $scope.patientDemographics && $scope.patientDemographics.ProgramStartDate) {\r\n var day = new Date(vm.patient.ProgramStartDate).setHours(0, 0, 0, 0);\r\n var today = new Date().setHours(0, 0, 0, 0);\r\n if (vm.patient.ProgramStartDate && day < today) {\r\n $scope.patientDemographics.ProgramStartDate.$setValidity('pastDate', false);\r\n\r\n } else {\r\n $scope.patientDemographics.ProgramStartDate.$setValidity('pastDate', true);\r\n }\r\n }\r\n }\r\n\r\n var disabledProgramDate = function (o) {\r\n var day = new Date(o.date).setHours(0, 0, 0, 0);\r\n var today = new Date().setHours(0, 0, 0, 0);\r\n if (day >= today) {\r\n return false;\r\n\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n async function getServiceLevel() {\r\n vm.patientServiceLevel = await PatientServiceLevelService.getPatientServiceLevelWithKitInfo(vm.patientId);\r\n\r\n const shippingStatuses = new Set([17, 18, 19]);\r\n if (vm.patientServiceLevel.goDeviceOrderStatus && shippingStatuses.has(vm.patientServiceLevel.goDeviceOrderStatus.statusId)) {\r\n vm.showGoDeviceOrderStatus = true;\r\n }\r\n if(vm.patientServiceLevel.serviceLevelTypeId && (vm.patientServiceLevel.serviceLevelTypeId == ServiceLevelType.RPM ||\r\n vm.patientServiceLevel.serviceLevelTypeId == ServiceLevelType.RPMVideo)) {\r\n vm.showHomeServiceLevelInfo = true;\r\n }\r\n }\r\n\r\n async function serviceLevelChanged(serviceLevelData) {\r\n handleUserNamePolling(vm.patientServiceLevel.name);\r\n\r\n $timeout(() => {\r\n DemographicsService.refreshPatientHeader(vm.patient.Id)\r\n }, 1000);\r\n\r\n await getServiceLevel(); //update vm.patientServiceLevel\r\n\r\n if (vm.patientServiceLevel.kitId > 0) {\r\n vm.patient.ServiceLevelKitNum = vm.patientServiceLevel.kit.kitNo;\r\n }\r\n\r\n if (serviceLevelData.ServiceLevel) {\r\n vm.patient.ServiceLevel = serviceLevelData.ServiceLevel.DisplayText;\r\n vm.patient.ServiceLevelId = serviceLevelData.ServiceLevel.ServiceLevelId;\r\n vm.patient.ServiceLevelTypeId = serviceLevelData.ServiceLevel.ServiceLevelTypeId;\r\n // this is crazy that we represent this value in at least 3 different places\r\n vm.patient.ServiceLevelPIN = serviceLevelData.PIN || serviceLevelData.patientServiceLevel.pin || vm.patient.ServiceLevelPIN;\r\n vm.patient.ServiceLevelPhoneNumber = serviceLevelData.PhoneNum;\r\n }\r\n\r\n if (serviceLevelData.goDevicesOrder != null) {\r\n vm.patientDevices = await DemographicsService.getPatientDevices(vm.patient.Id);\r\n }\r\n }\r\n\r\n function ensureDropDownsIncludePatientData() {\r\n if (vm.patient.HospitalId > 0) {\r\n var option = lodash.find(vm.hospitals, function (o) {\r\n return o.Id == vm.patient.HospitalId\r\n });\r\n if (!option) {\r\n vm.hospitals.push({ Id: vm.patient.HospitalId, FacilityName: vm.patient.HospitalName });\r\n }\r\n }\r\n if (vm.patient.RaceId > 0) {\r\n var option = lodash.find(vm.races, function (o) {\r\n return o.RaceId == vm.patient.RaceId\r\n });\r\n if (!option) {\r\n vm.races.push({ RaceId: vm.patient.RaceId, Name: vm.patient.Race });\r\n }\r\n }\r\n if (vm.patient.LanguageId > 0) {\r\n var option = lodash.find(vm.languages, function (o) {\r\n return o.LanguageId == vm.patient.LanguageId\r\n });\r\n if (!option) {\r\n vm.languages.push({ LanguageId: vm.patient.LanguageId, Name: vm.patient.Language });\r\n }\r\n }\r\n if (vm.patient.ReligionId > 0) {\r\n var option = lodash.find(vm.religions, function (o) {\r\n return o.ReligionId == vm.patient.ReligionId\r\n });\r\n if (!option) {\r\n vm.religions.push({ ReligionId: vm.patient.ReligionId, Name: vm.patient.Religion });\r\n }\r\n }\r\n if (vm.patient.PopulationGroupId > 0) {\r\n var option = lodash.find(vm.populationgroups, function (o) {\r\n return o.Id == vm.patient.PopulationGroupId\r\n });\r\n if (!option) {\r\n vm.populationgroups.push({ Id: vm.patient.PopulationGroupId, Name: vm.patient.PopulationGroup });\r\n }\r\n }\r\n if (vm.patient.PopulationId > 0) {\r\n var option = lodash.find(vm.populations, function (o) {\r\n return o.PopulationId == vm.patient.PopulationId\r\n });\r\n if (!option) {\r\n vm.populations.push({ PopulationId: vm.patient.PopulationId, PopulationName: vm.patient.PopulationName });\r\n }\r\n }\r\n if (vm.patient.ProgramDurationId > 0) {\r\n var option = lodash.find(vm.programdurations, function (o) {\r\n return o.ProgramDurationId == vm.patient.ProgramDurationId\r\n });\r\n if (!option) {\r\n vm.programdurations.push({\r\n ProgramDurationId: vm.patient.ProgramDurationId,\r\n Name: vm.patient.ProgramDurationName\r\n });\r\n }\r\n }\r\n if (vm.patient.ProviderGroupId > 0) {\r\n var option = lodash.find(vm.providergroups, function (o) {\r\n return o.Id == vm.patient.ProviderGroupId\r\n });\r\n if (!option) {\r\n vm.providergroups.push({ Id: vm.patient.ProviderGroupId, Name: vm.patient.ProviderGroup });\r\n }\r\n }\r\n if (vm.patient.ReferralId > 0) {\r\n var option = lodash.find(vm.referrals, function (o) {\r\n return o.Id == vm.patient.ReferralId\r\n });\r\n if (!option) {\r\n vm.referrals.push({ Id: vm.patient.ReferralId, Name: vm.patient.Referral });\r\n }\r\n }\r\n if (vm.patient.PayerId > 0) {\r\n var option = lodash.find(vm.payers, function (o) {\r\n return o.Id == vm.patient.PayerId\r\n });\r\n if (!option) {\r\n vm.payers.push({ Id: vm.patient.PayerId, Name: vm.patient.Payer, CareManagementTypes: vm.patient.PatientCareManagementTypes || [] });\r\n }\r\n }\r\n if (vm.patient.TimeZoneId > 0) {\r\n var option = lodash.find(vm.timezones, function (o) {\r\n return o.id == vm.patient.TimeZoneId\r\n });\r\n if (!option) {\r\n vm.timezones.push({ id: vm.patient.TimeZoneId, DisplayValue: '' });\r\n }\r\n }\r\n }\r\n\r\n function handleUserNamePolling(serviceLevel) {\r\n //Do not continue polling for report if user navigates to different page or report\r\n if ($state && $state.current.name === 'patients.patient.demographics' && serviceLevel === 9) {\r\n DemographicsService.getPatientUserName(vm.patient.Id).then(function (data) {\r\n if (data === null || data === undefined || data.length === 0) {\r\n var t = setTimeout(function () {\r\n handleUserNamePolling(serviceLevel);\r\n }, 5000);\r\n } else if (data.length > 0) {\r\n vm.patient.UserName = data;\r\n }\r\n });\r\n }\r\n }\r\n\r\n function updatePatientMonitoringStatus(event, monitoringStatusId) {\r\n vm.patient.MonitoringStatusId = monitoringStatusId;\r\n }\r\n\r\n function getPatient(patientId) {\r\n DemographicsService.getPatient(patientId)\r\n .then(function (data) {\r\n bindPatient(data);\r\n DemographicsService.refreshPatientHeader(patientId);\r\n });\r\n }\r\n\r\n function setDefaults(patient) {\r\n var hospital = undefined;\r\n if (vm.hospitals.length == 1) {\r\n hospital = vm.hospitals[0];\r\n }\r\n\r\n if (!hospital) {\r\n hospital = lodash.find(vm.hospitals, 'IsDefault');\r\n }\r\n\r\n if (hospital) {\r\n patient.HospitalId = hospital.Id;\r\n patient.TimeZoneId = hospital.TimeZoneId;\r\n }\r\n\r\n var language = lodash.find(vm.languages, 'IsDefault');\r\n if (language) {\r\n patient.LanguageId = language.LanguageId;\r\n }\r\n\r\n var payer = lodash.find(vm.payers, 'IsDefault');\r\n if (payer) {\r\n vm.careManagementTypes = payer.CareManagementTypes || [];\r\n patient.PayerId = payer.Id;\r\n\r\n patient.PatientCareManagementTypes = [];\r\n if (payer.CareManagementTypes && payer.CareManagementTypes.length === 1) {\r\n patient.PatientCareManagementTypes.push(payer.CareManagementTypes[0]);\r\n }\r\n }\r\n\r\n var populationgroup = lodash.find(vm.populationgroups, 'IsDefault');\r\n if (populationgroup) {\r\n patient.PopulationGroupId = populationgroup.Id;\r\n }\r\n\r\n var population = lodash.find(vm.populations, 'IsDefault');\r\n if (population) {\r\n patient.PopulationId = population.PopulationId;\r\n }\r\n\r\n var programduration = lodash.find(vm.programdurations, 'IsDefault');\r\n if (programduration) {\r\n patient.ProgramDurationId = programduration.ProgramDurationId;\r\n }\r\n\r\n var providergroup = lodash.find(vm.providergroups, 'IsDefault');\r\n if (providergroup) {\r\n patient.ProviderGroupId = providergroup.Id;\r\n }\r\n\r\n var race = lodash.find(vm.races, 'IsDefault');\r\n if (race) {\r\n patient.RaceId = race.RaceId;\r\n }\r\n\r\n var referral = lodash.find(vm.referrals, 'IsDefault');\r\n if (referral) {\r\n patient.ReferralId = referral.Id;\r\n }\r\n\r\n var religion = lodash.find(vm.religions, 'IsDefault');\r\n if (religion) {\r\n patient.ReligionId = religion.ReligionId;\r\n }\r\n\r\n var caregiver = AuthorizationService.getCaregiver();\r\n if (vm.EnableAllThirdPartyMonitoring || (hospital && hospital.IsThirdParty) || (caregiver && caregiver.IsThirdParty)) {\r\n patient.IsThirdPartyMonitored = true;\r\n }\r\n }\r\n\r\n function bindPatient(data) {\r\n vm.patient = data;\r\n vm.patient.NewPatientIdent = vm.patient.PatientIdent;\r\n\r\n if (vm.patient.PatientProviders) {\r\n vm.patientProviders = vm.patient.PatientProviders.filter(function (patientProvider) {\r\n return !patientProvider.IsPrimary;\r\n });\r\n }\r\n\r\n vm.patient.PersonalCaregiverNameField = vm.patient.PersonalCaregiverName;\r\n if (demographics) {\r\n ensureDropDownsIncludePatientData();\r\n }\r\n\r\n if (vm.patient.DOB && vm.patient.DOB.length > 0) {\r\n // without this, we would see 1 day before actual date\r\n vm.patient.DOB = DemographicsService.getUtcDate(vm.patient.DOB);\r\n }\r\n\r\n if (vm.patient.ProgramStartDate && vm.patient.ProgramStartDate.length > 0) {\r\n // without this, we would see 1 day before actual date\r\n vm.patient.ProgramStartDate = DemographicsService.getUtcDate(vm.patient.ProgramStartDate);\r\n }\r\n\r\n if (vm.patient.photo != undefined) {\r\n vm.photo = vm.patient.photo;\r\n }\r\n\r\n handleProviders();\r\n\r\n vm.originalPatient = angular.copy(vm.patient);\r\n\r\n if (_patientMileStonePermission && vm.patientId > 0) {\r\n PatientMilestoneService.getPatientMilestoneList(vm.patientId).then(function (x) {\r\n vm.Milestones = x.data;\r\n vm.patientMilestoneState.setStonesFromBag(x.data, vm.patient);\r\n });\r\n };\r\n\r\n if (vm.patient && vm.patient.MRNIdent && $scope.patientDemographics) {\r\n vm.checkIdentifier('MRNIdent', vm.patient.MRNIdent);\r\n }\r\n }\r\n\r\n vm.getTaskOrderDisplay = function () {\r\n if (!vm.patientServiceLevel || !vm.patientServiceLevel.taskOrders) {\r\n return '';\r\n }\r\n\r\n var taskOrders = lodash.pluck(vm.patientServiceLevel.taskOrders, 'number');\r\n taskOrders = lodash.filter(taskOrders, function (taskOrder) { return taskOrder !== undefined && taskOrder.length > 0; });\r\n return taskOrders.join(', ');\r\n }\r\n\r\n function clearPhoto() {\r\n vm.photo = '';\r\n vm.patient.photo = '';\r\n document.getElementById('photo').value = '';\r\n }\r\n\r\n function handleProviders() {\r\n\r\n //Add no provider group option\r\n vm.providergroups.unshift({\r\n Id: null,\r\n IsDefault: false,\r\n IsEnabled: true,\r\n Name: '',\r\n SortOrder: 0\r\n });\r\n if (vm.patient.ProviderGroupId === undefined) {\r\n vm.patient.ProviderGroupId = null;\r\n }\r\n\r\n var primaryProvider = lodash.find(vm.patientProviders, { IsPrimary: true });\r\n if (primaryProvider !== undefined) {\r\n vm.selectProvider = primaryProvider;\r\n vm.updatePersonalCaregiverFields();\r\n }\r\n\r\n }\r\n\r\n vm.updatePersonalCaregiverFields = function (ignore) {\r\n\r\n var selectedProvider = vm.selectedProvider;\r\n\r\n if (selectedProvider && selectedProvider.ProviderId && selectedProvider.ProviderId == -1) {\r\n vm.patient.PersonalCaregiverContactNumber = ' ';\r\n vm.patient.PersonalCaregiverSpecialtyId = null;\r\n vm.patient.PersonalCaregiverNameField = '';\r\n vm.patient.PersonalCaregiverProviderId = null;\r\n } else if (selectedProvider) {\r\n if (selectedProvider.PhoneNumber1 === '') selectedProvider.PhoneNumber1 = ' ';\r\n\r\n var name = selectedProvider.LastName + ', ' + selectedProvider.FirstName;\r\n if (selectedProvider.CaregiverTitle !== undefined && selectedProvider.CaregiverTitle !== null) {\r\n name += ' ' + selectedProvider.CaregiverTitle.Name;\r\n }\r\n\r\n vm.patient.PersonalCaregiverContactNumber = selectedProvider.PhoneNumber1;\r\n vm.patient.PersonalCaregiverSpecialtyId = selectedProvider.CaregiverSpecialtyId;\r\n vm.patient.PersonalCaregiverNameField = name;\r\n vm.patient.PersonalCaregiverProviderId = selectedProvider.ProviderId;\r\n vm.patient.PersonalCaregiverFax = selectedProvider.FaxNumber;\r\n vm.patient.PersonalCaregiverHl7Ident = selectedProvider.Hl7Ident;\r\n vm.patient.PersonalCaregiverTitleId = selectedProvider.CaregiverTitleId;\r\n\r\n } else {\r\n if (vm.patient !== undefined) {\r\n if (vm.patient.PersonalCaregiverNameField) {\r\n vm.patient.PersonalCaregiverName = vm.patient.PersonalCaregiverNameField;\r\n } else {\r\n vm.patient.PersonalCaregiverName = '';\r\n }\r\n }\r\n }\r\n\r\n vm.patient.Provider = selectedProvider;\r\n if (!ignore) {\r\n if (selectedProvider !== undefined && selectedProvider.ProviderGroupId !== undefined && selectedProvider.ProviderGroupId !== null) {\r\n vm.patient.ProviderGroupId = selectedProvider.ProviderGroupId;\r\n }\r\n }\r\n }\r\n\r\n vm.setPersonalCaregiverFields = function (patientProvider) {\r\n vm.patient.Provider = patientProvider.Provider;\r\n vm.patient.PersonalCaregiverId = patientProvider.PatientProviderId;\r\n if (patientProvider.Provider) {\r\n vm.patient.ProviderId = patientProvider.Provider.ProviderId;\r\n vm.patient.PrimaryProviderMasterId = patientProvider.Provider.ProviderMasterId;\r\n }\r\n }\r\n\r\n vm.typeaheadTitle = function () {\r\n return !vm.isOther ? 'Typeahead is enabled' : 'Typeahead is disabled';\r\n }\r\n\r\n vm.clearPersonalCaregiver = function () {\r\n vm.isOther = !vm.isOther;\r\n vm.patient.PersonalCaregiverProviderId = -1;\r\n vm.updatePersonalCaregiverFields();\r\n }\r\n\r\n vm.editDemographicsClick = function () {\r\n vm.editMode = !vm.editMode;\r\n }\r\n\r\n vm.cancelEdit = function () {\r\n if (vm.patient.Id > 0) {\r\n vm.patient = vm.originalPatient;\r\n vm.editMode = false;\r\n } else {\r\n $state.go('patients.list');\r\n }\r\n }\r\n\r\n function scrollToAnchor(anchor) {\r\n if (anchor !== null) {\r\n SmoothScroll.scroll(anchor);\r\n }\r\n }\r\n\r\n function isTestValue(input) {\r\n return input.toUpperCase().indexOf('TEST') >= 0 || input.toUpperCase().indexOf('VIVIFY') >= 0;\r\n }\r\n\r\n vm.createPatient = function () {\r\n var savePromise;\r\n $scope.patientDemographics.$setSubmitted();\r\n\r\n if ($scope.patientDemographics.$invalid) {\r\n var errorType = Object.keys($scope.patientDemographics.$error)[0];\r\n if (errorType) {\r\n scrollToAnchor($scope.patientDemographics.$error[errorType][0].$name);\r\n }\r\n return false;\r\n }\r\n\r\n // add the patient identifier fields \r\n vm.patient.PatientIdentifiers = vm.patientIdentifierFields;\r\n\r\n if (isTestValue(vm.patient.LastName) || (vm.patient.FirstName.length > 0 && isTestValue(vm.patient.FirstName))) {\r\n vhSweetAlert.verify('Is this a test patient?', 'Do you want to add this patient as a test patient?', 'Yes', 'No').then(function (confirmed) {\r\n if (confirmed) {\r\n vm.patient.FirstName = 'TEST_PATIENT';\r\n vm.patient.IsTestPatient = true;\r\n savePromise = vm.savePatient();\r\n } else {\r\n savePromise = vm.savePatient();\r\n }\r\n });\r\n } else {\r\n savePromise = vm.savePatient();\r\n }\r\n\r\n return savePromise;\r\n }\r\n\r\n function catchSavePatient(err) {\r\n if (err.status === 400) {\r\n err.preventDefault();\r\n if (err.data.ModelState && vm.webformfields[Object.keys(err.data.ModelState)[0]] !== undefined) {\r\n vm.errorMessages = 'Could not update ' + vm.webformfields[Object.keys(err.data.ModelState)[0]].FieldLabel;\r\n } else if (vm.patient.TimeZoneId == null) {\r\n vm.errorMessages = 'Please enter a time zone for the patient'\r\n }\r\n else {\r\n vm.errorMessages = err.data.ErrorMessage || 'Invalid data was submitted';\r\n }\r\n\r\n vhSweetAlert.error('Update Patient Error', vm.errorMessages).then(function () {\r\n if (vm.patient !== undefined && vm.patient.Id > 0) {\r\n $state.go('patients.patient.demographics', { 'patientId': vm.patient.Id }, { reload: true });\r\n }\r\n });\r\n }\r\n }\r\n\r\n vm.saveDemographics = function () {\r\n if (vm.err.length === 0) {\r\n var savePromise;\r\n if (vm.patient.PersonalCaregiverNameField && vm.patient.PersonalCaregiverNameField.length > 0) {\r\n vm.patient.PersonalCaregiverName = vm.patient.PersonalCaregiverNameField;\r\n }\r\n vm.originalPatient = angular.copy(vm.patient);\r\n\r\n if (vm.patient.DOB) {\r\n vm.patient.DOB = moment(vm.patient.DOB).format('YYYY-MM-DD');\r\n }\r\n\r\n savePromise = DemographicsService.savePatientDemographics(vm.patient.Id, vm.patient).then(function (data) {\r\n bindPatient(data);\r\n DemographicsService.refreshPatientHeader(vm.patient.Id);\r\n }).catch(catchSavePatient);\r\n }\r\n }\r\n\r\n vm.saveProgram = function () {\r\n if (vm.err.length === 0) {\r\n var savePromise;\r\n if (vm.patient.PersonalCaregiverNameField && vm.patient.PersonalCaregiverNameField.length > 0) {\r\n vm.patient.PersonalCaregiverName = vm.patient.PersonalCaregiverNameField;\r\n }\r\n\r\n vm.originalPatient = angular.copy(vm.patient);\r\n savePromise = DemographicsService.savePatientProgram(vm.patient.Id, vm.patient).then(function (data) {\r\n bindPatient(data);\r\n DemographicsService.refreshPatientHeader(vm.patient.Id);\r\n }).catch(catchSavePatient);\r\n }\r\n }\r\n\r\n vm.saveHospital = function () {\r\n if (vm.err.length === 0) {\r\n var savePromise;\r\n if (vm.patient.PersonalCaregiverNameField && vm.patient.PersonalCaregiverNameField.length > 0) {\r\n vm.patient.PersonalCaregiverName = vm.patient.PersonalCaregiverNameField;\r\n }\r\n\r\n vm.originalPatient = angular.copy(vm.patient);\r\n savePromise = DemographicsService.savePatientHospital(vm.patient.Id, vm.patient).then(function (data) {\r\n bindPatient(data);\r\n DemographicsService.refreshPatientHeader(vm.patient.Id);\r\n }).catch(catchSavePatient);\r\n }\r\n }\r\n\r\n vm.savePatient = function () {\r\n\r\n if (vm.err.length === 0) {\r\n var savePromise;\r\n\r\n if (!vm.patient.Id || vm.patient.Id == 0) {\r\n if ($scope.dob) {\r\n vm.patient.DOB = $scope.dob;\r\n vm.patient.DOB = moment(vm.patient.DOB).format('YYYY-MM-DD');\r\n }\r\n\r\n saving = true;\r\n\r\n if (!vm.patient.Provider) {\r\n if (vm.patient.PersonalCaregiverNameField && vm.patient.PersonalCaregiverNameField.length > 0) {\r\n var nameParts = vm.patient.PersonalCaregiverNameField.split(' ');\r\n var provider = {\r\n FreeText: true,\r\n FirstName: nameParts[0],\r\n LastName: nameParts.length > 1 ? nameParts[1] : null,\r\n ProviderGroupId: vm.patient.ProviderGroupId\r\n };\r\n\r\n vm.patient.Provider = provider;\r\n }\r\n }\r\n\r\n savePromise = DemographicsService.saveNewPatient(vm.patient).then(function (response) {\r\n return $state.go('patients.patient.demographics', { 'patientId': response.Id });\r\n }).catch(catchSavePatient);\r\n\r\n } else {\r\n vm.originalPatient = angular.copy(vm.patient);\r\n savePromise = DemographicsService.savePatient(vm.patient.Id, vm.patient).then(function (data) {\r\n bindPatient(data);\r\n DemographicsService.refreshPatientHeader(vm.patient.Id);\r\n }).catch(catchSavePatient);\r\n }\r\n\r\n return savePromise;\r\n }\r\n\r\n }\r\n\r\n function file_changed() {\r\n var header = vm.photo.substring(0, vm.photo.indexOf(',') + 1);\r\n\r\n if (header.indexOf('image') != -1) {\r\n var sourceImage = new Image();\r\n sourceImage.src = vm.photo;\r\n sourceImage.onload = function () {\r\n if (Math.max(sourceImage.width, sourceImage.height) > vm.maxImageDim) {\r\n //width=Math.min(sourceImage.width*vm.maxImageDim/sourceImage.height,sourceImage.width);\r\n if (sourceImage.height > sourceImage.width) {\r\n width = Math.round(sourceImage.width * vm.maxImageDim / sourceImage.height);\r\n height = vm.maxImageDim;\r\n }\r\n else {\r\n width = vm.maxImageDim;\r\n height = Math.round(sourceImage.height * vm.maxImageDim / sourceImage.width);\r\n }\r\n\r\n resizeImage(vm.photo, width, height, function (dataURL) {\r\n var data = dataURL.substring(dataURL.indexOf(',') + 1, dataURL.length);\r\n vm.patient.photo = data;\r\n });\r\n }\r\n else {\r\n var data = vm.photo.substring(vm.photo.indexOf(',') + 1, vm.photo.length);\r\n vm.patient.photo = data;\r\n }\r\n };\r\n\r\n }\r\n else {\r\n vm.photo = '';\r\n }\r\n }\r\n\r\n function resizeImage(url, width, height, callback) {//resize data url\r\n var sourceImage = new Image();\r\n\r\n sourceImage.onload = function () {\r\n var canvas = document.createElement('canvas');\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n canvas.getContext('2d').drawImage(sourceImage, 0, 0, width, height);\r\n\r\n callback(canvas.toDataURL());\r\n };\r\n\r\n sourceImage.src = url;\r\n }\r\n\r\n vm.editServiceLevel = function () {\r\n if (!vm.patientServiceLevel) return;\r\n\r\n //If open kit ship order status is In Progress\r\n if (vm.patientServiceLevel.kitShippingStatusId == 9) {\r\n vhSweetAlert.error('Unable to edit service level', 'Order is being processed. Please try back later.');\r\n return;\r\n }\r\n\r\n $state.go('.servicelevelWizard');\r\n }\r\n\r\n vm.editCareTeam = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/demographics/careteam.modal.html',\r\n controller: 'CareteamModalController',\r\n backdrop: 'static',\r\n resolve: {\r\n monitoringCaregivers: function () {\r\n return vm.monitoringCaregivers;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function () {\r\n // refresh monitoring caregivers\r\n PatientDemographicsCaregiversService.getPatientCaregivers(vm.patientId).then(function (data) {\r\n vm.monitoringCaregivers = data;\r\n });\r\n },\r\n function () {\r\n // Cancelled\r\n });\r\n }\r\n\r\n vm.editSpecialHandling = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/demographics/specialhandling.modal.html',\r\n controller: 'SpecialHandlingModalController',\r\n backdrop: 'static',\r\n resolve: {\r\n patientSpecialHandling: function () {\r\n return vm.specialHandling;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function () {\r\n // refresh special handling\r\n PatientDemographicSpecialHandlingService.getPatientSpecialHandling(vm.patientId).then(function (data) {\r\n vm.specialHandling = data;\r\n });\r\n\r\n DemographicsService.refreshPatientHeader(vm.patientId);\r\n },\r\n function () {\r\n // Cancelled\r\n });\r\n }\r\n\r\n vm.editDemographics = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/demographics/editdemographics.modal.html',\r\n controller: 'EditDemographicsModalController',\r\n backdrop: 'static',\r\n windowClass: 'tempClass',\r\n size: 'lg',\r\n resolve: {\r\n patient: function () {\r\n return vm.patient;\r\n },\r\n webformfields: function () {\r\n return vm.webformfields;\r\n },\r\n genders: function () {\r\n return vm.genders;\r\n },\r\n races: function () {\r\n return vm.races;\r\n },\r\n religions: function () {\r\n return vm.religions;\r\n },\r\n languages: function () {\r\n return vm.languages;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (response) {\r\n vm.saveDemographics();\r\n },\r\n function () {\r\n vm.patient = angular.copy(vm.originalPatient);\r\n });\r\n }\r\n\r\n vm.editProgram = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/demographics/program.modal.html',\r\n controller: 'ProgramModalController',\r\n backdrop: 'static',\r\n resolve: {\r\n patient: function () {\r\n return vm.patient;\r\n },\r\n pmilestone: function () {\r\n return vm.patientMilestoneState;\r\n },\r\n webformfields: function () {\r\n return vm.webformfields;\r\n },\r\n populationgroups: function () {\r\n return vm.populationgroups;\r\n },\r\n\r\n populations: function () {\r\n return vm.populations;\r\n },\r\n programdurations: function () {\r\n return vm.programdurations;\r\n },\r\n hasProgramStartDateWritePermission: function () {\r\n return vm.hasProgramStartDateWritePermission;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (response) {\r\n vm.saveProgram();\r\n PatientMilestoneService.saveMileStoneList(vm.patientMilestoneState.getPstonesToSave()).then(function (res) {\r\n if (res.data !== null && res.data !== undefined) {\r\n vm.patientMilestoneState.setPatientMilestones(res.data, vm.patient);\r\n }\r\n }).catch(function (err) {\r\n console.log(err);\r\n return [];\r\n });\r\n },\r\n function () {\r\n vm.patient = angular.copy(vm.originalPatient);\r\n vm.patientMilestoneState.restoreMilestones(vm.patient);\r\n });\r\n }\r\n\r\n vm.editHospitalInfo = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/demographics/patienthospital.modal.html',\r\n controller: 'PatientHospitalModalController',\r\n backdrop: 'static',\r\n resolve: {\r\n patient: function () {\r\n return vm.patient;\r\n },\r\n hasMaskedIdentifiersWritePermission: function () {\r\n return vm.hasMaskedIdentifiersWritePermission;\r\n },\r\n hasPatientHospitalUpdatePermission: function () {\r\n return vm.hasPatientHospitalUpdatePermission;\r\n },\r\n RequireAdditionalIdentifier: function () {\r\n return vm.RequireAdditionalIdentifier;\r\n },\r\n ShowPatientIdentifier: function () {\r\n return vm.ShowPatientIdentifier;\r\n },\r\n webformfields: function () {\r\n return vm.webformfields;\r\n },\r\n hospitals: function () {\r\n return vm.hospitals.filter(function (hospital) { return hospital.IsEnabled });\r\n },\r\n timezones: function () {\r\n return vm.timezones;\r\n },\r\n payers: function () {\r\n return vm.payers;\r\n },\r\n referrals: function () {\r\n return vm.referrals;\r\n },\r\n enableAllThirdPartyMonitoring: function () {\r\n return vm.EnableAllThirdPartyMonitoring;\r\n },\r\n IsMrnDisabled: function () {\r\n return vm.HL7UseVivifyID;\r\n },\r\n patientIdentifierFields: function () {\r\n return vm.patientIdentifierFields;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function () {\r\n vm.saveHospital();\r\n },\r\n function () {\r\n vm.patient = angular.copy(vm.originalPatient);\r\n });\r\n }\r\n\r\n vm.editProviders = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/demographics/providers.tpl.html',\r\n controller: 'PatientProvidersController',\r\n backdrop: 'static',\r\n windowClass: 'tempClass',\r\n size: 'lg',\r\n resolve: {\r\n patient: function () {\r\n return vm.patient;\r\n },\r\n webformfields: function () {\r\n return vm.webformfields;\r\n },\r\n patientProviders: function () {\r\n return angular.copy(\r\n vm.patientProviders.filter(function (p) {\r\n return !p.IsPrimary;\r\n }).map(function (provider, idx) {\r\n provider.idx = idx;\r\n provider.isValid = false;\r\n provider.isDirty = false;\r\n provider.original = provider;\r\n provider.editing = false;\r\n\r\n return provider;\r\n\r\n })\r\n );\r\n },\r\n personalCaregiverRoles: function () {\r\n var personalCaregiverRoleRepo = repository.new('PersonalCaregiverRole');\r\n return personalCaregiverRoleRepo.getList().then(function (response) {\r\n return response.data.filter(function (role) {\r\n return role.Enabled;\r\n });\r\n });\r\n },\r\n specialties: function () {\r\n return PatientDemographicsProvidersService.getCaregiverSpecialties();\r\n },\r\n ProviderGroups: function () {\r\n return vm.providergroups;\r\n },\r\n CaregiverTitles: function () {\r\n return EditConfigurationsService.getCaregiverTitles();\r\n },\r\n AddSecondaryProviderToProviderList: function () {\r\n return vm.AddSecondaryProviderToProviderList;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (res) {\r\n var promises = [];\r\n\r\n if (res.isPrimaryCaregiverEdited) {\r\n if (res.selectedProvider && !res.isFreetext) {\r\n res.selectedProvider.IsPrimary = true;\r\n promises.push(PatientDemographicsProvidersService.addProvider(vm.patient.Id, res.selectedProvider).then(function (patientProvider) {\r\n vm.setPersonalCaregiverFields(patientProvider);\r\n }));\r\n } else if (res.selectedProvider && res.isFreetext) {\r\n if (vm.patient.PersonalCaregiverId && vm.patient.PersonalCaregiverId > 0) {\r\n //update\r\n promises.push(PatientDemographicsProvidersService.updateFreetextProvider(vm.patient.Id, vm.patient.PersonalCaregiverId, res.selectedProvider).then(function (patientProvider) {\r\n vm.setPersonalCaregiverFields(patientProvider);\r\n }));\r\n } else {\r\n //create\r\n promises.push(PatientDemographicsProvidersService.addFreetextProvider(vm.patient.Id, res.selectedProvider).then(function (patientProvider) {\r\n vm.setPersonalCaregiverFields(patientProvider);\r\n }));\r\n }\r\n } else {\r\n if (vm.originalPatient.Provider && vm.originalPatient.Provider.ProviderId) {\r\n promises.push(PatientDemographicsProvidersService.removeProvider(vm.patient.Id, vm.originalPatient.PersonalCaregiverId).then(function () {\r\n vm.patient.Provider = null;\r\n }));\r\n }\r\n }\r\n }\r\n\r\n if (res.patientProviders) {\r\n vm.patientProviders = lodash.remove(res.patientProviders, function (patientProvider) {\r\n return patientProvider === undefined || patientProvider.PatientProviderId !== undefined;\r\n });\r\n }\r\n\r\n if (vm.patient.ProviderGroupId !== vm.originalPatient.ProviderGroupId) {\r\n promises.push(PatientDemographicsProvidersService.updateProviderGroup(vm.patient.Id, vm.patient.ProviderGroupId));\r\n }\r\n\r\n $q.all(promises).then(function () {\r\n vm.originalPatient = angular.copy(vm.patient);\r\n });\r\n\r\n },\r\n function () {\r\n vm.patient = angular.copy(vm.originalPatient);\r\n });\r\n\r\n }\r\n\r\n vm.editEmergencyContacts = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/demographics/emergencycontacts.tpl.html',\r\n controller: 'EmergencyContactsController as ecvm',\r\n backdrop: 'static',\r\n resolve: {\r\n emergencyContacts: function () {\r\n return vm.contacts;\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (contacts) {\r\n contacts.created.forEach(function (contact) {\r\n vm.contacts.push(contact);\r\n });\r\n\r\n contacts.updated.forEach(function (contact) {\r\n var index = lodash.indexOf(vm.contacts, lodash.find(vm.contacts, { Id: contact.Id }));\r\n vm.contacts.splice(index, 1, contact);\r\n });\r\n\r\n lodash.remove(vm.contacts, function (contact) {\r\n return lodash.some(contacts.removed, function (removedContact) {\r\n return removedContact.Id == contact.Id;\r\n });\r\n });\r\n });\r\n }\r\n\r\n vm.checkIdentifier = function (identifierType, identifier) {\r\n $scope.$root.$emit('disable-save', true);\r\n var ident = { IdentifierType: identifierType, Identifier: identifier, currentPatientId: 0 };\r\n if (identifier.length > 0) {\r\n DemographicsService.checkIdentifier(ident).then(function (exists) {\r\n var idx = vm.err.indexOf(identifierType);\r\n if (!exists) {\r\n if (idx === -1) {\r\n vm.err.push(identifierType);\r\n }\r\n if ($scope.patientDemographics && $scope.patientDemographics[identifierType] !== undefined) {\r\n $scope.patientDemographics[identifierType].$setValidity('taken', false);\r\n }\r\n } else {\r\n if (idx > -1) {\r\n vm.err.splice(idx, 1);\r\n }\r\n if ($scope.patientDemographics && $scope.patientDemographics[identifierType] !== undefined) {\r\n $scope.patientDemographics[identifierType].$setValidity('taken', true);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n vm.checkHasError = function (identifierType) {\r\n return vm.err.indexOf(identifierType) > -1;\r\n }\r\n\r\n vm.providerGroupList = function (providerName) {\r\n\r\n var providerGroupId = 0;\r\n if ($scope.patient !== undefined && $scope.patient !== null) {\r\n providerGroupId = $scope.patient.ProviderGroupId;\r\n }\r\n\r\n if ($scope.patientDemographics.ProviderGroupId !== undefined && $scope.patientDemographics.ProviderGroupId !== null) {\r\n providerGroupId = $scope.patientDemographics.ProviderGroupId.$modelValue;\r\n }\r\n\r\n if (vm.isOther) {\r\n return [];\r\n } else {\r\n return PatientDemographicsProvidersService.getProvidersAsync(providerName, providerGroupId).then(function (data) {\r\n if (vm.patient.ProviderGroupId > 0) {\r\n return data.filter(function (provider) {\r\n return provider.ProviderGroupId == vm.patient.ProviderGroupId || provider.ProviderId === '0';\r\n });\r\n } else {\r\n return data;\r\n }\r\n });\r\n }\r\n }\r\n\r\n vm.selectProviderGroup = function () {\r\n if (!vm.isOther) {\r\n if (vm.patient !== null && vm.patient !== undefined && vm.patient.Provider !== null && vm.patient.Provider !== undefined) {\r\n if (vm.patient.Provider.ProviderGroupId !== vm.patient.ProviderGroupId) {\r\n vm.patient.PersonalCaregiverNameField = '';\r\n vm.patient.PersonalCaregiverProviderId = -1;\r\n if (vm.patient.ProviderGroupId !== undefined && vm.patient.ProviderGroupId !== null) {\r\n vm.selectedProvider = undefined;\r\n vm.patient.PersonalCaregiverNameField = undefined;\r\n }\r\n\r\n vm.updatePersonalCaregiverFields(true);\r\n return;\r\n }\r\n }\r\n\r\n vm.updatePersonalCaregiverFields();\r\n }\r\n }\r\n\r\n vm.selectProvider = function (item) {\r\n vm.selectedProvider = item;\r\n\r\n var providerId = parseInt(item.ProviderId);\r\n vm.isOther = providerId === 0;\r\n if (vm.isOther) {\r\n vm.patient.PersonalCaregiverNameField = '';\r\n vm.patient.PersonalCaregiverProviderId = -1;\r\n vm.updatePersonalCaregiverFields();\r\n }\r\n if (!isNaN(providerId)) {\r\n vm.patient.PersonalCaregiverProviderId = providerId;\r\n vm.updatePersonalCaregiverFields();\r\n }\r\n\r\n }\r\n\r\n vm.formatCareManagementTypes = function () {\r\n return vm.patient.PatientCareManagementTypes.map(o => o.Acronym).join(',');\r\n }\r\n\r\n vm.payerChanged = function () {\r\n var payer = vm.payers.find(o => o.Id == vm.patient.PayerId);\r\n vm.careManagementTypes = payer ? payer.CareManagementTypes : [];\r\n switch (vm.careManagementTypes.length) {\r\n case 0:\r\n vm.patient.PatientCareManagementTypes = [];\r\n break;\r\n case 1: //default to only option\r\n vm.patient.PatientCareManagementTypes = [vm.careManagementTypes[0]];\r\n break;\r\n default:\r\n let types = vm.patient.PatientCareManagementTypes;\r\n vm.patient.PatientCareManagementTypes = vm.careManagementTypes.filter(t => types.some(cmt => cmt.Id === t.Id));\r\n break;\r\n }\r\n }\r\n}\r\n\r\nangular.module('patient.demographics').controller('DemographicsController', DemographicsController);\r\n","function DemographicsService($http, $rootScope, WebFormFieldRepository) {\r\n\r\n /** Returns the date portion of an ISO-8601 date as a Date object stripping off the time */\r\n function getUtcDate(serializedDate) {\r\n var d = new Date(Date.parse(serializedDate));\r\n var day = d.getUTCDate();\r\n var month = d.getUTCMonth();\r\n var year = d.getUTCFullYear();\r\n return new Date(year, month, day);\r\n }\r\n\r\n function checkIdentifier(ident) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/PatientIdentifier',\r\n data: ident\r\n }).then(function (res) {\r\n return res.data;\r\n });\r\n }\r\n\r\n function getPatient(patientId) {\r\n return $http({\r\n url: '/api/Patient/' + patientId,\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getNewPatient(searchField) {\r\n return {\r\n Id: undefined,\r\n LastName: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.LastName ? searchField.PatientFields.LastName : \"\",\r\n FirstName: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.FirstName ? searchField.PatientFields.FirstName : \"\",\r\n Gender: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.Gender ? searchField.PatientFields.Gender : undefined,\r\n DOB: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.DOB ? searchField.PatientFields.DOB : \"\",\r\n CustomField: \"\",\r\n Address1: \"\",\r\n Address2: \"\",\r\n State: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.State ? searchField.PatientFields.State : \"\",\r\n City: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.City ? searchField.PatientFields.City : \"\",\r\n ZipCode: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.Zipcode ? searchField.PatientFields.Zipcode : \"\",\r\n Email: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.Email ? searchField.PatientFields.Email : \"\",\r\n Phone1: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.Phone ? searchField.PatientFields.Phone : \"\",\r\n Phone2: \"\",\r\n TimeZoneId: undefined,\r\n RaceId: undefined,\r\n ReligionId: undefined,\r\n EmpiIdent: \"\",\r\n AccountIdent: \"\",\r\n VisitIdent: \"\",\r\n HL7DeptIdent: \"\",\r\n HL7Custom1: \"\",\r\n HL7Custom2: \"\",\r\n MRNIdent: searchField != undefined && searchField != null && searchField.PatientFields && searchField.PatientFields.MRNIdent ? searchField.PatientFields.MRNIdent : \"\",\r\n IsTestPatient: false,\r\n HospitalId: undefined,\r\n MonitoringStatusId: undefined,\r\n LanguageId: undefined,\r\n PopulationId: undefined,\r\n PayerId: undefined,\r\n RiskId: undefined,\r\n ReferralId: undefined,\r\n PopulationGroupId: undefined,\r\n ProviderGroupId: undefined,\r\n ProgramStartDate: \"\",\r\n ProgramDurationId: undefined,\r\n ServiceLevelTypeId: undefined,\r\n ServiceLevelPhoneNumber: \"\",\r\n ServiceLevelKitNum: \"\",\r\n IsThirdPartyMonitored: false,\r\n RequireShipping: false,\r\n PatientIdentifierFields: undefined\r\n };\r\n }\r\n\r\n function getLists(patientId) {\r\n return $http({\r\n url: '/api/cgp/Patient/' + patientId + '/demographics',\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function mapFormFieldsArray(formFields) {\r\n let result = {};\r\n for (let field of formFields) {\r\n result[field.FieldName] = field;\r\n }\r\n return result;\r\n }\r\n\r\n function getWebFormFields(formFields) {\r\n if (angular.isArray(formFields)) {\r\n return mapFormFieldsArray(formFields);\r\n }\r\n return WebFormFieldRepository.get().then(formFields => mapFormFieldsArray(formFields));\r\n }\r\n\r\n function savePatient(patientId, data) {\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/demographics',\r\n method: 'PUT',\r\n data: data\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveNewPatient(data) {\r\n return $http({\r\n url: '/api/Patient',\r\n method: 'POST',\r\n data: data\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n function savePatientDemographics(id, data) {\r\n return $http({\r\n url: '/api/cgp/patient/'+ id + '/demographics',\r\n method: 'PUT',\r\n data: data\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function savePatientProgram(id, data) {\r\n return $http({\r\n url: '/api/cgp/patient/'+ id + '/demographics/program',\r\n method: 'PUT',\r\n data: data\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function savePatientHospital(id, data) {\r\n return $http({\r\n url: '/api/cgp/patient/'+ id + '/demographics/hospital',\r\n method: 'PUT',\r\n data: data\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveKitShippingInfo(data) {\r\n return $http({\r\n url: '/api/kitshipping',\r\n method: 'POST',\r\n data: data\r\n });\r\n }\r\n\r\n function refreshPatientHeader(patientId) {\r\n $rootScope.$emit(\"vh:patientUpdated\", patientId);\r\n }\r\n\r\n function getPatientUserName(patientId) {\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/username',\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getInstallMethods() {\r\n return $http({\r\n url: '/api/InstallMethod',\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveCaregiver(patientId, caregiver) {\r\n return $http({\r\n url: '/api/cgp/patient/'+ patientId + '/demographics/caregiver',\r\n method: 'PUT',\r\n data: caregiver\r\n }).then(function(response){\r\n return response.data\r\n });\r\n }\r\n\r\n function cancelShipping(kitNo) {\r\n return $http({\r\n url: '/api/kitshipping/cancel?kitno=' + kitNo,\r\n method: 'POST'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function cancelShippingForRequestByKitType(patientId) {\r\n return $http({\r\n url: '/api/kitshipping/cancelRqeuestByKitType?patientId=' + patientId,\r\n method: 'POST'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function SearchPatientDuplicate(request) {\r\n return $http({\r\n url: '/api/cgp/patient/PatientSearch',\r\n method: 'POST',\r\n data:request\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function getPatientDevices(patientId){\r\n return $http({\r\n url: '/api/Patient/'+patientId+'/Device',\r\n method: 'GET'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientIdentifierFields(patientId) {\r\n return $http({\r\n url: '/api/PatientIdentifier/Patient/' + patientId,\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientKitShippingStatus(patientId) {\r\n return $http({\r\n url: '/api/kitshipping/patient/' + patientId + '/status',\r\n method: 'GET'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getUtcDate: getUtcDate,\r\n checkIdentifier: checkIdentifier,\r\n getPatient: getPatient,\r\n getNewPatient: getNewPatient,\r\n getLists: getLists,\r\n getWebFormFields: getWebFormFields,\r\n savePatient: savePatient,\r\n saveNewPatient: saveNewPatient,\r\n saveKitShippingInfo: saveKitShippingInfo,\r\n refreshPatientHeader: refreshPatientHeader,\r\n getPatientUserName: getPatientUserName,\r\n getInstallMethods: getInstallMethods,\r\n savePatientDemographics: savePatientDemographics,\r\n savePatientProgram: savePatientProgram,\r\n savePatientHospital: savePatientHospital,\r\n saveCaregiver: saveCaregiver,\r\n cancelShipping: cancelShipping,\r\n cancelShippingForRequestByKitType: cancelShippingForRequestByKitType,\r\n getPatientDevices: getPatientDevices,\r\n getPatientIdentifierFields: getPatientIdentifierFields,\r\n SearchPatientDuplicate: SearchPatientDuplicate,\r\n getPatientKitShippingStatus: getPatientKitShippingStatus\r\n };\r\n\r\n}\r\n\r\nangular.module('patient.demographics').service('DemographicsService', DemographicsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/demographics.tpl.html',\n '
          New Patient Profile
          Demographics
          0\">
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.LastName.$invalid && (patientDemographics.LastName.$dirty || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.LastName.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.FirstName.$invalid && (!patientDemographics.FirstName.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.FirstName.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Gender.$invalid && (!patientDemographics.Gender.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.Gender.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.DOB.$invalid && (!patientDemographics.DOB.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.DOB.FieldLabel}} is required
          {{vm.webformfields.DOB.FieldLabel}} must not be in the future
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.RaceId.$invalid && (!patientDemographics.RaceId.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.RaceId.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.ReligionId.$invalid && (!patientDemographics.ReligionId.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.ReligionId.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.LanguageId.$invalid && (!patientDemographics.LanguageId.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.LanguageId.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Address1.$invalid && (!patientDemographics.Address1.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.Address1.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Address2.$invalid && (!patientDemographics.Address2.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.Address2.FieldLabel}} is required
          *
          0\" class=\"col-lg-5 p-none\">
          *
          0\" id=\"State\" name=\"State\" ng-readonly=\"!vm.editMode\" class=\"form-control\" ng-model=\"vm.patient.State\" placeholder=\"{{vm.webformfields.State.FieldLabel}}\" type=\"text\" ng-required=\"{{vm.webformfields.State.IsRequired}}\" maxlength=\"2\">
          {{vm.webformfields.City.FieldLabel}} is required
          {{vm.webformfields.State.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.ZipCode.$invalid && (!patientDemographics.ZipCode.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.ZipCode.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Phone1.$invalid && (!patientDemographics.Phone1.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.Phone1.FieldLabel}} is required
          {{vm.webformfields.Phone1.FieldLabel}} is invalid
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Phone2.$invalid && (!patientDemographics.Phone2.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.Phone2.FieldLabel}} is required
          {{vm.webformfields.Phone2.FieldLabel}} is invalid
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Email.$invalid && (!patientDemographics.Email.$pristine || patientDemographics.$submitted), \\'readonly\\' : !vm.editMode }\">
          *
          {{vm.webformfields.Email.FieldLabel}} is required
          {{vm.webformfields.Email.FieldLabel}} is invalid
          *
          {{vm.webformfields.HospitalId.FieldLabel}} is required
          *
          {{vm.webformfields.PopulationGroupId.FieldLabel}} is required
          *
          *
          {{vm.webformfields.PopulationId.FieldLabel}} is required
          *
          {{vm.webformfields.MRNIdent.FieldLabel}} is required
          Already assigned to another patient.
          *
          {{vm.webformfields.HL7Custom1.FieldLabel}} is required
          Already assigned to another patient
          *
          {{vm.webformfields.PatientIdent.FieldLabel}} is required
          {{vm.webformfields.PatientIdent.FieldLabel}} is malformed
          Already assigned to another patient
          *
          {{vm.webformfields.ProgramDurationId.FieldLabel}} is required
          *
          {{vm.webformfields.EmpiIdent.FieldLabel}} is required
          *
          {{vm.webformfields.ProgramStartDate.FieldLabel}} is required
          {{vm.webformfields.ProgramStartDate.FieldLabel}} must not be before patient is created
          *
          {{vm.webformfields.CustomField.FieldLabel}} is required
          *
          {{vm.webformfields.ProviderGroupId.FieldLabel}} is required
          *
          *
          {{vm.webformfields.TimeZoneId.FieldLabel}} is required
          *
          {{webformfields.Provider.FieldLabel}} is required
          *
          0 && vm.editMode\" ng-click=\"vm.clearPhoto()\">
          *
          {{vm.webformfields.ReferralId.FieldLabel}} is required
          *
          0\">
          *
          {{vm.webformfields.PayerId.FieldLabel}} is required
          0\">
          *Denotes Required Field

          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/demographicsview.tpl.html',\n '
          Patient Profile
          0 && !vm.patient.IsFinalState\" class=\"pull-right\">

          No Service Level Assigned

          0\" uib-tooltip=\"PIN: {{vm.patient.ServiceLevelPIN}}\" tooltip-append-to-body=\"true\" tooltip-enable=\"!vm.showPin() && !vm.passwordSet() && vm.patient.ServiceLevelPIN.length > 0\" tooltip-placement=\"top-left\">{{vm.patient.ServiceLevel}} 0 && (vm.HybridAppEnabled || vm.UsePinValidation || vm.patient.ServiceLevelTypeId === 11)\">(PIN:{{vm.patient.ServiceLevelPIN}})(Password Set) 0\">({{vm.patientServiceLevel.kit.kitNo}}) 0\">| {{vm.patient.ServiceLevelPhoneNumber | tel}}

          {{vm.patientServiceLevel.configurationCategory }} {{vm.patientServiceLevel.configurationRanking.ConfigurationName }}
          {{vm.patientServiceLevel.kit.status}} {{vm.patientServiceLevel.kit.statusDate | datetime : \"datetime\"}}
          {{vm.patientServiceLevel.goDeviceOrderStatus.status}} {{vm.patientServiceLevel.goDeviceOrderStatus.statusDate | datetime : \"datetime\"}}
          Kit Type: {{vm.patientServiceLevel.kitType.Name}}
          Cuff Size: {{vm.patientServiceLevel.selectedBPCuffSizeName}}
          Scale Type: {{vm.patientServiceLevel.selectedScaleTypeName}}
          0\" devices=\"vm.patientDevices\"> 0\">Task Orders: {{vm.getTaskOrderDisplay()}}

          {{vm.patient.LastName}}, {{vm.patient.FirstName}} 0\">| {{vm.patient.DOB | datetime}} 0 || vm.webformfields.RaceId.FieldLabel.length > 0)\">| 0\">{{vm.patient.Race}} 0 && vm.webformfields.Gender.FieldLabel.length > 0\">, 0\">{{vm.patient.Gender}}

          0\">{{vm.patient.Language}} 0 && vm.webformfields.LanguageId.FieldLabel.length > 0\">| 0\">{{vm.patient.Religion}}
          0 || vm.webformfields.Address2.FieldLabel.length > 0)\">{{vm.patient.Address1}} 0\">, {{vm.patient.Address2}}
          0 || vm.webformfields.State.FieldLabel.length > 0 || vm.webformfields.ZipCode.FieldLabel.length > 0)\">{{vm.patient.City}} 0\">, {{vm.patient.State}} {{vm.patient.ZipCode}}
          0\">{{vm.patient.Phone1 | tel}} (Primary)
          0\">{{vm.patient.Phone2 | tel}} (Secondary)
          0\">{{vm.patient.Email}}
          0 && !vm.patient.IsFinalState\" class=\"pull-right\">

          No Emergency Contacts

          0\">Emergency Contacts

          {{c.Name}}, {{c.Relationship}} {{c.Phone_No | tel}}
          {{vm.patient.HospitalName}} | {{vm.patient.TimeZoneName}}
          {{vm.patient.Id}}
          0\"> {{vm.patient.MRNIdent}}
          0 && vm.RequireAdditionalIdentifier\"> {{vm.patient.ConsultNumber}}
          0 && vm.RequireAdditionalIdentifier\"> {{vm.patient.HL7Custom1}}
          0 && vm.ShowPatientIdentifier\"> {{vm.patient.NewPatientIdent | ssn}}
          0\"> {{vm.patient.EmpiIdent}}
          0\" style=\"overflow: hidden; text-overflow: ellipsis\"> {{vm.patient.CustomField}}
          0\"> {{vm.patient.Referral}}
          0\"> {{vm.patient.Payer}}
          0\"> {{vm.formatCareManagementTypes()}}
          0\"> {{identifierfield.Value}}
          0 && !vm.patient.IsFinalState\" class=\"pull-right\">

          0\">Special Handling

          {{handling.SpecialHandlingModel.Name}}

          No Special Handlings Assigned

          Program Information

          {{vm.patient.PopulationGroup}} | {{vm.patient.PopulationName}}
          {{vm.patient.ProgramDurationName}} | {{vm.patient.ProgramStartDate | datetime: \"date\": \"UTC\"}} | Program not started
          0\">
          {{s.Name}}|{{s.date | datetime : \"shortDate\" : \"UTC\"}}

          Care Team

          {{c.DisplayName}}
          Mobile Phone: {{c.Phone | tel}}
          Other Phone: {{c.Phone2 | tel}}
          {{vm.patient.ProviderGroup}}
          {{vm.patient.Provider.LastName}}, {{vm.patient.Provider.FirstName}} {{vm.patient.Provider.CaregiverTitle.Name}}
          {{vm.webformfields.Provider_Specialty.FieldLabel}}: {{vm.patient.Provider.CaregiverSpecialty.Name}}
          {{vm.webformfields.Provider_Hl7Ident.FieldLabel}}: {{vm.patient.Provider.Hl7Ident}}
          {{vm.webformfields.Provider_Phone1.FieldLabel}}: {{vm.patient.Provider.PhoneNumber1 | tel}}
          {{vm.webformfields.Provider_Fax.FieldLabel}}: {{ vm.patientProvider.FaxNumber | tel}}
          {{vm.webformfields.Provider_Fax.FieldLabel}}: {{ vm.patient.Provider.FaxNumber | tel}}
          {{vm.webformfields.Provider_Email.FieldLabel}}: {{vm.patient.Provider.EmailAddress}}
          {{vm.webformfields.Provider_PhoneMobile.FieldLabel}}: {{vm.patient.Provider.MobileNumber | tel}}
          {{vm.webformfields.Provider_Phone2.FieldLabel}}: {{vm.patient.Provider.PhoneNumber2 | tel}}
          {{vm.webformfields.Provider_AnsweringService.FieldLabel}}: {{vm.patient.Provider.AnsweringServiceNumber | tel}}
          0 && (vm.patient.Provider.ProviderGroup > 0 || vm.patient.Provider !== null)\">

          0\">Providers

          0\" ng-repeat=\"c in vm.patientProviders\">
          {{c.Provider.LastName}}, {{c.Provider.FirstName}} | {{c.Provider.CaregiverTitle.Name}} | {{c.Provider.CaregiverSpecialty.Name}} | {{c.Provider.PhoneNumber1 | tel}} | {{c.PersonalCaregiverRole.Text}} | {{c.Provider.Hl7Ident}}
          {{c.Provider.LastName}}, {{c.Provider.FirstName}} {{c.Provider.CaregiverTitle.Name}}
          {{c.PersonalCaregiverRole.Text}}
          {{vm.webformfields.Provider_Specialty.FieldLabel}}: {{c.Provider.CaregiverSpecialty.Name}}
          {{vm.webformfields.Provider_Hl7Ident.FieldLabel}}: {{c.Provider.Hl7Ident}}
          {{vm.webformfields.Provider_PhoneMobile.FieldLabel}}: {{c.Provider.MobileNumber | tel}}
          {{vm.webformfields.Provider_Phone1.FieldLabel}}: {{c.Provider.PhoneNumber1 | tel}}
          {{vm.webformfields.Provider_Fax.FieldLabel}}: {{c.Provider.FaxNumber | tel}}
          {{vm.webformfields.Provider_Email.FieldLabel}}: {{c.Provider.EmailAddress}}
          {{vm.webformfields.Provider_Phone2.FieldLabel}}: {{c.Provider.PhoneNumber2 | tel}}
          {{vm.webformfields.Provider_AnsweringService.FieldLabel}}: {{c.Provider.AnsweringServiceNumber | tel}}
          ');\n}]);\n}(window, document, window.angular));","function EditDemographicsModalController(patient, webformfields, genders, races, religions, languages, $scope, $uibModalInstance) {\r\n $scope.patient = patient;\r\n $scope.webformfields = webformfields;\r\n $scope.genders = genders;\r\n $scope.races = races;\r\n $scope.religions = religions;\r\n $scope.languages = languages;\r\n \r\n var vm = this;\r\n vm.disabled = false;\r\n\r\n var canDeleteEmail = true;\r\n\r\n if($scope.patient.ServiceLevel &&\r\n (!$scope.patient.ServiceLevelPhoneNumber || \r\n ($scope.patient.ServiceLevelPhoneNumber && $scope.patient.ServiceLevelPhoneNumber.length === 0)) &&\r\n ($scope.patient.ServiceLevelTypeId === 9 || $scope.patient.ServiceLevelTypeId === 11)) {\r\n canDeleteEmail = false;\r\n \r\n }\r\n if(webformfields.Email.IsRequired){\r\n canDeleteEmail = false;\r\n }\r\n $scope.canDeleteEmail = canDeleteEmail;\r\n\r\n $scope.validateBirthDay = function(){\r\n if($scope && $scope.patientDemographics && $scope.patientDemographics.DOB){ \r\n var today = new Date();\r\n if(patient.DOB && patient.DOB > today){\r\n $scope.patientDemographics.DOB.$setValidity(\"future\",false);\r\n }else{\r\n $scope.patientDemographics.DOB.$setValidity(\"future\",true);\r\n }\r\n }\r\n }\r\n \r\n var disabledDate = function(o){\r\n var day = new Date(o.date);\r\n var today = new Date();\r\n if(day < today){\r\n return false;\r\n \r\n }else{\r\n return true;\r\n }\r\n }\r\n\r\n $scope.datePickerOptionsDOB = {\r\n dateDisabled:disabledDate\r\n }\r\n\r\n $scope.photo = '';\r\n var maxImageDim = 100;\r\n\r\n\r\n $scope.photoChanged = function() {\r\n var header = $scope.photo.substring(0, $scope.photo.indexOf(',') + 1);\r\n if(header.indexOf('image') < 0) {\r\n $scope.photo = '';\r\n return;\r\n }\r\n\r\n var sourceImage = new Image();\r\n sourceImage.src = $scope.photo;\r\n sourceImage.onload = function () {\r\n if (Math.max(sourceImage.width, sourceImage.height) > maxImageDim) {\r\n var width, height;\r\n if (sourceImage.height > sourceImage.width) {\r\n width = Math.round(sourceImage.width * maxImageDim / sourceImage.height);\r\n height = maxImageDim;\r\n }\r\n else {\r\n width = maxImageDim;\r\n height = Math.round(sourceImage.height * maxImageDim / sourceImage.width);\r\n }\r\n\r\n resizeImage($scope.photo, width, height, function (dataURL) {\r\n var data = dataURL.substring(dataURL.indexOf(',') + 1, dataURL.length);\r\n $scope.patient.photo = data;\r\n });\r\n }\r\n else {\r\n var data = $scope.photo.substring($scope.photo.indexOf(',') + 1, $scope.photo.length);\r\n $scope.patient.photo = data;\r\n }\r\n };\r\n };\r\n\r\n function resizeImage(url, width, height, callback) {//resize data url\r\n var sourceImage = new Image();\r\n\r\n sourceImage.onload = function () {\r\n var canvas = document.createElement(\"canvas\");\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n canvas.getContext(\"2d\").drawImage(sourceImage, 0, 0, width, height);\r\n\r\n callback(canvas.toDataURL());\r\n };\r\n\r\n sourceImage.src = url;\r\n }\r\n\r\n $scope.clearPhoto = function() {\r\n $scope.photo = '';\r\n $scope.patient.photo = '';\r\n document.getElementById('photo').value = '';\r\n };\r\n\r\n $scope.ok = function() {\r\n $scope.patientDemographics.$setSubmitted();\r\n if($scope.patientDemographics.$valid) {\r\n vm.disabled = true;\r\n $uibModalInstance.close();\r\n }\r\n };\r\n\r\n $scope.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('patient.demographics').controller('EditDemographicsModalController',EditDemographicsModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/editdemographics.modal.html',\n '

          Patient Demographics

          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.LastName.$invalid && (patientDemographics.LastName.$dirty || patientDemographics.$submitted) }\">
          {{webformfields.LastName.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.FirstName.$invalid && (!patientDemographics.FirstName.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.FirstName.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Gender.$invalid && (!patientDemographics.Gender.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.Gender.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.DOB.$invalid && (!patientDemographics.DOB.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.DOB.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.RaceId.$invalid && (!patientDemographics.RaceId.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.RaceId.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.ReligionId.$invalid && (!patientDemographics.ReligionId.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.ReligionId.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.LanguageId.$invalid && (!patientDemographics.LanguageId.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.LanguageId.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Address1.$invalid && (!patientDemographics.Address1.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.Address1.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Address2.$invalid && (!patientDemographics.Address2.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.Address2.FieldLabel}} is required
          0 || webformfields.State.FieldLabel.length > 0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.City.$invalid && (!patientDemographics.City.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.City.FieldLabel}} is required
          {{webformfields.State.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.ZipCode.$invalid && (!patientDemographics.ZipCode.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.ZipCode.FieldLabel}} is required
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Phone1.$invalid && (!patientDemographics.Phone1.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.Phone1.FieldLabel}} is required
          {{webformfields.Phone1.FieldLabel}} is invalid
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Phone2.$invalid && (!patientDemographics.Phone2.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.Phone2.FieldLabel}} is required
          {{webformfields.Phone2.FieldLabel}} is invalid
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Email.$invalid && (!patientDemographics.Email.$pristine || patientDemographics.$submitted) }\">
          {{webformfields.Email.FieldLabel}} is required
          {{webformfields.Email.FieldLabel}} is invalid
          0\" class=\"form-group col-lg-6\" ng-class=\"{ \\'has-error\\' : patientDemographics.Photo.$invalid && (!patientDemographics.Photo.$pristine || patientDemographics.$submitted) }\">
          0\" ng-click=\"clearPhoto()\">
          ');\n}]);\n}(window, document, window.angular));","function EmergencyContactsController($uibModalInstance, $scope, $stateParams, $q, emergencyContacts, lodash, PatientDemographicsContactsService, ConfigurationsService) {\r\n var ecvm = this;\r\n\r\n ecvm.contacts = [];\r\n ecvm.ok = ok;\r\n ecvm.cancel = cancel;\r\n ecvm.addNewRow = addNewRow;\r\n ecvm.removeContact = removeContact;\r\n ecvm.updateContact = updateContact;\r\n ecvm.focusNameElement = true;\r\n ecvm.defaultCountry = 'us';\r\n ecvm.supportedCountries = 'us';\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n ecvm.contacts = lodash.map(emergencyContacts, function (contact) {\r\n return {\r\n id: contact.Id,\r\n patientId: $stateParams.patientId,\r\n name: contact.Name,\r\n relationship: contact.Relationship,\r\n contactNumber: contact.Phone_No,\r\n isDirty: false,\r\n modified: false,\r\n deleted: false\r\n }\r\n });\r\n\r\n addNewRow();\r\n\r\n ConfigurationsService.getConfig().then(function (data) {\r\n ecvm.defaultCountry = data.DefaultCountry;\r\n ecvm.supportedCountries = data.SupportedCountries;\r\n });\r\n }\r\n\r\n function getNewContact() {\r\n return {\r\n id: 0,\r\n patientId: $stateParams.patientId,\r\n name: '',\r\n relationship: '',\r\n contactNumber: '',\r\n modified: false,\r\n deleted: false\r\n };\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function addNewRow() {\r\n var lastContact = ecvm.contacts[ecvm.contacts.length -1];\r\n\r\n if (ecvm.contacts.length == 0 || lastContact.name.length > 0 || lastContact.relationship.length > 0 || (lastContact.contactNumber != undefined && lastContact.contactNumber.length > 0)) {\r\n ecvm.contacts.push(getNewContact());\r\n }\r\n }\r\n\r\n function removeContact(contact) {\r\n contact.deleted = true;\r\n contact.modified = false;\r\n }\r\n\r\n function updateContact(contact) {\r\n if (contact.id > 0) {\r\n ecvm.focusNameElement = false;\r\n contact.modified = true;\r\n }\r\n }\r\n\r\n function ok() {\r\n $scope.addEmergencyContactForm.$setSubmitted(true);\r\n\r\n if (!$scope.addEmergencyContactForm.$valid) {\r\n return false;\r\n }\r\n\r\n //Remove the last empty element from array\r\n ecvm.contacts = ecvm.contacts.slice(0, -1);\r\n\r\n var promises = [];\r\n\r\n var createdContacts = [];\r\n var updatedContacts = [];\r\n var removedContacts = [];\r\n\r\n var created = lodash.filter(ecvm.contacts, function (contact) {\r\n return contact.id === 0 && !contact.deleted;\r\n });\r\n if (created.length > 0) {\r\n var createdPromise = PatientDemographicsContactsService.addContacts($stateParams.patientId, created).then(function(contacts){\r\n if(contacts){\r\n createdContacts = contacts;\r\n }\r\n });\r\n promises.push(createdPromise);\r\n }\r\n\r\n var updated = lodash.filter(ecvm.contacts, function (contact) {\r\n return !contact.deleted && contact.modified;\r\n });\r\n if (updated.length > 0) {\r\n var updatedPromise = PatientDemographicsContactsService.updateContacts($stateParams.patientId, updated).then(function(contacts){\r\n if(contacts){\r\n updatedContacts = contacts;\r\n }\r\n });\r\n promises.push(updatedPromise);\r\n }\r\n\r\n var removed = lodash.filter(ecvm.contacts, function (contact) {\r\n return contact.deleted && contact.id > 0;\r\n });\r\n if (removed.length > 0) {\r\n var ids = lodash.pluck(removed, 'id');\r\n var removedPromise = PatientDemographicsContactsService.removeContacts($stateParams.patientId, ids).then(function (contacts) {\r\n if(contacts) {\r\n removedContacts = contacts;\r\n }\r\n });\r\n promises.push(removedPromise);\r\n }\r\n\r\n $q.all(promises).then(function() {\r\n $uibModalInstance.close({\r\n created: createdContacts,\r\n updated: updatedContacts,\r\n removed: removedContacts\r\n });\r\n });\r\n }\r\n}\r\n\r\n\r\nangular.module(\"patient.demographics\").controller(\"EmergencyContactsController\", EmergencyContactsController);\r\n","function PatientDemographicsContactsService($http, lodash) {\r\n\r\n function getContacts(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/contacts').then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function addContacts(patientId, contacts) {\r\n var models = lodash.map(contacts, function(contact){\r\n return {\r\n PatientId: contact.patientId,\r\n Name: contact.name,\r\n Phone_No: contact.contactNumber,\r\n Relationship: contact.relationship,\r\n IsDeleted: false\r\n }\r\n });\r\n\r\n return $http.post('/api/Patient/' + patientId + '/contacts', models).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateContacts(patientId, contacts) {\r\n var models = lodash.map(contacts, function(contact){\r\n return {\r\n Id: contact.id,\r\n PatientId: contact.patientId,\r\n Name: contact.name,\r\n Phone_No: contact.contactNumber,\r\n Relationship: contact.relationship,\r\n IsDeleted: false\r\n }\r\n });\r\n\r\n return $http.put('/api/Patient/' + patientId + '/contacts', models).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function removeContacts(patientId, contactIds) {\r\n return $http({\r\n method: 'DELETE',\r\n url: '/api/Patient/' + patientId + '/contacts',\r\n params: {\r\n contactIds: contactIds\r\n }\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getContacts: getContacts,\r\n addContacts: addContacts,\r\n updateContacts: updateContacts,\r\n removeContacts: removeContacts\r\n }\r\n}\r\n\r\nangular.module(\"patient.demographics\").service(\"PatientDemographicsContactsService\", PatientDemographicsContactsService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/emergencycontacts.tpl.html',\n '

          Emergency Contacts

          NameRelationshipContact Number
          Name is required
          Relationship is required
          Phone Number is invalid
          Phone Number is required
          ');\n}]);\n}(window, document, window.angular));","function GoDevicesDirective(){\r\n\r\n function controller($scope, GoDevicesService, lodash){\r\n $scope.typeIcons = {\r\n \"1\": \"vh-ui-glyph-item-weight\",\r\n \"2\": \"vh-ui-glyph-item-bp\",\r\n \"3\": \"vh-ui-glyph-item-o2\",\r\n \"8\": \"vh-ui-glyph-item-glucose\",\r\n \"13\": \"vh-ui-glyph-item-temp\",\r\n \"35\": \"vh-ui-glyph-item-ekg\",\r\n \"58\": \"vh-ui-glyph-item-spyro\",\r\n \"64\": \"vh-ui-glyph-item-pedo\",\r\n \"66\": \"vh-ui-glyph-item-inhaler\",\r\n \"67\": \"vh-ui-glyph-item-inhaler-rescue\",\r\n \"68\": \"vh-ui-glyph-item-sleep\"\r\n };\r\n $scope.typeAbb = {\r\n \"1\":\"Wt\",\r\n \"2\":\"BP\",\r\n \"3\":\"O2\",\r\n \"8\":\"BS\",\r\n \"13\":\"Temp\",\r\n \"35\":\"Ekg\",\r\n \"58\":\"Spyro\",\r\n \"64\":\"Pedo\",\r\n \"66\":\"Inhaler\",\r\n \"67\":\"Inhaler-Rescue\",\r\n \"68\":\"Sleep\"\r\n };\r\n $scope.getTypeAbb = function(typeId){\r\n return $scope.typeAbb[typeId];\r\n }\r\n $scope.getTypeIcon = function(id){\r\n return $scope.typeIcons[id];\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/godevices.tpl.html\",\r\n scope: {\r\n devices: '='\r\n }\r\n\r\n }\r\n}\r\nangular.module(\"patient.demographics\").directive(\"godevices\", GoDevicesDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/godevices.tpl.html',\n '
          0\">

          Included devices

          {{getTypeAbb(device.DeviceTypeId)}}
          ');\n}]);\n}(window, document, window.angular));","function KitDevicesDirective() {\r\n\r\n function controller($scope, ConfigurationsService) {\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n ConfigurationsService.getConfig().then(function(config){\r\n $scope.enableSpiro = config.EnableSpirometerBiometric;\r\n $scope.enablePedo = config.EnablePedometerBiometric;\r\n });\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/kitdevices.tpl.html\",\r\n scope: {\r\n kit: '='\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"kitdevices\", KitDevicesDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/kitdevices.tpl.html',\n '

          Included devices

          Wt ({{kit.kitScale}}) BP ({{kit.kitCuff}}) SpO2 BS Temp Spiro Steps Tablet only {{kit.details}}
          ');\n}]);\n}(window, document, window.angular));","function KitShippingDirective(DemographicsService, PatientServiceLevelService, lodash, ConfigurationsService, TemplatesService) {\r\n loadController();\r\n function loadController() {\r\n\r\n }\r\n\r\n var numberofDays;\r\n var welcomeCallDays;\r\n var kitPickUpdateFilter;\r\n\r\n ConfigurationsService.getConfig().then(function (data) {\r\n welcomeCallDays = data[\"WelcomeCallDays\"] - 1;\r\n kitPickUpdateFilter = data[\"KitPickUpdateFilter\"];\r\n numberofDays = kitPickUpdateFilter - 1;\r\n }\r\n );\r\n\r\n var today = new Date();\r\n function controller($scope) {\r\n $scope.availableLanguages = [];\r\n\r\n $scope.availableEducationMaterials = [];\r\n function loadLanguages() {\r\n TemplatesService.getAvailableLanguages().then(\r\n function (result) {\r\n var orderedLang = lodash.sortBy(result, [function (o) { return o.SortOrder; }]);\r\n $scope.availableLanguages = orderedLang;\r\n\r\n var defualtLanguage = lodash.filter($scope.availableLanguages, { LanguageId: $scope.patientLanguage })[0];\r\n $scope.logisticsInfo.selectedLanguage = defualtLanguage;\r\n });\r\n }\r\n\r\n function loadEducationMaterials() {\r\n if ($scope.logisticsInfo.IsPickup !== undefined && $scope.logisticsInfo.IsPickup === false) {\r\n PatientServiceLevelService.getEducationMaterials().then(\r\n function (result) {\r\n $scope.availableEducationMaterials = lodash.sortBy(lodash.filter(result.data, { 'Disabled': false }), \"SortOrder\");\r\n }\r\n )\r\n }\r\n }\r\n loadLanguages();\r\n loadEducationMaterials();\r\n\r\n $scope.setFocus = function (event) {\r\n event.preventDefault();\r\n $scope.$broadcast('educationMaterials.focus');\r\n };\r\n\r\n $scope.logisticsInfo.PickupDate = getNextBusinessDay(kitPickUpdateFilter);\r\n $scope.logisticsInfo.WelcomeCallDate = null;\r\n\r\n $scope.validateDate = function () {\r\n var dateField = getNextBusinessDay(kitPickUpdateFilter);\r\n if ($scope.logisticsInfo.PickupDate && $scope.logisticsInfo.PickupDate < dateField) {\r\n $scope.form.PickupDate.$setValidity(\"businessDays\", false);\r\n }\r\n if (!$scope.logisticsInfo.PickupDate || $scope.logisticsInfo.PickupDate === \"\") {\r\n if ($scope.form.PickupDate) {\r\n $scope.form.PickupDate.$setValidity(\"businessDays\", false);\r\n }\r\n }\r\n };\r\n\r\n $scope.validateWelcomeCallDate = function () {\r\n var dateField = getNextBusinessDay(ConfigurationsService.configParams.WelcomeCallDays);\r\n\r\n if ($scope.logisticsInfo.WelcomeCallDate && $scope.logisticsInfo.WelcomeCallDate < dateField) {\r\n $scope.form.WelcomeCallDate.$setValidity(\"businessDays\", false);\r\n }\r\n if (!$scope.logisticsInfo.WelcomeCallDate || $scope.logisticsInfo.WelcomeCallDate === \"\") {\r\n if ($scope.form.WelcomeCallDate) {\r\n $scope.form.WelcomeCallDate.$setValidity(\"businessDays\", true);\r\n }\r\n }\r\n };\r\n\r\n function getNextBusinessDay(OffSet) {\r\n\r\n //Date isn't today\r\n\r\n /* Here add a function that calculates the next buisness day bassed off\r\n of the global config ***************************************************/\r\n var date = new Date();\r\n\r\n date.setHours(0, 0, 0, 0);\r\n\r\n if (OffSet) {\r\n\r\n var numberofDays = OffSet;\r\n while (numberofDays > 0) {\r\n var day = date.getDay();\r\n if (day !== 0 && day !== 6) {\r\n --numberofDays;\r\n }\r\n date.setDate(date.getDate() + 1);\r\n }\r\n // If the date lands on a weekend go to monday\r\n if (date.getDay() === 0) {\r\n date.setDate(date.getDate() + 1);\r\n } else if (date.getDay() === 6) {\r\n date.setDate(date.getDate() + 2);\r\n }\r\n }\r\n return date;\r\n\r\n }\r\n var disabledDate = function (o) {\r\n var day = o.date.getDay();\r\n var tempDate = new Date(o.date);\r\n var odate = o.date;\r\n odate.setHours(0, 0, 0, 0);\r\n\r\n if (odate < today) {\r\n return false;\r\n }\r\n if (day === 0 || day === 6) {\r\n return true;\r\n } else { return false; }\r\n }\r\n\r\n $scope.datepickerOptionsPickup = {\r\n dateDisabled: disabledDate,\r\n minDate: getNextBusinessDay(ConfigurationsService.configParams.KitPickUpdateFilter)\r\n };\r\n\r\n $scope.datepickerOptionsWelcomeCall = {\r\n dateDisabled: disabledDate,\r\n minDate: getNextBusinessDay(ConfigurationsService.configParams.WelcomeCallDays)\r\n };\r\n }\r\n\r\n function link(scope, element, attrs, ctrl) {\r\n scope.logisticsInfo.EducationalMaterials = [];\r\n\r\n scope.logisticsInfo.selectedLanguage = 2;\r\n scope.form = ctrl;\r\n scope.logisticsInfo.Note = '';\r\n\r\n var enableWelcomeCall = ConfigurationsService.configParams.EnableWelcomeCall;\r\n scope.enableWelcomeCall = enableWelcomeCall;\r\n\r\n\r\n var installMethodOptions = DemographicsService.getInstallMethods().then(\r\n function (result) {\r\n scope.installMethods = lodash.filter(result, { IsEnabled: true });\r\n var firstItem = lodash.filter(scope.installMethods, { IsDefault: true });\r\n scope.logisticsInfo.InstallMethod = firstItem[0]\r\n }\r\n );\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n restrict: \"E\",\r\n replace: true,\r\n require: \"?^form\",\r\n templateUrl: \"modules/patient/demographics/kitshipping.tpl.html\",\r\n scope: { logisticsInfo: \"=\", logisticsOptions: \"=\", webFormFields: \"=\", patientLanguage: \"=\" }\r\n }\r\n\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"kitshipping\", KitShippingDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/kitshipping.tpl.html',\n '

          0\">{{logisticsOptions.logisticsTitle}}

           Require Kit {{logisticsOptions.logisticsType}}

          Kit {{logisticsOptions.logisticsType}} Information



          {{webFormFields.Address1.FieldLabel}} is required
          {{webFormFields.City.FieldLabel}} is required
          {{webFormFields.State.FieldLabel}} is required
          {{webFormFields.ZipCode.FieldLabel}} is required
          0 && availableEducationMaterials.length>0\">
          {{$item.Name}}{{multioption.Name}}
          {{webFormFields.Phone1.FieldLabel}} is required
          {{webFormFields.Phone1.FieldLabel}} is invalid
          {{webFormFields.Phone2.FieldLabel}} is required
          {{webFormFields.Phone2.FieldLabel}} is invalid
          0\" class=\"form-group p-b-xs m-b-xs\" ng-class=\"{ \\'has-error\\' : form.installMethod.$invalid && (form.installMethod.$dirty || form.$submitted) }\">
          Welcome Call Date must be a business day in the configured range
          Pickup Date is required
          Pickup Date must be a business day in the configured range
          ');\n}]);\n}(window, document, window.angular));","\r\nfunction PatientHospitalModalController(patient, hasMaskedIdentifiersWritePermission, hasPatientHospitalUpdatePermission, RequireAdditionalIdentifier, ShowPatientIdentifier, webformfields, \r\n hospitals, timezones, payers, referrals, enableAllThirdPartyMonitoring, lodash, $uibModalInstance, $scope, DemographicsService, IsMrnDisabled, patientIdentifierFields) {\r\n $scope.patient = patient;\r\n $scope.webformfields = webformfields;\r\n $scope.hospitals = hospitals;\r\n $scope.timezones = timezones;\r\n $scope.payers = payers;\r\n $scope.referrals = referrals;\r\n $scope.enableAllThirdPartyMonitoring = enableAllThirdPartyMonitoring;\r\n $scope.hasMaskedIdentifiersWritePermission = hasMaskedIdentifiersWritePermission;\r\n $scope.hasPatientHospitalUpdatePermission = hasPatientHospitalUpdatePermission;\r\n $scope.RequireAdditionalIdentifier = RequireAdditionalIdentifier;\r\n $scope.ShowPatientIdentifier = ShowPatientIdentifier;\r\n $scope.isMrnDisabled = IsMrnDisabled;\r\n $scope.getMrnTitle = getMrnTitle;\r\n $scope.patientIdentifierFields = patientIdentifierFields;\r\n $scope.currentPayer = lodash.find($scope.payers, function(i) { return i.Id == patient.PayerId; });\r\n\r\n updateCareManagementTypes();\r\n\r\n $scope.err = [];\r\n\r\n patient.PatientIdentifiers = patientIdentifierFields;\r\n\r\n $scope.updatePatientHospital = function() {\r\n var item = lodash.find($scope.hospitals, function(i) { return i.HospitalId == patient.HospitalId; })\r\n $scope.patient.HospitalName = item.Name;\r\n }\r\n\r\n $scope.updatePatientTimezone = function() {\r\n var item = lodash.find($scope.timezones, function(i) { return i.id == patient.TimeZoneId; })\r\n $scope.patient.TimeZoneName = item.DisplayValue;\r\n }\r\n\r\n $scope.updatePatientReferral = function() {\r\n var item = lodash.find($scope.referrals, function(i) { return i.Id == patient.ReferralId; })\r\n $scope.patient.Referral = item.Name;\r\n }\r\n\r\n $scope.updatePatientPayer = function() {\r\n var item = lodash.find($scope.payers, function(i) { return i.Id == patient.PayerId; })\r\n $scope.patient.Payer = item.Name;\r\n $scope.currentPayer = item;\r\n updateCareManagementTypes();\r\n }\r\n\r\n $scope.payerHasManagementTypes = function() {\r\n return $scope.currentPayer && $scope.currentPayer.CareManagementTypes && $scope.currentPayer.CareManagementTypes.length > 0;\r\n }\r\n\r\n $scope.checkIdentifier = function(identifierType, identifier) {\r\n var ident = { IdentifierType: identifierType, Identifier: identifier, currentPatientId: patient.Id };\r\n if(identifier != undefined && identifier.length > 0) {\r\n DemographicsService.checkIdentifier(ident).then(function(exists){\r\n var idx = $scope.err.indexOf(identifierType);\r\n if(!exists) {\r\n if(idx === -1) {\r\n $scope.err.push(identifierType);\r\n }\r\n } else {\r\n if(idx > -1) {\r\n $scope.err.splice(idx, 1);\r\n }\r\n }\r\n });\r\n }\r\n };\r\n\r\n $scope.checkHasError = function(identifierType) {\r\n return $scope.err.indexOf(identifierType) > -1;\r\n };\r\n\r\n $scope.ok = function() {\r\n if($scope.patientDemographics.$valid) {\r\n $uibModalInstance.close();\r\n }\r\n };\r\n\r\n $scope.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n function updateCareManagementTypes() {\r\n if ($scope.currentPayer) {\r\n switch ($scope.currentPayer.CareManagementTypes.length) {\r\n case 0:\r\n $scope.patient.PatientCareManagementTypes = [];\r\n break;\r\n case 1: //default to only option\r\n $scope.patient.PatientCareManagementTypes = [$scope.currentPayer.CareManagementTypes[0]];\r\n break;\r\n default:\r\n //filter CareManagementTypes to those assigned to currentPayer\r\n let types = $scope.patient.PatientCareManagementTypes;\r\n $scope.patient.PatientCareManagementTypes = $scope.currentPayer.CareManagementTypes.filter(t => types.some(cmt => cmt.Id === t.Id));\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function getMrnTitle() {\r\n if(IsMrnDisabled) {\r\n return $scope.webformfields.MRNIdent.FieldLabel + ' cannot be updated.';\r\n }\r\n return '';\r\n }\r\n\r\n\r\n}\r\n\r\nangular.module('patient.demographics').controller('PatientHospitalModalController',PatientHospitalModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/patienthospital.modal.html',\n '

          Patient Program

          {{webformfields.HospitalId.FieldLabel}} is required
          {{webformfields.MRNIdent.FieldLabel}} is required
          {{webformfields.MRNIdent.FieldLabel}} is already assigned to another patient.
          {{webformfields.ConsultNumber.FieldLabel}} is required
          {{webformfields.ConsultNumber.FieldLabel}} is already assigned to another patient.
          {{webformfields.HL7Custom1.FieldLabel}} is required
          {{webformfields.HL7Custom1.FieldLabel}} is already assigned to another patient
          {{webformfields.PatientIdent.FieldLabel}} is required
          {{webformfields.PatientIdent.FieldLabel}} malformed
          {{webformfields.PatientIdent.FieldLabel}} is already assinged to another patient
          {{webformfields.EmpiIdent.FieldLabel}} is required
          {{webformfields.CustomField.FieldLabel}} is required
          {{webformfields.TimeZoneId.FieldLabel}} is required
          {{webformfields.ReferralId.FieldLabel}} is required
          {{webformfields.PayerId.FieldLabel}} is required
          ');\n}]);\n}(window, document, window.angular));","// Service of patient Milestone\r\nfunction PatientMilestoneService($http, lodash) {\r\n function getMileStoneList() {\r\n return $http({\r\n url: '/api/PatientMilestone',\r\n metod: 'GET'\r\n });\r\n }\r\n function getPatientMilestoneList(patientId) {\r\n return $http({\r\n url: '/api/PatientMilestone?patientId='+patientId,\r\n metod: 'GET'\r\n });\r\n }\r\n \r\n function saveMileStoneList(list) {\r\n return $http.post('/api/PatientMilestone', JSON.stringify(list)); \r\n }\r\n\r\n return {\r\n getMileStoneList:getMileStoneList,\r\n getPatientMilestoneList:getPatientMilestoneList,\r\n saveMileStoneList:saveMileStoneList\r\n\r\n }\r\n\r\n}\r\nangular.module(\"patient.demographics\").service(\"PatientMilestoneService\", PatientMilestoneService);","angular.module(\"patient.demographics\").factory('PatientMilestoneState',function(lodash,PermissionService,DateUtilities, CaregiverToPatientTimeService) {\r\n\r\n var _patient = {};\r\n\r\n function PatientMilestoneState(PatientId) {\r\n this.Milestones = [];\r\n this.OriginalBag = {};\r\n this.PatientId = PatientId;\r\n this.patientMilestones = [];\r\n this.patientMilestonesHeader = [];\r\n this.MilestoneList = [];// List of saved milestones\r\n // PermissionService.userHasPermission([\"ConfigurationsWrite\"]);\r\n this.hasReadPermission = PermissionService.userHasPermission([\"PatientMilestoneRead\"]);\r\n this.hasWritePermission = PermissionService.userHasPermission([\"PatientMilestoneWrite\"]);\r\n }\r\n\r\n PatientMilestoneState.prototype.restoreMilestones = function(patient) {\r\n this.Milestones = lodash.cloneDeep(this.OriginalBag.Milestones);\r\n this.patientMilestones = lodash.cloneDeep(this.OriginalBag.PatientMilestones);\r\n this.setStonesFromBag(this.OriginalBag, patient);\r\n }\r\n\r\n PatientMilestoneState.prototype.getPatientId = function() {\r\n return this.PatientId;\r\n }\r\n\r\n PatientMilestoneState.prototype.getPstonesToSave = function() {\r\n var retval = this.Milestones.map(function(x){\r\n if(x.EditingDate !== \"\"){\r\n x.EventDateTime_UTC = CaregiverToPatientTimeService.calculatePatientTime(x.EditingDate, _patient.TimeZoneAndroidId);\r\n }\r\n if(x.EditingDate === \"\" && x.EventDateTime_UTC){\r\n x.EventDateTime_UTC = null;\r\n }\r\n return x;\r\n });\r\n return retval;\r\n }\r\n\r\n PatientMilestoneState.prototype.setStonesFromBag = function(bag, patient) {\r\n //Bag contains PatientMilestones object and Milestones object that need to be mapped\r\n\r\n //Used for dateInFuture method\r\n _patient = patient;\r\n\r\n this.patientMilestonesHeader = [];\r\n var id = this.getPatientId();\r\n this.patientMilestones = lodash.cloneDeep(bag.PatientMilestones);\r\n this.Milestones = lodash.cloneDeep(bag.Milestones);\r\n this.OriginalBag = lodash.cloneDeep(bag);\r\n this.Milestones = this.Milestones.map(function(x) {// Zero out patientMilestoneId's, setting ones we already saved later\r\n x.PatientMilestoneId = 0;\r\n return x;\r\n });\r\n this.Milestones = this.Milestones.map(function(x) {\r\n x.PatientId = id;\r\n x.EditingDate = \"\";\r\n for(var i = 0; i < bag.PatientMilestones.length; ++i) {\r\n var p = bag.PatientMilestones[i];\r\n\r\n if(p.MilestoneId === x.MilestoneId && p.EventDateTime_UTC) {\r\n x.EventDateTime_UTC = CaregiverToPatientTimeService.calculateCaregiverTime(p.EventDateTime_UTC, _patient.TimeZoneAndroidId);\r\n x.EditingDate = CaregiverToPatientTimeService.calculateCaregiverTime(p.EventDateTime_UTC, _patient.TimeZoneAndroidId);\r\n x.PatientMilestoneId = p.PatientMilestoneId;\r\n x.inThePast = _invalidDates(x.EventDateTime_UTC);\r\n }else if(p.MilestoneId === x.MilestoneId) {\r\n x.PatientMilestoneId = p.PatientMilestoneId;\r\n }\r\n \r\n }\r\n return x;\r\n });\r\n this.patientMilestonesHeader = this.Milestones.filter(function(x) {\r\n return (x.EventDateTime_UTC) ? true:false;// Values with dates should be shown\r\n });\r\n this.patientMilestonesHeader = this.patientMilestonesHeader.map(function(x){// Set them as actual date objects for display\r\n x.date = new Date(x.EventDateTime_UTC);\r\n return x;\r\n });\r\n\r\n }\r\n\r\n PatientMilestoneState.prototype.setPatientMilestones = function(m, patient) {\r\n this.patientMilestones = lodash.cloneDeep(m);\r\n this.OriginalBag.PatientMilestones = lodash.cloneDeep(m);\r\n this.setStonesFromBag(this.OriginalBag, patient);\r\n }\r\n\r\n\r\n PatientMilestoneState.prototype.setMilestones = function(m) {\r\n this.Milestones = m;\r\n this.BackupMileStones = lodash.cloneDeep(this.Milestones);\r\n }\r\n\r\n function _invalidDates(date)\r\n {\r\n var day = DateUtilities.getDateInMilliseconds(new Date(date));\r\n var created = DateUtilities.getServerUTCDateTimeToDateInMillisecondsForTimezone(_patient.CreatedDtUTC, _patient.TimeZoneAndroidId);\r\n\r\n if(day >= created) { \r\n return false; \r\n } else { \r\n return true; \r\n } \r\n }\r\n\r\n function _calculateInvalidDates(o) {\r\n return _invalidDates(o.date);\r\n }\r\n\r\n PatientMilestoneState.prototype.MilestoneDateOptions = {\r\n dateDisabled:_calculateInvalidDates\r\n };\r\n\r\n PatientMilestoneState.prototype.validateMileStoneDate = function(form,stone,date) {\r\n \r\n var checkDate = new Date(date);\r\n\r\n if(form[stone.Name].$viewValue === \"\" || typeof form[stone.Name].$viewValue == 'undefined' ){\r\n form[stone.Name].$setValidity(\"past\",true);\r\n stone.error = false;\r\n }\r\n else{\r\n form[stone.Name].$setValidity(\"past\",true);\r\n stone.error = false;\r\n }\r\n \r\n\r\n }\r\n return PatientMilestoneState;\r\n})","function PatientSearchController($scope, lodash, DemographicsService, PatientHeaderService, $state, $uibModal, vhSweetAlert, WebFormFields) {\r\n var vm = this;\r\n vm.genders = [\"\", 'Male', 'Female'];\r\n vm.countryCode = \"1\";\r\n vm.PatientSearchFields = {\r\n LastName: '',\r\n FirstName: '',\r\n Gender: '',\r\n Email: '',\r\n PhoneNumber: '',\r\n City: '',\r\n State: '',\r\n MRNIndent: '',\r\n Zipcode: '',\r\n DOB:''\r\n }\r\n \r\n $scope.dob = '';\r\n vm.webformfields = WebFormFields\r\n vm.datePickerOptionsDOB = {\r\n dateDisabled: function (o) {\r\n var day = new Date(o.date);\r\n var today = new Date();\r\n if (day < today) {\r\n return false;\r\n\r\n } else {\r\n return true;\r\n }\r\n }\r\n }\r\n vm.Phonerequired = function () {\r\n var required = vm.PatientSearchFields.Phone && vm.PatientSearchFields.Phone.replace(/\\D/g, '').length > 11\r\n if (required) {\r\n $scope.patientSearch.PhoneSearch.$setValidity('req', false)\r\n }\r\n else {\r\n if (vm.PatientSearchFields.Phone && vm.PatientSearchFields.Phone.replace(/\\D/g, '').length == 11 && !vm.PatientSearchFields.Phone.replace(/\\D/g, '').startsWith(1)) {\r\n $scope.patientSearch.PhoneSearch.$setValidity('req', false)\r\n return;\r\n }\r\n $scope.patientSearch.PhoneSearch.$setValidity('req', true)\r\n }\r\n }\r\n vm.validateBirthDay = function () {\r\n var today = new Date();\r\n if ($scope.dob && $scope.dob > today) {\r\n $scope.patientSearch.DOB.$setValidity(\"future\", false);\r\n\r\n } else {\r\n $scope.patientSearch.DOB.$setValidity(\"future\", true);\r\n }\r\n vm.PatientSearchFields.DateOfBirth = $scope.dob\r\n \r\n }\r\n vm.CancelSearch = function () {\r\n $state.go('patients.list');\r\n }\r\n vm.SearchPatients = function () {\r\n var request = {};\r\n request.FirstName = vm.PatientSearchFields.FirstName!=''? vm.PatientSearchFields.FirstName:null;\r\n request.LastName = vm.PatientSearchFields.LastName != '' ? vm.PatientSearchFields.LastName : null;\r\n request.Gender = vm.PatientSearchFields.Gender != '' ? vm.PatientSearchFields.Gender : null;\r\n request.Email = vm.PatientSearchFields.Email != '' ? vm.PatientSearchFields.Email : null;\r\n request.PhoneNumber = vm.PatientSearchFields.PhoneNumber != '' ? vm.PatientSearchFields.PhoneNumber : null;\r\n request.City = vm.PatientSearchFields.City != '' ? vm.PatientSearchFields.City : null;\r\n request.State = vm.PatientSearchFields.State != '' ? vm.PatientSearchFields.State : null;\r\n request.MRNIdent = vm.PatientSearchFields.MRNIdent != '' ? vm.PatientSearchFields.MRNIdent : null;\r\n request.ZipCode = vm.PatientSearchFields.Zipcode != '' ? vm.PatientSearchFields.Zipcode : null;\r\n request.Phone = vm.PatientSearchFields.Phone != '' ? vm.PatientSearchFields.Phone : null;\r\n if ($scope.dob) {\r\n vm.PatientSearchFields.DOB = $scope.dob;\r\n vm.PatientSearchFields.DOB = moment(vm.PatientSearchFields.DOB).format(\"MM/DD/YYYY\");\r\n }\r\n else\r\n vm.PatientSearchFields.DOB = '';\r\n request.DateOfBirth = vm.PatientSearchFields.DOB != '' ? vm.PatientSearchFields.DOB : null;\r\n DemographicsService.SearchPatientDuplicate(request).then(function (result) {\r\n vm.patientList = result != null ? result.SearchPatientListResult : [];\r\n vm.TotalPatients = result.TotalPatients\r\n MapProgramDate(vm.patientList);\r\n vm.pristinePatientSearchFields = angular.copy(vm.PatientSearchFields);\r\n \r\n if (vm.pristinePatientSearchFields.Phone && vm.pristinePatientSearchFields.Phone.length > 0) {\r\n vm.pristinePatientSearchFields.Phone = vm.pristinePatientSearchFields.Phone.replace(/\\D/g, '')\r\n if (vm.pristinePatientSearchFields.Phone.length == 10)\r\n vm.pristinePatientSearchFields.Phone = vm.countryCode + vm.pristinePatientSearchFields.Phone;\r\n }\r\n \r\n if (vm.patientList && vm.patientList.length == 0) {\r\n $state.go(\"patients.create\", { PatientFields: vm.pristinePatientSearchFields})\r\n }\r\n });\r\n \r\n }\r\n vm.getUtcDate = function (serializedDate) {\r\n var date = new Date(Date.parse(serializedDate));\r\n var formatedDate = moment(date).format(\"MM/DD/YYYY\")\r\n return formatedDate;\r\n }\r\n vm.createNewPatient = function () {\r\n var modalConfirm = {\r\n html: true,\r\n type: \"warning\",\r\n showCancelButton: true,\r\n cancelButtonText: 'No',\r\n confirmButtonText: 'Yes',\r\n title: 'Are you sure?',\r\n text: `Matching patient(s) profile(s) exist. Do you still want to create a duplicate member profile?` \r\n };\r\n vhSweetAlert.verify(modalConfirm)\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n $state.go(\"patients.create\", { PatientFields: vm.pristinePatientSearchFields })\r\n }\r\n });\r\n\r\n }\r\n vm.createNewVisit=function(patientId) {\r\n PatientHeaderService.createNewEncounter(patientId).then(function (response) {\r\n if (response.data.Id) {\r\n $state.go(\"patients.patient.demographics\", { patientId: response.data.Id }, { reload: true });\r\n }\r\n });\r\n }\r\n function MapProgramDate(patientList) {\r\n angular.forEach(patientList, function (v, k) {\r\n v.programDate = null;\r\n v.programTotalDaysText = null;\r\n v.programStatusText = null;\r\n v.programDayText = null;\r\n if (v.MonitoringStatusId === 1) {\r\n v.programDate = v.ProgramStartDate;\r\n if (v.ProgramDurationDays) {\r\n v.programDayText = \"Day \" + v.ProgramDurationDays;\r\n }\r\n v.programTotalDaysText = v.ProgramDurationTotalDays;\r\n v.programDayText = v.programTotalDaysText != null && v.programDayText!=null ? v.programDayText + \" of \" +v.programTotalDaysText:v.programDayText \r\n } else if (v.MonitoringStatusId === 3) {\r\n v.programStatusText = \"Screening\";\r\n setProgramDateText(v);\r\n } else if (v.MonitoringStatusId === 8) {\r\n v.programStatusText = \"Pre-active\";\r\n setProgramDateText(v);\r\n } else if (v.MonitoringStatusId === 2) {\r\n v.programStatusText = \"Inactive\";\r\n setProgramDateText(v);\r\n } else if (v.MonitoringStatusId === 6) {\r\n v.programStatusText = \"Screen Failed\";\r\n v.programDate = v.MonitoringStatusChangeDate;\r\n } else if (v.MonitoringStatusId === 7) {\r\n v.programStatusText = \"Deleted\";\r\n v.programDate = v.MonitoringStatusChangeDate;\r\n } else if (v.MonitoringStatusId === 4) {\r\n v.programStatusText = \"Completed\";\r\n if (v.ProgramDurationDays) {\r\n v.programDayText = \"\" + v.ProgramDurationDays + \" d\";\r\n }\r\n v.programDate = v.MonitoringStatusChangeDate;\r\n }\r\n })\r\n \r\n }\r\n\r\n function setProgramDateText(v) {\r\n if (v.MonitoringStatusChangeDate !== null) {\r\n v.programDayText = \"Day \" + moment().startOf('day').diff(moment(v.MonitoringStatusChangeDate).startOf('day'), 'days') ;\r\n\r\n }\r\n }\r\n\r\n var disabledDate = function (o) {\r\n var day = new Date(o.date);\r\n var today = new Date();\r\n if (day < today) {\r\n return false;\r\n\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n}\r\nangular.module('patient.demographics').controller('PatientSearchController', PatientSearchController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/PatientSearch.tpl.html',\n '
          Add Patient
          Search Patient
          0\">
          0\">
          0\">
          0\" ng-class=\"{ \\'has-error\\' : patientSearch.DOB.$invalid && (!patientSearch.DOB.$pristine || patientSearch.$submitted) }\">
          {{vm.webformfields.DOB.FieldLabel}} must not be in the future
          0\">
          0\">
          0\">
          0\">
          0\" ng-class=\"{ \\'has-error\\' : patientSearch.Email.$invalid && (!patientSearch.Email.$pristine || patientSearch.$submitted) }\">
          {{vm.webformfields.Email.FieldLabel}} is invalid
          Phone is invalid

          0\">
          Patient Results
          {{item.LastName}}
          {{item.FirstName}}
          {{item.DateofBirth| datetime : \"date\" : \"UTC\"}} 
          {{item.Age.Value}} {{item.Age.UnitsStringShort}}
           {{item.Gender}}
          {{item.ServiceLevel}}
          MRN {{item.MRNIdent}}
          {{item.Phone1|tel}} (Primary)
          {{item.Phone2|tel}} (Secondary)
          {{item.EmailId1}}
          City: {{item.City}}
          State: {{item.State}}
          Zip Code: {{item.Zipcode}}
          {{item.programStatusText}} {{item.programDate| datetime : \"date\" : \"UTC\"}} ({{item.programDayText}})
          ');\n}]);\n}(window, document, window.angular));","\r\nfunction ProgramModalController(pmilestone,patient, webformfields, populationgroups, populations, programdurations, hasProgramStartDateWritePermission, lodash, $uibModalInstance,PatientMilestoneService, $scope,PatientMilestoneState,DateUtilities) {\r\n $scope.patient = patient;\r\n $scope.webformfields = webformfields;\r\n $scope.populationgroups = populationgroups;\r\n $scope.populations = populations;\r\n $scope.programdurations = programdurations;\r\n // $scope.patientMilestoneState = new PatientMilestoneState($scope.patient.Id);\r\n // $scope.Milestones = [{Name:\"Add A Milestone\"}];\r\n // $scope.patientMileStones = [];\r\n $scope.patientMilestoneState = pmilestone;\r\n\r\n $scope.filterMilestones = function(populationId){\r\n $scope.patientMilestoneState.restoreMilestones($scope.patient);\r\n\r\n $scope.patientMilestoneState.Milestones = $scope.patientMilestoneState.Milestones.filter(function (x){\r\n return(x.MilestonePopulations.length == 0 || x.MilestonePopulations.find(function (o) {return o.PopulationId == populationId;}));\r\n });\r\n }\r\n $scope.filterMilestones($scope.patient.PopulationId);\r\n \r\n $scope.hasProgramStartDateWritePermission = hasProgramStartDateWritePermission;\r\n $scope.updateProgramDuration = function() {\r\n var item = lodash.find($scope.programdurations, function(i) { return i.ProgramDurationId == patient.ProgramDurationId; })\r\n $scope.patient.ProgramDurationName = item.Name;\r\n }\r\n\r\n $scope.validatedate = function() { \r\n if(!patient.ProgramStartDate || patient.ProgramStartDate === \"\" ){\r\n $scope.patientDemographics.ProgramStartDate.$setValidity(\"backdate\",true); \r\n return;\r\n }\r\n \r\n //ProgramStartDate is chosen and is localized to the browser's timezone, so make sure that it has no timezone\r\n var programLocalizedStartDateInMilliseconds = DateUtilities.getDateInMilliseconds(patient.ProgramStartDate);\r\n\r\n var patientLocalizedCreatedDateInMilliseconds = DateUtilities.getServerUTCDateTimeToDateInMillisecondsForTimezone($scope.patient.CreatedDtUTC, $scope.patient.TimeZoneAndroidId);\r\n\r\n if(programLocalizedStartDateInMilliseconds < patientLocalizedCreatedDateInMilliseconds){ \r\n $scope.patientDemographics.ProgramStartDate.$setValidity(\"backdate\",false); \r\n } else { \r\n $scope.patientDemographics.ProgramStartDate.$setValidity(\"backdate\",true); \r\n } \r\n }\r\n\r\n var disabledDate = function(o) {\r\n var day = DateUtilities.getDateInMilliseconds(new Date(o.date));\r\n var created = DateUtilities.getServerUTCDateTimeToDateInMillisecondsForTimezone($scope.patient.CreatedDtUTC, $scope.patient.TimeZoneAndroidId);\r\n\r\n if(day >= created) { \r\n return false; \r\n } else { \r\n return true; \r\n } \r\n } \r\n \r\n $scope.datePickerOptions = { \r\n dateDisabled:disabledDate \r\n };\r\n\r\n\r\n $scope.ok = function() {\r\n if($scope.patientDemographics.$valid) {\r\n $uibModalInstance.close();\r\n }\r\n };\r\n\r\n $scope.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('patient.demographics').controller('ProgramModalController',ProgramModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/program.modal.html',\n '

          Patient Program{{testdata}}

          {{webformfields.PopulationGroupId.FieldLabel}} is required
          {{webformfields.PopulationId.FieldLabel}} is required
          {{webformfields.ProgramDurationId.FieldLabel}} is required
          {{webformfields.ProgramStartDate.FieldLabel}} is required
          {{webformfields.ProgramStartDate.FieldLabel}} must be after patient created date
          0 && patientMilestoneState.hasReadPermission\">
          ');\n}]);\n}(window, document, window.angular));","\r\nfunction PatientProvidersController($q, $window, $uibModalInstance, $scope, $stateParams, patient, patientProviders, webformfields, lodash,PatientDemographicsProvidersService, \r\n personalCaregiverRoles, PermissionService, specialties, EditConfigurationsService, ProviderGroups, CaregiverTitles, AddSecondaryProviderToProviderList, ProviderService) {\r\n \r\n $scope.newProvider = {};\r\n $scope.personalCaregiverRoles = personalCaregiverRoles;\r\n $scope.caregiverTitles = CaregiverTitles;\r\n $scope.allProviderGroups = ProviderGroups;\r\n\r\n $scope.specialties = specialties;\r\n $scope.patientProviders = patientProviders;\r\n\r\n $scope.originalPatientProviders = angular.copy(patientProviders);\r\n\r\n $scope.focusProvider = false;\r\n $scope.webformfields = webformfields;\r\n $scope.patient = patient;\r\n\r\n $scope.isFreetext = false;\r\n $scope.canFreetext = PermissionService.userHasPermission([\"ProviderFreetextWrite\"]);\r\n\r\n $scope.isPrimaryCaregiverEdited = false;\r\n\r\n $scope.addProvider = addProvider;\r\n $scope.addNewProvider = addNewProvider;\r\n $scope.clearProvider = clearProvider;\r\n\r\n $scope.unsavedProviders = [];\r\n $scope.unsavedProviderFormFields = [];\r\n\r\n /*\r\n $scope.$watchCollection(\"unsavedProviders\", function(newValue, oldValue){\r\n if(newValue != oldValue){\r\n $scope.unsavedProviderFormFields.forEach(function(formField) {\r\n ProviderService.checkUnsavedProviders(formField.val, newValue, formField);\r\n });\r\n }\r\n });\r\n */\r\n\r\n $scope.$watch('isFreetext', function(val){\r\n var provider = $window.document.getElementById('Provider');\r\n if(provider) {\r\n provider.focus();\r\n }\r\n });\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n $scope.originalPersonalCaregiverName = $scope.patient.PersonalCaregiverName;\r\n $scope.originalPersonalCaregiverContactNumber = $scope.patient.PersonalCaregiverContactNumber;\r\n\r\n $scope.addNewProvider();\r\n }\r\n\r\n $scope.addSecondaryProviderToProviderList = AddSecondaryProviderToProviderList;\r\n $scope.isFreetext = $scope.patient.Provider ? $scope.patient.Provider.FreeText : false;\r\n\r\n function getNewProvider() {\r\n return {\r\n PatientId: $stateParams.patientId,\r\n Provider: {},\r\n isValid: false,\r\n isNew: true,\r\n isNewRow: true // changes to false as soon as record is dirty, used to add new rows to edit screen\r\n };\r\n }\r\n\r\n function clearProvider() {\r\n \r\n $scope.patient.Provider = null;\r\n $scope.patient.ProviderGroup = null;\r\n $scope.patient.ProviderGroupId = null;\r\n $scope.patient.PersonalCaregiverNameField = null;\r\n $scope.patient.PersonalCaregiverContactNumber = '';\r\n $scope.patient.PersonalCaregiverFax = '';\r\n $scope.patient.PersonalCaregiverHl7Ident = null;\r\n $scope.patient.PersonalCaregiverSpecialtyId = null;\r\n $scope.patient.PersonalCaregiverTitleId = null;\r\n $scope.patient.PersonalCaregiverId = null;\r\n\r\n $scope.isPrimaryCaregiverEdited = true;\r\n }\r\n\r\n function addProvider(editableProvider) {\r\n\r\n var patientProviderPostModel = {\r\n PersonalCaregiverRoleId: editableProvider.PersonalCaregiverRoleId\r\n };\r\n\r\n if(editableProvider.Provider && editableProvider.Provider.FreeText) {\r\n patientProviderPostModel.Provider = editableProvider.Provider;\r\n patientProviderPostModel.Provider.CaregiverSpecialtyId = editableProvider.SpecialtyId;\r\n var nameParts = patientProviderPostModel.Provider.FullName.split(' ');\r\n patientProviderPostModel.Provider.FirstName = nameParts[0];\r\n if(nameParts.length > 0) {\r\n patientProviderPostModel.Provider.LastName = nameParts[1];\r\n }\r\n \r\n return PatientDemographicsProvidersService.addFreetextProvider($stateParams.patientId, patientProviderPostModel).then(function(data) {\r\n return data;\r\n });\r\n } else {\r\n if(editableProvider.Provider.ProviderMasterId) {\r\n patientProviderPostModel.ProviderMasterId = editableProvider.Provider.ProviderMasterId;\r\n return PatientDemographicsProvidersService.addProvider($stateParams.patientId, patientProviderPostModel).then(function (data) {\r\n return data;\r\n });\r\n }\r\n }\r\n\r\n \r\n }\r\n\r\n $scope.removeProvider = function (provider) {\r\n PatientDemographicsProvidersService.removeProvider($stateParams.patientId, provider.PatientProviderId).then(function (isRemoved) {\r\n lodash.remove($scope.patientProviders, function (o) {\r\n return o === undefined || o.PatientProviderId == provider.PatientProviderId; \r\n });\r\n });\r\n };\r\n\r\n function addNewProvider() {\r\n var newprovider = angular.copy(getNewProvider());\r\n $scope.patientProviders.push(newprovider);\r\n }\r\n\r\n $scope.updateProviderGroupFields = function () {\r\n\r\n var found = lodash.find($scope.allProviderGroups, { Id : $scope.patient.ProviderGroupId});\r\n if (found) {\r\n $scope.patient.ProviderGroup = found.Name;\r\n }\r\n\r\n if($scope.isFreetext) return;\r\n\r\n $scope.isPrimaryCaregiverEdited = true;\r\n if($scope.patient.Provider) {\r\n if($scope.patient.ProviderGroupId != $scope.patient.Provider.ProviderGroupId) {\r\n $scope.patient.Provider = null;\r\n $scope.patient.PersonalCaregiverNameField = null;\r\n }\r\n }\r\n };\r\n\r\n $scope.checkHl7Ident = function(oldHl7Ident, hl7Ident, formElement, unsavedProviders, unsavedProviderFormFields) {\r\n ProviderService.checkHl7Ident(hl7Ident, formElement, oldHl7Ident, unsavedProviders, unsavedProviderFormFields);\r\n /*\r\n PatientDemographicsProvidersService.getProviderByHl7Ident(hl7Ident).then(function(data){\r\n formElement.$setValidity('exists', !data);\r\n })\r\n */\r\n };\r\n\r\n $scope.selectProvider = function (item, ignore) {\r\n item.FreeText = false;\r\n $scope.isFreetext = false;\r\n\r\n $scope.selectedProvider = item;\r\n var providerMasterId = parseInt(item.ProviderMasterId);\r\n $scope.isFreetext = providerMasterId === 0;\r\n \r\n if (!isNaN(providerMasterId)) {\r\n $scope.patient.PrimaryProviderMasterId = item.ProviderMasterId;\r\n updatePersonalCaregiverFields(ignore);\r\n }\r\n }\r\n\r\n function updatePersonalCaregiverFields(ignore) {\r\n\r\n var selectedProvider = $scope.selectedProvider;// || $scope.patient.Provider;\r\n\r\n $scope.isPrimaryCaregiverEdited = true;\r\n $scope.patient.Provider = selectedProvider;\r\n $scope.patient.PersonalCaregiverContactNumber = selectedProvider.PhoneNumber1;\r\n $scope.patient.ProviderGroup = selectedProvider.ProviderGroup ? selectedProvider.ProviderGroup.Name : '';\r\n $scope.patient.PersonalCaregiverNameField = selectedProvider.FullName;\r\n $scope.patient.PersonalCaregiverTitleId = selectedProvider.CaregiverTitleId;\r\n $scope.patient.PersonalCaregiverHl7Ident = selectedProvider.Hl7Ident;\r\n $scope.patient.PersonalCaregiverContactNumber = selectedProvider.PhoneNumber1;\r\n $scope.patient.PersonalCaregiverFax = selectedProvider.FaxNumber;\r\n $scope.patient.PersonalCaregiverSpecialtyId = selectedProvider.CaregiverSpecialtyId;\r\n $scope.patient.PersonalCaregiverSpecialty = selectedProvider.CaregiverSpecialty;\r\n\r\n if (!ignore) {\r\n if (selectedProvider && selectedProvider.ProviderGroupId !== undefined && selectedProvider.ProviderGroupId !== null) {\r\n $scope.patient.ProviderGroupId = selectedProvider.ProviderGroupId;\r\n }\r\n }\r\n };\r\n\r\n $scope.typeaheadTitle = function() {\r\n return !$scope.isFreetext ? 'Typeahead is enabled' : 'Typeahead is disabled';\r\n }\r\n\r\n $scope.toggleOther = function () {\r\n if(!$scope.canFreetext) return;\r\n\r\n clearProvider();\r\n\r\n $scope.isFreetext = !$scope.isFreetext;\r\n\r\n };\r\n\r\n $scope.providerGroupList = function (providerName) {\r\n\r\n var providerGroupId = 0;\r\n if($scope.patient !== undefined && $scope.patient !== null) {\r\n providerGroupId = $scope.patient.ProviderGroupId;\r\n }\r\n\r\n if ($scope.isFreetext) {\r\n return [];\r\n } else {\r\n return PatientDemographicsProvidersService.getProvidersAsync(providerName, providerGroupId).then(function(providers){\r\n if ($scope.patient.ProviderGroupId > 0) {\r\n return providers.filter(function (provider) {\r\n return provider.ProviderGroupId == $scope.patient.ProviderGroupId || provider.ProviderId === \"0\";\r\n });\r\n } else {\r\n return providers;\r\n }\r\n });\r\n }\r\n }\r\n\r\n\r\n $scope.ok = function () {\r\n \r\n $scope.patientProviderForm.$setSubmitted();\r\n if (($scope.patientProviderForm.$invalid) || ($scope.demographicsProviderForm.$invalid)) {\r\n return;\r\n }\r\n\r\n var allProvidersValid = true;\r\n $scope.isPrimaryCaregiverEdited = $scope.isFreetext || $scope.isPrimaryCaregiverEdited || $scope.patient.PersonalCaregiverContactNumber != $scope.originalPersonalCaregiverContactNumber;\r\n\r\n // ensure all provider forms are valid\r\n $scope.patientProviders.forEach(function (o) {\r\n \r\n if (!o.isNewRow && !o.isValid()) {\r\n allProvidersValid = false;\r\n }\r\n\r\n o.PersonalCaregiverRole = lodash.find(personalCaregiverRoles, {PersonalCaregiverRoleId: o.PersonalCaregiverRoleId });\r\n\r\n });\r\n\r\n if (allProvidersValid) {\r\n\r\n var promises = [];\r\n\r\n // delete as needed\r\n $scope.originalPatientProviders.forEach(function (o) {\r\n if (lodash.find($scope.patientProviders, function (p) { return p.PatientProviderId == o.PatientProviderId; }) === undefined ) {\r\n promises.push($scope.removeProvider(o));\r\n }\r\n });\r\n\r\n // update or add providers that are dirty\r\n $scope.patientProviders.forEach(function (o) {\r\n if (o.isDirty()) {\r\n if (o.isNew) {\r\n promises.push($scope.addProvider(o));\r\n }\r\n } \r\n });\r\n\r\n $q.all(promises).then(function(newPatientProviders) {\r\n newPatientProviders.forEach(function(newPatientProvider){ $scope.patientProviders.push(newPatientProvider);});\r\n lodash.remove($scope.patientProviders, function(patientProvider){\r\n return patientProvider === undefined || patientProvider.isNew || patientProvider.IsNewRow;\r\n });\r\n\r\n if($scope.patient.PersonalCaregiverNameField) {\r\n if($scope.isFreetext) {\r\n var nameParts = $scope.patient.PersonalCaregiverNameField.split(' ');\r\n $scope.selectedProvider = {\r\n IsPrimary: true,\r\n Provider: {\r\n ProviderId: $scope.patient.ProviderId,\r\n ProviderMasterId: $scope.patient.PrimaryProviderMasterId,\r\n ProviderGroupId: $scope.patient.ProviderGroupId,\r\n FirstName: nameParts[0],\r\n LastName: nameParts.length > 0 ? nameParts[1] : undefined,\r\n CaregiverTitleId: $scope.patient.PersonalCaregiverTitleId,\r\n Hl7Ident: $scope.patient.PersonalCaregiverHl7Ident,\r\n PhoneNumber1: $scope.patient.PersonalCaregiverContactNumber,\r\n FaxNumber: $scope.patient.PersonalCaregiverFax,\r\n CaregiverSpecialtyId: $scope.patient.PersonalCaregiverSpecialtyId\r\n }\r\n };\r\n }\r\n }\r\n\r\n $uibModalInstance.close({\r\n isPrimaryCaregiverEdited: $scope.isPrimaryCaregiverEdited, \r\n selectedProvider: $scope.selectedProvider, \r\n patientProviders: $scope.patientProviders, \r\n isFreetext: $scope.isFreetext\r\n });\r\n });\r\n }\r\n };\r\n\r\n $scope.isProviderRequired = function() {\r\n if($scope.webformfields.Provider.IsRequired) {\r\n return true;\r\n }\r\n\r\n if($scope.patient.Provider && $scope.patient.Provider.ProviderGroupId) {\r\n return true;\r\n }\r\n\r\n if($scope.isFreetext) {\r\n if($scope.patient.PersonalCaregiverTitleId && $scope.patient.PersonalCaregiverTitleId > 0) return true;\r\n if($scope.patient.PersonalCaregiverHl7Ident && $scope.patient.PersonalCaregiverHl7Ident.length > 0) return true;\r\n if($scope.patient.PersonalCaregiverContactNumber && $scope.patient.PersonalCaregiverContactNumber.length > 0) return true;\r\n if($scope.patient.PersonalCaregiverFax && $scope.patient.PersonalCaregiverFax.length > 0) return true;\r\n if($scope.patient.PersonalCaregiverSpecialtyId && $scope.patient.PersonalCaregiverSpecialtyId > 0) return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n $scope.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n}\r\n\r\n\r\nangular.module('patient.demographics').controller('PatientProvidersController', PatientProvidersController);\r\n","function ProvidersDirective($stateParams, lodash, PatientDemographicsProvidersService, specialties, providers) {\r\n\r\n function controller($scope) {\r\n// debugger;\r\n// $scope.specialties = specialties;\r\n// $scope.providers = providers;\r\n// $scope.focusProvider = false;\r\n\r\n// function getNewProvider() {\r\n// debugger;\r\n// return {\r\n// patientId: $stateParams.patientId,\r\n// name: '',\r\n// specialtyId: '',\r\n// contactNumber: ''\r\n// };\r\n// }\r\n\r\n// $scope.newProvider = getNewProvider();\r\n\r\n// $scope.isAddingProvider = false;\r\n// $scope.showAddProvider = function () {\r\n// $scope.isAddingProvider = true;\r\n// $scope.focusProvider = true;\r\n// $scope.newProvider = getNewProvider();\r\n// };\r\n\r\n// $scope.cancelAdd = function() {\r\n// debugger;\r\n// $scope.patientProvidersForm.$setPristine(true);\r\n// $scope.isAddingProvider = false;\r\n// };\r\n\r\n// // $scope.addProvider = function (addProviderForm) {\r\n// // if(!addProviderForm.$valid) {\r\n// // addProviderForm.$setSubmitted();\r\n// // return;\r\n// // }\r\n\r\n// // PatientDemographicsProvidersService.addProvider($scope.newProvider).then(function (provider) {\r\n// // var addedProvider = {\r\n// // Id: provider.Id,\r\n// // PatientId: provider.PatientId,\r\n// // Name: provider.Name,\r\n// // SpecialtyId: provider.SpecialtyId,\r\n// // ContactNumber: provider.ContactNo\r\n// // };\r\n\r\n// // $scope.providers.push(addedProvider);\r\n\r\n// // $scope.newProvider = getNewProvider();\r\n// // $scope.patientProvidersForm.$setPristine(true);\r\n// // $scope.isAddingProvider = false;\r\n// // });\r\n// // };\r\n\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/providers.tpl.html\"\r\n }\r\n}\r\n\r\n\r\nangular.module(\"patient.demographics\").directive(\"providers\", ProvidersDirective);\r\n","function PatientDemographicsProvidersService($http) {\r\n\r\n function getCaregiverSpecialties() {\r\n return $http.get('/api/CaregiverSpecialty').then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getProvidersAsync(providerName, providerGroupId) {\r\n\r\n if(providerGroupId === undefined || providerGroupId === null) {\r\n providerGroupId = 0;\r\n }\r\n\r\n return $http({\r\n method: 'POST',\r\n url: '/api/AutoComplete/Provider',\r\n data: {\r\n param: providerName,\r\n providerGroupId: providerGroupId\r\n }\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getProviders(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/providers').then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function addProvider(patientId, provider) {\r\n provider.PatientId = patientId;\r\n return $http.post('/api/Patient/' + patientId + '/provider/link', provider).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateProvider(patientId, patientProviderId, provider) {\r\n provider.IsDeleted = false;\r\n return $http.put('/api/Patient/' + patientId + '/provider/link/' + patientProviderId, provider).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function removeProvider(patientId, patientProviderId) {\r\n return $http.delete('/api/Patient/' + patientId + '/provider/' + patientProviderId).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getProviderGroups() {\r\n return $http.get('/api/provider/Groups').then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getProviderByGroup(providerGroupId) {\r\n return $http.get('/api/provider/Group?providerGroupId=' + providerGroupId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function addFreetextProvider(patientId, provider) {\r\n return $http.post('/api/Patient/' + patientId + '/provider/freetext', provider).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateFreetextProvider(patientId, patientProviderId, provider) {\r\n return $http.put('/api/Patient/' + patientId + '/provider/freetext/' + patientProviderId, provider).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateProviderGroup(patientId, providerGroupId) {\r\n if(providerGroupId) {\r\n return $http.post('/api/Patient/' + patientId + '/ProviderGroupId/' + providerGroupId).then(function(res) {\r\n return res.data;\r\n });\r\n } else {\r\n return $http.delete('/api/Patient/' + patientId + '/ProviderGroupId').then(function(res) {\r\n return res.data;\r\n });\r\n }\r\n }\r\n\r\n return {\r\n getCaregiverSpecialties: getCaregiverSpecialties,\r\n getProviders: getProviders,\r\n addProvider: addProvider,\r\n updateProvider: updateProvider,\r\n removeProvider: removeProvider,\r\n getProvidersAsync: getProvidersAsync,\r\n getProviderGroups: getProviderGroups,\r\n getProviderByGroup: getProviderByGroup,\r\n addFreetextProvider: addFreetextProvider,\r\n updateFreetextProvider: updateFreetextProvider,\r\n updateProviderGroup: updateProviderGroup\r\n }\r\n}\r\n\r\nangular.module(\"patient.demographics\").service(\"PatientDemographicsProvidersService\", PatientDemographicsProvidersService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/providers.tpl.html',\n '

          Providers

          {{webformfields.ProviderGroupId.FieldLabel}} is required
          Provider with HL7 Identifier already exists
          Provider with HL7 Identifier already entered
          {{patient.PersonalCaregiverContactNumber | tel}}
          {{patient.PersonalCaregiverContactNumber}} is invalid
          {{webformfields.Provider_Fax.FieldLabel}} is invalid
          {{webformfields.Provider.FieldLabel}}{{webformfields.Provider_Title.FieldLabel}}{{webformfields.Provider_Hl7Ident.FieldLabel}}{{webformfields.Provider_Phone1.FieldLabel}}{{webformfields.Provider_Fax.FieldLabel}}{{webformfields.Provider_Specialty.FieldLabel}} 0\">RoleActions
          ');\n}]);\n}(window, document, window.angular));","function ProviderUpdateDirective($window, $timeout, lodash, PatientDemographicsProvidersService, PermissionService, ProviderService) {\r\n\r\n function controller($scope, vhSweetAlert) {\r\n\r\n $scope.providerList = providerList;\r\n $scope.typeaheadTitle = typeaheadTitle;\r\n $scope.canFreetext = false;\r\n $scope.isFreetext = false;\r\n \r\n $scope.setIsFreetext = setIsFreetext;\r\n $scope.removeProvider = removeProvider;\r\n //$scope.onFieldBlur = onFieldBlur;\r\n $scope.toggleFreetext = toggleFreetext;\r\n //$scope.debounce = undefined;\r\n //$scope.addProvider = addProvider;\r\n $scope.addNewProvider = $scope.$parent.addNewProvider;\r\n $scope.selectProvider = selectProvider;\r\n $scope.updatePatientProvider = updatePatientProvider;\r\n\r\n $scope.editableProvider.isValid = function () {\r\n $scope.updateProviderForm.$setSubmitted();\r\n return $scope.updateProviderForm.$valid;\r\n };\r\n $scope.editableProvider.isDirty = function () {\r\n return !$scope.updateProviderForm.$pristine;\r\n };\r\n\r\n init();\r\n function init() {\r\n $scope.canFreetext = PermissionService.userHasPermission([\"ProviderFreetextWrite\"]);\r\n setIsFreetext();\r\n }\r\n\r\n function updatePatientProvider(editableProvider) {\r\n if(editableProvider.PatientProviderId) {\r\n var patientProviderPostModel = {\r\n PatientProviderId: editableProvider.PatientProviderId,\r\n PatientId: $scope.$parent.patient.Id,\r\n PersonalCaregiverRoleId: editableProvider.PersonalCaregiverRoleId,\r\n ProviderMasterId: editableProvider.ProviderMasterId\r\n };\r\n\r\n return PatientDemographicsProvidersService.updateProvider($scope.$parent.patient.Id, editableProvider.PatientProviderId, patientProviderPostModel).then(function(p) {\r\n $scope.editableProvider = p;\r\n return $scope.editableProvider;\r\n });\r\n }\r\n }\r\n\r\n function removeProvider(provider) {\r\n lodash.remove($scope.$parent.patientProviders, provider);\r\n }\r\n\r\n\r\n // function onFieldBlur() {\r\n // if($scope.isFreetext) {\r\n // return;\r\n // }\r\n\r\n // addProvider();\r\n // }\r\n\r\n // function addProvider(provider) {\r\n\r\n // //provider.Name = provider.FirstName + \" \" + provider.LastName;\r\n\r\n // if($scope.debounce) {\r\n // $timeout.cancel($scope.debounce);\r\n // }\r\n // $scope.debounce = $timeout(function() {\r\n // PatientDemographicsProvidersService.addProvider($scope.$parent.patient.Id, provider).then(function(newPatinetProvider){\r\n // console.log(newPatinetProvider);\r\n // });\r\n // // if(!$scope.updateProviderForm.$valid) return;\r\n // // $scope.isFreetext = false;\r\n\r\n // // if(!$scope.canFreetext && ($scope.editableProvider.ProviderId === undefined || $scope.editableProvider.ProviderId === 0) && !$scope.updateProviderForm.$pristine) {\r\n // // clearProvider();\r\n // // }\r\n\r\n // if ($scope.editableProvider.isNewRow && $scope.editableProvider.isDirty()) {\r\n // $scope.editableProvider.isNewRow = false;\r\n // $scope.$parent.addNewProvider();\r\n // }\r\n\r\n // }, 1000);\r\n // }\r\n\r\n function selectProvider(provider) {\r\n provider.FreeText = false;\r\n $scope.editableProvider.Provider = provider;\r\n $scope.editableProvider.isNewRow = false;\r\n $scope.$parent.addNewProvider();\r\n }\r\n\r\n function typeaheadTitle () {\r\n return !$scope.isFreetext ? 'Typeahead is enabled' : 'Typeahead is disabled';\r\n }\r\n\r\n function toggleFreetext() {\r\n if(!$scope.canFreetext) return;\r\n\r\n $scope.isFreetext = !$scope.isFreetext;\r\n $scope.editableProvider.Provider = $scope.editableProvider.Provider || {};\r\n $scope.editableProvider.Provider.FreeText = $scope.isFreetext;\r\n\r\n if($scope.isFreetext) {\r\n var provider = $window.document.getElementById('providerNameInput');\r\n if(provider) {\r\n provider.focus();\r\n }\r\n }\r\n clearProvider();\r\n\r\n }\r\n\r\n function clearProvider() {\r\n // $scope.editableProvider = {\r\n // isNew: true,\r\n // isNewRow: true\r\n // };\r\n }\r\n\r\n function setIsFreetext() {\r\n return false;\r\n }\r\n\r\n function providerList(search){\r\n if($scope.isFreetext) {\r\n return [];\r\n }\r\n\r\n return PatientDemographicsProvidersService.getProvidersAsync(search);\r\n }\r\n\r\n // $scope.$on('$destroy', function(){\r\n // // if($scope.debounce) {\r\n // // $timeout.cancel($scope.debounce);\r\n // // }\r\n\r\n // if($scope.editableProvider.Name && $scope.editableProvider.Name.length === 0) {\r\n // removeProvider();\r\n // }\r\n // });\r\n\r\n $scope.checkHl7Ident = function(oldHl7Ident, hl7Ident, formElement, unsavedProviders, unsavedProviderFormFields) {\r\n ProviderService.checkHl7Ident(hl7Ident, formElement, oldHl7Ident, unsavedProviders, unsavedProviderFormFields);\r\n }\r\n \r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'A',\r\n require: '^providers',\r\n replace: true,\r\n templateUrl: 'modules/patient/demographics/providerupdate.tpl.html',\r\n scope: {\r\n unsavedProviderFormFields: '=',\r\n unsavedProviders: '=',\r\n editableProvider: '=',\r\n editableSpecialties: '=',\r\n roles: '=',\r\n specialties: '=',\r\n caregiverTitles: '=',\r\n webformfields: '='\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"providerUpdate\", ProviderUpdateDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/providerupdate.tpl.html',\n '
          Fax Number is invalid
          Provider with HL7 Identifier already exists
          Provider with HL7 Identifier already entered
          Phone Number is invalid
          {{editableProvider.Provider.LastName}}, {{editableProvider.Provider.FirstName}}{{editableProvider.Provider.CaregiverTitle.Name}}{{editableProvider.Provider.Hl7Ident}}{{editableProvider.Provider.PhoneNumber1 | tel}}{{editableProvider.Provider.FaxNumber | tel}}{{editableProvider.Provider.CaregiverSpecialty.Name}}
          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelByodDirective() {\r\n function controller($scope, ServiceLevelWizardService, ServiceLevelType, DemographicsService) {\r\n $scope.maxDate = new Date();\r\n $scope.serviceLevelType = ServiceLevelType;\r\n $scope.PhoneNumRequired = $scope.wizard.serviceLevelData.serviceLevel.PhoneNumRequired;\r\n $scope.EmailRequired = $scope.wizard.serviceLevelData.serviceLevel.EmailRequired;\r\n $scope.PhoneOrEmailRequired = $scope.wizard.serviceLevelData.serviceLevel.PhoneOrEmailRequired;\r\n\r\n $scope.wizard.serviceLevelData.patientServiceLevel.email = angular.copy($scope.wizard.serviceLevelData.patient.Email);\r\n let dateOfBirth = angular.copy($scope.wizard.serviceLevelData.patient.DOB);\r\n\r\n $scope.wizard.serviceLevelData.patientServiceLevel.dob = dateOfBirth;\r\n\r\n $scope.isByodServiceType = $scope.wizard.serviceLevelData.serviceLevel.ServiceLevelTypeId === ServiceLevelType.BYOD;\r\n $scope.isGoServiceType = $scope.wizard.serviceLevelData.serviceLevel.ServiceLevelTypeId === ServiceLevelType.Go;\r\n\r\n $scope.usePin = $scope.wizard.configurations.UsePinValidation && ($scope.isByodServiceType || $scope.isGoServiceType);\r\n $scope.wizard.serviceLevelData.showPin = $scope.usePin;\r\n $scope.requireDob = $scope.isByodServiceType || $scope.isGoServiceType;\r\n $scope.useHybrid = $scope.wizard.configurations.HybridAppEnabled || $scope.isGoServiceType ||$scope.isByodServiceType;\r\n\r\n $scope.byodDateOptions = [\r\n {id: 1, label: 'Right Now'},\r\n {id: 2, label: 'Today'},\r\n {id: 3, label: 'Tomorrow'},\r\n {id: 4, label: 'Day After Tomorrow'}\r\n ];\r\n\r\n $scope.byodDate = $scope.byodDateOptions[0];\r\n\r\n $scope.byodDateChange = function () {\r\n $scope.wizard.serviceLevelData.patientServiceLevel.byodWelcomeDate = $scope.byodDate.label;\r\n };\r\n\r\n $scope.validateEitherPhoneOrEmailExist = function(){\r\n \r\n if((!$scope.wizard.serviceLevelData.patientServiceLevel.phone|| $scope.wizard.serviceLevelData.patientServiceLevel.phone == '') && (!$scope.wizard.serviceLevelData.patientServiceLevel.email ||$scope.wizard.serviceLevelData.patientServiceLevel.email =='')){\r\n return true;\r\n } else{\r\n return false;\r\n }\r\n };\r\n\r\n $scope.byodTimeOptions = [\r\n {id: 1, label: 'Morning'},\r\n {id: 2, label: 'Afternoon'},\r\n {id: 3, label: 'Evening'}\r\n ];\r\n\r\n $scope.byodTime = $scope.byodTimeOptions[0];\r\n\r\n $scope.byodTimeChange = function () {\r\n $scope.wizard.serviceLevelData.patientServiceLevel.byodWelcomeTime = $scope.byodTime.label;\r\n };\r\n\r\n $scope.emailPattern = (function () {\r\n var regexp = /^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/;\r\n return {\r\n test: function (value) {\r\n return regexp.test(value);\r\n }\r\n };\r\n })();\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.wizard.serviceLevelData.patientServiceLevel.phone = getPhoneNumber();\r\n $scope.wizard.serviceLevelData.patientServiceLevel.byodPin = getPin();\r\n $scope.wizard.serviceLevelData.patientServiceLevel.email = getEmail();\r\n\r\n $scope.byodDateOptions.forEach(function(option) {\r\n if(option.label === $scope.wizard.configurations.GoWelcomeCallDate) {\r\n $scope.byodDate = option;\r\n $scope.wizard.serviceLevelData.patientServiceLevel.byodWelcomeDate = option.label;\r\n }\r\n });\r\n\r\n $scope.byodTimeOptions.forEach(function (option) {\r\n if (option.label === $scope.wizard.configurations.GoWelcomeCallTime) {\r\n $scope.byodTime = option;\r\n $scope.wizard.serviceLevelData.patientServiceLevel.byodWelcomeTime = option.label;\r\n }\r\n });\r\n\r\n //this should only happen if +go service level and no devices available\r\n if($scope.wizard.skipDeviceSelection){\r\n $scope.wizard.showOk = true;\r\n $scope.wizard.showNext = false;\r\n }\r\n }\r\n\r\n function getPhoneNumber() {\r\n if ($scope.wizard.serviceLevelData.patientServiceLevel.phone && $scope.wizard.serviceLevelData.patientServiceLevel.phone.length > 0) {\r\n return $scope.wizard.serviceLevelData.patientServiceLevel.phone;\r\n }\r\n return angular.copy($scope.wizard.serviceLevelData.patient.Phone1);\r\n }\r\n\r\n function getPin() {\r\n if ($scope.wizard.serviceLevelData.patientServiceLevel.pin && $scope.wizard.serviceLevelData.patientServiceLevel.pin.length > 0) {\r\n return angular.copy($scope.wizard.serviceLevelData.patientServiceLevel.pin);\r\n } else {\r\n return ServiceLevelWizardService.generatePIN($scope.wizard.configurations, false);\r\n }\r\n }\r\n\r\n function getEmail() {\r\n if ($scope.wizard.serviceLevelData.patientServiceLevel.email && $scope.wizard.serviceLevelData.patientServiceLevel.email.length > 0) {\r\n return $scope.wizard.serviceLevelData.patientServiceLevel.email;\r\n } else if($scope.wizard.serviceLevelData.patientServiceLevel.patient) {\r\n return angular.copy($scope.wizard.serviceLevelData.patientServiceLevel.patient.EmailId1);\r\n }\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: \"E\",\r\n require: \"^form\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/byod/servicelevel-byod.tpl.html\",\r\n scope: {\r\n wizard: \"=\",\r\n wizardForm: \"=\"\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelByod\", ServiceLevelByodDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/byod/servicelevel-byod.tpl.html',\n '
          Phone Number is required
          Phone Number is invalid
          {{wizard.webFormFields.Email.FieldLabel}} is required
          Phone Number or {{wizard.webFormFields.Email.FieldLabel}} is required
          {{wizard.webFormFields.Email.FieldLabel}} is invalid
          {{wizard.webFormFields.DOB.FieldLabel}} is required
          {{wizard.webFormFields.DOB.FieldLabel}} is invalid
          Invitation Message Date
          ');\n}]);\n}(window, document, window.angular));","function confirmationController($scope,lodash){\r\n $scope.wizard.fromConfirmation = true;\r\n $scope.patient = $scope.wizard.serviceLevelData.patient;\r\n $scope.shippedDevices = $scope.wizard.devices.filter(function(device){\r\n return device.DeliveryOptionId == 1 && device.Active;\r\n });\r\n $scope.handDeliveredDevices = $scope.wizard.devices.filter(function(device){\r\n return device.DeliveryOptionId == 2 && device.Active;\r\n });\r\n\r\n $scope.typeIcons = {\r\n \"1\": \"vh-ui-glyph-item-weight\",\r\n \"2\": \"vh-ui-glyph-item-bp\",\r\n \"3\": \"vh-ui-glyph-item-o2\",\r\n \"8\": \"vh-ui-glyph-item-glucose\",\r\n \"13\": \"vh-ui-glyph-item-temp\",\r\n \"35\": \"vh-ui-glyph-item-ekg\",\r\n \"58\": \"vh-ui-glyph-item-spyro\",\r\n \"64\": \"vh-ui-glyph-item-pedo\",\r\n \"66\": \"vh-ui-glyph-item-inhaler\",\r\n \"67\": \"vh-ui-glyph-item-inhaler-rescue\",\r\n \"68\": \"vh-ui-glyph-item-sleep\"\r\n };\r\n\r\n $scope.getTypeIcon = function(id){\r\n return $scope.typeIcons[id];\r\n }\r\n}\r\n//vh-ui-glyph vh-ui-glyph-item-weight vh-ui-glyph-4x\r\nfunction ServicelevelGoConfirmation(){\r\n\r\n \r\n return {\r\n controller: confirmationController,\r\n restrict: \"E\",\r\n require: \"^form\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/go/servicelevel-go-confirmation.tpl.html\",\r\n scope: {\r\n wizard: \"=\",\r\n wizardForm: \"=\"\r\n }\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelGoConfirmation\", ServicelevelGoConfirmation);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/go/servicelevel-go-confirmation.tpl.html',\n '
          0\">
          0\">
          {{device.DeviceName}}
          {{wizard.goDeviceShippingInfo.AddressLine1}}
          {{wizard.goDeviceShippingInfo.AddressLine2}}
          {{wizard.goDeviceShippingInfo.City}}, {{wizard.goDeviceShippingInfo.State}} {{wizard.goDeviceShippingInfo.ZipCode}}
          Tel: {{wizard.goDeviceShippingInfo.Phone}}
          Tel2: {{wizard.goDeviceShippingInfo.Phone2}}
          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelGoDevices() {\r\n function controller($scope, GoDevicesService, lodash) {\r\n \r\n $scope.showOk = false;\r\n $scope.IsEditMode = $scope.wizard.serviceLevelData.patientServiceLevel.id != 0;\r\n \r\n\r\n if($scope.IsEditMode){\r\n $scope.wizard.devices.map(function(device){\r\n device.Active = false;\r\n })\r\n }\r\n\r\n $scope.typeIcons = {\r\n \"1\": \"vh-ui-glyph-item-weight\",\r\n \"2\": \"vh-ui-glyph-item-bp\",\r\n \"3\": \"vh-ui-glyph-item-o2\",\r\n \"8\": \"vh-ui-glyph-item-glucose\",\r\n \"13\": \"vh-ui-glyph-item-temp\",\r\n \"35\": \"vh-ui-glyph-item-ekg\",\r\n \"58\": \"vh-ui-glyph-item-spyro\",\r\n \"64\": \"vh-ui-glyph-item-pedo\",\r\n \"66\": \"vh-ui-glyph-item-inhaler\",\r\n \"67\": \"vh-ui-glyph-item-inhaler-rescue\",\r\n \"68\": \"vh-ui-glyph-item-sleep\"\r\n };\r\n $scope.getTypeIcon = function (id) {\r\n return $scope.typeIcons[id];\r\n }\r\n\r\n $scope.toggleDevice = function (device) {\r\n device.Active = !device.Active;\r\n if (device.DeliveryOptions.length > 1) {\r\n device.DeliveryOptionId = null;\r\n }\r\n $scope.checkForActive();\r\n };\r\n\r\n // $scope.PatientAlreadyHas = function(device){\r\n // if($scope.IsEditMode){\r\n // var results = $scope.wizard.patientDevices.filter(function(dev){\r\n // return dev.DeviceModelId == device.DeviceModelId;\r\n // });\r\n \r\n // return results.length==0;\r\n // }else{\r\n // return true;\r\n // }\r\n \r\n // }\r\n\r\n $scope.toggleDeliveryMethod = function (device, optionId) {\r\n device.DeliveryOptionId = optionId;\r\n };\r\n\r\n $scope.checkForActive = function(){\r\n var active = false;\r\n $scope.wizard.devices.map(function(device){\r\n if(device.Active){\r\n active = true;\r\n }\r\n });\r\n if(!active){\r\n $scope.wizard.showOk = true;\r\n $scope.wizard.showNext = false;\r\n if ($scope.IsEditMode){\r\n $scope.wizard.enableNext = false;\r\n }\r\n }else{\r\n $scope.wizard.showOk = false;\r\n $scope.wizard.showNext = true;\r\n $scope.wizard.enableNext = true;\r\n }\r\n }\r\n\r\n $scope.checkForActive();\r\n }\r\n\r\n\r\n\r\n\r\n return {\r\n controller: controller,\r\n restrict: \"E\",\r\n require: \"^form\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/go/servicelevel-go-devices.tpl.html\",\r\n scope: {\r\n wizard: \"=\",\r\n wizardForm: \"=\"\r\n }\r\n };\r\n}\r\n\r\n//TODO: add service\r\n\r\n\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelGoDevices\", ServiceLevelGoDevices);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/go/servicelevel-go-devices.tpl.html',\n '

          Current Patient Devices

          • {{device.DeviceModel.DeviceName}}

          Assigned Devices

          {{device.DeviceName}}

          * No active devices *

          Available Devices

          * No available devices *

          {{device.DeviceName}}
          ');\n}]);\n}(window, document, window.angular));","\r\nfunction shippingController($scope,lodash){\r\n $scope.webFormFields = $scope.wizard.webFormFields;\r\n \r\n $scope.IsRequired = false;\r\n if(!$scope.wizard.goDeviceShippingInfo){\r\n var patient = $scope.wizard.serviceLevelData.patient;\r\n $scope.wizard.goDeviceShippingInfo = {\r\n AddressLine1: patient.Address1,\r\n AddressLine2: patient.Address2,\r\n City: patient.City,\r\n State: patient.State,\r\n ZipCode: patient.ZipCode,\r\n Phone: patient.Phone1,\r\n Phone2: patient.Phone2\r\n };\r\n }\r\n\r\n $scope.nonPoBoxPattern = (function () {\r\n var regexp = /^ *((#\\d+)|(box[-. \\/\\\\]?\\d+)|(.*p[ \\.]? ?(o|0)[-. \\/\\\\]? *-?(box|(#|num)?\\d+))|(p(ost)? *(o(ff(ice)?)?)? *(box|b)? *\\d+)|(p *-?\\/?(o)? *-?box)|post office box|(p[.| ]*o[.| ]*b[.| ]*|box|b) *(number|num|#)? *\\d+|(num|number|#) *\\d+)/i;\r\n return {\r\n test: function (value) {\r\n return !regexp.test(value);\r\n }\r\n };\r\n })();\r\n\r\n //This pattern validates two-letter abbreviations for all US states and Canadian provinces\r\n $scope.statePattern = (function () {\r\n var regexp = /^(?:(A[BKLRZ]|BC|C[AOT]|D[CE]|F[L]|G[A]|H[I]|I[ADLN]|K[SY]|L[A]|M[ABDEINOST]|N[BCDEHJLMSTUVY]|O[HKNR]|P[AER]|QC|R[I]|S[CDK]|T[NX]|U[T]|V[AIT]|W[AIVY]|YT))$/i;\r\n return {\r\n test: function (value) {\r\n return regexp.test(value);\r\n }\r\n };\r\n })();\r\n\r\n //This pattern validates US ZIP Codes and Canadian Postal Codes\r\n $scope.zipPattern = (function () {\r\n var provinceExp = /^(?:AB|BC|MB|N[BLTSU]|ON|PE|QC|SK|YT)*$/i;\r\n var zipAndPostalExp = /^[0-9]{5}(?:-[0-9]{4})?$|^(?!.*[DFIOQU])[A-VXY][0-9][A-Z] [0-9][A-Z][0-9]$/i;\r\n var zipExp = /^[0-9]{5}(?:-[0-9]{4})?$/i;\r\n var postalExp = /^(?!.*[DFIOQU])[A-VXY][0-9][A-Z] [0-9][A-Z][0-9]$/i;\r\n return {\r\n test: function (value) {\r\n //If state field is blank, validate as either ZIP or postal codes\r\n if ($scope.wizard.goDeviceShippingInfo.State == \"\") {\r\n return zipAndPostalExp.test(value);\r\n }\r\n //If it's a canadian province code, validate as postal code\r\n //otherwise validate as ZIP code\r\n else if (provinceExp.test($scope.wizard.goDeviceShippingInfo.State)) {\r\n return postalExp.test(value);\r\n } else {\r\n return zipExp.test(value);\r\n }\r\n }\r\n };\r\n })();\r\n\r\n function init(){\r\n \r\n var shippedDevice = lodash.find($scope.wizard.devices, function(d) { return d.DeliveryOptionId == 1 && d.Active; });\r\n \r\n if(shippedDevice == undefined){\r\n $scope.IsRequired = false;\r\n if($scope.wizard.fromConfirmation){\r\n $scope.wizard.fromConfirmation = false;\r\n $scope.wizard.back();\r\n\r\n }else{\r\n $scope.wizard.next();\r\n }\r\n \r\n }else{\r\n $scope.IsRequired = true;\r\n }\r\n \r\n }\r\n \r\n init();\r\n}\r\n\r\nfunction ServicelevelGoShipping(){\r\n\r\n return {\r\n controller: shippingController,\r\n restrict: \"E\",\r\n require: \"^form\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/go/servicelevel-go-shipping.tpl.html\",\r\n scope: {\r\n wizard: \"=\",\r\n wizardForm: \"=\"\r\n }\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelGoShipping\", ServicelevelGoShipping);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/go/servicelevel-go-shipping.tpl.html',\n '
          {{webFormFields.Address1.FieldLabel}} is required
          PO Box is not allowed
          PO Box is not allowed
          {{webFormFields.City.FieldLabel}} is required
          {{webFormFields.State.FieldLabel}} is required
          {{webFormFields.State.FieldLabel}} is invalid
          {{webFormFields.ZipCode.FieldLabel}} is required
          {{webFormFields.ZipCode.FieldLabel}} is invalid
          {{webFormFields.Phone1.FieldLabel}} is required
          {{webFormFields.Phone1.FieldLabel}} is invalid
          {{webFormFields.Phone2.FieldLabel}} is required
          {{webFormFields.Phone2.FieldLabel}} is invalid
          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelIvrDirective() {\r\n function controller($scope, ServiceLevelWizardService, ServiceLevelType) {\r\n $scope.serviceLevelType = ServiceLevelType;\r\n $scope.ivrPhoneNumber = $scope.wizard.configurations.IvrPhoneNumber;\r\n\r\n $scope.ivrWelcomeDateOptions = [\r\n {id: 1, label: 'Today'},\r\n {id: 2, label: 'Tomorrow'},\r\n {id: 3, label: 'Day After Tomorrow'}\r\n ];\r\n\r\n $scope.ivrDateChange = function () {\r\n $scope.wizard.serviceLevelData.patientServiceLevel.welcomeDate = $scope.ivrWelcomeDate.label;\r\n };\r\n\r\n $scope.ivrWelcomeTimeOptions = [\r\n {id: 1, label: 'Morning'},\r\n {id: 2, label: 'Afternoon'},\r\n {id: 3, label: 'Evening'}\r\n ];\r\n\r\n $scope.ivrTimeChange = function () {\r\n $scope.wizard.serviceLevelData.patientServiceLevel.welcomeTime = $scope.ivrWelcomeTime.label;\r\n };\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.ivrWelcomeDateOptions.forEach(function(option) {\r\n if(option.label === $scope.wizard.configurations.IvrWelcomeCallDate) {\r\n $scope.ivrWelcomeDate = option;\r\n $scope.wizard.serviceLevelData.patientServiceLevel.welcomeDate = option.label;\r\n }\r\n });\r\n\r\n $scope.ivrWelcomeTimeOptions.forEach(function (option) {\r\n if (option.label === $scope.wizard.configurations.IvrWelcomeCallTime) {\r\n $scope.ivrWelcomeTime = option;\r\n $scope.wizard.serviceLevelData.patientServiceLevel.welcomeTime = option.label;\r\n }\r\n });\r\n\r\n $scope.wizard.serviceLevelData.patientServiceLevel.phone = getPhoneNumber();\r\n $scope.wizard.serviceLevelData.patientServiceLevel.ivrPin = getPin();\r\n }\r\n\r\n function getPhoneNumber() {\r\n if($scope.wizard.serviceLevelData.patientServiceLevel.phone && $scope.wizard.serviceLevelData.patientServiceLevel.phone.length > 0) {\r\n return $scope.wizard.serviceLevelData.patientServiceLevel.phone;\r\n }\r\n return angular.copy($scope.wizard.serviceLevelData.patient.Phone1);\r\n }\r\n\r\n function getPin() {\r\n if($scope.wizard.serviceLevelData.patientServiceLevel.pin && $scope.wizard.serviceLevelData.patientServiceLevel.pin.length > 0) {\r\n return angular.copy($scope.wizard.serviceLevelData.patientServiceLevel.pin);\r\n } else {\r\n return ServiceLevelWizardService.generatePIN($scope.wizard.configurations, false);\r\n }\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/ivr/servicelevel-ivr.tpl.html\",\r\n scope: {\r\n wizard: '=',\r\n wizardForm: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelIvr\", ServiceLevelIvrDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/ivr/servicelevel-ivr.tpl.html',\n '
          Phone Number is required
          Phone Number is invalid
          Invitation Message Date
          ');\n}]);\n}(window, document, window.angular));","function PatientServiceLevelService($http, $q, $filter, lodash, ConfigurationsService, DemographicsService, ServiceLevelType) {\r\n\r\n function getServiceLevels(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/serviceLevels').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getServiceLevel(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/serviceLevel').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getServiceLevelKitInfo() {\r\n return $http.get('/api/PatientServiceLevel/getServiceLevelKitInformation').then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientKit(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/kit').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientKitCommon(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/kitCommon').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getAvailableKits(hospitalId,kitTypeId) {\r\n return $http.get('/api/Kit/available/' + hospitalId, {params:{kitTypeId:kitTypeId}}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getAvailableKitTypes() {\r\n return $http.get('/api/KitTypes/').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getIvrConfiguration() {\r\n return ConfigurationsService.getConfig().then(function (config) {\r\n return {\r\n phoneNumber: config.IvrPhoneNumber,\r\n defaultDate: config.IvrWelcomeCallDate,\r\n defaultTime: config.IvrWelcomeCallTime\r\n };\r\n });\r\n }\r\n\r\n function getIsEmaEnabled() {\r\n return ConfigurationsService.getConfig().then(function (config) {\r\n return config.isEmaEnabled;\r\n });\r\n }\r\n\r\n function getLogisticsConfiguration() {\r\n return ConfigurationsService.getConfig().then(function(config){\r\n return {\r\n isShippingEnabled: config.KitLogisticsLevel === 'ShipOnly' || config.KitLogisticsLevel === 'Full',\r\n isPickupEnabled: config.KitLogisticsLevel === 'PickUpOnly' || config.KitLogisticsLevel === 'Full'\r\n };\r\n });\r\n }\r\n\r\n function getLatestGoDeviceOrderStatus(patientId) {\r\n return $http.get('/api/cgp/logistics/patient/' + patientId + '/LatestOrderStatus').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getKitAttributes(kitPoolId, kitTypeId) {\r\n var data = {\r\n KitPoolId: kitPoolId,\r\n KitTypeId: kitTypeId\r\n };\r\n\r\n return $http.post('/api/patientServiceLevel/getServiceLevelKitAttributes', data).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateTaskOrders(patientServiceLevel, taskOrders) {\r\n var validModels = lodash.filter(taskOrders, function(taskOrder){\r\n return taskOrder.number && taskOrder.number.length > 0 && (taskOrder.deleted === true || taskOrder.modified === true && !(taskOrder.deleted === true && taskOrder.modified === true));\r\n });\r\n\r\n var models = lodash.map(validModels, function(model){\r\n return {\r\n TaskOrderId: model.id,\r\n PatientServiceLevelId: patientServiceLevel.id,\r\n TaskOrderNumber: model.number\r\n }\r\n });\r\n\r\n return $http.post('/api/Patient/' + patientServiceLevel.patientId + '/serviceLevel/taskOrders', models).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n var kitStatuses = [\r\n 'Available',\r\n 'In Use',\r\n 'Dirty',\r\n 'Broken',\r\n 'Shipped',\r\n 'Reprocessing',\r\n 'Provisioning',\r\n 'Ordered',\r\n 'In Progress'\r\n ];\r\n\r\n var kitDevices = [\r\n {DeviceTypeId: 1, id: 1, name: 'Wt'},\r\n {DeviceTypeId: 2, id: 2, name: 'BP'},\r\n {DeviceTypeId: 3, id: 3, name: 'SpO2'},\r\n {DeviceTypeId: 8, id: 8, name: 'BS'},\r\n {DeviceTypeId: 13, id: 13, name: 'Temp'},\r\n {DeviceTypeId: 15, id: 15, name: 'Spiro'},\r\n {DeviceTypeId: 16, id: 16, name: 'Steps'}\r\n ];\r\n\r\n function getKitNo(kit) {\r\n var retVal = kit.KitNo;\r\n return retVal;\r\n }\r\n\r\n function getKitStatus(kit) {\r\n var statusId = kit.KitStatus.KitStatusId;\r\n if (statusId <= 0) {\r\n return '';\r\n }\r\n\r\n return kitStatuses[statusId - 1];\r\n }\r\n\r\n function getKitStatusDate(kit) {\r\n var date = new Date(Date.parse(kit.KitStatus.CreatedDateTime_UTC));\r\n if (date) {\r\n var day = $filter('date')(date, \"MM/dd/yyyy\");\r\n var time = $filter('date')(date, \"HH:mm\");\r\n return day + ' ' + time;\r\n }\r\n\r\n return '';\r\n }\r\n\r\n function mapDevices(kit) {\r\n var devices = [];\r\n\r\n kit.Devices.forEach(function (device) {\r\n var kitDevice = getDevice(device.DeviceTypeId);\r\n if (kitDevice) {\r\n devices.push(kitDevice.id);\r\n }\r\n });\r\n\r\n return devices;\r\n }\r\n\r\n function getDevice(id) {\r\n var retVal = undefined;\r\n kitDevices.forEach(function (device) {\r\n if (device.id === id) {\r\n retVal = device;\r\n }\r\n });\r\n\r\n return retVal;\r\n }\r\n\r\n function hasKitDevice(kit, id) {\r\n var retVal = false;\r\n if (kit.devices) {\r\n kit.devices.forEach(function (device) {\r\n if (device === id) {\r\n retVal = true;\r\n }\r\n });\r\n }\r\n return retVal;\r\n }\r\n\r\n function getEducationMaterials(){\r\n return $http({\r\n url: '/api/EducationalMaterial',\r\n metod: 'GET'\r\n });\r\n }\r\n function MapConfiguration(configurationRanking) {\r\n return configurationRanking;\r\n }\r\n function mapKit(kit) {\r\n if (!angular.isObject(kit)) return undefined;\r\n\r\n var kitModel = {\r\n id: kit.Id,\r\n kitNo: getKitNo(kit),\r\n status: getKitStatus(kit),\r\n statusDate: getKitStatusDate(kit),\r\n devices: mapDevices(kit)\r\n };\r\n\r\n kitModel.hasWt = hasKitDevice(kitModel, kitDevices[0].id);\r\n kitModel.hasBP = hasKitDevice(kitModel, kitDevices[1].id);\r\n kitModel.hasSpO2 = hasKitDevice(kitModel, kitDevices[2].id);\r\n kitModel.hasBS = hasKitDevice(kitModel, kitDevices[3].id);\r\n kitModel.hasTemp = hasKitDevice(kitModel, kitDevices[4].id);\r\n kitModel.hasSpiro = hasKitDevice(kitModel, kitDevices[5].id);\r\n kitModel.hasPedo = hasKitDevice(kitModel, kitDevices[6].id);\r\n kitModel.isTabletOnly = !kitModel.devices || kitModel.devices.length == 0;\r\n kitModel.details = kit.Details;\r\n kitModel.kitPoolId = kit.KitPoolId;\r\n kitModel.kitTypeId = kit.KitTypeId;\r\n kitModel.kitCuffAttributeId = kit.KitCuffAttributeId;\r\n kitModel.kitScaleAttributeId = kit.KitScaleAttributeId;\r\n kitModel.hasPendingShipOrder = kit.HasPendingShipOrder;\r\n if (kit.Details.indexOf(\"~\") >= 0)\r\n {\r\n kitModel.details = kit.DisplayDetails;\r\n }\r\n\r\n kitModel.displayDetails = kit.DisplayDetails;\r\n kitModel.displayKitNo = kitModel.kitNo;\r\n if ( kit.DisplayDetails.length > 0 ){\r\n kitModel.displayKitNo += ' (' + kit.DisplayDetails + ')';\r\n }\r\n\r\n return kitModel;\r\n }\r\n\r\n function mapTaskOrder(taskOrder) {\r\n return {\r\n id: taskOrder.TaskOrderId,\r\n number: taskOrder.TaskOrderNumber,\r\n deleted: taskOrder.DeletedDateTime_UTC !== null,\r\n modified: false\r\n };\r\n }\r\n\r\n async function getPatientConfigurationRanking(patientServiceLevel) {\r\n\r\n var sl = patientServiceLevel && patientServiceLevel.ServiceLevel ? patientServiceLevel.ServiceLevel : null;\r\n if (!sl || (sl.ServiceLevelTypeId !== ServiceLevelType.Go && patientServiceLevel.ServiceLevel.ServiceLevelTypeId !== ServiceLevelType.RPMVideo))\r\n return;\r\n\r\n var retVal = null;\r\n\r\n if (patientServiceLevel) {\r\n const patientConfigurationRankings = await ConfigurationsService.getConfigRankings(patientServiceLevel.PatientId);\r\n var filter = sl.ServiceLevelTypeId == ServiceLevelType.Go ? patientConfigurationRankings.filter(a => a.isSelected && a.ConfigService == 0) : patientConfigurationRankings.filter(a => a.isSelected && a.ConfigService == 1);\r\n retVal = (filter) ? filter[0] : null;\r\n }\r\n\r\n if (!retVal){\r\n retVal = { ConfigurationName: 'Default Settings' }\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function getPatientConfigurationCategory(patientServiceLevel) {\r\n if (patientServiceLevel && patientServiceLevel.ServiceLevel){\r\n var serviceLevelTypeId = patientServiceLevel.ServiceLevel.ServiceLevelTypeId;\r\n switch (serviceLevelTypeId) {\r\n case ServiceLevelType.RPMVideo: \r\n case ServiceLevelType.Go: \r\n return 'Patient Experience: ';\r\n default: \r\n return '';\r\n }\r\n }\r\n }\r\n\r\n function mapPatientServiceLevel(patientId, patientServiceLevel, isNew) {\r\n return {\r\n id: isNew ? 0 : patientServiceLevel.PatientServiceLevelId,\r\n patientId: isNew ? patientId : patientServiceLevel.PatientId,\r\n patient: isNew ? null : patientServiceLevel.Patient,\r\n serviceLevelId: isNew ? 0 : patientServiceLevel.ServiceLevelId,\r\n serviceLevelTypeId: isNew || !patientServiceLevel.ServiceLevel ? 0 : patientServiceLevel.ServiceLevel.ServiceLevelTypeId,\r\n kitId: isNew ? null : patientServiceLevel.KitId,\r\n kitNo: isNew ? '' : patientServiceLevel.KitNo,\r\n phone: isNew ? '' : patientServiceLevel.PhoneNum,\r\n email: isNew ? '' : patientServiceLevel.email,\r\n pin: isNew ? '' : patientServiceLevel.PIN,\r\n welcomeDate: '',\r\n welcomeTime: '',\r\n name: isNew ? '' : patientServiceLevel.DisplayText,\r\n serviceLevelType: isNew ? null : patientServiceLevel.ServiceLevelType_Enum,\r\n taskOrders: isNew || !patientServiceLevel.TaskOrders ? [] : patientServiceLevel.TaskOrders.map(mapTaskOrder),\r\n configurationRankingId : isNew ? null : patientServiceLevel.ConfigurationRankingId,\r\n configurationRanking: null ,\r\n configurationCategory: isNew ? null : getPatientConfigurationCategory(patientServiceLevel),\r\n isEulaAccepted: isNew ? false : patientServiceLevel.EulaAcceptedDateTime_UTC != null,\r\n invitation: isNew || !patientServiceLevel.Invitations ? null : patientServiceLevel.Invitations[0]\r\n };\r\n }\r\n\r\n async function getPatientServiceLevelWithKitInfo(patientId) {\r\n let patientServiceLevel = await getServiceLevel(patientId);\r\n var isNewPatientServiceLevel = !patientServiceLevel || patientServiceLevel === null;\r\n let response = mapPatientServiceLevel(patientId, patientServiceLevel, isNewPatientServiceLevel);\r\n\r\n if (isNewPatientServiceLevel) {\r\n return response;\r\n }\r\n response.configurationRanking =isNewPatientServiceLevel?null:MapConfiguration(await getPatientConfigurationRanking(patientServiceLevel))\r\n \r\n if (patientServiceLevel.ServiceLevel.ServiceLevelTypeId == ServiceLevelType.RPM ||\r\n patientServiceLevel.ServiceLevel.ServiceLevelTypeId == ServiceLevelType.RPMVideo) {\r\n let kitCommon = await getPatientKitCommon(patientId);\r\n response.selectedBPCuffSizeName = kitCommon !== null && kitCommon.SelectedBPCuffSizeName !== null ? kitCommon.SelectedBPCuffSizeName : null;\r\n response.selectedScaleTypeName = kitCommon !== null && kitCommon.SelectedScaleTypeName !== null ? kitCommon.SelectedScaleTypeName : null;\r\n response.kitShippingStatusId = kitCommon && kitCommon.KitShippingStatusId ? kitCommon.KitShippingStatusId : null;\r\n if(kitCommon && kitCommon.KitTypeId){\r\n Object.assign(response, {\r\n kitType: {\r\n Id: kitCommon.KitTypeId,\r\n Name: kitCommon.KitTypeName,\r\n Description: kitCommon.KitTypeDesc\r\n }\r\n });\r\n }\r\n if(kitCommon && kitCommon.KitPoolId){\r\n Object.assign(response, {\r\n kitPool: {\r\n Id: kitCommon.KitPoolId,\r\n Name: kitCommon.KitPoolName\r\n }\r\n });\r\n }\r\n }\r\n\r\n if (patientServiceLevel.KitId > 0) {\r\n response.kit = mapKit(await getPatientKit(patientId));\r\n let attr = await getKitAttributes(response.kit.kitPoolId, response.kit.kitTypeId);\r\n attr.kitCuffs = lodash.sortBy(attr.KitCuffAttributes, 'SortOrder');\r\n attr.kitScales = lodash.sortBy(attr.KitScaleAttributes, 'SortOrder');\r\n const kitScale = lodash.find(attr.kitScales, {'AttributeId': response.kit.kitScaleAttributeId});\r\n const kitCuff = lodash.find(attr.kitCuffs, {'AttributeId': response.kit.kitCuffAttributeId});\r\n response.kit.kitScale = kitScale.Value;\r\n response.kit.kitCuff = kitCuff.Value;\r\n response.kitShippingStatusId = await DemographicsService.getPatientKitShippingStatus(patientId); \r\n } else if (patientServiceLevel.ServiceLevel.ServiceLevelTypeId == ServiceLevelType.Go) {\r\n\r\n let status = await getLatestGoDeviceOrderStatus(patientId);\r\n if (status && status !== null) {\r\n response.goDeviceOrderStatus = {\r\n statusId: status.LogisticsStatusId,\r\n statusDate: status.CreatedDateTime_UTC,\r\n status: status.LogisticsStatusName === 'Delivered to Patient' ? 'Delivered' : status.LogisticsStatusName\r\n };\r\n }\r\n\r\n }\r\n\r\n return response;\r\n }\r\n\r\n\r\n return {\r\n getServiceLevels: getServiceLevels,\r\n getAvailableKits: getAvailableKits,\r\n getEducationMaterials: getEducationMaterials,\r\n getAvailableKitTypes: getAvailableKitTypes,\r\n getPatientKit: getPatientKit,\r\n getPatientKitCommon: getPatientKitCommon,\r\n getServiceLevel: getServiceLevel,\r\n getServiceLevelKitInfo: getServiceLevelKitInfo,\r\n getIvrConfiguration: getIvrConfiguration,\r\n getIsEmaEnabled: getIsEmaEnabled,\r\n getLogisticsConfiguration: getLogisticsConfiguration,\r\n updateTaskOrders: updateTaskOrders,\r\n kitStatuses: kitStatuses,\r\n kitDevices: kitDevices,\r\n getKitNo: getKitNo,\r\n getKitStatus: getKitStatus,\r\n getKitStatusDate: getKitStatusDate,\r\n mapDevices: mapDevices,\r\n getDevice: getDevice,\r\n mapKit: mapKit,\r\n mapPatientServiceLevel: mapPatientServiceLevel,\r\n getLatestGoDeviceOrderStatus: getLatestGoDeviceOrderStatus,\r\n getPatientServiceLevelWithKitInfo: getPatientServiceLevelWithKitInfo,\r\n getKitAttributes: getKitAttributes\r\n }\r\n}\r\n\r\nangular.module(\"patient.demographics\").service(\"PatientServiceLevelService\", PatientServiceLevelService);\r\n","function ServiceLevelRpmKitDirective($document, lodash) {\r\n\r\n function link(scope, elem, attrs, ctrl) {\r\n var manager = ctrl;\r\n\r\n scope.manager = manager;\r\n scope.displayOnly = false;\r\n\r\n scope.selectKit = function (kit) {\r\n manager.setKit(kit);\r\n };\r\n\r\n scope.kitDevices = scope.wizard.kitDevices;\r\n scope.orgkitDevices = angular.copy(scope.wizard.kitDevices);\r\n\r\n scope.getKit = function () {\r\n if(!manager.kitNumber || manager.kitNumber.length === 0) {\r\n scope.getKits(false);\r\n return;\r\n }\r\n\r\n manager.getKit(function (data) {\r\n manager.kitInfo.selectedKit = undefined;\r\n showTopKit();\r\n scope.wizardForm.selectKitNumber.$setValidity('unavailable', data.Kits.length > 0);\r\n });\r\n };\r\n\r\n scope.getKits = function (append) {\r\n manager.getKits(function (data) {\r\n scope.wizardForm.selectKitNumber.$setValidity('unavailable', data.Kits.length > 0);\r\n\r\n if (!append) {\r\n showTopKit();\r\n }\r\n }, append);\r\n };\r\n\r\n scope.toggleState = function (biometric) {\r\n biometric.selectedState = biometric.selectedState === 1 ? 0 : biometric.selectedState === 0 ? -1 : 1;\r\n scope.getKits(false);\r\n };\r\n\r\n scope.loadNextPage = function () {\r\n manager.page++;\r\n scope.getKits(true);\r\n };\r\n\r\n scope.filterBiometricFilters = function (biometric) {\r\n var found = lodash.find(scope.orgkitDevices, { DeviceTypeId: biometric.DeviceTypeId});\r\n var isFilter = found !== undefined ? found.isFilter : false;\r\n return biometric.id !== 1 && biometric.id !== 2 && isFilter === true;\r\n };\r\n\r\n scope.getDeviceName = manager.getDeviceName;\r\n scope.getDevices = manager.getDevices;\r\n scope.getDeviceList = manager.getDeviceList;\r\n\r\n init();\r\n\r\n function init() {\r\n manager.initStep(false, manager.kitInfo.selectedKit !== undefined, manual, select);\r\n }\r\n\r\n function manual() {\r\n scope.displayOnly = true;\r\n scope.selectKit(manager.kitInfo.manualKit);\r\n }\r\n\r\n function select(isSelected) {\r\n }\r\n\r\n function showTopKit() {\r\n var ele = $document[0].getElementById('kitListContainer');\r\n ele.scrollTop = 0;\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kit.tpl.html\",\r\n require: \"^servicelevelRpmManager\",\r\n scope: {\r\n wizardForm: \"=\",\r\n wizard: \"=\"\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelRpmKit\", ServiceLevelRpmKitDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kit.tpl.html',\n '
          {{kit.KitNo}}
          {{getDeviceList(kit)}}
          Load more kits...
          No kits to display.

          {{manager.kitInfo.selectedKit.KitNo}}


          {{getDeviceName(device)}} Tablet Only
          Last Used:
          {{manager.kitInfo.selectedKit.KitStatus.CreatedDateTime_UTC | datetime}}
          Location:
          {{manager.kitInfo.selectedKit && manager.kitInfo.selectedKit.CurrentLocationName}}

          Select a Kit

          {{manager.defaultKitSelectionHelpText}}

          ');\n}]);\n}(window, document, window.angular));","function servicelevelRpmKitPickup() {\r\n\r\n function controller ($scope) {\r\n var patient = $scope.wizard.serviceLevelData.patient,\r\n configurations = $scope.wizard.configurations;\r\n\r\n $scope.webFormFields = $scope.wizard.webFormFields;\r\n\r\n $scope.serviceLevelLogisticsType = 'Pickup';\r\n $scope.kitPickUpdateFilter = configurations[\"KitPickUpdateFilter\"];\r\n $scope.numberofDays = $scope.kitPickUpdateFilter - 1;\r\n $scope.callTimeOptions = [{\"value\": \"\", \"text\":\"\"},{ \"value\": \"AM\", \"text\": \"AM\" }, { \"value\": \"PM\", \"text\": \"PM\" }];\r\n $scope.wizard.serviceLevelData.logisticsInfo = $scope.wizard.serviceLevelData.logisticsInfo || {\r\n AddressLine1: patient.Address1,\r\n AddressLine2: patient.Address2,\r\n City: patient.City,\r\n State: patient.State,\r\n ZipCode: patient.ZipCode,\r\n Phone: patient.Phone1,\r\n Phone2: patient.Phone2,\r\n PickupDate: getNextBusinessDay($scope.kitPickUpdateFilter),\r\n PickupTime: 'AM',\r\n DeletedDateTime_UTC: null,\r\n DeletedBy_Id: null,\r\n IsPickup: true,\r\n kitId: $scope.wizard.serviceLevelData.patientServiceLevel.kitId,\r\n kitNo: $scope.wizard.serviceLevelData.patientServiceLevel.KitNo,\r\n kit: $scope.wizard.serviceLevelData.patientServiceLevel.kit,\r\n PatientId: patient.Id,\r\n serviceLevelLogisticsType: $scope.serviceLevelLogisticsType,\r\n KitPickupOptionId: null,\r\n IsCustomer: false\r\n //selectedLanguage: $scope.selectedLanguage !== undefined ? $scope.selectedLanguage : $scope.availableLanguages[0],\r\n //InstallMethod: defaultInstallMethod !== undefined ? defaultInstallMethod : $scope.installMethods[0],\r\n //InstallMethodId: defaultInstallMethod !== undefined ? defaultInstallMethod.InstallMethodId : $scope.installMethods[0].InstallMethodId,\r\n //availableEducationMaterials: $scope.wizard.availableEducationMaterials\r\n };\r\n\r\n $scope.wizard.serviceLevelData.logisticsInfo.KitPickupOptionId = $scope.wizard.serviceLevelData.selectedKitPickupOption.KitPickupOptionId;\r\n $scope.wizard.serviceLevelData.logisticsInfo.IsCustomer = $scope.wizard.serviceLevelData.selectedKitPickupOption.IsCustomer;\r\n\r\n $scope.datepickerOptionsPickup = {\r\n dateDisabled: disabledDate,\r\n minDate: getNextBusinessDay($scope.kitPickUpdateFilter)\r\n };\r\n\r\n $scope.datepickerOptionsWelcomeCall = {\r\n dateDisabled: disabledDate,\r\n minDate: getNextBusinessDay($scope.welcomeCallDays)\r\n };\r\n\r\n function disabledDate(o) {\r\n var today = new Date();\r\n var day = o.date.getDay();\r\n var tempDate = new Date(o.date);\r\n var odate = o.date;\r\n odate.setHours(0, 0, 0, 0);\r\n\r\n if (odate < today) {\r\n return false;\r\n }\r\n if (day === 0 || day === 6) {\r\n return true;\r\n } else { return false; }\r\n }\r\n\r\n function isNewServiceLevel() {\r\n return $scope.wizard.serviceLevelData.originalServiceLevel.ServiceLevelId !== $scope.wizard.serviceLevelData.serviceLevel.ServiceLevelId;\r\n }\r\n\r\n function isKitShipping() {\r\n return isNewServiceLevel() && $scope.wizard.serviceLevelData.serviceLevel.TabletRequired && !$scope.wizard.serviceLevelData.originalServiceLevel.TabletRequired;\r\n }\r\n\r\n function isKitPickup() {\r\n return isNewServiceLevel() && $scope.wizard.serviceLevelData.originalServiceLevel.TabletRequired && !$scope.wizard.serviceLevelData.serviceLevel.TabletRequired;\r\n }\r\n\r\n function getNextBusinessDay(OffSet) {\r\n\r\n //Date isn't today\r\n\r\n /* Here add a function that calculates the next buisness day bassed off\r\n of the global config ***************************************************/\r\n var date = new Date();\r\n\r\n date.setHours(0, 0, 0, 0);\r\n\r\n if (OffSet) {\r\n\r\n var numberofDays = OffSet;\r\n while (numberofDays > 0) {\r\n var day = date.getDay();\r\n if (day !== 0 && day !== 6) {\r\n --numberofDays;\r\n }\r\n date.setDate(date.getDate() + 1);\r\n }\r\n // If the date lands on a weekend go to monday\r\n if (date.getDay() === 0) {\r\n date.setDate(date.getDate() + 1);\r\n } else if (date.getDay() === 6) {\r\n date.setDate(date.getDate() + 2);\r\n }\r\n }\r\n return date;\r\n\r\n }\r\n }\r\n\r\n function link(scope, elem, attrs, ctrls) {\r\n scope.manager = ctrls[0] ? ctrls[0] : ctrls[1];\r\n\r\n init();\r\n function init() {\r\n scope.manager.initStep(skip(), true, manual, select);\r\n }\r\n\r\n function skip() {\r\n var retval = scope.wizard.serviceLevelData.selectedKitPickupOption && !scope.wizard.serviceLevelData.selectedKitPickupOption.PickupFromPatient;\r\n scope.wizard.serviceLevelData.kitShippingIncluded = !retval;\r\n scope.showForm = !retval;\r\n return retval;\r\n }\r\n\r\n function manual() {\r\n \r\n }\r\n\r\n function select() {}\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n require: [\"?^servicelevelRpmManager\", \"?^monitoringStatusManager\"],\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kitshipping.tpl.html\",\r\n scope: {\r\n wizard: \"=\",\r\n wizardForm: \"=\"\r\n }\r\n };\r\n}\r\n\r\nangular.module('patient.demographics').directive('servicelevelRpmKitpickup', servicelevelRpmKitPickup);","function ServiceLevelRpmKitship(lodash) {\r\n\r\n function controller($scope) {\r\n\r\n var patient = $scope.wizard.serviceLevelData.patient,\r\n configurations = $scope.wizard.configurations;\r\n\r\n $scope.serviceLevelLogisticsType = 'Shipping';\r\n\r\n $scope.patient = patient;\r\n $scope.webFormFields = $scope.wizard.webFormFields;\r\n $scope.validateDate = validateDate;\r\n $scope.validateWelcomeCallDate = validateWelcomeCallDate;\r\n $scope.welcomeCallDays = configurations[\"WelcomeCallDays\"];\r\n $scope.kitPickUpdateFilter = configurations[\"KitPickUpdateFilter\"];\r\n $scope.enableWelcomeCall = configurations[\"EnableWelcomeCall\"];\r\n $scope.numberofDays = $scope.kitPickUpdateFilter - 1;\r\n $scope.availableLanguages = $scope.wizard.availableLanguages;\r\n $scope.availableEducationMaterials = $scope.wizard.availableEducationMaterials;\r\n $scope.defaultLanguage = lodash.find($scope.availableLanguages, { LanguageId: $scope.wizard.serviceLevelData.patient.LanguageId});\r\n $scope.callTimeOptions = [{\"value\": \"\", \"text\":\"\"},{ \"value\": \"AM\", \"text\": \"AM\" }, { \"value\": \"PM\", \"text\": \"PM\" }];\r\n $scope.installMethods = lodash.filter($scope.wizard.installMethods, { IsEnabled: true });\r\n var defaultInstallMethod = lodash.find($scope.installMethods, { IsDefault: true });\r\n\r\n $scope.wizard.serviceLevelData.logisticsInfo = $scope.wizard.serviceLevelData.logisticsInfo || {\r\n AddressLine1: patient.Address1,\r\n AddressLine2: patient.Address2,\r\n City: patient.City,\r\n State: patient.State,\r\n ZipCode: patient.ZipCode,\r\n Phone: patient.Phone1,\r\n Phone2: patient.Phone2,\r\n WelcomeCallDate: getNextBusinessDay($scope.kitPickUpdateFilter),\r\n WelcomeCallTime: 'AM',\r\n PickupTime: '',\r\n DeletedDateTime_UTC: null,\r\n DeletedBy_Id: null,\r\n IsPickup: false,\r\n PatientId: patient.Id,\r\n selectedLanguage: $scope.selectedLanguage !== undefined ? $scope.selectedLanguage : $scope.availableLanguages[0],\r\n serviceLevelLogisticsType: $scope.serviceLevelLogisticsType\r\n };\r\n\r\n $scope.wizard.serviceLevelData.logisticsInfo.kitId = $scope.wizard.kitInfo.selectedKit !== undefined ? $scope.wizard.kitInfo.selectedKit.Id : null;\r\n $scope.wizard.serviceLevelData.logisticsInfo.kitNo = $scope.wizard.kitInfo.selectedKit !== undefined ? $scope.wizard.kitInfo.selectedKit.KitNo : null;\r\n $scope.wizard.serviceLevelData.logisticsInfo.kit = $scope.wizard.kitInfo.selectedKit;\r\n $scope.wizard.serviceLevelData.logisticsInfo.kitTypeId = $scope.wizard.kitInfo.selectedKitType !== undefined ? $scope.wizard.kitInfo.selectedKitType.KitTypeId : null;\r\n $scope.wizard.serviceLevelData.logisticsInfo.kitPoolId = $scope.wizard.kitInfo.selectedKitPool !== undefined ? $scope.wizard.kitInfo.selectedKitPool.KitPoolId : null;\r\n\r\n if($scope.installMethods.length > 0) {\r\n $scope.wizard.serviceLevelData.logisticsInfo.InstallMethod = defaultInstallMethod !== undefined ? defaultInstallMethod : $scope.installMethods[0];\r\n $scope.wizard.serviceLevelData.logisticsInfo.InstallMethodId = defaultInstallMethod !== undefined ? defaultInstallMethod.Id : $scope.installMethods[0].Id;\r\n }\r\n\r\n $scope.datepickerOptionsPickup = {\r\n dateDisabled: disabledDate,\r\n minDate: getNextBusinessDay($scope.kitPickUpdateFilter)\r\n };\r\n\r\n $scope.datepickerOptionsWelcomeCall = {\r\n dateDisabled: disabledDate,\r\n minDate: getNextBusinessDay($scope.welcomeCallDays)\r\n };\r\n\r\n $scope.truncate = function(text) {\r\n var max = 25;\r\n if(text.length < max) {\r\n return text;\r\n }\r\n\r\n return text.substring(0, max) + '...';\r\n }\r\n\r\n $scope.$on('$destroy', function() {\r\n //fixes js console error with multi select\r\n delete $scope.$$watchers;\r\n });\r\n\r\n function disabledDate(o) {\r\n var today = new Date();\r\n var day = o.date.getDay();\r\n var tempDate = new Date(o.date);\r\n var odate = o.date;\r\n odate.setHours(0, 0, 0, 0);\r\n\r\n if (odate < today) {\r\n return false;\r\n }\r\n if (day === 0 || day === 6) {\r\n return true;\r\n } else { return false; }\r\n }\r\n\r\n function validateDate () {\r\n var dateField = getNextBusinessDay($scope.kitPickUpdateFilter);\r\n if ($scope.wizard.serviceLevelData.logisticsInfo.PickupDate && $scope.wizard.serviceLevelData.logisticsInfo.PickupDate < dateField) {\r\n $scope.wizardForm.PickupDate.$setValidity(\"businessDays\", false);\r\n }\r\n if (!$scope.wizard.serviceLevelData.logisticsInfo.PickupDate || $scope.wizard.serviceLevelData.logisticsInfo.PickupDate === \"\") {\r\n if ($scope.wizardForm.PickupDate) {\r\n $scope.wizardForm.PickupDate.$setValidity(\"businessDays\", false);\r\n }\r\n }\r\n };\r\n\r\n function validateWelcomeCallDate() {\r\n var dateField = getNextBusinessDay($scope.welcomeCallDays);\r\n if ($scope.wizard.serviceLevelData.logisticsInfo.WelcomeCallDate && $scope.wizard.serviceLevelData.logisticsInfo.WelcomeCallDate < dateField) {\r\n $scope.wizardForm.kitshippingForm.WelcomeCallDate.$setValidity(\"businessDays\", false);\r\n }\r\n if (!$scope.wizard.serviceLevelData.logisticsInfo.WelcomeCallDate || $scope.wizard.serviceLevelData.logisticsInfo.WelcomeCallDate === \"\") {\r\n if ($scope.wizardForm.kitshippingForm.WelcomeCallDate) {\r\n $scope.wizardForm.kitshippingForm.WelcomeCallDate.$setValidity(\"businessDays\", true);\r\n }\r\n }\r\n }\r\n\r\n function isNewServiceLevel() {\r\n return $scope.wizard.serviceLevelData.originalServiceLevel.ServiceLevelId !== $scope.wizard.serviceLevelData.serviceLevel.ServiceLevelId;\r\n }\r\n\r\n function isKitShipping() {\r\n return isNewServiceLevel() && $scope.wizard.serviceLevelData.serviceLevel.TabletRequired && !$scope.wizard.serviceLevelData.originalServiceLevel.TabletRequired;\r\n }\r\n\r\n function isKitPickup() {\r\n return isNewServiceLevel() && $scope.wizard.serviceLevelData.originalServiceLevel.TabletRequired && !$scope.wizard.serviceLevelData.servicelLevel.TabletRequired;\r\n }\r\n\r\n function getNextBusinessDay(OffSet) {\r\n\r\n //Date isn't today\r\n\r\n /* Here add a function that calculates the next buisness day bassed off\r\n of the global config ***************************************************/\r\n var date = new Date();\r\n\r\n date.setHours(0, 0, 0, 0);\r\n\r\n if (OffSet) {\r\n\r\n var numberofDays = OffSet;\r\n while (numberofDays > 0) {\r\n var day = date.getDay();\r\n if (day !== 0 && day !== 6) {\r\n --numberofDays;\r\n }\r\n date.setDate(date.getDate() + 1);\r\n }\r\n // If the date lands on a weekend go to monday\r\n if (date.getDay() === 0) {\r\n date.setDate(date.getDate() + 1);\r\n } else if (date.getDay() === 6) {\r\n date.setDate(date.getDate() + 2);\r\n }\r\n }\r\n return date;\r\n\r\n }\r\n }\r\n\r\n function link(scope, elem, attrs, ctrl) {\r\n\r\n var manager = ctrl;\r\n\r\n init();\r\n\r\n scope.setFocus = function (event) {\r\n event.preventDefault();\r\n scope.$broadcast('educationMaterials.focus');\r\n };\r\n\r\n function init() {\r\n \r\n manager.initStep(skip(), true, manual, select);\r\n\r\n if (scope.wizard.noAvailableKits) {\r\n scope.wizard.enableNext = false;\r\n }\r\n }\r\n\r\n function skip() {\r\n\r\n var retval = false;\r\n var kitPoolId = manager.kitInfo.selectedKit ? manager.kitInfo.selectedKit.KitPoolId : manager.kitInfo.selectedKitPool.KitPoolId;\r\n var selectedKitKitPool = lodash.find(manager.kitInfo.info.KitPools, { KitPoolId : kitPoolId});\r\n \r\n if(manager.kitInfo.manualKit !== undefined) {\r\n //user has the kit does not need to ship\r\n retval = true;\r\n }else if(selectedKitKitPool !== undefined) {\r\n retval = !selectedKitKitPool.DoesShipToPatient;\r\n } else {\r\n retval = !manager.kitInfo.selectedKitPool.DoesShipToPatient;\r\n }\r\n \r\n scope.wizard.serviceLevelData.kitShippingIncluded = !retval;\r\n scope.showForm = !retval;\r\n return retval;\r\n }\r\n\r\n function manual() {\r\n if(skip()) {\r\n manager.skip();\r\n }\r\n }\r\n\r\n function select() { }\r\n\r\n }\r\n\r\n return {\r\n link: link,\r\n controller: controller,\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kitshipping.tpl.html\",\r\n require: \"^servicelevelRpmManager\",\r\n scope: {\r\n wizardForm: \"=\",\r\n wizard: \"=\"\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelRpmKitship\", ServiceLevelRpmKitship);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-kitshipping.tpl.html',\n '
          {{webFormFields.Address1.FieldLabel}} is required
          Max length 30 characters
          Max length 30 characters
          {{webFormFields.City.FieldLabel}} is required
          {{webFormFields.State.FieldLabel}} is required
          {{webFormFields.ZipCode.FieldLabel}} is required
          0 && availableEducationMaterials.length > 0\">
          {{truncate($item.Name)}}{{multioption.Name}}
          {{webFormFields.Phone1.FieldLabel}} is required
          {{webFormFields.Phone1.FieldLabel}} is invalid
          {{webFormFields.Phone2.FieldLabel}} is required
          {{webFormFields.Phone2.FieldLabel}} is invalid
          0\" class=\"form-group p-b-xs m-b-xs\" ng-class=\"{ \\'has-error\\' : wizardForm.kitshippingForm.installMethod.$invalid && (wizardForm.installMethod.$dirty || wizardForm.$submitted) }\">
          Welcome Call Date must be a business day in the configured range
          Pickup Date is required
          Pickup Date must be a business day in the configured range
          = 200\">{{250 - logisticsInfo.Notes.length}} of 250 characters remaining
          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelRpmManager($timeout, lodash, ServiceLevelWizardService) {\r\n function controller($scope) {\r\n var manager = this;\r\n\r\n var wizard = $scope.slw;\r\n\r\n wizard.kitDevices = [\r\n { DeviceTypeId: 1, name: 'Wt', icon: 'vh-ui-glyph-item-weight', isFilter: false, selectedState: -1},\r\n { DeviceTypeId: 2, name: 'BP', icon: 'vh-ui-glyph-item-bp', isFilter: false, selectedState: -1},\r\n { DeviceTypeId: 3, name: 'SpO2', icon: 'vh-ui-glyph-pulseox', isFilter: false, selectedState: -1},\r\n { DeviceTypeId: 8, name: 'BS', icon: 'vh-ui-glyph-item-glucose', isFilter: false, selectedState: -1},\r\n { DeviceTypeId: 13, name: 'Temp', icon: 'vh-ui-glyph-item-temp', isFilter: false, selectedState: -1},\r\n { DeviceTypeId: 15, name: 'Spiro', icon: 'vh-ui-glyph-item-spyro', isFilter: false, selectedState: -1},\r\n { DeviceTypeId: 16, name: 'Steps', icon: 'vh-ui-glyph-item-pedo', isFilter: false, selectedState: -1}\r\n ];\r\n\r\n manager.kitInfo = wizard.kitInfo;\r\n manager.info = wizard.kitInfo.info;\r\n\r\n manager.enableKitWizardEnterKitNo = wizard.configurations.EnableKitWizardEnterKitNo;\r\n manager.defaultKitPoolHelpText = wizard.configurations.DefaultKitPoolHelpText;\r\n manager.defaultKitTypeHelpText = wizard.configurations.DefaultKitTypeHelpText;\r\n manager.defaultKitSelectionHelpText = wizard.configurations.DefaultKitSelectionHelpText;\r\n manager.limitKitOrderingWhenKitPoolIsEmpty = wizard.configurations.LimitKitOrderingWhenKitPoolIsEmpty;\r\n manager.kitInfo.kitList = [];\r\n manager.page = 1;\r\n manager.canLoadMore = false;\r\n manager.hasKits = true;\r\n manager.filteredKitCount = 0;\r\n\r\n manager.all = [{AttributeId: 0, Value: 'All', SortOrder: 1}];\r\n\r\n manager.initStep = function(isSkip, isSelected, manualFunc, setFunc) {\r\n init();\r\n\r\n if(manager.kitInfo.manualKit) {\r\n manager.kitNumber = manager.kitInfo.manualKit.KitNo;\r\n manualFunc();\r\n } else if(isSkip) { \r\n setFunc(true);\r\n //for the type screen, skip logic is handled by the setfunc method.\r\n if (wizard.currentStep.name !== \"servicelevel-rpm-type\"){\r\n wizard.skip();\r\n }\r\n\r\n } else if(!isSelected) {\r\n setFunc(false);\r\n } else if(isSelected) {\r\n if ((manager.kitInfo.selectedKitType && manager.kitInfo.selectedKitType.DisplayCount > 0) || \r\n (manager.kitInfo.selectedKitPool && manager.kitInfo.selectedKitPool.EnableRequestByKitType) ||\r\n wizard.currentStep.name.includes('pickup') || wizard.currentStep.name.includes('confirmation')) {\r\n wizard.enableNext = true;\r\n }\r\n }\r\n };\r\n\r\n manager.skip = wizard.skip;\r\n\r\n manager.getAvailableKitLicenseCount = async function(kitPoolId = null) {\r\n var homeServiceLevelAssignedCount = await ServiceLevelWizardService.getHomeServiceLevelAssignedCount(kitPoolId);\r\n var lostKitsCount = await ServiceLevelWizardService.getLostKitsCount(kitPoolId);\r\n var numKitLicenses = manager.kitInfo.selectedKitPool.KitLicenseLimit - homeServiceLevelAssignedCount - lostKitsCount;\r\n\r\n return numKitLicenses;\r\n }\r\n\r\n manager.setManual = async function() {\r\n manager.enterKitNo = true;\r\n \r\n if (manager.limitKitOrderingWhenKitPoolIsEmpty && manager.kitInfo.selectedKitPool.KitLicenseLimit > 0) {\r\n var numKitLicenses = await manager.getAvailableKitLicenseCount(manager.kitInfo.selectedKitPool.KitPoolId);\r\n if (numKitLicenses < 1) {\r\n manager.noKitLicense = true;\r\n wizard.enableNext = false;\r\n wizard.nextButtonTooltip = wizard.noLicenseMsg;\r\n return;\r\n }\r\n }\r\n\r\n manager.noKitLicense = false;\r\n manager.kitNoFocused = true;\r\n wizard.enableNext = true;\r\n wizard.nextButtonTooltip = '';\r\n };\r\n\r\n manager.setKitPool = async function(kitPool) {\r\n init();\r\n manager.kitInfo.selectedKitPool = kitPool;\r\n clearManual();\r\n wizard.nextButtonTooltip = '';\r\n\r\n if (manager.kitInfo.selectedKitPool.EnableRequestByKitType && manager.limitKitOrderingWhenKitPoolIsEmpty) {\r\n var numKits;\r\n if (manager.kitInfo.selectedKitPool.KitLicenseLimit == null) {\r\n var data = await ServiceLevelWizardService.getOpenKitShipsKitPool(manager.kitInfo.selectedKitPool.KitPoolId);\r\n var totalKits = manager.kitInfo.selectedKitPool.Count;\r\n var openShipRecords = data.length;\r\n \r\n numKits = totalKits - openShipRecords;\r\n if (numKits < 0) {\r\n numKits = 0;\r\n }\r\n } else if (manager.kitInfo.selectedKitPool.KitLicenseLimit > 0) {\r\n numKits = await manager.getAvailableKitLicenseCount(manager.kitInfo.selectedKitPool.KitPoolId);\r\n\r\n if (numKits < 1) {\r\n wizard.nextButtonTooltip = wizard.noLicenseMsg;\r\n numKits = 0;\r\n }\r\n }\r\n\r\n manager.kitInfo.selectedKitPool.DisplayCount = numKits;\r\n\r\n if (numKits < 1) {\r\n wizard.enableNext = false;\r\n wizard.noAvailableKits = true;\r\n return;\r\n }\r\n } else {\r\n manager.kitInfo.selectedKitPool.DisplayCount = manager.kitInfo.selectedKitPool.Count;\r\n }\r\n\r\n if (!manager.kitInfo.selectedKitPool.KitLicenseLimit || manager.kitInfo.selectedKitPool.KitLicenseLimit == 0) {\r\n if (manager.kitInfo.selectedKitPool != undefined && manager.kitInfo.selectedKitPool.EnableRequestByKitType && manager.limitKitOrderingWhenKitPoolIsEmpty && manager.kitInfo.selectedKitPool.Count == 0)\r\n {\r\n wizard.enableNext = false;\r\n }\r\n else\r\n {\r\n wizard.enableNext = true;\r\n }\r\n } else {\r\n wizard.enableNext = true;\r\n } \r\n };\r\n\r\n manager.setKit = function(kit) {\r\n manager.kitInfo.selectedKit = kit;\r\n manager.getDeviceList(kit);\r\n wizard.enableNext = true;\r\n };\r\n\r\n manager.setKitType = async function(kitType, isSkip) {\r\n wizard.noAvailableKits = false;\r\n init();\r\n if(isSkip){\r\n wizard.disabled = true; //don't display until after data load finishes\r\n }\r\n manager.kitInfo.selectedKitType = kitType;\r\n clearManual();\r\n wizard.nextButtonTooltip = '';\r\n\r\n manager.kitInfo.selectedKitCuff = manager.all[0];\r\n manager.kitInfo.selectedKitScale = manager.all[0];\r\n\r\n if (manager.kitInfo.selectedKitPool.EnableRequestByKitType && manager.limitKitOrderingWhenKitPoolIsEmpty) {\r\n var numKits;\r\n if (manager.kitInfo.selectedKitPool.KitLicenseLimit == null) {\r\n var data = await ServiceLevelWizardService.getOpenKitShipsKitType(manager.kitInfo.selectedKitPool.KitPoolId, manager.kitInfo.selectedKitType.KitTypeId);\r\n var totalKits = manager.kitInfo.selectedKitType.Count;\r\n var openShipRecords = data.length;\r\n \r\n numKits = totalKits - openShipRecords;\r\n if (numKits < 0) {\r\n numKits = 0;\r\n }\r\n } else if (manager.kitInfo.selectedKitPool.KitLicenseLimit > 0) {\r\n numKits = await manager.getAvailableKitLicenseCount(manager.kitInfo.selectedKitPool.KitPoolId);\r\n\r\n if (numKits < 1) {\r\n wizard.nextButtonTooltip = wizard.noLicenseMsg;\r\n numKits = 0;\r\n }\r\n }\r\n \r\n manager.kitInfo.selectedKitType.DisplayCount = numKits;\r\n\r\n if (numKits < 1) {\r\n wizard.enableNext = false;\r\n wizard.noAvailableKits = true;\r\n return;\r\n }\r\n } else {\r\n manager.kitInfo.selectedKitType.DisplayCount = manager.kitInfo.selectedKitType.Count;\r\n }\r\n\r\n manager.getKits(function(data){\r\n if (wizard.currentStep.name == \"servicelevel-rpm-kit\" ||\r\n (wizard.currentStep.name == \"servicelevel-rpm-type\" && (manager.kitInfo.kitCuffs.length > 1 || manager.kitInfo.kitScales.length > 1))) {\r\n wizard.enableNext = false;\r\n } else if (wizard.disabled && wizard.currentStep.name == \"servicelevel-rpm-type\" &&\r\n manager.kitInfo.kitCuffs && manager.kitInfo.kitCuffs.length === 1 && manager.kitInfo.kitScales && manager.kitInfo.kitScales.length === 1) {\r\n wizard.skip();\r\n } else {\r\n if (wizard.currentStep.name == \"servicelevel-rpm-type\") {\r\n if (manager.kitInfo.selectedKitType.DisplayCount > 0 || manager.kitInfo.selectedKitPool.EnableRequestByKitType) {\r\n wizard.enableNext = true;\r\n }\r\n }\r\n else {\r\n wizard.enableNext = true;\r\n }\r\n }\r\n wizard.disabled = false;\r\n }, false);\r\n\r\n };\r\n\r\n manager.setUnassignOption = function(option) {\r\n if (option !== undefined){\r\n wizard.serviceLevelData.selectedKitPickupOption = option;\r\n wizard.enableNext = true;\r\n }\r\n };\r\n\r\n manager.getKit = function(successFunc) {\r\n wizard.enableNext = false;\r\n if(manager.kitNumber && manager.kitNumber.length) {\r\n ServiceLevelWizardService.getAvailableKit(manager.kitNumber)\r\n .then(function (data) {\r\n var hasKits = data.Kits.length > 0;\r\n if(hasKits) {\r\n manager.kitInfo.manualKit = data.Kits[0];\r\n // Need to check to see if this value is populated at all or else it could blow up and prevent the Next button from working\r\n if (manager.kitInfo.kitCuffs) {\r\n manager.kitInfo.selectedKitCuff = manager.kitInfo.kitCuffs.length === 1 ? manager.kitInfo.kitCuffs[0] : manager.all[0];\r\n }\r\n else {\r\n manager.kitInfo.selectedKitCuff = manager.all[0];\r\n }\r\n // Need to check to see if this value is populated at all or else it could blow up and prevent the Next button from working\r\n if (manager.kitInfo.kitScales) {\r\n manager.kitInfo.selectedKitScale = manager.kitInfo.kitScales.length === 1 ? manager.kitInfo.kitScales[0] : manager.all[0];\r\n }\r\n else {\r\n manager.kitInfo.selectedKitScale = manager.all[0];\r\n }\r\n setKitSelectionValues(data);\r\n wizard.enableNext = true;\r\n } else {\r\n wizard.enableNext = false;\r\n }\r\n successFunc(data);\r\n });\r\n } else {\r\n manager.kitInfo.manualKit = undefined;\r\n }\r\n };\r\n\r\n manager.debounce = undefined;\r\n\r\n manager.getKits = function(successFunc, append) {\r\n\r\n if(manager.debounce) {\r\n $timeout.cancel(manager.debounce);\r\n }\r\n\r\n manager.debounce = $timeout(function() {\r\n if (!append) {\r\n manager.page = 1;\r\n manager.canLoadMore = false;\r\n manager.hasKits = true;\r\n }\r\n\r\n var deviceStates = lodash.map(wizard.kitDevices, function (device) {\r\n return {\r\n DeviceTypeId: device.DeviceTypeId,\r\n State: device.selectedState\r\n };\r\n });\r\n\r\n if (manager.kitInfo.kitCuffs && !manager.kitInfo.selectedKitCuff) {\r\n manager.kitInfo.selectedKitCuff = manager.all[0];\r\n }\r\n \r\n if (manager.kitInfo.kitScales && !manager.kitInfo.selectedKitScale) {\r\n manager.kitInfo.selectedKitScale = manager.all[0];\r\n }\r\n\r\n if(manager.kitInfo.selectedKitPool !== undefined && manager.kitInfo.selectedKitType !== undefined && manager.kitInfo.selectedKitCuff !== undefined && manager.kitInfo.selectedKitScale !== undefined) {\r\n ServiceLevelWizardService.getAvailableKits(manager.kitInfo.selectedKitPool.KitPoolId, manager.kitInfo.selectedKitType.KitTypeId, manager.kitInfo.selectedKitCuff.AttributeId, manager.kitInfo.selectedKitScale.AttributeId, manager.kitNumber, deviceStates, manager.page)\r\n .then(function (data) {\r\n if (append) {\r\n manager.kitInfo.kitList = manager.kitInfo.kitList.concat(data.Kits);\r\n manager.canLoadMore = manager.filteredKitCount > (manager.page * 25);\r\n } else {\r\n init();\r\n clearManual();\r\n setKitSelectionValues(data);\r\n successFunc(data);\r\n }\r\n });\r\n }\r\n }, 750);\r\n \r\n };\r\n\r\n manager.getDeviceName = function(device) {\r\n var deviceName = device.name;\r\n if ((device.DeviceTypeId === 1 || device.DeviceTypeId === 2) && manager.kitInfo.selectedKit != undefined) {\r\n var attribute = device.DeviceTypeId === 1\r\n ? lodash.find(manager.kitInfo.kitScales, {'AttributeId': manager.kitInfo.selectedKit.KitScaleAttributeId})\r\n : lodash.find(manager.kitInfo.kitCuffs, {'AttributeId': manager.kitInfo.selectedKit.KitCuffAttributeId});\r\n if (attribute && attribute.Value.toLowerCase() !== 'none') {\r\n deviceName += ' (' + attribute.Value + ')';\r\n }\r\n }\r\n\r\n return deviceName;\r\n };\r\n\r\n manager.getKitIcons = function (kitTypes) {\r\n lodash.map(kitTypes, function(kitType) {\r\n kitType.icons = kitType.Icon ? kitType.Icon.split(' ') : [];\r\n });\r\n }\r\n\r\n manager.getDevices = function (kit) {\r\n if (!kit || !kit.Devices || kit.Devices.length === 0) {\r\n return [];\r\n }\r\n\r\n var deviceList = lodash.map(kit.Devices, function (device) {\r\n return lodash.find(wizard.kitDevices, {'DeviceTypeId': device.DeviceTypeId});\r\n });\r\n\r\n return lodash.sortBy(deviceList, 'DeviceTypeId');\r\n };\r\n\r\n manager.getDeviceList = function (kit) {\r\n var deviceList = manager.getDevices(kit);\r\n\r\n if (deviceList.length === 0) {\r\n return 'Tablet Only';\r\n }\r\n\r\n var devices = lodash.map(deviceList, function (device) {\r\n var deviceName = device.name;\r\n if (device.DeviceTypeId === 1 || device.DeviceTypeId === 2) {\r\n var attribute = device.DeviceTypeId === 1\r\n ? lodash.find(manager.kitInfo.kitScales, {'AttributeId': kit.KitScaleAttributeId})\r\n : lodash.find(manager.kitInfo.kitCuffs, {'AttributeId': kit.KitCuffAttributeId});\r\n if (attribute && attribute.Value.toLowerCase() !== 'none') {\r\n deviceName += ' (' + attribute.Value + ')';\r\n }\r\n }\r\n return deviceName;\r\n });\r\n\r\n return devices.join(', ');\r\n };\r\n\r\n manager.resetKitDevices = function() {\r\n wizard.kitDevices.map(function(kitDevice){\r\n kitDevice.isFilter = false;\r\n kitDevice.selectedState = -1;\r\n });\r\n };\r\n\r\n function init() {\r\n manager.kitNumber = '';\r\n manager.enterKitNo = false;\r\n manager.kitNoFocused = false;\r\n wizard.enableNext = false;\r\n }\r\n\r\n function clearManual() {\r\n manager.kitInfo.selectedKit = undefined;\r\n manager.kitInfo.manualKit = undefined;\r\n }\r\n\r\n function setKitSelectionValues(data) {\r\n manager.filteredKitCount = data.KitCount;\r\n manager.kitInfo.kitCuffs = lodash.sortBy(data.KitCuffAttributes, 'SortOrder');\r\n manager.kitInfo.kitScales = lodash.sortBy(data.KitScaleAttributes, 'SortOrder');\r\n if (manager.kitInfo.kitCuffs.length === 1) {\r\n manager.kitInfo.selectedKitCuff = manager.kitInfo.kitCuffs[0];\r\n }\r\n else {\r\n manager.kitInfo.selectedKitCuff = lodash.find(manager.kitInfo.kitCuffs, {'AttributeId': manager.kitInfo.selectedKitCuff.AttributeId});\r\n }\r\n if (manager.kitInfo.kitScales.length === 1) {\r\n manager.kitInfo.selectedKitScale = manager.kitInfo.kitScales[0];\r\n }\r\n else {\r\n manager.kitInfo.selectedKitScale = lodash.find(manager.kitInfo.kitScales, {'AttributeId': manager.kitInfo.selectedKitScale.AttributeId});\r\n }\r\n setBiometricFilters(data.DeviceTypes);\r\n manager.kitInfo.kitList = data.Kits;\r\n if (manager.kitInfo.selectedKitType && manager.kitInfo.selectedKitPool &&\r\n !manager.kitInfo.selectedKitPool.EnableRequestByKitType) {\r\n // Filter on cuff type if we need to at this point\r\n if (manager.kitInfo.selectedKitCuff && manager.kitInfo.selectedKitCuff.AttributeId > 0) {\r\n manager.kitInfo.kitList = manager.kitInfo.kitList.filter(k => k.KitCuffAttributeId === manager.kitInfo.selectedKitCuff.AttributeId);\r\n }\r\n // Filter on scale type if we need to at this point\r\n if (manager.kitInfo.selectedKitScale && manager.kitInfo.selectedKitScale.AttributeId > 0) {\r\n manager.kitInfo.kitList = manager.kitInfo.kitList.filter(k => k.KitScaleAttributeId === manager.kitInfo.selectedKitScale.AttributeId);\r\n } \r\n manager.kitInfo.selectedKitType.DisplayCount = manager.kitInfo.kitList.length; \r\n }\r\n if(manager.kitInfo.selectedKitType !== undefined){\r\n //VIVY-9830: for shared inventory, do not overwrite displayedcount with available kits\r\n if(!(manager.kitInfo.selectedKitPool.EnableRequestByKitType && manager.kitInfo.selectedKitPool.KitLicenseLimit && manager.kitInfo.selectedKitPool.KitLicenseLimit > 0 )){\r\n manager.kitInfo.selectedKitType.DisplayCount = manager.filteredKitCount;\r\n }\r\n }\r\n manager.hasKits = manager.kitInfo.kitList.length > 0;\r\n manager.canLoadMore = manager.filteredKitCount > (manager.page * 25);\r\n }\r\n\r\n function setBiometricFilters(devices) {\r\n if (devices && devices.length > 0) {\r\n devices.forEach(function (device) {\r\n var filter = lodash.find(wizard.kitDevices, {'DeviceTypeId': device});\r\n filter.isFilter = true;\r\n });\r\n }\r\n }\r\n\r\n }\r\n\r\n return {\r\n restrict: \"A\",\r\n controller: controller,\r\n controllerAs: \"manager\"\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelRpmManager\", ServiceLevelRpmManager);\r\n","function ServiceLevelRpmPoolDirective($document, $timeout, $stateParams, lodash, DirectEntryService, vhRulesParserService) {\r\n\r\n function link(scope, elem, attrs, ctrl) {\r\n var manager = ctrl;\r\n\r\n scope.manager = manager;\r\n\r\n scope.selectKitPool = function(kitPool) {\r\n if (kitPool) {\r\n manager.setKitPool(kitPool);\r\n scope.heading = kitPool.Name;\r\n scope.subHeading = kitPool.Description;\r\n \r\n clearErrors();\r\n } else {\r\n manager.kitInfo.selectedKitPool = undefined;\r\n scope.heading = 'Select Kit Pool';\r\n scope.subHeading = manager.defaultKitPoolHelpText;\r\n }\r\n };\r\n\r\n scope.selectManualEntry = function () {\r\n manager.setManual();\r\n scope.heading = 'I Have the Kit';\r\n scope.subHeading = 'Type in the kit number';\r\n };\r\n\r\n scope.getKit = function () {\r\n if(manager.kitNumber && manager.kitNumber.length > 0){\r\n manager.getKit(function(data){\r\n if(data.Kits.length === 0) {\r\n manager.kitInfo.selectedKitType = undefined;\r\n }\r\n \r\n scope.wizardForm.poolKitNumber.$setValidity('unavailable', data.Kits.length !== 0);\r\n });\r\n }\r\n else {\r\n clearErrors();\r\n }\r\n };\r\n\r\n function clearErrors() {\r\n //Hack to update parent form in Service level wizard\r\n scope.wizardForm.poolKitNumber.$setValidity('unavailable', true);\r\n }\r\n\r\n init();\r\n\r\n function init() {\r\n scope.wizard.enableNext = false;\r\n DirectEntryService.getPatientConditionValues($stateParams.patientId, 0).then( function(conditionValues) {\r\n var filteredKitPools = lodash(manager.kitInfo.info.KitPools).filter(function(kitPool) {\r\n if ( angular.isString(kitPool.PostFixDisplayCondition) && kitPool.PostFixDisplayCondition.length > 0 ){\r\n try{\r\n if (kitPool.postfixConditionList == undefined){\r\n kitPool.postfixConditionList = JSON.parse(kitPool.PostFixDisplayCondition);\r\n }\r\n return vhRulesParserService.evaluate(kitPool.postfixConditionList, conditionValues);\r\n } catch(ex){\r\n console.log(\"Kit Pool Display Condition invalid. [\" + kitPool.DisplayCondition + \"] Error: \" + ex);\r\n }\r\n } else {\r\n return true;\r\n }\r\n }).value();\r\n\r\n scope.kitPools = lodash.sortBy(filteredKitPools, 'SortOrder');\r\n\r\n manager.initStep(scope.kitPools.length === 1, manager.kitInfo.selectedKitPool, manual, select);\r\n manager.kitInfo.selectedKitType = undefined;\r\n if(manager.kitInfo.selectedKitPool && !manager.kitInfo.manualKit) {\r\n scope.selectKitPool(manager.kitInfo.selectedKitPool);\r\n }\r\n scope.wizard.enableNext = true;\r\n });\r\n }\r\n\r\n function manual() {\r\n scope.selectManualEntry();\r\n $timeout(function() {\r\n var ele = $document[0].getElementById('kitPoolContainer');\r\n ele.scrollTop = ele.scrollHeight;\r\n }, 100);\r\n }\r\n\r\n function select(isSkip) {\r\n if(isSkip) {\r\n scope.selectKitPool(scope.kitPools[0]);\r\n } else {\r\n scope.selectKitPool(lodash.find(scope.kitPools, { IsDefaultSelectedCtp: true}));\r\n }\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-pool.tpl.html\",\r\n require: \"^servicelevelRpmManager\",\r\n scope: {\r\n wizardForm: \"=\",\r\n wizard: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelRpmPool\", ServiceLevelRpmPoolDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-pool.tpl.html',\n '
          {{kitPool.Name}}
          {{kitPool.Description}}
          I Have the Kit
          Type in the kit number

          {{manager.kitInfo.selectedKitPool.DisplayCount}} of {{manager.kitInfo.selectedKitPool.Total}} kits

          0 && manager.kitInfo.selectedKitPool.DisplayCount != null)\">{{manager.kitInfo.selectedKitPool.DisplayCount}} of {{manager.kitInfo.selectedKitPool.KitLicenseLimit}} kit licenses

          {{heading}}

          {{subHeading}}

          You will not be asked for the patient\\'s shipping information.
          Kit Number is required
          Kit Number is unavailable
          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelRpmTypeDirective($timeout, $document, lodash) {\r\n\r\n function link(scope, elem, attrs, ctrl) {\r\n \r\n var manager = ctrl;\r\n\r\n scope.manager = manager;\r\n\r\n scope.kitTypes = [];\r\n if(manager.kitInfo.selectedKitPool !== undefined)\r\n {\r\n scope.kitTypes = lodash.sortBy(manager.kitInfo.selectedKitPool.KitTypes, 'SortOrder');\r\n manager.getKitIcons(scope.kitTypes);\r\n }\r\n\r\n scope.selectKitType = function(kitType, isSkip) {\r\n if (kitType) {\r\n manager.setKitType(kitType, isSkip);\r\n scope.heading = kitType.Name;\r\n scope.subHeading = kitType.Description;\r\n } else {\r\n manager.kitInfo.selectedKitType = undefined;\r\n scope.heading = 'Select Kit Type';\r\n scope.subHeading = manager.defaultKitTypeHelpText;\r\n }\r\n };\r\n\r\n scope.selectManualEntry = function () {\r\n manager.setManual();\r\n scope.heading = 'I Have the Kit';\r\n scope.subHeading = 'Type in the kit number';\r\n };\r\n\r\n scope.getKit = function () {\r\n manager.getKit(function(data){\r\n scope.wizardForm.typeKitNumber.$setValidity('unavailable', data.Kits.length !== 0);\r\n scope.wizard.showNext = true;\r\n });\r\n };\r\n\r\n scope.selectCuff = function (cuff) {\r\n manager.kitInfo.selectedKitCuff = cuff;\r\n scope.getKits(false);\r\n };\r\n\r\n scope.selectScale = function (scale) {\r\n manager.kitInfo.selectedKitScale = scale;\r\n scope.getKits(false);\r\n };\r\n\r\n scope.getKits = function (append) {\r\n scope.wizard.enableNext = false; // disable temporarily so they can't go too fast\r\n manager.getKits(function (data) {\r\n //enable next button ONLY if there's a kit cuff selected AND a kit scale selected as well (for kit types that have kit cuffs and/or kit scales). Otherwise, next button should remain disabled\r\n scope.wizard.enableNext = manager.kitInfo.selectedKitType.DisplayCount > 0 && \r\n (manager.kitInfo.kitCuffs && manager.kitInfo.kitCuffs.length > 0 && manager.kitInfo.selectedKitCuff && manager.kitInfo.selectedKitCuff.AttributeId > 0) && \r\n (manager.kitInfo.kitScales && manager.kitInfo.kitScales.length > 0 && manager.kitInfo.selectedKitScale && manager.kitInfo.selectedKitScale.AttributeId > 0);\r\n }, append);\r\n };\r\n\r\n init();\r\n\r\n function init() {\r\n manager.initStep(scope.kitTypes.length === 1, manager.kitInfo.selectedKitType, manual, select);\r\n manager.resetKitDevices();\r\n \r\n if(manager.kitInfo.selectedKitType && !manager.kitInfo.manualKit) {\r\n scope.selectKitType(manager.kitInfo.selectedKitType);\r\n manager.kitInfo.selectedKit = undefined;\r\n }\r\n }\r\n\r\n function manual() {\r\n if(manager.info.KitPools.length > 1) {\r\n manager.skip();\r\n return;\r\n }\r\n\r\n scope.selectManualEntry();\r\n $timeout(function() {\r\n var ele = $document[0].getElementById('kitTypeContainer');\r\n if(ele) {\r\n ele.scrollTop = ele.scrollHeight;\r\n\t\t}\r\n }, 100);\r\n }\r\n\r\n function select(isSkip) {\r\n if(isSkip) {\r\n scope.selectKitType(scope.kitTypes[0], true);\r\n } else {\r\n scope.selectKitType(lodash.find(scope.kitTypes, {IsDefaultSelectedCtp: true}), false);\r\n }\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-type.tpl.html\",\r\n require: \"^servicelevelRpmManager\",\r\n scope: {\r\n wizardForm: \"=\",\r\n wizard: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelRpmType\", ServiceLevelRpmTypeDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-type.tpl.html',\n '
          {{kitType.Name}}
          {{kitType.Description}}
          I Have the Kit
          Type in the kit number

          {{manager.kitInfo.selectedKitType.DisplayCount}} of {{manager.kitInfo.selectedKitType.Total}} kit 1\">s

          0 && manager.kitInfo.selectedKitType.DisplayCount != null)\">{{manager.kitInfo.selectedKitType.DisplayCount}} of {{manager.kitInfo.selectedKitPool.KitLicenseLimit}} kit licenses

          {{heading}}

          {{subHeading}}

          BP Cuff Size:

          0 && manager.kitInfo.kitCuffs.length % 2 == 1\" style=\"display:inline-block;width:80px;text-align:left\">

          Scale Type:

          0 && manager.kitInfo.kitScales.length % 2 == 1\" style=\"display:inline-block;width:80px;text-align:left\">

          (Kit also includes box, adapter/cable, label, stand and documentation required for use)

          You will not be asked for the patient\\'s shipping information.
          Kit Number is required
          Kit Number is unavailable
          ');\n}]);\n}(window, document, window.angular));","function servicelevelRpmUnassign(KitStatus, lodash) {\r\n\r\n\r\n function controller ($scope) {\r\n\r\n $scope.kitPickupOptions = $scope.wizard.kitPickupOptions.filter(filter);\r\n\r\n function filter(option) {\r\n var kit = $scope.wizard.serviceLevelData.patientServiceLevel.kit;\r\n \r\n if(option.DeletedDateTime_UTC !== null) {\r\n return false;\r\n }\r\n\r\n //If a kit type has been assigned but a kit hasn't\r\n if (kit == null) {\r\n return option.IsCancel;\r\n }\r\n\r\n //Do not show cancel options if kit is arleady shipped\r\n if(kit.hasPendingShipOrder && kit.status != \"Shipped\") {\r\n return option.IsCancel;\r\n } \r\n \r\n if(option.IsCancel) {\r\n //if kit is in shipped status user cannot cancel.\r\n if(kit.status === 'Shipped') {\r\n return false;\r\n }\r\n //return kit.hasPendingShipOrder;\r\n } else if ($scope.selectedKitPool && option.PickupFromPatient) {\r\n return $scope.selectedKitPool.DoesPickupFromPatient;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n }\r\n\r\n function link(scope, elem, attrs, ctrls) {\r\n scope.manager = ctrls[0] ? ctrls[0] : ctrls[1];\r\n\r\n init();\r\n function init() {\r\n var kit = scope.wizard.serviceLevelData.patientServiceLevel.kit;\r\n\r\n if (kit == null) {\r\n scope.manager.kitInfo.selectedKitType = scope.wizard.serviceLevelData.patientServiceLevel.kitType;\r\n scope.manager.kitInfo.selectedKitPool = scope.wizard.serviceLevelData.patientServiceLevel.kitPool;\r\n }\r\n else {\r\n scope.manager.kitNumber = kit.kitNo;\r\n scope.selectedKitPool = lodash.find(scope.manager.info.KitPools, {'KitPoolId': kit.kitPoolId});\r\n scope.manager.kitInfo.selectedKitPool = scope.selectedKitPool;\r\n scope.manager.kitInfo.selectedKit = kit;\r\n } \r\n\r\n scope.warning = scope.wizard.getWarning();\r\n scope.wizard.showBack = !scope.wizard.isKitServicelevel(scope.wizard.serviceLevelData.originalServiceLevel);\r\n\r\n scope.manager.initStep(false, false, manual, select);\r\n if(scope.wizard.serviceLevelData.logisticsInfo && scope.wizard.serviceLevelData.logisticsInfo.InstallMethod) {\r\n scope.wizard.serviceLevelData.logisticsInfo.InstallMethodId = scope.wizard.serviceLevelData.logisticsInfo.InstallMethod.Id;\r\n }\r\n }\r\n\r\n function manual() {}\r\n\r\n function select() {\r\n if(scope.kitPickupOptions.length === 1) {\r\n scope.manager.setUnassignOption(scope.kitPickupOptions[0]);\r\n } else if(scope.wizard.serviceLevelData.selectedKitPickupOption !== undefined) {\r\n scope.manager.setUnassignOption(scope.wizard.serviceLevelData.selectedKitPickupOption);\r\n } else if(scope.selectedKitPool && scope.selectedKitPool.DoesPickupFromPatient !== undefined) {\r\n scope.manager.setUnassignOption(lodash.find(scope.kitPickupOptions, {PickupFromPatient: scope.selectedKitPool.DoesPickupFromPatient }));\r\n }\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n require: [\"?^servicelevelRpmManager\", \"?^monitoringStatusManager\"],\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-unassign.tpl.html\",\r\n scope: {\r\n wizard: \"=\",\r\n wizardForm: \"=\"\r\n }\r\n };\r\n}\r\n\r\nangular.module('patient.demographics').directive('servicelevelRpmUnassign', servicelevelRpmUnassign);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/rpm/servicelevel-rpm-unassign.tpl.html',\n '
          {{warning}}
          {{option.Name}}
          {{option.Description}}

          {{wizard.serviceLevelData.selectedKitPickupOption.Name}}

          {{wizard.serviceLevelData.selectedKitPickupOption.LongDescription}}

          Select options for kit unassign.

          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelConfirmationDirective(ServiceLevelType, ConfigurationsService, lodash, moment) {\r\n\r\n function link(scope, elem, attrs, ctrls) {\r\n\r\n scope.manager = ctrls[0] ? ctrls[0] : ctrls[1];\r\n \r\n scope.isKitServicelevel = scope.wizard.isKitServicelevel;\r\n scope.displayDetails = displayDetails;\r\n\r\n scope.kit = scope.manager.kitInfo.selectedKit || scope.wizard.serviceLevelData.patientServiceLevel.kit;\r\n\r\n if (scope.kit != null) {\r\n scope.kit.kitNo = scope.kit.kitNo || scope.kit.KitNo;\r\n\r\n scope.kit.Devices = scope.kit.Devices || lodash.map(scope.kit.devices, function (deviceTypeId) {\r\n return lodash.find(scope.wizard.kitDevices, {'DeviceTypeId': deviceTypeId});\r\n });\r\n\r\n scope.deviceList = scope.manager.getDevices(scope.kit);\r\n }\r\n\r\n init();\r\n function init() {\r\n\r\n if(scope.wizard.serviceLevelData.serviceLevel.ServiceLevelId === ServiceLevelType.Unassign) {\r\n scope.warning = scope.wizard.getWarning();\r\n scope.wizard.serviceLevelData.warning = scope.warning;\r\n }\r\n\r\n scope.manager.initStep(false, true, manual, select);\r\n\r\n scope.logisticsInfo = scope.wizard.serviceLevelData.logisticsInfo;\r\n scope.serviceLevel = scope.wizard.serviceLevelData.serviceLevel;\r\n scope.patient = scope.wizard.serviceLevelData.patient;\r\n\r\n buildShipText();\r\n if(scope.wizard.serviceLevelData.logisticsInfo && scope.wizard.serviceLevelData.logisticsInfo.EducationalMaterials && scope.wizard.serviceLevelData.logisticsInfo.EducationalMaterials.length > 0) {\r\n scope.educationalMaterials = lodash(scope.wizard.serviceLevelData.logisticsInfo.EducationalMaterials).pluck('Name').value().join(', ');\r\n }\r\n\r\n var dateFormat = ConfigurationsService.configParams.DateFormat.toUpperCase();\r\n\r\n if(scope.wizard.serviceLevelData.logisticsInfo.PickupDate) {\r\n scope.PickupDate = moment(scope.wizard.serviceLevelData.logisticsInfo.PickupDate).format(dateFormat);\r\n }\r\n\r\n if(scope.wizard.serviceLevelData.logisticsInfo.WelcomeCallDate) {\r\n scope.WelcomeCallDate = moment(scope.wizard.serviceLevelData.logisticsInfo.WelcomeCallDate).format(dateFormat);\r\n }\r\n\r\n if(scope.wizard.serviceLevelData.logisticsInfo && scope.wizard.serviceLevelData.logisticsInfo.InstallMethod) {\r\n scope.wizard.serviceLevelData.logisticsInfo.InstallMethodId = scope.wizard.serviceLevelData.logisticsInfo.InstallMethod.Id;\r\n }\r\n\r\n\r\n }\r\n\r\n function displayDetails(devices) {\r\n if(devices.length > 0) {\r\n return lodash.pluck(devices, 'name').join(', ');\r\n } else {\r\n return 'Tablet Only';\r\n };\r\n }\r\n\r\n function getDevice(deviceId) {\r\n var foundDevice = lodash.find($scope.wizard.kitDevices, {});\r\n }\r\n\r\n function buildShipText() {\r\n scope.shipText = \"Kit will be \";\r\n if(scope.wizard.serviceLevelData.serviceLevel.ServiceLevelId === 0) {\r\n scope.shipText += \"picked up from\";\r\n } else {\r\n scope.shipText += \"shipped to\";\r\n }\r\n scope.shipText += \" the address below:\";\r\n }\r\n\r\n function manual() {\r\n scope.wizard.enableNext = true;\r\n }\r\n\r\n function select() {}\r\n\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: \"E\",\r\n require: [\"?^servicelevelRpmManager\", \"?^monitoringStatusManager\"],\r\n templateUrl: \"modules/patient/demographics/servicelevels/servicelevel-confirmation.tpl.html\",\r\n scope: {\r\n wizard: '=',\r\n wizardForm: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelConfirmation\", ServiceLevelConfirmationDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/servicelevel-confirmation.tpl.html',\n '
          {{warning}}
          {{patient.FirstName}} {{patient.LastName}} will be unassigned. {{wizard.serviceLevelData.selectedKitPickupOption.Description}}. {{patient.FirstName}} {{patient.LastName}} has been assigned the {{serviceLevel.DisplayText}} service level. {{patient.FirstName}} {{patient.LastName}} will receive kit {{kit.KitNo}} from the {{wizard.kitInfo.selectedKitPool.Name}} with {{displayDetails(deviceList)}}. {{patient.FirstName}} {{patient.LastName}} will receive a kit of type \\'{{manager.kitInfo.selectedKitType.Name}}\\' from the {{wizard.kitInfo.selectedKitPool.Name}}.
          {{shipText}}
          {{logisticsInfo.AddressLine1}}
          {{logisticsInfo.AddressLine2}}
          {{logisticsInfo.City}}, {{logisticsInfo.State}} {{logisticsInfo.ZipCode}}
          Notes: {{logisticsInfo.Note}}
          Tel: {{logisticsInfo.Phone}}
          Tel2: {{logisticsInfo.Phone2}}

          {{kit.kitNo}}

          {{manager.kitInfo.selectedKitType.Name}}

          {{manager.kitInfo.selectedKitType.Description}}
          {{manager.getDeviceName(device)}} Tablet Only
          {{manager.kitInfo.selectedKitPool.Name}}
          Additional Details:
          {{wizard.serviceLevelData.logisticsInfo.InstallMethod.Text}}
          {{wizard.serviceLevelData.logisticsInfo.selectedLanguage.Name}}
          {{educationalMaterials}}
          {{manager.kitInfo.selectedKitCuff.Value}}
          {{manager.kitInfo.selectedKitScale.Value}}
          {{PickupDate}}
          {{wizard.serviceLevelData.logisticsInfo.PickupTime}}
          {{WelcomeCallDate}}
          {{wizard.serviceLevelData.logisticsInfo.WelcomeCallTime}}
          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelSelectionDirective($timeout) {\r\n\r\n function controller($scope, $q, ServiceLevelType, InvitationStatusEnum, ServiceLevelWizardService) {\r\n\r\n $scope.ServiceLevelType = ServiceLevelType;\r\n $scope.selectServiceLevel = selectServiceLevel;\r\n $scope.PendingDevices = [];\r\n $scope.ShippedDevices = [];\r\n\r\n $scope.typeIcons = {\r\n \"1\": \"vh-ui-glyph-item-weight\",\r\n \"2\": \"vh-ui-glyph-item-bp\",\r\n \"8\": \"vh-ui-glyph-item-glucose\",\r\n \"13\": \"vh-ui-glyph-item-temp\"\r\n };\r\n\r\n $scope.getTypeIcon = function (id) {\r\n return $scope.typeIcons[id];\r\n }\r\n\r\n $scope.getIconClass = function(icon) {\r\n if (icon == null) return '';\r\n if (icon.startsWith('fa-')) {\r\n return 'fa ' + icon;\r\n } else if (icon.startsWith('vh-ui')) {\r\n return 'vh-ui-glyph ' + icon;\r\n }\r\n }\r\n \r\n $scope.isCurrentServiceLevel = function(serviceLevel) {\r\n return serviceLevel && $scope.wizard.serviceLevelData.originalServiceLevel &&\r\n serviceLevel.ServiceLevelId === $scope.wizard.serviceLevelData.originalServiceLevel.serviceLevelId &&\r\n !serviceLevel.IsAdd;\r\n }\r\n\r\n const Unassigned = 0;\r\n const unassignedServiceLevel = [{\r\n ServiceLevelId: Unassigned,\r\n DisplayText: 'Unassign Service Level',\r\n Icon: 'vh-ui-glyph-service-unassign',\r\n ServiceLevelTypeId: 0,\r\n EMAServiceLevelCode: 0,\r\n EnableVideo: false,\r\n TabletRequired: false,\r\n TaskOrderRequired: false,\r\n PhoneNumRequired: false,\r\n SortOrder: 100\r\n }];\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n if ($scope.wizard.serviceLevelData.serviceLevel) {\r\n $scope.wizard.enableNext = true;\r\n }\r\n\r\n $scope.wizard.kitInfo.selectedKitPool = undefined;\r\n $scope.wizard.kitInfo.selectedKitType = undefined;\r\n $scope.wizard.kitInfo.selectedKit = undefined;\r\n $scope.wizard.kitInfo.manualKit = undefined;\r\n $scope.wizard.kitInfo.kitCuffs = undefined;\r\n $scope.wizard.kitInfo.kitScales = undefined;\r\n $scope.wizard.kitInfo.kitFilters = undefined;\r\n $scope.wizard.kitInfo.kitNo = undefined;\r\n\r\n $scope.serviceLevels = $scope.wizard.serviceLevels\r\n .concat(unassignedServiceLevel)\r\n .filter(function (serviceLevel) {\r\n return serviceLevelFilter(serviceLevel);\r\n });\r\n\r\n if ($scope.wizard.serviceLevelData.originalServiceLevel.serviceLevelTypeId == ServiceLevelType.Go) {\r\n var goSl = $scope.wizard.serviceLevels.filter(function (serviceLevel) {\r\n return serviceLevel.ServiceLevelTypeId == $scope.wizard.serviceLevelData.originalServiceLevel.serviceLevelTypeId &&\r\n serviceLevel.ServiceLevelId == $scope.wizard.serviceLevelData.originalServiceLevel.serviceLevelId\r\n });\r\n\r\n ServiceLevelWizardService.canAddGoDevices(goSl[0], $scope.wizard.serviceLevelData.patient.PopulationId).then(function (isEnabled) {\r\n $scope.wizard.goDevicesEnabled = isEnabled;\r\n if ($scope.wizard.goDevicesEnabled) {\r\n if (goSl.length == 1) {\r\n var copy = Object.assign({}, goSl[0]);\r\n copy.IsAdd = true;\r\n copy.DisplayText = \"Add +Go Devices\";\r\n copy.DescriptionText = \"Add +Go devices to this patient\";\r\n copy.Icon = \"vh-ui-glyph-item-bp\";\r\n copy.SortOrder = 99;\r\n\r\n $scope.serviceLevels.push(copy)\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n function serviceLevelFilter(serviceLevel) {\r\n const activeServiceLevelId = $scope.wizard.serviceLevelData.originalServiceLevelId;\r\n\r\n // Don't show Unassign if no active service level\r\n if (activeServiceLevelId === Unassigned) {\r\n return serviceLevel.ServiceLevelId !== Unassigned;\r\n }\r\n if (serviceLevel.ServiceLevelId === Unassigned) {\r\n return true;\r\n }\r\n\r\n if (serviceLevel.ServiceLevelTypeId === ServiceLevelType.CMP) {\r\n return false;\r\n }\r\n\r\n // Don't show active service level for +Home/RPM\r\n if ($scope.wizard.isKitServicelevel($scope.wizard.serviceLevelData.originalServiceLevel)) {\r\n return $scope.wizard.isKitServicelevel(serviceLevel) && serviceLevel.ServiceLevelId !== activeServiceLevelId;\r\n }\r\n\r\n if (serviceLevel.ServiceLevelTypeId === ServiceLevelType.Go) {\r\n const hasOptedIn = $scope.wizard.serviceLevelData.originalServiceLevel.invitation &&\r\n $scope.wizard.serviceLevelData.originalServiceLevel.invitation.InvitationStatus === InvitationStatusEnum.OptedIn;\r\n\r\n if (hasOptedIn) return true;\r\n }\r\n\r\n return serviceLevel.ServiceLevelId === activeServiceLevelId;\r\n };\r\n\r\n\r\n function selectServiceLevel(serviceLevel) {\r\n return $timeout(async function () {\r\n try {\r\n $scope.wizard.disabled = true; //disable next/ok button temporarily\r\n\r\n $scope.PendingDevices = [];\r\n $scope.ShippedDevices = [];\r\n\r\n $scope.wizard.serviceLevelData.serviceLevel = serviceLevel;\r\n $scope.wizard.serviceLevelData.patientServiceLevel.serviceLevelId = serviceLevel.ServiceLevelId;\r\n\r\n var isGo = $scope.wizard.serviceLevelData.patientServiceLevel.serviceLevelTypeId == ServiceLevelType.Go;\r\n\r\n if (serviceLevel.ServiceLevelTypeId === ServiceLevelType.Go && isGo) {\r\n if (serviceLevel.ServiceLevelId !== $scope.wizard.serviceLevelData.originalServiceLevelId) {\r\n serviceLevel.IsTransition = true;\r\n }\r\n } else if (serviceLevel.ServiceLevelTypeId === ServiceLevelType.Unassign && isGo) {\r\n const nonPendingStatuses = [5, 8, 9, 10];\r\n\r\n let logOrders = await ServiceLevelWizardService.getPatientDeviceOrders($scope.wizard.serviceLevelData.patient.Id);\r\n if (logOrders) {\r\n logOrders.map(function (order) {\r\n order.DeviceOrders.map(function (order) {\r\n if (order.LogisticsStatusId == 16) { //pending\r\n $scope.PendingDevices.push(order.PatientDevice.DeviceModel);\r\n } else if (nonPendingStatuses.indexOf(order.LogisticsStatusId) > -1) { //shipped\r\n $scope.ShippedDevices.push(order.PatientDevice.DeviceModel);\r\n }\r\n })\r\n })\r\n }\r\n\r\n $scope.kitManager.kitNumber = $scope.wizard.serviceLevelData.patientServiceLevel.kitNo;\r\n }\r\n\r\n await $scope.wizard.assignWorkflow(serviceLevel);\r\n }\r\n finally {\r\n $scope.wizard.disabled = false;\r\n }\r\n });\r\n };\r\n }\r\n\r\n function link(scope, elem, attrs, ctrl) {\r\n var kitManager = ctrl;\r\n scope.kitManager = kitManager;\r\n\r\n kitManager.enterKitNo = true;\r\n kitManager.kitNoFocused = true;\r\n\r\n init();\r\n function init() {\r\n var skip = scope.wizard.isKitServicelevel(scope.wizard.serviceLevelData.originalServiceLevel);\r\n kitManager.initStep(skip, false, manual, select);\r\n }\r\n\r\n function select() {\r\n if (scope.serviceLevels.length === 1) {\r\n scope.selectServiceLevel(scope.serviceLevels[0]);\r\n } else if (scope.wizard.serviceLevelData.serviceLevel) {\r\n scope.selectServiceLevel(scope.wizard.serviceLevelData.serviceLevel); //selected\r\n } else if (scope.wizard.serviceLevelData.originalServiceLevel) {\r\n let serviceLevel = scope.serviceLevels.find(sl => sl.ServiceLevelId === scope.wizard.serviceLevelData.originalServiceLevelId);\r\n if (serviceLevel) {\r\n scope.selectServiceLevel(serviceLevel); //current\r\n }\r\n }\r\n }\r\n\r\n function manual() { }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n require: \"^servicelevelRpmManager\",\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/demographics/servicelevels/servicelevel-selection.tpl.html\",\r\n scope: {\r\n wizard: \"=\",\r\n wizardForm: \"=\"\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"servicelevelSelection\", ServiceLevelSelectionDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/servicelevel-selection.tpl.html',\n '
          {{serviceLevel.DisplayText}} (current)
          {{serviceLevel.DescriptionText}}

          Transition patient to

          {{wizard.serviceLevelData.serviceLevel.DisplayText}}

          {{wizard.serviceLevelData.serviceLevel.LongDescriptionText}}

          Patient Experience:

          {{wizard.serviceLevelData.selectedConfigurationRanking.ConfigurationNameAndCategory}}
          Default Settings

          Select the service that will be used to monitor this patient.

          ');\n}]);\n}(window, document, window.angular));","\r\nfunction ServiceLevelWizardController($scope, $rootScope, $uibModalInstance, $q, lodash, $timeout, vhSweetAlert,\r\n serviceLevels, patient, patientServiceLevel, webFormFields, configurations, configurationRankings, kitInfo,\r\n availableLanguages, availableEducationMaterials, logisticsConfig, installMethods, kitPickupOptions,\r\n ServiceLevelType, ServiceLevelWizardService, DemographicsService, GoDevicesService, KitStatus, PatientServiceLevelService) {\r\n\r\n const slw = this;\r\n slw.serviceLevels = serviceLevels;\r\n slw.webFormFields = webFormFields;\r\n slw.configurations = configurations;\r\n slw.serviceLevelType = ServiceLevelType;\r\n slw.availableLanguages = availableLanguages;\r\n slw.availableEducationMaterials = availableEducationMaterials;\r\n slw.logisticsConfig = logisticsConfig;\r\n slw.installMethods = installMethods;\r\n slw.kitPickupOptions = kitPickupOptions;\r\n slw.GoDevicesService = GoDevicesService;\r\n slw.ServiceLevelWizardService = ServiceLevelWizardService;\r\n slw.ServiceLevelService = PatientServiceLevelService;\r\n slw.lodash = lodash;\r\n\r\n slw.kitInfo = {\r\n info: kitInfo,\r\n selectedKitPool: undefined,\r\n selectedKitType: undefined,\r\n selectedKit: undefined,\r\n selectedKitCuff: undefined,\r\n selectedKitScale: undefined,\r\n manualKit: undefined,\r\n kitCuffs: undefined,\r\n kitScales: undefined,\r\n kitFilters: undefined\r\n };\r\n\r\n if (patient.DOB && patient.DOB.length > 0) {\r\n // Without this, we would see 1 day before actual date\r\n patient.DOB = DemographicsService.getUtcDate(patient.DOB);\r\n }\r\n\r\n slw.serviceLevelData = {\r\n patient: patient,\r\n originalServiceLevelId: patientServiceLevel.serviceLevelId,\r\n originalServiceLevel: patientServiceLevel,\r\n serviceLevel: undefined,\r\n patientServiceLevel: angular.copy(patientServiceLevel),\r\n kitShippingIncluded: false,\r\n warning: undefined,\r\n selectedKitPickupOption: undefined,\r\n selectedConfigurationRanking: undefined,\r\n configurationRankingId: undefined,\r\n };\r\n\r\n slw.goDevicesEnabled = false;\r\n slw.skipDeviceSelection = false;\r\n slw.disabled = false;\r\n\r\n slw.showBack = false;\r\n slw.showNext = true;\r\n slw.enableNext = false;\r\n slw.showOk = false;\r\n \r\n slw.noLicenseMsg = 'No remaining licenses available. Contact your Clinical Account Manager.';\r\n slw.nextButtonTooltip = '';\r\n\r\n let previousStep = -1;\r\n let step = 0;\r\n\r\n let selectedWorkflow = ServiceLevelWizardService.getWizardSteps(ServiceLevelType.None);\r\n slw.currentStep = selectedWorkflow[0];\r\n\r\n var originalServiceLevelTypeId = angular.copy(slw.serviceLevelData.patient.ServiceLevelTypeId);\r\n\r\n slw.serviceConfigurationRankings = [];\r\n\r\n const kitServiceLevels = new Set([ServiceLevelType.RPM, ServiceLevelType.RPMVideo]);\r\n\r\n slw.isKitServicelevel = function (serviceLevel) {\r\n return kitServiceLevels.has(serviceLevel.ServiceLevelTypeId) || kitServiceLevels.has(serviceLevel.serviceLevelTypeId);\r\n }\r\n\r\n slw.assignWorkflow = async function (serviceLevel) {\r\n let showOk = false;\r\n let showNext = false;\r\n slw.enableNext = false;\r\n\r\n const serviceLevelType = serviceLevel.ServiceLevelTypeId;\r\n\r\n const goServiceLevel = serviceLevels.find(s => s.ServiceLevelTypeId == ServiceLevelType.Go &&\r\n s.ServiceLevelId == slw.serviceLevelData.serviceLevel.ServiceLevelId);\r\n if (goServiceLevel) {\r\n //check if we can actually add devices\r\n slw.goDevicesEnabled = await ServiceLevelWizardService.canAddGoDevices(goServiceLevel, slw.serviceLevelData.patient.PopulationId);\r\n } else {\r\n slw.goDevicesEnabled = false;\r\n }\r\n\r\n const isKit = slw.serviceLevelData.patient.ServiceLevelTypeId === ServiceLevelType.RPM ||\r\n slw.serviceLevelData.patient.ServiceLevelTypeId === ServiceLevelType.RPMVideo;\r\n\r\n selectedWorkflow = ServiceLevelWizardService.getWizardSteps(serviceLevelType, isKit, serviceLevel.IsTransition);\r\n\r\n if (slw.goDevicesEnabled) {\r\n const goDeviceWorkflow = ServiceLevelWizardService.getWizardSteps(ServiceLevelType.GoAddDevice);\r\n if (slw.serviceLevelData.patientServiceLevel.id == 0 && !slw.serviceLevelData.serviceLevel.IsAdd) {\r\n selectedWorkflow = selectedWorkflow.concat(goDeviceWorkflow.slice(1));\r\n } else if (slw.serviceLevelData.patientServiceLevel.id != 0 && (slw.serviceLevelData.serviceLevel.IsAdd || serviceLevel.IsTransition)) {\r\n selectedWorkflow = goDeviceWorkflow;\r\n }\r\n }\r\n\r\n showOk = selectedWorkflow.length === 1;\r\n showNext = selectedWorkflow.length > 1;\r\n slw.enableNext = true;\r\n\r\n slw.serviceLevelData.selectedConfigurationRanking = null;\r\n\r\n switch (serviceLevelType) {\r\n\r\n case ServiceLevelType.RPMVideo:\r\n if (slw.serviceLevelData && slw.serviceLevelData.originalServiceLevel.id === 0)\r\n setConfigurationRankingOptions(1);\r\n break;\r\n \r\n case ServiceLevelType.Go:\r\n if (slw.serviceLevelData && slw.serviceLevelData.originalServiceLevel.id === 0)\r\n setConfigurationRankingOptions(0);\r\n\r\n if (slw.goDevicesEnabled) {\r\n slw.patientDevices = await DemographicsService.getPatientDevices(slw.serviceLevelData.patient.Id);\r\n let goDevices = await ServiceLevelWizardService.getGoDevices(slw.serviceLevelData.patient, slw.patientDevices);\r\n slw.devices = goDevices;\r\n\r\n if (goDevices.length == 0) {\r\n slw.skipDeviceSelection = true;\r\n\r\n //this should only happen if +go service level and no devices available\r\n if (serviceLevel.IsTransition) {\r\n showOk = true;\r\n showNext = false;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n\r\n slw.showOk = showOk;\r\n slw.showNext = showNext;\r\n };\r\n\r\n slw.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n slw.ok = async function () {\r\n $scope.serviceLevelForm.$setSubmitted();\r\n if (!$scope.serviceLevelForm.$valid) {\r\n return;\r\n }\r\n\r\n if (await presave()) {\r\n save();\r\n slw.disabled = true;\r\n }\r\n };\r\n\r\n slw.back = function () {\r\n if (step > 0) {\r\n previousStep = step;\r\n step--;\r\n\r\n //Skip the Select Kit page if EnableRequestByKitType is true on the selected kit pool \r\n if (selectedWorkflow[step] && selectedWorkflow[step].name == 'servicelevel-rpm-kit' &&\r\n slw.kitInfo.selectedKitPool != undefined && slw.kitInfo.selectedKitPool.EnableRequestByKitType &&\r\n slw.kitInfo.manualKit == undefined) {\r\n step--;\r\n }\r\n } else {\r\n step = 0;\r\n previousStep = -1;\r\n }\r\n updateWorkflow(step);\r\n };\r\n\r\n slw.next = function () {\r\n\r\n if (selectedWorkflow[step].requireValidation) {\r\n $scope.serviceLevelForm.$setSubmitted();\r\n if (!$scope.serviceLevelForm.$valid) {\r\n return;\r\n }\r\n }\r\n previousStep = step;\r\n step++;\r\n\r\n //Skip the Select Kit page if EnableRequestByKitType is true on the selected kit pool \r\n if (selectedWorkflow[step] && selectedWorkflow[step].name == 'servicelevel-rpm-kit' &&\r\n slw.kitInfo.selectedKitPool != undefined && slw.kitInfo.selectedKitPool.EnableRequestByKitType &&\r\n slw.kitInfo.manualKit == undefined) {\r\n previousStep = step - 1;\r\n step++;\r\n }\r\n\r\n updateWorkflow(step);\r\n };\r\n\r\n slw.skip = function () {\r\n if (previousStep < step) {\r\n slw.next();\r\n } else {\r\n slw.back();\r\n }\r\n };\r\n\r\n slw.getWarning = function () {\r\n var status =\r\n slw.serviceLevelData.patientServiceLevel &&\r\n slw.serviceLevelData.patientServiceLevel.kit &&\r\n slw.serviceLevelData.patientServiceLevel.kit.status;\r\n\r\n if (status !== undefined) {\r\n\r\n var kitpoolId =\r\n slw.kitInfo.selectedKitPool &&\r\n slw.kitInfo.selectedKitPool.KitPoolId;\r\n\r\n if (kitpoolId !== undefined) {\r\n var selectedKitPool = lodash.find($scope.manager.info.KitPools, { 'KitPoolId': kitpoolId });\r\n\r\n if (selectedKitPool && selectedKitPool.DoesPickupFromPatient) {\r\n switch (status) {\r\n case KitStatus.Shipped:\r\n return configurations.KitInShippedWarning;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n function updateWorkflow(step) {\r\n $timeout(() => {\r\n $scope.serviceLevelForm.$setPristine();\r\n slw.currentStep = selectedWorkflow[step];\r\n slw.showBack = step !== 0;\r\n slw.showNext = step !== selectedWorkflow.length - 1;\r\n slw.showOk = !slw.showNext;\r\n }, 0);\r\n }\r\n\r\n function isActiveServiceLevelType(...serviceLevelTypes) {\r\n return serviceLevelTypes.includes(originalServiceLevelTypeId);\r\n }\r\n\r\n function isSelectedServiceLevelType(...serviceLevelTypes) {\r\n return slw.serviceLevelData.serviceLevel && serviceLevelTypes.includes(slw.serviceLevelData.serviceLevel.ServiceLevelTypeId);\r\n }\r\n\r\n function getResendModalText() {\r\n return (isActiveServiceLevelType(ServiceLevelType.BYOD, ServiceLevelType.Go))\r\n ? 'Are you sure you want to change the phone number and resend the welcome message?'\r\n : 'Are you sure you want to change the phone number and to reschedule the welcome call?'\r\n }\r\n\r\n async function presave() {\r\n if (slw.serviceLevelData.serviceLevel.ServiceLevelId !== 0 &&\r\n (isActiveServiceLevelType(ServiceLevelType.BYOD, ServiceLevelType.IVR)) &&\r\n slw.serviceLevelData.patientServiceLevel.phone != slw.serviceLevelData.originalServiceLevel.phone\r\n ) {\r\n return await vhSweetAlert.verify(slw.serviceLevelData.serviceLevel.DisplayText, getResendModalText());\r\n }\r\n return true;\r\n }\r\n\r\n async function save() {\r\n var goDevicesOrder = null;\r\n if (isSelectedServiceLevelType(ServiceLevelType.Go)) {\r\n goDevicesOrder = ServiceLevelWizardService.createGoDevicesOrderModel(slw);\r\n }\r\n slw.serviceLevelData.goDevicesOrder = goDevicesOrder;\r\n\r\n slw.serviceLevelData.configurationRankingId = (slw.serviceLevelData && slw.serviceLevelData.originalServiceLevel) ? slw.serviceLevelData.originalServiceLevel.configurationRankingId : null;\r\n\r\n if (slw.serviceLevelData.selectedConfigurationRanking && isSelectedServiceLevelType(ServiceLevelType.Go, ServiceLevelType.RPMVideo))\r\n slw.serviceLevelData.configurationRankingId = slw.serviceLevelData.selectedConfigurationRanking.ConfigurationRankingId;\r\n\r\n if (!slw.serviceLevelData.serviceLevel.IsAdd) {\r\n const isTransition = slw.serviceLevelData.serviceLevel.IsTransition;\r\n\r\n let serviceLevelData = await ServiceLevelWizardService.saveServiceLevel(slw.serviceLevelData,\r\n slw.kitDevices, slw.kitInfo.manualKit !== undefined, slw.kitInfo, isTransition);\r\n\r\n if (serviceLevelData) {\r\n slw.serviceLevelData = serviceLevelData;\r\n if (goDevicesOrder != null) {\r\n slw.serviceLevelData.goDevicesOrder = goDevicesOrder;\r\n }\r\n }\r\n } else {\r\n await ServiceLevelWizardService.savePatientGoDevices(slw.serviceLevelData.patient.Id, slw.serviceLevelData.goDevicesOrder);\r\n }\r\n\r\n $uibModalInstance.close(slw.serviceLevelData);\r\n $rootScope.$broadcast('ServiceLevelChanged', slw.serviceLevelData);\r\n }\r\n\r\n function setConfigurationRankingOptions(type) {\r\n var configs = configurationRankings.filter(s => s.ConfigService == type) || [];\r\n slw.serviceConfigurationRankings = [...configs];\r\n var id = slw.serviceLevelData.ConfigurationRankingId;\r\n if (id && slw.serviceConfigurationRankings) {\r\n slw.serviceLevelData.selectedConfigurationRanking = slw.serviceConfigurationRankings.filter(a => a.ConfigurationRankingId == id);\r\n } else {\r\n slw.serviceLevelData.selectedConfigurationRanking = (slw.serviceConfigurationRankings) ? slw.serviceConfigurationRankings[0] : null;\r\n }\r\n if (!slw.serviceLevelData.selectedConfigurationRanking) {\r\n slw.serviceLevelData.DefaultRanking = true;\r\n }\r\n }\r\n\r\n}\r\n\r\nangular.module('patient.demographics').controller('ServiceLevelWizardController', ServiceLevelWizardController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/servicelevels/servicelevel-wizard.modal.html',\n '

          {{slw.currentStep.title}}

          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelWizardService($http, $q, $rootScope, lodash, ServiceLevelType, ServiceLevelService,\r\n InvitesService, DemographicsService, ConfigurationsService, ConfigurationContentService, GoDevicesService) {\r\n\r\n\r\n async function saveServiceLevel(serviceLevelData, kitDevices, isManualKit, kitInfo, isTransition) {\r\n\r\n serviceLevelData.logisticsInfo = serviceLevelData.logisticsInfo || {};\r\n if (serviceLevelData.selectedKitPickupOption !== undefined) {\r\n serviceLevelData.logisticsInfo.KitPickupOptionId = serviceLevelData.selectedKitPickupOption.KitPickupOptionId;\r\n serviceLevelData.logisticsInfo.IsCustomer = serviceLevelData.selectedKitPickupOption.IsCustomer;\r\n }\r\n\r\n var isUnassign = serviceLevelData.serviceLevel.ServiceLevelId === ServiceLevelType.Unassign;\r\n var pin = serviceLevelData.serviceLevel.ServiceLevelTypeId === ServiceLevelType.IVR\r\n ? serviceLevelData.patientServiceLevel.ivrPin\r\n : serviceLevelData.patientServiceLevel.byodPin;\r\n\r\n if (!pin) {\r\n pin = serviceLevelData.patientServiceLevel.pin;\r\n }\r\n\r\n var serviceLevelPhoneNumber = serviceLevelData.patientServiceLevel.phone;\r\n if (serviceLevelPhoneNumber && !serviceLevelPhoneNumber.replace(/\\s/g, '').length) {\r\n serviceLevelPhoneNumber = null;\r\n\r\n } else {\r\n serviceLevelPhoneNumber = serviceLevelData.patientServiceLevel.phone;\r\n }\r\n\r\n var patientServiceLevelModel = {\r\n PatientServiceLevelId: serviceLevelData.patientServiceLevel.id,\r\n PatientId: serviceLevelData.patient.Id,\r\n ServiceLevelId: serviceLevelData.serviceLevel.ServiceLevelId,\r\n KitId: serviceLevelData.logisticsInfo.kitId !== undefined ? serviceLevelData.logisticsInfo.kitId : serviceLevelData.patientServiceLevel.kitId,\r\n KitNo: serviceLevelData.logisticsInfo.kitNo !== undefined ? serviceLevelData.logisticsInfo.kitNo : serviceLevelData.patientServiceLevel.kitNo,\r\n TabletRequired: false,\r\n PhoneNum: serviceLevelPhoneNumber,\r\n PIN: pin,\r\n Email: serviceLevelData.patientServiceLevel.email,\r\n IvrWelcomeDate: serviceLevelData.patientServiceLevel.welcomeDate,\r\n IvrWelcomeTime: serviceLevelData.patientServiceLevel.welcomeTime,\r\n ByodDate: serviceLevelData.patientServiceLevel.byodWelcomeDate,\r\n ByodTime: serviceLevelData.patientServiceLevel.byodWelcomeTime,\r\n ConfigurationRankingId: serviceLevelData.configurationRankingId\r\n };\r\n\r\n var kitShippingModel = serviceLevelData.logisticsInfo;\r\n\r\n if (!isUnassign) {\r\n if (kitInfo != null && kitInfo.selectedKitCuff != null && kitInfo.selectedKitScale != null)\r\n {\r\n serviceLevelData.logisticsInfo.selectedBPCuffSizeId = kitInfo.selectedKitCuff.AttributeId;\r\n serviceLevelData.logisticsInfo.selectedScaleTypeId = kitInfo.selectedKitScale.AttributeId;\r\n }\r\n\r\n if (serviceLevelData.logisticsInfo.EducationalMaterials && serviceLevelData.logisticsInfo.EducationalMaterials.length > 0) {\r\n var rawMaterials = serviceLevelData.logisticsInfo.EducationalMaterials;\r\n kitShippingModel.KitShippingEducationMaterial = formatEducationModelsForSave(rawMaterials);\r\n kitShippingModel.EducationalMaterials = null;// ToDo refacor Educationamaterials to be a different name here if if not null it will brake the service call\r\n }\r\n\r\n kitShippingModel.EducationalMaterialLanguage = kitShippingModel.selectedLanguage;\r\n if (kitShippingModel.selectedLanguage) {\r\n kitShippingModel.EducationLanguageId = kitShippingModel.selectedLanguage.LanguageId;\r\n }\r\n }\r\n\r\n if (isUnassign) {\r\n\r\n let success = await unassignServicelevel(serviceLevelData);\r\n if (!success) {\r\n return false;\r\n }\r\n\r\n if (serviceLevelData.selectedKitPickupOption && serviceLevelData.selectedKitPickupOption.IsCancel) {\r\n if (serviceLevelData.patientServiceLevel.kit && serviceLevelData.patientServiceLevel.kit.kitNo) {\r\n DemographicsService.cancelShipping(serviceLevelData.patientServiceLevel.kit.kitNo);\r\n }\r\n else {\r\n //Cancel the kit ship order for the patient using patient id\r\n DemographicsService.cancelShippingForRequestByKitType(serviceLevelData.patient.Id);\r\n }\r\n } else if (serviceLevelData.logisticsInfo.kit !== undefined) {\r\n if (serviceLevelData.logisticsInfo.kit.kitPoolId != null) {\r\n let kitPool = await getKitPool(serviceLevelData.logisticsInfo.kit.kitPoolId);\r\n if (serviceLevelData.kitShippingIncluded || \r\n (kitPool != null && kitPool.Reprocessing && ConfigurationsService.configParams.CreatePickupOrderForCustomerPickup)) {\r\n DemographicsService.saveKitShippingInfo(serviceLevelData.logisticsInfo);\r\n }\r\n }\r\n }\r\n\r\n createProfileHistoryEntry(serviceLevelData, isManualKit);\r\n return true;\r\n\r\n } else if (isTransition) {\r\n\r\n let response = await updatePatientServicelevel(patientServiceLevelModel, false, false, \"\");\r\n\r\n updatePatientData(serviceLevelData);\r\n\r\n //Save patient's +Go Devices\r\n if (serviceLevelData.serviceLevel.ServiceLevelTypeId === ServiceLevelType.Go && serviceLevelData.goDevicesOrder != null) {\r\n let goDevicesOrder = await savePatientGoDevices(serviceLevelData.patient.Id, serviceLevelData.goDevicesOrder);\r\n }\r\n\r\n return serviceLevelData.patientServiceLevel;\r\n\r\n } else {\r\n // assign service level\r\n\r\n let success = await saveDOB(serviceLevelData.patient, serviceLevelData.patientServiceLevel);\r\n if (!success) {\r\n return false;\r\n }\r\n\r\n const isRequestByKitType = kitInfo.selectedKitPool !== undefined ? kitInfo.selectedKitPool.EnableRequestByKitType : false;\r\n const kitTypeName = isRequestByKitType ? kitInfo.selectedKitType.Name : \"\";\r\n\r\n let response = await updatePatientServicelevel(patientServiceLevelModel, serviceLevelData.kitShippingIncluded, isRequestByKitType, kitTypeName);\r\n serviceLevelData.patientServiceLevel.kit = serviceLevelData.logisticsInfo.kit;\r\n\r\n updatePatientData(serviceLevelData);\r\n\r\n if (serviceLevelData.kitShippingIncluded) {\r\n await DemographicsService.saveKitShippingInfo(serviceLevelData.logisticsInfo);\r\n }\r\n\r\n createProfileHistoryEntry(serviceLevelData, isManualKit);\r\n\r\n //Save patient's +Go Devices\r\n if (serviceLevelData.serviceLevel.ServiceLevelTypeId === ServiceLevelType.Go && serviceLevelData.goDevicesOrder != null) {\r\n let goDevicesOrder = await savePatientGoDevices(serviceLevelData.patient.Id, serviceLevelData.goDevicesOrder);\r\n }\r\n\r\n return serviceLevelData.patientServiceLevel;\r\n\r\n }\r\n }\r\n\r\n function formatEducationModelsForSave(educationalMaterials) {\r\n if (educationalMaterials) {\r\n return educationalMaterials.map(function (material) {\r\n return { EducationalMaterialId: material.EducationalMaterialId, EducationalMaterial: lodash.cloneDeep(material), Name: material.Name }\r\n });\r\n }\r\n return [];\r\n }\r\n\r\n function getAvailableKits(kitPoolId, kitTypeId, kitCuffId, kitScaleId, kitNo, devices, page) {\r\n var data = {\r\n KitPoolId: kitPoolId,\r\n KitTypeId: kitTypeId,\r\n KitCuffAttributeId: kitCuffId,\r\n KitScaleAttributeId: kitScaleId,\r\n Devices: devices,\r\n Page: page,\r\n KitNo: !kitNo ? '' : kitNo\r\n };\r\n\r\n return $http.post('/api/PatientServiceLevel/getServiceLevelKits', data).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getOpenKitShipsKitType(kitPoolId, kitTypeId) {\r\n return $http.post('/api/kitshippinginfo/openshiprecords/' + kitPoolId + '/' + kitTypeId).then(function (response) {\r\n return response.data;\r\n })\r\n }\r\n\r\n \r\n function getOpenKitShipsKitPool(kitPoolId) {\r\n return $http.post('/api/kitshippinginfo/openshiprecords/' + kitPoolId).then(function (response) {\r\n return response.data;\r\n })\r\n }\r\n\r\n function getAvailableKit(kitNo) {\r\n var data = {\r\n KitPoolId: 0,\r\n KitTypeId: 0,\r\n KitCuffAttributeId: 0,\r\n KitScaleAttributeId: 0,\r\n Devices: [],\r\n Page: 1,\r\n KitNo: !kitNo ? '' : kitNo\r\n };\r\n\r\n return $http.post('/api/PatientServiceLevel/getServiceLevelKits', data).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveDOB(patient, patientServiceLevel) {\r\n if (patient.DOB == patientServiceLevel.dob) {\r\n return $q(function (resolve) {\r\n resolve(true);\r\n });\r\n }\r\n\r\n var dob = patientServiceLevel.dob || patient.DOB;\r\n return InvitesService.saveDateOfBirth(patient.Id, dob).then(function (result) {\r\n return result.data.Success;\r\n });\r\n }\r\n\r\n function updatePatientData(serviceLevelData) {\r\n serviceLevelData.patient.ServiceLevel = serviceLevelData.serviceLevel.DisplayText;\r\n serviceLevelData.patient.ServiceLevelId = serviceLevelData.serviceLevel.ServiceLevelId;\r\n serviceLevelData.patient.ServiceLevelTypeId = serviceLevelData.serviceLevel.ServiceLevelTypeId;\r\n\r\n serviceLevelData.patientServiceLevel.ServiceLevel = serviceLevelData.serviceLevel;\r\n serviceLevelData.patientServiceLevel.ServiceLevelId = serviceLevelData.serviceLevel.ServiceLevelId;\r\n serviceLevelData.patientServiceLevel.PatientId = serviceLevelData.patient.Id;\r\n serviceLevelData.patientServiceLevel.ServiceLevelTypeId = serviceLevelData.serviceLevel.ServiceLevelTypeId;\r\n serviceLevelData.patientServiceLevel.ConfigurationRankingId = serviceLevelData.configurationRankingId;\r\n\r\n if (serviceLevelData.patient.ServiceLevelTypeId === ServiceLevelType.BYOD || serviceLevelData.patient.ServiceLevelTypeId === ServiceLevelType.Go) {\r\n serviceLevelData.patient.DOB = serviceLevelData.patientServiceLevel.dob;\r\n serviceLevelData.patient.ServiceLevelPhoneNumber = serviceLevelData.patientServiceLevel.phone;\r\n serviceLevelData.patientServiceLevel.PhoneNum = serviceLevelData.patientServiceLevel.phone;\r\n serviceLevelData.patient.ServiceLevelPIN = serviceLevelData.patientServiceLevel.byodPin;\r\n serviceLevelData.patientServiceLevel.PIN = serviceLevelData.patientServiceLevel.byodPin;\r\n } else if (serviceLevelData.patient.ServiceLevelTypeId === ServiceLevelType.IVR) {\r\n serviceLevelData.patient.ServiceLevelPhoneNumber = serviceLevelData.patientServiceLevel.phone;\r\n serviceLevelData.patientServiceLevel.PhoneNum = serviceLevelData.patientServiceLevel.phone;\r\n serviceLevelData.patient.ServiceLevelPIN = serviceLevelData.patientServiceLevel.ivrPin;\r\n serviceLevelData.patientServiceLevel.PIN = serviceLevelData.patientServiceLevel.ivrPin;\r\n } else if (serviceLevelData.patient.ServiceLevelTypeId === ServiceLevelType.RPM || serviceLevelData.patient.ServiceLevelTypeId === ServiceLevelType.RPMVideo) {\r\n serviceLevelData.patient.ServiceLevelKitNum = serviceLevelData.logisticsInfo.kitNo;\r\n serviceLevelData.patient.KitNo = serviceLevelData.logisticsInfo.kitNo;\r\n serviceLevelData.patientServiceLevel.KitNo = serviceLevelData.logisticsInfo.kitNo;\r\n serviceLevelData.patientServiceLevel.KitId = serviceLevelData.logisticsInfo.kitId;\r\n }\r\n\r\n }\r\n\r\n function unassignServicelevel(serviceLevelData) {\r\n return $http.put('/api/Patient/' + serviceLevelData.patient.Id + '/serviceLevel/unassign').then(function (response) {\r\n if (response.data.IsSuccess) {\r\n $rootScope.$emit(\"vh:serviceLevelUnassigned\");\r\n return true;\r\n }\r\n return false;\r\n });\r\n }\r\n\r\n function updatePatientServicelevel(patientServiceLevelModel, kitShippingIncluded, isRequestByKitType, kitTypeName) {\r\n let params = isRequestByKitType ? {\r\n kitShippingIncluded,\r\n isRequestByKitType,\r\n kitTypeName\r\n } : {\r\n kitShippingIncluded\r\n };\r\n\r\n return $http({\r\n url: '/api/Patient/' + patientServiceLevelModel.PatientId + '/serviceLevel',\r\n method: 'PUT',\r\n params: params,\r\n data: patientServiceLevelModel\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n\r\n }\r\n\r\n function generatePIN(configurations, isIvr) {\r\n var length = isIvr\r\n ? configurations.IvrPinValidationLength\r\n : configurations.PinValidationLength;\r\n\r\n var pin = '';\r\n for (var i = 0; i <= 10; i++) {\r\n pin = '';\r\n\r\n for (var j = 0; j < length; j++) {\r\n //Insure first number isn't zero\r\n if (j === 0) {\r\n pin += Math.floor((Math.random() * 9)) + 1;\r\n } else { pin += Math.floor((Math.random() * 9)); }\r\n\r\n }\r\n\r\n var isDuplicates = true;\r\n for (var j = 0; j < length; j++) {\r\n if (pin[0] != pin[j]) {\r\n isDuplicates = false;\r\n break;\r\n }\r\n }\r\n\r\n var isSequential = true;\r\n for (var j = 0; j < length; j++) {\r\n if (j > 0 && (parseInt(pin[j]) != parseInt(pin[j - 1] + 1))) {\r\n isSequential = false;\r\n break;\r\n }\r\n }\r\n\r\n if (!isDuplicates && !isSequential) {\r\n break;\r\n }\r\n }\r\n\r\n return pin;\r\n }\r\n\r\n function createProfileHistoryEntry(serviceLevelData, isManualKit) {\r\n if (serviceLevelData.serviceLevel.ServiceLevelId === 0 && \r\n (serviceLevelData.originalServiceLevel.serviceLevelTypeId === ServiceLevelType.RPM ||\r\n serviceLevelData.originalServiceLevel.serviceLevelTypeId === ServiceLevelType.RPMVideo)) {\r\n\r\n var str = serviceLevelData.selectedKitPickupOption.Name;\r\n str += ' : ';\r\n str += serviceLevelData.selectedKitPickupOption.Description;\r\n logToPatientProfileHistory(serviceLevelData.patient.Id, str);\r\n\r\n } else if (serviceLevelData.serviceLevel.ServiceLevelId !== 0 && isManualKit) {\r\n\r\n var str = \"Service level assigned with I Have The Kit option.\"\r\n logToPatientProfileHistory(serviceLevelData.patient.Id, str);\r\n\r\n }\r\n }\r\n\r\n function logToPatientProfileHistory(patientId, log) {\r\n\r\n var model = {\r\n text: log\r\n };\r\n\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/profilehistory',\r\n method: 'POST',\r\n data: model\r\n })\r\n .then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n function savePatientGoDevices(patientId, patientDevicesOrderModel) {\r\n return $http.post('/api/Patient/' + patientId + '/DevicesOrder', patientDevicesOrderModel).then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n }\r\n\r\n function getPatientDeviceOrders(patientId) {\r\n return $http.get('/api/cgp/Logistics/Patient/' + patientId + '/LogisticsOrders').then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n }\r\n\r\n function getKitPool(kitPoolId) {\r\n return $http.get('/api/KitPool/' + kitPoolId).then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n }\r\n\r\n function getHomeServiceLevelAssignedCount(kitPoolId = null) {\r\n return $http.get('/api/PatientServiceLevel/HomeServiceLevelCount?kitPoolId=' + kitPoolId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getLostKitsCount(kitPoolId = null) {\r\n return $http.get('/api/Kit/LostCount?kitPoolId=' + kitPoolId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n async function canAddGoDevices(goServiceLevel, patientProgramId) {\r\n let goDevicesEnabled = false;\r\n\r\n //Step 1: can we add devices\r\n let serviceLevelConfigs = await ServiceLevelService.getConfigs();\r\n var configId = lodash.find(serviceLevelConfigs, c => c.Param == \"GoDevices\").ConfigurationId;\r\n var configValue = lodash.find(goServiceLevel.Configurations, c => c.ConfigurationId == configId);\r\n\r\n if (configValue != null) {\r\n goDevicesEnabled = (configValue.Value == \"True\"); //not sure why this is a string\r\n } else {\r\n goDevicesEnabled = ConfigurationsService.configParams.GoDevices; //default\r\n }\r\n\r\n if (!goDevicesEnabled) return false;\r\n\r\n let byodConfigs = await ConfigurationContentService.getWebRpmContent();\r\n var programConfig = null;\r\n var deviceConfig = lodash.find(byodConfigs.WebRpmConfigurations, c => c.Param == \"GoDevices\");\r\n if (patientProgramId > 0) {\r\n programConfig = lodash.find(deviceConfig.PopulationConfigurations, c => c.PopulationId == patientProgramId);\r\n }\r\n\r\n var deviceConfigOk = deviceConfig.Value == \"True\";\r\n var popConfigOk = (programConfig != null) && (programConfig.Value == \"True\"); //population config takes precedent\r\n if (popConfigOk || (deviceConfigOk && programConfig == null)) {\r\n goDevicesEnabled = true;\r\n }\r\n\r\n return goDevicesEnabled;\r\n }\r\n\r\n function createGoDevicesOrderModel(slw) {\r\n var selectedDevices = lodash.filter(slw.devices, 'Active', true);\r\n if (selectedDevices.length == 0) return null;\r\n \r\n var patientDeviceModels = lodash.map(selectedDevices, function (device) {\r\n var patientDeviceModel = {\r\n PatientId: device.PatientId,\r\n DeviceModelId: device.DeviceModelId,\r\n DeviceModelName: device.DeviceName,\r\n DeviceTypeId: device.DeviceTypeId,\r\n PatientDeviceStatusId: device.PatientDeviceStatusId,\r\n DeliveryOptionId: device.DeliveryOptionId\r\n };\r\n return patientDeviceModel;\r\n });\r\n\r\n var patientDevicesOrder = {\r\n PatientId: slw.serviceLevelData.patient.Id,\r\n Address1: slw.goDeviceShippingInfo.AddressLine1,\r\n Address2: slw.goDeviceShippingInfo.AddressLine2,\r\n State: slw.goDeviceShippingInfo.State,\r\n City: slw.goDeviceShippingInfo.City,\r\n ZipCode: slw.goDeviceShippingInfo.ZipCode,\r\n Phone1: slw.goDeviceShippingInfo.Phone,\r\n Phone2: slw.goDeviceShippingInfo.Phone2,\r\n PatientDeviceModels: patientDeviceModels\r\n };\r\n\r\n return patientDevicesOrder;\r\n }\r\n\r\n async function getGoDevices(patient, patientDevices) {\r\n let goDevices = [];\r\n\r\n if (patient.PopulationId != null) {\r\n\r\n const popDevices = await GoDevicesService.GetByPopulation(patient.PopulationId);\r\n\r\n goDevices = popDevices\r\n .map(function (device) {\r\n var hasDevice = patientDevices.some(d => d.DeviceModelId == device.DeviceModel.DeviceModelId);\r\n\r\n var patientDevice = {\r\n PatientId: patient.Id,\r\n DeviceName: device.DeviceModel.DeviceName,\r\n DeviceModelId: device.DeviceModel.DeviceModelId,\r\n DeviceTypeId: device.DeviceModel.DeviceTypeId,\r\n PatientDeviceStatusId: 1,\r\n DeliveryOptionId: null,\r\n DeliveryOptions: device.DeviceModelPopulationDeliveryOptions,\r\n Active: hasDevice ? false : device.IsDefaultDevice,\r\n HasDeviceWarning: hasDevice\r\n }\r\n\r\n if (patientDevice.DeliveryOptions.length == 1) {\r\n patientDevice.DeliveryOptionId = patientDevice.DeliveryOptions[0].DeliveryOptionId\r\n }\r\n\r\n return patientDevice;\r\n });\r\n\r\n } else {\r\n\r\n let deviceModels = await GoDevicesService.GetAllEnabled();\r\n\r\n goDevices = deviceModels\r\n .filter(d => d.IsEnabled && d.DeviceModelDeliveryOptions.length > 0)\r\n .map(function (deviceData) {\r\n var hasDevice = patientDevices.some(d => d.DeviceModelId == deviceData.DeviceModelId);\r\n\r\n var patientDevice = {\r\n PatientId: patient.Id,\r\n DeviceName: deviceData.DeviceName,\r\n DeviceModelId: deviceData.DeviceModelId,\r\n DeviceTypeId: deviceData.DeviceTypeId,\r\n PatientDeviceStatusId: 1,\r\n DeliveryOptionId: null,\r\n DeliveryOptions: deviceData.DeviceModelDeliveryOptions,\r\n Active: false,\r\n HasDeviceWarning: hasDevice\r\n }\r\n\r\n if (patientDevice.DeliveryOptions.length == 1) {\r\n patientDevice.DeliveryOptionId = patientDevice.DeliveryOptions[0].DeliveryOptionId\r\n }\r\n\r\n return patientDevice;\r\n });\r\n }\r\n\r\n return goDevices;\r\n }\r\n\r\n function getWizardSteps(serviceLevelTypeId, isKitAssigned, isTransition) {\r\n const maxHeightStyle = { \"max-height\": \"400px\", \"overflow\": \"hidden\" };\r\n const maxDeviceHeightStyle = { \"max-height\": \"800px\", \"overflow\": \"auto\" };\r\n\r\n const selectionStep = { name: 'servicelevel-selection', title: 'Select Service Level', requireValidation: false };\r\n const confirmationStep = { name: 'servicelevel-confirmation', title: 'Confirm', requireValidation: false, style: { \"background-color\": \"#FCFCFC\" } };\r\n\r\n let wizardSteps = [selectionStep];\r\n\r\n if (isTransition) {\r\n return wizardSteps;\r\n }\r\n\r\n switch (serviceLevelTypeId) {\r\n\r\n case ServiceLevelType.Unassign:\r\n if (isKitAssigned) {\r\n wizardSteps = [\r\n selectionStep,\r\n { name: 'servicelevel-rpm-unassign', title: 'Choose Unassign Option', requireValidation: false, style: maxHeightStyle },\r\n { name: 'servicelevel-rpm-kitpickup', title: 'Update Pickup', requireValidation: true, style: maxHeightStyle },\r\n confirmationStep\r\n ];\r\n } else {\r\n wizardSteps = [selectionStep];\r\n }\r\n break;\r\n\r\n case ServiceLevelType.CMP:\r\n wizardSteps = [selectionStep];\r\n break;\r\n\r\n case ServiceLevelType.RPM:\r\n case ServiceLevelType.RPMVideo:\r\n wizardSteps = [\r\n selectionStep,\r\n { name: 'servicelevel-rpm-pool', title: 'Select Delivery Method', requireValidation: true, style: maxHeightStyle },\r\n { name: 'servicelevel-rpm-type', title: 'Select Kit Type', requireValidation: true, style: maxHeightStyle },\r\n { name: 'servicelevel-rpm-kit', title: 'Select Kit', requireValidation: true, style: maxHeightStyle },\r\n { name: 'servicelevel-rpm-kitship', title: 'Kit Shipping Information', requireValidation: true },\r\n confirmationStep\r\n ];\r\n break;\r\n\r\n case ServiceLevelType.IVR:\r\n wizardSteps = [\r\n selectionStep,\r\n { name: 'servicelevel-ivr', title: 'Confirm Patient Information and Invitation Date', requireValidation: true, style: maxHeightStyle }\r\n ];\r\n break;\r\n\r\n case ServiceLevelType.Go:\r\n case ServiceLevelType.BYOD:\r\n wizardSteps = [\r\n selectionStep,\r\n { name: 'servicelevel-byod', title: 'Confirm Patient Information and Invitation Date', requireValidation: true, style: maxHeightStyle }\r\n ];\r\n break;\r\n\r\n case ServiceLevelType.GoAddDevice:\r\n wizardSteps = [\r\n selectionStep,\r\n { name: 'servicelevel-go-devices', title: 'Confirm Patient Devices', requireValidation: true, style: maxDeviceHeightStyle },\r\n { name: 'servicelevel-go-shipping', title: 'Confirm Patient Shipping Information', requireValidation: true, style: maxDeviceHeightStyle },\r\n { name: 'servicelevel-go-confirmation', title: 'Confirm', requireValidation: false, style: maxDeviceHeightStyle }\r\n ];\r\n break;\r\n \r\n }\r\n\r\n return wizardSteps;\r\n }\r\n\r\n\r\n return {\r\n canAddGoDevices: canAddGoDevices,\r\n createGoDevicesOrderModel: createGoDevicesOrderModel,\r\n saveServiceLevel: saveServiceLevel,\r\n getAvailableKits: getAvailableKits,\r\n getOpenKitShipsKitPool: getOpenKitShipsKitPool,\r\n getOpenKitShipsKitType: getOpenKitShipsKitType,\r\n getAvailableKit: getAvailableKit,\r\n logToPatientProfileHistory: logToPatientProfileHistory,\r\n generatePIN: generatePIN,\r\n savePatientGoDevices: savePatientGoDevices,\r\n getPatientDeviceOrders: getPatientDeviceOrders,\r\n getKitPool: getKitPool,\r\n getWizardSteps: getWizardSteps,\r\n getGoDevices: getGoDevices,\r\n getHomeServiceLevelAssignedCount: getHomeServiceLevelAssignedCount,\r\n getLostKitsCount: getLostKitsCount\r\n }\r\n}\r\n\r\nangular.module(\"patient.demographics\").service(\"ServiceLevelWizardService\", ServiceLevelWizardService);\r\n","/**\r\n * Usage: \r\n * \r\n * This renders a directive dynamically based on the property provided as step-name.\r\n * The model for the overall wizard is passed through via the wizard attribute.\r\n */\r\nfunction WizardStepDirective($compile) {\r\n function link(scope, elem, attrs, ctrl) {\r\n scope.form = ctrl;\r\n\r\n scope.$watch('stepName', function (newVal, oldVal) {\r\n if(!newVal) return;\r\n\r\n loadStep();\r\n });\r\n\r\n function loadStep() {\r\n var template = '<' + scope.stepName + ' wizard=\"wizard\" wizard-form=\"form\">';\r\n var step = $compile(template)(scope);\r\n\r\n elem.empty();\r\n elem.append(step);\r\n }\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: \"E\",\r\n require: \"^form\",\r\n scope: {\r\n wizard: \"=\",\r\n stepName: \"=\"\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").directive(\"wizardStep\", WizardStepDirective);","\r\nfunction SpecialHandlingModalController($uibModalInstance, $scope, $stateParams, lodash, patientSpecialHandling, PatientDemographicSpecialHandlingService, DemographicsService, $rootScope) {\r\n\r\n var specialHandlingList = [];\r\n $scope.visibleSpecialHandlingList = [];\r\n $scope.specialHandling = {}; // binding patientSpeicalHandling directly to $scope does not work!! Must have a \"proxy\" object ($scope.specialHandling)\r\n $scope.specialHandling.patientSpecialHandling = lodash(patientSpecialHandling).pluck('SpecialHandlingModel').flatten().value();\r\n\r\n PatientDemographicSpecialHandlingService.getSpecialHandling().then(function (data) {\r\n specialHandlingList = data;\r\n filterVisibleList();\r\n });\r\n\r\n $scope.setFocus = function(event) {\r\n event.preventDefault();\r\n $scope.$broadcast('specialhandling.focus');\r\n };\r\n\r\n function filterVisibleList() {\r\n var result = []\r\n angular.forEach(specialHandlingList,function(d) {\r\n if (lodash.findIndex($scope.specialHandling.patientSpecialHandling, function(o) { return o.SpecialHandlingId == d.SpecialHandlingId && o.IsEnabled; }) == -1 ) {\r\n result.push(d);\r\n }\r\n });\r\n $scope.visibleSpecialHandlingList = result;\r\n }\r\n\r\n $scope.ok = function() {\r\n // set var to avoid closing modal before all api actions are complete\r\n var apiRequests = 0;\r\n // DELETE Special Handling as needed\r\n angular.forEach(patientSpecialHandling, function(sp) {\r\n if(lodash.find($scope.specialHandling.patientSpecialHandling, function(o) { return o.SpecialHandlingId == sp.SpecialHandlingId }) == undefined) {\r\n //console.log(\"delete \" + sp.SpecialHandlingModel.Name);\r\n apiRequests += 1;\r\n PatientDemographicSpecialHandlingService.removePatientSpecialHandling($stateParams.patientId, sp.PatientSpecialHandlingId).then(function() {\r\n apiRequests -= 1;\r\n if(apiRequests == 0){\r\n $uibModalInstance.close();\r\n }\r\n });\r\n }\r\n });\r\n\r\n // SAVE Special Handling as needed\r\n angular.forEach($scope.specialHandling.patientSpecialHandling, function(o) {\r\n if(lodash.find(patientSpecialHandling, function(sp) { return o.SpecialHandlingId == sp.SpecialHandlingId }) == undefined) {\r\n //console.log(\"add \" + o.Name);\r\n apiRequests += 1;\r\n PatientDemographicSpecialHandlingService.addPatientSpecialHandling($stateParams.patientId, o.SpecialHandlingId).then(function() {\r\n apiRequests -= 1;\r\n if(apiRequests == 0){\r\n $uibModalInstance.close();\r\n }\r\n });\r\n }\r\n });\r\n\r\n // If we get this far, ok was clicked without making changes\r\n if(apiRequests <= 0) {\r\n $uibModalInstance.close();\r\n }\r\n };\r\n\r\n $scope.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('patient.demographics').controller('SpecialHandlingModalController',SpecialHandlingModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/demographics/specialhandling.modal.html',\n '

          Special Handling

          {{$item.Name}} {{sp.Name}}
          ');\n}]);\n}(window, document, window.angular));","function PatientDemographicSpecialHandlingService($http) {\r\n function getSpecialHandling() {\r\n return $http.get('/api/SpecialHandling?enabledOnly=true').then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientSpecialHandling(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/specialHandling').then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function addPatientSpecialHandling(patientId, specialHandlingId) {\r\n var model = {\r\n PatientId: patientId,\r\n SpecialHandlingId: specialHandlingId\r\n };\r\n\r\n return $http.post('/api/Patient/' + patientId + '/specialHandling', model).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function removePatientSpecialHandling(patientId, patientSpecialHandlingId) {\r\n return $http.delete('/api/Patient/' + patientId + '/specialHandling/' + patientSpecialHandlingId).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getSpecialHandling: getSpecialHandling,\r\n getPatientSpecialHandling: getPatientSpecialHandling,\r\n addPatientSpecialHandling: addPatientSpecialHandling,\r\n removePatientSpecialHandling: removePatientSpecialHandling\r\n };\r\n}\r\n\r\nangular.module(\"patient.demographics\").service(\"PatientDemographicSpecialHandlingService\", PatientDemographicSpecialHandlingService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/biometric.modal.html',\n '

          Add Patient Biometrics

          Weight must be at least 1 {{vm.responses.WeightUnitType.value === \\'kg\\' ? \\'kg\\' : \\'lbs\\'}}
          Weight must be at most {{vm.responses.WeightUnitType.value === \\'kg\\' ? \\'454 kg\\' : \\'1000 lbs\\'}}
          Value must contain at most {{vm.responses.WeightUnitType.value === \\'kg\\' ? \\'2 decimal places\\' : \\'1 decimal place\\'}}
          Invalid Time
          60 ? vm.responses.Diastolic + 1 : 60\" ng-max=\"280\" ng-model-options=\"{ updateOn: \\'blur\\' }\" ng-pattern=\"/^[0-9]*$/\">
          Systolic pressure must be at least {{vm.responses.Diastolic && vm.responses.Diastolic > 60 ? vm.responses.Diastolic + 1 : 60}} mmHg
          Systolic pressure must be at most 280 mmHg
          Diastolic pressure must be at least 20 mmHg
          Diastolic pressure must be at most {{vm.responses.Systolic && vm.responses.Systolic < 279 ? vm.responses.Systolic - 1 : 279}} mmHg
          Value must be a whole number greater than 0
          Invalid Time
          Oxygen must be at least 1%
          Oxygen must be at most 100%
          Value must be a whole number greater than 0
          Invalid Time
          Heart Rate must be at least 17 bpm
          Heart Rate must be at most 320 bpm
          Value must be a whole number greater than 0
          Invalid Time
          Blood Sugar must be at least {{vm.bloodSugarMin}} {{vm.bloodSugarUnitType}}
          Blood Sugar must be at most {{vm.bloodSugarMax}} {{vm.bloodSugarUnitType}}
          {{vm.bloodSugarFormatErrorText}}
          Invalid Time
          HbA1c must be at least {{vm.HbA1cMin}} {{vm.HbA1cUnitType}}
          HbA1c must be at most {{vm.HbA1cMax}} {{vm.HbA1cUnitType}}
          {{vm.HbA1cFormatErrorText}}
          Invalid Time
          Temperature must be at least {{vm.responses.TemperatureUnitType.value === \\'C\\' ? \\'32.2 °C\\' : \\'90.0 °F\\'}}
          Temperature must be at most {{vm.responses.TemperatureUnitType.value === \\'C\\' ? \\'43.3 °C\\' : \\'110.0 °F\\'}}
          Value must contain at most 1 decimal place
          Invalid Time
          Invalid Time
          PEF must be at least 100 L/min
          PEF must be at most 999 L/min
          PEF must be a whole number greater than 0
          FEV1 must be at least 1.00 L
          FEV1 must be at most 9.99 L
          FEV1 must contain at most 2 decimal places and be greater than 0
          FEV1/6 must be at least 0.00
          FEV1/6 must be at most 1.00
          FEV1/6 must contain at most 2 decimal places
          All three spirometry values required
          Steps must be greater than 0
          Steps must be at most 99,999
          Value must be a whole number
          Invalid Time
          Enter biometrics and select \"OK\"
          ');\n}]);\n}(window, document, window.angular));","function BiometricModalController($uibModalInstance, $timeout, lodash, ConfigurationsService, ParametersService, patientId, questions, liPatient, patientTimeZoneName, moment, observationDate) {\r\n var vm = this;\r\n vm.showDatePicker = false;\r\n\r\n vm.HbA1cMin = 3;\r\n vm.HbA1cMax = 20;\r\n vm.HbA1cFormatErrorText = \"Value is limited to one decimal places\";\r\n\r\n vm.ClicksMin = 1;\r\n vm.ClicksMax = 100;\r\n\r\n vm.observationDate = observationDate ? observationDate : new Date();\r\n vm.datepickerOptions = {\r\n maxDate: vm.observationDate\r\n };\r\n vm.liPatient = liPatient;\r\n\r\n defaultQuestions = [{\r\n SurveyQuestionTypeId: 1,\r\n Text: \"Prompt for Glucometer reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 3\r\n }, {\r\n SurveyParameterTypeId: 7\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 2,\r\n Text: \"Prompt for Blood Pressure reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 1\r\n }, {\r\n SurveyParameterTypeId: 2\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 14,\r\n Text: \"Prompt for Heart Rate reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 5\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 15,\r\n Text: \"Prompt for Oxygen reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 6\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 4,\r\n Text: \"Prompt for Weight Scale reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 4\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 11,\r\n Text: \"Prompt for Temperature reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 11\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 13,\r\n Text: \"Prompt for Spirometer reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 13\r\n }, {\r\n SurveyParameterTypeId: 15\r\n }, {\r\n SurveyParameterTypeId: 16\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 16,\r\n Text: \"Prompt for Pedometer reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 19\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 19,\r\n Text: \"Prompt for Control Clicks reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 26\r\n }]\r\n }, {\r\n SurveyQuestionTypeId: 20,\r\n Text: \"Prompt for Rescue Clicks reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 27\r\n }]\r\n\r\n },\r\n {\r\n SurveyQuestionTypeId: 18,\r\n Text: \"Prompt for HbA1c reading\",\r\n PatientSurveyOptions: [{\r\n SurveyParameterTypeId: 20\r\n }]\r\n }];\r\n\r\n if (!questions || lodash(questions).isEmpty()) {\r\n vm.showDatePicker = true;\r\n\r\n lodash(defaultQuestions).forEach(function(question) {\r\n lodash(question.PatientSurveyOptions).map(function(option) {\r\n option.ParentPatientSurveyQuestion = question;\r\n return option;\r\n }).value();\r\n }).value();\r\n vm.questions = defaultQuestions;\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n //Do not show the spirometer question if Spirometer is diabled for the portal.\r\n if (!data.EnableSpirometerBiometric) {\r\n lodash(vm.questions).remove({\r\n SurveyQuestionTypeId: 13\r\n }).value();\r\n }\r\n //Do not show pedometer question if Pedometer is disabled for the portal.\r\n if (!data.EnablePedometerBiometric) {\r\n lodash(vm.questions).remove({\r\n SurveyQuestionTypeId: 16\r\n }).value();\r\n }\r\n\r\n if (!data.EnableInhalerBiometrics) {\r\n lodash(vm.questions).remove({\r\n SurveyQuestionTypeId: 19\r\n }).value();\r\n\r\n lodash(vm.questions).remove({\r\n SurveyQuestionTypeId: 20\r\n }).value();\r\n }\r\n });\r\n } else {\r\n vm.questions = questions;\r\n }\r\n\r\n vm.responses = {};\r\n\r\n vm.weightUnitTypeOptions = [{\r\n name: 'lbs',\r\n value: 'lbs'\r\n }, {\r\n name: 'kg',\r\n value: 'kg'\r\n }, ];\r\n vm.responses.WeightUnitType = vm.weightUnitTypeOptions[0];\r\n\r\n vm.HbA1cUnitTypeOptions = [{\r\n name: '%',\r\n value: '%'\r\n }, {\r\n name: 'mmol/mol',\r\n value: 'mmol/mol'\r\n } ];\r\n vm.responses.HbA1cUnitType = vm.HbA1cUnitTypeOptions[0];\r\n\r\n vm.temperatureUnitTypeOptions = [{\r\n name: 'F',\r\n value: 'F'\r\n }, {\r\n name: 'C',\r\n value: 'C'\r\n }, ];\r\n vm.responses.TemperatureUnitType = vm.temperatureUnitTypeOptions[0];\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n vm.bloodSugarUnitType = data.DefaultBloodSugarUnit;\r\n vm.hbA1cUnitType = data.DefaultHba1cUnit;\r\n \r\n if(vm.bloodSugarUnitType == 'mg/dL') {\r\n vm.bloodSugarStep = 1;\r\n vm.bloodSugarMin = 1;\r\n vm.bloodSugarMax = 999;\r\n vm.bloodSugarFormat = /^[0-9]*$/;\r\n vm.bloodSugarFormatErrorText = 'Value must be a whole number';\r\n }\r\n else {\r\n vm.bloodSugarStep = 0.1;\r\n vm.bloodSugarMin = 0.6;\r\n vm.bloodSugarMax = 33.3;\r\n vm.bloodSugarFormat = /^[0-9]+(\\.[0-9]{1})?$/;\r\n vm.bloodSugarFormatErrorText = 'Value must contain at most 1 decimal place';\r\n }\r\n\r\n if(vm.hbA1cUnitType == '%') {\r\n vm.HbA1cStep = 'any';\r\n vm.HbA1cMin = 3;\r\n vm.HbA1cMax = 20;\r\n vm.hbA1cFormat = /^[0-9]+(\\.[0-9]{1,2})?$/;\r\n vm.HbA1cFormatErrorText = 'Value must contain at most 2 decimal places';\r\n }\r\n else {\r\n vm.HbA1cStep = 1;\r\n vm.HbA1cMin = 0;\r\n vm.HbA1cMax = 999;\r\n vm.hbA1cFormat = /^[0-9]*$/;\r\n vm.HbA1cFormatErrorText = 'Value must be a whole number';\r\n }\r\n });\r\n\r\n //Load the edit boxes with existing values\r\n lodash(vm.questions).pluck(\"PatientSurveyOptions\").flatten().forEach(function(option) {\r\n switch (option.SurveyParameterTypeId) {\r\n //Systolic\r\n case 1:\r\n vm.responses.Systolic = option.BiometricAnswer;\r\n vm.responses.BloodPressureTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n break;\r\n //Diastolic\r\n case 2:\r\n vm.responses.Diastolic = option.BiometricAnswer;\r\n break;\r\n //Blood Sugar\r\n case 3:\r\n vm.responses.BloodSugar = option.BiometricAnswer;\r\n vm.responses.BloodSugarTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n break;\r\n //Weight\r\n case 4:\r\n vm.responses.Weight = option.BiometricAnswer;\r\n vm.responses.WeightTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n var weightUnit;\r\n if (option && option.BiometricAnswer) {\r\n weightUnit = option.UnitType;\r\n } else {\r\n weightUnit = data.DefaultWeightUnit;\r\n }\r\n\r\n vm.responses.WeightUnitType = vm.weightUnitTypeOptions[0];\r\n if (weightUnit === 'kg') {\r\n vm.responses.WeightUnitType = vm.weightUnitTypeOptions[1];\r\n }\r\n });\r\n break;\r\n //HbA1c\r\n case 20:\r\n vm.responses.HbA1c = option.BiometricAnswer;\r\n vm.responses.HbA1cTime = option.ParentPatientSurveyQuestion.ObservationDateTime; \r\n ConfigurationsService.getConfig().then(function(data) {\r\n vm.responses.hbA1cUnitType = data.DefaultHba1cUnit;\r\n var hbA1cUnit = data.DefaultHba1cUnit;\r\n if(hbA1cUnit !== '%') {\r\n vm.responses.HbA1cUnitType = vm.HbA1cUnitTypeOptions[1];\r\n }\r\n });\r\n break;\r\n //ControlClicks\r\n case 26:\r\n vm.responses.ControlClicks = option.BiometricAnswer;\r\n vm.responses.ControlClicksTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n break;\r\n //RescueClicks\r\n case 26:\r\n vm.responses.RescueClicks = option.BiometricAnswer;\r\n vm.responses.RescueClicksTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n break;\r\n //Pulse\r\n case 5:\r\n vm.responses.Pulse = option.BiometricAnswer;\r\n vm.responses.PulseTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n break;\r\n //Oxygen\r\n case 6:\r\n vm.responses.Oxygen = option.BiometricAnswer;\r\n vm.responses.OxygenTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n break;\r\n //Fahrenheit - We never have celsius options.\r\n case 11:\r\n vm.responses.Temperature = option.BiometricAnswer;\r\n vm.responses.TemperatureTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n var tempUnit;\r\n if (option && option.BiometricAnswer) {\r\n tempUnit = option.UnitType;\r\n } else {\r\n tempUnit = data.DefaultTempUnit;\r\n }\r\n\r\n vm.responses.TemperatureUnitType = vm.temperatureUnitTypeOptions[0];\r\n if (tempUnit === 'C') {\r\n vm.responses.TemperatureUnitType = vm.temperatureUnitTypeOptions[1];\r\n }\r\n });\r\n break;\r\n //PEF\r\n case 13:\r\n vm.responses.Pef = option.BiometricAnswer;\r\n vm.responses.SpirometerTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n break;\r\n //FEVOne\r\n case 15:\r\n vm.responses.FevOne = option.BiometricAnswer;\r\n break;\r\n //FEVRatio\r\n case 16:\r\n vm.responses.FevRatio = option.BiometricAnswer;\r\n break;\r\n case 19:\r\n vm.responses.Steps = option.BiometricAnswer;\r\n vm.responses.StepsTime = option.ParentPatientSurveyQuestion.ObservationDateTime;\r\n break;\r\n }\r\n }).value();\r\n\r\n vm.focusId = 0;\r\n vm.hasQuestionType = function(questionTypeId) {\r\n var hasQuestion = lodash(vm.questions).pluck(\"SurveyQuestionTypeId\").contains(questionTypeId);\r\n if (vm.focusId === 0 && hasQuestion) {\r\n vm.focusId = questionTypeId;\r\n }\r\n\r\n return hasQuestion;\r\n }\r\n\r\n vm.hasPulseOnBloodPressure = function() {\r\n var hasPulse = false;\r\n\r\n var bpQuestion = lodash(vm.questions).find({\r\n SurveyQuestionTypeId: 2\r\n });\r\n if (bpQuestion) {\r\n hasPulse = lodash(bpQuestion.PatientSurveyOptions).pluck(\"SurveyParameterTypeId\").contains(5);\r\n }\r\n\r\n return hasPulse;\r\n }\r\n\r\n vm.propagateTime = function(time) {\r\n vm.responses.BloodSugarTime = time;\r\n vm.responses.BloodPressureTime = time;\r\n vm.responses.PulseTime = time;\r\n vm.responses.OxygenTime = time;\r\n vm.responses.WeightTime = time;\r\n vm.responses.TemperatureTime = time;\r\n vm.responses.SpirometerTime = time;\r\n vm.responses.StepsTime = time;\r\n\t vm.responses.HbA1cTime = time;\r\n\t vm.responses.ControlClicksTime = time;\r\n\t vm.responses.RescueClicksTime = time;\r\n };\r\n\r\n vm.updateMaxTime = function() {\r\n var rightNow = moment.tz(new Date(), patientTimeZoneName).format();\r\n var rightNowNoTimeZone = rightNow.substring(0, rightNow.lastIndexOf(\"-\"));\r\n var caregiverTime = moment.tz(rightNowNoTimeZone, moment.tz.guess());\r\n var patientMaxTime = new Date(caregiverTime.format());\r\n \r\n var yesterday = new Date();\r\n yesterday.setDate(yesterday.getDate() - 1);\r\n\r\n if (vm.observationDate.getDate() <= yesterday.getDate()) {\r\n var tomorrow = new Date();\r\n tomorrow.setDate(tomorrow.getDate() + 1);\r\n vm.maxTime = tomorrow;\r\n }\r\n else {\r\n vm.maxTime = patientMaxTime;\r\n }\r\n\r\n updateBiometricModels(patientMaxTime);\r\n };\r\n\r\n function updateBiometricModels(rightNow){\r\n if(!vm.responses.WeightTime) {\r\n vm.responses.WeightTime = rightNow;\r\n $timeout(function(){vm.responses.WeightTime = null;});\r\n }\r\n\r\n if(!vm.responses.HbA1cTime) {\r\n vm.responses.HbA1cTime = rightNow;\r\n $timeout(function(){vm.responses.HbA1cTime = null;});\r\n }\r\n\r\n if(!vm.responses.ControlClicksTime) {\r\n vm.responses.ControlClicksTime = rightNow;\r\n $timeout(function(){vm.responses.ControlClicksTime = null;});\r\n }\r\n\r\n if(!vm.responses.RescueClicksTime) {\r\n vm.responses.RescueClicksTime = rightNow;\r\n $timeout(function(){vm.responses.RescueClicksTime = null;});\r\n }\r\n\r\n if(!vm.responses.BloodSugarTime) {\r\n vm.responses.BloodSugarTime = rightNow;\r\n $timeout(function(){vm.responses.BloodSugarTime = null;});\r\n }\r\n\r\n if(!vm.responses.BloodPressureTime) {\r\n vm.responses.BloodPressureTime = rightNow;\r\n $timeout(function(){vm.responses.BloodPressureTime = null;});\r\n }\r\n\r\n if(!vm.responses.PulseTime) {\r\n vm.responses.PulseTime = rightNow;\r\n $timeout(function(){vm.responses.PulseTime = null;});\r\n }\r\n\r\n if(!vm.responses.OxygenTime) {\r\n vm.responses.OxygenTime = rightNow;\r\n $timeout(function(){vm.responses.OxygenTime = null;});\r\n }\r\n\r\n if(!vm.responses.TemperatureTime) {\r\n vm.responses.TemperatureTime = rightNow;\r\n $timeout(function(){vm.responses.TemperatureTime = null;});\r\n }\r\n\r\n if(!vm.responses.SpirometerTime) {\r\n vm.responses.SpirometerTime = rightNow;\r\n $timeout(function(){vm.responses.SpirometerTime = null;});\r\n }\r\n\r\n if (!vm.responses.StepsTime) {\r\n vm.responses.StepsTime = rightNow;\r\n $timeout(function() {vm.responses.StepsTime = null;})\r\n }\r\n }\r\n\r\n vm.updateMaxTime();\r\n\r\n vm.ok = function() {\r\n lodash(vm.questions).pluck(\"PatientSurveyOptions\").flatten().forEach(function(option) {\r\n var selectedDate = vm.observationDate;\r\n switch (option.SurveyParameterTypeId) {\r\n //Systolic\r\n case 1:\r\n option.BiometricAnswer = vm.responses.Systolic;\r\n\r\n if (vm.responses.BloodPressureTime) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.BloodPressureTime.getHours(), vm.responses.BloodPressureTime.getMinutes());\r\n }\r\n break;\r\n\r\n //Diastolic\r\n case 2:\r\n option.BiometricAnswer = vm.responses.Diastolic;\r\n break;\r\n\r\n //Blood Sugar\r\n case 3:\r\n option.BiometricAnswer = vm.responses.BloodSugar;\r\n option.UnitType = vm.bloodSugarUnitType;\r\n\r\n if (vm.responses.BloodSugarTime) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.BloodSugarTime.getHours(), vm.responses.BloodSugarTime.getMinutes());\r\n }\r\n break;\r\n\r\n //Weight\r\n case 4:\r\n option.BiometricAnswer = vm.responses.Weight;\r\n option.UnitType = vm.responses.WeightUnitType.value;\r\n\r\n if (vm.responses.WeightTime) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.WeightTime.getHours(), vm.responses.WeightTime.getMinutes());\r\n }\r\n break;\r\n\r\n //Pulse\r\n case 5:\r\n option.BiometricAnswer = vm.responses.Pulse;\r\n\r\n if (vm.responses.PulseTime) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.PulseTime.getHours(), vm.responses.PulseTime.getMinutes());\r\n }\r\n break;\r\n\r\n //Oxygen\r\n case 6:\r\n option.BiometricAnswer = vm.responses.Oxygen;\r\n\r\n if (vm.responses.OxygenTime) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.OxygenTime.getHours(), vm.responses.OxygenTime.getMinutes());\r\n }\r\n break;\r\n\r\n //Fahrenheit - We never have celsius options.\r\n case 11:\r\n option.BiometricAnswer = vm.responses.Temperature;\r\n option.UnitType = vm.responses.TemperatureUnitType.value;\r\n\r\n if (vm.responses.TemperatureTime) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.TemperatureTime.getHours(), vm.responses.TemperatureTime.getMinutes());\r\n }\r\n break;\r\n\r\n //PEF\r\n case 13:\r\n option.BiometricAnswer = vm.responses.Pef;\r\n\r\n if (vm.responses.SpirometerTime) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.SpirometerTime.getHours(), vm.responses.SpirometerTime.getMinutes());\r\n }\r\n break;\r\n\r\n //FEVOne\r\n case 15:\r\n option.BiometricAnswer = vm.responses.FevOne;\r\n break;\r\n\r\n //FEVRatio\r\n case 16:\r\n option.BiometricAnswer = vm.responses.FevRatio;\r\n break;\r\n\r\n //HbA1c\r\n case 20:\r\n\t\t option.BiometricAnswer = vm.responses.HbA1c;\r\n option.UnitType = vm.responses.HbA1cUnitType.value;\r\n if (vm.responses.HbA1c) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.HbA1cTime.getHours(), vm.responses.HbA1cTime.getMinutes());\r\n }\r\n break;\r\n \r\n //ControlClicks\r\n case 26:\r\n option.BiometricAnswer = vm.responses.ControlClicks;\r\n if (vm.responses.ControlClicks) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.ControlClicksTime.getHours(), vm.responses.ControlClicksTime.getMinutes());\r\n }\r\n break;\r\n\r\n //RescueClicks\r\n case 27:\r\n option.BiometricAnswer = vm.responses.RescueClicks;\r\n if (vm.responses.RescueClicks) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.RescueClicksTime.getHours(), vm.responses.RescueClicksTime.getMinutes());\r\n }\r\n break;\r\n \r\n //Information\r\n case 19:\r\n option.BiometricAnswer = vm.responses.Steps;\r\n\r\n if (vm.responses.Steps) {\r\n option.ParentPatientSurveyQuestion.ObservationDateTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), vm.responses.StepsTime.getHours(), vm.responses.StepsTime.getMinutes());\r\n }\r\n break;\r\n }\r\n }).value();\r\n\r\n $uibModalInstance.close({questions: vm.questions, answers: vm.responses});\r\n };\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.directentry\").controller(\"BiometricModalController\", BiometricModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/complete.modal.html',\n '
          Complete Pathways?
          Would you like to complete the answered pathway(s)?
          ');\n}]);\n}(window, document, window.angular));","function CompleteModalController($uibModalInstance) {\r\n var vm = this;\r\n\r\n vm.click = function (action) {\r\n $uibModalInstance.close(action);\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.directentry\").controller(\"CompleteModalController\", CompleteModalController);\r\n","function DirectEntryController(DirectEntryService, lodash, vhSweetAlert, $stateParams, $scope, $uibModal, portalConfig, TemplatesService, SurveyQuestionAttribute, moment, SmoothScroll, vhRulesParserService, patientContent) {\r\n var vm = this;\r\n vm.patientId = $stateParams.patientId;\r\n vm.patientInfo = patientContent;\r\n vm.loadDirectEntryContent = loadDirectEntryContent;\r\n vm.reloadDirectEntryContent = reloadDirectEntryContent;\r\n vm.isValidDueDate = isValidDueDate;\r\n vm.processDueDateChange = processDueDateChange;\r\n vm.save = save;\r\n vm.cancel = cancel;\r\n vm.openBiometrics = openBiometrics;\r\n vm.isValid = isValid;\r\n\r\n var patientTimeZone = patientContent.patient.patientTimeZoneName;\r\n\r\n vm.dueDate = calculatePatientTime();\r\n vm.datepickerOptions = {\r\n maxDate: vm.dueDate\r\n };\r\n vm.showTimeRequired = false;\r\n\r\n vm.isFutureDate = isFutureDate;\r\n\r\n vm.ConditionValues = {};\r\n vm.QuestionFilter = QuestionFilter;\r\n vm.addTag = addTag;\r\n vm.processRules = processRules;\r\n vm.processHealthTipText = processHealthTipText;\r\n\r\n vm.HideDisplayCondition = true;\r\n\r\n\r\n function calculatePatientTime() {\r\n var rightNow = moment.tz(new Date(), patientTimeZone).format();\r\n var rightNowNoTimeZone = rightNow.substring(0, rightNow.lastIndexOf(\"-\"));\r\n var caregiverTime = moment.tz(rightNowNoTimeZone, moment.tz.guess());\r\n vm.maxTime = new Date(caregiverTime.format());\r\n return new Date(caregiverTime.format());\r\n }\r\n\r\n function QuestionFilter(question){\r\n if ( vm.HideDisplayCondition){\r\n return !question.ParentPatientSurveyOption && question.DisplayConditionResult;\r\n }\r\n else {\r\n return !question.ParentPatientSurveyOption;\r\n }\r\n }\r\n\r\n function loadDirectEntryContent(directentry) {\r\n lodash.forEach(directentry.PatientSurveys, function(survey) {\r\n var allQuestions = survey.PatientSurveyQuestions;\r\n var allOptions = lodash(allQuestions).pluck(\"PatientSurveyOptions\").flatten().value();\r\n var nestedQuestions = lodash(allQuestions).filter(function(o) {\r\n return o.ParentPatientSurveyOptionId !== null;\r\n }).value();\r\n\r\n lodash(allQuestions).map(function(question) {\r\n //Provide questions their parent option.\r\n question.ParentPatientSurveyOption = lodash.find(allOptions, {\r\n PatientSurveyOptionId: question.ParentPatientSurveyOptionId\r\n });\r\n\r\n //This hides the nested questions in the root level (as they are returned from the API).\r\n question.Visible = true;\r\n question.DisplayConditionResult = true;\r\n question.HideDisplayCondition = vm.HideDisplayCondition;\r\n question.TextTemplate = question.Text;\r\n\r\n if (question.ParentPatientSurveyOptionId !== null) {\r\n question.Visible = false;\r\n }\r\n\r\n //Collapse questions if they are already answered.\r\n question.isCollapsed = question.IsAnswered;\r\n\r\n return question;\r\n }).value();\r\n\r\n ApplyAnswersToQuestions(allQuestions);\r\n\r\n lodash(allOptions).map(function(option) {\r\n //Provide options their nested children questions.\r\n option.PatientSurveyQuestions = lodash.filter(nestedQuestions, {\r\n ParentPatientSurveyOptionId: option.PatientSurveyOptionId\r\n });\r\n\r\n //Provide options their parent question.\r\n option.ParentPatientSurveyQuestion = lodash(allQuestions).find({PatientSurveyQuestionId: option.PatientSurveyQuestionId});\r\n\r\n //Collapse options if they are already selected.\r\n option.isCollapsed = option.Selected;\r\n option.TextTemplate = option.Text;\r\n\r\n return option;\r\n }).value();\r\n\r\n lodash(allQuestions).map(function(question) {\r\n question.ChildPatientSurveyQuestions = lodash(question.PatientSurveyOptions).pluck(\"PatientSurveyQuestions\").flatten().value();\r\n return question;\r\n }).value();\r\n });\r\n\r\n //Hide surveys with no visible questions.\r\n lodash(directentry.PatientSurveys).map(function(o) {\r\n o.Visible = lodash(o.PatientSurveyQuestions).any(function(q) {\r\n return q.Visible;\r\n });\r\n return;\r\n }).value();\r\n\r\n //Show the no available surveys text.\r\n vm.anyAvailableSurveys = lodash(directentry.PatientSurveys).any({\r\n Visible: true\r\n });\r\n\r\n //Load display index for Questions\r\n lodash.forEach(directentry.PatientSurveys, function(survey) {\r\n var count = 1;\r\n lodash.forEach(survey.PatientSurveyQuestions, function(q) {\r\n if (QuestionFilter(q)) {\r\n q.displayIndex = count;\r\n count++;\r\n }\r\n });\r\n });\r\n\r\n vm.directentry = directentry;\r\n processRules();\r\n vm.originaldirectentry = deepCopy(vm.directentry);\r\n }\r\n\r\n function addTag(value){\r\n vhRulesParserService.addTag(value, vm.ConditionValues);\r\n }\r\n\r\n function addBPReading(systolic, diastolic){\r\n //TODO: This is breaking direct entry. Need to rework this once rules are actually introduced.\r\n //vhRulesParserService.addBPReading(systolic, diastolic, vm.ConditionValues);\r\n }\r\n\r\n function processHealthTipText(question){\r\n question.Answer = \"Ok\";\r\n if (question.PatientSurveyOptions != null && question.PatientSurveyOptions.length > 1){\r\n question.AlertSeverityLevelId = question.PatientSurveyOptions[1].AlertSeverityLevelId;\r\n question.Answer = question.PatientSurveyOptions[1].Text;\r\n }\r\n return question.Answer;\r\n }\r\n\r\n function processRules(){\r\n if ( vm.directentry != undefined){\r\n var allQuestions = lodash(vm.directentry.PatientSurveys).pluck(\"PatientSurveyQuestions\").flatten().value();\r\n lodash(allQuestions).map(function(question) {\r\n question.Text = vhRulesParserService.replaceVariables(question.TextTemplate, vm.ConditionValues);\r\n if ( angular.isString(question.PostFixDisplayCondition) && question.PostFixDisplayCondition.length > 0 ){\r\n try{\r\n if (question.postfixConditionList == undefined){\r\n question.postfixConditionList = JSON.parse(question.PostFixDisplayCondition);\r\n }\r\n question.DisplayConditionResult = vhRulesParserService.evaluate(question.postfixConditionList, vm.ConditionValues);\r\n }catch(ex){\r\n console.log(\"Pathway Questions Display Condition invalid. [\" + question.DisplayCondition + \"] Error: \" + ex);\r\n }\r\n }\r\n return question;\r\n }).value();\r\n\r\n\r\n var allOptions = lodash(allQuestions).pluck(\"PatientSurveyOptions\").flatten().value();\r\n lodash(allOptions).map(function(option) {\r\n option.Text = vhRulesParserService.replaceVariables(option.TextTemplate, vm.ConditionValues)\r\n return option;\r\n }).value();\r\n }\r\n }\r\n\r\n function processDueDateChange(){\r\n if (isValidDueDate() == true)\r\n {\r\n reloadDirectEntryContent();\r\n }\r\n }\r\n\r\n function isValidDueDate(){\r\n var today = calculatePatientTime();\r\n \r\n if(vm.dueDate && vm.dueDate > today)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n \r\n }\r\n\r\n function reloadDirectEntryContent() {\r\n DirectEntryService.getDirectEntry($stateParams.patientId, vm.dueDate).then(function(response) {\r\n var yesterday = calculatePatientTime();\r\n yesterday.setDate(yesterday.getDate() - 1);\r\n\r\n if (vm.dueDate <= yesterday) {\r\n var tomorrow = new Date();\r\n tomorrow.setDate(tomorrow.getDate() + 1);\r\n vm.maxTime = tomorrow;\r\n }\r\n else {\r\n var rightNow = moment.tz(new Date(), response.PatientTimeZone).format();\r\n var rightNowNoTimeZone = rightNow.substring(0, rightNow.lastIndexOf(\"-\"));\r\n var caregiverTime = moment.tz(rightNowNoTimeZone, moment.tz.guess());\r\n vm.responseTime = null;\r\n vm.maxTime = new Date(caregiverTime.format());\r\n }\r\n\r\n var patientSurveyId = 0;\r\n if ( response.PatientSurveys.length > 0){\r\n patientSurveyId = response.PatientSurveys[0].PatientSurveyId;\r\n }\r\n\r\n DirectEntryService.getPatientConditionValues($stateParams.patientId, patientSurveyId).then( function(conditionValues){\r\n vm.ConditionValues = conditionValues;\r\n var allTags = lodash(response.PatientSurveys).pluck(\"Tags\").flatten().value();\r\n addTag(allTags);\r\n processRules();\r\n })\r\n\r\n vm.loadDirectEntryContent(response);\r\n });\r\n }\r\n\r\n function isFutureDate() {\r\n //vm.dueDate > vm.maxTime\r\n return moment(vm.dueDate).startOf('day').isAfter(moment(vm.maxTime));\r\n\r\n }\r\n\r\n function openBiometrics(patientSurveyId) {\r\n var biometricQuestions = lodash(vm.directentry.PatientSurveys).filter({\r\n PatientSurveyId: patientSurveyId\r\n }).pluck(\"PatientSurveyQuestions\").flatten().filter(function(question) {\r\n return TemplatesService.isBiometricQuestion(question);\r\n }).value();\r\n\r\n lodash(biometricQuestions).map( function (question) {\r\n if (!question.ObservationDateTime) {\r\n question.ObservationDateTime = vm.responseTime;\r\n }\r\n\r\n return question;\r\n }).value();\r\n\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/directentry/biometric.modal.html',\r\n controller: 'BiometricModalController as vm',\r\n backdrop: 'static',\r\n windowClass: 'biometricModalSize',\r\n scope: $scope,\r\n resolve: {\r\n patientId: function() {\r\n return vm.patientId;\r\n },\r\n questions: function() {\r\n //Filter out the already answered questions.\r\n return lodash(biometricQuestions).filter({IsAnswered: false}).value();\r\n },\r\n liPatient: function() {\r\n return null;\r\n },\r\n patientTimeZoneName: function() {\r\n return vm.directentry.PatientTimeZone;\r\n },\r\n observationDate: function() {\r\n return vm.dueDate;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(responses) {\r\n var answers = responses.answers;\r\n\r\n if(vm.responseTime === null) {\r\n setResponseTime(answers);\r\n }\r\n //Set question answers using the option answers.\r\n ApplyAnswersToBiometricQuestions(biometricQuestions);\r\n\r\n //Mark questions that aren't already answered but have an answer as ShouldSave.\r\n lodash(biometricQuestions).forEach(function(question) {\r\n if (!question.IsAnswered && question.Answer) {\r\n question.ShouldSave = true;\r\n }\r\n }).value();\r\n\r\n $scope.directEntryForm.$setDirty();\r\n processRules();\r\n }, function() {});\r\n }\r\n\r\n function setResponseTime(answers) {\r\n var responseTimes = Object.keys(answers)\r\n .map(function(key){\r\n return answers[key];\r\n }).filter(function(val){\r\n return val instanceof Date\r\n })\r\n .sort(function(a, b){\r\n return a > b;\r\n });\r\n\r\n if(responseTimes.length > 0) {\r\n vm.responseTime = responseTimes[0];\r\n }\r\n\r\n }\r\n\r\n function ApplyAnswersToQuestions(questions) {\r\n //Single, multi, video, yes/no\r\n var surveyQuestionTypeIds = [6, 7, 9, 10, 17];\r\n var surveyQuestions = lodash(questions).filter(function(question) {\r\n return lodash(surveyQuestionTypeIds).contains(question.SurveyQuestionTypeId);\r\n }).value();\r\n\r\n var biometricQuestions = lodash(questions).filter(function(question) {\r\n return TemplatesService.isBiometricQuestion(question)\r\n }).value();\r\n\r\n var healthTipQuestions = lodash(questions).filter({SurveyQuestionTypeId: 8}).value();\r\n\r\n ApplyAnswersToSurveyQuestions(surveyQuestions);\r\n ApplyAnswersToBiometricQuestions(biometricQuestions);\r\n ApplyAnswersToHealthTips(healthTipQuestions);\r\n\r\n processRules();\r\n }\r\n\r\n function ApplyAnswersToSurveyQuestions(questions) {\r\n lodash(questions).forEach(function(question) {\r\n ApplyAnswerToSurveyQuestion(question);\r\n }).value();\r\n }\r\n\r\n function ApplyAnswerToSurveyQuestion(question) {\r\n\r\n //Setup Question.Answer for showing answers in a collapsed view.\r\n if (lodash(question.PatientSurveyOptions).any({Selected: true})) {\r\n question.Answer = null;\r\n lodash(question.PatientSurveyOptions).where({Selected: true}).forEach(function(o) {\r\n if (question.Answer) {\r\n question.Answer += \", \" + o.Text;\r\n }\r\n else {\r\n question.Answer = o.Text;\r\n }\r\n }).value();\r\n } else if (TemplatesService.isCustomResponseQuestion(question)) {\r\n question.Answer = question.CustomResponseAnswer;\r\n }\r\n else {\r\n question.Answer = null;\r\n }\r\n }\r\n\r\n function ApplyAnswersToHealthTips(questions) {\r\n lodash(questions).map(function(question) {\r\n if (question.IsAnswered) {\r\n question.Answer = \"Ok\";\r\n if (question.PatientSurveyOptions != null && question.PatientSurveyOptions.length > 1){\r\n question.AlertSeverityLevelId = question.PatientSurveyOptions[1].AlertSeverityLevelId;\r\n question.Answer = question.PatientSurveyOptions[1].Text;\r\n }\r\n }\r\n return question;\r\n }).value();\r\n }\r\n\r\n function hasPulseOnBloodPressure(questions) {\r\n var hasPulse = false;\r\n\r\n var bpQuestion = lodash(questions).find({\r\n SurveyQuestionTypeId: 2\r\n });\r\n if (bpQuestion) {\r\n hasPulse = lodash(bpQuestion.PatientSurveyOptions).pluck(\"SurveyParameterTypeId\").contains(5);\r\n }\r\n\r\n return hasPulse;\r\n }\r\n\r\n function ApplyAnswersToBiometricQuestions(questions) {\r\n lodash(questions).forEach(function(question) {\r\n switch (question.SurveyQuestionTypeId) {\r\n //Blood Sugar\r\n case 1:\r\n var bloodSugarOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 3\r\n });\r\n\r\n if (bloodSugarOption && bloodSugarOption.BiometricAnswer) {\r\n question.Answer = bloodSugarOption.BiometricAnswer;\r\n\r\n if (bloodSugarOption && bloodSugarOption.BiometricAnswer && bloodSugarOption.UnitType && bloodSugarOption.UnitType.length > 0) {\r\n question.Answer += ' ' + bloodSugarOption.UnitType;\r\n } else {\r\n question.Answer += ' mg/dL';\r\n }\r\n }\r\n\r\n break;\r\n\r\n //Blood Pressure\r\n case 2:\r\n var bpAnswer = '';\r\n var systolicOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 1\r\n });\r\n var diastolicOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 2\r\n });\r\n\r\n if (systolicOption && systolicOption.BiometricAnswer &&\r\n diastolicOption && diastolicOption.BiometricAnswer) {\r\n bpAnswer = systolicOption.BiometricAnswer + '/' + diastolicOption.BiometricAnswer + ' mmHg';\r\n addBPReading(systolicOption.BiometricAnswer, diastolicOption.BiometricAnswer);\r\n }\r\n \r\n var pulseAnswer = '';\r\n var pulseOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 5\r\n });\r\n\r\n if (pulseOption && pulseOption.BiometricAnswer) {\r\n pulseAnswer += pulseOption.BiometricAnswer + ' bpm';\r\n }\r\n\r\n question.Answer = bpAnswer + (bpAnswer && pulseAnswer ? ', ' : '') + pulseAnswer;\r\n break;\r\n\r\n //Pulse Ox\r\n case 3:\r\n var pulseOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 5\r\n });\r\n var oxygenOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 6\r\n });\r\n\r\n if (pulseOption && pulseOption.BiometricAnswer &&\r\n oxygenOption && oxygenOption.BiometricAnswer) {\r\n question.Answer = pulseOption.BiometricAnswer + ' bpm, ' + oxygenOption.BiometricAnswer + '%';\r\n } else if(oxygenOption && oxygenOption.BiometricAnswer) {\r\n question.Answer = oxygenOption.BiometricAnswer + '%'\r\n }\r\n break;\r\n\r\n //Weight\r\n case 4:\r\n var weightOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 4\r\n });\r\n\r\n if (weightOption && weightOption.BiometricAnswer && weightOption.UnitType) {\r\n question.Answer = weightOption.BiometricAnswer + ' ' + weightOption.UnitType;\r\n }\r\n break;\r\n \r\n //HbA1c\r\n case 18:\r\n var HbA1cOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 20\r\n });\r\n if (HbA1cOption && HbA1cOption.BiometricAnswer && HbA1cOption.UnitType) {\r\n question.Answer = HbA1cOption.BiometricAnswer + ' ' + HbA1cOption.UnitType;\r\n }\r\n break;\r\n\r\n //Temperature\r\n case 11:\r\n var temperatureOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 11\r\n });\r\n\r\n if (temperatureOption && temperatureOption.BiometricAnswer) {\r\n question.Answer = temperatureOption.BiometricAnswer + ' °' + temperatureOption.UnitType;\r\n }\r\n break;\r\n\r\n //Spirometer\r\n case 13:\r\n var pefOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 13\r\n });\r\n var fevOneOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 15\r\n });\r\n var fevRatioOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 16\r\n });\r\n\r\n if (pefOption && pefOption.BiometricAnswer &&\r\n fevOneOption && fevOneOption.BiometricAnswer &&\r\n fevRatioOption && fevRatioOption.BiometricAnswer) {\r\n question.Answer = pefOption.BiometricAnswer + ' L/min, ' + fevOneOption.BiometricAnswer + ' L, ' + fevRatioOption.BiometricAnswer;\r\n }\r\n break;\r\n\r\n //Pulse\r\n case 14:\r\n var pulseOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 5\r\n });\r\n\r\n if (pulseOption && pulseOption.BiometricAnswer) {\r\n question.Answer = pulseOption.BiometricAnswer + ' bpm';\r\n }\r\n break;\r\n\r\n //Oxygen\r\n case 15:\r\n var oxygenOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 6\r\n });\r\n\r\n if (oxygenOption && oxygenOption.BiometricAnswer) {\r\n question.Answer = oxygenOption.BiometricAnswer + '%';\r\n }\r\n break;\r\n\r\n //Pedometer\r\n case 16:\r\n var stepsOption = lodash(question.PatientSurveyOptions).find({\r\n SurveyParameterTypeId: 19\r\n });\r\n\r\n if (stepsOption && stepsOption.BiometricAnswer != undefined) {\r\n question.Answer = stepsOption.BiometricAnswer + ' steps';\r\n }\r\n break;\r\n }\r\n }).value();\r\n }\r\n\r\n function getUnansweredQuestions() {\r\n var allQuestions = lodash(vm.directentry.PatientSurveys).pluck(\"PatientSurveyQuestions\").flatten().value();\r\n\r\n return lodash(allQuestions).filter(function(question) {\r\n var unanswered = false;\r\n if (TemplatesService.isCustomResponseQuestion(question)) {\r\n if (lodash.findIndex(question.SurveyQuestionAttributes, function(att) {return att.QuestionAttributeId === SurveyQuestionAttribute.AlphaNumeric;}) >= 0) {\r\n //AlphaNumeric type\r\n if (question.text === null && ((question.ParentPatientSurveyOption && question.ParentPatientSurveyOption.Selected===true) || !question.ParentPatientSurveyOption)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } else if (lodash.findIndex(question.SurveyQuestionAttributes, function(att) { return att.QuestionAttributeId === SurveyQuestionAttribute.Numeric;}) >= 0) {\r\n //Numeric type\r\n if (isNaN(question.text) && ((question.ParentPatientSurveyOption && question.ParentPatientSurveyOption.Selected===true) || !question.ParentPatientSurveyOption)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } else if (lodash.findIndex(question.SurveyQuestionAttributes, function(att) { return att.QuestionAttributeId === SurveyQuestionAttribute.Address;}) >= 0) {\r\n //Address type\r\n if (!question.IsAnswered && !question.address1 && ((question.ParentPatientSurveyOption && question.ParentPatientSurveyOption.Selected === true) || !question.ParentPatientSurveyOption))\r\n {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n //The question needs to have an answer if it has no parent or it's parent option is selected\r\n if (!TemplatesService.isHealthTipQuestion(question) &&\r\n (!question.ParentPatientSurveyOption || question.ParentPatientSurveyOption.Selected)) {\r\n unanswered = !lodash(question.PatientSurveyOptions).any(function(option) {\r\n return option.Selected || option.BiometricAnswer;\r\n });\r\n }\r\n\r\n return unanswered;\r\n }).value();\r\n }\r\n\r\n function highlightQuestions(questions) {\r\n lodash(questions).map(function(question) {\r\n question.Highlight = true;\r\n return question;\r\n }).value();\r\n }\r\n\r\n function unhighlightAllQuestions() {\r\n var allQuestions = lodash(vm.directentry.PatientSurveys).pluck(\"PatientSurveyQuestions\").flatten().value();\r\n\r\n lodash(allQuestions).map(function(question) {\r\n question.Highlight = false;\r\n return question;\r\n }).value();\r\n }\r\n\r\n function save() {\r\n if (vm.responseTime && vm.responseTime < vm.maxTime) {\r\n var unansweredQuestions = getUnansweredQuestions();\r\n\r\n if (lodash(unansweredQuestions).any()) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/directentry/complete.modal.html',\r\n controller: 'CompleteModalController as vm',\r\n backdrop: 'static',\r\n scope: $scope\r\n });\r\n\r\n return modalInstance.result.then(function(action) {\r\n unhighlightAllQuestions();\r\n\r\n if (action === 'now') {\r\n highlightQuestions(unansweredQuestions);\r\n }\r\n else if (action === 'later') {\r\n saveEntries(false);\r\n }\r\n else if (action === 'complete') {\r\n saveEntries(true);\r\n }\r\n }, function() {});\r\n }\r\n else {\r\n return saveEntries(true);\r\n }\r\n }\r\n else {\r\n vm.showTimeRequired = true;\r\n SmoothScroll.scrollToTop();\r\n }\r\n }\r\n\r\n function saveEntries(shouldComplete) {\r\n var questions = lodash(vm.directentry.PatientSurveys).pluck(\"PatientSurveyQuestions\").flatten().value();\r\n\r\n var surveysToComplete = [];\r\n if (shouldComplete) {\r\n surveysToComplete = lodash(questions).filter({\r\n ShouldSave: true\r\n }).pluck(\"PatientSurveyId\").unique().value();\r\n }\r\n\r\n return DirectEntryService.savePatientResponses(vm.patientId, questions, surveysToComplete, vm.directentry.PatientTimeZone, vm.dueDate, vm.responseTime).then(function() {\r\n lodash(questions).map(function(q) {\r\n //Lock down the questions that are about to be saved.\r\n if (q.ShouldSave) {\r\n q.IsAnswered = true;\r\n }\r\n //Lock down all questions in the survey if the survey is set to complete.\r\n if (lodash(surveysToComplete).contains(q.PatientSurveyId)) {\r\n q.IsAnswered = true;\r\n }\r\n return q;\r\n }).value();\r\n\r\n vm.originaldirectentry = deepCopy(vm.directentry);\r\n $scope.directEntryForm.$setPristine();\r\n });\r\n }\r\n\r\n function cancel() {\r\n vm.directentry = deepCopy(vm.originaldirectentry);\r\n $scope.directEntryForm.$setPristine();\r\n }\r\n\r\n function isValid() {\r\n if (vm.directentry === undefined) {\r\n return true;\r\n }\r\n var questions = lodash(vm.directentry.PatientSurveys).pluck(\"PatientSurveyQuestions\").flatten().value();\r\n \r\n return lodash.findIndex(questions, function(question) {\r\n return question.isValid === false;\r\n }) === -1;\r\n }\r\n\r\n function deepCopy(o) {\r\n var gdcc = \"__copy__\";\r\n if (o !== Object(o)) {\r\n return o; // primitive value\r\n }\r\n var set = gdcc in o,\r\n cache = o[gdcc],\r\n result;\r\n if (set && typeof cache == \"function\") {\r\n return cache();\r\n }\r\n\r\n o[gdcc] = function() {\r\n return result;\r\n }; // overwrite\r\n\r\n if (o instanceof Array) {\r\n result = [];\r\n for (var i=0; i 0) {\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.AddressLine2, Value: question.address2});\r\n }\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.City, Value: question.city});\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.State, Value: question.state});\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.Zip, Value: question.zip});\r\n break;\r\n }\r\n\r\n case SurveyQuestionAttribute.Date: {\r\n let value = moment(question.Answer).format('YYYY-MM-DD');\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.Date, Value: value});\r\n break; \r\n }\r\n\r\n case SurveyQuestionAttribute.DateMonthYear: {\r\n let value = moment(question.Answer).format('YYYY-MM');\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.Date, Value: value});\r\n break; \r\n }\r\n\r\n case SurveyQuestionAttribute.Time: {\r\n let value = moment(question.Answer).format('HH:mm');\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.Time, Value: value});\r\n break;\r\n }\r\n\r\n case SurveyQuestionAttribute.DateTime: {\r\n let date = moment(question.Answer).format('YYYY-MM-DD');\r\n let time = moment(question.Answer).format('HH:mm');\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.Date, Value: date});\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.Time, Value: time});\r\n break; \r\n }\r\n\r\n default: {\r\n responses.push({SurveyParameterTypeId: SurveyParameterType.Survey, Value: question.Answer});\r\n break;\r\n }\r\n }\r\n\r\n return responses;\r\n }\r\n\r\n\r\n function savePatientResponses(patientId, questions, surveysToComplete, patientTimeZone, dueDate, responseTime) {\r\n var patientResponses = [];\r\n\r\n var overallResponseDateTime = dueDate;\r\n if (responseTime) {\r\n overallResponseDateTime = new Date(dueDate.getFullYear(), dueDate.getMonth(), dueDate.getDate(), responseTime.getHours(), responseTime.getMinutes());\r\n }\r\n\r\n questions.forEach(function(question) {\r\n if (question.ShouldSave && !question.IsAnswered) {\r\n //What the caregiver types in is presumed to be in the patient time zone.\r\n //To accomplish that, we chop off the time zone from what they typed in and assign the patient's time zone instead (just changing the time zone, not converting the whole date time).\r\n //Then, we convert the time from the patient's time zone to the caregiver's time zone so that Angular black magic can convert that to UTC.\r\n var format = \"dddd, MMMM D YYYY, h:mm:ss a\";\r\n var observationDateTime = question.ObservationDateTime ? moment(question.ObservationDateTime).format() : moment(overallResponseDateTime).format();\r\n var patientTimeFormat = moment(new Date(),format).tz(patientTimeZone);\r\n var caregiverTimeFormat = moment(new Date(), format).tz(moment.tz.guess());\r\n var caregiverOffset = caregiverTimeFormat.utcOffset();\r\n var patientOffset = patientTimeFormat.utcOffset();\r\n\r\n if (patientOffset != caregiverOffset) {\r\n observationDateTime = new Date(moment(new Date(observationDateTime)).utcOffset(2 * caregiverOffset - patientOffset).format('YYYY-MM-DD HH:mm'));\r\n } else {\r\n observationDateTime = new Date(moment(new Date(observationDateTime)).format('YYYY-MM-DD HH:mm'));\r\n }\r\n\r\n const patientResponse = getResponseForQuestion(question, patientId, observationDateTime);\r\n patientResponses.push(patientResponse);\r\n }\r\n });\r\n\r\n var promise;\r\n\r\n if (patientResponses.length > 0) {\r\n promise = $http.post('/api/PatientResponse', patientResponses).then(function() {\r\n //Complete every survey that was affected.\r\n if (surveysToComplete.length > 0) {\r\n var data = [];\r\n lodash(surveysToComplete).forEach(function(patientSurveyId) {\r\n var surveyComplete = {\r\n PatientSurveyId: patientSurveyId,\r\n CompletedOn_UTC: overallResponseDateTime\r\n };\r\n data.push(surveyComplete);\r\n }).value();\r\n\r\n $http.post('/api/PatientSurveyCompletedDirect', data).then(function() {\r\n $rootScope.$emit(\"vh:patientUpdated\", patientId);\r\n });\r\n }\r\n else {\r\n $rootScope.$emit(\"vh:patientUpdated\", patientId);\r\n }\r\n });\r\n } else {\r\n promise = $q.resolve();\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n return {\r\n getDirectEntry: getDirectEntry,\r\n savePatientResponses: savePatientResponses,\r\n getPatientConditionValues: getPatientConditionValues\r\n };\r\n\r\n}\r\n\r\nangular.module('patient.directentry')\r\n .service('DirectEntryService', DirectEntryService)\r\n .constant('SurveyQuestionAttribute', {\r\n AlphaNumeric: 1,\r\n Numeric: 2,\r\n MaxLength: 3,\r\n DecimalPlacesAllowed: 4,\r\n MaxValue: 5,\r\n MinValue: 6,\r\n Address: 7,\r\n DateTime: 8,\r\n DateMonthYear: 9,\r\n Date: 10,\r\n Time: 11,\r\n Milestone: 12,\r\n PreviousDaysAllowed: 13,\r\n FutureDaysAllowed: 14\r\n });\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/directentry.tpl.html',\n '
          Patient Direct Entry
          Future Date Not Permitted
          vm.maxTime)}\" uib-timepicker=\"\" max=\"vm.maxTime\" ng-model=\"vm.responseTime\" hour-step=\"1\" minute-step=\"1\" required=\"\">
          vm.maxTime)\" class=\"text-danger\">Valid Time Required
          {{survey.Name}}{{survey.PatientSurveySchedule | schedule }}

          No Available Pathways

          ');\n}]);\n}(window, document, window.angular));","function QuestionDirective($compile, $filter, lodash, TemplatesService, SurveyQuestionAttribute) {\r\n\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n question: \"=\",\r\n devm: \"=\"\r\n },\r\n templateUrl: \"modules/patient/directentry/question.tpl.html\",\r\n require: ['^deSurvey', '^form'],\r\n link: function(scope, element, attributes, controllers) {\r\n const [surveyController, formController] = controllers;\r\n const DateTimeFilter = $filter('datetime');\r\n\r\n const questionTemplates = {\r\n biometric: 'biometric',\r\n singleSelect: 'singleselect',\r\n multiSelect: 'multiselect',\r\n healthtip: 'healthtip',\r\n alphanumeric: 'custom-alphanumeric',\r\n numeric: 'custom-numeric',\r\n address: 'custom-address',\r\n date: 'custom-date',\r\n time: 'custom-time',\r\n datetime: 'custom-datetime',\r\n dateMonthYear: 'custom-datemonthyear'\r\n };\r\n\r\n if (scope.question.ChildPatientSurveyQuestions && scope.question.ChildPatientSurveyQuestions.length > 0) {\r\n var count = 1;\r\n lodash.forEach(scope.question.ChildPatientSurveyQuestions, function(q) {\r\n q.displayIndex = count;\r\n count++;\r\n });\r\n\r\n $compile(`\r\n
          \r\n \r\n
          `)\r\n (scope, function(cloned, scope) {\r\n element.find('ol').append(cloned);\r\n }, {\r\n /*\r\n transcludeControllers: {\r\n form: formController\r\n }\r\n */\r\n });\r\n }\r\n\r\n scope.questionAttributesEnum = SurveyQuestionAttribute;\r\n scope.isHealthTip = TemplatesService.isHealthTipQuestion;\r\n scope.isVideo = TemplatesService.isVideoQuestion;\r\n scope.isBiometric = TemplatesService.isBiometricQuestion;\r\n scope.isCustomResponse = TemplatesService.isCustomResponseQuestion;\r\n scope.isMultiSelect = TemplatesService.isMultiSelectQuestion;\r\n scope.isSingleSelect = TemplatesService.isSingleSelectQuestion;\r\n scope.isAlphaNumeric = false;\r\n scope.isNumeric = false;\r\n scope.isAddress = false;\r\n scope.previousDaysAllowed = false;\r\n scope.futureDaysAllowed = false;\r\n scope.singleSelectLongOption = {};\r\n scope.states = [ \"Alabama\", \"Alaska\", \"Arizona\", \"Arkansas\", \"California\", \"Colorado\", \"Connecticut\", \"Delaware\", \"Florida\", \"Georgia\", \"Hawaii\", \"Idaho\",\r\n \"Illinois\", \"Indiana\", \"Iowa\", \"Kansas\", \"Kentucky\", \"Louisiana\", \"Maine\", \"Maryland\", \"Massachusetts\", \"Michigan\", \"Minnesota\", \"Mississippi\",\r\n \"Missouri\", \"Montana\", \"Nebraska\", \"Nevada\", \"New Hampshire\", \"New Jersey\", \"New Mexico\", \"New York\", \"North Carolina\", \"North Dakota\", \"Ohio\",\r\n \"Oklahoma\", \"Oregon\", \"Pennsylvania\", \"Rhode Island\", \"South Carolina\", \"South Dakota\", \"Tennessee\", \"Texas\", \"Utah\", \"Vermont\", \"Virginia\",\r\n \"Washington\", \"West Virginia\", \"Wisconsin\", \"Wyoming\" ];\r\n\r\n if (scope.isBiometric(scope.question)) {\r\n scope.questionType = 'biometric';\r\n\r\n } else if (scope.isHealthTip(scope.question)) {\r\n scope.questionType = 'healthtip';\r\n\r\n } else if (scope.isVideo(scope.question)) {\r\n scope.questionType = 'singleSelect';\r\n\r\n } else if (scope.isSingleSelect(scope.question)) {\r\n scope.questionType = 'singleSelect';\r\n\r\n } else if (scope.isMultiSelect(scope.question)) {\r\n scope.questionType = 'multiSelect';\r\n\r\n } else if (scope.isCustomResponse(scope.question)) {\r\n\r\n lodash.forEach(scope.question.SurveyQuestionAttributes, function(attribute) {\r\n switch(attribute.QuestionAttributeId) {\r\n \r\n case scope.questionAttributesEnum.AlphaNumeric:\r\n scope.isAlphaNumeric = true;\r\n scope.questionType = 'alphanumeric';\r\n scope.question.text = scope.question.CustomResponseAnswer;\r\n break;\r\n\r\n case scope.questionAttributesEnum.Numeric:\r\n scope.isNumeric = true;\r\n scope.questionType = 'numeric';\r\n scope.question.text = scope.question.CustomResponseAnswer;\r\n break;\r\n\r\n case scope.questionAttributesEnum.Address:\r\n scope.isAddress = true;\r\n scope.questionType = 'address';\r\n break;\r\n\r\n case scope.questionAttributesEnum.Date:\r\n scope.isDate = true;\r\n scope.questionType = 'date';\r\n if (scope.question.CustomResponseAnswer) {\r\n scope.question.date = moment(scope.question.CustomResponseAnswer).toDate();\r\n scope.question.Answer = moment(scope.question.CustomResponseAnswer).toDate();\r\n }\r\n break;\r\n\r\n case scope.questionAttributesEnum.Time:\r\n scope.isTime = true;\r\n scope.questionType = 'time';\r\n if (scope.question.CustomResponseAnswer) {\r\n scope.question.time = moment(scope.question.CustomResponseAnswer, 'HH:mm').toDate();\r\n scope.question.Answer = moment(scope.question.CustomResponseAnswer, 'HH:mm').toDate();\r\n }\r\n break;\r\n\r\n case scope.questionAttributesEnum.DateTime:\r\n scope.isDateTime = true;\r\n scope.questionType = 'datetime';\r\n if (scope.question.CustomResponseAnswer) {\r\n scope.question.date = moment(scope.question.CustomResponseAnswer).toDate();\r\n scope.question.time = moment(scope.question.CustomResponseAnswer).toDate();\r\n scope.question.Answer = moment(scope.question.CustomResponseAnswer).toDate();\r\n }\r\n break;\r\n\r\n case scope.questionAttributesEnum.DateMonthYear:\r\n scope.isMonthYear = true;\r\n scope.questionType = 'dateMonthYear';\r\n if (scope.question.CustomResponseAnswer) {\r\n const dateFormat = 'YYYY-MM';\r\n scope.question.date = moment(scope.question.CustomResponseAnswer, dateFormat).toDate();\r\n scope.question.Answer = moment(scope.question.CustomResponseAnswer, dateFormat).toDate();\r\n }\r\n break;\r\n\r\n case scope.questionAttributesEnum.MaxLength:\r\n scope.maxLength = attribute.Value;\r\n break;\r\n\r\n case scope.questionAttributesEnum.DecimalPlacesAllowed:\r\n scope.decimalPlacesAllowed = attribute.Value;\r\n break;\r\n\r\n case scope.questionAttributesEnum.MaxValue:\r\n scope.maxValue = attribute.Value;\r\n break;\r\n\r\n case scope.questionAttributesEnum.MinValue:\r\n scope.minValue = attribute.Value;\r\n break;\r\n\r\n case scope.questionAttributesEnum.Milestone:\r\n scope.milestoneId = attribute.Value;\r\n break;\r\n\r\n case scope.questionAttributesEnum.PreviousDaysAllowed:\r\n scope.previousDaysAllowed = attribute.Value;\r\n break;\r\n\r\n case scope.questionAttributesEnum.FutureDaysAllowed:\r\n scope.futureDaysAllowed = attribute.Value;\r\n break;\r\n }\r\n });\r\n }\r\n\r\n if (scope.isDateTime || scope.isMonthYear || scope.isDate) {\r\n scope.datepickerOptions = getDatePickerOptions();\r\n scope.minDate = scope.datepickerOptions.minDate;\r\n scope.maxDate = scope.datepickerOptions.maxDate;\r\n }\r\n\r\n function getDatePickerOptions() {\r\n var minDate = moment().startOf('day').toDate();\r\n var maxDate = moment().endOf('day').toDate();\r\n \r\n if (scope.previousDaysAllowed > 0) {\r\n if (scope.isMonthYear) {\r\n minDate = moment().subtract(scope.previousDaysAllowed, 'months').startOf('month').toDate();\r\n } else {\r\n minDate = moment().subtract(scope.previousDaysAllowed, 'days').startOf('day').toDate();\r\n }\r\n } else if (scope.previousDaysAllowed === 0) {\r\n minDate = null; //no limit\r\n }\r\n \r\n if (scope.futureDaysAllowed > 0) {\r\n if (scope.isMonthYear) {\r\n maxDate = moment().add(scope.futureDaysAllowed, 'months').endOf('month').toDate();\r\n } else {\r\n maxDate = moment().add(scope.futureDaysAllowed, 'days').startOf('day').toDate();\r\n }\r\n } else if (scope.futureDaysAllowed === 0) {\r\n maxDate = null; //no limit\r\n }\r\n\r\n return {\r\n minDate: minDate,\r\n maxDate: maxDate,\r\n datepickerMode: scope.isMonthYear ? \"month\" : \"day\",\r\n minMode: scope.isMonthYear ? \"month\" : \"day\",\r\n }\r\n }\r\n\r\n scope.getTemplate = function() {\r\n let templateName = questionTemplates[scope.questionType] || 'missing';\r\n return 'modules/patient/directentry/templates/question-' + templateName + '.tpl.html';\r\n }\r\n\r\n scope.clickedBiometric = function() {\r\n surveyController.openBiometrics();\r\n };\r\n\r\n scope.setFocus = function(event) {\r\n event.preventDefault();\r\n scope.$broadcast('question.focus');\r\n };\r\n\r\n scope.longSelectChanged = function(option) {\r\n var question = option.ParentPatientSurveyQuestion;\r\n //For single-select questions, we need to de-select any other options that were previously selected\r\n if (scope.isSingleSelect(question)) {\r\n lodash.forEach(question.PatientSurveyOptions, function(o) {\r\n if (o.PatientSurveyOptionId != option.PatientSurveyOptionId) {\r\n o.Selected = false;\r\n }\r\n });\r\n }\r\n //For easing the logic on the saving side via ShouldSave.\r\n if (lodash(question.PatientSurveyOptions).any({Selected: true})) {\r\n question.ShouldSave = true;\r\n //Note the selected option ID to know what nested questions to show.\r\n question.selectedOptionId = option.PatientSurveyOptionId;\r\n scope.devm.addTag(question.Tags);\r\n scope.devm.addTag(option.Tags);\r\n scope.devm.processRules();\r\n }\r\n else {\r\n question.ShouldSave = false;\r\n }\r\n }\r\n\r\n scope.formatAnswer = function(answer) {\r\n if (!answer) {\r\n return;\r\n }\r\n\r\n let result = answer;\r\n\r\n if (scope.isDateTime) {\r\n result = DateTimeFilter(answer, 'datetime');\r\n } else if (scope.isDate) {\r\n result = DateTimeFilter(answer);\r\n } else if (scope.isMonthYear) {\r\n result = moment(answer).format('MM/YYYY');\r\n } else if (scope.isTime) {\r\n result = moment(answer).format('HH:mm');\r\n }\r\n\r\n return result;\r\n }\r\n\r\n scope.optionChanged = function (option) {\r\n var question = option.ParentPatientSurveyQuestion;\r\n var siblingOptions = lodash(question.PatientSurveyOptions).filter(function (siblingOption) {\r\n return siblingOption.PatientSurveyOptionId !== option.PatientSurveyOptionId;\r\n }).value();\r\n\r\n //For easing the logic on the saving side via ShouldSave.\r\n if (lodash(question.PatientSurveyOptions).any({Selected: true})) {\r\n question.ShouldSave = true;\r\n //Note the selected option ID to know what nested questions to show.\r\n question.selectedOptionId = option.PatientSurveyOptionId;\r\n scope.devm.addTag(question.Tags);\r\n scope.devm.addTag(option.Tags);\r\n scope.devm.processRules();\r\n }\r\n else {\r\n question.ShouldSave = false;\r\n }\r\n\r\n //Do not allow multiple boxes checked for non-multi select questions.\r\n if (question.SurveyQuestionTypeId !== 7) {\r\n //Uncheck sibling options and their children.\r\n lodash(siblingOptions).map(function (o) {\r\n if (o.Selected == true) {\r\n if (option.Tags && option.Tags.indexOf('AddPoints') != -1 && o.Tags && o.Tags.indexOf('AddPoints') != -1) {\r\n scope.devm.addTag(o.Tags.replace('AddPoints', 'subtractpoints'));\r\n scope.devm.processRules();\r\n }\r\n }\r\n o.Selected = false;\r\n\r\n //NOTE: This will not uncheck children of multiselect question options.\r\n //Currently, we don't nest under multiselect options, so it isn't an issue.\r\n lodash(o.PatientSurveyQuestions).pluck(\"PatientSurveyOptions\").flatten().map(function (qo) {\r\n qo.Selected = false;\r\n scope.optionChanged(qo);\r\n return qo;\r\n }).value();\r\n\r\n return o;\r\n }).value();\r\n\r\n scope.toggleCollapse(question);\r\n }\r\n }\r\n\r\n scope.healthTipSelected = function(question) {\r\n scope.devm.addTag(question.Tags);\r\n scope.devm.processRules();\r\n scope.toggleCollapse(question);\r\n question.Answer = scope.devm.processHealthTipText(question);\r\n question.ShouldSave = true;\r\n if (question && !question.IsAnswered) {\r\n formController.$setDirty();\r\n }\r\n }\r\n\r\n function isValidNumber(text) {\r\n if (text == undefined || (text < scope.minValue || text > scope.maxValue) ||\r\n (scope.decimalPlacesAllowed === 0 && text.toString().indexOf(\".\") >= 0 ) ||\r\n (scope.decimalPlacesAllowed > 0 && text.toString().indexOf(\".\") >= 0 && text.toString().split(\".\")[1].length > scope.decimalPlacesAllowed)) {\r\n return false;\r\n }\r\n return !isNaN(text);\r\n }\r\n\r\n function isValidAddress(question) {\r\n if (question.SurveyQuestionAttributes.length < 1 ||\r\n question.SurveyQuestionAttributes[0].QuestionAttributeId !== scope.questionAttributesEnum.Address) {\r\n return false;\r\n }\r\n\r\n if (!question.address1 || !question.city || !question.state || !question.zip) {\r\n return false;\r\n }\r\n\r\n if (question.address1.length === 0 ||\r\n question.city.length === 0 ||\r\n question.state.length === 0 ||\r\n question.zip.length === 0) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n function isValidDate(question) {\r\n if (question.date === undefined) return undefined; //not set\r\n if (question.date === null) return false;\r\n if (scope.minDate != null && question.date.getTime() < scope.minDate.getTime()) {\r\n return false;\r\n }\r\n if (scope.maxDate != null && question.date.getTime() > scope.maxDate.getTime()) {\r\n return false;\r\n }\r\n if (scope.isDateTime && !question.time) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n scope.customResponseQuestionAnswered = function(question) {\r\n question.isValid = true;\r\n if (question.IsAnswered) return;\r\n\r\n if (scope.isNumeric) {\r\n question.isValid = isValidNumber(question.text);\r\n } else if (scope.isAddress) {\r\n question.isValid = isValidAddress(question);\r\n } else if (scope.isDate || scope.isDateTime || scope.isMonthYear) {\r\n question.isValid = isValidDate(question);\r\n question.Answer = question.isValid ? moment(question.date).startOf('day').add(moment.duration(question.time)).toDate() : null;\r\n } else if (scope.isTime) {\r\n question.isValid = (question.time !== null);\r\n question.Answer = question.time;\r\n } else if (scope.isAlphaNumeric && (!question.text || question.text.length === 0)) {\r\n return;\r\n }\r\n\r\n if (!question.isValid) {\r\n return;\r\n }\r\n\r\n scope.devm.addTag(question.Tags);\r\n scope.devm.processRules();\r\n\r\n if (!scope.isAddress && !scope.isDate && !scope.isTime && !scope.isDateTime && !scope.isMonthYear) {\r\n scope.toggleCollapse(question);\r\n }\r\n\r\n question.ShouldSave = true;\r\n\r\n if (question && !question.IsAnswered) {\r\n formController.$setDirty();\r\n }\r\n }\r\n\r\n scope.toggleCollapse = function(question) {\r\n if (scope.isAddress && question.IsAnswered) {\r\n return;\r\n }\r\n\r\n question.isCollapsed = !question.isCollapsed;\r\n\r\n //Only attempt to write answers from options for survey questions.\r\n if (!scope.isBiometric(question) && !scope.isHealthTip(question) && !scope.isCustomResponse(question)) {\r\n //Setup Question.Answer for showing answers in a collapsed view.\r\n if (lodash(question.PatientSurveyOptions).any({Selected: true})) {\r\n question.Answer = null;\r\n lodash(question.PatientSurveyOptions).where({Selected: true}).forEach(function(o) {\r\n if (question.Answer) {\r\n question.Answer += \", \" + o.Text;\r\n }\r\n else {\r\n question.Answer = o.Text;\r\n }\r\n }).value();\r\n }\r\n else {\r\n question.Answer = null;\r\n }\r\n } else if (scope.isCustomResponse(question) && (question.text || question.text === 0)) {\r\n question.Answer = question.text;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n\r\nangular.module(\"patient.directentry\").directive(\"deQuestion\", QuestionDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/question.tpl.html',\n '
        • {{question.displayIndex}}. {{question.Text}} - {{formatAnswer(question.Answer)}}
            0\">
        • ');\n}]);\n}(window, document, window.angular));","function SurveyDirective() {\r\n\r\n return {\r\n restrict: \"A\",\r\n scope: {\r\n survey: \"=\",\r\n openBiometrics: \"&\"\r\n },\r\n controller: function($scope) {\r\n this.openBiometrics = function() {\r\n $scope.openBiometrics({patientSurveyId: $scope.survey.PatientSurveyId});\r\n };\r\n }\r\n }\r\n}\r\n\r\n\r\nangular.module(\"patient.directentry\").directive(\"deSurvey\", SurveyDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-biometric.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-custom-address.tpl.html',\n '
          * Address 1 Address 2 * City * State * Postal Code * Required fields must be completed
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-custom-alphanumeric.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-custom-date.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-custom-datemonthyear.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-custom-datetime.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-custom-numeric.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-custom-time.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-healthtip.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-missing.tpl.html',\n '
          ** Unknown question type ** {{question}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-multiselect.tpl.html',\n '
          5\">
          {{$item.Text}}{{option.Text}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/directentry/templates/question-singleselect.tpl.html',\n '
          5\">
          ');\n}]);\n}(window, document, window.angular));","function FormInfoDirective() {\r\n function controller($scope) {\r\n $scope.showModifiedField = function(patientForm) {\r\n var cDate = new Date(patientForm.CreatedDateTime_UTC);\r\n var mDate = new Date(patientForm.ModifiedDateTime_UTC);\r\n if (cDate.getFullYear() != mDate.getFullYear()\r\n || cDate.getMonth() != mDate.getMonth()\r\n || cDate.getDate() != mDate.getDate()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: \"E\",\r\n replace: true,\r\n scope: {\r\n form: \"=\",\r\n },\r\n templateUrl: \"modules/patient/forms/form-info.tpl.html\"\r\n };\r\n}\r\n\r\nangular.module(\"patient.forms\").directive(\"formInfo\", FormInfoDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/forms/form-info.tpl.html',\n '
          Created:
           {{patientForm.CreatedDateTime_UTC | datetime}} by {{patientForm.CreatedByName}} |  {{patientForm.PostProcessorResult.ResultName}} :{{patientForm.PostProcessorResult.ResultValue}}   Incomplete
          Modified:
           {{patientForm.ModifiedDateTime_UTC | datetime: \\'date\\' : \\'UTC\\'}} by {{patientForm.ModifiedByName}}
          ');\n}]);\n}(window, document, window.angular));","function PatientFormController(form, questionValues, $stateParams, lodash, PatientFormsService, $state, $scope, $filter, PermissionService, vhSweetAlert, $uibModal, lists, FormQuestionType, ConfigurationsService, SurveyQuestionType, SurveyParameterType, moment, patientParameters) {\r\n var pfvm = this;\r\n // data\r\n pfvm.form = form.currentForm || form;\r\n pfvm.pastForms = form.otherForms || [];\r\n\r\n pfvm.canAddNew = !$stateParams.isCreate && lodash.every(form.otherForms, \"IsLocked\");\r\n pfvm.formId = pfvm.form.FormId;\r\n\r\n // Status: 4 = Processed\r\n pfvm.form.IsLocked = pfvm.form.IsLocked || pfvm.form.Status == 4;\r\n\r\n pfvm.editable = !pfvm.form.IsLocked && PermissionService.userHasPermission(\"PatientFormWrite\");\r\n pfvm.webformfields = [];\r\n pfvm.toggleProvider = toggleProvider;\r\n pfvm.graphData = {};\r\n\r\n pfvm.FormQuestionType = FormQuestionType;\r\n pfvm.patientParameters = patientParameters;0\r\n\r\n // functions\r\n pfvm.cancel = cancel;\r\n pfvm.saveForm = saveForm;\r\n pfvm.runChartPostProcessor = runChartPostProcessor;\r\n pfvm.runHrmPostProcessor = runHrmPostProcessor;\r\n pfvm.gridChanged = gridChanged;\r\n pfvm.gridLostFocus = gridLostFocus;\r\n pfvm.showChartButton = showChartButton;\r\n pfvm.hasPatientParameterType = hasPatientParameterType;\r\n\r\n pfvm.GraphDataDefaultDays = ConfigurationsService.configParams.GraphDataDefaultDays;\r\n pfvm.dateformat = ConfigurationsService.configParams.DateFormat.toLowerCase();\r\n\r\n pfvm.showHrmButtons = showHrmButtons;\r\n pfvm.checkIfComplete = checkIfComplete;\r\n pfvm.isSendDisabled = isSendDisabled;\r\n\r\n pfvm.getTitleForSendButton = getTitleForSendButton;\r\n\r\n if (pfvm.form.PostProcessorResult) {\r\n mapPostProcessing(pfvm.form.PostProcessorResult);\r\n }\r\n if (pfvm.form.pendingPostProcessor) {\r\n pfvm.form.pendingPostProcessor.then(mapPostProcessing);\r\n }\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n updateLocked(pfvm.pastForms);\r\n defineWebformFields(lists.WebFormFields);\r\n setVariables();\r\n\r\n pfvm.weightData = pfvm.form.WeightBiometrics;\r\n\r\n if (pfvm.form.PostProcessor === 'Vivify.Platform.Components.Forms.HRMFormPostProcessor' && pfvm.form.Parameters && pfvm.form.Parameters.length > 0) {\r\n setCaregivers();\r\n }\r\n\r\n // mark options checked for Checkbox question types\r\n var checkBoxQuestions = lodash(pfvm.form.FormSections).pluck(\"FormQuestions\").flatten().any(function (q) {\r\n if (q.FormQuestionTypeId == pfvm.FormQuestionType.Checkboxes || q.FormQuestionTypeId == pfvm.FormQuestionType.InlineCheckboxs) {\r\n var selectedItemIds = JSON.parse(q.SelectedOptionIds);\r\n lodash.forEach(selectedItemIds, function (id) {\r\n var selectedOption = lodash.find(q.FormOptions, {FormOptionId: id});\r\n selectedOption.Checked = true;\r\n });\r\n }\r\n });\r\n\r\n // prep data for Med Rec question types\r\n var gridQuestions = lodash(pfvm.form.FormSections).pluck(\"FormQuestions\").flatten().any(function (q) {\r\n if (q.FormQuestionTypeId == pfvm.FormQuestionType.Grid) {\r\n if (q.AnswerText !== undefined && q.AnswerText !== null && q.AnswerText.length > 0) {\r\n q.Rows = JSON.parse(q.AnswerText);\r\n }\r\n else {\r\n q.Rows = [];\r\n var row = [];\r\n lodash.forEach(q.FormOptions, function (o) {\r\n row.push({});\r\n });\r\n q.Rows.push(row);\r\n }\r\n }\r\n });\r\n\r\n // prep date questions\r\n lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .filter(function (q) {\r\n return q.FormQuestionTypeId == pfvm.FormQuestionType.Date;\r\n })\r\n .value()\r\n .forEach(function (q) {\r\n if (q.AnswerText && q.AnswerText.length > 0) {\r\n q.date = new Date(Date.parse(q.AnswerText));\r\n } else {\r\n q.date = new Date();\r\n }\r\n });\r\n\r\n setFormsComplete();\r\n\r\n setVariables();\r\n\r\n buildGraphs();\r\n }\r\n\r\n function buildGraphs() {\r\n\r\n pfvm.graphData = {};\r\n\r\n lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .value()\r\n .forEach(function (question) {\r\n if (question.FormQuestionTypeId === pfvm.FormQuestionType.PulseGraph && question.AnswerText && question.AnswerText.length > 0) {\r\n pfvm.graphData.pulse = JSON.parse(question.AnswerText);\r\n pfvm.graphData.pulse.endDate = pfvm.graphData.pulse.endDate && moment(pfvm.graphData.pulse.endDate).toDate();\r\n pfvm.graphData.pulse.dataset.data.forEach(function(value){\r\n value.forEach(function(val){\r\n val.date = moment(val.date).toDate();\r\n });\r\n });\r\n }\r\n if (question.FormQuestionTypeId === pfvm.FormQuestionType.WeightGraph && question.AnswerText && question.AnswerText.length > 0) {\r\n pfvm.graphData.weight = JSON.parse(question.AnswerText);\r\n pfvm.graphData.weight.endDate = pfvm.graphData.weight.endDate && moment(pfvm.graphData.weight.endDate).toDate();\r\n pfvm.graphData.weight.dataset.data.forEach(function(value){\r\n value.forEach(function(val){\r\n val.date = moment(val.date).toDate();\r\n });\r\n });\r\n }\r\n if (question.FormQuestionTypeId === pfvm.FormQuestionType.O2Graph && question.AnswerText && question.AnswerText.length > 0) {\r\n pfvm.graphData.o2 = JSON.parse(question.AnswerText);\r\n pfvm.graphData.o2.endDate = pfvm.graphData.o2.endDate && moment(pfvm.graphData.o2.endDate).toDate();\r\n pfvm.graphData.o2.dataset.data.forEach(function(value){\r\n value.forEach(function(val){\r\n val.date = moment(val.date).toDate();\r\n });\r\n });\r\n }\r\n if (question.FormQuestionTypeId === pfvm.FormQuestionType.BPGraph && question.AnswerText && question.AnswerText.length > 0) {\r\n pfvm.graphData.bp = JSON.parse(question.AnswerText);\r\n pfvm.graphData.bp.endDate = pfvm.graphData.bp.endDate && moment(pfvm.graphData.bp.endDate).toDate();\r\n pfvm.graphData.bp.dataset.data.forEach(function(value){\r\n value.forEach(function(val){\r\n val.date = moment(val.date).toDate();\r\n });\r\n });\r\n }\r\n });\r\n\r\n if (pfvm.graphData.pulse || pfvm.graphData.weight || pfvm.graphData.o2 || pfvm.graphData.bp) {\r\n\r\n return;\r\n }\r\n\r\n var graphEndDate = moment().toDate();\r\n\r\n pfvm.graphData = {\r\n weight: {\r\n dataset: {\r\n baseline: [pfvm.patientParameters.WeightScaleParameters.Baseline_Weight],\r\n parameter: [],\r\n symbol: [\"\\u25A0\"],\r\n data: []\r\n },\r\n endDate: graphEndDate\r\n },\r\n pulse: {\r\n dataset: {\r\n baseline: [],\r\n parameter: [],\r\n symbol: [\"\\u25A0\"],\r\n data: []\r\n },\r\n endDate: graphEndDate\r\n },\r\n o2: {\r\n dataset: {\r\n baseline: [],\r\n parameter: [],\r\n symbol: [\"\\u25A0\"],\r\n data: []\r\n },\r\n endDate: graphEndDate\r\n },\r\n bp: {\r\n dataset: {\r\n baseline: [],\r\n parameter: [],\r\n symbol: [\"\\u25A0\", \"\\u25CF\"],\r\n data: []\r\n },\r\n endDate: graphEndDate\r\n }\r\n };\r\n\r\n if (pfvm.form.PatientFormPatientResponses && pfvm.form.PatientFormPatientResponses.Biometrics) {\r\n\r\n var biometrics = pfvm.form.PatientFormPatientResponses.Biometrics.map(function (biometric) {\r\n biometric.Responses = biometric.Responses.filter(function (r) {\r\n return r.DeletedDateTime_UTC === null;\r\n });\r\n\r\n return biometric;\r\n });\r\n\r\n var weightResponses = lodash.find(biometrics, {SurveyQuestionType: SurveyQuestionType.Weight});\r\n if (weightResponses) {\r\n pfvm.graphData.weight.dataset.parameter.push({\r\n name: getParameterText('Weight', weightResponses.UnitOfMeasure),\r\n min: pfvm.patientParameters.WeightScaleParameters.Min_Weight,\r\n max: pfvm.patientParameters.WeightScaleParameters.Max_Weight\r\n });\r\n pfvm.graphData.weight.dataset.data.push(lodash(weightResponses.Responses).pluck('Values').flatten().value().filter(function (val) {\r\n return val.SurveyParameterTypeId === SurveyParameterType.Weight && !isNaN(parseFloat(val.Value))\r\n })\r\n .map(function (val) {\r\n return {\r\n date: moment(val.ObservationDateTime_UTC).toDate(),\r\n value: parseFloat(val.Value)\r\n }\r\n }));\r\n }\r\n\r\n var pulseOxResponses = lodash.find(biometrics, {SurveyQuestionType: SurveyQuestionType.PulseOx});\r\n var pulseResponses = lodash.find(biometrics, {SurveyQuestionType: SurveyQuestionType.Pulse});\r\n var pulseBpResponses = lodash.find(biometrics, {SurveyQuestionType: SurveyQuestionType.BloodPressure});\r\n\r\n var pulseOxValues = pulseOxResponses && lodash(pulseOxResponses.Responses)\r\n .pluck('Values')\r\n .flatten()\r\n .value();\r\n var pulseValues = pulseResponses && lodash(pulseResponses.Responses)\r\n .pluck('Values')\r\n .flatten()\r\n .value();\r\n var pulseBpValues = pulseBpResponses && lodash(pulseBpResponses.Responses)\r\n .pluck('Values')\r\n .flatten()\r\n .value();\r\n\r\n if(pulseOxValues) {\r\n if (pulseValues)\r\n pulseValues = pulseValues.concat(pulseOxValues);\r\n else\r\n pulseValues = pulseOxValues;\r\n }\r\n\r\n if(pulseBpValues) {\r\n if (pulseValues)\r\n pulseValues = pulseValues.concat(pulseBpValues);\r\n else\r\n pulseValues = pulseBpValues;\r\n }\r\n\r\n if (pulseValues) {\r\n pfvm.graphData.pulse.dataset.parameter.push({\r\n name: getParameterText('Pulse', 'bpm'),\r\n min: pfvm.patientParameters.PulseOxParameters.Med_Alert_Pulse,\r\n max: pfvm.patientParameters.PulseOxParameters.High_Alert_Pulse\r\n });\r\n pfvm.graphData.pulse.dataset.data.push(\r\n lodash(pulseValues)\r\n .filter(function (val) {\r\n return val.SurveyParameterTypeId === SurveyParameterType.Pulse && !isNaN(parseFloat(val.Value))\r\n })\r\n .map(function (val) {\r\n return {\r\n date: moment(val.ObservationDateTime_UTC).toDate(),\r\n value: parseFloat(val.Value)\r\n }\r\n })\r\n .sortBy(function(val) {\r\n return val.date;\r\n })\r\n .value());\r\n }\r\n\r\n var o2Responses = lodash.find(biometrics, {SurveyQuestionType: SurveyQuestionType.Oxygen});\r\n\r\n var o2Values = o2Responses && lodash(o2Responses.Responses)\r\n .pluck('Values')\r\n .flatten()\r\n .value();\r\n\r\n if(pulseOxValues) {\r\n if (o2Values)\r\n o2Values = o2Values.concat(pulseOxValues);\r\n else\r\n o2Values = pulseOxValues;\r\n }\r\n\r\n if (o2Values) {\r\n pfvm.graphData.o2.dataset.parameter.push({\r\n name: getParameterText('Oxygen', '%'),\r\n min: pfvm.patientParameters.PulseOxParameters.Med_Alert,\r\n max: pfvm.patientParameters.PulseOxParameters.High_Alert\r\n });\r\n pfvm.graphData.o2.dataset.data.push(\r\n lodash(o2Values)\r\n .filter(function (val) {\r\n return val.SurveyParameterTypeId === SurveyParameterType.Oxygen && !isNaN(parseFloat(val.Value))\r\n })\r\n .map(function (val) {\r\n return {\r\n date: moment(val.ObservationDateTime_UTC).toDate(),\r\n value: parseFloat(val.Value)\r\n }\r\n })\r\n .sortBy(function(val) {\r\n return val.date;\r\n })\r\n .value());\r\n }\r\n\r\n var bpResponses = lodash.find(biometrics, {SurveyQuestionType: SurveyQuestionType.BloodPressure});\r\n if (bpResponses) {\r\n pfvm.graphData.bp.dataset.parameter.push({\r\n name: getParameterText('Systolic', bpResponses.UnitOfMeasure),\r\n min: pfvm.patientParameters.BloodPressureParameters.Systolic_MedLL,\r\n max: pfvm.patientParameters.BloodPressureParameters.Systolic_MedUL\r\n });\r\n pfvm.graphData.bp.dataset.parameter.push({\r\n name: getParameterText('Diastolic', bpResponses.UnitOfMeasure),\r\n min: pfvm.patientParameters.BloodPressureParameters.Diastolic_MedLL,\r\n max: pfvm.patientParameters.BloodPressureParameters.Diastolic_MedUL\r\n });\r\n\r\n pfvm.graphData.bp.dataset.data.push(lodash(bpResponses.Responses).pluck('Values').flatten().value().filter(function (val) {\r\n return val.SurveyParameterTypeId === SurveyParameterType.Systolic && !isNaN(parseFloat(val.Value))\r\n })\r\n .map(function (val) {\r\n return {\r\n date: moment(val.ObservationDateTime_UTC).toDate(),\r\n value: parseFloat(val.Value)\r\n }\r\n }));\r\n\r\n pfvm.graphData.bp.dataset.data.push(lodash(bpResponses.Responses).pluck('Values').flatten().value().filter(function (val) {\r\n return val.SurveyParameterTypeId === SurveyParameterType.Diastolic && !isNaN(parseFloat(val.Value))\r\n })\r\n .map(function (val) {\r\n return {\r\n date: moment(val.ObservationDateTime_UTC).toDate(),\r\n value: parseFloat(val.Value)\r\n }\r\n }));\r\n }\r\n }\r\n }\r\n\r\n function getParameterText(param, uom) {\r\n var text = param;\r\n if (uom) {\r\n text += ' (' + uom + ')';\r\n }\r\n\r\n return text;\r\n }\r\n\r\n function hasPulseOx(o) {\r\n return o.SurveyQuestionType === SurveyQuestionType.Oxygen || o.SurveyQuestionType === SurveyQuestionType.PulseOx;\r\n }\r\n\r\n function setFormsComplete() {\r\n\r\n if ($stateParams.isCreate) {\r\n pfvm.isComplete = true;\r\n } else {\r\n pfvm.isComplete = pfvm.form.IsComplete;\r\n }\r\n }\r\n\r\n function toggleProvider(caregiver) {\r\n if (!pfvm.editable) {\r\n return false;\r\n }\r\n\r\n caregiver.Include = !caregiver.Include;\r\n $scope.patientForm.$setDirty();\r\n }\r\n\r\n function setCaregivers() {\r\n pfvm.form.Parameters.forEach(function (p) {\r\n var found = lodash.find(pfvm.patientProviders, {Id: parseInt(p.Parameter)});\r\n if (found) {\r\n found.include = true;\r\n found.PatientFormParameterId = p.PatientFormParameterId;\r\n }\r\n });\r\n }\r\n\r\n function defineWebformFields(fields) {\r\n if (fields) {\r\n for (var i = 0; i < fields.length; i++) {\r\n pfvm.webformfields[fields[i].FieldName] = fields[i];\r\n }\r\n }\r\n }\r\n\r\n function setVariables() {\r\n var currentQuestionValues = form.questionValues || questionValues;\r\n\r\n pfvm.variables = currentQuestionValues.FormVariables;\r\n\r\n var medicationQuestion = lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .find(function (q) {\r\n return q.FormQuestionTypeId === pfvm.FormQuestionType.ActiveMedications;\r\n });\r\n\r\n if (medicationQuestion && medicationQuestion.AnswerText && medicationQuestion.AnswerText.length > 0) {\r\n pfvm.medications = JSON.parse(medicationQuestion.AnswerText);\r\n } else {\r\n pfvm.medications = currentQuestionValues.Medications;\r\n }\r\n\r\n setParameters(currentQuestionValues);\r\n\r\n pfvm.formPageHeader = getFormVariable(0, pfvm.form.PageHeader || '');\r\n pfvm.formPageFooter = getFormVariable(0, pfvm.form.PageFooter || '');\r\n\r\n pfvm.medications.currentMedications = lodash(pfvm.medications.currentMedications)\r\n .sortBy(function (o) {\r\n return o.Name;\r\n })\r\n .value();\r\n\r\n var formVariableQuestions = lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .filter(function (question) {\r\n return question.FormQuestionTypeId === pfvm.FormQuestionType.StaticVariable || question.FormQuestionTypeId === pfvm.FormQuestionType.DynamicVariable;\r\n ;\r\n })\r\n .value();\r\n\r\n pfvm.isSaveable = $stateParams.isCreate && formVariableQuestions.length && formVariableQuestions.length > 0;\r\n\r\n formVariableQuestions.forEach(function (question) {\r\n question.Question = getFormVariable(question.FormQuestionId, question.Question);\r\n\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n return;\r\n }\r\n\r\n if (question.FormOptions === undefined || question.FormOptions.length === 0) {\r\n return;\r\n }\r\n\r\n var option = question.FormOptions[0];\r\n question.AnswerText = getFormVariable(question.FormQuestionId, option.Text);\r\n });\r\n }\r\n\r\n function setParameters(currentQuestionValues) {\r\n var patientParameters = currentQuestionValues.PatientParameters;\r\n\r\n var parameterQuestions = lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .filter(function (q) {\r\n return q.FormQuestionTypeId == pfvm.FormQuestionType.PatientParameters;\r\n })\r\n .value();\r\n\r\n parameterQuestions.forEach(function (question) {\r\n question.parameters = {};\r\n\r\n if (hasPatientParameterType(question, '{Pulse}')) {\r\n setPulseParameterQuestions(question, patientParameters.PulseOxParameters);\r\n }\r\n\r\n if (hasPatientParameterType(question, '{OxygenSat}')) {\r\n setOxygenParameterQuestions(question, patientParameters.PulseOxParameters);\r\n }\r\n\r\n if (hasPatientParameterType(question, '{BloodPressure}')) {\r\n setBloodPressureQuestions(question, patientParameters.BloodPressureParameters);\r\n }\r\n\r\n if (hasPatientParameterType(question, '{Weight}')) {\r\n setWeightQuestions(question, patientParameters.WeightScaleParameters);\r\n }\r\n });\r\n }\r\n\r\n function setPulseParameterQuestions(question, pulseOxParams) {\r\n\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n var savedParams = JSON.parse(question.AnswerText);\r\n question.parameters.pulse = {\r\n low: savedParams.pulse.low,\r\n high: savedParams.pulse.high,\r\n change: {\r\n low: savedParams.pulse.change.low,\r\n high: savedParams.pulse.change.high\r\n }\r\n };\r\n } else {\r\n question.parameters.pulse = {\r\n low: pulseOxParams.Med_Alert_Pulse,\r\n high: pulseOxParams.High_Alert_Pulse,\r\n change: {\r\n low: '',\r\n high: ''\r\n }\r\n };\r\n }\r\n }\r\n\r\n function setOxygenParameterQuestions(question, pulseOxParams) {\r\n\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n var savedParams = JSON.parse(question.AnswerText);\r\n question.parameters.oxygen = {\r\n medium: savedParams.oxygen.medium,\r\n high: savedParams.oxygen.high,\r\n change: {\r\n medium: savedParams.oxygen.change.medium,\r\n high: savedParams.oxygen.change.high\r\n }\r\n };\r\n } else {\r\n question.parameters.oxygen = {\r\n medium: pulseOxParams.Med_Alert,\r\n high: pulseOxParams.High_Alert,\r\n change: {\r\n medium: '',\r\n high: ''\r\n }\r\n };\r\n }\r\n }\r\n\r\n function setBloodPressureQuestions(question, bpParams) {\r\n question.parameters.bp = {};\r\n\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n var savedParams = JSON.parse(question.AnswerText);\r\n question.parameters.bp.systolic = {\r\n medium_upper: savedParams.bp.systolic.medium_upper,\r\n medium_lower: savedParams.bp.systolic.medium_lower,\r\n high_upper: savedParams.bp.systolic.high_upper,\r\n high_lower: savedParams.bp.systolic.high_lower,\r\n change: {\r\n medium_upper: savedParams.bp.systolic.change.medium_upper,\r\n medium_lower: savedParams.bp.systolic.change.medium_lower,\r\n high_upper: savedParams.bp.systolic.change.high_upper,\r\n high_lower: savedParams.bp.systolic.change.high_lower\r\n }\r\n };\r\n\r\n question.parameters.bp.diastolic = {\r\n medium_upper: savedParams.bp.diastolic.medium_upper,\r\n medium_lower: savedParams.bp.diastolic.medium_lower,\r\n high_upper: savedParams.bp.diastolic.high_upper,\r\n high_lower: savedParams.bp.diastolic.high_lower,\r\n change: {\r\n medium_upper: savedParams.bp.diastolic.change.medium_upper,\r\n medium_lower: savedParams.bp.diastolic.change.medium_lower,\r\n high_upper: savedParams.bp.diastolic.change.high_upper,\r\n high_lower: savedParams.bp.diastolic.change.high_lower\r\n }\r\n };\r\n } else {\r\n question.parameters.bp.systolic = {\r\n medium_upper: bpParams.Systolic_MedUL,\r\n medium_lower: bpParams.Systolic_MedLL,\r\n high_upper: bpParams.Systolic_HighUL,\r\n high_lower: bpParams.Systolic_HighLL,\r\n change: {\r\n medium_upper: '',\r\n medium_lower: '',\r\n high_upper: '',\r\n high_lower: ''\r\n }\r\n };\r\n\r\n question.parameters.bp.diastolic = {\r\n medium_upper: bpParams.Diastolic_MedUL,\r\n medium_lower: bpParams.Diastolic_MedLL,\r\n high_upper: bpParams.Diastolic_HighUL,\r\n high_lower: bpParams.Diastolic_HighLL,\r\n change: {\r\n medium_upper: '',\r\n medium_lower: '',\r\n high_upper: '',\r\n high_lower: ''\r\n }\r\n };\r\n }\r\n }\r\n\r\n function setWeightQuestions(question, weightParams) {\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n var savedParams = JSON.parse(question.AnswerText);\r\n question.parameters.weight = {\r\n uom: savedParams.weight.uom,\r\n current: {\r\n baseline: savedParams.weight.current.baseline,\r\n dailyGain: {\r\n high: savedParams.weight.current.dailyGain.high,\r\n low: savedParams.weight.current.dailyGain.low\r\n },\r\n dailyLoss: {\r\n high: savedParams.weight.current.dailyLoss.high,\r\n low: savedParams.weight.current.dailyLoss.low\r\n },\r\n weekly: savedParams.weight.current.weekly,\r\n max: savedParams.weight.current.max,\r\n min: savedParams.weight.current.min\r\n },\r\n change: {\r\n dailyGain: {\r\n high: savedParams.weight.change.dailyGain.high,\r\n low: savedParams.weight.change.dailyGain.low\r\n },\r\n dailyLoss: {\r\n high: savedParams.weight.change.dailyGain.high,\r\n low: savedParams.weight.change.dailyGain.low\r\n },\r\n weekly: savedParams.weight.change.weekly,\r\n max: savedParams.weight.change.max,\r\n min: savedParams.weight.change.min\r\n }\r\n };\r\n } else {\r\n question.parameters.weight = {\r\n uom: weightParams.UnitOfMeasure,\r\n current: {\r\n baseline: weightParams.Baseline_Weight,\r\n dailyGain: {\r\n high: weightParams.High_Alert_Lbs,\r\n low: weightParams.Med_Alert_Lbs\r\n },\r\n dailyLoss: {\r\n high: weightParams.High_Alert_Lbs,\r\n low: weightParams.Med_Alert_Lbs\r\n },\r\n weekly: weightParams.Med_Alert_Lbs_Weekly,\r\n max: weightParams.Max_Weight,\r\n min: weightParams.Min_Weight\r\n },\r\n change: {\r\n dailyGain: {\r\n high: '',\r\n low: ''\r\n },\r\n dailyLoss: {\r\n high: '',\r\n low: ''\r\n },\r\n weekly: '',\r\n max: '',\r\n min: ''\r\n }\r\n };\r\n }\r\n }\r\n\r\n function getFormVariable(questionId, text) {\r\n var value = text;\r\n\r\n var questionVariables = lodash.filter(pfvm.variables, function (v) {\r\n return v.FormQuestionId === questionId;\r\n });\r\n\r\n questionVariables.forEach(function (v) {\r\n var variableValue = v.Value;\r\n if (v.VariableName.toLowerCase().indexOf('phone') >= 0 || v.VariableName.toLowerCase().indexOf('telephone') >= 0) {\r\n variableValue = $filter('tel')(variableValue);\r\n } else if (v.VariableName.toLowerCase().indexOf('currentdatetime') >= 0) {\r\n variableValue = $filter('datetime')(new Date(), 'datetime');\r\n } else if (v.VariableName.toLowerCase().indexOf('currentdate') >= 0) {\r\n variableValue = $filter('datetime')(new Date());\r\n }\r\n\r\n value = value.replace('{' + v.VariableName + '}', variableValue);\r\n });\r\n\r\n return value;\r\n }\r\n\r\n function cancel() {\r\n $state.go(\"^\", undefined, {\r\n reload: true\r\n });\r\n }\r\n\r\n function runChartPostProcessor() {\r\n if (pfvm.form.PostProcessor && !pfvm.form.AutoRunPostProcessor) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to complete this form?', 'Complete')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n PatientFormsService.postProcess($stateParams.patientId, pfvm.form.PatientFormId, pfvm.form.PostProcessor).then(function (ppResponse) {\r\n if (pfvm.form.PostProcessor.indexOf('ChartFormPostProcessor') !== -1) {\r\n $state.go(\"patients.patient.chart\", undefined, {reload: true});\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n function runHrmPostProcessor() {\r\n if (pfvm.form.PostProcessor && !pfvm.form.AutoRunPostProcessor) {\r\n vhSweetAlert.verify('Send', 'Are you sure you want to send this form?', 'OK')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n PatientFormsService.postProcess($stateParams.patientId, pfvm.form.PatientFormId, pfvm.form.PostProcessor).then(function (ppResponse) {\r\n pfvm.form.Status = 2;\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n function saveForm() {\r\n var selections = lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .filter(function (q) {\r\n if (q.SelectedOptionId != undefined && q.SelectedOptionId != null) {\r\n q.SelectedOptionId = Number(q.SelectedOptionId); // Radio button is setting this as a string, not a number\r\n }\r\n\r\n if (q.FormQuestionTypeId == pfvm.FormQuestionType.MultiLineTextbox || q.FormQuestionTypeId == pfvm.FormQuestionType.Textbox) { // text input\r\n q.SelectedOptionId = q.FormOptions[0].FormOptionId;\r\n } else if (q.FormQuestionTypeId == pfvm.FormQuestionType.Checkboxes || q.FormQuestionTypeId == pfvm.FormQuestionType.InlineCheckboxs) { // checkbox input\r\n var selectedItemIds = [];\r\n q.AnswerText = '';\r\n lodash.forEach(q.FormOptions, function (o) {\r\n if (o.Checked) {\r\n selectedItemIds.push(o.FormOptionId);\r\n if (q.AnswerText.length > 0) {\r\n q.AnswerText = q.AnswerText.concat(', ');\r\n }\r\n q.AnswerText = q.AnswerText.concat(o.Text);\r\n }\r\n });\r\n if (q.AnswerText.length > 0) {\r\n q.AnswerText = q.AnswerText.concat('. ');\r\n }\r\n q.SelectedOptionIds = JSON.stringify(selectedItemIds);\r\n q.SelectedOptionId = null;\r\n } else if (q.FormQuestionTypeId == pfvm.FormQuestionType.Grid) {\r\n q.AnswerText = JSON.stringify(q.Rows);\r\n } else if (q.FormQuestionTypeId === pfvm.FormQuestionType.StaticVariable || q.FormQuestionTypeId === pfvm.FormQuestionType.DynamicVariable) {\r\n q.SelectedOptionId = q.FormOptions[0].FormOptionId;\r\n } else if (q.FormQuestionTypeId === pfvm.FormQuestionType.ActiveMedications) {\r\n q.AnswerText = JSON.stringify(pfvm.medications);\r\n } else if (q.FormQuestionTypeId === pfvm.FormQuestionType.PatientParameters) {\r\n q.AnswerText = JSON.stringify(q.parameters);\r\n } else if (q.FormQuestionTypeId === pfvm.FormQuestionType.Date) {\r\n q.AnswerText = q.date.toUTCString();\r\n } else if (q.FormQuestionTypeId === pfvm.FormQuestionType.O2Graph) {\r\n q.AnswerText = JSON.stringify(pfvm.graphData.o2);\r\n } else if (q.FormQuestionTypeId === pfvm.FormQuestionType.BPGraph) {\r\n q.AnswerText = JSON.stringify(pfvm.graphData.bp);\r\n } else if (q.FormQuestionTypeId === pfvm.FormQuestionType.WeightGraph) {\r\n q.AnswerText = JSON.stringify(pfvm.graphData.weight);\r\n } else if (q.FormQuestionTypeId === pfvm.FormQuestionType.PulseGraph) {\r\n q.AnswerText = JSON.stringify(pfvm.graphData.pulse);\r\n } else {\r\n q.AnswerText = '';\r\n var selectedOption = lodash.find(q.FormOptions, {FormOptionId: q.SelectedOptionId});\r\n if (selectedOption) {\r\n q.AnswerText = selectedOption.Text;\r\n }\r\n }\r\n return lodash.isString(q.AnswerText) && q.AnswerText.length > 0;\r\n })\r\n .map(function (q) {\r\n return {\r\n FormQuestionId: q.FormQuestionId,\r\n FormOptionId: q.SelectedOptionId,\r\n PatientFormId: pfvm.form.PatientFormId,\r\n SelectedOptionIds: q.SelectedOptionIds,\r\n Text: q.AnswerText\r\n };\r\n }).value();\r\n\r\n if (selections.length < 1) {\r\n vhSweetAlert.error(\"Error\", \"Cannot submit form without selected answers.\");\r\n return;\r\n }\r\n\r\n var model = {\r\n FormId: pfvm.form.FormId,\r\n PostProcessor: pfvm.form.PostProcessor,\r\n PatientFormId: pfvm.form.PatientFormId,\r\n PatientFormSelections: selections,\r\n PatientId: $stateParams.patientId,\r\n IsComplete: checkIfComplete(pfvm.form),\r\n AutoRunPostProcessor: pfvm.form.AutoRunPostProcessor,\r\n Parameters: pfvm.form.Parameters\r\n };\r\n\r\n if ($stateParams.isCreate) {\r\n var submitResults = PatientFormsService.submitForm($stateParams.patientId, model);\r\n return submitResults.savePromise.then(function (response) {\r\n $scope.patientForm.$setPristine();\r\n $scope.editable = false;\r\n $state.go(\"^.form\", {\r\n patientFormId: response.PatientFormId\r\n });\r\n });\r\n } else {\r\n var saveResults = PatientFormsService.saveForm($stateParams.patientId, model);\r\n if (saveResults.postProcessingPromise) {\r\n saveResults.postProcessingPromise.then(function (response) {\r\n mapPostProcessing(response);\r\n });\r\n }\r\n\r\n return saveResults.savePromise.then(function (saveData) {\r\n\r\n pfvm.form.Parameters = saveData.Parameters;\r\n\r\n setFormsComplete();\r\n var pastFound = lodash(pfvm.pastForms).find({PatientFormId: pfvm.form.PatientFormId});\r\n if (pastFound) {\r\n pastFound.IsComplete = pfvm.form.IsComplete;\r\n }\r\n $scope.patientForm.$setPristine();\r\n\r\n });\r\n }\r\n }\r\n\r\n function mapPostProcessing(model) {\r\n if (model !== null) {\r\n pfvm.resultName = model.ResultName;\r\n pfvm.resultValue = model.ResultValue;\r\n }\r\n }\r\n\r\n function checkIfComplete(form) {\r\n form.IsComplete = PatientFormsService.checkIfComplete(form);\r\n pfvm.IsComplete = form.IsComplete;\r\n return pfvm.IsComplete;\r\n }\r\n\r\n function addEmptyGridRow(question) {\r\n var row = [];\r\n lodash.forEach(question.FormOptions, function (o) {\r\n row.push({});\r\n });\r\n question.Rows.push(row);\r\n }\r\n\r\n function gridChanged(question, row) {\r\n //only add a new row if the last one is not empty\r\n var lastRow = question.Rows[question.Rows.length - 1];\r\n\r\n var isEmpty = !lodash.any(lastRow, function (o) {\r\n return o.AnswerText !== undefined && o.AnswerText !== null && o.AnswerText.length > 0;\r\n });\r\n\r\n\r\n if (!isEmpty) {\r\n addEmptyGridRow(question);\r\n }\r\n }\r\n\r\n function gridLostFocus(question, row) {\r\n //removeEmptyGridRow();\r\n }\r\n\r\n function hasPatientParameterType(question, type) {\r\n var hasType = lodash(question.FormOptions)\r\n .any(function (q) {\r\n return q.Text == type;\r\n });\r\n\r\n return hasType;\r\n }\r\n\r\n function removeEmptyGridRow() {\r\n //Do not check last option, since that one will always be empty\r\n for (i = 0; i < vm.question.FormOptions.length - 1; i++) {\r\n //Find any option text that is not empty. If none found, remove option\r\n if (optionIsEmpty(vm.question.FormOptions[i])) {\r\n vm.question.FormOptions.splice(i, 1);\r\n }\r\n }\r\n }\r\n\r\n function removeOption(index) {\r\n //Don't allow removing the last question\r\n if (!vm.questionOptionsDisabled && !optionIsEmpty(vm.question.FormOptions[index])) {\r\n vm.question.FormOptions.splice(index, 1);\r\n }\r\n }\r\n\r\n function optionIsEmpty(option) {\r\n var result = false;\r\n if (option != null) {\r\n var texts = option.Text;\r\n if (texts == null || texts.length === 0) {\r\n result = true;\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n function showChartButton() {\r\n var result = false;\r\n if (lodash.isString(pfvm.form.PostProcessor) &&\r\n pfvm.form.PostProcessor == 'Vivify.Platform.Components.Forms.ChartFormPostProcessor' &&\r\n pfvm.editable &&\r\n !$stateParams.isCreate\r\n ) {\r\n result = true;\r\n }\r\n return result;\r\n }\r\n\r\n function showHrmButtons() {\r\n var result = false;\r\n if (lodash.isString(pfvm.form.PostProcessor) &&\r\n pfvm.form.PostProcessor == 'Vivify.Platform.Components.Forms.HRMFormPostProcessor' &&\r\n !$stateParams.isCreate\r\n ) {\r\n result = true;\r\n }\r\n return result;\r\n }\r\n\r\n function updateLocked(pastForms) {\r\n pastForms.forEach(function (pastForm) {\r\n if (pastForm.IsLocked) {\r\n return;\r\n }\r\n\r\n // Processed\r\n pastForm.IsLocked = pastForm.Status == 4;\r\n });\r\n }\r\n\r\n function isSendDisabled() {\r\n return pfvm.form.SendLockDateTime_UTC && pfvm.form.SendLockDateTime_UTC !== null;\r\n }\r\n\r\n function getTitleForSendButton() {\r\n return isSendDisabled() ? \"Form cannot be sent since the fax number of a \" + pfvm.webformfields.Provider.FieldLabel + \" has been updated.\" : \"\";\r\n }\r\n}\r\n\r\nangular.module(\"patient.forms\").controller(\"PatientFormController\", PatientFormController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/forms/form.tpl.html',\n '
          0\" ng-bind-html=\"pfvm.formPageHeader\">

          {{pfvm.form.FormTypeName}}



          {{pfvm.form.FormTypeName}}  {{pfvm.form.CreatedDateTime_UTC | datetime}} |   {{pfvm.form.CreatedByName}}  {{pfvm.resultName}}: {{pfvm.resultValue}}   Incomplete

          {{pfvm.form.Pretext}}

          {{section.Title}}{{section.FormQuestions.length}}

          {{section.Description}}

          {{question.Question}}
          {{option.Text}}

          {{question.Question}}

          {{question.AnswerText}}

          {{question.AnswerText}}

          {{question.AnswerText}}

          {{question.AnswerText}}

          {{question.AnswerText}}

          {{question.AnswerText}}

          {{question.date | datetime}}

          {{question.date | datetime}}

          {{option.Text}}

          {{option.Text}}

          {{option.Text}}

          {{option.Text}}

          {{option.Text}}

          {{field.AnswerText}}

          {{field.AnswerText}}

          {{question.AnswerText}}

          {{field.AnswerText}}

          {{question.AnswerText}}

          0\">
          MedicationDoseRouteFrequencyReasonDate
          Started
          Date
          Stopped
          Refill
          {{med.Name}}{{med.Dose}}{{med.Route}}{{med.Frequency}}{{med.Reason}}{{med.StartDate | datetime : \"date\" : \"UTC\"}}{{med.EndDate | datetime : \"date\" : \"UTC\"}}
          No Patient Medications
          CurrentChange
          High Threshold (>=)Low Threshold (<=)High Threshold (>=)Low Threshold (<=)
          High AlertMedium AlertHigh AlertMedium AlertHigh AlertMedium AlertHigh AlertMedium Alert
          Systolic BP{{question.parameters.bp.systolic.high_upper}}{{question.parameters.bp.systolic.medium_upper}}{{question.parameters.bp.systolic.high_lower}}{{question.parameters.bp.systolic.medium_lower}}
          Diastolic BP{{question.parameters.bp.diastolic.high_upper}}{{question.parameters.bp.diastolic.medium_upper}}---{{question.parameters.bp.diastolic.medium_lower}}---
          Pulse{{question.parameters.pulse.high}}---{{question.parameters.pulse.low}}---------
          Oxygen Sat------{{question.parameters.oxygen.high}}{{question.parameters.oxygen.medium}}------
          CurrentChange
          Daily Gain (>=)Daily Loss (<=)Weekly Gain/LossMax WeightMin WeightDaily Gain (>=)Daily Loss (<=)Weekly Gain/LossMax WeightMin Weight
          Baseline: {{question.parameters.weight.current.baseline}} ({{question.parameters.weight.uom}})HighLowHighLowMediumHighHighHighLowHighLowMediumHighHigh
          Weight ({{question.parameters.weight.uom}}){{question.parameters.weight.current.dailyGain.high}}{{question.parameters.weight.current.dailyGain.low}}{{question.parameters.weight.current.dailyLoss.high}}{{question.parameters.weight.current.dailyLoss.low}}{{question.parameters.weight.current.weekly}}{{question.parameters.weight.current.max}}{{question.parameters.weight.current.min}}

          {{pfvm.form.Posttext}}

          ');\n}]);\n}(window, document, window.angular));","function PatientFormsController($scope, allForms, lodash, $stateParams, PermissionService,PatientFormsService, TemplatesService) {\r\n var pfvm = this;\r\n pfvm.patientId = $stateParams.patientId;\r\n pfvm.patient = $scope.$parent.vm.patient;\r\n pfvm.availableForms = [];\r\n pfvm.selectedPopulation = null;\r\n pfvm.searchText = \"\";\r\n pfvm.formsTitle = \"Recommended Forms\";\r\n pfvm.allForms = allForms;\r\n console.log(allForms)\r\n pfvm.populations = [];\r\n\r\n loadController();\r\n function loadController() {\r\n determineAvailableForms();\r\n\r\n lodash.map(pfvm.Forms, function (f) {\r\n f.canAdd = f.PatientForms.length === 0 || !lodash.any(f.PatientForms, {IsLocked: false});\r\n return f;\r\n });\r\n\r\n lodash.forEach(pfvm.allForms, function(form) {\r\n lodash.forEach(form.FormPopulations, function(pop) {\r\n if (lodash.findIndex(pfvm.populations, function(o) { return o.PopulationId === pop.PopulationId }) < 0) {\r\n pfvm.populations.push(pop);\r\n }\r\n });\r\n });\r\n\r\n pfvm.populations = lodash.sortBy(pfvm.populations, 'PopulationName');\r\n\r\n //Build list of populations that have associated forms\r\n pfvm.populations.push({ PopulationId: -2, PopulationName: \"Unassigned Forms\"});\r\n pfvm.populations.push({ PopulationId: -1, PopulationName: \"Defaulted Forms\"});\r\n }\r\n pfvm.populationChanged = function() {\r\n determineAvailableForms();\r\n }\r\n\r\n pfvm.searchChanged = function() {\r\n pfvm.selectedPopulation = null;\r\n determineAvailableForms();\r\n }\r\n\r\n pfvm.clearSearch = function() {\r\n pfvm.searchText = \"\";\r\n determineAvailableForms();\r\n }\r\n\r\n function determineAvailableForms() {\r\n var forms = [];\r\n pfvm.formsTitle = \"Available Forms\";\r\n if (pfvm.searchText.length > 0) {\r\n var searchText = pfvm.searchText.toLowerCase();\r\n lodash.forEach(allForms, function(form) {\r\n if (form.IsActive == true && form.FormTypeName.toLowerCase().indexOf(searchText) != -1) {\r\n forms.push(form);\r\n }\r\n });\r\n } else if (pfvm.selectedPopulation != null) {\r\n if (pfvm.selectedPopulation.PopulationId === -1) {\r\n lodash.forEach(allForms, function(form) {\r\n if (form.IsActive == true && form.IsDefault === true) {\r\n forms.push(form);\r\n }\r\n });\r\n } else if (pfvm.selectedPopulation.PopulationId === -2) {\r\n lodash.forEach(allForms, function(form) {\r\n if (form.IsActive == true && form.FormPopulations.length === 0 && form.IsDefault === false) {\r\n forms.push(form);\r\n }\r\n });\r\n } else {\r\n lodash.forEach(allForms, function(form) {\r\n if (form.IsActive == true && lodash.findIndex(form.FormPopulations, function (o) { return o.PopulationId === pfvm.selectedPopulation.PopulationId }) >= 0) {\r\n forms.push(form);\r\n }\r\n });\r\n }\r\n } else {\r\n pfvm.formsTitle = \"Recommended Forms\";\r\n lodash.forEach(allForms, function(form) {\r\n if (form.IsActive == true && form.IsDefault === true || lodash.findIndex(form.FormPopulations, function (o) { return o.PopulationName === pfvm.patient.population }) >= 0) {\r\n forms.push(form);\r\n }\r\n });\r\n }\r\n\r\n pfvm.availableForms = forms;\r\n }\r\n}\r\n\r\nangular.module(\"patient.forms\").controller(\"PatientFormsController\", PatientFormsController);\r\n","function PatientFormsService($http, lodash, $q, $rootScope, FormQuestionType) {\r\n var pendingPostProcessors = {};\r\n\r\n function getDailyFormResponses(patientId, patientSurveyId) {\r\n var url = \"/api/cgp/patient/\" + patientId + \"/DailyPatientFormResponse\";\r\n var params;\r\n if (patientSurveyId) {\r\n params = { patientSurveyId: patientSurveyId };\r\n }\r\n return $http.get(url, params).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getForms(patientId) {\r\n return $http.get(\"/api/form?includeall=true\").then(function (response) {\r\n return response.data;\r\n }).then(function (data) {\r\n return $http.get(\"/api/patient/\"+patientId+\"/form\").then(function (response) {\r\n return lodash.map(data, function (f) {\r\n f.PatientForms = lodash.filter(response.data, {FormTypeId: f.FormTypeId});\r\n f.LastPatientForm = lodash(f.PatientForms).sortBy(\"CreatedDateTime_UTC\").last();\r\n return f;\r\n });\r\n });\r\n });\r\n }\r\n\r\n function getForm(formId, patientId) {\r\n return $http.get(\"/api/form/\"+formId+'?patientId='+patientId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientForm(patientId, patientFormId) {\r\n return $http.get(\"/api/patient/\"+patientId+\"/form/\"+patientFormId).then(function (response) {\r\n response.data.pendingPostProcessor = pendingPostProcessors[patientFormId];\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientFormsByType(patientId, formType) {\r\n return $http.get(\"/api/patient/\" + patientId + \"/form?formtype=\" + formType).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getFormQuestionValues(patientId, formId, patientFormId) {\r\n return $http.get(\"/api/patient/\" + patientId + \"/form/\" + formId + \"/questionValues/\" + patientFormId).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function submitForm(patientId, form) {\r\n var saveModel = {};\r\n var deferred = $q.defer();\r\n saveModel.savePromise = $http.post(\"/api/patient/\"+patientId+\"/form\", form).then(function (response) {\r\n return response.data;\r\n }).then(function (data) {\r\n if (form.PostProcessor && form.AutoRunPostProcessor) {\r\n postProcess(patientId, data.PatientFormId, form.PostProcessor).then(function (ppResponse) {\r\n deferred.resolve(ppResponse);\r\n });\r\n }\r\n return data;\r\n });\r\n\r\n if (form.PostProcessor) {\r\n saveModel.postProcessingPromise = deferred.promise;\r\n } else {\r\n deferred.resolve();\r\n }\r\n return saveModel;\r\n }\r\n\r\n function saveForm(patientId, form) {\r\n var saveModel = {};\r\n var deferred = $q.defer();\r\n saveModel.savePromise = $http.put(\"/api/patient/\"+patientId+\"/form/\"+form.PatientFormId, form).then(function (response) {\r\n return response.data;\r\n }).then(function (data) {\r\n if (form.PostProcessor && form.AutoRunPostProcessor) {\r\n postProcess(patientId, data.PatientFormId, form.PostProcessor).then(function (ppResponse) {\r\n deferred.resolve(ppResponse);\r\n });\r\n }\r\n return data;\r\n });\r\n\r\n if (form.PostProcessor) {\r\n saveModel.postProcessingPromise = deferred.promise;\r\n } else {\r\n deferred.resolve();\r\n }\r\n return saveModel;\r\n }\r\n\r\n function postProcess(patientId, patientFormId, postProcessor) {\r\n var promise = $http.post(\"/api/patient/\"+patientId+\"/form/\"+patientFormId+\"?postprocessor=\"+postProcessor)\r\n .then(function (response) {\r\n if (response.data !== null && postProcessor.toUpperCase().indexOf(\"RISK\") > -1) {\r\n $rootScope.$emit(\"vh:patientUpdated\", patientId);\r\n }\r\n return response.data;\r\n }).finally(function () {\r\n delete pendingPostProcessors[patientFormId];\r\n }\r\n );\r\n pendingPostProcessors[patientFormId] = promise;\r\n return promise;\r\n }\r\n\r\n function checkIfComplete(form) {\r\n var questions = lodash(form.FormSections).pluck(\"FormQuestions\").flatten().value()\r\n .filter(function(q){\r\n if(q.DeletedBy_Id && q.DeletedBy_Id !== null){\r\n return false;\r\n }\r\n\r\n if(q.FormQuestionTypeId === FormQuestionType.StaticVariable\r\n || q.FormQuestionTypeId === FormQuestionType.DynamicVariable\r\n || q.FormQuestionTypeId === FormQuestionType.ActiveMedications\r\n || q.FormQuestionTypeId === FormQuestionType.PatientParameters\r\n || q.FormQuestionTypeId === FormQuestionType.WeightGraph\r\n || q.FormQuestionTypeId === FormQuestionType.BPGraph\r\n || q.FormQuestionTypeId === FormQuestionType.O2Graph\r\n || q.FormQuestionTypeId === FormQuestionType.PulseGraph){\r\n return false;\r\n }\r\n\r\n return q.Required === true;\r\n });\r\n\r\n for(var i = 0; i < questions.length; i++) {\r\n //if provider question need to check if there are any included\r\n if(questions[i].FormQuestionTypeId === FormQuestionType.Provider) {\r\n if(form.Parameters.length > 0 && !lodash(form.Parameters).any({Include: true})) {\r\n return false;\r\n }\r\n } else if (questions[i].FormQuestionTypeId === FormQuestionType.OriginalInputType) {\r\n if(!questions[i].SelectedOptionId) {\r\n return false;\r\n }\r\n } else if(questions[i].AnswerText === undefined || questions[i].AnswerText === null || questions[i].AnswerText.length < 1) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n\r\n }\r\n\r\n return {\r\n getForms: getForms,\r\n getForm: getForm,\r\n getFormQuestionValues: getFormQuestionValues,\r\n getPatientForm: getPatientForm,\r\n submitForm: submitForm,\r\n saveForm: saveForm,\r\n getPatientFormsByType: getPatientFormsByType,\r\n getDailyFormResponses: getDailyFormResponses,\r\n postProcess: postProcess,\r\n checkIfComplete: checkIfComplete\r\n };\r\n}\r\nangular.module(\"patient.forms\").factory(\"PatientFormsService\", PatientFormsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/forms/forms.tpl.html',\n '
          Forms
          0\">
          {{pfvm.formsTitle}}
          {{form.FormTypeName}}
          Patient Forms
          0\">
          ');\n}]);\n}(window, document, window.angular));","function PatientFormGraph(lodash, moment) {\r\n\r\n function controller($scope, $element, $filter) {\r\n\r\n $scope.showNoData = false;\r\n var svg, g, yMax, yMin, x, y, xDomain, yDomain, viewHeight, viewWidth;\r\n\r\n init();\r\n function init() {\r\n if ($scope.dataset.data.length > 0) {\r\n\r\n calcYMinMax();\r\n clearGraph();\r\n draw();\r\n buildLegendTable();\r\n } else {\r\n $scope.showNoData = true;\r\n }\r\n }\r\n\r\n function draw() {\r\n margin = { top: 20, right: 30, bottom: 40, left: 40 };\r\n\r\n viewHeight = $scope.minHeight + margin.bottom + margin.top;\r\n\r\n var elem = $element[0];\r\n\r\n var data = $scope.dataset.data[0];\r\n\r\n var dates = lodash(data)\r\n .pluck('date')\r\n .value();\r\n\r\n var endDate = $scope.endDate\r\n || lodash(dates).max();\r\n\r\n var startDate = moment(endDate).subtract($scope.days, 'day');\r\n\r\n viewWidth = elem.offsetWidth;\r\n width = viewWidth - margin.left - margin.right;\r\n height = viewHeight - margin.top - margin.bottom;\r\n yDomain = [parseFloat(yMin), parseFloat(yMax)];\r\n xDomain = [startDate, endDate];\r\n\r\n svg = d3.select(elem).select(\".svg-container\")\r\n .append('svg')\r\n .attr('viewBox', '0 0 ' + viewWidth + ' ' + viewHeight)\r\n .attr('preserveAspectRatio', 'xMidYMid meet')\r\n .classed(\"svg-content\", true)\r\n .style(\"min-height\", $scope.minHeight + \"px\");\r\n\r\n g = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\r\n x = d3.scaleTime()\r\n .domain(xDomain)\r\n .nice()\r\n .range([0, width]);\r\n\r\n y = d3.scaleLinear()\r\n .domain(yDomain)\r\n .nice()\r\n .range([height, 0]);\r\n\r\n var line = d3.line()\r\n .defined(function (d) {\r\n return d;\r\n })\r\n .x(function (d) {\r\n return x(d.date);\r\n })\r\n .y(function (d) {\r\n return y(d.value);\r\n })\r\n .curve(d3.curveCatmullRom);\r\n\r\n var xAxisG = g.append(\"g\")\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(d3.axisBottom(x).tickFormat(filterDate));\r\n\r\n xAxisG.selectAll(\"text\")\r\n .style(\"text-anchor\", \"end\")\r\n .style(\"font-size\", \"1.3em\")\r\n .attr(\"dx\", \"-.8em\")\r\n .attr(\"dy\", \".35em\")\r\n .attr(\"transform\", \"rotate(-30)\");\r\n\r\n xAxisG.select(\".domain\")\r\n .remove();\r\n\r\n g.append(\"g\")\r\n .call(d3.axisLeft(y))\r\n .append(\"text\")\r\n .attr(\"fill\", \"#000\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .attr(\"y\", 6)\r\n .attr(\"dy\", \"0.95em\")\r\n .attr(\"text-anchor\", \"end\");\r\n\r\n \r\n\r\n g.append(\"g\")\r\n .attr(\"class\", \"grid\")\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(make_x_gridlines()\r\n .tickSize(-height)\r\n .tickFormat(\"\")\r\n );\r\n\r\n g.append(\"g\")\r\n .attr(\"class\", \"grid\")\r\n .call(make_y_gridlines()\r\n .tickSize(-width)\r\n .tickFormat(\"\")\r\n );\r\n\r\n svg.selectAll(\".tick\").selectAll(\"text\").style(\"font-size\", \"1.3em\");\r\n\r\n $scope.dataset.data.forEach(function (data, idx) {\r\n $scope.dataset.baseline.forEach(function (baseline) {\r\n\r\n var baselineData = [\r\n { date: x.domain()[0], value: baseline },\r\n { date: x.domain()[1], value: baseline }\r\n ];\r\n \r\n g.append(\"path\")\r\n .attr(\"class\", \"path-baseline\")\r\n .datum(baselineData)\r\n .attr(\"fill\", \"none\")\r\n .attr(\"stroke\", \"black\")\r\n .attr(\"stroke-linejoin\", \"round\")\r\n .attr(\"stroke-linecap\", \"round\")\r\n .attr(\"stroke-width\", 1.5)\r\n .attr(\"d\", line);\r\n \r\n var value = g.selectAll(\"g.value .path-baseline\")\r\n .data(baselineData)\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\", \"value\");\r\n });\r\n \r\n g.append(\"path\")\r\n .attr(\"class\", \"path\" + idx)\r\n .datum(data)\r\n .attr(\"fill\", \"none\")\r\n .attr(\"stroke\", \"black\")\r\n .attr(\"stroke-linejoin\", \"round\")\r\n .attr(\"stroke-linecap\", \"round\")\r\n .attr(\"stroke-width\", 1.5)\r\n .attr(\"d\", line);\r\n\r\n var value = g.selectAll(\"g.value .path\" + idx)\r\n .data(data)\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\", \"value\");\r\n\r\n var valuePoint;\r\n if (idx === 0) {\r\n\r\n valuePoint = value.append(\"rect\")\r\n .attr(\"y\", function (d, i) {\r\n return y(d.value) - 4;\r\n })\r\n .attr(\"x\", function (d, i) {\r\n return x(d.date) - 4;\r\n })\r\n .attr(\"width\", \"7px\")\r\n .attr(\"height\", \"7px\")\r\n .attr(\"value\", function (d, i) {\r\n return d.value;\r\n })\r\n .attr(\"date\", function (d, i) {\r\n return d.date;\r\n });\r\n } else if (idx === 1) {\r\n valuePoint = value.append(\"circle\")\r\n .attr(\"cy\", function (d, i) {\r\n return y(d.value);\r\n })\r\n .attr(\"cx\", function (d, i) {\r\n return x(d.date);\r\n })\r\n .attr(\"r\", function (d, i) {\r\n return 4;\r\n })\r\n .attr(\"value\", function (d, i) {\r\n return d.value;\r\n })\r\n .attr(\"date\", function (d, i) {\r\n return d.date;\r\n });\r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n function line() {\r\n d3.line()\r\n .defined(function (d) {\r\n return d;\r\n })\r\n .x(function (d) {\r\n return x(d.date);\r\n })\r\n .y(function (d) {\r\n return y(d.value);\r\n })\r\n .curve(d3.curveCatmullRom)\r\n }\r\n\r\n function buildLegendTable() {\r\n\r\n var table = d3.select($element[0]).select('.table-container')\r\n .append('table')\r\n .attr('class', 'table');\r\n\r\n var thead = table.append('thead');\r\n var tbody = table.append('tbody');\r\n\r\n var columns = [\"Symbol\", \"Parameter\", \"High\", \"Low\"];\r\n if ($scope.dataset.baseline.length > 0) {\r\n columns.push(\"Baseline\");\r\n }\r\n var columnData = [];\r\n\r\n $scope.dataset.data.forEach(function (data, idx) {\r\n var data = {\r\n Symbol: $scope.dataset.symbol[idx],\r\n Parameter: $scope.dataset.parameter[idx].name,\r\n High: $scope.dataset.parameter[idx].max,\r\n Low: $scope.dataset.parameter[idx].min\r\n };\r\n\r\n if ($scope.dataset.baseline.length > 0) {\r\n data.Baseline = $scope.dataset.baseline[idx];\r\n }\r\n\r\n columnData.push(data);\r\n\r\n });\r\n\r\n thead.append('tr')\r\n .selectAll('th')\r\n .data(columns).enter()\r\n .append('th')\r\n .attr(\"class\", \"text-center\")\r\n .text(function (c) { return c; });\r\n\r\n // create a row for each object in the data\r\n var rows = tbody.selectAll('tr')\r\n .data(columnData)\r\n .enter()\r\n .append('tr')\r\n .attr(\"class\", \"text-center\");\r\n\r\n var cells = rows.selectAll('td')\r\n .data(function (row) {\r\n return columns.map(function (column) {\r\n return { column: column, value: row[column] };\r\n })\r\n })\r\n .enter()\r\n .append('td')\r\n .text(function (d) { return d.value; });\r\n }\r\n\r\n function min(data, prop) {\r\n return d3.min(data, function(d) {\r\n return d[prop];\r\n });\r\n }\r\n\r\n function max(data, prop) {\r\n return d3.max(data, function(d) {\r\n return d[prop];\r\n });\r\n }\r\n\r\n function make_y_gridlines() {\r\n return d3.axisLeft(y)\r\n .ticks(5)\r\n }\r\n\r\n function make_x_gridlines() {\r\n return d3.axisBottom(x)\r\n .ticks(5)\r\n }\r\n\r\n function clearGraph() {\r\n d3.select($element[0]).select('.svg-container').selectAll('*').remove();\r\n d3.select($element[0]).select('.table-container').selectAll('*').remove();\r\n }\r\n\r\n function calcYMinMax() {\r\n\r\n $scope.dataset.data.forEach(function (data, idx) {\r\n\r\n var max = d3.max(data, function (d) {\r\n return d.value;\r\n });\r\n\r\n if (idx > 0) {\r\n yMax = max > yMax ? max : yMax;\r\n } else {\r\n yMax = max;\r\n }\r\n\r\n var min = d3.min(data, function (d) {\r\n return d.value;\r\n });\r\n\r\n if (idx > 0) {\r\n yMin = min < yMin ? min : yMin;\r\n } else {\r\n yMin = min;\r\n }\r\n\r\n });\r\n\r\n if (yMin === yMax) {\r\n yMin--;\r\n yMax++;\r\n }\r\n }\r\n\r\n function filterDate(date) {\r\n if ($scope.dateformat === \"dd/mm/yyyy\") {\r\n return $filter('date')(date, \"dd-MMM\", \"UTC\");\r\n }\r\n return $filter('date')(date, \"MMM-dd\", \"UTC\");\r\n }\r\n\r\n }\r\n\r\n function link() { }\r\n\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n dataset: '=',\r\n days: \"=\",\r\n endDate: \"=\",\r\n minHeight: \"=\"\r\n },\r\n templateUrl: 'modules/patient/forms/patientFormGraph.tpl.html'\r\n };\r\n\r\n}\r\n\r\nangular.module('patient.forms').directive('patientFormGraph', PatientFormGraph);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/forms/patientFormGraph.tpl.html',\n '
          No Data
          ');\n}]);\n}(window, document, window.angular));","function PatientSurveyFormController(form, lodash, $filter, ConfigurationsService) {\r\n var vm = this;\r\n vm.survey = form.Surveys[0];\r\n\r\n loadController();\r\n function loadController() {\r\n vm.dates = lodash.map(vm.survey.CompleteInfo, function(i) {\r\n var parts = $filter(\"date\")(i.SurveyDate, \"MMM d EEE\", \"UTC\").split(\" \");\r\n var dateFormat = ConfigurationsService.configParams.DateFormat;\r\n if(dateFormat.toLowerCase() === \"dd/mm/yyyy\")\r\n {\r\n return {\r\n day: parts[2],\r\n shortDate: parts[1] + \" \" + parts[0]\r\n };\r\n }\r\n return {\r\n day: parts[2],\r\n shortDate: parts[0] + \" \" + parts[1]\r\n };\r\n });\r\n\r\n\r\n angular.forEach(vm.survey.Questions, function (question, i) {\r\n var answered = question.Responses;\r\n question.Responses = lodash.map(vm.survey.CompleteInfo, function (c) {\r\n var response = lodash.find(answered, { \"Date\": c.SurveyDate });\r\n if (!response) {\r\n return {Date: c.SurveyDate, Alerts: []};\r\n }\r\n return response;\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module(\"patient.forms\").controller(\"PatientSurveyFormController\", PatientSurveyFormController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/forms/surveyform.tpl.html',\n '
          History of {{vm.survey.SurveyName}}
          {{date.day}}
          {{date.shortDate}}
          {{vm.survey.SurveyName}}
          ');\n}]);\n}(window, document, window.angular));","function AbbreviatedPatientHeaderDirective() {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/header/abbreviatedpatientheader.tpl.html\",\r\n scope: {\r\n liPatient: \"=\",\r\n //Used to make the abbreviated header even more abbreviated!\r\n showNoteField: \"=\"\r\n },\r\n controller: function($scope) {\r\n if ($scope.liPatient != null) {\r\n if ($scope.liPatient.avatar) {\r\n $scope.imageUrl = \"data:image/png;base64,\" + $scope.liPatient.avatar;\r\n } else {\r\n var gender = \"Male\";\r\n if ($scope.liPatient.gender && $scope.liPatient.gender.length > 0 && $scope.liPatient.gender[0].toLowerCase() === \"f\") {\r\n gender = \"Female\";\r\n }\r\n $scope.imageUrl = \"random\" + gender;\r\n }\r\n }\r\n },\r\n link: function(scope, elem, attrs) {\r\n if (scope.liPatient != null) {\r\n scope.riskStatus = getRiskClass(scope.liPatient.riskId);\r\n\r\n function getRiskClass(riskId) {\r\n if (riskId === 1) {\r\n return \"success\";\r\n } else if (riskId === 2) {\r\n return \"warning\";\r\n } else if (riskId === 3) {\r\n return \"danger\";\r\n } else {\r\n return \"none\";\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"abbreviatedPatientHeader\", AbbreviatedPatientHeaderDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/abbreviatedpatientheader.tpl.html',\n '
          0 || liPatient.isThirdPartyMonitored\">
          ');\n}]);\n}(window, document, window.angular));","function AddCPTCodeBillingController(liPatient, billingCodes, codes, dateFormat, $rootScope, $scope, $uibModalInstance, AddCptCodeBillingService) {\r\n var vm = this;\r\n\r\n vm.liPatient = liPatient;\r\n vm.eligibleCodes = [];\r\n vm.codes = codes.filter(function(code) {\r\n return liPatient.careManagementTypes.some(t => t.Id === code.CareManagementTypeId);\r\n });\r\n vm.dateFormat = dateFormat;\r\n vm.currentDate = new Date();\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n var patientDate = new Date(liPatient.createdDtUTC);\r\n var minDateYear = patientDate.getFullYear();\r\n var minDateMonth = patientDate.getMonth();\r\n var minDateDay = patientDate.getDate()\r\n var minDate = new Date(minDateYear, minDateMonth, minDateDay);\r\n vm.datePickerOptions = {\r\n showWeeks: false,\r\n minDate: minDate,\r\n maxDate: new Date()\r\n };\r\n\r\n if (vm.codes.length === 0) {\r\n vm.codes.push({ Code: 'No billing codes available', disabled: true })\r\n }\r\n\r\n AddCptCodeBillingService.getEligibleCodes(vm.liPatient.id).then(function(results) {\r\n vm.eligibleCodes = results;\r\n });\r\n }\r\n\r\n vm.pickerOpen = false;\r\n vm.datePickerOpen = function ($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n\r\n vm.pickerOpen = !vm.pickerOpen;\r\n };\r\n\r\n vm.ok = function(addCPTCodeBilling) {\r\n var isValid = addCPTCodeBilling.$valid && vm.eligibleCodes.length > 0;\r\n if (isValid) {\r\n let billings = [];\r\n let selectedCodes = vm.eligibleCodes;\r\n if (selectedCodes.length === 0) return;\r\n\r\n selectedCodes.forEach(function (code) {\r\n billings.push(AddCptCodeBillingService.CPTCodeBilling(\r\n vm.liPatient.id,\r\n code.CPTCodeId,\r\n code.Code,\r\n vm.currentDate\r\n ));\r\n });\r\n\r\n $uibModalInstance.close(billings);\r\n }\r\n }\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\n\r\nangular.module('patient.header').controller('AddCPTCodeBillingController', AddCPTCodeBillingController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/addcptcodebilling.modal.tpl.html',\n '

          Add Billing Code

          {{$item.Code}}
          {{code.Code}} {{code.Description}}

          ');\n}]);\n}(window, document, window.angular));","\r\nfunction AddCptCodeBillingService($http) {\r\n function getEligibleCodes(patientId) {\r\n return $http.get(`/api/patient/${patientId}/CptCodeBilling/eligible`).then(response => response.data);\r\n }\r\n\r\n function addCptCodeBillings(cptCodeBillings, patientId) {\r\n return $http.post('/api/patient/' + patientId + '/CptCodeBilling', cptCodeBillings).then(response => response.data);\r\n }\r\n\r\n function CPTCodeBilling (patientId, cptCodeId, code, datetime) {\r\n return {\r\n PatientId: patientId,\r\n CPTCodeId: cptCodeId,\r\n Code: code,\r\n DateTime_UTC: datetime.toISOString()\r\n };\r\n }\r\n\r\n return {\r\n getEligibleCodes: getEligibleCodes,\r\n addCptCodeBillings: addCptCodeBillings,\r\n CPTCodeBilling: CPTCodeBilling\r\n };\r\n}\r\n\r\nangular.module('patient.header').service('AddCptCodeBillingService', AddCptCodeBillingService);","function AddTimeLogDetailController(liPatient, timeLog, options, $scope, $uibModalInstance, ConfigurationsService, AuthorizationService) {\r\n var vm = this;\r\n\r\n vm.liPatient = liPatient;\r\n vm.timeLog = timeLog;\r\n vm.isDescriptionOptional = options && options.isDescriptionOptional;\r\n vm.title = options && options.title || 'Add Time Log Entry';\r\n vm.isClinical = AuthorizationService.getCaregiver().CaregiverTitle.IsClinical;\r\n vm.cmtRequired = false;\r\n\r\n vm.currentDate = new Date();\r\n\r\n vm.createDate = timeLog.StartTime_UTC;\r\n vm.startTime = timeLog.StartTime_UTC;\r\n\r\n vm.duration = 0;\r\n \r\n vm.dateFormat = ConfigurationsService.configParams.DateFormat;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n var currentDate = new Date();\r\n var currentYear = currentDate.getFullYear();\r\n var currentMonth = currentDate.getMonth();\r\n\r\n var timeLogYear = timeLog.StartTime_UTC.getFullYear();\r\n var timeLogMonth = timeLog.StartTime_UTC.getMonth();\r\n \r\n var minDate = new Date(timeLogYear, timeLogMonth, 1);\r\n var maxDate = currentDate;\r\n timeLog.StartTime_UTC.setDate(currentDate.getDate());\r\n\r\n if (timeLogYear <= currentYear && timeLogMonth < currentMonth) {\r\n minDate = new Date(timeLogYear, timeLogMonth, 1);\r\n maxDate = new Date(timeLogYear, timeLogMonth + 1, 0);\r\n timeLog.StartTime_UTC.setDate(1);\r\n }\r\n \r\n vm.datePickerOptions = {\r\n showWeeks: false,\r\n minDate: minDate,\r\n maxDate: maxDate\t\r\n };\r\n\r\n vm.careManagementType = null;\r\n if (vm.liPatient && vm.liPatient.careManagementTypes && vm.liPatient.careManagementTypes.length > 0) {\r\n vm.careManagementTypes = vm.liPatient.careManagementTypes; // no longer care if time is measured\r\n vm.cmtRequired = vm.careManagementTypes.filter(t => t.IsClinicalTimeMeasured === true).length > 0;\r\n\r\n if (vm.careManagementTypes.length === 0) {\r\n vm.careManagementTypes.push(vm.liPatient.careManagementTypes[0]);\r\n }\r\n\r\n // Default if only one\r\n if (vm.careManagementTypes.length === 1 && vm.cmtRequired) {\r\n vm.careManagementType = vm.careManagementTypes[0];\r\n }\r\n } else {\r\n vm.careManagementTypes = [];\r\n }\r\n }\r\n\r\n vm.pickerOpen = false;\r\n vm.datePickerOpen = function ($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n\r\n vm.pickerOpen = !vm.pickerOpen;\r\n };\r\n\r\n\r\n $scope.$watch('vm.startTime', function(newVal, oldVal){\r\n var currentDate = new Date();\r\n var currentTime = getDate(vm.startTime);\r\n\r\n if (currentDate < currentTime) {\r\n vm.startTime = oldVal;\r\n }\r\n });\r\n\r\n vm.ok = function(addTimeLog) {\r\n var isValid = addTimeLog.$valid;\r\n vm.submitted = true;\r\n if (isValid) {\r\n vm.timeLog.StartTime_UTC = getDate(vm.startTime);\r\n\r\n var stopTime = vm.timeLog.StartTime_UTC.getTime() + (vm.duration *60000);\r\n\r\n vm.timeLog.StopTime_UTC = new Date(stopTime);\r\n\r\n if (vm.careManagementType) {\r\n vm.timeLog.CareManagementTypeId = vm.careManagementType.Id;\r\n }\r\n\r\n $uibModalInstance.close(vm.timeLog);\r\n }\r\n }\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function getDate(time) {\r\n var date = vm.createDate;\r\n var year = date.getFullYear();\r\n var month = date.getMonth();\r\n var day = date.getDate();\r\n\r\n var hours = time.getHours();\r\n var minutes = time.getMinutes();\r\n\r\n return new Date(year, month, day, hours, minutes);\r\n }\r\n}\r\n\r\nangular.module('patient.header').controller('AddTimeLogDetailController', AddTimeLogDetailController);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/addTimeLog.modal.html',\n '

          {{vm.title}}

          Duration must be 300 minutes or less
          0 && vm.isClinical\">
          ');\n}]);\n}(window, document, window.angular));","function AlertStatusFilter(AlertSeverityLevel) {\r\n return function (alertSeverity) {\r\n if (alertSeverity === AlertSeverityLevel.High) {\r\n return \"danger\";\r\n } else if (alertSeverity === AlertSeverityLevel.Medium) {\r\n return \"warning\";\r\n } else if (alertSeverity === AlertSeverityLevel.Notification) {\r\n return \"primary\";\r\n }\r\n return \"available\";\r\n };\r\n}\r\nangular.module(\"patient.header\").filter(\"alertStatus\", AlertStatusFilter);\r\n","function AlertStatusBarDirective($filter, ConfigurationsService, AlertSeverityLevel, lodash) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^?displayTemperature\",\r\n scope: {\r\n patientData: \"=\",\r\n showSpirometer: \"=\",\r\n showBothWeight: \"=\",\r\n patientHeaderConfigurations: \"=\"\r\n },\r\n templateUrl: \"modules/patient/header/alertstatusbar.tpl.html\",\r\n link: function (scope, elem, attrs, displayTempCtrl) {\r\n const biometricExceptionsEnum = Object.freeze({\r\n \"BloodPressure\": 1,\r\n \"BloodGlucose\": 2,\r\n \"HbA1c\": 3,\r\n \"Weight\": 4,\r\n \"Pulse\": 5,\r\n \"OxygenSaturation\": 6,\r\n \"Temperature\": 7,\r\n \"Steps\": 11,\r\n \"ControlUse\": 12,\r\n \"RescueUse\": 13,\r\n \"Sleep\": 14,\r\n \"Spirometer\": 15\r\n });\r\n var reviewed = scope.patientData.reviewed;\r\n scope.surveyStatus = getIconStatus(scope.patientData.survey, reviewed);\r\n scope.surveyTooltip = getIconTooltip(scope.patientData.survey, \"Pathway completed: \");\r\n scope.surveySeverityColor = findTextColor(scope.patientData.survey, reviewed);\r\n scope.weightStatus = getIconStatus(scope.patientData.weight, reviewed);\r\n scope.weightTooltip = getIconTooltip(scope.patientData.weight, \"Last weight: \");\r\n scope.weightSeverityColor = findTextColor(scope.patientData.weight, reviewed);\r\n scope.bpStatus = getIconStatus(scope.patientData.bp, reviewed);\r\n scope.bpTooltip = getIconTooltip(scope.patientData.bp, \"Last blood pressure: \", \" mmHg\");\r\n scope.bpSeverityColor = findTextColor(scope.patientData.bp, reviewed);\r\n scope.glucoseStatus = getIconStatus(scope.patientData.glucose, reviewed);\r\n scope.glucoseTooltip = getIconTooltip(scope.patientData.glucose, \"Last blood sugar: \");\r\n scope.glucoseSeverityColor = findTextColor(scope.patientData.glucose, reviewed);\r\n scope.pulseStatus = getIconStatus(scope.patientData.pulse, reviewed);\r\n scope.pulseTooltip = getIconTooltip(scope.patientData.pulse, \"Last pulse: \", \" bpm\");\r\n scope.pulseSeverityColor = findTextColor(scope.patientData.pulse, reviewed);\r\n scope.oxygenStatus = getIconStatus(scope.patientData.oxygen, reviewed);\r\n scope.oxygenTooltip = getIconTooltip(scope.patientData.oxygen, \"Last oxygen: \", \"%\");\r\n scope.oxygenSeverityColor = findTextColor(scope.patientData.oxygen, reviewed);\r\n scope.tempStatus = getIconStatus(scope.patientData.temperature, reviewed);\r\n scope.tempTooltip = getIconTooltip(scope.patientData.temperature, \"Last temperature: \");\r\n scope.tempSeverityColor = findTextColor(scope.patientData.temperature, reviewed);\r\n scope.spiroStatus = getIconStatus(scope.patientData.spirometer, reviewed);\r\n scope.spiroTooltip = getIconTooltip(scope.patientData.spirometer, \"Last spirometer: \");\r\n scope.spiroSeverityColor = findTextColor(scope.patientData.spirometer, reviewed);\r\n scope.notificationStatus = getIconStatus(scope.patientData.notification);\r\n scope.generalStatus = getGeneralIconStatus(scope.patientData.general);\r\n scope.sleepTooltip = getIconTooltip(scope.patientData.sleep, \"Last amount of sleep recorded: \");\r\n scope.sleepStatus = getIconStatus(scope.patientData.sleep, reviewed);\r\n scope.sleepSeverityColor = findTextColor(scope.patientData.sleep, reviewed);\r\n scope.stepsStatus = getIconStatus(scope.patientData.steps, reviewed);\r\n scope.stepsSeverityColor = findTextColor(scope.patientData.steps, reviewed);\r\n scope.stepsTooltip = getIconTooltip(scope.patientData.steps, \"Last step count: \");\r\n scope.controlStatus = getIconStatus(scope.patientData.control, reviewed);\r\n scope.controlToolTip = getIconTooltip(scope.patientData.control, \"Last control uses: \");\r\n scope.controlSeverityColor = findTextColor(scope.patientData, reviewed);\r\n scope.rescueStatus = getIconStatus(scope.patientData.rescue, reviewed);\r\n scope.rescueToolTip = getIconTooltip(scope.patientData.rescue, \"Last rescue uses: \");\r\n scope.rescueSeverityColor = findTextColor(scope.patientData.rescue, reviewed);\r\n\r\n scope.shouldShowIcon = shouldShowIcon;\r\n\r\n if (scope.patientData.notification.lastReading) {\r\n var dateText = $filter('date')(scope.patientData.notification.lastReading.date, ConfigurationsService.configParams.DateFormat);\r\n scope.notificationTooltip = dateText + \": \" + scope.patientData.notification.lastReading.value;\r\n }\r\n\r\n if (scope.patientData.general.lastReading) {\r\n var dateText = $filter('date')(scope.patientData.general.lastReading.date, ConfigurationsService.configParams.DateFormat);\r\n scope.generalTooltip = dateText + \": \" + scope.patientData.general.lastReading.value;\r\n }\r\n\r\n if (scope.patientData.hoursNotResponsive === 0 || scope.patientData.hoursNotResponsive) {\r\n var daysNotResponsive = Math.floor(scope.patientData.hoursNotResponsive / 24);\r\n if (daysNotResponsive === 0) {\r\n scope.daysNotResponsiveText = \"<1 day\";\r\n } else if (daysNotResponsive < 2) {\r\n scope.daysNotResponsiveText = daysNotResponsive + \" day\";\r\n } else {\r\n scope.daysNotResponsiveText = daysNotResponsive + \" days\";\r\n }\r\n }\r\n\r\n if (scope.patientData.bp.lastReading && scope.patientData.bp.lastReading.value && scope.patientData.bp.lastReading.value.systolic !== null) {\r\n scope.bpValue = scope.patientData.bp.lastReading.value.systolic + \"/\" + scope.patientData.bp.lastReading.value.diastolic;\r\n }\r\n\r\n if (scope.patientData.sleep.lastReading && scope.patientData.sleep.lastReading.value && scope.patientData.sleep.lastReading.value.Hour !== null) {\r\n if(scope.patientData.sleep.lastReading.value.Hour < 10 && scope.patientData.sleep.lastReading.value.Min < 10) {\r\n scope.sleepValue = '0' + scope.patientData.sleep.lastReading.value.Hour + \":\" + '0' + scope.patientData.sleep.lastReading.value.Min;\r\n } else if (scope.patientData.sleep.lastReading.value.Hour < 10 && scope.patientData.sleep.lastReading.value.Min > 9) {\r\n scope.sleepValue = '0' + scope.patientData.sleep.lastReading.value.Hour + \":\" + scope.patientData.sleep.lastReading.value.Min;\r\n } else if (scope.patientData.sleep.lastReading.value.Hour > 9 && scope.patientData.sleep.lastReading.value.Min < 10) {\r\n scope.sleepValue = scope.patientData.sleep.lastReading.value.Hour + \":\" + '0' + scope.patientData.sleep.lastReading.value.Min;\r\n } else {\r\n scope.sleepValue = scope.patientData.sleep.lastReading.value.Hour + \":\" + scope.patientData.sleep.lastReading.value.Min;\r\n } \r\n }\r\n\r\n if (scope.patientData.control.lastReading && scope.patientData.control.lastReading.value) {\r\n scope.controlValue = scope.patientData.control.lastReading.value.control;\r\n }\r\n\r\n if (scope.patientData.rescue.lastReading && scope.patientData.rescue.lastReading.value) {\r\n scope.rescueValue = scope.patientData.rescue.lastReading.value.rescue;\r\n }\r\n\r\n if (scope.patientData.steps.lastReading && scope.patientData.steps.lastReading.value) {\r\n scope.stepsValue = scope.patientData.steps.lastReading.value.steps;\r\n }\r\n\r\n if (scope.patientData.temperature.lastReading && scope.patientData.temperature.lastReading.value && !scope.patientData.temperature.lastReading.isSkipped) {\r\n scope.tempValue = scope.patientData.temperature.lastReading.value.fahrenheit;\r\n if (displayTempCtrl.defaultTempUnit == 1) {\r\n scope.tempValue = scope.patientData.temperature.lastReading.value.celsius;\r\n }\r\n }\r\n\r\n if (scope.patientData.weight.lastReading && scope.patientData.weight.lastReading.value && !scope.patientData.weight.lastReading.isSkipped) {\r\n var key = \"pounds\";\r\n if (scope.patientData.weight.lastReading.value.defaultUnit == \"kg\") {\r\n key = \"kilograms\";\r\n }\r\n scope.weightValue = scope.patientData.weight.lastReading.value[key];\r\n }\r\n\r\n if (scope.patientData.glucose.lastReading && scope.patientData.glucose.lastReading.value && !scope.patientData.glucose.lastReading.isSkipped) {\r\n scope.glucoseValue = scope.patientData.glucose.lastReading.value.milligramsPerDeciliter;\r\n if (scope.patientData.glucose.lastReading.value.defaultUnit == \"mmol/L\") {\r\n scope.glucoseValue = scope.patientData.glucose.lastReading.value.millimolsPerLiter;\r\n }\r\n }\r\n\r\n scope.surveyText = (scope.patientData.survey.lastReading.value.completedSurveys || 0) + ' of ' + scope.patientData.survey.lastReading.value.availableSurveys;\r\n\r\n function getGeneralIconStatus(biometric) { // status for alert icon. Removed if alert given notification priority\r\n var alertSeverity = biometric.lastReading ? biometric.lastReading.alertSeverity : AlertSeverityLevel.None;\r\n if(alertSeverity === AlertSeverityLevel.Notification)\r\n {\r\n scope.patientData.general.lastReading = undefined; // remove tooltip message\r\n return \"available\";\r\n }\r\n return getIconStatus(biometric);\r\n }\r\n\r\n function getIconStatus(biometric, reviewed) {\r\n var alertSeverity = biometric.lastReading ? biometric.lastReading.alertSeverity : AlertSeverityLevel.None;\r\n\r\n if (alertSeverity === AlertSeverityLevel.None) {\r\n var noAlertIcon = \"available\";\r\n if (ConfigurationsService.configParams.DisplayGreenBiometricIcons === true && biometric.lastReading && !reviewed && biometric.lastReading.latestAlertSeverity >= 3) {\r\n\r\n var readingDate = moment(biometric.lastReading.date).startOf('day');\r\n var today = moment().startOf('day');\r\n\r\n if (readingDate.isSame(today)) {\r\n noAlertIcon = \"success\";\r\n }\r\n }\r\n return biometric.active ? noAlertIcon : \"disabled\";\r\n }\r\n return $filter('alertStatus')(alertSeverity);\r\n }\r\n\r\n function findTextColor(biometric, reviewed) {\r\n var success = \"\";\r\n if (ConfigurationsService.configParams.DisplayGreenBiometricIcons === true && reviewed) {\r\n success = \"success\";\r\n };\r\n var today = moment().startOf('day');\r\n if (biometric.lastReading && biometric.lastReading.latestAlertSeverity < biometric.lastReading.alertSeverity) {\r\n var biometricDate = moment(biometric.lastReading.date).startOf('day');\r\n if (today.isSame(biometricDate, 'day')) {\r\n if (biometric.lastReading.latestAlertSeverity === AlertSeverityLevel.High) {\r\n return \"danger\";\r\n } else if (biometric.lastReading.latestAlertSeverity === AlertSeverityLevel.Medium) {\r\n return \"warning\";\r\n }\r\n }\r\n }\r\n return success;\r\n }\r\n\r\n function getIconTooltip(iconData, nameData, units) {\r\n var toolTip = \"\";\r\n if (angular.isArray(iconData)) {\r\n angular.forEach(iconData, function (d, i) {\r\n addSubtip(d, nameData[i], units[i]);\r\n });\r\n } else {\r\n addSubtip(iconData, nameData, units);\r\n }\r\n return toolTip;\r\n\r\n function addSubtip(data, name, units) {\r\n if (data.lastReading && data.lastReading.date !== null) {\r\n toolTip += name;\r\n if (data.lastReading.isSkipped) {\r\n toolTip += \"Skipped\";\r\n } else if (data.lastReading.value && data.lastReading.value.systolic) {\r\n toolTip += data.lastReading.value.systolic + \"/\" + data.lastReading.value.diastolic;\r\n } else if (data.lastReading.value && data.lastReading.value.Hour) {\r\n if(data.lastReading.value.Hour < 10 && data.lastReading.value.Min < 10 ) {\r\n toolTip += '0' + data.lastReading.value.Hour + \":\" + '0' + data.lastReading.value.Min;\r\n } else if (data.lastReading.value.Hour > 9 && data.lastReading.value.Min < 10 ) {\r\n toolTip += data.lastReading.value.Hour + \":\" + '0' + data.lastReading.value.Min;\r\n } else if (data.lastReading.value.Hour < 10 && data.lastReading.value.Min > 9) {\r\n toolTip += '0' + data.lastReading.value.Hour + \":\" + data.lastReading.value.Min;\r\n } else {\r\n toolTip += data.lastReading.value.Hour + \":\" + data.lastReading.value.Min;\r\n }\r\n } else if (data.lastReading.value && data.lastReading.value.control) {\r\n toolTip += data.lastReading.value.control;\r\n } else if (data.lastReading.value && data.lastReading.value.rescue) {\r\n toolTip += data.lastReading.value.rescue;\r\n } else if (data.lastReading.value && data.lastReading.value.steps) {\r\n toolTip += data.lastReading.value.steps + ' steps';\r\n } else if (data.lastReading.value && data.lastReading.value.celsius) {\r\n var values = [data.lastReading.value.fahrenheit + \" °F\", data.lastReading.value.celsius + \" °C\"];\r\n if (displayTempCtrl.defaultTempUnit == 1) {\r\n values.reverse();\r\n }\r\n toolTip += displayTempCtrl.displayBothUnits ? values[0] + \" (\" + values[1] + \")\" : values[0];\r\n } else if (data.lastReading.value && data.lastReading.value.pef) {\r\n toolTip += data.lastReading.value.pef + \" L/min, \" + data.lastReading.value.fevOne + \" L, \" + data.lastReading.value.fevRatio;\r\n } else if (data.lastReading.value && data.lastReading.value.pounds) {\r\n var weightValues = [data.lastReading.value.pounds + \" lbs\", data.lastReading.value.kilograms + \" kg\"];\r\n if (data.lastReading.value.defaultUnit == \"kg\") {\r\n weightValues.reverse();\r\n }\r\n toolTip += scope.showBothWeight ? weightValues[0] + \" (\" + weightValues[1] + \")\" : weightValues[0];\r\n } else if (data.lastReading.value && data.lastReading.value.milligramsPerDeciliter) {\r\n var glucoseValues = [data.lastReading.value.milligramsPerDeciliter + \" mg/dL\", data.lastReading.value.millimolsPerLiter + \" mmol/L\"];\r\n if (data.lastReading.value.defaultUnit == \"mmol/L\") {\r\n glucoseValues.reverse();\r\n }\r\n toolTip += glucoseValues[0];\r\n } else if (data.lastReading.value && !angular.isObject(data.lastReading.value)) { // is string so just use it\r\n toolTip += data.lastReading.value;\r\n }\r\n if (data.lastReading.value && !data.lastReading.isSkipped && units) {\r\n toolTip += units;\r\n }\r\n if (data.baseline) {\r\n toolTip += \"\\nBaseline: \";\r\n var baselineValues = [data.baseline.pounds + \" lbs\", data.baseline.kilograms + \" kg\"];\r\n if (data.baseline.defaultUnit == \"kg\") {\r\n baselineValues.reverse();\r\n }\r\n toolTip += scope.showBothWeight ? baselineValues[0] + \" (\" + baselineValues[1] + \")\" : baselineValues[0];\r\n }\r\n var biasMinutes = moment().isDST() ? scope.patientData.daylightSavingsBias : scope.patientData.standardBias;\r\n var readingDate = new Date(data.lastReading.date);\r\n readingDate.setMinutes(readingDate.getMinutes() + biasMinutes);\r\n toolTip += \"\\n\";\r\n toolTip += $filter(\"datetime\")(readingDate, \"datetime\", \"UTC\");\r\n toolTip += \"\\n\";\r\n }\r\n }\r\n }\r\n\r\n function shouldShowIcon(patientHeaderConfigurationId) {\r\n //Find configuration for the specific population.\r\n var populationConfiguration = lodash.find(scope.patientHeaderConfigurations.PopulationPatientHeaderConfigurations, \r\n {PopulationId: scope.patientData.populationId, PatientHeaderConfigurationId: patientHeaderConfigurationId});\r\n\r\n //Use the population configuration if it exists.\r\n if (populationConfiguration) {\r\n return populationConfiguration.IsEnabled;\r\n }\r\n //Otherwise use the default configuration.\r\n else {\r\n var defaultConfiguration = lodash.find(scope.patientHeaderConfigurations.DefaultPatientHeaderConfigurations, \r\n {PatientHeaderConfigurationId: patientHeaderConfigurationId});\r\n return defaultConfiguration.IsEnabled;\r\n }\r\n }\r\n \r\n scope.getTooltip = getTooltip;\r\n\r\n function getTooltip(item) {\r\n let toolTip = \"\";\r\n if (item.LastReadingDateTime_UTC) {\r\n toolTip += getTooltipLabel(item.TypeName);\r\n if (item.IsLastReadingSkipped) {\r\n toolTip += \"Skipped\";\r\n }\r\n else {\r\n switch (item.BiometricMeasurementTypeId) {\r\n case biometricExceptionsEnum.BloodPressure:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value && \r\n item.LastReadings[1] && item.LastReadings[1].Value) {\r\n toolTip += item.LastReadings.filter(r => r.Key == \"Systolic\")[0].Value + \"/\" + item.LastReadings.filter(r => r.Key == \"Diastolic\")[0].Value;\r\n }\r\n break;\r\n case biometricExceptionsEnum.Sleep:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value && \r\n item.LastReadings[1] && item.LastReadings[1].Value) {\r\n let readingHour = item.LastReadings[0].Value;\r\n let readingMin = item.LastReadings[1].Value;\r\n if(readingHour < 10 && readingMin < 10 ) {\r\n toolTip += '0' + readingHour + \":\" + '0' + readingMin;\r\n } else if (readingHour > 9 && readingMin < 10 ) {\r\n toolTip += readingHour + \":\" + '0' + readingMin;\r\n } else if (readingHour < 10 && readingMin > 9) {\r\n toolTip += '0' + readingHour + \":\" + readingMin;\r\n } else {\r\n toolTip += readingHour + \":\" + readingMin;\r\n }\r\n }\r\n break;\r\n case biometricExceptionsEnum.Steps:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value) {\r\n toolTip += item.LastReadings.filter(r => r.Key == \"Steps\")[0].Value + ' steps';\r\n }\r\n break;\r\n case biometricExceptionsEnum.Temperature:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value && \r\n item.LastReadings[1] && item.LastReadings[1].Value) {\r\n let values = [item.LastReadings.filter(r => r.Key == \"TempFahrenheit\")[0].Value + \" °F\", item.LastReadings.filter(r => r.Key == \"TempCelsius\")[0].Value + \" °C\"];\r\n if (displayTempCtrl.defaultTempUnit == 1) {\r\n values.reverse();\r\n }\r\n toolTip += displayTempCtrl.displayBothUnits ? values[0] + \" (\" + values[1] + \")\" : values[0];\r\n }\r\n break;\r\n case biometricExceptionsEnum.Spirometer:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value && \r\n item.LastReadings[1] && item.LastReadings[1].Value && \r\n item.LastReadings[2] && item.LastReadings[2].Value) {\r\n toolTip += item.LastReadings.filter(r => r.Key == \"PEF\")[0].Value + \" L/min, \" + item.LastReadings.filter(r => r.Key == \"FEVOne\")[0].Value + \" L, \" + item.LastReadings.filter(r => r.Key == \"FEVRatio\")[0].Value;\r\n }\r\n break;\r\n case biometricExceptionsEnum.Weight:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value && \r\n item.LastReadings[1] && item.LastReadings[1].Value) {\r\n let weightValues = [item.LastReadings.filter(r => r.Key == \"Pounds\")[0].Value + \" lbs\", item.LastReadings.filter(r => r.Key == \"Killograms\")[0].Value + \" kg\"];\r\n if (item.LastReadingUnit == \"kg\") {\r\n weightValues.reverse();\r\n }\r\n toolTip += scope.showBothWeight ? weightValues[0] + \" (\" + weightValues[1] + \")\" : weightValues[0];\r\n }\r\n var baseline = scope.patientData.weight.baseline;\r\n if (baseline) {\r\n toolTip += \"\\nBaseline: \";\r\n let baselineValues = [baseline.pounds + \" lbs\", baseline.kilograms + \" kg\"];\r\n if (baseline.defaultUnit == \"kg\") {\r\n baselineValues.reverse();\r\n }\r\n toolTip += scope.showBothWeight ? baselineValues[0] + \" (\" + baselineValues[1] + \")\" : baselineValues[0];\r\n }\r\n break;\r\n case biometricExceptionsEnum.BloodGlucose:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value && \r\n item.LastReadings[1] && item.LastReadings[1].Value) {\r\n let glucoseValues = [item.LastReadings.filter(r => r.Key == \"MilligramsPerDecileter\")[0].Value + \" mg/dL\", item.LastReadings.filter(r => r.Key == \"MillimolsPerLiter\")[0].Value + \" mmol/L\"];\r\n if (item.LastReadingUnit == \"mmol/L\") {\r\n glucoseValues.reverse();\r\n }\r\n toolTip += glucoseValues[0];\r\n }\r\n break;\r\n default:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value) {\r\n toolTip += item.LastReadings[0].Value\r\n if (item.LastReadingUnit) {\r\n toolTip += item.LastReadingUnit;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n let biasMinutes = moment().isDST() ? scope.patientData.daylightSavingsBias : scope.patientData.standardBias;\r\n let readingDate = new Date(item.LastReadingDateTime_UTC);\r\n readingDate.setMinutes(readingDate.getMinutes() + biasMinutes);\r\n toolTip += \"\\n\";\r\n toolTip += $filter(\"datetime\")(readingDate, \"datetime\", \"UTC\");\r\n toolTip += \"\\n\";\r\n }\r\n return toolTip;\r\n }\r\n\r\n scope.getLabel = getLabel;\r\n\r\n function getLabel(item) {\r\n if (item.LastReadingDateTime_UTC) {\r\n if (!item.IsLastReadingSkipped) {\r\n switch (item.BiometricMeasurementTypeId) {\r\n case biometricExceptionsEnum.BloodPressure:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value && \r\n item.LastReadings[1] && item.LastReadings[1].Value) {\r\n return item.LastReadings.filter(r => r.Key == \"Systolic\")[0].Value + \"/\" + item.LastReadings.filter(r => r.Key == \"Diastolic\")[0].Value;\r\n } \r\n else return \"\";\r\n case biometricExceptionsEnum.Sleep:\r\n if (item.LastReadings && item.LastReadings[0] && item.LastReadings[1] && \r\n item.LastReadings.filter(r => r.Key == \"Hour\")[0].Value && item.LastReadings.filter(r => r.Key == \"Min\")[0].Value) {\r\n let readingHour = item.LastReadings.filter(r => r.Key == \"Hour\")[0].Value;\r\n let readingMin = item.LastReadings.filter(r => r.Key == \"Min\")[0].Value;\r\n if(readingHour < 10 && readingMin < 10 ) {\r\n return '0' + readingHour + \":\" + '0' + readingMin;\r\n } else if (readingHour > 9 && readingMin < 10 ) {\r\n return readingHour + \":\" + '0' + readingMin;\r\n } else if (readingHour < 10 && readingMin > 9) {\r\n return '0' + readingHour + \":\" + readingMin;\r\n } else {\r\n return readingHour + \":\" + readingMin;\r\n }\r\n } \r\n else return \"\";\r\n case biometricExceptionsEnum.Temperature:\r\n if (item.LastReadings) {\r\n if (displayTempCtrl.defaultTempUnit == 1 && item.LastReadings\r\n && item.LastReadings.filter(r => r.Key == \"TempCelsius\") && \r\n item.LastReadings.filter(r => r.Key == \"TempCelsius\")[0].Value) {\r\n return item.LastReadings.filter(r => r.Key == \"TempCelsius\")[0].Value;\r\n }\r\n else if (item.LastReadings.filter(r => r.Key == \"TempFahrenheit\")[0] \r\n && item.LastReadings.filter(r => r.Key == \"TempFahrenheit\")[0].Value) {\r\n return item.LastReadings.filter(r => r.Key == \"TempFahrenheit\")[0].Value;\r\n }\r\n }\r\n else return \"\";\r\n case biometricExceptionsEnum.Weight:\r\n let wtUnit = \"Pounds\";\r\n if (item.LastReadings \r\n && item.LastReadings.filter(r => r.Key == wtUnit)[0].Value\r\n && item.LastReadings.filter(r => r.Key == \"Killograms\")[0].Value //TODO fix misspelling in api;\r\n && item.LastReadings[0].Value && item.LastReadingUnit && !item.IsLastReadingSkipped) {\r\n if (item.LastReadingUnit == \"kg\") {\r\n wtUnit = \"Killograms\"; \r\n }\r\n return item.LastReadings.filter(r => r.Key == wtUnit)[0].Value;\r\n }\r\n else return \"\";\r\n case biometricExceptionsEnum.BloodGlucose:\r\n if (item.LastReadings && !item.IsLastReadingSkipped)\r\n {\r\n let glucosePosition = 0;\r\n if (item.LastReadingUnit == \"mmol/L\") {\r\n glucosePosition = 1;\r\n }\r\n\r\n if (item.LastReadings[glucosePosition] && \r\n item.LastReadings[glucosePosition].Value ) {\r\n return item.LastReadings[glucosePosition].Value;\r\n }\r\n }\r\n else return \"\";\r\n default:\r\n if (item.LastReadings && \r\n item.LastReadings[0] && item.LastReadings[0].Value) {\r\n return item.LastReadings[0].Value;\r\n }\r\n else return \"\";\r\n }\r\n }\r\n } \r\n }\r\n\r\n scope.getSeverityColor = getSeverityColor;\r\n\r\n function getSeverityColor(item) {\r\n let success = \"\";\r\n if (ConfigurationsService.configParams.DisplayGreenBiometricIcons === true && scope.patientData.reviewed) {\r\n success = \"success\";\r\n };\r\n let today = moment().startOf('day');\r\n if (item.LatestAlertSeverity < item.HighestAlertSeverity) {\r\n let biometricDate = moment(item.LastReadingDateTime_UTC).startOf('day');\r\n if (today.isSame(biometricDate, 'day')) {\r\n if (item.LatestAlertSeverity === AlertSeverityLevel.High) {\r\n return \"danger\";\r\n } else if (item.LatestAlertSeverity === AlertSeverityLevel.Medium) {\r\n return \"warning\";\r\n }\r\n }\r\n }\r\n return success;\r\n }\r\n\r\n scope.getStatus = getStatus;\r\n \r\n function getStatus(item) {\r\n let alertSeverity = item.HighestAlertSeverity ? item.HighestAlertSeverity : AlertSeverityLevel.None;\r\n\r\n if (alertSeverity === AlertSeverityLevel.None) {\r\n let noAlertIcon = \"available\";\r\n if (ConfigurationsService.configParams.DisplayGreenBiometricIcons === true && item.LastReadings && item.LastReadings[0] && item.LastReadings[0].Value && !scope.patientData.reviewed && item.LatestAlertSeverity >= 3) {\r\n\r\n let readingDate = moment(item.LastReadingDateTime_UTC).startOf('day');\r\n let today = moment().startOf('day');\r\n\r\n if (readingDate.isSame(today)) {\r\n noAlertIcon = \"success\";\r\n }\r\n }\r\n return item.IsActive ? noAlertIcon : \"disabled\";\r\n }\r\n return $filter('alertStatus')(alertSeverity);\r\n }\r\n\r\n function getTooltipLabel(typeName) {\r\n let labelName = typeName.toLowerCase();\r\n switch (typeName)\r\n {\r\n case \"Blood Glucose\":\r\n labelName = \"blood sugar\";\r\n break;\r\n case \"Oxygen Saturation\":\r\n labelName = \"oxygen\";\r\n break;\r\n case \"Sleep\":\r\n labelName = \"amount of sleep recorded\";\r\n break;\r\n case \"Steps\":\r\n labelName = \"step count\";\r\n break;\r\n case \"Control Use\":\r\n labelName = \"control uses\";\r\n break;\r\n case \"Rescue Use\":\r\n labelName = \"rescue uses\";\r\n break;\r\n }\r\n return \"Last \" + labelName + \": \";\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"alertStatusBar\", AlertStatusBarDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/alertstatusbar.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function CallStatusDirective(ConfigurationsService, $uibModal, PatientListService, PermissionService, VideoCallService, PatientServiceLevelService, InvitationStatusEnum, lodash, ServiceLevelType, $filter, ConfigurationRepository) {\r\n \r\n return {\r\n restrict: \"E\",\r\n template: ' 0}}\" tooltip-class=\"patient-header-tooltip\" tooltip-placement=\"auto top\" uib-tooltip=\"{{videoVisitTooltip}}\" tooltip-append-to-body=\"true\">',\r\n scope: {\r\n patientData: \"=\"\r\n },\r\n controller: function ($scope) {\r\n \r\n $scope.callType = $scope.patientData.enableVideo ? \"video\" : \"call\";\r\n \r\n if($scope.patientData.enableVideo && ConfigurationsService.configParams.GoWebShowPhoneIcon) {\r\n $scope.callType = $scope.patientData.goPlatformId === 2 \r\n || $scope.patientData.goPlatformId === undefined \r\n || $scope.patientData.goPlatformId === null ? \"video\" : \"call\";\r\n }\r\n \r\n $scope.canCall = PermissionService.userHasPermission([\"PatientCall\"]);\r\n },\r\n link: function (scope, elem, attrs) {\r\n load();\r\n\r\n function load() {\r\n scope.alertSeverity = scope.patientData.callAlertSeverity;\r\n ConfigurationsService.getConfig().then(function(data) {\r\n scope.callToEnabled = data.CallToEnabled === true;\r\n });\r\n\r\n if (scope.patientData.callAlertDateTime) {\r\n var minutesSince = moment().diff(scope.patientData.callAlertDateTime, 'minutes');\r\n var timeSince = 0;\r\n var units = \"\";\r\n if (minutesSince < 60) {\r\n timeSince = minutesSince;\r\n units = \"min\";\r\n } else if (minutesSince >= 60 && minutesSince < 60*24) {\r\n timeSince = Math.floor(minutesSince / 60);\r\n units = \"hr\";\r\n } else if (minutesSince >= 60*24 && minutesSince < 60*24*7) {\r\n timeSince = Math.floor(minutesSince / (60*24));\r\n units = \"day\";\r\n } else {\r\n timeSince = Math.floor(minutesSince/ (60*24*7));\r\n units = \"week\";\r\n }\r\n\r\n if (timeSince !== 1) {\r\n units += \"s\";\r\n }\r\n\r\n scope.callDuration = timeSince + \" \" + units;\r\n }\r\n\r\n scope.videoVisitTooltip = \"\";\r\n var VisitStatus = { Scheduled: 0, InProgress: 1, Ended: 2, InWaitingRoom: 3, PatientNotJoined: 4, CareMemberNotJoined: 5, CallRejected: 6, Cancelled: 7 }\r\n var toolTip = \"\";\r\n var lineBreak = \"\\n\";\r\n const DateTimeFilter = $filter('datetime');\r\n PatientListService.patientsScheduledVirtualVisits.subscribe(\r\n function (response) {\r\n if (response != null) {\r\n var visitsList = PatientListService.filterVirtualVisitsByPatientId(scope.patientData.id, response)\r\n var visitsListFiltered = visitsList.filter(x => x.StatusId == VisitStatus.Scheduled || x.StatusId == VisitStatus.InWaitingRoom)[0];\r\n if (visitsListFiltered != null) {\r\n toolTip = \"Scheduled Video Visit\" + lineBreak;\r\n toolTip += DateTimeFilter(visitsListFiltered.ScheduleDateTime_UTC) + \" \" + moment(visitsListFiltered.ScheduleDateTime_UTC).format('hh:mm A') + lineBreak;\r\n scope.videoVisitTooltip = toolTip;\r\n }\r\n }\r\n }\r\n );\r\n scope.$on(\"vh:launchCallModal\", function() {\r\n scope.callPatient();\r\n });\r\n }\r\n\r\n scope.callPatient = function openCallModal(event) {\r\n var callModalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/header/patientcall.modal.html',\r\n controller: 'PatientCallModalController as vm',\r\n keyboard: false,\r\n backdrop: 'static',\r\n windowClass: 'tempSizeSmall',\r\n size: 'sm',\r\n resolve: {\r\n message: function() {\r\n if(!scope.patientData.callAlertId) return null;\r\n return PatientListService.getPatientCallAlert(scope.patientData.id, scope.patientData.callAlertId).then(function(data){\r\n return data.Message;\r\n });\r\n },\r\n data: function() {\r\n return {\r\n Patient: scope.patientData,\r\n CallDuration: scope.callDuration\r\n };\r\n },\r\n hasNotificationPermission: function() {\r\n return VideoCallService.getPermissionStatus(scope.patientData.id).then(function(res) {\r\n return res === null ? true : res.Value === \"true\";\r\n });\r\n },\r\n optedIn: function() {\r\n return PatientServiceLevelService.getServiceLevel(scope.patientData.id).then(function(sl) {\r\n if(sl !== null){\r\n if(sl.ServiceLevel.ServiceLevelTypeId !== ServiceLevelType.BYOD && sl.ServiceLevel.ServiceLevelTypeId !== ServiceLevelType.Go) {\r\n return true;\r\n }\r\n var invitation = lodash(sl.Invitations).sortBy('CreatedDateTime_UTC').last();\r\n return invitation && invitation.InvitationStatus === InvitationStatusEnum.OptedIn;\r\n } else {\r\n return false;\r\n }\r\n });\r\n },\r\n isPatientScheduleVirtualVisitEnabled: function () {\r\n return PatientListService.getPatientScheduleVirtualVisitEnabled(scope.patientData.id).then(function (sl) {\r\n if (sl !== null) { \r\n return sl;\r\n } else {\r\n return false;\r\n }\r\n });\r\n },\r\n hasEulaAccepted: function () {\r\n return PatientListService.hasPatientAcceptedEula(scope.patientData.id).then(function (response) {\r\n if (response !== null) {\r\n return response.Success;\r\n } else {\r\n return false;\r\n }\r\n });\r\n },\r\n scheduledVisitsList: function () {\r\n return PatientListService.getPatientScheduleVirtualVisits(scope.patientData.id).then(function (response) {\r\n return response;\r\n });\r\n },\r\n isDisableScheduling: function () { \r\n return VideoCallService.getConfig().then(function (response) {\r\n if (response != null) {\r\n return response.IsDisableScheduling; \r\n } else {\r\n return false;\r\n }\r\n }); \r\n },\r\n isEnableScheduleNowPreNotification: function () {\r\n return ConfigurationsService.configParams.EnableScheduleNowExperiencePreNotification ? ConfigurationsService.configParams.EnableScheduleNowExperiencePreNotification : false;\r\n },\r\n isEnableScheduleNowPreNotificationConfirmation: function () {\r\n return ConfigurationsService.configParams.EnableScheduleNowExperiencePreNotificationConfirmation ? ConfigurationsService.configParams.EnableScheduleNowExperiencePreNotificationConfirmation : false;\r\n }\r\n } \r\n });\r\n\r\n callModalInstance.result.then(function (action) {\r\n if (action == 'callnow' || action == 'videocallnow') {\r\n scope.alertSeverity = scope.patientData.callAlertSeverity;\r\n scope.callDuration = \"\";\r\n }\r\n });\r\n\r\n if(event) {\r\n event.stopPropagation();\r\n }\r\n };\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"callStatus\", CallStatusDirective);\r\n","function CopyBiometricsModalController($uibModalInstance, MonitoringService, MonitoringBiometricsService, PatientChartService, \r\n SurveyParameterType, ReportsService, moment, lodash, patientId, liPatient, patientBiometricTypes, $filter) {\r\n var vm = this;\r\n vm.liPatient = liPatient;\r\n vm.endDate = new Date();\r\n vm.startDate = new Date();\r\n vm.formattedText = \"\";\r\n vm.includeChartNotes = true;\r\n vm.dataLoaded = false;\r\n var HEADING_WEIGHT = \"Time Wt \";\r\n var HEADING_BP = \"Time Sys Dias \";\r\n var HEADING_PULSE = \"Time HR \";\r\n var HEADING_BS = \"Time Glu \";\r\n var HEADING_OXY = \"Time Sp02 \";\r\n var HEADING_TEMP = \"Time Temp \";\r\n var HEADING_FEV1 = \"Time FEV1 \";\r\n var HEADING_PEF = \"Time PEF \";\r\n var HEADING_FEVRatio = \"Time FEV1/FEV6 \";\r\n var HEADING_STEPS = \"Time Steps \";\r\n var weightValues = [];\r\n var bpValues = [];\r\n var bsValues = [];\r\n var pulseValues = [];\r\n var oxyValues = [];\r\n var tempFValues = [];\r\n var tempCValues = [];\r\n var stepsValues = [];\r\n var pefValues = [];\r\n var fevOneValues = [];\r\n var fevRatioValues = [];\r\n\r\n vm.relativeDate = \"Today\";\r\n\r\n vm.getBiometrics = function () {\r\n // filter by biometric parameter types that patient has responses for\r\n MonitoringBiometricsService.getBiometrics().then(function (data) {\r\n vm.availableBiometricParameterTypes = lodash(data).filter(function (biometric) {\r\n var retVal = false;\r\n for (var type in biometric.parameterTypes) {\r\n for (var patientParameterType in patientBiometricTypes) {\r\n if (patientBiometricTypes[patientParameterType] == biometric.parameterTypes[type]) {\r\n retVal = true;\r\n }\r\n }\r\n }\r\n return retVal;\r\n }).value();\r\n\r\n vm.selectedBiometricParameterTypes = vm.availableBiometricParameterTypes;\r\n });\r\n };\r\n \r\n \r\n vm.copytoclipboard = function () {\r\n document.getElementById('formattedText').select();\r\n document.execCommand('copy');\r\n $uibModalInstance.close();\r\n };\r\n\r\n vm.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n vm.updateDates = function () {\r\n currentDate = new Date();\r\n if (vm.relativeDate === \"Today\") {\r\n vm.startDate = currentDate;\r\n vm.endDate = currentDate;\r\n } else if (vm.relativeDate === \"Yesterday\") {\r\n vm.startDate = moment().subtract('1', 'day').toDate();\r\n vm.endDate = moment().subtract('1', 'day').toDate();\r\n } else if (vm.relativeDate === \"This Calendar Week\") {\r\n vm.startDate = moment().startOf('week').toDate();\r\n vm.endDate = moment().subtract('1', 'day').toDate();\r\n } else if (vm.relativeDate === \"This Calendar Week\") {\r\n vm.startDate = moment().startOf('week').toDate();\r\n vm.endDate = currentDate;\r\n } else if (vm.relativeDate === \"Last Calendar Week\") {\r\n vm.startDate = moment().subtract('1', 'weeks').startOf('week').toDate();\r\n vm.endDate = moment().subtract('1', 'weeks').endOf('week').toDate();\r\n } else if (vm.relativeDate === \"Last Two Calendar Weeks\") {\r\n vm.startDate = moment().subtract('2', 'weeks').startOf('week').toDate();\r\n vm.endDate = moment().subtract('1', 'weeks').endOf('week').toDate();\r\n } else if (vm.relativeDate === \"Last Calendar Month\") {\r\n vm.startDate = moment().subtract('1', 'months').startOf('month').toDate();\r\n vm.endDate = moment().subtract('1', 'months').endOf('month').toDate();\r\n } else if (vm.relativeDate === \"This Calendar Year\") {\r\n vm.startDate = moment().startOf('year').toDate();\r\n vm.endDate = currentDate;\r\n } else if (vm.relativeDate === \"Last Calendar Year\") {\r\n vm.startDate = moment().subtract('1', 'years').startOf('year').toDate();\r\n vm.endDate = moment().subtract('1', 'years').endOf('year').toDate();\r\n } else if (vm.relativeDate === \"Last 14 Days\") {\r\n vm.startDate = moment().subtract('13', 'day').startOf('day').toDate();\r\n vm.endDate = currentDate;\r\n }\r\n }\r\n\r\n vm.fetchData = function() {\r\n\r\n MonitoringService.logPatientDataPreview(vm.liPatient.id).then(function(data){\r\n vm.formattedText = vm.liPatient.name.lastName + \", \" + vm.liPatient.name.firstName + \" \";\r\n if(vm.liPatient.dob) {\r\n vm.formattedText += \"(\" + $filter(\"datetime\")(new moment.utc(vm.liPatient.dob)) + \")\" + lineFeed;\r\n } else {\r\n vm.formattedText += lineFeed;\r\n }\r\n if(vm.includeChartNotes) {\r\n vm.formattedText += \"Vital Sign Data and Chart Notes for: \";\r\n } else {\r\n vm.formattedText += \"Vital Sign Data for: \";\r\n }\r\n\r\n var formattedStartDate = $filter(\"datetime\")(new moment(vm.startDate));\r\n var formattedEndDate = $filter(\"datetime\")(new moment(vm.endDate));\r\n vm.formattedText += formattedStartDate + \" - \" + formattedEndDate + lineFeed + lineFeed;\r\n var population = vm.liPatient.population && vm.liPatient.population != null ? vm.liPatient.population : \"\";\r\n vm.formattedText += \"Population: \" + population + lineFeed + lineFeed;\r\n\r\n /** Sample parse biometric \r\n {\r\n AlertSeverityLevelId:2\r\n ObservationDateTime_UTC:\"2017-06-27T15:15:00Z\"\r\n PatientResponseId:38\r\n PatientSurveyOptionId:0\r\n SkipReason:null\r\n SortOrder:0\r\n SurveyParameterTypeId:4\r\n Value:\"175\"\r\n } **/\r\n MonitoringService.getPatientResponses(patientId, vm.startDate, vm.endDate).then(function(data) {\r\n var parameterTypes = getSelectedParameterTypes();\r\n if (data.Biometrics) {\r\n var biometrics = parseBiometrics(data.Biometrics, parameterTypes);\r\n weightValues = getBiometricsByParameterType(biometrics, SurveyParameterType.Weight);\r\n bpValues = getBiometricsByParameterType(biometrics, SurveyParameterType.Systolic);\r\n bsValues = getBiometricsByParameterType(biometrics, SurveyParameterType.BloodSugar);\r\n pulseValues = getBiometricsByParameterType(biometrics, SurveyParameterType.Pulse);\r\n oxyValues = getBiometricsByParameterType(biometrics, SurveyParameterType.Oxygen);\r\n tempFValues = getBiometricsByParameterType(biometrics, SurveyParameterType.TempFahrenheit);\r\n tempCValues = getBiometricsByParameterType(biometrics, SurveyParameterType.TempCelsius);\r\n stepsValues = getBiometricsByParameterType(biometrics, SurveyParameterType.Steps);\r\n pefValues = getBiometricsByParameterType(biometrics, SurveyParameterType.PEF);\r\n fevOneValues = getBiometricsByParameterType(biometrics, SurveyParameterType.FEVOne);\r\n fevRatioValues = getBiometricsByParameterType(biometrics, SurveyParameterType.FEVRatio);\r\n var biometricDates = lodash(biometrics).map('Date').unique().value(); // distinct list of dates we have biometrics\r\n var currentResponseArray = [];\r\n var columnIndex = 0; // only show max of 5 biometrics per line\r\n var startHeader = false;\r\n var responseTypes = {};\r\n var summaryValues = populateSummary(biometrics, parameterTypes);\r\n\r\n vm.formattedText += dashes;\r\n vm.formattedText += \"Summary \";\r\n for(var i in summaryValues) {\r\n vm.formattedText += summaryValues[i].title;\r\n }\r\n vm.formattedText += lineFeed;\r\n vm.formattedText += dashes;\r\n vm.formattedText += \"High \";\r\n for(var i in summaryValues) {\r\n vm.formattedText += summaryValues[i].high;\r\n }\r\n vm.formattedText += lineFeed;\r\n vm.formattedText += \"Low \";\r\n for(var i in summaryValues) {\r\n vm.formattedText += summaryValues[i].low;\r\n }\r\n vm.formattedText += lineFeed;\r\n vm.formattedText += \"Average \";\r\n for(var i in summaryValues) {\r\n vm.formattedText += summaryValues[i].ave;\r\n }\r\n vm.formattedText += lineFeed;\r\n\r\n startNewHeader();\r\n\r\n if(parameterTypes.indexOf(SurveyParameterType.Weight) >= 0) {\r\n vm.formattedText += HEADING_WEIGHT;\r\n columnIndex++\r\n responseTypes.hasWeight = true;\r\n currentResponseArray = currentResponseArray.concat(weightValues);\r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.Systolic) >= 0) {\r\n vm.formattedText += HEADING_BP;\r\n columnIndex++\r\n responseTypes.hasBP = true;\r\n currentResponseArray = currentResponseArray.concat(bpValues);\r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.Pulse) >= 0) {\r\n vm.formattedText += HEADING_PULSE;\r\n columnIndex++\r\n responseTypes.hasPulse = true;\r\n currentResponseArray = currentResponseArray.concat(pulseValues);\r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.BloodSugar) >= 0) {\r\n vm.formattedText += HEADING_BS;\r\n columnIndex++\r\n responseTypes.hasBS = true;\r\n currentResponseArray = currentResponseArray.concat(bsValues);\r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.Oxygen) >= 0) {\r\n vm.formattedText += HEADING_OXY;\r\n columnIndex++\r\n responseTypes.hasOxygen = true;\r\n currentResponseArray = currentResponseArray.concat(oxyValues);\r\n }\r\n\r\n // START TESTING COLUMN LENGTH\r\n if(columnIndex >= 5) {\r\n columnIndex = 0;\r\n startHeader = true;//will need new header row if more biometrics are written\r\n writeBiometricSet(currentResponseArray, biometricDates, responseTypes);\r\n currentResponseArray = [];\r\n responseTypes = {};\r\n }\r\n\r\n if(parameterTypes.indexOf(SurveyParameterType.FEVOne) >= 0) {\r\n if(startHeader) { startNewHeader(); startHeader = false; }\r\n vm.formattedText += HEADING_FEV1;\r\n columnIndex++\r\n responseTypes.hasFEV1 = true;\r\n currentResponseArray = currentResponseArray.concat(fevOneValues);\r\n }\r\n if(columnIndex >= 5) {\r\n columnIndex = 0;\r\n startHeader = true;//will need new header row if more biometrics are written\r\n writeBiometricSet(currentResponseArray, biometricDates, responseTypes);\r\n currentResponseArray = [];\r\n responseTypes = {};\r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.PEF) >= 0) {\r\n if(startHeader) { startNewHeader(); startHeader = false; }\r\n vm.formattedText += HEADING_PEF;\r\n columnIndex++\r\n responseTypes.hasPEF = true;\r\n currentResponseArray = currentResponseArray.concat(pefValues);\r\n }\r\n if(columnIndex >= 5) {\r\n columnIndex = 0;\r\n startHeader = true;//will need new header row if more biometrics are written\r\n writeBiometricSet(currentResponseArray, biometricDates, responseTypes);\r\n currentResponseArray = [];\r\n responseTypes = {};\r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.FEVRatio) >= 0) {\r\n if(startHeader) { startNewHeader(); startHeader = false; }\r\n vm.formattedText += HEADING_FEVRatio;\r\n columnIndex++\r\n responseTypes.hasFEVRatio = true;\r\n currentResponseArray = currentResponseArray.concat(fevRatioValues);\r\n }\r\n if(columnIndex >= 5) {\r\n columnIndex = 0;\r\n startHeader = true;//will need new header row if more biometrics are written\r\n writeBiometricSet(currentResponseArray, biometricDates, responseTypes);\r\n currentResponseArray = [];\r\n responseTypes = {};\r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.TempFahrenheit) >= 0 || parameterTypes.indexOf(SurveyParameterType.TempCelsius) >= 0) {\r\n if(startHeader) { startNewHeader(); startHeader = false; }\r\n vm.formattedText += HEADING_TEMP;\r\n columnIndex++\r\n responseTypes.hasTemp = true;\r\n currentResponseArray = currentResponseArray.concat(tempFValues).concat(tempCValues);\r\n }\r\n if(columnIndex >= 5) {\r\n columnIndex = 0;\r\n startHeader = true;//will need new header row if more biometrics are written\r\n writeBiometricSet(currentResponseArray, biometricDates, responseTypes);\r\n currentResponseArray = [];\r\n responseTypes = {};\r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.Steps) >= 0) {\r\n if(startHeader) { startNewHeader(); startHeader = false; }\r\n vm.formattedText += HEADING_STEPS;\r\n columnIndex++\r\n responseTypes.hasSTEPS = true;\r\n currentResponseArray = currentResponseArray.concat(stepsValues);\r\n }\r\n\r\n // done, write whatever we may have\r\n if(currentResponseArray.length > 0) {\r\n writeBiometricSet(currentResponseArray, biometricDates, responseTypes);\r\n } else if (Object.keys(responseTypes).length > 0) {\r\n // my have written headings but have not data, so write bottom line of heading\r\n vm.formattedText += lineFeed + dashes;\r\n }\r\n }\r\n\r\n if(vm.includeChartNotes) {\r\n PatientChartService.getChartGroupsByRange(patientId, vm.startDate, vm.endDate).then(function (chartGroups) {\r\n vm.formattedText += lineFeed;\r\n vm.formattedText += parseChartNotes(chartGroups);\r\n });\r\n }\r\n\r\n vm.dataLoaded = true;\r\n });\r\n //vm.formattedText = testData;\r\n });\r\n };\r\n\r\n function parseChartNotes(chartGroups) {\r\n var retVal = \"\";\r\n if(chartGroups && chartGroups.length > 0) {\r\n chartGroups = chartGroups.reverse();\r\n }\r\n for(var g in chartGroups) {\r\n retVal += $filter(\"datetime\")(new moment(chartGroups[g].CreatedDtUTC), \"datetime\") + lineFeed;\r\n retVal += chartGroups[g].CreatedBy.DisplayName + lineFeed;\r\n\r\n for(var i in chartGroups[g].InterventionPatientChartEntries) {\r\n retVal += chartGroups[g].InterventionPatientChartEntries[i].Text + \" \";\r\n }\r\n for(var i in chartGroups[g].TextPatientChartEntries) {\r\n retVal += chartGroups[g].TextPatientChartEntries[i].Text + \" \";\r\n }\r\n if(chartGroups[g].InterventionPatientChartEntries.length > 0 || chartGroups[g].TextPatientChartEntries.length > 0) {\r\n retVal += lineFeed;\r\n }\r\n for(var i in chartGroups[g].AlertPatientChartEntries) {\r\n retVal += chartGroups[g].AlertPatientChartEntries[i].Text + lineFeed;\r\n }\r\n for (var i in chartGroups[g].MessagePatientChartEntries) {\r\n retVal += chartGroups[g].MessagePatientChartEntries[i].Text + lineFeed;\r\n }\r\n retVal += lineFeed;\r\n }\r\n return retVal;\r\n }\r\n\r\n Number.prototype.countDecimals = function () {\r\n var retVal = 0;\r\n if(Math.floor(this.valueOf()) !== this.valueOf()) {\r\n var parts = this.toString().split(\".\");\r\n if(parts.length > 1) {\r\n retVal = this.toString().split(\".\")[1].length || 0;\r\n } else {\r\n retVal = 0;\r\n }\r\n } \r\n return retVal;\r\n }\r\n\r\n function average(values) {\r\n var total = 0;\r\n var decimalPlaces = 0;\r\n for(var i = 0; i < values.length; i++) {\r\n var val = values[i];\r\n if(!isNaN(val) && val) {\r\n val = parseFloat(values[i], 10);\r\n var dec = val.countDecimals();\r\n decimalPlaces = dec > decimalPlaces ? dec : decimalPlaces;\r\n total += val;\r\n }\r\n }\r\n var ave = total / values.length;\r\n var retVal = +(Math.round(ave + \"e+\" + decimalPlaces) + \"e-\" + decimalPlaces); \r\n\r\n return retVal == NaN ? \"\" : retVal;\r\n }\r\n\r\n function populateSummaryObj(summaryObj, values) {\r\n if (values.length == 0) {\r\n var empty = padValue(\"\", summaryObj.title.length);\r\n summaryObj.low = empty;\r\n summaryObj.high = empty;\r\n summaryObj.ave = empty;\r\n } else {\r\n summaryObj.low = padValue(values[0], summaryObj.title.length);\r\n summaryObj.high = padValue(values[values.length -1], summaryObj.title.length);\r\n summaryObj.ave = padValue(average(values) + \"\", summaryObj.title.length);\r\n }\r\n }\r\n\r\n function populateSummary(responses, parameterTypes) {\r\n var summaryValues = [];\r\n var summaryIndex = 0;\r\n if(parameterTypes.indexOf(SurveyParameterType.Weight) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"Weight \" }; \r\n var values = lodash(weightValues).sortBy(function(i) { return parseFloat(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.Systolic) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"Sys \" }; \r\n var values = lodash(bpValues).sortBy(function(i) { return parseInt(i.OriginalValue, 10); }).map('OriginalValue').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n\r\n var diaValues = getBiometricsByParameterType(responses, SurveyParameterType.Diastolic);\r\n summaryValues[summaryIndex] = { title: \"Dias \" }; \r\n var values = lodash(diaValues).sortBy(function(i) { return parseInt(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.Pulse) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"HR \" }; \r\n var values = lodash(pulseValues).sortBy(function(i) { return parseInt(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.BloodSugar) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"Glu \" }; \r\n var values = lodash(bsValues).sortBy(function(i) { return parseFloat(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.Oxygen) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"Sp02 \" }; \r\n var values = lodash(oxyValues).sortBy(function(i) { return parseInt(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.FEVOne) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"FEV1 \" }; \r\n var values = lodash(fevOneValues).sortBy(function(i) { return parseFloat(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.PEF) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"PEF \" }; \r\n var values = lodash(pefValues).sortBy(function(i) { return parseInt(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.FEVRatio) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"FEV1/FEV6 \" }; \r\n var values = lodash(fevRatioValues).sortBy(function(i) { return parseFloat(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.TempCelsius) >= 0 || parameterTypes.indexOf(SurveyParameterType.TempFahrenheit) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"Temp \" }; \r\n var tempValues = tempFValues.concat(tempCValues);\r\n var values = lodash(tempValues).sortBy(function(i) { return parseFloat(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n if(parameterTypes.indexOf(SurveyParameterType.Steps) >= 0) { \r\n summaryValues[summaryIndex] = { title: \"Steps \" }; \r\n var values = lodash(stepsValues).sortBy(function(i) { return parseInt(i.Value, 10); }).map('Value').value(); \r\n populateSummaryObj(summaryValues[summaryIndex], values);\r\n summaryIndex++; \r\n }\r\n return summaryValues;\r\n }\r\n\r\n function writeBiometricSet(responses, biometricDates, responseTypes) {\r\n vm.formattedText += lineFeed + dashes;\r\n vm.formattedText += formatBiometricValues(responses, biometricDates, responseTypes);\r\n vm.formattedText += lineFeed;\r\n }\r\n\r\n function startNewHeader() {\r\n vm.formattedText += dashes;\r\n vm.formattedText += \"Date \";\r\n }\r\n\r\n // used to ensure consistant spacing on exported text\r\n function padValue(reading, totalLengthExpected) {\r\n if (!reading) { reading = \" \"; }\r\n while(reading.length < totalLengthExpected) {\r\n reading += \" \";\r\n }\r\n return reading;\r\n }\r\n\r\n function formatBiometricValues(biometrics, dates, responseTypes) {\r\n var retVal = \"\";\r\n var dailyReadingIndex = 0; // in case more than 1 reading in a day\r\n var readingsAvailable = 1; \r\n var bio = {};\r\n for(var i in dates) {\r\n dailyReadingIndex = 0;\r\n readingsAvailable = 1;\r\n while(dailyReadingIndex < readingsAvailable) {\r\n retVal += dates[i] + \" \";\r\n if (responseTypes.hasWeight) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.Weight, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_WEIGHT.length);\r\n } else { retVal += padValue(\"\", HEADING_WEIGHT.length); }\r\n }\r\n if (responseTypes.hasBP) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.Systolic, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_BP.length);\r\n } else { retVal += padValue(\"\", HEADING_BP.length); }\r\n }\r\n if (responseTypes.hasPulse) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.Pulse, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_PULSE.length);\r\n } else { retVal += padValue(\"\", HEADING_PULSE.length); }\r\n }\r\n if (responseTypes.hasBS) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.BloodSugar, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_BS.length);\r\n } else { retVal += padValue(\"\", HEADING_BS.length); }\r\n }\r\n if (responseTypes.hasOxygen) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.Oxygen, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_OXY.length);\r\n } else { retVal += padValue(\"\", HEADING_OXY.length); }\r\n }\r\n if (responseTypes.hasFEV1) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.FEVOne, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_FEV1.length);\r\n } else { retVal += padValue(\"\", HEADING_FEV1.length); }\r\n }\r\n if (responseTypes.hasPEF) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.PEF, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_PEF.length);\r\n } else { retVal += padValue(\"\", HEADING_PEF.length); }\r\n }\r\n if (responseTypes.hasFEVRatio) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.FEVRatio, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_FEVRatio.length);\r\n } else { retVal += padValue(\"\", HEADING_FEVRatio.length); }\r\n }\r\n if (responseTypes.hasTemp) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.TempFahrenheit, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_TEMP.length);\r\n } else { retVal += padValue(\"\", HEADING_TEMP.length); }\r\n }\r\n if (responseTypes.hasSTEPS) {\r\n bio = getBiometricByDate(biometrics, dates[i], SurveyParameterType.Steps, dailyReadingIndex);\r\n if (bio.readingsAvailable > 0) {\r\n readingsAvailable = bio.readingsAvailable > readingsAvailable ? bio.readingsAvailable : readingsAvailable;\r\n retVal += padValue(bio.reading.Time + \" \" + bio.reading.Value, HEADING_STEPS.length);\r\n } else { retVal += padValue(\"\", HEADING_STEPS.length); }\r\n }\r\n retVal += lineFeed;\r\n dailyReadingIndex++\r\n }\r\n }\r\n return retVal;\r\n }\r\n\r\n // indexOfDailyReading is used if there are more than 1 reading for the biometric in a single day\r\n function getBiometricByDate(responseValues, date, surveyParameterTypeId, dailyReadingIndex) {\r\n var biometric = lodash(responseValues).filter({ Date: date, SurveyParameterTypeId: surveyParameterTypeId }).value();\r\n if (biometric.length > dailyReadingIndex && biometric[dailyReadingIndex].Value != null) {\r\n return { readingsAvailable: biometric.length, reading: biometric[dailyReadingIndex] };\r\n } else {\r\n return { readingsAvailable: 0 };\r\n }\r\n }\r\n\r\n function getBiometricsByParameterType(responseValues, surveyParameterTypeId) {\r\n return lodash(responseValues).filter({ SurveyParameterTypeId: surveyParameterTypeId }).value();\r\n }\r\n\r\n function parseBiometrics(data, parameterTypes) {\r\n var retVal = [];\r\n for(var biometric in data) {\r\n for(var response in data[biometric].Responses) {\r\n for(var valIndex in data[biometric].Responses[response].Values) {\r\n var responseValue = data[biometric].Responses[response].Values[valIndex];\r\n \r\n if (parameterTypes.indexOf(responseValue.SurveyParameterTypeId) > -1) {\r\n responseValue.PatientResponseId = data[biometric].Responses[response].PatientResponseId;\r\n retVal.push(responseValue);\r\n } \r\n }\r\n }\r\n }\r\n retVal = consolidateBloodPressureValues(retVal);\r\n\r\n // parse ObservationDateTime_UTC into Date and Time fields\r\n for(var i in retVal) {\r\n var m = new moment(retVal[i].ObservationDateTime_UTC);\r\n var date = new Date(retVal[i].ObservationDateTime_UTC);\r\n retVal[i].ObservationDateTime_UTC = date; // set this as actual date object and not string for sorting\r\n retVal[i].Date = $filter(\"datetime\")(m);\r\n retVal[i].Time = m.format(\"HH:mm\"); //TODO: this UTC date shows in local caregiver time. Force display of patient time?\r\n }\r\n\r\n // sort by ObservationDateTime_UTC desc\r\n retVal = lodash.sortBy(retVal, 'ObservationDateTime_UTC').reverse();\r\n return retVal;\r\n }\r\n\r\n function consolidateBloodPressureValues(responseValues) {\r\n for(var i in responseValues) {\r\n if(responseValues[i].SurveyParameterTypeId == SurveyParameterType.Diastolic) {\r\n // find systolic value for this response\r\n var systolic = lodash(responseValues).filter({ SurveyParameterTypeId: SurveyParameterType.Systolic, PatientResponseId: responseValues[i].PatientResponseId }).value();\r\n if(systolic.length == 1) {\r\n systolic[0].OriginalValue = systolic[0].Value;\r\n systolic[0].Value += \"/\" + responseValues[i].Value;\r\n }\r\n }\r\n }\r\n return responseValues;\r\n }\r\n\r\n function getSelectedParameterTypes() {\r\n var ids = [];\r\n for(var bio in vm.selectedBiometricParameterTypes) {\r\n for(var type in vm.selectedBiometricParameterTypes[bio].parameterTypes) {\r\n ids.push(vm.selectedBiometricParameterTypes[bio].parameterTypes[type]);\r\n }\r\n }\r\n return ids;\r\n }\r\n\r\n function initialize() {\r\n ReportsService.getPHIWarningText().then(function(data){\r\n vm.phiWarningText = data.Value;\r\n }); \r\n }\r\n \r\n initialize();\r\n vm.updateDates();\r\n vm.getBiometrics();\r\n\r\n var dashes = '=========================================================================\\n';\r\n var lineFeed = '\\n';\r\n var testData = \"\\n\" +\r\n\"===============================================================================================\\n\" +\r\n\"Summary\t\tWeight\tSys\tBP Dias BP Heart Rate Glucose Sp02 FEV1 PEF Temp\\n\" +\r\n\"===============================================================================================\\n\" +\r\n\"\\n\" +\r\n\"===============================================================================================\\n\" +\r\n\"Date\t\tTime\tWt\t\tTime\tSys Dias\tTime\tHR\t\tTime\tGlu\t\tTime\tSp02\\n\" +\r\n\"===============================================================================================\\n\" +\r\n\"05/11/2017\t09:34\t206.1\t09:33\t133/52\t\t09:33\t63\\n\" +\r\n\"05/11/2017\t09:34\t206.1\t09:33\t133/52\t\t09:33\t63\\n\" +\r\n\"05/11/2017\t09:34\t206.1\t09:33\t133/52\t\t09:33\t63\\n\" +\r\n\"05/11/2017\t09:34\t206.1\t09:33\t133/52\t\t09:33\t63\\n\" +\r\n\"05/11/2017\t09:34\t206.1\t09:33\t133/52\t\t09:33\t63\\n\" +\r\n\"05/11/2017\t09:34\t206.1\t09:33\t133/52\t\t09:33\t63\\n\" +\r\n\"05/11/2017\t09:34\t206.1\t09:33\t133/52\t\t09:33\t63\\n\" +\r\n\"\\n\";\r\n\r\n// actual size from docs:\r\n//=========================================================================\r\n//Summary Weight Sys BP Dias BP Heart Rate Glucose SP02 FEV1 PEF Temp\r\n\r\n}\r\n\r\n\r\nangular.module(\"patient.header\").controller(\"CopyBiometricsModalController\", CopyBiometricsModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/copybiometrics.modal.html',\n '

          Transfer Patient Data

          {{$item.name}} {{item.name}}
          Include Chart Notes

          ');\n}]);\n}(window, document, window.angular));","function GeneralAlertModalController(patientAlertType, patientId, liPatient, $uibModalInstance, $rootScope, PatientHeaderService, AlertType, moment) {\r\n var vm = this;\r\n vm.patientAlertType = patientAlertType;\r\n vm.icon = patientAlertType == AlertType.Notification ? 'fa fa-bell' : 'fa fa-exclamation-circle';\r\n vm.title = patientAlertType == AlertType.Notification ? 'Add Notification' : 'Add General Alert';\r\n vm.alertMessage = '';\r\n vm.alertDelay = '0';\r\n vm.alertDate = new Date();\r\n var roundedUp = Math.ceil(moment().add(1,'m').minute() / 15) * 15;\r\n vm.alertTime = moment().minute(roundedUp);\r\n vm.dateOptions = { minDate: vm.alertDate };\r\n vm.liPatient = liPatient;\r\n vm.isValid = true;\r\n\r\n vm.saveAlert = function() {\r\n var alertDateTime = buildAlertDateTime();\r\n var now = moment().subtract(1, 'seconds');\r\n if (!alertDateTime.isValid() || !alertDateTime.isAfter(now)) {\r\n vm.isValid = false;\r\n return;\r\n }\r\n\r\n var alert = {\r\n AlertTypeId: patientAlertType,\r\n Message: vm.alertMessage,\r\n AlertDateTime_UTC: moment.utc(alertDateTime).format()\r\n };\r\n\r\n PatientHeaderService.saveGeneralAlert(patientId, alert).then(function() {\r\n $rootScope.$emit(\"vh:patientUpdated\", patientId);\r\n $rootScope.$emit(\"vh:patientAlertAdded\", patientId);\r\n });\r\n\r\n $uibModalInstance.close();\r\n }\r\n\r\n vm.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n vm.textRemainingClass = function() {\r\n return vm.alertMessage && vm.alertMessage.length >= 250 ? 'provisionFailedText' : 'provisionSuccessfulText';\r\n };\r\n\r\n function buildAlertDateTime() {\r\n if (vm.alertDelay === 'Custom') {\r\n var date = moment(vm.alertDate);\r\n var time = moment(vm.alertTime);\r\n return moment([date.year(), date.month(), date.date(), time.hour(), time.minute()]);\r\n }\r\n\r\n // delay n hours from now\r\n var delay = parseInt(vm.alertDelay);\r\n return moment().add(delay, 'minutes');\r\n }\r\n}\r\n\r\n\r\nangular.module(\"patient.header\").controller(\"GeneralAlertModalController\", GeneralAlertModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/generalalert.modal.html',\n '

          {{vm.title}}

          {{300 - vm.alertMessage.length}} of 300 characters remaining
          Enter a valid date/time
          ');\n}]);\n}(window, document, window.angular));","function HealthScoresDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n template: \r\n ['
          ',\r\n '
          {{::lastScore.score}}--
          ',\r\n '
          '].join(''),\r\n scope: {\r\n recentScores: \"=\",\r\n lastScore: \"=\"\r\n },\r\n link: function (scope, elem, attrs) {\r\n scope.lastScoreClass = scope.lastScore.status + \" \" + (scope.lastScore.isToday ? \"\" : \"dim\");\r\n var historyElem = angular.element('
          ');\r\n elem.prepend(historyElem);\r\n if (scope.recentScores && scope.recentScores.length > 0) {\r\n lodash(scope.recentScores)\r\n .sortBy(\"scoreDate\")\r\n .forEach(function (dayscore) {\r\n var scoreValue = Math.max(dayscore.score, 20);\r\n historyElem.append('
          ');\r\n }).value();\r\n historyElem.append('
          ');\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"healthScores\", HealthScoresDirective);\r\n","function MessageStatusDirective() {\r\n return {\r\n restrict: \"E\",\r\n template: '',\r\n scope: {\r\n patientData: \"=\"\r\n },\r\n controller: function($scope, $state, ConfigurationsService, PermissionService, MessageService, ServiceLevelType) {\r\n\r\n var patientOptedIn = $scope.patientData.isOptedIn;\r\n \r\n $scope.openMessenger = function($event) {\r\n $event.stopPropagation();\r\n if ($scope.canSendMessages) {\r\n $state.go('patients.patient.monitoring', { patientId: $scope.patientData.id });\r\n MessageService.openMessenger({ patientData: $scope.patientData });\r\n }\r\n }\r\n\r\n $scope.tooltip = function() {\r\n var tip = $scope.patientData.unreadMessageCount > 0 ? $scope.patientData.unreadMessageCount + ' unread messages' : '';\r\n\r\n if(!patientOptedIn){\r\n tip = 'Patient has not opted in. This feature will be available once the patient has opted in.';\r\n }\r\n \r\n return tip;\r\n } \r\n\r\n $scope.canSendMessages = PermissionService.userHasPermission([\"PatientMessageWrite\"]) && patientOptedIn;\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n $scope.messagingEnabled = data[\"PatientMessagingEnabled\"] && $scope.patientData.enableMessaging && $scope.patientData.serviceLevelTypeId === ServiceLevelType.Go;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"messageStatus\", MessageStatusDirective);\r\n","function MonitoringStatusChangeDirective() {\r\n\r\n function controller($scope, lodash, PermissionService) {\r\n var wizard = $scope.wizard;\r\n\r\n $scope.statusChangedDate = new Date();\r\n $scope.statusChangedDate.setHours(0, 0, 0, 0);\r\n $scope.showReason = false;\r\n $scope.showSubReason = false;\r\n $scope.showReasonNotes = false;\r\n\r\n $scope.backDatePermission = PermissionService.userHasPermission([\"PatientBackdateStatus\"]);\r\n\r\n $scope.dateSelected = function () {\r\n var changed = new Date($scope.statusChangedDate);\r\n var today = new Date();\r\n if (changed.setHours(0, 0, 0, 0) !== today.setHours(0, 0, 0, 0)) {\r\n wizard.statusChangedDate = changed;\r\n }\r\n\r\n validateDate();\r\n };\r\n\r\n $scope.assignStatus = function () {\r\n var defaultReason = lodash.find(wizard.monitoringStatus.StatusChangeReasons, {'IsDefault': true});\r\n wizard.statusChangeReason = defaultReason;\r\n $scope.showReason = wizard.monitoringStatus.Id !== wizard.originalMonitoringStatusId && wizard.monitoringStatus.StatusChangeReasons && wizard.monitoringStatus.StatusChangeReasons.length > 0;\r\n $scope.showSubReason = $scope.showReason && wizard.statusChangeReason && wizard.statusChangeReason.StatusChangeSubReasons && wizard.statusChangeReason.StatusChangeSubReasons.length > 0;\r\n $scope.showReasonNotes = wizard.statusChangeReason && wizard.statusChangeReason.EnableNotes && !$scope.showSubReason;\r\n \r\n wizard.assignStatus();\r\n };\r\n\r\n $scope.assignChangeReason = function () {\r\n $scope.showSubReason = $scope.showReason && wizard.statusChangeReason && wizard.statusChangeReason.StatusChangeSubReasons && wizard.statusChangeReason.StatusChangeSubReasons.length > 0;\r\n $scope.showReasonNotes = wizard.statusChangeReason && wizard.statusChangeReason.EnableNotes && !$scope.showSubReason;\r\n wizard.assignStatus();\r\n };\r\n\r\n var disabledDate = (o) =>{\r\n var today = new Date().setHours(0, 0, 0, 0);\r\n var dayOf = o.date.setHours(0, 0, 0, 0);\r\n\r\n var statusDate = false;\r\n if (wizard.monitoringStatus && wizard.monitoringStatus.CreatedDtUTC) {\r\n statusDate = new Date(wizard.monitoringStatus.CreatedDtUTC);\r\n statusDate.setHours(0, 0, 0, 0);\r\n }\r\n\r\n if (dayOf > today) {\r\n return true;\r\n } else {\r\n return statusDate && dayOf <= statusDate && dayOf.getTime() !== today.getTime();\r\n }\r\n };\r\n\r\n $scope.dateDisabled = disabledDate;\r\n\r\n $scope.dateOptions = {\r\n dateDisabled: disabledDate,\r\n minDate: formatMostRecentStatusChangeDtUTC()\r\n };\r\n\r\n function formatMostRecentStatusChangeDtUTC () {\r\n if (wizard.liPatient && wizard.liPatient.mostRecentStatusChangeDtUTC) {\r\n var date = new Date(wizard.liPatient.mostRecentStatusChangeDtUTC);\r\n date.setHours(0, 0, 0, 0);\r\n return date;\r\n } \r\n return;\r\n }\r\n\r\n function validateDate() {\r\n var statusChangedDate = new Date(wizard.statusChangedDate);\r\n if (!statusChangedDate || !statusChangedDate.getDate()) {\r\n wizard.validDate = false;\r\n } else {\r\n wizard.validDate = !$scope.dateDisabled({date: statusChangedDate});\r\n wizard.validBackDate = validateBackDate({date: statusChangedDate});\r\n }\r\n }\r\n\r\n function validateBackDate(o){\r\n var dateEntered = o.date.setHours(0, 0, 0, 0);\r\n var mostRecentStatusChangeDate = new Date(wizard.liPatient.mostRecentStatusChangeDtUTC);\r\n mostRecentStatusChangeDate.setHours(0, 0, 0, 0);\r\n\r\n if(dateEntered < mostRecentStatusChangeDate){\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n if (!wizard.statusChangeReason) {\r\n $scope.assignStatus();\r\n }\r\n\r\n validateDate();\r\n }\r\n }\r\n\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/header/monitoringStatus/monitoring-status-change.tpl.html\",\r\n controller: controller,\r\n replace: true,\r\n scope: {\r\n wizard: \"=\",\r\n wizardForm: \"=\"\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"monitoringStatusChange\", MonitoringStatusChangeDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/monitoringStatus/monitoring-status-change.tpl.html',\n '
          Date Is not valid
          Date entered cannot be before latest status change date
          *Reason is required

          *Additional Information is Required
          = 250}\">{{300 - wizard.reasonText.length}} of 300 characters remaining
          *Reason is required

          *Additional Information is Required
          = 250}\">{{300 - wizard.reasonText.length}} of 300 characters remaining
          ');\n}]);\n}(window, document, window.angular));","function MonitoringStatusManager($q, lodash, PatientServiceLevelService, DemographicsService, pickupService, WebFormFieldRepository) {\r\n function controller($scope) {\r\n var manager = this;\r\n\r\n var wizard = $scope.msw;\r\n\r\n wizard.loadUnassignData = function() {\r\n\r\n // If we have already loaded this data, there is no reason to do it again\r\n if(wizard.serviceLevelData.patientServiceLevel.kit){\r\n return;\r\n }\r\n\r\n wizard.serviceLevelData.serviceLevel = {\r\n ServiceLevelId: 0,\r\n DisplayText: 'Unassign Service Level',\r\n Icon: 'fa-times-circle',\r\n ServiceLevelTypeId: 0,\r\n EMAServiceLevelCode: 0,\r\n EnableVideo: false,\r\n TabletRequired: false,\r\n TaskOrderRequired: false,\r\n PhoneNumRequired: false,\r\n SortOrder: 1\r\n };\r\n\r\n wizard.enableNext = false;\r\n\r\n var promises = [];\r\n\r\n promises.push(DemographicsService.getPatient(wizard.liPatient.id));\r\n promises.push(PatientServiceLevelService.getPatientKit(wizard.liPatient.id));\r\n promises.push(PatientServiceLevelService.getServiceLevelKitInfo());\r\n promises.push(pickupService.getAll());\r\n promises.push(WebFormFieldRepository.get());\r\n\r\n $q.all(promises).then(function(responses){\r\n wizard.serviceLevelData.patient = responses[0];\r\n\r\n var kit = responses[1];\r\n if (kit && kit !== null) {\r\n var kitModel = PatientServiceLevelService.mapKit(kit);\r\n PatientServiceLevelService.getKitAttributes(kitModel.kitPoolId, kitModel.kitTypeId).then((attr) => {\r\n attr.kitCuffs = lodash.sortBy(attr.KitCuffAttributes, 'SortOrder');\r\n attr.kitScales = lodash.sortBy(attr.KitScaleAttributes, 'SortOrder');\r\n const kitScale = lodash.find(attr.kitScales, {'AttributeId': kit.kitScaleAttributeId});\r\n const kitCuff = lodash.find(attr.kitCuffs, {'AttributeId': kit.kitCuffAttributeId});\r\n if (kitScale)\r\n {\r\n kitModel.kitScale = kitScale.Value;\r\n }\r\n if (kitCuff)\r\n {\r\n kitModel.kitCuff = kitCuff.Value;\r\n }\r\n \r\n wizard.serviceLevelData.patientServiceLevel.kit = kitModel;\r\n });\r\n }\r\n\r\n wizard.kitInfo = {\r\n info: responses[2]\r\n };\r\n\r\n manager.kitInfo = wizard.kitInfo;\r\n manager.info = wizard.kitInfo.info;\r\n manager.info.kitPools = lodash.sortBy(manager.info.KitPools, 'SortOrder');\r\n\r\n manager.kitInfo.kitCuffs = lodash.sortBy(manager.info.KitCuffAttributes, 'SortOrder');\r\n manager.kitInfo.kitScales = lodash.sortBy(manager.info.KitScaleAttributes, 'SortOrder');\r\n\r\n wizard.kitPickupOptions = responses[3];\r\n wizard.webFormFields = responses[4];\r\n defineWebformFields(wizard.webFormFields);\r\n\r\n wizard.enableNext = true;\r\n });\r\n };\r\n\r\n manager.initStep = function(isSkip, isSelected, manualFunc, setFunc) {\r\n init();\r\n\r\n if(isSkip) {\r\n setFunc(true);\r\n wizard.skip();\r\n } else if(!isSelected) {\r\n setFunc(false);\r\n } else if(isSelected) {\r\n wizard.enableNext = true;\r\n }\r\n };\r\n\r\n manager.skip = wizard.skip;\r\n\r\n manager.setKitPool = function(kitPool) {\r\n init();\r\n manager.kitInfo.selectedKitPool = kitPool;\r\n clearManual();\r\n wizard.enableNext = true;\r\n };\r\n\r\n manager.setKit = function(kit) {\r\n manager.kitInfo.selectedKit = kit;\r\n wizard.enableNext = true;\r\n };\r\n\r\n manager.setUnassignOption = function(option) {\r\n wizard.enableNext = false;\r\n if (option) {\r\n wizard.serviceLevelData.selectedKitPickupOption = option;\r\n wizard.enableNext = true;\r\n }\r\n };\r\n\r\n manager.getDeviceName = function(device) {\r\n var deviceName = device.name;\r\n if (device.id === 1 || device.id === 2) {\r\n var attribute = device.id === 1\r\n ? lodash.find(manager.kitInfo.kitScales, {'AttributeId': manager.kitInfo.selectedKit.KitScaleAttributeId})\r\n : lodash.find(manager.kitInfo.kitCuffs, {'AttributeId': manager.kitInfo.selectedKit.KitCuffAttributeId});\r\n if (attribute && attribute.Value.toLowerCase() !== 'none') {\r\n deviceName += ' (' + attribute.Value + ')';\r\n }\r\n }\r\n\r\n return deviceName;\r\n };\r\n\r\n manager.kitDevices = wizard.kitDevices;\r\n\r\n manager.getDevices = function (kit) {\r\n if (!kit || kit.Devices.length === 0) {\r\n return [];\r\n }\r\n\r\n var deviceList = lodash.map(kit.Devices, function (device) {\r\n return lodash.find(manager.kitDevices, {'DeviceTypeId': device.DeviceTypeId});\r\n });\r\n\r\n return lodash.sortBy(deviceList, 'id');\r\n };\r\n\r\n manager.getDeviceList = function (kit) {\r\n var deviceList = manager.getDevices(kit);\r\n\r\n if (deviceList.length === 0) {\r\n return 'Tablet Only';\r\n }\r\n\r\n var devices = lodash.map(deviceList, function (device) {\r\n var deviceName = device.name;\r\n if (device.id === 1 || device.id === 2) {\r\n var attribute = device.id === 1\r\n ? lodash.find(manager.kitInfo.kitScales, {'AttributeId': kit.KitScaleAttributeId})\r\n : lodash.find(manager.kitInfo.kitCuffs, {'AttributeId': kit.KitCuffAttributeId});\r\n if (attribute && attribute.Value.toLowerCase() !== 'none') {\r\n deviceName += ' (' + attribute.Value + ')';\r\n }\r\n }\r\n return deviceName;\r\n });\r\n\r\n return devices.join(', ');\r\n };\r\n\r\n function init() {\r\n manager.kitNumber = '';\r\n manager.enterKitNo = false;\r\n manager.kitNoFocused = false;\r\n wizard.enableNext = false;\r\n }\r\n\r\n function clearManual() {\r\n manager.kitInfo.selectedKit = undefined;\r\n manager.kitInfo.manualKit = undefined;\r\n }\r\n\r\n function defineWebformFields(fields) {\r\n if (fields) {\r\n for (var i = 0; i < fields.length; i++) {\r\n fields[fields[i].FieldName] = fields[i];\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {\r\n restrict: \"A\",\r\n controller: controller,\r\n controllerAs: \"manager\"\r\n };\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"monitoringStatusManager\", MonitoringStatusManager);\r\n","function MonitoringStatusWizardController($rootScope, $scope, $uibModalInstance, lodash, liPatient, patientServiceLevel, patientStatus, configurations, monitoringStatuses, PatientHeaderService, KitStatus, DemographicsService, ServiceLevelWizardService, PatientServiceLevelService) {\r\n var msw = this;\r\n\r\n var step = 0;\r\n var previousStep;\r\n\r\n msw.showBack = false;\r\n msw.showNext = true;\r\n msw.enableNext = true;\r\n msw.enableBack = true;\r\n msw.enableCancel = true;\r\n msw.showOk = false;\r\n msw.enableStatusPicker = true;\r\n\r\n msw.liPatient = liPatient;\r\n msw.originalStatusId = angular.copy(patientStatus.Id);\r\n msw.originalMonitoringStatusId = angular.copy(patientStatus.Statusid);\r\n msw.monitoringStatuses = lodash.filter(monitoringStatuses, function (status) {\r\n var valid = status.Id !== 9 || (status.Id === msw.originalMonitoringStatusId);\r\n if (!liPatient.mostRecentRecord) {\r\n valid = valid && (status.IsFinalState || status.Id === msw.originalMonitoringStatusId);\r\n }\r\n if(liPatient.monitoringStatusId == 7){\r\n return status.IsFinalState == true;\r\n }\r\n return valid;\r\n });\r\n msw.monitoringStatus = lodash.find(msw.monitoringStatuses, {'Id': patientStatus.Statusid});\r\n if (liPatient.monitoringStatusId == 7 ) //User has deleted status, disable status change.\r\n {\r\n msw.enableNext = false;\r\n msw.enableStatusPicker = false;\r\n }\r\n\r\n msw.statusChangedDate = new Date().setHours(0, 0, 0, 0);\r\n msw.reasonText = '';\r\n\r\n msw.kitDevices = PatientServiceLevelService.kitDevices;\r\n\r\n msw.configurations = configurations;\r\n\r\n var monitoringStatusChange = [{name: 'monitoring-status-change', title: 'Monitoring Status Change', requireValidation: true, heightStyle: {'min-height': '230px'}}];\r\n var kitPickup = [\r\n {name: 'servicelevel-rpm-unassign', title: 'Choose Unassign Option', requireValidation: false, heightStyle: {'min-height': '400px'}},\r\n {name: 'servicelevel-rpm-kitpickup', title: 'Update Pickup', requireValidation: true, heightStyle: {'min-height': '400px'}},\r\n {name: 'servicelevel-confirmation', title: 'Confirm', requireValidation: false, heightStyle: {'min-height': '400px'}}\r\n ];\r\n\r\n var workflow = monitoringStatusChange;\r\n\r\n msw.assignStatus = function () {\r\n if (msw.monitoringStatus.IsFinalState && patientServiceLevel && \r\n (patientServiceLevel.ServiceLevel.ServiceLevelTypeId === 2 || patientServiceLevel.ServiceLevel.ServiceLevelTypeId === 3)) {\r\n workflow = monitoringStatusChange.concat(kitPickup);\r\n\r\n msw.loadUnassignData();\r\n } else {\r\n workflow = monitoringStatusChange;\r\n }\r\n\r\n updateWorkflow();\r\n };\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n msw.serviceLevelData = {\r\n patientServiceLevel: mapPatientServiceLevel(patientServiceLevel)\r\n };\r\n\r\n msw.originalServiceLevel = angular.copy(msw.serviceLevelData.patientServiceLevel);\r\n\r\n msw.currentStep = workflow[step];\r\n msw.showBack = step !== 0;\r\n msw.showNext = step !== workflow.length - 1;\r\n msw.showOk = !msw.showNext;\r\n }\r\n\r\n msw.back = function () {\r\n previousStep = step;\r\n step--;\r\n\r\n updateWorkflow();\r\n };\r\n\r\n msw.next = function () {\r\n if (workflow[step].requireValidation) {\r\n $scope.monitoringStatusForm.$setSubmitted();\r\n if (!$scope.monitoringStatusForm.$valid) {\r\n return;\r\n }\r\n }\r\n\r\n previousStep = step;\r\n step++;\r\n\r\n updateWorkflow();\r\n };\r\n\r\n msw.skip = function () {\r\n if (previousStep < step) {\r\n msw.next();\r\n } else {\r\n msw.back();\r\n }\r\n };\r\n\r\n msw.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n msw.ok = function () {\r\n $scope.monitoringStatusForm.$setSubmitted();\r\n if (!$scope.monitoringStatusForm.$valid) {\r\n return;\r\n }\r\n\r\n if (msw.validDate === true && msw.validBackDate) {\r\n save().then(function () {\r\n if (msw.monitoringStatus.IsFinalState) {\r\n $rootScope.$emit(\"vh:serviceLevelUnassigned\");\r\n }\r\n\r\n $uibModalInstance.close(msw.monitoringStatus.Id);\r\n });\r\n }\r\n };\r\n\r\n msw.getWarning = function () {\r\n var status =\r\n msw.serviceLevelData.patientServiceLevel &&\r\n msw.serviceLevelData.patientServiceLevel.kit &&\r\n msw.serviceLevelData.patientServiceLevel.kit.status;\r\n\r\n if (status !== undefined) {\r\n\r\n var kitpoolId =\r\n msw.kitInfo.selectedKitPool &&\r\n msw.kitInfo.selectedKitPool.KitPoolId;\r\n\r\n if (kitpoolId !== undefined) {\r\n var selectedKitPool = lodash.find($scope.manager.info.KitPools, {'KitPoolId': kitpoolId});\r\n\r\n if (selectedKitPool && selectedKitPool.DoesPickupFromPatient) {\r\n switch (status) {\r\n case KitStatus.Shipped:\r\n return configurations.KitInShippedWarning;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n msw.isKitServicelevel = function(serviceLevel) {\r\n if(serviceLevel === undefined) return false;\r\n\r\n return serviceLevel.ServiceLevelTypeId === ServiceLevelType.RPM || serviceLevel.serviceLevelTypeId === ServiceLevelType.RPM ||\r\n serviceLevel.ServiceLevelTypeId === ServiceLevelType.RPMVideo || serviceLevel.serviceLevelTypeId === ServiceLevelType.RPMVideo;\r\n }\r\n\r\n function updateWorkflow() {\r\n msw.currentStep = workflow[step];\r\n $scope.monitoringStatusForm.$setPristine();\r\n msw.showBack = step !== 0;\r\n msw.showNext = step !== workflow.length - 1;\r\n msw.showOk = !msw.showNext;\r\n }\r\n \r\n function save() {\r\n msw.enableNext = false;\r\n msw.enableBack = false;\r\n msw.enableCancel = false;\r\n\r\n var includeStatusReason = msw.monitoringStatus.StatusChangeReasons && msw.monitoringStatus.StatusChangeReasons.length > 0;\r\n var includeStatusSubReason = includeStatusReason && msw.statusChangeReason.StatusChangeSubReasons && msw.statusChangeReason.StatusChangeSubReasons.length > 0;\r\n var includeReasonText = includeStatusReason && ((!includeStatusSubReason && msw.statusChangeReason.EnableNotes) || (includeStatusSubReason && msw.statusChangeSubReason.EnableNotes));\r\n\r\n var status = {\r\n PatientId: liPatient.id,\r\n Statusid: msw.monitoringStatus.Id,\r\n OriginalMonitoringStatusId: msw.originalStatusId,\r\n MostRecentRecord: liPatient.mostRecentRecord,\r\n StatusChangeReasonId: includeStatusReason ? msw.statusChangeReason.StatusChangeReasonId : null,\r\n StatusChangeSubReasonId: includeStatusSubReason ? msw.statusChangeSubReason.StatusChangeSubReasonId : null,\r\n ReasonText: includeReasonText ? msw.reasonText : null,\r\n CreatedDtUTC: new Date(msw.statusChangedDate),\r\n StatusName: msw.monitoringStatus.Status\r\n };\r\n\r\n return PatientHeaderService.saveMonitoringStatus(liPatient.id, status).then(async function () {\r\n if (msw.monitoringStatus.IsFinalState && patientServiceLevel && \r\n (patientServiceLevel.ServiceLevel.ServiceLevelTypeId === 2 || patientServiceLevel.ServiceLevel.ServiceLevelTypeId === 3)) {\r\n createProfileHistoryEntry();\r\n\r\n if (msw.serviceLevelData.selectedKitPickupOption && msw.serviceLevelData.selectedKitPickupOption.IsCancel) {\r\n if (msw.serviceLevelData.patientServiceLevel.kit && msw.serviceLevelData.patientServiceLevel.kit.kitNo) {\r\n return DemographicsService.cancelShipping(msw.serviceLevelData.patientServiceLevel.kit.kitNo);\r\n }\r\n else {\r\n //Cancel the kit ship order for the patient using patient id\r\n return DemographicsService.cancelShippingForRequestByKitType(msw.serviceLevelData.patient.Id);\r\n }\r\n } else if (msw.serviceLevelData.logisticsInfo.kit !== undefined) {\r\n if (msw.serviceLevelData.logisticsInfo.kit.kitPoolId != null) {\r\n let kitPool = await ServiceLevelWizardService.getKitPool(msw.serviceLevelData.logisticsInfo.kit.kitPoolId);\r\n if (msw.serviceLevelData.kitShippingIncluded || \r\n (kitPool != null && kitPool.Reprocessing && configurations.CreatePickupOrderForCustomerPickup)) {\r\n return DemographicsService.saveKitShippingInfo(msw.serviceLevelData.logisticsInfo);\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n function createProfileHistoryEntry() {\r\n var str = msw.serviceLevelData.selectedKitPickupOption.Name;\r\n str += ' : ';\r\n str += msw.serviceLevelData.selectedKitPickupOption.Description;\r\n ServiceLevelWizardService.logToPatientProfileHistory(msw.serviceLevelData.patient.Id, str);\r\n }\r\n\r\n function mapPatientServiceLevel(patientServiceLevel) {\r\n if (!patientServiceLevel) {\r\n return patientServiceLevel;\r\n }\r\n\r\n return {\r\n id: patientServiceLevel.PatientServiceLevelId,\r\n patientId: patientServiceLevel.PatientId,\r\n serviceLevelId: patientServiceLevel.ServiceLevelId,\r\n serviceLevelTypeId: getServiceLevelType(patientServiceLevel),\r\n kitId: patientServiceLevel.KitId,\r\n kitNo: patientServiceLevel.KitNo,\r\n phone: patientServiceLevel.PhoneNum,\r\n pin: patientServiceLevel.PIN,\r\n welcomeDate: '',\r\n welcomeTime: '',\r\n name: patientServiceLevel.DisplayText,\r\n serviceLevelType: patientServiceLevel.ServiceLevelType_Enum,\r\n taskOrders: lodash.map(patientServiceLevel.TaskOrders, function (taskOrder) {\r\n return mapTaskOrder(taskOrder);\r\n })\r\n };\r\n\r\n function mapTaskOrder(taskOrder) {\r\n return {\r\n id: taskOrder.TaskOrderId,\r\n number: taskOrder.TaskOrderNumber,\r\n deleted: taskOrder.DeletedDateTime_UTC !== null,\r\n modified: false\r\n };\r\n }\r\n }\r\n\r\n function getServiceLevelType(patientServiceLevel) {\r\n var retVal = null;\r\n if (patientServiceLevel.ServiceLevel) {\r\n retVal = patientServiceLevel.ServiceLevel.ServiceLevelTypeId;\r\n }\r\n return retVal;\r\n }\r\n}\r\n\r\nangular.module('patient.header').controller('MonitoringStatusWizardController', MonitoringStatusWizardController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/monitoringStatus/monitoring-status-wizard.modal.html',\n '

          {{msw.currentStep.title}}

          ');\n}]);\n}(window, document, window.angular));","function PatientDemographicsDirective(ConfigurationsService, PermissionService,DemographicsService) {\r\n\r\n\r\n function controller($scope) {\r\n \r\n $scope.UsePinValidation = true;\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n $scope.UsePinValidation = data.UsePinValidation === true;\r\n $scope.HybridAppEnabled = data.HybridAppEnabled === true;\r\n\r\n $scope.showPin = data.ShowPinInPatientHeader === true;\r\n });\r\n\r\n var statusName;\r\n if ($scope.patientData.kitStatusName == \"Delivered to Patient\") {\r\n statusName = \"Delivered\";\r\n } else {\r\n statusName = $scope.patientData.kitStatusName;\r\n }\r\n $scope.kitStatus = ' ' + statusName + ' (' + $scope.patientData.kitStatusDays + ' bus. days)';\r\n $scope.showKitStatusLink = false;\r\n $scope.showKitStatusText = false;\r\n\r\n if ((($scope.patientData.kitNumber || ($scope.patientData.serviceLevelTypeId == 2 || $scope.patientData.serviceLevelTypeId == 3) && $scope.patientData.kitStatusName != null) && $scope.patientData.kitStatusId != 2 && $scope.patientData.program.monitoringStatusId != 1)\r\n || ($scope.patientData.serviceLevelTypeId == 11 \r\n && $scope.patientData.kitStatusName != null \r\n && $scope.patientData.kitStatusName != \"Completed\" \r\n && $scope.patientData.kitStatusName != \"Canceled\" \r\n && $scope.patientData.kitStatusName != \"Abandoned\")) {\r\n if (PermissionService.userHasPermission('KitLogisticsRead') && (ConfigurationsService.configParams.KitLogisticsLevel === 'PickUpOnly' || ConfigurationsService.configParams.KitLogisticsLevel === 'ShipOnly' || ConfigurationsService.configParams.KitLogisticsLevel == 'Full')) {\r\n $scope.showKitStatusLink = true;\r\n } else {\r\n $scope.showKitStatusText = true;\r\n }\r\n }\r\n\r\n if($scope.patientData.goPlatformId) {\r\n switch($scope.patientData.goPlatformId) {\r\n case 1:\r\n if(!$scope.patientData.serviceLevel.endsWith(\"-Web\"))\r\n $scope.patientData.serviceLevel += \"-Web\"; \r\n break;\r\n case 2:\r\n if(!$scope.patientData.serviceLevel.endsWith(\"-App\"))\r\n $scope.patientData.serviceLevel += \"-App\";\r\n break;\r\n }\r\n }\r\n\r\n var options = {\r\n race: \"Show Race\",\r\n mrn: \"Show MRN\",\r\n last4: \"Show Last Four\"\r\n };\r\n \r\n var headerValue = ConfigurationsService.configParams.ShowRaceMRNOrLast4InHeader;\r\n\r\n switch (headerValue) {\r\n case options.race:\r\n $scope.displayfield = $scope.patientData.race;\r\n break;\r\n case options.mrn:\r\n if ($scope.patientData && $scope.patientData.mrnIdent && $scope.patientData.mrnIdent.length > 0) {\r\n $scope.displayfield = $scope.patientData.mrnIdent;\r\n } else {\r\n $scope.displayfield = \"\";\r\n }\r\n break;\r\n\r\n case options.last4:\r\n $scope.displayfield = $scope.patientData.patientIdent;\r\n if ($scope.displayfield && $scope.displayfield && $scope.displayfield.length > 3) {\r\n $scope.displayfield = $scope.displayfield.slice(Math.max($scope.displayfield.length - 4, 0))\r\n }\r\n\r\n break;\r\n }\r\n\r\n $scope.nameTooltip = \"\";\r\n if ($scope.patientData.name.lastName) {\r\n $scope.nameTooltip += $scope.patientData.name.lastName;\r\n }\r\n if($scope.patientData.name.firstName) {\r\n if ($scope.nameTooltip != \"\") {\r\n $scope.nameTooltip += \", \";\r\n }\r\n $scope.nameTooltip += $scope.patientData.name.firstName;\r\n }\r\n $scope.nameTooltip += \" | EID:\" + $scope.patientData.id;\r\n\r\n function getUtcDate(serializedDate) {\r\n var d = new Date(Date.parse(serializedDate)); \r\n var day = d.getUTCDate();\r\n var month = d.getUTCMonth();\r\n var year = d.getUTCFullYear();\r\n return new Date(year, month, day);\r\n }\r\n \r\n if($scope.patientData.dob !== undefined && $scope.patientData.dob !== null) {\r\n var newdate = getUtcDate($scope.patientData.dob);\r\n $scope.patientData.dob = new Date(newdate);\r\n }\r\n }\r\n return {\r\n restrict: \"E\",\r\n controller: controller,\r\n templateUrl: \"modules/patient/header/patient-demographics.tpl.html\",\r\n scope: {\r\n patientData: \"=\",\r\n isPatientList: \"=\"\r\n }\r\n };\r\n\r\n}\r\nangular.module(\"patient.header\").directive(\"patientDemographics\", PatientDemographicsDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/patient-demographics.tpl.html',\n '
          {{::patientData.name.lastName}}
          {{::patientData.name.firstName}}
          |EID:{{::patientData.id}}
          {{::patientData.dob | datetime}} 
          {{::patientData.age | age: \"short\"}}
          0\" class=\"vh-ui-header-patient-race\">{{::displayfield}}
          {{::patientData.serviceLevel}} ({{::patientData.kitNumber}}) (PIN:{{::patientData.ivrPin}}) (PIN:{{::patientData.byodPin}}){{::kitStatus}}{{::kitStatus}}
          ');\n}]);\n}(window, document, window.angular));","function PatientAvatarDirective() {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n avatarData: \"=\",\r\n gender: \"=\"\r\n },\r\n template: '',\r\n controller: function($scope) {\r\n if ($scope.avatarData) {\r\n $scope.imageUrl = \"data:image/png;base64,\" + $scope.avatarData;\r\n } else {\r\n if ($scope.gender && $scope.gender.length > 0 && $scope.gender[0].toLowerCase() === \"f\") {\r\n $scope.placeholder = \"female\";\r\n } else if ($scope.gender && $scope.gender.length > 0 && $scope.gender[0].toLowerCase() === \"m\") {\r\n $scope.placeholder = \"male\";\r\n } else {\r\n $scope.placeholder = \"generic\";\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"patientAvatar\", PatientAvatarDirective);\r\n","function PatientCallModalController(message, data, $uibModalInstance, $q, $window, $timeout, $interval, $scope, $rootScope, $uibModal,\r\n PatientListService, TimeLogFactory, TimeLogSessionService, VideoCallService, AlertSeverityLevel, hasNotificationPermission, optedIn,\r\n isPatientScheduleVirtualVisitEnabled, hasEulaAccepted, scheduledVisitsList, vhSweetAlert, ConfigurationRepository, $filter, PatientHeaderService,\r\n isDisableScheduling, isEnableScheduleNowPreNotification, isEnableScheduleNowPreNotificationConfirmation) {\r\n var vm = this;\r\n vm.cancel = cancel;\r\n vm.patient = data.Patient;\r\n vm.ScheduleVirtualVisitEnabled = isPatientScheduleVirtualVisitEnabled;\r\n vm.ScheduleVirtualVisitButtonEnabled = true;\r\n vm.callDuration = data.CallDuration;\r\n vm.headingText = \"Calling Information for:\";\r\n vm.postponeCall = postponeCall;\r\n vm.callPatientNow = callPatientNow;\r\n vm.videoCallNow = videoCallNow;\r\n vm.videoCallNowText = 'Video Call Now';\r\n vm.scheduledvideoCallNowText = 'Schedule Video Visit';\r\n vm.sendPreNotificationText = 'Send Pre-Notification';\r\n vm.scheduleVisit = scheduleVisit;\r\n vm.virtualVisitId = 0;\r\n vm.maxLengthScheduleVisitNotes = 35;\r\n vm.careMemberTimeZone = '';\r\n vm.kitNumber = (vm.patient.kitNumber == null || vm.patient.kitNumber == '') ? \"\" : vm.patient.kitNumber;\r\n vm.sendPreNotification = sendPreNotification;\r\n\r\n const DateTimeFilter = $filter('datetime');\r\n\r\n //video call statuses\r\n var TEXT_INITCALL = \"Initializing call...\";\r\n var TEXT_CONTACTTAB = \"Contacting...\";\r\n var TEXT_CONTACTTAB_TIMEOUT = \"Call cancelled. Unable to contact.\";\r\n var TEXT_RINGINGTAB = \"Ringing tablet...\";\r\n var TEXT_RINGINGTAB_TIMEOUT = \"Call cancelled. No answer.\";\r\n var TEXT_CALLACCEPTED = \"Call accepted\";\r\n var TEXT_CALLDECLINED = \"Patient declined call\";\r\n var TEXT_CALLINPROGRESS = \"Call in progress\";\r\n var TEXT_CALLENDED = \"Call ended\";\r\n var TEXT_CALLCOMPLETE = \"Call completed\";\r\n var INPROGRESS = 1;\r\n var CallStatus = { Requested: 0, Acknowledged: 1, Accepted: 2, Declined: 3, Complete: 4 }\r\n var CallStatusText = { Requested: \"Requested\", Acknowledged: \"Acknowledged\", Accepted: \"Accepted\", Declined: \"Declined\", Complete: \"Complete\" }\r\n var callTimer, ackTimer, ringTimer, scheduledVideoVisitTimer;\r\n\r\n var checkVirtualVisitTimer;\r\n var VisitStatus = { Scheduled: 0, InProgress: 1, Ended: 2, InWaitingRoom: 3, PatientNotJoined: 4, CareMemberNotJoined: 5, CallRejected: 6, Cancelled: 7 }\r\n\r\n //default configs\r\n vm.config = {};\r\n\r\n vm.config.StatusCheckDuration = 2000; // 2 seconds\r\n vm.config.AckTimeout = 20000; //20 seconds\r\n vm.config.RingTimeout = 60000; // 60 seconds\r\n vm.config.IsVideoProviderInTouch = false; // Zoom is default video provider\r\n vm.config.IsDisableScheduling = isDisableScheduling;\r\n vm.scheduledvideoCallNowText = isDisableScheduling == true ? 'Schedule Now' : 'Schedule Video Visit';\r\n vm.isEnableScheduleNowPreNotification = isEnableScheduleNowPreNotification;\r\n vm.isEnableScheduleNowPreNotificationConfirmation = isEnableScheduleNowPreNotificationConfirmation;\r\n vm.error = \"\";\r\n vm.message = \"\";\r\n vm.inVideoCall = false;\r\n vm.videoCall = {};\r\n vm.videoCallUrl = '';\r\n vm.reason = message;\r\n vm.patientOptedIn = false;\r\n vm.scheduledvisits = [];\r\n vm.scheduledVisitsList = scheduledVisitsList.filter(x => x.StatusId == VisitStatus.Scheduled);\r\n vm.startStatusCheck = false;\r\n\r\n vm.endCall = function () {\r\n vm.inVideoCall = false;\r\n vm.message = TEXT_CALLENDED;\r\n clearAllTimeouts();\r\n if (vm.videoCall.MeetingId > 0) { VideoCallService.endCall(vm.videoCall.MeetingId); }\r\n }\r\n\r\n vm.cancelScheduledVisit = function (videoVisitId, datetimeString) {\r\n vm.message = '';\r\n var mdate = moment(datetimeString);\r\n vhSweetAlert.verify(\"Are you sure?\", \"This will remove the patient's video visit scheduled for \" + DateTimeFilter(mdate) +\" at \"+ mdate.format(\"hh:mm A\"), \"Yes\").then(function (isConfirm) {\r\n if (isConfirm) {\r\n\r\n PatientListService.getPatientScheduleVirtualVisits(vm.patient.id).then(function (data) {\r\n if (data.length > 0) {\r\n var visit = data.filter(x => x.VivifyVirtualVisitId == videoVisitId && x.StatusId == VisitStatus.Scheduled);\r\n // only if it's in Scheduled Status Cancel the visit\r\n if (visit.length > 0) {\r\n var indexId = vm.scheduledVisitsList.findIndex(x => x.VivifyVirtualVisitId == videoVisitId);\r\n PatientListService.cancelScheduleVideoVisit(videoVisitId).then(function (response) {\r\n if (response && indexId > -1) {\r\n vm.scheduledVisitsList.splice(indexId, 1)\r\n $rootScope.$emit(\"vh:patientUpdated\");\r\n }\r\n });\r\n }\r\n else {\r\n vm.message = \"Could not cancel, patient is in waiting room.\";\r\n }\r\n }\r\n else {\r\n // removed it from the list\r\n if (vm.scheduledVisitsList != null) {\r\n var indexId = vm.scheduledVisitsList.findIndex(x => x.VivifyVirtualVisitId == videoVisitId);\r\n if (indexId > -1) {\r\n vm.scheduledVisitsList.splice(indexId, 1);\r\n } \r\n } \r\n vm.message = \"Could not cancel, patient declined call.\";\r\n }\r\n }); \r\n }\r\n });\r\n };\r\n\r\n vm.IsScheduleVideoVisitStarted = function (videoVisitStatus) {\r\n return videoVisitStatus === VisitStatus.InWaitingRoom || videoVisitStatus === VisitStatus.InProgress;\r\n }\r\n\r\n loadController();\r\n\r\n $scope.$on('$destroy', function () {\r\n clearAllTimeouts();\r\n if (checkVirtualVisitTimer) {\r\n $interval.cancel(checkVirtualVisitTimer);\r\n checkVirtualVisitTimer = undefined;\r\n }\r\n });\r\n\r\n $scope.$watch('vm.inVideoCall', function () {\r\n if (vm.inVideoCall) {\r\n vm.videoCallNowText = 'Cancel video call';\r\n } else {\r\n vm.videoCallNowText = 'Video Call Now';\r\n }\r\n });\r\n\r\n function loadController() {\r\n if (vm.ScheduleVirtualVisitEnabled) {\r\n vm.modelTitle = 'Call Options';\r\n vm.phoneCallNow = 'Log Phone Call';\r\n if (scheduledVisitsList != null && scheduledVisitsList.length > 0) {\r\n var scheduleDate = moment().format(\"YYYY-MM-DD\");\r\n vm.scheduledvisits = scheduledVisitsList.filter(x => (moment(x.ScheduleDateTime_UTC).format(\"YYYY-MM-DD\") >= scheduleDate\r\n && moment(x.ScheduleDateTime_UTC).format(\"YYYY-MM-DD\") <= scheduleDate)\r\n && (x.StatusId == VisitStatus.InProgress\r\n || x.StatusId == VisitStatus.InWaitingRoom\r\n || x.StatusId == VisitStatus.Scheduled))[0];\r\n if (vm.scheduledvisits != null) {\r\n checkscheduleVisitStatus();\r\n checkVirtualVisitTimer = $interval(checkscheduleVisitStatus, 10000);\r\n }\r\n }\r\n } else {\r\n vm.modelTitle = 'Respond to Call Request';\r\n vm.phoneCallNow = 'Phone Call Now';\r\n }\r\n\r\n vm.patientOptedIn = optedIn && hasEulaAccepted;\r\n vm.remoteNotificationsEnabled = hasNotificationPermission;\r\n vm.disableCallButtons = !vm.patientOptedIn || !vm.patient.remoteNotificationsEnabled;\r\n\r\n if (!vm.patient.remoteNotificationsEnabled)\r\n vm.disabledToolTip = 'Patient must enable remote notifications to place video calls.';\r\n\r\n if (!vm.patientOptedIn)\r\n vm.disabledToolTip = 'Patient has not opted in. This feature will be available once the patient has opted in.';\r\n\r\n if (vm.patient.callAlertSeverity != AlertSeverityLevel.None) {\r\n vm.headingText = 'Call Requested By:';\r\n }\r\n\r\n Promise.all([VideoCallService.getConfig()])\r\n .then((data) => {\r\n let [videoCall] = data;\r\n vm.config.StatusCheckDuration = videoCall.StatusCheckDuration;\r\n vm.config.AckTimeout = videoCall.AckTimeout;\r\n vm.config.RingTimeout = videoCall.RingTimeout;\r\n vm.config.IsVideoProviderInTouch = videoCall.IsVideoProviderInTouch;\r\n });\r\n \r\n }\r\n\r\n function cancel() {\r\n $interval.cancel(callTimer);\r\n if (!vm.inVideoCall) {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n }\r\n\r\n function postponeCall() {\r\n PatientListService.postponePatientCall(vm.patient.id).then(function (data) {\r\n $uibModalInstance.close('postpone');\r\n });\r\n }\r\n\r\n function clearCallAlert() {\r\n if (vm.patient.callAlertId) {\r\n PatientListService.clearCallAlert(vm.patient.id, vm.patient.callAlertId).then(function (data) {\r\n vm.patient.callAlertSeverity = AlertSeverityLevel.None;\r\n $rootScope.$emit(\"vh:patientUpdated\");\r\n $rootScope.$emit(\"vh:refreshmessengercount\");\r\n });\r\n }\r\n }\r\n\r\n\r\n function callPatientNow() {\r\n var newTimeLog = TimeLogSessionService.getNewTimeLog('');\r\n\r\n var modalInstance = $uibModal.open({\r\n backdrop: 'static',\r\n controller: 'AddTimeLogDetailController as vm',\r\n templateUrl: 'modules/patient/header/addTimeLog.modal.html',\r\n resolve: {\r\n timeLog: function () {\r\n return newTimeLog;\r\n },\r\n liPatient: function() {\r\n return vm.patient;\r\n },\r\n options: function() {\r\n return {\r\n title: 'Add Call Log Entry',\r\n isDescriptionOptional: true\r\n };\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (timeLog) {\r\n\r\n PatientListService.callPatientNow(vm.patient.id, vm.patient.callAlertId, false, timeLog)\r\n .then(function(data) {\r\n vm.patient.callAlertSeverity = AlertSeverityLevel.None;\r\n $rootScope.$emit(\"vh:refreshmessengercount\");\r\n \r\n $uibModalInstance.close('callnow');\r\n });\r\n \r\n }, function() {\r\n $uibModalInstance.dismiss('cancel');\r\n });\r\n }\r\n\r\n function videoCallNow() {\r\n if (vm.inVideoCall) {\r\n vm.endCall();\r\n } else {\r\n PatientListService.callPatientNow(vm.patient.id, vm.patient.callAlertId, true).then(function (data) {\r\n initializeVideoCall();\r\n TimeLogFactory.startVideoCall();\r\n });\r\n }\r\n }\r\n\r\n function initializeVideoCall() {\r\n vm.message = TEXT_INITCALL;\r\n vm.error = '';\r\n VideoCallService.requestCall(vm.patient.id).then(function (data) {\r\n if (data.MeetingId > 0) {\r\n vm.inVideoCall = true;\r\n vm.message = TEXT_CONTACTTAB;\r\n if (vm.config.IsVideoProviderInTouch == false) { //Zoom Video\r\n ackTimer = $timeout(ackTimeoutCallback, vm.config.AckTimeout);\r\n VideoCallService.getMeetingInfo(data.MeetingId).then(function (videoCall) {\r\n vm.videoCall.MeetingId = videoCall.id;\r\n vm.videoCallUrl = videoCall.start_url;\r\n callTimer = $interval(checkCallStatus, vm.config.StatusCheckDuration);\r\n });\r\n }\r\n else //InTouch Video\r\n {\r\n vm.videoCall.MeetingId = data.MeetingId;\r\n getInTouchCaregiverMeetingUrl();\r\n callTimer = $interval(checkCallStatus, vm.config.StatusCheckDuration);\r\n }\r\n } else {\r\n vm.message = '';\r\n vm.error = 'Unable to start meeting';\r\n }\r\n }).catch(function (err) {\r\n handleException(err);\r\n vm.error = 'Error calling tablet';\r\n vm.message = '';\r\n });\r\n }\r\n\r\n function getInTouchCaregiverMeetingUrl() {\r\n if (vm.videoCall.MeetingId > 0) {\r\n VideoCallService.getInTouchCaregiverMeetingUrl(vm.videoCall.MeetingId, vm.patient.id).then(function (data) {\r\n vm.videoCallUrl = data;\r\n }).catch(function (err) {\r\n handleException(err);\r\n });\r\n }\r\n }\r\n\r\n function launchInTouchWindow() {\r\n var width = 1000;\r\n var height = 500;\r\n var left = (screen.width - width) / 2;\r\n var top = (screen.height - height) / 2;\r\n $window.open(vm.videoCallUrl, \"InTouch\",\r\n \"width=\" + width +\r\n \",height=\" + height +\r\n \",left=\" + left +\r\n \",top=\" + top +\r\n \",location=no,toolbar=no,status=no\");\r\n }\r\n\r\n function launchVideoWindow() {\r\n if (vm.config.IsVideoProviderInTouch == false) { //Zoom Video\r\n launchZoomWindow();\r\n }\r\n else { //InTouch Video\r\n launchInTouchWindow();\r\n }\r\n }\r\n\r\n function callCancelledCallback() {\r\n console.log('callCancelledCallback');\r\n vm.endCall();\r\n vm.message = TEXT_CALLENDED;\r\n }\r\n\r\n function ackTimeoutCallback() {\r\n console.log('ackTimeoutCallback');\r\n vm.endCall();\r\n vm.message = TEXT_CONTACTTAB_TIMEOUT;\r\n }\r\n\r\n function ringTimeoutCallback() {\r\n console.log('ringTimeoutCallback');\r\n vm.endCall();\r\n vm.message = TEXT_RINGINGTAB_TIMEOUT;\r\n }\r\n\r\n function checkCallStatus() {\r\n VideoCallService.getCallStatus(vm.videoCall.MeetingId).then(function (data) {\r\n vm.videoCall = data;\r\n handleStatus();\r\n }).catch(function (err) {\r\n handleException(err);\r\n });\r\n }\r\n\r\n function handleStatus() {\r\n if (vm.videoCall.MeetingId > 0) {\r\n if (vm.videoCall.CallStatusId == CallStatus.Acknowledged) {\r\n if (vm.config.IsVideoProviderInTouch == false) { //Zoom Video\r\n $timeout.cancel(ackTimer);\r\n }\r\n if (ringTimer == undefined) {\r\n ringTimer = $timeout(ringTimeoutCallback, vm.config.RingTimeout);\r\n }\r\n }\r\n else if (vm.videoCall.CallStatusId == CallStatus.Accepted) {\r\n clearAllTimeouts();\r\n launchVideoWindow();\r\n clearCallAlert();\r\n vm.inVideoCall = false;\r\n vm.cancel(); // dismiss dialog\r\n }\r\n else if (vm.videoCall.CallStatusId == CallStatus.Declined || vm.videoCall.CallStatusId == CallStatus.Complete || callTimer > 300000) {\r\n clearAllTimeouts();\r\n vm.inVideoCall = false;\r\n }\r\n\r\n setStatusMessage(vm.videoCall.CallStatusId);\r\n } else {\r\n clearAllTimeouts();\r\n vm.inVideoCall = false;\r\n }\r\n }\r\n\r\n function launchZoomWindow() {\r\n var width = 1000;\r\n var height = 500;\r\n var left = (screen.width - width) / 2;\r\n var top = (screen.height - height) / 2;\r\n $window.open(vm.videoCallUrl, \"zoom\",\r\n \"width=\" + width +\r\n \",height=\" + height +\r\n \",left=\" + left +\r\n \",top=\" + top +\r\n \",location=no,toolbar=no,status=no\");\r\n }\r\n\r\n function handleException(err) {\r\n console.log(err);\r\n clearAllTimeouts();\r\n }\r\n\r\n\r\n function clearAllTimeouts() {\r\n if (callTimer) {\r\n $interval.cancel(callTimer);\r\n callTimer = undefined;\r\n }\r\n\r\n if (ackTimer) {\r\n $timeout.cancel(ackTimer);\r\n ackTimer = undefined;\r\n }\r\n\r\n if(scheduledVideoVisitTimer) {\r\n $interval.cancel(scheduledVideoVisitTimer);\r\n scheduledVideoVisitTimer = undefined;\r\n }\r\n\r\n if (ringTimer) {\r\n $timeout.cancel(ringTimer);\r\n ringTimer = undefined;\r\n }\r\n }\r\n\r\n function setStatusMessage(statusId) {\r\n if (statusId == CallStatus.Acknowledged) { vm.message = TEXT_RINGINGTAB; }\r\n else if (statusId == CallStatus.Accepted) { vm.message = TEXT_CALLACCEPTED; }\r\n else if (statusId == CallStatus.Declined) { vm.message = TEXT_CALLDECLINED; }\r\n else if (statusId == CallStatus.Complete) { vm.message = TEXT_CALLCOMPLETE; }\r\n }\r\n\r\n function scheduleVisit() {\r\n if (vm.scheduledvideoCallNowText == 'Schedule Now') {\r\n scheduleNowVideoVisit();\r\n }\r\n else if (vm.scheduledvideoCallNowText == 'Join Video Visit' || vm.scheduledvideoCallNowText == 'Rejoin Video Visit') {\r\n joinVirtualVideoVisit();\r\n }\r\n else {\r\n var schedulemodalDialog = $uibModal.open({\r\n templateUrl: 'modules/patient/header/schedulevirtualvisit.modal.html',\r\n controller: 'SchedulevirtualvisitController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n patientAlertType: function () {\r\n return null;\r\n },\r\n patientId: function () {\r\n return vm.patient.id;\r\n },\r\n liPatient: function () {\r\n return vm.patient;\r\n },\r\n liPatientkitNumber: function () {\r\n return vm.patient.kitNumber;\r\n }\r\n }\r\n });\r\n\r\n schedulemodalDialog.result.then(function (action) {\r\n // Schedule Now (Home) \r\n if (action == '0') { \r\n vm.ScheduleVirtualVisitButtonEnabled = false;\r\n vm.startStatusCheck = false;\r\n vm.message = TEXT_RINGINGTAB;\r\n checksHomecheduleVisitStatus(); \r\n checkVirtualVisitTimer = $interval(checksHomecheduleVisitStatus, 10000); \r\n }\r\n else {\r\n $uibModalInstance.close();\r\n }\r\n \r\n });\r\n }\r\n }\r\n\r\n function checkscheduleVisitStatus() {\r\n vm.scheduledvisits = [];\r\n PatientListService.getPatientScheduleVirtualVisits(vm.patient.id).then(function (data) {\r\n if (data != null && data.length > 0) {\r\n var scheduleDate = moment().format(\"YYYY-MM-DD\");\r\n vm.scheduledvisits = data.filter(x => (moment(x.ScheduleDateTime_UTC).format(\"YYYY-MM-DD\") >= scheduleDate\r\n && moment(x.ScheduleDateTime_UTC).format(\"YYYY-MM-DD\") <= scheduleDate)\r\n && (x.StatusId == VisitStatus.InWaitingRoom))[0];\r\n if (vm.scheduledvisits != null) {\r\n vm.virtualVisitId = vm.scheduledvisits.VivifyVirtualVisitId;\r\n var indexId = vm.scheduledVisitsList.findIndex(x => x.VivifyVirtualVisitId == vm.virtualVisitId);\r\n if (indexId > -1) { vm.scheduledVisitsList.splice(indexId, 1, vm.scheduledvisits); }\r\n if (vm.scheduledvisits.RecordId == null) {\r\n vm.scheduledvideoCallNowText = 'Join Video Visit';\r\n } else {\r\n vm.scheduledvideoCallNowText = 'Rejoin Video Visit';\r\n vm.ScheduleVirtualVisitButtonEnabled = true;\r\n }\r\n ConfigurationRepository.getByParamName('ScheduledVisitCardTimeout').then( function (response) {\r\n if(response != null && response.Param == 'ScheduledVisitCardTimeout') {\r\n var intervalTimer = (new Date(vm.scheduledvisits.ScheduleDateTime_UTC) - new Date()) + response.Value * 60 * 1000;\r\n scheduledVideoVisitTimer = $interval(scheduledVideoVisitTimeout, intervalTimer);\r\n }\r\n });\r\n if (checkVirtualVisitTimer) {\r\n $interval.cancel(checkVirtualVisitTimer);\r\n checkVirtualVisitTimer = undefined;\r\n }\r\n }\r\n }\r\n }).catch(function (err) {\r\n handleException(err);\r\n });\r\n }\r\n\r\n function scheduledVideoVisitTimeout() {\r\n if (vm.scheduledvideoCallNowText == 'Join Video Visit' || vm.scheduledvideoCallNowText == 'Rejoin Video Visit') {\r\n vm.scheduledvideoCallNowText = vm.config.IsDisableScheduling == true ? 'Schedule Now':'Schedule Video Visit';\r\n }\r\n }\r\n\r\n function joinVirtualVideoVisit() {\r\n vm.ScheduleVirtualVisitButtonEnabled = false;\r\n PatientListService.callPatientNow(vm.patient.id, vm.patient.callAlertId, true).then(function (data) {\r\n initializeJoinVideoVisit();\r\n TimeLogFactory.startVideoCall();\r\n });\r\n }\r\n\r\n function initializeJoinVideoVisit() {\r\n \r\n vm.scheduledvideoCallNowText = 'Rejoin Video Visit';\r\n \r\n vm.error = '';\r\n VideoCallService.joinVideoVisit(vm.patient.id, vm.virtualVisitId).then(function (data) {\r\n if (data.MeetingId > 0) {\r\n if (vm.config.IsVideoProviderInTouch == false) { //Zoom Video \r\n VideoCallService.getMeetingInfo(data.MeetingId).then(function (videoCall) {\r\n vm.videoCall.MeetingId = videoCall.id;\r\n vm.videoCallUrl = videoCall.start_url;\r\n //callTimer = $interval(checkCallStatus, vm.config.StatusCheckDuration);\r\n launchVideoWindow();\r\n $rootScope.$emit(\"vh:patientUpdated\");\r\n $rootScope.$emit(\"vh:refreshmessengercount\");\r\n $uibModalInstance.close();\r\n });\r\n }\r\n else //InTouch Video\r\n {\r\n vm.videoCall.MeetingId = data.MeetingId;\r\n getInTouchCaregiverMeetingUrl();\r\n //callTimer = $interval(checkCallStatus, vm.config.StatusCheckDuration);\r\n }\r\n } else {\r\n vm.message = '';\r\n vm.error = 'Unable to start meeting';\r\n }\r\n }).catch(function (err) {\r\n handleException(err);\r\n vm.error = 'Error calling tablet';\r\n vm.message = '';\r\n });\r\n }\r\n\r\n function scheduleNowVideoVisit() { \r\n\r\n vm.ScheduleVirtualVisitButtonEnabled = false;\r\n\r\n var visit = {\r\n Message: '',\r\n ScheduleDateTime_UTC: moment.utc().format()\r\n }; \r\n\r\n PatientHeaderService.saveScheduleVirtualVisit(vm.patient.id, visit).then(function () { \r\n if (vm.kitNumber.length == 0) { // Go+ Service Level\r\n $rootScope.$emit(\"vh:patientUpdated\", vm.patient.id);\r\n $uibModalInstance.close();\r\n }\r\n else { // Home Service Level\r\n vm.message = TEXT_RINGINGTAB; \r\n vm.startStatusCheck = false;\r\n checksHomecheduleVisitStatus();\r\n checkVirtualVisitTimer = $interval(checksHomecheduleVisitStatus, 10000); \r\n }\r\n });\r\n }\r\n\r\n function sendPreNotification() {\r\n\r\n if (vm.isEnableScheduleNowPreNotificationConfirmation == true) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to let this patient know you are almost ready to see them?', 'Yes').then(function (isConfirm) {\r\n if (isConfirm) {\r\n // send Notification \r\n sendScheduleNowPreNotification();\r\n }\r\n });\r\n }\r\n else {\r\n // send Notification \r\n sendScheduleNowPreNotification();\r\n }\r\n }\r\n\r\n function sendScheduleNowPreNotification() {\r\n PatientListService.sendScheduleNowPreNotification(vm.patient.id).then(function (response) {\r\n if (response != null) {\r\n $rootScope.$emit(\"vh:patientUpdated\", vm.patient.id);\r\n $uibModalInstance.close();\r\n }\r\n });\r\n }\r\n\r\n function checksHomecheduleVisitStatus() {\r\n vm.scheduledvisits = [];\r\n PatientListService.getPatientScheduleVirtualVisits(vm.patient.id).then(function (data) {\r\n if (data != null && data.length > 0) {\r\n vm.startStatusCheck = true;\r\n var scheduleDate = moment().format(\"YYYY-MM-DD\");\r\n vm.scheduledvisits = data.filter(x => (moment(x.ScheduleDateTime_UTC).format(\"YYYY-MM-DD\") >= scheduleDate\r\n && moment(x.ScheduleDateTime_UTC).format(\"YYYY-MM-DD\") <= scheduleDate)\r\n && (x.StatusId == VisitStatus.InWaitingRoom))[0];\r\n if (vm.scheduledvisits != null) {\r\n vm.message = TEXT_INITCALL;\r\n vm.virtualVisitId = vm.scheduledvisits.VivifyVirtualVisitId; \r\n if (vm.scheduledvisits.RecordId == null) {\r\n vm.scheduledvideoCallNowText = 'Join Video Visit';\r\n joinVirtualVideoVisit();\r\n }\r\n }\r\n }\r\n else if (data.length == 0 && vm.startStatusCheck == true) {\r\n vm.message = TEXT_CONTACTTAB_TIMEOUT;\r\n clearAllTimeouts();\r\n if (checkVirtualVisitTimer) {\r\n $interval.cancel(checkVirtualVisitTimer);\r\n checkVirtualVisitTimer = undefined;\r\n }\r\n $rootScope.$emit(\"vh:patientUpdated\");\r\n $rootScope.$emit(\"vh:refreshmessengercount\"); \r\n vm.ScheduleVirtualVisitButtonEnabled = true;\r\n }\r\n }).catch(function (err) {\r\n handleException(err);\r\n });\r\n }\r\n\r\n \r\n\r\n\r\n}\r\nangular.module('patient.header').controller('PatientCallModalController', PatientCallModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/patientcall.modal.html',\n '

          {{vm.modelTitle}}

          0\">
          Scheduled
          • {{scheduleVisit.ScheduleDateTime_UTC | datetime }} at {{scheduleVisit.ScheduleDateTime_UTC | date : \"hh:mm a\"}}
            0) && !(vm.config.IsDisableScheduling)\" class=\"vh-ui-subtitle vh-ui-schedule-visit-notes\" tooltip-enable=\"{{scheduleVisit.Description.length}} > vm.maxLengthScheduleVisitNotes\" uib-tooltip=\"{{scheduleVisit.Description}}\" tooltip-placement=\"auto bottom\" tooltip-append-to-body=\"true\">Reason: {{scheduleVisit.Description}}

            0) || (vm.config.IsDisableScheduling)\">

          Requested
          Requested on {{vm.patient.callAlertDateTime | datetime}} at {{vm.patient.callAlertDateTime | date : \"HH:mm\"}} ({{vm.callDuration}} ago)
          0\">{{vm.patient.phone1Label}}: {{vm.patient.phone1 | tel }}
          0\">{{vm.patient.phone2Label}}: {{vm.patient.phone2 | tel }}
          0)\">
          0\" class=\"text-center\" style=\"color: black;\">{{vm.message}}
          0\" class=\"text-danger text-center\">{{vm.error}}
          ');\n}]);\n}(window, document, window.angular));","function PatientHeaderDirective(moment, $transitions, $state, PatientListService, PermissionService, $templateRequest, $interpolate, $compile, $rootScope, $uibModal, lodash, \r\n CurrentProceduralTerminologyCodesService, DirectEntryService, PatientChartService, TimeLogDetailService, $stateParams, PatientTimeLogUtilitiesService, \r\n PatientHeaderService, vhSweetAlert, MonitoringService, PatientServiceLevelService, ConfigurationsService, EditConfigurationsService,\r\n DemographicsService, $window, AuthorizationService, AlertType, AddCptCodeBillingService) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/header/patientheader.tpl.html\",\r\n replace: true,\r\n scope: {\r\n liPatient: \"=\",\r\n showSpirometer: \"=\",\r\n isClinical: \"=\",\r\n isTimeLogEnabled: \"=\",\r\n showBothWeight: \"=\",\r\n isPatientList: \"=\",\r\n directEntryEnabled: \"=\",\r\n isPatientDataTransferEnabled: \"=\",\r\n patientHeaderConfigurations: \"=\"\r\n },\r\n controller: function($scope) {\r\n $scope.showDirectEntry = $scope.directEntryEnabled && $scope.liPatient.serviceLevel;\r\n if ($scope.liPatient.avatar) {\r\n $scope.imageUrl = \"data:image/png;base64,\" + $scope.liPatient.avatar;\r\n } else {\r\n var gender = \"Male\";\r\n if ($scope.liPatient.gender && $scope.liPatient.gender.length > 0 && $scope.liPatient.gender[0].toLowerCase() === \"f\") {\r\n gender = \"Female\";\r\n }\r\n $scope.imageUrl = \"random\" + gender;\r\n }\r\n },\r\n link: function(scope, elem, attrs) {\r\n var originalPatientNote = scope.liPatient.note;\r\n scope.riskStatus = getRiskClass(scope.liPatient.riskId);\r\n scope.addPatientNote = addPatientNote;\r\n scope.completedPercent = Math.min(scope.liPatient.program.completedDays / scope.liPatient.program.durationDays * 100, 100) + \"%\";\r\n scope.guageStyle = \"width: \" + scope.completedPercent + \";\";\r\n scope.chartRouteActive = shouldShowChartSubmenu();\r\n scope.activityRouteActive = shouldShowActivitySubmenu();\r\n scope.showRiskModal = showRiskModal;\r\n scope.showMonitoringStatusModal = showMonitoringStatusModal;\r\n scope.showGeneralAlertModal = showGeneralAlertModal;\r\n scope.showNotificationModal = showNotificationModal;\r\n scope.showBiometricsModal = showBiometricsModal;\r\n scope.showCopyBiometricsModal = showCopyBiometricsModal;\r\n scope.reviewPatient = reviewPatient;\r\n scope.canMarkPatientReviewed = canMarkPatientReviewed;\r\n scope.patientIsReviewed = patientIsReviewed;\r\n scope.showAddTimeLog = showAddTimeLog;\r\n scope.showAddCPTCode = showAddCPTCode;\r\n scope.sendPathwayStartMessage = sendPathwayStartMessage;\r\n scope.showSendPathwayStartMessageButton = scope.liPatient.serviceLevelTypeId == 9 && scope.liPatient.hasSurveysDue && PermissionService.userHasPermission([\"PatientDemographicsWrite\"]);\r\n scope.showExternalSite = showExternalSite;\r\n scope.createNewVisit = createNewVisit;\r\n scope.ExternalLinkUrl = ConfigurationsService.configParams.ExternalLinkUrl;\r\n scope.ExternalLinkMenuText = ConfigurationsService.configParams.ExternalLinkMenuText;\r\n scope.ExternalLinkIcon = ConfigurationsService.configParams.ExternalLinkIcon;\r\n bindProgramStuff(scope.liPatient.program);\r\n\r\n var clinicalWatcher = scope.$watch('isClinical', function() {\r\n scope.timeLog = getTimeLogModel(scope.liPatient);\r\n });\r\n scope.timeLog = getTimeLogModel(scope.liPatient);\r\n\r\n if (!scope.isPatientList) {\r\n scope.isPatientListClass = \"nopointer\";\r\n }\r\n scope.monitoringGridUrl = $state.href(\"patients.patient.monitoring\", {\r\n patientId: scope.liPatient.id\r\n });\r\n\r\n var stateListener = $transitions.onSuccess({},(trans)=>{\r\n scope.chartRouteActive = shouldShowChartSubmenu();\r\n scope.activityRouteActive = shouldShowActivitySubmenu();\r\n });\r\n \r\n scope.$on(\"$destroy\", function() {\r\n clinicalWatcher();\r\n stateListener();\r\n });\r\n\r\n scope.launchCallModal = function() {\r\n scope.$broadcast(\"vh:launchCallModal\");\r\n };\r\n\r\n function shouldShowChartSubmenu() {\r\n return $state.includes(\"patients.patient.chart\") ||\r\n $state.includes(\"patients.patient.medications\") ||\r\n $state.includes(\"patients.patient.clinicalhistory\") ||\r\n $state.includes(\"patients.patient.forms\");\r\n }\r\n\r\n function shouldShowActivitySubmenu() {\r\n return $state.includes(\"patients.patient.activity\") || $state.includes(\"patients.patient.time_log.detail\");\r\n }\r\n\r\n function getRiskClass(riskId) {\r\n if (riskId === 1) {\r\n return \"success\";\r\n } else if (riskId === 2) {\r\n return \"warning\";\r\n } else if (riskId === 3) {\r\n return \"danger\";\r\n } else {\r\n return \"none\";\r\n }\r\n }\r\n\r\n function bindProgramStuff(program) {\r\n scope.programDate = null;\r\n scope.monitoringStatusChangeDate = null;\r\n scope.programTotalDaysText = null;\r\n scope.programStatusText = null;\r\n scope.programDayText = null;\r\n\r\n if (program.monitoringStatusId === 1) {\r\n scope.programDate = program.startDate;\r\n if (program.completedDays) {\r\n scope.programDayText = \"Day \" + program.completedDays;\r\n }\r\n scope.programTotalDaysText = program.durationDays;\r\n } else if (program.monitoringStatusId === 3) {\r\n scope.programStatusText = \"Screening\";\r\n setProgramDateText();\r\n } else if (program.monitoringStatusId === 8) {\r\n scope.programStatusText = \"Pre-active\";\r\n setProgramDateText();\r\n } else if (program.monitoringStatusId === 2) {\r\n scope.programStatusText = \"Inactive\";\r\n setProgramDateText();\r\n } else if (program.monitoringStatusId === 6) {\r\n scope.programStatusText = \"Screen Failed\";\r\n scope.monitoringStatusChangeDate = program.monitoringStatusChangeDate;\r\n } else if (program.monitoringStatusId === 7) {\r\n scope.programStatusText = \"Deleted\";\r\n scope.monitoringStatusChangeDate = program.monitoringStatusChangeDate;\r\n } else if (program.monitoringStatusId === 4) {\r\n scope.programStatusText = \"Completed\";\r\n if (program.completedDays) {\r\n scope.programDayText = program.completedDays + \" d\";\r\n }\r\n scope.monitoringStatusChangeDate = program.monitoringStatusChangeDate;\r\n }\r\n\r\n function setProgramDateText() {\r\n if (program.monitoringStatusChangeDate !== null) {\r\n scope.programDayText = \"Day \" + moment().startOf('day').diff(moment(program.monitoringStatusChangeDate).startOf('day'), 'days');\r\n }\r\n }\r\n }\r\n\r\n function getTimeLogModel(patient) {\r\n if (patient.timeLog) {\r\n var timeLogSeconds = patient.timeLog.totalTimeSeconds;\r\n if (scope.isClinical) {\r\n timeLogSeconds = patient.timeLog.clinicalTimeSeconds;\r\n }\r\n var seconds = timeLogSeconds % 60;\r\n var minutes = Math.floor(timeLogSeconds / 60 % 60);\r\n var hours = Math.floor(timeLogSeconds / 60 / 60);\r\n if (hours < 10) {\r\n hours = \"0\" + hours.toString();\r\n }\r\n if (minutes < 10) {\r\n minutes = \"0\" + minutes.toString();\r\n }\r\n if (seconds < 10) {\r\n seconds = \"0\" + seconds.toString();\r\n }\r\n return {\r\n hours: hours,\r\n minutes: minutes,\r\n seconds: seconds\r\n };\r\n }\r\n }\r\n\r\n function addPatientNote() {\r\n if (originalPatientNote != scope.liPatient.note) {\r\n PatientListService.addPatientNote({\r\n PatientId: scope.liPatient.id,\r\n Note: scope.liPatient.note\r\n });\r\n }\r\n }\r\n\r\n function showRiskModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/header/risk.modal.html',\r\n controller: 'RiskModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n patientId: function() {\r\n return scope.liPatient.id;\r\n },\r\n originalRiskId: function() {\r\n return scope.liPatient.riskId;\r\n },\r\n liPatient: function() {\r\n return scope.liPatient;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(newRiskId) {\r\n scope.liPatient.riskId = newRiskId;\r\n scope.riskStatus = getRiskClass(scope.liPatient.riskId);\r\n }, function() {});\r\n }\r\n\r\n function showMonitoringStatusModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/header/monitoringStatus/monitoring-status-wizard.modal.html',\r\n controller: 'MonitoringStatusWizardController as msw',\r\n backdrop: 'static',\r\n windowClass: 'tempClass',\r\n resolve: {\r\n patientStatus: function() {\r\n return MonitoringService.getPatientStatus(scope.liPatient.id).then(function(data){\r\n return data;\r\n });\r\n },\r\n patientServiceLevel: function() {\r\n return PatientServiceLevelService.getServiceLevel(scope.liPatient.id).then(function (patientServiceLevel) {\r\n return patientServiceLevel;\r\n });\r\n },\r\n configurations: function () {\r\n return ConfigurationsService.getConfig();\r\n },\r\n liPatient: function() {\r\n return scope.liPatient;\r\n },\r\n monitoringStatuses: function() {\r\n return PatientHeaderService.getMonitoringStatuses().then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(newMonitoringStatusId) {\r\n scope.liPatient.program.monitoringStatusId = newMonitoringStatusId;\r\n bindProgramStuff(scope.liPatient.program);\r\n if($state.current.name === \"patients.patient.demographics\") {\r\n $state.go(\"patients.patient.demographics\", { patientId: scope.liPatient.id }, { reload: true });\r\n }\r\n }, function() {});\r\n }\r\n\r\n function showGeneralAlertModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/header/generalalert.modal.html',\r\n controller: 'GeneralAlertModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n patientAlertType: function() {\r\n return AlertType.General;\r\n },\r\n patientId: function() {\r\n return scope.liPatient.id;\r\n },\r\n liPatient: function() {\r\n return scope.liPatient;\r\n }\r\n }\r\n });\r\n }\r\n\r\n function showNotificationModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/header/generalalert.modal.html',\r\n controller: 'GeneralAlertModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n patientAlertType: function() {\r\n return AlertType.Notification;\r\n },\r\n patientId: function() {\r\n return scope.liPatient.id;\r\n },\r\n liPatient: function() {\r\n return scope.liPatient;\r\n }\r\n }\r\n });\r\n }\r\n\r\n function showBiometricsModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/directentry/biometric.modal.html',\r\n controller: 'BiometricModalController as vm',\r\n backdrop: 'static',\r\n windowClass: 'biometricModalSize',\r\n resolve: {\r\n patientId: function() {\r\n return scope.liPatient.id;\r\n },\r\n questions: function() {\r\n //An empty list will cause the modal to generate a default list of biometric questions.\r\n return [];\r\n },\r\n liPatient: function() {\r\n return scope.liPatient;\r\n },\r\n patientTimeZoneName: function() {\r\n return scope.liPatient.patientTimeZoneName;\r\n },\r\n observationDate: function () {\r\n // observation datetime must be in patient time and not caregiver\r\n var rightNow = moment.tz(new Date(), scope.liPatient.patientTimeZoneName).format()\r\n var rightNowNoTimeZone = rightNow.substring(0, rightNow.lastIndexOf(\"-\"));\r\n var caregiverTime = moment.tz(rightNowNoTimeZone, moment.tz.guess())\r\n return new Date(caregiverTime.format());\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(responses) {\r\n var questions = responses.questions;\r\n\r\n //Mark questions that aren't already answered but have an answer as ShouldSave.\r\n lodash(questions).forEach(function(question) {\r\n var questionHasAnswer = lodash(question.PatientSurveyOptions).any(function(option) {\r\n return option.BiometricAnswer;\r\n });\r\n question.ShouldSave = questionHasAnswer;\r\n }).value();\r\n\r\n DirectEntryService.savePatientResponses(scope.liPatient.id, questions, [], scope.liPatient.patientTimeZoneName, null, null).then(function() {\r\n scope.$emit(\"vh:biometricsAdded\");\r\n });\r\n });\r\n }\r\n \r\n function showCopyBiometricsModal() {\r\n \r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/header/copybiometrics.modal.html',\r\n controller: 'CopyBiometricsModalController as vm',\r\n backdrop: 'static',\r\n size: 'lg',\r\n resolve: {\r\n patientId: function() {\r\n return scope.liPatient.id;\r\n },\r\n liPatient: function() {\r\n return scope.liPatient;\r\n },\r\n patientBiometricTypes: function() {\r\n return MonitoringService.getPatientBiometricTypes(scope.liPatient.id);\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function() {\r\n // done\r\n });\r\n }\r\n\r\n function reviewPatient() {\r\n PatientListService.setPatientreviewed(scope.liPatient.id).then(function() {\r\n scope.liPatient.reviewed = true;\r\n\r\n PatientChartService.addEntryGroup(scope.liPatient.id, {\r\n PatientId: scope.liPatient.id,\r\n TextPatientChartEntries: [{\r\n PatientId: scope.liPatient.id,\r\n Text: 'Patient Reviewed'\r\n }]\r\n });\r\n $rootScope.$emit(\"vh:patientUpdated\", scope.liPatient.id); \r\n });\r\n }\r\n\r\n function patientIsReviewed() {\r\n var reviewed = scope.liPatient.reviewed;\r\n var hasAlert = patientHasAlert();\r\n\r\n if (reviewed && !hasAlert) {\r\n return true\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n function sendPathwayStartMessage() {\r\n PatientHeaderService.sendPathwayStartMessage(scope.liPatient.id);\r\n vhSweetAlert.success('Text Message Sent', 'A pathway due message has been sent to the patient.');\r\n }\r\n\r\n function patientHasAlert() {\r\n var hasAlert = false;\r\n if (scope.liPatient.survey.lastReading && scope.liPatient.survey.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.weight.lastReading && scope.liPatient.weight.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.bp.lastReading && scope.liPatient.bp.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.pulse.lastReading && scope.liPatient.pulse.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.oxygen.lastReading && scope.liPatient.oxygen.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.glucose.lastReading && scope.liPatient.glucose.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.temperature.lastReading && scope.liPatient.temperature.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.spirometer.lastReading && scope.liPatient.spirometer.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.general.lastReading && scope.liPatient.general.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.glucose.lastReading && scope.liPatient.glucose.lastReading.alertSeverity != 3) {\r\n hasAlert = true;\r\n } else if (scope.liPatient.callAlertSeverity && scope.liPatient.callAlertSeverity != 3) {\r\n hasAlert = true;\r\n }\r\n\r\n return hasAlert;\r\n }\r\n\r\n function canMarkPatientReviewed () {\r\n var patient = scope.liPatient;\r\n var isActive = patient.program.monitoringStatusId == 1;\r\n\r\n var isReviewCompleted = patient.reviewed === true;\r\n var reviewIsNotCompleted = !isReviewCompleted;\r\n\r\n var hasUnansweredAlerts = patientHasAlert();\r\n var hasNoUnansweredAlerts = !hasUnansweredAlerts;\r\n\r\n var completedSurveysToday = patient.survey.lastReading.value.completedSurveys || 0;\r\n var availableSurveysToday = patient.survey.lastReading.value.availableSurveys;\r\n var finishedAllSurveysToday = completedSurveysToday == availableSurveysToday;\r\n var hasSurveysToday = availableSurveysToday > 0;\r\n\r\n var canMarkReviewAsComplete = isActive && reviewIsNotCompleted && hasNoUnansweredAlerts && hasSurveysToday && finishedAllSurveysToday;\r\n \r\n return canMarkReviewAsComplete;\r\n }\r\n \r\n function showExternalSite(){\r\n var url = scope.ExternalLinkUrl;\r\n // replace {patientId}, {userId}, {MRN}\r\n url = url.replace(\"{patientId}\", scope.liPatient.id);\r\n url = url.replace(\"{MRN}\", scope.liPatient.mrnIdent);\r\n url = url.replace(\"{userId}\", AuthorizationService.getCaregiver().Id);\r\n $window.open(url);\r\n }\r\n\r\n function createNewVisit(patientId) {\r\n PatientHeaderService.createNewEncounter(patientId).then(function(response) {\r\n if(response.data.Id) {\r\n $state.go(\"patients.patient.demographics\", { patientId: response.data.Id }, { reload: true }); \r\n }\r\n });\r\n }\r\n\r\n function showAddTimeLog() {\r\n\r\n if ($stateParams.monthOffset && $stateParams.monthOffset != 0) {\r\n var offsetDate = new Date();\r\n offsetDate.setMonth(offsetDate.getMonth() - 1);\r\n\r\n scope.date = offsetDate;\r\n }\r\n else {\r\n scope.date = new Date();\r\n }\r\n\r\n var newTimeLog = TimeLogDetailService.getNewTimeLog('');\r\n newTimeLog.StartTime_UTC.setYear(scope.date.getFullYear());\r\n newTimeLog.StartTime_UTC.setMonth(scope.date.getMonth());\r\n\r\n newTimeLog.StopTime_UTC.setYear(scope.date.getFullYear());\r\n newTimeLog.StopTime_UTC.setMonth(scope.date.getMonth());\r\n\r\n newTimeLog.StartTimeLogTypeId = 9;\r\n newTimeLog.StopTimeLogTypeId = 9;\r\n\r\n newTimeLog.Action = '';\r\n\r\n var modalInstance = $uibModal.open({\r\n backdrop: 'static',\r\n controller: 'AddTimeLogDetailController as vm',\r\n templateUrl: 'modules/patient/header/addTimeLog.modal.html',\r\n resolve: {\r\n timeLog: function () {\r\n return newTimeLog;\r\n },\r\n liPatient: function() {\r\n return scope.liPatient;\r\n },\r\n options: function() {\r\n return {};\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (timeLog) {\r\n timeLog.PatientId = scope.liPatient.id;\r\n\r\n TimeLogDetailService.addTimeLog(timeLog).then(function (data) {\r\n var date = new Date(Date.parse(data.StartTime_UTC));\r\n updateDate(date);\r\n });\r\n });\r\n }\r\n\r\n function showAddCPTCode() {\r\n // Let us do some caching\r\n if (scope.CPTCodes === undefined) {\r\n scope.CPTCodes = CurrentProceduralTerminologyCodesService.getCurrentProceduralTerminologyCodes().then(data => data.filter(code => code.IsEnabled));\r\n scope.CPTCodesList = scope.CPTCodes.then(data => data.map(item => item.Code));\r\n }\r\n\r\n var modalInstance = $uibModal.open({\r\n backdrop: 'static',\r\n controller: 'AddCPTCodeBillingController as vm',\r\n templateUrl: 'modules/patient/header/addcptcodebilling.modal.tpl.html',\r\n resolve: {\r\n liPatient: function() {\r\n return scope.liPatient;\r\n },\r\n billingCodes: function() {\r\n return scope.CPTCodesList;\r\n },\r\n codes: function() {\r\n return scope.CPTCodes;\r\n },\r\n dateFormat: function() {\r\n return ConfigurationsService.configParams.DateFormat;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (cptCodes) {\r\n if (cptCodes.length > 0) {\r\n AddCptCodeBillingService.addCptCodeBillings(cptCodes, scope.liPatient.id);\r\n }\r\n });\r\n }\r\n\r\n function updateDate(date) {\r\n var monthOffset = PatientTimeLogUtilitiesService.getMonthOffset(date);\r\n\r\n //if user is looking at the timelog refresh\r\n if($state.includes('patients.patient.time_log.detail')) {\r\n $state.go('patients.patient.time_log.detail', {\r\n patientId: scope.liPatient.id,\r\n monthOffset: monthOffset\r\n }, {reload: true});\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patient.header\").directive(\"patientHeader\", PatientHeaderDirective);\r\n","function PatientHeaderService($http, lodash, moment, ConfigurationsService, AlertSeverityLevel, $rootScope) {\r\n function getPatientHeader(patientId) {\r\n return $http.get('/api/cgp/patient/' + patientId).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function MapPatient(patient) {\r\n \r\n return {\r\n id: patient.PatientId,\r\n invitationStatusId: patient.InvitationStatusId,\r\n monitoringStatusId: patient.MonitoringStatusId,\r\n mostRecentStatusChangeDtUTC: patient.MonitoringStatusChangeDate,\r\n mrnIdent: patient.MRNIdent,\r\n gender: patient.Gender,\r\n race: patient.Race,\r\n avatar: patient.Photo,\r\n riskId: patient.RiskId,\r\n dob: patient.DOB,\r\n createdDtUTC: patient.CreatedDtUTC,\r\n phone1: patient.Phone1,\r\n phone2: patient.Phone2,\r\n phone1Label: patient.Phone1Label,\r\n phone2Label: patient.Phone2Label,\r\n ivrPin: patient.IVRPin,\r\n byodPin: patient.BYODPin,\r\n serviceLevel: patient.ServiceLevelName,\r\n serviceLevelTypeId: patient.ServiceLevelTypeId,\r\n enableVideo: patient.EnableVideo,\r\n enableMessaging: patient.EnableMessaging,\r\n unreadMessageCount: patient.UnreadMessageCount,\r\n standardBias: patient.PatientTimeZoneBias,\r\n daylightSavingsBias: patient.PatientTimeZoneDaylightBias,\r\n isThirdPartyMonitored: patient.IsThirdPartyMonitored,\r\n note: patient.Note,\r\n isCcm: patient.IsCCM,\r\n isRpm: patient.IsRPM,\r\n isCpt: patient.IsCPT,\r\n reviewed: patient.Reviewed,\r\n populationGroup: patient.PopulationGroup,\r\n populationId: patient.PopulationId,\r\n population: patient.Population,\r\n kitNumber: patient.KitNo,\r\n kitStatusName: patient.KitStatusName,\r\n kitStatusId: patient.KitStatusId,\r\n kitStatusDays: patient.KitStatusDays,\r\n mostRecentRecord: patient.MostRecentRecord,\r\n isActivePatient: patient.IsActivePatient,\r\n patientTimeZoneName: patient.PatientTimeZoneName,\r\n callAlertSeverity: patient.CallAlertId !== null ? patient.HighestPhoneAlertSeverity : 3,\r\n callAlertId: patient.CallAlertId,\r\n callAlertDateTime: patient.CallAlertId !== null ? patient.CallAlertDateTime_UTC : undefined,\r\n name: mapName(patient),\r\n age: mapAge(patient.Age),\r\n timeLog: mapTimeLog(patient),\r\n lastScore: mapLastScore(patient),\r\n healthScores: mapScores(patient),\r\n program: mapProgramData(patient),\r\n hasSurveysDue: (patient.SurveyCount - patient.CompletedSurveyCount) > 0,\r\n notification: mapNotification(mapListItemDataPoint(patient, \"Notification\", function(o) { return o.LastNotificationMessage })),\r\n general: mapListItemDataPoint(patient, \"General\", function (o) {return o.GeneralAlertMessage;}, \"GeneralAlertDateTime_UTC\"),\r\n specialHandlings: lodash.map(patient.SpecialHandlings, mapSpecialHandlings),\r\n isClinicalTimeMeasured: lodash.any(patient.CareManagementTypes, 'IsClinicalTimeMeasured'),\r\n careManagementList: lodash.map(patient.CareManagementTypes, 'Acronym').join(','),\r\n careManagementTypes: patient.CareManagementTypes,\r\n provider: mapProvider(patient.Provider),\r\n hoursNotResponsive: patient.HoursNotResponsive,\r\n patientIdent: patient.PatientIdent,\r\n HasPatientPassword: patient.HasPatientPassword,\r\n isOptedIn: patient.IsOptedIn,\r\n goPlatformId: patient.GoPlatformId,\r\n virtualvisit: patient.virtualvisit,\r\n remoteNotificationsEnabled: patient.RemoteNotificationsEnabled,\r\n biometrics: patient.Biometrics,\r\n mappedBiometrics: lodash.uniq(patient.Biometrics, 'TypeName'),\r\n survey: mapListItemDataPoint(patient, \"Survey\", function (o) {\r\n return { completedSurveys: o.CompletedSurveyCount, availableSurveys: o.SurveyCount};\r\n }, \"PatientSurveyCompletedOn_UTC\"),\r\n weight: mapListItemDataPoint(patient, \"Weight\", function (o) {\r\n if (o.LastWeight) {\r\n return {\r\n pounds: o.LastWeight.Pounds,\r\n kilograms: o.LastWeight.Kilograms,\r\n defaultUnit: o.LastWeightUnit\r\n };\r\n }\r\n }, \"LastWeightScaleDateTime_UTC\"),\r\n bp: mapListItemDataPoint(patient, \"BloodPressure\", function (o) {\r\n if (o.LastSystolic) {\r\n return {\r\n systolic: o.LastSystolic,\r\n diastolic: o.LastDiastolic\r\n };\r\n }\r\n }),\r\n pulse: mapListItemDataPoint(patient, \"Pulse\"),\r\n oxygen: mapListItemDataPoint(patient, \"Oxygen\"),\r\n steps: mapListItemDataPoint(patient, \"Steps\", function(o) {\r\n if(o.LastSteps) {\r\n return {\r\n steps: o.LastSteps\r\n }\r\n }\r\n }),\r\n glucose: mapListItemDataPoint(patient, \"BloodSugar\", function(o){\r\n if(o.LastBloodSugar){\r\n return {\r\n milligramsPerDeciliter: o.LastBloodSugar.MilligramsPerDeciliter,\r\n millimolsPerLiter: o.LastBloodSugar.MillimolsPerLiter,\r\n defaultUnit: o.LastBloodSugarUnit\r\n }\r\n }\r\n }),\r\n control: mapListItemDataPoint(patient, \"Control\", function(o) {\r\n if(o.LastControl) {\r\n return {\r\n control: o.LastControl\r\n }\r\n }\r\n }),\r\n rescue: mapListItemDataPoint(patient, \"Rescue\", function(o) {\r\n if(o.LastRescue) {\r\n return {\r\n rescue: o.LastRescue\r\n }\r\n }\r\n }),\r\n temperature: mapListItemDataPoint(patient, \"Temperature\", function (o) {\r\n if (o.LastTemperature) {\r\n return {\r\n celsius: o.LastTemperature.Celsius,\r\n fahrenheit: o.LastTemperature.Fahrenheit\r\n };\r\n }\r\n }),\r\n sleep: mapListItemDataPoint(patient, \"Sleep\", function(o){\r\n if(o.LastHour) {\r\n return {\r\n Hour: o.LastHour,\r\n Min: o.LastMin\r\n };\r\n }\r\n }),\r\n spirometer: mapListItemDataPoint(patient, \"Spirometer\", function (o) {\r\n if (o.LastPEF) {\r\n return {\r\n pef: o.LastPEF,\r\n fevOne: o.LastFEVOne,\r\n fevRatio: o.LastFEVRatio\r\n };\r\n }\r\n }),\r\n RemoteNotificationsEnabled: patient.RemoteNotificationsEnabled\r\n };\r\n }\r\n\r\n function mapProvider(provider) {\r\n if (provider) {\r\n return {\r\n name: provider.Provider.FirstName,\r\n phone: provider.Provider.PhoneNumber1\r\n };\r\n }\r\n }\r\n\r\n function mapSpecialHandlings(specialHandling) {\r\n return {\r\n color: specialHandling.Color,\r\n name: specialHandling.Name,\r\n icon: specialHandling.Icon\r\n };\r\n }\r\n\r\n function mapNotification(notification) {\r\n if (notification.lastReading) {\r\n notification.lastReading.alertSeverity = AlertSeverityLevel.Notification;\r\n }\r\n return notification;\r\n }\r\n\r\n function mapListItemDataPoint(patient, dataName, valueMapper, dateKey, activeKey) {\r\n var mapValue = valueMapper || mapBasicValue;\r\n var lastReading = null;\r\n var dateKeyValue = dateKey || \"Last\" + dataName + \"DateTime_UTC\";\r\n var lastReadingDate = patient[dateKeyValue];\r\n var lastValue = mapValue(patient, dataName);\r\n if (lastValue || lastReadingDate !== null) {\r\n lastReading = {\r\n date: lastReadingDate,\r\n value: lastValue,\r\n alertSeverity: patient[\"Highest\" + dataName + \"AlertSeverity\"],\r\n isSkipped: patient[\"IsLast\" + dataName + \"Skipped\"],\r\n units: patient.LastTemperatureSurveyParameterTypeId,\r\n latestAlertSeverity: patient[\"Latest\" + dataName + \"AlertSeverity\"],\r\n };\r\n }\r\n var baseline;\r\n if (patient.BaselineWeight && dataName == \"Weight\") {\r\n baseline = {\r\n pounds: patient.BaselineWeight.Pounds,\r\n kilograms: patient.BaselineWeight.Kilograms,\r\n defaultUnit: patient.BaselineWeightUnit\r\n };\r\n }\r\n return {\r\n active: activeKey ? patient[activeKey] : patient[\"Is\" + dataName + \"Active\"],\r\n lastReading: lastReading,\r\n baseline: baseline\r\n };\r\n }\r\n\r\n function mapBasicValue(patient, dataName) {\r\n return patient[\"Last\" + dataName];\r\n }\r\n\r\n function mapProgramData(patient) {\r\n return {\r\n monitoringStatusId: patient.MonitoringStatusId,\r\n isFinalState: patient.IsFinalState,\r\n completedDays: patient.ProgramDurationDays,\r\n durationDays: patient.ProgramDurationTotalDays,\r\n startDate: patient.ProgramStartDate,\r\n monitoringStatusChangeDate: patient.MonitoringStatusChangeDate,\r\n };\r\n }\r\n\r\n function mapLastScore(patient) {\r\n return {\r\n score: patient.Score,\r\n scoreDate: patient.ScoreDate,\r\n status: scoreStatus(patient),\r\n invalid: patient.IsInvalidScore,\r\n isToday: (patient.ScoreDate && moment(patient.ScoreDate).utc().isSame(moment.utc(), 'day'))\r\n };\r\n }\r\n\r\n function mapScores(patient) {\r\n return lodash.map(patient.RecentScores, function (s) {\r\n return {\r\n score: s.Score,\r\n status: scoreStatus(s),\r\n scoreDate: s.ScoreDate\r\n };\r\n });\r\n }\r\n\r\n function scoreStatus(score) {\r\n return (score.IsInvalidScore || (score.Score > 50 && score.Score <= 75))\r\n ? \"warning\"\r\n : (score.Score <= 50\r\n ? \"danger\"\r\n : ConfigurationsService.configParams.DisplayGreenBiometricIcons === true\r\n ? \"success\"\r\n : \"normal\");\r\n }\r\n\r\n function mapTimeLog(patient) {\r\n return {\r\n clinicalTimeSeconds: patient.TimeLogClinicalSeconds,\r\n totalTimeSeconds: patient.TimeLogTotalSeconds\r\n };\r\n }\r\n\r\n function mapAge(age) {\r\n if (age) {\r\n return {\r\n age: age.Value,\r\n units: age.Units\r\n };\r\n }\r\n }\r\n\r\n function mapName(patient) {\r\n return {\r\n firstName: patient.FirstName,\r\n lastName: patient.LastName\r\n };\r\n }\r\n\r\n function saveRisk(patientId, data) {\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/risk',\r\n method: 'PUT',\r\n data: data\r\n });\r\n }\r\n\r\n function getNotificationsEnabled(patientId) {\r\n return $http({\r\n url: '/api/patient/' + patientId + '/apppermission?permission=6',\r\n method: 'GET'\r\n });\r\n }\r\n\r\n function getMonitoringStatuses() {\r\n return $http({\r\n url: '/api/MonitoringStatus?enabledOnly=true',\r\n method: 'GET'\r\n });\r\n }\r\n\r\n function saveMonitoringStatus(patientId, data) {\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/status',\r\n method: 'POST',\r\n data: data\r\n }).then(function (response) {\r\n $rootScope.$emit(\"vh:patientUpdated\");\r\n $rootScope.$emit('vh:monitoringStatusChange', data.Statusid);\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveGeneralAlert(patientId, alert) {\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/Alert',\r\n method: 'POST',\r\n data: alert\r\n });\r\n }\r\n\r\n function sendPathwayStartMessage(patientId) {\r\n return $http({\r\n url: '/api/SMS/SendCareplanStartMessage/' + patientId,\r\n method: 'POST'\r\n });\r\n }\r\n\r\n function createNewEncounter(patientId) {\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/Encounter/create',\r\n method: 'POST'\r\n });\r\n }\r\n\r\n function saveScheduleVirtualVisit(patientId, visit) {\r\n return $http({\r\n url: '/api/VirtualVisit/' + patientId,\r\n method: 'POST',\r\n data: visit\r\n });\r\n }\r\n\r\n return {\r\n getPatientHeader: getPatientHeader,\r\n mapPatient: MapPatient,\r\n saveRisk: saveRisk,\r\n getMonitoringStatuses: getMonitoringStatuses,\r\n saveMonitoringStatus: saveMonitoringStatus,\r\n saveGeneralAlert: saveGeneralAlert,\r\n sendPathwayStartMessage: sendPathwayStartMessage,\r\n createNewEncounter: createNewEncounter,\r\n getNotificationsEnabled: getNotificationsEnabled,\r\n saveScheduleVirtualVisit: saveScheduleVirtualVisit\r\n };\r\n}\r\n\r\nangular.module('patient.header').service('PatientHeaderService', PatientHeaderService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/patientheader.tpl.html',\n '
          No Population Assigned
          {{::liPatient.populationGroup}} : {{::liPatient.population}}
          No Provider Assigned
          {{::liPatient.provider.name}}
          {{programStatusText}} 
          {{programDate | datetime : \"date\" : \"UTC\"}} 
          {{monitoringStatusChangeDate | datetime : \"date\"}} 
          ({{programDayText}} of {{programTotalDaysText}})
          0}\" uib-tooltip=\"{{liPatient.careManagementList}}\" tooltip-placement=\"left\" tooltip-popup-delay=\"500\">
          {{timeLog.hours}}
          {{timeLog.minutes}}
          Profile Monitoring Chart Pathways Parameters Health Summary Direct Entry Audit Notes Medications PMHx Forms History Time Log
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/risk.modal.html',\n '

          Risk Level Change

          Reason Required
          ');\n}]);\n}(window, document, window.angular));","function RiskModalController($uibModalInstance, patientId, originalRiskId, lodash, PatientHeaderService, liPatient) {\r\n var vm = this;\r\n vm.liPatient = liPatient;\r\n\r\n vm.riskLevels = [\r\n {Name: 'Unassigned', Id: 4},\r\n {Name: 'Low', Id: 1},\r\n {Name: 'Medium', Id: 2},\r\n {Name: 'High', Id: 3}\r\n ];\r\n\r\n vm.riskLevel = lodash(vm.riskLevels).find({Id: originalRiskId});\r\n\r\n vm.differentRiskSelected = function() {\r\n return vm.riskLevel.Id != originalRiskId;\r\n }\r\n\r\n vm.saveRisk = function() {\r\n var newRisk = {\r\n PatientId: patientId,\r\n RiskId: vm.riskLevel.Id,\r\n Reason: vm.reasonText\r\n };\r\n\r\n PatientHeaderService.saveRisk(patientId, newRisk);\r\n $uibModalInstance.close(vm.riskLevel.Id);\r\n }\r\n\r\n vm.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.header\").controller(\"RiskModalController\", RiskModalController);\r\n","function SchedulevirtualvisitController(patientAlertType, patientId, liPatient, $uibModalInstance, $rootScope, PatientHeaderService, AlertType, moment, liPatientkitNumber, $timeout) {\r\n var vm = this;\r\n vm.patientAlertType = patientAlertType;\r\n vm.icon = '';\r\n vm.title = 'Schedule Video Visit';\r\n vm.instructions = 'Enter Patient-Facing Notes Here';\r\n vm.alertMessage = '';\r\n vm.alertDelay = '0';\r\n vm.alertDate = new Date();\r\n var roundedUp = Math.ceil(moment().add(1, 'm').minute() / 15) * 15;\r\n vm.alertTime = moment().minute(roundedUp);\r\n vm.createTime = vm.alertTime;\r\n vm.dateOptions = { minDate: vm.alertDate };\r\n vm.liPatient = liPatient;\r\n vm.isValid = true;\r\n vm.kitNumber = (liPatientkitNumber == null || liPatientkitNumber == '') ? \"\" : liPatientkitNumber;\r\n vm.careMemberTimeZone = moment.tz(moment.tz.guess(true)).zoneAbbr();\r\n vm.careMemberTimeZoneText = \"Schedule At (In \" + vm.careMemberTimeZone + \"):\";\r\n\r\n $timeout(function () {\r\n var textInput = document.getElementById(\"txtComments\");\r\n if (textInput) {\r\n textInput.focus();\r\n }\r\n }, 100);\r\n\r\n vm.saveScheduleVirtualVisit = function() {\r\n var alertDateTime = buildAlertDateTime();\r\n var now = moment().subtract(1, 'seconds');\r\n if (!alertDateTime.isValid() || !alertDateTime.isAfter(now)) {\r\n vm.isValid = false;\r\n return;\r\n }\r\n\r\n var visit = { \r\n Message: vm.alertMessage,\r\n ScheduleDateTime_UTC: moment.utc(alertDateTime).format()\r\n };\r\n\r\n PatientHeaderService.saveScheduleVirtualVisit(patientId, visit).then(function() {\r\n $rootScope.$emit(\"vh:patientUpdated\", patientId); \r\n });\r\n\r\n if (vm.kitNumber != null && vm.kitNumber.length > 0 && vm.alertDelay == '0') {\r\n $uibModalInstance.close(vm.alertDelay);\r\n }\r\n else {\r\n $uibModalInstance.close('close');\r\n }\r\n }\r\n\r\n vm.cancel = function () {\r\n vm.alertMessage = ' ';\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n\r\n vm.textRemainingClass = function() {\r\n return vm.alertMessage && vm.alertMessage.length >= 250 ? 'provisionFailedText' : 'provisionSuccessfulText';\r\n };\r\n\r\n vm.reset = function() {\r\n if(vm.alertTime === null || vm.alertDelay === \"Custom\") {\r\n vm.alertTime = vm.createTime;\r\n vm.isValid = true;\r\n }\r\n }\r\n\r\n function buildAlertDateTime() {\r\n if (vm.alertDelay === 'Custom') {\r\n var date = moment(vm.alertDate);\r\n var time = moment(vm.alertTime);\r\n return moment([date.year(), date.month(), date.date(), time.hour(), time.minute()]);\r\n }\r\n\r\n // delay n hours from now\r\n var delay = parseInt(vm.alertDelay);\r\n return moment().add(delay, 'minutes');\r\n }\r\n}\r\n\r\n\r\nangular.module(\"patient.header\").controller(\"SchedulevirtualvisitController\", SchedulevirtualvisitController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/header/schedulevirtualvisit.modal.html',\n '

          {{vm.title}}

          0)\">
          {{300 - vm.alertMessage.length}} of 300 characters remaining
          Enter a valid date/time
          ');\n}]);\n}(window, document, window.angular));","function VideoCallService($http, $window) {\r\n\r\n function requestCall(patientId) {\r\n return $http.get(\"/api/videocall/requestcall?id=\" + patientId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function cancelCall(meetingId) {\r\n return $http.get(\"/api/videocall/cancel?id=\" + meetingId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getCallStatus(meetingId) {\r\n return $http.get(\"/api/videocall/status?id=\" + meetingId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getMeetingInfo(meetingId) {\r\n return $http.get(\"/api/videocall/meeting?id=\" + meetingId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getConfig() {\r\n return $http.get(\"/api/videocall/config\").then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getInTouchCaregiverMeetingUrl(meetingId, patientId) {\r\n return $http.get(\"/api/videocall/InTouchCaregiverMeetingUrl?meetingId=\" + meetingId + \"&patientId=\" + patientId ).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPermissionStatus(patientId) {\r\n return $http.get(\"/api/Patient/\" + patientId + \"/apppermission?permission=6\").then(function(res){\r\n return res.data;\r\n });\r\n }\r\n\r\n function joinVideoVisit(patientId,visitid) {\r\n return $http.get(\"/api/videocall/JoinVideoVisit?patientId=\" + patientId + \"&virtualVisitId=\" + visitid).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getCallStatus: getCallStatus,\r\n getMeetingInfo: getMeetingInfo,\r\n requestCall: requestCall,\r\n endCall: cancelCall,\r\n getConfig: getConfig,\r\n getInTouchCaregiverMeetingUrl: getInTouchCaregiverMeetingUrl,\r\n getPermissionStatus: getPermissionStatus,\r\n joinVideoVisit: joinVideoVisit\r\n };\r\n }\r\n\r\n angular.module(\"patient\").factory(\"VideoCallService\", VideoCallService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/healthsummary/healthsummary.tpl.html',\n '
          Patient Health Summary
          ');\n}]);\n}(window, document, window.angular));","function assignCaregiversAction() {\r\n return {\r\n restrict: 'E',\r\n templateUrl: 'modules/patient/list/actions/assignCaregiverAction.tpl.html',\r\n scope: {\r\n patientSet: '=',\r\n onAction: '&'\r\n },\r\n controllerAs: 'vm',\r\n bindToController: true,\r\n controller: function($scope, $rootScope, PatientDemographicsCaregiversService, AuthorizationService) {\r\n var vm = this;\r\n vm.caregivers = [];\r\n vm.selectedCaregivers = [];\r\n vm.isUpdating = false;\r\n\r\n PatientDemographicsCaregiversService.getCaregivers().then(function(response) {\r\n vm.caregivers = response;\r\n vm.caregivers.sort((a, b) => a.DisplayName > b.DisplayName ? 1 : -1);\r\n\r\n const currentUser = AuthorizationService.getCaregiver();\r\n let index = vm.caregivers.findIndex(c => c.Id === currentUser.Id);\r\n if (index >= 0) {\r\n let user = vm.caregivers.splice(index, 1);\r\n vm.caregivers.unshift(user[0]);\r\n }\r\n });\r\n\r\n vm.apply = function() {\r\n vm.isUpdating = true;\r\n const patientList = Array.from(vm.patientSet);\r\n const caregiverList = vm.selectedCaregivers.map(c => c.Id);\r\n\r\n PatientDemographicsCaregiversService.assignPatientCaregivers(patientList, caregiverList).then(function(result) {\r\n vm.isUpdating = false;\r\n\r\n let unchangedCount = patientList.length - result.UpdatedPatients.length;\r\n if (unchangedCount > 0) {\r\n let toast = { text: `${unchangedCount} patient(s) that were not updated will remain selected.` };\r\n $rootScope.$emit('vh:notify', toast);\r\n\r\n //deselect only the updated patients\r\n for (const patientId of result.UpdatedPatients) {\r\n vm.patientSet.delete(patientId);\r\n }\r\n }\r\n\r\n for (const notification of result.Notifications) {\r\n let toast = { text: notification, type: 'warning' };\r\n $rootScope.$emit('vh:notify', toast);\r\n }\r\n\r\n if (result.UpdatedPatients.length > 0) {\r\n let toast = {\r\n text: `${result.UpdatedPatients.length} patient(s) now have the selected Care Team Member(s) assigned.`,\r\n type: 'success',\r\n duration: 5000\r\n };\r\n $rootScope.$emit('vh:notify', toast);\r\n }\r\n\r\n if (vm.onAction) {\r\n vm.onAction({\r\n $event: {\r\n success: unchangedCount == 0\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"patients.list\").directive(\"assignCaregiversAction\", assignCaregiversAction);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/list/actions/assignCaregiverAction.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","function removeCaregiversAction() {\r\n return {\r\n restrict: 'E',\r\n templateUrl: 'modules/patient/list/actions/removeCaregiversAction.tpl.html',\r\n scope: {\r\n patientSet: '=',\r\n onAction: '&'\r\n },\r\n controllerAs: 'vm',\r\n bindToController: true,\r\n controller: function($scope, $rootScope, PatientDemographicsCaregiversService, AuthorizationService) {\r\n var vm = this;\r\n vm.caregivers = [];\r\n vm.selectedCaregivers = [];\r\n vm.isUpdating = false;\r\n\r\n PatientDemographicsCaregiversService.getCaregivers().then(function(response) {\r\n vm.caregivers = response;\r\n vm.caregivers.sort((a, b) => a.DisplayName > b.DisplayName ? 1 : -1);\r\n\r\n const currentUser = AuthorizationService.getCaregiver();\r\n let index = vm.caregivers.findIndex(c => c.Id === currentUser.Id);\r\n if (index >= 0) {\r\n let user = vm.caregivers.splice(index, 1);\r\n vm.caregivers.unshift(user[0]);\r\n }\r\n });\r\n\r\n vm.apply = function() {\r\n vm.isUpdating = true;\r\n const patientList = Array.from(vm.patientSet);\r\n const caregiverList = vm.selectedCaregivers.map(c => c.Id);\r\n\r\n return PatientDemographicsCaregiversService.removePatientCaregivers(patientList, caregiverList).then(function(result) {\r\n vm.isUpdating = false;\r\n\r\n let unchangedCount = patientList.length - result.UpdatedPatients.length;\r\n if (unchangedCount > 0) {\r\n let toast = { text: `${unchangedCount} patient(s) that were not updated will remain selected.` };\r\n $rootScope.$emit('vh:notify', toast);\r\n\r\n //deselect only the updated patients\r\n for (const patientId of result.UpdatedPatients) {\r\n vm.patientSet.delete(patientId);\r\n }\r\n }\r\n\r\n for (const notification of result.Notifications) {\r\n let toast = { text: notification, type: 'warning' };\r\n $rootScope.$emit('vh:notify', toast);\r\n }\r\n\r\n let toast = {\r\n text: `${result.UpdatedPatients.length} patient(s) updated successfully.`,\r\n type: result.UpdatedPatients.length > 0 ? 'success' : 'warning',\r\n duration: 5000\r\n };\r\n $rootScope.$emit('vh:notify', toast);\r\n\r\n if (vm.onAction) {\r\n vm.onAction({\r\n $event: {\r\n success: unchangedCount == 0\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"patients.list\").directive(\"removeCaregiversAction\", removeCaregiversAction);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/list/actions/removeCaregiversAction.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","function PatientListFiltersDirective(PatientListService, AuthorizationService, lodash, $timeout, ConfigurationsService, AlertFilter, PatientListSortBy) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/patient/list/filters/patientlistfilters.tpl.html\",\r\n scope: {\r\n lists: \"=\",\r\n filtersChanged: \"&\",\r\n filters: \"=\",\r\n canSeeAll: \"=\",\r\n isTimeLogEnabled: \"=\",\r\n defaultCaregiverId: \"=\"\r\n },\r\n link: function(scope, elem, attrs) {\r\n\r\n scope.activeSearch = false;\r\n scope.loggedInCaregiver = AuthorizationService.getCaregiver();\r\n scope.filters.Caregivers = scope.filters.Caregivers || [];\r\n scope.filters.Hospitals = scope.filters.Hospitals || [];\r\n\r\n scope.apply = apply;\r\n scope.alertChanged = alertChanged;\r\n scope.cancelSearch = cancelSearch;\r\n scope.isClinicalChanged = isClinicalChanged;\r\n scope.clearAll = clearAll;\r\n scope.saveFilters = saveFilters;\r\n scope.updateCaregiverIds = updateCaregiverIds;\r\n scope.caregiverSelect = caregiverSelect;\r\n scope.updateHospitalIds = updateHospitalIds;\r\n scope.hospitalSelect = hospitalSelect;\r\n scope.setFocus = setFocus;\r\n scope.Caregivers = [];\r\n\r\n activate();\r\n\r\n function activate() {\r\n\r\n //Remove status where IsMonitoring is false (invited, deleted)\r\n lodash.remove(scope.lists.MonitoringStatuses, function(n) {\r\n if (n.Status === 'Invited' && (ConfigurationsService.configParams.EnableWebRpm || false)) {\r\n return false; \r\n }\r\n\r\n return !n.IsMonitoring && n.Id > 0; //0 is All Statuses\r\n });\r\n\r\n //Add non-final status to monitoring statuses if configuration is set to true\r\n if (ConfigurationsService.configParams.NonFinalStatusFilterEnabled === true) {\r\n scope.lists.MonitoringStatuses.splice(6, 0, { Id: -1, Status: \"Non Final Status\" });\r\n }\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n scope.settings = {\r\n PatientMessagingEnabled: data[\"PatientMessagingEnabled\"],\r\n CallToEnabled: data[\"CallToEnabled\"]\r\n };\r\n });\r\n \r\n //set text to My Patients\r\n if(scope.canSeeAll) {\r\n\r\n scope.Caregivers = scope.lists.Caregivers;\r\n\r\n scope.Caregivers.filter(function(n) {\r\n return n.Id === scope.loggedInCaregiver.Id;\r\n }).map(function(caregiver) {\r\n caregiver.DisplayName = 'My Patients';\r\n caregiver.SortOrder = 2;\r\n });\r\n\r\n //you don't have any patients you need to be pushed into this list\r\n addToArray(scope.Caregivers, {\r\n Id: scope.loggedInCaregiver.Id,\r\n DisplayName: 'My Patients',\r\n SortOrder: 2\r\n });\r\n\r\n addToArray(scope.Caregivers, {Id: -1, DisplayName: 'All Patients', SortOrder: 1});\r\n\r\n } else {\r\n\r\n addToArray(scope.Caregivers, {Id: scope.loggedInCaregiver.Id, DisplayName: 'My Patients'});\r\n }\r\n\r\n initFilters();\r\n changeSortDropdown();\r\n }\r\n\r\n function initFilters() {\r\n for(var i = 0; i < scope.filters.ViewAll.length; i ++) {\r\n var caregiver = lodash.find(scope.Caregivers, {Id: scope.filters.ViewAll[i]});\r\n if(caregiver !== undefined) {\r\n addToArray(scope.filters.Caregivers, caregiver);\r\n }\r\n }\r\n //if you can see all and\r\n if(scope.canSeeAll && (scope.filters.ViewAll.length === 0 || scope.filters.ViewAll[0] === -1)) {\r\n var allCaregiver = lodash.find(scope.Caregivers, {Id: -1});\r\n if(allCaregiver !== undefined) {\r\n addToArray(scope.filters.Caregivers, allCaregiver);\r\n }\r\n }\r\n\r\n for(var i = 0; i < scope.filters.HospitalId.length; i ++) {\r\n var hospital = lodash.find(scope.lists.Hospitals, {Id: scope.filters.HospitalId[i]});\r\n if(hospital !== undefined) {\r\n if(lodash.findIndex(scope.filters.Hospitals, {Id: hospital.Id}) === -1) {\r\n scope.filters.Hospitals.push(hospital);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function addToArray(arr, obj) {\r\n var idx = lodash.findIndex(arr, {Id: obj.Id});\r\n if(idx === -1) {\r\n arr.push(obj);\r\n }\r\n }\r\n\r\n function apply() {\r\n $timeout(function(){\r\n addDefaultCaregiver();\r\n addDefaultHospital();\r\n scope.filters.searchText = \"\";\r\n scope.filtersChanged({filters: scope.filters});\r\n scope.$broadcast('multiSelect.refresh');\r\n });\r\n }\r\n\r\n function alertChanged() {\r\n if (scope.filters.Alerts === AlertFilter.AlertsOnly) {\r\n scope.filters.SortBy = PatientListSortBy.AlertPriority;\r\n } else if (scope.filters.Alerts === AlertFilter.NonResponders) {\r\n scope.filters.SortBy = PatientListSortBy.NonResponderSinceDateTime;\r\n } else if (scope.filters.Alerts === AlertFilter.NotificationsOnly) {\r\n scope.filters.SortBy = PatientListSortBy.PatientName;\r\n } else if (scope.filters.Alerts === AlertFilter.CallRequests) {\r\n scope.filters.SortBy = PatientListSortBy.CallRequestSeverityDescending;\r\n } else {\r\n scope.filters.SortBy = PatientListSortBy.PatientName;\r\n }\r\n }\r\n\r\n function cancelSearch() {\r\n scope.activeSearch = false;\r\n scope.filters.searchText = \"\";\r\n scope.apply();\r\n }\r\n\r\n function isClinicalChanged() {\r\n changeSortDropdown();\r\n }\r\n\r\n function clearAll() {\r\n scope.filters.PopulationGroupId = 0;\r\n scope.filters.MonitoringStatusId = 0;\r\n scope.filters.Alerts = -1;\r\n scope.filters.PopulationId = 0;\r\n scope.filters.ProgramDurationId = 0;\r\n scope.filters.RiskId = 0;\r\n scope.filters.ProviderGroupId = 0;\r\n scope.filters.HospitalId = [];\r\n scope.filters.Hospitals = [];\r\n scope.filters.PayerId = 0;\r\n scope.filters.ServiceLevelTypeId = 0;\r\n scope.filters.Caregivers = [];\r\n scope.filters.KitStatusId = 0;\r\n scope.filters.patientIds = null;\r\n scope.BIClickData = null;\r\n scope.filters.GoPlatformId = -1;\r\n scope.filters.VirtualVisits = -1;\r\n apply();\r\n }\r\n\r\n function saveFilters() {\r\n PatientListService.saveFiltersToDatabase(scope.filters);\r\n }\r\n\r\n function updateCaregiverIds() {\r\n scope.filters.ViewAll = lodash.pluck(scope.filters.Caregivers, 'Id');\r\n }\r\n\r\n function caregiverSelect(item, select) {\r\n if(item.Id === scope.defaultCaregiverId) {\r\n scope.filters.Caregivers = [];\r\n var caregiver = lodash.find(scope.Caregivers, {Id: scope.defaultCaregiverId});\r\n if(caregiver !== undefined) {\r\n scope.filters.Caregivers.push(caregiver);\r\n }\r\n } else {\r\n var idx = lodash.findIndex(scope.filters.Caregivers, {Id: scope.defaultCaregiverId});\r\n if(idx > -1) {\r\n scope.filters.Caregivers.splice(idx, 1);\r\n }\r\n }\r\n\r\n addDefaultCaregiver();\r\n updateCaregiverIds();\r\n scope.$broadcast('multiSelect.refresh');\r\n }\r\n\r\n function addDefaultCaregiver() {\r\n scope.filters.Caregivers = scope.filters.Caregivers || [];\r\n if(!scope.filters.Caregivers.length) {\r\n var caregiver = lodash.find(scope.Caregivers, {Id: scope.defaultCaregiverId});\r\n if(caregiver !== undefined) {\r\n scope.filters.Caregivers.push(caregiver);\r\n updateCaregiverIds();\r\n }\r\n }\r\n }\r\n\r\n function updateHospitalIds() {\r\n scope.filters.HospitalId = lodash.pluck(scope.filters.Hospitals, 'Id');\r\n }\r\n\r\n function addDefaultHospital() {\r\n scope.filters.Hospitals = scope.filters.Hospitals || [];\r\n if(!scope.filters.Hospitals.length) {\r\n var hospital = lodash.find(scope.lists.Hospitals, {Id: 0});\r\n if(hospital !== undefined) {\r\n scope.filters.Hospitals.push(hospital);\r\n updateHospitalIds();\r\n }\r\n }\r\n }\r\n\r\n function hospitalSelect(item, select) {\r\n if(item.Id === 0) {\r\n //if 0 empty list and add \"All\"\r\n scope.filters.Hospitals = [];\r\n var hospital = lodash.find(scope.lists.Hospitals, {Id: 0});\r\n if(hospital !== undefined) {\r\n scope.filters.Hospitals.push(hospital);\r\n }\r\n } else {\r\n // else remove \"All\"\r\n var idx = lodash.findIndex(scope.filters.Hospitals, {Id: 0});\r\n if(idx > -1) {\r\n scope.filters.Hospitals.splice(idx, 1);\r\n }\r\n\r\n }\r\n\r\n updateHospitalIds();\r\n addDefaultHospital();\r\n scope.$broadcast('multiSelect.refresh');\r\n\r\n }\r\n\r\n function setFocus(eventName, event) {\r\n event.preventDefault();\r\n scope.$broadcast(eventName);\r\n }\r\n\r\n function changeSortDropdown() {\r\n scope.sortings = [\r\n {id: 1, name: \"Alert Priority\"},\r\n {id: 2, name: \"Patient Name\"},\r\n {id: 7, name: \"Days Non Responding\"},\r\n {id: 8, name: \"Days in Status Ascending\"},\r\n {id: 9, name: \"Days in Status Descending\"}\r\n ];\r\n if (scope.isTimeLogEnabled) {\r\n var timelogSorting = [\r\n {id: 3, name: \"Time Accumulated Ascending\"},\r\n {id: 4, name: \"Time Accumulated Descending\"}\r\n ];\r\n if (scope.filters.ClinicalTimeOnly) {\r\n timelogSorting = [\r\n {id: 5, name: \"Time Accumulated Ascending\"},\r\n {id: 6, name: \"Time Accumulated Descending\"}\r\n ];\r\n if (scope.filters.SortBy < 5 && scope.filters.SortBy > 2) {\r\n scope.filters.SortBy += 2;\r\n }\r\n } else if (scope.filters.SortBy > 4 && scope.filters.SortBy < 7) {\r\n scope.filters.SortBy -= 2;\r\n } else {\r\n // Removing setting sortby = 2 because it is breaking returing to screen\r\n //scope.filters.sortBy = 2; //default to name\r\n }\r\n scope.sortings = scope.sortings.concat(timelogSorting);\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"patients.list\").directive(\"patientListFilters\", PatientListFiltersDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/list/filters/patientlistfilters.tpl.html',\n '
          Filter By:
          {{$item.DisplayName}}{{caregiver.DisplayName}}
          {{$item.FacilityName}}{{hospital.FacilityName}}
          Sort By:
          Select active filters and apply to filter the patients.
          ');\n}]);\n}(window, document, window.angular));","function patientListUiSelect($timeout) {\r\n return {\r\n require: 'uiSelect',\r\n link: function(scope, element, attrs, $select) {\r\n scope.$on('multiSelect.refresh', function(){\r\n $timeout(function(){\r\n $select.refreshItems();\r\n });\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"patients.list\").directive(\"patientListUiSelect\", patientListUiSelect);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/list/patient-search-keywords.tpl.html',\n '
          • Age (number)
          • Date of Birth / DOB
          • CPCompleted (date)
          • Email
          • Kit (number)
          • Kit Assigned (date)
          • Name
          • Patient Created (date)
          • Phone
          • Phone Number
          • Special Handling
          • Status
          • Time Zone

          Search supports the following operators: =, >, <, !, &, and |. Date fields also support relative date keywords: Today, Tomorrow, Yesterday, This Week, Last Week, This Month, Last Month, This Year, Last Year.

          ');\n}]);\n}(window, document, window.angular));","function PatientListController($scope, patientListContent, PatientListService, PatientHeaderService, lodash, SmoothScroll, PermissionService, AuthorizationService, $timeout, $rootScope, vhSweetAlert, Pluralize, ConfigurationsService, stateParams, AlertFilter, PatientListSortBy, LocalStorageService, webformfields) {\r\n var plvm = this;\r\n plvm.patientHeaderConfigurations = patientListContent.PatientHeaderConfigurations;\r\n plvm.showSpirometer = patientListContent.IsSpirometerEnabled;\r\n plvm.isTimeLogEnabled = patientListContent.IsTimeLogEnabled;\r\n plvm.isPatientDataTransferEnabled = patientListContent.IsPatientDataTransferEnabled;\r\n plvm.tempUnits = patientListContent.DefaultTemperatureUnit;\r\n plvm.displayBothTempUnits = patientListContent.ShowBothTemperatureUnits;\r\n plvm.multiSpecialHandlingColor = patientListContent.MultipleSpecialHandlingColor;\r\n plvm.displayBothWeight = patientListContent.ShowBothWeightUnits;\r\n plvm.patients = [];\r\n plvm.pages = [];\r\n plvm.alerts = [];\r\n plvm.pageLengths = patientListContent.DefaultPageLengths;\r\n plvm.pageLength = plvm.pageLengths[0];\r\n plvm.pageNumber = 1;\r\n plvm.totalPatients = 0;\r\n plvm.pageChanged = pageChanged;\r\n plvm.limit = 8;\r\n plvm.refresh = refresh;\r\n plvm.searchKeywords = searchKeywords;\r\n\r\n plvm.configItems = patientListContent;\r\n plvm.filtersChanged = filtersChanged;\r\n plvm.toggleFilters = toggleFilters;\r\n plvm.toggleSearch = toggleSearch;\r\n plvm.toggleSelect = toggleSelect;\r\n plvm.toggleSelectPatient = toggleSelectPatient;\r\n plvm.selectAll = selectAll;\r\n plvm.toggleActiveFilters = toggleActiveFilters;\r\n plvm.isPatientSelected = isPatientSelected;\r\n plvm.actionSelected = actionSelected;\r\n plvm.actionCompleted = actionCompleted;\r\n plvm.search = search;\r\n plvm.searchTextKeypressed = searchTextKeypressed;\r\n plvm.cancelSearch = cancelSearch;\r\n plvm.clearSearch = clearSearch;\r\n plvm.removeFilter = removeFilter;\r\n plvm.filters = patientListContent.CaregiverFilters;\r\n plvm.mainDisplay = \"Patients\";\r\n plvm.filters.searchText = \"\";\r\n plvm.filters.numActiveFilters = \"\";\r\n plvm.filters.activeFilters = [];\r\n plvm.filters.isCollapsed = false;\r\n plvm.filters.patientIds = null;\r\n plvm.filters.VirtualVisits = -1;\r\n plvm.selectedPatients = new Set();\r\n plvm.BIClickData = null;\r\n plvm.showFilters = false;\r\n plvm.showActiveFilters = false;\r\n plvm.showSearch = false;\r\n plvm.showSelection = false;\r\n plvm.activeSearch = false;\r\n plvm.triggerSearchFocus = false;\r\n plvm.canSeeAllPatients = PermissionService.userHasPermission([\"PatientsReadAll\"]);\r\n plvm.canSelectPatients = hasSelectPermissions();\r\n plvm.caregiver = AuthorizationService.getCaregiver();\r\n plvm.defaultCaregiverId = plvm.canSeeAllPatients ? -1 : plvm.caregiver.Id;\r\n plvm.shouldShowAgreement = LocalStorageService.get(\"showAgreement\");\r\n plvm.webformfields = webformfields;\r\n var formfields = {\r\n Age: 'Age',\r\n DOB: 'Date of Birth',\r\n CPCompleted: 'CPCompleted',\r\n Email: 'Email',\r\n Kit: 'Kit',\r\n KitAssigned: 'Kit Assigned',\r\n Name: 'Name',\r\n PatientCreated: 'Patient Created',\r\n PhoneNumber: 'Phone Number',\r\n SpecialHandling: 'Special Handling',\r\n Status: 'Status',\r\n CustomField: 'Study',\r\n TimeZone: 'Time Zone'\r\n };\r\n\r\n for (let field of plvm.webformfields) {\r\n if (formfields.hasOwnProperty(field.FieldName)) {\r\n formfields[field.FieldName] = field.FieldLabel;\r\n }\r\n }\r\n \r\n plvm.showStickyPager = true;\r\n plvm.showBottomPager = false;\r\n\r\n plvm.SearchForExistingProfile = ConfigurationsService.configParams.SearchForExistingProfile != null ? ConfigurationsService.configParams.SearchForExistingProfile : true\r\n loadController();\r\n\r\n function loadController() {\r\n //If filters settings exist in session, then use those instead of saved filters\r\n var sessionFilters = PatientListService.getSessionFilters();\r\n if (sessionFilters) {\r\n plvm.filters = sessionFilters;\r\n checkForOldFilters()\r\n } else {\r\n //If no session filters are loaded, we're here for the first time\r\n //Check the alerts filter and auto-set the sort by. Then save to session filters\r\n if ((plvm.filters.Alerts === 1 || plvm.filters.Alerts === \"1\") && (!plvm.filters.SortBy || plvm.filters.SortBy <= 0)) {\r\n plvm.filters.SortBy = PatientListSortBy.AlertPriority;\r\n } else if (!plvm.filters.SortBy || plvm.filters.SortBy <= 0) {\r\n plvm.filters.SortBy = PatientListSortBy.PatientName;\r\n }\r\n if(!sessionFilters) {\r\n plvm.filters.GoPlatformId = -1;\r\n }\r\n checkForOldFilters()\r\n PatientListService.saveFiltersToSession(plvm.filters);\r\n }\r\n\r\n applyFilterParams();\r\n\r\n var state = window.history.state;\r\n if (state) {\r\n plvm.pageNumber = state.page;\r\n plvm.pageLength = state.pageLength;\r\n plvm.totalPatients = state.total;\r\n }\r\n\r\n var defaultCaregiverIdx = plvm.filters.ViewAll.indexOf(0);\r\n if (defaultCaregiverIdx > -1) {\r\n plvm.filters.ViewAll.splice(defaultCaregiverIdx, 1);\r\n plvm.filters.ViewAll.push(plvm.canSeeAllPatients ? -1 : AuthorizationService.getCaregiver().Id);\r\n }\r\n\r\n if (plvm.filters.searchText.length > 0) {\r\n plvm.activeSearch = true;\r\n plvm.showSearch = true;\r\n }\r\n\r\n //If saved filter is non-final status, but configuration setting is disabled, set status filter to all statuses\r\n if (plvm.filters.MonitoringStatusId === -1 && ConfigurationsService.configParams.NonFinalStatusFilterEnabled === false) {\r\n plvm.filters.MonitoringStatusId = 0;\r\n }\r\n\r\n // if selected hospital ids are not in hospital list set \r\n // selection to all hospitals\r\n \r\n plvm.filters.HospitalId = plvm && plvm.filters && plvm.filters.HospitalId ? plvm.filters.HospitalId\r\n .filter(h1 => plvm.configItems.Hospitals.find(h2 => h2.Id == h1)) : [];\r\n\r\n plvm.filters.Hospitals = plvm && plvm.filters && plvm.filters.Hospitals ? plvm.filters.Hospitals\r\n .filter(h1 => plvm.configItems.Hospitals.find(h2 => h2.Id == h1.Id)) : [];\r\n\r\n if(plvm.filters.HospitalId.length === 0){\r\n plvm.filters.HospitalId = [0];\r\n }\r\n \r\n updatePatientList(false);\r\n }\r\n\r\n function searchTextKeypressed(keyEvent) {\r\n \r\n if(keyEvent.which === 13) //Enter key pressed\r\n {\r\n plvm.search();\r\n }\r\n };\r\n\r\n plvm.filterSearch = function(text) {\r\n var matchingSearches = lodash(formfields)\r\n .filter(field => field.toUpperCase().indexOf(text.toUpperCase()) >= 0 || text == '.')\r\n .map(field => field + ' = ')\r\n .value(); \r\n\r\n return matchingSearches;\r\n }\r\n\r\n function checkForOldFilters() {\r\n if (!angular.isArray(plvm.filters.ViewAll)) {\r\n plvm.filters.ViewAll = [plvm.filters.ViewAll];\r\n }\r\n\r\n if (!angular.isArray(plvm.filters.HospitalId)) {\r\n plvm.filters.HospitalId = [plvm.filters.HospitalId];\r\n }\r\n }\r\n\r\n function applyFilterParams() {\r\n var filterBy = stateParams.filterBy;\r\n var value = stateParams.value;\r\n if (filterBy) {\r\n clearSubFilters();\r\n switch (filterBy) {\r\n case 'unreadMessages':\r\n plvm.filters.Alerts = AlertFilter.UnreadMessages;\r\n plvm.filters.ViewAll = [plvm.defaultCaregiverId];\r\n break;\r\n case 'callRequests':\r\n plvm.filters.Alerts = AlertFilter.CallRequests;\r\n plvm.filters.SortBy = PatientListSortBy.CallRequestSeverityDescending;\r\n plvm.filters.ViewAll = [plvm.defaultCaregiverId];\r\n break;\r\n case 'biClick':\r\n plvm.BIClickData = value;\r\n plvm.filters.Alerts = AlertFilter.AllPatients;\r\n plvm.filters.HospitalId = [0];\r\n plvm.filters.patientIds = plvm.BIClickData.patientIds;\r\n plvm.filters.ViewAll = [0];\r\n plvm.filters.SortBy = PatientListSortBy.PatientName;\r\n break;\r\n case 'virtualVisitInWaitingRoom':\r\n plvm.filters.VirtualVisits = 1; // In Waiting Room \r\n plvm.filters.ViewAll = [plvm.defaultCaregiverId];\r\n break;\r\n\r\n \r\n }\r\n }\r\n }\r\n\r\n function clearSubFilters() {\r\n plvm.filters.searchText = \"\";\r\n plvm.filters.MonitoringStatusId = 0;\r\n plvm.filters.PopulationGroupId = 0;\r\n plvm.filters.PopulationId = 0;\r\n plvm.filters.ProgramDurationId = 0;\r\n plvm.filters.RiskId = 0;\r\n plvm.filters.GoPlatformId = -1;\r\n plvm.filters.VirtualVisits = -1;\r\n plvm.filters.ProviderGroupId = 0;\r\n plvm.filters.PayerId = 0;\r\n plvm.filters.ServiceLevelTypeId = 0;\r\n plvm.filters.Caregivers = [];\r\n plvm.filters.KitStatusId = 0;\r\n // don't clear BIClickData since it was passed in\r\n }\r\n\r\n function searchKeywords() {\r\n vhSweetAlert({\r\n title: \"Search Keywords\",\r\n templateUrl: 'modules/patient/list/patient-search-keywords.tpl.html'\r\n });\r\n }\r\n\r\n function updatePatient(patientId) {\r\n var index = lodash.findIndex(plvm.patients, { id: patientId });\r\n if (index > -1) {\r\n PatientHeaderService.getPatientHeader(patientId).then(function(data) {\r\n return data.PatientHeader;\r\n }).then(PatientHeaderService.mapPatient).then(function(patient) {\r\n plvm.patients.splice(index, 1);\r\n $timeout(function() {\r\n plvm.patients.splice(index, 0, patient);\r\n });\r\n });\r\n }\r\n }\r\n\r\n if ($rootScope.patientUpdatedWatcher === undefined) {\r\n $rootScope.patientUpdatedWatcher = $rootScope.$on(\"vh:patientUpdated\", function(event, id) {\r\n updatePatient(id);\r\n });\r\n }\r\n\r\n function filtersChanged(filters) {\r\n PatientListService.saveFiltersToSession(filters);\r\n plvm.pageNumber = 1;\r\n window.history.replaceState(null, '');\r\n updatePatientList(false);\r\n plvm.showFilters = false;\r\n plvm.showActiveFilters = false;\r\n }\r\n\r\n function search() {\r\n plvm.activeSearch = true;\r\n filtersChanged(plvm.filters);\r\n }\r\n\r\n function cancelSearch() {\r\n plvm.filters.searchText = \"\";\r\n search();\r\n plvm.showSearch = false;\r\n plvm.activeSearch = false;\r\n }\r\n\r\n function clearSearch() {\r\n plvm.filters.searchText = \"\";\r\n search();\r\n plvm.activeSearch = false;\r\n }\r\n\r\n function clearSelections(keepSelected) {\r\n plvm.selectedPatients.clear();\r\n plvm.showSelection = !!keepSelected;\r\n plvm.selectedAction = null;\r\n }\r\n\r\n function pageChanged(ignoreSoftStop) {\r\n // By default ignoreSoftStop will be true if it is undefined or null, \r\n // so we will ignore the soft stop limit when changing pages, \r\n // but not when the refresh button is clicked.\r\n if (window.history) {\r\n window.history.replaceState({\r\n page: plvm.pageNumber,\r\n pageLength: plvm.pageLength,\r\n total: plvm.totalPatients\r\n }, '');\r\n }\r\n\r\n plvm.selectedPatients.clear();\r\n SmoothScroll.scrollToTop();\r\n updatePatientList(ignoreSoftStop);\r\n }\r\n\r\n function refresh() {\r\n plvm.pageNumber = 1;\r\n plvm.showFilters = false;\r\n plvm.showActiveFilters = false;\r\n clearSelections();\r\n pageChanged(false);\r\n }\r\n\r\n function removeHospitalFilter(filterName) {\r\n var hospital = lodash.find(plvm.filters.Hospitals, { FacilityName: filterName.displayText });\r\n if (hospital !== undefined) {\r\n lodash.remove(plvm.filters.Hospitals, { Id: hospital.Id });\r\n }\r\n var idx = plvm.filters.HospitalId.indexOf(hospital.Id);\r\n if (idx > -1) {\r\n plvm.filters.HospitalId.splice(idx, 1);\r\n }\r\n\r\n if (plvm.filters.HospitalId.length === 0) {\r\n plvm.filters.HospitalId.push(0);\r\n var defaultHospital = lodash.find(plvm.configItems.Hospitals, { Id: 0 });\r\n if (defaultHospital !== undefined) {\r\n plvm.filters.Hospitals.push(defaultHospital);\r\n }\r\n }\r\n }\r\n\r\n\r\n function addDefaultCaregiver() {\r\n if (plvm.filters.ViewAll.length === 0) {\r\n plvm.filters.ViewAll.push(plvm.defaultCaregiverId);\r\n var defaultCaregiver = lodash.find(plvm.configItems.Caregivers, { Id: plvm.defaultCaregiverId });\r\n if (defaultCaregiver !== undefined && lodash.findIndex(plvm.filters.Caregivers, { Id: plvm.defaultCaregiverId }) === -1) {\r\n plvm.filters.Caregivers.push(defaultCaregiver);\r\n }\r\n }\r\n }\r\n\r\n function removeCaregiverFilter(filterName) {\r\n var caregiver = lodash.find(plvm.filters.Caregivers, { DisplayName: filterName.displayText });\r\n if (caregiver !== undefined) {\r\n lodash.remove(plvm.filters.Caregivers, { Id: caregiver.Id });\r\n }\r\n var idx = plvm.filters.ViewAll.indexOf(caregiver.Id);\r\n if (idx > -1) {\r\n plvm.filters.ViewAll.splice(idx, 1);\r\n }\r\n\r\n addDefaultCaregiver();\r\n }\r\n\r\n function removeFilter(filterName) {\r\n $timeout(function() {\r\n if (filterName.filter === 'HospitalId') {\r\n removeHospitalFilter(filterName);\r\n $scope.$broadcast('multiSelect.refresh');\r\n } else if (filterName.filter === 'CaregiverId') {\r\n removeCaregiverFilter(filterName);\r\n $scope.$broadcast('multiSelect.refresh');\r\n } else {\r\n plvm.filters[filterName.filter] = 0;\r\n }\r\n\r\n filtersChanged(plvm.filters);\r\n });\r\n }\r\n\r\n function updatePatientList(ignoreSoftStop) {\r\n plvm.mainDisplay = \"Patients\";\r\n plvm.countDisplay = \"Loading...\";\r\n plvm.patients = [];\r\n plvm.filters.activeFilters = [];\r\n plvm.filters.IgnoreSoftStop = ignoreSoftStop;\r\n plvm.limit = 8;\r\n if (plvm.pageNumber == null)\r\n plvm.pageNumber = 1;\r\n if (plvm.filters.searchText.length > 0) {\r\n PatientListService.searchPatients(plvm.pageLength, plvm.pageNumber, plvm.filters.searchText, plvm.filters.SortBy, plvm.filters.IgnoreSoftStop)\r\n .then(checkResultStatus);\r\n } else {\r\n PatientListService.getPatientList(plvm.pageLength, plvm.pageNumber, plvm.filters.SortBy, plvm.filters)\r\n .then(checkResultStatus);\r\n }\r\n\r\n\r\n }\r\n\r\n function checkResultStatus(result) {\r\n switch(result.Status)\r\n {\r\n case PatientListService.resultStatusEnum.HardLimitReached:\r\n showHardLimitDialog(result);\r\n break;\r\n case PatientListService.resultStatusEnum.SoftLimitReached:\r\n showSoftLimitDialog(result);\r\n break;\r\n default:\r\n retrievePatientsComplete(result);\r\n }\r\n }\r\n\r\n function showHardLimitDialog(result) {\r\n var title = 'Please refine your patient list filters in order to continue.';\r\n var body = 'You are attempting to load ' + result.TotalPatients + ' patient records, which exceeds system limits.';\r\n\r\n vhSweetAlert.error(title, body).then(function (confirmed) {\r\n if (confirmed) {\r\n // Change filters\r\n // Set TotalPatients to 0 and call retrievePatientsComplete to clear the list and update the list header\r\n result.TotalPatients = 0;\r\n retrievePatientsComplete(result);\r\n //If filtering patients (not finding patients), show patient filters dialog.\r\n if (!plvm.filters.searchText) {\r\n plvm.toggleFilters();\r\n }\r\n }\r\n });\r\n }\r\n\r\n function showSoftLimitDialog(result) {\r\n var title = 'Do you want to refine your patient list filters?';\r\n var body = 'You are attempting to load ' + result.TotalPatients + ' patient records, which can cause slow load times.';\r\n var okButtonText = 'Yes';\r\n var cancelButtonText = 'No';\r\n\r\n vhSweetAlert.verify(title, body, okButtonText, cancelButtonText).then(function (confirmed) {\r\n if (confirmed) {\r\n // Change filters\r\n // Set TotalPatients to 0 and call retrievePatientsComplete to clear the list and update the list header\r\n result.TotalPatients = 0;\r\n retrievePatientsComplete(result);\r\n //If filtering patients (not finding patients), show patient filters dialog.\r\n if (!plvm.filters.searchText) {\r\n plvm.toggleFilters();\r\n }\r\n } else {\r\n // Use current filters\r\n // Load the PatientHeaders (patient details) and then update the patient list.\r\n updatePatientList(true);\r\n }\r\n });\r\n }\r\n\r\n function retrievePatientsComplete(result) {\r\n plvm.patients = lodash.map(result.PatientHeaders, PatientHeaderService.mapPatient);\r\n plvm.totalPatients = result.TotalPatients;\r\n plvm.mainDisplay = getMainDisplayText();\r\n plvm.countDisplay = getDisplayText();\r\n\r\n // publish current patient id list to header for easy navigation between patients.\r\n var patientList = {};\r\n patientList.patientIds = lodash.map(plvm.patients, 'id');\r\n // go get the current page of virtual visits\r\n PatientListService.getPatientsScheduleVirtualVisits(patientList.patientIds);\r\n patientList.totalPatients = result.TotalPatients;\r\n patientList.filters = plvm.filters;\r\n patientList.pageLength = plvm.pageLength;\r\n patientList.pageNumber = plvm.pageNumber;\r\n\r\n plvm.pages = [];\r\n\r\n for(var i = 1; i <= Math.ceil(plvm.totalPatients / plvm.pageLength); i++)\r\n plvm.pages.push({'value': i, 'text': 'Page ' + i});\r\n\r\n $rootScope.$emit(\"vh:patientListChanged\", patientList);\r\n }\r\n\r\n function getDisplayText() {\r\n //Viewing [start]-[end] of (your|all) [totalPatient] (|status) patients\r\n var startingPatient = (plvm.pageNumber - 1) * plvm.pageLength + 1;\r\n var text = \"Viewing \";\r\n if (plvm.totalPatients === 0) {\r\n text += \"0\";\r\n } else {\r\n text += startingPatient.toString();\r\n text += \"-\";\r\n text += startingPatient + plvm.patients.length - 1;\r\n }\r\n text += \" of \";\r\n\r\n text += plvm.totalPatients;\r\n if (plvm.filters.MonitoringStatusId > 0) {\r\n text += \" \";\r\n text += lodash.find(plvm.configItems.MonitoringStatuses, { Id: plvm.filters.MonitoringStatusId }).Status.toLowerCase();\r\n } else if (plvm.filters.MonitoringStatusId === -1) {\r\n text += \" Non Final Status\";\r\n }\r\n text += \" patient\";\r\n if (plvm.totalPatients !== 1) {\r\n text += \"s\";\r\n }\r\n\r\n // BI click takes precedence\r\n if (plvm.filters.patientIds && plvm.BIClickData) {\r\n var biClick = plvm.BIClickData;\r\n text += \": (\" + biClick.reportName.substring(biClick.reportName.lastIndexOf('\\\\') + 1) + \")\";\r\n if (biClick.cellText)\r\n text += \", (\" + biClick.cellText + \")\";\r\n if (biClick.chartLabelValue)\r\n text += \", (\" + biClick.chartLabelValue + \")\";\r\n if (biClick.chartSeriesValue)\r\n text += \", (\" + biClick.chartSeriesValue + \")\";\r\n }\r\n else if (plvm.filters.Alerts === AlertFilter.AlertsOnly) {\r\n text += \" with alerts\";\r\n } else if (plvm.filters.Alerts === AlertFilter.NotificationsOnly) {\r\n text += \" with notifications\";\r\n } else if (plvm.filters.Alerts === AlertFilter.CallRequests) {\r\n text += \" with call requests\";\r\n } else if (plvm.filters.Alerts === AlertFilter.NoAlerts) {\r\n text += \" without alerts\";\r\n } else if (plvm.filters.Alerts === AlertFilter.SurveyDueToday) {\r\n text += \" that have a pathway scheduled for today\";\r\n } else if (plvm.filters.Alerts === AlertFilter.UnreadMessages) {\r\n text += \" that have unread messages\";\r\n }\r\n\r\n if (plvm.filters.ViewAll.indexOf(-1) > -1 && plvm.filters.ViewAll.indexOf(AuthorizationService.getCaregiver().Id) > -1) {\r\n text += \" for \"\r\n for (var i = 0; i < plvm.filter.ViewAll.length; i++) {\r\n text += lodash.find(plvm.configItems.Caregivers, { Id: plvm.filter.ViewAll[i] }).DisplayName;\r\n if (i > plvm.filter.ViewAll.length) {\r\n text += \", \";\r\n }\r\n }\r\n }\r\n\r\n setFiltersText();\r\n\r\n return text;\r\n }\r\n\r\n function setFiltersText() {\r\n\r\n\r\n //Set plural values using Pluralize directive.\r\n var label = lodash.find(plvm.configItems.Populations, function(o) { return o.PopulationId == 0 })\r\n\r\n for (var i = 0; i < plvm.configItems.Populations.length; ++i) {\r\n if (plvm.configItems.Populations[i].PopulationId === 0) {\r\n plvm.configItems.Populations[i].PopulationName = Pluralize(label.PopulationName);\r\n break;\r\n }\r\n }\r\n\r\n label = lodash.find(plvm.configItems.ProgramDurations, function(o) { return o.ProgramDurationId == 0 });\r\n for (var i = 0; i < plvm.configItems.ProgramDurations.length; ++i) {\r\n if (plvm.configItems.ProgramDurations[i].ProgramDurationId === 0) {\r\n plvm.configItems.ProgramDurations[i].Name = Pluralize(label.Name);\r\n break;\r\n }\r\n }\r\n\r\n label = lodash.find(plvm.configItems.Hospitals, function(o) { return o.Id == 0 });\r\n for (var i = 0; i < plvm.configItems.Hospitals.length; ++i) {\r\n if (plvm.configItems.Hospitals[i].Id === 0) {\r\n plvm.configItems.Hospitals[i].FacilityName = Pluralize(label.FacilityName);\r\n break;\r\n }\r\n }\r\n\r\n //Next three values have the same format.\r\n var updateToPlural = function(array) {\r\n var label = lodash.find(array, function(o) { return o.Id == 0 });\r\n for (var i = 0; i < array.length; ++i) {\r\n if (array[i].Id === 0) {\r\n array[i].Name = Pluralize(label.Name);\r\n break;\r\n }\r\n }\r\n };\r\n updateToPlural(plvm.configItems.PopulationGroups);\r\n updateToPlural(plvm.configItems.ProviderGroups);\r\n updateToPlural(plvm.configItems.Payers);\r\n\r\n var filterChanged = false;\r\n var filterString = '';\r\n var filterCount = 0;\r\n plvm.filters.activeFilters = [];\r\n\r\n if (plvm.filters.PopulationGroupId !== 0) {\r\n var _populationGroup = lodash.find(plvm.configItems.PopulationGroups, function (o) { return o.Id == plvm.filters.PopulationGroupId });\r\n if (_populationGroup) {\r\n plvm.filters.activeFilters.push({ filter: \"PopulationGroupId\", displayText: _populationGroup.Name });\r\n filterCount++;\r\n } else {\r\n plvm.filters.PopulationGroupId = 0;\r\n filterChanged = true;\r\n }\r\n }\r\n\r\n if (plvm.filters.PopulationId !== 0) {\r\n var _populationId = lodash.find(plvm.configItems.Populations, function (o) { return o.PopulationId == plvm.filters.PopulationId });\r\n if (_populationId) {\r\n plvm.filters.activeFilters.push({ filter: \"PopulationId\", displayText: _populationId.PopulationName });\r\n filterCount++;\r\n } else {\r\n plvm.filters.PopulationId = 0;\r\n filterChanged = true;\r\n }\r\n }\r\n\r\n if (plvm.filters.ProgramDurationId !== 0) {\r\n var _programDurationId = lodash.find(plvm.configItems.ProgramDurations, function (o) { return o.ProgramDurationId == plvm.filters.ProgramDurationId });\r\n if (_programDurationId) {\r\n plvm.filters.activeFilters.push({ filter: \"ProgramDurationId\", displayText: _programDurationId.Name });\r\n filterCount++;\r\n } else {\r\n plvm.filters.ProgramDurationId = 0;\r\n filterChanged = true;\r\n }\r\n }\r\n\r\n if (plvm.filters.RiskId !== 0) {\r\n var riskDisplayText = \"\";\r\n if (plvm.filters.RiskId === 1) {\r\n riskDisplayText = \"Low\";\r\n } else if (plvm.filters.RiskId === 2) {\r\n riskDisplayText = \"Medium\";\r\n } else if (plvm.filters.RiskId === 3) {\r\n riskDisplayText = \"High\";\r\n } else if (plvm.filters.RiskId === 4) {\r\n riskDisplayText = \"Unassigned\";\r\n }\r\n plvm.filters.activeFilters.push({ filter: \"RiskId\", displayText: riskDisplayText });\r\n filterCount++;\r\n }\r\n\r\n if (plvm.filters.GoPlatformId > -1) {\r\n filterCount++;\r\n var goDisplayText = \"\";\r\n if(plvm.filters.GoPlatformId === 0){\r\n goDisplayText = \"+Go All\";\r\n }\r\n else if(plvm.filters.GoPlatformId === 1) {\r\n goDisplayText = \"+Go Web Only\"\r\n } else if (plvm.filters.GoPlatformId === 2){\r\n goDisplayText = \"+Go App Only\"\r\n }\r\n plvm.filters.activeFilters.push({filter: \"GoPlatformId\", displayText: goDisplayText});\r\n }\r\n\r\n if (plvm.filters.ProviderGroupId !== 0) {\r\n var _providerGroupId = lodash.find(plvm.configItems.ProviderGroups, function (o) { return o.Id == plvm.filters.ProviderGroupId });\r\n if (_providerGroupId) {\r\n plvm.filters.activeFilters.push({ filter: \"ProviderGroupId\", displayText: _providerGroupId.Name });\r\n filterCount++;\r\n } else {\r\n plvm.filters.ProviderGroupId = 0;\r\n filterChanged = true;\r\n }\r\n }\r\n\r\n if (plvm.filters.PayerId !== 0) {\r\n var _payerId = lodash.find(plvm.configItems.Payers, function (o) { return o.Id == plvm.filters.PayerId });\r\n if (_payerId) {\r\n plvm.filters.activeFilters.push({ filter: \"PayerId\", displayText: _payerId.Name });\r\n filterCount++;\r\n } else {\r\n plvm.filters.PayerId = 0;\r\n filterChanged = true;\r\n }\r\n }\r\n\r\n if (plvm.filters.ServiceLevelTypeId !== 0) {\r\n var _serviceLevelTypeId = lodash.find(plvm.configItems.ServiceLevels, function (o) { return o.ServiceLevelTypeId == plvm.filters.ServiceLevelTypeId });\r\n if (_serviceLevelTypeId) {\r\n plvm.filters.activeFilters.push({ filter: \"ServiceLevelTypeId\", displayText: _serviceLevelTypeId.DisplayText });\r\n filterCount++;\r\n }\r\n }\r\n\r\n var hospitalFilters = plvm.filters.HospitalId.filter(function(hospitalId) {\r\n return hospitalId !== 0;\r\n });\r\n\r\n if (hospitalFilters.length > 0) {\r\n filterCount++;\r\n hospitalFilters.map(function(hospitalId) {\r\n plvm.filters.activeFilters.push({ filter: \"HospitalId\", displayText: lodash.find(plvm.configItems.Hospitals, function(o) { return o.Id == hospitalId }).FacilityName });\r\n });\r\n }\r\n\r\n var CaregiverFilters = plvm.filters.Caregivers.filter(function(caregiver) {\r\n return caregiver.Id !== plvm.defaultCaregiverId;\r\n }).map(function(caregiver) {\r\n plvm.filters.activeFilters.push({ filter: \"CaregiverId\", displayText: lodash.find(plvm.configItems.Caregivers, function(o) { return o.Id == caregiver.Id }).DisplayName });\r\n });\r\n\r\n var viewAllCount = [];\r\n //can view all should\r\n\r\n if (lodash.findIndex(plvm.filters.activeFilters, { filter: 'CaregiverId' }) > -1) {\r\n filterCount++;\r\n }\r\n\r\n if (plvm.filters.KitStatusId !== 0) {\r\n plvm.filters.activeFilters.push({ filter: \"KitStatusId\", displayText: lodash.find(plvm.configItems.KitStatuses, function(o) { return o.KitStatusId == plvm.filters.KitStatusId }).Name });\r\n filterCount++;\r\n }\r\n\r\n if(plvm.filters.MonitoringStatusId > 0) {\r\n filterCount++;\r\n }\r\n\r\n if(plvm.filters.Alerts > -1) {\r\n filterCount++;\r\n }\r\n\r\n if(plvm.filters.VirtualVisits > -1) {\r\n filterCount++;\r\n }\r\n\r\n plvm.filters.activeFiltersCount = filterCount;\r\n\r\n if (filterChanged) {\r\n PatientListService.saveFiltersToDatabase(plvm.filters);\r\n filtersChanged(plvm.filters); \r\n }\r\n }\r\n\r\n function getMainDisplayText() {\r\n var text = \"\";\r\n var viewAll = plvm.filters.ViewAll;\r\n\r\n if (viewAll.indexOf(-1) > -1) {\r\n text = \"All Patients \";\r\n } else {\r\n text = \"Patients\";\r\n }\r\n return text;\r\n }\r\n\r\n function toggleFilters() {\r\n plvm.showFilters = !plvm.showFilters;\r\n plvm.showSearch = false;\r\n clearSelections();\r\n\r\n $timeout(function() {\r\n window.scrolltoTop();\r\n }, 500);\r\n\r\n }\r\n\r\n function toggleActiveFilters() { \r\n plvm.showActiveFilters = !plvm.showActiveFilters;\r\n }\r\n\r\n function toggleSearch() {\r\n plvm.showSearch = !plvm.showSearch;\r\n plvm.showFilters = false; \r\n plvm.showActiveFilters = false;\r\n clearSelections();\r\n \r\n if (!plvm.showSearch) {\r\n window.scrolltoTop();\r\n clearSearch();\r\n } else {\r\n $timeout(function() {\r\n window.scrolltoTop();\r\n var patientSeachField = document.querySelector('#patientSeachField');\r\n patientSeachField.focus();\r\n }, 500);\r\n }\r\n }\r\n\r\n function toggleSelect() {\r\n plvm.showSelection = !plvm.showSelection;\r\n\r\n if (plvm.showSelection) {\r\n plvm.selectActions = PatientListService.getActionMenu();\r\n plvm.showSearch = false;\r\n plvm.showFilters = false;\r\n plvm.showActiveFilters = false;\r\n plvm.selectedPatients.clear();\r\n } else {\r\n clearSelections();\r\n }\r\n }\r\n\r\n function toggleSelectPatient(patientId) {\r\n if (plvm.selectedPatients.has(patientId)) {\r\n plvm.selectedPatients.delete(patientId);\r\n } else {\r\n plvm.selectedPatients.add(patientId);\r\n }\r\n\r\n if (plvm.selectedPatients.size === 0) {\r\n plvm.selectedAction = null;\r\n }\r\n }\r\n\r\n function isPatientSelected(patientId) {\r\n return plvm.selectedPatients.has(patientId);\r\n }\r\n\r\n function hasSelectPermissions() {\r\n const actions = PatientListService.getActionMenu();\r\n const activities = new Set(actions.map(action => action.activity));\r\n for (const activity of activities) {\r\n if (PermissionService.userHasPermission(activity)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n function selectAll() {\r\n if (plvm.selectedPatients.size === 0) {\r\n plvm.patients.forEach(patient => plvm.selectedPatients.add(patient.id));\r\n } else {\r\n plvm.selectedPatients.clear();\r\n plvm.selectedAction = null;\r\n }\r\n }\r\n\r\n function actionSelected(action) {\r\n plvm.selectedAction = action;\r\n }\r\n\r\n function actionCompleted(event) {\r\n if (event && event.success) {\r\n clearSelections(true);\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"patients.list\").controller(\"PatientListController\", PatientListController);","function PatientListService($http, $window, PendingService) {\r\n\r\n let resultStatusEnum = { Sucess: 1, SoftLimitReached: 2, HardLimitReached: 3};\r\n\r\n // Subscribe to this subject to get realtime updates from the getPatientScheduleVirtualVisitss call.\r\n let patientsScheduledVirtualVisits = new Rx.BehaviorSubject();\r\n\r\n function getPatientListContent() {\r\n return PendingService.promise('/patient/list/content', () => $http.get(\"/api/cgp/patient/list/content\"))\r\n .then(\r\n function(response) {\r\n return response.data;\r\n },\r\n function(rejection) {\r\n if (rejection.status == 502 || rejection.status == 503) {\r\n rejection.preventDefault();\r\n }\r\n }\r\n );\r\n }\r\n\r\n function getPatientList(pageLength, pageNumber, sortBy, filters) {\r\n return $http.post(\"/api/cgp/patient/list\",\r\n {\r\n pageLength: pageLength,\r\n pageNumber: pageNumber,\r\n sortBy: sortBy,\r\n filters: filters\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function searchPatients(pageLength, pageNumber, searchText, sortOrder, ignoreSoftStop) {\r\n return $http.get(\"/api/cgp/patient/list/search\", {params: {pageSize: pageLength, pageNumber: pageNumber, searchText: searchText, sortOrder: sortOrder, IgnoreSoftStop: ignoreSoftStop}}).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function addPatientNote(patientNote) {\r\n return $http.post(\"/api/cgp/patientnote/note\", patientNote).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getSessionFilters() {\r\n return angular.fromJson($window.sessionStorage.getItem(\"filters\"));\r\n }\r\n\r\n function saveFiltersToSession(filters) {\r\n filters.patientIds = null; // don't save click from BI screen\r\n $window.sessionStorage.setItem(\"filters\", angular.toJson(filters));\r\n }\r\n\r\n function resetSessionFilters() {\r\n $window.sessionStorage.setItem(\"filters\", null);\r\n }\r\n\r\n function saveFiltersToDatabase(filters) {\r\n return $http.post(\"/api/cgp/patient/list/filters\", filters).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function postponePatientCall(patientId) {\r\n return $http.post(\"/api/patientcall/postponepatientcall?id=\" + patientId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function callPatientNow(patientId, alertId, isVideoCall, timeLog) {\r\n return $http.post(`/api/patientcall/callpatient?id=${patientId}&callAlertId=${alertId}&isVideoCall=${isVideoCall}`, timeLog).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function clearCallAlert(patientId, alertId) {\r\n return $http.post(\"/api/patientcall/clearcallalert?patientId=\" + patientId + \"&callAlertId=\" + alertId).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n \r\n function getPatientCallAlert(patientId, alertId) {\r\n return $http.get('/api/Patient/' + patientId + '/Alert/' + alertId).then(function(response) { return response.data; });\r\n }\r\n\r\n function setPatientreviewed(patientId) {\r\n return $http.post(\"/api/patient/\" + patientId + \"/patientreviewed\").then(function(data) {\r\n });\r\n }\r\n\r\n function getPatientScheduleVirtualVisitEnabled(patientId) {\r\n return $http.get(\"/api/VirtualVisit/GetScheduleVirtualVisitEnabled?id=\" + patientId).then(function (response) { return response.data; });\r\n }\r\n\r\n function hasPatientAcceptedEula(patientId) {\r\n return $http.get(\"/api/Eula/\" + patientId).then(function (response) { return response.data; });\r\n }\r\n\r\n function getPatientScheduleVirtualVisits(patientId) {\r\n return $http.get(\"/api/VirtualVisit/GetVirtualVisits?id=\" + patientId).then(function (response) { return response.data; });\r\n }\r\n\r\n function getPatientsScheduleVirtualVisits(patientIds) {\r\n return $http.post(\"/api/VirtualVisit/GetVirtualVisits\", {'Keys': patientIds})\r\n .then(function (response) {\r\n patientsScheduledVirtualVisits.onNext(response.data)\r\n return response.data;\r\n });\r\n }\r\n\r\n function filterVirtualVisitsByPatientId(patientId, virtualVisits) {\r\n return virtualVisits.filter(visit => visit.PatientId == patientId)\r\n }\r\n\r\n function cancelScheduleVideoVisit(scheduleVisitId) {\r\n return $http.get(\"/api/VirtualVisit/CancelVirtualVisit?id=\"+ scheduleVisitId).then(function (response) { return response.data; });\r\n }\r\n function getVirtualVisitCounts() {\r\n return $http.get(\"/api/VirtualVisit/GetVirtualVisitCounts\", { ignoreLoadingBar: true }).then(function (response) {\r\n return response.data;\r\n },\r\n function(rejection){\r\n rejection.preventDefault();\r\n });\r\n }\r\n\r\n function getActionMenu() {\r\n return [\r\n { name: 'Assign Care Team Member(s)', iconClass: '', component: 'assignCaregiversAction', activity: 'PatientAssignWrite' },\r\n { name: 'Remove Care Team Member(s)', iconClass: '', component: 'removeCaregiversAction', activity: 'PatientAssignWrite' }\r\n ];\r\n }\r\n\r\n function sendScheduleNowPreNotification(patientId) {\r\n return $http.post(\"/api/VirtualVisit/SendScheduleNowPreNotification?id=\" + patientId).then(function (response) { return response.data; }); \r\n }\r\n \r\n return {\r\n getPatientListContent: getPatientListContent,\r\n getPatientList: getPatientList,\r\n searchPatients: searchPatients,\r\n addPatientNote: addPatientNote,\r\n getSessionFilters: getSessionFilters,\r\n saveFiltersToSession: saveFiltersToSession,\r\n saveFiltersToDatabase: saveFiltersToDatabase,\r\n resetSessionFilters: resetSessionFilters,\r\n postponePatientCall: postponePatientCall,\r\n callPatientNow: callPatientNow,\r\n clearCallAlert: clearCallAlert,\r\n getPatientCallAlert: getPatientCallAlert,\r\n setPatientreviewed: setPatientreviewed,\r\n getPatientScheduleVirtualVisitEnabled: getPatientScheduleVirtualVisitEnabled,\r\n hasPatientAcceptedEula: hasPatientAcceptedEula,\r\n getPatientScheduleVirtualVisits: getPatientScheduleVirtualVisits,\r\n cancelScheduleVideoVisit: cancelScheduleVideoVisit,\r\n getVirtualVisitCounts: getVirtualVisitCounts,\r\n getPatientsScheduleVirtualVisits: getPatientsScheduleVirtualVisits,\r\n patientsScheduledVirtualVisits: patientsScheduledVirtualVisits,\r\n filterVirtualVisitsByPatientId: filterVirtualVisitsByPatientId,\r\n getActionMenu: getActionMenu,\r\n sendScheduleNowPreNotification: sendScheduleNowPreNotification,\r\n resultStatusEnum: resultStatusEnum\r\n };\r\n}\r\n\r\nangular.module(\"patients.list\").factory(\"PatientListService\", PatientListService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/list/patientlist.tpl.html',\n '

          {{plvm.mainDisplay}}

          1. {{plvm.countDisplay}} 0\"> : {{filter.displayText}} 
          Find By:
          Select Patients: ({{plvm.selectedPatients.size}} selected)
          Select All 0\"> Select None
          0 && plvm.selectedPatients.size > 0\">
          ');\n}]);\n}(window, document, window.angular));","function MasterMedicationsController($timeout, MedicationsService, lodash, $state) {\r\n var vm = this;\r\n var searchDelay = 500;\r\n var delay = null;\r\n vm.searchName = \"\";\r\n vm.searchReason = \"\";\r\n vm.searchCondtion = \"\";\r\n vm.searchAhfsClass = \"\";\r\n vm.searchChanged = searchChanged;\r\n vm.pageSize = 50;\r\n vm.pageNumber = 1;\r\n vm.totalMasterMeds = 0;\r\n vm.pageChanged = searchChanged;\r\n vm.searched = false;\r\n vm.cancel = cancel;\r\n \r\n function searchChanged() {\r\n if (delay !== null) {\r\n $timeout.cancel(delay);\r\n }\r\n delay = $timeout(function () {\r\n if (vm.searchName || vm.searchReason || vm.searchCondition || vm.searchAhfsClass) {\r\n MedicationsService.searchMedications(vm.pageSize, vm.pageNumber, vm.searchName, vm.searchReason, vm.searchCondition, vm.searchAhfsClass).then(bindSearchMeds);\r\n } else {\r\n vm.searched = false;\r\n }\r\n }, searchDelay);\r\n delay.then(function () {\r\n delay = null;\r\n });\r\n }\r\n\r\n function bindSearchMeds(medSearch) {\r\n vm.searched = true;\r\n vm.totalMasterMeds = medSearch.TotalCount;\r\n vm.masterMeds = lodash(medSearch.Response).groupBy(function (m) {\r\n return m.Name + (m.GenericName ? \"(\" + m.GenericName + \")\": \"\");\r\n }).value();\r\n }\r\n\r\n function cancel() {\r\n $state.go(\"^\");\r\n }\r\n}\r\n\r\nangular.module(\"patient.medications\").controller(\"MasterMedicationsController\", MasterMedicationsController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/medications/mastermedications.tpl.html',\n '
          Available Medications
          0\">
          MedicationDoseRouteDose FormFrequencyReasonConditionAHFS Class
          {{medName}}
          {{med.Dose}} {{med.MedUnitOfMeasureValue}}{{med.MedRouteValue}}{{med.MedDoseFormValue}}{{med.MedFrequencyValue}}{{med.Reason}}{{med.Condition}}{{med.MedAHFSClassValue}}

          No Medications Found

          ');\n}]);\n}(window, document, window.angular));","function MedicationController(patientMedication, MedStatus, MedicationsService, $stateParams, $state, $scope, $timeout) {\r\n var vm = this;\r\n\r\n vm.saveClass = \"fa-floppy-o\";\r\n vm.saving = false;\r\n vm.dateStoppedOptions = {};\r\n\r\n vm.cancel = cancel;\r\n vm.medication = patientMedication || {};\r\n if (vm.medication.StartDate) {\r\n vm.medication.StartDate = new Date(vm.medication.StartDate);\r\n vm.dateStoppedOptions = {\r\n minDate: new Date(vm.medication.StartDate)\r\n };\r\n }\r\n vm.startDateChanged = function() {\r\n vm.dateStoppedOptions = {\r\n minDate: new Date(vm.medication.StartDate)\r\n };\r\n }\r\n\r\n if (vm.medication.EndDate) {\r\n vm.medication.EndDate = new Date(vm.medication.EndDate);\r\n }\r\n vm.submitMedForm = saveMedication;\r\n vm.isCreateNew = !vm.medication.PatientMedicationId && !vm.medication.MasterMedicationId; // created a new med not from existing\r\n vm.medication.MedStatusId = vm.medication.MedStatusId || 1;\r\n vm.datePickerOptions = {\r\n maxDate: new Date()\r\n };\r\n\r\n vm.medicationName = vm.medication.Name;\r\n if (vm.medication.GenericName) {\r\n vm.medicationName += \" (\" + vm.medication.GenericName + \")\";\r\n }\r\n vm.canEditDose = vm.isCreateNew || !vm.medication.Dose;\r\n vm.canEditUoM = vm.isCreateNew || !vm.medication.MedUnitOfMeasureValue;\r\n vm.canSave = true;\r\n vm.focusInput = determineFocusElem();\r\n if (!vm.medication.PatientMedicationId) {\r\n $timeout(function () {\r\n $scope.medForm.$setDirty();\r\n });\r\n }\r\n\r\n function determineFocusElem() {\r\n if (vm.isCreateNew) {\r\n return \"medName\";\r\n }\r\n if (vm.canEditDose) {\r\n return \"dose\";\r\n }\r\n if (vm.carEditUoM) {\r\n return \"units\";\r\n }\r\n return \"freq\";\r\n }\r\n\r\n function saveMedication(gotoState) {\r\n if ($scope.medForm.$invalid || (vm.medication.StartDate && vm.medication.EndDate && vm.medication.StartDate > vm.medication.EndDate)) {\r\n return;\r\n }\r\n vm.saveClass = \"fa-spinner fa-pulse\";\r\n vm.saving = true;\r\n\r\n if (vm.isCreateNew) {\r\n vm.medication.Name = vm.medicationName;\r\n }\r\n\r\n (vm.medication.Name == '' || vm.medication.Name == null) && handleMissingMedicineName(vm.medication, vm.medicationName);\r\n\r\n var savePromise = null;\r\n if (vm.medication.PatientMedicationId) {\r\n savePromise = MedicationsService.savePatientMedication($stateParams.patientId, vm.medication.PatientMedicationId, vm.medication);\r\n } else {\r\n savePromise = MedicationsService.createPatientMedication($stateParams.patientId, vm.medication);\r\n }\r\n return savePromise.then(function () {\r\n vm.canSave = false; // lock page till it redirects\r\n $scope.medForm.$setPristine();\r\n $state.go(gotoState, undefined, {reload: true});\r\n });\r\n\r\n function handleMissingMedicineName(medication, medicationName) {\r\n // Trim whitespace, remove opening and closing parantheses, set Name\r\n if (medication.Name == '' || !medication.Name) {\r\n var medName = medicationName.trim();\r\n var len = medName.length - 1;\r\n\r\n if (medName[0] == '(' && medName[len] == ')') {\r\n medName = medName.slice(1);\r\n medName = medName.slice(0, -1);\r\n vm.medication.Name = medName;\r\n }\r\n }\r\n }\r\n }\r\n\r\n function cancel() {\r\n $state.go(\"^\");\r\n }\r\n}\r\nangular.module(\"patient.medications\").controller(\"MedicationController\", MedicationController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/medications/medication.tpl.html',\n '
          Medication Editor
          Medication name is required.
          Medication name cannot be more than 50 characters.
          Dose cannot be more than 50 characters.
          Units cannot be more than 50 characters.
          Route cannot be more than 50 characters.
          Dose form cannot be more than 50 characters.
          Frequency cannot be more than 50 characters.
          Dispense amount cannot be more than 20 characters.
          Prescriber cannot be more than 50 characters.
          Invalid date format.
          Invalid date format.
          vm.medication.EndDate\">Stop date must be after start date.
          Reason cannot be more than 100 characters.
          Condition cannot be more than 100 characters.
          Comments cannot be more than 400 characters.
           BEERS Criteria Medication - do not use in elderly
          ');\n}]);\n}(window, document, window.angular));","function MedicationsController(medications, lodash, MedStatus, MedicationsService, $stateParams) {\r\n var vm = this;\r\n vm.pageSize = medications.Request.PageSize;\r\n vm.pageNumber = medications.Request.PageNumber;\r\n vm.pageChanged = pageChanged;\r\n vm.allCollapsed = true;\r\n vm.toggleCollapse = toggleCollapse;\r\n\r\n bindResponse(medications);\r\n\r\n function pageChanged() {\r\n MedicationsService.getMedications($stateParams.patientId, vm.pageSize, vm.pageNumber).then(bindResponse);\r\n }\r\n\r\n function mapMedication(medication) {\r\n medication.MedStatusName = MedStatus[medication.MedStatusId];\r\n if (medication.MedStatusId === 1 || medication.MedStatusId === 3) {\r\n medication.GroupingName = \"Current\";\r\n } else if (medication.MedStatusId === 2) {\r\n medication.GroupingName = \"Holding\";\r\n } else {\r\n medication.GroupingName = \"Discontinued\";\r\n }\r\n return medication;\r\n }\r\n\r\n function bindMedications(response) {\r\n vm.medications = lodash(response).map(mapMedication).groupBy(\"GroupingName\").pairs().sortBy(function (p) {\r\n return p[0] === \"Current\" ? 0 : (p[0] === \"Holding\" ? 1 : 2);\r\n }).value();\r\n }\r\n\r\n function bindResponse(response) {\r\n bindMedications(response.Response);\r\n vm.totalMeds = response.TotalCount;\r\n }\r\n\r\n function toggleCollapse() {\r\n vm.allCollapsed = !vm.allCollapsed;\r\n var outer = vm.medications;\r\n\r\n\r\n for (var outerCount = 0; outerCount < outer.length; outerCount++) {\r\n var meds = outer[outerCount][1];\r\n\r\n for (var count = 0; count < meds.length; count++) {\r\n var med = meds[count];\r\n med.showDetails = !vm.allCollapsed;\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module('patient.medications').controller('MedicationsController', MedicationsController);\r\n","function MedicationsService($http) {\r\n\r\n function getMedications(patientId, pageSize, pageNumber, filters) {\r\n return $http.get('/api/Patient/' + patientId + '/medication', {\r\n params : {\r\n pageSize: pageSize,\r\n pageNumber: pageNumber,\r\n filterBy: filters\r\n }\r\n })\r\n .then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientMedication(patientId, patientMedicationId) {\r\n return $http.get(\"/api/Patient/\"+ patientId + \"/medication/\" + patientMedicationId)\r\n .then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function createPatientMedication(patientId, patientMedication) {\r\n return $http.post(\"/api/Patient/\" + patientId + \"/medication/\", patientMedication).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function savePatientMedication(patientId, patientMedicationId, patientMedication) {\r\n return $http.put(\"/api/Patient/\" + patientId + \"/medication/\" + patientMedicationId, patientMedication)\r\n .then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function searchMedications(pageSize, pageNumber, name, reason, condition, ahfsClass) {\r\n var filters = [];\r\n if (name) {\r\n filters.push(\"name=\"+name);\r\n }\r\n if (reason) {\r\n filters.push(\"reason=\"+reason);\r\n }\r\n if (condition) {\r\n filters.push(\"condition=\"+condition);\r\n }\r\n if (ahfsClass) {\r\n filters.push(\"ahfsclass=\"+ahfsClass);\r\n }\r\n return $http.get(\"/api/Medication\", {\r\n params: {\r\n pageSize: pageSize,\r\n pageNumber: pageNumber,\r\n filterBy: filters.join(\" & \")\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getMedications: getMedications,\r\n getPatientMedication: getPatientMedication,\r\n createPatientMedication: createPatientMedication,\r\n savePatientMedication: savePatientMedication,\r\n searchMedications: searchMedications\r\n };\r\n}\r\n\r\nangular.module('patient.medications')\r\n .service('MedicationsService', MedicationsService)\r\n .constant(\"MedStatus\", {\r\n 1: \"Active\",\r\n 2: \"Hold\",\r\n 3: \"Needs Refill\",\r\n 4: \"Discontinued\",\r\n 5: \"Deleted\"\r\n });\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/medications/medications.tpl.html',\n '
          Patient Medications
          0\">
          MedicationDoseRouteDose FormFrequencyPrescriberDate StartedDate Stopped
           {{medGroup[0]}}
          {{medGroup[1].length}}
           {{medication.Name}} ({{medication.GenericName}})  (deleted){{medication.Dose}} {{medication.MedUnitOfMeasureValue}}{{medication.MedRouteValue}}{{medication.MedDoseFormValue}}{{medication.MedFrequencyValue}}{{medication.Prescriber}}{{medication.StartDate | datetime}}{{medication.EndDate | datetime}}
          ReasonConditionAHFSComment
          {{medication.Reason}}{{medication.Condition}}{{medication.MedAHFSClassValue}}{{medication.Comment}}

          No Medications

          ');\n}]);\n}(window, document, window.angular));","function MonitoringAlertsViewDirective() {\r\n function controller($scope, $stateParams, $filter, $uibModal, lodash, AlertClass, AlertType, AlertSeverityLevel, AlertCategory, AlertStatus, MonitoringEventsService, PermissionService, ConfigurationsService, MonitoringBiometricsService, vhSweetAlert) {\r\n\r\n var vm = this;\r\n\r\n\r\n //#region Initialization\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.vm = vm;\r\n\r\n vm.alertClasses = Object.values(AlertClass);\r\n vm.AlertClass = AlertClass;\r\n vm.alertClassNames = Object.getOwnPropertyNames(AlertClass);\r\n vm.selectedAlertClass = PermissionService.userHasPermission(['PatientAlertsWrite']) ? \r\n AlertClass.Alert : \r\n AlertClass.Notification;\r\n\r\n vm.selectAlertClass = selectAlertClass;\r\n vm.accept = accept;\r\n vm.reject = reject;\r\n vm.updateSelectedAlerts = updateSelectedAlerts;\r\n vm.visibleGroupAlerts = visibleGroupAlerts;\r\n vm.tabHeading = tabHeading;\r\n vm.alertCount = alertCount;\r\n vm.hasAlerts = hasAlerts;\r\n\r\n MonitoringEventsService.onUpdateAlerts(loadAlerts);\r\n MonitoringEventsService.alertsLoaded();\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Event Handlers\r\n\r\n // when new alerts come in, all alerts are re-loaded\r\n function loadAlerts(patientAlerts) {\r\n vm.alertDateGroupings = [];\r\n vm.alerts = [];\r\n vm.selectedAlerts = [];\r\n vm.hasSelectedAlerts = false;\r\n updateButtonText();\r\n\r\n patientAlerts.forEach(function (patientAlert) {\r\n patientAlert.updateSelected = updateSelectedAlerts;\r\n\r\n if (patientAlert.AlertStatusId != AlertStatus.New) {\r\n return;\r\n }\r\n\r\n vm.alerts.push(initializeAlert(patientAlert));\r\n });\r\n\r\n selectAlertClass(vm.selectedAlertClass);\r\n\r\n sortAlertDateGroupings();\r\n\r\n }\r\n\r\n // when they click accept / acknowledge button\r\n function accept() {\r\n showAlertModal('accept');\r\n };\r\n\r\n // when they click reject button\r\n function reject() {\r\n showAlertModal('reject');\r\n };\r\n\r\n // when they click on a tab\r\n function selectAlertClass(alertClass) {\r\n var selectedAlerts = lodash.filter(vm.alerts, function (patientAlert) {\r\n return patientAlert.selected == true;\r\n });\r\n if(selectedAlerts && selectedAlerts.length > 0 && selectedAlerts[0].class == vm.selectedAlertClass && alertClass != vm.selectedAlertClass) {\r\n var previouslySelectedAlertClass = vm.selectedAlertClass == AlertClass.Notification ? AlertClass.Alert : AlertClass.Notification;\r\n var previouslySelectedAlertClassName = (lodash.invert(AlertClass))[vm.selectedAlertClass];\r\n var selectedAlertClassName = (lodash.invert(AlertClass))[previouslySelectedAlertClass];\r\n vhSweetAlert.error(\"Invalid Selection\", `You have already selected one or more ${previouslySelectedAlertClassName}s.\\nYou must deal with all ${previouslySelectedAlertClassName}s first, or de-select them,\\nbefore dealing with ${selectedAlertClassName}s.`);\r\n return;\r\n }\r\n vm.selectedAlertClass = alertClass;\r\n vm.canEdit = vm.selectedAlertClass == AlertClass.Alert ? \r\n PermissionService.userHasPermission(['PatientAlertsWrite']) : \r\n PermissionService.userHasPermission(['PatientNotificationsWrite']);\r\n vm.alertClassPluralLowercase = plural(lower(vm.alertClassNames[vm.selectedAlertClass - 1]));\r\n updateSelectedAlerts();\r\n vm.alertDateGroupings.forEach(function (alertDateGrouping) {\r\n updateVisibility(alertDateGrouping);\r\n });\r\n };\r\n\r\n // when they check or uncheck an item (in the list or in the grid)\r\n function updateSelectedAlerts() {\r\n // local variable for all selected alerts of any class\r\n var selectedAlerts = lodash.filter(vm.alerts, function (patientAlert) {\r\n return patientAlert.selected == true;\r\n });\r\n\r\n // all selected alerts of this class\r\n var thisClassAlerts = lodash.filter(vm.alerts, function (patientAlert) {\r\n return patientAlert.selected == true && patientAlert.class == vm.selectedAlertClass;\r\n });\r\n\r\n // all selected alerts of other class\r\n var otherClassAlerts = lodash.filter(vm.alerts, function (patientAlert) {\r\n return patientAlert.selected == true && patientAlert.class != vm.selectedAlertClass;\r\n });\r\n\r\n // disallow mixed selection\r\n if(thisClassAlerts && thisClassAlerts.length > 0 && otherClassAlerts && otherClassAlerts.length) {\r\n return false;\r\n }\r\n\r\n // select the other tab if all selected alerts are on the other tab\r\n if(selectedAlerts && selectedAlerts.length > 0 && otherClassAlerts.length == selectedAlerts.length) {\r\n selectAlertClass(selectedAlerts[0].class);\r\n return true;\r\n }\r\n\r\n vm.selectedAlerts = lodash.filter(vm.alerts, function (patientAlert) {\r\n return patientAlert.selected == true && patientAlert.class == vm.selectedAlertClass;\r\n });\r\n\r\n if (vm.selectedAlerts.length > 0) {\r\n vm.hasSelectedAlerts = true;\r\n }\r\n else {\r\n vm.hasSelectedAlerts = false;\r\n // if no alerts are manually selected, then all are virtually selected\r\n vm.selectedAlerts = lodash.filter(vm.alerts, function (patientAlert) {\r\n return patientAlert.class == vm.selectedAlertClass;\r\n });\r\n }\r\n updateButtonText();\r\n\r\n return true;\r\n };\r\n\r\n //#endregion\r\n\r\n //#region Methods\r\n\r\n function updateButtonText() {\r\n vm.acceptAlertText = vm.selectedAlertClass == AlertClass.Alert ? 'Accept' : 'Acknowledge';\r\n vm.rejectAlertText = 'Reject';\r\n if (!vm.hasSelectedAlerts) {\r\n vm.acceptAlertText += ' All';\r\n vm.rejectAlertText += ' All';\r\n }\r\n }\r\n\r\n function tabHeading(alertClass) {\r\n return plural(vm.alertClassNames[alertClass - 1]);\r\n }\r\n\r\n function alertCount(alertClass) {\r\n var alerts = lodash.filter(vm.alerts, function (patientAlert) {\r\n return patientAlert.class == alertClass;\r\n });\r\n\r\n return alerts.length;\r\n }\r\n\r\n function initializeAlert(patientAlert) {\r\n patientAlert.selected = false;\r\n\r\n patientAlert.class = getAlertClass(patientAlert);\r\n\r\n patientAlert.PatientResponse = patientAlert.PatientResponse || { SurveyQuestionTypeId: -1 };\r\n\r\n patientAlert.icon = getIcon(patientAlert);\r\n\r\n patientAlert.group = getAlertDateGrouping(patientAlert);\r\n patientAlert.group.alerts.push(patientAlert);\r\n\r\n return patientAlert;\r\n }\r\n\r\n function getAlertClass(patientAlert) {\r\n switch(patientAlert.AlertSeverityLevelId) {\r\n case AlertSeverityLevel.Notification:\r\n return AlertClass.Notification;\r\n default:\r\n return AlertClass.Alert;\r\n }\r\n }\r\n\r\n function hasAlerts(alertClass) {\r\n return lodash.some(vm.alerts, function (patientAlert) {\r\n return patientAlert.class == vm.selectedAlertClass;\r\n });\r\n }\r\n\r\n function visibleGroupAlerts(alertDateGrouping) {\r\n return lodash.find(alertDateGrouping.alerts, function (patientAlert) {\r\n return patientAlert.class == vm.selectAlertClass;\r\n });\r\n }\r\n\r\n function getIcon(patientAlert) {\r\n\r\n if(patientAlert.class == AlertClass.Notification) {\r\n return \"fa fa-bell\";\r\n } else if (patientAlert.Category === AlertCategory.Survey) {\r\n return 'vh-ui-glyph vh-ui-glyph-item-survey';\r\n } else if (patientAlert.Category === AlertCategory.Task) {\r\n return 'fa fa-exclamation';\r\n } else if(patientAlert.Category === AlertCategory.Biometric) {\r\n MonitoringBiometricsService.getBiometrics().then(function (biometrics) {\r\n var found = lodash.find(biometrics, function(b) {\r\n return lodash.intersection(b.types, [patientAlert.PatientResponse.SurveyQuestionTypeId]).length > 0;\r\n });\r\n \r\n if(found) {\r\n return found.icon;\r\n } else {\r\n return 'vh-ui-glyph vh-ui-glyph-item-survey'\r\n }\r\n });\r\n }\r\n }\r\n\r\n function getAlertDateGrouping(patientAlert) {\r\n var patientAlertDate = patientAlert.AlertStatusSetDateTime_UTC;\r\n var alertDateGrouping = $filter('date')(patientAlertDate, 'EEE, MMM d');\r\n if(ConfigurationsService.configParams.DateFormat.toLowerCase() === \"dd/mm/yyyy\"){\r\n alertDateGrouping = $filter('date')(patientAlertDate, 'EEE, d MMM');\r\n }\r\n\r\n var patientAlertDateGroup = lodash.find(vm.alertDateGroupings, function (patientAlertDateGroup) {\r\n return patientAlertDateGroup.day == alertDateGrouping;\r\n });\r\n\r\n if (patientAlertDateGroup) {\r\n return patientAlertDateGroup;\r\n }\r\n else {\r\n return createAlertDateGrouping(alertDateGrouping, patientAlertDate);\r\n }\r\n }\r\n\r\n function createAlertDateGrouping(patientAlertGroupDay, patientAlertDate) {\r\n var alertDateGrouping = {\r\n day: patientAlertGroupDay,\r\n date: patientAlertDate,\r\n alerts: [],\r\n visible: true\r\n };\r\n\r\n alertDateGrouping.removeIfEmpty = function () {\r\n var hasNewAlerts = lodash.some(alertDateGrouping.alerts, function (patientAlert) {\r\n return patientAlert.AlertStatusId == AlertStatus.New;\r\n });\r\n if (!hasNewAlerts) {\r\n lodash.remove(vm.alertDateGroupings, function (patientAlertDateGroup) {\r\n return patientAlertDateGroup.day == alertDateGrouping.day;\r\n });\r\n }\r\n };\r\n\r\n vm.alertDateGroupings.push(alertDateGrouping);\r\n\r\n return alertDateGrouping;\r\n }\r\n\r\n function updateVisibility(alertDateGrouping) {\r\n alertDateGrouping.visible = false;\r\n var hasVisibleAlerts = lodash.some(alertDateGrouping.alerts, function (patientAlert) {\r\n return patientAlert.class == vm.selectedAlertClass;\r\n });\r\n\r\n if(hasVisibleAlerts) {\r\n alertDateGrouping.visible = true;\r\n }\r\n }\r\n\r\n function sortAlertDateGroupings() {\r\n vm.alertDateGroupings.sort(function (group1, group2) {\r\n var group1Date = group1.date;\r\n var group2Date = group2.date;\r\n\r\n if (group1Date !== group2Date) {\r\n if (group2Date > group1Date) {\r\n return 1;\r\n }\r\n if (group1Date > group2Date) {\r\n return -1;\r\n }\r\n }\r\n\r\n return group2Date - group1Date;\r\n });\r\n\r\n vm.alertDateGroupings.forEach(function (patientAlertDateGroup) {\r\n sortGroupAlerts(patientAlertDateGroup);\r\n });\r\n }\r\n\r\n function sortGroupAlerts(patientAlertDateGroup) {\r\n patientAlertDateGroup.alerts = lodash.sortByAll(patientAlertDateGroup.alerts, ['AlertSeverityLevelId', 'AlertStatusSetDateTime_UTC']);\r\n } \r\n\r\n /* This is registered with the MonitoringEventsService to handle accepting/rejecting alerts from any directive */\r\n function showAlertModal(action) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/monitoring/alerts/monitoringalert.modal.html',\r\n controller: 'MonitoringAlertController as alertvm',\r\n backdrop: 'static',\r\n size: 'lg',\r\n resolve: {\r\n alerts: function () {\r\n return vm.selectedAlerts;\r\n },\r\n patientId: function () {\r\n return $stateParams.patientId;\r\n },\r\n action: function () {\r\n return action ? action : 'accept';\r\n }, // action = accept or reject\r\n patientContent: function() {\r\n return $scope.patientContent;\r\n },\r\n selectedAlertClass: function() {\r\n return vm.selectedAlertClass;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (response) {\r\n response.forEach(function (patientAlert) {\r\n concludeAlert(patientAlert);\r\n });\r\n\r\n var concludedAlerts = lodash.remove(vm.alerts, function (patientAlert) {\r\n return patientAlert.AlertStatusId != AlertStatus.New;\r\n });\r\n concludedAlerts.forEach(function (patientAlert) {\r\n concludeRelatedAlerts(patientAlert.AlertTypeId, patientAlert.AlertStatusId);\r\n });\r\n updateSelectedAlerts();\r\n },\r\n function () {\r\n });\r\n }\r\n\r\n function concludeAlert(patientAlert) {\r\n if (patientAlert.AlertStatusId == AlertStatus.New) {\r\n return;\r\n }\r\n\r\n patientAlert.selected = false;\r\n\r\n if (patientAlert.updateCompliance) {\r\n patientAlert.updateCompliance();\r\n }\r\n\r\n if (patientAlert.response && patientAlert.response.updateDisplay) {\r\n patientAlert.response.updateDisplay();\r\n }\r\n\r\n updateVisibility(patientAlert.group);\r\n patientAlert.group.removeIfEmpty();\r\n }\r\n\r\n function concludeRelatedAlerts(alertTypeId, alertStatusId) {\r\n var relatedAlerts;\r\n\r\n var relatedAlertTypes = [AlertType.Password, AlertType.Phone, AlertType.CareplanOverdue, AlertType.NinetyDay];\r\n if (relatedAlertTypes.includes(alertTypeId)) {\r\n relatedAlerts = lodash.remove(vm.alerts, function (patientAlert) {\r\n if (patientAlert.AlertTypeId == alertTypeId) {\r\n patientAlert.AlertStatusId = alertStatusId;\r\n }\r\n return patientAlert.AlertTypeId == alertTypeId;\r\n });\r\n } else if (alertTypeId == AlertType.WeightBaseLine && alertStatusId == AlertStatus.Accepted) {\r\n relatedAlerts = lodash.remove(vm.alerts, function (patientAlert) {\r\n if (patientAlert.AlertTypeId == alertTypeId) {\r\n patientAlert.AlertStatusId = AlertStatus.Rejected;\r\n }\r\n return patientAlert.AlertTypeId == alertTypeId;\r\n });\r\n }\r\n\r\n if (relatedAlerts && relatedAlerts.length > 0) {\r\n relatedAlerts.forEach(function (patientAlert) {\r\n if (patientAlert.response && patientAlert.response.updateDisplay) {\r\n patientAlert.response.updateDisplay();\r\n }\r\n });\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Helpers\r\n function plural(text) {\r\n return text + 's';\r\n }\r\n\r\n function lower(text) {\r\n return text.toLowerCase();\r\n }\r\n\r\n //#endregion\r\n\r\n }\r\n\r\n return {\r\n restrict: 'E',\r\n replace: true,\r\n controller: controller,\r\n templateUrl: 'modules/patient/monitoring/alerts/alertview.tpl.html',\r\n scope: {\r\n patientContent: \"=\"\r\n }\r\n }\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringAlertsView', MonitoringAlertsViewDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/alerts/alertview.tpl.html',\n '
          0\" class=\"view-height-md\">
          {{alertDateGrouping.day}}
          There are no {{vm.alertClassPluralLowercase}}
          ');\n}]);\n}(window, document, window.angular));","function MonitoringAlertController(patientId, patientContent, alerts, action, selectedAlertClass, AlertClass, AlertStatus, MonitoringAlertService, AlertCategory, lodash, $uibModalInstance, $q) {\r\n var alertvm = this;\r\n alertvm.selectedAlerts = alerts;\r\n alertvm.alertsPlural = alerts.length > 1 ? 's' : '';\r\n alertvm.selectedAlertClass = selectedAlertClass;\r\n alertvm.AlertClass = AlertClass;\r\n alertvm.selectedAlertClassName = Object.getOwnPropertyNames(alertvm.AlertClass)[alertvm.selectedAlertClass - 1];\r\n alertvm.acceptVerb = selectedAlertClass == AlertClass.Alert ? 'Accept' : 'Acknowledge';\r\n alertvm.notificationCount = alerts.length;\r\n alertvm.highSurveyAlertCount = lodash.filter(alerts, function (i) {\r\n return i.AlertSeverityLevelId == 1 && i.Category == AlertCategory.Survey;\r\n }).length;\r\n alertvm.mediumSurveyAlertCount = lodash.filter(alerts, function (i) {\r\n return i.AlertSeverityLevelId == 2 && i.Category == AlertCategory.Survey;\r\n }).length;\r\n alertvm.highBiometricAlertCount = lodash.filter(alerts, function (i) {\r\n return i.AlertSeverityLevelId == 1 && i.Category == AlertCategory.Biometric;\r\n }).length;\r\n alertvm.mediumBiometricAlertCount = lodash.filter(alerts, function (i) {\r\n return i.AlertSeverityLevelId == 2 && i.Category == AlertCategory.Biometric;\r\n }).length;\r\n alertvm.highTaskCount = lodash.filter(alerts, function (i) {\r\n return i.AlertSeverityLevelId == 1 && i.Category == AlertCategory.Task;\r\n }).length;\r\n alertvm.mediumTaskCount = lodash.filter(alerts, function (i) {\r\n return i.AlertSeverityLevelId == 2 && i.Category == AlertCategory.Task;\r\n }).length;\r\n alertvm.selectedAcceptInterventions = [];\r\n alertvm.selectedRejectInterventions = [];\r\n alertvm.acceptAlertNote = \"\";\r\n alertvm.rejectAlertNote = \"\";\r\n alertvm.isAccepting = action != 'reject';\r\n alertvm.isRejecting = action == 'reject';\r\n alertvm.patientContent = patientContent.patient;\r\n\r\n if (alerts.length == 1) {\r\n alertvm.alertMessage = alerts[0].Message;\r\n }\r\n\r\n alertvm.submittingAlerts = false;\r\n\r\n $q.all([\r\n MonitoringAlertService.getPopulations(), \r\n MonitoringAlertService.getInterventions()\r\n ]).then(function(result) {\r\n var populations = result[0];\r\n var interventions = result[1];\r\n\r\n var population = lodash.find(populations, function(population) {\r\n return population.PopulationId == patientContent.patient.populationId;\r\n });\r\n var populationId = null;\r\n if(population) {\r\n populationId = population.PopulationId;\r\n }\r\n\r\n var alertTypes = lodash.map(alertvm.selectedAlerts, 'AlertTypeId');\r\n interventions = lodash.filter(interventions, function (intervention) {\r\n return (\r\n alertTypes.indexOf(intervention.AlertTypeId) >= 0 ||\r\n (\r\n intervention.AlertClassId == alertvm.selectedAlertClass && \r\n (!intervention.AlertTypeId || intervention.AlertTypeId == null)\r\n )\r\n ) &&\r\n (\r\n lodash.any(intervention.Programs, function (program) {\r\n return program.PopulationId === populationId || program.IsAllPatients;\r\n }) ||\r\n intervention.Programs.length == 0\r\n )\r\n });\r\n alertvm.acceptinterventions = lodash.filter(interventions, function (intervention) {\r\n return intervention.AlertStatusId == AlertStatus.Accepted;\r\n });\r\n alertvm.rejectinterventions = lodash.filter(interventions, function (intervention) {\r\n return intervention.AlertStatusId == AlertStatus.Rejected;\r\n });\r\n\r\n });\r\n \r\n alertvm.toggleAcceptInterventions = function (interventionId) {\r\n var index = alertvm.selectedAcceptInterventions.indexOf(interventionId);\r\n if (index > -1) {\r\n alertvm.selectedAcceptInterventions.splice(index, 1);\r\n }\r\n else {\r\n alertvm.selectedAcceptInterventions.push(interventionId);\r\n }\r\n };\r\n\r\n alertvm.toggleRejectInterventions = function (interventionId) {\r\n var index = alertvm.selectedRejectInterventions.indexOf(interventionId);\r\n if (index > -1) {\r\n alertvm.selectedRejectInterventions.splice(index, 1);\r\n }\r\n else {\r\n alertvm.selectedRejectInterventions.push(interventionId);\r\n }\r\n };\r\n\r\n var alertStatusObj = {\r\n PatientId: patientId,\r\n PatientAlertId: [],\r\n AlertStatusId: 0,\r\n Interventions: [],\r\n Note: null,\r\n };\r\n\r\n alertvm.accept = function () {\r\n alertvm.submittingAlerts = true;\r\n\r\n var accepted = lodash.forEach(alertvm.selectedAlerts, function (a) {\r\n a.AlertStatusId = AlertStatus.Accepted;\r\n a.Interventions = alertvm.selectedAcceptInterventions;\r\n a.InterventionModels = getInterventions(alertvm.acceptinterventions, alertvm.selectedAcceptInterventions);\r\n a.Note = decodeHtml(alertvm.acceptAlertNote);\r\n\r\n addChartNotes(a);\r\n });\r\n\r\n var status = angular.copy(alertStatusObj);\r\n status.PatientAlertId = lodash(alertvm.selectedAlerts).pluck(\"PatientAlertId\").compact().value();\r\n status.AlertStatusId = AlertStatus.Accepted;\r\n status.Interventions = alertvm.selectedAcceptInterventions;\r\n status.Note = decodeHtml(alertvm.acceptAlertNote);\r\n\r\n MonitoringAlertService.saveAlertStatus(patientId, status).then(function () {\r\n $uibModalInstance.close(accepted);\r\n });\r\n };\r\n\r\n function decodeHtml(str) {\r\n const regex = /[<]\\w+/g\r\n var newNote;\r\n if (regex.test(str)) {\r\n newNote = str.split('<').join('< ');\r\n return newNote;\r\n }\r\n return str;\r\n }\r\n\r\n alertvm.reject = function () {\r\n alertvm.submittingAlerts = true;\r\n\r\n var rejected = lodash.forEach(alertvm.selectedAlerts, function (a) {\r\n a.AlertStatusId = AlertStatus.Rejected;\r\n a.Interventions = alertvm.selectedRejectInterventions;\r\n a.InterventionModels = getInterventions(alertvm.rejectinterventions, alertvm.selectedRejectInterventions);\r\n a.Note = decodeHtml(alertvm.rejectAlertNote);\r\n\r\n addChartNotes(a);\r\n });\r\n\r\n var status = angular.copy(alertStatusObj);\r\n status.PatientAlertId = lodash(alertvm.selectedAlerts).pluck(\"PatientAlertId\").compact().value();\r\n status.AlertStatusId = AlertStatus.Rejected;\r\n status.Interventions = alertvm.selectedRejectInterventions;\r\n status.Note = decodeHtml(alertvm.rejectAlertNote);\r\n\r\n MonitoringAlertService.saveAlertStatus(patientId, status).then(function () {\r\n $uibModalInstance.close(rejected);\r\n });\r\n };\r\n\r\n function addChartNotes(alert) {\r\n alert.InterventionModels.forEach(function (intervention) {\r\n alert.PatientChartEntries.push({Text: intervention.Text});\r\n });\r\n\r\n if (alert.Note.length > 0) {\r\n alert.PatientChartEntries.push({Text: alert.Note});\r\n }\r\n }\r\n\r\n function getInterventions(interventions, interventionIds){\r\n var retVal = [];\r\n interventionIds.forEach(function(id){\r\n retVal.push(getIntervention(interventions, id));\r\n });\r\n return retVal;\r\n }\r\n\r\n function getIntervention(interventions, id) {\r\n return lodash.find(interventions, function(intervention){\r\n return intervention.InterventionId === id;\r\n });\r\n }\r\n\r\n alertvm.saveNote = function () {\r\n //save data\r\n $uibModalInstance.dismiss('save note');\r\n };\r\n\r\n alertvm.cancel = function () {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').controller('MonitoringAlertController', MonitoringAlertController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/alerts/monitoringalert.modal.html',\n '

          {{alertvm.alertMessage}}

          Notifications:
          ({{alertvm.notificationCount}})
          Biometric Alerts:
          Med ({{alertvm.mediumBiometricAlertCount}}) High ({{alertvm.highBiometricAlertCount}})
          Pathway Alerts:
          Med ({{alertvm.mediumSurveyAlertCount}}) High ({{alertvm.highSurveyAlertCount}})
          Tasks:
          Med ({{alertvm.mediumTaskCount}}) High ({{alertvm.highTaskCount}})
          {{alertvm.acceptVerb}} {{alertvm.selectedAlertClassName}}{{alertvm.alertsPlural}}

          0\">Select interventions

          Reject Alert(s)

          0\">Select interventions

          ');\n}]);\n}(window, document, window.angular));","function MonitoringAlertService($http, $rootScope, repository) {\r\n\r\n // accept/reject alerts\r\n // { PatientId: 0, PatientAlertId: 0, AlertStatusId:0, Note: '', Interventions:[0] }\r\n function saveAlertStatus(patientId, alerts) {\r\n return $http.post('/api/Patient/' + patientId + '/Alert/Status', alerts).then(function() {\r\n $rootScope.$emit(\"vh:patientUpdated\", patientId);\r\n }); //response is void\r\n }\r\n\r\n function getInterventions() {\r\n return $http.get('/api/Intervention/?enabledOnly=true').then(function(response) { return response.data; });\r\n }\r\n\r\n function getAlertTasks(patientId) {\r\n return $http.get('/api/Patient/' + patientId + '/Alert/Tasks').then(function(response) { return response.data; });\r\n }\r\n\r\n function getPopulations() {\r\n var url = \"Population\";\r\n var repo = repository.new(url);\r\n return repo.getList().then(function (result) {\r\n return result.data;\r\n });\r\n }\r\n\r\n\r\n\r\n return {\r\n saveAlertStatus: saveAlertStatus,\r\n getInterventions: getInterventions,\r\n getAlertTasks: getAlertTasks,\r\n getPopulations: getPopulations\r\n }\r\n}\r\n\r\nangular.module(\"patient.monitoring\").service(\"MonitoringAlertService\", MonitoringAlertService);\r\n","function MonitoringAlertsDirective() {\r\n\r\n function controller($scope, AlertSeverityLevel) {\r\n \r\n $scope.selectAlert = function(patientAlert) {\r\n if(!$scope.canEdit) {\r\n return;\r\n }\r\n patientAlert.selected = !patientAlert.selected;\r\n if(patientAlert.response) {\r\n patientAlert.response.selected = patientAlert.selected;\r\n if (patientAlert.response.updateDisplay) {\r\n patientAlert.response.updateDisplay();\r\n }\r\n }\r\n $scope.updateSelected();\r\n };\r\n\r\n $scope.validUrl = function(url) {\r\n var pattern = new RegExp(/((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9.‌​-]+(:[0-9]+)?|(?:www‌​.|[-;:&=\\+\\$,\\w]+@)[‌​A-Za-z0-9.-]+)((?:\\/‌​[\\+~%\\/.\\w-_]*)?\\??(‌​?:[-\\+=&;%@.\\w_]*)#?‌​(?:[\\w]*))?)/);\r\n return url !== null && url !== undefined && pattern.test(url);\r\n };\r\n\r\n $scope.getClass = function(alert) {\r\n switch(alert.AlertSeverityLevelId) {\r\n case AlertSeverityLevel.High:\r\n return 'badge-danger';\r\n case AlertSeverityLevel.Medium:\r\n return 'badge-warning';\r\n case AlertSeverityLevel.Notification:\r\n return 'badge-primary';\r\n }\r\n }\r\n \r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n replace: true,\r\n controller: controller,\r\n templateUrl: 'modules/patient/monitoring/alerts/monitoringalerts.tpl.html',\r\n scope: {\r\n alerts: '=',\r\n canEdit: '=',\r\n updateSelected: '&',\r\n selectedAlertClass: '='\r\n }\r\n }\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringAlerts', MonitoringAlertsDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/alerts/monitoringalerts.tpl.html',\n '
          {{alert.AlertStatusSetDateTime_UTC | date : \\'HH:mm\\'}}
          ');\n}]);\n}(window, document, window.angular));","function MonitoringBiometricDeviceDirective() {\r\n\r\nfunction controller($scope, lodash, PermissionService, MonitoringViewType, MonitoringEventsService, ConfigurationsService, AlertType, AlertSeverityLevel, AlertStatus) {\r\n \r\n \r\n $scope.expanded = true;\r\n \r\n if($scope.enableCollapse){\r\n var maxReadingCount = Math.max(...$scope.biometricInfo.readings.map(x => x.readings.length)); \r\n $scope.expanded = $scope.expanded && maxReadingCount < $scope.readingThreshold; \r\n\r\n }\r\n\r\n $scope.toggleExpand = ()=>{\r\n if(!$scope.enableCollapse)\r\n return;\r\n\r\n $scope.expanded = !$scope.expanded;\r\n MonitoringEventsService.selectSummary({});\r\n }\r\n\r\n $scope.toggleReadings = function () {\r\n $scope.biometricInfo.showReadings = !$scope.biometricInfo.showReadings;\r\n };\r\n\r\n var hasModifyResponse = PermissionService.userHasPermission(['ModifyResponse']);\r\n\r\n function setCanModifyReadings() {\r\n $scope.canModify = hasModifyResponse;\r\n }\r\n\r\n function setMultipleReadings(displayType) {\r\n var readings = $scope.biometricInfo.readings;\r\n\r\n var hasMultipleReadings = false;\r\n var hasVisibleReadings = false;\r\n\r\n if(displayType == MonitoringViewType.Audit) {\r\n readings.forEach(function(reading){\r\n if(reading.readings.length > 0){\r\n hasVisibleReadings = true;\r\n }\r\n if(reading.readings.length > 1) {\r\n hasMultipleReadings = true;\r\n }\r\n });\r\n } else {\r\n readings.forEach(function(reading){\r\n var visible = lodash.filter(reading.readings, function(r) {\r\n return !r.isDeleted;\r\n });\r\n if(visible.length > 0) {\r\n hasVisibleReadings = true;\r\n }\r\n if(visible.length > 1) {\r\n hasMultipleReadings = true;\r\n }\r\n });\r\n }\r\n\r\n $scope.biometricInfo.multipleReadings = hasMultipleReadings;\r\n $scope.biometricInfo.hasReadings = hasVisibleReadings;\r\n }\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.enableAlerts = PermissionService.userHasPermission(['PatientAlertsWrite']);\r\n $scope.canModify = false;\r\n\r\n $scope.viewType = MonitoringEventsService.getDisplayType();\r\n\r\n setCanModifyReadings($scope.viewType);\r\n setMultipleReadings($scope.viewType);\r\n\r\n MonitoringEventsService.onDisplayTypeChanged(function(displayType){\r\n setCanModifyReadings(displayType);\r\n setMultipleReadings(displayType);\r\n $scope.viewType = displayType;\r\n });\r\n\r\n $scope.biometricInfo.updateVisiblility = function() {\r\n setMultipleReadings($scope.viewType);\r\n };\r\n \r\n MonitoringEventsService.onExpandReadings((expanding)=>{\r\n $scope.expanded = expanding;\r\n });\r\n\r\n\r\n }\r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n require: '^monitoringBiometrics',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'modules/patient/monitoring/biometrics/biometricdevice.tpl.html',\r\n controller: controller,\r\n scope: {\r\n biometricInfo: '=',\r\n startDate: '=',\r\n endDate: '=',\r\n enableCollapse: '=',\r\n readingThreshold: '=',\r\n showGraphHeader: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringBiometricDevice', MonitoringBiometricDeviceDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/biometricdevice.tpl.html',\n '
          {{biometricInfo.name}} 0\" class=\"pull-right dim p-r-sm\">({{biometricInfo.unit}})
          0\" biometric-info=\"biometricInfo\" reading-date=\"biometricReading\" reading-threshold=\"readingThreshold\" enable-collapse=\"enableCollapse\">
          0\" monitoring-biometric-graph=\"\" biometric-graph-primary=\"biometricInfo.graph\" biometric-graph-secondary=\"biometricInfo.graph2\" biometric-info=\"biometricInfo\" start-date=\"startDate\" end-date=\"endDate\" show=\"viewType == \\'Graph\\'\" show-graph-header=\"showGraphHeader\" expanded=\"expanded\">');\n}]);\n}(window, document, window.angular));","function MonitoringBiometricGraphDirective() {\r\n function controller($scope, MonitoringEventsService, ConfigurationsService) {\r\n \r\n $scope.expanded = $scope.expanded != false;\r\n MonitoringEventsService.onExpandCurrentGraphs(function() {\r\n $scope.expanded = !$scope.expanded;\r\n });\r\n\r\n MonitoringEventsService.onDisplayTypeChanged(function(dataType){\r\n $scope.expanded = true;\r\n });\r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n require: '^monitoringBiometricDevice',\r\n replace: true,\r\n controller: controller,\r\n templateUrl: 'modules/patient/monitoring/biometrics/biometricgraph.tpl.html',\r\n scope: {\r\n biometricInfo: '=',\r\n startDate: '=',\r\n endDate: '=',\r\n biometricGraphPrimary: '=',\r\n biometricGraphSecondary: '=',\r\n biometricInfo: '=',\r\n startDate: '=',\r\n endDate: '=',\r\n show: '=',\r\n showGraphHeader: '=',\r\n expanded: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringBiometricGraph', MonitoringBiometricGraphDirective);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/biometricgraph.tpl.html',\n '');\n}]);\n}(window, document, window.angular));","function MonitoringBiometricReadingDirective() {\r\n\r\n function controller(MonitoringEventsService, MonitoringService, MonitoringViewType, AlertClass, AlertStatus, AlertSeverityLevel, AlertType, $scope, $stateParams, $uibModal, lodash, vhSweetAlert) {\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.tooltipTemplateUrl = 'modules/patient/monitoring/biometrics/valuetooltip.tpl.html';\r\n \r\n MonitoringEventsService.onDisplayTypeChanged(function (displayType) {\r\n $scope.canProcess = canProcess(displayType);\r\n updateAlertDisplay($scope.biometricReading.alerts, displayType);\r\n $scope.biometricReading.biometric.updateVisiblility();\r\n });\r\n\r\n $scope.canProcess = canProcess(MonitoringEventsService.getDisplayType());\r\n $scope.displayUom = $scope.biometricReading.unit && $scope.biometricReading.unit.length > 0 && $scope.biometricReading.unit !== $scope.unitOfMeasure;\r\n\r\n var obs = $scope.biometricReading.obs;\r\n var created = $scope.biometricReading.created;\r\n var timeDiff = Math.abs(obs.getTime() - created.getTime());\r\n var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));\r\n\r\n $scope.showCreatedDateTime = diffDays > 1;\r\n\r\n $scope.biometricReading.updateDisplay = function () {\r\n var type = MonitoringEventsService.getDisplayType();\r\n\r\n updateAlertDisplay($scope.biometricReading.alerts, type);\r\n var status = getGraphNodeStatus($scope.biometricReading.alertLevel);\r\n var state = getGraphNodeState($scope.biometricReading.alertStatus);\r\n $scope.biometricReading.graphNodes.forEach(function(n){\r\n n.status = status;\r\n n.state = state;\r\n });\r\n\r\n $scope.biometricReading.biometric.updateVisiblility();\r\n };\r\n\r\n applyAlertInfo(MonitoringEventsService.getDisplayType());\r\n $scope.biometricReading.biometric.updateVisiblility();\r\n }\r\n\r\n function getGraphNodeStatus(alertLevel) {\r\n switch(alertLevel) {\r\n case AlertSeverityLevel.None:\r\n return 'normal';\r\n case AlertSeverityLevel.Medium:\r\n return 'warning';\r\n case AlertSeverityLevel.High:\r\n return 'danger';\r\n }\r\n }\r\n\r\n function getGraphNodeState(alertStatus) {\r\n if($scope.biometricReading.isDeleted) {\r\n return 'declined';\r\n }\r\n switch(alertStatus) {\r\n case AlertStatus.New:\r\n return 'normal';\r\n case AlertStatus.Accepted:\r\n return 'accepted';\r\n default:\r\n return 'declined';\r\n }\r\n }\r\n\r\n function isVisible(type) {\r\n if(type === MonitoringViewType.Audit) {\r\n return $scope.canModify;\r\n }\r\n\r\n return !$scope.biometricReading.isDeleted;\r\n }\r\n\r\n function applyAlertInfo(type) {\r\n updateAlertDisplay($scope.biometricReading.alerts, type);\r\n\r\n $scope.biometricReading.isNewAlert = $scope.biometricReading.alertStatus == AlertStatus.New;\r\n $scope.biometricReading.showAlertModal = function () {\r\n MonitoringEventsService.handleAlerts(alerts);\r\n updateAlertDisplay($scope.biometricReading.alerts, type);\r\n };\r\n }\r\n\r\n function canProcess(type) {\r\n var retVal = true;\r\n\r\n var biometric = $scope.biometricReading;\r\n if(!biometric.reading) {\r\n return false;\r\n }\r\n\r\n if (biometric.reading.length == 0) {\r\n retVal = false;\r\n }\r\n else if (type != MonitoringViewType.Audit) {\r\n retVal = $scope.enableAlerts && biometric.alertLevel < 3 && biometric.alertStatus == AlertStatus.New;\r\n }\r\n else {\r\n retVal = $scope.canModify;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n $scope.processReading = function () {\r\n if ($scope.biometricReading.id === 0) {\r\n return;\r\n }\r\n\r\n var isNewAlert = $scope.biometricReading.alertStatus == AlertStatus.New && $scope.biometricReading.alertLevel < AlertSeverityLevel.None;\r\n\r\n if (isNewAlert && $scope.enableAlerts) {\r\n $scope.biometricReading.alerts.forEach(function (a) {\r\n a.selected = !a.selected;\r\n if(a.updateSelected()) {\r\n $scope.readingClass = getReadingClass();\r\n }\r\n else {\r\n a.selected = !a.selected;\r\n var previouslySelectedAlertClass = AlertClass.Notification;\r\n var previouslySelectedAlertClassName = (lodash.invert(AlertClass))[previouslySelectedAlertClass];\r\n var selectedAlertClassName = (lodash.invert(AlertClass))[AlertClass.Alert];\r\n vhSweetAlert.error(\"Invalid Selection\", `You have already selected one or more ${previouslySelectedAlertClassName}s.\\nYou must deal with all ${previouslySelectedAlertClassName}s first, or de-select them,\\nbefore dealing with ${selectedAlertClassName}s.`);\r\n }\r\n });\r\n } else if ($scope.canModify) {\r\n showModifyModal();\r\n }\r\n };\r\n\r\n function getReadingClass() {\r\n var alertClass = '';\r\n\r\n if ($scope.isChild) {\r\n alertClass += 'child ';\r\n }\r\n\r\n var hasSelectedAlert = lodash.any($scope.biometricReading.alerts, function (alert) {\r\n return alert.selected == true && alert.AlertStatusId == AlertStatus.New;\r\n });\r\n if (hasSelectedAlert) {\r\n alertClass += 'selected ';\r\n }\r\n\r\n if ($scope.biometricReading.isDeleted) {\r\n alertClass += 'text-deleted ';\r\n }\r\n\r\n if ($scope.biometricReading.alertLevel == AlertSeverityLevel.None) {\r\n return alertClass;\r\n }\r\n\r\n if ($scope.biometricReading.alertStatus == AlertStatus.New) {\r\n alertClass += 'alert-active';\r\n }\r\n else if ($scope.biometricReading.alertStatus == AlertStatus.Accepted) {\r\n alertClass += 'alert-inactive';\r\n }\r\n else {\r\n alertClass += 'rejected alert-inactive';\r\n }\r\n\r\n if ($scope.biometricReading.alertLevel == AlertSeverityLevel.Medium) {\r\n alertClass += ' warning';\r\n }\r\n else {\r\n alertClass += ' danger';\r\n }\r\n\r\n return alertClass;\r\n }\r\n\r\n function showModifyModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/monitoring/biometrics/modifyresponse.modal.html',\r\n controller: 'ModifyResponseController as mvm',\r\n backdrop: 'static'\r\n });\r\n modalInstance.result.then(function (reason) {\r\n changeStatus(reason);\r\n },\r\n function () {\r\n });\r\n }\r\n\r\n function changeStatus(reason) {\r\n MonitoringService.changeResponseStatus($stateParams.patientId, $scope.biometricReading.id, reason).then(function (response) {\r\n $scope.biometricReading.isDeleted = response.DeletedDateTime_UTC !== undefined && response.DeletedDateTime_UTC !== null;\r\n $scope.biometricReading.response.DeletedDateTime_UTC = response.DeletedDateTime_UTC;\r\n $scope.biometricReading.response.DeletedBy_Id = response.DeletedBy_Id;\r\n\r\n var statusId = $scope.biometricReading.alertStatus == AlertStatus.New ? AlertStatus.New : $scope.biometricReading.isDeleted ? AlertStatus.Rejected : AlertStatus.Accepted;\r\n\r\n $scope.biometricReading.alerts.forEach(function (alert) {\r\n alert.AlertStatusId = statusId;\r\n $scope.biometricReading.alertStatus = statusId;\r\n });\r\n\r\n $scope.biometricReading.updateDisplay();\r\n });\r\n }\r\n\r\n function updateAlertDisplay(alerts, type) {\r\n $scope.biometricReading.hasNotes = false;\r\n\r\n var activeAlerts = lodash.filter(alerts, function(a){ return a.AlertStatusId == AlertStatus.New});\r\n if(activeAlerts.length > 0) {\r\n $scope.biometricReading.alertLevel = lodash.min(lodash.pluck(activeAlerts, 'AlertSeverityLevelId'));\r\n $scope.biometricReading.alertStatus = lodash.min(lodash.pluck(activeAlerts, 'AlertStatusId'));\r\n } else if (alerts.length >= 1) {\r\n // We do not want to base inactive alerts on baseline\r\n var standardAlerts = lodash.filter(alerts, function(a) { return a.AlertTypeId != AlertType.WeightBaseLine; });\r\n\r\n if(standardAlerts.length > 0) {\r\n $scope.biometricReading.alertLevel = lodash.min(lodash.pluck(standardAlerts, 'AlertSeverityLevelId'));\r\n $scope.biometricReading.alertStatus = lodash.min(lodash.pluck(standardAlerts, 'AlertStatusId'));\r\n } else {\r\n $scope.biometricReading.alertLevel = AlertSeverityLevel.None;\r\n $scope.biometricReading.alertStatus = AlertStatus.New;\r\n }\r\n }\r\n\r\n if ($scope.biometricReading.alertStatus == AlertStatus.Rejected) {\r\n $scope.biometricReading.isDeleted = true;\r\n }\r\n\r\n $scope.biometricReading.tooltipMessages = [];\r\n alerts.forEach(function (alert) {\r\n var notes = '';\r\n if (alert.PatientChartEntries.length > 0) {\r\n $scope.biometricReading.hasNotes = true;\r\n notes = lodash(alert.PatientChartEntries)\r\n .pluck('Text')\r\n .filter(function (note) {\r\n return note.indexOf(alert.Message) < 0;\r\n })\r\n .value()\r\n .join(' ');\r\n }\r\n\r\n if (!alert.InterventionModels && alert.Interventions && alert.Interventions.length > 0) {\r\n $scope.biometricReading.hasNotes = true;\r\n var updatedNotes = [notes];\r\n updatedNotes.push(lodash(alert.Interventions).pluck('Text').value().join(' '));\r\n notes = updatedNotes.join(' ');\r\n }\r\n\r\n var tooltipMessage = {\r\n message: alert.Message,\r\n deleted: alert.AlertTypeId == AlertType.WeightBaseLine && alert.AlertStatusId == AlertStatus.Rejected,\r\n notes: notes,\r\n option: {\r\n AlertSeverityLevelId: alert.AlertSeverityLevelId\r\n }\r\n \r\n };\r\n\r\n $scope.biometricReading.tooltipMessages.push(tooltipMessage);\r\n });\r\n\r\n $scope.readingClass = getReadingClass();\r\n $scope.isVisible = isVisible(type);\r\n }\r\n }\r\n\r\n function link(scope, elem, attrs) {\r\n scope.isChild = attrs.child !== undefined;\r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n replace: true,\r\n controller: controller,\r\n link: link,\r\n templateUrl: 'modules/patient/monitoring/biometrics/biometricreading.tpl.html',\r\n scope: {\r\n biometricReading: '=',\r\n unitOfMeasure: '=',\r\n enableAlerts: '=',\r\n canModify: '='\r\n }\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringBiometricReading', MonitoringBiometricReadingDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/biometricreading.tpl.html',\n '
          6 ? \\'smaller\\' : \\'inherit\\'}\" uib-tooltip-template=\"\\'{{tooltipTemplateUrl}}\\'\" tooltip-enable=\"{{biometricReading.reading && biometricReading.reading.length > 0}}\" tooltip-placement=\"auto bottom\" tooltip-append-to-body=\"true\" tooltip-class=\"vh-monitoring-view\">
          {{biometricReading.reading}}
          ');\n}]);\n}(window, document, window.angular));","function MonitoringBiometricsDirective() {\r\n\r\n function controller($scope, $filter, lodash, MonitoringService, MonitoringEventsService, MonitoringBiometricsService, MonitoringViewType, ConfigurationsService, $timeout) {\r\n\r\n\r\n $scope.$watch('startDate',(newValue)=>{\r\n $timeout(()=>{\r\n loadController();\r\n }, 500)\r\n });\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.hasBiometricReadings = false;\r\n MonitoringBiometricsService.getBiometrics().then(function (data) {\r\n $scope.biometrics = data;\r\n\r\n MonitoringService.getBiometricConfigurations().then(function (config) {\r\n var weightBiometric = lodash.where($scope.biometrics, {'name': 'Weight'})[0];\r\n weightBiometric.displayBoth = config.displayBothWeightUnits;\r\n\r\n var tempBiometric = lodash.where($scope.biometrics, {'name': 'Temp'})[0];\r\n tempBiometric.displayBoth = config.displayBothTempUnits;\r\n\r\n var hbA1cBiometric = lodash.where($scope.biometrics, {'name': 'HbA1c'})[0];\r\n hbA1cBiometric.unit = ConfigurationsService.getConfig().then(function(config) {\r\n return config.DefaultHba1cUnit;\r\n });\r\n\r\n MonitoringEventsService.onUpdateBiometrics(function (biometricData, timeZone) {\r\n assignResponses(biometricData, timeZone);\r\n });\r\n \r\n MonitoringEventsService.biometricsLoaded($scope.biometrics);\r\n });\r\n });\r\n }\r\n\r\n $scope.showBiometric = function(biometric) {\r\n //Do not snow HbA1c biometric in graph form.\r\n if (!biometric.hasReadings || (MonitoringEventsService.getDisplayType() == 'Graph' && biometric.name == 'HbA1c')) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n function generateReadings(dates) {\r\n $scope.biometrics.forEach(function (biometric) {\r\n biometric.readings = [];\r\n biometric.graph = [];\r\n biometric.graph2 = [];\r\n biometric.hasReadings = false;\r\n dates.forEach(function (date) {\r\n var newReading = MonitoringBiometricsService.getNewReading(date, true);\r\n biometric.readings.push(newReading);\r\n });\r\n });\r\n }\r\n\r\n function assignResponses(biometricData, timeZone) {\r\n $scope.hasBiometricReadings = false;\r\n\r\n var data = biometricData.data;\r\n var dates = biometricData.dates;\r\n\r\n generateReadings(dates);\r\n\r\n data.forEach(function (data) {\r\n data.Responses.forEach(function (response) {\r\n var biometric = MonitoringBiometricsService.getBiometric($scope.biometrics, data, response.Values);\r\n\r\n $scope.hasBiometricReadings = true;\r\n biometric.hasReadings = true;\r\n biometric.isBluetooth = data.HasDevice;\r\n biometric.unit = data.UnitOfMeasure.length > 0 ? data.UnitOfMeasure : biometric.unit;\r\n\r\n //Special case for receiving Pulse from BP\r\n if (response.Values[0] && response.Values[0].SurveyParameterTypeId == 5) {\r\n biometric.unit = 'bpm';\r\n }\r\n\r\n // TODO: change this to work with the configuration\r\n var date = $filter('date')(MonitoringService.getUtcDate(response.Date), 'shortDate');\r\n MonitoringBiometricsService.addReading(biometric, date, response, timeZone);\r\n });\r\n });\r\n\r\n $scope.biometrics.forEach(function (biometric) {\r\n MonitoringBiometricsService.finalizeBiometric(biometric, dates);\r\n });\r\n }\r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n scope: {\r\n startDate: '=',\r\n endDate: '=',\r\n enableCollapse: '=',\r\n readingThreshold: '=',\r\n showGraphHeader: '='\r\n },\r\n replace: true,\r\n templateUrl: 'modules/patient/monitoring/biometrics/biometrics.tpl.html',\r\n controller: controller\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringBiometrics', MonitoringBiometricsDirective);\r\n","function MonitoringBiometricsService($q,lodash, $filter, moment, MonitoringService, SurveyQuestionType, AlertStatus, SurveyParameterType, vhUomConversionService) {\r\n\r\n function getBiometrics() {\r\n var q = $q.defer();\r\n\r\n return MonitoringService.getBiometricMeasurementTypes().then(function(data) {\r\n let biometrics = data\r\n .map(el => ({ \r\n name: el.ShortName, \r\n unit: el.UnitName, \r\n icon: el.Icon, \r\n types: el.SurveyQuestionTypes, \r\n parameterTypes: el.SurveyParameterTypes, \r\n deviceId: el.DeviceTypeId,\r\n isBluetooth: false,\r\n hasReadings: false,\r\n showReadings: false,\r\n showAllReadings: false,\r\n readings: [],\r\n graph: [],\r\n graph2: []\r\n }));\r\n\r\n q.resolve(biometrics);\r\n\r\n return q.promise;\r\n });\r\n }\r\n \r\n function getBiometric(biometrics, data, values) {\r\n var filtered = lodash.filter(biometrics, function (biometric) {\r\n return lodash.includes(biometric.types, data.SurveyQuestionType);\r\n });\r\n\r\n if (filtered.length == 1) {\r\n return filtered[0];\r\n }\r\n\r\n var firstType = values[0].SurveyParameterTypeId;\r\n var retVal = lodash.find(filtered, function (biometric) {\r\n return lodash.includes(biometric.parameterTypes, firstType);\r\n });\r\n return retVal;\r\n }\r\n\r\n function getNewReading(date, isParent) {\r\n var reading = {\r\n id: 0,\r\n date: $filter('date')(date.date, 'shortDate'),\r\n reading: '',\r\n unit: '',\r\n time: '',\r\n obs: date.date,\r\n alertLevel: 3,\r\n alertStatus: AlertStatus.New,\r\n readingType: 'b',\r\n isDeleted: false,\r\n hasNotes: false,\r\n alerts: []\r\n };\r\n\r\n if (isParent) {\r\n reading.readings = [];\r\n }\r\n\r\n return reading;\r\n }\r\n\r\n function findReading(biometric, date) {\r\n return lodash.find(biometric.readings, function (bioReading) {\r\n return bioReading.date.indexOf(date) > -1;\r\n });\r\n }\r\n\r\n // PUT ALL THIS SHIT IN THE SAME ARRAY\r\n function addReading(biometric, date, response, timeZone) {\r\n var reading = findReading(biometric, date, response);\r\n\r\n // If the reading is undefined it does not belong to the current date range\r\n if(reading === undefined) {\r\n return;\r\n }\r\n\r\n var child = getNewReading(date, false);\r\n mapReading(child, response, timeZone);\r\n child.biometric = biometric;\r\n if(child.unit.length == 0) {\r\n child.unit = biometric.unit;\r\n }\r\n\r\n child.graphNodes = [];\r\n\r\n mapAlternateReading(biometric, child);\r\n addAlertIcon(biometric, child);\r\n reading.readings.push(child);\r\n\r\n addGraphNodes(biometric, response, child);\r\n }\r\n\r\n function addAlertIcon(biometric, reading) {\r\n reading.alerts.forEach(function(alert){\r\n alert.icon = biometric.icon;\r\n });\r\n }\r\n\r\n function mapReading(reading, response, timeZone) {\r\n var value = getValue(response.Values);\r\n var alerts = getAlertInfo(response.Alerts);\r\n\r\n var serializedDate = response.Values[0].ObservationDateTime_UTC;\r\n var d = moment.tz(serializedDate, timeZone);\r\n\r\n var serializedCreatedDate = response.CreatedDateTime_UTC;\r\n var cd = moment.tz(serializedCreatedDate, timeZone);\r\n\r\n reading.id = response.PatientResponseId;\r\n reading.reading = value.reading;\r\n reading.unit = value.unit;\r\n reading.time = d.format('HH:mm');\r\n reading.date = d.format('l');\r\n reading.createdTime = cd.format('HH:mm');\r\n reading.createdDate = cd.format('l');\r\n reading.obs = new Date(Date.parse(d.format()));\r\n reading.created = new Date(Date.parse(cd.format()));\r\n reading.alertLevel = alerts.alertLevel;\r\n reading.alertStatus = alerts.alertStatus;\r\n reading.readingType = response.PatientResponseInputMethod == 1 ? 'm' : response.PatientResponseInputMethod == 3 ? 'd' : 'b';\r\n reading.isDeleted = !(response.DeletedDateTime_UTC === undefined || response.DeletedDateTime_UTC === null);\r\n reading.response = response;\r\n reading.alerts = response.Alerts;\r\n reading.message = alerts.message;\r\n reading.hasNotes = false;\r\n\r\n if(value.bloodSugarType) {\r\n reading.bloodSugarType = value.bloodSugarType;\r\n }\r\n\r\n if(response.Alerts.length > 0) {\r\n var notes = lodash(response.Alerts).pluck('PatientChartEntries').flatten().value();\r\n reading.hasNotes = notes.length > 0;\r\n\r\n reading.alerts.forEach(function(a){\r\n a.response = reading;\r\n });\r\n }\r\n }\r\n\r\n function mapAlternateReading(biometric, reading) {\r\n if(biometric.displayBoth) {\r\n var unit = reading.unit.length > 0 ? reading.unit : biometric.unit;\r\n if(unit.indexOf('F') > -1){\r\n reading.alternateReading = vhUomConversionService.convertToC(reading.reading);\r\n reading.alternateUnit = '°C';\r\n }\r\n else if(unit.indexOf('C') > -1){\r\n reading.alternateReading = vhUomConversionService.convertToF(reading.reading);\r\n reading.alternateUnit = '°F';\r\n }\r\n else if(unit.indexOf('lbs') > -1){\r\n reading.alternateReading = vhUomConversionService.convertToKg(reading.reading);\r\n reading.alternateUnit = 'kg';\r\n }\r\n else {\r\n reading.alternateReading = vhUomConversionService.convertToLb(reading.reading);\r\n reading.alternateUnit = +reading.reading === 1 ? 'lb' : 'lbs';\r\n }\r\n }\r\n }\r\n\r\n function getValue(values) {\r\n var value = {\r\n reading: '',\r\n unit: ''\r\n };\r\n\r\n var parameterTypes = lodash(values).pluck('SurveyParameterTypeId').value();\r\n\r\n if(values[0].SkipReason && values[0].SkipReason !== null && values[0].SkipReason.length > 0) {\r\n value.reading = '--';\r\n if(lodash.includes(parameterTypes, SurveyParameterType.Systolic)) {\r\n value.reading += '/--';\r\n }\r\n\r\n return value;\r\n }\r\n\r\n if(values.length === 1) {\r\n value.reading = values[0].Value;\r\n if(lodash.includes(parameterTypes, SurveyParameterType.TempCelsius)) {\r\n value.unit = '°C';\r\n }\r\n else if(lodash.includes(parameterTypes, SurveyParameterType.TempFahrenheit)) {\r\n value.unit = '°F';\r\n }\r\n\r\n return value;\r\n }\r\n\r\n if(values.length === 2 && lodash.includes(parameterTypes, SurveyParameterType.Details)) {\r\n value.reading = values[0].SurveyParameterTypeId === SurveyParameterType.Details\r\n ? values[1].Value\r\n : values[0].Value;\r\n\r\n return value;\r\n }\r\n\r\n var partOne, partTwo, partThree;\r\n\r\n if(lodash.includes(parameterTypes, SurveyParameterType.Systolic)) {\r\n partOne = +(values[0].SurveyParameterTypeId === SurveyParameterType.Diastolic);\r\n partTwo = +(values[0].SurveyParameterTypeId === SurveyParameterType.Systolic);\r\n value.reading = values[partOne].Value + '/' + values[partTwo].Value;\r\n }\r\n else if(lodash.includes(parameterTypes, SurveyParameterType.Weight)) {\r\n partOne = +(values[0].SurveyParameterTypeId === SurveyParameterType.UnitType);\r\n partTwo = +(values[0].SurveyParameterTypeId === SurveyParameterType.Weight);\r\n value.reading = values[partOne].Value;\r\n value.unit = values[partTwo].Value;\r\n }\r\n else if(lodash.includes(parameterTypes, SurveyParameterType.BloodSugar)) {\r\n partOne = findParameterType(values, SurveyParameterType.BloodSugar);\r\n partTwo = findParameterType(values, SurveyParameterType.ReadingType);\r\n partThree = findParameterType(values, SurveyParameterType.UnitType);\r\n\r\n value.reading = partOne.Value;\r\n value.bloodSugarType = partTwo.Value;\r\n if(value.bloodSugarType == 'PP') {\r\n value.bloodSugarType = 'Post Prandial';\r\n }\r\n value.unit = partThree ? partThree.Value : 'mg/dL';\r\n }\r\n else if(lodash.includes(parameterTypes, SurveyParameterType.ReadingType)) {\r\n partOne = +(values[0].SurveyParameterTypeId === SurveyParameterType.ReadingType);\r\n value.reading = values[partOne].Value;\r\n }\r\n else if (lodash.includes(parameterTypes, SurveyParameterType.HbA1c)) {\r\n partOne = +(values[0].SurveyParameterTypeId === SurveyParameterType.UnitType);\r\n partTwo = +(values[0].SurveyParameterTypeId === SurveyParameterType.HbA1c);\r\n value.reading = values[partOne].Value;\r\n value.unit = values[partTwo].Value;\r\n }\r\n else if (lodash.includes(parameterTypes, SurveyParameterType.Hour)) {\r\n partOne = +(values[0].SurveyParameterTypeId === SurveyParameterType.Min);\r\n partTwo = +(values[0].SurveyParameterTypeId === SurveyParameterType.Hour);\r\n \r\n if(values[partOne].Value.length < 2) {\r\n values[partOne].Value = '0' + values[partOne].Value;\r\n }\r\n \r\n if (values[partTwo].Value.length< 2) {\r\n values[partTwo].Value = '0' + values[partTwo].Value;\r\n }\r\n value.reading = values[partOne].Value + ':' + values[partTwo].Value;\r\n }\r\n else if (lodash.includes(parameterTypes, SurveyParameterType.Steps)) {\r\n partOne = +(values[0].SurveyParameterTypeId === SurveyParameterType.UnitType);\r\n partTwo = +(values[0].SurveyParameterTypeId === SurveyParameterType.Steps);\r\n value.reading = values[partOne].Value;\r\n value.unit = values[partTwo].Value;\r\n } else if (lodash.includes(parameterTypes, SurveyParameterType.Oxygen)){\r\n value.reading = values[0].Value;\r\n value.unit = '%';\r\n }\r\n\r\n return value;\r\n }\r\n\r\n function findParameterType(values, typeId) {\r\n return lodash.find(values, function (value) {\r\n return value.SurveyParameterTypeId == typeId;\r\n });\r\n }\r\n\r\n function addGraphNodes(biometric, response, reading) {\r\n var alerts = getAlertInfo(response.Alerts);\r\n var uom = biometric.unit;\r\n var status = getGraphNodeStatus(alerts.alertLevel);\r\n var state = getGraphNodeState(reading, alerts.alertStatus);\r\n\r\n var value = getValue(response.Values);\r\n\r\n if(!value || !value.reading || value.reading.indexOf('--') > -1 || value.reading == '') {\r\n console.log(biometric, response, reading);\r\n return;\r\n }\r\n\r\n if(value.unit.indexOf('F') > -1 && uom.indexOf('F') == -1){\r\n value.reading = vhUomConversionService.convertToC(value.reading);\r\n }\r\n else if(value.unit.indexOf('C') > -1 && uom.indexOf('C') == -1) {\r\n value.reading = vhUomConversionService.convertToF(value.reading);\r\n }\r\n else if(value.unit.indexOf('kg') > -1 && uom.indexOf('kg') == -1) {\r\n value.reading = vhUomConversionService.convertToLb(value.reading);\r\n }\r\n else if(value.unit.indexOf('lb') > -1 && uom.indexOf('lb') == -1) {\r\n value.reading = vhUomConversionService.convertToKg(value.reading);\r\n }\r\n\r\n \r\n\r\n var node;\r\n if(biometric.name=='BP' && response.Values.length > 1) {\r\n node = mapGraphNode(response.PatientResponseId, response.Values[0].Value, response.Values[0].ObservationDateTime_UTC, uom, status, state);\r\n var secondaryNode = mapGraphNode(response.PatientResponseId, response.Values[1].Value, response.Values[1].ObservationDateTime_UTC, uom, status, state);\r\n biometric.graph.push(secondaryNode);\r\n reading.graphNodes.push(secondaryNode);\r\n biometric.graph2.push(node);\r\n reading.graphNodes.push(node);\r\n }\r\n else {\r\n node = mapGraphNode(response.PatientResponseId, value.reading, response.Values[0].ObservationDateTime_UTC, uom, status, state);\r\n biometric.graph.push(node);\r\n reading.graphNodes.push(node);\r\n }\r\n }\r\n\r\n function getGraphNodeStatus(alertLevel) {\r\n return alertLevel == 3 ? 'normal' : alertLevel == 2 ? 'warning' : 'danger';\r\n }\r\n\r\n function getGraphNodeState(reading, alertStatus) {\r\n if(reading.isDeleted) {\r\n return 'declined';\r\n }\r\n\r\n return alertStatus == AlertStatus.New ? 'normal' : alertStatus == AlertStatus.Accepted ? 'accepted' : 'declined';\r\n }\r\n\r\n function mapGraphNode(id, value, date, uom, status, state) {\r\n return {\r\n id: id,\r\n date: new Date(Date.parse(date)),\r\n value: +value,\r\n baseline: '',\r\n units: uom,\r\n status: status,\r\n state: state\r\n };\r\n }\r\n\r\n function addGraphEndDates(dates, graph) {\r\n if(graph.length > 0) {\r\n var firstDate = dates[0].date;\r\n var first = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate(), 0, 0, 0);\r\n graph.unshift({date: first, value: graph[0].value, baseline: '', units: graph[0].units, status: 'normal', state: 'normal'});\r\n var lastDate = dates[dates.length - 1].date;\r\n var last = new Date(lastDate.getFullYear(), lastDate.getMonth(), lastDate.getDate(), 24, 59, 59);\r\n graph.push({date: last, value: graph[graph.length - 1].value, baseline: '', units: graph[graph.length - 1].units, status: 'normal', state: 'normal'});\r\n }\r\n }\r\n\r\n function finalizeBiometric(biometric, dates) {\r\n function dateProp(a) {\r\n return a.date;\r\n }\r\n\r\n function obsProp(a) {\r\n return a.obs;\r\n }\r\n\r\n sortByDate(biometric.graph, dateProp);\r\n addGraphEndDates(dates, biometric.graph);\r\n\r\n if(biometric.graph2.length > 0) {\r\n sortByDate(biometric.graph2, dateProp);\r\n addGraphEndDates(dates, biometric.graph2);\r\n }\r\n\r\n biometric.multipleReadings = false;\r\n biometric.readings.forEach(function(reading){\r\n sortByDate(reading.readings, obsProp);\r\n reading.readings.reverse();\r\n if(reading.readings.length > 1){\r\n biometric.multipleReadings = true;\r\n }\r\n });\r\n }\r\n\r\n function sortByDate(values, prop) {\r\n values.sort(function (a, b) {\r\n var aa = prop(a);\r\n var bb = prop(b);\r\n\r\n if (aa !== bb) {\r\n if (aa > bb) {\r\n return 1;\r\n }\r\n if (bb > aa) {\r\n return -1;\r\n }\r\n }\r\n return aa - bb;\r\n });\r\n }\r\n\r\n function getAlertInfo(alerts) {\r\n var alertDisplay = {\r\n alertLevel: 3,\r\n alertStatus: AlertStatus.New,\r\n message: ''\r\n };\r\n\r\n if (alerts.length == 0) {\r\n return alertDisplay;\r\n }\r\n\r\n alertDisplay.alertLevel = lodash(alerts).pluck('AlertSeverityLevelId').min();\r\n alertDisplay.alertStatus = lodash(alerts).pluck('AlertStatusId').min();\r\n alertDisplay.message = lodash.pluck(alerts, 'Message').join(' ');\r\n\r\n return alertDisplay;\r\n }\r\n\r\n return {\r\n getBiometrics: getBiometrics,\r\n getBiometric: getBiometric,\r\n getNewReading: getNewReading,\r\n addReading: addReading,\r\n addGraphNodes: addGraphNodes,\r\n finalizeBiometric: finalizeBiometric\r\n }\r\n\r\n}\r\n\r\nangular.module(\"patient.monitoring\").service(\"MonitoringBiometricsService\", MonitoringBiometricsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/biometrics.tpl.html',\n '
          There are no biometric readings for these dates.
          ');\n}]);\n}(window, document, window.angular));","\r\nvar bioMetricSummaryInjects = ['$scope', 'PermissionService', 'MonitoringViewType', 'MonitoringEventsService', 'ConfigurationsService', 'AlertType', 'AlertSeverityLevel', 'AlertStatus'];\r\n\r\nvar bioMetricSummaryScope = { \r\n readingDate: '=',\r\n biometricInfo: '=',\r\n enableCollapse: '=',\r\n readingThreshold: '='\r\n};\r\n\r\nvar bioMetricSummaryAttributes = {\r\n readingDate: { required: true, default: {} },\r\n biometricInfo: { required: true, default: {} },\r\n enableCollapse: { required: true, default: false },\r\n readingThreshold: { required: true, default: 0 }\r\n};\r\n\r\nclass BiometricSummaryDirective {\r\n\r\n constructor(){\r\n this.restrict = 'E';\r\n this.scope = bioMetricSummaryScope;\r\n this.controllerAs = 'vm';\r\n this.controller = 'BiometricSummaryController';\r\n this.templateUrl = \"modules/patient/monitoring/biometrics/biometricsummary.tpl.html\";\r\n }\r\n\r\n link(scope, element, attrs, controller, transcludeFn) {\r\n controller.element = element;\r\n }\r\n\r\n}\r\n\r\nclass BiometricSummaryController {\r\n\r\n constructor(){\r\n // set properties based on passed in injected parameters\r\n [...arguments].forEach((argument, index) => this[bioMetricSummaryInjects[index]] = argument);\r\n\r\n Object.keys(bioMetricSummaryAttributes).forEach(prop => {\r\n var property = bioMetricSummaryAttributes[prop];\r\n var scopeValue = this.$scope[prop];\r\n \r\n if(property.required && scopeValue == null)\r\n throw `Attribute ${prop} is required`\r\n \r\n // set the property to the scope value or the default value defined above\r\n this[prop] = scopeValue || property.default;\r\n \r\n // if we have watch logic set up a $scope watch to update local data\r\n if(property.watch){\r\n this.$scope.$watch(prop, newValue => {\r\n this[prop] = newValue;\r\n Reflect.apply(property.watch, this, [newValue])\r\n });\r\n }else{ // else let's set up a default that will update our controller values when scope values change\r\n //this.$scope.$watch(prop, newValue => this[prop] = newValue);\r\n }\r\n });\r\n \r\n \r\n var separator = '/';\r\n this.summary = { \r\n _averages: [], \r\n get average(){ return this._averages.join(separator) },\r\n _min: [],\r\n get min(){ return this._min.join(separator) },\r\n _max: [],\r\n get max(){ return this._max.join(separator) }\r\n };\r\n\r\n this._selected = false;\r\n\r\n var index = this.biometricInfo.readings.indexOf(this.readingDate);\r\n this.popupPlacement = index < 3 ? 'top-left' : index >= 3 && index < 9 ? 'top' : 'top-right';\r\n \r\n this.popupTemplate = 'modules/patient/monitoring/biometrics/biometricsummarypopup.tpl.html';\r\n \r\n this.enableAlerts = this.PermissionService.userHasPermission(['PatientAlertsWrite']);\r\n this.canModify = this.PermissionService.userHasPermission(['ModifyResponse']);\r\n\r\n \r\n this.startDate = new Date(this.biometricInfo.readings[0].date).removeTime();\r\n this.endDate = new Date(this.biometricInfo.readings[this.biometricInfo.readings.length - 1].date);\r\n this.selectedDate = new Date(this.readingDate.date).removeTime();\r\n \r\n if(this.readingDate.readings.filter(x => !x.isDeleted).length > 0){\r\n var values = this.readingDate.readings[0].response.Values;\r\n values.forEach((x, index)=>{\r\n var actualValues = this.readingDate.readings.filter(x => !x.isDeleted).map(r => parseFloat(r.response.Values[index].Value)).filter(x => x);\r\n if(actualValues.length > 0){\r\n this.summary._averages.push(Math.ceil(actualValues.reduce((total, value)=> total + parseFloat(value))/actualValues.length));\r\n this.summary._min.push(Math.min(...actualValues));\r\n this.summary._max.push(Math.max(...actualValues));\r\n }\r\n });\r\n };\r\n\r\n\r\n var allAlerts = this.readingDate.readings.map(r => r.alerts).flat().sort((a,b)=> new Date(a.AlertStatusSetDateTime_UTC) > new Date(b.AlertStatusSetDateTime_UTC) ? 1 : -1 );\r\n this.summary.alerts = allAlerts.filter(a => a.AlertSeverityLevelId == this.AlertSeverityLevel.High && a.AlertStatusId == this.AlertStatus.New).length;\r\n this.summary.warnings = allAlerts.filter(a => a.AlertSeverityLevelId == this.AlertSeverityLevel.Medium && a.AlertStatusId == this.AlertStatus.New).length;\r\n this.summary.notifications = allAlerts.filter(a => a.AlertSeverityLevelId == this.AlertSeverityLevel.Notification && a.AlertStatusId == this.AlertStatus.New).length;\r\n\r\n \r\n\r\n this.MonitoringEventsService.onSelectSummary((selected)=>{\r\n this.selected = selected == this && this._selected;\r\n });\r\n\r\n }\r\n\r\n get selected(){\r\n return this._selected;\r\n }\r\n\r\n set selected(value){\r\n if(this._selected != value){\r\n this._selected = value;\r\n this.MonitoringEventsService.selectSummary(this);\r\n } \r\n }\r\n\r\n get alertTooltip(){\r\n return `
          High Alerts: ${this.summary.alerts}
          ` +\r\n `
          Medium Alerts: ${this.summary.warnings}
          ` +\r\n `
          Notifications: ${this.summary.notifications}
          `;\r\n }\r\n\r\n get toolTip(){\r\n return `
          Avg: ${this.summary.average}
          ` +\r\n `
          Min: ${this.summary.min}
          ` +\r\n `
          Max: ${this.summary.max}
          `;\r\n }\r\n\r\n}\r\n\r\nangular.module('patient.monitoring')\r\n.directive('biometricSummary', ()=> new BiometricSummaryDirective())\r\n.controller('BiometricSummaryController',[...bioMetricSummaryInjects, function(){ return new BiometricSummaryController(...arguments) }]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/biometricsummary.tpl.html',\n '
          {{vm.summary.average}}
          0\" ng-class=\"{\\'label-outline text-muted\\': vm.summary.alerts == 0}\">{{vm.summary.alerts}}
          0\" ng-class=\"{\\'label-outline text-muted\\': vm.summary.warnings == 0}\">{{vm.summary.warnings}}
          0\" ng-class=\"{\\'label-outline text-muted\\': vm.summary.notifications == 0}\">{{vm.summary.notifications}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/biometricsummarypopup.tpl.html',\n '
          {{vm.readingDate.date}} Avg: {{vm.summary.average}} Min: {{vm.summary.min}} Max: {{vm.summary.max}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/collapsedreadingtooltip.tpl.html',\n '
          {{item.Message}}
          {{item.reading}} 0\">({{item.unit}})
          {{item.alternateReading}} ({{item.alternateUnit}}) ({{item.readingType}})
          {{item.bloodSugarType}}
          {{item.date | datetime}} {{item.time}}
          ({{item.createdDate | datetime}} {{item.createdTime}})
          ');\n}]);\n}(window, document, window.angular));","function ModifyResponseController($uibModalInstance) {\r\n var mvm = this;\r\n mvm.modifyReason = '';\r\n\r\n mvm.ok = function() {\r\n $uibModalInstance.close(mvm.modifyReason);\r\n };\r\n\r\n mvm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').controller('ModifyResponseController', ModifyResponseController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/modifyresponse.modal.html',\n '
          Reason for Modifying
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/biometrics/valuetooltip.tpl.html',\n '
          {{biometricReading.date | datetime}} {{biometricReading.time}}
          ({{biometricReading.createdDate | datetime}} {{biometricReading.createdTime}})
          {{biometricReading.reading}} 0\">({{biometricReading.unit}}) {{biometricReading.alternateReading}} ({{biometricReading.alternateUnit}}) ({{biometricReading.readingType}})
          {{biometricReading.bloodSugarType}}
          0\" class=\"row response-tooltip-alerts p-t-sm p-b-sm\">
          0\" class=\"row p-t-xs\">
          {{tooltipMessage.notes}}
          ');\n}]);\n}(window, document, window.angular));","function MonitoringHealthIndexDirective() {\r\n\r\n function controller($scope, MonitoringEventsService, MonitoringService) {\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.scores = [];\r\n $scope.isDataView = true;\r\n\r\n MonitoringEventsService.onHealthScoresChanged(loadCurrentHealthScores);\r\n }\r\n\r\n function loadCurrentHealthScores(scores, start, end) {\r\n $scope.scores = [];\r\n\r\n var currentDate = new Date(start.getTime());\r\n var endDate = new Date(end.getTime());\r\n endDate.setDate(endDate.getDate() + 1);\r\n var index = 0;\r\n\r\n while (!MonitoringService.areDatesEqual(currentDate, endDate)) {\r\n\r\n var healthScoreModel = {\r\n score: '',\r\n date: currentDate,\r\n valid: true,\r\n status: ''\r\n };\r\n\r\n for (var i = index; i < scores.length; i++) {\r\n if (MonitoringService.areDatesEqual(currentDate, scores[i].date)) {\r\n index = i;\r\n healthScoreModel = scores[i];\r\n break;\r\n }\r\n }\r\n\r\n $scope.scores.push(healthScoreModel);\r\n\r\n currentDate.setDate(currentDate.getDate() + 1);\r\n }\r\n }\r\n\r\n $scope.getBarHeight = function (score) {\r\n if (!score.score || score.score == \"\") {\r\n return 0;\r\n }\r\n\r\n return 41 * (score.score / 100);\r\n };\r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n replace: true,\r\n require: '^monitoringBiometrics',\r\n templateUrl: 'modules/patient/monitoring/indexes/healthindex.tpl.html',\r\n controller: controller\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringHealthIndex', MonitoringHealthIndexDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/indexes/healthindex.tpl.html',\n 'Health Index {{score.score}} --
          ');\n}]);\n}(window, document, window.angular));","function PatientMonitoringController(healthScores, patientContent, monitoringData, monitoringConfig, $filter, lodash, $stateParams, AlertCategory, MonitoringViewType, MonitoringService, MonitoringAlertService, MonitoringEventsService, ConfigurationsService, HelpService, $rootScope, $scope) {\r\n var vm = this;\r\n\r\n var timeZoneInfo = patientContent.patient.patientTimeZoneName;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.healthScores = healthScores;\r\n vm.startDate = monitoringData.startDate;\r\n vm.endDate = monitoringData.endDate;\r\n loadPatientResponses(vm.startDate, vm.endDate, false);\r\n vm.programStartDate = patientContent.patient.program.startDate;\r\n vm.dayHeaders = [];\r\n vm.viewType = MonitoringViewType.Grid;\r\n vm.loadPatientResponses = loadPatientResponses;\r\n vm.patientContent = patientContent;\r\n\r\n loadDayHeaders(vm.startDate);\r\n\r\n vm.responseData = monitoringData.data;\r\n vm.biometrics = {\r\n data: monitoringData.data.Biometrics,\r\n dates: vm.dayHeaders\r\n };\r\n\r\n vm.surveys = {\r\n data: monitoringData.data.Surveys,\r\n startDate: vm.startDate,\r\n endDate: vm.endDate\r\n };\r\n\r\n //vm.alerts = monitoringData.data.Alerts;\r\n vm.alerts = getAlerts(vm.biometrics, vm.surveys, monitoringData.tasks);\r\n MonitoringEventsService.init();\r\n\r\n MonitoringEventsService.onAlertsLoaded(function(){\r\n MonitoringEventsService.updateAlerts(vm.alerts);\r\n });\r\n\r\n MonitoringEventsService.onBiometricsLoaded(function(){\r\n MonitoringEventsService.updateBiometrics(vm.biometrics, timeZoneInfo);\r\n });\r\n\r\n MonitoringEventsService.onSurveysLoaded(function() {\r\n MonitoringEventsService.updateSurveys(vm.surveys, timeZoneInfo);\r\n });\r\n\r\n MonitoringEventsService.onGetDisplayType(function() {\r\n return vm.viewType;\r\n });\r\n\r\n var biometricAdded = $rootScope.$on(\"vh:biometricsAdded\", function () {\r\n loadPatientResponses(vm.startDate, vm.endDate, true);\r\n });\r\n\r\n\r\n vm.readingThreshold = monitoringConfig.readingThreshold;\r\n vm.enableReadingCollapse = monitoringConfig.enableReadingCollapse;\r\n vm.showGraphHeader = monitoringConfig.showGraphHeader;\r\n\r\n vm.toggleReadingsHeading = 'Collapse';\r\n \r\n \r\n\r\n $scope.$on(\"$destroy\", biometricAdded);\r\n\r\n }\r\n\r\n vm.toggleHeading = 'Expand';\r\n\r\n vm.toggleExpand = function() {\r\n MonitoringEventsService.expandCurrentSurveys();\r\n var expandHeading = vm.toggleHeading == 'Collapse' ? 'Expand' : 'Collapse';\r\n vm.toggleHeading = expandHeading;\r\n };\r\n\r\n vm.toggleGraphHeading = 'Collapse';\r\n\r\n vm.toggleGraphExpand = function() {\r\n MonitoringEventsService.expandCurrentGraphs(vm.toggleGraphHeading == 'Expand');\r\n var expandHeading = vm.toggleGraphHeading == 'Collapse' ? 'Expand' : 'Collapse';\r\n vm.toggleGraphHeading = expandHeading;\r\n };\r\n\r\n\r\n vm.toggleReadingsExpand = function(){\r\n MonitoringEventsService.expandReadings(vm.toggleReadingsHeading == 'Expand');\r\n var expandHeading = vm.toggleReadingsHeading == 'Collapse' ? 'Expand' : 'Collapse';\r\n vm.toggleReadingsHeading = expandHeading;\r\n };\r\n\r\n vm.updateViewType = function(viewType) {\r\n vm.toggleGraphHeading = 'Collapse';\r\n vm.viewType = viewType;\r\n MonitoringEventsService.displayTypeChanged(viewType);\r\n };\r\n\r\n function loadPatientResponses(start, end, skipDateComparison) {\r\n if ((!skipDateComparison || skipDateComparison === undefined) && MonitoringService.areDatesEqual(vm.startDate, start)) {\r\n return;\r\n }\r\n vm.toggleHeading = 'Expand';\r\n vm.startDate = start;\r\n vm.endDate = end;\r\n \r\n if (vm.startDate.getHours() == 0) {\r\n vm.startDate.addHours(12);//avoid issues with tome zone convertion.\r\n vm.endDate.addHours(12);\r\n } \r\n\r\n MonitoringService.getPatientResponses($stateParams.patientId, start, end).then(function (data) {\r\n return {\r\n responseData: data,\r\n biometrics: data.Biometrics,\r\n surveys: data.Surveys\r\n };\r\n }).then(function (responseData) {\r\n return MonitoringAlertService.getAlertTasks($stateParams.patientId).then(function (data) {\r\n\r\n /* Check for alerts in the past for example welcomecall*/\r\n var earliestDate = vm.programStartDate;\r\n for(x in data){\r\n if(data[x].CreatedDate < earliestDate){\r\n earliestDate = data[x].CreatedDate;\r\n }\r\n }\r\n if(earliestDate < vm.programStartDate){\r\n //We have found an alert that is befor the program Start Date. Allow user to browse to this date\r\n vm.programStartDate = earliestDate;\r\n } \r\n\r\n loadDayHeaders(vm.startDate);\r\n\r\n vm.responseData = data;\r\n vm.biometrics = {\r\n data : responseData.biometrics,\r\n dates: vm.dayHeaders\r\n };\r\n vm.surveys = {\r\n data: responseData.surveys,\r\n startDate: vm.startDate,\r\n endDate: vm.endDate\r\n };\r\n vm.alerts = getAlerts(vm.biometrics, vm.surveys, data);\r\n });\r\n })\r\n .then(function(){\r\n MonitoringEventsService.updateAlerts(vm.alerts);\r\n MonitoringEventsService.updateBiometrics(vm.biometrics, timeZoneInfo);\r\n MonitoringEventsService.updateSurveys(vm.surveys, timeZoneInfo);\r\n });\r\n\r\n }\r\n\r\n function getAlerts(biometrics, surveys, tasks) {\r\n var alerts = [];\r\n\r\n lodash(surveys.data).pluck('Questions').flatten().pluck('Responses').flatten().pluck('Alerts').flatten().value()\r\n .forEach(function (alert) {\r\n alert.Category = AlertCategory.Survey;\r\n alerts.push(alert);\r\n });\r\n\r\n lodash(biometrics.data).pluck('Responses').flatten().pluck('Alerts').flatten().value()\r\n .forEach(function (alert) {\r\n alert.Category = AlertCategory.Biometric;\r\n alerts.push(alert);\r\n });\r\n\r\n tasks.forEach(function (task) {\r\n var date = new Date(Date.parse(task.CreatedDateTime_UTC));\r\n date.setHours(0,0,0,0);\r\n if (date >= vm.startDate && date <= vm.endDate) {\r\n var found = lodash(alerts).find({PatientAlertId: task.PatientAlertId});\r\n if(!found) {\r\n task.Category = AlertCategory.Task;\r\n alerts.push(task);\r\n }\r\n }\r\n });\r\n\r\n monitoringData.data.Alerts.forEach(function(a) {\r\n var found = lodash(alerts).find({PatientAlertId: a.PatientAlertId});\r\n if(!found) {\r\n alerts.push(a);\r\n }\r\n });\r\n\r\n return alerts;\r\n }\r\n \r\n function loadDayHeaders(start) {\r\n var startDate = new Date(start.getTime());\r\n vm.dayHeaders = [];\r\n for (var i = 13; i >= 0; i--) {\r\n var date = $filter('date')(startDate, 'MMM d EEE');\r\n var parts = date.split(' ');\r\n var shortDate = parts[0] + ' ' + parts[1];\r\n if(ConfigurationsService.configParams.DateFormat.toLowerCase() === \"dd/mm/yyyy\") {\r\n var shortDate = parts[1] + ' ' + parts[0];\r\n }\r\n var dayHeader = {\r\n day: parts[2],\r\n shortDate: shortDate,\r\n date: new Date(startDate.getTime())\r\n };\r\n \r\n vm.dayHeaders.push(dayHeader);\r\n startDate.setDate(startDate.getDate() + 1)\r\n }\r\n }\r\n\r\n vm.showUserGuideHealthScore = function() {\r\n HelpService.showUserGuides(\"content.healthscore\");\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').controller('PatientMonitoringController', PatientMonitoringController);\r\n","function MonitoringEventsService() {\r\n\r\n var expandCurrentBiometricsHandler;\r\n var expandCurrentGraphsHandler = [];\r\n var expandCurrentSurveysHandler;\r\n var alertHandler;\r\n var statusChangeHandler;\r\n var onGetDisplayTypeHandler;\r\n var getDisplayTypeHandler;\r\n\r\n var displayTypeChangedHandlers = [];\r\n var healthScoresChangedHandler;\r\n var healthScoresLoadedHandler;\r\n var biometricsLoadedHandler = [];\r\n var updateBiometricsHandler;\r\n var surveysLoadedHandler = [];\r\n var updateSurveysHandler;\r\n var alertsLoadedHandler;\r\n var updateAlertsHandler;\r\n var selectSummaryHandlers = [];\r\n var expandReadingsHandlers = [];\r\n\r\n function init() {\r\n expandCurrentBiometricsHandler = undefined;\r\n expandCurrentGraphsHandler = [];\r\n alertHandler = undefined;\r\n onGetDisplayTypeHandler = undefined;\r\n getDisplayTypeHandler = undefined;\r\n\r\n displayTypeChangedHandlers = [];\r\n healthScoresChangedHandler = undefined;\r\n healthScoresLoadedHandler = undefined;\r\n biometricsLoadedHandler = [];\r\n updateBiometricsHandler = undefined;\r\n surveysLoadedHandler = [];\r\n updateSurveysHandler = undefined;\r\n alertsLoadedHandler = undefined;\r\n updateAlertsHandler = undefined;\r\n\r\n selectSummaryHandlers = [];\r\n expandReadingsHandlers = []\r\n }\r\n\r\n function onGetDisplayType(handler) {\r\n onGetDisplayTypeHandler = handler;\r\n }\r\n\r\n function getDisplayType() {\r\n if (onGetDisplayTypeHandler) {\r\n return onGetDisplayTypeHandler();\r\n }\r\n }\r\n\r\n function onDisplayTypeChanged(handler) {\r\n displayTypeChangedHandlers.push(handler);\r\n }\r\n\r\n function displayTypeChanged(displayType) {\r\n if (displayTypeChangedHandlers) {\r\n displayTypeChangedHandlers.forEach(function (handler) {\r\n handler(displayType);\r\n });\r\n }\r\n }\r\n\r\n function onHealthScoresChanged(handler) {\r\n healthScoresChangedHandler = handler;\r\n }\r\n\r\n function healthScoresChanged(scores, start, end) {\r\n if (healthScoresChangedHandler) {\r\n healthScoresChangedHandler(scores, start, end);\r\n }\r\n }\r\n\r\n function onHealthScoresLoaded(handler) {\r\n healthScoresLoadedHandler = handler;\r\n }\r\n\r\n function healthScoresLoaded(scores, start, end) {\r\n if (healthScoresLoadedHandler) {\r\n healthScoresLoadedHandler(scores, start, end);\r\n }\r\n }\r\n\r\n function onBiometricsLoaded(handler) {\r\n biometricsLoadedHandler.push(handler);\r\n }\r\n\r\n function onUpdateBiometrics(handler) {\r\n updateBiometricsHandler = handler;\r\n }\r\n\r\n function onSurveysLoaded(handler) {\r\n surveysLoadedHandler.push(handler);\r\n }\r\n\r\n function onUpdateSurveys(handler) {\r\n updateSurveysHandler = handler;\r\n }\r\n\r\n function onAlertsLoaded(handler) {\r\n alertsLoadedHandler = handler;\r\n }\r\n\r\n function onUpdateAlerts(handler) {\r\n updateAlertsHandler = handler;\r\n }\r\n\r\n function biometricsLoaded(data) {\r\n if (biometricsLoadedHandler) {\r\n biometricsLoadedHandler.forEach(function (handler) {\r\n handler(data);\r\n });\r\n }\r\n }\r\n\r\n function updateBiometrics(data, info) {\r\n if (updateBiometricsHandler) {\r\n updateBiometricsHandler(data, info);\r\n }\r\n }\r\n\r\n function surveysLoaded() {\r\n if (surveysLoadedHandler) {\r\n surveysLoadedHandler.forEach(function (handler) {\r\n handler();\r\n });\r\n }\r\n }\r\n\r\n function updateSurveys(data, info) {\r\n if (updateSurveysHandler) {\r\n updateSurveysHandler(data, info);\r\n }\r\n }\r\n\r\n function alertsLoaded() {\r\n if (alertsLoadedHandler) {\r\n alertsLoadedHandler();\r\n }\r\n }\r\n\r\n function updateAlerts(data) {\r\n if (updateAlertsHandler) {\r\n updateAlertsHandler(data);\r\n }\r\n }\r\n\r\n function onExpandCurrentSurveys(handler) {\r\n expandCurrentSurveysHandler = handler;\r\n }\r\n\r\n function expandCurrentSurveys() {\r\n if (expandCurrentSurveysHandler) {\r\n expandCurrentSurveysHandler();\r\n }\r\n }\r\n\r\n function onExpandCurrentGraphs(handler) {\r\n expandCurrentGraphsHandler.push(handler);\r\n }\r\n\r\n function expandCurrentGraphs(expanding) {\r\n if (expandCurrentGraphsHandler) {\r\n expandCurrentGraphsHandler.forEach(function (handler) {\r\n handler(expanding);\r\n });\r\n }\r\n }\r\n\r\n function onHandleStatusChange(handler) {\r\n statusChangeHandler = handler;\r\n }\r\n\r\n function handleStatusChange() {\r\n if (statusChangeHandler) {\r\n statusChangeHandler();\r\n }\r\n }\r\n\r\n function onHandleAlerts(handler) {\r\n alertHandler = handler;\r\n }\r\n\r\n function handleAlerts(alerts) {\r\n if (alertHandler) {\r\n alertHandler(alerts);\r\n }\r\n }\r\n\r\n function onSelectSummary(handler) {\r\n selectSummaryHandlers.push(handler);\r\n }\r\n\r\n function selectSummary(summary) {\r\n if (selectSummaryHandlers) {\r\n selectSummaryHandlers.forEach(function (handler) {\r\n handler(summary);\r\n });\r\n }\r\n }\r\n\r\n function onExpandReadings(handler) {\r\n expandReadingsHandlers.push(handler);\r\n }\r\n\r\n function expandReadings(expanding) {\r\n selectSummary({});\r\n if (expandReadingsHandlers) {\r\n expandReadingsHandlers.forEach(function (handler) {\r\n handler(expanding);\r\n });\r\n }\r\n }\r\n\r\n return {\r\n init: init,\r\n onGetDisplayType: onGetDisplayType,\r\n getDisplayType: getDisplayType,\r\n onDisplayTypeChanged: onDisplayTypeChanged,\r\n displayTypeChanged: displayTypeChanged,\r\n onHealthScoresChanged: onHealthScoresChanged,\r\n onHealthScoresLoaded: onHealthScoresLoaded,\r\n onBiometricsLoaded: onBiometricsLoaded,\r\n onUpdateBiometrics: onUpdateBiometrics,\r\n onSurveysLoaded: onSurveysLoaded,\r\n onUpdateSurveys: onUpdateSurveys,\r\n onAlertsLoaded: onAlertsLoaded,\r\n onUpdateAlerts: onUpdateAlerts,\r\n healthScoresChanged: healthScoresChanged,\r\n healthScoresLoaded: healthScoresLoaded,\r\n biometricsLoaded: biometricsLoaded,\r\n updateBiometrics: updateBiometrics,\r\n surveysLoaded: surveysLoaded,\r\n updateSurveys: updateSurveys,\r\n alertsLoaded: alertsLoaded,\r\n updateAlerts: updateAlerts,\r\n\r\n onExpandCurrentSurveys: onExpandCurrentSurveys,\r\n expandCurrentSurveys: expandCurrentSurveys,\r\n onExpandCurrentGraphs: onExpandCurrentGraphs,\r\n expandCurrentGraphs: expandCurrentGraphs,\r\n onHandleStatusChange: onHandleStatusChange,\r\n handleStatusChange: handleStatusChange,\r\n onHandleAlerts: onHandleAlerts,\r\n handleAlerts: handleAlerts,\r\n\r\n onSelectSummary: onSelectSummary,\r\n selectSummary: selectSummary,\r\n\r\n onExpandReadings: onExpandReadings,\r\n expandReadings: expandReadings\r\n }\r\n}\r\n\r\nangular.module(\"patient.monitoring\").service(\"MonitoringEventsService\", MonitoringEventsService);\r\n","function MonitoringService($http, lodash, ConfigurationsService) {\r\n function getAllHealthScores(patientId) {\r\n return $http.get('/api/patient/' + patientId + '/healthScores').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function logPatientDataPreview(patientId) {\r\n\r\n var model = {\r\n Text: 'Transfer Patient Data Preview selected.'\r\n }\r\n\r\n return $http({\r\n url: '/api/Patient/'+ patientId +'/profilehistory',\r\n method: 'POST',\r\n data: model\r\n })\r\n .then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getBiometricMeasurementTypes() {\r\n return $http.get(\"/api/BiometricMeasurementType\")\r\n .then(function (response) {\r\n return response.data;\r\n })\r\n };\r\n\r\n function getPatientResponses(patientId, obsStart, obsEnd) {\r\n var data = {\r\n startDate: obsStart,\r\n endDate: obsEnd\r\n };\r\n\r\n return $http({\r\n url: '/api/cgp/Patient/' + patientId + '/DailyPatientResponse',\r\n method: 'GET',\r\n params: data\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPatientFirstResponseDate(patientId) {\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/response/firstresponse',\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getBiometricConfigurations() {\r\n return ConfigurationsService.getConfig().then(function (config) {\r\n return {\r\n defaultTempUnit: config.DefaultTempUnit,\r\n displayBothTempUnits: config.DisplayBothTempUnits,\r\n displayBothWeightUnits: config.DisplayBothUnitsOfWeight,\r\n defaultBloodSugarUnit: config.DefaultBloodSugarUnit\r\n };\r\n });\r\n }\r\n\r\n function changeResponseStatus(patientId, patientResponseId, reason) {\r\n return $http.put('/api/Patient/' + patientId + '/response/' + patientResponseId + '/status', JSON.stringify(reason)).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function areDatesEqual(a, b) {\r\n return a.getDate() === b.getDate() && a.getMonth() === b.getMonth() && a.getFullYear() === b.getFullYear();\r\n }\r\n\r\n function getUtcDate(serializedDate) {\r\n var d = new Date(Date.parse(serializedDate));\r\n var day = d.getUTCDate();\r\n var month = d.getUTCMonth();\r\n var year = d.getUTCFullYear();\r\n return new Date(year, month, day);\r\n }\r\n \r\n function getPatientBiometricTypes(patientId) {\r\n return $http({\r\n url: '/api/Patient/' + patientId + '/response/biometrictypes',\r\n method: 'GET'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n function getPatientStatus(patientId){\r\n return $http({\r\n url:'/api/Patient/'+patientId+'/status',\r\n method:'GET'\r\n }).then(function (response){\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getAllHealthScores: getAllHealthScores,\r\n getPatientResponses: getPatientResponses,\r\n getBiometricConfigurations: getBiometricConfigurations,\r\n changeResponseStatus: changeResponseStatus,\r\n areDatesEqual: areDatesEqual,\r\n getBiometricMeasurementTypes: getBiometricMeasurementTypes,\r\n getUtcDate: getUtcDate,\r\n getPatientBiometricTypes: getPatientBiometricTypes,\r\n getPatientFirstResponseDate: getPatientFirstResponseDate,\r\n getPatientStatus:getPatientStatus,\r\n logPatientDataPreview: logPatientDataPreview\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').service('MonitoringService', MonitoringService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/monitoring.tpl.html',\n '
          Patient Monitoring
          ');\n}]);\n}(window, document, window.angular));","function MonitoringNavigationDirective() {\r\n\r\n function controller($scope, MonitoringService, MonitoringEventsService, ConfigurationsService) {\r\n\r\n loadController();\r\n \r\n $scope.$watch(\"programStartDate\",function(newValue,oldValue){\r\n $scope.programStartDate = newValue;\r\n loadController();\r\n \r\n })\r\n\r\n function loadController() {\r\n $scope.navigationData = getNavigationData();\r\n }\r\n\r\n function getNavigationData() {\r\n var retVal = [];\r\n\r\n var endDate = new Date();\r\n endDate.setDate(endDate.getDate() + 1);\r\n\r\n var currentDate = new Date(endDate.getTime());\r\n currentDate.setDate(endDate.getDate() - 14);\r\n\r\n var patientCreatedDateTimeUtc = MonitoringService.getUtcDate($scope.patientCreatedDateTimeUtc);\r\n if (patientCreatedDateTimeUtc < currentDate) {\r\n currentDate = patientCreatedDateTimeUtc;\r\n }\r\n\r\n var index = 0;\r\n\r\n do {\r\n var healthScoreModel = {\r\n score: '',\r\n date: new Date(currentDate.getTime()),\r\n valid: true,\r\n status: ''\r\n };\r\n\r\n if (index < $scope.healthScores.length) {\r\n var currentHealthScore = $scope.healthScores[index];\r\n var currentParsedDate = MonitoringService.getUtcDate(currentHealthScore.ScoreDate);\r\n if (MonitoringService.areDatesEqual(currentDate, currentParsedDate)) {\r\n healthScoreModel.score = currentHealthScore.Score;\r\n healthScoreModel.valid = !currentHealthScore.IsInvalidScore;\r\n healthScoreModel.status = getScoreStatus(currentHealthScore);\r\n index++;\r\n }\r\n }\r\n\r\n retVal.push(healthScoreModel);\r\n currentDate.setDate(currentDate.getDate() + 1);\r\n }\r\n while (!MonitoringService.areDatesEqual(currentDate, endDate));\r\n\r\n return retVal;\r\n }\r\n\r\n function getScoreStatus(score) {\r\n if (score && score.score != '') {\r\n var style = \"normal\";\r\n\r\n if (score.IsInvalidScore || (score.Score > 50 && score.Score <= 75)) {\r\n style = \"warning\";\r\n } else if (score.Score <= 50) {\r\n style = \"danger\";\r\n } else if(ConfigurationsService.configParams.DisplayGreenBiometricIcons === true) {\r\n style = \"success\";\r\n }\r\n\r\n return style;\r\n }\r\n }\r\n\r\n $scope.updateNav = function (start, end) {\r\n $scope.updateDates({start: start, end: end});\r\n MonitoringEventsService.healthScoresChanged($scope.navigationData, start, end);\r\n };\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n templateUrl: 'modules/patient/monitoring/navigation/navigation.tpl.html',\r\n scope: {\r\n healthScores: '=',\r\n programStartDate: '=?',\r\n updateDates: '&',\r\n patientCreatedDateTimeUtc: '='\r\n },\r\n \r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringNavigation', MonitoringNavigationDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/navigation/navigation.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/surveys/questiontooltip.tpl.html',\n '
          {{response.date | datetime}} {{response.time}}
          ({{response.createdDate | datetime}} {{response.createdTime}})
          {{response.value}}
          0\" class=\"row response-tooltip-alerts p-t-sm p-b-sm\">
          {{tooltipMessage.question}}
          {{tooltipMessage.message}}
          0\" class=\"row p-t-xs\">
          {{tooltipMessage.notes}}
          ');\n}]);\n}(window, document, window.angular));","function MonitoringSurveyQuestionDirective() {\r\n\r\n function controller(PermissionService, ConfigurationsService, lodash, $scope, $filter, AlertSeverityLevel, AlertStatus, AlertClass, SurveyParameterType, vhSweetAlert) {\r\n\r\n var vm = this;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.vm = vm;\r\n\r\n vm.dateFormat = ConfigurationsService.configParams.DateFormat.toUpperCase();\r\n\r\n vm.tooltipTemplateUrl = 'modules/patient/monitoring/surveys/questiontooltip.tpl.html';\r\n vm.getAlertSeverityClass = getAlertSeverityClass;\r\n\r\n intializeResponses();\r\n }\r\n\r\n $scope.toggleAlertSelection = function (response) {\r\n if(canClick(response)) {\r\n var selectedAlerts = response.Alerts;\r\n if(selectedAlerts && selectedAlerts.length > 0) {\r\n selectedAlerts.forEach(function (a) {\r\n a.selected = !a.selected;\r\n });\r\n var canSelect = selectedAlerts[0].updateSelected(); // this causes the list (alertview) to update\r\n if(canSelect) {\r\n selectedAlerts.forEach(function (a) {\r\n a.response.displayClass = getAlertClass(a.response);\r\n });\r\n }\r\n else {\r\n selectedAlerts.forEach(function (a) {\r\n a.selected = !a.selected; // revert selection\r\n });\r\n var previouslySelectedAlertClass = selectedAlerts[0].AlertSeverityLevelId == AlertSeverityLevel.Notification ? AlertClass.Alert : AlertClass.Notification;\r\n var previouslySelectedAlertClassName = (lodash.invert(AlertClass))[previouslySelectedAlertClass];\r\n var selectedAlertClass = selectedAlerts[0].AlertSeverityLevelId == AlertSeverityLevel.Notification ? AlertClass.Notification : AlertClass.Alert;\r\n var selectedAlertClassName = (lodash.invert(AlertClass))[selectedAlertClass];\r\n vhSweetAlert.error(\"Invalid Selection\", `You have already selected one or more ${previouslySelectedAlertClassName}s.\\nYou must deal with all ${previouslySelectedAlertClassName}s first, or de-select them,\\nbefore dealing with ${selectedAlertClassName}s.`);\r\n }\r\n }\r\n }\r\n };\r\n\r\n function canClick(response) {\r\n var enableAlertSelection = response.Alerts[0].AlertSeverityLevelId == AlertSeverityLevel.Notification ? \r\n PermissionService.userHasPermission(['PatientNotificationsWrite']) : \r\n PermissionService.userHasPermission(['PatientAlertsWrite']);\r\n\r\n return enableAlertSelection && response.Alerts.length > 0 && response.Alerts[0].AlertStatusId == AlertStatus.New;\r\n }\r\n\r\n function intializeResponses() {\r\n $scope.question.Responses.forEach(function (response) {\r\n if (!response) {\r\n return;\r\n }\r\n\r\n if (response.ObservationDateTime_Local) {\r\n response.time = response.ObservationDateTime_Local.format('HH:mm');\r\n response.date = response.ObservationDateTime_Local.format('l');\r\n }\r\n\r\n if (response.CreatedDateTime_Local) {\r\n response.createdTime = response.CreatedDateTime_Local.format('HH:mm');\r\n response.createdDate = response.CreatedDateTime_Local.format('l');\r\n }\r\n\r\n response.showCreatedDateTime = false;\r\n\r\n if (response.ObservationDateTime_Local && response.CreatedDateTime_Local) {\r\n var obs = new Date(Date.parse(response.ObservationDateTime_Local.format()));\r\n var created = new Date(Date.parse(response.CreatedDateTime_Local.format()));\r\n var timeDiff = Math.abs(obs.getTime() - created.getTime());\r\n var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));\r\n\r\n response.showCreatedDateTime = diffDays > 1;\r\n }\r\n\r\n response.value = formatResponseValue(response);\r\n\r\n response.tooltipEnabled = response.value && response.value.length > 0;\r\n\r\n response.updateDisplay = function () {\r\n updateDisplay(response);\r\n };\r\n\r\n updateDisplay(response);\r\n });\r\n }\r\n\r\n function updateDisplay(response) {\r\n var alertStatus = lodash.min(lodash.pluck(response.Alerts, 'AlertStatusId'));\r\n response.tooltipMessages = [];\r\n\r\n if (alertStatus == AlertStatus.Rejected) {\r\n response.isDeleted = true;\r\n }\r\n\r\n //Format multi-select questions differently. This is sort of hacky\r\n //because the question tooltip wasn't meant to display multi-select questions differently\r\n if ($scope.question.SurveyQuestionType === 7) {\r\n //If the question property is set, the tooltip will show it differently, for multi-select questions\r\n var tooltipMessage = {\r\n question: $scope.question.Question\r\n };\r\n response.tooltipMessages.push(tooltipMessage);\r\n\r\n var alerts = lodash.filter(response.Values, function(o) {\r\n return o.AlertSeverityLevelId !== AlertSeverityLevel.None;\r\n });\r\n\r\n alerts = lodash.sortBy(alerts, ['AlertSeverityLevelId']);\r\n\r\n alerts.forEach(function(alert) {\r\n response.tooltipMessages.push(getToolTipMessage(alert));\r\n });\r\n\r\n //If we have intervention notes, add the notes to the last tooltip message so they show up at the bottom.\r\n if (response.Alerts.length > 0 && response.Alerts[0].PatientChartEntries && response.Alerts[0].PatientChartEntries.length > 0) {\r\n response.tooltipMessages[response.tooltipMessages.length-1].notes = lodash(response.Alerts[0].PatientChartEntries)\r\n .pluck('Text')\r\n .filter(function (note) {\r\n return note.indexOf(response.Alerts[0].Message) < 0;\r\n })\r\n .value()\r\n .join(' ');\r\n }\r\n }\r\n else {\r\n response.Alerts.forEach(function (alert) {\r\n var notes = '';\r\n if (alert.PatientChartEntries.length > 0) {\r\n response.hasNotes = true;\r\n notes = lodash(alert.PatientChartEntries)\r\n .pluck('Text')\r\n .filter(function (note) {\r\n return note.indexOf(alert.Message) < 0;\r\n })\r\n .value()\r\n .join(' ');\r\n }\r\n\r\n response.tooltipMessages.push(getToolTipMessage(alert, notes));\r\n });\r\n }\r\n\r\n\r\n\r\n response.displayClass = getAlertClass(response);\r\n }\r\n\r\n function getToolTipMessage(alert, notes) {\r\n var tooltipMessage = {\r\n level: alert.AlertSeverityLevelId,\r\n message: alert.Message || alert.Value,\r\n notes: notes,\r\n option: {\r\n AlertSeverityLevelId: alert.AlertSeverityLevelId\r\n }\r\n };\r\n return tooltipMessage;\r\n }\r\n\r\n function getAlertClass(response) {\r\n var alertClass = '';\r\n\r\n var hasSelectedAlert = lodash.any(response.Alerts, function (alert) {\r\n return alert.selected == true;\r\n });\r\n if (hasSelectedAlert) {\r\n alertClass += 'selected ';\r\n }\r\n\r\n if (response && response.Alerts && response.Alerts.length > 0) {\r\n var alertLevel = lodash.min(lodash.pluck(response.Alerts, 'AlertSeverityLevelId'));\r\n var alertStatus = lodash.min(lodash.pluck(response.Alerts, 'AlertStatusId'));\r\n\r\n if (alertLevel == AlertSeverityLevel.None) {\r\n return alertClass;\r\n }\r\n\r\n switch(alertStatus) {\r\n case AlertStatus.New:\r\n response.isNewAlert = true;\r\n alertClass += 'alert-active';\r\n break;\r\n case AlertStatus.Accepted:\r\n alertClass += 'alert-inactive';\r\n break;\r\n case AlertStatus.Rejected:\r\n alertClass += 'rejected alert-inactive';\r\n break;\r\n }\r\n\r\n alertClass += ' ' + getAlertSeverityClass(alertLevel);\r\n }\r\n\r\n return alertClass;\r\n }\r\n\r\n function getAlertSeverityClass(alertLevel) {\r\n switch(alertLevel) {\r\n case AlertSeverityLevel.Notification:\r\n return 'primary';\r\n case AlertSeverityLevel.Medium:\r\n return 'warning';\r\n case AlertSeverityLevel.High:\r\n return 'danger';\r\n }\r\n }\r\n\r\n function formatResponseValue(response) {\r\n if (!response.Values) return '';\r\n\r\n let separator = ', ';\r\n\r\n let values = response.Values.map(value => {\r\n switch (value.SurveyParameterTypeId) {\r\n case SurveyParameterType.Date:\r\n if (value.Value && value.Value.length === 7) {\r\n return moment(value.Value, 'YYYY-MM').format('MM/YYYY');\r\n } else {\r\n return moment(value.Value).format(vm.dateFormat);\r\n }\r\n\r\n case SurveyParameterType.Time:\r\n separator = ' ';\r\n return value.Value;\r\n\r\n default:\r\n return value.Value;\r\n }\r\n });\r\n\r\n return values.join(separator);\r\n }\r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n replace: true,\r\n templateUrl: 'modules/patient/monitoring/surveys/surveyquestion.tpl.html',\r\n controller: controller,\r\n scope: {\r\n question: '=',\r\n isAudit: '='\r\n },\r\n link: function (scope, elem, attrs) {\r\n if (attrs.isForms !== undefined) {\r\n scope.isForms = true;\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringSurveyQuestion', MonitoringSurveyQuestionDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/surveys/surveyquestion.tpl.html',\n '{{question.Question}}
          {{response.value}}
          ');\n}]);\n}(window, document, window.angular));","function MonitoringSurveysDirective() {\r\n\r\n function controller($scope, lodash, MonitoringService, AlertStatus, MonitoringViewType, MonitoringEventsService) {\r\n\r\n var expanded = false;\r\n MonitoringEventsService.onExpandCurrentSurveys(function () {\r\n expanded = !expanded;\r\n $scope.surveys.forEach(function (survey) {\r\n survey.showSurvey = expanded;\r\n });\r\n });\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.hasSurveyResponses = false;\r\n $scope.surveys = [];\r\n $scope.isAudit = MonitoringEventsService.getDisplayType() == MonitoringViewType.Audit;\r\n\r\n MonitoringEventsService.onUpdateSurveys(loadSurveys);\r\n MonitoringEventsService.onDisplayTypeChanged(function(viewType){\r\n $scope.isAudit = viewType == MonitoringViewType.Audit;\r\n });\r\n\r\n MonitoringEventsService.surveysLoaded();\r\n }\r\n\r\n function loadSurveys(surveys, timeZone) {\r\n $scope.surveys = surveys.data;\r\n var start = surveys.startDate;\r\n var end = surveys.endDate;\r\n expanded = false;\r\n $scope.hasSurveyResponses = false;\r\n loadComplianceInfo(start, end);\r\n loadQuestionResponses(start, end, timeZone);\r\n }\r\n\r\n function loadComplianceInfo(start, end) {\r\n for (var i = 0; i < $scope.surveys.length; i++) {\r\n $scope.surveys[i].showSurvey = false;\r\n var d = angular.copy(start);\r\n var complianceInfo = [];\r\n do {\r\n var compliance = lodash.find($scope.surveys[i].CompleteInfo, function (o) {\r\n o.SurveyDate = MonitoringService.getUtcDate(o.SurveyDate);\r\n return MonitoringService.areDatesEqual(o.SurveyDate, d);\r\n });\r\n\r\n if (compliance) {\r\n compliance.Date = d;\r\n getComplianceResponses(compliance, $scope.surveys[i], d);\r\n } else {\r\n compliance = {Date: d};\r\n }\r\n\r\n complianceInfo.push(compliance);\r\n d.setDate(d.getDate() + 1);\r\n }\r\n while (d <= end);\r\n\r\n $scope.surveys[i].CompleteInfo = complianceInfo;\r\n }\r\n }\r\n\r\n function getComplianceResponses(compliance, survey, date) {\r\n var responses = lodash(survey.Questions)\r\n .pluck('Responses')\r\n .flatten()\r\n .filter(function(o) {\r\n o.Date = MonitoringService.getUtcDate(o.Date);\r\n return MonitoringService.areDatesEqual(o.Date, date);\r\n })\r\n .value();\r\n\r\n responses.forEach(function(r){\r\n r.Alerts.forEach(function(a){\r\n a.updateCompliance = function(){\r\n assignAlertCounts(compliance, responses);\r\n } ;\r\n });\r\n });\r\n\r\n assignAlertCounts(compliance, responses);\r\n }\r\n\r\n function assignAlertCounts(compliance, responses) {\r\n compliance.highCount = lodash(responses)\r\n .pluck('Alerts')\r\n .flatten()\r\n .filter(function(o){\r\n return o.AlertStatusId == AlertStatus.New && o.AlertSeverityLevelId == 1;\r\n })\r\n .value()\r\n .length;\r\n\r\n compliance.mediumCount = lodash(responses)\r\n .pluck('Alerts')\r\n .flatten()\r\n .filter(function(o){\r\n return o.AlertStatusId == AlertStatus.New && o.AlertSeverityLevelId == 2;\r\n })\r\n .value()\r\n .length;\r\n }\r\n\r\n function loadQuestionResponses(start, end, timeZone) {\r\n $scope.hasSurveyResponses = $scope.surveys.length > 0;\r\n\r\n for (var i = 0; i < $scope.surveys.length; i++) {\r\n for (var q = 0; q < $scope.surveys[i].Questions.length; q++) {\r\n var d = angular.copy(start);\r\n var responses = [];\r\n do {\r\n var response = lodash.find($scope.surveys[i].Questions[q].Responses, function (o) {\r\n o.Date = MonitoringService.getUtcDate(o.Date);\r\n return MonitoringService.areDatesEqual(o.Date, d);\r\n });\r\n\r\n if (response) {\r\n response.Alerts.forEach(function(a){\r\n a.response = response;\r\n });\r\n response.ObservationDateTime_Local = moment.tz(response.ObservationDateTime_UTC, timeZone);\r\n response.CreatedDateTime_Local = moment.tz(response.CreatedDateTime_UTC, timeZone);\r\n responses.push(response);\r\n } else {\r\n responses.push({Date: d, Alerts: []});\r\n }\r\n d.setDate(d.getDate() + 1);\r\n }\r\n while (d <= end)\r\n\r\n $scope.surveys[i].Questions[q].Responses = responses;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {\r\n restrict: 'A',\r\n replace: true,\r\n templateUrl: 'modules/patient/monitoring/surveys/surveys.tpl.html',\r\n controller: controller\r\n };\r\n}\r\n\r\nangular.module('patient.monitoring').directive('monitoringSurveys', MonitoringSurveysDirective);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/monitoring/surveys/surveys.tpl.html',\n '{{survey.SurveyName}}
          0 || compliance.mediumCount > 0\" class=\"value question alerts\"> 0\" class=\"badge badge-danger danger\">{{compliance.highCount}} 0\" class=\"badge badge-warning warning\">{{compliance.mediumCount}}
          There are no Pathway responses for these dates.
          ');\n}]);\n}(window, document, window.angular));","function AddChangeReasonController(patientId, $uibModalInstance, ParametersService, lodash) {\r\n var vm = this;\r\n vm.selectedOption = null;\r\n vm.custom = \"\";\r\n loadController();\r\n\r\n function loadController() {\r\n ParametersService.getChangeReasons(patientId)\r\n .then(function(response) {\r\n vm.defaultChangeReasons = response;\r\n vm.defaultChangeReasons.push({\r\n BiometricThresholdsChangeReasonId: 0,\r\n IsDefault: false,\r\n IsEnabled: true,\r\n Programs: [],\r\n SortOrder: 0,\r\n Text: \"Other\"\r\n }\r\n );\r\n var defaultReasons = lodash.where(vm.defaultChangeReasons, {'IsDefault': true});\r\n if (defaultReasons[0] != null) {\r\n vm.selectedOption = defaultReasons[0];\r\n }\r\n else {\r\n vm.selectedOption = vm.defaultChangeReasons[0];\r\n }\r\n });\r\n }\r\n\r\n vm.ok = function() {\r\n var submit = vm.selectedOption.Text;\r\n if(submit == \"Other\" && vm.custom == \"\"){\r\n alert(\"Must provide a change reason.\");\r\n } else{\r\n if(submit == \"Other\"){\r\n submit = vm.custom;\r\n }\r\n $uibModalInstance.close(submit);\r\n }\r\n }\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\n\r\nangular.module('patient.parameters').controller('AddChangeReasonController', AddChangeReasonController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/addchangereason.modal.html',\n '

          Change Reason

          Character limit: 1000
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/devices/bloodPressureParameters.tpl.html',\n '
           Upper Boundary
          Systolic High Alert is required
          Systolic High Alert must be less than or equal to {{pvm.portalConfig.SystolicUpperBoundaryHighAlertValueSafeguard}}
          Value must be a whole number greater than 0
          Systolic High Upper Boundary Alert must be greater than Systolic Medium Upper Boundary Alert
          Systolic Medium Alert is required
          Systolic Medium Alert must be less than or equal to {{pvm.portalConfig.SystolicUpperBoundaryMediumAlertValueSafeguard}}
          Value must be a whole number greater than 0
          Systolic Medium Upper Boundary Alert must be greater than Systolic Medium Lower Boundary Alert
           Lower Boundary
          Value must be a whole number greater than 0
          Systolic High Alert is required
          Systolic High Lower Boundary Alert must be greater than or equal to {{pvm.portalConfig.SystolicLowerBoundaryHighAlertValueSafeguard}}
          Systolic High Lower Boundary Alert must be less than Medium alert
          Value must be a whole number greater than 0
          Systolic Medium Alert is required
          Systolic Medium Lower Boundary Alert must be greater than or equal to {{pvm.portalConfig.SystolicLowerBoundaryMediumAlertValueSafeguard}}
          Systolic Medium Lower Boundary Alert must be less than or equal to 400
           BP Variance
          Medium Alert Enabled
          +
          Readings must be whole numbers between 0-{{pvm.portalConfig.SystolicComparedToLastReadingPositiveDifferentialSafeguard}}
          -
          Readings must be whole numbers between 0-{{pvm.portalConfig.SystolicComparedToLastReadingNegativeDifferentialSafeguard}}
           Upper Boundary
          Value must be a whole number greater than 0
          Diastolic High Alert is required
          Diastolic High Upper Boundary Alert must be greater than Diastolic Medium Upper Boundary Alert
          Diastolic High Upper Boundary Alert must be less than or equal to {{pvm.portalConfig.DiastolicUpperBoundaryHighAlertValueSafeguard}}
          Value must be a whole number greater than 0
          Diastolic Medium Alert is required
          Diastolic Medium Upper Boundary Alert must be greater than Diastolic Medium Lower Boundary Alert
          Diastolic Medium Alert must be less than or equal to {{pvm.portalConfig.DiastolicUpperBoundaryMediumAlertValueSafeguard}}
           Lower Boundary
          Value must be a whole number greater than 0
          Diastolic Medium Alert is required
          Diastolic Medium Alert must be greater than or equal to {{pvm.portalConfig.DiastolicLowerBoundaryMediumAlertValueSafeguard}}
          Diastolic Medium Alert must be less than or equal to 280
          Manual reading value must be whole number less than or equal to 100, or 0 to skip alerts
          # of readings must be whole number between 0-10
          Time between must be whole number between than 0-100
          Follow up delay must be whole number between 0-120
          One or more values were changed by {{pvm.parameters.BloodPressureParameters.ModifiedByName}} on {{pvm.parameters.BloodPressureParameters.ModifiedDtUTC | date:\"medium\"}} with the reason: {{pvm.parameters.BloodPressureParameters.ChangeReason}}
          {{pvm.portalConfig.BloodPressureGuidelines}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/devices/bloodSugarParameters.tpl.html',\n '
           Lower Boundary
          High Alert Value is required
          High alert value must be {{pvm.portalConfig.LowerBoundaryHighAlertValueSafeguard}} or more
          High alert value must be less than Medium alert value
          High Alert Value {{pvm.bloodSugarPatternAlertText}}
          Medium alert Value is required
          Medium alert value must be {{pvm.portalConfig.LowerBoundaryMediumAlertValueSafeguard}} or more
          Medium alert value must be less than {{pvm.bloodSugarMax}}
          Medium Alert Value {{pvm.bloodSugarPatternAlertText}}
          Medium alert Value is required
          Medium alert Value must be {{pvm.portalConfig.FastingUpperBoundaryMediumAlertValueSafeguard}} or less
          Medium Alert Value {{pvm.bloodSugarPatternAlertText}}
           Upper Boundary
          High alert Value is required
          High alert value must be greater than medium alert
          High alert value must be {{pvm.portalConfig.RandomUpperBoundaryHighAlertValueSafeguard}} or less
          High alert value {{pvm.bloodSugarPatternAlertText}}
          High alert value is required
          Medium alert upper value must be greater than medium alert lower boundary
          Medium alert value must be {{pvm.portalConfig.RandomUpperBoundaryMediumAlertValueSafeguard}} or less
          Medium alert value {{pvm.bloodSugarPatternAlertText}}
          Follow up delay value is invalid
          Follow up delay must be less than 25
          Follow up postpone value is invalid
          Follow up postpone value must be less than or equal to 1440
          Advanced
           Upper Boundary
          Medium alert value {{pvm.bloodSugarPatternAlertText}}
          Medium alert value must be less than or equal to {{pvm.portalConfig.PostPrandialUpperBoundaryMediumAlertValueSafeguard}}
           Increased
          Medium alert value must be less than or equal to {{pvm.portalConfig.PostPrandialIncreasedMediumAlertValueSafeguard}}
          Medium alert value is invalid
          High alert value must be greater than medium alert value
          High alert value must be less than or equal to {{pvm.portalConfig.PostPrandialIncreasedHighAlertValueSafeguard}}
          High alert value is required
          High alert value {{pvm.bloodSugarPatternAlertText}}
          Manual reading value must be whole number less than or equal to 100, or 0 to skip alerts
          One or more values were changed by {{pvm.parameters.BloodSugarParameters.ModifiedByName}} on {{pvm.parameters.BloodSugarParameters.ModifiedDtUTC | date:\"medium\"}} with the reason: {{pvm.parameters.BloodSugarParameters.ChangeReason}}
          {{pvm.portalConfig.BloodGlucoseGuidelines}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/devices/heartRateParameters.tpl.html',\n '
          High Alert upper value must be greater than high alert lower value
          High Alert upper value must be less than or equal to {{pvm.portalConfig.PulseHighAlertValueSafeguard}}
          Higher Alert upper value is required
          Higher Alert upper value must be a whole number greater than 0
          Higher Alert lower must be a whole number greater than or equal to {{pvm.portalConfig.PulseMediumAlertValueSafeguard}}
          One or more values were changed by {{pvm.parameters.PulseOxParameters.ModifiedByName}} on {{pvm.parameters.PulseOxParameters.ModifiedDtUTC | date:\"medium\"}} with the reason: {{pvm.parameters.PulseOxParameters.ChangeReason}}
          {{pvm.portalConfig.PulseGuidelines}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/devices/oxygenParameters.tpl.html',\n '
          High Alert must be a whole number between {{pvm.portalConfig.OxygenHighAlertValueSafeguard}}-100
          Medium Alert must be whole number between 0-100
          Medium Alert must be greater or equal to {{pvm.portalConfig.OxygenMediumAlertValueSafeguard}}
          Manual reading value must be whole number less than or equal to 100, or 0 to skip alerts
          Reading Delay must be whole number between 0-60
          One or more values were changed by {{pvm.parameters.PulseOxParameters.ModifiedByName}} on {{pvm.parameters.PulseOxParameters.ModifiedDtUTC | date:\"medium\"}} with the reason: {{pvm.parameters.PulseOxParameters.ChangeReason}}
          {{pvm.portalConfig.OxygenSaturationGuidelines}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/devices/pedometerParameters.tpl.html',\n '
          High Alert value must be greater than or equal to {{pvm.portalConfig.PedometerHighAlertSafeguard}}
          High Alert value must be lower than or equal to medium alert value
          High Alert value is required
          High Alert value must be a whole number greater than 0
          Medium Alert value must be greater than or equal to {{pvm.portalConfig.PedometerMediumAlertSafeguard}}
          Medium Alert value must be a whole number greater than 0 and less than 100,000
          Manual reading value must be whole number less than or equal to 100, or 0 to skip alerts
          One or more values were changed by {{pvm.parameters.PedometerParameters.ModifiedByName}} on {{pvm.parameters.PedometerParameters.ModifiedDateTime_UTC | date:\"medium\"}} with the reason: {{pvm.parameters.PedometerParameters.ChangeReason}}
          {{pvm.portalConfig.PedometerGuidelines}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/devices/spirometerParameters.tpl.html',\n '
          High alert value must be whole number greater than 0
          Medium alert value must be whole number greater than 0 and less than 1000
          Medium alert must be greater than high alert
          High alert value is invalid
          Medium alert value is invalid
          Medium alert must be greater than high alert
          Medium alert must be less than 10
          High Alert value is invalid
          High Alert value must be a decimal between 0 and 1
          Medium alert value is invalid
          Value must be between 0-1
          Medium alert must be greater than high alert
          Manual reading value must be whole number less than or equal to 100, or 0 to skip alerts
          One or more values were changed by {{pvm.parameters.SpirometerParameters.ModifiedByName}} on {{pvm.parameters.SpirometerParameters.ModifiedDateTime_UTC | date:\"medium\"}} with the reason: {{pvm.parameters.SpirometerParameters.ChangeReason}}
          {{pvm.portalConfig.SpirometerGuidelines}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/devices/thermometerParameters.tpl.html',\n '
           Upper Boundary
          High alert value is required
          High alert value is not valid
          High alert must be greater than medium alert
          High alert must be less than or equal to {{pvm.portalConfig.TemperatureUpperBoundaryHighAlertSafeguard}}
          Medium alert value is required
          Medium alert must be less than or equal to {{pvm.portalConfig.TemperatureUpperBoundaryMediumAlertSafeguard}}
          Medium alert value is not valid
          Medium upper alert must be greater than medium lower alert
           Lower Boundary
          High alert value is required
          High alert value is invalid
          High lower alert must be greater than or equal to {{pvm.portalConfig.TemperatureLowerBoundaryHighAlertSafeguard}}
          High lower alert must be less than or equal to Medium alert
          Medium alert value is required
          Medium lower alert must be greater than or equal to {{pvm.portalConfig.TemperatureLowerBoundaryMediumAlertSafeguard}}
          Medium lower alert value is invalid
          Manual reading value must be whole number less than or equal to 100, or 0 to skip alerts
          One or more values were changed by {{pvm.parameters.ThermometerParameters.ModifiedByName}} on {{pvm.parameters.ThermometerParameters.ModifiedDateTime_UTC | date:\"medium\"}} with the reason: {{pvm.parameters.ThermometerParameters.ChangeReason}}
          {{pvm.portalConfig.TemperatureGuidelines}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/devices/weightScaleParameters.tpl.html',\n '
          Baseline weight is required
          Baseline weight value is invalid
          Baseline weight must be less than or equal to 1000
          Max weight is required
          Max weight value is invalid
          Max weight must be greater than baseline weight
          Max weight must be less than or equal to baseline plus {{pvm.weightVariance}}
          Min weight is required
          Min weight must be less than baseline weight
          Min weight must be greater than or equal to baseline minus {{pvm.weightVariance}}
          Min weight value is invalid
          High alert value is required
          High alert percentage Value is required
          High alert percentage Value must be less than or equal to 100
          High alert value must be greater than medium alert value
          High alert value must be less than or equal to {{pvm.portalConfig.DailyHighAlertValueSafeguard}}
          High alert value is invalid
          High alert value percentage is invalid
          High alert value percentage must be less than or equal to {{pvm.portalConfig.DailyGain_S_LossPercentageSafeguard}}
          High alert value percentage must be greater than medium alert value percentage
          Medium alert value is required
          Medium alert value must be less than or equal to {{pvm.portalConfig.DailyMediumAlertValueSafeguard}}
          Medium alert percentage value is required
          Medium alert value is invalid
          Medium alert value percentage is invalid
          Medium alert value percentage must be less than or equal to {{pvm.portalConfig.DailyMediumAlertPercentageSafeguard}}
          High alert value is required
          High alert value must be less than or equal to {{pvm.portalConfig.WeeklyHighAlertValueSafeguard}}
          High alert value must be greater than medium alert value
          High alert percentage value is required
          High alert value is invalid
          High alert value percentage is invalid
          High alert value percentage must be less than or equal to {{pvm.portalConfig.WeeklyHighAlertPercentageSafeguard}}
          High alert value percentage must be greater than medium alert value percentage
          Medium alert value is required
          Medium alert value must be less than or equal to {{pvm.portalConfig.WeeklyMediumAlertValueSafeguard}}
          Medium alert percentage value is required
          Medium alert value is invalid
          Medium alert value percentage is invalid
          Medium alert value percentage must be less than or equal to {{pvm.portalConfig.WeeklyMediumAlertPercentageSafeguard}}
          Manual reading value must be whole number less than or equal to 100, or 0 to skip alerts
          Unit of Measure
          Enable Baseline Alerts
          One or more values were changed by {{pvm.parameters.WeightScaleParameters.ModifiedByName}} on {{pvm.parameters.WeightScaleParameters.ModifiedDtUTC | date:\"medium\"}} with the reason: {{pvm.parameters.WeightScaleParameters.ChangeReason}}
          {{pvm.portalConfig.WeightGuidelines}}
          ');\n}]);\n}(window, document, window.angular));","function ParametersController(parameters, $filter, lodash, ParametersService, portalConfig, PermissionService, vhUomConversionService, $scope, SmoothScroll, $timeout, $uibModal, $window) {\r\n var pvm = this;\r\n pvm.portalConfig = portalConfig;\r\n pvm.parameters = parameters;\r\n pvm.parameters.BloodPressureParameters = pvm.parameters.BloodPressureParameters == null ? {} : pvm.parameters.BloodPressureParameters;\r\n pvm.parameters.BloodSugarParameters = pvm.parameters.BloodSugarParameters == null ? {} : pvm.parameters.BloodSugarParameters;\r\n pvm.parameters.WeightScaleParameters = pvm.parameters.WeightScaleParameters == null ? {} : pvm.parameters.WeightScaleParameters;\r\n pvm.parameters.ThermometerParameters = pvm.parameters.ThermometerParameters == null ? {} : pvm.parameters.ThermometerParameters;\r\n pvm.parameters.PulseOxParameters = pvm.parameters.PulseOxParameters == null ? {} : pvm.parameters.PulseOxParameters;\r\n pvm.parameters.SpirometerParameters = pvm.parameters.SpirometerParameters == null ? {} : pvm.parameters.SpirometerParameters;\r\n pvm.parameters.PedometerParameters = pvm.parameters.PedometerParameters == null ? {} : pvm.parameters.PedometerParameters;\r\n pvm.parameters.BloodPressureParameters.TimeDiffBetReadings = pvm.parameters.BloodPressureParameters.TimeDiffBetReadings / 60;\r\n pvm.parameters.TabletParameters = pvm.parameters.TabletParameters == null ? {} : pvm.parameters.TabletParameters;\r\n pvm.tempValues = {};\r\n pvm.bloodSugarValues = {};\r\n pvm.getTempLabel = getTempLabel;\r\n pvm.getWeightLabel = getWeightLabel;\r\n pvm.bloodSugarLabel = portalConfig.DefaultBloodSugarUnit;\r\n pvm.weightUnitChanged = weightUnitChanged;\r\n pvm.weightScaleDayCount = portalConfig.WeightScaleGainLossAlertDays || 7;\r\n pvm.heartRateDevice = \"pulseOx\";\r\n pvm.setMinMaxWeights = setMinMaxWeights;\r\n pvm.canWrite = PermissionService.userHasPermission([\"PatientParametersWrite\"]);\r\n pvm.formDirty = false;\r\n pvm.openChangeReasonModal = openChangeReasonModal;\r\n pvm.saveChanges = saveChanges;\r\n pvm.cancelChanges = cancelChanges;\r\n pvm.sectionChanged = sectionChanged;\r\n pvm.sectionChangedDynamic = sectionChangedDynamic;\r\n pvm.glucoAdvanced = pvm.parameters.BloodSugarParameters ? !pvm.parameters.BloodSugarParameters.IsSingleReading : true;\r\n pvm.collapsed = {};\r\n pvm.collapsed.bloodPressure = pvm.collapsed.oxygen = pvm.collapsed.heartRate = pvm.collapsed.weight = pvm.collapsed.glucometer = pvm.collapsed.thermo = pvm.collapsed.spiro = pvm.collapsed.pedo = pvm.collapsed.tablet = true;\r\n pvm.expandAllNodes = expandAllNodes;\r\n pvm.collapseAllNodes = collapseAllNodes;\r\n pvm.toggleExpand = true;\r\n pvm.toggleExpansion = toggleExpansion;\r\n pvm.changeReason = \"\";\r\n pvm.DynamicParameters = {};\r\n dirtySections = {};\r\n pvm.alertSeverityLevels = [\r\n { Name : 'High Alert', Value : 1 },\r\n { Name : 'Medium Alert', Value : 2 },\r\n { Name : 'Notification', Value : 4 }\r\n ];\r\n\r\n var originalParameters = angular.copy(pvm.parameters);\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n if (pvm.parameters.ThermometerParameters) {\r\n if (portalConfig.DefaultTempUnit == \"C\") {\r\n pvm.tempValues.upperhigh = vhUomConversionService.convertToC(pvm.parameters.ThermometerParameters.UpperHighAlert);\r\n pvm.tempValues.upperMed = vhUomConversionService.convertToC(pvm.parameters.ThermometerParameters.UpperMedAlert);\r\n pvm.tempValues.lowerHigh = vhUomConversionService.convertToC(pvm.parameters.ThermometerParameters.LowerHighAlert);\r\n pvm.tempValues.lowerMed = vhUomConversionService.convertToC(pvm.parameters.ThermometerParameters.LowerMedAlert);\r\n pvm.portalConfig.TemperatureUpperBoundaryHighAlertSafeguard = vhUomConversionService.convertToC(pvm.parameters.ThermometerParameters.TemperatureUpperBoundaryHighAlertSafeguard);\r\n pvm.portalConfig.TemperatureUpperBoundaryMediumAlertSafeguard = vhUomConversionService.convertToC(pvm.parameters.ThermometerParameters.TemperatureUpperBoundaryMediumAlertSafeguard);\r\n pvm.portalConfig.TemperatureLowerBoundaryHighAlertSafeguard = vhUomConversionService.convertToC(pvm.parameters.ThermometerParameters.TemperatureLowerBoundaryHighAlertSafeguard);\r\n pvm.portalConfig.TemperatureLowerBoundaryMediumAlertSafeguard = vhUomConversionService.convertToC(pvm.parameters.ThermometerParameters.TemperatureLowerBoundaryMediumAlertSafeguard);\r\n } else {\r\n pvm.tempValues.upperhigh = pvm.parameters.ThermometerParameters.UpperHighAlert;\r\n pvm.tempValues.upperMed = pvm.parameters.ThermometerParameters.UpperMedAlert;\r\n pvm.tempValues.lowerHigh = pvm.parameters.ThermometerParameters.LowerHighAlert;\r\n pvm.tempValues.lowerMed = pvm.parameters.ThermometerParameters.LowerMedAlert;\r\n pvm.portalConfig.TemperatureUpperBoundaryHighAlertSafeguard = pvm.parameters.ThermometerParameters.TemperatureUpperBoundaryHighAlertSafeguard;\r\n pvm.portalConfig.TemperatureUpperBoundaryMediumAlertSafeguard = pvm.parameters.ThermometerParameters.TemperatureUpperBoundaryMediumAlertSafeguard;\r\n pvm.portalConfig.TemperatureLowerBoundaryHighAlertSafeguard = pvm.parameters.ThermometerParameters.TemperatureLowerBoundaryHighAlertSafeguard;\r\n pvm.portalConfig.TemperatureLowerBoundaryMediumAlertSafeguard = pvm.parameters.ThermometerParameters.TemperatureLowerBoundaryMediumAlertSafeguard;\r\n }\r\n }\r\n if (pvm.parameters.BloodPressureParameters && pvm.parameters.BloodPressureParameters.ObtainPulse === true) {\r\n pvm.heartRateDevice = \"bp\";\r\n }\r\n\r\n if (pvm.parameters.BloodSugarParameters) {\r\n if (portalConfig.DefaultBloodSugarUnit == 'mmol/L') {\r\n pvm.bloodSugarValues.lowerValueHigh = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.LB_High);\r\n pvm.bloodSugarValues.lowerValueMed = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.LB_Med);\r\n pvm.bloodSugarValues.upperFastingMed = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.UB_Fasting_Med);\r\n pvm.bloodSugarValues.upperPPMed = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.UB_PP_Med);\r\n pvm.bloodSugarValues.upperPPIncHigh = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.UB_PP_Inc_High);\r\n pvm.bloodSugarValues.upperPPIncMed = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.UB_PP_Inc_Med);\r\n pvm.bloodSugarValues.upperRandomCheckMed = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.UB_RandomChk_Med);\r\n pvm.bloodSugarValues.upperRandomCheckHigh = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.UB_RandomChk_High);\r\n pvm.portalConfig.FastingUpperBoundaryMediumAlertValueSafeguard = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.FastingUpperBoundaryMediumAlertValueSafeguard);\r\n pvm.portalConfig.LowerBoundaryHighAlertValueSafeguard = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.LowerBoundaryHighAlertValueSafeguard);\r\n pvm.portalConfig.LowerBoundaryMediumAlertValueSafeguard = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.LowerBoundaryMediumAlertValueSafeguard);\r\n pvm.portalConfig.PostPrandialIncreasedHighAlertValueSafeguard = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.PostPrandialIncreasedHighAlertValueSafeguard);\r\n pvm.portalConfig.PostPrandialIncreasedMediumAlertValueSafeguard = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.PostPrandialIncreasedMediumAlertValueSafeguard);\r\n pvm.portalConfig.PostPrandialUpperBoundaryMediumAlertValueSafeguard = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.PostPrandialUpperBoundaryMediumAlertValueSafeguard);\r\n pvm.portalConfig.RandomUpperBoundaryHighAlertValueSafeguard = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.RandomUpperBoundaryHighAlertValueSafeguard);\r\n pvm.portalConfig.RandomUpperBoundaryMediumAlertValueSafeguard = vhUomConversionService.convertToMmolL(pvm.parameters.BloodSugarParameters.RandomUpperBoundaryMediumAlertValueSafeguard);\r\n pvm.bloodSugarPattern = /^[0-9]+(\\.[0-9]{1})?$/;\r\n pvm.bloodSugarStep = .1;\r\n pvm.bloodSugarMax = vhUomConversionService.convertToMmolL(999);\r\n pvm.bloodSugarPPMax = vhUomConversionService.convertToMmolL(3000);\r\n pvm.bloodSugarPPIncMax = vhUomConversionService.convertToMmolL(1000);\r\n pvm.bloodSugarPatternAlertText = 'is invalid';\r\n }\r\n else {\r\n pvm.bloodSugarValues.lowerValueHigh = pvm.parameters.BloodSugarParameters.LB_High;\r\n pvm.bloodSugarValues.lowerValueMed = pvm.parameters.BloodSugarParameters.LB_Med;\r\n pvm.bloodSugarValues.upperFastingMed = pvm.parameters.BloodSugarParameters.UB_Fasting_Med;\r\n pvm.bloodSugarValues.upperPPMed = pvm.parameters.BloodSugarParameters.UB_PP_Med;\r\n pvm.bloodSugarValues.upperPPIncHigh = pvm.parameters.BloodSugarParameters.UB_PP_Inc_High;\r\n pvm.bloodSugarValues.upperPPIncMed = pvm.parameters.BloodSugarParameters.UB_PP_Inc_Med;\r\n pvm.bloodSugarValues.upperRandomCheckMed = pvm.parameters.BloodSugarParameters.UB_RandomChk_Med;\r\n pvm.bloodSugarValues.upperRandomCheckHigh = pvm.parameters.BloodSugarParameters.UB_RandomChk_High;\r\n pvm.portalConfig.FastingUpperBoundaryMediumAlertValueSafeguard = pvm.parameters.BloodSugarParameters.FastingUpperBoundaryMediumAlertValueSafeguard;\r\n pvm.portalConfig.LowerBoundaryHighAlertValueSafeguard = pvm.parameters.BloodSugarParameters.LowerBoundaryHighAlertValueSafeguard;\r\n pvm.portalConfig.LowerBoundaryMediumAlertValueSafeguard = pvm.parameters.BloodSugarParameters.LowerBoundaryMediumAlertValueSafeguard;\r\n pvm.portalConfig.PostPrandialIncreasedHighAlertValueSafeguard = pvm.parameters.BloodSugarParameters.PostPrandialIncreasedHighAlertValueSafeguard;\r\n pvm.portalConfig.PostPrandialIncreasedMediumAlertValueSafeguard = pvm.parameters.BloodSugarParameters.PostPrandialIncreasedMediumAlertValueSafeguard;\r\n pvm.portalConfig.PostPrandialUpperBoundaryMediumAlertValueSafeguard = pvm.parameters.BloodSugarParameters.PostPrandialUpperBoundaryMediumAlertValueSafeguard;\r\n pvm.portalConfig.RandomUpperBoundaryHighAlertValueSafeguard = pvm.parameters.BloodSugarParameters.RandomUpperBoundaryHighAlertValueSafeguard;\r\n pvm.portalConfig.RandomUpperBoundaryMediumAlertValueSafeguard = pvm.parameters.BloodSugarParameters.RandomUpperBoundaryMediumAlertValueSafeguard;\r\n pvm.bloodSugarPattern = /^[0-9]*$/;\r\n pvm.bloodSugarStep = 1;\r\n pvm.bloodSugarMax = 999;\r\n pvm.bloodSugarPPMax = 3000;\r\n pvm.bloodSugarPPIncMax = 1000;\r\n pvm.bloodSugarPatternAlertText = 'must be a whole number greater than 0';\r\n }\r\n }\r\n\r\n if (pvm.parameters.DynamicParameters) {\r\n pvm.parameters.DynamicParameters.forEach(param => {\r\n param.BiometricAlertConditions.forEach(condit => condit.Severity = pvm.alertSeverityLevels.find(sev => sev.Value === condit.AlertSeverityLevelId));\r\n });\r\n }\r\n\r\n setPristine(false);\r\n\r\n pvm.parameters.SpirometerParameters.FEVOneHighAlert = padDecimal(pvm.parameters.SpirometerParameters.FEVOneHighAlert);\r\n pvm.parameters.SpirometerParameters.FEVOneMedAlert = padDecimal(pvm.parameters.SpirometerParameters.FEVOneMedAlert);\r\n pvm.parameters.SpirometerParameters.FEVRatioHighAlert = padDecimal(pvm.parameters.SpirometerParameters.FEVRatioHighAlert);\r\n pvm.parameters.SpirometerParameters.FEVRatioMedAlert = padDecimal(pvm.parameters.SpirometerParameters.FEVRatioMedAlert);\r\n\r\n pvm.parameters.ThermometerParameters.UpperHighAlert = padDecimal(pvm.parameters.ThermometerParameters.UpperHighAlert);\r\n pvm.parameters.ThermometerParameters.UpperMedAlert = padDecimal(pvm.parameters.ThermometerParameters.UpperMedAlert);\r\n pvm.parameters.ThermometerParameters.LowerHighAlert = padDecimal(pvm.parameters.ThermometerParameters.LowerHighAlert);\r\n pvm.parameters.ThermometerParameters.LowerMedAlert = padDecimal(pvm.parameters.ThermometerParameters.LowerMedAlert);\r\n\r\n pvm.parameters.WeightScaleParameters.Baseline_Weight = padDecimal(pvm.parameters.WeightScaleParameters.Baseline_Weight);\r\n pvm.parameters.WeightScaleParameters.Max_Weight = padDecimal(pvm.parameters.WeightScaleParameters.Max_Weight);\r\n pvm.parameters.WeightScaleParameters.Min_Weight = padDecimal(pvm.parameters.WeightScaleParameters.Min_Weight);\r\n pvm.parameters.WeightScaleParameters.High_Alert_Lbs = padDecimal(pvm.parameters.WeightScaleParameters.High_Alert_Lbs);\r\n pvm.parameters.WeightScaleParameters.Med_Alert_Lbs = padDecimal(pvm.parameters.WeightScaleParameters.Med_Alert_Lbs);\r\n pvm.parameters.WeightScaleParameters.Med_Alert_Lbs_Weekly = padDecimal(pvm.parameters.WeightScaleParameters.Med_Alert_Lbs_Weekly);\r\n\r\n pvm.portalConfig.BloodGlucoseGuidelines = pvm.parameters.BloodSugarParameters.BloodGlucoseGuidelines;\r\n pvm.portalConfig.BloodPressureGuidelines = pvm.parameters.BloodPressureParameters.BloodPressureGuidelines;\r\n pvm.portalConfig.OxygenSaturationGuidelines = pvm.parameters.PulseOxParameters.OxygenSaturationGuidelines;\r\n pvm.portalConfig.PedometerGuidelines = pvm.parameters.PedometerParameters.PedometerGuidelines;\r\n pvm.portalConfig.PulseGuidelines = pvm.parameters.PulseOxParameters.PulseGuidelines;\r\n pvm.portalConfig.SpirometerGuidelines = pvm.parameters.SpirometerParameters.SpirometerGuidelines;\r\n pvm.portalConfig.TemperatureGuidelines = pvm.parameters.ThermometerParameters.TemperatureGuidelines;\r\n pvm.portalConfig.WeightGuidelines = pvm.parameters.WeightScaleParameters.WeightGuidelines;\r\n\r\n pvm.portalConfig.DailyGain_S_LossPercentageSafeguard = pvm.parameters.WeightScaleParameters.DailyGain_S_LossPercentageSafeguard;\r\n pvm.portalConfig.DailyMediumAlertPercentageSafeguard = pvm.parameters.WeightScaleParameters.DailyMediumAlertPercentageSafeguard;\r\n pvm.portalConfig.WeeklyMediumAlertPercentageSafeguard = pvm.parameters.WeightScaleParameters.WeeklyMediumAlertPercentageSafeguard;\r\n pvm.portalConfig.WeeklyHighAlertPercentageSafeguard = pvm.parameters.WeightScaleParameters.WeeklyHighAlertPercentageSafeguard;\r\n if (pvm.parameters.WeightScaleParameters.UnitOfMeasure == \"kg\") {\r\n pvm.portalConfig.DailyHighAlertValueSafeguard = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.DailyHighAlertValueSafeguard);\r\n pvm.portalConfig.DailyMediumAlertValueSafeguard = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.DailyMediumAlertValueSafeguard);\r\n pvm.portalConfig.WeeklyMediumAlertValueSafeguard = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.WeeklyMediumAlertValueSafeguard);\r\n pvm.portalConfig.WeeklyHighAlertValueSafeguard = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.WeeklyHighAlertValueSafeguard);\r\n pvm.portalConfig.MaxMinWeightAbsoluteSafeguard = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.MaxMinWeightAbsoluteSafeguard);\r\n }\r\n else {\r\n pvm.portalConfig.DailyHighAlertValueSafeguard = pvm.parameters.WeightScaleParameters.DailyHighAlertValueSafeguard;\r\n pvm.portalConfig.DailyMediumAlertValueSafeguard = pvm.parameters.WeightScaleParameters.DailyMediumAlertValueSafeguard;\r\n pvm.portalConfig.WeeklyMediumAlertValueSafeguard = pvm.parameters.WeightScaleParameters.WeeklyMediumAlertValueSafeguard;\r\n pvm.portalConfig.WeeklyHighAlertValueSafeguard = pvm.parameters.WeightScaleParameters.WeeklyHighAlertValueSafeguard;\r\n pvm.portalConfig.MaxMinWeightAbsoluteSafeguard = pvm.parameters.WeightScaleParameters.MaxMinWeightAbsoluteSafeguard;\r\n }\r\n pvm.portalConfig.PulseHighAlertValueSafeguard = pvm.parameters.PulseOxParameters.PulseHighAlertValueSafeguard;\r\n pvm.portalConfig.PulseMediumAlertValueSafeguard = pvm.parameters.PulseOxParameters.PulseMediumAlertValueSafeguard;\r\n pvm.portalConfig.OxygenHighAlertValueSafeguard = pvm.parameters.PulseOxParameters.OxygenHighAlertValueSafeguard;\r\n pvm.portalConfig.OxygenMediumAlertValueSafeguard = pvm.parameters.PulseOxParameters.OxygenMediumAlertValueSafeguard;\r\n pvm.portalConfig.SystolicComparedToLastReadingPositiveDifferentialSafeguard = pvm.parameters.BloodPressureParameters.SystolicComparedToLastReadingPositiveDifferentialSafeguard;\r\n pvm.portalConfig.SystolicComparedToLastReadingNegativeDifferentialSafeguard = pvm.parameters.BloodPressureParameters.SystolicComparedToLastReadingNegativeDifferentialSafeguard;\r\n pvm.portalConfig.SystolicUpperBoundaryHighAlertValueSafeguard = pvm.parameters.BloodPressureParameters.SystolicUpperBoundaryHighAlertValueSafeguard;\r\n pvm.portalConfig.SystolicUpperBoundaryMediumAlertValueSafeguard = pvm.parameters.BloodPressureParameters.SystolicUpperBoundaryMediumAlertValueSafeguard;\r\n pvm.portalConfig.SystolicLowerBoundaryHighAlertValueSafeguard = pvm.parameters.BloodPressureParameters.SystolicLowerBoundaryHighAlertValueSafeguard;\r\n pvm.portalConfig.SystolicLowerBoundaryMediumAlertValueSafeguard = pvm.parameters.BloodPressureParameters.SystolicLowerBoundaryMediumAlertValueSafeguard;\r\n pvm.portalConfig.DiastolicUpperBoundaryHighAlertValueSafeguard = pvm.parameters.BloodPressureParameters.DiastolicUpperBoundaryHighAlertValueSafeguard;\r\n pvm.portalConfig.DiastolicUpperBoundaryMediumAlertValueSafeguard = pvm.parameters.BloodPressureParameters.DiastolicUpperBoundaryMediumAlertValueSafeguard;\r\n pvm.portalConfig.DiastolicLowerBoundaryMediumAlertValueSafeguard = pvm.parameters.BloodPressureParameters.DiastolicLowerBoundaryMediumAlertValueSafeguard;\r\n pvm.portalConfig.PedometerHighAlertSafeguard = pvm.parameters.PedometerParameters.PedometerHighAlertSafeguard;\r\n pvm.portalConfig.PedometerMediumAlertSafeguard = pvm.parameters.PedometerParameters.PedometerMediumAlertSafeguard;\r\n pvm.portalConfig.MaxMinWeightPercentageSafeguard = pvm.parameters.WeightScaleParameters.MaxMinWeightPercentageSafeguard;\r\n pvm.weightScaleDayCount = pvm.parameters.WeightScaleParameters.WeightScaleGainLossAlertDays\r\n pvm.portalConfig.MaxMinWeightAbsolute = pvm.parameters.WeightScaleParameters.MaxMinWeightAbsolute;\r\n pvm.portalConfig.MaxMinWeightPercentage = pvm.parameters.WeightScaleParameters.MaxMinWeightPercentage;\r\n pvm.weightVariance = Math.min(pvm.parameters.WeightScaleParameters.Baseline_Weight * pvm.portalConfig.MaxMinWeightPercentageSafeguard / 100, pvm.portalConfig.MaxMinWeightAbsoluteSafeguard);\r\n \r\n }\r\n\r\n function setPristine(isDirty) {\r\n dirtySections.bp = isDirty;\r\n dirtySections.pulseOxy = isDirty;\r\n dirtySections.wt = isDirty;\r\n dirtySections.gluco = isDirty;\r\n dirtySections.thermo = isDirty;\r\n dirtySections.spiro = isDirty;\r\n dirtySections.tablet = isDirty;\r\n pvm.formDirty = isDirty;\r\n }\r\n\r\n pvm.ok = function(deleteTimeLog) {\r\n vm.timeLog.DeleteTimeLogReasonId = vm.selectedOption.DeleteTimeLogReasonId;\r\n $uibModalInstance.close(vm.timeLog);\r\n }\r\n\r\n pvm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function padDecimal(value) {\r\n return value;\r\n // val = value.toString();\r\n // if (val.indexOf(\".\") == -1) {\r\n // return val + \".00\";\r\n // } else {\r\n // if (val.split(\".\")[1].length == 1) {\r\n // return val + \"0\";\r\n // }\r\n // }\r\n // return val;\r\n }\r\n\r\n function getTempLabel(temp) {\r\n var label = \"°\";\r\n if (portalConfig.DefaultTempUnit == \"C\") {\r\n label += \"C\";\r\n } else {\r\n label += \"F\";\r\n }\r\n if (temp === undefined) {\r\n return label;\r\n }\r\n if (portalConfig.DisplayBothTempUnits === true) {\r\n if (portalConfig.DefaultTempUnit == \"C\") {\r\n label = label + \" (\" + vhUomConversionService.convertToF(temp) + \" °F)\";\r\n } else {\r\n label = label + \" (\" + vhUomConversionService.convertToC(temp) + \" °C)\";\r\n }\r\n }\r\n return label;\r\n }\r\n\r\n\r\n function getWeightLabel(weight) {\r\n var label = \"lbs\";\r\n if (pvm.parameters.WeightScaleParameters.UnitOfMeasure == \"kg\") {\r\n label = \"kg\";\r\n }\r\n if (weight === undefined) {\r\n return label;\r\n }\r\n if (portalConfig.DisplayBothUnitsOfWeight === true) {\r\n if (pvm.parameters.WeightScaleParameters.UnitOfMeasure == \"kg\") {\r\n label = label + \" (\" + vhUomConversionService.convertToLb(weight) + \" lb)\";\r\n } else {\r\n label = label + \" (\" + vhUomConversionService.convertToKg(weight) + \" kg)\";\r\n }\r\n }\r\n return label;\r\n }\r\n\r\n function getWeightDayRangeLabel() {\r\n //WeightScaleGainLossAlertDays\r\n }\r\n\r\n function weightUnitChanged() {\r\n sectionChanged(\"wt\");\r\n if (pvm.parameters.WeightScaleParameters.UnitOfMeasure == \"kg\") {\r\n pvm.parameters.WeightScaleParameters.Baseline_Weight = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.Baseline_Weight);\r\n pvm.parameters.WeightScaleParameters.Max_Weight = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.Max_Weight);\r\n pvm.parameters.WeightScaleParameters.Min_Weight = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.Min_Weight);\r\n pvm.parameters.WeightScaleParameters.High_Alert_Lbs = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.High_Alert_Lbs);\r\n pvm.parameters.WeightScaleParameters.Med_Alert_Lbs = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.Med_Alert_Lbs);\r\n pvm.parameters.WeightScaleParameters.Med_Alert_Lbs_Weekly = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.Med_Alert_Lbs_Weekly);\r\n pvm.parameters.WeightScaleParameters.High_Alert_Lbs_Weekly = vhUomConversionService.convertToKg(pvm.parameters.WeightScaleParameters.High_Alert_Lbs_Weekly);\r\n pvm.portalConfig.MaxMinWeightAbsoluteSafeguard = vhUomConversionService.convertToKg(pvm.portalConfig.MaxMinWeightAbsoluteSafeguard);\r\n pvm.portalConfig.DailyHighAlertValueSafeguard = vhUomConversionService.convertToKg(pvm.portalConfig.DailyHighAlertValueSafeguard);\r\n pvm.portalConfig.DailyMediumAlertValueSafeguard = vhUomConversionService.convertToKg(pvm.portalConfig.DailyMediumAlertValueSafeguard);\r\n pvm.portalConfig.WeeklyMediumAlertValueSafeguard = vhUomConversionService.convertToKg(pvm.portalConfig.WeeklyMediumAlertValueSafeguard);\r\n pvm.portalConfig.WeeklyHighAlertValueSafeguard = vhUomConversionService.convertToKg(pvm.portalConfig.WeeklyHighAlertValueSafeguard);\r\n pvm.weightVariance = vhUomConversionService.convertToKg(pvm.weightVariance);\r\n } else {\r\n pvm.parameters.WeightScaleParameters.Baseline_Weight = vhUomConversionService.convertToLb(pvm.parameters.WeightScaleParameters.Baseline_Weight);\r\n pvm.parameters.WeightScaleParameters.Max_Weight = vhUomConversionService.convertToLb(pvm.parameters.WeightScaleParameters.Max_Weight);\r\n pvm.parameters.WeightScaleParameters.Min_Weight = vhUomConversionService.convertToLb(pvm.parameters.WeightScaleParameters.Min_Weight);\r\n pvm.parameters.WeightScaleParameters.High_Alert_Lbs = vhUomConversionService.convertToLb(pvm.parameters.WeightScaleParameters.High_Alert_Lbs);\r\n pvm.parameters.WeightScaleParameters.Med_Alert_Lbs = vhUomConversionService.convertToLb(pvm.parameters.WeightScaleParameters.Med_Alert_Lbs);\r\n pvm.parameters.WeightScaleParameters.Med_Alert_Lbs_Weekly = vhUomConversionService.convertToLb(pvm.parameters.WeightScaleParameters.Med_Alert_Lbs_Weekly);\r\n pvm.parameters.WeightScaleParameters.High_Alert_Lbs_Weekly = vhUomConversionService.convertToLb(pvm.parameters.WeightScaleParameters.High_Alert_Lbs_Weekly);\r\n pvm.portalConfig.MaxMinWeightAbsoluteSafeguard = vhUomConversionService.convertToLb(pvm.portalConfig.MaxMinWeightAbsoluteSafeguard);\r\n pvm.portalConfig.DailyHighAlertValueSafeguard = vhUomConversionService.convertToLb(pvm.portalConfig.DailyHighAlertValueSafeguard);\r\n pvm.portalConfig.DailyMediumAlertValueSafeguard = vhUomConversionService.convertToLb(pvm.portalConfig.DailyMediumAlertValueSafeguard);\r\n pvm.portalConfig.WeeklyMediumAlertValueSafeguard = vhUomConversionService.convertToLb(pvm.portalConfig.WeeklyMediumAlertValueSafeguard);\r\n pvm.portalConfig.WeeklyHighAlertValueSafeguard = vhUomConversionService.convertToLb(pvm.portalConfig.WeeklyHighAlertValueSafeguard);\r\n pvm.weightVariance = vhUomConversionService.convertToLb(pvm.weightVariance);\r\n }\r\n }\r\n\r\n function sectionChanged(section) {\r\n pvm.formDirty = true;\r\n if (section == \"bp\") {\r\n dirtySections.bp = true;\r\n } else if (section == \"pulseOxy\") {\r\n dirtySections.pulseOxy = true;\r\n } else if (section == \"wt\") {\r\n dirtySections.wt = true;\r\n } else if (section == \"gluco\") {\r\n dirtySections.gluco = true;\r\n } else if (section == \"thermo\") {\r\n dirtySections.thermo = true;\r\n } else if (section == \"spiro\") {\r\n dirtySections.spiro = true;\r\n } else if (section == \"pedo\") {\r\n dirtySections.pedo = true;\r\n } else if (section == \"tablet\") {\r\n dirtySections.tablet = true;\r\n }\r\n\r\n }\r\n\r\n function sectionChangedDynamic() {\r\n if (pvm.parameters && originalParameters.DynamicParameters && pvm.parameters.DynamicParameters != originalParameters.DynamicParameters) {\r\n pvm.formDirty = true;\r\n dirtySections.dynamic = true;\r\n return true;\r\n }\r\n }\r\n\r\n\r\n\r\n function openChangeReasonModal() {\r\n\r\n if (dirtySections.bp || dirtySections.pulseOxy || dirtySections.wt || dirtySections.gluco || dirtySections.thermo || dirtySections.spiro || dirtySections.pedo || sectionChangedDynamic()) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/parameters/addchangereason.modal.html',\r\n controller: 'AddChangeReasonController as vm',\r\n backdrop: 'static',\r\n size: 'sm',\r\n resolve: {\r\n patientId: function() {\r\n return pvm.parameters.PatientId;\r\n }\r\n }\r\n });\r\n \r\n modalInstance.result.then(function (changeReason) {\r\n saveChanges(changeReason);\r\n });\r\n }\r\n else {\r\n saveChanges(\"\");\r\n }\r\n }\r\n\r\n function saveChanges(changeReason) {\r\n $scope.parametersForm.$setSubmitted();\r\n let invalidDynamic = pvm.parameters.DynamicParameters.find(p => p.BiometricAlertConditions.find(c => c.BiometricAlertExpressions.find(e => e.valueInvalid)));\r\n if ($scope.parametersForm.$invalid || invalidDynamic) {\r\n expandAllNodes();\r\n $timeout(function () {\r\n var errorType = Object.keys($scope.parametersForm.$error)[0];\r\n if (errorType) {\r\n SmoothScroll.scroll($scope.parametersForm.$error[errorType][0].$name, $scope.parametersForm.$error[errorType][0].$name, 200);\r\n }\r\n else {\r\n var element = document.querySelector(\"div[name='header\" + invalidDynamic.BiometricMeasurementTypeId + \"']\");\r\n element.scrollIntoView({ behavior: 'smooth' });\r\n }\r\n }, 500);\r\n\r\n console.log($scope.parametersForm.$error);\r\n return false;\r\n }\r\n\r\n //No need to save all sections if they only touched one. This is more efficient since sections all live in\r\n //different database tables\r\n var parametersSaveModel = {};\r\n pvm.DynamicParameters = {};\r\n\r\n parametersSaveModel.PatientId = pvm.parameters.PatientId;\r\n if (dirtySections.dynamic === true) {\r\n let updatedCondition, originalCondition, unique, bt, bAId = [];\r\n //get only the updatedCondition alert\r\n updatedCondition = pvm.parameters.DynamicParameters\r\n .filter(p => p.BiometricAlertConditions\r\n .some(c => c.isDirty === true))\r\n .map(x => x.BiometricAlertConditions\r\n .map(x => ({Condition: x.Condition, BiometricAlertConditionId: x.BiometricAlertConditionId})))\r\n .flat();\r\n \r\n //grab all the conditions from the original set of alerts\r\n originalCondition = originalParameters.DynamicParameters.map(x => x.BiometricAlertConditions\r\n .map(y => ({Condition: y.Condition, BiometricAlertConditionId: y.BiometricAlertConditionId})))\r\n .flat();\r\n \r\n //grab the difference or unique conditions\r\n unique = updatedCondition.filter((u) => originalCondition\r\n .find(o => o.BiometricAlertConditionId == u.BiometricAlertConditionId).Condition != u.Condition);\r\n \r\n if (unique.length > 0){\r\n bAId = unique.map(x => x.BiometricAlertConditionId);\r\n bt = pvm.parameters.DynamicParameters.filter(p => p.BiometricAlertConditions\r\n .some(bac => bAId.includes(bac.BiometricAlertConditionId)));\r\n parametersSaveModel.DynamicParameters = bt.map(obj=> ({ ...obj, ChangeReason: changeReason }));\r\n parametersSaveModel.DynamicParameters.PatientId = pvm.parameters.PatientId;\r\n pvm.DynamicParameters = parametersSaveModel.DynamicParameters;\r\n }\r\n }\r\n if (dirtySections.bp === true) {\r\n parametersSaveModel.BloodPressureParameters = angular.copy(pvm.parameters.BloodPressureParameters);\r\n parametersSaveModel.BloodPressureParameters.PatientId = pvm.parameters.PatientId;\r\n parametersSaveModel.BloodPressureParameters.TimeDiffBetReadings = pvm.parameters.BloodPressureParameters.TimeDiffBetReadings * 60;\r\n parametersSaveModel.BloodPressureParameters.ChangeReason = changeReason;\r\n if (pvm.heartRateDevice == \"bp\") {\r\n parametersSaveModel.BloodPressureParameters.ObtainPulse = true;\r\n } else {\r\n parametersSaveModel.BloodPressureParameters.ObtainPulse = false;\r\n }\r\n }\r\n if (dirtySections.pulseOxy === true) {\r\n parametersSaveModel.PulseOxParameters = pvm.parameters.PulseOxParameters;\r\n parametersSaveModel.PulseOxParameters.PatientId = pvm.parameters.PatientId;\r\n parametersSaveModel.PulseOxParameters.ChangeReason = changeReason;\r\n }\r\n if (dirtySections.wt === true) {\r\n parametersSaveModel.WeightScaleParameters = pvm.parameters.WeightScaleParameters;\r\n parametersSaveModel.WeightScaleParameters.PatientId = pvm.parameters.PatientId;\r\n parametersSaveModel.WeightScaleParameters.ChangeReason = changeReason;\r\n }\r\n if (dirtySections.gluco === true) {\r\n if (portalConfig.DefaultBloodSugarUnit == 'mmol/L') {\r\n pvm.parameters.BloodSugarParameters.LB_High = vhUomConversionService.convertToMgdL(pvm.bloodSugarValues.lowerValueHigh);\r\n pvm.parameters.BloodSugarParameters.LB_Med = vhUomConversionService.convertToMgdL(pvm.bloodSugarValues.lowerValueMed);\r\n pvm.parameters.BloodSugarParameters.UB_Fasting_Med = vhUomConversionService.convertToMgdL(pvm.bloodSugarValues.upperFastingMed);\r\n pvm.parameters.BloodSugarParameters.UB_PP_Med = vhUomConversionService.convertToMgdL(pvm.bloodSugarValues.upperPPMed);\r\n pvm.parameters.BloodSugarParameters.UB_PP_Inc_High = vhUomConversionService.convertToMgdL(pvm.bloodSugarValues.upperPPIncHigh);\r\n pvm.parameters.BloodSugarParameters.UB_PP_Inc_Med = vhUomConversionService.convertToMgdL(pvm.bloodSugarValues.upperPPIncMed);\r\n pvm.parameters.BloodSugarParameters.UB_RandomChk_Med = vhUomConversionService.convertToMgdL(pvm.bloodSugarValues.upperRandomCheckMed);\r\n pvm.parameters.BloodSugarParameters.UB_RandomChk_High = vhUomConversionService.convertToMgdL(pvm.bloodSugarValues.upperRandomCheckHigh);\r\n }\r\n else {\r\n pvm.parameters.BloodSugarParameters.LB_High = pvm.bloodSugarValues.lowerValueHigh;\r\n pvm.parameters.BloodSugarParameters.LB_Med = pvm.bloodSugarValues.lowerValueMed;\r\n pvm.parameters.BloodSugarParameters.UB_Fasting_Med = pvm.bloodSugarValues.upperFastingMed;\r\n pvm.parameters.BloodSugarParameters.UB_PP_Med = pvm.bloodSugarValues.upperPPMed;\r\n pvm.parameters.BloodSugarParameters.UB_PP_Inc_High = pvm.bloodSugarValues.upperPPIncHigh;\r\n pvm.parameters.BloodSugarParameters.UB_PP_Inc_Med = pvm.bloodSugarValues.upperPPIncMed;\r\n pvm.parameters.BloodSugarParameters.UB_RandomChk_Med = pvm.bloodSugarValues.upperRandomCheckMed;\r\n pvm.parameters.BloodSugarParameters.UB_RandomChk_High = pvm.bloodSugarValues.upperRandomCheckHigh;\r\n }\r\n\r\n parametersSaveModel.BloodSugarParameters = pvm.parameters.BloodSugarParameters;\r\n parametersSaveModel.BloodSugarParameters.PatientId = pvm.parameters.PatientId;\r\n parametersSaveModel.BloodSugarParameters.IsSingleReading = !pvm.glucoAdvanced;\r\n parametersSaveModel.BloodSugarParameters.ChangeReason = changeReason;\r\n }\r\n if (dirtySections.thermo === true) {\r\n pvm.parameters.ThermometerParameters.PatientId = pvm.parameters.PatientId;\r\n if (portalConfig.DefaultTempUnit == \"C\") {\r\n pvm.parameters.ThermometerParameters.UpperHighAlert = vhUomConversionService.convertToF(pvm.tempValues.upperhigh);\r\n pvm.parameters.ThermometerParameters.UpperMedAlert = vhUomConversionService.convertToF(pvm.tempValues.upperMed);\r\n pvm.parameters.ThermometerParameters.LowerHighAlert = vhUomConversionService.convertToF(pvm.tempValues.lowerHigh);\r\n pvm.parameters.ThermometerParameters.LowerMedAlert = vhUomConversionService.convertToF(pvm.tempValues.lowerMed);\r\n } else {\r\n pvm.parameters.ThermometerParameters.UpperHighAlert = pvm.tempValues.upperhigh;\r\n pvm.parameters.ThermometerParameters.UpperMedAlert = pvm.tempValues.upperMed;\r\n pvm.parameters.ThermometerParameters.LowerHighAlert = pvm.tempValues.lowerHigh;\r\n pvm.parameters.ThermometerParameters.LowerMedAlert = pvm.tempValues.lowerMed;\r\n }\r\n parametersSaveModel.ThermometerParameters = pvm.parameters.ThermometerParameters;\r\n parametersSaveModel.ThermometerParameters.ChangeReason = changeReason;\r\n }\r\n if (dirtySections.spiro === true) {\r\n parametersSaveModel.SpirometerParameters = pvm.parameters.SpirometerParameters;\r\n parametersSaveModel.SpirometerParameters.PatientId = pvm.parameters.PatientId;\r\n parametersSaveModel.SpirometerParameters.ChangeReason = changeReason;\r\n }\r\n if (dirtySections.pedo === true) {\r\n parametersSaveModel.PedometerParameters = pvm.parameters.PedometerParameters;\r\n parametersSaveModel.PedometerParameters.PatientId = pvm.parameters.PatientId;\r\n parametersSaveModel.PedometerParameters.ChangeReason = changeReason;\r\n }\r\n if (dirtySections.tablet === true) {\r\n parametersSaveModel.TabletParameters = pvm.parameters.TabletParameters;\r\n parametersSaveModel.TabletParameters.PatientId = pvm.parameters.PatientId;\r\n parametersSaveModel.TabletParameters.ChangeReason = changeReason;\r\n }\r\n\r\n return ParametersService.saveParameters(parametersSaveModel.PatientId, parametersSaveModel).then(function (data) {\r\n if (pvm.DynamicParameters && pvm.DynamicParameters.PatientId) {\r\n data.DynamicParameters.forEach(parameter => {\r\n let oldDyn = pvm.parameters.DynamicParameters.find(p => p.BiometricMeasurementTypeId == parameter.BiometricMeasurementTypeId);\r\n let idx = pvm.parameters.DynamicParameters.indexOf(oldDyn);\r\n pvm.parameters.DynamicParameters[idx] = parameter;\r\n });\r\n } \r\n else {\r\n if(data.PedometerParameters){\r\n pvm.parameters.PedometerParameters.ChangeReason = data.PedometerParameters.ChangeReason;\r\n pvm.parameters.PedometerParameters.ModifiedDateTime_UTC = data.PedometerParameters.ModifiedDateTime_UTC;\r\n pvm.parameters.PedometerParameters.ModifiedByName = data.PedometerParameters.ModifiedByName;\r\n }\r\n if(data.SpirometerParameters){\r\n pvm.parameters.SpirometerParameters.ChangeReason = data.SpirometerParameters.ChangeReason;\r\n pvm.parameters.SpirometerParameters.ModifiedDateTime_UTC = data.SpirometerParameters.ModifiedDateTime_UTC;\r\n pvm.parameters.SpirometerParameters.ModifiedByName = data.SpirometerParameters.ModifiedByName;\r\n }\r\n if(data.ThermometerParameters){\r\n pvm.parameters.ThermometerParameters.ChangeReason = data.ThermometerParameters.ChangeReason;\r\n pvm.parameters.ThermometerParameters.ModifiedDateTime_UTC = data.ThermometerParameters.ModifiedDateTime_UTC;\r\n pvm.parameters.ThermometerParameters.ModifiedByName = data.ThermometerParameters.ModifiedByName;\r\n }\r\n if(data.BloodSugarParameters){\r\n pvm.parameters.BloodSugarParameters.ChangeReason = data.BloodSugarParameters.ChangeReason;\r\n pvm.parameters.BloodSugarParameters.ModifiedDtUTC = data.BloodSugarParameters.ModifiedDtUTC;\r\n pvm.parameters.BloodSugarParameters.ModifiedByName = data.BloodSugarParameters.ModifiedByName;\r\n }\r\n if(data.WeightScaleParameters){\r\n pvm.parameters.WeightScaleParameters.ChangeReason = data.WeightScaleParameters.ChangeReason;\r\n pvm.parameters.WeightScaleParameters.ModifiedDtUTC = data.WeightScaleParameters.ModifiedDtUTC;\r\n pvm.parameters.WeightScaleParameters.ModifiedByName = data.WeightScaleParameters.ModifiedByName;\r\n }\r\n if(data.BloodPressureParameters){\r\n pvm.parameters.BloodPressureParameters.ChangeReason = data.BloodPressureParameters.ChangeReason;\r\n pvm.parameters.BloodPressureParameters.ModifiedDtUTC = data.BloodPressureParameters.ModifiedDtUTC;\r\n pvm.parameters.BloodPressureParameters.ModifiedByName = data.BloodPressureParameters.ModifiedByName;\r\n }\r\n if(data.PulseOxParameters){\r\n pvm.parameters.PulseOxParameters.ChangeReason = data.PulseOxParameters.ChangeReason;\r\n pvm.parameters.PulseOxParameters.ModifiedDtUTC = data.PulseOxParameters.ModifiedDtUTC;\r\n pvm.parameters.PulseOxParameters.ModifiedByName = data.PulseOxParameters.ModifiedByName;\r\n }\r\n }\r\n updatePage();\r\n });\r\n\r\n\r\n function updatePage() {\r\n originalParameters = angular.copy(pvm.parameters);\r\n $scope.parametersForm.$setPristine(true);\r\n setPristine(false);\r\n }\r\n }\r\n\r\n function cancelChanges() {\r\n $scope.parametersForm.High_Alert_Lbs_Weekly.$setValidity(\"Equal\", true);\r\n $scope.parametersForm.High_Alert_Per_Weekly.$setValidity(\"Equal\", true);\r\n $scope.parametersForm.$setPristine(true);\r\n pvm.parameters = angular.copy(originalParameters);\r\n pvm.DynamicParameters = {};\r\n loadController();\r\n }\r\n\r\n function toggleExpansion() {\r\n if (pvm.toggleExpand) {\r\n expandAllNodes();\r\n }\r\n else {\r\n collapseAllNodes();\r\n }\r\n }\r\n\r\n function expandAllNodes() {\r\n pvm.collapsed.bloodPressure = pvm.collapsed.oxygen = pvm.collapsed.heartRate = pvm.collapsed.weight = pvm.collapsed.glucometer = pvm.collapsed.thermo = pvm.collapsed.spiro = pvm.collapsed.pedo = pvm.collapsed.tablet = false;\r\n pvm.parameters.DynamicParameters.forEach(p => p.expanded = true);\r\n pvm.toggleExpand = false;\r\n }\r\n\r\n function collapseAllNodes() {\r\n pvm.collapsed.bloodPressure = pvm.collapsed.oxygen = pvm.collapsed.heartRate = pvm.collapsed.weight = pvm.collapsed.glucometer = pvm.collapsed.thermo = pvm.collapsed.spiro = pvm.collapsed.pedo = pvm.collapsed.tablet = true;\r\n pvm.parameters.DynamicParameters.forEach(p => p.expanded = false);\r\n pvm.toggleExpand = true;\r\n }\r\n\r\n function setMinMaxWeights() {\r\n\r\n var variance = pvm.parameters.WeightScaleParameters.Baseline_Weight * 0.1;\r\n\r\n if (portalConfig.MaxMinWeightPercentage > 0) {\r\n variance = pvm.parameters.WeightScaleParameters.Baseline_Weight * portalConfig.MaxMinWeightPercentage / 100;\r\n } else if (portalConfig.MaxMinWeightAbsolute > 0) {\r\n if (pvm.parameters.WeightScaleParameters.UnitOfMeasure == \"kg\") {\r\n variance = vhUomConversionService.convertToKg(portalConfig.MaxMinWeightAbsolute);\r\n } else {\r\n variance = portalConfig.MaxMinWeightAbsolute;\r\n }\r\n }\r\n pvm.weightVariance = Math.min(pvm.parameters.WeightScaleParameters.Baseline_Weight * portalConfig.MaxMinWeightPercentageSafeguard / 100, portalConfig.MaxMinWeightAbsoluteSafeguard);\r\n\r\n if (pvm.parameters.WeightScaleParameters.Baseline_Weight === 0) {\r\n pvm.parameters.WeightScaleParameters.Max_Weight = 0;\r\n pvm.parameters.WeightScaleParameters.Min_Weight = 0;\r\n } else {\r\n pvm.parameters.WeightScaleParameters.Max_Weight = pvm.parameters.WeightScaleParameters.Baseline_Weight + variance;\r\n //limit to 2 decimal places\r\n pvm.parameters.WeightScaleParameters.Max_Weight = parseFloat(pvm.parameters.WeightScaleParameters.Max_Weight.toFixed(2));\r\n \r\n pvm.parameters.WeightScaleParameters.Min_Weight = pvm.parameters.WeightScaleParameters.Baseline_Weight - variance;\r\n //Limit to 2 decimal places\r\n pvm.parameters.WeightScaleParameters.Min_Weight = parseFloat(pvm.parameters.WeightScaleParameters.Min_Weight.toFixed(2));\r\n }\r\n }\r\n}\r\n\r\nangular.module('patient.parameters').controller('ParametersController', ParametersController);\r\n","function ParametersService($http) {\r\n\r\n function GetParameters(patientId) {\r\n return $http.get(\"/api/patient/\" + patientId + \"/Parameter\").then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function GetParameter(patientId, parameterName) {\r\n return $http.get(\"/api/patient/\" + patientId + \"/Parameter/\" + parameterName).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function SaveParameters(patientId, parameters) {\r\n return $http.put(\"/api/patient/\" + patientId + \"/Parameter\", parameters).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function GetChangeReasons(patientId) {\r\n return $http.get(\"/api/BiometricThresholdsChangeReason/\"+ patientId).then(function(data) {\r\n return data.data;\r\n });\r\n}\r\n\r\n return {\r\n getParameters: GetParameters,\r\n getParameter: GetParameter,\r\n saveParameters: SaveParameters,\r\n getChangeReasons: GetChangeReasons,\r\n };\r\n\r\n}\r\n\r\nangular.module('patient.parameters').service('ParametersService', ParametersService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/parameters/parameters.tpl.html',\n '
          Patient Parameters
          Weight (Individualized)
           Blood Pressure (Individualized)
           Oxygen Saturation (Individualized)
           Heart Rate (Individualized)
           Blood Sugar (Individualized)
          Temperature (Individualized)
           Spirometry (Individualized)
           Steps (Individualized)
           Tablet
          Reminders Enabled
          {{bt.BiometricMeasurementTypeName}} (Individualized)
          {{condition.Severity.Name}}
          One or more values were changed by {{bt.ModifiedByName}} on {{bt.ModifiedDateTime_UTC | date:\"medium\"}} with the reason: {{bt.ChangeReason}}
          {{bt.AlertName}}
          ');\n}]);\n}(window, document, window.angular));","function PatientController(patientContent, $state, $rootScope, $scope, $timeout, PatientHeaderService, PatientListService) {\r\n var vm = this;\r\n vm.patient = patientContent.patient;\r\n\r\n vm.showSpirometer = patientContent.IsSpirometerEnabled;\r\n vm.isTimeLogEnabled = patientContent.IsTimeLogEnabled;\r\n vm.isPatientDataTransferEnabled = patientContent.IsPatientDataTransferEnabled;\r\n vm.tempUnits = patientContent.DefaultTemperatureUnit;\r\n vm.displayBothTempUnits = patientContent.ShowBothTemperatureUnits;\r\n vm.multiSpecialHandlingColor = patientContent.MultipleSpecialHandlingColor;\r\n vm.displayBothWeight = patientContent.ShowBothWeightUnits;\r\n vm.directEntryEnabled = patientContent.IsDirectEntryEnabled;\r\n vm.patientHeaderConfigurations = patientContent.PatientHeaderConfigurations;\r\n var listener = $rootScope.$on(\"vh:patientUpdated\", function () {\r\n PatientHeaderService.getPatientHeader(patientContent.patient.id).then(function (data) {\r\n return PatientHeaderService.mapPatient(data.PatientHeader);\r\n }).then(function (patient) {\r\n patientContent.patient = patient;\r\n vm.patient = patient;\r\n vm.refreshPatient = true;\r\n $timeout(function () {\r\n vm.refreshPatient = false;\r\n });\r\n });\r\n });\r\n\r\n // go get the current page of virtual visits\r\n PatientListService.getPatientsScheduleVirtualVisits([patientContent.patient.id]);\r\n $rootScope.$emit(\"vh:patientSelected\", patientContent.patient.id, patientContent.patient);\r\n\r\n $scope.$on(\"$destroy\", function() { \r\n $rootScope.$emit(\"vh:patientSelected\", -1, null );\r\n listener(); // remove listener\r\n });\r\n}\r\nangular.module(\"patient\").controller(\"PatientController\", PatientController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/patient.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function AdmitDirective() {\r\n\r\n function controller($scope, ClinicalHistoryService, $stateParams, vhSweetAlert, lodash, $uibModal) {\r\n $scope.admitData = {};\r\n $scope.newAdmitData = {};\r\n $scope.newAdmitData.Comment = \"\";\r\n\r\n $scope.admitData.patientAdmitData = [];\r\n $scope.date = {\r\n admitDate: null,\r\n dischargeDate: null,\r\n readOnly: true\r\n };\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n ClinicalHistoryService.getPatientAdmitDischarge($stateParams.patientId).then(function(data) {\r\n $scope.admitData.patientAdmitData = data;\r\n });\r\n }\r\n\r\n $scope.addDischargeInfo = function() {\r\n if (!$scope.admitDischargeForm.admitDate.$valid) {\r\n vhSweetAlert.error('Admit date is not in correct format: mm/dd/yyyy');\r\n } else if (!$scope.admitDischargeForm.dischargeDate.$valid) {\r\n vhSweetAlert.error('Discharge date is not in correct format: mm/dd/yyyy');\r\n } else if ($scope.date.admitDate !== null && $scope.date.dischargeDate !== null && $scope.date.admitDate > $scope.date.dischargeDate) {\r\n vhSweetAlert.error('Admit date must be before discharge date');\r\n } else {\r\n $scope.newAdmitData.PatientId = $stateParams.patientId;\r\n $scope.newAdmitData.AdmitDtUTC = $scope.date.admitDate;\r\n $scope.newAdmitData.DischargeDtUTC = $scope.date.dischargeDate;\r\n ClinicalHistoryService.addAdmitDischargeInfo($stateParams.patientId, $scope.newAdmitData).then(function(data) {\r\n $scope.admitData.patientAdmitData.push(data);\r\n $scope.newAdmitData = {};\r\n $scope.admitDischargeForm.$setPristine(true);\r\n $scope.date.dischargeDate = null;\r\n $scope.date.admitDate = null;\r\n });\r\n }\r\n };\r\n\r\n $scope.deleteAdmitData = function(admitData) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this Patient Admit/Discharge detail?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n ClinicalHistoryService.deleteAdmitDischargeInfo($stateParams.patientId, admitData.Id).then(function(data) {\r\n lodash.remove($scope.admitData.patientAdmitData, { Id: admitData.Id });\r\n });\r\n }\r\n });\r\n };\r\n\r\n $scope.editAdmitData = function(admitData) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/PMHx/editAdmitDischarge.modal.html',\r\n controller: 'EditAdmitDischargeModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n admitDischargeDetail: function () {\r\n return admitData;\r\n }\r\n }\r\n\r\n });\r\n modalInstance.result.then(function(editedAdmitData) {\r\n admitData.AdmitDtUTC = editedAdmitData.AdmitDtUTC;\r\n admitData.DischargeDtUTC = editedAdmitData.DischargeDtUTC;\r\n admitData.Comment = editedAdmitData.Comment;\r\n ClinicalHistoryService.editAdmitDischargeInfo($stateParams.patientId, admitData).then(function(data) {\r\n });\r\n }, function () {\r\n });\r\n };\r\n }\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n templateUrl: \"modules/patient/PMHx/admit.tpl.html\",\r\n controller: controller\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.clinicalhistory\").directive(\"admit\", AdmitDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/PMHx/admit.tpl.html',\n '
          Patient Admit / Discharge Details
          Admit DateDischarge DateComments
          {{admitData.AdmitDtUTC | datetime}}{{admitData.DischargeDtUTC | datetime}}{{admitData.Comment | datetime}}
          ');\n}]);\n}(window, document, window.angular));","function ClinicalHistoryService($http) {\r\n\r\n function GetPatientComorbidities(patientId) {\r\n return $http.get(\"/api/patient/\" + patientId + \"/comorbidity\").then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function GetComorbidities() {\r\n return $http.get(\"/api/comorbidity/\").then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function AddComorbidity(patientId, comorbidity) {\r\n return $http.post(\"/api/patient/\" + patientId + \"/comorbidity\", comorbidity).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function RemoveComorbidity(patientId, comorbidityId) {\r\n return $http.delete(\"/api/patient/\" + patientId + \"/comorbidity/\" + comorbidityId).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function EditPatientComorbidities(patientId, comorbidities) {\r\n return $http.put(\"/api/patient/\" + patientId + \"/comorbidity\", comorbidities).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function GetPatientAdmitDischarge(patientId) {\r\n return $http.get(\"/api/patient/\" + patientId + \"/admitdischarge\").then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function AddAdmitDischargeInfo(patientId, admitDischargeInfo) {\r\n return $http.post(\"/api/patient/\" + patientId + \"/admitdischarge\", admitDischargeInfo).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function EditAdmitDischargeInfo(patientId, admitDischargeInfo) {\r\n return $http.put(\"/api/patient/\" + patientId + \"/admitdischarge\", admitDischargeInfo).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function DeleteAdmitDischargeInfo(patientId, admitId) {\r\n return $http.delete(\"/api/patient/\" + patientId + \"/admitdischarge/\" + admitId).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function GetPatientClinicalHistory(patientId) {\r\n return $http.get(\"/api/patient/\" + patientId + \"/clinicalhistory\").then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n function EditPatientClinicalHistory(patientId, clincialHistory) {\r\n return $http.put(\"/api/patient/\" + patientId + \"/clinicalhistory\", clincialHistory).then(function(data) {\r\n return data.data;\r\n });\r\n }\r\n\r\n\r\n return {\r\n getPatientComorbidities: GetPatientComorbidities,\r\n getComorbidities: GetComorbidities,\r\n addComorbidity: AddComorbidity,\r\n removeComorbidity: RemoveComorbidity,\r\n editPatientComorbidities: EditPatientComorbidities,\r\n getPatientAdmitDischarge: GetPatientAdmitDischarge,\r\n addAdmitDischargeInfo: AddAdmitDischargeInfo,\r\n editAdmitDischargeInfo: EditAdmitDischargeInfo,\r\n deleteAdmitDischargeInfo: DeleteAdmitDischargeInfo,\r\n getPatientClinicalHistory: GetPatientClinicalHistory,\r\n editPatientClinicalHistory: EditPatientClinicalHistory\r\n };\r\n\r\n}\r\n\r\n\r\n\r\nangular.module('patient.clinicalhistory').service('ClinicalHistoryService', ClinicalHistoryService);\r\n","function ComorbiditiesDirective() {\r\n\r\n function controller($scope, $uibModal, ClinicalHistoryService, $stateParams, vhSweetAlert, lodash) {\r\n $scope.comorbidities = {};\r\n\r\n $scope.comorbidities.patientComorbidities = [];\r\n $scope.comorbidities.availableComorbidities = [];\r\n $scope.comorbidities.selectedComorbidities = [];\r\n var allComorbidities = [];\r\n\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n ClinicalHistoryService.getPatientComorbidities($stateParams.patientId).then(function(data) {\r\n $scope.comorbidities.patientComorbidities = data;\r\n sortpatientComorbidities();\r\n\r\n ClinicalHistoryService.getComorbidities().then(function(data) {\r\n allComorbidities = data;\r\n filterAvailableComorbidities();\r\n });\r\n });\r\n }\r\n\r\n function filterAvailableComorbidities() {\r\n var result = [];\r\n angular.forEach(allComorbidities, function(d) {\r\n if (lodash.findIndex($scope.comorbidities.patientComorbidities, function(o) { return o.ComorbidityId == d.ComorbidityId; }) == -1 ) {\r\n result.push(d);\r\n }\r\n });\r\n $scope.comorbidities.availableComorbidities = result;\r\n }\r\n\r\n function sortpatientComorbidities() {\r\n $scope.comorbidities.patientComorbidities = lodash.sortBy($scope.comorbidities.patientComorbidities, function(i) { return i.ComorbidityName.toLowerCase(); });\r\n }\r\n\r\n $scope.addNew = function() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/PMHx/addcomorbidity.modal.html',\r\n controller: 'AddComorbidityModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n comorbidities: function () {\r\n return $scope.comorbidities.patientComorbidities;\r\n }\r\n }\r\n\r\n });\r\n modalInstance.result.then(function (comorbidityName) {\r\n var newComorbidity = {};\r\n newComorbidity.PatientId = $stateParams.patientId;\r\n newComorbidity.ComorbidityName = comorbidityName;\r\n ClinicalHistoryService.addComorbidity($stateParams.patientId, [newComorbidity]).then(function(data) {\r\n $scope.comorbidities.patientComorbidities = $scope.comorbidities.patientComorbidities.concat(data);\r\n sortpatientComorbidities();\r\n });\r\n }, function () {\r\n });\r\n };\r\n\r\n $scope.deleteComorbidity = function(comorbidity) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete the comorbidity ' + comorbidity.ComorbidityName + '?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n ClinicalHistoryService.removeComorbidity($stateParams.patientId, comorbidity.ComorbidityId).then(function(data) {\r\n lodash.remove($scope.comorbidities.patientComorbidities, { ComorbidityId: comorbidity.ComorbidityId });\r\n filterAvailableComorbidities();\r\n });\r\n }\r\n });\r\n };\r\n\r\n $scope.addComorbidities = function() {\r\n newPatientComorbidities = [];\r\n angular.forEach($scope.comorbidities.selectedComorbidities, function(c) {\r\n var newComorbidity = {};\r\n newComorbidity.PatientId = $stateParams.patientId;\r\n newComorbidity.ComorbidityName = c.Name;\r\n newComorbidity.ComorbidityId = c.ComorbidityId;\r\n newPatientComorbidities.push(newComorbidity);\r\n });\r\n\r\n ClinicalHistoryService.addComorbidity($stateParams.patientId, newPatientComorbidities).then(function(data) {\r\n $scope.comorbidities.patientComorbidities = $scope.comorbidities.patientComorbidities.concat(data);\r\n filterAvailableComorbidities();\r\n $scope.comorbidities.selectedComorbidities = [];\r\n sortpatientComorbidities();\r\n $scope.comorbiditiesForm.$setPristine(true);\r\n });\r\n };\r\n }\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n templateUrl: \"modules/patient/PMHx/comorbidities.tpl.html\",\r\n controller: controller\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.clinicalhistory\").directive(\"comorbidities\", ComorbiditiesDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/PMHx/comorbidities.tpl.html',\n '
          Comorbidities
          {{$item.Name}}{{comorbidity.Name}}
          ');\n}]);\n}(window, document, window.angular));","function EditAdmitDischargeModalController($uibModalInstance, admitDischargeDetail, vhSweetAlert, $scope, patientId) {\r\n var vm = this;\r\n vm.editedContent = [];\r\n vm.addEmptyEntry = addEmptyEntry;\r\n vm.checkState = checkState;\r\n vm.markDeleted = markDeleted;\r\n vm.isEntryValid = isEntryValid;\r\n\r\n\r\n vm.dateOptions = { maxDate: new Date() };\r\n vm.today = new Date();\r\n\r\n vm.comorbidityName = '';\r\n vm.editedDetail = {};\r\n vm.editedDetail.Comment = admitDischargeDetail.Comment;\r\n\r\n vm.editedDetail.AdmitDtUTC = null;\r\n vm.editedDetail.DischargeDtUTC = null;\r\n\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n angular.copy(admitDischargeDetail, vm.editedContent);\r\n\r\n angular.forEach(vm.editedContent, function(d) {\r\n if (d.AdmitDtUTC !== null) {\r\n d.AdmitDtUTC = new Date(Date.parse(d.AdmitDtUTC));\r\n }\r\n if (d.DischargeDtUTC !== null) {\r\n d.DischargeDtUTC =new Date(Date.parse(d.DischargeDtUTC));\r\n }\r\n });\r\n checkState();\r\n\r\n }\r\n\r\n function addEmptyEntry() {\r\n vm.editedContent.push({ AdmitDtUTC: null, DischargeDtUTC: null, Comment: null, IsDeleted: false, PatientId: patientId });\r\n }\r\n\r\n function checkState() {\r\n var lastEntry = vm.editedContent[vm.editedContent.length-1];\r\n if (lastEntry === undefined || lastEntry.AdmitDtUTC !== null || lastEntry.DischargeDtUTC !== null || lastEntry.Comment !== null) {\r\n addEmptyEntry();\r\n }\r\n }\r\n\r\n function markDeleted(entry) {\r\n entry.IsDeleted = true;\r\n }\r\n\r\n function isEntryValid(entry, isLastEntry) {\r\n /*\r\n if the date value is undefined and null, it's empty (valid)\r\n if the date value is undefined and not null, it's an invalid date\r\n */\r\n var invalidAdmit = !entry.AdmitDtUTC && entry.AdmitDtUTC !== null;\r\n var invalidDischarge = !entry.DischargeDtUTC && entry.DischargeDtUTC !== null;\r\n var emptyAdmit = !entry.AdmitDtUTC && entry.AdmitDtUTC === null;\r\n var emptyDischarge = !entry.DischargeDtUTC && entry.DischargeDtUTC === null;\r\n\r\n if(invalidAdmit || invalidDischarge) {\r\n console.log(\"invalid Admit or Discharge\");\r\n return false;\r\n } else if (!isLastEntry && emptyAdmit && emptyDischarge && entry.IsDeleted === false) {\r\n console.log(\"empty admit or discharge when not deleting\")\r\n return false;\r\n } else if (entry.AdmitDtUTC !== null && entry.DischargeDtUTC !== null && entry.DischargeDtUTC < entry.AdmitDtUTC) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n function isValid() {\r\n for (var i = 0; i <= vm.editedContent.length - 1; i++) {\r\n if (!isEntryValid(vm.editedContent[i], i == vm.editedContent.length - 1)) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n function ok() {\r\n $scope.adForm.$setSubmitted();\r\n if (isValid())\r\n {\r\n vm.editedContent.pop();\r\n $uibModalInstance.close(vm.editedContent);\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('patient.clinicalhistory').controller('EditAdmitDischargeModalController', EditAdmitDischargeModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/PMHx/editAdmitDischarge.modal.html',\n '

          Patient Admit / Discharge Detail

          Admit Date
          Discharge Date
          Comments
          detail.DischargeDtUTC)) }\">
          detail.DischargeDtUTC)\">Admit date must be before discharge date
          Admit date or discharge date must be populated and in correct format (mm/dd/yyyy)
          ');\n}]);\n}(window, document, window.angular));","function EditComorbidityModalController($scope, $uibModalInstance, patientComorbidities, lodash, vhSweetAlert, ClinicalHistoryService, patientId) {\r\n var vm = this;\r\n\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.comorbidities = {};\r\n vm.validateAddedComorbidities = validateAddedComorbidities;\r\n vm.removeComorbidity = removeComorbidity;\r\n vm.comorbidities.patientComorbidities = angular.copy(patientComorbidities);\r\n vm.comorbidities.availableComorbidities = [];\r\n vm.comorbidities.addedComorbidities = [];\r\n vm.removeIfEmpty = removeIfEmpty;\r\n vm.setFocus = setFocus;\r\n var allComorbidities = [];\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n ClinicalHistoryService.getComorbidities().then(function(data) {\r\n allComorbidities = data;\r\n filterAvailableComorbidities();\r\n });\r\n\r\n validateAddedComorbidities();\r\n }\r\n\r\n function setFocus(event) {\r\n event.preventDefault();\r\n $scope.$broadcast('addcomorbidity.focus');\r\n }\r\n\r\n function filterAvailableComorbidities() {\r\n var result = [];\r\n angular.forEach(allComorbidities, function(d) {\r\n if (lodash.findIndex(vm.comorbidities.patientComorbidities, function(o) {\r\n return o.ComorbidityId == d.ComorbidityId;\r\n }) == -1 && d.IsEnabled) {\r\n d.ComorbidityName = d.Name;\r\n d.PatientId = patientId;\r\n result.push(d);\r\n }\r\n });\r\n vm.comorbidities.availableComorbidities = result;\r\n }\r\n\r\n function validateAddedComorbidities() {\r\n if (vm.comorbidities.addedComorbidities.length === 0 || vm.comorbidities.addedComorbidities[vm.comorbidities.addedComorbidities.length -1].ComorbidityName.length != 0) {\r\n vm.comorbidities.addedComorbidities.push({ ComorbidityName: \"\" });\r\n }\r\n }\r\n\r\n function removeComorbidity(index) {\r\n if (index != vm.comorbidities.addedComorbidities.length -1) {\r\n vm.comorbidities.addedComorbidities.splice(index, 1);\r\n }\r\n }\r\n\r\n function removeIfEmpty(index) {\r\n if (index != vm.comorbidities.addedComorbidities.length -1 & vm.comorbidities.addedComorbidities[index].ComorbidityName.length === 0) {\r\n removeComorbidity(index);\r\n }\r\n }\r\n\r\n function ok() {\r\n\r\n angular.forEach(patientComorbidities, function(c) {\r\n if (lodash.findIndex(vm.comorbidities.patientComorbidities, function(o) { return o.PatientId > 0 && o.ComorbidityId === c.ComorbidityId }) === -1) {\r\n c.IsDeleted = true;\r\n vm.comorbidities.patientComorbidities.push(c);\r\n }\r\n });\r\n\r\n angular.forEach(vm.comorbidities.addedComorbidities, function(c) {\r\n if (c.ComorbidityName.length > 0) {\r\n c.PatientId = patientId;\r\n c.IsDeleted = false;\r\n vm.comorbidities.patientComorbidities.push(c);\r\n }\r\n });\r\n\r\n $uibModalInstance.close(vm.comorbidities.patientComorbidities);\r\n\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('patient.clinicalhistory').controller('EditComorbidityModalController', EditComorbidityModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/PMHx/editcomorbidity.modal.html',\n '

          Patient Comorbidities

          Add pre-selected comorbidities

          {{$item.ComorbidityName}}{{comorbidity.ComorbidityName}}

          Add custom comorbidities

          0 }\"> 0\">
          ');\n}]);\n}(window, document, window.angular));","function HistoryDirective() {\r\n\r\n function controller($scope, vhSweetAlert, ClinicalHistoryService,$stateParams, PermissionService, textAngularManager, $timeout) {\r\n $scope.tools = [];\r\n $scope.data = {};\r\n $scope.data.clinicalHistory = {};\r\n $scope.userHasWritePermissions = PermissionService.userHasPermission(['PatientClinicalHistoryWrite']);\r\n $scope.isEditMode = false;\r\n $scope.editClinicalHistory = editClinicalHistory;\r\n $scope.saveClinicalHistory = saveClinicalHistory;\r\n $scope.cancel = cancel;\r\n\r\n var originalHistory = '';\r\n\r\n loadController();\r\n\r\n\r\n function loadController() {\r\n var textSizeTools = []; // ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];\r\n var textStyleTools = ['bold', 'italics', 'underline'];\r\n var listTools = ['ul', 'ol'];\r\n var textAlignTools = ['justifyLeft', 'justifyCenter', 'justifyRight'];\r\n var otherTools = ['fontColor'];\r\n\r\n $scope.tools = [textSizeTools, textStyleTools, listTools, textAlignTools, otherTools];\r\n\r\n ClinicalHistoryService.getPatientClinicalHistory($stateParams.patientId).then(function(data) {\r\n $scope.data.clinicalHistory = data;\r\n originalHistory = $scope.data.clinicalHistory.History_Text;\r\n });\r\n\r\n }\r\n\r\n function editClinicalHistory() {\r\n $scope.isEditMode = true;\r\n\r\n $timeout(function(){\r\n var editorScope = textAngularManager.retrieveEditor('clinicalHistory').scope;\r\n editorScope.displayElements.text[0].focus();\r\n });\r\n }\r\n\r\n function saveClinicalHistory() {\r\n $scope.data.clinicalHistory.PatientId = $stateParams.patientId;\r\n return ClinicalHistoryService.editPatientClinicalHistory($stateParams.patientId, $scope.data.clinicalHistory).then(function(data) {\r\n $scope.historyForm.$setPristine(true);\r\n $scope.isEditMode = false;\r\n originalHistory = $scope.data.clinicalHistory.History_Text;\r\n });\r\n }\r\n\r\n function cancel() {\r\n $scope.isEditMode = false;\r\n $scope.historyForm.$setPristine(true);\r\n $scope.data.clinicalHistory.History_Text = originalHistory;\r\n }\r\n }\r\n\r\n return {\r\n restrict: \"E\",\r\n replace: true,\r\n templateUrl: \"modules/patient/PMHx/history.tpl.html\",\r\n controller: controller\r\n };\r\n}\r\n\r\n\r\nangular.module(\"patient.clinicalhistory\").directive(\"history\", HistoryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/PMHx/history.tpl.html',\n '

          Clinical History

          No Clinical History
           
          ');\n}]);\n}(window, document, window.angular));","function ClinicalHistoryController($stateParams, ClinicalHistoryService, comorbiditiesData, admitDischargeData, $uibModal) {\r\n var vm = this;\r\n vm.patientId = $stateParams.patientId;\r\n vm.patientComorbidities = comorbiditiesData;\r\n vm.patientAdmitDischarge = admitDischargeData;\r\n vm.editAdmitDischarge = editAdmitDischarge;\r\n vm.editComorbidities = editComorbidities;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n }\r\n\r\n function editAdmitDischarge() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/PMHx/editAdmitDischarge.modal.html',\r\n controller: 'EditAdmitDischargeModalController as vm',\r\n backdrop: 'static',\r\n windowClass: 'tempSize',\r\n size: 'lg',\r\n resolve: {\r\n admitDischargeDetail: function () {\r\n return vm.patientAdmitDischarge;\r\n },\r\n patientId: function() {\r\n return vm.patientId;\r\n }\r\n }\r\n\r\n });\r\n modalInstance.result.then(function(editedAdmitDischargeData) {\r\n ClinicalHistoryService.editAdmitDischargeInfo(vm.patientId, editedAdmitDischargeData).then(function(data) {\r\n vm.patientAdmitDischarge = data;\r\n });\r\n });\r\n }\r\n\r\n function editComorbidities() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/patient/PMHx/editcomorbidity.modal.html',\r\n controller: 'EditComorbidityModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n patientComorbidities: function () {\r\n return vm.patientComorbidities;\r\n },\r\n patientId: function() {\r\n return vm.patientId;\r\n }\r\n }\r\n\r\n });\r\n modalInstance.result.then(function(patientComorbidities) {\r\n ClinicalHistoryService.editPatientComorbidities(vm.patientId, patientComorbidities).then(function(data) {\r\n vm.patientComorbidities = data;\r\n });\r\n });\r\n }\r\n\r\n\r\n\r\n}\r\n\r\nangular.module('patient.clinicalhistory').controller('ClinicalHistoryController',ClinicalHistoryController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/patient/PMHx/PMHx.tpl.html',\n '
          PMHx

          Comorbidities

          No Comorbidities
          {{comorbidity.ComorbidityName}}

          Patient Admit / Discharge Details

          No Patient Admit/Discharge Details
          0\">
          AdmitDischargeComment
          {{admitDischargeData.AdmitDtUTC | datetime}}{{admitDischargeData.DischargeDtUTC | datetime}}{{admitDischargeData.Comment}}
          ');\n}]);\n}(window, document, window.angular));","function VhRequiredPermission(PermissionService) {\r\n return {\r\n restrict: \"A\",\r\n link: function(scope, elem, attrs) {\r\n var onAuthFailed = 'hide';\r\n if (attrs.onAuthFailed) {\r\n onAuthFailed = attrs.onAuthFailed;\r\n }\r\n if (!PermissionService.userHasPermission(attrs.permission)) {\r\n if (onAuthFailed === 'hide') {\r\n elem.css(\"display\", \"none\");\r\n } else {\r\n elem.addClass(\"disabled\");\r\n }\r\n }\r\n }\r\n\r\n };\r\n}\r\nangular.module(\"permissions\").directive(\"vhRequiredPermission\", VhRequiredPermission);\r\n","function UiSrefAuth($state, PermissionService) {\r\n // directive to hide or remove if user does not have permission to go to route\r\n return {\r\n restrict: \"A\",\r\n link: function (scope, elem, attrs) {\r\n var removeElem = attrs.uiSrefAuth === \"remove\";\r\n var paramsIndex = attrs.uiSref.indexOf(\"(\");\r\n var stateName = attrs.uiSref;\r\n if (paramsIndex > -1) {\r\n stateName = stateName.substr(0, paramsIndex);\r\n }\r\n\r\n var state = $state.get(stateName);\r\n if (state.data !== null && state.data !== undefined && state.data.requiredPermissions !== undefined) {\r\n if (!PermissionService.userHasPermission(state.data.requiredPermissions)) {\r\n var elemToKill = elem;\r\n var parent = elem.parent();\r\n var count = 0;\r\n while(parent && count <= 5) {\r\n if (parent.attr(\"ui-sref-auth-elem\") !== undefined) {\r\n elemToKill = parent;\r\n parent = null;\r\n } else {\r\n parent = parent.parent();\r\n }\r\n count++;\r\n }\r\n if (removeElem) {\r\n elemToKill.remove();\r\n } else {\r\n elemToKill.css(\"display\", \"none\");\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\nangular.module(\"permissions\").directive(\"uiSrefAuth\", UiSrefAuth);\r\n","function PermissionService($http, $window, lodash, LocalStorageService) {\r\n var permissionMap = {\r\n ConfigurationsRead: 1000,\r\n ConfigurationsWrite: 1001,\r\n MasterCareplansRead: 1002,\r\n MasterCareplansWrite: 1003,\r\n KitsRead: 1004,\r\n KitsWrite: 1005,\r\n SecurityReservedActivityRead: 1006,\r\n KitLocationRead: 1009,\r\n KitLocationWrite: 1010,\r\n ToggleOverDueAlerts: 1011,\r\n KitsDelete: 1018,\r\n ConfigurationSkipBiometricRead: 1020,\r\n ConfigurationSkipBiometricWrite: 1021,\r\n MoveKits: 1012,\r\n ProvisionKits: 1013,\r\n SmsWrite: 1015,\r\n AdvancedConfigurationsWrite: 1019,\r\n ConfigurationPatientStatusRead: 1016,\r\n ConfigurationPatientStatusWrite: 1017,\r\n KitStatusWrite: 1025,\r\n WebhookRead: 1026,\r\n WebhookWrite: 1027,\r\n ConfigurationProviderGroupRead: 1028,\r\n ConfigurationProviderGroupWrite: 1029,\r\n SurveyTemplateExport: 1030,\r\n SurveyTemplateImport: 1031,\r\n SecurityRoleRead: 1032,\r\n SecurityRoleWrite: 1033,\r\n SecurityAccessLevelBasicRead: 1034,\r\n SecurityAccessLevelBasicWrite: 1035,\r\n SecurityAccessLevelModerateRead: 1036,\r\n SecurityAccessLevelModerateWrite: 1037,\r\n SecurityAccessLevelAdvancedRead: 1038,\r\n SecurityAccessLevelAdvancedWrite: 1039,\r\n ConfigurationInterventionsRead: 1040,\r\n ConfigurationInterventionsWrite: 1041,\r\n ChartContentRead: 1042,\r\n ChartContentWrite: 1043,\r\n WelcomeVideoConfigRead: 1044,\r\n WelcomeVideoConfigWrite: 1045,\r\n InstallMethodConfigRead: 1046,\r\n InstallMethodConfigWrite: 1047,\r\n EducationalMaterialWrite: 1048,\r\n EducationalMaterialRead: 1049,\r\n EmailServersReadAndWrite: 1050,\r\n SpecialHandlingReadAndWrite: 1051,\r\n SystemServiceLevelRead: 1052,\r\n SystemServiceLevelWrite: 1053,\r\n SystemFormsRead: 1054,\r\n SystemFormsWrite: 1055,\r\n KitPickupOptionRead: 1056,\r\n KitPickupOptionWrite: 1057,\r\n RuleWrite: 1059,\r\n PathwayConditionWrite: 1060,\r\n PathwayTagWrite: 1061,\r\n ProviderRoleRead: 1062,\r\n ProviderRoleWrite: 1063,\r\n ProviderFreetextWrite: 1064,\r\n ConfigurationsTransformsRead: 1065,\r\n ConfigurationsTransformsWrite: 1066,\r\n ConfigurationPopulationRead: 1067,\r\n ConfigurationPopulationWrite: 1068,\r\n HospitalSettingsRead: 1069,\r\n HospitalSettingsWrite: 1070,\r\n ConfigurationMilestoneRead: 1073,\r\n ConfigurationMilestoneWrite: 1074,\r\n LanguageSettingsRead: 1075,\r\n LanguageSettingsWrite: 1076,\r\n MessageInterventionsRead: 1077,\r\n MessageInterventionsWrite: 1078,\r\n SpecialHandlingTagWrite: 1081,\r\n ComorbidityTagWrite: 1082,\r\n ConfigurationComorbidityRead: 1083,\r\n ConfigurationComorbidityWrite: 1084,\r\n NetworkOperatorRead: 1071,\r\n NetworkOperatorWrite: 1072,\r\n GoDevicesRead: 1085,\r\n GoDevicesWrite: 1086,\r\n GoDevicesPopulationsWrite: 1087,\r\n AlertTypeRead: 1088,\r\n AlertTypeWrite: 1089,\r\n CoachCardRead: 1090,\r\n CoachCardWrite: 1091,\r\n PatientHeaderConfigurationWrite: 1092,\r\n LoginNotificationRead: 1093,\r\n LoginNotificationWrite: 1094,\r\n PayersRead: 1095,\r\n PayersWrite: 1096,\r\n ReferralsRead: 1097,\r\n ReferralsWrite: 1098,\r\n ProviderGroupsRead: 1099,\r\n ProviderGroupsWrite: 1100,\r\n PopulationGroupsRead: 1101,\r\n PopulationGroupsWrite: 1102,\r\n ContentUIDRead: 1103,\r\n CurrentProceduralTerminologyCodeRead: 1105,\r\n CurrentProceduralTerminologyCodeWrite: 1106,\r\n ProgramDurationsRead: 1107,\r\n ProgramDurationsWrite: 1108,\r\n ResourceLibraryImport: 1109,\r\n ResourceLibraryExport: 1110,\r\n RulesImport: 1111,\r\n RulesExport: 1112,\r\n ProgramExport: 1113,\r\n ProgramImport: 1114,\r\n ConfigurationPathwayAlertChangeReasonRead: 1122,\r\n ConfigurationPathwayAlertChangeReasonWrite: 1123,\r\n CanAssignDisabledContent: 1124,\r\n CanAssignFromAllSites: 1125,\r\n SecurityRoleExport: 1126,\r\n CanDisableRule: 1127,\r\n CanLockQuestions: 1118,\r\n CanEditLockedQuestions: 1119,\r\n CanLockPathways: 1120,\r\n CanEditLockedPathways: 1121,\r\n CaregiversRead: 2000,\r\n CaregiversWrite: 2001,\r\n KitShippingEdit: 2004,\r\n NetworkAndTabletWrite: 2005,\r\n KitDetailsWrite: 2006,\r\n KitReturnLocationWrite: 2007,\r\n EditKitStatus: 2008,\r\n EditKitLocation: 2009,\r\n PatientDemographicsRead: 3000,\r\n PatientClinicalDataRead: 3001,\r\n PatientDemographicsWrite: 3002,\r\n PatientMedicationsWrite: 3003,\r\n PatientAlertsWrite: 3004,\r\n PatientChartNotesWrite: 3005,\r\n DirectEntryWrite: 3011,\r\n HospitalsReadAll: 3018,\r\n PatientCareplanRead: 3022,\r\n PatientCareplanScheduleWrite: 3023,\r\n PatientCareplanWrite: 3006,\r\n PatientAssignWrite: 3007,\r\n PatientTimeLogAuditWrite: 3031,\r\n HealthTipsWriteAdvanced: 3032,\r\n ProgramStartDateWrite: 3020,\r\n ModifyResponse: 3021,\r\n VideosRead: 3024,\r\n VideosWrite: 3025,\r\n HealthTipsRead: 3026,\r\n HealthTipsWrite: 3027,\r\n MasterCareplanCategoryDelete: 3028,\r\n MasterCareplanQuestionDelete: 3029,\r\n PatientResponseApiRead: 3030,\r\n KitLogisticsRead: 3034,\r\n KitLogisticsWrite: 3035,\r\n InviteListRead: 3036,\r\n InviteListWrite: 3037,\r\n VideoListRead: 3038,\r\n ReceiveKitsRead: 3039,\r\n ReceiveKitsWrite: 3040,\r\n PatientListRead: 3041,\r\n PatientMonitoringRead: 3042,\r\n PatientTimeLogRead: 3043,\r\n BulkPatientCareplanWrite: 3045,\r\n PatientParametersRead: 3048,\r\n PatientParametersWrite: 3049,\r\n PatientFormRead: 3046,\r\n PatientFormWrite: 3047,\r\n PatientMedicationsRead: 3050,\r\n PatientClinicalHistoryRead: 3051,\r\n PatientClinicalHistoryWrite: 3052,\r\n PatientChartNotesRead: 3053,\r\n PatientMaskedIdentifierWrite: 3055,\r\n PatientDataTransfer: 3056,\r\n PatientCardsRead: 3058,\r\n UnassignKitOptions: 3059,\r\n KitPickupRemoveKit: 3060,\r\n PatientBackdateStatus: 3061,\r\n SurveyTemplateMassEdit: 3062,\r\n PatientSurveyMassEdit: 3063,\r\n PatientMilestoneRead: 3079,\r\n PatientMilestoneWrite: 3080,\r\n SiteRead: 3066,\r\n SiteWrite: 3067,\r\n SitesReadAll: 3068,\r\n ProfileFieldsRead: 3069,\r\n ProfileFieldsWrite: 3070,\r\n PatientRuleLogRead: 3071,\r\n PatientTagWrite: 3072,\r\n PatientTagHxRead: 3073,\r\n PatientMessageWrite: 3078,\r\n PatientPathwayStatusWrite: 3081,\r\n PatientAuditExport: 3082,\r\n PatientCall: 3083,\r\n PatientNotificationsWrite: 3085,\r\n PatientActivityRead: 3086,\r\n AllHospitalAccess: 3087,\r\n CreateNewPatient: 3088,\r\n SurveyQuestionsRead: 3089,\r\n SurveyQuestionsWrite: 3090,\r\n PatientCPTCodeBillingRead: 3091,\r\n PatientCPTCodeBillingWrite: 3092,\r\n ContentPathwayScheduleEdit: 3095,\r\n PatientPathwayScheduleEdit: 3096,\r\n PathwayAlertChangeReasonRead: 3097,\r\n PathwayAlertChangeReasonWrite: 3098,\r\n PatientHospitalUpdate: 3099,\r\n PatientsReadAll: 3017,\r\n DocumentGenerator: 5004,\r\n ReportsRead: 3012,\r\n DashboardRead: 3013,\r\n PatientIdentifierConfigurationRead: 3093,\r\n PatientIdentifierConfigurationWrite: 3094,\r\n ProgramStatusReport: 4000,\r\n KitUtilizationReport: 4001,\r\n ProgramComplianceReport: 4002,\r\n KitHistoryReport: 4003,\r\n KitStatusReport: 4005,\r\n AlertAnalysisReport: 4006,\r\n PatientStatusReport: 4007,\r\n PatientDataDumpReport: 4008,\r\n BYODStatusReport: 4009,\r\n SkipBiometricReport: 4010,\r\n HealthSummaryReport: 4011,\r\n PatientTimeLogReport: 4012,\r\n PatientSatisfactionReport: 4013,\r\n UsageMonitoringReport: 4014,\r\n ReportDesigner: 4200,\r\n MediaRead:6000,\r\n MediaWrite: 6001,\r\n KitShippingMarkKitAsLost: 1058,\r\n ConfigurationDeleteReasonRead: 1023,\r\n ConfigurationDeleteReasonWrite: 1024,\r\n BiometricThresholdsChangeReasonsRead: 1115,\r\n BiometricThresholdsChangeReasonsWrite: 1116,\r\n ResourceLibraryRead: 1079,\r\n ResourceLibraryWrite: 1080,\r\n CaregiverMassUpload: 2010,\r\n };\r\n\r\n var usersPermissions = null;\r\n\r\n return {\r\n hasLoadedPermissions: false,\r\n userHasPermission: function(permissionsToCheck) {\r\n // permissionsToCheck can be a string name of a single permission, or it can be an array of string names or int codes\r\n if (angular.isString(permissionsToCheck)) {\r\n permissionsToCheck = [permissionsToCheck]; // convert the single string into an array\r\n }\r\n\r\n var userPermissions = this.getPermissions();\r\n\r\n for (var i = 0; i < permissionsToCheck.length; i++) {\r\n permissionToCheck = permissionsToCheck[i];\r\n // If permissionToCheck is a string, e.g. \"MasterCareplansRead\" instead of an int, e.g. 1002, then look up the int.\r\n if (typeof permissionToCheck == \"string\" || permissionToCheck instanceof String) {\r\n if (lodash.has(permissionMap, permissionToCheck)) {\r\n // look up the int\r\n permissionToCheck = permissionMap[permissionToCheck];\r\n } else {\r\n // Permission denied since we don't know what it is\r\n console.log(\"Unrecognized permission: \" + permissionToCheck);\r\n return false;\r\n }\r\n }\r\n //Check if permission is an int\r\n if (!(typeof permissionToCheck === 'number' && (permissionToCheck % 1) === 0)) {\r\n // Permission denied since we don't know what it is\r\n console.log(\"Permission was not a string or an int: \" + permissionToCheck);\r\n return false;\r\n }\r\n\r\n // Check if the user has this permission\r\n if (lodash.contains(userPermissions, permissionToCheck)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n\r\n getPermissions: function() {\r\n if (usersPermissions !== null) {\r\n return usersPermissions;\r\n }\r\n return LocalStorageService.get('vh-permissions');\r\n },\r\n\r\n loadUserPermissions: function() {\r\n var self = this;\r\n return $http.get('/api/UserPermission').then(function(response) {\r\n self.hasLoadedPermissions = true;\r\n usersPermissions = response.data.SecurityActivities;\r\n LocalStorageService.remove('vh-permissions');\r\n LocalStorageService.store('vh-permissions', response.data.SecurityActivities);\r\n });\r\n },\r\n clearUserPermissions: function() {\r\n this.hasLoadedPermissions = false;\r\n usersPermissions = null;\r\n if ($window.localStorage) {\r\n $window.localStorage.removeItem('vh-permissions');\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module('permissions').factory('PermissionService', PermissionService);","function AllReports(reportData, $state, lodash, moment, ReportsService, $window, PermissionService, $uibModal, $scope, BIService, $rootScope, AuthorizationService, vhSweetAlert, $timeout) {\r\n var rvm = this;\r\n var hasModerateWrite = PermissionService.userHasPermission([\"SecurityAccessLevelModerateWrite\"]);\r\n var hasAdvancedWrite = PermissionService.userHasPermission([\"SecurityAccessLevelAdvancedWrite\"]);\r\n var userId = AuthorizationService.getCaregiver().Id;\r\n rvm.searchText = \"\";\r\n rvm.searchTextBox = \"\";\r\n rvm.activeSearch = false;\r\n rvm.noSearchResults = false;\r\n rvm.performSearch = performSearch;\r\n rvm.clearSearch = clearSearch;\r\n\r\n rvm.reportData = reportData;\r\n rvm.selectedReport = null;\r\n rvm.selectReport = selectReport;\r\n\r\n rvm.unPublishReport = unPublishReport;\r\n rvm.publishReport = publishReport;\r\n rvm.flashUnpublished = flashUnpublished;\r\n\r\n rvm.CreateBtnClicked = CreateBtnClicked;\r\n rvm.BIService = BIService;\r\n rvm.ReportDesignerChanged = ReportDesignerChanged;\r\n rvm.folderId = $state.params.folderId;\r\n rvm.isSelfService = $state.params.isSelfService;\r\n rvm.isReportDesigner = false;\r\n rvm.DisplayEditBtn = false;\r\n rvm.DisplayExportBtn = false;\r\n rvm.DisplayCopyBtn = false;\r\n rvm.DisplayDeleteBtn = false;\r\n rvm.DisplayRunBtn = false;\r\n rvm.RunBtnClicked = RunBtnClicked;\r\n rvm.EditBtnClicked = EditBtnClicked;\r\n rvm.DeleteBtnClicked = DeleteBtnClicked;\r\n rvm.ExportBtnClicked = ExportBtnClicked;\r\n rvm.CopyBtnClicked = CopyBtnClicked;\r\n rvm.ImportBtnClicked = ImportBtnClicked;\r\n rvm.PermissionService = PermissionService;\r\n rvm.ExagoSessionLoaded = false;\r\n\r\n SetUserReportCounts();\r\n init();\r\n\r\n $rootScope.$on(\"OnExagoSessionLoaded\", function () {\r\n rvm.ExagoSessionLoaded = true;\r\n });\r\n\r\n $rootScope.$on(\"updateSelfServiceReportsChange\", function () {\r\n if (rvm.isSelfService) {\r\n rvm.BIService.getSelfServiceReports(rvm.folderId).then(function (data) {\r\n angular.forEach(data, function (report) {\r\n if (rvm.reportData.filter(e => e.ReportId === report.ReportId).length == 0) {\r\n rvm.reportData.push(report);\r\n } else {\r\n var selReports = rvm.reportData.filter(e => e.ReportId === report.ReportId);\r\n if (selReports.length > 0) {\r\n selReports[0].DisplayName = report.DisplayName;\r\n }\r\n \r\n }\r\n \r\n \r\n });\r\n SetUserReportCounts();\r\n });\r\n }\r\n });\r\n\r\n\r\n function SetUserReportCounts() {\r\n if(reportData != null)\r\n rvm.UserReport = rvm.reportData.filter(report => report.ReportOwnerId === userId)\r\n if (rvm.UserReport != null) {\r\n rvm.UserReportCount = rvm.UserReport.length;\r\n rvm.MaximumReportCount = (rvm.UserReport[0] || { MaximumReportCount: 50 }).MaximumReportCount;\r\n rvm.canAddNewReport = rvm.UserReportCount < rvm.MaximumReportCount;\r\n } \r\n}\r\n\r\nfunction init() {\r\n rvm.isReportDesigner = PermissionService.userHasPermission(\"ReportDesigner\");\r\n}\r\n\r\nfunction RunBtnClicked(reportParameters) {\r\n if (reportParameters) {\r\n reportParameters.$setSubmitted();\r\n if (reportParameters.$valid) {\r\n $scope.$broadcast(\"biExecuteReport\", 'pdf');\r\n }\r\n }\r\n else {\r\n $scope.$broadcast(\"biExecuteReport\");\r\n }\r\n}\r\n\r\n function EditBtnClicked() {\r\n $state.params.report = rvm.selectedReport;\r\n $state.params.isEdit = true;\r\n $state.transitionTo(\"reports.folder.edit\", $state.params, { reload: true, cache: false });\r\n }\r\n\r\n function ExportBtnClicked() {\r\n rvm.BIService.getReportDefinition(rvm.selectedReport.ReportId);\r\n }\r\n\r\n function CopyBtnClicked() {\r\n var modalInstance = rvm.modalInstance = $uibModal.open({\r\n templateUrl: 'modules/bi/copyreport.modal.html',\r\n controller: 'CopyReportModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n modal: function () {\r\n return rvm.modalInstance;\r\n },\r\n modalName: function () {\r\n return 'Copy Report';\r\n },\r\n originalReportId: function () {\r\n return rvm.selectedReport.ReportId;\r\n }\r\n }\r\n });\r\n\r\n \r\n\r\n modalInstance.result.then(function (data) {\r\n\r\n }\r\n );\r\n }\r\n\r\n\r\n\r\n\r\n function ImportBtnClicked() {\r\n var modalInstance = rvm.modalInstance = $uibModal.open({\r\n templateUrl: 'modules/bi/importreport.modal.html',\r\n controller: 'ImportReportModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n modal: function () {\r\n return rvm.modalInstance;\r\n },\r\n currentList: function () {\r\n return rvm.images;\r\n },\r\n fileUploader: function () {\r\n return rvm.BIService.getFileUploader();\r\n },\r\n modalName: function () {\r\n return 'Import Report';\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (data) {\r\n\r\n }\r\n );\r\n }\r\n\r\n\r\n\r\n\r\n function CreateBtnClicked() {\r\n $state.params.isEdit = false;\r\n $state.transitionTo(\"reports.folder.edit\", $state.params, { reload: true, cache: false });\r\n }\r\n\r\n function DeleteBtnClicked() {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete the \"' + rvm.selectedReport.DisplayName + '\" report?', 'Delete')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n $scope.$broadcast(\"biDeleteReport\");\r\n }\r\n }\r\n );\r\n }\r\n\r\n function performSearch() {\r\n rvm.activeSearch = true;\r\n rvm.searchText = rvm.searchTextBox;\r\n }\r\n\r\nfunction clearSearch() {\r\n rvm.searchText = \"\";\r\n rvm.searchTextBox = \"\";\r\n rvm.activeSearch = false;\r\n}\r\n\r\n function isReportOwner(report) {\r\n return userId == report.ReportOwnerId;\r\n }\r\n\r\n $scope.DisplayPublishToggle = function(report) {\r\n return isReportOwner(report) || hasAdvancedWrite || hasModerateWrite;\r\n }\r\n\r\n function selectReport(report) {\r\n\r\n BIService.getReport(report.ReportId).then(function (data) {\r\n rvm.selectedReport = data;\r\n rvm.DisplayRunBtn = true;\r\n rvm.DisplayDeleteBtn = isReportOwner(report) || hasAdvancedWrite || hasModerateWrite;\r\n rvm.DisplayEditBtn = isReportOwner(report) || hasAdvancedWrite || hasModerateWrite;\r\n rvm.DisplayExportBtn = isReportOwner(report) || hasAdvancedWrite || hasModerateWrite;\r\n rvm.DisplayCopyBtn = isReportOwner(report) || hasAdvancedWrite || hasModerateWrite;\r\n if (BIService) {\r\n BIService.getExagoApi().then(function (api) {\r\n var exagoContainer = document.querySelector('#ExagoWindow');\r\n api.DisposeContainerContent(exagoContainer);\r\n });\r\n\r\n $timeout(function () {\r\n window.scrolltoTop();\r\n }, 500);\r\n }\r\n });\r\n }\r\n\r\nfunction unPublishReport(report) {\r\n savePublishState(report, false);\r\n}\r\n\r\nfunction publishReport(report) {\r\n savePublishState(report, true);\r\n}\r\n\r\n function savePublishState(report, isPublish) {\r\n report.IsPublished = isPublish;\r\n rvm.BIService.savePublishState(report).then(function () {\r\n $rootScope.$broadcast(\"updateSelfServiceReportsChange\");\r\n });\r\n }\r\n\r\nfunction flashUnpublished(report) {\r\n\r\n }\r\n\r\n\r\n function ReportDesignerChanged(container, reportDesignerStatusEnum, isSelfService, folderId) {\r\n switch (reportDesignerStatusEnum) {\r\n case BIService.reportDesignerStatusEnum.SaveReport:\r\n {\r\n if (rvm.isSelfService) {\r\n rvm.BIService.getSelfServiceReports(folderId).then(function (data) {\r\n angular.forEach(data, function (report) {\r\n if (rvm.reportData.filter(e => e.ReportId === report.ReportId).length == 0) {\r\n rvm.reportData.push(report);\r\n }\r\n });\r\n SetUserReportCounts();\r\n });\r\n }\r\n break;\r\n }\r\n case BIService.reportDesignerStatusEnum.DeleteReport:\r\n {\r\n if (rvm.isSelfService) {\r\n rvm.BIService.getSelfServiceReports(folderId).then(function (data) {\r\n angular.forEach(rvm.reportData, function (report) {\r\n if (data.filter(e => e.ReportId === report.ReportId).length == 0) {\r\n var reportIndex = rvm.reportData.map(function (e) { return e.ReportId; }).indexOf(report.ReportId);\r\n rvm.reportData.splice(reportIndex, 1);\r\n }\r\n });\r\n SetUserReportCounts();\r\n $rootScope.$broadcast(\"updateSelfServiceReportsChange\");\r\n rvm.selectedReport = null;\r\n rvm.DisplayEditBtn = false;\r\n rvm.DisplayDeleteBtn = false;\r\n rvm.DisplayRunBtn = false;\r\n rvm.DisplayExportBtn = false;\r\n rvm.DisplayCopyBtn = false;\r\n });\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n}\r\nangular.module(\"reports\").controller(\"AllReportsController\", AllReports);\r\n","function BiometricChartDirective(lodash, $filter, ConfigurationsService) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/reports/biometriccharts/biometricchart.tpl.html\",\r\n scope: {\r\n chartTitle: \"=\",\r\n chartData: \"=\",//[{date,value,alertLevel}] or [{label:\"sdf\",data:[{date,value,alertLevel}]}]\r\n chartIcon: \"=\",\r\n units: \"=\",\r\n referenceLabel: \"=\"\r\n },\r\n link: function (scope, elem, attrs) {\r\n scope.data = {};\r\n var labelDates = [];\r\n if (scope.chartData.length > 0 && scope.chartData[0].data) {\r\n //multiple dataset\r\n scope.data.datasets = lodash.map(scope.chartData, function (d) {\r\n return mapToData(d.data, d.label);\r\n });\r\n labelDates = lodash.pluck(scope.chartData[0].data, \"date\");\r\n var lastValues = [];\r\n var highestAlert = 3;\r\n angular.forEach(scope.chartData, function (set) {\r\n var lastValue = set.data[set.data.length-1];\r\n lastValues.push(lastValue.value);\r\n if (lastValue.alertLevel < highestAlert) {\r\n highestAlert = lastValue.alertLevel;\r\n }\r\n });\r\n scope.lastValue = lastValues.join(\"/\");\r\n scope.lastValueClass = badgeClassFromAlert(highestAlert);\r\n } else {\r\n labelDates = lodash.pluck(scope.chartData, \"date\");\r\n scope.data.datasets = [\r\n {\r\n label: scope.chartTitle,\r\n data: mapChartDataValue(scope.chartData),\r\n fillColor: 'rgba(230,230,230,0.65)',\r\n referenceLabel: scope.referenceLabel,\r\n pointColor: 'rgb(42, 114, 192)'\r\n }\r\n ];\r\n scope.data.datasets = [mapToData(scope.chartData, scope.chartTitle)];\r\n\r\n var lastValue = scope.chartData[scope.chartData.length-1];\r\n scope.lastValue = lastValue.value;\r\n scope.lastValueClass = badgeClassFromAlert(lastValue.alertLevel);\r\n }\r\n\r\n if (labelDates.length === 1) {\r\n var onlyDate = labelDates[0];\r\n var nextDate = new Date(onlyDate.getUTCFullYear(), onlyDate.getUTCMonth(), onlyDate.getUTCDate(), onlyDate.getUTCHours());\r\n nextDate.setDate(onlyDate.getUTCDate()+1)\r\n var previousDate = new Date(onlyDate.getUTCFullYear(), onlyDate.getUTCMonth(), onlyDate.getUTCDate(), onlyDate.getUTCHours());\r\n previousDate.setDate(onlyDate.getUTCDate()-1);\r\n\r\n labelDates.unshift(previousDate);\r\n labelDates.push(nextDate);\r\n\r\n angular.forEach(scope.data.datasets, function (dataset) {\r\n dataset.data.unshift(null);\r\n dataset.data.push(null);\r\n });\r\n }\r\n\r\n scope.data.labels = lodash.map(labelDates, function (d) {\r\n if(ConfigurationsService.configParams.DateFormat.toLowerCase() === \"dd/mm/yyyy\")\r\n {\r\n return $filter('date')(d, \"dd MMM\", \"UTC\");\r\n }\r\n return $filter('date')(d, \"MMM dd\", \"UTC\");\r\n });\r\n\r\n\r\n scope.chartIcon = scope.chartIcon || \"fa fa-line-chart\";\r\n\r\n function mapToData(dataArray, label) {\r\n return {\r\n label: label,\r\n data: mapChartDataValue(dataArray),\r\n fillColor: 'rgba(230,230,230,0.65)',\r\n referenceLabel: scope.referenceLabel,\r\n pointColor: 'rgb(42, 114, 192)'\r\n }\r\n }\r\n\r\n scope.lineOptions = {\r\n scaleShowGridLines: true,\r\n scaleGridLineColor: \"rgba(0,0,0,.7)\",\r\n scaleGridLineWidth: 1,\r\n scaleFontColor: \"rgba(0,0,0,.7)\",\r\n scaleLineColor: \"rgba(0,0,0,.7)\",\r\n bezierCurve: true,\r\n bezierCurveTension: 0.4,\r\n pointDot: true,\r\n pointDotRadius: 3,\r\n pointDotStrokeWidth: 1,\r\n pointHitDetectionRadius: 20,\r\n datasetStroke: true,\r\n datasetStrokeWidth: 2,\r\n datasetFill: true,\r\n legend: {\r\n backgroundColor: '#333',\r\n backgroundOpacity: .8\r\n },\r\n maintainAspectRatio: false\r\n };\r\n\r\n function mapChartDataValue(data) {\r\n return lodash.map(data, function (d) {\r\n if (d.alertLevel === 1) {\r\n return {\r\n value: d.value,\r\n pointColor: 'rgba(166, 35, 22, 1)'\r\n };\r\n } else if (d.alertLevel === 2) {\r\n return {\r\n value: d.value,\r\n pointColor: 'rgba(255, 192, 54, 1)'\r\n };\r\n }\r\n return d.value;\r\n });\r\n }\r\n\r\n function badgeClassFromAlert(alertLevel) {\r\n if (alertLevel === 1) {\r\n return \"badge-danger\";\r\n } else if (alertLevel === 2) {\r\n return \"badge-warning\";\r\n } else {\r\n return \"badge-info\";\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"reports\").directive(\"biometricChart\", BiometricChartDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/biometriccharts/biometricchart.tpl.html',\n '
           ()
          {{lastValue}}
          ');\n}]);\n}(window, document, window.angular));","function BiometricChartsDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^displayTemperature\",\r\n scope: {\r\n biometrics: \"=\",\r\n allBiometrics: \"=\",\r\n healthScores: \"=\",\r\n baselineWeight: \"=\"\r\n },\r\n templateUrl: \"modules/reports/biometriccharts/biometriccharts.tpl.html\",\r\n controller: function($scope, lodash, ConfigurationsService) {\r\n loadController();\r\n\r\n function loadController(){\r\n ConfigurationsService.getConfig().then(function(config){\r\n var bs = lodash.find($scope.charts, function(chart) {\r\n return chart.title == 'Blood Glucose';\r\n });\r\n\r\n if(bs) {\r\n bs.units = config.DefaultBloodSugarUnit;\r\n }\r\n var wt = lodash.find($scope.charts, function(chart) {\r\n return chart.title == 'Weight';\r\n });\r\n\r\n if(wt) {\r\n wt.units = config.DefaultWeightUnit;\r\n }\r\n\r\n var hbA1c = lodash.find($scope.charts, function(chart) {\r\n return chart.title == 'HbA1c';\r\n });\r\n\r\n if(hbA1c) {\r\n hbA1c.units = config.DefaultHba1cUnit;\r\n }\r\n });\r\n }\r\n },\r\n link: function (scope, elem, attrs, tempController) {\r\n var tempKey = \"Fahrenheit\";\r\n var tempUnit = \"°F\";\r\n if (tempController && tempController.defaultTempUnit == 1) {\r\n tempKey = \"Celsius\";\r\n tempUnit = \"°C\";\r\n }\r\n\r\n var sysData = mapBiometric(\"BloodPressure\", \"Systolic\");\r\n var diaData = mapBiometric(\"BloodPressure\", \"Diastolic\");\r\n\r\n var healthScores = lodash.map(scope.healthScores, function (h) {\r\n return {\r\n date: new Date(h.ScoreDate),\r\n value: h.Score,\r\n alertLevel: alertLevelFromHealthScore(h.Score)\r\n };\r\n });\r\n\r\n function alertLevelFromHealthScore(score) {\r\n if (score < 50) {\r\n return 1;\r\n } else if (score < 75) {\r\n return 2;\r\n } else {\r\n return 3;\r\n }\r\n }\r\n\r\n function mapBiometric(bioName, valueSelector) {\r\n return lodash(scope.biometrics).filter(function (o) {\r\n return o[bioName] !== null && o[bioName] !== undefined && !o[bioName].IsSkipped;\r\n }).map(function (o) {\r\n var val = o[bioName].Value;\r\n if (valueSelector) {\r\n val = val[valueSelector];\r\n }\r\n return {\r\n date: new Date(o.ObservationDate),\r\n value: val,\r\n alertLevel: o[bioName].HighestAlertSeverity\r\n };\r\n }).value();\r\n }\r\n\r\n function mapDynamicBiometric(bioName) {\r\n return lodash(scope.biometrics).filter(function (o) {\r\n return o.BiometricValues !== null && o.BiometricValues !== undefined && o.BiometricValues.find(b => b.TypeName === bioName && !b.IsSkipped);\r\n }).map(function (o) {\r\n let biometricValue = o.BiometricValues.find(b => b.TypeName === bioName && !b.IsSkipped);\r\n var val = biometricValue.Value;\r\n return {\r\n date: new Date(o.ObservationDate),\r\n value: val,\r\n alertLevel: biometricValue.HighestAlertSeverity\r\n };\r\n }).value();\r\n }\r\n\r\n var bpData = [];\r\n if (sysData.length > 0) {\r\n bpData.push({data: sysData});\r\n bpData.push({data: diaData});\r\n }\r\n\r\n var charts = lodash.map(scope.allBiometrics, function(biometric) {\r\n let result = {\r\n title: biometric.TypeName,\r\n units: biometric.UnitName,\r\n data: mapDynamicBiometric(biometric.TypeName),\r\n icon: biometric.Icon\r\n };\r\n switch(biometric.TypeName) {\r\n case \"Blood Pressure\":\r\n result.data = bpData;\r\n break;\r\n case \"Weight\":\r\n result.reference = scope.baselineWeight;\r\n break;\r\n case \"Temperature\":\r\n result.units = tempUnit;\r\n result.data = mapBiometric(\"Temperature\", tempKey);\r\n break;\r\n case \"Oxygen Saturation\":\r\n result.units = \"SpO2\";\r\n break;\r\n case \"PEF\":\r\n result = {\r\n title: \"PEF\",\r\n units: \"L/min\",\r\n data: mapBiometric(\"PEF\"),\r\n icon: \"vh-ui-glyph vh-ui-glyph-item-spyro\"\r\n };\r\n break;\r\n case \"FEVOne\":\r\n result = {\r\n title: \"FEV1\",\r\n units: \"L\",\r\n data: mapBiometric(\"FEVOne\"),\r\n icon: \"vh-ui-glyph vh-ui-glyph-item-spyro\"\r\n };\r\n break;\r\n case \"FEVRatio\":\r\n result = {\r\n title: \"FEV1/FEV6\",\r\n data: mapBiometric(\"FEVRatio\"),\r\n icon: \"vh-ui-glyph vh-ui-glyph-item-spyro\"\r\n };\r\n break;\r\n }\r\n return result;\r\n });\r\n \r\n charts.unshift({\r\n title: \"Health Scores\",\r\n data: healthScores,\r\n });\r\n\r\n scope.charts = lodash(charts).filter(function (o) {\r\n return o.data.length > 0;\r\n }).value();\r\n\r\n\r\n angular.forEach(scope.charts, function (c) {\r\n var dataArray = c.data;\r\n if (c.data.length > 0 && c.data[0].data) {\r\n dataArray = c.data[0].data;\r\n }\r\n\r\n if (dataArray.length > 10) {\r\n c.large = true;\r\n } else {\r\n c.large = false;\r\n }\r\n });\r\n\r\n angular.forEach(scope.charts, function (c, index) {\r\n var previous = null;\r\n if (index != 0) {\r\n previous = scope.charts[index-1];\r\n }\r\n var next = scope.charts[index+1];\r\n\r\n if ((previous == null || previous.large) && (next === undefined || next.large)) {\r\n c.large = true;\r\n }\r\n })\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"biometricCharts\", BiometricChartsDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/biometriccharts/biometriccharts.tpl.html',\n '
          Metrics
          No Biometric Data
          ');\n}]);\n}(window, document, window.angular));","function BiometricGridDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^?displayTemperature\",\r\n templateUrl: \"modules/reports/biometricgrid/biometricgrid.tpl.html\",\r\n scope: {\r\n biometrics: \"=\",\r\n healthScores: \"=\",\r\n showSpirometer: \"=\",\r\n showPedometer: \"=\"\r\n },\r\n link: function (scope, elem, attr, tempCtrl) {\r\n var fUnits = \"°F\";\r\n var cUnits = \"°C\";\r\n var primaryKey = fUnits;\r\n var secondaryKey = cUnits;\r\n if (tempCtrl && tempCtrl.defaultTempUnit == 1) {\r\n primaryKey = cUnits;\r\n secondaryKey = fUnits;\r\n }\r\n\r\n scope.temperatureUnits = primaryKey;\r\n if (tempCtrl && tempCtrl.displayBothUnits) {\r\n scope.temperatureUnits += \"/\" + secondaryKey;\r\n }\r\n },\r\n controller: function ($scope, ConfigurationsService) {\r\n $scope.healthScoreDates = lodash.groupBy($scope.healthScores, \"ScoreDate\");\r\n $scope.biometricDates = lodash($scope.biometrics)\r\n .groupBy(\"ObservationDate\")\r\n .map(function (bs, key) {\r\n return {\r\n date: key,\r\n biometrics: bs\r\n };\r\n }).value();\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n $scope.bloodSugarUnit = '(' + data.DefaultBloodSugarUnit + ')';\r\n $scope.weightUnit = '(' + data.DefaultWeightUnit + ')';\r\n $scope.hbA1cUnit = '(' + data.DefaultHba1cUnit + ')';\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"biometricGrid\", BiometricGridDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/biometricgrid/biometricgrid.tpl.html',\n '
          Flowsheet
          0 || healthScores > 0\">
          DateTimeHealth Score
          Blood Pressure
          (mmHg)
          Heart Rate
          (bpm)
          Oxygen Saturation
          (SpO2)
          Weight
          {{weightUnit}}
          Blood Glucose
          {{bloodSugarUnit}}
          HbA1c
          {{hbA1cUnit}}
          Temperature
          ({{temperatureUnits}})
          PEF
          (L/min)
          FEV1
          (L)
          FEV1
          FEV6
          Activity
          steps
          {{biometricDate.date | datetime : \"date\" : \"UTC\"}} {{row.ObservationDateTime_UTC | date : \"HH:mm\"}}
          No Biometric Data
          ');\n}]);\n}(window, document, window.angular));","function BiometricValueDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^?displayTemperature\",\r\n scope: {\r\n value: \"=\"\r\n },\r\n template: '{{displayValue}}',\r\n link: function (scope, elem, attrs, displayTemperatureCtrl) {\r\n if (scope.value) {\r\n var isSkipped = scope.value.IsSkipped;\r\n if (isSkipped) {\r\n scope.displayValue = \"skipped\";\r\n } else if (angular.isString(scope.value.Value)) {\r\n scope.displayValue = scope.value.Value;\r\n } else if (angular.isObject(scope.value.Value) && scope.value.Value.Systolic){\r\n scope.displayValue = scope.value.Value.Systolic + \"/\" + scope.value.Value.Diastolic;\r\n } else if (angular.isObject(scope.value.Value) && scope.value.Value.Fahrenheit){\r\n var primaryKey = \"Fahrenheit\";\r\n var secondaryKey = \"Celsius\";\r\n if (displayTemperatureCtrl && displayTemperatureCtrl.defaultTempUnit == 1) {\r\n primaryKey = \"Celsius\";\r\n secondaryKey = \"Fahrenheit\";\r\n }\r\n\r\n scope.displayValue = scope.value.Value[primaryKey];\r\n if (displayTemperatureCtrl && displayTemperatureCtrl.displayBothUnits) {\r\n scope.displayValue += \" (\" + scope.value.Value[secondaryKey] + \")\";\r\n }\r\n }\r\n\r\n if (attrs.noBadge === undefined) {\r\n if (scope.value.HighestAlertSeverity === 1) {\r\n scope.displayClass = \"badge badge-danger\";\r\n } else if (scope.value.HighestAlertSeverity === 2) {\r\n scope.displayClass = \"badge badge-warning\";\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"biometricValue\", BiometricValueDirective);\r\n","function HealthScoreBadge() {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n score: \"=\"\r\n },\r\n template: '{{scoreText}}',\r\n link: function (scope, elem, attrs) {\r\n if (scope.score) {\r\n scope.scoreText = scope.score.Score || \"--\";\r\n scope.skippedSurvey = scope.score.IsInvalidScore;\r\n if (scope.scoreText >= 75) {\r\n scope.healthClass = \"badge-primary\";\r\n } else if (scope.scoreText >= 50 || scope.skippedSurvey) {\r\n scope.healthClass = \"badge-warning\";\r\n } else {\r\n scope.healthClass = \"badge-danger\";\r\n }\r\n\r\n if (scope.skippedSurvey) {\r\n scope.tooltipText = \"Score not computed. Patient skipped one or more questions.\";\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"healthScoreBadge\", HealthScoreBadge);\r\n","function CaregiverSelectController(data, $uibModalInstance) {\r\n var vm = this;\r\n vm.caregivers = data.caregivers;\r\n vm.selectedCaregiver = {};\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.okDisabled = true;\r\n vm.caregiverChanged = caregiverChanged;\r\n\r\n function caregiverChanged() {\r\n if (vm.selectedCaregiver && vm.selectedCaregiver.data) {\r\n vm.okDisabled = false;\r\n data.report.paramValues['@CaregiverId'] = vm.selectedCaregiver;\r\n } else {\r\n vm.okDisabled = true;\r\n }\r\n }\r\n\r\n function ok() {\r\n $uibModalInstance.close(data.report);\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('reports').controller('CaregiverSelectController', CaregiverSelectController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/caregiverselect.modal.html',\n '

          Select Care Team Member

          Select the Correct Care Team Member

          ');\n}]);\n}(window, document, window.angular));","function PatientFormReportController($scope, form, $stateParams, lodash, $filter, lists, FormQuestionType, ConfigurationsService, SurveyQuestionType, SurveyParameterType, moment, patientParameters) {\r\n var pfvm = this;\r\n // data\r\n pfvm.form = form.currentForm || form;\r\n pfvm.formId = pfvm.form.FormId;\r\n pfvm.webformfields = [];\r\n pfvm.graphData = {};\r\n pfvm.questionValues = form.questionValues;\r\n\r\n pfvm.FormQuestionType = FormQuestionType;\r\n pfvm.patientParameters = patientParameters;\r\n\r\n // functions\r\n pfvm.hasPatientParameterType = hasPatientParameterType;\r\n pfvm.isTextDisplay = isTextDisplay;\r\n\r\n pfvm.GraphDataDefaultDays = ConfigurationsService.configParams.GraphDataDefaultDays;\r\n pfvm.dateformat = ConfigurationsService.configParams.DateFormat.toLowerCase();\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n defineWebformFields(lists.WebFormFields);\r\n setVariables();\r\n\r\n pfvm.weightData = pfvm.form.WeightBiometrics;\r\n\r\n if (pfvm.form.PostProcessor === 'Vivify.Platform.Components.Forms.HRMFormPostProcessor' && pfvm.form.Parameters && pfvm.form.Parameters.length > 0) {\r\n setCaregivers();\r\n }\r\n\r\n // mark options checked for Checkbox question types\r\n var checkBoxQuestions = lodash(pfvm.form.FormSections).pluck(\"FormQuestions\").flatten().any(function (q) {\r\n if (q.FormQuestionTypeId == pfvm.FormQuestionType.Checkboxes || q.FormQuestionTypeId == pfvm.FormQuestionType.InlineCheckboxs) {\r\n var selectedItemIds = JSON.parse(q.SelectedOptionIds);\r\n lodash.forEach(selectedItemIds, function (id) {\r\n var selectedOption = lodash.find(q.FormOptions, {FormOptionId: id});\r\n selectedOption.Checked = true;\r\n });\r\n }\r\n });\r\n\r\n // prep data for Med Rec question types\r\n var gridQuestions = lodash(pfvm.form.FormSections).pluck(\"FormQuestions\").flatten().any(function (q) {\r\n if (q.FormQuestionTypeId == pfvm.FormQuestionType.Grid) {\r\n if (q.AnswerText !== undefined && q.AnswerText !== null && q.AnswerText.length > 0) {\r\n q.Rows = JSON.parse(q.AnswerText);\r\n }\r\n else {\r\n q.Rows = [];\r\n var row = [];\r\n lodash.forEach(q.FormOptions, function (o) {\r\n row.push({});\r\n });\r\n q.Rows.push(row);\r\n }\r\n }\r\n });\r\n\r\n // prep date questions\r\n lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .filter(function (q) {\r\n return q.FormQuestionTypeId == pfvm.FormQuestionType.Date;\r\n })\r\n .value()\r\n .forEach(function (q) {\r\n if (q.AnswerText && q.AnswerText.length > 0) {\r\n q.date = new Date(Date.parse(q.AnswerText));\r\n } else {\r\n q.date = new Date();\r\n }\r\n });\r\n\r\n setVariables();\r\n\r\n buildGraphs();\r\n }\r\n\r\n function buildGraphs() {\r\n pfvm.graphData = {};\r\n\r\n lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .value()\r\n .forEach(function (question) {\r\n if (question.FormQuestionTypeId === pfvm.FormQuestionType.PulseGraph && question.AnswerText && question.AnswerText.length > 0) {\r\n pfvm.graphData.pulse = JSON.parse(question.AnswerText);\r\n pfvm.graphData.pulse.endDate = pfvm.graphData.pulse.endDate && moment(pfvm.graphData.pulse.endDate).toDate();\r\n pfvm.graphData.pulse.dataset.data.forEach(function(value){\r\n value.forEach(function(val){\r\n val.date = moment(val.date).toDate();\r\n });\r\n });\r\n }\r\n if (question.FormQuestionTypeId === pfvm.FormQuestionType.WeightGraph && question.AnswerText && question.AnswerText.length > 0) {\r\n pfvm.graphData.weight = JSON.parse(question.AnswerText);\r\n pfvm.graphData.weight.endDate = pfvm.graphData.weight.endDate && moment(pfvm.graphData.weight.endDate).toDate();\r\n pfvm.graphData.weight.dataset.data.forEach(function(value){\r\n value.forEach(function(val){\r\n val.date = moment(val.date).toDate();\r\n });\r\n });\r\n }\r\n if (question.FormQuestionTypeId === pfvm.FormQuestionType.O2Graph && question.AnswerText && question.AnswerText.length > 0) {\r\n pfvm.graphData.o2 = JSON.parse(question.AnswerText);\r\n pfvm.graphData.o2.endDate = pfvm.graphData.o2.endDate && moment(pfvm.graphData.o2.endDate).toDate();\r\n pfvm.graphData.o2.dataset.data.forEach(function(value){\r\n value.forEach(function(val){\r\n val.date = moment(val.date).toDate();\r\n });\r\n });\r\n }\r\n if (question.FormQuestionTypeId === pfvm.FormQuestionType.BPGraph && question.AnswerText && question.AnswerText.length > 0) {\r\n pfvm.graphData.bp = JSON.parse(question.AnswerText);\r\n pfvm.graphData.bp.endDate = pfvm.graphData.bp.endDate && moment(pfvm.graphData.bp.endDate).toDate();\r\n pfvm.graphData.bp.dataset.data.forEach(function(value){\r\n value.forEach(function(val){\r\n val.date = moment(val.date).toDate();\r\n });\r\n });\r\n }\r\n });\r\n }\r\n\r\n function getParameterText(param, uom) {\r\n var text = param;\r\n if(uom) {\r\n text += ' (' + uom + ')';\r\n }\r\n\r\n return text;\r\n }\r\n\r\n function isTextDisplay(question) {\r\n return question.FormQuestionTypeId === pfvm.FormQuestionType.DropDown\r\n || question.FormQuestionTypeId === pfvm.FormQuestionType.Textbox\r\n || question.FormQuestionTypeId === pfvm.FormQuestionType.MultiLineTextbox\r\n || question.FormQuestionTypeId === pfvm.FormQuestionType.StaticVariable\r\n || question.FormQuestionTypeId === pfvm.FormQuestionType.DynamicVariable;\r\n }\r\n\r\n function hasPulseOx(o) {\r\n return o.SurveyQuestionType === SurveyQuestionType.Oxygen || o.SurveyQuestionType === SurveyQuestionType.PulseOx;\r\n }\r\n\r\n function setCaregivers() {\r\n pfvm.form.Parameters.forEach(function (p) {\r\n var found = lodash.find(pfvm.patientProviders, {Id: parseInt(p.Parameter)});\r\n if (found) {\r\n found.include = true;\r\n found.PatientFormParameterId = p.PatientFormParameterId;\r\n }\r\n });\r\n }\r\n\r\n function defineWebformFields(fields) {\r\n if (fields) {\r\n for (var i = 0; i < fields.length; i++) {\r\n pfvm.webformfields[fields[i].FieldName] = fields[i];\r\n }\r\n }\r\n }\r\n\r\n function setVariables() {\r\n var currentQuestionValues = form.questionValues || questionValues;\r\n\r\n pfvm.variables = currentQuestionValues.FormVariables;\r\n pfvm.medications = currentQuestionValues.Medications;\r\n setParameters(currentQuestionValues);\r\n\r\n pfvm.formPageHeader = getFormVariable(0, pfvm.form.PageHeader || '');\r\n pfvm.formPageFooter = getFormVariable(0, pfvm.form.PageFooter || '');\r\n\r\n var medicationQuestion = lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .find(function (q) {\r\n return q.FormQuestionTypeId === pfvm.FormQuestionType.ActiveMedications;\r\n });\r\n\r\n if (medicationQuestion && medicationQuestion.AnswerText && medicationQuestion.AnswerText.length > 0) {\r\n pfvm.medications = JSON.parse(medicationQuestion.AnswerText);\r\n }\r\n\r\n var formVariableQuestions = lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .filter(function (question) {\r\n return question.FormQuestionTypeId === pfvm.FormQuestionType.StaticVariable || question.FormQuestionTypeId === pfvm.FormQuestionType.DynamicVariable;;\r\n })\r\n .value();\r\n\r\n pfvm.isSaveable = $stateParams.isCreate && formVariableQuestions.length && formVariableQuestions.length > 0;\r\n\r\n formVariableQuestions.forEach(function (question) {\r\n question.Question = getFormVariable(question.FormQuestionId, question.Question);\r\n\r\n if(question.AnswerText && question.AnswerText.length > 0) {\r\n return;\r\n }\r\n\r\n if (question.FormOptions === undefined || question.FormOptions.length === 0) {\r\n return;\r\n }\r\n\r\n var option = question.FormOptions[0];\r\n question.AnswerText = getFormVariable(question.FormQuestionId, option.Text);\r\n });\r\n }\r\n\r\n function setParameters(currentQuestionValues) {\r\n var patientParameters = currentQuestionValues.PatientParameters;\r\n\r\n var parameterQuestions = lodash(pfvm.form.FormSections)\r\n .pluck(\"FormQuestions\")\r\n .flatten()\r\n .filter(function (q) {\r\n return q.FormQuestionTypeId == pfvm.FormQuestionType.PatientParameters;\r\n })\r\n .value();\r\n\r\n parameterQuestions.forEach(function (question) {\r\n question.parameters = {};\r\n\r\n if (hasPatientParameterType(question, '{Pulse}')) {\r\n setPulseParameterQuestions(question, patientParameters.PulseOxParameters);\r\n }\r\n\r\n if (hasPatientParameterType(question, '{OxygenSat}')) {\r\n setOxygenParameterQuestions(question, patientParameters.PulseOxParameters);\r\n }\r\n\r\n if (hasPatientParameterType(question, '{BloodPressure}')) {\r\n setBloodPressureQuestions(question, patientParameters.BloodPressureParameters);\r\n }\r\n\r\n if (hasPatientParameterType(question, '{Weight}')) {\r\n setWeightQuestions(question, patientParameters.WeightScaleParameters);\r\n }\r\n });\r\n }\r\n\r\n function setPulseParameterQuestions(question, pulseOxParams) {\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n var savedParams = JSON.parse(question.AnswerText);\r\n question.parameters.pulse = {\r\n low: savedParams.pulse.low,\r\n high: savedParams.pulse.high,\r\n change: {\r\n low: savedParams.pulse.change.low,\r\n high: savedParams.pulse.change.high\r\n }\r\n };\r\n }\r\n }\r\n\r\n function setOxygenParameterQuestions(question, pulseOxParams) {\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n var savedParams = JSON.parse(question.AnswerText);\r\n question.parameters.oxygen = {\r\n medium: savedParams.oxygen.medium,\r\n high: savedParams.oxygen.high,\r\n change: {\r\n medium: savedParams.oxygen.change.medium,\r\n high: savedParams.oxygen.change.high\r\n }\r\n };\r\n }\r\n }\r\n\r\n function setBloodPressureQuestions(question, bpParams) {\r\n question.parameters.bp = {};\r\n\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n var savedParams = JSON.parse(question.AnswerText);\r\n question.parameters.bp.systolic = {\r\n medium_upper: savedParams.bp.systolic.medium_upper,\r\n medium_lower: savedParams.bp.systolic.medium_lower,\r\n high_upper: savedParams.bp.systolic.high_upper,\r\n high_lower: savedParams.bp.systolic.high_lower,\r\n change: {\r\n medium_upper: savedParams.bp.systolic.change.medium_upper,\r\n medium_lower: savedParams.bp.systolic.change.medium_lower,\r\n high_upper: savedParams.bp.systolic.change.high_upper,\r\n high_lower: savedParams.bp.systolic.change.high_lower\r\n }\r\n };\r\n\r\n question.parameters.bp.diastolic = {\r\n medium_upper: savedParams.bp.diastolic.medium_upper,\r\n medium_lower: savedParams.bp.diastolic.medium_lower,\r\n high_upper: savedParams.bp.diastolic.high_upper,\r\n high_lower: savedParams.bp.diastolic.high_lower,\r\n change: {\r\n medium_upper: savedParams.bp.diastolic.change.medium_upper,\r\n medium_lower: savedParams.bp.diastolic.change.medium_lower,\r\n high_upper: savedParams.bp.diastolic.change.high_upper,\r\n high_lower: savedParams.bp.diastolic.change.high_lower\r\n }\r\n };\r\n }\r\n }\r\n\r\n function setWeightQuestions(question, weightParams) {\r\n if (question.AnswerText && question.AnswerText.length > 0) {\r\n var savedParams = JSON.parse(question.AnswerText);\r\n question.parameters.weight = {\r\n uom: savedParams.weight.uom,\r\n current: {\r\n baseline: savedParams.weight.current.baseline,\r\n dailyGain: {\r\n high: savedParams.weight.current.dailyGain.high,\r\n low: savedParams.weight.current.dailyGain.low\r\n },\r\n dailyLoss: {\r\n high: savedParams.weight.current.dailyLoss.high,\r\n low: savedParams.weight.current.dailyLoss.low\r\n },\r\n weekly: savedParams.weight.current.weekly,\r\n max: savedParams.weight.current.max,\r\n min: savedParams.weight.current.min\r\n },\r\n change: {\r\n dailyGain: {\r\n high: savedParams.weight.change.dailyGain.high,\r\n low: savedParams.weight.change.dailyGain.low\r\n },\r\n dailyLoss: {\r\n high: savedParams.weight.change.dailyGain.high,\r\n low: savedParams.weight.change.dailyGain.low\r\n },\r\n weekly: savedParams.weight.change.weekly,\r\n max: savedParams.weight.change.max,\r\n min: savedParams.weight.change.min\r\n }\r\n };\r\n }\r\n }\r\n\r\n function getFormVariable(questionId, text) {\r\n var value = text;\r\n\r\n var questionVariables = lodash.filter(pfvm.variables, function (v) {\r\n return v.FormQuestionId === questionId;\r\n });\r\n\r\n questionVariables.forEach(function (v) {\r\n var variableValue = v.Value;\r\n if (v.VariableName.toLowerCase().indexOf('phone') >= 0 || v.VariableName.toLowerCase().indexOf('telephone') >= 0) {\r\n variableValue = $filter('tel')(variableValue);\r\n } else if (v.VariableName.toLowerCase().indexOf('currentdatetime') >= 0) {\r\n variableValue = $filter('datetime')(new Date(), 'datetime');\r\n } else if (v.VariableName.toLowerCase().indexOf('currentdate') >= 0) {\r\n variableValue = $filter('datetime')(new Date());\r\n }\r\n\r\n value = value.replace('{' + v.VariableName + '}', variableValue);\r\n });\r\n\r\n return value;\r\n }\r\n\r\n function hasPatientParameterType(question, type) {\r\n var hasType = lodash(question.FormOptions)\r\n .any(function (q) {\r\n return q.Text == type;\r\n });\r\n\r\n return hasType;\r\n }\r\n}\r\n\r\nangular.module(\"reports.patientforms\").controller(\"PatientFormReportController\", PatientFormReportController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/forms/patientformreport.tpl.html',\n '
          0\" ng-bind-html=\"pfvm.formPageHeader\">

          {{pfvm.form.FormTypeName}}



          0\">

          {{pfvm.form.Pretext}}

          {{section.Title}}

          {{section.Description}}

          {{question.Question}}

          {{question.AnswerText}}

          {{question.date | datetime}}

          {{option.Text}}

          {{option.Text}}

          {{option.Text}}
          {{field.AnswerText}}

          0\">{{param.Label}}

          No Patient Medications 0\" class=\"table form-section-group\">
          MedicationDoseRouteFrequencyReasonDate
          Started
          Date
          Stopped
          Refill
          {{med.Name}}{{med.Dose}}{{med.Route}}{{med.Frequency}}{{med.Reason}}{{med.StartDate | datetime : \"date\" : \"UTC\"}}{{med.EndDate | datetime : \"date\" : \"UTC\"}}
          CurrentChange
          High Threshold (>=)Low Threshold (<=)High Threshold (>=)Low Threshold (<=)
          High AlertMedium AlertHigh AlertMedium AlertHigh AlertMedium AlertHigh AlertMedium Alert
          Systolic BP{{question.parameters.bp.systolic.high_upper}}{{question.parameters.bp.systolic.medium_upper}}{{question.parameters.bp.systolic.high_lower}}{{question.parameters.bp.systolic.medium_lower}}{{question.parameters.bp.systolic.change.high_upper}}{{question.parameters.bp.systolic.change.medium_upper}}{{question.parameters.bp.systolic.change.high_lower}}{{question.parameters.bp.systolic.change.medium_lower}}
          Diastolic BP{{question.parameters.bp.diastolic.high_upper}}{{question.parameters.bp.diastolic.medium_upper}}---{{question.parameters.bp.diastolic.medium_lower}}{{question.parameters.bp.diastolic.change.high_upper}}{{question.parameters.bp.diastolic.change.medium_upper}}---{{question.parameters.bp.diastolic.change.medium_lower}}
          Pulse{{question.parameters.pulse.high}}------{{question.parameters.pulse.low}}{{question.parameters.pulse.change.high}}------{{question.parameters.pulse.change.low}}
          Oxygen Sat------{{question.parameters.oxygen.high}}{{question.parameters.oxygen.medium}}------{{question.parameters.oxygen.change.high}}{{question.parameters.oxygen.change.medium}}
          CurrentChange
          Daily Gain (>=)Daily Loss (<=)Weekly Gain/LossMax WeightMin WeightDaily Gain (>=)Daily Loss (<=)Weekly Gain/LossMax WeightMin Weight
          Baseline: {{question.parameters.weight.current.baseline}} (lbs)HighLowHighLowMediumHighHighHighLowHighLowMediumHighHigh
          Weight (lbs){{question.parameters.weight.current.dailyGain.high}}{{question.parameters.weight.current.dailyGain.low}}{{question.parameters.weight.current.dailyLoss.high}}{{question.parameters.weight.current.dailyLoss.low}}{{question.parameters.weight.current.weekly}}{{question.parameters.weight.current.max}}{{question.parameters.weight.current.min}}{{question.parameters.weight.change.dailyGain.high}}{{question.parameters.weight.change.dailyGain.low}}{{question.parameters.weight.change.dailyLoss.high}}{{question.parameters.weight.change.dailyLoss.low}}{{question.parameters.weight.change.weekly}}{{question.parameters.weight.change.max}}{{question.parameters.weight.change.min}}
          0\">

          {{pfvm.form.Posttext}}

          ');\n}]);\n}(window, document, window.angular));","function HealthSummaryController(ReportsService, healthSummaryReport, $filter, lodash) {\r\n var hsvm = this;\r\n\r\n ReportsService.getBiometrics().then((biometrics) => {\r\n hsvm.allBiometrics = biometrics;\r\n maphealthSummaryReport(healthSummaryReport);\r\n });\r\n\r\n function maphealthSummaryReport(report) {\r\n if (report.PatientHeader != null) {\r\n hsvm.patient = mapPatientHeader(report.PatientHeader);\r\n hsvm.biometrics = report.PatientBiometrics;\r\n hsvm.healthScores = report.PatientScores;\r\n hsvm.patientNotes = report.PatientNotes;\r\n hsvm.patientResponses = report.PatientSurveyResponses;\r\n hsvm.baselineWeight = report.BaselineWeight;\r\n hsvm.medications = report.PatientMedications;\r\n hsvm.showSpirometer = report.ShowSpirometer;\r\n hsvm.showPedometer = report.ShowPedometer;\r\n hsvm.validHealthScores = lodash.filter(report.PatientScores, function (h) {\r\n return !h.IsInvalidScore;\r\n });\r\n }\r\n hsvm.reportInfo = mapReportInfo(report.ReportHeader);\r\n hsvm.createdDate = report.CreatedDateTime_UTC;\r\n hsvm.defaultTempUnit = report.DefaultTemperature;\r\n hsvm.displayBothUnits = report.ShowBothTemperatureUnits;\r\n hsvm.reportSections = report.ReportSections;\r\n }\r\n\r\n function mapReportInfo(header) {\r\n return {\r\n reportName: \"Health Summary\",\r\n infoLineOne: header.TextLineOne,\r\n infoLineTwo: header.TextLineTwo,\r\n logoSrc: mapImage(header.ReportLogo)\r\n };\r\n }\r\n\r\n function mapPatientHeader(header) {\r\n return {\r\n firstName: header.FirstName,\r\n lastName: header.LastName,\r\n mi: header.MiddleInitial,\r\n age: mapAge(header.Age),\r\n dob: header.DateOfBirth,\r\n patientImgSrc: header.Image,\r\n patientId: header.PatientId,\r\n race: header.Race,\r\n gender: header.Gender,\r\n population: header.Population,\r\n populationGroup: header.PopulationGroup,\r\n phone: header.PhoneNumber,\r\n email: header.EmailAddress,\r\n risk: header.RiskId,\r\n provider: header.Provider,\r\n providerGroup: header.ProviderGroup,\r\n hospital: header.Hospital,\r\n lastHealthScore: header.LastHealthScore,\r\n isThirdPartyMonitored: header.IsThirdPartyMonitored\r\n };\r\n }\r\n\r\n function mapAge(age) {\r\n if (age) {\r\n return {\r\n age: age.Value,\r\n units: age.Units\r\n };\r\n }\r\n }\r\n\r\n function mapImage(im) {\r\n if (im && im.length > 0) {\r\n if (im.substring(0,4) == 'http') {\r\n return im;\r\n } else {\r\n return \"data:image/png;base64,\" + im;\r\n }\r\n }\r\n }\r\n\r\n\r\n}\r\nangular.module(\"reports\").controller(\"HealthSummaryController\", HealthSummaryController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/healthsummary.tpl.html',\n '
          {{hsvm.createdDate | datetime}} {{hsvm.patient.lastName}}, {{hsvm.patient.firstName}} {{hsvm.patient.mi}} ID: {{hsvm.patient.patientId}}
          /
          Patient not found.
          ');\n}]);\n}(window, document, window.angular));","function MedicationsDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/reports/medications/medications.tpl.html\",\r\n scope: {\r\n medications: \"=\"\r\n },\r\n link: function (scope, elem, attr) {},\r\n controller: function ($scope) {\r\n\r\n $scope.currentMedications = lodash($scope.medications)\r\n .filter(function(o) { return o.MedStatus == \"Current\"; })\r\n .sortBy(function(o) { return o.Name; })\r\n .value();\r\n\r\n\r\n $scope.holdingMedications = lodash($scope.medications)\r\n .filter(function(o) { return o.MedStatus == \"Holding\"; })\r\n .sortBy(function(o) { return o.Name; })\r\n .value();\r\n\r\n\r\n $scope.discontinuedMedications = lodash($scope.medications)\r\n .filter(function(o) { return o.MedStatus == \"Discontinued\"; })\r\n .sortBy(function(o) { return o.Name; })\r\n .value();\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\")\r\n .directive(\"medications\", MedicationsDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/medications/medications.tpl.html',\n '
          Medications
          0\"> 0\"> 0\" ng-class=\"{\\'text-danger\\': med.NeedsRefill===true}\"> 0\"> 0\"> 0\"> 0\" class=\"text-muted\">
          MedicationDoseRouteFrequencyReasonDate
          Started
          Date
          Stopped
          Refill
          Current{{currentMedications[0].MedStatusCount}}
          {{med.Name}}{{med.Dose}}{{med.Route}}{{med.Frequency}}{{med.Reason}}{{med.StartDate | datetime : \"date\" : \"UTC\"}}{{med.EndDate | datetime : \"date\" : \"UTC\"}}
          Holding{{holdingMedications[0].MedStatusCount}}
          {{med.Name}}{{med.Dose}}{{med.Route}}{{med.Frequency}}{{med.Reason}}{{med.StartDate | datetime : \"date\" : \"UTC\"}}{{med.EndDate | datetime : \"date\" : \"UTC\"}}
          Discontinued{{discontinuedMedications[0].MedStatusCount}}
          {{med.Name}}{{med.Dose}}{{med.Route}}{{med.Frequency}}{{med.Reason}}{{med.StartDate | datetime : \"date\" : \"UTC\"}}{{med.EndDate | datetime : \"date\" : \"UTC\"}}
          No Patient Medications
          ');\n}]);\n}(window, document, window.angular));","function PatientNotesDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/reports/patientnotes/patientnotes.tpl.html\",\r\n scope: {\r\n patientNotes: \"=\"\r\n },\r\n link: function (scope, elem, attr) {},\r\n controller: function ($scope) {\r\n $scope.patientNoteData = lodash($scope.patientNotes)\r\n .reverse()\r\n .groupBy(function(note) {\r\n return new Date(note.CreatedDateTime_UTC);\r\n })\r\n .value();\r\n }\r\n };\r\n}\r\n\r\nfunction ToArray(lodash) {\r\n return function(obj) {\r\n if (!(obj instanceof Object)) return obj;\r\n return lodash.map(obj, function(val, key) {\r\n return Object.defineProperty(val, '$key', {__proto__: null, value: key});\r\n });\r\n };\r\n}\r\n\r\nfunction Html($sce) {\r\n return function(input){\r\n return $sce.trustAsHtml(input);\r\n };\r\n}\r\n\r\nangular.module(\"reports\")\r\n .directive(\"patientNotes\", PatientNotesDirective)\r\n .filter('toArray', ToArray)\r\n .filter('html', Html);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/patientnotes/patientnotes.tpl.html',\n '
          Notes
          0\">
          DateTimeNoteAuthor
          {{rows.$key | datetime}} {{row.CreatedDateTime_UTC | date : \"HH:mm\"}}
          {{alert.AlertMessage}}
          {{row.ProviderName}}, {{row.ProviderTitle}}
          No Patient Notes
          ');\n}]);\n}(window, document, window.angular));","function PatientSelectController(data, $uibModalInstance, lodash) {\r\n var vm = this;\r\n vm.patients = data.patients;\r\n vm.selectedPatient = {};\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.okDisabled = true;\r\n vm.patientChanged = patientChanged;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n }\r\n\r\n function patientChanged() {\r\n if (vm.selectedPatient && vm.selectedPatient.data) {\r\n vm.okDisabled = false;\r\n data.report.paramValues['@PatientId'] = vm.selectedPatient;\r\n } else {\r\n vm.okDisabled = true;\r\n }\r\n }\r\n\r\n function ok() {\r\n $uibModalInstance.close(data.report);\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('reports').controller('PatientSelectController', PatientSelectController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/patientselect.modal.html',\n '

          Select Patient

          Select the Correct Patient

          ');\n}]);\n}(window, document, window.angular));","function PatientDirective() {\r\n return {\r\n restrict: \"A\",\r\n scope: {\r\n patient: \"=\"\r\n },\r\n controller: function ($scope) {\r\n this.patient = $scope.patient;\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"patient\", PatientDirective);\r\n","function PatientHealthScore () {\r\n return {\r\n restrict: \"E\",\r\n require: \"^patient\",\r\n templateUrl: \"modules/reports/patientsummary/patienthealthscore.tpl.html\",\r\n link: function (scope, elem, attrs, patientController) {\r\n var patient = patientController.patient;\r\n if (patient.lastHealthScore != null) {\r\n scope.healthScoreText = patient.lastHealthScore.Score || \"--\";\r\n if (scope.healthScoreText >= 75) {\r\n scope.healthScoreTrendClass = \"text-success\";\r\n scope.healthScoreTrendIconClass = \"fa-level-up\";\r\n } else if (scope.healthScoreText >= 50 || patient.lastHealthScore.IsSkipped) {\r\n scope.healthScoreTrendClass = \"text-warning\";\r\n scope.healthScoreTrendIconClass = \"fa-level-down\";\r\n } else {\r\n scope.healthScoreTrendClass = \"text-danger\";\r\n scope.healthScoreTrendIconClass = \"fa-level-down\";\r\n }\r\n if (patient.lastHealthScore.IsSkipped) {\r\n scope.tooltipText =\"Score not computed. Patient skipped one or more questions.\";\r\n }\r\n }\r\n\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"patientHealthScore\", PatientHealthScore)\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/patientsummary/patienthealthscore.tpl.html',\n '
          Last Health Score
          {{healthScoreText}}
          ');\n}]);\n}(window, document, window.angular));","function PatientImgDirective() {\r\n return {\r\n restrict: \"E\",\r\n require: \"^patient\",\r\n template: '
          ',\r\n link: function (scope, elem, attrs, patientController) {\r\n scope.patient = patientController.patient;\r\n setPhoto();\r\n function setPhoto() {\r\n scope.patientImage = scope.patient.patientImgSrc;\r\n\r\n if (scope.patientImage === undefined || scope.patientImage === null || scope.patientImage.length < 1) {\r\n if (scope.patient.Gender === \"Female\") {\r\n scope.patientImage = \"layout/img/female.png\";\r\n } else {\r\n scope.patientImage = \"layout/img/male.png\";\r\n }\r\n } else {\r\n scope.patientImage = \"data:image/png;base64,\" + scope.patientImage;\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"patientImg\", PatientImgDirective);\r\n","function PatientInfoDirective($filter, lodash) {\r\n return {\r\n restrict: \"E\",\r\n require: \"^patient\",\r\n templateUrl: \"modules/reports/patientsummary/patientinfo.tpl.html\",\r\n link: function (scope, elem, attrs, patientController) {\r\n scope.patient = patientController.patient;\r\n\r\n var infoTypes = [\r\n \"patientId\",\r\n { key:\"dob\", filter: \"date\", filterOption: \"MM/dd/yyyy\", otherFilterOptions: \"UTC\"},\r\n \"race\",\r\n \"gender\",\r\n {key: \"populationGroup\", name: \"Population Group\"},\r\n \"population\",\r\n { key: \"phone\", filter: \"tel\"},\r\n \"email\"\r\n ];\r\n\r\n var info = lodash.map(infoTypes, mapInfoTypes, scope.patient);\r\n\r\n if (info.length < 5) {\r\n scope.infoFirstRow = info;\r\n } else {\r\n var firstRowCount = Math.ceil(info.length/2);\r\n scope.infoFirstRow = info.slice(0, firstRowCount);\r\n scope.infoSecondRow = info.slice(firstRowCount);\r\n }\r\n\r\n function mapInfoTypes(type) {\r\n var item = {};\r\n var key = \"\";\r\n if (angular.isString(type)) {\r\n key = type;\r\n } else {\r\n key = type.key;\r\n }\r\n if (type.filter) {\r\n item.value = $filter(type.filter)(this[type.key], type.filterOption, type.otherFilterOptions);\r\n } else {\r\n item.value = this[key];\r\n }\r\n\r\n if (type.name) {\r\n item.itemName = type.name;\r\n } else {\r\n item.itemName = key.charAt(0).toUpperCase() + key.slice(1);\r\n }\r\n return item;\r\n }\r\n }\r\n };\r\n}\r\n\r\nfunction InfoItemDirective() {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n item: \"=\"\r\n },\r\n template: '{{itemText}}',\r\n link: function (scope, elem, attrs) {\r\n if (scope.item) {\r\n if (scope.item.value) {\r\n scope.itemText = scope.item.value;\r\n } else {\r\n scope.itemText = \"N/A\";\r\n if (scope.item.itemName) {\r\n scope.itemText = scope.item.itemName + \" \" + scope.itemText;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\n//Directive for static patient info\r\nangular.module(\"reports\").directive(\"patientInfo\", PatientInfoDirective).directive(\"infoItem\", InfoItemDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/patientsummary/patientinfo.tpl.html',\n '

          {{patient.lastName}}, {{patient.firstName}} {{patient.mi}} ({{patient.age | age}}) 

           | 

           | 

          ');\n}]);\n}(window, document, window.angular));","function patientSummaryDirective() {\r\n return {\r\n restrict: \"E\",\r\n require: \"patient\",\r\n templateUrl: \"modules/reports/patientsummary/patientsummary.tpl.html\"\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"patientSummary\", patientSummaryDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/patientsummary/patientsummary.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function ProviderInfoDirective() {\r\n return {\r\n restrict: \"E\",\r\n require: \"^patient\",\r\n templateUrl: \"modules/reports/patientsummary/providerinfo.tpl.html\",\r\n link: function (scope, elem, attrs, patientController) {\r\n scope.patient = patientController.patient;\r\n\r\n riskIdToText(scope.patient.risk);\r\n\r\n function riskIdToText(riskId) {\r\n if (riskId == 1) {\r\n scope.riskText = \"Low Risk\";\r\n } else if (riskId == 2) {\r\n scope.riskText = \"Medium Risk\";\r\n } else if (riskId == 3) {\r\n scope.riskText = \"High Risk\";\r\n } else if (riskId == 4) {\r\n scope.riskText = \"Risk Not Assigned\";\r\n scope.riskNotAssigned = true;\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"providerInfo\", ProviderInfoDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/patientsummary/providerinfo.tpl.html',\n '

          {{riskText}}

          {{patient.provider}}{{patient.providerGroup}}

          {{patient.hospital}}

          ');\n}]);\n}(window, document, window.angular));","function ReportCcmTimeTypeFilterDirective() {\r\n function controller($scope) {\r\n $scope.$watch('filter.value', function(newValue, oldValue){\r\n if(newValue !== oldValue){\r\n $scope.action();\r\n }\r\n });\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n require: '^reportFilters',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'modules/reports/report_parameters/ccm-time-type.tpl.html',\r\n scope: {\r\n filter: '=filter',\r\n action: '&'\r\n }\r\n }\r\n}\r\n\r\nangular.module('reports').directive('ccmTimeTypeFilter', ReportCcmTimeTypeFilterDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/report_parameters/ccm-time-type.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function ReportDateMonthFilterDirective() {\r\n function controller($scope) {\r\n $scope.monthOpened = false;\r\n $scope.datePickerOpen = function ($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n\r\n $scope.monthOpened = !$scope.monthOpened;\r\n };\r\n }\r\n\r\n function link(scope, elem, attrs, controller){\r\n scope.$watch('filter.value', function(newValue, oldValue){\r\n if(newValue !== oldValue){\r\n controller.validate();\r\n }\r\n });\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n restrict: 'E',\r\n require: '^reportFilters',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'modules/reports/report_parameters/date-month.tpl.html',\r\n scope: {\r\n filter: '=filter'\r\n }\r\n }\r\n}\r\n\r\nangular.module('reports').directive('dateMonthFilter', ReportDateMonthFilterDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/report_parameters/date-month.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function ReportMultiplePatientFilterDirective($timeout, ReportsService) {\r\n function link(scope, elem, attrs, controller) {\r\n this.additionalTime = 0;\r\n\r\n scope.validateName = function() {\r\n $timeout(function(){\r\n controller.validate()\r\n }, 200);\r\n };\r\n\r\n scope.getPatientTypeaheadData = function (val) {\r\n return ReportsService.getTypeAheadPatientByName(val).then(function(data){\r\n return data;\r\n });\r\n }\r\n \r\n scope.validateAdditionalTime = function() {\r\n $timeout(function() {\r\n controller.validateAdditionalTime();\r\n }, 200);\r\n };\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n require: '^reportFilters',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'modules/reports/report_parameters/multiple-patient.tpl.html',\r\n scope: {\r\n filter: '=filter'\r\n }\r\n }\r\n}\r\n\r\nangular.module('reports').directive('multiplePatientFilter', ReportMultiplePatientFilterDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/report_parameters/multiple-patient.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function ReportFiltersDirective() {\r\n \r\n function controller($scope) {\r\n this.validate = function(){\r\n $scope.validate();\r\n }\r\n\r\n this.validateAdditionalTime = function(){\r\n $scope.validateAdditionalTime();\r\n }\r\n }\r\n \r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n templateUrl: 'modules/reports/report_parameters/report_parameters.tpl.html'\r\n }\r\n}\r\n\r\nangular.module('reports').directive('reportFilters', ReportFiltersDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/report_parameters/report_parameters.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function ReportTypeaheadCaregiverFilterDirective($timeout) {\r\n function link(scope, elem, attrs, controller) {\r\n scope.validateName = function() {\r\n if(scope.filter.type === 'Single'){\r\n $timeout(function(){\r\n controller.validate()\r\n }, 200);\r\n }\r\n };\r\n\r\n scope.update = function() {\r\n if(scope.filter.type !== 'Single'){\r\n controller.validate();\r\n }\r\n };\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n require: '^reportFilters',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'modules/reports/report_parameters/typeahead-caregiver.tpl.html',\r\n scope: {\r\n filter: '=filter'\r\n }\r\n }\r\n}\r\n\r\nangular.module('reports').directive('typeaheadCaregiverFilter', ReportTypeaheadCaregiverFilterDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/report_parameters/typeahead-caregiver.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function ReportTypeaheadPatientFilterDirective($timeout) { \r\n function link(scope, elem, attrs, controller) {\r\n scope.validateName = function() {\r\n if(scope.filter.type === 'Single'){\r\n $timeout(function(){\r\n controller.validate()\r\n }, 200);\r\n }\r\n };\r\n\r\n scope.update = function() {\r\n if(scope.filter.type !== 'Single'){\r\n controller.validate();\r\n }\r\n };\r\n }\r\n\r\n return {\r\n link: link,\r\n restrict: 'E',\r\n require: '^reportFilters',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'modules/reports/report_parameters/typeahead-patient.tpl.html',\r\n scope: {\r\n filter: '=filter'\r\n }\r\n }\r\n}\r\n\r\nangular.module('reports').directive('typeaheadPatientFilter', ReportTypeaheadPatientFilterDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/report_parameters/typeahead-patient.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function Report(biReport, PHIWarningText, BIService, PermissionService, $scope, AuthorizationService, $state, lodash, $http, $window) {\r\n var ExportTypeEnum = { PDF:1, Excel:2, RTF:3, CSV: 4};\r\n var hasModerateWrite = PermissionService.userHasPermission([\"SecurityAccessLevelModerateWrite\"]);\r\n var hasAdvancedWrite = PermissionService.userHasPermission([\"SecurityAccessLevelAdvancedWrite\"]);\r\n var hasReportOwnership = biReport.ReportOwnerId == AuthorizationService.getCaregiver().Id;\r\n var rvm = this;\r\n rvm.executionStatusEnum = BIService.executionStatusEnum;\r\n rvm.isSelfService = $state.params.isSelfService;\r\n\r\n rvm.report = biReport;\r\n rvm.ExportTypeEnum = ExportTypeEnum;\r\n rvm.PhiWarningText = PHIWarningText;\r\n rvm.isReportRunning = false;\r\n rvm.lastRunDate = null;\r\n rvm.executionStatus = rvm.executionStatusEnum.Unknown;\r\n rvm.errorMessage = null;\r\n\r\n rvm.isExportOptionAvailable = isExportOptionAvailable;\r\n rvm.isLegacyReport = isLegacyReport;\r\n rvm.StatusChanged = StatusChanged;\r\n rvm.showPhiWarningText = showPhiWarningText;\r\n rvm.canExport = canExport;\r\n rvm.canPreview = canPreview;\r\n rvm.DisplayEditBtn = DisplayEditBtn;\r\n rvm.DisplayFullUIBtn = DisplayFullUIBtn;\r\n\r\n rvm.RunBtnClicked = RunBtnClicked;\r\n rvm.ExportBtnClicked = ExportBtnClicked;\r\n rvm.EditBtnClicked = EditBtnClicked;\r\n rvm.FullUIBtnClicked = FullUIBtnClicked;\r\n\r\n rvm.ParameterChanged = ParameterChanged;\r\n rvm.isExcelOnly = isExcelOnly;\r\n\r\n rvm.ExagoSessionLoaded = false;\r\n \r\n \r\n rvm.PatientTimeLogPatientId = null;\r\n rvm.PatientTimeLogAdditionalTime = null;\r\n\r\n initializeController();\r\n\r\n $scope.$on(\"OnExagoSessionLoaded\", function () {\r\n rvm.ExagoSessionLoaded = true;\r\n \r\n });\r\n\r\n $scope.$on('OnDisposeContainer', function (event, next, current) {\r\n rvm.isReportRunning = false;\r\n });\r\n\r\n function initializeController() { \r\n if (isExcelOnly()) {\r\n rvm.report.paramValues = {};\r\n\r\n //Initialize dropdowns with default values\r\n if (reportHasParam('@StartDate')) {\r\n rvm.report.paramValues['@StartDate'] = getParam('@StartDate').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@EndDate')) {\r\n rvm.report.paramValues['@EndDate'] = getParam('@EndDate').ReportParamOption[0]\r\n }\r\n if (reportHasParam('@NoteRange')) {\r\n rvm.report.paramValues['@NoteRange'] = getParam('@NoteRange').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@StatusId')) {\r\n rvm.report.paramValues['@StatusId'] = getParam('@StatusId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@StatusReasonId')) {\r\n rvm.report.paramValues['@StatusReasonId'] = rvm.report.paramValues['@StatusId'].ParamOptionSubOptions[0];\r\n }\r\n if (reportHasParam('@SurveyQuestionTypeId')) {\r\n rvm.report.paramValues['@SurveyQuestionTypeId'] = getParam('@SurveyQuestionTypeId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@SkipBiometricReasonId')) {\r\n rvm.report.paramValues['@SkipBiometricReasonId'] = rvm.report.paramValues['@SurveyQuestionTypeId'].ParamOptionSubOptions[0];\r\n }\r\n if (reportHasParam('@ServiceLevel')) {\r\n rvm.report.paramValues['@ServiceLevel'] = getParam('@ServiceLevel').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@HospitalId')) {\r\n rvm.report.paramValues['@HospitalId'] = getParam('@HospitalId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@HospitalIds')) {\r\n lodash.forEach(getParam('@HospitalIds').ReportParamOption, function (paramOption) {\r\n paramOption.selected = true;\r\n });\r\n rvm.report.paramValues['@HospitalIds'] = undefined;\r\n }\r\n if (reportHasParam('@ActionType')) {\r\n rvm.report.paramValues['@ActionType'] = getParam('@ActionType').ReportParamOption.sort(sortOptionsByName)[0];\r\n }\r\n if (reportHasParam('@InvitationStatusId')) {\r\n rvm.report.paramValues['@InvitationStatusId'] = getParam('@InvitationStatusId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@Programs')) {\r\n lodash.forEach(getParam('@Programs').ReportParamOption, function (paramOption) {\r\n paramOption.selected = true;\r\n });\r\n }\r\n if (reportHasParam('@ProgramGroups')) {\r\n lodash.forEach(getParam('@ProgramGroups').ReportParamOption, function (paramOption) {\r\n paramOption.selected = true;\r\n });\r\n }\r\n if (reportHasParam('@AlertClass')) { \r\n lodash.forEach(getParam('@AlertClass').ReportParamOption, function (paramOption) {\r\n paramOption.selected = true;\r\n });\r\n }\r\n if (reportHasParam('@PatientId')) {\r\n rvm.report.paramValues['@PatientId'] = getParam('@PatientId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@SurveyQuestionTypeId')) {\r\n rvm.report.paramValues['@SurveyQuestionTypeId'] = getParam('@SurveyQuestionTypeId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@SkipBiometricReasonId')) {\r\n rvm.report.paramValues['@SkipBiometricReasonId'] = getParam('@SkipBiometricReasonId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@PrePost')) {\r\n rvm.report.paramValues['@PrePost'] = getParam('@PrePost').ReportParamOption[0];\r\n }\r\n // this is sub-optimal \r\n if (rvm.report.Name == 'Program Compliance' || rvm.report.Name == 'Patient Compliance Data Dump') {\r\n rvm.dateOptions = {\r\n showWeeks: false,\r\n maxDate: moment().subtract(1, 'day').toDate()\r\n };\r\n } else {\r\n rvm.dateOptions = {\r\n showWeeks: false,\r\n maxDate: new Date()\r\n };\r\n }\r\n\r\n }\r\n }\r\n\r\n function reportHasParam(databaseName) {\r\n var param = getParam(databaseName);\r\n if (param) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n function getBIParam(BIParamName) {\r\n var param = lodash.find(rvm.report.Parameters, function (o) {\r\n return o.DisplayName == BIParamName;\r\n });\r\n\r\n\r\n if (param) {\r\n return param;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n function getBIParamByExagoParam(BIParamName) {\r\n var param = lodash.find(rvm.report.Parameters, function (o) {\r\n return o.ExagoParameterName == BIParamName;\r\n });\r\n\r\n\r\n if (param) {\r\n return param;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n\r\n\r\n function getParam(databaseName) { \r\n var param = lodash.find(rvm.report.LegacyReport.ReportParams, function (o) {\r\n return o.DatabaseName == databaseName;\r\n });\r\n\r\n\r\n if (param) {\r\n return param;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n function isExportOptionAvailable(option) {\r\n return rvm.report.ExcludedExportOptions == undefined || rvm.report.ExcludedExportOptions == \"\" || !rvm.report.ExcludedExportOptions.split(\",\").includes(option.toString());\r\n }\r\n\r\n function isLegacyReport() {\r\n retval = false;\r\n //Once we fix the OTN Exago reports, we should change to && instead of ||\r\n if (rvm.report.ReportTypeEnum == BIService.reportTypeEnum.Legacy || rvm.report.LegacyReport) {\r\n retval = true;\r\n }\r\n\r\n return retval;\r\n }\r\n\r\n function isExcelOnly() {\r\n retval = false;\r\n //Once we fix the OTN Exago reports, we should change to && instead of ||\r\n if ((rvm.report.ReportTypeEnum == BIService.reportTypeEnum.Legacy || rvm.report.LegacyReport) && rvm.report.LegacyReport.ExcelReportClass != undefined && rvm.report.LegacyReport.ExcelReportClass == 'GenericDataDump'\r\n //&& rvm.report.DisplayName != \"BYOD and +Go Status\"\r\n //&& rvm.report.DisplayName != \"Care Team Member Audit\"\r\n // && rvm.report.DisplayName != \"Patient Status\"\r\n // && rvm.report.DisplayName != \"Staff Workload\"\r\n\r\n ) {\r\n retval = true;\r\n }\r\n\r\n return retval;\r\n }\r\n\r\n\r\n function canExport() {\r\n // Can export if the report is not running\r\n return (!rvm.isReportRunning && rvm.ExagoSessionLoaded) || (rvm.isLegacyReport() && rvm.isExcelOnly());\r\n }\r\n\r\n function canPreview() {\r\n // Can preview if the report is not running \r\n return !rvm.isReportRunning && rvm.ExagoSessionLoaded;\r\n }\r\n\r\n function showPhiWarningText() {\r\n return rvm.report.IsPatientRelated;\r\n }\r\n\r\n function DisplayEditBtn() {\r\n return (hasAdvancedWrite || hasReportOwnership || hasModerateWrite) && !rvm.isSelfService && !rvm.isExcelOnly();\r\n }\r\n\r\n function DisplayFullUIBtn() {\r\n return (hasAdvancedWrite || hasModerateWrite) && !rvm.isSelfService && !rvm.isExcelOnly();\r\n }\r\n function RunBtnClicked(reportParameters) {\r\n reportParameters.$setSubmitted();\r\n if (reportParameters.$valid) {\r\n $scope.$broadcast(\"biExecuteReport\", 'pdf');\r\n }\r\n }\r\n\r\n function ExportBtnClicked(exportFormat, reportParameters) { \r\n if (rvm.isExcelOnly()) {\r\n rvm.errorMessage = \"\";\r\n rvm.lastRunDate = \"\";\r\n rvm.executionStatus = rvm.executionStatusEnum.Unknown;\r\n reportParameters.$setSubmitted();\r\n if (!reportParameters.$valid) {\r\n return;\r\n }\r\n\r\n reportExecRequest = {};\r\n reportExecRequest.ReportTypeId = rvm.report.LegacyReport.ReportTypeId;\r\n reportExecRequest.ReportActionType = \"Export\";\r\n if (rvm.report.DisplayName == \"Patient Time Log Summary\")\r\n getPatientTimeLogData(reportParameters);\r\n var reportParams = getReportParams();\r\n\r\n angular.forEach(reportParams, function (param) {\r\n delete param.ReportParam;\r\n });\r\n // Date.prototype.toJSON = function () { return moment(this).format(); } \r\n reportExecRequest.ReportParams = JSON.stringify(reportParams);\r\n rvm.report.LegacyReport.ReportInstances.unshift({ CreatedDateTime_UTC: new Date(), Status: 0 });\r\n return BIService.createReportRequest(reportExecRequest).then(function (data) {\r\n rvm.report.LegacyReport.ReportInstances[0].ReportGUID = data;\r\n rvm.isReportRunning = true;\r\n handleReportRunning(rvm.report.LegacyReport.ReportTypeId);\r\n return data;\r\n });\r\n }\r\n else {\r\n reportParameters.$setSubmitted();\r\n if (reportParameters.$valid) {\r\n $scope.$broadcast(\"biExecuteReport\", exportFormat, 'export');\r\n }\r\n }\r\n }\r\n function getPatientTimeLogData(reportParameters) {\r\n //Patient time log summary report\r\n if (reportParameters.patient != undefined) {\r\n rvm.PatientTimeLogPatientId = reportParameters.patient.$modelValue;\r\n rvm.PatientTimeLogAdditionalTime = \"\";\r\n }\r\n else if (reportParameters.additionaltime != undefined) {\r\n rvm.PatientTimeLogAdditionalTime = reportParameters.additionaltime.$modelValue\r\n rvm.PatientTimeLogPatientId == \"\";\r\n }\r\n else {\r\n rvm.PatientTimeLogPatientId = null;\r\n rvm.PatientTimeLogAdditionalTime = \"\";\r\n }\r\n }\r\n\r\n function getReportStatus(reportGuid) {\r\n return BIService.getReportStatus(reportGuid).then(function (data) {\r\n return data;\r\n });\r\n }\r\n\r\n function getReportExtendedStatus(reportGuid) {\r\n return BIService.getExtendedReportStatus(reportGuid).then(function (data) {\r\n return data;\r\n });\r\n }\r\n\r\n\r\n function handleReportRunning(reportTypeId) {\r\n if ($state && $state.current.name === 'reports.folder.report' && rvm.report.LegacyReport.ReportTypeId && rvm.report.LegacyReport.ReportTypeId === reportTypeId) {\r\n getReportExtendedStatus(rvm.report.LegacyReport.ReportInstances[0].ReportGUID).then(function (data) {\r\n if (data.Status === 0) {\r\n var t = setTimeout(function () {\r\n handleReportRunning(reportTypeId);\r\n }, 5000);\r\n } else if (data.Status == -99) {\r\n rvm.isReportRunning = false;\r\n rvm.executionStatus = rvm.executionStatusEnum.TooManyRecords;\r\n rvm.errorMessage = data.ErrorMessage;\r\n \r\n } else if (data.Status < 0) {\r\n rvm.isReportRunning = false;\r\n rvm.executionStatus = rvm.executionStatusEnum.Error;\r\n rvm.report.LegacyReport.ReportInstances[0].Status = data.Status;\r\n } else if (data.Status === 1 ) {\r\n rvm.isReportRunning = false;\r\n rvm.report.LegacyReport.ReportInstances[0].Status = data.Status;\r\n rvm.lastRunDate = data.CreatedDateTime_UTC;\r\n exportReport(rvm.report.LegacyReport.ReportInstances[0].ReportGUID);\r\n }\r\n });\r\n }\r\n }\r\n var file = null;\r\n\r\n function exportReport(reportGuid) {\r\n $http({\r\n url: \"/api/report/ExportToExcel?reportId=\" + reportGuid,\r\n method: \"GET\",\r\n responseType: 'arraybuffer'\r\n }).then(function ({data, status, headers, config}) {\r\n\r\n if (file !== null) {\r\n $window.URL.revokeObjectURL(file);\r\n }\r\n\r\n file = new Blob([data]);\r\n\r\n var fileName = headers('Content-Disposition').split('=')[1];\r\n\r\n if ($window.navigator.msSaveBlob) {\r\n $window.navigator.msSaveBlob(file, fileName);\r\n }\r\n else {\r\n var a = document.createElement('a');\r\n a.href = $window.URL.createObjectURL(file);\r\n a.target = '_blank';\r\n a.download = fileName;\r\n a.click();\r\n }\r\n });\r\n }\r\n\r\n function EditBtnClicked() {\r\n $scope.$broadcast(\"biEditReport\");\r\n }\r\n\r\n function FullUIBtnClicked() {\r\n $scope.$broadcast(\"biLoadFullUI\");\r\n }\r\n\r\n function ParameterChanged(param) {\r\n\r\n }\r\n\r\n function paramType(databaseName, dropDowns, typeAheadFields) {\r\n if (dropDowns.includes(databaseName)) return \"isDropDown\";\r\n if (typeAheadFields.includes(databaseName)) return \"isTypeAheadField\";\r\n return databaseName;\r\n }\r\n\r\n function getReportParams() {\r\n \r\n reportParams = {};\r\n\r\n lodash.forEach(rvm.report.LegacyReport.ReportParams, function (param) {\r\n //Formatting for all values that need special display values\r\n var paramValue = null;\r\n if (param.DatabaseName in rvm.report.paramValues)\r\n paramValue = rvm.report.paramValues[param.DatabaseName];\r\n \r\n switch (param.DatabaseName) {\r\n case '@StartDate':\r\n if (param.ReportParamDataTypeId == 4) { //This is \"Date\"\r\n var biParam = getBIParam(\"Date\");\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: moment(biParam.CustomStartDate).utc(true), DisplayValue: biParam.CustomStartDate };\r\n }\r\n else {\r\n var biParam = getBIParam(\"Date Range\");\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: moment(biParam.CustomStartDate).utc(true), DisplayValue: biParam.CustomStartDate };\r\n }\r\n break;\r\n case '@EndDate': \r\n var biParam = getBIParam(\"Date Range\");\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: moment(biParam.CustomEndDate).utc(true), DisplayValue: biParam.CustomEndDate };\r\n break; \r\n\r\n case '@StatusId':\r\n var biParam = getBIParam(\"Status\");\r\n var selectedValue = biParam.SelectedValue;\r\n var displayValue = \"\";\r\n if (selectedValue == \"All\") {\r\n selectedValue = \"0\"\r\n }\r\n angular.forEach(biParam.Options, function (param) {\r\n if (param.Value == biParam.SelectedValue) {\r\n displayValue = param.Name;\r\n }\r\n });\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: displayValue };\r\n break;\r\n case '@ServiceLevel':\r\n var biParam = getBIParam(\"Service Level\");\r\n var selectedValue = biParam.SelectedValue;\r\n if (selectedValue == \"All\") {\r\n selectedValue = \"0\"\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break;\r\n case '@Programs':\r\n var biParam = getBIParam(\"Programs\"); \r\n var selectedValues = [];\r\n var selectedValuesDisplay = null;\r\n angular.forEach(biParam.Options, function (param) {\r\n selectedValues.push(param[\"Value\"]);\r\n });\r\n if (selectedValues.length > 0)\r\n selectedValuesDisplay = \"\\\"\" + selectedValues.join() + \"\\\"\" ; \r\n\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValuesDisplay, DisplayValue: selectedValuesDisplay };\r\n break;\r\n case '@ProgramGroups':\r\n var biParam = getBIParam(\"Program Groups\"); \r\n var selectedValues = [];\r\n var selectedValuesDisplay = null;\r\n angular.forEach(biParam.Options, function (param) {\r\n selectedValues.push(param[\"Value\"]);\r\n });\r\n if (selectedValues.length > 0)\r\n selectedValuesDisplay = \"\\\"\" + selectedValues.join() + \"\\\"\" ; \r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValuesDisplay, DisplayValue: selectedValuesDisplay };\r\n break; \r\n case '@AlertClass':\r\n var biParam = getBIParam(\"Alert Class\"); \r\n var selectedValues = [];\r\n var selectedValuesDisplay = null; \r\n angular.forEach(biParam.Options, function (param) { \r\n if(param[\"selected\"]== true)\r\n selectedValues.push(param[\"Value\"]);\r\n });\r\n if (selectedValues.length > 0)\r\n selectedValuesDisplay = \"\\\"\" + selectedValues.join() + \"\\\"\";\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValuesDisplay, DisplayValue: selectedValuesDisplay };\r\n break;\r\n case '@AlertLevel':\r\n var biParam = getBIParam(\"Alert Level\");\r\n var selectedValues = [];\r\n var selectedValuesDisplay = null;\r\n angular.forEach(biParam.Options, function (param) {\r\n if (param[\"selected\"] == true)\r\n selectedValues.push(param[\"Value\"]);\r\n });\r\n if (selectedValues.length > 0)\r\n selectedValuesDisplay = \"\\\"\" + selectedValues.join() + \"\\\"\";\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValuesDisplay, DisplayValue: selectedValuesDisplay };\r\n break;\r\n case '@AlertType':\r\n var biParam = getBIParam(\"Alert Type\");\r\n var selectedValues = [];\r\n var selectedValuesDisplay = null;\r\n angular.forEach(biParam.Options, function (param) {\r\n selectedValues.push(param[\"Value\"]);\r\n });\r\n if (selectedValues.length > 0)\r\n selectedValuesDisplay = \"\\\"\" + selectedValues.join() + \"\\\"\";\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValuesDisplay, DisplayValue: selectedValuesDisplay };\r\n break;\r\n case '@SurveyQuestionTypeId':\r\n var biParam = getBIParam(\"Biometric\");\r\n var selectedValue = biParam.SelectedValue;\r\n if (selectedValue == \"All\") {\r\n selectedValue = \"0\"\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break;\r\n \r\n case '@SkipBiometricReasonId':\r\n var biParam = getBIParam(\"Skip Reason\");\r\n var selectedValue = biParam.SelectedValue;\r\n if (selectedValue == \"All\") {\r\n selectedValue = \"0\"\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break; \r\n case '@StatusReasonId':\r\n var biParam = getBIParam(\"Status Reason\");\r\n var selectedValue = biParam.SelectedValue;\r\n if (selectedValue == \"All\") {\r\n selectedValue = \"0\"\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break; \r\n case '@PatientId': \r\n if (param.Label == 'Time Log Patient') {\r\n var patientId = null\r\n if (rvm.PatientTimeLogPatientId == \"\" || rvm.PatientTimeLogPatientId == null) {\r\n rvm.PatientTimeLogPatientId = patientId\r\n }\r\n else{\r\n patientId = rvm.PatientTimeLogPatientId.data;\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: patientId, DisplayValue: patientId };\r\n break;\r\n }\r\n else {\r\n var biParam = getBIParam(\"Patient\");\r\n if (biParam != undefined) {\r\n var selectedValue = biParam.SelectedValue;\r\n if (selectedValue == \"All\") {\r\n selectedValue = \"0\"\r\n }\r\n else if (selectedValue != undefined && selectedValue != \"\") {\r\n selectedValue = biParam.SelectedValue.data;\r\n }\r\n else {\r\n selectedValue = null;\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break;\r\n }\r\n }\r\n \r\n case '@CaregiverId':\r\n var biParam = getBIParam(\"Care Team Member\");\r\n if (biParam != undefined) {\r\n var selectedValue = biParam.SelectedValue;\r\n if (selectedValue == \"All\") {\r\n selectedValue = \"0\"\r\n }\r\n else if (selectedValue != undefined && selectedValue != \"\") {\r\n selectedValue = biParam.SelectedValue.data;\r\n }\r\n else {\r\n selectedValue = null;\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break;\r\n }\r\n case '@Month':\r\n var biParam = getBIParam(\"Month\");\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: moment(biParam.CustomStartDate).utc(true), DisplayValue: biParam.CustomStartDate };\r\n break;\r\n case '@PatientType':\r\n var biParam = getBIParam(\"Patient Time Log Type\");\r\n var selectedValue = biParam.SelectedValue;\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break;\r\n case '@Hospitals':\r\n var biParam = getBIParamByExagoParam(\"Hospitals\");\r\n var selectedValues = [];\r\n var selectedValuesDisplay = null;\r\n angular.forEach(biParam.Options, function (param) {\r\n selectedValues.push(param[\"Value\"]);\r\n });\r\n if (selectedValues.length > 0)\r\n selectedValuesDisplay = selectedValues.join();\r\n else\r\n selectedValuesDisplay = '';\r\n\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValuesDisplay, DisplayValue: selectedValuesDisplay };\r\n break;\r\n case '@PatientTimeType':\r\n var biParam = getBIParam(\"Patient Time Type\");\r\n var selectedValue = biParam.SelectedValue; \r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break;\r\n case '@AdditionalTime':\r\n var biParam = getBIParam(\"Additional Time\");\r\n var additionalTime = \"0\";\r\n if (rvm.PatientTimeLogAdditionalTime == \"\" || rvm.PatientTimeLogAdditionalTime == null) {\r\n rvm.PatientTimeLogAdditionalTime = additionalTime\r\n }\r\n else {\r\n additionalTime = rvm.PatientTimeLogAdditionalTime;\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: additionalTime, DisplayValue: additionalTime };\r\n break; \r\n case '@InvitationStatusId':\r\n var biParam = getBIParam(\"Invitation Status\");\r\n var selectedValue = biParam.SelectedValue;\r\n if (selectedValue == \"All\") {\r\n selectedValue = \"0\"\r\n }\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: selectedValue, DisplayValue: selectedValue };\r\n break;\r\n \r\n \r\n }\r\n });\r\n\r\n return reportParams;\r\n }\r\n\r\n function StatusChanged(container, executionStatusEnum) {\r\n rvm.executionStatus = executionStatusEnum;\r\n switch (executionStatusEnum) {\r\n case rvm.executionStatusEnum.Refreshing:\r\n case rvm.executionStatusEnum.Starting:\r\n case rvm.executionStatusEnum.Visualizing:\r\n {\r\n rvm.isReportRunning = true;\r\n break;\r\n }\r\n case rvm.executionStatusEnum.Unknown:\r\n case rvm.executionStatusEnum.Initializing:\r\n case rvm.executionStatusEnum.Executing:\r\n case rvm.executionStatusEnum.Complete:\r\n case rvm.executionStatusEnum.Error:\r\n default:\r\n {\r\n rvm.isReportRunning = false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n \r\n}\r\n\r\nangular.module(\"reports\").controller(\"ReportController\", Report);\r\n","function ReportRdlTypeDirective() {\r\n\r\n function controller($scope, $transitions, lodash, moment, ReportsService, $window, vhSweetAlert, PermissionService, $uibModal, $http, ConfigurationsService, $state, $timeout, BIService) {\r\n\r\n $scope.reportHasParam = reportHasParam;\r\n $scope.updateDates = updateDates;\r\n $scope.openStartCalendar = openStartCalendar;\r\n $scope.openEndCalendar = openEndCalendar;\r\n $scope.getKits = getKits;\r\n $scope.getParam = getParam;\r\n $scope.autoSelectSubOption = autoSelectSubOption;\r\n $scope.getRelativeDateOptions = getRelativeDateOptions;\r\n $scope.patientTypeaheadData = [];\r\n $scope.caregiverTypeaheadData = [];\r\n $scope.kitTypeaheadData = [];\r\n $scope.openReport = openReport;\r\n $scope.userHasPermission = userHasPermission;\r\n $scope.calendarChanged = calendarChanged;\r\n $scope.validatePatient = validatePatient;\r\n $scope.canExport = canExport;\r\n $scope.canPreview = canPreview;\r\n $scope.exportReport = exportReport;\r\n $scope.executeReport = executeReport;\r\n $scope.isExagoReport = isExagoReport;\r\n $scope.canWriteNotes = PermissionService.userHasPermission([\"PatientChartNotesWrite\"]);\r\n $scope.dateFormat = ConfigurationsService.configParams.DateFormat;\r\n $scope.getPatientTypeaheadData = getPatientTypeaheadData;\r\n $scope.getCaregiverTypeaheadData = getCaregiverTypeaheadData;\r\n\r\n // exago reports\r\n var ExagoState = { ParameterEntry: 1, ExecutionStart: 2, InitialContentLoad: 3, ReportError: 4 }\r\n var ReportType = { SsrsExcel: 1, PatientTimeLog: 2, UsageMonitor: 3, Unknown: 4, PatientSummary: 5, ExagoReport: 100, ExagoDashboard: 200 }\r\n\r\n $scope.api = null;\r\n $scope.showExagoReport = showExagoReport;\r\n $scope.exagoContainer = document.querySelector('#ExagoWindow');\r\n $scope.exagoState = ExagoState.ParameterEntry;\r\n $scope.hasAdvancedWrite = PermissionService.userHasPermission([\"SecurityAccessLevelAdvancedWrite\"]);\r\n $scope.editReport = editReport;\r\n $scope.loadFullUI = loadFullUI;\r\n\r\n initializeController();\r\n\r\n function sortOptionsByName(a,b){\r\n if(a.Name < b.Name) {\r\n return -1;\r\n }\r\n if(a.Name > b.Name) {\r\n return 1;\r\n }\r\n return 0; \r\n }\r\n\r\n function initializeExago() {\r\n if (isExagoReport()) {\r\n $timeout(function () {\r\n\r\n // destroy API session\r\n $scope.$on(\"$destroy\", function () {\r\n if ($scope.api) {\r\n $scope.api.DisposeContainerContent($scope.exagoContainer);\r\n }\r\n });\r\n\r\n // prevent navigation during report execution\r\n $scope.$on('$locationChangeStart', function (event, next, current) {\r\n if ($scope.exagoState === ExagoState.ExecutionStart) {\r\n event.preventDefault();\r\n }\r\n });\r\n\r\n $transitions.onStart({}, (trans) => {\r\n if ($scope.exagoState === ExagoState.ExecutionStart) {\r\n return false;\r\n }\r\n });\r\n\r\n }, 10);\r\n }\r\n }\r\n\r\n function initializeController() {\r\n initializeExago();\r\n if (reportHasParam('@Sections')) {\r\n ConfigurationsService.getConfig().then(function (data) {\r\n var sectionParamOptions = getParam('@Sections').ReportParamOption;\r\n $scope.report.paramValues['@Sections'] = lodash.find(sectionParamOptions, {Name: data.DefaultPatientSummaryReportSections});\r\n });\r\n }\r\n\r\n $scope.report.paramValues = {};\r\n\r\n //Initialize dropdowns with default values\r\n if (reportHasParam('@NoteRange')) {\r\n $scope.report.paramValues['@NoteRange'] = getParam('@NoteRange').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@StatusId')) {\r\n $scope.report.paramValues['@StatusId'] = getParam('@StatusId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@StatusReasonId')) {\r\n $scope.report.paramValues['@StatusReasonId'] = $scope.report.paramValues['@StatusId'].ParamOptionSubOptions[0];\r\n }\r\n if (reportHasParam('@SurveyQuestionTypeId')) {\r\n $scope.report.paramValues['@SurveyQuestionTypeId'] = getParam('@SurveyQuestionTypeId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@SkipBiometricReasonId')) {\r\n $scope.report.paramValues['@SkipBiometricReasonId'] = $scope.report.paramValues['@SurveyQuestionTypeId'].ParamOptionSubOptions[0];\r\n }\r\n if (reportHasParam('@ServiceLevel')) {\r\n $scope.report.paramValues['@ServiceLevel'] = getParam('@ServiceLevel').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@HospitalId')) {\r\n $scope.report.paramValues['@HospitalId'] = getParam('@HospitalId').ReportParamOption[0];\r\n }\r\n if (reportHasParam('@HospitalIds')) {\r\n lodash.forEach(getParam('@HospitalIds').ReportParamOption, function (paramOption) {\r\n paramOption.selected = true;\r\n });\r\n }\r\n if (reportHasParam('@ActionType')) {\r\n $scope.report.paramValues['@ActionType'] = getParam('@ActionType').ReportParamOption.sort(sortOptionsByName)[0];\r\n }\r\n if (reportHasParam('@InvitationStatusId')) {\r\n $scope.report.paramValues['@InvitationStatusId'] = getParam('@InvitationStatusId').ReportParamOption[0];\r\n }\r\n\r\n if (reportHasParam('@PrePost')) {\r\n $scope.report.paramValues['@PrePost'] = getParam('@PrePost').ReportParamOption[0];\r\n }\r\n // this is sub-optimal \r\n if ($scope.report.Name == 'Program Compliance' || $scope.report.Name == 'Patient Compliance Data Dump') {\r\n $scope.dateOptions = {\r\n showWeeks: false,\r\n maxDate: moment().subtract(1, 'day').toDate()\r\n };\r\n } else {\r\n $scope.dateOptions = {\r\n showWeeks: false,\r\n maxDate: new Date()\r\n };\r\n }\r\n\r\n //If last report is still running, start timeout to keep checking status\r\n if ($scope.report.ReportInstances.length > 0 && $scope.report.ReportInstances[0].Status === 0) {\r\n handleReportRunning($scope.report.ReportTypeId);\r\n }\r\n\r\n // Only start date so default to yesterday\r\n if (reportHasParam('@StartDate') && !reportHasParam('@EndDate')) {\r\n $scope.report.relativeDate = \"Yesterday\";\r\n } else {\r\n $scope.report.relativeDate = \"Last Calendar Month\";\r\n }\r\n\r\n updateDates();\r\n }\r\n\r\n function handleReportRunning(reportTypeId) {\r\n // If an exago retport is still running, update the status to error\r\n if (isExagoReport() == true && $scope.report.ReportInstances[0].Status == ReportsService.ReportInstanceStatus.Running) {\r\n $scope.report.ReportInstances[0].Status = ReportsService.ReportInstanceStatus.Error;\r\n ReportsService.updateReportInstance($scope.report.ReportInstances[0]);\r\n } else {\r\n //Do not continue polling for report if user navigates to different page or report\r\n if ($state && $state.current.name === 'reports.folder.report' && $scope.report.ReportTypeId && $scope.report.ReportTypeId === reportTypeId) {\r\n getReportStatus($scope.report.ReportInstances[0].ReportGUID).then(function (data) {\r\n if (data === 0) {\r\n var t = setTimeout(function () {\r\n handleReportRunning(reportTypeId);\r\n }, 5000);\r\n } else if (data < 0) {\r\n $scope.report.ReportInstances[0].Status = data;\r\n } else if (data === 1 && canPreview()) {\r\n $scope.report.ReportInstances[0].Status = data;\r\n openReport($scope.report.ReportInstances[0].ReportGUID);\r\n } else if (data === 1 && !canPreview()) {\r\n $scope.report.ReportInstances[0].Status = data;\r\n exportReport($scope.report.ReportInstances[0].ReportGUID);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n function userHasPermission() {\r\n var hasPermission = false;\r\n hasPermission = PermissionService.userHasPermission([report.SecurityActivityId]);\r\n return hasPermission;\r\n }\r\n\r\n function reportHasParam(databaseName) {\r\n var param = getParam(databaseName);\r\n if (param) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n function getParam(databaseName) {\r\n var param = lodash.find($scope.report.ReportParams, function (o) {\r\n return o.DatabaseName == databaseName;\r\n });\r\n\r\n\r\n if (param) {\r\n return param;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n function getParamOption(param, name) {\r\n var paramOption = lodash.find(param.ReportParamOption, function (o) {\r\n return o.Name == name;\r\n });\r\n\r\n if (paramOption) {\r\n return paramOption;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n function getRelativeDateOptions() {\r\n var relativeDateOptions = [\r\n \"Yesterday\",\r\n \"This Calendar Week\",\r\n \"Last Calendar Week\",\r\n \"Last Two Calendar Weeks\",\r\n \"Last Calendar Month\",\r\n \"This Calendar Year\",\r\n \"Last Calendar Year\"\r\n ];\r\n\r\n // no end date\r\n if (lodash.findIndex($scope.report.ReportParams, function (o) {\r\n return o.DatabaseName == '@EndDate';\r\n }) < 0) relativeDateOptions = [ \"Yesterday\" ];\r\n\r\n if ($scope.report.Name == 'Program Compliance'|| $scope.report.Name == 'Patient Compliance Data Dump') {\r\n return relativeDateOptions;\r\n } else {\r\n relativeDateOptions.unshift(\"Today\");\r\n return relativeDateOptions;\r\n }\r\n }\r\n\r\n function autoSelectSubOption(parentParam, childParam) {\r\n $scope.report.paramValues[childParam] = $scope.report.paramValues[parentParam].ParamOptionSubOptions[0];\r\n }\r\n\r\n function updateDates() {\r\n if ($scope.report.relativeDate === \"Today\") {\r\n $scope.report.paramValues['@StartDate'] = moment().startOf('day').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().endOf('day').toDate();\r\n } else if ($scope.report.relativeDate === \"Yesterday\") {\r\n $scope.report.paramValues['@StartDate'] = moment().subtract('1', 'day').startOf('day').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().subtract('1', 'day').endOf('day').toDate();\r\n } else if ($scope.report.relativeDate === \"This Calendar Week\" && $scope.report.Name == 'Program Compliance') {\r\n $scope.report.paramValues['@StartDate'] = moment().startOf('week').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().subtract('1', 'day').toDate();\r\n } else if ($scope.report.relativeDate === \"This Calendar Week\") {\r\n $scope.report.paramValues['@StartDate'] = moment().startOf('week').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().endOf('day').toDate();\r\n } else if ($scope.report.relativeDate === \"Last Calendar Week\") {\r\n $scope.report.paramValues['@StartDate'] = moment().subtract('1', 'weeks').startOf('week').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().subtract('1', 'weeks').endOf('week').toDate();\r\n } else if ($scope.report.relativeDate === \"Last Two Calendar Weeks\") {\r\n $scope.report.paramValues['@StartDate'] = moment().subtract('2', 'weeks').startOf('week').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().subtract('1', 'weeks').endOf('week').toDate();\r\n } else if ($scope.report.relativeDate === \"Last Calendar Month\") {\r\n $scope.report.paramValues['@StartDate'] = moment().subtract('1', 'months').startOf('month').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().subtract('1', 'months').endOf('month').toDate();\r\n } else if ($scope.report.relativeDate === \"This Calendar Year\" && $scope.report.Name == 'Program Compliance') {\r\n $scope.report.paramValues['@StartDate'] = moment().startOf('year').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().subtract('1', 'day').toDate();\r\n } else if ($scope.report.relativeDate === \"This Calendar Year\") {\r\n $scope.report.paramValues['@StartDate'] = moment().startOf('year').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().endOf('day').toDate();\r\n } else if ($scope.report.relativeDate === \"Last Calendar Year\") {\r\n $scope.report.paramValues['@StartDate'] = moment().subtract('1', 'years').startOf('year').toDate();\r\n $scope.report.paramValues['@EndDate'] = moment().subtract('1', 'years').endOf('year').toDate();\r\n }\r\n }\r\n\r\n function openStartCalendar($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n $scope.report.startCalendarOpened = true;\r\n $scope.report.endCalendarOpened = false;\r\n }\r\n\r\n function openEndCalendar($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n $scope.report.endCalendarOpened = true;\r\n $scope.report.startCalendarOpened = false;\r\n }\r\n\r\n function calendarChanged() {\r\n //Reset relative date dropdown if a custom date-range is selected\r\n if ($scope.report.startCalendarOpened || $scope.report.endCalendarOpened) {\r\n $scope.report.relativeDate = '';\r\n }\r\n }\r\n\r\n function canExport() {\r\n return $scope.report.CanExport;\r\n }\r\n\r\n function canPreview() {\r\n return $scope.report.CanPreview;\r\n }\r\n\r\n function getPatients(val) {\r\n return ReportsService.getTypeAheadPatient(val).then(function (data) {\r\n return data.slice(0, 8);\r\n });\r\n }\r\n\r\n function getKits(val) {\r\n val = val || '';\r\n if(val.length > 0) {\r\n return ReportsService.getTypeAheadKitByNumber(val).then(function (data) {\r\n $scope.kitTypeaheadData = data;\r\n return data;\r\n });\r\n }\r\n }\r\n\r\n function executeReport(exportFormat) {\r\n\r\n $scope.exagoState = ExagoState.ParameterEntry;\r\n\r\n //Validate report, make sure it's all filled in correctly\r\n if (!validateReport()) {\r\n if ($scope.report.errorMessage.length > 0) {\r\n vhSweetAlert.error({\r\n title: 'Error',\r\n text: $scope.report.errorMessage,\r\n html: true,\r\n });\r\n }\r\n return;\r\n }\r\n\r\n //Ensure we get all responses in the days selected\r\n if ($scope.report.paramValues['@StartDate'] && $scope.report.paramValues['@EndDate']) {\r\n $scope.report.paramValues['@StartDate'] = moment($scope.report.paramValues['@StartDate']).startOf('day').format(\"YYYY-MM-DDTHH:mm:ss\");\r\n $scope.report.paramValues['@EndDate'] = moment($scope.report.paramValues['@EndDate']).endOf('day').format(\"YYYY-MM-DDTHH:mm:ss\");\r\n }\r\n\r\n //If save patient note was never touched for Patient Summary reprot, it won't exist. Need to create it with a value of false\r\n if ($scope.report.TypeEnum == ReportType.PatientSummary && !('@SavePatientNote' in $scope.report.paramValues)) {\r\n $scope.report.paramValues['@SavePatientNote'] = 0;\r\n }\r\n\r\n var reportParams = getReportParams();\r\n if (isExagoReport()) {\r\n if (exportFormat) {\r\n executeExagoReport(exportFormat, reportParams);\r\n } else {\r\n executeExagoReport(\"html\", reportParams);\r\n }\r\n \r\n return;\r\n }\r\n\r\n reportExecRequest = {};\r\n reportExecRequest.ReportTypeId = $scope.report.ReportTypeId;\r\n\r\n // Parameter Value and DisplayValue\r\n angular.forEach(reportParams, function (param) {\r\n delete param.ReportParam;\r\n });\r\n reportExecRequest.ReportParams = JSON.stringify(reportParams);\r\n\r\n //Post report\r\n $scope.report.ReportInstances.unshift({ CreatedDateTime_UTC: new Date(), Status: 0 });\r\n return ReportsService.doReport(reportExecRequest).then(function (data) {\r\n $scope.report.ReportInstances[0].ReportGUID = data;\r\n handleReportRunning($scope.report.ReportTypeId);\r\n return data;\r\n });\r\n }\r\n\r\n function paramType(databaseName, dropDowns, typeAheadFields)\r\n {\r\n if (dropDowns.includes(databaseName)) return \"isDropDown\";\r\n if (typeAheadFields.includes(databaseName)) return \"isTypeAheadField\";\r\n return databaseName;\r\n }\r\n\r\n function getReportParams() {\r\n //Some dropdowns use the value, while other dropdowns pass the name as the value. These dropdowns use the value\r\n var dropDowns = ['@StatusId', '@StatusReasonId', '@SurveyQuestionTypeId', '@SkipBiometricReasonId', '@InvitationStatusId', '@HospitalId'];\r\n var typeAheadFields = ['@PatientId', '@CaregiverId', '@KitId'];\r\n\r\n reportParams = {};\r\n\r\n lodash.forEach($scope.report.ReportParams, function (param) {\r\n //Formatting for all values that need special display values\r\n var paramValue = null;\r\n if (param.DatabaseName in $scope.report.paramValues)\r\n paramValue = $scope.report.paramValues[param.DatabaseName];\r\n\r\n switch (paramType(param.DatabaseName, dropDowns, typeAheadFields)) {\r\n case \"isDropDown\":\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: paramValue.Value, DisplayValue: paramValue.Name };\r\n break;\r\n case \"isTypeAheadField\":\r\n if (param.DatabaseName in $scope.report.paramValues) {\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: paramValue.data, DisplayValue: paramValue.value };\r\n } else {\r\n var text;\r\n if (param.DatabaseName == \"@PatientId\") {\r\n text = param.IsRequired ? 'All Patients' : 'No Patient Selected';\r\n } else {\r\n text = param.IsRequired ? 'All Care Team Members' : 'No Care Team Member Selected';\r\n }\r\n\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: 0, DisplayValue: text };\r\n }\r\n break;\r\n case '@PatientNote':\r\n if (!(param.DatabaseName in $scope.report.paramValues) || paramValue.length === 0) {\r\n paramValue = '';\r\n }\r\n\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: paramValue.replace(/'/g, \"''\"), DisplayValue: \"Patient Note\" };\r\n break;\r\n case '@NoteRange':\r\n case '@ServiceLevel':\r\n case '@ActionType':\r\n case '@PrePost':\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: paramValue.Name };\r\n break;\r\n case '@SavePatientNote':\r\n if (paramValue === 0) {\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: paramValue, DisplayValue: \"False\" };\r\n } else if (paramValue == 1) {\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: paramValue, DisplayValue: \"True\" };\r\n }\r\n break;\r\n case '@HospitalIds':\r\n var hospitalParam = getParam('@HospitalIds');\r\n var displayValues = '';\r\n var values = '';\r\n lodash.forEach(hospitalParam.ReportParamOption, function (o) {\r\n if (o.selected && values.length > 0) {\r\n values = values + ', ' + o.Value;\r\n displayValues = displayValues + ', ' + o.Name;\r\n } else if (o.selected && values.length === 0) {\r\n values = values + o.Value;\r\n displayValues = displayValues + o.Name;\r\n }\r\n });\r\n if (values.length > 0) {\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: values, DisplayValue: displayValues };\r\n }\r\n break;\r\n case '@AlertClass': \r\n var alertClassParam = getParam('@AlertClass');\r\n var displayValues = '';\r\n var values = '';\r\n lodash.forEach(alertClassParam.ReportParamOption, function (o) {\r\n if (o.selected && values.length > 0) {\r\n values = values + ', ' + o.Value;\r\n displayValues = displayValues + ', ' + o.Name;\r\n } else if (o.selected && values.length === 0) {\r\n values = values + o.Value;\r\n displayValues = displayValues + o.Name;\r\n }\r\n });\r\n if (values.length > 0) {\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: values, DisplayValue: displayValues };\r\n }\r\n break;\r\n case '@Sections':\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: paramValue.Name, DisplayValue: paramValue.Name };\r\n break;\r\n default:\r\n if (param.DatabaseName in $scope.report.paramValues) {\r\n reportParams[param.ReportParamId] = { ReportParam: param, Value: paramValue, DisplayValue: paramValue };\r\n }\r\n break;\r\n }\r\n });\r\n\r\n return reportParams;\r\n }\r\n\r\n function showExagoReport() {\r\n return isExagoReport() && ($scope.exagoState >= ExagoState.ExecutionStart);\r\n }\r\n\r\n function isExagoReport() {\r\n return ($scope.report.TypeEnum == ReportType.ExagoDashboard) || ($scope.report.TypeEnum == ReportType.ExagoReport);\r\n }\r\n\r\n\r\n function executeExagoReport(exportFormat, reportParams) {\r\n // preconditions: not running, has api, report, and report path\r\n if (($scope.exagoState === ExagoState.ExecutionStart) || !$scope.report || !$scope.report.ReportPath)\r\n return;\r\n $scope.exagoState = ExagoState.ExecutionStart;\r\n\r\n reportInstanceParamModels = [];\r\n angular.forEach(reportParams, function (param) {\r\n var reportInstanceParamModel = {\r\n ReportInstanceParamId: -1,\r\n ReportInstanceId: -1,\r\n ReportParamId: param.ReportParamId,\r\n Value: param.Value,\r\n DisplayValue: param.Value,\r\n ReportParamDataTypeId: param.ReportParamDataTypeId\r\n };\r\n reportInstanceParamModels.push(reportInstanceParamModel);\r\n });\r\n\r\n var reportInstanceModel =\r\n {\r\n ReportInstanceId: -1,\r\n ReportTypeId: $scope.report.ReportTypeId,\r\n ReportPath: $scope.report.ReportPath,\r\n Status: ReportsService.ReportInstanceStatus.Running,\r\n CreatedDateTime_UTC: new Date(), // use new date, this will get seralized to utc when saved.\r\n ReportInstanceParams: reportInstanceParamModels\r\n };\r\n\r\n ReportsService.createReportInstance(reportInstanceModel).then(function (newInstance) {\r\n // set locally\r\n $scope.report.ReportInstances.unshift(newInstance);\r\n $scope.report.paramValues['@ReportInstanceId'] = $scope.report.ReportInstances[0].ReportInstanceId; // local value\r\n\r\n BIService.getExagoApi().then(function (api) {\r\n\r\n var exagoParams = BIService.getExagoParams(reportParams);\r\n var reportInstanceId = $scope.report.ReportInstances[0].ReportInstanceId; // most current instance\r\n exagoParams.push({ Name: \"ReportInstanceId\", Value: reportInstanceId, PromptText: null }); // send to back end for execution\r\n\r\n $scope.api = api;\r\n api.DisposeContainerContent($scope.exagoContainer);\r\n\r\n var reportOptions = {\r\n Udf: null,\r\n UpdateCallback: onExagoReportProgress,\r\n ErrorCallback: onExagoReportError,\r\n NewFilters: [],\r\n PromptingFilterValues: [],\r\n Parameters: exagoParams\r\n };\r\n\r\n api.ExecuteReport($scope.exagoContainer, exportFormat, $scope.report.ReportPath, reportOptions, onExagoReportProgress, onExagoReportError);\r\n // state is updated in OnExagoReportProgress/onExagoReportError\r\n }, function (reason) {\r\n $scope.exagoState = ExagoState.ReportError;\r\n $scope.report.ReportInstances[0].Status = ReportsService.ReportInstanceStatus.Error;\r\n ReportsService.updateReportInstance($scope.report.ReportInstances[0]);\r\n console.error(reason);\r\n // log reason?\r\n });\r\n }, function (reason) {\r\n $scope.exagoState = ExagoState.ReportError;\r\n console.error(reason);\r\n // log reason?\r\n });\r\n }\r\n\r\n function onExagoReportProgress(container, updateType) {\r\n var instanceStatus = ReportsService.ReportInstanceStatus.Running;\r\n switch (updateType) {\r\n case \"executionstart\":\r\n $scope.exagoState = ExagoState.ExecutionStart;\r\n break;\r\n case \"initialcontentload\":\r\n $scope.exagoState = ExagoState.InitialContentLoad;\r\n instanceStatus = ReportsService.ReportInstanceStatus.Complete;\r\n break;\r\n default:\r\n $scope.exagoState = ExagoState.ReportError;\r\n instanceStatus = ReportsService.ReportInstanceStatus.Error;\r\n console.error(updateType);\r\n break;\r\n }\r\n\r\n if (instanceStatus != ReportsService.ReportInstanceStatus.Running) {\r\n $scope.report.ReportInstances[0].Status = instanceStatus;\r\n ReportsService.updateReportInstance($scope.report.ReportInstances[0]);\r\n $scope.$apply();\r\n }\r\n }\r\n\r\n function onExagoReportError(container, errorMessage) {\r\n $scope.exagoState = ExagoState.ReportError;\r\n $scope.report.ReportInstances[0].Status = ReportsService.ReportInstanceStatus.Error;\r\n $scope.report.ReportInstances[0].ErrorMessage = errorMessage;\r\n ReportsService.updateReportInstance($scope.report.ReportInstances[0]);\r\n console.error(errorMessage);\r\n $scope.$apply();\r\n }\r\n\r\n function openReport(reportGuid) {\r\n $window.open(\"../ReportViewer.aspx?\" + reportGuid);\r\n }\r\n\r\n function getReportStatus(reportGuid) {\r\n return ReportsService.getReportStatus(reportGuid).then(function (data) {\r\n return data;\r\n });\r\n }\r\n\r\n var file = null;\r\n\r\n function exportReport(reportGuid) {\r\n $http({\r\n url: \"/api/report/ExportToExcel?reportId=\" + reportGuid,\r\n method: \"GET\",\r\n responseType: 'arraybuffer'\r\n }).then(function ({data, status, headers, config}) {\r\n\r\n if (file !== null) {\r\n $window.URL.revokeObjectURL(file);\r\n }\r\n\r\n file = new Blob([data]);\r\n\r\n var fileName = headers('Content-Disposition').split('=')[1];\r\n\r\n if ($window.navigator.msSaveBlob) {\r\n $window.navigator.msSaveBlob(file, fileName);\r\n }\r\n else {\r\n var a = document.createElement('a');\r\n a.href = $window.URL.createObjectURL(file);\r\n a.target = '_blank';\r\n a.download = fileName;\r\n a.click();\r\n }\r\n });\r\n }\r\n\r\n function getPatientTypeaheadData(val) {\r\n val = val || '';\r\n if(val.length > 0) {\r\n return ReportsService.getTypeAheadPatientByName(val).then(function(data){\r\n $scope.patientTypeaheadData = data;\r\n return data;\r\n });\r\n }\r\n }\r\n\r\n function validateReport() {\r\n var valid = true;\r\n $scope.report.errorMessage = '';\r\n lodash.forEach($scope.report.ReportParams, function (param) {\r\n //Check hospital list to ensure at least one is checked\r\n if (param.DatabaseName == '@HospitalIds') {\r\n if (lodash.findIndex(param.ReportParamOption, function (o) {\r\n return o.selected === true;\r\n }) == -1) {\r\n $scope.report.errorMessage = $scope.report.errorMessage + param.Label + \" field is required.
          \";\r\n valid = false;\r\n }\r\n } else if (param.IsRequired === true) {\r\n if (!$scope.report.paramValues || !$scope.report.paramValues[param.DatabaseName] || $scope.report.paramValues[param.DatabaseName].length === 0) {\r\n $scope.report.errorMessage = $scope.report.errorMessage + param.Label + \" field is required.
          \";\r\n valid = false;\r\n }\r\n }\r\n });\r\n\r\n //Check that start date and end date are in correct order\r\n if (lodash.findIndex($scope.report.ReportParams, function (o) {\r\n return o.DatabaseName == '@StartDate';\r\n }) >= 0 && lodash.findIndex($scope.report.ReportParams, function (o) {\r\n return o.DatabaseName == '@EndDate';\r\n }) >= 0) {\r\n if ($scope.report.paramValues && ('@StartDate' in $scope.report.paramValues) && ('@EndDate' in $scope.report.paramValues) && moment($scope.report.paramValues['@StartDate']) > moment($scope.report.paramValues['@EndDate'])) {\r\n $scope.report.errorMessage = $scope.report.errorMessage + \"Start Date cannot be greater than End Date.
          \";\r\n valid = false;\r\n }\r\n }\r\n\r\n //Check that patientId is indeed unique if they typed it in and did not select it from the typeahead list\r\n if (valid === true) {\r\n if (!validatePatient()) {\r\n valid = false;\r\n }\r\n }\r\n if (valid === true && !validateCaregiver()) {\r\n valid = false;\r\n }\r\n if (valid === true) {\r\n if (!validateKit()) {\r\n valid = false;\r\n }\r\n }\r\n return valid;\r\n }\r\n\r\n function validatePatient() {\r\n var valid = true;\r\n //Check that patientId is indeed unique if they typed it in and did not select it from the typeahead list\r\n var patientParam = lodash.find($scope.report.ReportParams, function(o){\r\n return o.DatabaseName == '@PatientId';\r\n });\r\n\r\n if(patientParam && '@PatientId' in $scope.report.paramValues && !($scope.report.paramValues['@PatientId'].data)) {\r\n var patientName = $scope.report.paramValues['@PatientId'];\r\n var patients = lodash.filter($scope.patientTypeaheadData, function (o) {\r\n var name = patientName.replace(/\\s/g, \"\").toUpperCase();\r\n var value = o.value.replace(/\\s/g, \"\").toUpperCase();\r\n return value == name;\r\n });\r\n\r\n var required = patientParam.IsRequired;\r\n\r\n if (patients.length === 0 && required) {\r\n //patient not found\r\n var errorMessage = 'Patient ' + patientName + ' not found. Please try a different name.';\r\n vhSweetAlert.error('Error', errorMessage);\r\n $scope.report.errorMessage = errorMessage;\r\n valid = false;\r\n } else if (patients.length === 0 && !required) {\r\n delete $scope.report.paramValues['@PatientId'];\r\n } else if (patients.length === 1) {\r\n //Only one was found, so use that one\r\n $scope.report.paramValues['@PatientId'] = patients[0];\r\n } else if (patients.length > 1) {\r\n //Open modal to find out which patient they want to use\r\n openPatientSelectModal(patients);\r\n valid = false;\r\n }\r\n }\r\n\r\n return valid;\r\n }\r\n\r\n function getCaregiverTypeaheadData(name) {\r\n name = name || '';\r\n if(name.length > 0) {\r\n return ReportsService.getTypeAheadCaregiverByName(name).then(function(data){\r\n $scope.caregiverTypeaheadData = data;\r\n return data;\r\n });\r\n }\r\n }\r\n\r\n function validateCaregiver() {\r\n var valid = true;\r\n\r\n var caregiverParam = lodash.find($scope.report.ReportParams, function(o){\r\n return o.DatabaseName == '@CaregiverId';\r\n });\r\n\r\n if (caregiverParam && '@CaregiverId' in $scope.report.paramValues && !($scope.report.paramValues['@CaregiverId'].data)) {\r\n var caregiverName = $scope.report.paramValues['@CaregiverId'];\r\n var caregivers = lodash.filter($scope.caregiverTypeaheadData, function (o) {\r\n var name = caregiverName.replace(/\\s/g, \"\").toUpperCase();\r\n var value = o.value.replace(/\\s/g, \"\").toUpperCase();\r\n return value == name;\r\n });\r\n\r\n var required = caregiverParam.IsRequired;\r\n\r\n if (caregivers.length === 0 && required) {\r\n var errorMessage = 'Care Team Member ' + caregiverName + ' not found. Please try a different name.';\r\n vhSweetAlert.error('Error', errorMessage);\r\n $scope.report.errorMessage = errorMessage;\r\n valid = false;\r\n } else if (caregivers.length === 0 && !required) {\r\n delete $scope.report.paramValues['@CaregiverId'];\r\n } else if (caregivers.length == 1) {\r\n $scope.report.paramValues['@CaregiverId'] = caregivers[0];\r\n } else if (caregivers.length > 1) {\r\n openCaregiverSelectModal(caregivers);\r\n valid = false;\r\n }\r\n }\r\n return valid;\r\n }\r\n\r\n function validateKit() {\r\n var valid = true;\r\n //Check that KitId is indeed unique if they typed it in and did not select it from the typeahead list\r\n if (lodash.findIndex($scope.report.ReportParams, function (o) {\r\n return o.DatabaseName == '@KitId';\r\n }) >= 0 && '@KitId' in $scope.report.paramValues && !($scope.report.paramValues['@KitId'].data)) {\r\n var kitId = $scope.report.paramValues['@KitId'];\r\n var kits = lodash.filter($scope.kitTypeaheadData, function (o) {\r\n return o.value.toUpperCase() == kitId.toUpperCase();\r\n });\r\n\r\n if (kits.length === 0) {\r\n //kit not found\r\n var errorMessage = 'Kit Id ' + kitId + ' not found. Please try a different Id.';\r\n vhSweetAlert.error('Error', errorMessage);\r\n $scope.report.errorMessage = errorMessage;\r\n valid = false;\r\n } else {\r\n //One or multiple were found, use first one\r\n $scope.report.paramValues['@KitId'] = kits[0];\r\n }\r\n }\r\n\r\n return valid;\r\n }\r\n\r\n function openPatientSelectModal(patients) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/reports/patientselect.modal.html',\r\n controller: 'PatientSelectController as vm',\r\n keyboard: false,\r\n resolve: {\r\n data: function () {\r\n return {\r\n report: $scope.report,\r\n patients: patients\r\n };\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (report) {\r\n }, function () {\r\n });\r\n }\r\n\r\n function openCaregiverSelectModal(caregivers) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/reports/caregiverselect.modal.html',\r\n controller: 'CaregiverSelectController as vm',\r\n keyboard: false,\r\n resolve: {\r\n data: function () {\r\n return {\r\n report: $scope.report,\r\n caregivers: caregivers\r\n };\r\n }\r\n }\r\n });\r\n modalInstance.result.then(function (report) {\r\n }, function () {\r\n });\r\n }\r\n\r\n function loadFullUI() {\r\n if (($scope.exagoState === ExagoState.ExecutionStart))\r\n return;\r\n\r\n $scope.exagoState = ExagoState.InitialContentLoad;\r\n BIService.getExagoApi([]).then(function (api) {\r\n api.DisposeContainerContent($scope.exagoContainer);\r\n api.LoadFullUI($scope.exagoContainer);\r\n });\r\n }\r\n\r\n\r\n function editReport() {\r\n if (($scope.exagoState === ExagoState.ExecutionStart) || !$scope.report || !$scope.report.ReportPath)\r\n return;\r\n\r\n $scope.exagoState = ExagoState.InitialContentLoad;\r\n BIService.getExagoApi([]).then(function (api) {\r\n api.DisposeContainerContent($scope.exagoContainer);\r\n api.EditReport($scope.exagoContainer, $scope.report.ReportPath, null, function () { console.error(errorMessage); });\r\n });\r\n }\r\n\r\n // this alllows JSON.stringify for circular structures (clientInfo)\r\n const getCircularReplacer = () => {\r\n const seen = new WeakMap();\r\n return (key, value) => {\r\n if (typeof value === \"object\" && value !== null) {\r\n if (seen.has(value)) {\r\n var valueKey = seen.get(value);\r\n return '[Duplicate] ' + seen.get(value); // return field name from already existing data\r\n }\r\n seen.set(value, key);\r\n }\r\n return value;\r\n };\r\n };\r\n\r\n // this function wraps the client-side code (see src\\modules\\dashboard\\dashboard.controller.js)\r\n $scope.OnClick_Navigate_PatientList_ByChartLabel = function (clientInfo) {\r\n if ($scope.report && $scope.report.ReportInstances && $scope.report.ReportInstances.length && $scope.report.ReportInstances.length > 0) {\r\n //var clientInfoJson = JSON.stringify(clientInfo, getCircularReplacer());\r\n var reportInstance = $scope.report.ReportInstances[0];\r\n if (reportInstance && reportInstance.ReportInstanceId) {\r\n var reportInfo;\r\n if (clientInfo.dashboardItem)\r\n reportInfo = clientInfo.dashboardItem.htmlViewer._options.ReportInfo;\r\n else\r\n reportInfo = clientInfo.contextObject._options.ReportInfo;\r\n\r\n var cellId = null;\r\n\r\n if (clientInfo.chartData && clientInfo.chartData.selectedPointId) {\r\n cellId = getCellIdFromWidget(clientInfo.reportWidgets)\r\n } else {\r\n cellId = getCellIdFromUIElement(clientInfo.uiElement)\r\n }\r\n\r\n var biClickData = {\r\n cellId: cellId,\r\n reportInstanceId: reportInstance.ReportInstanceId,\r\n reportName: reportInfo.Name,\r\n executionId: clientInfo.internal.executionId,\r\n chartLabelValue: clientInfo.chartItemDataPoint.label,\r\n chartSeriesValue: clientInfo.chartSeriesDataPoint.seriesname\r\n };\r\n\r\n // close exago toolTip\r\n // window.document.getElementById(\"fusioncharts-tooltip-element\").style.display = \"none\";\r\n\r\n // Navigate\r\n var args = [\"OnClickToPatientList\", JSON.stringify(biClickData)]\r\n NavigateToPatientList(clientInfo, biClickData, args); }\r\n }\r\n }\r\n\r\n function NavigateToPatientList(clientInfo, biClickData, args) {\r\n // Use server-side action event (clientInfo.ServerCallback doesn't work)\r\n var eventName = args[0]\r\n , actionArgs = JSON.stringify({\r\n EventName: eventName,\r\n ExecutionId: clientInfo.internal.executionId,\r\n ReportData: clientInfo.includeReportData ? clientInfo.internal.reportData : null,\r\n ReportName: clientInfo.internal.reportName,\r\n ReportType: clientInfo.internal.reportType,\r\n ReportSaveDataJson: clientInfo.includeReportSaveData && null != clientInfo.internal.reportSaveData ? JSON.stringify(clientInfo.internal.reportSaveData) : null,\r\n UdfData: clientInfo.internal.udfData,\r\n ExportType: clientInfo.internal.exportType\r\n })\r\n , userArgs = Utilities.GetActionArguments(args, 1)\r\n , thisObj = biClickData;\r\n Utilities.AjaxRequest(\"Callbacks.Core.ExecuteAction\", actionArgs, userArgs,\r\n function (response) {\r\n thisObj.patientIds = response.value.UserResponse;\r\n $state.go(\"patients.list\", { filterBy: 'biClick', value: thisObj }, { reload: true });\r\n },\r\n function (response) {\r\n }\r\n );\r\n }\r\n\r\n function getCellIdFromUIElement(uiElement) {\r\n var cellId = null;\r\n if (uiElement) {\r\n var tableDataElement = uiElement.closest(\"td\");\r\n if (tableDataElement) {\r\n cellId = tableDataElement.getAttribute(\"data-id\");\r\n }\r\n }\r\n return cellId;\r\n }\r\n\r\n function getCellIdFromWidget(reportWidgets) {\r\n var cellId = null;\r\n\r\n if (reportWidgets) {\r\n for (var widgetId in reportWidgets) {\r\n if (widgetId) {\r\n var widget = reportWidgets[widgetId];\r\n if (widget.chartData && widget.chartData.selectedPointId && widget.chartContainer) {\r\n cellId = getCellIdFromUIElement(widget.chartContainer);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return cellId;\r\n }\r\n\r\n // this function wraps the client-side code\r\n //$scope.OnClickByCrossTab = function (reportInstanceId, clientInfo, window) {\r\n // var scrapedHtmlData = GetRowColHeaderValue(clientInfo, window);\r\n // var biClickData = {\r\n // reportInstanceId: reportInstanceId,\r\n // reportName: clientInfo.dashboardItem.htmlViewer._options.ReportInfo.Name,\r\n // crossTabRowValue: scrapedHtmlData[0],\r\n // crossTabColumnValue: scrapedHtmlData[1]\r\n // };\r\n // var biClickDataJson = JSON.stringify(biClickData);\r\n\r\n // $state.go(\"patients.list\", { filterBy: 'biClick', value: biClickDataJson }, { reload: true });\r\n //}\r\n\r\n function GetRowColHeaderValue(clientInfo, window) {\r\n // header row (one line below button)\r\n var tr = clientInfo.uiElement;\r\n while (tr !== null && tr.tagName != 'TR')\r\n tr = tr.parentNode;\r\n var headerRowIndex = tr.rowIndex + 1;\r\n\r\n // cell\r\n var selection = window.getSelection();\r\n if (selection === null) {\r\n window.alert(\"Please highlight the text in a cell\");\r\n return;\r\n }\r\n var td = selection.anchorNode; // start of selection\r\n while (td !== null && td.tagName != 'TD')\r\n td = td.parentNode;\r\n if (td === null) {\r\n window.alert(\"Please highlight the text in a cell\");\r\n return;\r\n }\r\n var colIndex = td.cellIndex;\r\n\r\n // row\r\n var tr = td.parentNode;\r\n if (tr.rowIndex <= headerRowIndex) {\r\n window.alert(\"Please highlight the text in a cell\");\r\n return;\r\n }\r\n var rowHeader = tr.cells[0].textContent;\r\n\r\n // col\r\n if (tr.cells[0].colSpan == 2)\r\n colIndex++;\t// crossTab first column is always a colSpan of 2\r\n var tbody = tr;\r\n while (tbody.tagName != 'TBODY' && tbody !== null)\r\n tbody = tbody.parentNode;\r\n var colHeader = tbody.rows[headerRowIndex].cells[colIndex].textContent;\r\n\r\n return [rowHeader, colHeader];\r\n }\r\n\r\n\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n templateUrl: 'modules/reports/report.rdl.tpl.html'\r\n };\r\n}\r\n\r\nangular.module('reports').directive('reportRdlType', ReportRdlTypeDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/report.rdl.tpl.html',\n '
          {{hospital.Name}}
           
           
           
          0\">Last run on {{report.ReportInstances[0].CreatedDateTime_UTC | datetime : \"datetime\"}}
          0\">Report Running...
          0\">Error running report...
          0\">{{report.PhiWarningText}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/report.tpl.html',\n '
          {{rvm.report.DisplayName}}
          {{rvm.report.DisplayName}}

          (Unpublished)

          {{rvm.errorMessage}}
          Last run on {{rvm.lastRunDate | datetime : \"datetime\"}} Report Running... Error running report...
          {{rvm.PhiWarningText}}
          ');\n}]);\n}(window, document, window.angular));","function ReportTypeDirective($compile) {\r\n\r\n function getTemplate(typeEnum) {\r\n // typeEnum 1, 4, 5 all use report-rdl-type\r\n var retVal = '';\r\n if(typeEnum == 2) {\r\n retVal = '';\r\n } else if (typeEnum == 3) {\r\n retVal = '';\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function link(scope, element, attrs) {\r\n element.html(getTemplate(scope.report.TypeEnum));\r\n $compile(element.contents())(scope);\r\n }\r\n\r\n return {\r\n restrict: 'E',\r\n replace: true,\r\n link: link,\r\n scope: {\r\n report: '=',\r\n }\r\n };\r\n}\r\n\r\nangular.module('reports').directive('reportType', ReportTypeDirective);\r\n","function ReportHeaderDirective() {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n reportHeaderInfo: \"=\"\r\n },\r\n templateUrl: \"modules/reports/reportheader.tpl.html\",\r\n link: function (scope, elem, attr) {\r\n\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"reportHeader\", ReportHeaderDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/reportheader.tpl.html',\n '
          {{reportHeaderInfo.reportName}}
          {{reportHeaderInfo.infoLineOne}}
          {{reportHeaderInfo.infoLineTwo}}
          ');\n}]);\n}(window, document, window.angular));","function ReportsService($http, $q, $window, $filter, PermissionService) {\r\n return {\r\n\r\n ReportInstanceStatus: { Running: 0, Complete: 1, Error: -1, InvalidInstance: -3 },\r\n\r\n getBiometrics: function () {\r\n return $http.get(\"/api/BiometricMeasurementType/Graphable\").then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getHealthSummaryReport: function (patientId) {\r\n return $http.get(\"/api/cgp/report/healthsummary/\" + patientId).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n generateParamaters: function(monthOffset, patient, isClinical) {\r\n let params = '';\r\n\r\n // Set month\r\n params += 'monthOffset=' + monthOffset;\r\n\r\n // Set Patient Time Type\r\n if (isClinical.value === 'Clinical') {\r\n params += '&isClinical=true';\r\n } else if (isClinical.value === 'Non-Clinical') {\r\n params += '&isClinical=false';\r\n } // All is null\r\n\r\n if (patient.type === 'Single' && patient.value && patient.value.data && patient.value.data.length > 0) {\r\n params += '&patientId=' + patient.value.data;\r\n } else if (patient.type.indexOf('Over 20 Min') !== -1) {\r\n params += '&isBillable='+ true;\r\n } else if (patient.type.indexOf('Over 60 Min') !== -1) {\r\n params += '&isBillable=' + true;\r\n params += '&additionalTime=' + (40 + patient.value); // Minutes\r\n } else if (patient.type.indexOf('Additional 30 Min') !== -1) {\r\n params += '&isBillable=' + true;\r\n params += '&additionalTime=' + 69; // Minutes\r\n } else if (patient.type.indexOf('Over 16 Days') !== -1){\r\n params += '&isBillable=' + true;\r\n params += '&minQuestionDays=' + 16; // >= 16 days\r\n }\r\n\r\n if (patient.type.indexOf('Non-CCM/RPM') !== -1) {\r\n // Not having CCM or RPM (Null or False in the database)\r\n params += '&isCCM=' + false;\r\n params += '&isRPM=' + false;\r\n } else if (patient.type.indexOf('CCM') !== -1) {\r\n // Having CCM (True in the database)\r\n params += '&isCCM=' + true;\r\n } else if (patient.type.indexOf('RPM') !== -1) {\r\n params += '&isRPM=' + true;\r\n } // else condition ALL Patients Null, True, and False\r\n\r\n return params;\r\n },\r\n\r\n getTimeLogReport: function (monthOffset, patient, isClinical) {\r\n\r\n var path = '/AngularReport/GetTimeLogReport?';\r\n path += this.generateParamaters(monthOffset, patient, isClinical);\r\n\r\n return $http.get(path,{\r\n headers: {\r\n 'If-Modified-Since': 'Mon, 26 Jul 1997 05:00:00 GMT',\r\n 'Cache-Control': 'no-cache',\r\n 'Pragma': 'no-cache'\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getUsageMonitoringReport: function(startDate, endDate) {\r\n return $http.get('/api/report/GetUsageMonitoringReport?startDate=' + $filter('date')(startDate, \"yyyy-MM-dd\") + '&endDate=' + $filter('date')(endDate, \"yyyy-MM-dd\")).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getReportHeader: function() {\r\n return $http.get('/api/cgp/report/header').then(function(response){\r\n return response.data;\r\n });\r\n },\r\n\r\n getPHIWarningText: function() {\r\n return $http.get('/api/Configuration/?param=ReportPHIWarningText').then(function(response){\r\n return response.data;\r\n });\r\n },\r\n\r\n createReportInstance: function (instance) {\r\n return $http.post(\"/api/ReportInstance\", instance).then(function (response) {\r\n return response.data;\r\n }, function (reason) {\r\n console.error(reason);\r\n return (reason);\r\n });\r\n },\r\n\r\n updateReportInstance: function (instance) {\r\n return $http.put(\"/api/ReportInstance\", instance).then(function (response) {\r\n return response.data;\r\n }, function (reason) {\r\n console.error(reason);\r\n return (reason);\r\n });\r\n },\r\n\r\n doReport: function (reportExecRequest) {\r\n return $http.post(\"/api/report\", reportExecRequest).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n runReportToExcel: function (reportExecRequest) {\r\n return $http.post(\"/api/report/RunReportToExcel\", reportExecRequest).then(function (response) {\r\n return response;\r\n });\r\n },\r\n\r\n exportToExcel: function (reportExecRequest) {\r\n return $http({\r\n url: '/api/report/ExportToExcel/' + reportExecRequest.ReportTypeId,\r\n method: 'POST',\r\n data: reportExecRequest,\r\n responseType: 'arraybuffer'\r\n }).then(function ({data, status, headers, config}) {\r\n var file = new Blob([data]);\r\n var fileName = headers('Content-Disposition').split('=')[1];\r\n var fileURL = URL.createObjectURL(file);\r\n var link = $window.document.createElement('a');\r\n link.href = fileURL;\r\n link.target = '_blank';\r\n link.download = fileName;\r\n $window.document.body.appendChild(link);\r\n link.click();\r\n\r\n\r\n });\r\n },\r\n\r\n getTypeAheadPatient: function () {\r\n return $http.get(\"/api/AutoComplete/Patient\").then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getTypeAheadCaregiver: function () {\r\n return $http.get(\"/api/AutoComplete/Caregiver\").then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getTypeAheadCaregiverByName: function(name) {\r\n return $http({\r\n url: \"/api/AutoComplete/Caregiver\",\r\n method: \"POST\",\r\n data: {\r\n param: name\r\n }\r\n })\r\n .then(function(response){\r\n return response.data;\r\n });\r\n },\r\n\r\n getReportStatus: function(reportGuid) {\r\n return $http.get(\"/api/report/status?reportId=\" + reportGuid).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n getTypeAheadPatientByName: function (searchString) {\r\n return $http.post\r\n (\r\n '/api/AutoComplete/DataSource/',\r\n {\r\n DataSource: 8, //patient\r\n SearchText: searchString\r\n }\r\n ).then(function(response){\r\n return response.data;\r\n });\r\n },\r\n\r\n getTypeAheadKit: function () {\r\n return $http.get(\"/api/AutoComplete/Kit\").then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getTypeAheadKitByNumber: function(kitNo) {\r\n return $http({\r\n url: '/api/AutoComplete/Kit',\r\n method: 'POST',\r\n data: {\r\n param: kitNo\r\n }\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getReport: function(id) {\r\n if (PermissionService.userHasPermission([\"ReportsRead\"])) {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/report/ExagoReport/' + id\r\n }).then(function (response) {\r\n var reportx = response.data;\r\n return reportx;\r\n });\r\n } else {\r\n return $q(function (resolve, reject) {\r\n resolve(null);\r\n });\r\n }\r\n }\r\n\r\n\r\n };\r\n}\r\n\r\nangular.module(\"reports\").factory(\"ReportsService\", ReportsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/reports.tpl.html',\n '

          Self-Service Report Management

          Published Reports {{publishedReports.length}}
          No published reports.
          No results returned.

          Unpublished Reports {{unpublishedReports.length}}

          No unpublished reports.

          {{rvm.selectedReport.Name}}
          ');\n}]);\n}(window, document, window.angular));","function ReportSectionsDirective($compile, lodash) {\r\n return {\r\n restrict: \"E\",\r\n scope: {\r\n sectionData: \"=\"\r\n },\r\n link: function (scope, elem, attr) {\r\n var sections = scope.sectionData.reportSections;\r\n sections = lodash.sortBy(sections, function(o) { return o.SortOrder; });\r\n elem.empty();\r\n var elementString = [];\r\n\r\n lodash.forEach(sections, function(section) {\r\n elementString.push(getDirective(section.SectionName));\r\n });\r\n\r\n elem.append(elementString.join(\"\"));\r\n $compile(elem.contents())(scope);\r\n\r\n function getDirective(sectionType) {\r\n var directiveHtml;\r\n if (sectionType === \"BiometricsGraphs\") {\r\n directiveHtml = '';\r\n } else if (sectionType === \"BiometricsGrid\") {\r\n directiveHtml = '';\r\n } else if (sectionType === \"Responses\") {\r\n directiveHtml = '';\r\n } else if (sectionType === \"Notes\") {\r\n directiveHtml = '';\r\n } else if (sectionType === \"Medications\") {\r\n directiveHtml = '';\r\n }\r\n return directiveHtml;\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"reports\").directive(\"reportSections\", ReportSectionsDirective);\r\n","function PatientResponsesDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/reports/responses/responses.tpl.html\",\r\n scope: {\r\n patientResponses: \"=\"\r\n },\r\n link: function (scope, elem, attr) {},\r\n controller: function ($scope) {\r\n $scope.patientResponseData = lodash($scope.patientResponses)\r\n .reverse()\r\n .groupBy(function(response) {\r\n return response.ObservationDate.substring(0,10);\r\n })\r\n .value();\r\n }\r\n };\r\n}\r\n\r\nfunction ToArray(lodash) {\r\n return function(obj) {\r\n if (!(obj instanceof Object)) return obj;\r\n return lodash.map(obj, function(val, key) {\r\n return Object.defineProperty(val, '$key', {__proto__: null, value: key});\r\n });\r\n };\r\n}\r\n\r\nangular.module(\"reports\")\r\n .directive(\"responses\", PatientResponsesDirective)\r\n .filter('toArray', ToArray);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/responses/responses.tpl.html',\n '
          Responses
          0\">
          DateTimeQuestionAnswer
          {{ row.ObservationDate | datetime : \"date\" : \"UTC\" }} {{row.ObservationDateTime_UTC | date : \"HH:mm\"}}
          {{row.QuestionText}}
          {{answer.AnswerText}}
          No Survey Data
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/time_log/report.tpl.html',\n '
          • MS Excel
          0\">{{::phiWarningText}}
          {{emptyDisplayText}}
          ');\n}]);\n}(window, document, window.angular));","function TimeLogReportDirective(ReportsService, $window) {\r\n const ALL = 'All';\r\n const SINGLE = 'Single';\r\n const CCM = 'All (CCM)';\r\n const CCM_OVER_20 = 'All (CCM - Over 20 Min)';\r\n const CCM_OVER_60 = 'All (CCM - Over 60 Min)';\r\n const CCM_ADDITIONAL_30 = 'All (CCM - Additional 30 Min)';\r\n const CLINICAL_OVER_20 = 'All (Clinical - Over 20 Min)';\r\n const NON_CCM_RPM = 'All (Non-CCM/RPM)';\r\n const RPM = 'All (RPM)';\r\n const RPM_OVER_16_DAYS = 'All (RPM - Over 16 Days)';\r\n const RPM_OVER_20 = 'All (RPM - Over 20 Min)';\r\n\r\n function controller($scope, $window, $http, vhSweetAlert) {\r\n $scope.additionalTime = 0;\r\n var lastMonth = new Date();\r\n lastMonth.setMonth(lastMonth.getMonth() - 1);\r\n $scope.date = {\r\n value: lastMonth,\r\n maxDate: new Date(),\r\n datePickerOptions: {\r\n 'minMode': 'month'\r\n },\r\n readOnly: true\r\n };\r\n\r\n $scope.timeType = {\r\n value: ALL\r\n };\r\n\r\n $scope.emptyDisplayText = 'Report data will be displayed here.';\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.patient = {\r\n type: SINGLE,\r\n options: [SINGLE, ALL],\r\n value: '',\r\n typeAheadData: []\r\n };\r\n\r\n $scope.$watch('patient.type', function(newValue, oldValue){\r\n if(newValue != oldValue && (newValue === SINGLE || newValue === CCM_OVER_60)) {\r\n $scope.patient.value = '';\r\n }\r\n\r\n $scope.validate();\r\n });\r\n\r\n $scope.$watch('timeType.value', function(newValue, oldValue){\r\n if(newValue != oldValue){\r\n $scope.validate();\r\n }\r\n });\r\n\r\n $http.get('/api/Payer/hasCCM').then(function(response){\r\n if(response.data === true) {\r\n $scope.patient.options.splice(1, 0, NON_CCM_RPM);\r\n $scope.patient.options.splice(2, 0, CCM_OVER_20);\r\n $scope.patient.options.splice(3, 0, CCM_OVER_60);\r\n $scope.patient.options.splice(4, 0, CCM_ADDITIONAL_30);\r\n $scope.patient.options.splice(5, 0, CCM);\r\n $http.get('/api/Payer/hasRPM').then(function(response){\r\n if(response.data === true) {\r\n $scope.patient.options.splice(6, 0, RPM_OVER_16_DAYS);\r\n $scope.patient.options.splice(7, 0, RPM_OVER_20);\r\n $scope.patient.options.splice(8, 0, RPM);\r\n }\r\n });\r\n }\r\n else {\r\n $http.get('/api/Payer/hasRPM').then(function(response){\r\n if(response.data === true) {\r\n $scope.patient.options.splice(1, 0, NON_CCM_RPM);\r\n $scope.patient.options.splice(2, 0, RPM_OVER_16_DAYS);\r\n $scope.patient.options.splice(3, 0, RPM_OVER_20);\r\n $scope.patient.options.splice(4, 0, RPM);\r\n }\r\n else {\r\n $scope.patient.options.splice(1, 0, CLINICAL_OVER_20);\r\n }\r\n });\r\n }\r\n });\r\n\r\n ReportsService.getReportHeader().then(function(data){\r\n $scope.reportHeader = {\r\n reportName: \"Patient Time Log\",\r\n infoLineOne: data.TextLineOne,\r\n infoLineTwo: data.TextLineTwo\r\n };\r\n });\r\n\r\n ReportsService.getPHIWarningText().then(function(data){\r\n $scope.phiWarningText = data.Value;\r\n });\r\n\r\n $scope.validate = function () {\r\n if ($scope.patient.type !== SINGLE) {\r\n $scope.loadReport();\r\n }\r\n else if (validatePatient()) {\r\n $scope.loadReport();\r\n }\r\n else {\r\n $scope.timeLogReport = {};\r\n }\r\n };\r\n\r\n $scope.validateAdditionalTime = function () {\r\n if($scope.patient.type !== CCM_OVER_60) {\r\n $scope.loadReport();\r\n }\r\n else if (validateTime()) {\r\n $scope.loadReport();\r\n } else {\r\n vhSweetAlert.error('Error', 'Additional time must be an increment of 30 minutes.')\r\n $scope.timeLogReport = {};\r\n }\r\n };\r\n\r\n $scope.filterTimeType = function () {\r\n $scope.timeLogType = $scope.timeType.value;\r\n };\r\n\r\n $scope.print = function() {\r\n $window.print();\r\n };\r\n }\r\n\r\n function validatePatient() {\r\n var valid = true;\r\n\r\n if ($scope.patient.value.length) {\r\n //patient not found\r\n var errorMessage = 'Patient ' + $scope.patient.value + ' not found. Please try a different name.';\r\n vhSweetAlert.error('Error', errorMessage);\r\n valid = false;\r\n }\r\n else if($scope.patient.value.length === 0){\r\n valid = false;\r\n }\r\n\r\n return valid;\r\n }\r\n\r\n function validateTime() {\r\n $scope.additionalTime = $scope.patient.value;\r\n if($scope.additionalTime % 30 === 0) {\r\n return true;\r\n }\r\n else {\r\n var errorMessage = 'Any extra time must be in increments of 30.';\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n function link(scope, elem, attrs){\r\n\r\n var reportBody = angular.element($window.document.querySelector('#timeLogReportBody'));\r\n\r\n scope.reportHasData = function(){\r\n var children = reportBody.children();\r\n return children.length > 0;\r\n };\r\n\r\n scope.loadReport = function() {\r\n reportBody.html('');\r\n\r\n scope.emptyDisplayText = 'Report data will be displayed here.';\r\n\r\n var monthOffset = getMonthOffset(new Date(), scope.date)\r\n\r\n ReportsService.getTimeLogReport(monthOffset, scope.patient, scope.timeType).then(function (data) {\r\n\r\n reportBody.html(data);\r\n scope.emptyDisplayText = 'There is no data to display.';\r\n\r\n var execReport = {\r\n ReportTypeId: scope.report.ReportTypeId,\r\n ReportParams: ReportsService.generateParamaters(monthOffset, scope.patient, scope.timeType)\r\n };\r\n\r\n scope.excelSrc = {\r\n url: '/api/report/ExportToExcel/' + scope.report.ReportTypeId,\r\n method: 'POST',\r\n data: execReport\r\n };\r\n });\r\n };\r\n\r\n function getMonthOffset(currentDate, selectedDate) {\r\n // We do not want the UTC values here bacause the last day of the month plus the offset will be wrong\r\n // May 31 21:00:00 +5 hours is June!\r\n var currentYear = currentDate.getFullYear();\r\n var currentMonth = currentDate.getMonth();\r\n var selectedYear = selectedDate.value.getFullYear();\r\n var selectedMonth = selectedDate.value.getMonth()\r\n\r\n return ((currentYear * 12) + currentMonth) - ((selectedYear * 12) + selectedMonth);\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: link,\r\n restrict: 'E',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'modules/reports/time_log/report.tpl.html'\r\n }\r\n}\r\n\r\nangular.module('reports.time_log').directive('timeLogReport', TimeLogReportDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/reports/usagemonitoring/report.tpl.html',\n '
          • MS Excel
          DateTotal Patients ActiveNew Patients ActivePatients CompletedService Level AssignedService Level UnassignedCaregivers CreatedCaregivers DeletedHealth MeasurementsVideo Conferencing
          {{::record.CreatedDtUTC | dateUTCformat}}{{::record.TotalActivePatients}}{{::record.NewActivePatients}}{{::record.CompletedPatients}}{{::record.KitsAssigned}}{{::record.KitsUnassigned}}{{::record.CaregiversCreated}}{{::record.CaregiversDeleted}}{{::record.HealthMeasurements}}{{::record.VideoConferencing}}
          Summary{{totals.newActivePatients}}{{totals.completedPatients}}{{totals.kitsAssigned}}{{totals.kitsUnassigned}}{{totals.caregiversCreated}}{{totals.caregiversDeleted}}{{totals.healthMeasurements}}{{totals.videoConferencing}}
          {{emptyDisplayText}}
          ');\n}]);\n}(window, document, window.angular));","function UsageMonitoringReportDirective(ReportsService, $window, ConfigurationsService) {\r\n function controller($scope, $window, $http, vhSweetAlert, moment, $filter) {\r\n $scope.date = {\r\n value: new Date(),\r\n maxDate: new Date(),\r\n datePickerOptions: {\r\n 'minMode': 'month'\r\n },\r\n readOnly: true\r\n };\r\n\r\n $scope.reportData = [];\r\n $scope.totals = {};\r\n $scope.emptyDisplayText = 'Report data will be displayed here.';\r\n $scope.date = {relativeDate: ''};\r\n $scope.paramValues = [];\r\n $scope.updateDates = updateDates;\r\n $scope.getRelativeDateOptions = getRelativeDateOptions;\r\n $scope.date.endCalendarOpened = false;\r\n $scope.date.startCalendarOpened = false;\r\n $scope.openStartCalendar = openStartCalendar;\r\n $scope.openEndCalendar = openEndCalendar;\r\n $scope.calendarChanged = calendarChanged;\r\n $scope.reportHasData = false;\r\n $scope.displayEmptyMessage = true;\r\n $scope.dateFormat = ConfigurationsService.configParams.DateFormat;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n $scope.date.relativeDate = \"Last Calendar Month\";\r\n updateDates();\r\n }\r\n\r\n $scope.validate = function () {\r\n\r\n };\r\n\r\n $scope.dateOptions = {\r\n showWeeks: false,\r\n maxDate: new Date()\r\n };\r\n\r\n $scope.print = function() {\r\n $window.print();\r\n };\r\n\r\n function getRelativeDateOptions() {\r\n var relativeDateOptions = [\r\n \"Yesterday\",\r\n \"This Calendar Week\",\r\n \"Last Calendar Week\",\r\n \"Last Two Calendar Weeks\",\r\n \"Last Calendar Month\",\r\n \"This Calendar Year\",\r\n \"Last Calendar Year\"\r\n ];\r\n return relativeDateOptions;\r\n }\r\n\r\n function updateDates() {\r\n currentDate = new Date();\r\n if ($scope.date.relativeDate === \"Today\") {\r\n $scope.paramValues['@StartDate'] = currentDate;\r\n $scope.paramValues['@EndDate'] = currentDate;\r\n } else if ($scope.date.relativeDate === \"Yesterday\") {\r\n $scope.paramValues['@StartDate'] = moment().subtract('1', 'day').startOf('day').toDate();\r\n $scope.paramValues['@EndDate'] = moment().subtract('1', 'day').endOf('day').toDate();\r\n } else if ($scope.date.relativeDate === \"This Calendar Week\") {\r\n $scope.paramValues['@StartDate'] = moment().startOf('week').toDate();\r\n $scope.paramValues['@EndDate'] = moment().subtract('1', 'day').toDate();\r\n } else if ($scope.date.relativeDate === \"Last Calendar Week\") {\r\n $scope.paramValues['@StartDate'] = moment().subtract('1', 'weeks').startOf('week').toDate();\r\n $scope.paramValues['@EndDate'] = moment().subtract('1', 'weeks').endOf('week').toDate();\r\n } else if ($scope.date.relativeDate === \"Last Two Calendar Weeks\") {\r\n $scope.paramValues['@StartDate'] = moment().subtract('2', 'weeks').startOf('week').toDate();\r\n $scope.paramValues['@EndDate'] = moment().subtract('1', 'weeks').endOf('week').toDate();\r\n } else if ($scope.date.relativeDate === \"Last Calendar Month\") {\r\n $scope.paramValues['@StartDate'] = moment().subtract('1', 'months').startOf('month').toDate();\r\n $scope.paramValues['@EndDate'] = moment().subtract('1', 'months').endOf('month').toDate();\r\n } else if ($scope.date.relativeDate === \"This Calendar Year\") {\r\n $scope.paramValues['@StartDate'] = moment().startOf('year').toDate();\r\n $scope.paramValues['@EndDate'] = moment().subtract('1', 'day').toDate();\r\n } else if ($scope.date.relativeDate === \"Last Calendar Year\") {\r\n $scope.paramValues['@StartDate'] = moment().subtract('1', 'years').startOf('year').toDate();\r\n $scope.paramValues['@EndDate'] = moment().subtract('1', 'years').endOf('year').toDate();\r\n }\r\n\r\n runReport();\r\n }\r\n\r\n function openStartCalendar($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n $scope.date.startCalendarOpened = true;\r\n $scope.date.endCalendarOpened = false;\r\n }\r\n\r\n function openEndCalendar($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n $scope.date.endCalendarOpened = true;\r\n $scope.date.startCalendarOpened = false;\r\n }\r\n\r\n function calendarChanged() {\r\n //Reset relative date dropdown if a custom date-range is selected\r\n if ($scope.date.startCalendarOpened || $scope.date.endCalendarOpened) {\r\n $scope.date.relativeDate = '';\r\n //$scope.date.startCalendarOpened = false;\r\n //$scope.date.endCalendarOpened = false;\r\n }\r\n if ($scope.paramValues['@StartDate'] !== undefined && $scope.paramValues['@EndDate'] !== undefined) {\r\n runReport();\r\n }\r\n }\r\n\r\n function runReport() {\r\n ReportsService.getUsageMonitoringReport($scope.paramValues['@StartDate'], $scope.paramValues['@EndDate']).then(function(data) {\r\n $scope.reportData = data;\r\n\r\n if ($scope.reportData.length > 0)\r\n {\r\n $scope.displayEmptyMessage = false;\r\n calculateTotals();\r\n } else {\r\n $scope.displayEmptyMessage = true;\r\n $scope.emptyDisplayText = 'There is no data to display.';\r\n }\r\n\r\n var execReport = {\r\n ReportTypeId: $scope.report.ReportTypeId,\r\n ReportParams: getReportParams()\r\n };\r\n\r\n $scope.excelSrc = {\r\n url: '/api/report/ExportToExcel/' + $scope.report.ReportTypeId,\r\n method: 'POST',\r\n data: execReport\r\n };\r\n });\r\n }\r\n\r\n function getReportParams(){\r\n params = 'startDate=' + $filter('date')($scope.paramValues['@StartDate'], 'MM/dd/yyyy');\r\n params += '&endDate=' + $filter('date')($scope.paramValues['@EndDate'], 'MM/dd/yyyy');\r\n\r\n return params;\r\n }\r\n\r\n function calculateTotals() {\r\n $scope.totals.newActivePatients = 0;\r\n $scope.totals.completedPatients = 0;\r\n $scope.totals.kitsAssigned = 0;\r\n $scope.totals.kitsUnassigned = 0;\r\n $scope.totals.caregiversCreated = 0;\r\n $scope.totals.caregiversDeleted = 0;\r\n $scope.totals.healthMeasurements = 0;\r\n $scope.totals.videoConferencing = 0;\r\n angular.forEach($scope.reportData, function(a) {\r\n $scope.totals.newActivePatients += a.NewActivePatients;\r\n $scope.totals.completedPatients += a.CompletedPatients;\r\n $scope.totals.kitsAssigned += a.KitsAssigned;\r\n $scope.totals.kitsUnassigned += a.KitsUnassigned;\r\n $scope.totals.caregiversCreated += a.CaregiversCreated;\r\n $scope.totals.caregiversDeleted += a.CaregiversDeleted;\r\n $scope.totals.healthMeasurements += a.HealthMeasurements;\r\n $scope.totals.videoConferencing += a.VideoConferencing;\r\n });\r\n }\r\n }\r\n\r\n\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n transclude: true,\r\n templateUrl: 'modules/reports/usagemonitoring/report.tpl.html'\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('reports').directive('usageMonitoringReport', UsageMonitoringReportDirective);\r\n","\r\n\r\n\r\nfunction CardGroupRepository($http, lodash) {\r\n\r\n return {\r\n getAll: function () {\r\n \r\n return $http.get('/api/CardGroup').then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n getByPageNumber: function(page, pageSize, cardGroupId){\r\n\r\n if(isNaN(parseInt(cardGroupId)))\r\n throw 'Invalid card group id.';\r\n\r\n return $http.get('/api/CardGroup/?pageSize=' + pageSize + '&page=' + page + '&cardGroupId=' + cardGroupId).then(function (response) {\r\n return response.data;\r\n });\r\n } \r\n\r\n };\r\n}\r\n\r\nangular.module('repos').factory('CardGroupRepository', CardGroupRepository);\r\n","class CardsRepository {\r\n\r\n constructor($http, lodash, PendingService){\r\n this.$http = $http;\r\n this.lodash = lodash;\r\n this.PendingService = PendingService;\r\n } \r\n\r\n deleteCard(card){\r\n return this.$http.delete('/api/card/' + card.CardId)\r\n .then(response => response.data);\r\n }\r\n\r\n saveCards(cards){\r\n return this.$http.post('/api/card/', cards).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n \r\n importCards(importData){\r\n return this.$http.post('/api/import/cards/', importData).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n validationData(){\r\n return this.$http.get('/api/import/validation/cards').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n getCards(){\r\n return this.PendingService.promise('get all cards', () => this.$http.get('/api/card/'))\r\n .then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n get(id) {\r\n return this.PendingService.promise('get card' + id, () => this.$http.get('/api/card/' + id))\r\n .then(\r\n function (response) {\r\n return response.data\r\n });\r\n };\r\n\r\n searchCards(searchText) {\r\n return this.$http.get('/api/card/search/' + searchText).then(\r\n function (response) {\r\n return response.data\r\n });\r\n };\r\n\r\n getRulesForCard(cardId) {\r\n return this.$http.get('/api/card/' + cardId + '/Rule').then(\r\n function (response) {\r\n return response.data\r\n });\r\n };\r\n\r\n}\r\n\r\nfunction cardsRepositoryFactory($http, lodash, PendingService) { return new CardsRepository(...arguments); }\r\n\r\nangular.module('repos').factory('CardsRepository', cardsRepositoryFactory);","function ConfigurationRepository($http) {\r\n return {\r\n getByParamName: function (name) {\r\n return $http.get('/api/configuration?param=' + name).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getSystemConfigurations: function() {\r\n return $http.get('/api/configuration').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getSiteConfigurations: function() {\r\n return $http.get('/api/configuration/site').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n save: function(data) {\r\n return $http.post('/api/configuration', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n canBackDate:function(status,canBackDate){\r\n return $http.put('/api/MonitoringStatus',{'data': status,'value':canBackDate}).then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n },\r\n WriteToChart:function(status,data){\r\n return $http.put('/api/MonitoringStatus/writetochart',{'data': status,'value':data}).then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n },\r\n refresh: function() {\r\n return $http.get('/api/configuration?refresh=true').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n getMediaPaths: function() {\r\n return $http.get('/api/media/path').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n createMediaPaths: function() {\r\n return $http.post('/api/media/path').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n };\r\n}\r\n\r\nangular.module('repos').factory('ConfigurationRepository', ConfigurationRepository);\r\n","function HospitalRepository($http) {\r\n return {\r\n getAll: function () {\r\n return $http.get('/api/Hospital').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n };\r\n}\r\n\r\nangular.module('repos').factory('HospitalRepository', HospitalRepository);\r\n","function IconsRepository(){\r\n\r\n // font awesome version 4.7\r\n var faIconClasses = [\"fa-500px\",\"fa-address-book\",\"fa-address-book-o\",\"fa-address-card\",\r\n \"fa-address-card-o\",\"fa-adjust\",\"fa-adn\",\"fa-align-center\",\"fa-align-justify\",\"fa-align-left\",\r\n \"fa-align-right\",\"fa-amazon\",\"fa-ambulance\",\"fa-american-sign-language-interpreting\",\"fa-anchor\",\r\n \"fa-android\",\"fa-angellist\",\"fa-angle-double-down\",\"fa-angle-double-left\",\"fa-angle-double-right\",\r\n \"fa-angle-double-up\",\"fa-angle-down\",\"fa-angle-left\",\"fa-angle-right\",\"fa-angle-up\",\"fa-apple\",\r\n \"fa-archive\",\"fa-area-chart\",\"fa-arrow-circle-down\",\"fa-arrow-circle-left\",\"fa-arrow-circle-o-down\",\r\n \"fa-arrow-circle-o-left\",\"fa-arrow-circle-o-right\",\"fa-arrow-circle-o-up\",\"fa-arrow-circle-right\",\r\n \"fa-arrow-circle-up\",\"fa-arrow-down\",\"fa-arrow-left\",\"fa-arrow-right\",\"fa-arrow-up\",\"fa-arrows\",\r\n \"fa-arrows-alt\",\"fa-arrows-h\",\"fa-arrows-v\",\"fa-asl-interpreting\",\"fa-assistive-listening-systems\",\r\n \"fa-asterisk\",\"fa-at\",\"fa-audio-description\",\"fa-automobile\",\"fa-backward\",\"fa-balance-scale\",\"fa-ban\",\r\n \"fa-bandcamp\",\"fa-bank\",\"fa-bar-chart\",\"fa-bar-chart-o\",\"fa-barcode\",\"fa-bars\",\"fa-bath\",\"fa-bathtub\",\r\n \"fa-battery\",\"fa-battery-0\",\"fa-battery-1\",\"fa-battery-2\",\"fa-battery-3\",\"fa-battery-4\",\"fa-battery-empty\",\r\n \"fa-battery-full\",\"fa-battery-half\",\"fa-battery-quarter\",\"fa-battery-three-quarters\",\"fa-bed\",\"fa-beer\",\r\n \"fa-behance\",\"fa-behance-square\",\"fa-bell\",\"fa-bell-o\",\"fa-bell-slash\",\"fa-bell-slash-o\",\"fa-bicycle\",\r\n \"fa-binoculars\",\"fa-birthday-cake\",\"fa-bitbucket\",\"fa-bitbucket-square\",\"fa-bitcoin\",\"fa-black-tie\",\r\n \"fa-blind\",\"fa-bluetooth\",\"fa-bluetooth-b\",\"fa-bold\",\"fa-bolt\",\"fa-bomb\",\"fa-book\",\"fa-bookmark\",\r\n \"fa-bookmark-o\",\"fa-braille\",\"fa-briefcase\",\"fa-btc\",\"fa-bug\",\"fa-building\",\"fa-building-o\",\"fa-bullhorn\",\r\n \"fa-bullseye\",\"fa-bus\",\"fa-buysellads\",\"fa-cab\",\"fa-calculator\",\"fa-calendar\",\"fa-calendar-check-o\",\"fa-calendar-minus-o\",\r\n \"fa-calendar-o\",\"fa-calendar-plus-o\",\"fa-calendar-times-o\",\"fa-camera\",\"fa-camera-retro\",\"fa-car\",\"fa-caret-down\",\r\n \"fa-caret-left\",\"fa-caret-right\",\"fa-caret-square-o-down\",\"fa-caret-square-o-left\",\"fa-caret-square-o-right\",\r\n \"fa-caret-square-o-up\",\"fa-caret-up\",\"fa-cart-arrow-down\",\"fa-cart-plus\",\"fa-cc\",\"fa-cc-amex\",\"fa-cc-diners-club\",\r\n \"fa-cc-discover\",\"fa-cc-jcb\",\"fa-cc-mastercard\",\"fa-cc-paypal\",\"fa-cc-stripe\",\"fa-cc-visa\",\"fa-certificate\",\"fa-chain\",\r\n \"fa-chain-broken\",\"fa-check\",\"fa-check-circle\",\"fa-check-circle-o\",\"fa-check-square\",\"fa-check-square-o\",\"fa-chevron-circle-down\",\r\n \"fa-chevron-circle-left\",\"fa-chevron-circle-right\",\"fa-chevron-circle-up\",\"fa-chevron-down\",\"fa-chevron-left\",\"fa-chevron-right\",\r\n \"fa-chevron-up\",\"fa-child\",\"fa-chrome\",\"fa-circle\",\"fa-circle-o\",\"fa-circle-o-notch\",\"fa-circle-thin\",\"fa-clipboard\",\"fa-clock-o\",\r\n \"fa-clone\",\"fa-close\",\"fa-cloud\",\"fa-cloud-download\",\"fa-cloud-upload\",\"fa-cny\",\"fa-code\",\"fa-code-fork\",\"fa-codepen\",\"fa-codiepie\",\r\n \"fa-coffee\",\"fa-cog\",\"fa-cogs\",\"fa-columns\",\"fa-comment\",\"fa-comment-o\",\"fa-commenting\",\"fa-commenting-o\",\"fa-comments\",\"fa-comments-o\",\r\n \"fa-compass\",\"fa-compress\",\"fa-connectdevelop\",\"fa-contao\",\"fa-copy\",\"fa-copyright\",\"fa-creative-commons\",\"fa-credit-card\",\r\n \"fa-credit-card-alt\",\"fa-crop\",\"fa-crosshairs\",\"fa-css3\",\"fa-cube\",\"fa-cubes\",\"fa-cut\",\"fa-cutlery\",\"fa-dashboard\",\"fa-dashcube\",\r\n \"fa-database\",\"fa-deaf\",\"fa-deafness\",\"fa-dedent\",\"fa-delicious\",\"fa-desktop\",\"fa-deviantart\",\"fa-diamond\",\"fa-digg\",\"fa-dollar\",\r\n \"fa-dot-circle-o\",\"fa-download\",\"fa-dribbble\",\"fa-drivers-license\",\"fa-drivers-license-o\",\"fa-dropbox\",\"fa-drupal\",\"fa-edge\",\"fa-edit\",\r\n \"fa-eercast\",\"fa-eject\",\"fa-ellipsis-h\",\"fa-ellipsis-v\",\"fa-empire\",\"fa-envelope\",\"fa-envelope-o\",\"fa-envelope-open\",\"fa-envelope-open-o\",\r\n \"fa-envelope-square\",\"fa-envira\",\"fa-eraser\",\"fa-etsy\",\"fa-eur\",\"fa-euro\",\"fa-exchange\",\"fa-exclamation\",\"fa-exclamation-circle\",\r\n \"fa-exclamation-triangle\",\"fa-expand\",\"fa-expeditedssl\",\"fa-external-link\",\"fa-external-link-square\",\"fa-eye\",\"fa-eye-slash\",\"fa-eyedropper\",\r\n \"fa-fa\",\"fa-facebook\",\"fa-facebook-f\",\"fa-facebook-official\",\"fa-facebook-square\",\"fa-fast-backward\",\"fa-fast-forward\",\"fa-fax\",\"fa-feed\",\r\n \"fa-female\",\"fa-fighter-jet\",\"fa-file\",\"fa-file-archive-o\",\"fa-file-audio-o\",\"fa-file-code-o\",\"fa-file-excel-o\",\"fa-file-image-o\",\r\n \"fa-file-movie-o\",\"fa-file-o\",\"fa-file-pdf-o\",\"fa-file-photo-o\",\"fa-file-picture-o\",\"fa-file-powerpoint-o\",\"fa-file-sound-o\",\"fa-file-text\",\r\n \"fa-file-text-o\",\"fa-file-video-o\",\"fa-file-word-o\",\"fa-file-zip-o\",\"fa-files-o\",\"fa-film\",\"fa-filter\",\"fa-fire\",\"fa-fire-extinguisher\",\r\n \"fa-firefox\",\"fa-first-order\",\"fa-flag\",\"fa-flag-checkered\",\"fa-flag-o\",\"fa-flash\",\"fa-flask\",\"fa-flickr\",\"fa-floppy-o\",\"fa-folder\",\"fa-folder-o\",\r\n \"fa-folder-open\",\"fa-folder-open-o\",\"fa-font\",\"fa-font-awesome\",\"fa-fonticons\",\"fa-fort-awesome\",\"fa-forumbee\",\"fa-forward\",\"fa-foursquare\",\r\n \"fa-free-code-camp\",\"fa-frown-o\",\"fa-futbol-o\",\"fa-gamepad\",\"fa-gavel\",\"fa-gbp\",\"fa-ge\",\"fa-gear\",\"fa-gears\",\"fa-genderless\",\"fa-get-pocket\",\r\n \"fa-gg\",\"fa-gg-circle\",\"fa-gift\",\"fa-git\",\"fa-git-square\",\"fa-github\",\"fa-github-alt\",\"fa-github-square\",\"fa-gitlab\",\"fa-gittip\",\"fa-glass\",\r\n \"fa-glide\",\"fa-glide-g\",\"fa-globe\",\"fa-google\",\"fa-google-plus\",\"fa-google-plus-circle\",\"fa-google-plus-official\",\"fa-google-plus-square\",\r\n \"fa-google-wallet\",\"fa-graduation-cap\",\"fa-gratipay\",\"fa-grav\",\"fa-group\",\"fa-h-square\",\"fa-hacker-news\",\"fa-hand-grab-o\",\"fa-hand-lizard-o\",\r\n \"fa-hand-o-down\",\"fa-hand-o-left\",\"fa-hand-o-right\",\"fa-hand-o-up\",\"fa-hand-paper-o\",\"fa-hand-peace-o\",\"fa-hand-pointer-o\",\"fa-hand-rock-o\",\r\n \"fa-hand-scissors-o\",\"fa-hand-spock-o\",\"fa-hand-stop-o\",\"fa-handshake-o\",\"fa-hard-of-hearing\",\"fa-hashtag\",\"fa-hdd-o\",\"fa-header\",\"fa-headphones\",\r\n \"fa-heart\",\"fa-heart-o\",\"fa-heartbeat\",\"fa-history\",\"fa-home\",\"fa-hospital-o\",\"fa-hotel\",\"fa-hourglass\",\"fa-hourglass-1\",\"fa-hourglass-2\",\r\n \"fa-hourglass-3\",\"fa-hourglass-end\",\"fa-hourglass-half\",\"fa-hourglass-o\",\"fa-hourglass-start\",\"fa-houzz\",\"fa-html5\",\"fa-i-cursor\",\"fa-id-badge\",\r\n \"fa-id-card\",\"fa-id-card-o\",\"fa-ils\",\"fa-image\",\"fa-imdb\",\"fa-inbox\",\"fa-indent\",\"fa-industry\",\"fa-info\",\"fa-info-circle\",\"fa-inr\",\"fa-instagram\",\r\n \"fa-institution\",\"fa-internet-explorer\",\"fa-intersex\",\"fa-ioxhost\",\"fa-italic\",\"fa-joomla\",\"fa-jpy\",\"fa-jsfiddle\",\"fa-key\",\"fa-keyboard-o\",\r\n \"fa-krw\",\"fa-language\",\"fa-laptop\",\"fa-lastfm\",\"fa-lastfm-square\",\"fa-leaf\",\"fa-leanpub\",\"fa-legal\",\"fa-lemon-o\",\"fa-level-down\",\"fa-level-up\",\r\n \"fa-life-bouy\",\"fa-life-buoy\",\"fa-life-ring\",\"fa-life-saver\",\"fa-lightbulb-o\",\"fa-line-chart\",\"fa-link\",\"fa-linkedin\",\"fa-linkedin-square\",\"fa-linode\",\r\n \"fa-linux\",\"fa-list\",\"fa-list-alt\",\"fa-list-ol\",\"fa-list-ul\",\"fa-location-arrow\",\"fa-lock\",\"fa-long-arrow-down\",\"fa-long-arrow-left\",\"fa-long-arrow-right\",\r\n \"fa-long-arrow-up\",\"fa-low-vision\",\"fa-magic\",\"fa-magnet\",\"fa-mail-forward\",\"fa-mail-reply\",\"fa-mail-reply-all\",\"fa-male\",\"fa-map\",\"fa-map-marker\",\r\n \"fa-map-o\",\"fa-map-pin\",\"fa-map-signs\",\"fa-mars\",\"fa-mars-double\",\"fa-mars-stroke\",\"fa-mars-stroke-h\",\"fa-mars-stroke-v\",\"fa-maxcdn\",\"fa-meanpath\",\r\n \"fa-medium\",\"fa-medkit\",\"fa-meetup\",\"fa-meh-o\",\"fa-mercury\",\"fa-microchip\",\"fa-microphone\",\"fa-microphone-slash\",\"fa-minus\",\"fa-minus-circle\",\r\n \"fa-minus-square\",\"fa-minus-square-o\",\"fa-mixcloud\",\"fa-mobile\",\"fa-mobile-phone\",\"fa-modx\",\"fa-money\",\"fa-moon-o\",\"fa-mortar-board\",\"fa-motorcycle\",\"fa-mouse-pointer\",\"fa-music\",\"fa-navicon\",\"fa-neuter\",\"fa-newspaper-o\",\"fa-object-group\",\"fa-object-ungroup\",\"fa-odnoklassniki\",\"fa-odnoklassniki-square\",\"fa-opencart\",\"fa-openid\",\"fa-opera\",\"fa-optin-monster\",\"fa-outdent\",\"fa-pagelines\",\"fa-paint-brush\",\"fa-paper-plane\",\"fa-paper-plane-o\",\"fa-paperclip\",\"fa-paragraph\",\"fa-paste\",\"fa-pause\",\"fa-pause-circle\",\"fa-pause-circle-o\",\"fa-paw\",\"fa-paypal\",\"fa-pencil\",\"fa-pencil-square\",\"fa-pencil-square-o\",\"fa-percent\",\"fa-phone\",\"fa-phone-square\",\"fa-photo\",\"fa-picture-o\",\"fa-pie-chart\",\"fa-pied-piper\",\"fa-pied-piper-alt\",\"fa-pied-piper-pp\",\"fa-pinterest\",\"fa-pinterest-p\",\"fa-pinterest-square\",\"fa-plane\",\"fa-play\",\"fa-play-circle\",\"fa-play-circle-o\",\"fa-plug\",\"fa-plus\",\"fa-plus-circle\",\"fa-plus-square\",\"fa-plus-square-o\",\"fa-podcast\",\"fa-power-off\",\"fa-print\",\"fa-product-hunt\",\"fa-puzzle-piece\",\"fa-qq\",\"fa-qrcode\",\"fa-question\",\"fa-question-circle\",\"fa-question-circle-o\",\"fa-quora\",\"fa-quote-left\",\"fa-quote-right\",\"fa-ra\",\"fa-random\",\"fa-ravelry\",\"fa-rebel\",\"fa-recycle\",\"fa-reddit\",\"fa-reddit-alien\",\"fa-reddit-square\",\"fa-refresh\",\"fa-registered\",\"fa-remove\",\"fa-renren\",\"fa-reorder\",\"fa-repeat\",\"fa-reply\",\"fa-reply-all\",\"fa-resistance\",\"fa-retweet\",\"fa-rmb\",\"fa-road\",\"fa-rocket\",\"fa-rotate-left\",\"fa-rotate-right\",\"fa-rouble\",\"fa-rss\",\"fa-rss-square\",\"fa-rub\",\"fa-ruble\",\"fa-rupee\",\"fa-s15\",\"fa-safari\",\"fa-save\",\"fa-scissors\",\"fa-scribd\",\"fa-search\",\"fa-search-minus\",\"fa-search-plus\",\"fa-sellsy\",\"fa-send\",\"fa-send-o\",\"fa-server\",\"fa-share\",\"fa-share-alt\",\"fa-share-alt-square\",\"fa-share-square\",\"fa-share-square-o\",\"fa-shekel\",\"fa-sheqel\",\"fa-shield\",\"fa-ship\",\"fa-shirtsinbulk\",\"fa-shopping-bag\",\"fa-shopping-basket\",\"fa-shopping-cart\",\"fa-shower\",\"fa-sign-in\",\"fa-sign-language\",\"fa-sign-out\",\"fa-signal\",\"fa-signing\",\"fa-simplybuilt\",\"fa-sitemap\",\"fa-skyatlas\",\"fa-skype\",\"fa-slack\",\"fa-sliders\",\"fa-slideshare\",\"fa-smile-o\",\"fa-snapchat\",\"fa-snapchat-ghost\",\"fa-snapchat-square\",\"fa-snowflake-o\",\"fa-soccer-ball-o\",\"fa-sort\",\"fa-sort-alpha-asc\",\"fa-sort-alpha-desc\",\"fa-sort-amount-asc\",\"fa-sort-amount-desc\",\"fa-sort-asc\",\"fa-sort-desc\",\"fa-sort-down\",\"fa-sort-numeric-asc\",\"fa-sort-numeric-desc\",\"fa-sort-up\",\"fa-soundcloud\",\"fa-space-shuttle\",\"fa-spinner\",\"fa-spoon\",\"fa-spotify\",\"fa-square\",\"fa-square-o\",\"fa-stack-exchange\",\"fa-stack-overflow\",\"fa-star\",\"fa-star-half\",\"fa-star-half-empty\",\"fa-star-half-full\",\"fa-star-half-o\",\"fa-star-o\",\"fa-steam\",\"fa-steam-square\",\"fa-step-backward\",\"fa-step-forward\",\"fa-stethoscope\",\"fa-sticky-note\",\"fa-sticky-note-o\",\"fa-stop\",\"fa-stop-circle\",\"fa-stop-circle-o\",\"fa-street-view\",\"fa-strikethrough\",\"fa-stumbleupon\",\"fa-stumbleupon-circle\",\"fa-subscript\",\"fa-subway\",\"fa-suitcase\",\"fa-sun-o\",\"fa-superpowers\",\"fa-superscript\",\"fa-support\",\"fa-table\",\"fa-tablet\",\"fa-tachometer\",\"fa-tag\",\"fa-tags\",\"fa-tasks\",\"fa-taxi\",\"fa-telegram\",\"fa-television\",\"fa-tencent-weibo\",\"fa-terminal\",\"fa-text-height\",\"fa-text-width\",\"fa-th\",\"fa-th-large\",\"fa-th-list\",\"fa-themeisle\",\"fa-thermometer\",\"fa-thermometer-0\",\"fa-thermometer-1\",\"fa-thermometer-2\",\"fa-thermometer-3\",\"fa-thermometer-4\",\"fa-thermometer-empty\",\"fa-thermometer-full\",\"fa-thermometer-half\",\"fa-thermometer-quarter\",\"fa-thermometer-three-quarters\",\"fa-thumb-tack\",\"fa-thumbs-down\",\"fa-thumbs-o-down\",\"fa-thumbs-o-up\",\"fa-thumbs-up\",\"fa-ticket\",\"fa-times\",\"fa-times-circle\",\"fa-times-circle-o\",\"fa-times-rectangle\",\"fa-times-rectangle-o\",\"fa-tint\",\"fa-toggle-down\",\"fa-toggle-left\",\"fa-toggle-off\",\"fa-toggle-on\",\"fa-toggle-right\",\"fa-toggle-up\",\"fa-trademark\",\"fa-train\",\"fa-transgender\",\"fa-transgender-alt\",\"fa-trash\",\"fa-trash-o\",\"fa-tree\",\"fa-trello\",\"fa-tripadvisor\",\"fa-trophy\",\"fa-truck\",\"fa-try\",\"fa-tty\",\"fa-tumblr\",\"fa-tumblr-square\",\"fa-turkish-lira\",\"fa-tv\",\"fa-twitch\",\"fa-twitter\",\"fa-twitter-square\",\"fa-umbrella\",\"fa-underline\",\"fa-undo\",\"fa-universal-access\",\"fa-university\",\"fa-unlink\",\"fa-unlock\",\"fa-unlock-alt\",\"fa-unsorted\",\"fa-upload\",\"fa-usb\",\"fa-usd\",\"fa-user\",\"fa-user-circle\",\"fa-user-circle-o\",\"fa-user-md\",\"fa-user-o\",\"fa-user-plus\",\"fa-user-secret\",\"fa-user-times\",\"fa-users\",\"fa-vcard\",\"fa-vcard-o\",\"fa-venus\",\"fa-venus-double\",\"fa-venus-mars\",\"fa-viacoin\",\"fa-viadeo\",\"fa-viadeo-square\",\"fa-video-camera\",\"fa-vimeo\",\"fa-vimeo-square\",\"fa-vine\",\"fa-vk\",\"fa-volume-control-phone\",\"fa-volume-down\",\"fa-volume-off\",\"fa-volume-up\",\"fa-warning\",\"fa-wechat\",\"fa-weibo\",\"fa-weixin\",\"fa-whatsapp\",\"fa-wheelchair\",\"fa-wheelchair-alt\",\"fa-wifi\",\"fa-wikipedia-w\",\"fa-window-close\",\"fa-window-close-o\",\"fa-window-maximize\",\"fa-window-minimize\",\"fa-window-restore\",\"fa-windows\",\"fa-won\",\"fa-wordpress\",\"fa-wpbeginner\",\"fa-wpexplorer\",\"fa-wpforms\",\"fa-wrench\",\"fa-xing\",\"fa-xing-square\",\"fa-y-combinator\",\"fa-y-combinator-square\",\"fa-yahoo\",\"fa-yc\",\"fa-yc-square\",\"fa-yelp\",\"fa-yen\",\"fa-yoast\",\"fa-youtube\",\"fa-youtube-play\",\"fa-youtube-square\"];\r\n\r\n var vhIcons = [\r\n \"vh-ui-glyph-action-accept\",\r\n \"vh-ui-glyph-action-add\",\r\n \"vh-ui-glyph-action-arrow-down\",\r\n \"vh-ui-glyph-action-arrow-left\",\r\n \"vh-ui-glyph-action-arrow-right\",\r\n \"vh-ui-glyph-action-arrow-up\",\r\n \"vh-ui-glyph-action-blank\",\r\n \"vh-ui-glyph-action-call\",\r\n \"vh-ui-glyph-action-contract-horizontal\",\r\n \"vh-ui-glyph-action-contract-vertical\",\r\n \"vh-ui-glyph-action-expand-horizontal\",\r\n \"vh-ui-glyph-action-expand-vertical\",\r\n \"vh-ui-glyph-action-find\",\r\n \"vh-ui-glyph-action-note-add\",\r\n \"vh-ui-glyph-action-pause\",\r\n \"vh-ui-glyph-action-play\",\r\n \"vh-ui-glyph-action-reject\",\r\n \"vh-ui-glyph-action-stop\",\r\n \"vh-ui-glyph-action-subtract\",\r\n \"vh-ui-glyph-action-video\",\r\n \"vh-ui-glyph-arrow-down\",\r\n \"vh-ui-glyph-arrow-left\",\r\n \"vh-ui-glyph-arrow-right\",\r\n \"vh-ui-glyph-arrow-up\",\r\n \"vh-ui-glyph-bluetooth\",\r\n \"vh-ui-glyph-brand-bug\",\r\n \"vh-ui-glyph-brand-pathway\",\r\n \"vh-ui-glyph-caret-left\",\r\n \"vh-ui-glyph-caret-up\",\r\n \"vh-ui-glyph-carfet-right\",\r\n \"vh-ui-glyph-carret-down\",\r\n \"vh-ui-glyph-chat\",\r\n \"vh-ui-glyph-config-filled\",\r\n \"vh-ui-glyph-config-outline\",\r\n \"vh-ui-glyph-dogear-bottomleft\",\r\n \"vh-ui-glyph-dogear-bottomright\",\r\n \"vh-ui-glyph-dogear-topleft\",\r\n \"vh-ui-glyph-dogear-topright\",\r\n \"vh-ui-glyph-facility-clinic\",\r\n \"vh-ui-glyph-facility-emergency\",\r\n \"vh-ui-glyph-facility-hospital\",\r\n \"vh-ui-glyph-flag-esl\",\r\n \"vh-ui-glyph-flag-fallrisk\",\r\n \"vh-ui-glyph-flag-hearingimpared\",\r\n \"vh-ui-glyph-flag-monitored-3rdparty\",\r\n \"vh-ui-glyph-flag-seeingimpared\",\r\n \"vh-ui-glyph-flag-wheelchair\",\r\n \"vh-ui-glyph-hamburger\",\r\n \"vh-ui-glyph-item-alerts\",\r\n \"vh-ui-glyph-item-bp\",\r\n \"vh-ui-glyph-item-ekg\",\r\n \"vh-ui-glyph-item-o2\",\r\n \"vh-ui-glyph-item-phone\",\r\n \"vh-ui-glyph-item-pulse\",\r\n \"vh-ui-glyph-item-survey\",\r\n \"vh-ui-glyph-item-temp\",\r\n \"vh-ui-glyph-item-weight\",\r\n \"vh-ui-glyph-media-record\",\r\n \"vh-ui-glyph-media-video\",\r\n \"vh-ui-glyph-media-volume-down\",\r\n \"vh-ui-glyph-media-volume-up\",\r\n \"vh-ui-glyph-menu-chart\",\r\n \"vh-ui-glyph-menu-history\",\r\n \"vh-ui-glyph-menu-monitoring\",\r\n \"vh-ui-glyph-menu-profile\",\r\n \"vh-ui-glyph-menu-survey\",\r\n \"vh-ui-glyph-role-administrator\",\r\n \"vh-ui-glyph-role-callcenter\",\r\n \"vh-ui-glyph-role-nurse\",\r\n \"vh-ui-glyph-role-patient\",\r\n \"vh-ui-glyph-role-patient-female\",\r\n \"vh-ui-glyph-role-patient-male\",\r\n \"vh-ui-glyph-role-physician\",\r\n \"vh-ui-glyph-solution-risk-at\",\r\n \"vh-ui-glyph-solution-risk-high\",\r\n \"vh-ui-glyph-solution-risk-low\",\r\n \"vh-ui-glyph-solution-risk-rising\",\r\n \"vh-ui-glyph-time-all\",\r\n \"vh-ui-glyph-time-ccm\",\r\n \"vh-ui-glyph-time-clinical\",\r\n \"vh-ui-glyph-time-rpm\",\r\n \"vh-ui-glyph-time-session\",\r\n \"vh-ui-glyph-time\",\r\n \"vh-ui-glyph-users\",\r\n \"vh-ui-glyph-country-mexico\",\r\n \"vh-ui-glyph-country-us\",\r\n \"vh-ui-glyph-item-glucose\",\r\n \"vh-ui-glyph-item-spyro\",\r\n \"vh-ui-glyph-action-filter\",\r\n \"vh-ui-glyph-action-request\"\r\n ];\r\n\r\n return {\r\n\r\n getFA: function() { Promise.resolve(faIconClasses); },\r\n getVivify: function() { return Promise.resolve(vhIcons); },\r\n getAll: function() { return Promise.resolve(faIconClasses.concat(vhIcons)); }\r\n\r\n }\r\n\r\n}\r\n\r\nangular.module('repos').factory('IconsRepository', IconsRepository);\r\n","function KeepAliveRepository($http) {\r\n return {\r\n get: function () {\r\n return $http.get('/api/KeepAlive').then(\r\n function (response) {\r\n return response.data;\r\n },\r\n function(rejection) {\r\n if (rejection) {\r\n rejection.preventDefault();\r\n }\r\n }\r\n );\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('KeepAliveRepository', KeepAliveRepository);\r\n","(function(angular) {\r\n var moduleName = 'repos';\r\n var factoryName = 'KitRepository';\r\n var dependencies = ['$http'];\r\n var constructor = function($http) {\r\n return {\r\n getAll: function() {\r\n return $http.get('/api/Kit').then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n };\r\n };\r\n\r\n angular.module(moduleName).factory(factoryName, dependencies.concat(constructor));\r\n})(angular);\r\n","function KitLocationRepository($http) {\r\n return {\r\n getAll: function () {\r\n return $http.get('/api/KitLocation').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getAllAssignableStatusesAndLocations: function() {\r\n return $http.get('/api/KitLocation/StatusesAndLocationsForKitAssignment').then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n moveKits: function(kitIds, locationId, statusId) {\r\n return $http.post('/api/KitLocation/MoveKits', {\r\n KitIds: kitIds,\r\n KitLocationId: locationId,\r\n KitStatusId: statusId\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n save: function(data) {\r\n return $http.post('/api/KitLocation', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n delete: function(id) {\r\n return $http.delete('/api/KitLocation/' + id).then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('KitLocationRepository', KitLocationRepository);\r\n","function KitProvisioningRepository($http) {\r\n return {\r\n getAll: function () {\r\n return $http.get('/api/KitProvisioning').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n provision: function(id) {\r\n return $http.post('/api/KitProvisioning/' + id).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n };\r\n}\r\n\r\nangular.module('repos').factory('KitProvisioningRepository', KitProvisioningRepository);\r\n","function PatientLanguageRepository($http, PendingService) {\r\n\r\n return {\r\n getAll: function () {\r\n return PendingService.promise('get patient language', () => $http.get('/api/PatientLanguage'))\r\n .then(\r\n function (response) {\r\n return response.data\r\n });\r\n }\r\n };\r\n}\r\nangular.module('repos').factory('PatientLanguageRepository', PatientLanguageRepository);\r\n","function PatientSummaryRepository($http) {\r\n return {\r\n get: function (id) {\r\n return $http.get('/api/PatientSummary/' + id).then(\r\n function (response) {\r\n return response.data\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('PatientSummaryRepository', PatientSummaryRepository);\r\n","function PatientSurveyRepository($http) {\r\n return {\r\n get: function (patientId, patientSurveyId, presentUnansweredQuestions) {\r\n return $http.get(`/api/Patient/${patientId}/PatientSurvey/${patientSurveyId}`, {\r\n params: {\r\n presentUnansweredQuestions: presentUnansweredQuestions,\r\n }\r\n }).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n create: function (patientId, surveyTemplateId) {\r\n var data = { SurveyTemplateId: surveyTemplateId };\r\n return $http.post(`/api/Patient/${patientId}/PatientSurvey`, data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n delete: function (patientId, patientSurveyId) {\r\n return $http.delete(`/api/Patient/${patientId}/PatientSurvey/${patientSurveyId}`).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n save: function (patientId, patientSurvey) {\r\n let patientSurveyId = patientSurvey.PatientSurveyId;\r\n return $http.put(`/api/Patient/${patientId}/PatientSurvey/${patientSurveyId}`, patientSurvey).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n pushSurveyToTablet: function (patientId) {\r\n return $http.get(`/api/Patient/${patientId}/PatientSurvey/Publish`).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n setPatientSurveyStatus: function (patientId, patientSurveyId, statusId) {\r\n return $http.put(`/api/Patient/${patientId}/PatientSurvey/${patientSurveyId}/Status?StatusId=${statusId}`).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n discontinuePatientSurvey: function (patientId, data) {\r\n return $http.post(`/api/Patient/${patientId}/PatientSurvey/Status`, data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n createByTemplate: function(surveyTemplateId, preview) {\r\n return $http.post(`/api/PatientSurvey/ByTemplatePopulation?SurveyTemplateId=${surveyTemplateId}&preview=${preview}`).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n deleteByTemplate: function(surveyTemplateId, preview) {\r\n return $http.delete(`/api/PatientSurvey/ByTemplate?SurveyTemplateId=${surveyTemplateId}&preview=${preview}`).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('PatientSurveyRepository', PatientSurveyRepository);\r\n","function PatientSurveyScheduleRepository($http) {\r\n return {\r\n save: function (data) {\r\n return $http.post('/api/PatientSurveySchedule', data);\r\n }, \r\n\r\n saveSchedules: function(schedules) {\r\n return $http.post(\"/api/PatientSurveySchedule/UpdateSurveySchedules\", schedules);\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('PatientSurveyScheduleRepository', PatientSurveyScheduleRepository);\r\n","class PendingService {\r\n\r\n constructor(){\r\n this.pending = {};\r\n }\r\n\r\n promise(key, promiseCallback){\r\n \r\n var item = this.pending[key];\r\n \r\n if(item)\r\n return item;\r\n \r\n this.pending[key] = promiseCallback();\r\n \r\n this.pending[key].then(value =>{\r\n this.pending[key] = null;\r\n return value;\r\n });\r\n \r\n return this.pending[key];\r\n }\r\n\r\n}\r\n \r\n\r\nangular.module('repos').factory('PendingService', function(){ return new PendingService(...arguments)});\r\n","function PopulationsRepository($http) {\r\n return {\r\n getAll: function (options) {\r\n var params = Object.assign({ enabledOnly: true, allSites: false, clearCache: false }, options);\r\n return $http.get('/api/Population', { params: params }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('PopulationsRepository', PopulationsRepository);\r\n","function QuestionRepository($http, $cacheFactory, ResponseTransformers) {\r\n\r\n var questionCache = $cacheFactory('SurveyQuestions', { capacity: 20 });\r\n var transform$Ref = ResponseTransformers.transform$Ref;\r\n\r\n return {\r\n importHealthTips: function(importData){\r\n questionCache.removeAll();\r\n return $http.post('/api/import/healthTips/', importData).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n clearCache: function(){\r\n questionCache.removeAll()\r\n },\r\n\r\n searchQuestions: function (searchText, categoryId, languageId, pageSize, page) {\r\n return $http.get('/api/SurveyQuestion', {\r\n cache: questionCache,\r\n transformResponse: transform$Ref,\r\n params: {\r\n searchText: searchText,\r\n categoryId: categoryId,\r\n languageId: languageId,\r\n pageSize: pageSize,\r\n page: page\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n searchQuestionsByType: function (searchText, questionTypeId, languageId) {\r\n return $http.get('/api/SurveyQuestion', {\r\n cache: questionCache,\r\n transformResponse: transform$Ref,\r\n params: {\r\n searchText: searchText,\r\n questionTypeId: questionTypeId,\r\n languageId: languageId\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n searchQuestionsByTypeAndPageNumber: function (page, pageSize, categoryId) {\r\n if (categoryId == undefined){ categoryId = 0;}\r\n return $http.get('/api/surveyquestion/HealthTips?pageSize='+pageSize+'&page='+page+\"&categoryId=\"+categoryId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n get: function (id) {\r\n return $http.get('/api/SurveyQuestion/' + id, { transformResponse: transform$Ref }).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getUncategorized: function (searchText, languageId, pageSize, page) {\r\n return $http.get('/api/SurveyQuestion', {\r\n cache: questionCache,\r\n transformResponse: transform$Ref,\r\n params: {\r\n uncategorized: true,\r\n searchText: searchText,\r\n languageId: languageId,\r\n pageSize: pageSize,\r\n page: page\r\n }\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n save: function (question, templatesToUpdate) {\r\n questionCache.removeAll();\r\n return $http.post('/api/SurveyQuestion', {model: question, surveyTemplatesToUpdate: templatesToUpdate}).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n delete: function (id) {\r\n questionCache.removeAll();\r\n return $http.delete('/api/SurveyQuestion/' + id);\r\n },\r\n\r\n create: function (data) {\r\n questionCache.removeAll();\r\n return $http.put('/api/SurveyQuestion', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getTemplates(id) {\r\n return $http.get('/api/SurveyQuestion/' + id + '/SurveyTemplates');\r\n },\r\n\r\n isQuestionAssignedToPatientPathway(id) {\r\n return $http.get('/api/SurveyQuestion/' + id + '/PatientPathway');\r\n },\r\n\r\n getHealthTips() {\r\n return $http.get('/api/SurveyQuestion/HealthTips').then(function (response) {\r\n return response.data;\r\n })\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('QuestionRepository', QuestionRepository);\r\n","function QuestionCategoryRepository($http) {\r\n return {\r\n importQuestionCategories: function(importData){\r\n return $http.post('/api/import/surveyquestions/', importData).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getAll: function () {\r\n return $http.get('/api/SurveyQuestionCategory').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n searchCategories: function (searchText) {\r\n return $http.get('/api/SurveyQuestionCategory?SearchText=' + searchText).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n create: function (data) {\r\n return $http.put('/api/SurveyQuestionCategory', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n save: function (data) {\r\n return $http.post('/api/SurveyQuestionCategory', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\ns\r\n },\r\n\r\n delete: function (id) {\r\n return $http.delete('/api/SurveyQuestionCategory/' + id);\r\n }\r\n\r\n };\r\n}\r\n\r\nangular.module('repos').factory('QuestionCategoryRepository', QuestionCategoryRepository);\r\n","function QuestionTypeRepository($q) {\r\n var questionTypes = [\r\n {\r\n \"Name\": \"Yes/No\",\r\n \"TypeId\": 10\r\n },\r\n {\r\n \"Name\": \"Single Selection\",\r\n \"TypeId\": 6\r\n },\r\n {\r\n \"Name\": \"Multi Selection\",\r\n \"TypeId\": 7\r\n },\r\n {\r\n \"Name\": \"Likert Scale\",\r\n \"TypeId\": 6\r\n },\r\n {\r\n \"Name\": \"Video\",\r\n \"TypeId\": 9\r\n },\r\n {\r\n \"Name\": \"Custom Response\",\r\n \"TypeId\": 17\r\n }\r\n ];\r\n return {\r\n getAll: function () {\r\n return $q(function(resolve, reject) {\r\n resolve({data:questionTypes});\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('QuestionTypeRepository', QuestionTypeRepository);\r\n","function ResourceLibraryRepository($http) {\r\n return {\r\n getResourceLibraryGroups: function() {\r\n return $http.get('/api/ResourceLibrary/groups').then(function(response) {\r\n return response.data;\r\n })\r\n },\r\n deleteThumbnail: function(resourceId, type, languageId){\r\n var url = \"/api/ResourceLibrary/thumbnails/\" + resourceId + \"/\" + type + '/' + languageId;\r\n return $http.delete(url).then(x =>{\r\n return x;\r\n })\r\n },\r\n importResourceLibraryCategories: function(importData) {\r\n return $http.post('/api/import/libraryTiles/', importData).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('ResourceLibraryRepository', ResourceLibraryRepository);\r\n","function TagRepository($http) {\r\n return {\r\n \r\n getSurveyTags: function() {\r\n return $http.get('/api/Tag').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n \r\n };\r\n}\r\n\r\nangular.module('repos').factory('TagRepository', TagRepository);\r\n","function TemplateRepository($http, $cacheFactory, FileUploader, ResponseTransformers) {\r\n\r\n var templateCache = $cacheFactory('SurveyTemplates', { capacity: 20 });\r\n var transform$Ref = ResponseTransformers.transform$Ref;\r\n\r\n return {\r\n importTemplates(templates){\r\n templateCache.removeAll();\r\n return $http.post('/api/import/pathways', templates).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getValidationData(){\r\n return $http.get('/api/import/validation/pathways').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getAll: function () {\r\n return $http.get('/api/SurveyTemplate', { cache: templateCache }).then(\r\n function (response) {\r\n return response.data\r\n });\r\n },\r\n get: function (id) {\r\n return $http.get('/api/SurveyTemplate/' + id, {\r\n transformResponse: transform$Ref\r\n }).then(function (response) {\r\n return response.data\r\n });\r\n },\r\n searchTemplates: function (searchText) {\r\n return $http.get('/api/SurveyTemplate', {\r\n params: { searchText: searchText },\r\n cache: templateCache\r\n }).then(function (response) {\r\n return response.data\r\n });\r\n },\r\n delete: function (id) {\r\n templateCache.removeAll();\r\n return $http.delete('/api/SurveyTemplate/' + id);\r\n },\r\n save: function (model) {\r\n templateCache.removeAll();\r\n return $http.post('/api/SurveyTemplate', model);\r\n },\r\n\r\n getFileUploader: function() {\r\n var fileUploader = new FileUploader({\r\n url: '/api/ImportTemplate'\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function(item, options) {\r\n var i = item.name.indexOf('.json');\r\n return i !== -1;\r\n }\r\n });\r\n return fileUploader;\r\n }\r\n };\r\n}\r\nangular.module('repos').factory('TemplateRepository', TemplateRepository);\r\n","function TemplateGroupRepository($http) {\r\n return {\r\n getAll: function () {\r\n return $http.get('/api/TemplateGroup').then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('TemplateGroupRepository', TemplateGroupRepository);\r\n","function TemplateScheduleRepository($http) {\r\n return {\r\n save: function (data) {\r\n return $http.post('/api/SurveySchedule', data);\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('TemplateScheduleRepository', TemplateScheduleRepository);\r\n","function VideoRepository($http) {\r\n return {\r\n getAllVideos: function () {\r\n return $http.get('/api/Video', {cache: true}).then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n },\r\n getVideos: function (searchText, pageSize, page, contentProviderId) {\r\n if (contentProviderId == undefined) { contentProviderId = 0; }\r\n return $http.get('/api/Video', {\r\n params: {\r\n searchText: searchText,\r\n pageSize: pageSize,\r\n page: page,\r\n contentProviderId: contentProviderId\r\n }\r\n }).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getVideo: function (videoId) {\r\n return $http.get('/api/Video/' + videoId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n create: function (video) {\r\n return $http.post('/api/Video/Create', video);\r\n },\r\n update: function (video) {\r\n return $http.put('/api/Video/', video);\r\n }, \r\n importVideos(importData){\r\n return $http.post('/api/import/videos/', importData).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n delete: function (videoId) {\r\n return $http.delete('/api/Video/' + videoId);\r\n },\r\n getContentProviders: function(){\r\n return $http.get('/api/Video/ContentProviders').then(\r\n function (response) {\r\n return response.data;\r\n }\r\n );\r\n },\r\n videoUploadUrl: \"/api/Video\"\r\n }\r\n}\r\n\r\nangular.module('repos').factory('VideoRepository', VideoRepository);\r\n","function WebFormFieldRepository($http) {\r\n return {\r\n get: function() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/WebFormField'\r\n })\r\n .then(function(res){\r\n return res.data;\r\n });\r\n },\r\n getByFieldName: function (name) {\r\n return $http.get('/api/WebFormField?name=' + name).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('WebFormFieldRepository', WebFormFieldRepository);\r\n","function BiometricsController($scope, $state, $stateParams, $uibModal, lodash, vhSweetAlert, populations, PermissionService, BiometricsService, NavigationService, AuthorizationService) {\r\n var vm = this;\r\n\r\n vm.populationId = $stateParams.populationId;\r\n vm.populationName = $stateParams.populationName;\r\n\r\n vm.populations = populations;\r\n vm.availablePopulations = [];\r\n vm.configuredPopulations = [];\r\n\r\n var hasConfigurationsWrite = PermissionService.userHasPermission([\"ConfigurationsWrite\"]);\r\n var hasAdvancedConfigurationsWrite = PermissionService.userHasPermission([\"AdvancedConfigurationsWrite\"]);\r\n vm.canEditSetting = canEditSetting;\r\n vm.toggleHead = toggleHead;\r\n vm.getDescription = getDescription;\r\n vm.editSetting = editSetting;\r\n vm.addPopulation = addPopulation;\r\n vm.resetPopulation = resetPopulation;\r\n vm.removePopulation = removePopulation;\r\n vm.listLoading = false;\r\n vm.filter = \"\";\r\n vm.expanded = \"Collapse All\";\r\n vm.toggleExpandAll = toggleExpandAll;\r\n vm.searchvalue = searchvalue;\r\n vm.searchhead = searchhead;\r\n vm.siteName = '';\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.listLoading = true;\r\n BiometricsService.get(vm.populationId).then(function (data) {\r\n vm.listLoading = false;\r\n vm.settings = data;\r\n vm.heads = mapHeaders(data);\r\n vm.headList = Object.keys(vm.heads).sort();\r\n vm.sortedHeads = [];\r\n for (var i = 0; i < vm.headList.length; ++i) {\r\n var obj = { \"name\": vm.headList[i], \"obj\": vm.heads[vm.headList[i]] };\r\n vm.sortedHeads.push(obj);\r\n }\r\n\r\n vm.canEditSettings = canEditSettings();\r\n\r\n });\r\n\r\n BiometricsService.getBiometricGroups().then(function (configuredPopulations) {\r\n vm.configuredPopulations = configuredPopulations;\r\n });\r\n\r\n AuthorizationService.getSites().then(sites => {\r\n vm.siteName = sites.filter(s => s.IsCurrent)[0].Name;\r\n });\r\n }\r\n\r\n function toggleExpandAll(head, headList) {\r\n vm.listLoading = true;\r\n var expandOrUnexpand = false;\r\n if (vm.expanded == \"Collapse All\") {\r\n expandOrUnexpand = true;\r\n vm.expanded = \"Expand All\";\r\n } else { vm.expanded = \"Collapse All\"; }\r\n\r\n for (i = 0; i < headList.length; ++i) {\r\n head[headList[i]].visible = expandOrUnexpand;\r\n }\r\n vm.listLoading = false;\r\n }\r\n\r\n function mapHeaders(settings) {\r\n var heads = {};\r\n for (var i = 0; i < settings.length; i++) {\r\n if (heads[settings[i].Name] == undefined) {\r\n heads[settings[i].Name] = [];\r\n }\r\n heads[settings[i].Name].push({ \"visible\": false, \"obj\": settings[i] });\r\n }\r\n return heads;\r\n }\r\n\r\n function toggleHead(head) {\r\n head.visible = !head.visible;\r\n }\r\n\r\n function searchhead(value, index, array) {\r\n if (vm.filter.length > 0) {\r\n var filter = vm.filter.toUpperCase().replace(/ /g, '');\r\n var str = value.name.toUpperCase().replace(/ /g, '');\r\n if (str.indexOf(filter) !== -1) {\r\n return true;\r\n } else {\r\n for (var i = 0; i < value.obj.length; ++i) {\r\n var param = value.obj[i].obj.Param.toUpperCase().replace(/ /g, '');\r\n if (param.indexOf(filter) !== -1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n function searchvalue(value, index, array) {\r\n if (vm.filter.length > 0) {\r\n var filter = vm.filter.toUpperCase().replace(/ /g, '');\r\n var str = value.obj.Param.toUpperCase().replace(/ /g, '');\r\n if (str.indexOf(filter) !== -1) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n function canEditSettings() {\r\n var retVal = false;\r\n\r\n for (var i = 0; i < vm.settings.length; i++) {\r\n retVal = canEditSetting(vm.settings[i]);\r\n if (retVal === true) {\r\n break;\r\n }\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function canEditSetting(setting) {\r\n var retVal = false;\r\n\r\n switch (setting.SecurityActivityId) {\r\n case 1001:\r\n retVal = hasConfigurationsWrite;\r\n break;\r\n case 1019:\r\n retVal = hasAdvancedConfigurationsWrite;\r\n break;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function editSetting(setting) {\r\n if (vm.populationId == -1) {\r\n vhSweetAlert.verify('Are you sure?', 'This will change the Default System settings', 'Edit Default Value')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n doEdit(setting);\r\n }\r\n });\r\n }\r\n else {\r\n doEdit(setting);\r\n }\r\n }\r\n\r\n function doEdit(setting) {\r\n $uibModal.open({\r\n templateUrl: 'modules/site/biometrics/biometrics.modal.html',\r\n controller: 'EditBiometricController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n setting: function () {\r\n return angular.copy(setting);\r\n },\r\n populationId: function() {\r\n return vm.populationId;\r\n }\r\n }\r\n }).result\r\n .then(function (updatedSetting) {\r\n setting.Value = updatedSetting.Value;\r\n });\r\n }\r\n\r\n function addPopulation(){\r\n $uibModal.open({\r\n templateUrl: 'modules/configurations/content/addpopulation.modal.html',\r\n controller: 'AddPopulationController as vm',\r\n keyboard: false,\r\n resolve: {\r\n canAssignDisabledItems: () => false,\r\n showDisabled: () => false,\r\n availablePopulations: function () {\r\n return availablePopulations();\r\n }\r\n }\r\n }).result.then(function ({populationId, showDisabled}) {\r\n \r\n BiometricsService.addPopulation(populationId).then(function (settings) {\r\n NavigationService.refreshBiometricGroups(); \r\n $state.go(\"site.biometrics\", \r\n {\r\n populationId: populationId,\r\n populationName: populations.find(function(population){\r\n return population.PopulationId == populationId;\r\n }).PopulationName\r\n });\r\n });\r\n });\r\n }\r\n\r\n function resetPopulation(){\r\n // confirm\r\n vhSweetAlert.verify('Are you sure?', 'This will undo all your custom settings', 'Reset To Default')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n BiometricsService.resetPopulation(vm.populationId).then(function (data) {\r\n vm.settings = data;\r\n $state.go(\"site.biometrics\", \r\n {\r\n populationId: vm.populationId,\r\n populationName: vm.populationName\r\n },\r\n {\r\n reload:true\r\n });\r\n });\r\n }\r\n });\r\n }\r\n\r\n function removePopulation(){\r\n // confirm\r\n vhSweetAlert.verify('Are you sure?', 'This will delete this biometric program and all its customized settings', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n BiometricsService.removePopulation(vm.populationId).then(function () {\r\n NavigationService.refreshBiometricGroups(); \r\n $state.go(\"site.biometrics\", \r\n {\r\n populationId: -1,\r\n populationName: 'Default'\r\n });\r\n });\r\n }\r\n });\r\n }\r\n\r\n function availablePopulations() {\r\n return lodash.filter(vm.populations, function (population) {\r\n return !lodash.any(vm.configuredPopulations, {PopulationId: population.PopulationId});\r\n });\r\n }\r\n\r\n function getDescription(setting) {\r\n var retVal = 'No description.';\r\n\r\n if (setting.Description) {\r\n if (setting.Description !== null && setting.Description !== undefined) {\r\n retVal = setting.Description;\r\n }\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n}\r\n\r\nangular.module('site.biometrics').controller('BiometricsController', BiometricsController);\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/biometrics/biometrics.modal.html',\n '

          {{vm.setting.Param | pascalSpacing}}

          {{vm.setting.Description}}

          ');\n}]);\n}(window, document, window.angular));","function BiometricsService($http, PopulationsRepository){\r\n\r\n // this gets the actual biometric parameters\r\n var get = function(populationId){\r\n return $http.get(\r\n \"/api/Configuration/Population\", \r\n {\r\n params: { \r\n populationId: populationId \r\n } \r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n function getAllPopulations(){\r\n return PopulationsRepository.getAll();\r\n }\r\n\r\n // gets sub menu items\r\n function getBiometricGroups(){\r\n return $http.get(\"/api/Configuration/Population/GetBiometricGroups\").then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n var update = function(setting, populationId){\r\n return $http({\r\n method:'PUT',\r\n url:'/api/Configuration/Population/' + populationId,\r\n data: setting\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var addPopulation = function(populationId){\r\n return $http({\r\n method:'POST',\r\n url:'/api/Configuration/Population/' + populationId\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var resetPopulation = function(populationId){\r\n return $http({\r\n method:'PUT',\r\n url:'/api/Configuration/Population/biometrics/' + populationId + '/reset'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var removePopulation = function(populationId){\r\n return $http({\r\n method:'DELETE',\r\n url:'/api/Configuration/Population/biometrics/' + populationId\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n return {\r\n get: get,\r\n update: update,\r\n getAllPopulations: getAllPopulations,\r\n getBiometricGroups: getBiometricGroups,\r\n addPopulation: addPopulation,\r\n resetPopulation: resetPopulation,\r\n removePopulation: removePopulation\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('site.biometrics').factory('BiometricsService', BiometricsService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/biometrics/biometrics.tpl.html',\n '

          Biometrics

          {{vm.populationName}} 0\">({{vm.siteName}})
          0\" class=\"table table-bordered\">
          {{head.name}}
          {{setting.obj.Param | pascalSpacing}}{{setting.obj.Value}} ******************
          ');\n}]);\n}(window, document, window.angular));","function EditBiometricController(setting, populationId, BiometricsService, PermissionService, $uibModalInstance) {\r\n var vm = this;\r\n \r\n vm.setting = setting;\r\n vm.populationId = populationId;\r\n \r\n loadController();\r\n \r\n function loadController() {\r\n vm.canEditBiometrics = PermissionService.userHasPermission([\"ConfigurationsWrite\"]);\r\n \r\n vm.saveBiometric = saveBiometric;\r\n vm.cancelEditing = cancelEditing;\r\n }\r\n \r\n function saveBiometric(isValid) {\r\n if(isValid) {\r\n BiometricsService.update(setting, populationId).then(function(savedSetting) {\r\n if(savedSetting){\r\n $uibModalInstance.close(savedSetting);\r\n }\r\n else {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n });\r\n }\r\n }\r\n \r\n function cancelEditing() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n }\r\n \r\n angular.module('site.biometrics').controller('EditBiometricController', EditBiometricController);\r\n ","function HospitalModalController($scope, lodash, Hospital, TimeZones, $uibModalInstance, HospitalsService, CanEdit, $filter) {\r\n var vm = this;\r\n vm.hospital = Hospital;\r\n vm.timeZones = TimeZones;\r\n vm.canEdit = CanEdit; \r\n vm.toggle = toggle;\r\n vm.toggleClass = toggleClass;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss();\r\n }\r\n\r\n function ok() {\r\n if ($scope.hospitalForm.$valid && vm.canEdit) {\r\n if (vm.hospital.PhoneNumberUnFormatted) {\r\n var formattedNumber = $filter('tel')(vm.hospital.PhoneNumberUnFormatted)\r\n vm.hospital.PhoneNumber = formattedNumber\r\n }\r\n else {\r\n vm.hospital.PhoneNumber = vm.hospital.PhoneNumberUnFormatted\r\n }\r\n if(vm.hospital.Id && vm.hospital.Id > 0) {\r\n HospitalsService.update(vm.hospital.Id, vm.hospital).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n } else {\r\n HospitalsService.create(vm.hospital).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n }\r\n\r\n function toggle(prop) {\r\n if(vm.canEdit) {\r\n vm.hospital[prop] = !vm.hospital[prop];\r\n }\r\n }\r\n\r\n function toggleClass(prop) {\r\n return vm.hospital[prop] == true ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n }\r\n}\r\n\r\nangular.module('site.hospitals').controller('HospitalModalController', HospitalModalController)","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/hospitals/hospital.modal.html',\n '

          Hospital

          Required
          Required
          Phone is invalid
          ');\n}]);\n}(window, document, window.angular));","function HospitalsController(Hospitals, PatientCounts, vhSweetAlert, HospitalsService, lodash, $uibModal, PermissionService, $filter) {\r\n var vm = this;\r\n\r\n vm.canEdit = PermissionService.userHasPermission(['HospitalSettingsWrite']);\r\n vm.allFacilityButtonText = \"\";\r\n vm.isAllFacilityButtonDisabled = false;\r\n vm.hospitals = Hospitals;\r\n\r\n vm.openEdit = openEdit;\r\n vm.mapTimeZone = mapTimeZone;\r\n vm.delete = deleteHosptal;\r\n vm.patientCounts = PatientCounts;\r\n vm.toggleClass = toggleClass;\r\n vm.toggle = toggle;\r\n vm.updateAllFacilityFeeSetting = updateAllFacilityFeeSetting;\r\n \r\n activate();\r\n\r\n function activate() {\r\n refreshHospitals();\r\n }\r\n\r\n function refreshHospitals() {\r\n if (vm.hospitals.length > 0) {\r\n vm.hospitals = lodash.sortBy(vm.hospitals, 'SortOrder');\r\n }\r\n\r\n vm.dragListeners = {\r\n contain: '#hospitals',\r\n orderChanged: orderChanged,\r\n accept: accept\r\n };\r\n determineFacilityButtonParams();\r\n\r\n }\r\n\r\n function deleteHosptal(event, hospital) {\r\n vhSweetAlert.verify(\"Are you sure?\", \"Do you want to delete \" + hospital.FacilityName + \"?\", \"Delete\")\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n hospital.IsDeleted = 1;\r\n hospital.IsEnabled = 0;\r\n hospital.IsDefault = 0;\r\n HospitalsService.update(hospital.Id, hospital).then(function(data) {\r\n var index = vm.hospitals.indexOf(hospital);\r\n vm.hospitals.splice(index, 1);\r\n refreshHospitals();\r\n });\r\n }\r\n });\r\n }\r\n\r\n function openEdit(event, hospital) {\r\n event.preventDefault();\r\n var original = angular.copy(hospital);\r\n original.PhoneNumberUnFormatted = original.PhoneNumber ? $filter('phone')(original.PhoneNumber) : null;\r\n\r\n // set sort order for new hospital and also show default setting for Facility Fee\r\n if (!original.Id) {\r\n original.SortOrder = vm.hospitals.length > 0 ? vm.hospitals[vm.hospitals.length - 1].SortOrder + 1 : 1;\r\n HospitalsService.getHospitalSettingDefault().then(function (defaultSettings) {\r\n original.FacilityFeeEnabled = defaultSettings.FacilityFeeEnabled;\r\n openHospitalModal(original, hospital);\r\n });\r\n \r\n } else {\r\n openHospitalModal(original, hospital);\r\n }\r\n }\r\n\r\n function openHospitalModal(original, hospital) {\r\n $uibModal.open({\r\n templateUrl: 'modules/site/hospitals/hospital.modal.html',\r\n controller: 'HospitalModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n Hospital: function () {\r\n return original;\r\n },\r\n TimeZones: function () {\r\n return timeZones;\r\n },\r\n CanEdit: function () {\r\n return vm.canEdit;\r\n }\r\n }\r\n }).result.then(function (data) {\r\n updateHospitalList(hospital, data);\r\n if (data.IsDefault === true) {\r\n resetDefault(data);\r\n }\r\n }, function () {\r\n // cancelled\r\n });\r\n }\r\n\r\n\r\n function toggleClass(value) {\r\n return value == true ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n }\r\n\r\n function toggle(event, item, prop) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n item[prop] = !item[prop];\r\n saveHospital(item);\r\n\r\n if (prop === 'IsDefault') {\r\n resetDefault(item);\r\n }\r\n\r\n determineFacilityButtonParams();\r\n }\r\n\r\n function resetDefault(updatedHospital) {\r\n vm.hospitals.filter(function(hospital) {\r\n return hospital.Id !== updatedHospital.Id;\r\n }).forEach(function(hospital) {\r\n if (hospital.IsDefault) {\r\n hospital.IsDefault = false;\r\n saveHospital(hospital);\r\n }\r\n });\r\n }\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n \r\n list.map(function(listItem, index) {\r\n listItem.SortOrder = index;\r\n return listItem;\r\n });\r\n\r\n updateHospitals(list);\r\n }\r\n\r\n function updateHospitals(list) {\r\n list.forEach(function(h) {\r\n saveHospital(h);\r\n });\r\n }\r\n\r\n function updateHospitalList(hospital, newHospital) {\r\n var index = vm.hospitals.indexOf(hospital);\r\n if (index >= 0) {\r\n vm.hospitals[index] = newHospital;\r\n } else {\r\n getHospitals();\r\n }\r\n }\r\n\r\n function saveHospital(hospital) {\r\n HospitalsService.update(hospital.Id, hospital);\r\n }\r\n\r\n function getHospitals() {\r\n HospitalsService.get().then(function(data) {\r\n vm.hospitals = data;\r\n refreshHospitals();\r\n });\r\n }\r\n\r\n function accept(sourceItemHandleScope, destSortableScope, destItemScope) {\r\n return vm.canEdit && sourceItemHandleScope.sortableScope.modelValue[0].SiteId === destSortableScope.modelValue[0].SiteId;\r\n }\r\n\r\n function mapTimeZone(id) {\r\n var retval = lodash.find(timeZones, function(o) { return o.id == id });\r\n return retval;\r\n }\r\n\r\n function determineFacilityButtonParams() {\r\n var hasFacilityFeeEnabled = vm.hospitals.map(x => x.FacilityFeeEnabled).indexOf(true) != -1;\r\n var hasFacilityFeeDisabled = vm.hospitals.map(x => x.FacilityFeeEnabled).indexOf(false) != -1;\r\n vm.isAllFacilityButtonDisabled = (hasFacilityFeeEnabled && hasFacilityFeeDisabled);\r\n if (hasFacilityFeeDisabled) {\r\n vm.allFacilityButtonText = 'Enable All Facility Fee';\r\n }\r\n else {\r\n vm.allFacilityButtonText = 'Disable All Facility Fee';\r\n }\r\n }\r\n\r\n function updateAllFacilityFeeSetting(event) {\r\n event.preventDefault();\r\n var hasFacilityFeeEnabled = vm.hospitals.map(x => x.FacilityFeeEnabled).indexOf(true) != -1;\r\n var enableConfirmationString = hasFacilityFeeEnabled ? \"disable\" : \"enable\";\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to ' + enableConfirmationString + ' the facility fee for all hospitals?', 'Confirm')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n var allFacilityFeeSetting =\r\n {\r\n FacilityFeeEnabled: !hasFacilityFeeEnabled\r\n };\r\n HospitalsService.updateAllFacilityFeeSetting(allFacilityFeeSetting).then(function (data) {\r\n vm.hospitals = data;\r\n refreshHospitals();\r\n });\r\n }\r\n }\r\n );\r\n }\r\n\r\n var timeZones = [\r\n { 'id': 0, 'name': '(UTC) Coordinated Universal Time (No DST)'},\r\n { 'id': 2, 'name': '(UTC-04:00) Atlantic'},\r\n { 'id': 3, 'name': '(UTC-05:00) Eastern Time'},\r\n { 'id': 4, 'name': '(UTC-05:00) Indiana (No DST)'},\r\n { 'id': 5, 'name': '(UTC-06:00) Central Time'},\r\n { 'id': 7, 'name': '(UTC-07:00) Arizona (No DST)'},\r\n { 'id': 8, 'name': '(UTC-07:00) Mountain Time'},\r\n { 'id': 9, 'name': '(UTC-08:00) Pacific Time'},\r\n { 'id': 10,'name': '(UTC-09:00) Alaska'},\r\n { 'id': 11,'name': '(UTC-10:00) Hawaii (No DST)'},\r\n { 'id': 12,'name': '(UTC) Greenwhich Mean Time'},\r\n ]\r\n\r\n}\r\n\r\nangular.module('site.hospitals').controller('HospitalsController', HospitalsController);","function HospitalsService($http) {\r\n \r\n return {\r\n get: get,\r\n update: update,\r\n create: create,\r\n getPatientCounts: getPatientCounts,\r\n updateAllFacilityFeeSetting: updateAllFacilityFeeSetting,\r\n getHospitalSettingDefault: getHospitalSettingDefault\r\n };\r\n \r\n function get() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/HospitalSettings'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n \r\n function getPatientCounts() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/HospitalSettings/PatientCount'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getHospitalSettingDefault() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/HospitalSettings/HospitalSettingDefault'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n function update(id, hospital) {\r\n return $http({\r\n method: 'PUT',\r\n url: '/api/HospitalSettings/' + id,\r\n data: hospital\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n \r\n function create(hospital) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/HospitalSettings',\r\n data: hospital\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateAllFacilityFeeSetting(allFacilityFeeSetting) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/HospitalSettings/UpdateAllFacilityFeeSetting',\r\n data: allFacilityFeeSetting\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n \r\n }\r\n \r\n angular.module('site.hospitals').factory('HospitalsService', HospitalsService)","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/hospitals/hospitals.tpl.html',\n '

          Hospitals

          0\">

          Hospital

          Ident

          Billing Account

          Default

          Enabled

          Facility Fee

          Tablet Reminders

          Third Party

          Time Zone

          Phone

          {{item.FacilityName}} {{vm.patientCounts[item.Id]}} patient(s)
           
          Ident:
          {{item.FacilityId}} 
          Billing Account:
          {{item.BillingSubAccountIdent}} 
          Default:
          Enabled:
          Facility Fee:
          Tablet Reminders:
          Third Party:
          {{vm.mapTimeZone(item.TimeZoneId).name}} 
          {{item.PhoneNumber|phone|tel}}
          {{vm.patientCounts[item.Id]}}
          ');\n}]);\n}(window, document, window.angular));","function PayersController($scope, $uibModal, payers, PayersService, CareManagementTypesService) {\r\n var vm = this;\r\n\r\n vm.payers = payers;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n\r\n vm.formatList = function (items, prop) {\r\n return items ? items.map(item => item ? item[prop] : '').join(', ') : '';\r\n }\r\n\r\n vm.getToggleClass = function (toggleValue) {\r\n return toggleValue ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n }\r\n\r\n vm.toggleIsDefault = function (payer, $event) {\r\n $event.stopPropagation();\r\n payer.IsDefault = !payer.IsDefault;\r\n setDefaults(payer);\r\n PayersService.updateAll(payers);\r\n }\r\n\r\n vm.toggleIsEnabled = function (payer, $event) {\r\n $event.stopPropagation();\r\n payer.IsEnabled = !payer.IsEnabled;\r\n PayersService.update(payer);\r\n }\r\n\r\n vm.toggleIsCPT = function (payer, $event) {\r\n $event.stopPropagation();\r\n payer.IsCPT = !payer.IsCPT;\r\n PayersService.update(payer);\r\n }\r\n\r\n vm.orderChanged = orderChanged;\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n resort(list);\r\n PayersService.updateAll(list);\r\n }\r\n\r\n vm.openEdit = function (payer) {\r\n $uibModal.open({\r\n templateUrl: 'modules/site/payers/payersEdit.tpl.html',\r\n controller: 'PayersEditController',\r\n resolve: {\r\n payer: function () {\r\n return angular.copy(payer);\r\n },\r\n careManagementTypes: function () {\r\n return CareManagementTypesService.getAll(true);\r\n }\r\n }\r\n }).result.then(function (updatedPayer) {\r\n if (!updatedPayer) return;\r\n\r\n var idx = vm.payers.indexOf(payer);\r\n if (idx >= 0) {\r\n vm.payers[idx] = updatedPayer;\r\n }\r\n else {\r\n vm.payers.push(updatedPayer);\r\n }\r\n\r\n if (updatedPayer.IsDefault === true) {\r\n setDefaults(updatedPayer);\r\n PayersService.updateAll(payers);\r\n }\r\n });\r\n }\r\n\r\n function resort(list) {\r\n for (var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n }\r\n\r\n function setDefaults(updatedPayer) {\r\n if (updatedPayer.IsDefault) {\r\n payers.forEach(payer => {\r\n if (payer != updatedPayer) {\r\n payer.IsDefault = false;\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('site.payers').controller('PayersController', PayersController);","function PayersService($http) {\r\n\r\n var create = function () {\r\n return {\r\n IsDefault: false,\r\n IsEnabled: false,\r\n IsCPT: false,\r\n CareManagementTypes: []\r\n }\r\n };\r\n\r\n var get = function () {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/payer?enabledOnly=false'\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var update = function (payer) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/payer',\r\n data: payer\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var updateAll = function (payers) {\r\n return $http({\r\n method: 'PUT',\r\n url: '/api/payer',\r\n data: payers\r\n }).then(function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n return {\r\n create: create,\r\n update: update,\r\n updateAll: updateAll,\r\n get: get\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('site.payers').factory('PayersService', PayersService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/payers/payers.tpl.html',\n '

          Name

          Is Default

          Enabled

          Billing Codes Enabled

          Care Management Types

          {{payer.Name}}
          {{vm.formatList(payer.CareManagementTypes, \\'Acronym\\')}}
          ');\n}]);\n}(window, document, window.angular));","function PayersEditController($scope, $uibModalInstance, payer, careManagementTypes, PayersService) {\r\n\r\n $scope.payer = payer || PayersService.create();\r\n $scope.careManagementTypes = careManagementTypes || [];\r\n\r\n //map care management types into payer\r\n if ($scope.payer.CareManagementTypes && $scope.careManagementTypes.length > 0) {\r\n const types = $scope.careManagementTypes.filter(type => $scope.payer.CareManagementTypes.find(t => t.Id === type.Id));\r\n $scope.payer.CareManagementTypes = types;\r\n }\r\n\r\n $scope.save = save;\r\n function save() {\r\n $scope.payerForm.$setSubmitted();\r\n if ($scope.payerForm.$valid) {\r\n PayersService.update($scope.payer).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n\r\n $scope.cancel = cancel\r\n function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n\r\n}\r\n\r\nangular.module('site.payers').controller('PayersEditController', PayersEditController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/payers/payersEdit.tpl.html',\n '

          {{payer.Id != null ? \\'Edit Payer\\' : \\'Add Payer\\'}}

          *Name is required
          ');\n}]);\n}(window, document, window.angular));","function PopulationGroupsController($scope, $uibModal, populationGroups, PopulationGroupsService,$filter){\r\n var vm = this;\r\n\r\n vm.populationGroups = populationGroups;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n\r\n\r\n vm.toggleIsDefault = function(populationGroup) {\r\n populationGroup.IsDefault = !populationGroup.IsDefault;\r\n setDefaults(populationGroup);\r\n PopulationGroupsService.updateAll(populationGroups);\r\n }\r\n\r\n vm.toggleIsEnabled = function(populationGroup) {\r\n populationGroup.IsEnabled = !populationGroup.IsEnabled;\r\n PopulationGroupsService.update(populationGroup);\r\n }\r\n\r\n vm.orderChanged = orderChanged;\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n resort(list);\r\n PopulationGroupsService.updateAll(list);\r\n }\r\n\r\n vm.openEdit = function (populationGroup) {\r\n if (populationGroup) {\r\n populationGroup.PhoneNumberUnFormatted = $filter('phone')(populationGroup.PhoneNumber)\r\n }\r\n $uibModal.open({\r\n templateUrl: 'modules/site/populationGroups/populationGroupsEdit.tpl.html',\r\n controller: 'PopulationGroupsEditController',\r\n resolve: {\r\n populationGroup: function () {\r\n return angular.copy(populationGroup);\r\n }\r\n }\r\n }).result.then(function(updatedPopulationGroup){\r\n if(!updatedPopulationGroup) {\r\n return;\r\n }\r\n var idx = vm.populationGroups.indexOf(populationGroup);\r\n if(idx>=0){\r\n vm.populationGroups[idx]=updatedPopulationGroup;\r\n }\r\n else {\r\n vm.populationGroups.push(updatedPopulationGroup);\r\n resort(vm.populationGroups);\r\n }\r\n setDefaults(updatedPopulationGroup);\r\n PopulationGroupsService.updateAll(populationGroups);\r\n });\r\n }\r\n\r\n function resort(list) {\r\n for(var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n }\r\n\r\n function setDefaults(updatedPopulationGroup) {\r\n if(updatedPopulationGroup.IsDefault) {\r\n populationGroups.forEach(populationGroup => {\r\n if(populationGroup != updatedPopulationGroup) {\r\n populationGroup.IsDefault = false;\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('site.populationGroups').controller('PopulationGroupsController', PopulationGroupsController);","function PopulationGroupsService($http){\r\n\r\n var get = function(o){\r\n\r\n var url = '/api/populationGroup?enabledOnly=';\r\n url += (o && o.enabledOnly) ? 'true' : 'false';\r\n\r\n return $http({\r\n method:'GET',\r\n url: url\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var update = function(populationGroup){\r\n return $http({\r\n method:'POST',\r\n url:'/api/populationGroup',\r\n data: populationGroup\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var updateAll = function(populationGroups){\r\n return $http({\r\n method:'PUT',\r\n url:'/api/populationGroup',\r\n data: populationGroups\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n return {\r\n update: update,\r\n updateAll: updateAll,\r\n get: get\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('site.populationGroups').factory('PopulationGroupsService', PopulationGroupsService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/populationGroups/populationGroups.tpl.html',\n '

          Program Groups

          Program Group

          Short Name

          Is Default

          Enabled

          Phone

              {{populationGroup.Name}}
          {{populationGroup.ShortName}}
          {{populationGroup.PhoneNumber|phone|tel}}
          ');\n}]);\n}(window, document, window.angular));","function PopulationGroupsEditController($scope, $uibModalInstance, populationGroup, PopulationGroupsService, $filter) {\r\n\r\n $scope.populationGroup = populationGroup || { };\r\n\r\n $scope.save = save;\r\n function save() {\r\n $scope.populationGroupForm.$setSubmitted();\r\n if ($scope.populationGroupForm.$valid) {\r\n if ($scope.populationGroup.PhoneNumberUnFormatted) {\r\n var formattedNumber = $filter('tel')($scope.populationGroup.PhoneNumberUnFormatted)\r\n $scope.populationGroup.PhoneNumber = formattedNumber\r\n } else {\r\n $scope.populationGroup.PhoneNumber = $scope.populationGroup.PhoneNumberUnFormatted\r\n }\r\n\r\n PopulationGroupsService.update($scope.populationGroup).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n\r\n $scope.cancel = cancel\r\n function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n\r\n}\r\n\r\nangular.module('site.populationGroups').controller('PopulationGroupsEditController', PopulationGroupsEditController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/populationGroups/populationGroupsEdit.tpl.html',\n '

          {{populationGroup.Id != null ? \\'Edit Program Group\\' : \\'Add New Program Group\\'}}

          {{populationGroup.Name}}
          *Name is required
          Phone is invalid
          Default
          Enabled
          ');\n}]);\n}(window, document, window.angular));","function PopulationCtrl($uibModal, populations, PopulationCount, vhSweetAlert, EditConfigurationsService, ConfigurationsService, PermissionService, $filter ) {\r\n\r\n var vm = this;\r\n vm.populations = populations;\r\n vm.populationCount = PopulationCount;\r\n vm.IsAll = true;\r\n vm.openEdit = openEdit;\r\n vm.toggleClass = toggleClass;\r\n vm.toggle = toggle;\r\n vm.orderList = orderList;\r\n vm.delete = deletePopulation;\r\n vm.defaultHours = 0;\r\n vm.globalAlerts = true;\r\n vm.globalMessaging = true;\r\n vm.globalProgramPauseSetting = \"\";\r\n\r\n vm.canExport = PermissionService.userHasPermission([\"ProgramExport\"]);\r\n vm.canImport = PermissionService.userHasPermission([\"ProgramImport\"]);\r\n\r\n vm.imported = ()=>{\r\n\r\n };\r\n\r\n ConfigurationsService.getConfig().then(function(data) {\r\n vm.defaultHours = data.OverdueAlertHours;\r\n if (data.EnableOverDueAlerts === true) {\r\n vm.globalAlerts = true\r\n }else{\r\n vm.globalAlerts = false;\r\n }\r\n vm.globalMessaging = data[\"PatientMessagingEnabled\"];\r\n vm.globalProgramPauseSetting = data[\"ProgramDaysPauseWhenPatientIsInactive\"];\r\n });\r\n vm.CanEditPopulations = PermissionService.userHasPermission([\"ConfigurationPopulationWrite\"]);\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n \r\n function toggleClass(value) {\r\n return value == true ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n }\r\n\r\n function toggle(item, prop) {\r\n item[prop] = !item[prop];\r\n savePopulation(item);\r\n\r\n if(prop === 'IsDefault') {\r\n vm.populations.filter(function(population){\r\n return population.PopulationId !== item.PopulationId;\r\n }).forEach(function(population){\r\n population.IsDefault = false;\r\n });\r\n }\r\n\r\n EditConfigurationsService.updatePopulationList(vm.populations);\r\n }\r\n\r\n vm.formatProgramPauseSetting = function(type){\r\n switch (type) {\r\n case 1:\r\n //return the global setting\r\n return \"(\" + vm.globalProgramPauseSetting + \")\";\r\n case 2:\r\n return \"Yes\"\r\n case 3:\r\n return \"No\"\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n function orderList(list) {\r\n for(var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n }\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue; \r\n orderList(list);\r\n EditConfigurationsService.updatePopulationList(list);\r\n }\r\n\r\n function savePopulation(population) {\r\n\r\n EditConfigurationsService.updatePopulation(population.PopulationId, population);\r\n }\r\n\r\n function deletePopulation(event, population) {\r\n var updatedList;\r\n vhSweetAlert.verify(\"Are you sure?\", \"Do you want to delete \" + population.PopulationName + \"?\", \"Delete\")\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n EditConfigurationsService.deletePopulation(population.PopulationId).then(function(){\r\n updatedList = EditConfigurationsService.populationsList({ enabledOnly: false });\r\n\r\n updatedList.then(function(data){\r\n vm.populations = data;\r\n });\r\n });\r\n }\r\n });\r\n\r\n }\r\n\r\n\r\n function openEdit(population) {\r\n if (vm.CanEditPopulations === false) {\r\n return;\r\n }\r\n if (population) {\r\n population.PhoneNumberUnFormatted = $filter('phone')(population.PhoneNumber)\r\n }\r\n $uibModal.open({\r\n controller: 'PopulationEditCtrl',\r\n templateUrl: 'modules/site/populations/populationEdit.tpl.html',\r\n size: 'mdsm',\r\n resolve: {\r\n population: function() {\r\n return population;\r\n },\r\n populations: function() {\r\n return vm.populations;\r\n }\r\n }\r\n }).result.then(function(population){\r\n if(population !== undefined) {\r\n EditConfigurationsService.updatePopulation(population.PopulationId, population).then(function(data){\r\n var updateListPromise;\r\n var listChanged = false;\r\n\r\n if(population.PopulationId == 0) {\r\n vm.populations.unshift(population);\r\n orderList(vm.populations);\r\n vm.populations.shift(population);\r\n listChanged = true;\r\n }\r\n\r\n if(population.IsDefault) {\r\n vm.populations.filter(function(population){\r\n return population.PopulationId !== data.PopulationId;\r\n }).forEach(function(population){\r\n population.IsDefault = false;\r\n });\r\n listChanged = true;\r\n } \r\n\r\n if(listChanged) {\r\n updateListPromise = EditConfigurationsService.updatePopulationList(vm.populations).then(function(){\r\n return EditConfigurationsService.populationsList({ enabledOnly: false });\r\n });\r\n }\r\n else {\r\n updateListPromise = EditConfigurationsService.populationsList({ enabledOnly: false });\r\n }\r\n\r\n updateListPromise.then(function(data){\r\n vm.populations = data;\r\n });\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\nangular.module('site.populations').controller('PopulationCtrl', PopulationCtrl);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/populations/population.tpl.html',\n '

          Programs

          Program

          Export

          Enable

          Overdue Alert Hours

          Program Pause

          Days Til Non-Resp

          Phone

          Patient Count

          {{item.PopulationName}}
          Default
          Enable Program
          Enable Alerts
          Tablet Reminders
          Patient Messages
          {{item.OverdueAlertHours || \\'Default\\'}}
          {{vm.formatProgramPauseSetting(item.ProgramPauseSetting)}}
          {{item.DaysTilNonResponder || 0}}
          {{item.PhoneNumber|phone|tel}}
          0 {{vm.populationCount[item.PopulationId]}}

          Program

          Enable

          Overdue Alert Hours

          Program Pause

          Days Til Non-Resp

          Phone

          Patient Count

          {{item.PopulationName}}
          Default
          Enable Program
          Enable Alerts
          Tablet Reminders
          Patient Messages
          {{item.OverdueAlertHours || \\'Default\\'}}
          {{vm.formatProgramPauseSetting(item.ProgramPauseSetting)}}
          {{item.DaysTilNonResponder || 0}}
          {{item.PhoneNumber|phone|tel}}
          0 {{vm.populationCount[item.PopulationId]}}
          ');\n}]);\n}(window, document, window.angular));","function PopulationEditCtrl($scope, $uibModalInstance, population,ConfigurationsService,$filter) {\r\n $scope.population = population === undefined ? createNewPopulation() : population;\r\n $scope.ProgramPauseSetting = $scope.population.ProgramPauseSetting.toString();\r\n $scope.cancel = cancel;\r\n $scope.save = save;\r\n $scope.toggle = toggle;\r\n $scope.defaultHours = true;\r\n \r\n ConfigurationsService.getConfig().then(function(data) {\r\n if (data.EnableOverDueAlerts === true) {\r\n $scope.globalAlerts = true\r\n }else{\r\n $scope.globalAlerts = false;\r\n }\r\n $scope.globalMessaging = data[\"PatientMessagingEnabled\"];\r\n $scope.globalProgramPauseSetting = data[\"ProgramDaysPauseWhenPatientIsInactive\"];\r\n });\r\n\r\n function toggle(item, prop) {\r\n item[prop] = !item[prop];\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.close();\r\n }\r\n\r\n function createNewPopulation(){\r\n return {\r\n PopulationId: 0,\r\n PopulationName: '',\r\n OverdueAlertHours: null,\r\n DaysTilNonResponder: null,\r\n PendingProgramCompletion: null,\r\n IsDefault: false,\r\n IsEnabled: false,\r\n TabletReminderEnabled: false,\r\n PatientMessagingEnabled: false,\r\n ProgramPauseSetting: \"1\", //cant bind select to ints\r\n SortOrder: 0\r\n }\r\n }\r\n\r\n function save() {\r\n $scope.population.ProgramPauseSetting = $scope.ProgramPauseSetting;\r\n $scope.populationsForm.$setSubmitted();\r\n if ($scope.populationsForm.$valid) {\r\n if ($scope.population.PhoneNumberUnFormatted) {\r\n var formattedNumber = $filter('tel')($scope.population.PhoneNumberUnFormatted)\r\n $scope.population.PhoneNumber= formattedNumber\r\n }\r\n else {\r\n $scope.population.PhoneNumber = $scope.population.PhoneNumberUnFormatted\r\n }\r\n $uibModalInstance.close($scope.population);\r\n }\r\n }\r\n}\r\n\r\nangular.module('site.populations').controller('PopulationEditCtrl', PopulationEditCtrl);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/populations/populationEdit.tpl.html',\n '

          Edit Program

          Add Program

          *Required
          Phone is invalid
          Default
          Enabled
          Tablet Reminders
          Enable Alerts
          Patient Messages
          ');\n}]);\n}(window, document, window.angular));","function ProfileFieldsController($scope, $uibModal,fields,ProfileFieldsService){\r\n var vm = this;\r\n\r\n vm.fields = fields;\r\n\r\n vm.openEdit = function(field){\r\n $uibModal.open({\r\n templateUrl: 'modules/site/profileFields/profileFieldsEdit.tpl.html',\r\n controller: 'ProfileFieldsEditController',\r\n resolve: {\r\n field: function () {\r\n return angular.copy(field);\r\n }\r\n }\r\n }).result.then(function(updatedField){\r\n if(!updatedField) return;\r\n var idx = vm.fields.indexOf(field);\r\n if(idx>=0){\r\n vm.fields[idx]=updatedField;\r\n }\r\n });\r\n }\r\n}\r\n\r\n\r\n\r\nangular.module('site.profileFields').controller('ProfileFieldsController', ProfileFieldsController);","function ProfileFieldsService($http){\r\n var getFields = function(){\r\n return $http({\r\n method:'GET',\r\n url:'/api/cgp/profilefields'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var updateField = function(field){\r\n return $http({\r\n method:'POST',\r\n url:'/api/cgp/profilefields',\r\n data: field\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n return {\r\n updateField: updateField,\r\n getFields: getFields\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('site.profileFields').factory('ProfileFieldsService', ProfileFieldsService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/profileFields/profileFields.tpl.html',\n '

          Profile Fields

          Field NameField LabelRequired
          {{field.FieldName}}{{field.FieldLabel}}{{field.IsRequired}}
          ');\n}]);\n}(window, document, window.angular));","function ProfileFieldsEditController($scope,$uibModalInstance,ProfileFieldsService, field){\r\n $scope.field = field;\r\n $scope.updateField = function(field){\r\n ProfileFieldsService.updateField(field).then(function(response){\r\n $uibModalInstance.close(response);\r\n });\r\n }\r\n\r\n $scope.cancel = function(){\r\n $uibModalInstance.close();\r\n };\r\n\r\n //this may need to be moved server side\r\n $scope.RequiredEditDisabled = function(fieldName){\r\n var disabledList = ['LastName','Provider_LastName','Provider_FirstName'];\r\n if(disabledList.indexOf(fieldName) == -1){\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\nangular.module(\"site.profileFields\").controller(\"ProfileFieldsEditController\", ProfileFieldsEditController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/profileFields/profileFieldsEdit.tpl.html',\n '

          Edit Profile Field

          ');\n}]);\n}(window, document, window.angular));","function ProgramDurationsController($scope, $uibModal, programDurations, ProgramDurationsService){\r\n var vm = this;\r\n\r\n vm.programDurations = programDurations;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n\r\n\r\n vm.toggleIsDefault = function(programDuration) {\r\n programDuration.IsDefault = !programDuration.IsDefault;\r\n setDefaults(programDuration);\r\n ProgramDurationsService.updateAll(programDurations);\r\n }\r\n\r\n vm.toggleIsEnabled = function(programDuration) {\r\n programDuration.IsEnabled = !programDuration.IsEnabled;\r\n ProgramDurationsService.update(programDuration);\r\n }\r\n\r\n vm.orderChanged = orderChanged;\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n resort(list);\r\n ProgramDurationsService.updateAll(list);\r\n }\r\n\r\n vm.openEdit = function(programDuration){\r\n $uibModal.open({\r\n templateUrl: 'modules/site/programDurations/programDurationsEdit.tpl.html',\r\n controller: 'ProgramDurationsEditController',\r\n resolve: {\r\n programDuration: function () {\r\n return angular.copy(programDuration);\r\n }\r\n }\r\n }).result.then(function(updatedProgramDuration){\r\n if(!updatedProgramDuration) {\r\n return;\r\n }\r\n var idx = vm.programDurations.indexOf(programDuration);\r\n if(idx>=0){\r\n vm.programDurations[idx]=updatedProgramDuration;\r\n }\r\n else {\r\n vm.programDurations.push(updatedProgramDuration);\r\n resort(vm.programDurations);\r\n }\r\n setDefaults(updatedProgramDuration);\r\n ProgramDurationsService.updateAll(programDurations);\r\n });\r\n }\r\n\r\n function resort(list) {\r\n for(var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n }\r\n\r\n function setDefaults(updatedProgramDuration) {\r\n if(updatedProgramDuration.IsDefault) {\r\n programDurations.forEach(programDuration => {\r\n if(programDuration != updatedProgramDuration) {\r\n programDuration.IsDefault = false;\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('site.programDurations').controller('ProgramDurationsController', ProgramDurationsController);","function ProgramDurationsService($http){\r\n\r\n var get = function(){\r\n return $http({\r\n method:'GET',\r\n url:'/api/programDuration?enabledOnly=false'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var update = function(programDuration){\r\n return $http({\r\n method:'POST',\r\n url:'/api/programDuration',\r\n data: programDuration\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var updateAll = function(programDurations){\r\n return $http({\r\n method:'PUT',\r\n url:'/api/programDuration',\r\n data: programDurations\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n return {\r\n update: update,\r\n updateAll: updateAll,\r\n get: get\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('site.programDurations').factory('ProgramDurationsService', ProgramDurationsService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/programDurations/programDurations.tpl.html',\n '

          Program Durations

          Name

          Is Default

          Enabled

          Days

              {{programDuration.Name}}
              {{programDuration.Days}}
          ');\n}]);\n}(window, document, window.angular));","function ProgramDurationsEditController($scope, $uibModalInstance, programDuration, ProgramDurationsService) {\r\n\r\n $scope.programDuration = programDuration || { };\r\n\r\n $scope.save = save;\r\n function save() {\r\n $scope.programDurationForm.$setSubmitted();\r\n if ($scope.programDurationForm.$valid) {\r\n ProgramDurationsService.update($scope.programDuration).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n\r\n $scope.cancel = cancel\r\n function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n\r\n}\r\n\r\nangular.module('site.programDurations').controller('ProgramDurationsEditController', ProgramDurationsEditController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/programDurations/programDurationsEdit.tpl.html',\n '

          {{programDuration.Id != null ? \\'Edit Program Duration\\' : \\'Add New Program Duration\\'}}

          {{programDuration.Name}}
          *Name is required
          *Days is required
          Default
          Enabled
          ');\n}]);\n}(window, document, window.angular));","function ProviderGroupsController($scope, $uibModal, providerGroups, ProviderGroupsService, $filter){\r\n var vm = this;\r\n\r\n vm.providerGroups = providerGroups;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n\r\n\r\n vm.toggleIsDefault = function(providerGroup) {\r\n providerGroup.IsDefault = !providerGroup.IsDefault;\r\n setDefaults(providerGroup);\r\n ProviderGroupsService.updateAll(providerGroups);\r\n }\r\n\r\n vm.toggleIsEnabled = function(providerGroup) {\r\n providerGroup.IsEnabled = !providerGroup.IsEnabled;\r\n ProviderGroupsService.update(providerGroup);\r\n }\r\n\r\n vm.orderChanged = orderChanged;\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n resort(list);\r\n ProviderGroupsService.updateAll(list);\r\n }\r\n\r\n vm.openEdit = function (providerGroup) {\r\n if (providerGroup && providerGroup.PhoneNumber) {\r\n providerGroup.PhoneNumberUnFormatted = $filter('phone')(providerGroup.PhoneNumber)\r\n }\r\n $uibModal.open({\r\n templateUrl: 'modules/site/providerGroups/providerGroupsEdit.tpl.html',\r\n controller: 'ProviderGroupsEditController',\r\n resolve: {\r\n providerGroup: function () {\r\n return angular.copy(providerGroup);\r\n }\r\n }\r\n }).result.then(function(updatedProviderGroup){\r\n if(!updatedProviderGroup) {\r\n return;\r\n }\r\n var idx = vm.providerGroups.indexOf(providerGroup);\r\n if(idx>=0){\r\n vm.providerGroups[idx]=updatedProviderGroup;\r\n }\r\n else {\r\n vm.providerGroups.push(updatedProviderGroup);\r\n resort(vm.providerGroups);\r\n }\r\n setDefaults(updatedProviderGroup);\r\n ProviderGroupsService.updateAll(providerGroups);\r\n });\r\n }\r\n\r\n function resort(list) {\r\n for(var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n }\r\n\r\n function setDefaults(updatedProviderGroup) {\r\n if(updatedProviderGroup.IsDefault) {\r\n providerGroups.forEach(providerGroup => {\r\n if(providerGroup != updatedProviderGroup) {\r\n providerGroup.IsDefault = false;\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('site.providerGroups').controller('ProviderGroupsController', ProviderGroupsController);","function ProviderGroupsService($http){\r\n\r\n var get = function(){\r\n return $http({\r\n method:'GET',\r\n url:'/api/providerGroup'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var update = function(providerGroup){\r\n return $http({\r\n method:'POST',\r\n url:'/api/providerGroup',\r\n data: providerGroup\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var updateAll = function(providerGroups){\r\n return $http({\r\n method:'PUT',\r\n url:'/api/providerGroup',\r\n data: providerGroups\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n return {\r\n update: update,\r\n updateAll: updateAll,\r\n get: get\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('site.providerGroups').factory('ProviderGroupsService', ProviderGroupsService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/providerGroups/providerGroups.tpl.html',\n '

          Provider Groups

          Provider Group

          Is Default

          Enabled

          Phone

              {{providerGroup.Name}}
          {{providerGroup.PhoneNumber|phone|tel}}
          ');\n}]);\n}(window, document, window.angular));","function ProviderGroupsEditController($scope, $uibModalInstance, providerGroup, ProviderGroupsService, $filter) {\r\n\r\n $scope.providerGroup = providerGroup || { };\r\n\r\n $scope.save = save;\r\n function save() {\r\n $scope.providerGroupForm.$setSubmitted();\r\n if ($scope.providerGroupForm.$valid) {\r\n if ($scope.providerGroup.PhoneNumberUnFormatted) {\r\n var formattedNumber = $filter('tel')($scope.providerGroup.PhoneNumberUnFormatted)\r\n $scope.providerGroup.PhoneNumber = formattedNumber\r\n }\r\n else {\r\n $scope.providerGroup.PhoneNumber = $scope.providerGroup.PhoneNumberUnFormatted\r\n }\r\n ProviderGroupsService.update($scope.providerGroup).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n\r\n $scope.cancel = cancel\r\n function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n\r\n}\r\n\r\nangular.module('site.providerGroups').controller('ProviderGroupsEditController', ProviderGroupsEditController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/providerGroups/providerGroupsEdit.tpl.html',\n '

          {{providerGroup.Id != null ? \\'Edit Provider Group\\' : \\'Add New Provider Group\\'}}

          {{providerGroup.Name}}
          *Name is required
          Phone is invalid
          Default
          Enabled
          ');\n}]);\n}(window, document, window.angular));","function ReferralsController($scope, $uibModal, referrals, ReferralsService){\r\n var vm = this;\r\n\r\n vm.referrals = referrals;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n\r\n\r\n vm.toggleIsDefault = function(referral) {\r\n referral.IsDefault = !referral.IsDefault;\r\n setDefaults(referral);\r\n ReferralsService.updateAll(referrals);\r\n }\r\n\r\n vm.toggleIsCCM = function(referral) {\r\n referral.IsCCM = !referral.IsCCM;\r\n ReferralsService.update(referral);\r\n }\r\n\r\n vm.toggleIsEnabled = function(referral) {\r\n referral.IsEnabled = !referral.IsEnabled;\r\n ReferralsService.update(referral);\r\n }\r\n\r\n vm.orderChanged = orderChanged;\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n resort(list);\r\n ReferralsService.updateAll(list);\r\n }\r\n\r\n vm.openEdit = function(referral){\r\n $uibModal.open({\r\n templateUrl: 'modules/site/referrals/referralsEdit.tpl.html',\r\n controller: 'ReferralsEditController',\r\n resolve: {\r\n referral: function () {\r\n return angular.copy(referral);\r\n }\r\n }\r\n }).result.then(function(updatedReferral){\r\n if(!updatedReferral) {\r\n return;\r\n }\r\n var idx = vm.referrals.indexOf(referral);\r\n if(idx>=0){\r\n vm.referrals[idx]=updatedReferral;\r\n }\r\n else {\r\n vm.referrals.push(updatedReferral);\r\n resort(vm.referrals);\r\n }\r\n setDefaults(updatedReferral);\r\n ReferralsService.updateAll(referrals);\r\n });\r\n }\r\n\r\n function resort(list) {\r\n for(var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n }\r\n\r\n function setDefaults(updatedReferral) {\r\n if(updatedReferral.IsDefault) {\r\n referrals.forEach(referral => {\r\n if(referral != updatedReferral) {\r\n referral.IsDefault = false;\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('site.referrals').controller('ReferralsController', ReferralsController);","function ReferralsService($http){\r\n\r\n var get = function(){\r\n return $http({\r\n method:'GET',\r\n url:'/api/referral?enabledOnly=false'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var update = function(referral){\r\n return $http({\r\n method:'POST',\r\n url:'/api/referral',\r\n data: referral\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var updateAll = function(referrals){\r\n return $http({\r\n method:'PUT',\r\n url:'/api/referral',\r\n data: referrals\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n return {\r\n update: update,\r\n updateAll: updateAll,\r\n get: get\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('site.referrals').factory('ReferralsService', ReferralsService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/referrals/referrals.tpl.html',\n '

          Referrals

          Name

          Is Default

          Enabled

              {{referral.Name}}
          ');\n}]);\n}(window, document, window.angular));","function ReferralsEditController($scope, $uibModalInstance, referral, ReferralsService) {\r\n\r\n $scope.referral = referral || { };\r\n\r\n $scope.save = save;\r\n function save() {\r\n $scope.referralForm.$setSubmitted();\r\n if ($scope.referralForm.$valid) {\r\n ReferralsService.update($scope.referral).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n\r\n $scope.cancel = cancel\r\n function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n\r\n}\r\n\r\nangular.module('site.referrals').controller('ReferralsEditController', ReferralsEditController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/referrals/referralsEdit.tpl.html',\n '

          {{referral.Id != null ? \\'Edit Referral\\' : \\'Add New Referral\\'}}

          {{referral.Name}}
          *Name is required
          Default
          Enabled
          ');\n}]);\n}(window, document, window.angular));","function SpecialHandlingCtrl($scope, $uibModal, SpecialHandlings, EditConfigurationsService) {\r\n\r\n var vm = this;\r\n vm.SpecialHandlings = SpecialHandlings;\r\n vm.IsAll = true;\r\n vm.openEdit = openEdit;\r\n vm.toggle = toggle;\r\n vm.tagList = tagList;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n \r\n function toggle(sh) {\r\n sh.IsEnabled = !sh.IsEnabled;\r\n EditConfigurationsService.updateSpecialHandling([sh]);\r\n }\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n \r\n for(var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n\r\n EditConfigurationsService.updateSpecialHandling(list); \r\n }\r\n\r\n function tagList(sh) {\r\n return sh.Tags ? sh.Tags.split(';') : [];\r\n }\r\n\r\n function openEdit(sh) {\r\n $uibModal.open({\r\n controller: 'specialhandlingEditCtrl',\r\n templateUrl: 'modules/site/specialhandling/specialhandlingEdit.tpl.html',\r\n resolve: {\r\n sh: function() {\r\n return sh;\r\n }\r\n }\r\n }).result.then(function(result){\r\n EditConfigurationsService.getSpecialHandlingList().then(function(data){\r\n if(data) {\r\n vm.SpecialHandlings = data;\r\n }\r\n });\r\n }).catch(function(){\r\n EditConfigurationsService.getSpecialHandlingList().then(function(data){\r\n if(data) {\r\n vm.SpecialHandlings = data;\r\n }\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module('site.specialhandling').controller('SpecialHandlingCtrl', SpecialHandlingCtrl);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/specialhandling/specialhandling.tpl.html',\n '

          Special Handling

          Name

          Enabled

          Icon

          Color

          Tags

          {{sh.Name}}
          {{sh.Icon}}
          {{sh.Color}}
          {{tag}}
          ');\n}]);\n}(window, document, window.angular));","function specialhandlingEditCtrl($scope, $uibModalInstance, sh, EditConfigurationsService) {\r\n $scope.sh = sh || { };\r\n $scope.sh.tagList = $scope.sh.Tags ? $scope.sh.Tags.split(';') : [];\r\n $scope.tagList = [];\r\n $scope.showTagList = false;\r\n $scope.cancel = cancel\r\n $scope.save = save;\r\n $scope.deleteSp = deleteSp;\r\n $scope.cleanTag = cleanTag;\r\n\r\n function deleteSp() {\r\n EditConfigurationsService.deleteSpecialHandling($scope.sh.SpecialHandlingId).then(function(){\r\n $uibModalInstance.close('delete');\r\n });\r\n }\r\n\r\n function save() {\r\n $scope.specialhandlingForm.$setSubmitted();\r\n if ($scope.specialhandlingForm.$valid) {\r\n $scope.sh.Tags = $scope.sh.tagList.join(';');\r\n delete $scope.sh.tagList;\r\n\r\n EditConfigurationsService.updateSpecialHandling([$scope.sh]).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n\r\n function cleanTag(tag) {\r\n return tag.replace(/[;,]/g, '');\r\n }\r\n}\r\n\r\nangular.module('site.specialhandling').controller('specialhandlingEditCtrl', specialhandlingEditCtrl);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/site/specialhandling/specialhandlingEdit.tpl.html',\n '

          Special Handling

          {{sh.Name}}
          *Required
          {{$item}} {{tag}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/_controls/controls.tpl.html',\n '

          Controls Demo

          Multi-Select Example
          At least one selection is required
          HTML:
          {{vm.code}}
          Toast Notifications
          ');\n}]);\n}(window, document, window.angular));","\r\nclass BiometricAlertController {\r\n // remember that if you change the order of the parameters here\r\n // you also need to change the order at the bottom of this file\r\n constructor(\r\n $scope,\r\n $state,\r\n BiometricAlert,\r\n BiometricAlertsService,\r\n EditConfigurationsService,\r\n TemplatesService,\r\n CardsService,\r\n ResourceLibraryService,\r\n VideosService,\r\n HealthTipsService,\r\n GoDevicesService,\r\n alertTypes,\r\n expandable,\r\n privateProperties,\r\n ){\r\n this.$scope = $scope;\r\n this.$state = $state;\r\n this.BiometricAlert = BiometricAlert;\r\n this.BiometricAlertsService = BiometricAlertsService;\r\n this.EditConfigurationsService = EditConfigurationsService;\r\n this.TemplatesService = TemplatesService;\r\n this.CardsService = CardsService;\r\n this.ResourceLibraryService = ResourceLibraryService;\r\n this.VideosService = VideosService;\r\n this.HealthTipsService = HealthTipsService;\r\n this.GoDevicesService = GoDevicesService;\r\n\r\n this.alertTypes = alertTypes;\r\n\r\n this.expandable = expandable;\r\n this.privateProperties = privateProperties;\r\n\r\n this.biometricAlert = {};\r\n this.TemplateId = 0;\r\n this.modalHeader = \"Add New Biometric Alert\";\r\n this.promptForName = false;\r\n this.editable = true;\r\n this.showDebug = false;\r\n this.populations = [];\r\n this.selectedPopulations = [];\r\n this.tags = {};\r\n\r\n this.showSave = false;\r\n this.isEdit = false;\r\n\r\n this.conditionDragListeners = {\r\n accept: this.acceptConditionOrderChange,\r\n orderChanged: this.conditionsOrderChanged\r\n };\r\n\r\n this.alertSeverityLevels = [\r\n { Name : 'High Alert', Value : 1 },\r\n { Name : 'Medium Alert', Value : 2 },\r\n { Name : 'Notification', Value : 4 }\r\n ];\r\n\r\n this.showTest = false; //bool for future to vary when editing vs creating new alert\r\n this.testObject= {\r\n AlertType: \"\",\r\n Message: \"\"\r\n };\r\n this.testParameter;\r\n this.testValue;\r\n\r\n // initilization code\r\n this.initialize();\r\n }\r\n\r\n initialize(){\r\n this.loading = true;\r\n\r\n // get lookups\r\n this.lookups = new Promise(resolve => {\r\n\r\n Promise.all([\r\n this.BiometricAlertsService.getRuleExpressionValues(),\r\n ])\r\n .then(data => {\r\n let [\r\n biometricAlertExpressionValues\r\n ] = data;\r\n\r\n var lookups = {\r\n biometricAlertExpressionValues\r\n };\r\n\r\n this.biometricAlertExpressionValues = lookups.biometricAlertExpressionValues;\r\n\r\n resolve(lookups);\r\n });\r\n });\r\n // combine promises\r\n\r\n let alertId = 0;\r\n if (this.BiometricAlert) {\r\n alertId = this.BiometricAlert.BiometricAlertId;\r\n }\r\n\r\n Promise.all([\r\n this.BiometricAlertsService.getPopulations(),\r\n this.BiometricAlertsService.getBiometricAlertPopulations(alertId),\r\n this.BiometricAlertsService.getBiometricMeasurementTypes()\r\n ]).then(data => {\r\n\r\n let [\r\n programs,\r\n alertPrograms,\r\n biometricMeasurementTypes\r\n ] = data;\r\n\r\n this.populations = programs;\r\n this.allPopulations = programs;\r\n this.biometricPopulations = alertPrograms;\r\n this.biometricMeasurementTypes = biometricMeasurementTypes;\r\n this.allPatients = this.populations.find(p => p.IsAllPatients);\r\n\r\n if (this.BiometricAlert != null) {\r\n this.editable = true;\r\n\r\n this.modalHeader = \"Edit Biometric Alert\";\r\n this.isEdit = true; // for tracking modal header changes\r\n //Create copy of biometricAlert, so we're editing copy\r\n angular.copy(this.BiometricAlert, this.biometricAlert);\r\n\r\n this.BiometricMeasurementTypeId = this.biometricAlert.BiometricMeasurementTypeId;\r\n this.biometricMeasurementType = this.biometricMeasurementTypes.find(b => b.BiometricMeasurementTypeId == this.BiometricMeasurementTypeId);\r\n // use expandable constant proxy from app.constants.js\r\n this.biometricAlert.BiometricAlertConditions = this.biometricAlert.BiometricAlertConditions.map(x => this.conditionProxy(this.privateProperties(this.expandable(x, true), { })));\r\n\r\n this.promptForName = true;\r\n\r\n this.loadSelectedProgramsFromBiometricAlert();\r\n\r\n this.collapseAll();\r\n \r\n this.biometricChanged();\r\n }\r\n else { //logic for new alerts\r\n this.biometricAlert.BiometricAlertConditions = [];\r\n this.biometricAlert.BiometricAlertPrograms = [];\r\n this.bioimetricMeasurementType = null;\r\n }\r\n this.loading = false;\r\n })\r\n }\r\n\r\n conditionsOrderChanged(event){\r\n event.source.sortableScope.modelValue.forEach((x, index) => {\r\n x.pauseDescriptionUpdates = true;\r\n x.SortOrder = index;\r\n x.pauseDescriptionUpdates = false;\r\n });\r\n }\r\n\r\n acceptConditionOrderChange(sourceItemHandleScope, destSortableScope)\r\n {\r\n return sourceItemHandleScope.sortableScope.element.hasClass('conditions');\r\n }\r\n\r\n conditionProxy(condition){\r\n return new Proxy(condition, {\r\n set: (target, key, value, receiver)=>{\r\n if(target[key] != value){\r\n\r\n if(key == 'SortOrder' && !this.loading)\r\n this.showSave = true;\r\n\r\n var result = Reflect.set(target,key,value,receiver);\r\n return result;\r\n }\r\n return true;\r\n }\r\n })\r\n }\r\n\r\n expandAll(){\r\n this.biometricAlert.BiometricAlertConditions.forEach(x => x.expand());\r\n }\r\n\r\n collapseAll(){\r\n this.biometricAlert.BiometricAlertConditions.forEach(x => x.collapse());\r\n }\r\n\r\n loadSelectedProgramsFromBiometricAlert() {\r\n if (this.biometricAlert.BiometricAlertPrograms.length > 0) {\r\n var copySelected = [];\r\n\r\n this.biometricAlert.BiometricAlertPrograms.forEach(biometricAlertPrograms => {\r\n var result = this.populations.find(item => item.PopulationId === biometricAlertPrograms.PopulationId);\r\n if (result != null) {\r\n copySelected.push(result);\r\n }\r\n })\r\n this.selectedPopulations = copySelected;\r\n }\r\n }\r\n\r\n isValid(checkFDAStatement = true){\r\n let isValid = this.biometricAlert\r\n && this.biometricAlert.BiometricAlertConditions\r\n && this.biometricAlert.BiometricAlertConditions.length > 0\r\n\r\n if (checkFDAStatement) {\r\n isValid = this.biometricAlert.AlertName && this.biometricAlert.AlertName != ''\r\n }\r\n\r\n if (isValid) {\r\n this.biometricAlert.BiometricAlertConditions.forEach(c => {\r\n isValid = isValid\r\n && c.AlertSeverityLevelId > 0\r\n && c.AlertText != ''\r\n && c.BiometricAlertExpressions;\r\n if (isValid) {\r\n c.BiometricAlertExpressions.forEach(e => {\r\n isValid = isValid\r\n && !e.valueInvalid\r\n && !e.minMaxInvalid\r\n && e.Value\r\n && e.Value != '';\r\n });\r\n }\r\n });\r\n }\r\n\r\n return isValid;\r\n }\r\n\r\n addCondition(index) {\r\n var biometricAlertCondition = {};\r\n biometricAlertCondition.Condition = '';\r\n biometricAlertCondition.AlertText = \"\";\r\n biometricAlertCondition.AlertSeverityLevelId = \"\";\r\n\r\n var proxyCondition =this.expandable(this.privateProperties(biometricAlertCondition, { }), true);\r\n\r\n if(index != undefined && index != null && index != this.biometricAlert.BiometricAlertConditions.length){\r\n this.biometricAlert.BiometricAlertConditions.splice( index, 0, proxyCondition);\r\n }else{\r\n this.biometricAlert.BiometricAlertConditions.push(proxyCondition);\r\n }\r\n this.biometricAlert.BiometricAlertConditions.forEach((x, index) => {\r\n x.pauseDescriptionUpdates = true;\r\n x.SortOrder = index;\r\n x.pauseDescriptionUpdates = false;\r\n });\r\n }\r\n\r\n saveSelectedProgramToBiometricAlert() {\r\n this.biometricAlert.BiometricAlertPrograms = this.selectedPopulations.map(population => { return {PopulationId: population.PopulationId}; });\r\n }\r\n\r\n populationsChanged(selectedItems) {\r\n if(this.selectedPopulations.length > 1 && this.selectedPopulations[0].IsAllPatients)\r\n this.selectedPopulations = this.selectedPopulations.filter(x => !x.IsAllPatients);\r\n else if(this.selectedPopulations.length > 1 && this.selectedPopulations.find(x => x.IsAllPatients))\r\n this.selectedPopulations = this.selectedPopulations.filter(x => x.IsAllPatients);\r\n }\r\n\r\n deleteCondition(condition) {\r\n this.biometricAlert.BiometricAlertConditions.splice(this.biometricAlert.BiometricAlertConditions.indexOf(condition), 1);\r\n this.showSave = true;\r\n }\r\n\r\n biometricChanged(resetAlertName = false) {\r\n if(resetAlertName) this.biometricAlert.AlertName = \"\";\r\n this.BiometricMeasurementTypeId = this.biometricMeasurementType.BiometricMeasurementTypeId;\r\n let biometricPopulations = this.biometricPopulations[this.BiometricMeasurementTypeId];\r\n if (biometricPopulations) {\r\n this.populations = this.allPopulations.filter(p => !biometricPopulations.find(b => b == p.PopulationId));\r\n if(this.selectedPopulations.length > 0) {\r\n this.selectedPopulations = this.selectedPopulations.filter(p => !biometricPopulations.find(b => b == p.PopulationId));\r\n }\r\n }\r\n else {\r\n this.populations = this.allPopulations;\r\n }\r\n if (this.biometricAlert.BiometricAlertConditions \r\n && this.biometricAlert.BiometricAlertConditions.length === 0){\r\n this.addCondition(0);\r\n this.testValue = null;\r\n this.testObject.Message= null;\r\n }\r\n }\r\n\r\n save() {\r\n if(this.biometricAlert.AlertName && this.biometricAlert.AlertName.length > 0){\r\n this.saveSelectedProgramToBiometricAlert();\r\n this.biometricAlert.BiometricMeasurementTypeId = this.BiometricMeasurementTypeId;\r\n\r\n this.BiometricAlertsService.saveBiometricAlert(this.biometricAlert).then((data) => {\r\n if (data && data.data && data.data.ErrorMessage) {\r\n this.error = data.data.ErrorMessage;\r\n }\r\n else {\r\n this.$state.go('system.biometricAlerts', {\r\n FromState: this.$state.params.FromState\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n doTest() {\r\n if(this.testValue && this.testValue != \"\" && this.isValid(false)){\r\n this.testObject.Message = \"\";\r\n this.testObject.AlertType = \"\";\r\n this.biometricAlert.SurveyParameterTypeIds = this.biometricMeasurementType.SurveyParameterTypes.map(r => r.SurveyParameterTypeId);\r\n this.BiometricAlertsService.postTestAlert(this.biometricAlert, this.biometricMeasurementType.SurveyParameterTypes\r\n .find(t => t.Name == this.testParameter.replace(\"{\", \"\").replace(\"}\", \"\")), \r\n this.testValue)\r\n .then((data) => {\r\n this.testObject.Message = \"\";\r\n this.testObject.AlertType = \"\";\r\n this.testObject.Message = data.Message;\r\n if(this.testObject.Message != \"\" && this.testObject.Message != null){this.testObject.AlertType = this.alertSeverityLevels.find(a => a.Value == data.AlertType).Name;}\r\n if (data.Message == null) {this.testObject.Message= \"No alert triggered\";}\r\n });\r\n }\r\n }\r\n\r\n cancel() {\r\n this.$state.go('system.biometricAlerts', {\r\n FromState: this.$state.params.FromState\r\n });\r\n };\r\n}\r\n\r\nangular.module('system.biometricAlerts').controller('BiometricAlertController',\r\nfunction(\r\n $scope,\r\n $state,\r\n BiometricAlert,\r\n BiometricAlertsService,\r\n EditConfigurationsService,\r\n TemplatesService,\r\n CardsService,\r\n ResourceLibraryService,\r\n VideosService,\r\n HealthTipsService,\r\n GoDevicesService,\r\n alertTypes,\r\n expandable,\r\n privateProperties,\r\n)\r\n { return new BiometricAlertController(...arguments); });\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/biometricalerts/biometricalert.tpl.html',\n '

          {{vm.biometricMeasurementType.TypeName ? \"Add New \" + vm.biometricMeasurementType.TypeName + \" Alert\":vm.modalHeader}}

          {{vm.modalHeader}}

          Loading...

          1. {{vm.biometricAlert.Display}}
          {{$item.PopulationName}}{{population.PopulationName}}
          {{vm.error}}

          There are no Conditions configured. Click here to add a Condition

          Alert Text value options:
          • Use variables (such as {value1}) to automatically populate alert text based on input values
          • Mouse over value fields to determine variable name to include
          • Example1: Biometric is greater than {value1}
          • Example2: Biometric is between {value1} and {value2}

          • When using a single expression or multilple expressions with Any(||), use {operator} and {value} to automatically populate alert text with the operator (such as \"is greater than\") and the value that triggered the alert
          • Example: Biometric {operator} {value}
          • Note: If using multiple values with All(&&), {operator} and {value} will populate with only the last expression evaluated
          If ({{condition.Condition}})
          {{vm.biometricAlert  | json}}
          ');\n}]);\n}(window, document, window.angular));","function biometricAlertConditionDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: function(elem, attr) {\r\n return 'modules/system/biometricalerts/biometricAlertCondition.tpl.html';\r\n },\r\n scope: {\r\n condition: \"=\",\r\n tags: \"=\",\r\n controller: \"=\",\r\n isPatientLevel: \"=\",\r\n },\r\n link: function (scope, elm, attr) {\r\n scope.onchange = onchange;\r\n scope.isDirty = false;\r\n\r\n scope.expressionOperators = [\r\n { Value : '&&', Name : 'all' },\r\n { Value : '||', Name : 'any' }\r\n ]\r\n\r\n if (scope.isPatientLevel) {\r\n if (scope.condition.Condition.includes('&&')) {\r\n scope.condition.expressionOperator = '&&';\r\n }\r\n else if (scope.condition.Condition.includes('||')) {\r\n scope.condition.expressionOperator = '||';\r\n }\r\n else {\r\n scope.condition.expressionOperator = '&&';\r\n }\r\n scope.anyAll = scope.expressionOperators.find(item => item.Value == scope.condition.expressionOperator).Name;\r\n }\r\n else {\r\n scope.$watch('controller.biometricMeasurementType', function(newValue, oldValue) {\r\n //If value has changed or page is just loading\r\n if (newValue != oldValue || !scope.condition.expressionOperator) {\r\n if (scope.condition.BiometricAlertConditionId > 0 && newValue == oldValue) {\r\n if (scope.condition.Condition.includes('&&')) {\r\n scope.showRemove = true;\r\n scope.condition.expressionOperator = '&&';\r\n }\r\n else if (scope.condition.Condition.includes('||')) {\r\n scope.showRemove = true;\r\n scope.condition.expressionOperator = '||';\r\n }\r\n else {\r\n scope.showRemove = false;\r\n scope.condition.expressionOperator = '&&';\r\n }\r\n }\r\n else {\r\n scope.showRemove = false;\r\n scope.condition.expressionOperator = '&&';\r\n scope.condition.BiometricAlertExpressions = [];\r\n scope.condition.BiometricAlertExpressions.push({ Property : '', Operator : '', Value : '' });\r\n scope.condition.Condition = '';\r\n scope.condition.AlertText = scope.controller.biometricMeasurementType.SurveyParameterTypes[0].Name + \" {operator} {value}\";\r\n }\r\n }\r\n });\r\n \r\n scope.biometricAlertExpressionValues = scope.controller.biometricAlertExpressionValues;\r\n }\r\n\r\n scope.add = function(){\r\n scope.condition.BiometricAlertExpressions.push({ Property : '', Operator : '', Value : '' });\r\n scope.showRemove = true;\r\n }\r\n\r\n scope.remove = function(expression){\r\n scope.condition.BiometricAlertExpressions.splice(scope.condition.BiometricAlertExpressions.indexOf(expression), 1);\r\n if (scope.condition.BiometricAlertExpressions.length == 1) {\r\n scope.showRemove = false;\r\n }\r\n scope.controller.showSave = true;\r\n onchange();\r\n }\r\n\r\n function onchange(){\r\n var conditionText = '';\r\n scope.condition.BiometricAlertExpressions.forEach(function(expression){\r\n if( conditionText.length > 0 ){\r\n conditionText += ' ' + scope.condition.expressionOperator + ' ';\r\n }\r\n conditionText += expression.text;\r\n });\r\n scope.condition.Condition = conditionText;\r\n }\r\n }\r\n };\r\n}\r\nangular.module(\"system.biometricAlerts\").directive(\"biometricAlertCondition\", biometricAlertConditionDirective);\r\n\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/biometricalerts/biometricAlertCondition.tpl.html',\n '
          1\">
          {{anyAll}} of the following biometric alerts are true:
          ');\n}]);\n}(window, document, window.angular));","function biometricAlertExpressionDirective(lodash, BiometricAlertsService) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: function(elem, attr) {\r\n return 'modules/system/biometricalerts/biometricAlertExpression.tpl.html';\r\n },\r\n scope: {\r\n add: \"=\",\r\n remove: \"=\",\r\n expression: \"=\",\r\n onchange: \"=\",\r\n condition: \"=\",\r\n tags: \"=\",\r\n biometricAlertExpressionValues: \"=\",\r\n parameterTypes: \"=\",\r\n showRemove: \"=\",\r\n isPatientLevel: \"=\",\r\n expressionIndex: \"=\",\r\n expressionLast: \"=\",\r\n operator: \"=\"\r\n },\r\n //requires: ['ngSanitize', 'uiSelect'],\r\n \r\n link: function (scope, elm, attr) {\r\n scope.expressionVariable = \"{value\" + (scope.expressionIndex + 1) + \"}\";\r\n if (scope.expressionLast || scope.operator == '||') {\r\n scope.expressionVariable += \" or {value}\";\r\n }\r\n scope.updateExpression = updateExpression;\r\n scope.propChanged = propChanged;\r\n \r\n scope.$watch('parameterTypes', function(newValue, oldValue) {\r\n if (newValue != oldValue || !scope.expression.Operator || scope.expression.Operator == '') {\r\n scope.expression.Property = '{' + scope.parameterTypes[0].Name + '}';\r\n scope.expression.Operator = '=';\r\n scope.expression.Value = '';\r\n scope.expression.MinSafeguard = '';\r\n scope.expression.MaxSafeguard = '';\r\n }\r\n else {\r\n scope.updateExpression();\r\n }\r\n scope.properties = lodash.map(scope.parameterTypes,function(type) {\r\n return {\r\n Value: '{' + type.Name + '}',\r\n Name: type.Name,\r\n Type: 'int' \r\n };\r\n });\r\n });\r\n\r\n scope.$watch('operator', function() {\r\n if (!scope.expressionLast) {\r\n updateVariable();\r\n }\r\n });\r\n\r\n scope.$watch('expressionLast', function() {\r\n if (scope.operator != '||') {\r\n updateVariable();\r\n }\r\n });\r\n\r\n function updateVariable() {\r\n if (scope.expressionLast || scope.operator == '||') {\r\n if (scope.expressionVariable.indexOf(\"{value}\") == -1) {\r\n scope.expressionVariable += \" or {value}\";\r\n }\r\n }\r\n else {\r\n scope.expressionVariable = scope.expressionVariable.replace(\" or {value}\", \"\");\r\n }\r\n }\r\n\r\n scope.selectedBiometricAlertExpressionList = {};\r\n scope.selectedBiometricAlertExpressionList = { selectItems : []};\r\n scope.selectedBiometricAlertExpressionList.isExpressionListEnabled = false;\r\n\r\n //updateExpression();\r\n\r\n scope.arrayOperator = [\r\n { Value : '=', Name : 'contains' },\r\n { Value : '!=', Name : 'does not contain' }\r\n ]\r\n\r\n scope.boolOperator = [\r\n { Value : '=', Name : 'is true' },\r\n { Value : '!=', Name : 'is false' }\r\n ]\r\n\r\n scope.stringOperator = [\r\n { Value : '=', Name : 'is' },\r\n { Value : '!=', Name : 'is not' }\r\n ]\r\n \r\n scope.intOperator = [\r\n { Value : '=', Name : 'is' },\r\n { Value : '>', Name : 'is greater than' },\r\n { Value : '<', Name : 'is less than' },\r\n { Value : '>=', Name : 'is or is greater than' },\r\n { Value : '<=', Name : 'is or is less than' },\r\n { Value : '!=', Name : 'is not' }\r\n ]; \r\n\r\n scope.biometricAlertOperator = [\r\n { Value : '=', Name : 'Equal' },\r\n { Value : '&&', Name : 'And' },\r\n { Value : '||', Name : 'Or' },\r\n { Value : '>', Name : 'Greater than' },\r\n { Value : '<', Name : 'Less than' },\r\n { Value : '>=', Name : 'Greater than or Equal' },\r\n { Value : '<=', Name : 'Less than or Equal' },\r\n { Value : '!=', Name : 'Not equal' },\r\n { Value : '(', Name : '(' },\r\n { Value : ')', Name : ')' },\r\n { Value : '+', Name : 'Add' },\r\n { Value : '-', Name : 'Subtract' },\r\n { Value : '*', Name : 'Multiply' },\r\n { Value : '/', Name : 'Divide' },\r\n { Value : '%', Name : 'Modulo' }\r\n ]; \r\n \r\n\r\n scope.showOperatorList = function(type){\r\n return getSelectedPropertyType() === type;\r\n }\r\n\r\n scope.biometricAlertExpressionOnSelect = function(item, model) {\r\n if (getSelectedPropertyType() === \"int\")\r\n {\r\n scope.expression.text = scope.expression.Property + ' ' + scope.expression.Operator + ' ' + item.Id;\r\n }\r\n if (getSelectedPropertyType() === \"string\")\r\n {\r\n scope.expression.text = scope.expression.Property + ' ' + scope.expression.Operator + ' \\'' + item.Value + '\\'';\r\n }\r\n scope.onchange();\r\n }\r\n\r\n scope.showExpression = function()\r\n {\r\n if (scope.selectedBiometricAlertExpressionList.isExpressionListEnabled == false)\r\n {\r\n return (scope.showOperatorList('array') || scope.showOperatorList('string') || scope.showOperatorList('int'));\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n scope.showExpressionList = function()\r\n {\r\n return scope.selectedBiometricAlertExpressionList.isExpressionListEnabled;\r\n }\r\n\r\n function propChanged(){\r\n scope.expression.Value = '';\r\n\r\n scope.selectedBiometricAlertExpressionList.isExpressionListEnabled = false;\r\n scope.selectedBiometricAlertExpressionList.selectItems = [];\r\n scope.selectedBiometricAlertExpressionList.selected = undefined;\r\n \r\n var filter = lodash.filter(scope.biometricAlertExpressionValues, function(x) {\r\n if (\"{\" + x.ExpressionName.toUpperCase() + \"}\" == scope.expression.Property.toUpperCase())\r\n { \r\n scope.selectedBiometricAlertExpressionList.isExpressionListEnabled = true;\r\n scope.selectedBiometricAlertExpressionList.hideId = !x.HideId\r\n return x;\r\n }\r\n });\r\n if (filter.length > 0)\r\n {\r\n scope.selectedBiometricAlertExpressionList.selectItems = filter[0].ExpressionValues;\r\n }\r\n updateExpression();\r\n }\r\n\r\n function updateExpression(){\r\n var type = getSelectedPropertyType();\r\n var enableTypeahead = getSelectedPropertyTypeahead();\r\n switch( type ){\r\n case 'bool':{\r\n scope.expression.text = scope.expression.Property + ' ' + scope.expression.Operator + ' true';\r\n break;\r\n }\r\n case 'string':\r\n case 'array':{\r\n scope.expression.text = scope.expression.Property + ' ' + scope.expression.Operator + ' \\'' + scope.expression.Value + '\\'';\r\n break;\r\n }\r\n default:{\r\n scope.expression.valueInvalid = false;\r\n scope.expression.minMaxInvalid = false;\r\n scope.valueSafeguard = \"safeguard\"\r\n\r\n scope.valueError = '';\r\n if (scope.expression.Value && scope.changed) {\r\n if (scope.isPatientLevel){\r\n scope.condition.isDirty = true;\r\n }\r\n scope.expression.Value = scope.expression.Value.replace(/[^0-9]/g, '');\r\n }\r\n if (scope.expression.MinSafeguard) {\r\n scope.expression.MinSafeguard = scope.expression.MinSafeguard.replace(/[^0-9]/g, '');\r\n if (scope.expression.MinSafeguard && scope.expression.Value && parseInt(scope.expression.Value) < parseInt(scope.expression.MinSafeguard)) {\r\n scope.expression.valueInvalid = true;\r\n if (scope.isPatientLevel) {\r\n scope.valueSafeguard = scope.expression.MinSafeguard;\r\n }\r\n scope.valueError = \"lower\";\r\n }\r\n }\r\n if (scope.expression.MaxSafeguard) {\r\n scope.expression.MaxSafeguard = scope.expression.MaxSafeguard.replace(/[^0-9]/g, '');\r\n if (scope.expression.MaxSafeguard && scope.expression.Value && parseInt(scope.expression.Value) > parseInt(scope.expression.MaxSafeguard)) {\r\n scope.expression.valueInvalid = true;\r\n if (scope.isPatientLevel) {\r\n scope.valueSafeguard = scope.expression.MaxSafeguard;\r\n }\r\n scope.valueError = \"higher\";\r\n }\r\n if (scope.expression.MaxSafeguard && scope.expression.MinSafeguard && parseInt(scope.expression.MinSafeguard) > parseInt(scope.expression.MaxSafeguard)) {\r\n scope.expression.minMaxInvalid = true;\r\n }\r\n }\r\n scope.expression.text = scope.expression.Property + ' ' + scope.expression.Operator + ' ' + scope.expression.Value;\r\n break\r\n }\r\n }\r\n scope.changed = true;\r\n \r\n scope.condition.edit = type === 'composite';\r\n scope.enableTypeahead = enableTypeahead;\r\n\r\n scope.onchange();\r\n }\r\n\r\n function getSelectedPropertyTypeahead(){\r\n var retVal = '';\r\n var varType = lodash.pluck(lodash.filter(scope.properties, { 'Value' : scope.expression.Property } ), 'enableTypeahead');\r\n if(varType.length > 0){\r\n retVal = varType[0];\r\n } \r\n return retVal;\r\n }\r\n function getSelectedPropertyType(){\r\n var retVal = '';\r\n var varType = lodash.pluck(lodash.filter(scope.properties, { 'Value' : scope.expression.Property } ), 'Type');\r\n if(varType.length > 0){\r\n retVal = varType[0];\r\n } \r\n return retVal;\r\n }\r\n\r\n scope.addExpression = function(){\r\n scope.expressionLast = false;\r\n scope.add();\r\n }\r\n\r\n scope.removeExpression = function(){\r\n scope.remove(scope.expression);\r\n }\r\n\r\n scope.searchTags = function(term) {\r\n var tagsList = lodash(scope.tags).map(function(tag){\r\n return {\r\n label: tag\r\n }\r\n })\r\n .filter(function(t) {\r\n return t.label.toUpperCase().indexOf(term.toUpperCase()) >= 0;\r\n })\r\n .sortBy('label')\r\n .value();\r\n\r\n scope.surveyTags = tagsList;\r\n return tagsList;\r\n }\r\n\r\n scope.getTag = function(item) {\r\n return item.label.trim();\r\n }\r\n }\r\n };\r\n}\r\nangular.module(\"system.biometricAlerts\").directive(\"biometricAlertExpression\", biometricAlertExpressionDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/biometricalerts/biometricAlertExpression.tpl.html',\n '
          {{expression.Property.replace(\\'{\\', \\'\\').replace(\\'}\\', \\'\\')}} {{expression.Operator}}
          Value is {{valueError}} than {{valueSafeguard}}.
          Min:
          Max:
          Minimum safeguard is higher than maximum safeguard.
          ');\n}]);\n}(window, document, window.angular));","function BiometricAlertsController(BiometricAlertsService, $scope, $state, $http, $uibModal, vhSweetAlert,TemplatesService, lodash, PermissionService) {\r\n var vm = this;\r\n vm.BiometricAlerts = [];\r\n vm.selectedBiometricAlert = undefined;\r\n vm.anyProgram = {Name: 'Any Program', Value: ''};\r\n vm.ProgramFilter = undefined;\r\n vm.refresh = refresh;\r\n vm.biometricAlertFilter = biometricAlertFilter;\r\n vm.filterChanged = filterChanged;\r\n vm.clearFilters = clearFilters;\r\n vm.populations = [];\r\n vm.programTypes = [];\r\n\r\n vm.loading = true;\r\n vm.searchText = '';\r\n \r\n vm.selectedBiometricAlerts = [];\r\n\r\n vm.alertSecurityLevels = [\r\n { AlertSecurityLevelId: 1, Name: 'High Alert' },\r\n { AlertSecurityLevelId: 2, Name: 'Medium Alert' },\r\n { AlertSecurityLevelId: 4, Name: 'Notification' }\r\n ]\r\n\r\n vm.isSelected = (id) => vm.selectedBiometricAlerts.find(x => x == id);\r\n\r\n vm.toggleSelect = (event, id) => {\r\n event.stopPropagation();\r\n var selected = vm.isSelected(id);\r\n vm.selectedBiometricAlerts = vm.selectedBiometricAlerts.filter(x => x != id);\r\n\r\n if(!selected)\r\n vm.selectedBiometricAlerts = vm.selectedBiometricAlerts.concat([id]);\r\n }\r\n\r\n init();\r\n \r\n function init(){\r\n var fromState = ($state.params.FromState || {}); \r\n vm.ProgramFilter = fromState.ProgramFilter;\r\n vm.searchText = fromState.searchText;\r\n\r\n vm.refresh(fromState.ProgramFilter);\r\n }\r\n\r\n vm.view = function(biometricAlertId){\r\n $state.go('system.biometricAlerts.biometricAlert', { BiometricAlertId: biometricAlertId, \r\n FromState: { ActionNameFilter : vm.ActionNameFilter, EventNameFilter : vm.EventNameFilter, ProgramFilter : vm.ProgramFilter, searchText: vm.searchText } \r\n });\r\n }\r\n\r\n vm.clearSearch = ()=>{ vm.searchText = ''; vm.searchTextBox = ''; };\r\n vm.searchChanged = ()=>{ vm.searchText = vm.searchTextBox; }\r\n\r\n function clearFilters(){\r\n vm.ProgramFilter = vm.anyProgram.Value;\r\n vm.ActionNameFilter = null;\r\n vm.EventNameFilter = null;\r\n vm.searchText = '';\r\n vm.searchTextBox = '';\r\n }\r\n\r\n function refresh(selectProgram){\r\n loadPrograms(selectProgram || '');\r\n BiometricAlertsService.getAll().then(function(data){\r\n vm.BiometricAlerts = data;\r\n vm.BiometricAlerts.forEach(alert => {\r\n alert.Name = alert.BiometricMeasurementTypeName + ' - ' + vm.displayProgramName(alert);\r\n alert.BiometricAlertConditions.forEach(condition => {\r\n condition.Severity = vm.alertSecurityLevels.find(a => a.AlertSecurityLevelId == condition.AlertSeverityLevelId).Name;\r\n });\r\n });\r\n vm.loading = false;\r\n })\r\n .catch(()=>{\r\n vm.loading = false;\r\n });\r\n }\r\n\r\n function loadPrograms(selectProgram){\r\n \r\n BiometricAlertsService.getPopulations().then(function (data) {\r\n vm.populations = data;\r\n vm.allPatients = lodash.find(data, function (p) { return p.IsAllPatients; });\r\n }).then(function(){\r\n vm.programTypes = vm.populations.map(function(population){\r\n return {\r\n Name: population.PopulationName,\r\n Value: population.PopulationId\r\n };\r\n });\r\n if(!selectProgram) \r\n vm.ProgramFilter = selectProgram;\r\n });\r\n }\r\n\r\n vm.addBiometricAlert = function(){\r\n $state.go('system.biometricAlerts.biometricAlert', { BiometricAlertId: 0, FromState: { ActionNameFilter : vm.ActionNameFilter, EventNameFilter : vm.EventNameFilter, ProgramFilter : vm.ProgramFilter } });\r\n }\r\n\r\n vm.deleteBiometricAlert = function(biometricAlertId){\r\n var text = 'Are you sure you want to delete this biometricAlert?';\r\n vhSweetAlert.verify('Are you sure?', text, 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n BiometricAlertsService.deleteBiometricAlert(biometricAlertId).then(function(data){vm.selectedBiometricAlert = undefined;refresh();});\r\n }\r\n }\r\n );\r\n }\r\n\r\n vm.select = function(biometricAlert) {\r\n vm.selectedBiometricAlert = biometricAlert;\r\n }\r\n\r\n function biometricAlertFilter(biometricAlert){\r\n var retVal = false;\r\n \r\n if(hasProgram(biometricAlert, vm.ProgramFilter))\r\n {\r\n retVal = true;\r\n }\r\n\r\n if(retVal && biometricAlert && vm.searchText && vm.searchText.length > 0)\r\n {\r\n retVal = retVal && (biometricAlert.Name.toLowerCase().indexOf(vm.searchText.toLowerCase()) > -1 || biometricAlert.AlertName.toLowerCase().indexOf(vm.searchText.toLowerCase()) > -1);\r\n }\r\n\r\n return retVal || vm.selectedBiometricAlerts.find(x => biometricAlert.BiometricAlertId == x) != null;\r\n }\r\n\r\n function hasProgram(biometricAlert, program){\r\n var retVal = false;\r\n //biometricAlert assigned to any programs\r\n if(program == undefined || program == vm.anyProgram.Value) {\r\n retVal = true;\r\n }\r\n // biometricAlert assigned to All Patients\r\n else if(biometricAlert.BiometricAlertPrograms.length < 1 && program == vm.allPatients.PopulationId) {\r\n retVal = true;\r\n }\r\n else {\r\n lodash.forEach(biometricAlert.BiometricAlertPrograms, function(Program)\r\n {\r\n if(Program.PopulationId == program)\r\n {\r\n retVal = true;\r\n }\r\n });\r\n }\r\n \r\n return retVal;\r\n }\r\n\r\n vm.displayProgramName = function(biometricAlert)\r\n { \r\n var programText = '';\r\n var programList = [];\r\n if(biometricAlert.BiometricAlertPrograms.length < 1)\r\n {\r\n programText = 'Not Assigned';\r\n }\r\n\r\n lodash.forEach(biometricAlert.BiometricAlertPrograms, function(Program)\r\n {\r\n var ProgramName = vm.populations.find(item => item.PopulationId === Program.PopulationId);\r\n\r\n if (ProgramName != null)\r\n {\r\n programList.push(ProgramName.PopulationName);\r\n }\r\n });\r\n //case insensitve sort\r\n\t programList.sort(function(x,y){\r\n var a = String(x).toUpperCase();\r\n var b = String(y).toUpperCase();\r\n if (a > b)\r\n return 1\r\n if (a < b)\r\n return -1\r\n return 0;\r\n });\r\n\t lodash.forEach(programList, function(programItem)\r\n {\r\n if(programText != '') programText += ', ';\r\n programText += programItem;\r\n });\r\n return programText;\r\n }\r\n\r\n function filterChanged(){\r\n vm.searchText = vm.searchTextBox;\r\n vm.selectedBiometricAlert = undefined;\r\n //vm.selectedBiometricAlerts = [];\r\n }\r\n}\r\n\r\nangular.module(\"system.biometricAlerts\").controller(\"BiometricAlertsController\", BiometricAlertsController);\r\n","function BiometricAlertsService($http, PendingService, PopulationsRepository) {\r\n return {\r\n getAll: function () {\r\n return $http.get('/api/BiometricAlert').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n get: function (biometricAlertId) {\r\n return PendingService.promise('get biometric alert ' + biometricAlertId, ()=> $http.get('/api/BiometricAlert/' + biometricAlertId))\r\n .then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n saveBiometricAlert: function(biometricAlert) {\r\n return $http.post(\"/api/BiometricAlert\", biometricAlert).then(function(data) {\r\n return data;\r\n });\r\n },\r\n deleteBiometricAlert: function (id) {\r\n return $http.delete('/api/BiometricAlert/' + id);\r\n },\r\n\r\n getRuleExpressionValues: function() {\r\n return PendingService.promise('get biometric alert expression values', () => $http.get('/api/Rule/GetRuleExpressionValues'))\r\n .then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getPopulations: function() {\r\n return PopulationsRepository.getAll({ enabledOnly: true, includeAllPatients: true });\r\n },\r\n\r\n getBiometricAlertPopulations: function(id) {\r\n return PendingService.promise('get biometric alert population dictionary', () => $http.get(\"/api/BiometricAlert/Populations/\" + id))\r\n .then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getBiometricMeasurementTypes: function() {\r\n return PendingService.promise('get biometric types', () => $http.get(\"/api/BiometricMeasurementType/WithParameters\"))\r\n .then(function(response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n postTestAlert: function(BiometricMeasurementAlertType, SurveyParameterType, Value) {\r\n let data = {BiometricMeasurementAlertType, SurveyParameterType, Value};\r\n return $http.post(\"/api/BiometricAlert/Test\", data).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module(\"system.biometricAlerts\").service(\"BiometricAlertsService\", BiometricAlertsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/biometricalerts/biometricalerts.tpl.html',\n '

          Biometric Alerts

          Biometric Alerts {{biometricAlerts.length}}
          0\" ng-click=\"vm.clearSearch()\">

          Loading...

          0 || vm.loading\">

          There are no biometric alerts setup.

          {{vm.displayProgramName(vm.selectedBiometricAlert)}}
          {{vm.selectedBiometricAlert.AlertName}}
          0\">Else If ({{condition.Condition}})
          {{condition.Severity}}({{condition.AlertText}})
          ');\n}]);\n}(window, document, window.angular));","function biometricAlertTestDirective(lodash, BiometricAlertsService) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: function(elem, attr) {\r\n return 'modules/system/biometricalerts/biometricAlertTest.tpl.html';\r\n },\r\n scope: {\r\n controller: \"=\",\r\n },\r\n \r\n link: function (scope) {\r\n\r\n scope.$watch('controller.biometricMeasurementType.SurveyParameterTypes', function(types) {\r\n if (angular.isUndefined(types) || types == null) return;\r\n scope.properties = lodash.map(types,function(type) {\r\n return {\r\n Value: '{' + type.Name + '}',\r\n Name: type.Name,\r\n Type: 'int' \r\n };\r\n });\r\n scope.controller.testParameter = '{' + types[0].Name + '}';\r\n }\r\n );\r\n\r\n if (scope.controller){\r\n scope.controller.updateExpression = function(){\r\n if (scope.controller.testValue) {\r\n scope.controller.testValue = scope.controller.testValue.replace(/[^0-9]/g, '');\r\n }\r\n }\r\n }\r\n\r\n }\r\n };\r\n}\r\nangular.module(\"system.biometricAlerts\").directive(\"biometricAlertTest\", biometricAlertTestDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/biometricalerts/biometricAlertTest.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","function EmailController($http, EmailService, lodash) {\r\n\r\n var vm = this;\r\n loadController();\r\n\r\n\r\n this.email = {\r\n SubjectText: \"\",\r\n BodyText: \"\",\r\n SendDate_UTC: new Date(),\r\n ExpirationDate_UTC: getExpiration(),\r\n EmailAddress: \"\",\r\n SendingCaregiver_Id: 1,\r\n ReceivingCaregiver_Id: 1,\r\n Retries: 5\r\n };\r\n blankNumerics();\r\n\r\n function loadController() {\r\n loadEmails();\r\n\r\n }\r\n function blankNumerics() {\r\n vm.email.ReceivingCaregiver_Id = null;\r\n vm.email.SendingCaregiver_Id = null;\r\n\r\n }\r\n function loadEmails(response) {\r\n EmailService.getQueuedEmails().then(bindEmails);\r\n }\r\n function bindEmails(response) {\r\n vm.emails = response;\r\n }\r\n\r\n function getExpiration() {\r\n var now = new Date();\r\n var tommorow_utc = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() + 5, now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());\r\n return tommorow_utc;\r\n }\r\n\r\n function clearEmailFields() {\r\n vm.email.EmailAddress = \"\";\r\n vm.email.BodyText = \"\";\r\n vm.email.SubjectText = \"\";\r\n vm.email.ReceivingCaregiver_Id = null;\r\n vm.email.SendingCaregiver_Id = null;\r\n }\r\n\r\n function alertEmailSent() {\r\n console.info(\"Sent email to \" + vm.email.EmailAddress);\r\n }\r\n\r\n vm.addEmailToQueue = function addEmailToQueue() {\r\n EmailService.addEmailToQueue(vm.email)\r\n .then(alertEmailSent)\r\n .then(clearEmailFields);\r\n }\r\n \r\n vm.deleteEmail = function deleteEmail(id) {\r\n EmailService.deleteEmail(id).then(loadEmails);\r\n }\r\n\r\n}\r\n\r\nangular.module('system.email').controller('EmailController', EmailController);","function EmailService($http) {\r\n function addEmailToQueue(email) {\r\n return $http.post('/api/emailqueue/', email).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n\r\n }\r\n\r\n function deleteEmail(id) {\r\n return $http.delete('/api/emailqueue/' + id).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getQueuedEmails() {\r\n return $http.get('/api/emailqueue/').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n addEmailToQueue: addEmailToQueue,\r\n deleteEmail: deleteEmail,\r\n getQueuedEmails: getQueuedEmails\r\n }\r\n\r\n\r\n}\r\n\r\nangular.module('system.email').factory('EmailService', EmailService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/email/email.tpl.html',\n '

          Send a test Email message

          Email Queue
          IdSending CaregiverReceiving CaregiverEmailSubjectCreated Date
          {{email.EmailQueueId}}{{email.SendingCaregiver_Id}}{{email.ReceivingCaregiver_Id}}{{email.EmailAddress}}{{email.SubjectText}}{{email.CreatedDateTime_UTC | datetime : \"datetime\" : \"UTC\"}}{{email.BodyText}}
          ');\n}]);\n}(window, document, window.angular));","function EmailServerCtrl($uibModal, servers, EmailServersService) {\r\n\r\n var vm = this;\r\n vm.EmailServers = servers;\r\n vm.IsAll = true;\r\n vm.openEdit = openEdit;\r\n vm.toggleSSL = toggleSSL;\r\n \r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n \r\n for(var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n\r\n EmailServersService.updateEmailServerList(list);\r\n }\r\n\r\n function toggleSSL(server) {\r\n server.IsSSLConnection = !server.IsSSLConnection\r\n saveServer(server);\r\n }\r\n\r\n function saveServer(server) {\r\n EmailServersService.updateEmailServer(server.EmailServerId, server);\r\n }\r\n\r\n function openEdit(server) {\r\n $uibModal.open({\r\n controller: 'EmailServerEditCtrl',\r\n templateUrl: 'modules/system/emailServers/emailServersEdit.tpl.html',\r\n resolve: {\r\n server: function() {\r\n return server;\r\n }\r\n }\r\n }).result.then(function(result){\r\n if(result !== undefined) {\r\n EmailServersService.getEmailServers().then(function(data){\r\n vm.EmailServers = data;\r\n });\r\n }\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module('system.emailServers').controller('EmailServerCtrl', EmailServerCtrl);","function EmailServersService($http) {\r\n\r\n function getEmailServers() {\r\n return $http({\r\n method:'GET',\r\n url:'/api/EmailServer'\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateEmailServer(emailServerId, server) {\r\n return $http({\r\n method:'PUT',\r\n url:'/api/EmailServer?id='+emailServerId,\r\n data:JSON.stringify(server)\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n \r\n function updateEmailServerList(servers) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/EmailServer',\r\n data: servers\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getEmailServers: getEmailServers,\r\n updateEmailServer:updateEmailServer,\r\n updateEmailServerList:updateEmailServerList\r\n }\r\n}\r\n\r\nangular.module('system.emailServers').service('EmailServersService', EmailServersService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/emailServers/emailServers.tpl.html',\n '

          Email Servers

          Data Center

          From

          UserName

          Password

          Host

          Port

          IsSSL

          {{item.DataCenter}}
          {{item.From}}
          {{item.UserName}}
          {{item.Password}}
          {{item.Host}}
          {{item.Port}}
          ');\n}]);\n}(window, document, window.angular));","function EmailServerEditCtrl($scope, $uibModalInstance, server, EmailServersService) {\r\n var vm = this;\r\n \r\n $scope.server = server === undefined ? { EmailServerId: 0 } : server;\r\n $scope.cancel = cancel;\r\n $scope.save = save;\r\n\r\n function cancel() {\r\n $uibModalInstance.close();\r\n }\r\n\r\n function save() {\r\n $scope.emailServersForm.$setSubmitted();\r\n if($scope.emailServersForm.$valid) {\r\n EmailServersService.updateEmailServer($scope.server.EmailServerId, $scope.server).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n\r\n}\r\n\r\nangular.module('system.emailServers').controller('EmailServerEditCtrl', EmailServerEditCtrl);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/emailServers/emailServersEdit.tpl.html',\n '

          Email Server

          IsSSL
          ');\n}]);\n}(window, document, window.angular));","function AddFormModalController(form, variables, count, FormsService, $uibModalInstance, lodash) {\r\n var vm = this;\r\n\r\n //data\r\n vm.form = angular.copy(form);\r\n vm.count = count;\r\n vm.modalHeader = \"Edit Form\";\r\n vm.selectedPopulations = [];\r\n vm.populations = [];\r\n var allPatients = {PopulationName: 'All Patients', PopulationId: 0};\r\n\r\n var textSizeTools = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];\r\n var textStyleTools = ['bold', 'italics', 'underline'];\r\n var listTools = ['ul', 'ol'];\r\n var textAlignTools = ['justifyLeft', 'justifyCenter', 'justifyRight'];\r\n var otherTools = ['fontColor', 'html'];\r\n\r\n vm.tools = [textSizeTools, textStyleTools, listTools, textAlignTools, otherTools];\r\n\r\n //functions\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.isValid = isValid;\r\n vm.newForm = true;\r\n\r\n var variableDisplay = lodash(variables).map(function (v) {\r\n return {\r\n label: v.Name\r\n }\r\n })\r\n .sortBy('label')\r\n .value();\r\n\r\n vm.variableDisplay = variableDisplay;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n if (FormsService.isGreaterThanZero(vm.form.FormId)) {\r\n vm.newForm = false;\r\n }\r\n\r\n if (vm.newForm) {\r\n vm.modalHeader = \"Add New Form\";\r\n vm.form.IsActive = false;\r\n vm.form.PostProcessor = '';\r\n vm.form.SortOrder = vm.count + 1;\r\n\r\n }\r\n loadFormPopulations();\r\n\r\n vm.variables = variableDisplay;\r\n if (vm.variables.length > 7) {\r\n vm.variables = vm.variables.slice(0, 5);\r\n }\r\n }\r\n\r\n function loadFormPopulations() {\r\n //vm.selectedPopulations = get availble populations\r\n FormsService.getPopulations().then(function (data) {\r\n data.unshift(allPatients);\r\n vm.populations = data;\r\n\r\n }).then(function () {\r\n if (vm.form.IsDefault == true) {\r\n vm.selectedPopulations = [allPatients];\r\n }\r\n else if (vm.form.FormId) {\r\n FormsService.getFormPopulationIds(vm.form.FormId).then(function (data) {\r\n vm.selectedPopulations = lodash.filter(vm.populations, function (o) {\r\n return lodash(data).includes(o.PopulationId)\r\n });\r\n })\r\n }\r\n });\r\n }\r\n\r\n //vm.selectedPopulations\r\n vm.defaultsChanged = function defaultsChanged() {\r\n var isDefault = vm.form.IsDefault;\r\n var allPatients = lodash.find(vm.selectedPopulations, function (p) {\r\n return p.PopulationId === 0;\r\n });\r\n if (isDefault && allPatients !== undefined && vm.selectedPopulations.length > 1) {\r\n var copySelected = angular.copy(vm.selectedPopulations);\r\n lodash.remove(copySelected, function (p) {\r\n return p.PopulationId === 0;\r\n });\r\n vm.selectedPopulations = copySelected;\r\n vm.form.IsDefault = false;\r\n vm.form.FormPopulations = vm.selectedPopulations;\r\n } else if (!isDefault && allPatients) {\r\n vm.selectedPopulations = [allPatients];\r\n vm.form.IsDefault = true;\r\n vm.form.FormPopulations = [];\r\n } else if (vm.selectedPopulations.length < 1) {\r\n vm.form.IsDefault = false;\r\n vm.form.FormPopulations = [];\r\n } else {\r\n vm.form.FormPopulations = vm.selectedPopulations;\r\n }\r\n };\r\n\r\n vm.searchVariables = searchVariables;\r\n vm.getVariableText = getVariableText;\r\n vm.mentioSetupHeader = mentioSetupHeader;\r\n vm.mentioSetupFooter = mentioSetupFooter;\r\n\r\n function searchVariables(term) {\r\n var variableList = lodash(variableDisplay)\r\n .filter(function (v) {\r\n return v.label.toUpperCase().indexOf(term.toUpperCase()) >= 0;\r\n })\r\n .sortBy('label')\r\n .value();\r\n\r\n if (variableList.length > 7) {\r\n variableList = variableList.slice(0, 5);\r\n }\r\n\r\n vm.variables = variableList;\r\n return variableList;\r\n }\r\n\r\n function getVariableText(item) {\r\n return '{' + item.label + '}';\r\n }\r\n\r\n function mentioSetup(element) {\r\n element.attr('mentio', 'mentio');\r\n element.attr('mentio-typed-term', 'vm.headerTypedTerm');\r\n }\r\n\r\n function mentioSetupHeader(element) {\r\n mentioSetup(element);\r\n element.attr('mentio-id', \"'headerContent'\");\r\n }\r\n\r\n function mentioSetupFooter(element) {\r\n mentioSetup(element);\r\n element.attr('mentio-id', \"'footerContent'\");\r\n }\r\n\r\n vm.variableTooltipTemplate = 'modules/system/forms/add-question-variable-tooltip.tpl.html';\r\n\r\n vm.onPaste = function (html) {\r\n return html.replace(/<(|\\/)(html|body|meta)[^>]*?>/ig, '').trim();\r\n };\r\n\r\n function ok() {\r\n if (isValid()) {\r\n done();\r\n }\r\n }\r\n\r\n function done() {\r\n if (vm.form.PostProcessor != undefined && vm.form.PostProcessor.indexOf('RiskStratificationPostProcessor') != -1) {\r\n vm.form.AutoRunPostProcessor = true;\r\n } else {\r\n vm.form.AutoRunPostProcessor = false;\r\n }\r\n $uibModalInstance.close(vm.form);\r\n }\r\n\r\n function isValid() {\r\n return (vm.form.FormTypeName != undefined && vm.form.FormTypeName != \"\");\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\n\r\nangular.module('system.forms').controller('AddFormModalController', AddFormModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/forms/add-form.modal.html',\n '

          {{vm.modalHeader}}

          {{$item.PopulationName}}{{population.PopulationName}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/forms/add-question-variable-tooltip.tpl.html',\n '

          Available Variables

          {{variable.label}}
          ');\n}]);\n}(window, document, window.angular));","function AddFormQuestionModalController(question, count, variables, variableTransforms, FormsService, $uibModalInstance, lodash, FormQuestionTypes) {\r\n var vm = this;\r\n\r\n //data\r\n vm.modalHeader = \"Edit Question\";\r\n vm.questionHeader = \"Edit Question Text\";\r\n vm.question = angular.copy(question);\r\n vm.count = count;\r\n vm.newQuestion = true;\r\n vm.questionOptionsDisabled = false;\r\n vm.submitted = false;\r\n vm.variableTransforms = variableTransforms;\r\n vm.optionText = '';\r\n\r\n vm.formQuestionTypes = FormQuestionTypes;\r\n vm.patientParameterTypes = [\r\n {id: '{Pulse}', label: 'Pulse'},\r\n {id: '{OxygenSat}', label: 'Oxygen Sat'},\r\n {id: '{BloodPressure}', label: 'Blood Pressure'},\r\n {id: '{Weight}', label: 'Weight'}\r\n ];\r\n\r\n\r\n // functions\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.isValid = isValid;\r\n vm.questionTypeChanged = questionTypeChanged;\r\n vm.showOptions = showOptions;\r\n vm.hasOptions = hasOptions;\r\n vm.optionLostFocus = optionLostFocus;\r\n vm.optionChanged = optionChanged;\r\n vm.removeOption = removeOption;\r\n vm.optionsAreValid = optionsAreValid;\r\n\r\n var variableDisplay = lodash(variables).map(function(v){\r\n return {\r\n label: v.Name\r\n }\r\n })\r\n .sortBy('label')\r\n .value();\r\n vm.variableDisplay = variableDisplay;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n if ( FormsService.isGreaterThanZero(question.FormQuestionId) ) {\r\n vm.newQuestion = false;\r\n }\r\n// var section = lodash.find(vm.form.FormSections, {FormSectionId : vm.sectionId});\r\n if (vm.newQuestion) {\r\n vm.question = {};\r\n vm.modalHeader = \"Add New Question\";\r\n vm.questionHeader = \"Enter New Question Text\";\r\n vm.question.Columns = 4;\r\n vm.question.MinHeight = 50;\r\n vm.question.FormOptions = [];\r\n vm.question.Required = true;\r\n vm.question.SortOrder = vm.count + 1;\r\n\r\n// if (section != undefined && section != null) {\r\n// vm.question.SortOrder = section.FormQuestions.length + 1;\r\n// section.FormQuestions.push(vm.question);\r\n// }\r\n }\r\n else{\r\n// vm.question = lodash.find(section.FormQuestions, { FormQuestionId : question.FormQuestionId} );\r\n }\r\n vm.question.RequiredStr = vm.question.Required ? \"yes\" : \"no\";\r\n\r\n if (vm.question.FormQuestionTypeId != undefined && vm.question.FormQuestionTypeId != null && vm.question.FormQuestionTypeId > 0 ){\r\n optionChanged();\r\n }\r\n\r\n vm.variables = variableDisplay;\r\n if(vm.variables.length > 7){\r\n vm.variables = vm.variables.slice(0, 5);\r\n }\r\n\r\n if(vm.question.FormOptions && vm.question.FormOptions.length > 0) {\r\n vm.optionText = vm.question.FormOptions[0].Text;\r\n }\r\n }\r\n\r\n vm.searchVariables = searchVariables;\r\n vm.getVariableText = getVariableText;\r\n\r\n function searchVariables(term) {\r\n var variableList = lodash(variableDisplay)\r\n .filter(function(v){\r\n return v.label.toUpperCase().indexOf(term.toUpperCase()) >= 0;\r\n })\r\n .sortBy('label')\r\n .value();\r\n\r\n if(variableList.length > 7){\r\n variableList = variableList.slice(0, 5);\r\n }\r\n\r\n vm.variables = variableList;\r\n return variableList;\r\n }\r\n\r\n function getVariableText(item) {\r\n return '{' + item.label + '}';\r\n }\r\n\r\n vm.variableTooltipTemplate = 'modules/system/forms/add-question-variable-tooltip.tpl.html';\r\n\r\n function showOptions () {\r\n return (vm.question.FormOptions.length > 0);\r\n }\r\n\r\n function hasOptions() {\r\n var hiddenTypes = [10, 11, 12, 14, 15, 16, 17, 18, 19];\r\n\r\n return hiddenTypes.indexOf(vm.question.FormQuestionTypeId) < 0;\r\n }\r\n\r\n function addNewOption(text, sortOrder){\r\n var newOption = {\r\n Text: text,\r\n SortOrder: sortOrder\r\n };\r\n vm.question.FormOptions.push(newOption);\r\n }\r\n\r\n function addEmptyOption(){\r\n addNewOption('', 0);\r\n }\r\n\r\n function optionChanged() {\r\n //only add a new option if the last one is not empty\r\n if (!vm.questionOptionsDisabled && !optionIsEmpty(vm.question.FormOptions[vm.question.FormOptions.length - 1]) && Number(vm.question.FormQuestionTypeId) != 4 && Number(vm.question.FormQuestionTypeId) != 5 ) {\r\n addEmptyOption();\r\n }\r\n }\r\n\r\n function optionLostFocus() {\r\n removeEmptyOptions();\r\n if(vm.question.FormQuestionTypeId === 10 || vm.question.FormQuestionTypeId === 15) {\r\n vm.question.FormOptions[0].Text = vm.optionText;\r\n }\r\n }\r\n\r\n function removeEmptyOptions() {\r\n //Do not check last option, since that one will always be empty\r\n for (i = 0; i < vm.question.FormOptions.length - 1; i++) {\r\n //Find any option text that is not empty. If none found, remove option\r\n if (optionIsEmpty(vm.question.FormOptions[i])) {\r\n vm.question.FormOptions.splice(i, 1);\r\n }\r\n }\r\n }\r\n\r\n function removeOption (index) {\r\n //Don't allow removing the last question\r\n if (!vm.questionOptionsDisabled && !optionIsEmpty(vm.question.FormOptions[index]) ) {\r\n vm.question.FormOptions.splice(index, 1);\r\n }\r\n }\r\n\r\n function optionIsEmpty(option) {\r\n var result = false;\r\n if (option != null) {\r\n var texts = option.Text;\r\n if (texts == null || texts.length === 0) {\r\n result = true;\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n function questionTypeChanged () {\r\n switch (Number(vm.question.FormQuestionTypeId)) {\r\n case 4: // multi-line textbox\r\n case 5: // textbox\r\n vm.question.FormOptions = [];\r\n addNewOption('Add note', 1);\r\n break;\r\n default:\r\n }\r\n\r\n optionChanged();\r\n }\r\n\r\n function ok() {\r\n vm.submitted = true;\r\n if (isValid() && vm.optionsAreValid()) {\r\n //Remove last option if it's empty\r\n if (optionIsEmpty(vm.question.FormOptions[vm.question.FormOptions.length - 1]) ) {\r\n vm.question.FormOptions.splice(vm.question.FormOptions.length - 1, 1);\r\n }\r\n if(vm.question.FormQuestionTypeId === 10) {\r\n vm.question.FormOptions[0].Text = vm.optionText;\r\n }\r\n vm.question.Required = vm.question.RequiredStr == \"yes\" ? true : false;\r\n setOptionSortOrder();\r\n done();\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function done() {\r\n $uibModalInstance.close(vm.question);\r\n }\r\n\r\n function isValid() {\r\n return (vm.question.Question != undefined && vm.question.Question != \"\");\r\n }\r\n\r\n function optionsAreValid() {\r\n var isValid = true;\r\n if (vm.question.FormQuestionTypeId == null || vm.question.FormQuestionTypeId === 0) {\r\n isValid = false;\r\n }\r\n switch (Number(vm.question.FormQuestionTypeId)) {\r\n case 4: // multi-line textbox\r\n case 5: // textbox\r\n //First check for empty last option\r\n if (optionIsEmpty(vm.question.FormOptions[vm.question.FormOptions.length - 1])) {\r\n if (vm.question.FormOptions.length != 2) {\r\n isValid = false;\r\n }\r\n } else {\r\n if (vm.question.FormOptions.length != 1) {\r\n isValid = false;\r\n }\r\n }\r\n break;\r\n }\r\n return isValid;\r\n }\r\n\r\n function setOptionSortOrder() {\r\n //Reset all options sort order to their indexes\r\n for (i = 0; i <= vm.question.FormOptions.length -1; i ++) {\r\n vm.question.FormOptions[i].SortOrder = i;\r\n }\r\n }\r\n\r\n}\r\nangular.module('system.forms').controller('AddFormQuestionModalController', AddFormQuestionModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/forms/add-question.modal.html',\n '

          {{vm.modalHeader}}

          {{vm.questionHeader}}

          Response Options

          1. = 3 && $index != vm.question.FormOptions.length -1\">

          Response

          ');\n}]);\n}(window, document, window.angular));","function AddFormSectionModalController(section, count, FormsService, $uibModalInstance, lodash) {\r\n var vm = this;\r\n\r\n // data\r\n vm.count = count;\r\n vm.section = angular.copy(section);\r\n vm.isValid = isValid;\r\n vm.newSection = true;\r\n vm.modalHeader = \"Edit Section\";\r\n\r\n // functions\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n\r\n loadController();\r\n function loadController() {\r\n if (FormsService.isGreaterThanZero(section.FormSectionId)) {\r\n vm.newSection = false;\r\n }\r\n\r\n if ( vm.newSection ){\r\n vm.modalHeader = \"Add New Section\";\r\n vm.section.SortOrder = vm.count + 1;\r\n }\r\n }\r\n\r\n function ok() {\r\n if (isValid()) {\r\n done();\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function done(form) {\r\n $uibModalInstance.close(vm.section);\r\n }\r\n\r\n function isValid() {\r\n return (vm.section.Title != undefined && vm.section.Title != \"\");\r\n }\r\n}\r\nangular.module('system.forms').controller('AddFormSectionModalController', AddFormSectionModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/forms/add-section.modal.html',\n '

          {{vm.modalHeader}}

          ');\n}]);\n}(window, document, window.angular));","function FormsController(FormsService, $uibModal, lodash, vhSweetAlert, $state, FormQuestionTypes) {\r\n var vm = this;\r\n // data\r\n vm.forms = [];\r\n vm.selectedForm = undefined;\r\n vm.populationString = '';\r\n\r\n // functions\r\n vm.selectForm = selectForm;\r\n vm.editForm = editForm;\r\n vm.editSection = editSection;\r\n vm.editQuestion = editQuestion;\r\n vm.unPublishForm = unPublishForm;\r\n vm.publishForm = publishForm;\r\n vm.deleteSection = deleteSection;\r\n vm.deleteForm = deleteForm;\r\n vm.deleteQuesiton = deleteQuesiton;\r\n vm.importForm = importForm;\r\n\r\n var formQuestionTypes = FormQuestionTypes;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n FormsService.getAllForms()\r\n .then(function(data) {\r\n vm.forms = data;\r\n });\r\n\r\n\r\n }\r\n\r\n function selectForm(form) {\r\n FormsService.getForm(form.FormId)\r\n .then(function(data) {\r\n vm.selectedForm = data;\r\n vm.selectedForm.jsonText = JSON.stringify(vm.selectedForm);\r\n vm.populationString = parsePopulationString(vm.selectedForm.FormPopulations);\r\n });\r\n }\r\n function parsePopulationString(formPopulations){\r\n var popString = '';\r\n\r\n for (var i = 0; i < formPopulations.length; i++) {\r\n popString += formPopulations[i].PopulationName;\r\n if(i < formPopulations.length-1){\r\n popString += ', ';\r\n }\r\n }\r\n return popString;\r\n \r\n\r\n }\r\n\r\n function editForm(selectedForm) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/forms/add-form.modal.html',\r\n controller: 'AddFormModalController as vm',\r\n keyboard: false,\r\n resolve: {\r\n form: selectedForm,\r\n count: vm.forms.length,\r\n variables: FormsService.getFormVariables(),\r\n FormQuestionTypes: function() {\r\n return formQuestionTypes;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(\r\n function(form) {\r\n saveForm(form);\r\n }\r\n );\r\n\r\n }\r\n\r\n function editSection(section, count) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/forms/add-section.modal.html',\r\n controller: 'AddFormSectionModalController as vm',\r\n keyboard: false,\r\n resolve: {\r\n section: section,\r\n count: count\r\n }\r\n });\r\n\r\n modalInstance.result.then(\r\n function(section) {\r\n if (vm.selectedForm != null) {\r\n lodash.remove(vm.selectedForm.FormSections, { FormSectionId: section.FormSectionId });\r\n vm.selectedForm.FormSections.push(section);\r\n saveForm(vm.selectedForm);\r\n }\r\n }\r\n );\r\n }\r\n\r\n function editQuestion(question, sectionId, count) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/forms/add-question.modal.html',\r\n controller: 'AddFormQuestionModalController as vm',\r\n keyboard: false,\r\n resolve: {\r\n question: question,\r\n count: count,\r\n variableTransforms: FormsService.getFormVariableTransforms(),\r\n variables: FormsService.getFormVariables(),\r\n FormQuestionTypes: function() {\r\n return formQuestionTypes;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(\r\n function(question) {\r\n //updateForm(form);\r\n if (vm.selectedForm != null) {\r\n var section = lodash.find(vm.selectedForm.FormSections, { FormSectionId: sectionId });\r\n if (section != null) {\r\n lodash.remove(section.FormQuestions, { FormQuestionId: question.FormQuestionId });\r\n section.FormQuestions.push(question);\r\n saveForm(vm.selectedForm);\r\n }\r\n }\r\n }\r\n );\r\n }\r\n\r\n function saveForm(form) {\r\n if (FormsService.isGreaterThanZero(form.FormId)) {\r\n FormsService.saveForm(form).then(updateForm);\r\n } else {\r\n FormsService.newForm(form).then(updateForm);\r\n }\r\n }\r\n\r\n function updateForm(form) {\r\n index = lodash.findIndex(vm.forms, {\r\n FormId: form.FormId\r\n });\r\n if (index == -1) {\r\n vm.forms.push(form);\r\n vm.selectedForm = form;\r\n vm.selectedForm.jsonText = JSON.stringify(vm.selectedForm);\r\n } else {\r\n vm.forms[index] = form; //angular.copy(form);\r\n vm.selectedForm = vm.forms[index];\r\n vm.selectedForm.jsonText = JSON.stringify(vm.selectedForm);\r\n }\r\n\r\n }\r\n\r\n function unPublishForm(formId) {\r\n //form = lodash.find(vm.forms, { FormId : formId} );\r\n index = lodash.findIndex(vm.forms, {\r\n FormId: formId\r\n });\r\n if (index != -1) {\r\n vm.forms[index].IsActive = false;\r\n FormsService.changeStatus(formId, false);\r\n }\r\n event.stopPropagation();\r\n return false;\r\n }\r\n\r\n function publishForm(formId) {\r\n //form = lodash.find(vm.forms, { FormId : formId} );\r\n index = lodash.findIndex(vm.forms, {\r\n FormId: formId\r\n });\r\n if (index != -1) {\r\n vm.forms[index].IsActive = true;\r\n FormsService.changeStatus(formId, true);\r\n }\r\n event.stopPropagation();\r\n return false;\r\n }\r\n\r\n function deleteSection(sectionId) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this section?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n lodash.remove(vm.selectedForm.FormSections, {\r\n FormSectionId: sectionId\r\n });\r\n saveForm(vm.selectedForm);\r\n }\r\n });\r\n }\r\n\r\n function deleteQuesiton(sectionId, questionId) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this question?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n var section = lodash.find(vm.selectedForm.FormSections, {\r\n FormSectionId: sectionId\r\n });\r\n lodash.remove(section.FormQuestions, {\r\n FormQuestionId: questionId\r\n });\r\n saveForm(vm.selectedForm);\r\n }\r\n });\r\n }\r\n\r\n\r\n\r\n function deleteForm(formId) {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this form?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n FormsService.deleteForm(formId).then(\r\n function(data) {\r\n vm.selectedForm = null;\r\n lodash.remove(vm.forms, {\r\n FormId: formId\r\n });\r\n });\r\n }\r\n });\r\n }\r\n\r\n function importForm() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/forms/import-form.modal.html',\r\n controller: 'ImportFormModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n currentList: function() {\r\n return vm.images;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(result){\r\n vhSweetAlert.success(\"Form '\" + result.FormTypeName + \"' imported.\");\r\n updateForm(result);\r\n }, function(){\r\n $state.go('system.forms', undefined, {reload: true});\r\n });\r\n }\r\n}\r\n\r\nangular.module('system.forms').controller('FormsController', FormsController);\r\n","function FormsService($http, lodash, $q, $rootScope, FileUploader, PopulationsRepository) {\r\n return {\r\n getAllForms: function () {\r\n return $http.get(\"/api/form/?includeall=true\").then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getForm: function (formId) {\r\n return $http.get(\"/api/form/\" + formId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n saveForm: function (data) {\r\n return $http.put('/api/form/' + data.FormId, data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n deleteForm: function (formId) {\r\n return $http.delete('/api/form/' + formId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n newForm: function (data) {\r\n return $http.post('/api/form/', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n isGreaterThanZero: function (objId) {\r\n return !isNaN(objId) && objId > 0;\r\n },\r\n\r\n getFileUploader: function () {\r\n var fileUploader = new FileUploader({\r\n url: '/api/ImportForm'\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function (item, options) {\r\n var i = item.name.indexOf('.json');\r\n return i !== -1;\r\n }\r\n });\r\n return fileUploader;\r\n },\r\n\r\n getPopulations: function() {\r\n return PopulationsRepository.getAll();\r\n },\r\n\r\n changeStatus: function (formId, status) {\r\n return $http.put('/api/form/' + formId + '/Enable/' + status, null).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getFormPopulationIds: function (formId) {\r\n return $http.get(\"/api/form/\" + formId + \"/PopulationIds\").then(function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getFormVariableTransforms: function() {\r\n return $http.get('/api/form/variableTransforms').then(function(response){\r\n return response.data;\r\n });\r\n },\r\n\r\n getFormVariables: function() {\r\n return $http.get('/api/form/variables').then(function(response){\r\n return response.data;\r\n });\r\n },\r\n \r\n getQuestionTypes: function() {\r\n return $http.get('/api/form/QuestionTypes').then(function(res) { \r\n return res.data.map(function(t) {\r\n t.Text = t.Name;\r\n return t;\r\n });\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"system.forms\").factory(\"FormsService\", FormsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/forms/forms.tpl.html',\n '

          Forms

          1. Viewing {{vm.forms.length}} forms
          Active Forms {{activeForms.length}}

           {{form.FormTypeName}}

          Inactive Forms {{inactiveForms.length}}

           {{form.FormTypeName}}

          {{vm.selectedForm.FormTypeName}}
          {{vm.selectedForm.Description}} No description

          {{vm.selectedForm.Pretext}}

          No pretext

          No sections

          Add Section
          {{section.Title}}    {{section.FormQuestions.length}}

          {{section.Description}}

          1. {{question.Question}} 
            1. {{option.Text}}
          0\" vh-required-permission=\"\" permission=\"SystemFormsWrite\">

          {{vm.selectedForm.Posttext}}

          No pretext
          ');\n}]);\n}(window, document, window.angular));","function ImportFormModalController(FormsService, $uibModalInstance, $state, NavigationService) {\r\n var vm = this;\r\n //data\r\n var theFile;\r\n\r\n //functions\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.fileUploader = FormsService.getFileUploader();\r\n\r\n\r\n var fileNameValidationError = { text: \"File name has illegal characters.\", type: 'danger' };\r\n\r\n vm.fileUploader.onAfterAddingFile = function (fileItem) {\r\n var fileName = fileItem.file.name;\r\n\r\n if (fileName.length > 20) {\r\n fileName = fileName.slice(0, 20);\r\n fileName += '...';\r\n }\r\n vm.fileName = fileName;\r\n vm.alerts = [];\r\n if (theFile) {\r\n vm.fileUploader.removeFromQueue(theFile);\r\n }\r\n\r\n if (!isValidFileName(fileItem.file.name)) {\r\n vm.alerts = [fileNameValidationError];\r\n vm.fileUploader.removeFromQueue(fileItem);\r\n return;\r\n }\r\n theFile = fileItem;\r\n theFile.onProgress = function (progress) {\r\n if (progress == 100) {\r\n progress = 99;\r\n }\r\n vm.progress = progress;\r\n };\r\n\r\n theFile.onSuccess = function (response, status, headers) {\r\n $uibModalInstance.close(response);\r\n };\r\n\r\n theFile.onError = function (response, status, headers) {\r\n var errorText;\r\n if (vm.isIENine) {\r\n errorText = response;\r\n } else {\r\n errorText = response.ErrorMessage;\r\n }\r\n vm.alerts = [{ text: errorText, type: 'danger' }];\r\n };\r\n };\r\n\r\n function ok() {\r\n if (vm.isIENine) {\r\n vm.progress = 99;\r\n }\r\n theFile.upload();\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function isValidFileName(name) {\r\n var fileNameRegEx = /^[A-Za-z0-9\\._-\\s]*$/;\r\n return fileNameRegEx.test(name);\r\n }\r\n}\r\nangular.module('system.forms').controller('ImportFormModalController', ImportFormModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/forms/import-form.modal.html',\n '

          Import Form

          {{alert.text}}
          {{vm.progress}}%
          ');\n}]);\n}(window, document, window.angular));","function GoDevicesConfirmationController($uibModalInstance, $scope){\r\n $scope.ok = function(){\r\n $uibModalInstance.close(true);\r\n }\r\n $scope.cancel = function() {\r\n $uibModalInstance.dismiss(false);\r\n }\r\n}\r\n\r\nangular.module('system.go_devices').controller('GoDevicesConfirmationController', GoDevicesConfirmationController);","function GoDevicesController($scope, $location, $state, $transitions, $uibModal, GoDevicesService, PermissionService, EditConfigurationsService, lodash, vhSweetAlert, DeviceModels) {\r\n var vm = this;\r\n $scope.selectedDevice = null;\r\n $scope.selectedDeviceCopy = null;\r\n $scope.selectedPopulation = null;\r\n $scope.EnableDirectShip = false;\r\n $scope.EnableHandDeliver = false;\r\n $scope.DeviceTypeId = null;\r\n $scope.devices = [];\r\n $scope.populations = null;\r\n $scope.DevicePopulations = { list: [] };\r\n $scope.editPopulations = false;\r\n $scope.isShowPopulations = false;\r\n $scope.isDirectShip = []; //this is an array of true/false for the device populations' direct ship option \r\n $scope.isHandDeliver = []; //this is an array of true/false for the device populations' hand deliver option\r\n $scope.isDefaultDevice = []; //this is an array of true/false for the device populations' is default device option\r\n $scope.allowNavigation = false;\r\n\r\n $scope.DeviceTypes = [];\r\n\r\n DeviceModels.forEach(function (dm) {\r\n if (lodash.find($scope.DeviceTypes, { id: dm.DeviceTypeId }) === undefined) {\r\n $scope.DeviceTypes.push({ id: dm.DeviceTypeId, name: dm.DeviceTypeValue });\r\n }\r\n });\r\n\r\n\r\n $scope.canRead = PermissionService.userHasPermission([\"GoDevicesRead\"]);\r\n $scope.canWrite = PermissionService.userHasPermission([\"GoDevicesWrite\"]); //advanced write\r\n $scope.canPopulationWrite = PermissionService.userHasPermission([\"GoDevicesPopulationsWrite\"]);\r\n\r\n //Load populations list\r\n $scope.LoadPopulations = function () {\r\n EditConfigurationsService.populationsList().then(function (data) {\r\n $scope.populations = data;\r\n });\r\n }\r\n\r\n //do calls\r\n $scope.GetDevices = function (selectDeviceModelId) {\r\n GoDevicesService.GetAll().then(function (data) {\r\n $scope.devices = data;\r\n if (selectDeviceModelId) {\r\n $scope.SelectDevice(lodash.find($scope.devices, { 'DeviceModelId': selectDeviceModelId }));\r\n } else {\r\n $scope.SelectDevice($scope.devices[0]);\r\n }\r\n });\r\n\r\n //TODO: Add to scope\r\n }\r\n\r\n function openDeleteModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/go_devices/go_devicesDeleteConfirmation.tpl.html',\r\n controller: 'GoDevicesConfirmationController as vm',\r\n keyboard: false,\r\n size: 'sm',\r\n scope: $scope\r\n // resolve: { device: }\r\n });\r\n\r\n return modalInstance;\r\n }\r\n\r\n\r\n $scope.onDelete = function (device) {\r\n GoDevicesService.GetPatientDeviceCount(device.DeviceModelId).then(function (count) {\r\n if (count == 0) {\r\n\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete ' + device.DeviceName + '?', 'Delete').then(function (result) {\r\n if (result == true) {\r\n GoDevicesService.DeleteDevice(device.DeviceModelId).then(function (res, err) {\r\n var index = $scope.devices.indexOf(device);\r\n if (index > -1) {\r\n $scope.devices.splice(index, 1);\r\n }\r\n $scope.SelectDevice($scope.devices[0]);\r\n });\r\n }\r\n })\r\n } else {\r\n\r\n //show modal warning\r\n vhSweetAlert.error(\"Cannot delete device\", 'Device has been assigned to ' + count + ' patient(s). \\n To delete it, first complete all patients that are assigned this device.');\r\n }\r\n });\r\n }\r\n\r\n\r\n $scope.Toggle = function (device) {\r\n if ($scope.canWrite) {\r\n var confirmation = null;\r\n var status = ((device.IsEnabled) ? 'disable' : 'enable');\r\n var msg = \"Are you sure you want to \" + status + \" this device '\" + device.DeviceName + \"'?\";\r\n confirmation = vhSweetAlert.verify('Are you sure?', msg, 'Yes');\r\n confirmation.then(function (result) {\r\n if (result) {\r\n GoDevicesService.ToggleDevice(device.DeviceModelId).then(function (data) {\r\n $scope.GetDevices();\r\n })\r\n }\r\n });\r\n }\r\n }\r\n\r\n\r\n //Save device info changes \r\n $scope.EditDevice = function () {\r\n if ($scope.selectedDeviceCopy.DeviceName == null || $scope.selectedDeviceCopy.DeviceModelId == null) return;\r\n\r\n var device = $scope.selectedDevice;\r\n var msg = \"Are you sure you want to save changes to this device '\" + device.DeviceName + \"'?\";\r\n vhSweetAlert.verify('Are you sure?', msg, 'Yes').then(function (result) {\r\n if (result) {\r\n var shipOption = $scope.selectedDevice.DeviceModelDeliveryOptions.filter(function (x) {\r\n return x.DeliveryOptionId == 1\r\n })[0];\r\n\r\n var handOption = $scope.selectedDevice.DeviceModelDeliveryOptions.filter(function (x) {\r\n return x.DeliveryOptionId == 2\r\n })[0];\r\n\r\n if ($scope.EnableHandDeliver) {\r\n if (!handOption) {\r\n $scope.selectedDeviceCopy.DeviceModelDeliveryOptions.push({\r\n DeviceModelId: $scope.selectedDeviceCopy.DeviceModelId,\r\n DeliveryOptionId: 2\r\n });\r\n }\r\n } else {\r\n if (handOption) {\r\n var index = $scope.selectedDeviceCopy.DeviceModelDeliveryOptions.indexOf(handOption);\r\n $scope.selectedDeviceCopy.DeviceModelDeliveryOptions.splice(index, 1);\r\n }\r\n }\r\n if ($scope.EnableDirectShip) {\r\n if (!shipOption) {\r\n $scope.selectedDeviceCopy.DeviceModelDeliveryOptions.push({\r\n DeviceModelId: $scope.selectedDeviceCopy.DeviceModelId,\r\n DeliveryOptionId: 1\r\n });\r\n }\r\n } else {\r\n if (shipOption) {\r\n var index = $scope.selectedDeviceCopy.DeviceModelDeliveryOptions.indexOf(shipOption);\r\n $scope.selectedDeviceCopy.DeviceModelDeliveryOptions.splice(index, 1);\r\n }\r\n }\r\n $scope.selectedDeviceCopy.DeviceTypeId = $scope.DeviceTypeId;\r\n\r\n GoDevicesService.UpdateDevice($scope.selectedDeviceCopy).then(function (data) {\r\n swapDevice(data);\r\n $scope.SelectDevice(data);\r\n })\r\n }\r\n });\r\n }\r\n\r\n $scope.CancelDeviceChanges = function () {\r\n //revert the copy\r\n $scope.SelectDevice($scope.selectedDevice);\r\n }\r\n\r\n $scope.CancelPopulationChanges = function () {\r\n $scope.selectedDeviceCopy.DeviceModelTblPopulations = lodash.cloneDeep($scope.selectedDevice.DeviceModelTblPopulations);\r\n $scope.InitPopulations();\r\n }\r\n\r\n\r\n //Save device populations settings\r\n $scope.SaveDevicePopulations = function () {\r\n var msg = \"Are you sure you want to save population changes to this device '\" + $scope.selectedDeviceCopy.DeviceName + \"'?\";\r\n vhSweetAlert.verify('Are you sure?', msg, 'Yes').then(function (result) {\r\n if (result) {\r\n\r\n var populations = $scope.selectedDeviceCopy.DeviceModelTblPopulations;\r\n for (var i = 0; i < populations.length; i++) {\r\n var shipOption = populations[i].DeviceModelPopulationDeliveryOptions.filter(function (x) {\r\n return x.DeliveryOptionId == 1\r\n })[0];\r\n\r\n var handOption = populations[i].DeviceModelPopulationDeliveryOptions.filter(function (x) {\r\n return x.DeliveryOptionId == 2\r\n })[0];\r\n\r\n if ($scope.isDirectShip[i]) {\r\n if (!shipOption) {\r\n populations[i].DeviceModelPopulationDeliveryOptions.push({\r\n DeliveryOptionId: 1,\r\n DeviceModelTblPopulationId: populations[i].DeviceModelTblPopulationId\r\n });\r\n }\r\n } else {\r\n if (shipOption) {\r\n var index = populations[i].DeviceModelPopulationDeliveryOptions.indexOf(shipOption);\r\n populations[i].DeviceModelPopulationDeliveryOptions.splice(index, 1);\r\n }\r\n }\r\n\r\n if ($scope.isHandDeliver[i]) {\r\n if (!handOption) {\r\n populations[i].DeviceModelPopulationDeliveryOptions.push({\r\n DeliveryOptionId: 2,\r\n DeviceModelTblPopulationId: populations[i].DeviceModelTblPopulationId\r\n });\r\n }\r\n } else {\r\n if (handOption) {\r\n var index = populations[i].DeviceModelPopulationDeliveryOptions.indexOf(handOption);\r\n populations[i].DeviceModelPopulationDeliveryOptions.splice(index, 1);\r\n }\r\n }\r\n\r\n populations[i].IsDefaultDevice = $scope.isDefaultDevice[i];\r\n } //end for loop\r\n\r\n GoDevicesService.UpdateDevicePopulations($scope.selectedDeviceCopy.DeviceModelId, $scope.selectedDeviceCopy).then(function (data) {\r\n var tempModelName = null;\r\n var tempDeviceTypeId = null;\r\n var tempDirectShipEnabled = null;\r\n var tempHandDeliverEnabled = null;\r\n var isFormDirty = false;\r\n if ($scope.form.$dirty) {\r\n tempModelName = $scope.selectedDeviceCopy.DeviceName;\r\n tempDeviceTypeId = $scope.DeviceTypeId;\r\n tempDirectShipEnabled = $scope.EnableDirectShip;\r\n tempHandDeliverEnabled = $scope.EnableHandDeliver;\r\n isFormDirty = true;\r\n }\r\n swapDevice(data);\r\n $scope.SelectDevice(data);\r\n if (isFormDirty) {\r\n $scope.selectedDeviceCopy.DeviceName = tempModelName;\r\n $scope.DeviceTypeId = tempDeviceTypeId;\r\n $scope.EnableDirectShip = tempDirectShipEnabled;\r\n $scope.EnableHandDeliver = tempHandDeliverEnabled;\r\n $scope.form.$setDirty();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n $scope.InitPopulations = function () {\r\n $scope.popform.$setPristine();\r\n $scope.selectedDeviceCopy.DeviceModelDeliveryOptions = Object.assign({}, $scope.selectedDevice).DeviceModelDeliveryOptions;\r\n $scope.PopulateDevicePopulations($scope.selectedDevice);\r\n\r\n //Show populations section if the device has at least one device delivery option selected\r\n if ($scope.selectedDeviceCopy.DeviceModelDeliveryOptions.length > 0) {\r\n $scope.isShowPopulations = true;\r\n }\r\n else {\r\n $scope.isShowPopulations = false;\r\n }\r\n\r\n var populationCount = $scope.selectedDeviceCopy.DeviceModelTblPopulations.length;\r\n for (var i = 0; i < populationCount; i++) {\r\n $scope.isDirectShip[i] = $scope.FindPopulationDeliveryOption(i, 1);\r\n $scope.isHandDeliver[i] = $scope.FindPopulationDeliveryOption(i, 2);\r\n $scope.isDefaultDevice[i] = $scope.IsPopulationDefaultDevice(i);\r\n }\r\n }\r\n\r\n $scope.AttemptSelect = function (device) {\r\n if (($scope.form.$dirty || $scope.popform.$dirty)) {\r\n OpenNavigationConfirmation().then(function (result) {\r\n if (result) {\r\n $scope.SelectDevice(device);\r\n } else {\r\n return false;\r\n }\r\n });\r\n } else {\r\n $scope.SelectDevice(device);\r\n }\r\n\r\n }\r\n //Select a device\r\n $scope.SelectDevice = function (device) {\r\n\r\n $scope.EnableDirectShip = false;\r\n $scope.EnableHandDeliver = false;\r\n $scope.selectedDevice = device;\r\n $scope.DeviceTypeId = device.DeviceTypeId.toString();\r\n //$scope.selectedDeviceCopy = Object.assign({}, device);\r\n $scope.selectedDeviceCopy = lodash.cloneDeep($scope.selectedDevice);\r\n $scope.selectedPopulation = null;\r\n $scope.form.$setPristine();\r\n $scope.InitPopulations();\r\n $scope.selectedDeviceCopy.DeviceModelDeliveryOptions.map(function (d) {\r\n if (d.DeliveryOptionId == 1) {\r\n $scope.EnableDirectShip = true;\r\n }\r\n if (d.DeliveryOptionId == 2) {\r\n $scope.EnableHandDeliver = true;\r\n }\r\n });\r\n if (!$scope.EnableDirectShip) {\r\n //Clear the checkboxes on populations\r\n for (var i = 0; i < $scope.isDirectShip.length; i++) {\r\n $scope.isDirectShip[i] = false;\r\n }\r\n }\r\n if (!$scope.EnableHandDeliver) {\r\n //Clear the checkboxes on populations\r\n for (var c = 0; c < $scope.isHandDeliver.length; c++) {\r\n $scope.isHandDeliver[c] = false;\r\n }\r\n }\r\n\r\n }\r\n\r\n //Load device populations into multi select\r\n $scope.PopulateDevicePopulations = function (device) {\r\n $scope.DevicePopulations.list = device.DeviceModelTblPopulations;\r\n $scope.isDirectShip = [];\r\n $scope.isHandDeliver = [];\r\n $scope.isDefaultDevice = [];\r\n }\r\n\r\n //Add population to multi select\r\n $scope.OnAddPopulation = function (item) {\r\n var population = {\r\n DeviceModelTblPopulationId: 0,\r\n DeviceModelId: $scope.selectedDeviceCopy.DeviceModelId,\r\n PopulationId: item.PopulationId,\r\n IsDefaultDevice: false,\r\n CreatedDateTime_UTC: moment(new Date()).format(\"YYYY-MM-DD\"),\r\n CreatedBy_Id: 0,\r\n DeletedDateTime_UTC: null,\r\n DeletedBy_Id: null,\r\n DeviceModelPopulationDeliveryOptions: [],\r\n PopulationName: item.PopulationName\r\n };\r\n $scope.selectedDeviceCopy.DeviceModelTblPopulations.push(population);\r\n }\r\n\r\n //Remove population from multi select\r\n $scope.OnRemovePopulation = function (item) {\r\n var id = item.PopulationId;\r\n var index = $scope.selectedDeviceCopy.DeviceModelTblPopulations.findIndex(function (population) {\r\n return population.PopulationId === id;\r\n })\r\n $scope.selectedDeviceCopy.DeviceModelTblPopulations.splice(index, 1);\r\n }\r\n\r\n $scope.OpenAddDeviceModal = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/go_devices/go_devices.modal.html',\r\n controller: 'GoDevicesModalController as vm',\r\n keyboard: false,\r\n size: 'md',\r\n resolve: {\r\n GoDeviceModels: function () {\r\n\r\n var currentDeviceModels = $scope.devices.map(function(d) {\r\n return d.DeviceModelId;\r\n });\r\n\r\n return DeviceModels.filter(function(deviceModel) {\r\n return currentDeviceModels.indexOf(deviceModel.Id) === -1;\r\n });\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (result) {\r\n if (result.length > 1) {\r\n var device = result[0];\r\n var isDeletedExists = result[1];\r\n if (isDeletedExists) {\r\n GoDevicesService.UpdateDeletedDevice(device).then(\r\n function () {\r\n $scope.GetDevices(device.DeviceModelId);\r\n },\r\n function () { }\r\n );\r\n } else {\r\n GoDevicesService.AddDevice(device).then(\r\n function (data) {\r\n $scope.GetDevices(data.DeviceModelId);\r\n },\r\n function () { }\r\n );\r\n }\r\n }\r\n }).catch(function() {\r\n console.log('cancel');\r\n });\r\n }\r\n\r\n //Find population level delivery option(s)\r\n $scope.FindPopulationDeliveryOption = function (populationIndex, deliveryOptionId) {\r\n return $scope.selectedDeviceCopy.DeviceModelTblPopulations[populationIndex].DeviceModelPopulationDeliveryOptions.some(function (o) {\r\n return o.DeliveryOptionId == deliveryOptionId;\r\n });\r\n }\r\n\r\n $scope.IsPopulationDefaultDevice = function (populationIndex) {\r\n return $scope.selectedDeviceCopy.DeviceModelTblPopulations[populationIndex].IsDefaultDevice;\r\n }\r\n\r\n function OpenNavigationConfirmation() {\r\n var msg = \"Are you sure you want to leave without saving changes to this device '\" + $scope.selectedDevice.DeviceName + \"'?\";\r\n return vhSweetAlert.verify('Are you sure?', msg, 'Yes');\r\n }\r\n\r\n $scope.$on('$locationChangeStart', function (event, next, current) {\r\n if (($scope.form.$dirty || $scope.popform.$dirty) && !$scope.allowNavigation) {\r\n event.preventDefault();\r\n OpenNavigationConfirmation().then(function (result) {\r\n if (result) {\r\n $scope.allowNavigation = true;\r\n $location.path(next.substring($location.absUrl().length - $location.url().length));\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n }\r\n });\r\n $transitions.onStart({from: 'system.go_devices'}, (trans) => {\r\n if ($scope.form && ($scope.form.$dirty || $scope.popform.$dirty) && !$scope.allowNavigation) {\r\n \r\n OpenNavigationConfirmation().then(function (result) {\r\n if (result) {\r\n $scope.allowNavigation = true;\r\n trans.router.stateService.transitionTo(trans.$to());\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n return false;\r\n }\r\n });\r\n\r\n function swapDevice(device) {\r\n var index = $scope.devices.indexOf($scope.selectedDevice);\r\n $scope.devices[index] = device;\r\n }\r\n\r\n function Init() {\r\n $scope.GetDevices();\r\n $scope.LoadPopulations();\r\n }\r\n Init();\r\n\r\n};\r\n\r\nangular.module(\"system.go_devices\").controller(\"GoDevicesController\", GoDevicesController)","function GoDevicesModalController($scope, $uibModalInstance, GoDevicesService, GoDeviceModels, lodash){\r\n $scope.device = {\r\n DeviceModelId:null,\r\n BluetoothProfileId:null,\r\n DeviceName:null,\r\n IsEnabled:false,\r\n DeviceModelDeliveryOptions: [],\r\n DeviceTypeId:null,\r\n ShowForRule: false\r\n };\r\n\r\n $scope.EnableDirectShip=false;\r\n $scope.EnableHandDeliver=false;\r\n $scope.ModelIdInvalid = false;\r\n $scope.ModelIdDeleted = false;\r\n\r\n $scope.deviceModels = GoDeviceModels;\r\n\r\n // .filter(function(deviceModel) {\r\n // return GoDeviceModels.indexOf(deviceModel.Id) === -1;\r\n // });\r\n $scope.deviceModels.push({ Id: -1, Device_Name: 'Other'});\r\n \r\n $scope.DeviceTypes = [];\r\n GoDeviceModels.forEach(function(dm) {\r\n if(lodash.find($scope.DeviceTypes, { id: dm.DeviceTypeId}) === undefined) {\r\n $scope.DeviceTypes.push({ id: dm.DeviceTypeId, name: dm.DeviceTypeValue });\r\n }\r\n });\r\n\r\n //for reference\r\n var deviceDeliveryModelTemplate = {\r\n DeviceModelId: null,\r\n DeliveryOptionId: null,\r\n }\r\n\r\n $scope.ok = function() {\r\n \r\n if($scope.deviceModelForm.$valid !== true) {\r\n return;\r\n }\r\n \r\n $scope.CheckModelId().then(function(data){\r\n if(data){\r\n if (data.DeletedDateTime_UTC) {\r\n $scope.ModelIdDeleted = true;\r\n } else {\r\n $scope.ModelIdInvalid = true;\r\n }\r\n }\r\n\r\n if(!$scope.ModelIdInvalid){\r\n if($scope.EnableDirectShip){\r\n $scope.device.DeviceModelDeliveryOptions.push(\r\n {\r\n DeviceModelId: $scope.device.DeviceModelId,\r\n BluetoothProfileId: $scope.device.BluetoothProfileId,\r\n DeliveryOptionId: 1,\r\n IsEnabled:true\r\n }\r\n )\r\n }\r\n if($scope.EnableHandDeliver){\r\n $scope.device.DeviceModelDeliveryOptions.push(\r\n {\r\n DeviceModelId: $scope.device.DeviceModelId,\r\n BluetoothProfileId: $scope.device.BluetoothProfileId,\r\n DeliveryOptionId: 2,\r\n IsEnabled:true\r\n }\r\n )\r\n }\r\n $uibModalInstance.close([$scope.device, $scope.ModelIdDeleted]);\r\n }\r\n });\r\n \r\n }\r\n\r\n $scope.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n $scope.CheckModelId = function(){\r\n return GoDevicesService.Exists($scope.device.DeviceModelId)\r\n }\r\n\r\n $scope.selectDeviceModel = function(deviceModel) {\r\n if(deviceModel.Id > 0) {\r\n $scope.device.DeviceModelId = deviceModel.Id;\r\n $scope.device.DeviceName = deviceModel.Device_Name;\r\n $scope.device.DeviceTypeId = deviceModel.DeviceTypeId;\r\n $scope.device.BluetoothProfileId = deviceModel.BluetoothProfileId;\r\n } else {\r\n $scope.device.DeviceModelId = undefined;\r\n $scope.device.DeviceName = undefined;\r\n $scope.device.DeviceTypeId = undefined;\r\n $scope.device.BluetoothProfileId = undefined;\r\n }\r\n };\r\n\r\n}\r\n\r\nangular.module('system.go_devices').controller('GoDevicesModalController', GoDevicesModalController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/go_devices/go_devices.modal.html',\n '
          Add New Device
          ');\n}]);\n}(window, document, window.angular));","function GoDevicesModels(){\r\n var models = {\r\n DeviceModel : function(data){\r\n this.DeviceModelId = null;\r\n this.BluetoothProfileId = null;\r\n this.DeviceTypeId = null;\r\n this.DeviceName = null;\r\n this.IsEnabled = true;\r\n this.SortOrder = null;\r\n this.CreatedBy_Id = null;\r\n this.AvailableDeliveryOptions = [];\r\n\r\n if(data){\r\n for(var k in this) this[k]=data[k];\r\n }\r\n },\r\n\r\n PopulationModel : function(data){\r\n this.PopulationId;\r\n this.DeviceModelId;\r\n this.AvailableDeliveryOptions = [];\r\n\r\n if(data){\r\n for(var k in this) this[k]=data[k];\r\n }\r\n },\r\n\r\n DeviceModelDeliveryOption : function(data){\r\n this.DeliveryModelDeliveryOptionId;\r\n this.DeviceModelId;\r\n this.DeliveryOptionId;\r\n\r\n if(data){\r\n for(var k in this) this[k]=data[k];\r\n }\r\n },\r\n\r\n DeviceModelPopulationDeliveryOption : function(){\r\n this.DeliveryModelPopulationDeliveryOptionId;\r\n this.DeviceModelTplPopulationId;\r\n this.DeliveryOptionId;\r\n \r\n if(data){\r\n for(var k in this) this[k]=data[k];\r\n }\r\n }\r\n }\r\n return models;\r\n}\r\n\r\nangular.module(\"system.go_devices\").factory(\"GoDevicesModels\", GoDevicesModels);\r\n","function GoDevicesService($http, PendingService) {\r\n \r\n var GetAll = function () {\r\n return $http.get('/api/GoDevices').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var GetAllEnabled = function () {\r\n return PendingService.promise('/GoDevices/Enabled', ()=> $http.get('/api/GoDevices/Enabled'))\r\n .then(response => response.data);\r\n };\r\n \r\n var GetAllExclude = function () {\r\n return $http.get('/api/GoDevices/Exclude').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var GetByPopulation = function (popId) {\r\n return $http.get('/api/GoDevices/ByPopulation/'+popId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var Get = function(deviceId){\r\n return $http.get('/api/GoDevices/'+ deviceId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var UpdateDevice = function(deviceModel){\r\n return $http.put('/api/GoDevices', deviceModel).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var UpdateDeletedDevice = function(deviceModel){\r\n return $http.put('/api/GoDevices/Deleted', deviceModel).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var AddDevice = function(deviceModel){\r\n return $http.post('/api/GoDevices',deviceModel).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var UpdateDevicePopulations = function(deviceId, deviceModel){\r\n return $http.put('/api/GoDevices/'+ deviceId +'/Populations', deviceModel).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var GetDevicePopulationSettings = function(deviceId){\r\n return $http.get('/api/GoDevices/'+ deviceId +'/Populations/Settings').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var ToggleDevice = function(deviceId){\r\n return $http.put('/api/GoDevices/'+ deviceId +'/Toggle').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n var Exists = function(deviceId){\r\n return $http.get('/api/GoDevices/'+ deviceId+'/Exists').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n var GetPatientDeviceCount = function(deviceModelId){\r\n return $http.get('/api/GoDevices/'+ deviceModelId + '/PatientDeviceCount').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n var DeleteDevice = function(deviceModelId){\r\n return $http.delete('/api/GoDevices/'+ deviceModelId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n };\r\n //Doing validations in service as opposed to component\r\n var ValidateDevice = function(device){\r\n //TODO: add validations\r\n };\r\n\r\n var ValidatePopulationSetting = function(){\r\n \r\n };\r\n\r\n var getDeviceModels = function() {\r\n return $http.get('/api/GoDevices/GetDeviceModels').then(function(res) {\r\n return res.data;\r\n });\r\n }\r\n\r\n return {\r\n GetAll:GetAll,\r\n GetAllEnabled:GetAllEnabled,\r\n GetAllExclude:GetAllExclude,\r\n GetByPopulation:GetByPopulation,\r\n Get:Get,\r\n UpdateDevice:UpdateDevice,\r\n UpdateDeletedDevice:UpdateDeletedDevice,\r\n AddDevice:AddDevice,\r\n UpdateDevicePopulations:UpdateDevicePopulations,\r\n GetDevicePopulationSettings:GetDevicePopulationSettings,\r\n ToggleDevice:ToggleDevice,\r\n Exists:Exists,\r\n GetPatientDeviceCount:GetPatientDeviceCount,\r\n DeleteDevice:DeleteDevice,\r\n ValidateDevice:ValidateDevice,\r\n ValidatePopulationSetting:ValidatePopulationSetting,\r\n getDeviceModels: getDeviceModels\r\n };\r\n}\r\nangular.module(\"system.go_devices\").factory(\"GoDevicesService\", GoDevicesService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/go_devices/go_devices.tpl.html',\n '

          +Go Devices

          Enabled Devices
          {{enabledDevices.length}}

          No enabled devices.

          Disabled Devices
          {{disabledDevices.length}}

          No disabled devices.

          Device Settings: {{selectedDevice.DeviceName}}

          {{$item.PopulationName}}{{population.PopulationName}}
          0\">
          Program NameAvailable Delivery OptionsSelect Device by Default
          {{population.PopulationName}}
          ');\n}]);\n}(window, document, window.angular));","function LanguageModalController($scope, lodash, Language, $uibModalInstance, LanguagesService, CanEdit) {\r\n var vm = this;\r\n vm.language = Language;\r\n //vm.toggle = toggle;\r\n vm.canEdit = CanEdit;\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss();\r\n }\r\n\r\n function ok() {\r\n if($scope.languageForm.$valid && vm.canEdit) {\r\n if(vm.language.LanguageId > 0) {\r\n LanguagesService.update(vm.language).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n } else {\r\n LanguagesService.create(vm.language).then(function(data){\r\n $uibModalInstance.close(data);\r\n });\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module('system.serviceLevels').controller('LanguageModalController', LanguageModalController)","function LanguagesController(Languages, LanguagesService, lodash, $uibModal, PermissionService, $timeout) {\r\n var vm = this;\r\n\r\n vm.canEdit = PermissionService.userHasPermission(['LanguageSettingsWrite']);\r\n vm.languages = Languages;\r\n\r\n vm.openEdit = openEdit;\r\n vm.delete = deleteLanguage;\r\n\r\n\r\n refreshLanguages();\r\n \r\n\r\n function refreshLanguages() {\r\n vm.languages = lodash.sortBy(vm.languages, 'SortOrder');\r\n\r\n vm.dragListeners = {\r\n contain: '#languages',\r\n orderChanged: orderChanged,\r\n accept: accept\r\n };\r\n }\r\n\r\n function deleteLanguage(event, language) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n language.IsDeleted = 1;\r\n language.IsEnabled = 0;\r\n language.IsDefault = 0;\r\n LanguagesService.update(language).then(function (response) { getLanguages(); });\r\n }\r\n\r\n function openEdit(event, language) {\r\n event.preventDefault();\r\n var original = angular.copy(language);\r\n if (!original.LanguageId) {\r\n original.SortOrder = vm.languages[vm.languages.length - 1].SortOrder + 1;\r\n }\r\n\r\n $uibModal.open({\r\n templateUrl: 'modules/system/languages/languages.modal.html',\r\n controller: 'LanguageModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n Language: function () {\r\n return original;\r\n },\r\n CanEdit: function () {\r\n return vm.canEdit;\r\n }\r\n }\r\n }).result.then(function (data) {\r\n getLanguages();\r\n }, function () {\r\n // cancelled\r\n });\r\n }\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n \r\n list.map(function(listItem, index){\r\n listItem.SortOrder = index;\r\n return listItem;\r\n });\r\n\r\n updateLanguages(list);\r\n}\r\n\r\nfunction updateLanguages(list) {\r\n list.forEach(function(l) {\r\n LanguagesService.update(l);\r\n });\r\n}\r\n\r\n function getLanguages() {\r\n LanguagesService.get(false, false).then(function (data) {\r\n vm.languages = data;\r\n refreshLanguages();\r\n });\r\n }\r\n\r\n function accept(sourceItemHandleScope, destSortableScope, destItemScope) {\r\n return vm.canEdit && sourceItemHandleScope.sortableScope.modelValue[0].SiteId === destSortableScope.modelValue[0].SiteId;\r\n }\r\n}\r\n\r\nangular.module('system.languages').controller('LanguagesController', LanguagesController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/languages/languages.modal.html',\n '

          Languages

          Required
          ');\n}]);\n}(window, document, window.angular));","function LanguagesService($http) {\r\n\r\n\r\n function get(contentEnabledOnly, isEnabledOnly) {\r\n return $http({\r\n method: 'GET',\r\n url: \"/api/PatientLanguage?contentEnabledOnly=\" + contentEnabledOnly + \"&isEnabledOnly=\" + isEnabledOnly,\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function update(language) {\r\n return $http({\r\n method: 'PUT',\r\n url: '/api/PatientLanguage/',\r\n data: language\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function create(language) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/PatientLanguage',\r\n data: language\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n get: get,\r\n update: update,\r\n create: create\r\n };\r\n}\r\n\r\nangular.module('system.languages').factory('LanguagesService', LanguagesService)\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/languages/languages.tpl.html',\n '

          Languages

          0\">

          Language

          Default

          Enabled

          ISO6392 Code

          Locale Code

          Content Enabled

          {{item.Name}}
          {{item.ISO_6392_Code}}
          {{item.Code}}
          ');\n}]);\n}(window, document, window.angular));","function AddNotificationModalController($uibModalInstance, notification, lodash, $sce) {\r\n var vm = this;\r\n vm.notification = angular.copy(notification);\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.next = next;\r\n vm.back = back;\r\n vm.updateHtml = updateHtml;\r\n\r\n vm.isValid = isValid;\r\n vm.IsNew = notification.NotificationId == 0;\r\n vm.wizardStep = 1;\r\n vm.showHtml = false;\r\n vm.showError = false;\r\n vm.showDateError = false;\r\n vm.isUpgradeNotification = isUpgradeNotification;\r\n vm.validError = '';\r\n vm.validDateError = '';\r\n\r\n vm.templates = [\r\n { Id: 1, Name: 'Pre Upgrade', Icon: 'fa-bell', \r\n Description : 'The Care Team Portal will soon be upgraded', \r\n Priority : 100,\r\n Html: '
          Your Care Team Portal will be upgraded on $DATE$.
          to learn what new features are coming.
          ',\r\n Data : {\r\n Date : 'April 25th @ 8:00 CST',\r\n Url : 'https://help.dev.vivifyhealth.com/Vivify/v58/Content/A_Introduction%20Topics/What%27s%20New.htm',\r\n Name: 'Add New Upgrade Notification'\r\n }\r\n },\r\n { Id: 2, Name: 'Post Upgrade', Icon: 'fa-check-square-o', \r\n Description : 'The Care Team Portal has been upgraded', \r\n Priority : 200,\r\n Html: '
          Your Care Team Portal has been upgraded to the latest version.
          to view the release notes.
          ',\r\n Data : {\r\n Url : 'https://help.dev.vivifyhealth.com/Vivify/v58/Content/A_Introduction%20Topics/What%27s%20New.htm',\r\n Name: 'Add New Post Upgrade Notification'\r\n }\r\n },\r\n { Id: 3, Name: 'Survey', Icon: 'fa-question-circle-o', \r\n Description : 'Users feedback is requested', \r\n Priority : 300,\r\n Html: '
          $BODY$
          ',\r\n Data : {\r\n Title : '',\r\n Question : '',\r\n Buttons : [ { Id : 1, Text : '' }, { Id : 2, Text : '' }, { Id : 3, Text : '' }, { Id : 4, Text : '' }, { Id : 5, Text : '' }],\r\n Name: 'Add New Survey-Type Notification'\r\n }\r\n },\r\n { Id: 4, Name: 'Custom', Icon: 'fa-wrench', \r\n Description : 'Informational text to provide to all users', \r\n Priority : 400,\r\n Html: '
          Your software will be upgraded on April 25th @ 8:00 CST.
          to learn what new features are coming.
          ',\r\n Data: {\r\n Name: 'Add New Custom Notification'\r\n }\r\n }\r\n ]\r\n\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n if ( !vm.IsNew ){\r\n vm.SelectedTypeId = vm.notification.LoginNotificationTypeId;\r\n vm.wizardStep = 2;\r\n vm.Template = lodash.find(vm.templates, function(o) { return o.Id == vm.notification.LoginNotificationTypeId});\r\n vm.Template.RenderHtml = vm.notification.MessageHtml;\r\n // need to convert utc start/expire strings back to local date.\r\n vm.Template.StartDate = getUtcPlusLocalOffsetDate(vm.notification.StartDate);\r\n vm.Template.ExpireDate = getUtcPlusLocalOffsetDate(vm.notification.ExpireDate); \r\n vm.Template.Priority = vm.notification.Priority;\r\n vm.Template.Html = vm.notification.TemplateHtml;\r\n vm.Template.Data = JSON.parse(vm.notification.TemplateData);\r\n updateHtml();\r\n }\r\n }\r\n\r\n function getUtcPlusLocalOffsetDate(dateString){\r\n var utc = new Date(dateString);\r\n var utcPlusOffset = new Date( utc.setMinutes( utc.getTimezoneOffset()));\r\n return utcPlusOffset;\r\n }\r\n\r\n function updateHtml(){\r\n if ( vm.SelectedTypeId == 1 || vm.SelectedTypeId == 2){\r\n vm.Template.RenderHtml = vm.Template.Html.replace(\"$DATE$\", vm.Template.Data.Date);\r\n vm.Template.RenderHtml = vm.Template.RenderHtml.replace(\"$URL$\", vm.Template.Data.Url);\r\n }\r\n else if ( vm.SelectedTypeId == 3){\r\n var body = '';\r\n if (vm.Template.Data.Title.length > 0){\r\n body += vm.Template.Data.Title + '
          ' \r\n }\r\n body += vm.Template.Data.Question + '
          ';\r\n\r\n for (var i = 0; i < vm.Template.Data.Buttons.length; i++){\r\n if (vm.Template.Data.Buttons[i].Text.length > 0){\r\n body += ' ';\r\n }\r\n } \r\n vm.Template.RenderHtml = vm.Template.Html.replace(\"$BODY$\", body);\r\n } else if (vm.SelectedTypeId == 4) {\r\n var body = '';\r\n \r\n body = vm.Template.Html;\r\n vm.Template.RenderHtml = body;\r\n }\r\n vm.Template.TrustedRenderHtml = $sce.trustAsHtml(vm.Template.RenderHtml);\r\n }\r\n\r\n function onChange(){\r\n vm.validError = '';\r\n vm.validDateError = '';\r\n vm.enableNextBtn = false;\r\n switch(vm.wizardStep){\r\n case 1:\r\n {\r\n if ( vm.SelectedTypeId != 0 ){\r\n vm.enableNextBtn = true;\r\n }\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.enableNextBtn = true;\r\n break;\r\n }\r\n case 3:\r\n {\r\n if (vm.code.length >= 6){\r\n vm.enableNextBtn = true;\r\n }\r\n break;\r\n }\r\n }\r\n updateHtml();\r\n // SetFocus(); \r\n }\r\n\r\n function isUpgradeNotification(id) {\r\n if(id == 1 && (!vm.Template.Data.Url || !vm.Template.Data.Date)){\r\n return true;\r\n } else if (id == 2 && !vm.Template.Data.Url) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n function next(){\r\n switch(vm.wizardStep){\r\n case 1:\r\n {\r\n vm.wizardStep = 2;\r\n vm.Template = lodash.find(vm.templates, function(o) { return o.Id == vm.SelectedTypeId});\r\n break;\r\n }\r\n case 2:\r\n {\r\n vm.wizardStep = 3;\r\n break;\r\n }\r\n case 3:\r\n {\r\n break;\r\n }\r\n } \r\n onChange();\r\n }\r\n\r\n function back(){\r\n vm.wizardStep--;\r\n if ( vm.SelectedTypeId != 2 && vm.wizardStep == 2){\r\n // SelectedTypeId 2 has an extra step, \r\n // so skip step 2 dor SelectedTypeId 3 and 4 so\r\n // Enter Code screen is step 3 for all three SelectedTypeId type\r\n vm.wizardStep = 1;\r\n } \r\n onChange();\r\n } \r\n\r\n\r\n function isValid(){\r\n let valid = false;\r\n // and ExpireDate > StartDate\r\n if ( vm.Template.StartDate != undefined && vm.Template.ExpireDate != undefined ){\r\n valid = true;\r\n if ( (vm.Template.Id == 1 || vm.Template.Id == 2) && vm.Template.Data.Url.length == 0 ){\r\n valid = false;\r\n }\r\n }\r\n return valid;\r\n }\r\n\r\n function ok() {\r\n if ( isValid() ) {\r\n var loginNotification = {};\r\n loginNotification.LoginNotificationId = vm.notification.LoginNotificationId > 0 ? vm.notification.LoginNotificationId : 0;\r\n loginNotification.MessageHtml = vm.Template.RenderHtml;\r\n loginNotification.StartDate = vm.Template.StartDate;\r\n loginNotification.ExpireDate = vm.Template.ExpireDate;\r\n loginNotification.Priority = vm.Template.Priority;\r\n loginNotification.TemplateHtml = vm.Template.Html;\r\n loginNotification.TemplateData = JSON.stringify(vm.Template.Data);\r\n loginNotification.LoginNotificationTypeId = vm.Template.Id;\r\n\r\n $uibModalInstance.close(loginNotification);\r\n } else if(vm.SelectedTypeId == 3 && (!vm.Template.Data.Buttons[0].Text || !vm.Template.Data.Title || !vm.Template.Data.Question)) {\r\n vm.showError = true;\r\n vm.validError = 'Title, Question, and Button 1 are required';\r\n if(vm.Template.StartDate == undefined && vm.Template.ExpireDate == undefined) {\r\n vm.showDateError = true;\r\n vm.validDateError = 'Start date and expire date are required';\r\n }\r\n } else if(vm.SelectedTypeId == 4 && vm.Template.Html == undefined) {\r\n vm.showError = true;\r\n vm.validError = 'Text field is required';\r\n } else {\r\n vm.showDateError = true;\r\n vm.validDateError = 'Start date and expire date are required';\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('system.loginNotification').controller('AddNotificationModalController', AddNotificationModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/loginNotification/addNotification.modal.html',\n '

          Add New Portal Notification for Care Team Portal Users

          0\" class=\"modal-title\">Edit Caregiver Notification

          1 && vm.IsNew\" class=\"modal-title\">{{vm.Template.Data.Name}}

          Choose a Notification Template

          Add a notification pop-up that is presented to each Care Team Portal user when they log into the portal.

          {{item.Name}}

          {{item.Description}}

          Display from: {{vm.Template.StartDate | date : \\'EEEE, MMM d, yyyy\\'}} till {{vm.Template.ExpireDate | date : \\'EEEE, MMM d, yyyy\\'}} with priority {{vm.Template.Priority}}
          {{vm.Template.RenderHtml}}
          {{vm.validError}}
          {{vm.validDateError}}
          ');\n}]);\n}(window, document, window.angular));","class ImportLoginNotificationModalController {\r\n\r\n constructor(LoginNotificationService, $uibModalInstance, $scope, $timeout, $state, fileUploader, modalName)\r\n {\r\n this.LoginNotificationService = LoginNotificationService;\r\n this.$uibModalInstance = $uibModalInstance;\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$state = $state;\r\n this.fileUploader = fileUploader;\r\n this.modalName = modalName;\r\n\r\n this.fileNameValidationError = {text: 'File name has illegal characters.', type: 'danger'};\r\n\r\n this.notifications = [];\r\n this.valid = false;\r\n this.validating = false;\r\n this.loading = false;\r\n this.uploading = false;\r\n \r\n this.$uibModalInstance.opened.then( _ => {\r\n var changeHandler = (evt) => {\r\n \r\n var files = evt.target.files; // FileList object\r\n \r\n for (var i = 0, f; (f = files[i]); i++) {\r\n \r\n var reader = new FileReader();\r\n \r\n // Closure to capture the file information.\r\n reader.onload = ((theFile) => {\r\n return (e) => {\r\n\r\n var removeDeletedInfo = (obj) => {\r\n \r\n\r\n if(obj.deletedBy_Id)\r\n { obj.deletedBy_Id = null;\r\n console.log(obj);\r\n }\r\n\r\n if(obj.deletedDateTime_UTC)\r\n obj.deletedDateTime_UTC = null;\r\n \r\n\r\n for(var prop in obj){\r\n if(obj[prop] && typeof obj[prop] == 'object')\r\n obj[prop] = removeDeletedInfo(obj[prop]);\r\n else if(Array.isArray(obj[prop]))\r\n obj[prop].forEach((subObj, idx) => {\r\n obj[prop][idx] = removeDeletedInfo(subObj);\r\n } )\r\n }\r\n\r\n\r\n return obj;\r\n };\r\n\r\n var data = this._toCamel(removeDeletedInfo(JSON.parse(e.target.result)));\r\n\r\n var notifications = this.notifications = [data];\r\n\r\n this.count = notifications.length;\r\n \r\n this.caption = notifications.length > 1 ? `Importing (${this.count}) notifications.` :\r\n notifications.length == 1 ? `Importing ${notifications[0].name || notifications[0].Name}.`\r\n : null;\r\n\r\n this.validate();\r\n \r\n }})(f);\r\n \r\n // Read in the image file as a data URL.\r\n reader.readAsText(f);\r\n }\r\n \r\n };\r\n\r\n window.setTimeout( _ => {\r\n var element = document.getElementById('login-notification-file-input');\r\n element.removeEventListener('change', changeHandler);\r\n element.addEventListener('change', changeHandler, false);\r\n }, 500);\r\n });\r\n }\r\n\r\n _forceUpdate(){\r\n window.setTimeout(()=> {\r\n this.$scope.$parent.$apply();\r\n }, 100);\r\n }\r\n\r\n _toCamel(o){\r\n var self = this;\r\n var newO, origKey, newKey, value\r\n if (o instanceof Array) {\r\n return o.map(function(value) {\r\n if (typeof value === \"object\") {\r\n value = self._toCamel(value)\r\n }\r\n return value\r\n })\r\n } else {\r\n newO = {}\r\n for (origKey in o) {\r\n if (o.hasOwnProperty(origKey)) {\r\n newKey = (origKey.charAt(0).toLowerCase() + origKey.slice(1) || origKey).toString()\r\n value = o[origKey]\r\n if (value instanceof Array || (value !== null && value.constructor === Object)) {\r\n value = self._toCamel(value)\r\n }\r\n newO[newKey] = value\r\n }\r\n }\r\n }\r\n return newO\r\n }\r\n\r\n _reset () {\r\n this.notification = {};\r\n this.valid = false;\r\n this.validating = false;\r\n this.loading = false;\r\n this.uploading = false;\r\n }\r\n\r\n cancel () {\r\n this._reset();\r\n this.$uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n enableCancelButton () {\r\n return !this.uploading || true;\r\n }\r\n\r\n ok () {\r\n // upload with feedback\r\n this.uploading = true;\r\n\r\n this.upload().then(result => {\r\n this._reset();\r\n this.$uibModalInstance.close(result);\r\n }); \r\n }\r\n\r\n enableOkButton () {\r\n return !this.uploading || true;\r\n }\r\n\r\n\r\n upload () {\r\n return new Promise((resolve, reject) => {\r\n try { \r\n resolve(this.fileUploader.uploadAll()); \r\n } catch (error) {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n validate () {\r\n this.valid = false;\r\n this.validating = true;\r\n \r\n this.valid = this.notifications; // is not null or undefined... validate JSON object\r\n\r\n this._forceUpdate();\r\n }\r\n}\r\n\r\nfunction ImportLoginNotificationModalControllerFactory(LoginNotificationService, $uibModalInstance, $scope, $timeout, $state, fileUploader, modalName) {\r\n return new ImportLoginNotificationModalController(...arguments);\r\n}\r\n\r\nangular\r\n .module(\"system.loginNotification\")\r\n .controller(\"ImportLoginNotificationModalController\", ImportLoginNotificationModalControllerFactory);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/loginNotification/importloginnotification.modal.html',\n '

          {{vm.modalName}}

          ');\n}]);\n}(window, document, window.angular));","function LoginNotificationController(LoginNotificationService, lodash, $uibModal, PermissionService, vhSweetAlert) {\r\n var vm = this;\r\n\r\n // data\r\n vm.userCanEdit = PermissionService.userHasPermission([\"LoginNotificationWrite\"]);\r\n vm.selectedItem = null;\r\n vm.activeNotifications = [];\r\n vm.expiredNotifications = [];\r\n vm.deletedNotifications = [];\r\n\r\n //functions\r\n vm.addItem = addItem;\r\n vm.selectItem = selectItem;\r\n vm.deleteItem = deleteItem;\r\n vm.editItem = editItem;\r\n vm.importItem = importItem;\r\n\r\n init();\r\n\r\n function init(){\r\n refresh();\r\n } \r\n\r\n function refresh(){\r\n vm.activeNotifications = [];\r\n vm.expiredNotifications = [];\r\n vm.deletedNotifications = []; \r\n LoginNotificationService.getAll().then(function(data){\r\n lodash.forEach(data, processData);\r\n }); \r\n }\r\n\r\n function processData(notification){\r\n switch(notification.LoginNotificationTypeId){\r\n case 1:{\r\n notification.Icon = 'fa-bell';\r\n notification.Name = 'Pre Upgrade';\r\n break;\r\n }\r\n case 2:{\r\n notification.Icon = 'fa-check-square-o';\r\n notification.Name = 'Post Upgrade';\r\n break;\r\n }\r\n case 3:{\r\n notification.Icon = 'fa-question-circle-o';\r\n notification.Name = 'Survey';\r\n break;\r\n }\r\n case 4:{\r\n notification.Icon = 'fa-wrench';\r\n notification.Name = 'Custom';\r\n break;\r\n } \r\n }\r\n\r\n if ( notification.DeletedDateTime_UTC != null ){\r\n vm.deletedNotifications.push(notification)\r\n }\r\n else if ( getUtcPlusLocalOffsetDate(notification.ExpireDate).setHours(23,59,59,999) < Date.now() ){\r\n vm.expiredNotifications.push(notification)\r\n }\r\n else{\r\n vm.activeNotifications.push(notification)\r\n }\r\n\r\n if(notification.LoginNotificationId == 41) {\r\n var date = console.log(getUtcPlusLocalOffsetDate(notification.ExpireDate).setHours(23,59,59,999));\r\n }\r\n }\r\n\r\n function getUtcPlusLocalOffsetDate(dateString){\r\n var utc = new Date(dateString);\r\n var utcPlusOffset = new Date( utc.setMinutes( utc.getTimezoneOffset()));\r\n return utcPlusOffset;\r\n }\r\n\r\n function selectItem(item){\r\n vm.selectedItem = item;\r\n vm.selectedItem.jsonText = JSON.stringify(vm.selectedItem);\r\n vm.selectedItem.Name = item.Name;\r\n vm.selectedItem.filename = getName(item.LoginNotificationTypeId);\r\n LoginNotificationService.getResponses(vm.selectedItem.LoginNotificationId).then(function(data){\r\n vm.selectedItem.Responses = data;\r\n vm.selectedItem.jsonResponses = JSON.stringify(vm.selectedItem.Responses);\r\n vm.selectedItem.csvResponses = JSON2CSV(vm.selectedItem.Responses);\r\n }); \r\n }\r\n\r\n \r\n function JSON2CSV(objArray) {\r\n var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;\r\n var str = '';\r\n var line = '';\r\n // build column headers\r\n for (var index in array[0]) {\r\n var value = index + \"\";\r\n line += '\"' + value.replace(/\"/g, '\"\"') + '\",';\r\n }\r\n line = line.slice(0, -1);\r\n str += line + '\\r\\n';\r\n \r\n // build rows\r\n for (var i = 0; i < array.length; i++) {\r\n var line = '';\r\n for (var index in array[i]) {\r\n // array contains a CreatedBy object of which we need display name and caregivertitle object\r\n if(typeof array[i][index] == 'object') {\r\n var obj, value;\r\n if(index === \"CaregiverTitle\") {\r\n obj = array[i][index];\r\n value = obj.Name + \"\";\r\n } else {\r\n obj = array[i][index];\r\n value = obj.DisplayName + \"\";\r\n }\r\n } else {\r\n value = array[i][index] + \"\";\r\n }\r\n line += '\"' + value.replace(/\"/g, '\"\"') + '\",'; \r\n }\r\n line = line.slice(0, -1);\r\n str += line + '\\r\\n';\r\n }\r\n return str;\r\n }\r\n\r\n function getName(id) {\r\n var name = '';\r\n switch (id) {\r\n case (id = 1):\r\n name = 'PreUpgrade';\r\n break;\r\n case (id = 2):\r\n name = 'PostUpgrade';\r\n break;\r\n case (id = 3):\r\n name = 'Survey';\r\n break;\r\n case (id = 4):\r\n name = 'Custom';\r\n break;\r\n default:\r\n break;\r\n }\r\n return name;\r\n }\r\n\r\n function addItem() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/loginNotification/addNotification.modal.html',\r\n controller: 'AddNotificationModalController as vm',\r\n animation: false,\r\n backdrop: 'static',\r\n keyboard: false,\r\n size: 'lg', \r\n resolve: {\r\n notification: function() {\r\n return {\r\n NotificationId: 0,\r\n StartDate: new Date(),\r\n ExpireDate: new Date()\r\n };\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (data) {\r\n if ( data.LoginNotificationId > 0 ){\r\n LoginNotificationService.update(data).then(function(data){\r\n refresh();\r\n }); \r\n }\r\n else{\r\n LoginNotificationService.create(data).then(function(data){\r\n //addIcon(data);\r\n //vm.notifications.push(data);\r\n refresh();\r\n }); \r\n }\r\n });\r\n }\r\n\r\n function editItem(item) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/loginNotification/addNotification.modal.html',\r\n controller: 'AddNotificationModalController as vm',\r\n animation: false,\r\n backdrop: 'static',\r\n keyboard: false,\r\n size: 'lg', \r\n resolve: {\r\n notification: function() {\r\n return item;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (data) {\r\n LoginNotificationService.update(data).then(function(data){\r\n refresh();\r\n }); \r\n });\r\n } \r\n \r\n function deleteItem(item){\r\n var text = 'Are you sure you want to delete this notification?';\r\n vhSweetAlert.verify('Are you sure?', text, 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n LoginNotificationService.delete(item.LoginNotificationId).then(function(data){\r\n refresh();\r\n });\r\n }\r\n }\r\n );\r\n }\r\n\r\n function importItem() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/loginNotification/importloginnotification.modal.html',\r\n controller: 'ImportLoginNotificationModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n currentList: function() {\r\n return vm.images;\r\n },\r\n fileUploader: function() {\r\n return LoginNotificationService.getFileUploader();\r\n },\r\n modalName: function() {\r\n return 'Import Notification';\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(result){\r\n vhSweetAlert.success(\"Notification uploaded successfully\").then(function(){\r\n refresh();\r\n })\r\n });\r\n } \r\n\r\n vm.sortByStartDateAndPriority = function (item) {\r\n var retVal = item.Priority;\r\n return retVal\r\n } \r\n}\r\n\r\nangular.module('system.loginNotification').controller('LoginNotificationController', LoginNotificationController);\r\n\r\n","function LoginNotificationService($http, FileUploader) {\r\n return {\r\n getAll: function () {\r\n return $http.get('/api/LoginNotification').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getForCurrentUser: function () {\r\n return $http.get('/api/LoginNotification/CurrentUser').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }, \r\n create: function(item) {\r\n return $http.post('/api/LoginNotification', item).then(function(data) {\r\n return data;\r\n });\r\n }, \r\n update: function(item) {\r\n return $http.put('/api/LoginNotification/' + item.LoginNotificationId, item).then(function(data) {\r\n return data;\r\n });\r\n }, \r\n delete: function (id) {\r\n return $http.delete('/api/LoginNotification/' + id).then(function(data) {\r\n return data;\r\n });;\r\n },\r\n getFileUploader: function() {\r\n var fileUploader = new FileUploader({\r\n url: '/api/LoginNotification/Import'\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function(item, options) {\r\n var i = item.name.indexOf('.json');\r\n return i !== -1;\r\n }\r\n });\r\n return fileUploader;\r\n },\r\n saveResponse: function(loginNotificationId, response){\r\n return $http.post('/api/LoginNotification/Response', { LoginNotificationId : loginNotificationId, Response : response }).then(function(data) {\r\n return data;\r\n });\r\n },\r\n getResponses: function(loginNotificationId){\r\n return $http.get('/api/LoginNotification/' + loginNotificationId + '/Responses').then(function(response) {\r\n return response.data;;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('system.loginNotification').factory('LoginNotificationService', LoginNotificationService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/loginNotification/loginNotification.tpl.html',\n '

          Login User Notification

          1. Viewing {{vm.activeNotifications.length}} Active Notifications
          Notifications
          Active{{vm.activeNotifications.length}}

           ({{notification.LoginNotificationId}}) {{notification.Name}} for {{notification.StartDate | date : \\'EEEE, MMM d, yyyy\\' : \\'+0000\\'}}

          No active notifications.
          Expired{{vm.expiredNotifications.length}}

           ({{notification.LoginNotificationId}}) {{notification.Name}} for {{notification.StartDate | date : \\'EEEE, MMM d, yyyy\\' : \\'+0000\\'}}

          No expired notifications.
          0\" class=\"ibox-content ibox-subheading ng-animate-disabled\">
          Deleted{{vm.deletedNotifications.length}}

           ({{notification.LoginNotificationId}}) {{notification.Name}} for {{notification.StartDate | date : \\'EEEE, MMM d, yyyy\\' : \\'+0000\\'}}

          Notification

          Display from: {{vm.selectedItem.StartDate | date : \\'EEEE, MMM d, yyyy\\' : \\'+0000\\'}} till {{vm.selectedItem.ExpireDate | date : \\'EEEE, MMM d, yyyy\\' : \\'+0000\\'}} with priority {{vm.selectedItem.Priority}}

          User Responses

           {{response.CreatedDateTime_UTC | date : \\'EEEE, MMM d, yyyy\\' }}
          {{response.Response}}
          {{response.CreatedBy.DisplayName}}

          No resposnes.
          ');\n}]);\n}(window, document, window.angular));","function LogoUpdateController($rootScope, $state, $uibModal, vhSweetAlert) {\r\n var vm = this;\r\n\r\n vm.addUpdateLogoModal = addUpdateLogoModal;\r\n\r\n loadController();\r\n function loadController() {\r\n }\r\n\r\n function addUpdateLogoModal(buttonType) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/logo/logo.modal.html',\r\n controller: 'LogoModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n buttonType: function () {\r\n return buttonType;\r\n }\r\n }\r\n }); \r\n\r\n modalInstance.result.then(function() {\r\n $rootScope.$emit('vh:logoupdate');\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module('system.logo').controller('LogoUpdateController', LogoUpdateController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/logo/logo.modal.html',\n '

          Logo

          {{alert.text}}
          {{vm.progress}}%
          ');\n}]);\n}(window, document, window.angular));","function LogoService(FileUploader, ConfigurationRepository) {\r\n return {\r\n\r\n getFileUploader: function() {\r\n var fileUploader = new FileUploader({\r\n url: '/api/Media'\r\n });\r\n\r\n fileUploader.filters.push({\r\n name: 'typeFilter',\r\n fn: function(item, options) {\r\n var type = item.type;\r\n return (type == 'image/png');\r\n }\r\n });\r\n\r\n return fileUploader;\r\n },\r\n\r\n getSettingId: function(){\r\n return ConfigurationRepository.getByParamName('ReportLogo').then(function (data){\r\n return data.Id;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('system.logo').factory('LogoService', LogoService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/logo/logo.tpl.html',\n '

          Logo and Report Image

          ');\n}]);\n}(window, document, window.angular));","function LogoModalController(LogoService, SettingsService, $uibModalInstance, $scope, $timeout, buttonType) {\r\n var vm = this;\r\n\r\n var theFile;\r\n var reportSettingId;\r\n vm.buttonType = buttonType;\r\n\r\n vm.fileUploader = LogoService.getFileUploader();\r\n\r\n vm.cancel = cancel;\r\n vm.ok = ok;\r\n\r\n function cancel() {\r\n if (vm.fileUploader.uploading) {\r\n vm.fileUploader.cancelAll();\r\n }\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function ok() {\r\n if(buttonType == 'logoBtn') {\r\n theFile.formData = [{ ResourceScope: 'custom', ResourceType: 'Images', ResourceName: 'logo.png', OverwriteResource: true }];\r\n theFile.upload();\r\n } else if(buttonType == 'reportBtn') {\r\n theFile.formData = [{ ResourceScope: 'custom', ResourceType: 'Images', ResourceName: 'report.png', OverwriteResource: true }];\r\n theFile.upload();\r\n }\r\n }\r\n\r\n LogoService.getSettingId().then(function(id) {\r\n reportSettingId = id;\r\n });\r\n\r\n vm.fileUploader.onAfterAddingFile = function (fileItem) {\r\n\r\n vm.alerts = [];\r\n\r\n if (theFile) {\r\n vm.fileUploader.removeFromQueue(theFile);\r\n }\r\n theFile = fileItem;\r\n\r\n theFile.onProgress = function (progress) {\r\n if (progress == 100) {\r\n progress = 99;\r\n }\r\n vm.progress = progress;\r\n };\r\n\r\n theFile.onSuccess = function (response, status, headers) {\r\n $uibModalInstance.close(response);\r\n if(buttonType == 'reportBtn') {\r\n SettingsService.saveSetting({Id: reportSettingId, Name: \"Reports\", SecurityActivityId: 1001, Value: \"/api/media/custom/images/report.png\",});\r\n }\r\n };\r\n\r\n theFile.onError = function (response, status, headers) {\r\n var errorText;\r\n if (vm.isIENine) {\r\n errorText = response;\r\n } else {\r\n errorText = response.ErrorMessage;\r\n }\r\n vm.alerts = [{ text: errorText, type: 'danger' }];\r\n };\r\n };\r\n\r\n vm.fileUploader.onWhenAddingFileFailed = function (item, filter, options) {\r\n\r\n vm.fileUploader.clearQueue();\r\n theFile = null;\r\n vm.fileName = null;\r\n var alertText;\r\n if (filter.name == \"typeFilter\") {\r\n alertText = \"Could not add image. File must be an image format\";\r\n } else if (filter.name == \"sizeFilter\") {\r\n alertText = \"Could not add image. File size must be less than 50MB\";\r\n } else if (filter.name == \"emptyFilter\") {\r\n alertText = \"Cannot upload an empty file.\";\r\n }\r\n vm.alerts = [{ text: alertText, type: 'danger' }];\r\n };\r\n\r\n $scope.$watch('vm.logoFile', function (val) {\r\n if (val !== undefined) {\r\n var img = new Image();\r\n img.onload = function () {\r\n var height = this.naturalHeight || this.height;\r\n if (height > 40) {\r\n $timeout(function () {\r\n alertText = 'This file is too tall. Please choose a file no taller than 40px.';\r\n vm.alerts = [{ text: alertText, type: 'danger' }];\r\n // vm.fileUploader.removeFromQueue(theFile);\r\n });\r\n }\r\n }\r\n\r\n img.src = val;\r\n }\r\n });\r\n\r\n\r\n}\r\n\r\nangular.module('system.logo').controller('LogoModalController', LogoModalController);","function NetworkOperatorController(NetworkOperators, NetworkOperatorService, lodash, $uibModal, PermissionService, $timeout) {\r\n var vm = this;\r\n\r\n vm.canEdit = PermissionService.userHasPermission(['NetworkOperatorWrite']);\r\n vm.models = NetworkOperators;\r\n vm.update = update;\r\n\r\n function update(model) {\r\n NetworkOperatorService.update(model.Id, model);\r\n }\r\n\r\n function get() {\r\n HospitalsService.get().then(function(data){\r\n vm.models = data;\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module('system.networkoperator').controller('NetworkOperatorController', NetworkOperatorController);","function NetworkOperatorService($http) {\r\n \r\n return {\r\n get: get,\r\n update: update\r\n };\r\n \r\n function get() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/NetworkOperator'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n \r\n function update(id, model) {\r\n return $http({\r\n method: 'PUT',\r\n url: '/api/NetworkOperator/' + id,\r\n data: model\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n \r\n }\r\n \r\n angular.module('system.networkoperator').factory('NetworkOperatorService', NetworkOperatorService)","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/networkoperator/networkoperator.tpl.html',\n '

          Network Operators

          0\">

          Name

          Default

          Enabled

          {{item.Name}}
          ');\n}]);\n}(window, document, window.angular));","function PatientIdentifierFieldsController($scope, $uibModal,fields,PatientIdentifierFieldsService){\r\n var vm = this;\r\n\r\n vm.fields = fields;\r\n\r\n vm.openEdit = function(field){\r\n $uibModal.open({\r\n templateUrl: 'modules/system/patientIdentifierFields/patientIdentifierFieldsEdit.tpl.html',\r\n controller: 'PatientIdentifierFieldsEditController',\r\n resolve: {\r\n field: function () {\r\n return angular.copy(field);\r\n }\r\n }\r\n }).result.then(function(updatedField){\r\n if(!updatedField) return;\r\n var idx = vm.fields.indexOf(field);\r\n if(idx>=0){\r\n vm.fields[idx]=updatedField;\r\n }\r\n else\r\n {\r\n getPatientIdentifierFields()\r\n }\r\n });\r\n }\r\n \r\n function getPatientIdentifierFields() {\r\n PatientIdentifierFieldsService.getFields().then(function (data) {\r\n vm.fields = data;\r\n });\r\n }\r\n}\r\n\r\nangular.module('system.patientIdentifierFields').controller('PatientIdentifierFieldsController', PatientIdentifierFieldsController);\r\n","function PatientIdentifierFieldsService($http){\r\n var getFields = function(){\r\n return $http({\r\n method:'GET',\r\n url:'/api/PatientIdentifierEnum'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n var updateField = function(field){\r\n return $http({\r\n method:'POST',\r\n url:'/api/PatientIdentifierEnum',\r\n data: field\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n };\r\n\r\n return {\r\n updateField: updateField,\r\n getFields: getFields\r\n };\r\n}\r\n\r\n\r\n\r\nangular.module('system.patientIdentifierFields').factory('PatientIdentifierFieldsService', PatientIdentifierFieldsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/patientIdentifierFields/patientIdentifierFields.tpl.html',\n '

          Patient Identifier Fields

          Identifier TypeDescriptionLabelIs Visible
          {{field.Text}}{{field.Description}}{{field.Label}}{{field.IsVisible}}
          ');\n}]);\n}(window, document, window.angular));","function PatientIdentifierFieldsEditController($scope,$uibModalInstance,PatientIdentifierFieldsService, field){\r\n $scope.field = field;\r\n $scope.updateField = function(field){\r\n var data = {};\r\n data.Text = field.Text;\r\n data.Description = field.Description;\r\n data.Label = field.Label;\r\n data.IsVisible = field.IsVisible;\r\n if (!angular.isUndefined(field.PatientIdentifierEnumId)) {\r\n data.PatientIdentifierEnumId = field.PatientIdentifierEnumId;\r\n }\r\n\r\n if (data.Text != undefined && data.Label != undefined) {\r\n PatientIdentifierFieldsService.updateField(data).then(function(response){\r\n $uibModalInstance.close(response);\r\n });\r\n }\r\n }\r\n\r\n $scope.cancel = function(){\r\n $uibModalInstance.close();\r\n };\r\n\r\n //this may need to be moved server side\r\n $scope.RequiredEditDisabled = function(fieldName){\r\n var disabledList = [];\r\n if(disabledList.indexOf(fieldName) == -1){\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\nangular.module(\"system.patientIdentifierFields\").controller(\"PatientIdentifierFieldsEditController\", PatientIdentifierFieldsEditController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/patientIdentifierFields/patientIdentifierFieldsEdit.tpl.html',\n '

          Patient Identifier Field

          *Required
          *Required
          *Required
          ');\n}]);\n}(window, document, window.angular));","function pickupController($scope, $uibModal, pickupOptions, PermissionService, pickupService, lodash, $timeout) {\r\n var vm = this;\r\n\r\n vm.canEdit = PermissionService.userHasPermission('KitPickupOptionWrite');\r\n\r\n \r\n vm.openEdit = openEdit;\r\n vm.pickupOptions = pickupOptions;\r\n vm.toggle = toggle;\r\n vm.toggleDelete = toggleDelete;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n\r\n function toggleDelete(id) {\r\n pickupService.deleteOption(id).then(function (pickupOption) {\r\n if (pickupOption) {\r\n var idx = lodash.findIndex(vm.pickupOptions, { KitPickupOptionId: pickupOption.KitPickupOptionId });\r\n if (idx > -1) {\r\n vm.pickupOptions[idx] = pickupOption;\r\n }\r\n }\r\n });\r\n }\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n\r\n for (var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n\r\n pickupService.updateAll(list);\r\n }\r\n\r\n function toggle(param, option) {\r\n option[param] = !option[param];\r\n pickupService.update(option.KitPickupOptionId, option);\r\n }\r\n\r\n function openEdit(pickupOption) {\r\n vm.modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/pickup/pickupedit.tpl.html',\r\n controller: 'pickupEditController',\r\n resolve: {\r\n option: function () {\r\n return angular.copy(pickupOption);\r\n }\r\n }\r\n }).result.then(function (response) {\r\n if (response) {\r\n var idx = lodash.findIndex(vm.pickupOptions, { KitPickupOptionId: response.KitPickupOptionId });\r\n if (idx > -1) {\r\n vm.pickupOptions[idx] = response;\r\n } else {\r\n vm.pickupOptions.push(response);\r\n }\r\n }\r\n });\r\n }\r\n}\r\n\r\nangular.module('system.pickup').controller('pickupController', pickupController);\r\n","function pickupService($http) {\r\n\r\n function getAll() {\r\n return $http({\r\n url: '/api/KitPickupOption',\r\n method: 'GET'\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function get(id) {\r\n return $http({\r\n url: '/api/KitPickupOption/' + id,\r\n method: 'GET'\r\n }).then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function create(pickupOption) {\r\n return $http({\r\n url: '/api/KitPickupOption',\r\n method: 'POST',\r\n data: pickupOption\r\n }).then(function(response){\r\n return response.data\r\n });\r\n }\r\n\r\n function update(id, option) {\r\n return $http({\r\n url: '/api/KitPickupOption/' + id,\r\n method: 'PUT',\r\n data: option\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateAll(list) {\r\n return $http({\r\n url: '/api/KitPickupOption/UpdateAll',\r\n method: 'POST',\r\n data: list\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function deleteOption(id) {\r\n return $http({\r\n url: '/api/KitPickupOption/' + id,\r\n method: 'DELETE'\r\n }).then(function (response){\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n create: create,\r\n get: get,\r\n getAll: getAll,\r\n update: update,\r\n updateAll: updateAll,\r\n deleteOption: deleteOption\r\n };\r\n\r\n}\r\n\r\nangular.module('system.pickup').factory('pickupService', pickupService)","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/pickup/pickup.tpl.html',\n '

          Pickup Options

          Name

          Description

          Long Description

          Does Pickup From Patient

          Customer Pickup

          Is Cancel

          Is Enabled

          {{item.Name}}
          {{item.Description}}
          {{item.LongDescription}}
          ');\n}]);\n}(window, document, window.angular));","function pickupEditController($scope,PermissionService, $uibModalInstance, pickupService, option) {\r\n\r\n $scope.cancel = cancel;\r\n $scope.save = save;\r\n $scope.option = option;\r\n $scope.canEdit = PermissionService.userHasPermission('KitPickupOptionWrite');\r\n\r\n function save(option) {\r\n if($scope.pickupForm.$valid) {\r\n if(option.KitPickupOptionId === undefined) {\r\n pickupService.create(option).then(function(response){\r\n $uibModalInstance.close(response);\r\n });\r\n } else {\r\n pickupService.update(option.KitPickupOptionId, option).then(function(response){\r\n $uibModalInstance.close(response);\r\n });\r\n }\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n}\r\n\r\nangular.module('system.pickup').controller('pickupEditController', pickupEditController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/pickup/pickupedit.tpl.html',\n '

          Edit Pickup Option

          *Required
          *Required
          *Required
          *Required
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/addLibraryTileAction.tpl.html',\n '

          {{$select.selected.Name}}ID:{{$select.selected.LibraryCategoryId}} ID:
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/addPathwayAction.tpl.html',\n '

          Start Date value options:

          • Leave this field blank and it will default to the start date set in the pathway template.
          • Use one of these variables: {Today}, {Sunday}, {Monday}, {Tuesday}, {Wednesday}, {Thursday}, {Friday}, {Saturday}
          • Use on the above variables with \\'+\\' sign to add days. For example \\'{Today} + 5\\' would set the start date to five days from today.

          End Date value options:

          • Leave this field blank and it will default to the end date set in the pathway template.
          • Use one of these variables: {Today}, {Sunday}, {Monday}, {Tuesday}, {Wednesday}, {Thursday}, {Friday}, {Saturday}
          • Use on the above variables with \\'+\\' sign to add days. For example \\'{Today} + 5\\' would set the end date to five days from today.

          Due Time value options:

          • Leave this field blank and it will default to the due time in the pathway template.
          • Enter a time. For example \\'11:30\\' would set the due time to 11:30 AM. \\'14:15\\' would set the due time to 2:15 PM.
          • Enter number of minutes. For example \\'30\\' would set the due time to be thirty minutes from now.


          {{$select.selected.Value}} (unpublished) ID: {{$select.selected.Id}}
          (Unpublished)
          ID:





          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/addPatientAlertAction.tpl.html',\n '





          Alert Time value options:
          • Defaults to the current time if left blank.
          • Enter number of minutes. For example \\'30\\' would delay the alert time by thirty minutes.
          • Enter a time. For example \\'11:30\\' would set the alert time to 11:30 AM. \\'14:15\\' would set the alert time to 2:15 PM.
          Alert Date value options:
          • Defaults to {Today} if left blank.
          • Use {Today} with \\'+\\' sign to add days. For example \\'{Today} + 5\\' would delay the alert by five days.
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/addPatientCardAction.tpl.html',\n '



          {{$select.selected.Name}}ID:{{$select.selected.VideoId}} ID:

          {{$select.selected.name}}ID:{{$select.selected.id}} ID:
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/changePathwayStatusAction.tpl.html',\n '

          {{$select.selected.Value}} (unpublished) ID: {{$select.selected.Id}}
          (Unpublished)
          ID:

          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/changePatientProgramAction.tpl.html',\n '

          {{$item.Value}} (disabled) ({{$item.SiteName}})ID: {{$item.Id}}({{item.SiteName}})(disabled) ID:
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/changePatientStatusAction.tpl.html',\n '

          {{$select.selected.Value}}ID:{{$select.selected.Id}} ID:

          {{$select.selected.Value}}ID:{{$select.selected.Id}} ID:

          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/discontinueAllPathwaysExceptAction.tpl.html',\n '
          {{$item.Value}} (unpublished)  ID:{{$item.Id}}
          (Unpublished)
          ID:
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/executeSQLCommandAction.tpl.html',\n '

          {{$select.selected.Value}}ID:{{$select.selected.Id}} ID:
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/managePatientDeviceAction.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/managePatientSpecialHandlingAction.tpl.html',\n '


          {{$select.selected.Value}} (disabled) ({{$select.selected.SiteName}})ID: {{$select.selected.Id}}({{item.SiteName}})(disabled) ID:
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/managePatientSurveySchedulesAction.tpl.html',\n '


          {{$item.Value}} (unpublished)  ID:{{$item.Id}}
          (Unpublished)
          ID:

           Pathway Times
          {{vm.schedule.DueTime.StartMinutesBeforePromptTime | date:\\'shortTime\\'}}
          Mins
          {{vm.schedule.DueTime.LateMinutesAfterPromptTime | date:\\'shortTime\\'}}
          Mins
          {{vm.schedule.DueTime.EndMinutesAfterPromptTime | date:\\'shortTime\\'}}
          Mins
           Recurrence
          {{vm.schedule.description.recurrence}}
          Value cannot be less than 1
          Value cannot be less than 1
          Value cannot be less than 1
          Value must be between 1 and 31
           
            Start Date
          {{vm.schedule.description.start}}
          0\" tooltip-popup-delay=\"700\" uib-tooltip=\"{{vm.schedule.StartDate.MilestoneDay.Description}}\" tooltip-placement=\"left\">
          Value cannot be less than 0
          Program Day Cannot be less than 2
          Value cannot be less than 0
          Program duration cannot be less than 1 day
          Program duration cannot be less than 1 day
          Value cannot be less than 0
           
          Days before or after cannot be less than 0
           End Date
          {{vm.schedule.description.end}}
          0\" tooltip-popup-delay=\"700\" uib-tooltip=\"{{vm.schedule.EndDate.MilestoneDay.Description}}\" tooltip-placement=\"left\">
          Value must be greater than 1
          Value must be greater than 1
          Value must be 1 or greater
          Value cannot be lower than 0
          Value cannot be lower than 1
          Value cannot be lower than 1
          Value cannot be lower than 0
           
          Days before or after cannot be less than 0
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/managePatientTagAction.tpl.html',\n '


          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/removeLibraryTileAction.tpl.html',\n '

          {{$select.selected.Name}}ID:{{$select.selected.LibraryCategoryId}} ID:
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/removePatientCardAction.tpl.html',\n '



          {{$select.selected.Name}}ID:{{$select.selected.VideoId}} ID:

          {{$select.selected.name}}ID:{{$select.selected.id}} ID:
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/replacePatientCardAction.tpl.html',\n '



          {{$select.selected.Name}}ID:{{$select.selected.VideoId}} ID:

          {{$select.selected.name}}ID:{{$select.selected.id}} ID:
          ');\n}]);\n}(window, document, window.angular));","function ruleActionDirective(GoDevicesService, cardTypes) {\r\n\r\n return {\r\n restrict: \"E\",\r\n templateUrl: function(elem, attr) {\r\n return 'modules/system/rules/actions/' + attr.type + '.tpl.html';\r\n },\r\n scope: {\r\n vm: \"=controller\",\r\n ruleAction: \"=actionObj\"\r\n },\r\n link: function (scope, elm, attr) {\r\n scope.showHelp = false;\r\n scope.actionData = scope.ruleAction.data || {};\r\n \r\n // ----------------------------------------------------------------------------------------------------------------------------------------\r\n // these methods ensure that the UID is set correctly ----------------------------------\r\n // -------------------------------------------------------------------------------------\r\n scope.onVideoChanged = ()=>{\r\n \r\n scope.actionData.SurveyVideoUId = null;\r\n\r\n var video = scope.vm.videos.find( x => x.VideoId == scope.actionData.SurveyVideoId);\r\n if(video)\r\n scope.actionData.SurveyVideoUId = video.VideoUId;\r\n };\r\n\r\n scope.onHealthTipChanged = ()=>{\r\n \r\n scope.actionData.HealthTipUId = null;\r\n\r\n var healthtip = scope.vm.healthTips.find(x => x.id == scope.actionData.HealthTipId)\r\n if(healthtip)\r\n scope.actionData.HealthTipUId = healthtip.uid;\r\n };\r\n\r\n scope.onPathwayChanged = ()=>{\r\n \r\n scope.actionData.TemplateUId = null;\r\n\r\n var pathway = scope.vm.pathways.find(x => x.SurveyTemplateId == scope.actionData.TemplateId)\r\n if(pathway)\r\n scope.actionData.TemplateUId = pathway.SurveyTemplateUId;\r\n };\r\n\r\n\r\n scope.onProgramChanged = ($item)=>{\r\n\r\n const filterProgramsWithSameSite = x => x === $item || x.SiteId != $item.SiteId;\r\n const distinct = (item, index, self) => self.indexOf(item) === index;\r\n \r\n var selectedPrograms = scope.actionData.Programs;\r\n\r\n // adding\r\n if(selectedPrograms.indexOf($item) > -1){\r\n $item.ProgramId = $item.Id;\r\n $item.ProgramName = $item.Value;\r\n selectedPrograms = selectedPrograms.filter(filterProgramsWithSameSite);\r\n } else // removing\r\n {\r\n if(!$item.IsEnabled && !canAssignDisabledItems)\r\n {\r\n selectedPrograms.push($item);\r\n }\r\n\r\n if($item.SiteId === currentSite.SiteId && !canAssignFromAllSites){\r\n selectedPrograms.push($item);\r\n }\r\n }\r\n\r\n scope.actionData.Programs = selectedPrograms.filter(distinct); \r\n\r\n };\r\n\r\n scope.onServiceLevelChanged = () => {\r\n scope.actionData.ServiceLevelUId = null;\r\n\r\n const serviceLevel = scope.vm.serviceLevels.find(x => x.ServiceLevelId == scope.actionData.ServiceLevelId);\r\n if (serviceLevel) {\r\n scope.actionData.ServiceLevelUId = serviceLevel.ServiceLevelUId || null;\r\n }\r\n }\r\n\r\n scope.onLibraryTileChanged = () => {\r\n scope.actionData.LibraryCategoryUId = null;\r\n\r\n var tile = scope.vm.tiles.find(x => x.LibraryCategoryId == scope.actionData.LibraryCategoryId);\r\n if(tile)\r\n scope.actionData.LibraryCategoryUId = tile.ResourceLibraryCategoryUId;\r\n }\r\n // ----------------------------------------------------------------------------------------------------------------------------------------\r\n \r\n\r\n\r\n scope.cardStatus = [\r\n { Name : 'Default', Value : 1 },\r\n { Name : 'Positive', Value : 2 },\r\n { Name : 'Warning', Value : 3 },\r\n { Name : 'Negative', Value : 4 }\r\n ];\r\n\r\n scope.cardTypes = cardTypes;\r\n\r\n scope.cardDeviceModelEnum = []\r\n\r\n scope.cardDeviceModelEnum = scope.vm.devices.filter(function(dm) {\r\n return dm.IsEnabled && dm.ShowForRule;\r\n }).map(function(dm) {\r\n return { Name: dm.DeviceName, Value: dm.DeviceModelId };\r\n }) \r\n\r\n scope.alertType = [\r\n { Name : 'Blood Pressure', Value : 7 },\r\n { Name : 'Blood Sugar', Value : 8 },\r\n { Name : 'Caregiver Alert', Value : 14 },\r\n { Name : 'Caregiver Notification', Value : 38 },\r\n { Name : 'Heart Rate', Value : 10 },\r\n { Name : 'Oxygen Saturation', Value : 11 },\r\n { Name : 'Phone Call Request', Value : 13 },\r\n { Name : 'Survey Response', Value : 12 },\r\n { Name : 'Temperature', Value : 19 },\r\n { Name : 'Weight', Value : 9 }\r\n ];\r\n\r\n scope.alertSeverityLevel = [\r\n { Name : 'High', Value : 1 },\r\n { Name : 'Medium', Value : 2 }\r\n ];\r\n\r\n scope.manageDeviceModels = [];\r\n\r\n scope.vm.devices.forEach(element => {\r\n if(element.IsEnabled && element.ShowForRule) {\r\n scope.manageDeviceModels.push({ Name: element.DeviceName, Value: element.DeviceModelId });\r\n } \r\n })\r\n\r\n scope.manageDeviceAction = [\r\n { Name: 'Add', Value: 'Add' },\r\n { Name: 'Delete', Value: 'Delete' }\r\n ];\r\n\r\n scope.manageTagAction = [\r\n { Name: 'Add', Value: 'Add' },\r\n { Name: 'Delete', Value: 'Delete' }\r\n ];\r\n\r\n scope.manageSpecialHandlingAction = [\r\n { Name: 'Add', Value: 'Add' },\r\n { Name: 'Delete', Value: 'Delete' }\r\n ];\r\n\r\n scope.managePatientSurveySchedulesAction = [\r\n { Name: 'Exclude', Value: 'Exclude' },\r\n { Name: 'Include', Value: 'Include' }\r\n ];\r\n\r\n scope.surveyStatuses = [\r\n { Name : 'Active', Value : 1 },\r\n { Name : 'Inactive', Value : 2 },\r\n { Name : 'Discontinued', Value : 3 }\r\n ]\r\n\r\n scope.getHeroColor = function(cardStatusId) {\r\n var retVal = 'DefaultCard';\r\n cardStatusId = cardStatusId || scope.actionData.CardStatusId;\r\n switch(cardStatusId)\r\n {\r\n case 1:\r\n retVal = 'DefaultCard';\r\n break;\r\n case 2:\r\n retVal = 'PositiveCard';\r\n break;\r\n case 3:\r\n retVal = 'WarningCard';\r\n break;\r\n case 4:\r\n retVal = 'NegativeCard';\r\n break;\r\n }\r\n return retVal;\r\n };\r\n\r\n\r\n }\r\n };\r\n}\r\n\r\n\r\nangular.module(\"system.rules\")\r\n .directive(\"ruleAction\", ['GoDevicesService', 'cardTypes',function(){ return new ruleActionDirective(...arguments)}]);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/sendEmailRuleAction.tpl.html',\n '
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/actions/transitionPatientServiceLevelAction.tpl.html',\n '

          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/addrule.modal.html',\n '

          {{vm.modalHeader}}

          When

          If

          Then












          {{vm.addPatientCardActionData.Title}}

          {{vm.addPatientCardActionData.Subtitle}}

          {{vm.addPatientCardActionData.Value}} {{vm.addPatientCardActionData.Units}}

          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/executeSQLCommandAction.tpl.html',\n '

          {{$select.selected.Value}}ID:{{$select.selected.Id}} ID:
          ');\n}]);\n}(window, document, window.angular));","class ruleController {\r\n // remember that if you change the order of the parameters here\r\n // you also need to change the order at the bottom of this file\r\n constructor(\r\n $scope,\r\n $state,\r\n Rule,\r\n RulesService,\r\n EditConfigurationsService,\r\n TemplatesService,\r\n CardsService,\r\n ResourceLibraryService,\r\n VideosService,\r\n HealthTipsService,\r\n GoDevicesService,\r\n ServiceLevelService,\r\n SitesService,\r\n AuthorizationService,\r\n PermissionService,\r\n ruleEventTypes,\r\n ruleActionTypes,\r\n surveyStatuses,\r\n patientStatuses,\r\n cardTypes,\r\n alertTypes,\r\n expandable,\r\n privateProperties,\r\n $uibModal,\r\n $window,\r\n $timeout,\r\n $q\r\n ) {\r\n\r\n\r\n this.$scope = $scope;\r\n this.$state = $state;\r\n this.Rule = Rule;\r\n this.RulesService = RulesService;\r\n this.EditConfigurationsService = EditConfigurationsService;\r\n this.TemplatesService = TemplatesService;\r\n this.CardsService = CardsService;\r\n this.ResourceLibraryService = ResourceLibraryService;\r\n this.VideosService = VideosService;\r\n this.HealthTipsService = HealthTipsService;\r\n this.GoDevicesService = GoDevicesService;\r\n this.ServiceLevelService = ServiceLevelService;\r\n this.PermissionService = PermissionService;\r\n this.SitesService = SitesService;\r\n this.AuthorizationService = AuthorizationService;\r\n this.eventTypes = ruleEventTypes;\r\n this.actionTypes = ruleActionTypes;\r\n this.surveyStatuses = surveyStatuses;\r\n this.patientStatuses = patientStatuses;\r\n this.cardTypes = cardTypes;\r\n this.alertTypes = alertTypes;\r\n this.$q = $q\r\n\r\n this.expandable = expandable;\r\n this.privateProperties = privateProperties;\r\n\r\n this.maxCommentLength = 500;\r\n this.rule = {};\r\n this.TemplateId = 0;\r\n this.modalHeader = \"Add New Rule\";\r\n this.promptForName = false;\r\n this.editable = true;\r\n this.showDebug = false;\r\n this.itemsDeleted = false;\r\n this.populations = [];\r\n this.selectedSites = [];\r\n this.selectedPopulations = [];\r\n this.tags = {};\r\n\r\n this.sites = [];\r\n this.userSites = [];\r\n this.currentSite = {};\r\n\r\n this.$uibModal = $uibModal;\r\n this.$window = $window;\r\n this.$timeout = $timeout;\r\n\r\n this.showSave = false;\r\n\r\n this.showDisabledItems = false;\r\n this.canAssignDisabledItems = this.PermissionService.userHasPermission(['CanAssignDisabledContent']);\r\n this.canAssignFromAllSites = this.PermissionService.userHasPermission(['CanAssignFromAllSites']);\r\n\r\n this.canDisableRule = this.PermissionService.userHasPermission(['CanDisableRule']);\r\n\r\n this.isEditing = false;\r\n\r\n this.actionDragListeners = {\r\n accept: this.acceptActionOrderChange,\r\n orderChanged: this.actionsOrderChanged\r\n };\r\n\r\n this.conditionDragListeners = {\r\n accept: this.acceptConditionOrderChange,\r\n orderChanged: this.conditionsOrderChanged\r\n };\r\n\r\n // initilization code\r\n this.initialize();\r\n }\r\n\r\n $back() {\r\n this.$window.history.back();\r\n }\r\n\r\n $retryLoad() {\r\n this.$timeout(() => {\r\n this.$window.history.forward();\r\n }, 100);\r\n\r\n this.$window.history.back();\r\n }\r\n\r\n async initialize() {\r\n\r\n try {\r\n this.loading = true;\r\n var dotInterval = null;\r\n var timeoutAfter = 30;\r\n var updateLoadingMessage = area => {\r\n\r\n if (area) {\r\n\r\n var dots = '.';\r\n\r\n var updateSubProcessLabel = () => {\r\n this.subLoadProcess = `Loading: ${area}${dots}`;\r\n };\r\n\r\n if (dotInterval) {\r\n window.clearInterval(dotInterval);\r\n }\r\n\r\n dotInterval = window.setInterval(() => {\r\n dots = `${dots}.`;\r\n\r\n if (dots.length > timeoutAfter) {\r\n window.clearInterval(dotInterval);\r\n }\r\n\r\n updateSubProcessLabel();\r\n\r\n }, 1000);\r\n\r\n\r\n\r\n updateSubProcessLabel();\r\n\r\n } else {\r\n\r\n if (dotInterval) {\r\n window.clearInterval(dotInterval);\r\n }\r\n\r\n\r\n this.loading = false;\r\n this.loadingError = false;\r\n this.subLoadProcess = '';\r\n }\r\n }\r\n\r\n updateLoadingMessage('...')\r\n\r\n let [\r\n templates, \r\n cards, \r\n tiles, \r\n videos, \r\n healthTips, \r\n devices, \r\n serviceLevels, \r\n languages, \r\n tags, \r\n sites, \r\n userSites\r\n ] = await Promise.all([\r\n this.TemplatesService.getAllTemplates(),\r\n this.CardsService.getCards(),\r\n this.ResourceLibraryService.getLibraryTiles(),\r\n this.VideosService.getVideos('', -1, 1, 0),\r\n this.HealthTipsService.getHealthTips(),\r\n this.GoDevicesService.GetAllEnabled(),\r\n this.ServiceLevelService.get(),\r\n this.CardsService.getLanguages(),\r\n this.TemplatesService.getSurveyTags(),\r\n this.SitesService.getAllSites(),\r\n this.AuthorizationService.getSites()\r\n ]);\r\n\r\n updateLoadingMessage('expression values');\r\n var ruleExpressionValues = await this.RulesService.getRuleExpressionValues({ includeDisabled: true, allSites: true });\r\n ruleExpressionValues.push(this.getGoPlatforms());\r\n\r\n var lookups = {\r\n populations: [],\r\n templates: templates,\r\n cards: cards,\r\n tiles: tiles,\r\n videos: videos.Results,\r\n healthTips: healthTips.tips,\r\n devices: devices,\r\n serviceLevels: serviceLevels,\r\n ruleExpressionValues: ruleExpressionValues,\r\n languages: languages\r\n };\r\n\r\n this.lookups = Promise.resolve(lookups);\r\n\r\n this.tags = tags;\r\n\r\n this.devices = lookups.devices;\r\n\r\n\r\n this.sites = [{ SiteId: -1, Name: 'All Sites' }].concat(sites);\r\n this.userSites = userSites;\r\n\r\n this.pathways = (await this.lookups).templates;\r\n this.healthTips = (await this.lookups).healthTips;\r\n this.videos = (await this.lookups).videos;\r\n this.devices = (await this.lookups).devices;\r\n this.tiles = (await this.lookups).tiles;\r\n\r\n updateLoadingMessage('programs');\r\n lookups.populations = await this.updatePrograms();\r\n\r\n this.populations = lookups.populations;\r\n this.serviceLevels = lookups.serviceLevels;\r\n\r\n\r\n ruleExpressionValues.forEach(x => {\r\n\r\n if (x.ExpressionValues.find(v => v.SiteId != null)) {\r\n var values = [];\r\n this.sites.forEach(site => {\r\n\r\n var enabledValues = x.ExpressionValues.filter(v => v.SiteId === site.SiteId && v.IsEnabled);\r\n values = values.concat(enabledValues);\r\n });\r\n this.sites.forEach(site => {\r\n\r\n var disabledValues = x.ExpressionValues.filter(v => v.SiteId === site.SiteId && v.IsEnabled === false);\r\n values = values.concat(disabledValues);\r\n });\r\n\r\n x.ExpressionValues = values;\r\n }\r\n\r\n })\r\n\r\n this.actionExpressionValues = lookups.ruleExpressionValues;\r\n\r\n templates = lookups.templates;\r\n var templateExpressions = this.actionExpressionValues.find(x => x.ExpressionName == 'SurveyTemplateId');\r\n if (templateExpressions) {\r\n templates = templates.map(x => { return { Id: x.SurveyTemplateId, UId: x.SurveyTemplateUId, Value: x.Name, Category: (x.IsPublished ? 'Published' : 'Unpublished'), IsEnabled: (x.IsPublished ? true : false) } });\r\n\r\n var sortedTemplates = [];\r\n\r\n var enabledValues = templates.filter(x => x.IsEnabled);\r\n var disabledValues = templates.filter(x => !x.IsEnabled);\r\n sortedTemplates = [...enabledValues, ...disabledValues];\r\n templateExpressions.ExpressionValues = sortedTemplates;\r\n }\r\n\r\n if (this.Rule != null) {\r\n this.editable = true;\r\n\r\n this.modalHeader = \"Edit Rule\";\r\n //Create copy of rule, so we're editing copy\r\n this.rule = JSON.parse(JSON.stringify(this.Rule));\r\n\r\n // use expandable constant proxy from app.constants.js\r\n this.rule.RuleConditions = this.rule.RuleConditions.map(x => this.conditionProxy(this.privateProperties(this.expandable(x, true), { _editComment: false })));\r\n\r\n // use expandable constant proxy from app.constants.js and the actionProxy from below\r\n this.rule.RuleConditions.forEach(x => x.RuleActions = x.RuleActions.map(a => this.actionProxy(this.privateProperties(this.expandable(a), { _editComment: false }))));\r\n\r\n\r\n if (this.rule.RuleConditions.length > 0 && this.rule.RuleConditions[0].RuleActions.length > 0) {\r\n if (this.rule.RuleConditions[0].RuleActions[0].ActionName == 'AddPathwayAction') {\r\n this.addPathwayActionData = JSON.parse(this.rule.RuleConditions[0].RuleActions[0].ActionData);\r\n this.addPathwayActionData.TemplateId = this.TemplateId;\r\n } else if (this.rule.RuleConditions[0].RuleActions[0].ActionName == 'ChangePathwayStatusAction') {\r\n this.changePathwayStatusData = JSON.parse(this.rule.RuleConditions[0].RuleActions[0].ActionData);\r\n this.changePathwayStatusData.TemplateId = this.TemplateId;\r\n }\r\n }\r\n\r\n this.promptForName = true;\r\n\r\n this.loadSelectedProgramsFromRule();\r\n this.loadSelectedSitesFromRule();\r\n } else {\r\n this.editable = false;\r\n this.rule.IsEnabled = true;\r\n this.rule.SurveyTemplateId = this.TemplateId;\r\n this.rule.Display = \"\";\r\n this.rule.Name = \"\";\r\n this.rule.SortOrder = 1;\r\n this.rule.EventName = null;\r\n this.rule.RuleConditions = [];\r\n this.rule.RuleActions = [];\r\n this.rule.RulePrograms = [];\r\n this.addCondition();\r\n }\r\n\r\n this.filterRuleExpressionValues();\r\n\r\n updateLoadingMessage();\r\n\r\n } catch (err) {\r\n\r\n console.log(err);\r\n\r\n this.loading = true;\r\n this.loadingError = true;\r\n }\r\n\r\n\r\n\r\n }\r\n\r\n getGoPlatforms() {\r\n var values = [\r\n { Id: '0', Value: 'GoAndroid', SiteId: null, SiteName: null, IsEnabled: true },\r\n { Id: '0', Value: 'GoiOS', SiteId: null, SiteName: null, IsEnabled: true },\r\n { Id: '0', Value: 'GoWebBrowser', SiteId: null, SiteName: null, IsEnabled: true },\r\n { Id: '0', Value: 'GoWebDesktopBrowser', SiteId: null, SiteName: null, IsEnabled: true }, \r\n ];\r\n var expresstionValue = { ExpressionName: 'GoPlatform', HideId: true, ExpressionValues: values };\r\n return expresstionValue;\r\n }\r\n\r\n updatePrograms() {\r\n\r\n return this.RulesService.getPopulations({ enabledOnly: false, includeAllPatients: true, allSites: true, clearCache: true })\r\n .then(result => {\r\n\r\n var distinctSiteIds = result.map(x => x.SiteId).filter((id, index, self) => self.indexOf(id) === index);\r\n var sortedResults = [];\r\n\r\n distinctSiteIds.forEach(siteId => {\r\n\r\n var sitePrograms = result.filter(x => x.SiteId === siteId);\r\n var allPatients = sitePrograms.find(x => x.IsAllPatients);\r\n\r\n if (allPatients) {\r\n sortedResults.push(allPatients);\r\n }\r\n\r\n sitePrograms.filter(site => site.IsEnabled).forEach(site => {\r\n if (!site.IsAllPatients) {\r\n sortedResults.push(site);\r\n }\r\n })\r\n\r\n sitePrograms.filter(site => !site.IsEnabled).forEach(site => {\r\n if (!site.IsAllPatients) {\r\n sortedResults.push(site);\r\n }\r\n })\r\n\r\n });\r\n \r\n return sortedResults;\r\n });\r\n }\r\n\r\n actionsOrderChanged(event) {\r\n event.source.sortableScope.modelValue.forEach((x, index) => {\r\n x.pauseDescriptionUpdates = true;\r\n x.SortOrder = index;\r\n x.pauseDescriptionUpdates = false;\r\n });\r\n }\r\n\r\n acceptActionOrderChange(sourceItemHandleScope, destSortableScope) {\r\n return sourceItemHandleScope.sortableScope.element.hasClass('actions');\r\n }\r\n\r\n conditionsOrderChanged(event) {\r\n event.source.sortableScope.modelValue.forEach((x, index) => {\r\n x.pauseDescriptionUpdates = true;\r\n x.SortOrder = index;\r\n x.pauseDescriptionUpdates = false;\r\n });\r\n }\r\n\r\n acceptConditionOrderChange(sourceItemHandleScope, destSortableScope) {\r\n return sourceItemHandleScope.sortableScope.element.hasClass('conditions');\r\n }\r\n\r\n conditionProxy(condition) {\r\n return new Proxy(condition, {\r\n set: (target, key, value, receiver) => {\r\n if (target[key] != value) {\r\n\r\n if (key == 'SortOrder' && !this.loading)\r\n this.showSave = true;\r\n\r\n var result = Reflect.set(target, key, value, receiver);\r\n return result;\r\n }\r\n return true;\r\n }\r\n })\r\n }\r\n\r\n actionProxy(action) {\r\n\r\n\r\n const defaultName = 'Not Set';\r\n var pauseDescriptionUpdates = false;\r\n var descriptionHtml = '';\r\n\r\n var data = JSON.parse(action.ActionData || '{}');\r\n\r\n if (action.ActionName == 'ChangePatientProgramAction') {\r\n data.Programs = data.Programs || [];\r\n\r\n if (data.ProgramId) {\r\n data.Programs.push({ ProgramId: data.ProgramId, ProgramUId: data.ProgramUId })\r\n data.ProgramId = null;\r\n data.ProgramUId = null;\r\n }\r\n\r\n var programs = data.Programs.map(x => ({ id: x.ProgramId, uid: x.ProgramUId }));\r\n\r\n data.Programs = this.getActionExpressionData('Program',false)\r\n .filter(x => programs.find(p => p.Id == x.Id || (p.uid && p.uid == x.UId)));\r\n }\r\n\r\n // var surveyActions = ['AddPathwayAction', 'ChangePathwayStatusAction',\r\n // 'DiscontinueAllPathwaysExceptAction', 'ManagePatientSurveySchedulesAction']\r\n // if (surveyActions.find(x => x == action.ActionName)) {\r\n \r\n // }\r\n\r\n data = new Proxy(data, {\r\n\r\n get: (target, key, receiver) => {\r\n\r\n switch (key) {\r\n case 'availablePrograms':\r\n\r\n return this.getActionExpressionData('Program',true);\r\n case 'availableSurveys':\r\n return this.getActionExpressionData('SurveyTemplateId');\r\n\r\n default:\r\n return Reflect.get(target, key, receiver);\r\n }\r\n\r\n\r\n },\r\n\r\n set: (target, key, value) => {\r\n\r\n var result = Reflect.set(target, key, value);\r\n var jsonTarget = target;\r\n\r\n switch (action.ActionName) {\r\n case 'ChangePatientProgramAction':\r\n jsonTarget = {};\r\n\r\n jsonTarget.Programs = target.Programs.map(x => {\r\n var program = this.populations.find(p => p.PopulationId == x.Id || p.PopulationId == x.ProgramId);\r\n if (program) {\r\n x.ProgramUId = program.PopulationUId;\r\n }\r\n\r\n return { ProgramId: x.Id, ProgramUId: x.UId, ProgramName: x.Value };\r\n });\r\n\r\n break;\r\n case 'ExecuteSQLCommandAction':\r\n var ruleSQLCmds = this.getActionExpressionData('RuleSQLCommand')\r\n\r\n var ruleSQLCmd = ruleSQLCmds.find(p => p.Id == target.RuleSQLCommandId);\r\n\r\n if (ruleSQLCmd && ruleSQLCmd.Value) {\r\n jsonTarget.DisplayText = ruleSQLCmd.Value;\r\n }\r\n\r\n if (ruleSQLCmd && ruleSQLCmd.UId) {\r\n jsonTarget.RuleSQLCommandUId = ruleSQLCmd.UId;\r\n }\r\n\r\n break;\r\n // case 'AddPathwayAction':\r\n // case 'ChangePathwayStatusAction':\r\n // var survey = this.pathways.find(p => p.SurveyTemplateId == target.TemplateId /*|| p.SurveyTemplateId == target.Templates*/);\r\n\r\n // if (survey && survey.SurveyTemplateId) {\r\n // jsonTarget.TemplateId = survey.SurveyTemplateId;\r\n // }\r\n\r\n // if (survey && survey.SurveyTemplateUId) {\r\n // jsonTarget.TemplateUId = survey.SurveyTemplateUId;\r\n // }\r\n\r\n // break;\r\n // case 'DiscontinueAllPathwaysExceptAction':\r\n // break;\r\n // case 'ManagePatientSurveySchedulesAction':\r\n // break;\r\n default:\r\n break;\r\n }\r\n\r\n action.ActionData = JSON.stringify(jsonTarget, ' ');\r\n updateDescription();\r\n return result;\r\n }\r\n });\r\n\r\n\r\n var updateDescription = () => {\r\n\r\n if (pauseDescriptionUpdates)\r\n return;\r\n\r\n descriptionHtml = '';\r\n\r\n this.lookups\r\n .then(lookups => {\r\n\r\n var actionType = this.actionTypes.find(x => x.value == action.ActionName) || {};\r\n var cardType = this.cardTypes.find(x => x.value == data.CardTypeId) || {};\r\n\r\n var cardName = null;\r\n\r\n switch (data.CardTypeId) {\r\n case 2:\r\n var device = lookups.devices.find(x => x.DeviceModelId == data.DeviceModelEnumId);\r\n if (device)\r\n cardName = device.DeviceName;\r\n break;\r\n case 3:\r\n var video = lookups.videos.find(x => x.VideoUId == data.SurveyVideoUId || x.VideoId == data.SurveyVideoId);\r\n if (video)\r\n cardName = video.Name;\r\n break;\r\n\r\n case 4:\r\n var healthtip = lookups.healthTips.find(x => x.uid == data.HealthTipUId || x.id == data.HealthTipId);\r\n if (healthtip)\r\n cardName = healthtip.name;\r\n break;\r\n\r\n case 5:\r\n var card = lookups.cards.find(x => x.CardUId == data.CardUId || x.CardId == data.CardId);\r\n if (card)\r\n cardName = card.Name;\r\n break;\r\n };\r\n\r\n\r\n descriptionHtml = actionType.name || 'Unknown';\r\n\r\n descriptionHtml += ': ';\r\n\r\n switch (action.ActionName) {\r\n\r\n case 'AddPathwayAction':\r\n var pathway = lookups.templates.find(x => x.SurveyTemplateId == data.TemplateId) || {};\r\n descriptionHtml += `${pathway.Name || defaultName}`;\r\n break;\r\n case 'ChangePathwayStatusAction':\r\n var pathway = lookups.templates.find(x => x.SurveyTemplateId == data.TemplateId);\r\n var surveyStatus = this.surveyStatuses.find(x => x.value == data.SurveyStatusId);\r\n var surveyStatusText = surveyStatus ? `${surveyStatus.name}` : 'Not Set';\r\n var pathwayName = (pathway || {}).Name || '';\r\n descriptionHtml += `${pathwayName} (status: ${surveyStatusText})`;\r\n break;\r\n case 'DiscontinueAllPathwaysExceptAction':\r\n //I don't think we need to list anything in the header for this action.\r\n //This is where that would go if someone decides otherwise.\r\n break;\r\n case 'AddPatientAlertAction':\r\n var alertType = this.alertTypes.find(x => x.value == data.AlertTypeId);\r\n var alertTypeText = alertType ? `(${alertType.name}) ` : defaultName;\r\n descriptionHtml += `${alertTypeText}${data.AlertText || defaultName}`;\r\n break;\r\n case 'ChangePatientProgramAction':\r\n var programs = lookups.populations.filter(x =>\r\n x.PopulationId == data.ProgramId ||\r\n (data.Programs || []).find(p => p.ProgramId == x.PopulationId)\r\n );\r\n\r\n programs = programs.map(program => `${program.PopulationName || defaultName} (${program.SiteName})`)\r\n descriptionHtml += programs.join(', ');\r\n\r\n break;\r\n case 'ChangePatientStatusAction':\r\n var patientStatus = this.patientStatuses.find(x => x.value == data.StatusId) || {};\r\n descriptionHtml += `${patientStatus.name || defaultName}`\r\n break;\r\n case 'ExecuteSQLCommandAction':\r\n descriptionHtml += `${data.DisplayText || defaultName}`\r\n break;\r\n case 'AddPatientCardAction':\r\n case 'ReplacePatientCardAction':\r\n case 'RemovePatientCardAction':\r\n descriptionHtml = descriptionHtml.replace('card', `${cardType.description || ''} card`);\r\n descriptionHtml += `${cardName || defaultName}`;\r\n break;\r\n case 'AddLibraryTileAction':\r\n var tile = lookups.tiles.find(x => x.LibraryCategoryId == data.LibraryCategoryId) || {};\r\n var tileName = tile.Name;\r\n if (tile)\r\n descriptionHtml += `${tileName || defaultName}`;;\r\n break;\r\n case 'RemoveLibraryTileAction':\r\n var tile = lookups.tiles.find(x => x.LibraryCategoryId == data.LibraryCategoryId) || {};\r\n var tileName = tile.Name;\r\n if (tile)\r\n descriptionHtml += `${tileName || defaultName}`;;\r\n break;\r\n case 'ManagePatientDeviceAction':\r\n var device = lookups.devices.find(x => x.DeviceModelId == data.DeviceModelId);\r\n var deviceName = '';\r\n if (device)\r\n deviceName = device.DeviceName;\r\n\r\n descriptionHtml += ` ${data.ManageDeviceAction || ''} ${deviceName}`;\r\n break;\r\n case 'ManagePatientTagAction':\r\n descriptionHtml += ` ${data.ManageTagAction || ''} (${data.Tag || defaultName})`;\r\n break;\r\n case 'ManagePatientSpecialHandlingAction':\r\n descriptionHtml += ` ${data.ManageSpecialHandlingAction || ''} (${data.SpecialHandling !== undefined && data.SpecialHandling !== null ? data.SpecialHandling.Value : defaultName})`;\r\n break;\r\n };\r\n\r\n window.setTimeout(() => { this.$scope.$apply(); })\r\n\r\n });\r\n\r\n\r\n\r\n };\r\n\r\n\r\n\r\n var handler = {\r\n get: (target, key, receiver) => {\r\n\r\n switch (`${key}`.toLowerCase()) {\r\n case 'data':\r\n return data;\r\n case 'description':\r\n return descriptionHtml;\r\n case 'updatedescription':\r\n return () => updateDescription();\r\n case 'pausedescriptionupdates':\r\n return pauseDescriptionUpdates;\r\n case 'target':\r\n return target;\r\n default:\r\n return Reflect.get(target, key, receiver);\r\n }\r\n\r\n },\r\n set: (target, key, value, receiver) => {\r\n\r\n\r\n switch (`${key}`.toLowerCase()) {\r\n case 'pausedescriptionupdates':\r\n pauseDescriptionUpdates = value;\r\n return true;\r\n default:\r\n if (target[key] != value) {\r\n\r\n if (key != '$$hashKey')\r\n this.showSave = true;\r\n\r\n var result = Reflect.set(target, key, value, receiver);\r\n updateDescription();\r\n return result;\r\n }\r\n return true;\r\n }\r\n\r\n\r\n }\r\n };\r\n return new Proxy(action, handler);\r\n }\r\n\r\n\r\n notDeleted(items) {\r\n\r\n return (items || []).filter(x => !x.DeletedDateTime_UTC);\r\n }\r\n\r\n expandAll(condition) {\r\n (condition ? condition.RuleActions : this.rule.RuleConditions).forEach(x => x.expand());\r\n }\r\n\r\n collapseAll(condition) {\r\n (condition ? condition.RuleActions : this.rule.RuleConditions).forEach(x => x.collapse());\r\n }\r\n\r\n filterRuleExpressionValues() {\r\n var result = JSON.parse(JSON.stringify(this.actionExpressionValues));\r\n\r\n result.forEach(x => {\r\n x.ExpressionValues = x.ExpressionValues || [];\r\n if (x.ExpressionValues.find(x => x.IsEnabled != null)) {\r\n x.ExpressionValues = x.ExpressionValues.filter(x => (this.canAssignDisabledItems && this.showDisabledItems) || x.IsEnabled);\r\n }\r\n\r\n if (x.ExpressionValues.find(x => x.SiteId != null)) {\r\n if (this.selectedSites.length > 0 && this.selectedSites[0].SiteId != -1) {\r\n x.ExpressionValues = x.ExpressionValues.filter(x => this.selectedSites.find(s => s.SiteId == x.SiteId));\r\n }\r\n }\r\n });\r\n\r\n this.ruleExpressionValues = null;\r\n this.ruleExpressionValues = result;\r\n }\r\n\r\n\r\n getActionExpressionData(expressionName,applyDisabledFilter) {\r\n var filter = this.actionExpressionValues.filter(x => x.ExpressionName == expressionName);\r\n\r\n var filtered = filter.length > 0 ? filter[0].ExpressionValues : [];\r\n\r\n filtered = filtered.filter(x => !x.IsAllPatients)\r\n\r\n if (filtered.find(x => x.IsEnabled != null)) {\r\n if (applyDisabledFilter) {\r\n filtered = filtered.filter(x => (this.canAssignDisabledItems && this.showDisabledItems) || x.IsEnabled);\r\n } else {\r\n filtered = filtered.filter(x => (this.canAssignDisabledItems) || x.IsEnabled);\r\n }\r\n }\r\n\r\n if (filtered.find(x => x.SiteId != null)) {\r\n if (this.selectedSites.length > 0 && this.selectedSites[0].SiteId != -1) {\r\n filtered = filtered.filter(x => this.selectedSites.find(s => s.SiteId == x.SiteId));\r\n }\r\n }\r\n\r\n return filtered;\r\n }\r\n\r\n loadSelectedProgramsFromRule() {\r\n if (this.rule.RulePrograms.length > 0) {\r\n var copySelected = []; \r\n this.rule.RulePrograms = this.rule.RulePrograms.filter((item, index, self) => self.indexOf(self.find(x => x.PopulationId == item.PopulationId)) === index);\r\n\r\n this.rule.RulePrograms.forEach(rulePrograms => {\r\n var result = this.populations.find(item => item.PopulationId === rulePrograms.PopulationId && rulePrograms.DeletedDateTime_UTC == null);\r\n if (result != null) { \r\n copySelected.push(result); \r\n }\r\n })\r\n this.selectedPopulations = copySelected; \r\n }\r\n }\r\n\r\n loadSelectedSitesFromRule() {\r\n var that = this;\r\n setCurrentSite();\r\n var siteIds = that.selectedPopulations.filter(x => x.SiteId !== that.currentSite.SiteId).map(x => x.SiteId);\r\n var sitesOfSelectedPrograms = that.sites.filter(x => siteIds.includes(x.SiteId));\r\n this.selectedSites = that.selectedSites.concat(sitesOfSelectedPrograms);\r\n\r\n\r\n function setCurrentSite() {\r\n that.currentSite = that.userSites.find(x => x.IsCurrent);\r\n\r\n if (that.currentSite) {\r\n\r\n var site = that.sites.find(x => x.SiteId === that.currentSite.SiteId);\r\n\r\n if (site) {\r\n site.IsCurrent = true;\r\n\r\n that.selectedSites = [site];\r\n } \r\n }\r\n }\r\n };\r\n\r\n isValid() {\r\n var isValid = this.rule &&\r\n this.rule.RuleConditions &&\r\n this.notDeleted(this.rule.RuleConditions).length > 0;\r\n\r\n if (isValid)\r\n this.rule.RuleConditions.forEach(x => {\r\n isValid = isValid && this.notDeleted(x.RuleActions).length > 0;\r\n });\r\n\r\n return isValid;\r\n }\r\n\r\n addCondition(index) {\r\n var ruleCondition = {};\r\n ruleCondition.Name = '';\r\n ruleCondition.Condition = '';\r\n ruleCondition.SortOrder = this.rule.RuleConditions.length + 1;\r\n ruleCondition.RuleActions = [];\r\n ruleCondition.Comment = '';\r\n\r\n var proxyCondition = this.expandable(this.privateProperties(ruleCondition, { _editComment: false }), true);\r\n\r\n\r\n if (index != undefined && index != null && index != this.rule.RuleConditions.length) {\r\n this.rule.RuleConditions.splice(index, 0, proxyCondition);\r\n } else {\r\n this.rule.RuleConditions.push(proxyCondition);\r\n }\r\n\r\n this.editCondition(ruleCondition);\r\n\r\n this.addAction(ruleCondition.RuleActions);\r\n\r\n \r\n }\r\n\r\n addAction(actionArray, index) {\r\n var ruleAction = {};\r\n ruleAction.Name = \"\";\r\n ruleAction.ActionName = null;\r\n ruleAction.ActionData = \"\";\r\n\r\n var proxyAction = this.actionProxy(this.expandable(this.privateProperties(ruleAction, { _editComment: false }), true));\r\n\r\n\r\n if (index != undefined && index != null && index != actionArray.length) {\r\n actionArray.splice(index, 0, proxyAction);\r\n } else {\r\n ruleAction.SortOrder = actionArray.length + 1;\r\n actionArray.push(proxyAction);\r\n }\r\n\r\n\r\n }\r\n\r\n saveSelectedProgramToRule() {\r\n this.rule.RulePrograms = this.selectedPopulations.map(population => { return { PopulationId: population.PopulationId }; });\r\n }\r\n\r\n get filteredPrograms() {\r\n var filtered = this.populations;\r\n\r\n if (!this.canAssignDisabledItems || !this.showDisabledItems) {\r\n filtered = filtered.filter(x => x.IsEnabled);\r\n }\r\n\r\n if (!this.canAssignFromAllSites) {\r\n filtered = filtered.filter(x => x.SiteId == this.currentSite.SiteId);\r\n }\r\n\r\n if (this.selectedSites.length > 0 && this.selectedSites[0].SiteId != -1) {\r\n filtered = filtered.filter(x => this.selectedSites.find(s => s.SiteId == x.SiteId));\r\n }\r\n\r\n return filtered;\r\n }\r\n\r\n populationsChanged(action, site) {\r\n\r\n if (action === 'add' && site.IsAllPatients) {\r\n // remove all non IsAllPatients for that site.\r\n this.selectedPopulations = this.selectedPopulations.filter(x => x.SiteId != site.SiteId || x.IsAllPatients);\r\n }\r\n\r\n if (action === 'add' && !site.IsAllPatients) {\r\n // make sure that we remove IsAllPatients for the site \r\n this.selectedPopulations = this.selectedPopulations.filter(x => x.SiteId != site.SiteId || !x.IsAllPatients);\r\n }\r\n\r\n }\r\n\r\n\r\n sitesChanged(action, item) {\r\n\r\n if (item == null)\r\n this.selectedSites = [];\r\n\r\n item = item || {};\r\n\r\n if (action === 'add' && item.SiteId === -1 && this.selectedSites.find(x => x === item)) {\r\n this.selectedSites = [item];\r\n }\r\n\r\n if (action === 'add' && this.selectedSites.length === 0) {\r\n this.selectedSites = [this.currentSite];\r\n }\r\n\r\n if (action === 'add' && this.selectedSites.length > 1) {\r\n this.selectedSites = this.selectedSites.filter(x => x.SiteId != -1);\r\n }\r\n\r\n if (action === 'remove') {\r\n this.selectedPopulations = this.selectedPopulations.filter(x => x.SiteId != item.SiteId);\r\n }\r\n\r\n this.filterRuleExpressionValues();\r\n }\r\n\r\n addDefaultAction() {\r\n this.addAction(this.rule.RuleActions);\r\n }\r\n\r\n deleteCondition(condition) {\r\n condition.DeletedDateTime_UTC = new Date().toUTCString();\r\n this.showSave = true;\r\n }\r\n\r\n deleteAction(action, condition) {\r\n action.DeletedDateTime_UTC = new Date().toUTCString();\r\n this.showSave = true;\r\n }\r\n\r\n addRuleItem(text) {\r\n if (this.rule.RuleConditions[0].Condition == null) {\r\n this.rule.RuleConditions[0].Condition = '';\r\n }\r\n if (this.rule.RuleConditions[0].Condition.slice(-1) != ' ') {\r\n this.rule.RuleConditions[0].Condition += ' ';\r\n }\r\n this.rule.RuleConditions[0].Condition += text + ' ';\r\n }\r\n\r\n updateDescription() {\r\n\r\n var eventItem = this.eventTypes.find(x => x.value == this.rule.EventName);\r\n var actionItem = this.actionTypes.find(x => x.value == this.rule.RuleConditions[0].RuleActions[0].ActionName);\r\n\r\n if (!this.promptForName && eventItem != null && actionItem != null) {\r\n if (this.rule.Display.length == 0) {\r\n this.rule.Display = eventItem.description + ' ' + actionItem.description;\r\n }\r\n this.promptForName = true;\r\n }\r\n }\r\n\r\n save() {\r\n this.saveSelectedProgramToRule();\r\n\r\n this.RulesService.saveRule(this.rule).then(() => {\r\n this.$state.go('system.rules', {\r\n FromState: this.$state.params.FromState\r\n });\r\n });\r\n }\r\n\r\n cancel() {\r\n this.$state.go('system.rules', {\r\n FromState: this.$state.params.FromState\r\n });\r\n };\r\n\r\n toggleShowDisabledItems($event) {\r\n $event.stopPropagation();\r\n this.showDisabledItems = !this.showDisabledItems;\r\n this.filterRuleExpressionValues();\r\n }\r\n\r\n toggleIsRuleDisabled($event) {\r\n $event.stopPropagation();\r\n this.rule.IsEnabled = !this.rule.IsEnabled;\r\n this.showSave = true;\r\n }\r\n\r\n editCondition(condition) {\r\n condition.edit = !condition.edit;\r\n this.isEditing = true;\r\n }\r\n\r\n displayDisabledSurveys() {\r\n return this.showDisabledItems && this.canAssignDisabledItems;\r\n }\r\n\r\n}\r\n\r\n\r\n\r\n\r\nangular.module('system.rules')\r\n .filter('NotDeleted', () => (items) => items.filter(x => !x.DeletedDateTime_UTC))\r\n .controller('ruleController', [\r\n '$scope',\r\n '$state',\r\n 'Rule',\r\n 'RulesService',\r\n 'EditConfigurationsService',\r\n 'TemplatesService',\r\n 'CardsService',\r\n 'ResourceLibraryService',\r\n 'VideosService',\r\n 'HealthTipsService',\r\n 'GoDevicesService',\r\n 'ServiceLevelService',\r\n 'SitesService',\r\n 'AuthorizationService',\r\n 'PermissionService',\r\n 'ruleEventTypes',\r\n 'ruleActionTypes',\r\n 'surveyStatuses',\r\n 'patientStatuses',\r\n 'cardTypes',\r\n 'alertTypes',\r\n 'expandable',\r\n 'privateProperties',\r\n '$uibModal',\r\n '$window',\r\n '$timeout',\r\n '$q',\r\n function(\r\n $scope,\r\n $state,\r\n Rule,\r\n RulesService,\r\n EditConfigurationsService,\r\n TemplatesService,\r\n CardsService,\r\n ResourceLibraryService,\r\n VideosService,\r\n HealthTipsService,\r\n GoDevicesService,\r\n ServiceLevelService,\r\n SitesService,\r\n AuthorizationService,\r\n PermissionService,\r\n ruleEventTypes,\r\n ruleActionTypes,\r\n surveyStatuses,\r\n patientStatuses,\r\n cardTypes,\r\n alertTypes,\r\n expandable,\r\n privateProperties,\r\n $uibModal,\r\n $window,\r\n $timeout,\r\n $q\r\n ) { return new ruleController(...arguments); }\r\n ]);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/rule.tpl.html',\n '

          {{vm.modalHeader}}

          1. {{vm.rule.Display}}
          Error loading rule data.
          {{$item.Name}} (Current)
          {{$item.PopulationName}} ({{$item.SiteName}}) (disabled) ({{population.SiteName}}) (disabled)
          0\">

          There are no Conditions configured. Click here to add a Condition

          0\">Else if ({{condition.Condition}}) Actions ({{condition.RuleActions.length}})
          0\">{{condition.Comment}}(No comments)
          {{vm.maxCommentLength - (condition.Comment || \\'\\').length}} of {{vm.maxCommentLength}} characters left

          There are no Actions configured. Click here to add an Action

          0 ? \\'visible\\' : \\'hidden\\') }\">And Then
          0\">{{action.Comment}}(No comments)
          {{vm.maxCommentLength - (action.Comment || \\'\\').length}} of {{vm.maxCommentLength}} characters left
          {{vm.rule  | json}}
          ');\n}]);\n}(window, document, window.angular));","function ruleConditionDirective(lodash) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: function(elem, attr) {\r\n return 'modules/system/rules/ruleCondition.tpl.html';\r\n },\r\n scope: {\r\n condition: \"=\",\r\n tags: \"=\",\r\n controller: \"=\",\r\n isediting: \"=\"\r\n },\r\n link: function (scope, elm, attr) {\r\n scope.isediting = attr.isediting;\r\n scope.onchange = onchange;\r\n scope.condition.expressionOperator = '&&';\r\n scope.condition.expressions = [];\r\n scope.condition.expressions.push({ property : '', operator : '', value : '' });\r\n\r\n scope.ruleExpressionValues = scope.controller.ruleExpressionValues;\r\n\r\n scope.$watch('controller.ruleExpressionValues', newValue => scope.ruleExpressionValues = newValue)\r\n\r\n scope.expressionOperators = [\r\n { Value : '&&', Name : 'all' },\r\n { Value : '||', Name : 'any' }\r\n ]\r\n\r\n scope.add = function(){\r\n scope.condition.expressions.push({ property : '', operator : '', value : '' });\r\n }\r\n\r\n scope.remove = function(){\r\n\r\n }\r\n\r\n scope.indent = function(){\r\n\r\n } \r\n \r\n function onchange(){\r\n var conditionText = '';\r\n scope.condition.expressions.forEach(function(expression){\r\n if( conditionText.length > 0 ){\r\n conditionText += ' ' + scope.condition.expressionOperator + ' ';\r\n }\r\n conditionText += expression.text;\r\n });\r\n scope.condition.Condition = conditionText;\r\n scope.condition.edit = scope.isediting;\r\n }\r\n }\r\n };\r\n}\r\nangular.module(\"system.rules\").directive(\"ruleCondition\", ruleConditionDirective);\r\n\r\n\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/ruleCondition.tpl.html',\n '
          1\">
          of the following rules are true:
          ');\n}]);\n}(window, document, window.angular));","function ruleExpressionDirective(lodash, RulesService) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: function(elem, attr) {\r\n return 'modules/system/rules/ruleExpression.tpl.html';\r\n },\r\n scope: {\r\n add: \"=\",\r\n expression: \"=\",\r\n onchange: \"=\",\r\n condition: \"=\",\r\n tags: \"=\",\r\n ruleExpressionValues: \"=\"\r\n },\r\n //requires: ['ngSanitize', 'uiSelect'],\r\n \r\n link(scope) {\r\n\r\n \r\n scope.updateExpression = updateExpression;\r\n scope.propChanged = propChanged;\r\n\r\n scope.expression.property = '{Tags}';\r\n scope.expression.operator = '=';\r\n scope.expression.value = '';\r\n scope.selectedRuleExpressionList = {};\r\n scope.selectedRuleExpressionList = { selectItems : []};\r\n scope.selectedRuleExpressionList.isExpressionListEnabled = false;\r\n\r\n scope.$watch('ruleExpressionValues', (newValues)=>{\r\n scope.selectedRuleExpressionList.isExpressionListEnabled = false;\r\n scope.selectedRuleExpressionList.selectItems = [];\r\n scope.selectedRuleExpressionList.selected = undefined;\r\n \r\n var filter = lodash.filter(scope.ruleExpressionValues, function(x) {\r\n if (\"{\" + x.ExpressionName.toUpperCase() + \"}\" == scope.expression.property.toUpperCase())\r\n { \r\n scope.selectedRuleExpressionList.isExpressionListEnabled = true;\r\n scope.selectedRuleExpressionList.hideId = !x.HideId\r\n return x;\r\n }\r\n });\r\n if (filter.length > 0)\r\n {\r\n scope.selectedRuleExpressionList.selectItems = filter[0].ExpressionValues;\r\n }\r\n });\r\n \r\n scope.properties = [\r\n { Value : '{Tags}', Name : 'Tags', Type : 'array', enableTypeahead : 'true' },\r\n { Value : '{SessionTags}', Name : 'Session Tags', Type : 'array', enableTypeahead : 'true' },\r\n { Value : 'tag(\\'TagName\\', DayCount)', Name : 'Tag Count Function', Type : 'composite' },\r\n\r\n { Value : '{Gender}', Name : 'Gender', Type : 'string', PossibleValues : ['Male', 'Female'] },\r\n { Value : '{IsBirthday}', Name : 'Is Birthday', Type : 'bool', PossibleValues : ['true', 'false'] },\r\n { Value : '{StatusId}', Name : 'Status Id', Type : 'int' },\r\n { Value : '{EventPreviousStatusId}', Name: 'EventPreviousStatusId', Type: 'int' },\r\n { Value : '{ServiceLevel}', Name : 'Service Level', Type : 'string' },\r\n { Value : '{EventPreviousServiceLevel}', Name: 'EventPreviousServiceLevel', Type: 'string' },\r\n { Value : '{ProgramGroup}', Name : 'Program Group', Type : 'string' },\r\n { Value : '{Program}', Name : 'Program', Type : 'string' },\r\n { Value: '{ProviderGroup}', Name: 'Provider Group', Type: 'string' },\r\n { Value : '{HospitalId}', Name : 'Hospital Id', Type : 'int'},\r\n { Value : '{IsAdhocBiometricReading}', Name : 'Is Adhoc Biometric Reading', Type : 'bool', PossibleValues : ['true', 'false'] },\r\n\r\n { Value : '{AvgSystolic}', Name : 'Avg Systolic', Type : 'int' },\r\n { Value : '{AvgDiastolic}', Name : 'Avg Diastolic', Type : 'int' },\r\n { Value : '{AvgBloodSugar}', Name : 'Avg Blood Sugar', Type : 'int' },\r\n\r\n { Value : '{Systolic}', Name : 'Systolic', Type : 'int' },\r\n { Value : '{Diastolic}', Name : 'Diastolic', Type : 'int' },\r\n { Value : '{BloodSugar}', Name : 'Blood Sugar', Type : 'int' },\r\n { Value : '{Weight}', Name : 'Weight', Type : 'int' },\r\n { Value : '{TemperatureFahrenheit}', Name : 'Temperature Fahrenheit', Type : 'int' },\r\n { Value : '{TemperatureCelsius}', Name : 'Temperature Celsius', Type : 'int' },\r\n { Value : '{Pulse}', Name : 'Pulse', Type : 'int' },\r\n { Value : '{Oxygen}', Name : 'Oxygen', Type : 'int' },\r\n { Value : '{Hba1c}', Name : 'Hba1c', Type : 'int' },\r\n\r\n { Value : '{LastSystolic}', Name : 'Last Systolic', Type : 'int' },\r\n { Value : '{LastDiastolic}', Name : 'Last Diastolic', Type : 'int' }, \r\n { Value : '{LastBloodSugar}', Name : 'Last Blood Sugar', Type : 'int' },\r\n { Value : '{LastWeight}', Name : 'Last Weight', Type : 'int' },\r\n { Value : '{LastOxygen}', Name : 'Last Oxygen', Type : 'int' },\r\n { Value : '{LastPulse}', Name : 'Last Pulse', Type : 'int' },\r\n { Value : '{LastTempFahrenheit}', Name : 'Last Temperature Fahrenheit', Type : 'int' },\r\n { Value : '{LastTempCelsius}', Name : 'Last Temperature Celsius', Type : 'int' },\r\n { Value : '{LastHba1c}', Name : 'Last Hba1c', Type : 'int' },\r\n\r\n { Value : '{HoursSinceLastBloodSugar}', Name : 'HoursSinceLastBloodSugar', Type : 'decimal' },\r\n { Value : '{HoursSinceLastBP}', Name : 'HoursSinceLastBP', Type : 'decimal' },\r\n { Value : '{HoursSinceLastPulse}', Name : 'HoursSinceLastPulse', Type : 'decimal' },\r\n { Value : '{HoursSinceLastWeight}', Name : 'HoursSinceLastWeight', Type : 'decimal' },\r\n { Value : '{HoursSinceLastTemperature}', Name : 'HoursSinceLastTemperature', Type : 'decimal' },\r\n { Value : '{HoursSinceLastOxygen}', Name : 'HoursSinceLastOxygen', Type : 'decimal' },\r\n { Value : '{HoursSinceLastStep}', Name : 'HoursSinceLastStep', Type : 'decimal' },\r\n { Value : '{HoursSinceLastHbA1c}', Name : 'HoursSinceLastHbA1c', Type : 'decimal' },\r\n { Value : '{HoursSinceLastControlInhaler}', Name : 'HoursSinceLastControlInhaler', Type : 'decimal' },\r\n { Value : '{HoursSinceLastRescueInhaler}', Name : 'HoursSinceLastRescueInhaler', Type : 'decimal' },\r\n\r\n { Value : '{BPReadingCount}', Name : 'BP Reading Count', Type : 'int' },\r\n { Value : '{ControlInhaler24HrCount}', Name : 'ControlInhaler24HrCount', Type : 'int' },\r\n { Value : '{ControlInhaler7DayCount}', Name : 'ControlInhaler7DayCount', Type : 'int' },\r\n { Value : '{RescueInhaler24HrCount}', Name : 'RescueInhaler24HrCount', Type : 'int' },\r\n { Value : '{RescueInhaler7DayCount}', Name : 'RescueInhaler7DayCount', Type : 'int' },\r\n\r\n { Value : '{ControlInhalerPaired}', Name : 'ControlInhalerPaired', Type : 'int' },\r\n { Value : '{RescueInhalerPaired}', Name : 'RescueInhalerPaired', Type : 'int' },\r\n\r\n { Value : '{DayOfMonth}', Name : 'Day Of Month', Type : 'int' },\r\n { Value : '{DayOfWeek}', Name : 'Day Of Week', Type : 'string', PossibleValues : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] },\r\n { Value : '{Month}', Name : 'Month', Type : 'int', PossibleValues : [1,2,3,4,5,6,7,8,9,10,11,12] },\r\n { Value : '{Today}', Name : 'Today', Type : 'string' },\r\n\r\n { Value : '{PathwayName}', Name : 'Pathway Name', Type : 'string' },\r\n { Value : '{SurveyTemplateId}', Name : 'Survey Template Id', Type : 'int' },\r\n { Value : '{PathwayPlayCount}', Name : 'Pathway Play Count', Type : 'int' },\r\n { Value : '{PathwayCompleteCount}', Name : 'Pathway Complete Count', Type : 'int' },\r\n { Value : '{ProgramDay}', Name : 'Program Day', Type : 'int' },\r\n { Value : '{LastDayOfProgram}', Name : 'Last Day Of Program', Type : 'int' },\r\n { Value : '{GoPlatform}', Name: 'GoPlatform', Type: 'string'},\r\n\r\n { Value: '{SpecialHandling}', Name: 'Special Handling', Type: 'array'}\r\n /*\r\n { Value : '{PatientId}', Name : 'PatientId', Type : 'int' },\r\n { Value : '{FirstName}', Name : 'FirstName', Type : 'string' },\r\n { Value : '{Current2wkSessionNumber}', Name : 'Current2wkSessionNumber', Type : 'int' },\r\n { Value : '{KitNo}', Name : 'KitNo', Type : 'string' },\r\n { Value : '{EventBiometricType}', Name : 'EventBiometricType', Type : 'string' },\r\n { Value : '{EventSurveyTemplateId}', Name : 'EventSurveyTemplateId', Type : 'int' },\r\n { Value : '{PathwayPlayCount}', Name : 'PathwayPlayCount', Type : 'int' },\r\n\r\n { Value : '{LastBP}', Name : 'LastBP', Type : 'string' },\r\n { Value : '{BPReadings}', Name : 'BPReadings', Type : 'List' },\r\n { Value : '{BSReadings}', Name : 'BSReadings', Type : 'List' },\r\n { Value : '{BPAverage}', Name : 'BPAverage', Type : 'string' },\r\n { Value : '{BPReadingCnt2wk}', Name : 'BPReadingCnt2wk', Type : 'int' },\r\n { Value : '{BPAverageCurrent2wk}', Name : 'BPAverageCurrent2wk', Type : 'string' },\r\n { Value : '{BPAveragePrev2wk}', Name : 'BPAveragePrev2wk', Type : 'string' },\r\n { Value : '{BPAverageFirst2wk}', Name : 'BPAverageFirst2wk', Type : 'string' },\r\n { Value : '{SystolicHL}', Name : 'SystolicHL', Type : 'string' },\r\n { Value : '{DiastolicHL}', Name : 'DiastolicHL', Type : 'string' },\r\n { Value : '{SystolicDelta}', Name : 'SystolicDelta', Type : 'int' },\r\n { Value : '{DiastolicDelta}', Name : 'DiastolicDelta', Type : 'int' },\r\n\r\n { Value : '{Now}', Name : 'Now', Type : 'DateTime' },\r\n { Value : '{Midnight}', Name : 'Midnight', Type : 'DateTime' },\r\n { Value : '{Tomorrow}', Name: 'Tomorrow', Type: 'DateTime' },\r\n { Value : '{Sunday}', Name : 'Sunday', Type : 'DateTime' },\r\n { Value : '{Monday}', Name : 'Monday', Type : 'DateTime' },\r\n { Value : '{Tuesday}', Name : 'Tuesday', Type : 'DateTime' },\r\n { Value : '{Wednesday}', Name : 'Wednesday', Type : 'DateTime' },\r\n { Value : '{Thursday}', Name : 'Thursday', Type : 'DateTime' },\r\n { Value : '{Friday}', Name : 'Friday', Type : 'DateTime' },\r\n { Value : '{Saturday}', Name : 'Saturday', Type : 'DateTime' },\r\n { Value : '{TwowkAgoDate}', Name : 'TwowkAgoDate', Type : 'string' },\r\n { Value : '{LastDayOfMonth}', Name : 'Last Day O fMonth', Type : 'int', PossibleValues : [28, 29, 30, 31] },\r\n { Value : '{TimeZoneId}', Name : 'TimeZoneId', Type : 'int' },\r\n\r\n { Value : '{AllTags}', Name : 'AllTags', Type : 'array', enableTypeahead : 'false' },\r\n { Value : '{TagsByDate}', Name : 'TagsByDate', Type : 'array', enableTypeahead : 'false' }\r\n */\r\n\r\n ]; \r\n\r\n //updateExpression();\r\n\r\n scope.arrayOperator = [\r\n { Value : '=', Name : 'contains' },\r\n { Value : '!=', Name : 'does not contain' }\r\n ]\r\n\r\n scope.boolOperator = [\r\n { Value : '=', Name : 'is true' },\r\n { Value : '!=', Name : 'is false' }\r\n ]\r\n\r\n scope.stringOperator = [\r\n { Value : '=', Name : 'is' },\r\n { Value : '!=', Name : 'is not' }\r\n ]\r\n \r\n scope.intOperator = [\r\n { Value : '=', Name : 'is' },\r\n { Value : '>', Name : 'is greater than' },\r\n { Value : '<', Name : 'is less than' },\r\n { Value : '>=', Name : 'is or is greater than' },\r\n { Value : '<=', Name : 'is or is less than' },\r\n { Value : '!=', Name : 'is not' }\r\n ]; \r\n\r\n scope.ruleOperator = [\r\n { Value : '=', Name : 'Equal' },\r\n { Value : '&&', Name : 'And' },\r\n { Value : '||', Name : 'Or' },\r\n { Value : '>', Name : 'Greater than' },\r\n { Value : '<', Name : 'Less than' },\r\n { Value : '>=', Name : 'Greater than or Equal' },\r\n { Value : '<=', Name : 'Less than or Equal' },\r\n { Value : '!=', Name : 'Not equal' },\r\n { Value : '(', Name : '(' },\r\n { Value : ')', Name : ')' },\r\n { Value : '+', Name : 'Add' },\r\n { Value : '-', Name : 'Subtract' },\r\n { Value : '*', Name : 'Multiply' },\r\n { Value : '/', Name : 'Divide' },\r\n { Value : '%', Name : 'Modulo' }\r\n ]; \r\n\r\n \r\n\r\n scope.showOperatorList = function(type){\r\n return getSelectedPropertyType() === type;\r\n }\r\n\r\n scope.ruleExpressionOnSelect = function(item, model) {\r\n if (getSelectedPropertyType() === \"int\")\r\n {\r\n scope.expression.text = scope.expression.property + ' ' + scope.expression.operator + ' ' + item.Id;\r\n }\r\n if (getSelectedPropertyType() === \"string\")\r\n {\r\n scope.expression.text = scope.expression.property + ' ' + scope.expression.operator + ' \\'' + item.Value + '\\'';\r\n }\r\n if (getSelectedPropertyType() === \"array\")\r\n {\r\n scope.expression.text = scope.expression.property + ' ' + scope.expression.operator + ' \\'' + item.Value + '\\'';\r\n }\r\n scope.onchange();\r\n }\r\n\r\n scope.showExpression = function()\r\n {\r\n if (scope.selectedRuleExpressionList.isExpressionListEnabled == false)\r\n {\r\n return (scope.showOperatorList('array') || scope.showOperatorList('string') || scope.showOperatorList('int'));\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n scope.showExpressionList = function()\r\n {\r\n return scope.selectedRuleExpressionList.isExpressionListEnabled;\r\n }\r\n\r\n function propChanged(){\r\n scope.expression.value = '';\r\n\r\n scope.selectedRuleExpressionList.isExpressionListEnabled = false;\r\n scope.selectedRuleExpressionList.selectItems = [];\r\n scope.selectedRuleExpressionList.selected = undefined;\r\n \r\n var filter = lodash.filter(scope.ruleExpressionValues, function(x) {\r\n if (\"{\" + x.ExpressionName.toUpperCase() + \"}\" == scope.expression.property.toUpperCase())\r\n { \r\n scope.selectedRuleExpressionList.isExpressionListEnabled = true;\r\n scope.selectedRuleExpressionList.hideId = !x.HideId\r\n return x;\r\n }\r\n });\r\n if (filter.length > 0)\r\n {\r\n scope.selectedRuleExpressionList.selectItems = filter[0].ExpressionValues;\r\n }\r\n updateExpression();\r\n }\r\n\r\n function updateExpression(){\r\n var type = getSelectedPropertyType();\r\n var enableTypeahead = getSelectedPropertyTypeahead();\r\n switch( type ){\r\n case 'bool':{\r\n scope.expression.text = scope.expression.property + ' ' + scope.expression.operator + ' true';\r\n break;\r\n }\r\n case 'string':\r\n case 'array':{\r\n scope.expression.text = scope.expression.property + ' ' + scope.expression.operator + ' \\'' + scope.expression.value + '\\'';\r\n break;\r\n }\r\n default:{\r\n scope.expression.text = scope.expression.property + ' ' + scope.expression.operator + ' ' + scope.expression.value;\r\n break\r\n }\r\n }\r\n \r\n scope.condition.edit = type === 'composite';\r\n scope.enableTypeahead = enableTypeahead;\r\n\r\n scope.onchange();\r\n }\r\n\r\n function getSelectedPropertyTypeahead(){\r\n var retVal = '';\r\n var varType = lodash.pluck(lodash.filter(scope.properties, { 'Value' : scope.expression.property } ), 'enableTypeahead');\r\n if(varType.length > 0){\r\n retVal = varType[0];\r\n } \r\n return retVal;\r\n }\r\n function getSelectedPropertyType(){\r\n var retVal = '';\r\n var varType = lodash.pluck(lodash.filter(scope.properties, { 'Value' : scope.expression.property } ), 'Type');\r\n if(varType.length > 0){\r\n retVal = varType[0];\r\n } \r\n return retVal;\r\n }\r\n\r\n scope.addExpression = function(){\r\n scope.add();\r\n }\r\n\r\n scope.remove = function(){\r\n\r\n }\r\n\r\n scope.indent = function(){\r\n\r\n }\r\n\r\n scope.closeDropdowns = function(){\r\n scope.$broadcast('uis:closeAll')\r\n scope.$emit('uis:closeAll')\r\n }\r\n\r\n\r\n scope.searchTags = function(term) {\r\n var tagsList = lodash(scope.tags).map(function(tag){\r\n return {\r\n label: tag\r\n }\r\n })\r\n .filter(function(t) {\r\n return t.label.toUpperCase().indexOf(term.toUpperCase()) >= 0;\r\n })\r\n .sortBy('label')\r\n .value();\r\n\r\n scope.surveyTags = tagsList;\r\n return tagsList;\r\n }\r\n\r\n scope.getTag = function(item) {\r\n return item.label.trim();\r\n }\r\n }\r\n };\r\n}\r\nangular.module(\"system.rules\").directive(\"ruleExpression\", ruleExpressionDirective);\r\nangular.module(\"system.rules\").filter(\"orderSearch\", \r\nfunction() {\r\n return function(items, search, ...params){\r\n search = search.toUpperCase();\r\n\r\n var fetchValue = function(item, param){\r\n return item[param].toString().toUpperCase().indexOf(search)\r\n }\r\n \r\n return items.sort(function(a, b){\r\n var minA = Math.min(...params.map(y => fetchValue(a, y) !== -1 ? fetchValue(a, y) : items.length))\r\n var minB = Math.min(...params.map(y => fetchValue(b, y) !== -1 ? fetchValue(b, y) : items.length))\r\n return minA - minB\r\n })\r\n }\r\n});\r\nangular.module('system.rules').filter(\"searchFilter\", function(){\r\n return function(items, search, ...params){\r\n search = search.toUpperCase()\r\n\r\n return items.filter((item) => \r\n params.some((param) => \r\n item[param].toString().toUpperCase().includes(search)\r\n )\r\n )\r\n }\r\n})\r\nangular.module('system.rules').directive('uiSelectCloseAll', function($rootScope){\r\n return{\r\n link: function(scope, element, attr){\r\n function safeApply(fn) {\r\n var phase = $rootScope.$$phase;\r\n if (phase == '$apply' || phase == '$digest') {\r\n if (fn && (typeof (fn) === 'function')) {\r\n fn();\r\n }\r\n } else {\r\n scope.$apply();\r\n }\r\n };\r\n scope.$on('uis:closeAll', function(event, id){\r\n if(scope.$id !== id){\r\n scope.$select.close(true);\r\n safeApply();\r\n }\r\n })\r\n scope.$watch('$select.open', function(newValue, oldValue){\r\n if(newValue !== oldValue && newValue){\r\n $rootScope.$broadcast('uis:closeAll', scope.$id)\r\n }\r\n })\r\n }\r\n }\r\n})\r\nangular.module(\"system.rules\").directive(\"selectCloseAll\", function($rootScope){\r\n return {\r\n link:function (scope, element, attr){\r\n element.bind(\"click\", function(event, data){\r\n $rootScope.$broadcast('uis:closeAll', scope.$id)\r\n })\r\n\r\n scope.$on('$destroy', function(){\r\n element.off('click')\r\n });\r\n }\r\n }\r\n})","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/ruleExpression.tpl.html',\n '
          {{$select.selected.Value}} (disabled) (unpublished) ({{item.SiteName}}) (disabled) (unpublished) ID:
          ');\n}]);\n}(window, document, window.angular));","function RulesController($scope, $state, $http, vhSweetAlert, lodash, RulesService, PermissionService, ruleEventTypes, ruleActionTypes) {\r\n var vm = this;\r\n vm.Rules = [];\r\n vm.selectedRule = undefined;\r\n vm.EventNameFilter = undefined;\r\n vm.anyProgram = { name: 'Any Program', value: '', SortOrder: -99 };\r\n vm.ProgramFilter = undefined;\r\n vm.refresh = refresh;\r\n vm.ruleFilter = ruleFilter;\r\n vm.filterChanged = filterChanged;\r\n vm.clearFilters = clearFilters;\r\n vm.populations = [];\r\n vm.programTypes = [];\r\n vm.eventTypes = ruleEventTypes;\r\n vm.actionTypes = ruleActionTypes;\r\n\r\n vm.loading = true;\r\n vm.searchText = '';\r\n\r\n vm.userCanImport = PermissionService.userHasPermission('RulesImport');\r\n vm.userCanExport = PermissionService.userHasPermission('RulesExport');\r\n vm.userCanDisableRule = PermissionService.userHasPermission('CanDisableRule');\r\n\r\n vm.toggle = toggle;\r\n vm.toggleClass = toggleClass;\r\n\r\n vm.selectedRules = [];\r\n\r\n vm.isSelected = (id) => vm.selectedRules.find(x => x == id);\r\n\r\n vm.toggleSelect = (event, id) => {\r\n event.stopPropagation();\r\n var selected = vm.isSelected(id);\r\n vm.selectedRules = vm.selectedRules.filter(x => x != id);\r\n\r\n if (!selected)\r\n vm.selectedRules = vm.selectedRules.concat([id]);\r\n }\r\n\r\n vm.exporting = promise => {\r\n promise.then(response => {\r\n console.log(response);\r\n vhSweetAlert.success('Exported', `Successfully exported ${(vm.selectedRules || []).length} rule(s).`);\r\n });\r\n };\r\n\r\n function _extractFileName(headerContentDisposition) {\r\n var filename = \"\";\r\n var disposition = headerContentDisposition;\r\n if (disposition && disposition.indexOf('attachment') !== -1) {\r\n var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\r\n var matches = filenameRegex.exec(disposition);\r\n if (matches != null && matches[1]) {\r\n filename = matches[1].replace(/['\"]/g, '');\r\n }\r\n }\r\n return filename;\r\n }\r\n\r\n vm.editRule = (event, rule) => {\r\n\r\n vm.toggleSelect(event, rule.RuleId);\r\n $state.go('system.rules.rule', { RuleId: vm.selectedRule.RuleId, FromState: { ActionNameFilter: vm.ActionNameFilter, EventNameFilter: vm.EventNameFilter, ProgramFilter: vm.ProgramFilter, searchText: vm.searchText } });\r\n }\r\n\r\n vm.export = () => {\r\n\r\n $http.post('/api/export/rules', JSON.stringify(vm.selectedRules))\r\n .then(function successCallback(response) {\r\n var headersFn = response.headers;\r\n var headers = headersFn();\r\n\r\n var filename = _extractFileName(headers['content-disposition']);\r\n var contentType = headers['content-type'];\r\n\r\n var a = document.createElement('a');\r\n try {\r\n var blob = new Blob([JSON.stringify(response.data)], { type: contentType });\r\n var url = window.URL.createObjectURL(blob);\r\n\r\n vhSweetAlert.success('Exported', `Successfully exported ${(vm.selectedRules || []).length} rule(s).`);\r\n\r\n a.setAttribute('href', url);\r\n a.setAttribute(\"download\", filename);\r\n a.click();\r\n\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n\r\n });\r\n }\r\n\r\n vm.eventTypes = [\r\n { Name: 'Patient completes any pathway.', Value: 'Vivify.Platform.Events.PatientSurveyCompletedEvent', DescriptionText: 'When patient completes any pathway' },\r\n { Name: 'Patient\\'s status changes.', Value: 'Vivify.Platform.Events.PatientStatusUpdatedEvent', DescriptionText: 'When patient\\'s status changes' },\r\n { Name: 'Patient\\'s program changes.', Value: 'Vivify.Platform.Events.PatientPopulationUpdatedEvent', DescriptionText: 'When patient\\'s program changes' },\r\n { Name: 'Patient is added.', Value: 'Vivify.Platform.Events.PatientAddedEvent', DescriptionText: 'When a patient is added' },\r\n { Name: 'Patient adds a biometric reading.', Value: 'Vivify.Platform.Events.PatientBiometricAddedEvent', DescriptionText: 'When a patient enters a biometric reading' },\r\n { Name: 'Care Team Portal user accepts alert/notification', Value: 'Vivify.Platform.Events.PatientAlertInterventionAddedEvent', DescriptionText: 'When a care team user accepts a patient alert or notification with an intervention' },\r\n { Name: 'Patient Alert External Registration Failed', Value: 'Vivify.Platform.Events.PatientAlertExternalRegistrationFailedEvent', DescriptionText: 'This event is fired when alert is create for HL7 registration fails to create a new patient because the patient already has an active encounter' },\r\n { Name: 'Special Handling is added to a patient', Value: 'Vivify.Platform.Events.PatientSpecialHandlingAddedEvent', DescriptionText: 'This event is fired when a special handling indicator is added to a patient' },\r\n { Name: 'Special Handling is removed from a patient', Value: 'Vivify.Platform.Events.PatientSpecialHandlingRemovedEvent', DescriptionText: 'This event is fired when a special handling indicator is removed from a patient' },\r\n { Name: 'Patient Survey is Overdue', Value: 'Vivify.Platform.Events.PatientSurveyOverdueEvent', DescriptionText: 'This event is fired when a patient survey is overdue' },\r\n ];\r\n\r\n\r\n vm.actionTypes = [\r\n { Name: 'Add pathway to patient', Value: 'AddPathwayAction', DescriptionText: 'add this pathway to patient' },\r\n { Name: 'Change pathway status to', Value: 'ChangePathwayStatusAction', DescriptionText: 'change the status of this pathway' },\r\n { Name: 'Add alert to patient', Value: 'AddPatientAlertAction', DescriptionText: '' },\r\n { Name: 'Change patient\\'s program', Value: 'ChangePatientProgramAction', DescriptionText: '' },\r\n { Name: 'Change patient\\'s status', Value: 'ChangePatientStatusAction', DescriptionText: '' },\r\n { Name: 'Add card to patient', Value: 'AddPatientCardAction', DescriptionText: '' },\r\n { Name: 'Remove card from patient', Value: 'RemovePatientCardAction', DescriptionText: '' },\r\n { Name: 'Replace card for patient', Value: 'ReplacePatientCardAction', DescriptionText: '' },\r\n { Name: 'Add library tile to patient', Value: 'AddLibraryTileAction', DescriptionText: '' },\r\n { Name: 'Remove library tile from patient', Value: 'RemoveLibraryTileAction', DescriptionText: '' },\r\n { Name: 'Send an email', Value: 'SendEmailRuleAction', DescriptionText: '' },\r\n { Name: 'Manage Patient Device', Value: 'ManagePatientDeviceAction', DescriptionText: '' },\r\n { Name: 'Manage Patient Tag', Value: 'ManagePatientTagAction', DescriptionText: '' },\r\n { Name: 'Manage Patient Special Handling', Value: 'ManagePatientSpecialHandlingAction', DescriptionText: '' }, \r\n { Name: 'Execute SQL Command', Value: 'ExecuteSQLCommandAction', DescriptionText: '' },\r\n { Name: 'Manage Patient Survey Schedules', Value: 'ManagePatientSurveySchedulesAction', DescriptionText: ''}\r\n ];\r\n\r\n init();\r\n\r\n function init() {\r\n var fromState = ($state.params.FromState || {});\r\n vm.ActionNameFilter = fromState.ActionNameFilter;\r\n vm.EventNameFilter = fromState.EventNameFilter;\r\n vm.ProgramFilter = fromState.ProgramFilter;\r\n vm.searchText = fromState.searchText;\r\n\r\n vm.refresh(fromState.ProgramFilter);\r\n }\r\n\r\n\r\n vm.ruleLogPaging = {\r\n page: 1,\r\n pageSize: 50\r\n };\r\n\r\n vm.view = function(ruleId) {\r\n $state.go('system.rules.rule', {\r\n RuleId: ruleId,\r\n FromState: { ActionNameFilter: vm.ActionNameFilter, EventNameFilter: vm.EventNameFilter, ProgramFilter: vm.ProgramFilter, searchText: vm.searchText }\r\n });\r\n }\r\n\r\n vm.clearSearch = () => {\r\n vm.searchText = '';\r\n vm.searchTextBox = '';\r\n };\r\n vm.searchChanged = () => { vm.searchText = vm.searchTextBox; }\r\n\r\n function clearFilters() {\r\n vm.ProgramFilter = vm.anyProgram.value;\r\n vm.ActionNameFilter = null;\r\n vm.EventNameFilter = null;\r\n vm.searchText = '';\r\n vm.searchTextBox = '';\r\n }\r\n\r\n function refresh(selectProgram) {\r\n loadPrograms(selectProgram || '');\r\n RulesService.refresh();\r\n RulesService.getAll().then(function(data) {\r\n vm.Rules = [...data.filter(rule => rule.IsEnabled).sort((a, b) => a.RuleId - b.RuleId), ...data.filter(rule => !rule.IsEnabled).sort((a, b) => a.RuleId - b.RuleId)];\r\n vm.loading = false;\r\n })\r\n .catch(() => {\r\n vm.loading = false;\r\n });\r\n }\r\n\r\n function loadPrograms(selectProgram) {\r\n\r\n RulesService.getPopulations().then(function(data) {\r\n vm.populations = data;\r\n vm.allPatients = lodash.find(data, function(p) { return p.IsAllPatients; });\r\n }).then(function() {\r\n vm.programTypes = [vm.anyProgram].concat(vm.populations.map(function(population) {\r\n return {\r\n name: population.PopulationName,\r\n value: population.PopulationId,\r\n SortOrder: population.SortOrder\r\n };\r\n }));\r\n if (!selectProgram)\r\n vm.ProgramFilter = selectProgram;\r\n });\r\n }\r\n\r\n vm.addRule = function() {\r\n $state.go('system.rules.rule', { RuleId: 0, FromState: { ActionNameFilter: vm.ActionNameFilter, EventNameFilter: vm.EventNameFilter, ProgramFilter: vm.ProgramFilter } });\r\n }\r\n\r\n vm.deleteRule = function(ruleId) {\r\n var text = 'Are you sure you want to delete this rule?';\r\n vhSweetAlert.verify('Are you sure?', text, 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n RulesService.deleteRule(ruleId).then(function(data) {\r\n vm.selectedRule = undefined;\r\n refresh();\r\n });\r\n }\r\n });\r\n }\r\n\r\n vm.ruleLogPageChanged = function() {\r\n\r\n RulesService.getLog(vm.selectedRule.RuleId, vm.ruleLogPaging.pageSize, vm.ruleLogPaging.page).then(function(data) {\r\n vm.Log = data.Response;\r\n vm.totalCount = data.TotalCount;\r\n parseLogObjects();\r\n });\r\n }\r\n\r\n vm.select = function(rule) {\r\n vm.selectedRule = rule;\r\n\r\n $http.post('/api/export/rules', JSON.stringify([rule.RuleId]))\r\n .then(function successCallback(response) {\r\n try {\r\n vm.selectedRule.jsonText = JSON.stringify(response.data);\r\n } catch (ex) {\r\n console.log(ex);\r\n }\r\n });\r\n\r\n vm.logexpanded = false;\r\n rule.RulePrograms = (rule.RulePrograms || []).filter((item, index, self) => self.indexOf(self.find(x => x.PopulationId == item.PopulationId)) === index);\r\n RulesService.getLog(vm.selectedRule.RuleId, vm.ruleLogPaging.pageSize, vm.ruleLogPaging.page).then(function(data) {\r\n vm.Log = data.Response;\r\n vm.totalCount = data.TotalCount;\r\n parseLogObjects();\r\n });\r\n }\r\n\r\n function parseLogObjects() {\r\n vm.Log.forEach(function(item) {\r\n if (item.Note.startsWith(\"[\")) {\r\n item.Data = {};\r\n item.Data.Log = JSON.parse(item.Note);\r\n if (item.EventData.startsWith(\"{\")) {\r\n item.Data.Event = JSON.parse(item.EventData);\r\n }\r\n if (item.PatientData.startsWith(\"{\")) {\r\n item.Data.Data = JSON.parse(item.PatientData);\r\n }\r\n\r\n } else {\r\n item.Data = {};\r\n item.Data.Log = [];\r\n item.Data.Log.push(item.Note);\r\n }\r\n });\r\n }\r\n\r\n function ruleFilter(rule) {\r\n var retVal = false;\r\n\r\n if (hasProgram(rule, vm.ProgramFilter)) {\r\n if (vm.EventNameFilter != undefined) {\r\n if (rule.EventName == vm.EventNameFilter) {\r\n if (vm.ActionNameFilter != undefined) {\r\n retVal = hasAction(rule, vm.ActionNameFilter);\r\n } else {\r\n retVal = true;\r\n }\r\n }\r\n } else {\r\n if (vm.ActionNameFilter != undefined) {\r\n retVal = hasAction(rule, vm.ActionNameFilter);\r\n } else {\r\n retVal = true;\r\n }\r\n }\r\n }\r\n\r\n if (retVal && rule && vm.searchText && vm.searchText.length > 0) {\r\n retVal = retVal && (rule.Name.toLowerCase().indexOf(vm.searchText.toLowerCase()) > -1 || `${rule.RuleUId}`.toLowerCase().indexOf(vm.searchText.toLowerCase()) > -1);\r\n\r\n }\r\n\r\n return retVal || vm.selectedRules.find(x => rule.RuleId == x) != null;\r\n }\r\n\r\n function hasProgram(rule, program) {\r\n var retVal = false;\r\n //rule assigned to any programs\r\n if (program == undefined || program == vm.anyProgram.value) {\r\n retVal = true;\r\n }\r\n // rule assigned to All Patients\r\n else if (rule.RulePrograms.length < 1 && program == vm.allPatients.PopulationId) {\r\n retVal = true;\r\n } else {\r\n lodash.forEach(rule.RulePrograms, function(Program) {\r\n if (Program.PopulationId == program) {\r\n retVal = true;\r\n }\r\n });\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n vm.displayProgramName = function(rule) {\r\n var programText = '';\r\n var programList = [];\r\n if (rule.RulePrograms.length < 1) {\r\n programText = 'No Patients';\r\n }\r\n\r\n lodash.forEach(rule.RulePrograms, function(Program) {\r\n var ProgramName = vm.populations.find(item => item.PopulationId === Program.PopulationId);\r\n\r\n if (ProgramName != null) {\r\n programList.push(ProgramName.PopulationName);\r\n }\r\n });\r\n //case insensitve sort\r\n programList.sort(function(x, y) {\r\n var a = String(x).toUpperCase();\r\n var b = String(y).toUpperCase();\r\n if (a > b)\r\n return 1\r\n if (a < b)\r\n return -1\r\n return 0;\r\n });\r\n lodash.forEach(programList, function(programItem) {\r\n if (programText != '') programText += ', ';\r\n programText += programItem;\r\n });\r\n return 'Defaulted for ' + programText;\r\n }\r\n\r\n function hasAction(rule, actionName) {\r\n var retVal = false;\r\n rule.RuleConditions.forEach(function(condition) {\r\n condition.RuleActions.forEach(function(action) {\r\n if (action.ActionName == actionName) {\r\n retVal = true;\r\n }\r\n });\r\n });\r\n\r\n rule.DefaultRuleActions.forEach(function(action) {\r\n if (action.ActionName == actionName) {\r\n retVal = true;\r\n }\r\n });\r\n return retVal;\r\n }\r\n\r\n function filterChanged() {\r\n vm.searchText = vm.searchTextBox;\r\n vm.selectedRule = undefined;\r\n //vm.selectedRules = [];\r\n }\r\n\r\n function toggleClass(value) {\r\n return value == true ? 'fa fa-toggle-on' : 'fa fa-toggle-off text-muted';\r\n }\r\n\r\n function toggle(event, item, prop) {\r\n event.preventDefault();\r\n\r\n item[prop] = !item[prop];\r\n RulesService.saveRule(item).then(() => refresh());\r\n }\r\n}\r\n\r\nangular.module('system.rules').controller('RulesController', RulesController);","function RulesService($http, PendingService, PopulationsRepository) {\r\n return {\r\n getAll: function () {\r\n return $http.get('/api/Rule').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n get: function (ruleId) {\r\n return PendingService.promise('get rule ' + ruleId, ()=> $http.get('/api/Rule/' + ruleId))\r\n .then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n refresh: function () {\r\n return $http.get('/api/Rule/refresh').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n getLog: function (ruleId, pageSize, pageNumber) {\r\n return $http.get('/api/Rule/' + ruleId + '/log?pageNumber=' + pageNumber + '&pageSize=' + pageSize).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n saveRule: function(rule) {\r\n return $http.post(\"/api/rule\", rule).then(function(data) {\r\n return data;\r\n });\r\n },\r\n\r\n importRules: function(rules){\r\n return $http.post(\"/api/import/rules\", rules).then(function(data) {\r\n return data;\r\n });\r\n },\r\n\r\n deleteRule: function (id) {\r\n return $http.delete('/api/rule/' + id);\r\n },\r\n\r\n getSQLCommands: function () {\r\n return $http.get('/api/Rule/GetSQLCommands').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getRuleExpressionValues: function(options) {\r\n options = options || { includeDisabled: false, allSites: false };\r\n return PendingService.promise('get rule expression values', () => $http.get('/api/Rule/GetRuleExpressionValues', { params: options }))\r\n .then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getActionExpressionValues: function(options) {\r\n options = options || { includeDisabled: false, allSites: false };\r\n return $http.get('/api/Rule/GetActionExpressionValues', { params: options }).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getPopulations: function(options) {\r\n options = options || { enabledOnly: false, includeAllPatients: true };\r\n return PopulationsRepository.getAll(options);\r\n }\r\n };\r\n}\r\n\r\nangular.module('system.rules').factory('RulesService', RulesService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/rules/rules.tpl.html',\n '

          Rules Engine

          Rules {{rules.length}}
          0\" ng-click=\"vm.clearSearch()\">

          Loading...

          0 || vm.loading\">

          There are no rules setup.

          {{vm.displayProgramName(vm.selectedRule)}}
          {{vm.selectedRule.Display}}
          {{vm.selectedRule.EventName}}

          0\">Else If ({{condition.Condition}}) Then
          {{action.ActionName}}

          Log

          {{log.CreatedDateTime_UTC | date:\\'short\\'}}     Event Data     Patient Data
          {{line}}

          ');\n}]);\n}(window, document, window.angular));","function AddRoleModalController(role, TemplatesService, $uibModalInstance, lodash, SecurityrolesService) {\r\n var vm = this;\r\n vm.role = angular.copy(role);\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n vm.isValid = isValid;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n }\r\n\r\n function addRole( name, securityActivityId, description ) {\r\n var data = {};\r\n data.Name = name;\r\n data.SecurityActivityId = securityActivityId;\r\n data.Description = description;\r\n SecurityrolesService.addRole(data)\r\n\r\n .then(function(entity) {\r\n // entity is SecurityRole object\r\n if(entity!=null){\r\n vm.role.crvm.pushRole(entity);\r\n vm.role.crvm.mapRoleActivities(entity.SecurityRoleId);\r\n vm.role.crvm.setSelectedRole(entity);\r\n $uibModalInstance.close(vm.role);\r\n }\r\n }\r\n )\r\n .catch(function (e) {\r\n if(e.status==300){\r\n vm.isDupError=true;\r\n //sweetAlert(\"Oops...\", \"Two roles cannot be given the same name.\", \"error\");\r\n }\r\n else{\r\n throw e;\r\n }\r\n vm.role.crvm.deleteRole(data.SecurityRoleId);\r\n }\r\n );\r\n }\r\n\r\n function isValid(){\r\n return ( vm.role.Name != undefined && vm.role.Name != \"\" && vm.SecurityActivityId != undefined && !vm.isDupError );\r\n }\r\n\r\n function ok() {\r\n if ( isValid() ) {\r\n addRole( vm.role.Name, vm.SecurityActivityId, vm.Description );\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('system.securityroles').controller('AddRoleModalController', AddRoleModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/securityroles/addrole.modal.html',\n '

          Add New Role

          ');\n}]);\n}(window, document, window.angular));","function SecurityrolesController(SecurityrolesService, PermissionService, $uibModal, $window, vhSweetAlert, lodash) {\r\n var vm = this;\r\n vm.canWrite = PermissionService.userHasPermission([\"SecurityRoleWrite\"]);\r\n vm.securityAccessLevelRead = 0;\r\n vm.securityAccessLevelWrite = 0;\r\n vm.searchText = '';\r\n vm.enableDisableActivity = enableDisableActivity;\r\n vm.mapRoleActivities = mapRoleActivities;\r\n vm.getAbledMapRoles = getAbledMapRoles;\r\n vm.openAddModal = openAddModal;\r\n vm.updateRole = updateRole;\r\n vm.deleteRole = deleteRole;\r\n vm.copyRole = copyRole;\r\n vm.deleteRolePrompt = deleteRolePrompt;\r\n vm.collapsed = true;\r\n vm.canReadItem = canReadItem;\r\n vm.canWriteItem = canWriteItem;\r\n vm.selectRole = selectRole;\r\n vm.securityLevelName = securityLevelName;\r\n vm.pushRole = pushRole;\r\n vm.setSelectedRole = setSelectedRole;\r\n vm.mappermissionGroups = [];\r\n vm.searchType = 'Role';\r\n vm.filterRoles = filterRoles;\r\n vm.exportRoles = exportRoles;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n\r\n vm.canExportRoles = PermissionService.userHasPermission(['SecurityRoleExport']);\r\n\r\n if ( PermissionService.userHasPermission([\"SecurityAccessLevelAdvancedRead\"]) ){\r\n vm.securityAccessLevelRead = 1038;\r\n }\r\n else if ( PermissionService.userHasPermission([\"SecurityAccessLevelModerateRead\"]) ){\r\n vm.securityAccessLevelRead = 1036;\r\n }\r\n else if ( PermissionService.userHasPermission([\"SecurityAccessLevelBasicRead\"]) ){\r\n vm.securityAccessLevelRead = 1034;\r\n }\r\n\r\n if ( PermissionService.userHasPermission([\"SecurityAccessLevelAdvancedWrite\"]) ){\r\n vm.securityAccessLevelWrite = 1039;\r\n }\r\n else if ( PermissionService.userHasPermission([\"SecurityAccessLevelModerateWrite\"]) ){\r\n vm.securityAccessLevelWrite = 1037;\r\n }\r\n else if ( PermissionService.userHasPermission([\"SecurityAccessLevelBasicWrite\"]) ){\r\n vm.securityAccessLevelWrite = 1035;\r\n }\r\n\r\n vm.accessLevels = [\r\n {value: 1034, text: 'Customer'},\r\n {value: 1036, text: 'Vivify Support'},\r\n {value: 1038, text: 'Vivify Development'}\r\n ];\r\n\r\n SecurityrolesService.getAllActivities() //gets data from securityactivity api\r\n .then(function (data) {\r\n vm.activities = data;\r\n vm.activitiesMap = {};\r\n for(var i=0;i 0) {\r\n found = false;\r\n if(vm.searchType === \"Role\") {\r\n found = (value.Name.toLowerCase().indexOf(searchText) != -1);\r\n }\r\n else {\r\n var acts = value.SecurityActivity;\r\n for(var i=0;i (a, b) => a[property] > b[property] ? 1 : a[property] < b[property] ? -1 : 0;\r\n\r\n var roles = vm.roles.slice().sort(sort('Name')).map(x => ({ \r\n Id: x.SecurityRoleId,\r\n Name: x.Name,\r\n Description: x.Description,\r\n Security_Activity_Id: x.SecurityActivityId,\r\n Security_Activity_Name: vm.activities.find(a => a.SecurityActivityId === x.SecurityActivityId).Name,\r\n Security_Activity_Description: vm.activities.find(a => a.SecurityActivityId === x.SecurityActivityId).Description,\r\n Is_API_Only_Role: x.IsAPIOnlyRole,\r\n Is_Deleted: x.IsDeleted,\r\n Is_Reserved: x.IsReserved\r\n }));\r\n\r\n var groups = vm.activities.map(a => a.Group).filter((item, index, self) => self.indexOf(item) === index).sort();\r\n\r\n var permissions = [];\r\n groups.forEach(group => {\r\n\r\n var activities = vm.activities.slice().sort(sort('Name')).filter(x => x.Group === group);\r\n\r\n permissions.push(...activities.map((x, index) => ({ \r\n Group: index === 0 ? group : '',\r\n Id: x.SecurityActivityId,\r\n Name: x.Name,\r\n Description: x.Description\r\n })));\r\n\r\n\r\n });\r\n\r\n var role_permissions = [];\r\n\r\n vm.roles.slice().sort(sort('Name')).forEach(x => {\r\n role_permissions.push(\r\n { \r\n Role_Name: x.Name,\r\n Role_Description: x.Description,\r\n Group: '',\r\n Permission_Name: '',\r\n Permission_Decription: ''\r\n });\r\n\r\n var groups = x.SecurityActivity.map(a => a.Group).filter((item, index, self) => self.indexOf(item) === index).sort();\r\n\r\n groups.forEach(g => {\r\n var activiityIds = x.SecurityActivity.filter(a => a.Group == g).map(a => a.SecurityActivityId);\r\n var activities = vm.activities.slice().sort(sort('Name')).filter(a => activiityIds.indexOf(a.SecurityActivityId) > -1); \r\n \r\n\r\n role_permissions.push(...activities.map((a, index) => ({\r\n Role_Name: '',\r\n Role_Description: '',\r\n Group: index === 0 ? a.Group : '',\r\n Permission_Name: a.Name,\r\n Permission_Decription: a.Description\r\n })));\r\n\r\n });\r\n\r\n }\r\n \r\n );\r\n\r\n var permission_roles = [];\r\n vm.activities.slice().sort(sort('Name')).forEach(x => {\r\n permission_roles.push({\r\n Id: x.SecurityActivityId,\r\n Name: x.Name,\r\n Description: x.Description\r\n });\r\n\r\n var incRoles = vm.roles.filter(r => r.SecurityActivity.find(a => a.SecurityActivityId === x.SecurityActivityId));\r\n\r\n permission_roles.push(...incRoles.sort(sort('Name')).map(r => ({\r\n Id: '',\r\n Name: '', \r\n Description: '',\r\n Roles: r.Name\r\n })));\r\n });\r\n\r\n\r\n \r\n var wb = XLSX.utils.book_new();\r\n\r\n var ws = XLSX.utils.json_to_sheet(roles);\r\n XLSX.utils.book_append_sheet(wb, ws, \"Roles\");\r\n\r\n ws = XLSX.utils.json_to_sheet(permissions);\r\n XLSX.utils.book_append_sheet(wb, ws, \"Permissions\");\r\n \r\n ws = XLSX.utils.json_to_sheet(role_permissions);\r\n XLSX.utils.book_append_sheet(wb, ws, \"Role_Permissions\");\r\n\r\n ws = XLSX.utils.json_to_sheet(permission_roles);\r\n XLSX.utils.book_append_sheet(wb, ws, \"Permission_Roles\");\r\n \r\n /* write workbook and force a download */\r\n XLSX.writeFile(wb, \"roles_permissions.xlsx\");\r\n\r\n }\r\n\r\n}\r\n\r\nangular.module('system.securityroles').controller('SecurityrolesController', SecurityrolesController);\r\n","function SecurityrolesService($http) {\r\n return {\r\n getAllSecurityRoles: function () {\r\n return $http.get('/api/SecurityRole').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getByRoleId: function (roleId) {\r\n return $http.get('/api/SecurityRole/' + roleId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getAllActivities: function() {\r\n return $http.get('/api/SecurityActivity').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n enableActivity: function(roleId, activityId) {\r\n return $http.post('/api/SecurityRole/' + roleId + '/activity/'+ activityId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n removeActivity: function(roleId, activityId) {\r\n return $http.delete('/api/SecurityRole/' + roleId + '/activity/'+ activityId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n updateRole: function(roleId, role) {\r\n return $http.put('/api/SecurityRole/' + roleId, role).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n addRole: function(role) {\r\n return $http.post('/api/SecurityRole', role).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n deleteRole: function(roleId) {\r\n return $http.delete('/api/SecurityRole/' + roleId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('SecurityrolesService', SecurityrolesService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/securityroles/securityroles.tpl.html',\n '

          Security Roles

          1. Viewing {{vm.roles.length}}

           {{role.Name || \\'Unlabeled Role\\'}}

          {{vm.selectedRole.Name}}
          {{vm.selectedRole.Description || \\'No description\\'}}
          {{ vm.securityLevelName(vm.selectedRole.SecurityActivityId)}} Access

          Enabled activities

          {{group}}

          {{activity.Name | pascalSpacing}}

           No enabled activities.

          Disabled activities
          {{group}}

          {{activity.Name | pascalSpacing}}

           No disabled activies.

          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelService($http) {\r\n\r\n return {\r\n get: get,\r\n getTypes: getTypes,\r\n getConfigs: getConfigs,\r\n update: update,\r\n updateAll: updateAll\r\n };\r\n\r\n function getTypes() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/ServiceLevelType'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function get() {\r\n return $http({\r\n method: 'GET',\r\n url: '/api/ServiceLevel'\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function getConfigs() {\r\n return $http.get('/api/configuration/ServiceLevel')\r\n .then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function update(serviceLevelId, serviceLevel) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/ServiceLevel/' + serviceLevelId,\r\n data: serviceLevel\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateAll(serviceLevels) {\r\n return $http({\r\n method: 'POST',\r\n url: '/api/ServiceLevel',\r\n data: serviceLevels\r\n }).then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module('system.serviceLevels').factory('ServiceLevelService', ServiceLevelService)\r\n","function ServiceLevelEditDirective(ServiceLevelService, SettingsService, ServiceLevelType) {\r\n return {\r\n restrict: \"E\",\r\n templateUrl: \"modules/system/serviceLevel/serviceLevelEdit.tpl.html\",\r\n scope: {\r\n model: \"=serviceLevel\",\r\n readOnly: \"=\",\r\n onUpdated: \"&\"\r\n },\r\n bindToController: true,\r\n controllerAs: \"vm\",\r\n controller: function ($scope, lodash, vhSweetAlert) {\r\n var vm = this;\r\n vm.canEdit = !vm.readOnly;\r\n vm.defaultSettings = [];\r\n vm.serviceLevel = null;\r\n vm.ServiceLevelType = ServiceLevelType;\r\n \r\n vm.toggle = toggle;\r\n vm.save = save;\r\n vm.cancel = cancel;\r\n vm.changeType = changeType;\r\n\r\n $scope.$watch('vm.model', function(newValue, oldValue) {\r\n if ($scope.serviceLevelForm.$dirty) {\r\n cancel();\r\n } else {\r\n vm.serviceLevel = angular.copy(newValue);\r\n applyConfig();\r\n }\r\n });\r\n\r\n ServiceLevelService.getTypes().then(function(types) {\r\n vm.serviceLevelTypes = types;\r\n });\r\n\r\n ServiceLevelService.getConfigs().then(function(configs) {\r\n vm.defaultSettings = configs;\r\n applyConfig();\r\n });\r\n \r\n function applyConfig() {\r\n if (vm.defaultSettings.length > 0) {\r\n // merge defaultSettings with existing config list\r\n var merged = lodash(lodash.cloneDeep(vm.defaultSettings))\r\n .concat(vm.serviceLevel.Configurations)\r\n .groupBy(\"ConfigurationId\")\r\n .map(lodash.spread(lodash.merge))\r\n .value();\r\n\r\n vm.serviceLevel.Configurations = merged;\r\n }\r\n }\r\n\r\n function toggle(prop) {\r\n if (vm.canEdit) {\r\n let disabledEdit = false;\r\n switch (prop) {\r\n case 'PhoneNumRequired':\r\n case 'EmailRequired':\r\n disabledEdit = vm.serviceLevel.PhoneOrEmailRequired;\r\n break;\r\n case 'PhoneOrEmailRequired':\r\n disabledEdit = (vm.serviceLevel.PhoneNumRequired || vm.serviceLevel.EmailRequired)\r\n break;\r\n }\r\n if (!disabledEdit) {\r\n vm.serviceLevel[prop] = !vm.serviceLevel[prop];\r\n $scope.serviceLevelForm.$setDirty();\r\n }\r\n }\r\n }\r\n \r\n function cancel() {\r\n vm.serviceLevel = angular.copy(vm.model);\r\n applyConfig();\r\n $scope.serviceLevelForm.$setPristine();\r\n }\r\n\r\n function save() {\r\n if($scope.serviceLevelForm.$valid && vm.canEdit) {\r\n ServiceLevelService.update(vm.serviceLevel.ServiceLevelId || 0, vm.serviceLevel).then(function(data){\r\n $scope.serviceLevelForm.$setPristine();\r\n vm.serviceLevel = data;\r\n vm.model = data;\r\n vm.onUpdated(data);\r\n });\r\n }\r\n }\r\n\r\n function changeType(){\r\n var serviceLevelType = lodash.find(vm.serviceLevelTypes, {'ServiceLevelTypeId': vm.serviceLevel.ServiceLevelTypeId});\r\n\r\n vm.serviceLevel.Icon = serviceLevelType.DefaultIcon;\r\n vm.serviceLevel.DescriptionText = serviceLevelType.DefaultDescriptionText;\r\n vm.serviceLevel.LongDescriptionText = serviceLevelType.DefaultLongDescriptionText;\r\n }\r\n }\r\n };\r\n}\r\n\r\nangular.module('system.serviceLevels').directive('serviceLevelEdit', ServiceLevelEditDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/serviceLevel/serviceLevelEdit.tpl.html',\n '
          {{vm.serviceLevel.DisplayText}}
          General
          Required
          Required
          Configuration
          ');\n}]);\n}(window, document, window.angular));","function ServiceLevelListCtrl(ServiceLevels, lodash, ServiceLevelService, PermissionService) {\r\n var vm = this;\r\n\r\n vm.canEdit = PermissionService.userHasPermission(['SystemServiceLevelWrite']);\r\n vm.serviceLevels = ServiceLevels;\r\n vm.selectServiceLevel = selectServiceLevel;\r\n vm.newServiceLevel = newServiceLevel;\r\n vm.refresh = refresh;\r\n vm.getIconClass = getIconClass;\r\n\r\n activate();\r\n\r\n function activate() {\r\n refreshServiceLevels();\r\n }\r\n\r\n function refreshServiceLevels() {\r\n vm.serviceLevels = lodash.sortBy(vm.serviceLevels, 'SortOrder');\r\n\r\n vm.dragListeners = {\r\n contain: '#serviceLevels',\r\n orderChanged: orderChanged,\r\n accept: accept\r\n };\r\n }\r\n\r\n function newServiceLevel() {\r\n vm.currentServiceLevel = {};\r\n }\r\n\r\n function selectServiceLevel(serviceLevel) {\r\n vm.currentServiceLevel = serviceLevel;\r\n }\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n \r\n list.map(function(listItem, index){\r\n listItem.SortOrder = index;\r\n return listItem;\r\n });\r\n\r\n updateAllServiceLevels(list);\r\n }\r\n\r\n function updateAllServiceLevels(list) {\r\n ServiceLevelService.updateAll(list);\r\n }\r\n\r\n function refresh() {\r\n ServiceLevelService.get().then(function(data){\r\n vm.serviceLevels = data;\r\n vm.currentServiceLevel = lodash.find(vm.serviceLevels, {'ServiceLevelId': vm.currentServiceLevel.ServiceLevelId});\r\n\r\n refreshServiceLevels()\r\n });\r\n }\r\n\r\n function accept(sourceItemHandleScope, destSortableScope, destItemScope) {\r\n return vm.canEdit && sourceItemHandleScope.sortableScope.modelValue[0].SiteId === destSortableScope.modelValue[0].SiteId;\r\n }\r\n\r\n function getIconClass(icon) {\r\n if (icon == null) return '';\r\n if (icon.startsWith('fa-')) {\r\n return 'fa ' + icon;\r\n } else if (icon.startsWith('vh-ui')) {\r\n return 'vh-ui-glyph ' + icon;\r\n }\r\n }\r\n}\r\n\r\nangular.module('system.serviceLevels').controller('ServiceLevelListCtrl', ServiceLevelListCtrl);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/serviceLevel/serviceLevelList.tpl.html',\n '

          Service Levels

          {{serviceLevel.DisplayText}} {{serviceLevel.ServiceLevelType_Enum.Name}}
          {{serviceLevel.DescriptionText}}

          Select or add a service level

          ');\n}]);\n}(window, document, window.angular));","function EditSettingController(setting, SettingsService, PermissionService, $uibModalInstance, ConfigurationsService,vhSweetAlert) {\r\n var vm = this;\r\n\r\n var defalutValue = setting.Value;\r\n\r\n vm.setting = setting;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.canEditSettings = PermissionService.userHasPermission([\"ConfigurationsWrite\"]);\r\n vm.saveSetting = saveSetting;\r\n vm.cancelEditing = cancelEditing;\r\n }\r\n\r\n function saveSetting(isValid) {\r\n if(isValid) {\r\n if((setting.Title == 'GoUseAgreementTypeWorkflow' || setting.Title == 'HomeUseAgreementsTypeWorkflow')&& defalutValue == \"False\" && setting.Value == \"True\") {\r\n showAgreementWarning();\r\n } else {\r\n save();\r\n }\r\n }\r\n }\r\n\r\n function save() {\r\n SettingsService.saveSetting(setting).then(function(savedSetting) {\r\n if(savedSetting){\r\n $uibModalInstance.close(setting);\r\n ConfigurationsService.clearPortalConfig();\r\n }\r\n else {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n });\r\n }\r\n\r\n function cancelEditing() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function showAgreementWarning() {\r\n vhSweetAlert.verify('Are you sure?', ' Please verify that all agreement types have been entered as default settings before proceeding.', 'Yes')\r\n .then(function (isConfirm) {\r\n if (isConfirm) {\r\n save(); \r\n } else {\r\n cancelEditing() ;\r\n }\r\n });\r\n }\r\n \r\n}\r\n\r\nangular.module('system.settings').controller('EditSettingController', EditSettingController);\r\n","function SettingValueInput($compile, $window, SettingsService) {\r\n function linker(scope, element, attrs) {\r\n configureTools(scope);\r\n\r\n scope.$watch('model', function render(newModel, oldModel) {\r\n var template = getTemplate(scope.model.ConfigurationDataTypeId, scope.model.ValidValues, scope);\r\n var input = $compile(template)(scope);\r\n element.replaceWith(input);\r\n }, false);\r\n }\r\n\r\n function configureTools(scope) {\r\n if ($window.FileReader === undefined) {\r\n scope.tools = [\r\n ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'],\r\n ['bold', 'italics', 'underline'],\r\n ['ul', 'ol'],\r\n ['justifyLeft', 'justifyCenter', 'justifyRight'],\r\n ['fontColor']\r\n ];\r\n } else {\r\n scope.tools = [\r\n ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'],\r\n ['bold', 'italics', 'underline'],\r\n ['ul', 'ol'],\r\n ['justifyLeft', 'justifyCenter', 'justifyRight'],\r\n ['fontColor', 'insertImage']\r\n ];\r\n }\r\n }\r\n\r\n function getTemplate(type, validValues, scope) {\r\n var retVal = '';\r\n\r\n var typeMap = SettingsService.settingTypeMap;\r\n\r\n switch (type) {\r\n case typeMap.int:\r\n case typeMap.double:\r\n case typeMap.onedecimal:\r\n if (validValues.length > 0) {\r\n var minMax = validValues.split(',');\r\n retVal = ' 0) {\r\n var options = validValues.split(',');\r\n var html = ['');\r\n retVal = html.join('');\r\n }\r\n break;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n model: '=ngModel',\r\n },\r\n link: linker\r\n };\r\n}\r\n\r\nangular.module('system.settings').directive('settingValueInput', SettingValueInput);\r\n","function StringToNumber()\r\n{\r\n return {\r\n require: 'ngModel',\r\n link: function(scope, element, attrs, ngModel) {\r\n ngModel.$parsers.push(function(value) {\r\n return '' + value;\r\n });\r\n ngModel.$formatters.push(function(value) {\r\n return parseFloat(value, 10);\r\n });\r\n }\r\n };\r\n}\r\n\r\nangular.module('system.settings').directive('stringToNumber', StringToNumber);\r\n","function InstallController(SettingsService, PermissionService, mediaPaths, settings, lodash, $uibModalInstance, $window) {\r\n var vm = this;\r\n vm.canEditSettings = PermissionService.userHasPermission([\"ConfigurationsWrite\"]);\r\n vm.canMediaWrite = PermissionService.userHasPermission([\"MediaWrite\"]);\r\n vm.mediaPaths = mediaPaths;\r\n vm.message = '';\r\n vm.portalUrlConfig = lodash.find(settings, function(o) { return o.Param == 'PortalUrl'; });\r\n vm.instanceIdConfig = lodash.find(settings, function(o) { return o.Param == 'InstanceIdent'; });\r\n vm.disableUpdateVid = false;\r\n \r\n vm.done = function() {\r\n $uibModalInstance.dismiss('done');\r\n }\r\n\r\n vm.createMediaPaths = function() {\r\n SettingsService.createMediaPaths().then(function(data) { vm.mediaPaths = data; });\r\n }\r\n\r\n vm.updateVideoLength = function() {\r\n SettingsService.updateVideoLength();\r\n vm.disableUpdateVid = true;\r\n vm.message = 'Careplan Video lengths are being updated.';\r\n }\r\n\r\n vm.savePortalConfig = function(configModel) {\r\n\tif (configModel.Param == 'InstanceIdent') {\r\n\t\tif (Number.isInteger(Number(vm.instanceIdConfig.Value)) && vm.instanceIdConfig.Value >= 100000 && vm.instanceIdConfig.Value <= 999999) {\r\n\t\t\tSettingsService.saveSetting(configModel).then(function(data) { vm.message = data == true ? configModel.Param + ' saved.' : 'save failed'; });\r\n\t\t} else {\r\n\t\t\tvm.message = configModel.Param + ' save failed, must be number between 100000 and 999999.';\t\r\n\t\t}\r\n\t} else {\r\n\t\tSettingsService.saveSetting(configModel).then(function(data) { vm.message = data == true ? configModel.Param + ' saved.' : 'save failed'; });\r\n\t}\r\n }\r\n}\r\n\r\nangular.module('system.settings').controller('InstallController', InstallController)","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/settings/install.modal.html',\n '

          Install

          {{vm.message}}

          Videos

          Directory Access

          {{item.Path}} {{item.AccessMessage}}
          ');\n}]);\n}(window, document, window.angular));","/* This controller is used by both System/Settings and Site/Settings */\r\nfunction SettingsController(isSiteSettings, SettingsService, PermissionService, $uibModal, $window) {\r\n var vm = this;\r\n vm.isSiteSettings = isSiteSettings;\r\n vm.pageTitle = isSiteSettings ? \"Site Settings\" : \"System Settings\";\r\n var hasConfigurationsWrite = PermissionService.userHasPermission([\"ConfigurationsWrite\"]);\r\n var hasAdvancedConfigurationsWrite = PermissionService.userHasPermission([\"AdvancedConfigurationsWrite\"]);\r\n vm.canEditSetting = canEditSetting;\r\n vm.toggleHead = toggleHead;\r\n vm.getDescription = getDescription;\r\n vm.editSetting = editSetting;\r\n vm.listLoading = false;\r\n vm.filter = \"\";\r\n vm.expanded = \"Collapse All\";\r\n vm.toggleExpandAll = toggleExpandAll;\r\n vm.searchvalue = searchvalue;\r\n vm.searchhead = searchhead;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n vm.listLoading = true;\r\n var promise;\r\n\r\n if (isSiteSettings) {\r\n promise = SettingsService.getSiteSettings();\r\n } else {\r\n promise = SettingsService.getSystemSettings();\r\n }\r\n\r\n promise.then((data) => {\r\n vm.listLoading = false;\r\n vm.settings = data;\r\n vm.heads = mapHeaders(data);\r\n vm.headList = Object.keys(vm.heads).sort();\r\n vm.sortedHeads = [];\r\n for (var i = 0; i < vm.headList.length; ++i) {\r\n vm.sortedHeads.push({\r\n name: vm.headList[i],\r\n obj: vm.heads[vm.headList[i]]\r\n });\r\n }\r\n vm.canEditSettings = canEditSettings();\r\n });\r\n }\r\n\r\n\r\n function toggleExpandAll(head,headList){\r\n vm.listLoading = true;\r\n var expandOrUnexpand = false;\r\n if(vm.expanded == \"Collapse All\") {\r\n expandOrUnexpand = true;\r\n vm.expanded = \"Expand All\";\r\n } else { vm.expanded = \"Collapse All\"; }\r\n\r\n for(i = 0; i < headList.length;++i) {\r\n head[headList[i]].visible = expandOrUnexpand;\r\n }\r\n vm.listLoading = false;\r\n }\r\n \r\n \r\n function mapHeaders(settings) {\r\n var heads = {};\r\n for (var i = 0; i < settings.length; i++) {\r\n if (heads[settings[i].Name] == undefined) {\r\n heads[settings[i].Name] = [];\r\n }\r\n heads[settings[i].Name].push({\r\n visible: false,\r\n obj: settings[i]\r\n });\r\n }\r\n return heads;\r\n }\r\n\r\n function canEditSetting(setting){\r\n var retVal = false;\r\n\r\n switch(setting.SecurityActivityId) {\r\n case 1001:\r\n retVal = hasConfigurationsWrite;\r\n break;\r\n case 1019:\r\n retVal = hasAdvancedConfigurationsWrite;\r\n break;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function toggleHead(head) {\r\n head.visible = !head.visible;\r\n }\r\n\r\n // returns true if either the value.name ame or nested value.obj.Param properties contains the search term.\r\n function searchhead(value, index, array) {\r\n if ( vm.filter.length > 0 ){\r\n var filter = vm.filter.toUpperCase().replace(/ /g,'');\r\n var str = value.name.toUpperCase().replace(/ /g,'');\r\n if (str.indexOf(filter) !== -1) {\r\n return true;\r\n } else {\r\n for(var i = 0; i < value.obj.length; ++i){\r\n var param = value.obj[i].obj.Param.toUpperCase().replace(/ /g,'');\r\n if(param.indexOf(filter) !== -1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n\r\n // (VIVY-5542) returns true if either the Name or Param properties contains the search term.\r\n function searchvalue(value, index, array) {\r\n if ( vm.filter.length > 0 ){\r\n var filter = vm.filter.toUpperCase().replace(/ /g,'');\r\n var str = value.obj.Param.toUpperCase().replace(/ /g,'');\r\n var name = value.obj.Name.toUpperCase().replace(/ /g,'');\r\n if (str.indexOf(filter) !== -1) {\r\n return true;\r\n } else if (name.indexOf(filter) !== -1) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n function canEditSettings() {\r\n var retVal = false;\r\n\r\n for(var i = 0; i < vm.settings.length; i++) {\r\n retVal = canEditSetting(vm.settings[i]);\r\n if(retVal === true) {\r\n break;\r\n }\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function editSetting(setting) {\r\n setting.Title = setting.Param;\r\n for (var i = 0; i < vm.settings.length; i++) {\r\n if (vm.settings[i].Param == setting.Param + 'Title') {\r\n setting.Title = vm.settings[i].Value;\r\n break;\r\n }\r\n }\r\n \r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/settings/settings.modal.html',\r\n controller: 'EditSettingController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n setting: function () {\r\n return angular.copy(setting);\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(updatedSetting) {\r\n setting.Value = updatedSetting.Value;\r\n });\r\n }\r\n\r\n function getDescription(setting) {\r\n var retVal = 'No description.';\r\n\r\n if(setting.Description) {\r\n if (setting.Description !== null && setting.Description !== undefined){\r\n retVal = setting.Description;\r\n }\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n vm.refresh = function(){\r\n vm.listLoading = true;\r\n SettingsService.refreshCache()\r\n .then(function (data) {\r\n vm.listLoading = false;\r\n vm.settings = data;\r\n vm.heads = mapHeaders(data);\r\n vm.headList = Object.keys(vm.heads).sort();\r\n vm.sortedHeads = [];\r\n for(var i = 0; i

          {{vm.setting.Title | pascalSpacing}}

          {{vm.setting.Description}}

          ');\n}]);\n}(window, document, window.angular));","function SettingsService(ConfigurationRepository, $http) {\r\n return {\r\n getSystemSettings: function () {\r\n var promise = ConfigurationRepository.getSystemConfigurations();\r\n return promise;\r\n },\r\n\r\n getSiteSettings: function () {\r\n var promise = ConfigurationRepository.getSiteConfigurations();\r\n return promise.then(response => response.filter(cfg => cfg.SurveyQuestionTypeId == null)); // filter out biometric settings\r\n },\r\n\r\n refreshCache: function () {\r\n var promise = ConfigurationRepository.refresh();\r\n return promise;\r\n },\r\n\r\n saveSetting: function (setting) {\r\n var promise = ConfigurationRepository.save(setting);\r\n return promise;\r\n },\r\n\r\n getMediaPaths: function() {\r\n return ConfigurationRepository.getMediaPaths();\r\n },\r\n\r\n createMediaPaths: function() {\r\n return ConfigurationRepository.createMediaPaths();\r\n },\r\n\r\n updateVideoLength: function() {\r\n return $http.post('/api/media/UpdateVideoLength').then(function(res) {\r\n return res;\r\n });\r\n },\r\n\r\n settingTypeMap: {\r\n int: 1,\r\n bool: 2,\r\n datetime: 3,\r\n string: 4,\r\n html: 5,\r\n email: 6,\r\n phone: 7,\r\n double: 8,\r\n url: 9,\r\n filepath: 10,\r\n onedecimal: 11,\r\n password: 12\r\n }\r\n };\r\n}\r\n\r\nangular.module('system.settings').factory('SettingsService', SettingsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/settings/settings.tpl.html',\n '

          {{vm.pageTitle}}

          0\" class=\"table table-bordered\">
          {{head.name}}
          {{setting.obj.Param | pascalSpacing}}{{setting.obj.Value}} ******************
          ');\n}]);\n}(window, document, window.angular));","function AddSiteModalController(site, SitesService, $uibModalInstance, lodash) {\r\n var vm = this;\r\n vm.site = angular.copy(site);\r\n vm.ok = ok;\r\n vm.cancel = cancel;\r\n\r\n function addSite() {\r\n if (vm.site.SiteId) {\r\n SitesService.saveSite(vm.site).then(function (entity) {\r\n if (entity != null) {\r\n $uibModalInstance.close(vm.site);\r\n }\r\n });\r\n } else {\r\n SitesService.newSite(vm.site).then(function (entity) {\r\n if (entity != null) {\r\n $uibModalInstance.close(vm.site);\r\n }\r\n });\r\n }\r\n }\r\n\r\n function isValid() {\r\n return (vm.site.Name != undefined && vm.site.Name != \"\");\r\n }\r\n\r\n function ok() {\r\n if (isValid()) {\r\n addSite();\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\nangular.module('system.sites').controller('AddSiteModalController', AddSiteModalController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/sites/addsite.modal.html',\n '

          Add New Site Update Site

          ');\n}]);\n}(window, document, window.angular));","function SitesController(SitesService, $rootScope, $state, $uibModal, vhSweetAlert, lodash) {\r\n var vm = this;\r\n vm.AddSite = AddSite;\r\n vm.Sites = [];\r\n vm.selectedSite = null;\r\n vm.selectSite = selectSite;\r\n\r\n loadController();\r\n function loadController() {\r\n SitesService.getAllSites().then(function (data) {\r\n vm.Sites = data;\r\n });\r\n }\r\n\r\n function selectSite(site){\r\n vm.selectedSite = site;\r\n }\r\n\r\n\r\n function AddSite(site) {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/sites/addsite.modal.html',\r\n controller: 'AddSiteModalController as vm',\r\n keyboard: false,\r\n resolve: {\r\n site: function() {\r\n return site || { Name: '', Description: '' };\r\n }\r\n }\r\n })\r\n .result.then(function(result) {\r\n var idx = lodash.indexOf(vm.Sites, lodash.find(vm.Sites, {SiteId: result.SiteId}));\r\n if(idx > -1) {\r\n vm.Sites.splice(idx, 1);\r\n }\r\n vm.Sites.push(result);\r\n });\r\n } \r\n}\r\n\r\nangular.module('system.sites').controller('SitesController', SitesController);","function SitesService($http) {\r\n return {\r\n getAllSites: function () {\r\n return $http.get(\"/api/site\").then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n getSite: function (siteId) {\r\n return $http.get(\"/api/site/\"+siteId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n saveSite: function (data) {\r\n return $http.put('/api/site/' + data.SiteId, data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n deleteSite: function (siteId) {\r\n return $http.delete('/api/site/' + siteId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n \r\n newSite: function (data) {\r\n return $http.post('/api/site/', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n };\r\n }\r\n angular.module(\"system.sites\").factory(\"SitesService\", SitesService);\r\n ","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/sites/sites.tpl.html',\n '

          Sites

          Hmm... no sites here yet.

           {{site.Name}}

          ');\n}]);\n}(window, document, window.angular));","function AddSlideshowImageController($uibModalInstance, currentList, SlideshowService, lodash) {\r\n vm = this;\r\n\r\n vm.fileUploader = SlideshowService.getFileUploader();\r\n\r\n var theFile;\r\n var noNameError = {text: \"Image name required\", type: 'danger'};\r\n var nameLengthError = {text: \"Image name must be 50 characters or less\", type: 'danger'};\r\n var fileNameValidationError = {text: \"File name has illegal characters.\", type: 'danger'};\r\n var fileNameExistsError = {text: 'File name already exists.', type: 'danger'};\r\n\r\n vm.cancel = cancel;\r\n vm.ok = ok;\r\n vm.changed = changed;\r\n vm.slideshowImageName = '';\r\n\r\n vm.fileUploader.onAfterAddingFile = function(fileItem) {\r\n var fileName = fileItem.file.name;\r\n\r\n if (fileName.length > 20) {\r\n fileName = fileName.slice(0,20);\r\n fileName += '...';\r\n }\r\n vm.fileName = fileName;\r\n vm.alerts = [];\r\n if (theFile) {\r\n vm.fileUploader.removeFromQueue(theFile);\r\n }\r\n\r\n if(vm.slideshowImageName.length === 0) {\r\n vm.slideshowImageName = fileName;\r\n }\r\n\r\n if(!validate()) {\r\n return;\r\n }\r\n\r\n theFile = fileItem;\r\n theFile.onProgress = function (progress) {\r\n if (progress == 100) {\r\n progress = 99;\r\n }\r\n vm.progress = progress;\r\n };\r\n\r\n theFile.onSuccess = function (response, status, headers) {\r\n $uibModalInstance.close(response);\r\n };\r\n\r\n theFile.onError = function (response, status, headers) {\r\n var errorText;\r\n if (vm.isIENine) {\r\n errorText = response;\r\n } else {\r\n errorText = response.ErrorMessage;\r\n }\r\n vm.alerts = [{text: errorText, type: 'danger'}];\r\n };\r\n };\r\n\r\n vm.fileUploader.onWhenAddingFileFailed = function(item, filter, options) {\r\n vm.fileUploader.clearQueue();\r\n theFile = null;\r\n vm.fileName = null;\r\n var alertText;\r\n if (filter.name == \"typeFilter\") {\r\n alertText = \"Could not add image. File must be an image format\";\r\n } else if (filter.name == \"sizeFilter\") {\r\n alertText = \"Could not add image. File size must be less than 50MB\";\r\n } else if (filter.name == \"emptyFilter\") {\r\n alertText = \"Cannot upload an empty file.\";\r\n }\r\n vm.alerts = [{text: alertText, type: 'danger'}];\r\n };\r\n\r\n function changed () {\r\n vm.alerts = [];\r\n validate();\r\n }\r\n\r\n function validate() {\r\n var retVal = true;\r\n\r\n if (!isValidFileName(vm.slideshowImageName)) {\r\n vm.alerts.push(fileNameValidationError);\r\n retVal = false;\r\n }\r\n\r\n if(isFilenameExists(vm.slideshowImageName)) {\r\n vm.alerts.push(fileNameExistsError);\r\n retVal = false;\r\n }\r\n\r\n if(vm.slideshowImageName.length > 50) {\r\n vm.alerts.push(nameLengthError);\r\n retVal = false;\r\n }\r\n\r\n if(vm.slideshowImageName.length === 0) {\r\n vm.alerts.push(noNameError);\r\n retVal = false;\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function cancel() {\r\n if(vm.fileUploader.uploading) {\r\n vm.fileUploader.cancelAll();\r\n }\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function ok() {\r\n if(vm.slideshowImageName.length > 50) {\r\n vm.alerts.push(nameLengthError);\r\n return;\r\n }\r\n\r\n if(validate()) {\r\n var resourceName = vm.slideshowImageName.split('.')[0],\r\n fileParts = theFile.file.name.split('.'),\r\n fileExtention = fileParts[fileParts.length -1]\r\n\r\n theFile.formData = [{ResourceScope: 'custom', ResourceType: 'Slideshow', ResourceName: resourceName + '.' + fileExtention }];\r\n theFile.upload();\r\n }\r\n }\r\n\r\n function isValidFileName(name) {\r\n var fileNameRegEx = /^[A-Za-z0-9\\._-]*$/;\r\n return fileNameRegEx.test(name);\r\n }\r\n\r\n function isFilenameExists(name) {\r\n var _name = name.split('.')[0];\r\n var list = currentList.map(function(image){\r\n return image.ImageName.split('.')[0];\r\n });\r\n\r\n return list.indexOf(_name) > -1;\r\n }\r\n}\r\n\r\nangular.module('system.slideshow').controller('AddSlideshowImageController', AddSlideshowImageController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/slideshow/addSlideshowImage.modal.html',\n '

          Add Image to Slideshow

          {{alert.text}}
          {{vm.progress}}%
          ');\n}]);\n}(window, document, window.angular));","function SlideshowController($timeout, $uibModal, $state, $sce, SlideshowService, PermissionService) {\r\n vm = this;\r\n\r\n vm.activeSearch = false;\r\n vm.currentPage = 1;\r\n vm.pageSize = 20;\r\n vm.total = 0;\r\n vm.searchText = '';\r\n vm.searchPlaceholder = 'Search';\r\n\r\n vm.addSlideshowImageModal = addSlideshowImageModal;\r\n vm.cancelSearch = cancelSearch;\r\n vm.highlight = highlight;\r\n vm.search = search;\r\n vm.selectItem = selectItem;\r\n vm.canEdit = PermissionService.userHasPermission(['MediaWrite']);\r\n\r\n\r\n loadController();\r\n function loadController() {\r\n getSlideshowImages();\r\n }\r\n\r\n function addSlideshowImageModal() {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/slideshow/addSlideshowImage.modal.html',\r\n controller: 'AddSlideshowImageController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n currentList: function() {\r\n return vm.images;\r\n }\r\n }\r\n });\r\n \r\n modalInstance.result.then(function(result){\r\n $state.go('system.slideshow', undefined, {reload: true});\r\n }, function(){\r\n $state.go('system.slideshow', undefined, {reload: true}); \r\n });\r\n }\r\n\r\n function search () {\r\n vm.activeSearch = true;\r\n vm.currentPage = 1;\r\n }\r\n function cancelSearch () {\r\n vm.searchText = '';\r\n vm.activeSearch = false;\r\n }\r\n\r\n function highlight (text) {\r\n if (vm.activeSearch && vm.searchText.length > 0) {\r\n return $sce.trustAsHtml(text.replace(new RegExp(vm.searchText, 'gi'), '$&'));\r\n } else {\r\n return $sce.trustAsHtml(text);\r\n }\r\n }\r\n\r\n function getSlideshowImages() {\r\n SlideshowService.get().then(function(data){\r\n vm.images = data;\r\n vm.total = data.length;\r\n\r\n });\r\n }\r\n\r\n function selectItem(image) {\r\n vm.selectedImage = image;\r\n }\r\n \r\n\r\n}\r\n\r\nangular.module('system.slideshow').controller('SlideshowController', SlideshowController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/slideshow/slideshow.tpl.html',\n '

          Slideshow Images

          No results returned

            1\" previous-text=\"‹\" next-text=\"›\" first-text=\"«\" last-text=\"»\">
          ');\n}]);\n}(window, document, window.angular));","function SmsController(SmsService, lodash) {\r\n var vm = this;\r\n vm.selectedEncoding = \"gsm\";\r\n vm.allEncodings = [\"auto\", \"gsm\", \"ucs2\"];\r\n vm.smsSegments = [];\r\n vm.phone = \"\";\r\n vm.Page = 1;\r\n vm.tab = 1;\r\n vm.PageSize = 200;\r\n\r\n\r\n vm.sms = {\r\n Message: \"\",\r\n PatientPhoneNum: \"\"\r\n };\r\n\r\n vm.sendSms = function () {\r\n SmsService.sendSms(vm.sms);\r\n };\r\n\r\n var segmenter = {\r\n gsm: segmentWith(160, 153, encodeCharGsm),\r\n ucs2: segmentWith(140, 134, encodeCharUtf16),\r\n auto: function (s) { return segmenter[pickencoding(s)](s); },\r\n } \r\n\r\n vm.testMsg = function(){\r\n vm.sms.Message = \"GSM 03.38 includes some accented characters such as ñ, à, and ö, but does not include others such as á, í, or ú or “fancy quotes like these”\";\r\n vm.messageChanged();\r\n }\r\n\r\n vm.messageChanged = function () {\r\n var inputCharacters = unicodeCharacters(vm.sms.Message);\r\n vm.selectedEncoding = vm.pickencoding(inputCharacters);\r\n vm.smsSegments = segmenter[vm.selectedEncoding](angular.copy(inputCharacters));\r\n }\r\n\r\n function segmentWith(maxSingleSegmentSize, maxConcatSegmentSize, doEncode) {\r\n return function (listOfUnichrs) {\r\n var bytes = map(listOfUnichrs, doEncode);\r\n\r\n if (listOfUnichrs.length == 0) {\r\n return [];\r\n } else if ([].concat.apply([], bytes).length <= maxSingleSegmentSize) {\r\n return [{ text: listOfUnichrs, bytes: bytes }];\r\n }\r\n\r\n var segments = []\r\n while (listOfUnichrs.length > 0) {\r\n var segment = { text: [], bytes: [] };\r\n var length = 0;\r\n function nextChrLen() {\r\n return bytes[0] === undefined ? length : length + bytes[0].length;\r\n }\r\n while (listOfUnichrs.length > 0 && nextChrLen() <= maxConcatSegmentSize) {\r\n var c = listOfUnichrs.shift()\r\n var b = bytes.shift();\r\n segment.text.push(c);\r\n segment.bytes.push(b);\r\n if (b != undefined) length += b.length;\r\n }\r\n segments.push(segment);\r\n }\r\n return segments;\r\n }\r\n }\r\n\r\n /**\r\n Encode a single (unicode) character into UTF16 \"bytes\"\r\n A single unicode character may be 2 javascript characters\r\n */\r\n function encodeCharUtf16(char) {\r\n return concatMap(char, function (c) {\r\n return [((0xff00 & c.charCodeAt(0)) >> 8), 0x00ff & c.charCodeAt(0)];\r\n });\r\n };\r\n\r\n /**\r\n Encode a single character into GSM0338 \"bytes\"\r\n */\r\n function encodeCharGsm(char) {\r\n return unicodeToGsm[char.charCodeAt(0)];\r\n };\r\n\r\n function _encodeEachWith(doEncode) {\r\n return function (s) {\r\n return map(unicodeCharacters(s), doEncode);\r\n }\r\n };\r\n\r\n function concatMap(sub, func) {\r\n return [].concat.apply([], map(sub, func));\r\n };\r\n\r\n vm.pickencoding = function (s) {\r\n // choose gsm if possible otherwise ucs2\r\n if (unicodeCodePoints(s).every(function (x) { return x in unicodeToGsm })) {\r\n return \"gsm\";\r\n } else {\r\n return \"ucs2\";\r\n }\r\n };\r\n\r\n /**\r\n take a string and return a list of the unicode codepoints\r\n */\r\n function unicodeCodePoints(string) {\r\n var charCodes = map(string, function (x) { return x.charCodeAt(0); });\r\n var result = [];\r\n while (charCodes.length > 0) {\r\n if (isHighSurrogate(charCodes[0])) {\r\n var high = charCodes.shift();\r\n var low = charCodes.shift();\r\n result.push(((high - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000)\r\n } else {\r\n result.push(charCodes.shift());\r\n }\r\n }\r\n return result;\r\n };\r\n\r\n function map(sub, func) {\r\n return [].map.apply(sub, [func])\r\n };\r\n\r\n function isHighSurrogate(c) {\r\n var codeUnit = (c.charCodeAt != undefined) ? c.charCodeAt(0) : c;\r\n return codeUnit >= 0xD800 && codeUnit <= 0xDBFF;\r\n };\r\n\r\n\r\n /**\r\n take a string and return a list of the unicode characters\r\n */\r\n function unicodeCharacters(string) {\r\n var chars = map(string, id);\r\n var result = [];\r\n while (chars.length > 0) {\r\n if (isHighSurrogate(chars[0])) {\r\n result.push(chars.shift() + chars.shift())\r\n } else {\r\n result.push(chars.shift());\r\n }\r\n }\r\n return result;\r\n };\r\n\r\n function id(x) { \r\n return x; \r\n }; \r\n\r\n vm.isInGsmCodeSet = function (c) {\r\n var codeUnit = (c.charCodeAt != undefined) ? c.charCodeAt(0) : c;\r\n return codeUnit in unicodeToGsm;\r\n }; \r\n\r\n vm.charCode = function(c){\r\n var retVal = c;\r\n if ( c.charCodeAt != undefined ){\r\n var number = c.charCodeAt(0).toString(16);\r\n if(number.length == 1) { number = \"0\" + number; }\r\n retVal = \"0x\" + number\r\n }\r\n return retVal;\r\n }\r\n\r\n\r\n vm.searchLog = function(){\r\n SmsService.getLog(vm.Page, vm.phone,vm.PageSize).then( \r\n function(data){ \r\n vm.log = {};\r\n vm.log.Response = data.data.Response;\r\n vm.PageSize = data.data.Request.PageSize;\r\n vm.log.Page = data.data.Request.PageNumber;\r\n vm.log.TotalRecords = data.data.TotalCount;\r\n });\r\n }\r\n\r\n //https://www.twilio.com/blog/2017/03/what-the-heck-is-a-segment.html\r\n var unicodeToGsm = {\r\n 0x000A: [0x0A],\r\n 0x000C: [0x1B, 0x0A],\r\n 0x000D: [0x0D],\r\n 0x0020: [0x20],\r\n 0x0021: [0x21],\r\n 0x0022: [0x22],\r\n 0x0023: [0x23],\r\n 0x0024: [0x02],\r\n 0x0025: [0x25],\r\n 0x0026: [0x26],\r\n 0x0027: [0x27],\r\n 0x0028: [0x28],\r\n 0x0029: [0x29],\r\n 0x002A: [0x2A],\r\n 0x002B: [0x2B],\r\n 0x002C: [0x2C],\r\n 0x002D: [0x2D],\r\n 0x002E: [0x2E],\r\n 0x002F: [0x2F],\r\n 0x0030: [0x30],\r\n 0x0031: [0x31],\r\n 0x0032: [0x32],\r\n 0x0033: [0x33],\r\n 0x0034: [0x34],\r\n 0x0035: [0x35],\r\n 0x0036: [0x36],\r\n 0x0037: [0x37],\r\n 0x0038: [0x38],\r\n 0x0039: [0x39],\r\n 0x003A: [0x3A],\r\n 0x003B: [0x3B],\r\n 0x003C: [0x3C],\r\n 0x003D: [0x3D],\r\n 0x003E: [0x3E],\r\n 0x003F: [0x3F],\r\n 0x0040: [0x00],\r\n 0x0041: [0x41],\r\n 0x0042: [0x42],\r\n 0x0043: [0x43],\r\n 0x0044: [0x44],\r\n 0x0045: [0x45],\r\n 0x0046: [0x46],\r\n 0x0047: [0x47],\r\n 0x0048: [0x48],\r\n 0x0049: [0x49],\r\n 0x004A: [0x4A],\r\n 0x004B: [0x4B],\r\n 0x004C: [0x4C],\r\n 0x004D: [0x4D],\r\n 0x004E: [0x4E],\r\n 0x004F: [0x4F],\r\n 0x0050: [0x50],\r\n 0x0051: [0x51],\r\n 0x0052: [0x52],\r\n 0x0053: [0x53],\r\n 0x0054: [0x54],\r\n 0x0055: [0x55],\r\n 0x0056: [0x56],\r\n 0x0057: [0x57],\r\n 0x0058: [0x58],\r\n 0x0059: [0x59],\r\n 0x005A: [0x5A],\r\n 0x005B: [0x1B, 0x3C],\r\n 0x005C: [0x1B, 0x2F],\r\n 0x005D: [0x1B, 0x3E],\r\n 0x005E: [0x1B, 0x14],\r\n 0x005F: [0x11],\r\n 0x0061: [0x61],\r\n 0x0062: [0x62],\r\n 0x0063: [0x63],\r\n 0x0064: [0x64],\r\n 0x0065: [0x65],\r\n 0x0066: [0x66],\r\n 0x0067: [0x67],\r\n 0x0068: [0x68],\r\n 0x0069: [0x69],\r\n 0x006A: [0x6A],\r\n 0x006B: [0x6B],\r\n 0x006C: [0x6C],\r\n 0x006D: [0x6D],\r\n 0x006E: [0x6E],\r\n 0x006F: [0x6F],\r\n 0x0070: [0x70],\r\n 0x0071: [0x71],\r\n 0x0072: [0x72],\r\n 0x0073: [0x73],\r\n 0x0074: [0x74],\r\n 0x0075: [0x75],\r\n 0x0076: [0x76],\r\n 0x0077: [0x77],\r\n 0x0078: [0x78],\r\n 0x0079: [0x79],\r\n 0x007A: [0x7A],\r\n 0x007B: [0x1B, 0x28],\r\n 0x007C: [0x1B, 0x40],\r\n 0x007D: [0x1B, 0x29],\r\n 0x007E: [0x1B, 0x3D],\r\n 0x00A1: [0x40],\r\n 0x00A3: [0x01],\r\n 0x00A4: [0x24],\r\n 0x00A5: [0x03],\r\n 0x00A7: [0x5F],\r\n 0x00BF: [0x60],\r\n 0x00C4: [0x5B],\r\n 0x00C5: [0x0E],\r\n 0x00C6: [0x1C],\r\n 0x00C9: [0x1F],\r\n 0x00D1: [0x5D],\r\n 0x00D6: [0x5C],\r\n 0x00D8: [0x0B],\r\n 0x00DC: [0x5E],\r\n 0x00DF: [0x1E],\r\n 0x00E0: [0x7F],\r\n 0x00E4: [0x7B],\r\n 0x00E5: [0x0F],\r\n 0x00E6: [0x1D],\r\n 0x00C7: [0x09],\r\n 0x00E8: [0x04],\r\n 0x00E9: [0x05],\r\n 0x00EC: [0x07],\r\n 0x00F1: [0x7D],\r\n 0x00F2: [0x08],\r\n 0x00F6: [0x7C],\r\n 0x00F8: [0x0C],\r\n 0x00F9: [0x06],\r\n 0x00FC: [0x7E],\r\n 0x0393: [0x13],\r\n 0x0394: [0x10],\r\n 0x0398: [0x19],\r\n 0x039B: [0x14],\r\n 0x039E: [0x1A],\r\n 0x03A0: [0x16],\r\n 0x03A3: [0x18],\r\n 0x03A6: [0x12],\r\n 0x03A8: [0x17],\r\n 0x03A9: [0x15],\r\n 0x20AC: [0x1B, 0x65]\r\n }\r\n}\r\n\r\nangular.module('system.sms').controller('SmsController', SmsController);\r\n\r\n","function SmsService(repository, $http) {\r\n var smsRepo = repository.new(\"sms\");\r\n\r\n return {\r\n sendSms: function(sms) {\r\n return smsRepo.create(sms);\r\n },\r\n getLog: function (page, phone,pageSize) {\r\n return $http.get('/api/sms/log',{params:{FilterBy:encodeURIComponent(phone),PageSize:pageSize,PageNumber:page}} ).then(\r\n function (response) {\r\n return response;\r\n });\r\n },\r\n\r\n };\r\n}\r\n\r\nangular.module('system.sms').factory('SmsService', SmsService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/sms/sms.tpl.html',\n '

          Send a test SMS message

          Phone number is required.
          Message text is required.
          Segment {{$index + 1}}:
          {{char}}
          TimePhonePatient IdMessage
          {{item.CreatedDateTime_UTC | date:\\'short\\'}}{{item.ToPhoneNumber}}{{item.PatientId}}{{item.Message}}
          ');\n}]);\n}(window, document, window.angular));","function TitleEditController($scope, $uibModalInstance, title, TitlesService) {\r\n\r\n $scope.title = title || TitlesService.create();\r\n $scope.clinicalRoles = TitlesService.getRoles();\r\n\r\n $scope.save = function() {\r\n if ($scope.title.Name.length === 0) return;\r\n $uibModalInstance.close($scope.title);\r\n }\r\n\r\n $scope.cancel = function() {\r\n $uibModalInstance.close(undefined);\r\n }\r\n\r\n $scope.getToggleClass = function(toggleValue) {\r\n return toggleValue ? 'fa fa-toggle-on text-primary' : 'fa fa-toggle-off';\r\n }\r\n}\r\n\r\nangular.module('system.titles').controller('TitleEditController', TitleEditController);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/titles/titleEdit.tpl.html',\n '

          {{title.Id != null ? \\'Edit Care Team Title\\' : \\'Add New Care Team Title\\'}}

          *required
          ');\n}]);\n}(window, document, window.angular));","function TitlesController($scope, $uibModal, titles, TitlesService, lodash) {\r\n var vm = this;\r\n\r\n vm.titles = titles;\r\n\r\n vm.dragListeners = {\r\n orderChanged: orderChanged\r\n };\r\n\r\n vm.toggleIsEnabled = function (title, $event) {\r\n $event.stopPropagation();\r\n title.IsEnabled = !title.IsEnabled;\r\n TitlesService.update(title);\r\n }\r\n\r\n vm.toggleIsDefault = function (title, $event) {\r\n $event.stopPropagation();\r\n title.IsDefault = !title.IsDefault;\r\n let updatedTitles = setDefaults(title);\r\n TitlesService.update(updatedTitles);\r\n }\r\n\r\n vm.getToggleClass = function(toggleValue) {\r\n return toggleValue ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n }\r\n\r\n vm.openEdit = function (title) {\r\n $uibModal.open({\r\n templateUrl: 'modules/system/titles/titleEdit.tpl.html',\r\n controller: 'TitleEditController',\r\n resolve: {\r\n title: () => angular.copy(title)\r\n }\r\n }).result.then(function updateTitle(updatedTitle) {\r\n if (!updatedTitle) {\r\n return Promise.resolve();\r\n }\r\n var idx = vm.titles.indexOf(title);\r\n if (idx >= 0) {\r\n vm.titles[idx] = updatedTitle;\r\n }\r\n else {\r\n idx = vm.titles.length;\r\n updatedTitle.SortOrder = getNextOrder();\r\n vm.titles.push(updatedTitle);\r\n }\r\n\r\n let updatedTitles;\r\n if (updatedTitle.IsDefault === true) {\r\n updatedTitles = setDefaults(updatedTitle);\r\n } else {\r\n updatedTitles = [updatedTitle];\r\n }\r\n\r\n return TitlesService.update(updatedTitles)\r\n .then(titles => vm.titles[idx] = titles[0]);\r\n });\r\n }\r\n\r\n function orderChanged(event) {\r\n var list = event.dest.sortableScope.modelValue;\r\n resort(list);\r\n TitlesService.update(list);\r\n }\r\n\r\n function getNextOrder() {\r\n return 1 + vm.titles.reduce((max, title) => Math.max(max, title.SortOrder), 0);\r\n }\r\n\r\n function resort(list) {\r\n for (var i = 0; i < list.length; i++) {\r\n list[i].SortOrder = i;\r\n }\r\n }\r\n\r\n function setDefaults(updatedTitle) {\r\n let modified = [updatedTitle];\r\n\r\n if (updatedTitle.IsDefault) {\r\n titles.forEach(title => {\r\n if (title != updatedTitle && title.IsDefault) {\r\n title.IsDefault = false;\r\n modified.push(title);\r\n }\r\n });\r\n }\r\n\r\n return modified;\r\n }\r\n}\r\n\r\nangular.module('system.titles').controller('TitlesController', TitlesController);","function TitlesService($http) {\r\n const resourceUrl = '/api/CaregiverTitle';\r\n const clinicalRoles = ['Clinical', 'Non-Clinical', 'QHP'];\r\n const blankTitle = {\r\n Name: '',\r\n Description: '',\r\n ClinicalRole: clinicalRoles[0],\r\n IsEnabled: true,\r\n IsDefault: false\r\n };\r\n\r\n function getResponseData(response) {\r\n return response.data;\r\n }\r\n\r\n return {\r\n create: () => Object.assign({}, blankTitle),\r\n get: () => $http.get(resourceUrl, { params: { enabledOnly: false }}).then(getResponseData),\r\n getRoles: () => clinicalRoles,\r\n update: (title) => {\r\n const data = angular.isArray(title) ? title : [title];\r\n return $http.put(resourceUrl, data).then(getResponseData);\r\n }\r\n }\r\n}\r\n\r\nangular.module('system.titles').factory('TitlesService', TitlesService);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/titles/titles.tpl.html',\n '

          Care Team Titles

          Full Name

          Abbreviation

          Clinical Role

          Default

          Enabled

          {{title.Description || \\'(not set)\\'}}
          {{title.Name}}
          {{title.ClinicalRole}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/webhooks/webhook.modal.html',\n '

          {{vm.webhook.WebhookId > 0 ? \"Edit\" : \"Add\"}} Webhook for {{vm.webhook.ApplicationName}}




          Param NameValueType
          ');\n}]);\n}(window, document, window.angular));","function WebhookModalController(webhook, WebhooksService, PermissionService, $uibModalInstance) {\r\n var vm = this;\r\n vm.webhook = webhook || {};\r\n var newWebhookParamDefaults = { 'WebhookParamName':'','WebhookParamValue':'','WebhookParamTypeId':1, 'showInput': false };\r\n loadController();\r\n\r\n function loadController() {\r\n vm.saveWebhook = saveWebhook;\r\n vm.cancelEditing = cancelEditing;\r\n vm.paramTypes = [ {'id':1, 'label':'Querystring'}, {'id':2, 'label':'Header'} ];\r\n vm.isEventParam = isEventParam;\r\n vm.newWebhookParam = newWebhookParamDefaults;\r\n vm.addParam = addParam;\r\n vm.onWebhookParamChanged = angular.copy(onWebhookParamChanged);\r\n vm.deleteParam = deleteParam;\r\n vm.populateEventParams = populateEventParams;\r\n fetchEvents();\r\n }\r\n\r\n function assignShowInput(params) {\r\n for(var param in params) {\r\n isEventParam(param);\r\n }\r\n }\r\n\r\n function saveWebhook(isValid) {\r\n if(isValid) {\r\n WebhooksService.saveWebhook(webhook).then(function(savedWebhook) {\r\n if(savedWebhook){\r\n $uibModalInstance.close(webhook);\r\n }\r\n else {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n });\r\n }\r\n }\r\n\r\n function cancelEditing() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function fetchEvents() {\r\n WebhooksService.getEvents().then(function(events) {\r\n vm.events = events;\r\n vm.eventList = Object.keys(events).sort();\r\n populateEventParams();\r\n })\r\n }\r\n\r\n function populateEventParams() {\r\n vm.eventParams = vm.events[vm.webhook.EventName];\r\n vm.newEventParams = angular.copy(vm.eventParams);\r\n if(vm.newEventParams) {\r\n vm.newEventParams.push('other');\r\n }\r\n }\r\n\r\n function isEventParam(param) {\r\n var retVal = (param == '' || param == undefined) && param != '{other}'; //default to param drop down if empty\r\n if(vm.events) {\r\n var params = vm.events[vm.webhook.EventName];\r\n for(var p in params) {\r\n var eventParam = '{'+params[p]+'}';\r\n if(angular.lowercase(eventParam) == angular.lowercase(param)) {\r\n retVal = true;\r\n }\r\n }\r\n }\r\n if(param != undefined) {\r\n param.showInput = !retVal;\r\n }\r\n return retVal;\r\n }\r\n\r\n function addParam() {\r\n if(vm.newWebhookParam.WebhookParamName != '' && vm.newWebhookParam.WebhookParamValue != '') {\r\n if(vm.webhook.WebhookParams == undefined) {\r\n vm.webhook.WebhookParams = [];\r\n }\r\n vm.webhook.WebhookParams.push(angular.copy(vm.newWebhookParam));\r\n vm.newWebhookParam = angular.copy(onWebhookParamChanged);\r\n }\r\n }\r\n\r\n function onWebhookParamChanged(param) {\r\n if(param == '{other}') {\r\n vm.newWebhookParam.showInput = true;\r\n vm.newWebhookParam.WebhookParamValue = '';\r\n }\r\n }\r\n\r\n function deleteParam(param) {\r\n var toRemove = vm.webhook.WebhookParams.indexOf(param);\r\n vm.webhook.WebhookParams.splice(toRemove, 1);\r\n }\r\n\r\n}\r\n\r\nangular.module('system.webhooks').controller('WebhookModalController', WebhookModalController);\r\n","function WebhooksController(WebhooksService, PermissionService, $uibModal, $window) {\r\n var vm = this;\r\n var haswebhooksWrite = PermissionService.userHasPermission([\"WebhookWrite\"]);\r\n\r\n vm.getAppWebhooks = getAppWebhooks;\r\n vm.getParamTypeName = getParamTypeName;\r\n vm.getEnabledClass = getEnabledClass;\r\n vm.enableDisableWebhook = enableDisableWebhook;\r\n vm.editWebhook = editWebhook;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n WebhooksService.getApps()\r\n .then(function (data) {\r\n vm.apps = data;\r\n });\r\n }\r\n\r\n function getAppWebhooks(app) {\r\n WebhooksService.getByApp(app.ApplicationKey)\r\n .then(function(data) {\r\n app.webhooks = data;\r\n vm.selectedApp = app;\r\n });\r\n }\r\n\r\n function getParamTypeName(paramTypeId) {\r\n var retVal = paramTypeId == 1 ? 'Querystring' : 'Header' ;\r\n return retVal;\r\n }\r\n\r\n function getEnabledClass(isEnabled) {\r\n var retVal = isEnabled ? 'fa fa-toggle-on' : 'fa fa-toggle-off';\r\n return retVal;\r\n }\r\n\r\n function enableDisableWebhook(webhook) {\r\n //call service to toggle webhook enable flag\r\n WebhooksService.enableWebhook(webhook.WebhookId, !webhook.IsEnabled)\r\n .then(function(data) {\r\n // data is a boolean representing the success of the web call.\r\n webhook.IsEnabled = data ? !webhook.IsEnabled : webhook.IsEnabled;\r\n });\r\n }\r\n\r\n function editWebhook(webhook) {\r\n var isNew = false;\r\n if(webhook == undefined) {\r\n isNew = true;\r\n webhook = {};\r\n webhook.ApplicationId = vm.selectedApp.ApplicationId;\r\n webhook.ApplicationName = vm.selectedApp.ApplicationName;\r\n webhook.ApplicationKey = vm.selectedApp.ApplicationKey;\r\n }\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/system/webhooks/webhook.modal.html',\r\n controller: 'WebhookModalController as vm',\r\n backdrop: 'static',\r\n resolve: {\r\n webhook: function () {\r\n return angular.copy(webhook);\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function(updatedWebhook) {\r\n getAppWebhooks(vm.selectedApp);\r\n });\r\n }\r\n\r\n}\r\n\r\nangular.module('system.webhooks').controller('WebhooksController', WebhooksController);\r\n","function WebhooksRepository($http) {\r\n return {\r\n getApps: function () {\r\n return $http.get('/api/oauthapplication').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getByApp: function (appkey) {\r\n return $http.get('/api/webhook?appkey=' + appkey).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getAll: function() {\r\n return $http.get('/api/webhook').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n save: function(data) {\r\n return $http.post('/api/webhook', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n saveWebhookParam: function(webhookId, data) {\r\n return $http.post('/api/webhook/' + webhookId + '/Param', data).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n enableWebhook: function(webhookId, isEnabled) {\r\n return $http.put('/api/webhook/' + webhookId + '/isenabled', isEnabled).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n },\r\n\r\n getEvents: function() {\r\n return $http.get('/api/webhook/events').then(\r\n function(response) {\r\n return response.data;\r\n }\r\n )\r\n }\r\n };\r\n}\r\n\r\nangular.module('repos').factory('WebhooksRepository', WebhooksRepository);\r\n","function WebhooksService(WebhooksRepository) {\r\n return {\r\n getAllWebhooks: function () {\r\n var promise = WebhooksRepository.getAll();\r\n return promise;\r\n },\r\n\r\n getByApp: function(appkey) {\r\n var promise = WebhooksRepository.getByApp(appkey);\r\n return promise;\r\n },\r\n\r\n getApps: function() {\r\n var promise = WebhooksRepository.getApps();\r\n return promise;\r\n },\r\n\r\n saveWebhook: function (webhook) {\r\n var promise = WebhooksRepository.save(webhook);\r\n return promise;\r\n },\r\n\r\n enableWebhook: function (webhookId, isEnabled) {\r\n var promise = WebhooksRepository.enableWebhook(webhookId, isEnabled);\r\n return promise;\r\n },\r\n\r\n getEvents: function() {\r\n var promise = WebhooksRepository.getEvents();\r\n return promise;\r\n }\r\n\r\n };\r\n}\r\n\r\nangular.module('system.webhooks').factory('WebhooksService', WebhooksService);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/system/webhooks/webhooks.tpl.html',\n '

          Webhooks

          APPLICATIONS AND SERVICES

          {{vm.selectedApp.ApplicationName}} WEBHOOKS

          ENABLED
          There are no enabled Webhooks for {{vm.selectedApp.ApplicationName}}
          {{webhook.WebhookName}}{{webhook.EventName}}
          ({{webhook.IsPost ? \\'POST\\' : \\'GET\\'}}) {{webhook.Url}}
          DISABLED
          There are no disabled Webhooks for {{vm.selectedApp.ApplicationName}}
          {{webhook.WebhookName}}{{webhook.EventName}}
          ({{webhook.IsPost ? \\'POST\\' : \\'GET\\'}}) {{webhook.Url}}
          ');\n}]);\n}(window, document, window.angular));","function DeleteTimeLogDetailController(timeLog, $uibModalInstance, TimeLogDetailService, lodash) {\r\n var vm = this;\r\n\r\n vm.timeLog = timeLog;\r\n vm.selectedOption = null;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n TimeLogDetailService.getDeleteTimeLogReasons()\r\n .then(function(response) {\r\n vm.deleteTimeLogReasons = response;\r\n\r\n var defaultReasons = lodash.where(vm.deleteTimeLogReasons, {'IsDefault': true});\r\n if (defaultReasons[0] != null) {\r\n vm.selectedOption = defaultReasons[0];\r\n }\r\n else {\r\n vm.selectedOption = vm.deleteTimeLogReasons[0];\r\n }\r\n });\r\n }\r\n\r\n vm.ok = function(deleteTimeLog) {\r\n vm.timeLog.DeleteTimeLogReasonId = vm.selectedOption.DeleteTimeLogReasonId;\r\n $uibModalInstance.close(vm.timeLog);\r\n }\r\n\r\n vm.cancel = function() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n}\r\n\r\nangular.module('time_log.detail').controller('DeleteTimeLogDetailController', DeleteTimeLogDetailController);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/time_log/detail/deletedetail.modal.html',\n '

          Delete Time Log

          ');\n}]);\n}(window, document, window.angular));","function PatientTimeLogAuditDirective() {\r\n function controller($scope, PatientTimeLogUtilitiesService) {\r\n $scope.selected = false; \r\n \r\n $scope.totalTimeHours = '00';\r\n $scope.totalTimeMinutes = '00';\r\n $scope.totalTimeSeconds = '00'; \r\n \r\n $scope.select = function(){\r\n $scope.selected = true;\r\n };\r\n\r\n $scope.selectToggle = function(){\r\n $scope.selected = !$scope.selected;\r\n $scope.timeIsOpen = !$scope.timeIsOpen;\r\n };\r\n\r\n $scope.getCaregiver = function(timeLog, type) {\r\n return PatientTimeLogUtilitiesService.getCaregiver(timeLog, type);\r\n };\r\n\r\n $scope.getDateTimeDisplay = function(type) {\r\n var date;\r\n if(type === 'Delete') {\r\n date = $scope.timeLogAudit.DeletedDateTime_UTC;\r\n }\r\n else {\r\n date = $scope.timeLogAudit.AuditModifiedDateTime;\r\n }\r\n\r\n var retVal = PatientTimeLogUtilitiesService.getDateDisplay(date);\r\n\r\n retVal += ' at ' + PatientTimeLogUtilitiesService.getTimeDisplay(date);\r\n\r\n return retVal;\r\n };\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n var totalTime = $scope.updateTotalTime({timeLogAudit: $scope.timeLogAudit, isAudit: true});\r\n \r\n $scope.totalTimeHours = totalTime.hours;\r\n $scope.totalTimeMinutes = totalTime.minutes;\r\n $scope.totalTimeSeconds = totalTime.seconds;\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n require: '^timeLogDetailTime',\r\n replace: true,\r\n transclude: true,\r\n scope: {\r\n timeLogAudit: '=timeLogAudit',\r\n updateTotalTime: '&' \r\n },\r\n templateUrl: 'modules/time_log/detail/detail.audit.tpl.html'\r\n }\r\n}\r\n\r\nangular.module(\"time_log.detail\").directive('timeLogAudit', PatientTimeLogAuditDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/time_log/detail/detail.audit.tpl.html',\n '
          {{timeLogAudit.AuditAction}} ({{timeLogAudit.minutesDisplay}})
          Deleted Added (Added by: {{::getCaregiver(timeLogAudit, \\'Modify\\')}} on {{::getDateTimeDisplay(\\'Modify\\')}}) (Modified by: {{::getCaregiver(timeLogAudit, \\'Modify\\')}} on {{::getDateTimeDisplay(\\'Modify\\')}})
          ( {{timeLogAudit.timeLabel}} ) {{totalTimeHours}} {{totalTimeMinutes}} {{totalTimeSeconds}}
          ');\n}]);\n}(window, document, window.angular));","function PatientTimeLogDetailController(patientContent, timeLogDetailContent, $scope, $state, $stateParams, $uibModal, PermissionService, TimeLogDetailService, PatientTimeLogUtilitiesService, lodash) {\r\n var vm = this;\r\n\r\n vm.clinicalTimeHours = '00';\r\n vm.clinicalTimeMinutes = '00';\r\n vm.clinicalTimeSeconds = '00';\r\n\r\n vm.totalTimeHours = '00';\r\n vm.totalTimeMinutes = '00';\r\n vm.totalTimeSeconds = '00';\r\n\r\n //PatientTimeLogAuditWrite permission is only used in UI. None of the API controllers are locked down with this permission\r\n //because the regular time log session use them.\r\n vm.canShowAuditView = PermissionService.userHasPermission([\"PatientTimeLogAuditWrite\"]);\r\n vm.hasModifiedRecords = false;\r\n\r\n vm.isAuditView = false;\r\n\r\n vm.toggleExpand = true;\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n if ($stateParams.monthOffset && $stateParams.monthOffset != 0) {\r\n var offsetDate = new Date();\r\n offsetDate.setMonth(offsetDate.getMonth() - 1);\r\n\r\n vm.date = offsetDate;\r\n }\r\n else {\r\n vm.date = new Date();\r\n }\r\n\r\n vm.datePickerOptions = {\r\n 'minMode': 'month',\r\n maxDate: new Date()\r\n };\r\n\r\n vm.monthOpened = false;\r\n vm.datePickerOpen = function ($event) {\r\n $event.preventDefault();\r\n $event.stopPropagation();\r\n\r\n vm.monthOpened = !vm.monthOpened;\r\n };\r\n\r\n TimeLogDetailService.getPatientName($stateParams.patientId).then(function (name) {\r\n vm.patientName = name;\r\n });\r\n\r\n TimeLogDetailService.getTimeLogConfiguration().then(function (data) {\r\n vm.filter = data.DefaultFilter;\r\n\r\n vm.days = PatientTimeLogUtilitiesService.getModel(timeLogDetailContent);\r\n updateFilteredDays(vm.days);\r\n setMonthTime();\r\n });\r\n\r\n vm.updateTimeLog = UpdateTimeLog;\r\n vm.deleteTimeLog = DeleteTimeLog;\r\n vm.updateDayTime = UpdateDayTime;\r\n vm.updateSessionTime = UpdateSessionTime;\r\n vm.updateTime = UpdateTime;\r\n vm.showAddTimeLogModal = ShowAddTimeLogModal;\r\n vm.toggleAuditView = ToggleAuditView;\r\n vm.isInAuditView = IsInAuditView;\r\n vm.toggleExpansion = toggleExpansion;\r\n\r\n vm.isTimeVisible = IsTimeVisible;\r\n }\r\n\r\n function IsTimeVisible(clockType) {\r\n var retVal = false;\r\n\r\n if (vm.filter == 'All') {\r\n retVal = true;\r\n }\r\n else if (clockType == 'Clinical') {\r\n retVal = vm.filter == 'Clinical';\r\n }\r\n else {\r\n retVal = vm.filter !== 'Clinical';\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n function updateFilteredDays(model) {\r\n lodash.forEach(model, function (d) {\r\n PatientTimeLogUtilitiesService.filterType(d, vm.filter, vm.isAuditView);\r\n });\r\n\r\n setMonthTime(model);\r\n }\r\n\r\n function UpdateTimeLog(timeLog, property) {\r\n if (property === 'Minutes') {\r\n var milliseconds = timeLog.minutes * 1000 * 60;\r\n var startTime = Date.parse(timeLog.StartTime_UTC);\r\n var startDate = new Date(startTime);\r\n var stopDate = new Date(startTime + milliseconds);\r\n timeLog.timeLabel = PatientTimeLogUtilitiesService.getTimeDisplay(startDate) + ' - ' + PatientTimeLogUtilitiesService.getTimeDisplay(stopDate);\r\n timeLog.TimeDiff = milliseconds;\r\n timeLog.StopTime_UTC = stopDate;\r\n setMonthTime();\r\n }\r\n\r\n TimeLogDetailService.updateTimeLog(timeLog)\r\n .then(function (data) {\r\n vm.hasModifiedRecords = true;\r\n });\r\n }\r\n\r\n function DeleteTimeLog(timeLog) {\r\n setMonthTime();\r\n\r\n TimeLogDetailService.deleteTimeLog(timeLog)\r\n .then(function(data) {\r\n timeLog.isDeleted = true;\r\n vm.hasModifiedRecords = true;\r\n });\r\n }\r\n\r\n function setDays(model, filtering) {\r\n if (filtering) {\r\n vm.days = angular.copy(model);\r\n }\r\n else {\r\n vm.days = model;\r\n }\r\n\r\n if (vm.days.length && vm.days.length > 0) {\r\n var days = lodash.filter(vm.days, function (day) {\r\n return day.day.isVisible === true;\r\n });\r\n }\r\n vm.toggleExpand = true;\r\n\r\n vm.currentMonth = {\r\n clinicalTime: updateMonthTime(vm.days, true),\r\n totalTime: updateMonthTime(vm.days, false)\r\n };\r\n }\r\n\r\n function setMonthTime() {\r\n var clinicalTime = updateMonthTime(vm.days, true);\r\n var totalTime = updateMonthTime(vm.days, false);\r\n\r\n vm.clinicalTimeHours = clinicalTime.hours;\r\n vm.clinicalTimeMinutes = clinicalTime.minutes;\r\n vm.clinicalTimeSeconds = clinicalTime.seconds;\r\n\r\n vm.totalTimeHours = totalTime.hours;\r\n vm.totalTimeMinutes = totalTime.minutes;\r\n vm.totalTimeSeconds = totalTime.seconds;\r\n }\r\n\r\n function updateMonthTime(model, isClinical) {\r\n var sessions = lodash.flatten(lodash.pluck(model, 'sessions'));\r\n sessions = lodash.filter(sessions, function (session) {\r\n return session.session.isVisible === true;\r\n });\r\n var timeLogs = lodash.pluck(sessions, 'timeLogs');\r\n var logs = lodash.pluck(lodash.flatten(timeLogs), 'timeLog');\r\n\r\n logs = lodash.where(logs, {'isDeleted': false});\r\n\r\n return PatientTimeLogUtilitiesService.getTotalTime(logs, isClinical);\r\n }\r\n\r\n function UpdateDayTime(day, isClinical) {\r\n day.isVisible = (vm.isAuditView && day.isVisible) || (day.isVisible && !lodash.every(day.Sessions, {isVisible: false}));\r\n\r\n var sessions = lodash.filter(day.Sessions, function (session) {\r\n return session.isVisible === true;\r\n });\r\n\r\n var logs = lodash.flatten(lodash.pluck(sessions, 'TimeLogs'));\r\n logs = lodash.pluck(logs, 'Parent');\r\n\r\n logs = lodash.where(logs, {'isDeleted': false});\r\n\r\n return PatientTimeLogUtilitiesService.getTotalTime(logs, isClinical);\r\n }\r\n\r\n function UpdateSessionTime(session, isClinical) {\r\n var parentLogs = lodash.pluck(session.TimeLogs, 'Parent');\r\n session.isVisible = (vm.isAuditView && session.isVisible) || (session.isVisible && !lodash.every(parentLogs, {isDeleted: true}));\r\n\r\n var logs = session.TimeLogs;\r\n logs = lodash.pluck(logs, 'Parent');\r\n\r\n logs = lodash.where(logs, {'isDeleted': false});\r\n\r\n return PatientTimeLogUtilitiesService.getTotalTime(logs, isClinical);\r\n }\r\n\r\n function UpdateTime(log, isAudit) {\r\n var logs = [log];\r\n\r\n return PatientTimeLogUtilitiesService.getTotalTime(logs, false, isAudit);\r\n }\r\n\r\n $scope.$watch('vm.date', function (newVal, oldVal) {\r\n if (newVal != oldVal) {\r\n updateDate(vm.date);\r\n }\r\n });\r\n\r\n function ShowAddTimeLogModal() {\r\n var newTimeLog = TimeLogDetailService.getNewTimeLog('');\r\n newTimeLog.StartTime_UTC.setYear(vm.date.getFullYear());\r\n newTimeLog.StartTime_UTC.setMonth(vm.date.getMonth());\r\n\r\n newTimeLog.StopTime_UTC.setYear(vm.date.getFullYear());\r\n newTimeLog.StopTime_UTC.setMonth(vm.date.getMonth());\r\n\r\n newTimeLog.StartTimeLogTypeId = 9;\r\n newTimeLog.StopTimeLogTypeId = 9;\r\n\r\n newTimeLog.Action = '';\r\n\r\n var modalInstance = $uibModal.open({\r\n backdrop: 'static',\r\n controller: 'AddTimeLogDetailController as vm',\r\n templateUrl: 'modules/patient/header/addTimeLog.modal.html',\r\n resolve: {\r\n timeLog: function () {\r\n return newTimeLog;\r\n },\r\n liPatient:function() {\r\n return patientContent.patient;\r\n },\r\n options: function() {\r\n return undefined;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (timeLog) {\r\n timeLog.PatientId = $stateParams.patientId;\r\n\r\n TimeLogDetailService.addTimeLog(timeLog).then(function (data) {\r\n var date = new Date(Date.parse(data.StartTime_UTC));\r\n updateDate(date);\r\n });\r\n });\r\n }\r\n\r\n function ToggleAuditView() {\r\n if(vm.isAuditView === false && vm.hasModifiedRecords) {\r\n var monthOffset = PatientTimeLogUtilitiesService.getMonthOffset(vm.date);\r\n\r\n TimeLogDetailService.getTimeLogAuditsByMonth($stateParams.patientId, monthOffset).then(function (data) {\r\n lodash.forEach(vm.days, function(d){\r\n PatientTimeLogUtilitiesService.updateAudits(d, data);\r\n vm.hasModifiedRecords = false;\r\n });\r\n });\r\n }\r\n\r\n vm.isAuditView = !vm.isAuditView;\r\n updateFilteredDays(vm.days);\r\n }\r\n\r\n function IsInAuditView() {\r\n return vm.isAuditView;\r\n }\r\n\r\n function updateDate(date) {\r\n var monthOffset = PatientTimeLogUtilitiesService.getMonthOffset(date);\r\n\r\n updateDays(monthOffset);\r\n $state.go('patients.patient.time_log.detail', {\r\n patientId: $stateParams.patientId,\r\n monthOffset: monthOffset\r\n }, {notify: false});\r\n }\r\n\r\n function toggleExpansion() {\r\n vm.toggleExpand = !vm.toggleExpand;\r\n\r\n if (vm.toggleExpand === true) {\r\n for (var i = 0; i < vm.days.length; i++) {\r\n PatientTimeLogUtilitiesService.collapse(vm.days[i]);\r\n }\r\n } else {\r\n for (var j = 0; j < vm.days.length; j++) {\r\n PatientTimeLogUtilitiesService.expand(vm.days[j]);\r\n }\r\n }\r\n }\r\n\r\n $scope.$watch('vm.filter', function (newVal, oldVal) {\r\n if (newVal != oldVal) {\r\n updateFilteredDays(vm.days);\r\n setDays(vm.days, true);\r\n setMonthTime();\r\n }\r\n });\r\n\r\n function updateDays(monthOffset) {\r\n TimeLogDetailService.getTimeLogsByMonth($stateParams.patientId, monthOffset).then(function (data) {\r\n vm.hasModifiedRecords = false;\r\n var model = PatientTimeLogUtilitiesService.getModel(data);\r\n updateFilteredDays(model);\r\n setDays(model);\r\n setMonthTime();\r\n });\r\n }\r\n}\r\n\r\nangular.module('time_log.detail').controller('PatientTimeLogDetailController', PatientTimeLogDetailController);\r\n","function DetailDatePickerDirective() {\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function(scope, element, attr, controller) {\r\n controller.$formatters.shift();\r\n }\r\n }\r\n}\r\n\r\nangular.module('time_log.detail').directive('datepickerPopup', DetailDatePickerDirective);\r\n","function PatientTimeLogDayDirective() {\r\n\r\n function controller($scope, lodash) {\r\n var dd = this;\r\n\r\n $scope.dayIsOpen = false;\r\n $scope.selected = false;\r\n $scope.enabled = true;\r\n $scope.addingTimeLog = false;\r\n\r\n $scope.$watch('day.selected', function () {\r\n $scope.dayIsOpen = $scope.day.selected;\r\n });\r\n\r\n $scope.dayToggle = function () {\r\n $scope.dayIsOpen = !$scope.dayIsOpen;\r\n selectChildren($scope.dayIsOpen);\r\n };\r\n\r\n $scope.select = function () {\r\n $scope.selected = true;\r\n selectChildren($scope.selected);\r\n };\r\n\r\n $scope.selectToggle = function () {\r\n $scope.selected = !$scope.selected;\r\n selectChildren($scope.selected);\r\n };\r\n\r\n $scope.$on('selectAll', function (e) {\r\n $scope.selected = true;\r\n selectChildren($scope.selected);\r\n });\r\n\r\n $scope.$on('selectNone', function (e) {\r\n $scope.selected = false;\r\n selectChildren($scope.selected);\r\n });\r\n\r\n dd.updateTime = function () {\r\n var clinicalTime = $scope.updateTotalTime({day: $scope.day, isClinical: true});\r\n if (clinicalTime === undefined) {\r\n clinicalTime = {\r\n hours: '00',\r\n minutes: '00',\r\n seconds: '00'\r\n };\r\n }\r\n\r\n var totalTime = $scope.updateTotalTime({day: $scope.day, isClinical: false});\r\n if (totalTime === undefined) {\r\n totalTime = {\r\n hours: '00',\r\n minutes: '00',\r\n seconds: '00'\r\n };\r\n }\r\n\r\n $scope.clinicalTimeHours = clinicalTime.hours;\r\n $scope.clinicalTimeMinutes = clinicalTime.minutes;\r\n $scope.clinicalTimeSeconds = clinicalTime.seconds;\r\n\r\n $scope.totalTimeHours = totalTime.hours;\r\n $scope.totalTimeMinutes = totalTime.minutes;\r\n $scope.totalTimeSeconds = totalTime.seconds;\r\n };\r\n\r\n function selectChildren(selected) {\r\n if ($scope.day.Sessions) {\r\n lodash.forEach($scope.day.Sessions, function(session){\r\n session.selected = selected;\r\n });\r\n }\r\n }\r\n\r\n loadController();\r\n\r\n function loadController() {\r\n dd.updateTime();\r\n }\r\n }\r\n\r\n return {\r\n controller: controller,\r\n restrict: 'E',\r\n replace: true,\r\n transclude: true,\r\n scope: {\r\n day: '=day',\r\n isTimeVisible: '&',\r\n updateTotalTime: '&',\r\n isAuditView: '=isAuditView'\r\n },\r\n templateUrl: 'modules/time_log/detail/detail.day.tpl.html'\r\n };\r\n}\r\n\r\nangular.module(\"time_log.detail\").directive('timeLogDetailDay', PatientTimeLogDayDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/time_log/detail/detail.day.tpl.html',\n '
          {{day.dateLabel}}
          {{clinicalTimeHours}} {{clinicalTimeMinutes}} {{clinicalTimeSeconds}}
          {{totalTimeHours}} {{totalTimeMinutes}} {{totalTimeSeconds}}
          ');\n}]);\n}(window, document, window.angular));","function TimeLogDetailService(repository, lodash, TimeLogSessionService, $http) {\r\n var timeLogRepo = repository.new('Timelog');\r\n var patientRepo = repository.new('Patient');\r\n var deleteTimeLogReasonRepo = repository.new(\"DeleteTimeLogReason\");\r\n\r\n function GetTimeLogsByMonth(patientId, month) {\r\n return $http.get('/api/Timelog/byMonth?patientId=' + patientId + '&monthOffset=' + month).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetTimeLogAuditsByMonth(patientId, month) {\r\n return GetTimeLogsByMonth(patientId, month)\r\n .then(function(days) {\r\n var sessions = lodash.flatten(lodash.pluck(days, 'Sessions'));\r\n var timeLogs = lodash.flatten(lodash.pluck(sessions, 'TimeLogs'));\r\n var timeLogAudits = [];\r\n\r\n lodash.forEach(timeLogs, function(l) {\r\n var audits = {\r\n parentId: l.Parent.TimeLogId,\r\n timeLogAudits: l.TimeLogAudits,\r\n };\r\n\r\n timeLogAudits.push(audits);\r\n });\r\n\r\n return timeLogAudits;\r\n });\r\n }\r\n\r\n function GetPatientName(patientId) {\r\n return patientRepo.get(patientId).then(function(res) {\r\n var patient = res.data;\r\n return patient.FullName;\r\n });\r\n }\r\n\r\n function AddTimeLog(timeLog) {\r\n return timeLogRepo.create(timeLog).then(function(res){\r\n var timeLog = res.data;\r\n\r\n return timeLog;\r\n });\r\n }\r\n\r\n function UpdateTimeLog(timeLog) {\r\n return timeLogRepo.update(timeLog.TimeLogId, timeLog)\r\n .then(function(response){\r\n return response.data;\r\n });\r\n }\r\n\r\n function DeleteTimeLog(timeLog) {\r\n return $http.delete('/api/Timelog/' + timeLog.TimeLogId + '?deleteTimeLogReasonId=' + timeLog.DeleteTimeLogReasonId).then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetNewTimeLog(action) {\r\n return TimeLogSessionService.getNewTimeLog(action);\r\n }\r\n\r\n function GetTimeLogConfiguration() {\r\n return $http.get('/api/Timelog/configuration').then(\r\n function (response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n function GetDeleteTimeLogReasons() {\r\n return deleteTimeLogReasonRepo.get()\r\n .then(function(response) {\r\n return response.data;\r\n });\r\n }\r\n\r\n return {\r\n getTimeLogsByMonth: GetTimeLogsByMonth,\r\n getTimeLogAuditsByMonth: GetTimeLogAuditsByMonth,\r\n getPatientName: GetPatientName,\r\n addTimeLog: AddTimeLog,\r\n updateTimeLog: UpdateTimeLog,\r\n deleteTimeLog: DeleteTimeLog,\r\n getTimeLogConfiguration: GetTimeLogConfiguration,\r\n getNewTimeLog: GetNewTimeLog,\r\n getDeleteTimeLogReasons: GetDeleteTimeLogReasons\r\n };\r\n}\r\n\r\nangular.module('time_log.detail').factory('TimeLogDetailService', TimeLogDetailService);\r\n","function PatientTimeLogSessionDirective() {\r\n\r\n function controller($scope, lodash) {\r\n\r\n $scope.sessionIsOpen = false;\r\n $scope.selected = false;\r\n $scope.enabled = true;\r\n\r\n $scope.$watch('session.selected', function () {\r\n $scope.sessionIsOpen = $scope.session.selected;\r\n $scope.selected = $scope.session.selected;\r\n selectChildren($scope.selected);\r\n });\r\n\r\n $scope.sessionToggle = function () {\r\n $scope.sessionIsOpen = !$scope.sessionIsOpen;\r\n $scope.selected = !$scope.selected;\r\n selectChildren($scope.sessionIsOpen);\r\n };\r\n\r\n $scope.$on('selectAll', function (e) {\r\n $scope.selected = true;\r\n selectChildren($scope.selected);\r\n });\r\n\r\n $scope.$on('selectNone', function (e) {\r\n $scope.selected = false;\r\n selectChildren($scope.selected);\r\n });\r\n\r\n this.updateTime = function () {\r\n var clinicalTime = $scope.updateTotalTime({session: $scope.session, isClinical: true});\r\n if(clinicalTime === undefined){\r\n clinicalTime = {\r\n hours: '00',\r\n minutes: '00',\r\n seconds: '00'\r\n };\r\n } \r\n \r\n var totalTime = $scope.updateTotalTime({session: $scope.session, isClinical: false});\r\n if(totalTime === undefined){\r\n totalTime = {\r\n hours: '00',\r\n minutes: '00',\r\n seconds: '00'\r\n };\r\n } \r\n \r\n $scope.clinicalTimeHours = clinicalTime.hours;\r\n $scope.clinicalTimeMinutes = clinicalTime.minutes;\r\n $scope.clinicalTimeSeconds = clinicalTime.seconds;\r\n\r\n $scope.totalTimeHours = totalTime.hours;\r\n $scope.totalTimeMinutes = totalTime.minutes;\r\n $scope.totalTimeSeconds = totalTime.seconds;\r\n\r\n if ($scope.updateParentController) {\r\n $scope.updateParentController();\r\n }\r\n };\r\n\r\n this.updateTime();\r\n\r\n function selectChildren(selected) {\r\n if ($scope.session.TimeLogs) {\r\n lodash.forEach($scope.session.TimeLogs, function(timeLog){\r\n timeLog.Parent.selected = selected;\r\n });\r\n }\r\n }\r\n }\r\n\r\n function linker(scope, element, attrs, controller) {\r\n scope.updateParentController = function () {\r\n controller.updateTime();\r\n };\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: linker,\r\n restrict: 'E',\r\n require: '^timeLogDetailDay',\r\n replace: true,\r\n transclude: true,\r\n scope: {\r\n session: '=session',\r\n updateTotalTime: '&',\r\n isAuditView: '=isAuditView'\r\n },\r\n templateUrl: 'modules/time_log/detail/detail.session.tpl.html'\r\n }\r\n}\r\n\r\nangular.module(\"time_log.detail\").directive('timeLogDetailSession', PatientTimeLogSessionDirective);","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/time_log/detail/detail.session.tpl.html',\n '
          {{session.label}}
          ( {{session.timeLabel}} ) {{clinicalTimeHours}} {{clinicalTimeMinutes}} {{clinicalTimeSeconds}}
          ( {{session.timeLabel}} ) {{totalTimeHours}} {{totalTimeMinutes}} {{totalTimeSeconds}}
          ');\n}]);\n}(window, document, window.angular));","function PatientTimeLogTimeDirective(vhSweetAlert, $uibModal) {\r\n\r\n function controller($scope, PatientTimeLogUtilitiesService) {\r\n var dm = this;\r\n\r\n $scope.selected = false;\r\n $scope.enabled = true;\r\n $scope.totalTimeHours = '00';\r\n $scope.totalTimeMinutes = '00';\r\n $scope.totalTimeSeconds = '00';\r\n $scope.timeIsOpen = false;\r\n \r\n \r\n $scope.validationError = false;\r\n $scope.notWholeNumber = false;\r\n $scope.negativeNumber = false;\r\n $scope.emptyString = false;\r\n\r\n $scope.$watch('timeLog.selected', function () {\r\n $scope.timeIsOpen = $scope.timeLog.selected;\r\n $scope.selected = $scope.timeLog.selected;\r\n });\r\n\r\n $scope.select = function(){\r\n $scope.selected = true;\r\n };\r\n\r\n $scope.isValidMinutes = function(minutes) {\r\n function isInt(n) {\r\n return n % 1 === 0;\r\n }\r\n if(minutes === \"\"){\r\n $scope.emptyString = true;\r\n }\r\n if(minutes >300) {\r\n $scope.validationError = true;\r\n }\r\n if(!isInt(minutes)) {\r\n $scope.notWholeNumber = true;\r\n }\r\n\r\n if(minutes < 0) {\r\n $scope.negativeNumber = true;\r\n }\r\n\r\n if(minutes === \"\" || minutes > 300 || !isInt(minutes) || minutes < 0){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n };\r\n \r\n $scope.setMinutesValid = function() {\r\n $scope.validationError = false;\r\n $scope.notWholeNumber = false;\r\n $scope.negativeNumber = false;\r\n $scope.emptyString = false;\r\n };\r\n\r\n\r\n $scope.updateAction = function(action) {\r\n if($scope.timeLog.Action === action) {\r\n return false;\r\n }\r\n $scope.timeLog.Action = action;\r\n $scope.updateTimeLog({timeLog: $scope.timeLog, property: 'Action'});\r\n };\r\n\r\n\r\n \r\n\r\n $scope.selectToggle = function() {\r\n $scope.selected = !$scope.selected;\r\n $scope.timeIsOpen = !$scope.timeIsOpen; \r\n };\r\n\r\n $scope.oncancel = function() {\r\n $scope.setMinutesValid();\r\n if($scope.totalTimeMinutes < 300){\r\n $scope.validationError = false;\r\n }\r\n };\r\n \r\n $scope.updateMinutes = function(minutes) {\r\n $scope.setMinutesValid();\r\n if(!$scope.isValidMinutes(minutes)){\r\n return \"\";\r\n }\r\n else{\r\n if($scope.timeLog.minutes === minutes){ \r\n return false;\r\n }\r\n if(minutes === 1){\r\n $scope.timeLog.minutesDisplay = '1 min'; \r\n }\r\n else {\r\n $scope.timeLog.minutesDisplay = minutes + ' mins';\r\n } \r\n $scope.timeLog.minutes = parseInt(minutes); \r\n $scope.updateTimeLog({timeLog: $scope.timeLog, property: 'Minutes'});\r\n dm.updateTime();\r\n $scope.updateParentController();\r\n $scope.validationError = false;\r\n\r\n }\r\n\r\n };\r\n\r\n dm.updateTime = function() {\r\n var totalTime = $scope.updateTotalTime({timeLog: $scope.timeLog});\r\n $scope.totalTimeHours = totalTime.hours;\r\n $scope.totalTimeMinutes = totalTime.minutes;\r\n $scope.totalTimeSeconds = totalTime.seconds;\r\n };\r\n\r\n $scope.showDeleteTimeLogModal = function () {\r\n var modalInstance = $uibModal.open({\r\n templateUrl: 'modules/time_log/detail/deletedetail.modal.html',\r\n controller: 'DeleteTimeLogDetailController as vm',\r\n backdrop: 'static',\r\n size: 'sm',\r\n resolve: {\r\n timeLog: function () {\r\n return $scope.timeLog;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (timeLog) {\r\n $scope.deleteTimeLog({timeLog: timeLog});\r\n\r\n timeLog.StopTime_UTC = timeLog.StartTime_UTC;\r\n dm.updateTime();\r\n $scope.updateParentController();\r\n });\r\n }\r\n\r\n $scope.getCaregiver = function(timeLog, type) {\r\n var name = PatientTimeLogUtilitiesService.getCaregiver(timeLog, type);\r\n\r\n return name;\r\n }\r\n\r\n $scope.getDateTimeDisplay = function(type) {\r\n var date;\r\n if(type === 'Delete') {\r\n date = $scope.timeLog.DeletedDateTime_UTC;\r\n }\r\n else {\r\n date = $scope.timeLog.ModifiedDateTime_UTC;\r\n }\r\n\r\n var retVal = PatientTimeLogUtilitiesService.getDateDisplay(date);\r\n\r\n retVal += ' at ' + PatientTimeLogUtilitiesService.getTimeDisplay(date);\r\n\r\n return retVal;\r\n }\r\n\r\n $scope.delete = function() {\r\n vhSweetAlert.verify('Are you sure?', 'Are you sure you want to delete this time log entry?', 'Delete')\r\n .then(function(isConfirm) {\r\n if (isConfirm) {\r\n $scope.deleteTimeLog({timeLog: $scope.timeLog});\r\n\r\n $scope.timeLog.StopTime_UTC = $scope.timeLog.StartTime_UTC;\r\n dm.updateTime();\r\n $scope.updateParentController();\r\n }\r\n }\r\n );\r\n };\r\n\r\n dm.updateTime();\r\n }\r\n\r\n function linker(scope, element, attrs, controller){\r\n scope.updateParentController = function () {\r\n controller.updateTime();\r\n };\r\n }\r\n\r\n return {\r\n controller: controller,\r\n link: linker,\r\n restrict: 'E',\r\n require: '^timeLogDetailSession',\r\n replace: true,\r\n transclude: true,\r\n scope: {\r\n timeLog: '=timeLog',\r\n isAuditView: '=isAuditView',\r\n updateTimeLog: '&',\r\n updateTotalTime: '&',\r\n deleteTimeLog: '&',\r\n isClinical: '&', \r\n },\r\n templateUrl: 'modules/time_log/detail/detail.time.tpl.html'\r\n }\r\n}\r\n\r\nangular.module(\"time_log.detail\").directive('timeLogDetailTime', PatientTimeLogTimeDirective);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/time_log/detail/detail.time.tpl.html',\n '
          {{timeLog.Action}} {{timeLog.Action}} ({{timeLog.minutesDisplay}}) ({{timeLog.minutesDisplay}})
          Duration must not be empty
          Duration must be 300 minutes or less
          Duration must be a whole number
          Duration must be a positive number
          Deleted {{timeLog.DeletedReason}} (Deleted by: {{::getCaregiver(timeLog, \\'Delete\\')}} on {{::getDateTimeDisplay(\\'Delete\\')}}) Added (Added by: {{::getCaregiver(timeLog, \\'Current\\')}} on {{::getDateTimeDisplay(\\'Modify\\')}}) (Modified by: {{::getCaregiver(timeLog, \\'Current\\')}} on {{::getDateTimeDisplay(\\'Modify\\')}}) (Modified by: {{getCaregiver(timeLog, \\'Current\\')}} on {{getDateTimeDisplay(\\'Modify\\')}})
          {{timeLog.CareManagementType}}
          ( {{timeLog.timeLabel}} ) {{totalTimeHours}} {{totalTimeMinutes}} {{totalTimeSeconds}}
          ');\n}]);\n}(window, document, window.angular));","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/time_log/detail/detail.tpl.html',\n '
          Patient Time Log
          {{vm.clinicalTimeHours}} {{vm.clinicalTimeMinutes}} {{vm.clinicalTimeSeconds}}
          {{vm.totalTimeHours}} {{vm.totalTimeMinutes}} {{vm.totalTimeSeconds}}

          ');\n}]);\n}(window, document, window.angular));","function PatientTimeLogUtilitiesService(lodash, $locale, $filter) {\r\n\r\n // Generic\r\n function GetTimeDisplay(dateTime) {\r\n var date = new Date(Date.parse(dateTime));\r\n return date.toLocaleTimeString($locale.id, {hour12: false});\r\n }\r\n\r\n function GetDateDisplay(dateTime) {\r\n return $filter(\"datetime\")(dateTime, 'date');\r\n }\r\n\r\n function GetMonthOffset(date) {\r\n var currentDate = new Date();\r\n var currentYear = currentDate.getUTCFullYear();\r\n var currentMonth = currentDate.getUTCMonth();\r\n\r\n var selectedYear = date.getUTCFullYear();\r\n var selectedMonth = date.getUTCMonth();\r\n\r\n var monthOffset = ((currentYear * 12) + currentMonth) - ((selectedYear * 12) + selectedMonth);\r\n\r\n return monthOffset;\r\n }\r\n\r\n // TimeLog display specific\r\n function GetTotalTime(logs, isClinical, isAudit) {\r\n if (isClinical) {\r\n logs = lodash.where(logs, {'IsClinical': true});\r\n }\r\n\r\n var diffs = [];\r\n if (isAudit) {\r\n diffs = lodash.pluck(logs, 'AuditTimeDiff');\r\n }\r\n else {\r\n diffs = lodash.pluck(logs, 'TimeDiff');\r\n }\r\n\r\n var time = lodash.sum(diffs);\r\n\r\n var totalSeconds = Math.floor(time / 1000);\r\n\r\n var seconds = totalSeconds % 60;\r\n var minutes = Math.floor(totalSeconds / 60 % 60);\r\n var hours = Math.floor(totalSeconds / 60 / 60);\r\n\r\n var logTimes = getTimeStrings(seconds, minutes, hours);\r\n\r\n return {\r\n hours: logTimes.hours,\r\n minutes: logTimes.minutes,\r\n seconds: logTimes.seconds\r\n };\r\n }\r\n\r\n function getTimeStrings(seconds, minutes, hours) {\r\n\r\n var hourString;\r\n if (hours >= 100) {\r\n hourString = hours;\r\n }\r\n else {\r\n hourString = ('0' + hours).slice(-2);\r\n }\r\n\r\n var minuteString;\r\n if (minutes >= 100) {\r\n minuteString = minutes;\r\n }\r\n else {\r\n minuteString = ('0' + minutes).slice(-2);\r\n }\r\n var secondString = ('0' + seconds).slice(-2);\r\n\r\n return {\r\n hours: hourString,\r\n minutes: minuteString,\r\n seconds: secondString\r\n };\r\n }\r\n\r\n // TimeLog model specific\r\n function GetModel(days) {\r\n var model = lodash.map(days, function (d) {\r\n d.selected = false;\r\n d.isVisible = true;\r\n d.dateLabel = GetDateDisplay(d.Day);\r\n\r\n return {\r\n day: d,\r\n sessions: lodash.map(d.Sessions, function (s) {\r\n s.label = GetCaregiver(s.TimeLogs[0].Parent);\r\n s.isClinical = s.TimeLogs[0].Parent.IsClinical;\r\n s.clinicalText = 'Clinical';\r\n s.selected = false;\r\n s.isVisible = true;\r\n\r\n var sessionStartTime = Date.parse(s.StartDateTime);\r\n var sessionStartDate = new Date(sessionStartTime);\r\n\r\n s.timeLabel = GetTimeDisplay(sessionStartDate);\r\n\r\n return {\r\n session: s,\r\n timeLogs: lodash.map(s.TimeLogs, function (l) {\r\n l.Parent.selected = false;\r\n l.Parent.isDeleted = l.Parent.DeletedBy_Id !== null;\r\n l.Parent.isAdded = l.Parent.StartTimeLogTypeId === 9;\r\n l.Parent.isClinical = s.isClinical;\r\n l.Parent.hasAudits = l.TimeLogAudits.length > 0;\r\n\r\n var logStartTime = Date.parse(l.Parent.StartTime_UTC);\r\n\r\n var logStartDate = new Date(logStartTime);\r\n\r\n var logTimeDiff = parseInt(l.Parent.TimeDiff / 1000) * 1000;\r\n var logStopDate = new Date(logStartTime + logTimeDiff);\r\n\r\n l.Parent.timeLabel = GetTimeDisplay(logStartDate) + ' - ' + GetTimeDisplay(logStopDate);\r\n l.Parent.minutes = Math.round((l.Parent.TimeDiff) / 1000 / 60);\r\n\r\n if(logTimeDiff === 0){\r\n l.Parent.minutesDisplay = '0 mins';\r\n }\r\n else if(l.Parent.minutes === 0){\r\n l.Parent.minutesDisplay = '< 1 min';\r\n }\r\n else if(l.Parent.minutes === 1){\r\n l.Parent.minutesDisplay = '1 min';\r\n }\r\n else {\r\n l.Parent.minutesDisplay = l.Parent.minutes + ' mins';\r\n }\r\n\r\n return {\r\n timeLog: l.Parent,\r\n timeLogAudits: lodash.map(l.TimeLogAudits, function (a) {\r\n a.selected = false;\r\n a.isDeleted = a.AuditDeletedBy_Id !== null;\r\n a.isClinical = l.Parent.IsClinical;\r\n a.auditType = getAuditType(l.Parent, a, l.TimeLogAudits);\r\n\r\n var auditStartTime = Date.parse(a.AuditStartTime);\r\n var auditStartDate = new Date(auditStartTime);\r\n\r\n var auditTimeDiff = parseInt(a.AuditTimeDiff / 1000) * 1000;\r\n var auditStopDate = new Date(auditStartTime + auditTimeDiff);\r\n\r\n a.timeLabel = GetTimeDisplay(auditStartDate) + ' - ' + GetTimeDisplay(auditStopDate);\r\n a.minutes = Math.round((a.AuditTimeDiff) / 1000 / 60);\r\n\r\n if(auditTimeDiff === 0){\r\n a.minutesDisplay = '0 mins';\r\n }\r\n else if(a.minutes === 0){\r\n a.minutesDisplay = '< 1 min';\r\n }\r\n else if(a.minutes === 1){\r\n a.minutesDisplay = '1 min';\r\n }\r\n else {\r\n a.minutesDisplay = a.minutes + ' mins';\r\n }\r\n\r\n return {\r\n timeLogAudit: a\r\n };\r\n })\r\n };\r\n })\r\n };\r\n })\r\n };\r\n });\r\n\r\n return model;\r\n }\r\n\r\n function UpdateAudits(day, audits) {\r\n var timeLogs = lodash.flatten(lodash.pluck(day.sessions, 'timeLogs'));\r\n lodash.forEach(timeLogs, function(l){\r\n var newAudits = getTimeLogAudits(l.timeLog.TimeLogId, audits);\r\n var timeLogAudits = lodash.map(newAudits, function(a){\r\n a.selected = false;\r\n a.isDeleted = a.AuditDeletedBy_Id !== null;\r\n a.isClinical = l.timeLog.IsClinical;\r\n a.auditType = getAuditType(l.timeLog, a, l.timeLogAudits);\r\n\r\n var auditStartTime = Date.parse(a.AuditStartTime);\r\n var auditStartDate = new Date(auditStartTime);\r\n\r\n var auditTimeDiff = parseInt(a.AuditTimeDiff / 1000) * 1000;\r\n var auditStopDate = new Date(auditStartTime + auditTimeDiff);\r\n\r\n a.timeLabel = GetTimeDisplay(auditStartDate) + ' - ' + GetTimeDisplay(auditStopDate);\r\n a.minutes = Math.round((a.AuditTimeDiff) / 1000 / 60);\r\n if(auditTimeDiff === 0){\r\n a.minutesDisplay = '0 mins';\r\n }\r\n else if(a.minutes === 0){\r\n a.minutesDisplay = '< 1 min';\r\n }\r\n else if(a.minutes === 1){\r\n a.minutesDisplay = '1 min';\r\n }\r\n else {\r\n a.minutesDisplay = a.minutes + ' mins';\r\n }\r\n\r\n l.timeLog.CurrentCaregiverFirstName = a.CurrentCaregiverFirstName;\r\n l.timeLog.CurrentCaregiverLastName = a.CurrentCaregiverLastName;\r\n l.timeLog.CurrentCaregiverTitleName = a.CurrentCaregiverTitleName;\r\n l.timeLog.ModifiedDateTime_UTC = a.ModifiedDateTime_UTC;\r\n l.timeLog.DeletedBy_Id = a.DeletedBy_Id;\r\n l.timeLog.DeletedReason = a.DeletedReason;\r\n l.timeLog.DeleteCaregiverFirstName = a.DeleteCaregiverFirstName;\r\n l.timeLog.DeleteCaregiverLastName = a.DeleteCaregiverLastName;\r\n l.timeLog.DeleteCaregiverTitleName = a.DeleteCaregiverTitleName;\r\n l.timeLog.DeletedDateTime_UTC = a.DeletedDateTime_UTC;\r\n\r\n return {\r\n timeLogAudit: a\r\n };\r\n });\r\n\r\n l.timeLog.hasAudits = timeLogAudits.length > 0;\r\n l.timeLogAudits = timeLogAudits;\r\n });\r\n }\r\n\r\n function GetCaregiver(timeLog, type) {\r\n var name = '';\r\n\r\n if(type && type === 'Delete' && timeLog.DeleteCaregiverLastName !== null) {\r\n if (timeLog.DeleteCaregiverLastName.length > 0) {\r\n name += timeLog.DeleteCaregiverLastName;\r\n }\r\n if (timeLog.DeleteCaregiverFirstName.length > 0) {\r\n name += ', ' + timeLog.DeleteCaregiverFirstName;\r\n }\r\n name += ' ' + timeLog.DeleteCaregiverTitleName;\r\n }\r\n else if(type && type === 'Modify' && timeLog.ModifyCaregiverLastName !== null) {\r\n if (timeLog.ModifyCaregiverLastName.length > 0) {\r\n name += timeLog.ModifyCaregiverLastName;\r\n }\r\n if (timeLog.ModifyCaregiverFirstName.length > 0) {\r\n name += ', ' + timeLog.ModifyCaregiverFirstName;\r\n }\r\n name += ' ' + timeLog.ModifyCaregiverTitleName;\r\n }\r\n else if(type && type === 'Current') {\r\n if (timeLog.CurrentCaregiverLastName.length > 0) {\r\n name += timeLog.CurrentCaregiverLastName;\r\n }\r\n if (timeLog.CurrentCaregiverFirstName.length > 0) {\r\n name += ', ' + timeLog.CurrentCaregiverFirstName;\r\n }\r\n name += ' ' + timeLog.CurrentCaregiverTitleName;\r\n }\r\n else {\r\n if (timeLog.CaregiverLastName.length > 0) {\r\n name += timeLog.CaregiverLastName;\r\n }\r\n if (timeLog.CaregiverFirstName.length > 0) {\r\n name += ', ' + timeLog.CaregiverFirstName;\r\n }\r\n name += ' ' + timeLog.CaregiverTitleName;\r\n }\r\n\r\n return name;\r\n }\r\n\r\n function FilterType(d, type, isAuditView) {\r\n d.day.isVisible = false;\r\n var hasSessions = false;\r\n d.day.isDeleted = true;\r\n lodash.forEach(d.sessions, function (s) {\r\n var logs = lodash.pluck(s.timeLogs, 'timeLog');\r\n var hasVisibleLogs = !lodash.every(logs, {'isDeleted': true});\r\n var isVisible = type === 'All' || (s.session.isClinical === (type === 'Clinical'));\r\n s.session.isVisible = (isAuditView || hasVisibleLogs) && isVisible;\r\n s.session.isDeleted = !hasVisibleLogs;\r\n d.day.isVisible = d.day.isVisible || s.session.isVisible;\r\n hasSessions = hasSessions || !s.session.isDeleted;\r\n });\r\n d.day.isDeleted = !hasSessions;\r\n }\r\n\r\n function Expand(day) {\r\n day.day.selected = true;\r\n\r\n for (var i = 0; i < day.sessions.length; i++) {\r\n day.sessions[i].session.selected = true;\r\n }\r\n }\r\n\r\n function Collapse(day) {\r\n day.day.selected = false;\r\n\r\n for (var i = 0; i < day.sessions.length; i++) {\r\n day.sessions[i].session.selected = false;\r\n }\r\n }\r\n\r\n function getTimeLogAudits(timeLogId, audits) {\r\n var retVal = [];\r\n\r\n lodash.forEach(audits, function(a){\r\n if(a.parentId === timeLogId){\r\n retVal = a.timeLogAudits;\r\n return false;\r\n }\r\n });\r\n\r\n return retVal;\r\n }\r\n\r\n function getAuditType(parent, audit, audits) {\r\n var retVal = 'Deleted';\r\n\r\n var index = audits.indexOf(audit);\r\n if(index == audits.length - 1) {\r\n if(audit.StartTimeLogTypeId === 9){\r\n audit.isAdded = true;\r\n }\r\n else {\r\n audit.isAdded = false;\r\n }\r\n }\r\n else {\r\n var previousAudit = audits[index + 1];\r\n if(!previousAudit.AuditAction){\r\n previousAudit = previousAudit.timeLogAudit;\r\n }\r\n\r\n if(previousAudit.AuditAction !== audit.AuditAction){\r\n retVal = 'Action';\r\n }\r\n else if(previousAudit.AuditTimeDiff !== audit.AuditTimeDiff) {\r\n retVal = 'TimeDiff';\r\n }\r\n }\r\n\r\n if(index === 0) {\r\n if(parent.Action !== audit.AuditAction) {\r\n parent.auditType = 'Action';\r\n }\r\n else if(parent.TimeDiff !== audit.AuditTimeDiff) {\r\n parent.auditType = 'TimeDiff';\r\n }\r\n }\r\n\r\n return retVal;\r\n }\r\n\r\n return {\r\n getTimeDisplay: GetTimeDisplay,\r\n getDateDisplay: GetDateDisplay,\r\n getMonthOffset: GetMonthOffset,\r\n getTotalTime: GetTotalTime,\r\n getModel: GetModel,\r\n getCaregiver: GetCaregiver,\r\n updateAudits: UpdateAudits,\r\n filterType: FilterType,\r\n expand: Expand,\r\n collapse: Collapse\r\n };\r\n}\r\n\r\nangular.module('time_log.detail').factory('PatientTimeLogUtilitiesService', PatientTimeLogUtilitiesService);\r\n","function vhToaster() {\r\n return {\r\n restrict: 'E',\r\n templateUrl: 'modules/toast/vhToaster.tpl.html',\r\n scope: true,\r\n controllerAs: 'vm',\r\n bindToController: true,\r\n controller: function($scope, $rootScope) {\r\n var vm = this;\r\n var alertId = 0;\r\n vm.alerts = [];\r\n $rootScope.$on('vh:notify', function (event, notification) {\r\n let alert = angular.copy(notification);\r\n alert.type = alert.type || 'primary';\r\n alert.alertId = ++alertId;\r\n\r\n vm.alerts.unshift(alert);\r\n });\r\n\r\n vm.closeAlert = function(alertId) {\r\n let index = vm.alerts.findIndex(alert => alert.alertId === alertId);\r\n if (index >= 0) {\r\n vm.alerts.splice(index, 1);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"toast\").directive(\"vhToaster\", vhToaster);\r\n","(function(window, document, angular, undefined){angular.module('app').run(['$templateCache', function($templateCache) {\n $templateCache.put('modules/toast/vhToaster.tpl.html',\n '
          {{alert.text}}
          ');\n}]);\n}(window, document, window.angular));"]}