public ActionResult Index(string id = "")
        {
            id = string.IsNullOrEmpty(id) ? User.Identity.GetUserId() : id;
            var physician = _physician.GetDetail(id);
            // excluding the current status from list
            var list = _physicianStatusService.GetAll().Where(m => m.phs_key != physician.status_key);

            #region Rules Added Define in Ticket TCARE-11 Physician Status Rules/Changes
            if (User.IsInRole(UserRoles.Physician.ToDescription()))
            {
                var notAvailable = PhysicianStatus.NotAvailable.ToInt();
                list = list.Where(m => m.phs_key != notAvailable);
            }

            if (physician?.physician_status?.phs_key != PhysicianStatus.Stroke.ToInt())
            {
                var tpa = PhysicianStatus.TPA.ToDescription();
                list = list.Where(m => m.phs_name.ToLower() != tpa);
            }

            #endregion

            ViewBag.physician = physician;
            ViewBag.Id        = id;
            return(GetViewResult(list.ToList()));
        }
        private async Task AddUserToRole(MyUserRole model)
        {
            var user = await UserManager.FindByIdAsync(model.UserId);

            model.UserRoleId = Guid.NewGuid().ToString();


            //check if same role exists already
            var prevRoleExists = user.Roles.Where(x => x.UserId == model.UserId &&
                                                  x.RoleId == model.RoleId
                                                  ).Any();

            #region Adding entry in physician table in case of role is physician
            var role = await RoleManager.FindByNameAsync(UserRoles.Physician.ToDescription());

            var physician = _physicianService.GetDetail(model.UserId);
            // if the user role has been changed from physician to some different role
            if (role.Id != model.RoleId && physician != null)
            {
                user.status_key                = null;
                user.status_change_date        = DateTime.Now.ToEST();
                user.status_change_date_forAll = DateTime.Now.ToEST();
                user.status_change_cas_key     = null;
                UserManager.Update(user);
            }
            else if (role.Id == model.RoleId && physician != null)
            {
                if (!user.status_key.HasValue)
                {
                    var defaultStatus = _physicianStatus.GetDefault();

                    user.status_key                = defaultStatus.phs_move_status_key;
                    user.status_change_date        = DateTime.Now.ToEST();
                    user.status_change_date_forAll = DateTime.Now.ToEST();
                    user.status_change_cas_key     = null;
                    UserManager.Update(user);
                }
            }

            #endregion

            //if not only then add that role
            if (!prevRoleExists)
            {
                user.Roles.Add(model);
                IdentityResult identityResult = await UserManager.UpdateAsync(user);
            }
        }