public PhysicianController()
 {
     _physicianStatusService = new PhysicianStatusService();
     _physician = new PhysicianService();
     _physicianStatusLogService    = new PhysicianStatusLogService();
     _physicianStatusSnoozeService = new PhysicianStatusSnoozeService();
     _caseService = new CaseService();
     _uclService  = new UCLService();
 }
 public AdminController()
 {
     _adminService              = new AdminService();
     _physicianService          = new PhysicianService();
     _physicianStatus           = new PhysicianStatusService();
     _physicianStatusLogService = new PhysicianStatusLogService();
     _userLogService            = new AspNetUsersLogService();
     _alarmTuneService          = new AlarmTuneService();
     _userVerificationService   = new UserVerificationService();
 }
예제 #3
0
 public UserProfileController()
 {
     _adminService              = new AdminService();
     _physicianService          = new PhysicianService();
     _physicianStatus           = new PhysicianStatusService();
     _physicianStatusLogService = new PhysicianStatusLogService();
     _userLogService            = new AspNetUsersLogService();
     _physicianLicenseService   = new PhysicianLicenseService();
     _facilityPhysicianService  = new FacilityPhysicianService();
     _UserProfileService        = new UserProfileServices();
 }
예제 #4
0
        private bool RunStatusUpdateCode(PhysicianDashboardViewModel item, double snoozeMinutes)
        {
            var elapsedTime = DateTime.Now.ToEST() - item.physician.status_change_date_forAll.Value.AddMinutes(snoozeMinutes);

            var hasExceededThreshhold = item.physician.physician_status.phs_move_threshhold_time.HasValue ?
                                        item.physician.physician_status.phs_move_threshhold_time.Value.TotalMilliseconds < elapsedTime.TotalMilliseconds : false;

            if (!hasExceededThreshhold)
            {
                return(false);
            }

            item.physician.status_key = item.physician.physician_status.phs_move_status_key.Value;

            #region ---- Applying Rule 3 Define in TCARE-11 -  Physician Status Rules/Changes -----

            var  status             = item.physician.physician_status.physician_status2.phs_key;
            bool isUpdateStatusDate = true;
            if (item.physician.physician_status.phs_key == PhysicianStatus.Stroke.ToInt() && status == PhysicianStatus.TPA.ToInt())
            {
                isUpdateStatusDate = false;
            }

            #endregion


            if (isUpdateStatusDate)
            {
                item.physician.status_change_date    = DateTime.Now.ToEST();
                item.physician.status_change_cas_key = null;
            }
            item.physician.status_change_date_forAll = DateTime.Now.ToEST();

            using (var objLogService = new PhysicianStatusLogService())
            {
                objLogService.Create(new Model.physician_status_log
                {
                    psl_user_key     = item.physician.Id,
                    psl_created_by   = "move to status service",
                    psl_created_date = DateTime.Now.ToEST(),
                    psl_phs_key      = status,
                    psl_status_name  = item.physician.physician_status.physician_status2.phs_name,
                });
            }


            return(true);
        }
예제 #5
0
        public void ResetUnSchedulePhysicians()
        {
            try
            {
                // create log
                _logger.AddLogEntry(_service3Name, "INPROGRESS", _service3Name + " Started", "");

                using (var objService = new PhysicianService())
                {
                    var now        = DateTime.Now.ToEST();
                    var physicians = objService.GetUnSchedulePhysiciansForService()
                                     .ToList();
                    physicians.ForEach(p =>
                    {
                        p.status_key                = PhysicianStatus.NotAvailable.ToInt();
                        p.status_change_date        = now;
                        p.status_change_cas_key     = null;
                        p.status_change_date_forAll = now;

                        using (var objLogService = new PhysicianStatusLogService())
                        {
                            objLogService.Create(new Model.physician_status_log
                            {
                                psl_user_key     = p.Id,
                                psl_created_by   = "unscheduled physicians service",
                                psl_created_date = DateTime.Now.ToEST(),
                                psl_phs_key      = PhysicianStatus.NotAvailable.ToInt(),
                                psl_start_date   = DateTime.Now.ToEST(),
                                psl_status_name  = PhysicianStatus.NotAvailable.ToString()
                            });
                        }
                    });

                    if (physicians.Count() > 0)
                    {
                        objService.SaveChanges();
                        var    physicianUserIds = physicians.Select(m => m.Id).ToList();
                        string url      = scrapper.baseUrl + "/RPCHandler/RefreshPhysicianStatus?SignalRAuthKey=" + Settings.SignalRAuthKey;
                        string postData = Newtonsoft.Json.JsonConvert.SerializeObject(physicianUserIds);
                        scrapper.GetData(url, "POST", postData, ref Cookies, ContentTypes.Json);
                    }

                    var Nhphysicians = objService.GetNHUnSchedulePhysiciansForService()
                                       .ToList();
                    Nhphysicians.ForEach(p =>
                    {
                        p.status_key                = PhysicianStatus.NotAvailable.ToInt();
                        p.status_change_date        = now;
                        p.status_change_cas_key     = null;
                        p.status_change_date_forAll = now;

                        using (var objLogService = new PhysicianStatusLogService())
                        {
                            objLogService.Create(new Model.physician_status_log
                            {
                                psl_user_key     = p.Id,
                                psl_created_by   = "unscheduled physicians service",
                                psl_created_date = DateTime.Now.ToEST(),
                                psl_phs_key      = PhysicianStatus.NotAvailable.ToInt(),
                                psl_start_date   = DateTime.Now.ToEST(),
                                psl_status_name  = PhysicianStatus.NotAvailable.ToString()
                            });
                        }
                    });

                    if (Nhphysicians.Count() > 0)
                    {
                        objService.SaveChanges();
                        var    physicianUserIds = Nhphysicians.Select(m => m.Id).ToList();
                        string url      = scrapper.baseUrl + "/RPCHandler/RefreshPhysicianStatus?SignalRAuthKey=" + Settings.SignalRAuthKey;
                        string postData = Newtonsoft.Json.JsonConvert.SerializeObject(physicianUserIds);
                        scrapper.GetData(url, "POST", postData, ref Cookies, ContentTypes.Json);
                    }
                }
            }
            catch (Exception exception)
            {
                _logger.AddLogEntry(_service3Name, "ERROR", exception, "");
            }
            finally
            {
                _logger.AddLogEntry(_service3Name, "COMPLETED", "", "");
            }
        }