public ActionResult Create(post_acute_care model) { model.pac_is_active = true; model.pac_callback = Functions.ClearPhoneFormat(model.pac_callback); model.pac_created_by = loggedInUser.Id; model.pac_created_by_name = loggedInUser.FullName; model.pac_created_date = DateTime.Now.ToEST(); model.pac_date_of_completion = DateTime.Now.ToEST(); if (model.pac_patient != null) { model.pac_billing_patient_name = model.pac_patient; } if (model.pac_dob != null) { model.pac_billing_dob = model.pac_dob; } if (model.pac_identification_type != null) { model.pac_billing_identification_type = model.pac_identification_type; } if (model.pac_identification_number != null) { model.pac_billing_identification_number = model.pac_identification_number; } if (model.pac_cst_key == null) { model.pac_cst_key = PacStatus.Open.ToInt(); } _postacutecareService.Create(model); return(GetSuccessResult(Url.Action("EditPAC", new { id = model.pac_key }))); }
public ActionResult CreateNavigator(post_acute_care model) { model.pac_cst_key = PacStatus.Open.ToInt(); model.pac_is_active = true; model.pac_callback = Functions.ClearPhoneFormat(model.pac_callback); model.pac_created_by = loggedInUser.Id; model.pac_created_by_name = loggedInUser.FullName; model.pac_created_date = DateTime.Now.ToEST(); model.pac_date_of_completion = DateTime.Now.ToEST(); _postacutecareService.Create(model); return(ShowSuccessMessageOnly("Case Created Successfully", model)); }
public ActionResult GeneratePACTemplate(post_acute_care model) { try { var physicians = _postacutecareService.getPACPhysicains(); var name = physicians.Where(x => x.Id == model.pac_phy_key).Select(c => c.FirstName).FirstOrDefault(); ViewBag.PhysicianName = name; var result = RenderPartialViewToString("Templates/Preview/_PACCaseTemplate", model); return(Json(new { success = true, data = result, showEditor = true })); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(Json(new { success = false })); } }
public ActionResult Create() { ViewBag.physicians = _postacutecareService.getPACPhysicains(); ViewBag.PacCaseType = _uclService.GetUclData(UclTypes.PacCaseType).ToList(); var tempstatus = _uclService.GetUclData(UclTypes.PacStatus).ToList(); var statuswithoucomplete = tempstatus.Where(x => x.ucd_title != "Complete").ToList(); ViewBag.PacStatus = statuswithoucomplete; ViewBag.IsEdit = false; post_acute_care _post_acute_care = new post_acute_care(); _post_acute_care.pac_cst_key = PacStatus.Open.ToInt(); return(View(_post_acute_care)); }
public ActionResult EditPAC(int id, bool isReadOnly = false) { ViewBag.IsReadOnlyCase = isReadOnly; ViewBag.PacCaseType = _uclService.GetUclData(UclTypes.PacCaseType).ToList(); var tempstatus = _uclService.GetUclData(UclTypes.PacStatus).ToList(); var statuswithoucomplete = tempstatus.Where(x => x.ucd_title != "Complete").ToList(); if (User.IsInRole(UserRoles.Navigator.ToDescription())) { ViewBag.PacStatus = statuswithoucomplete; } else { ViewBag.PacStatus = tempstatus; } var model = new post_acute_care(); try { ViewBag.physicians = _postacutecareService.getPACPhysicains(); ViewBag.IsEdit = true; model = _postacutecareService.GetDetails(id); ViewBag.ctpNAme = _uclService.GetDetails((int)model.pac_ctp_key).ucd_title; } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); } #region Get Billing Codes var types = new List <int>() { UclTypes.SleepCodes.ToInt() }; var uclDataList = _lookUpService.GetUclData(types) .Where(m => m.ucd_is_active) .OrderBy(c => c.ucd_ucl_key).ThenBy(c => c.ucd_sort_order) .ToList(); ViewBag.UclData = uclDataList.Select(m => new { m.ucd_key, m.ucd_title, m.ucd_description, m.ucd_ucl_key, m.ucd_sort_order }).OrderBy(o => o.ucd_sort_order); #endregion return(GetViewResult(model)); }
public ActionResult FacilityInfoHomeHealth(string caseType, int caseTypeKey, string className = "") { try { ViewBag.CaseTypeKey = caseTypeKey; ViewBag.CaseType = caseType; ViewBag.ClassName = className; ViewBag.IsItDashboard = false; var model = new post_acute_care(); model.pac_identification_type = _uCLService.GetDefault(UclTypes.IdentificationType)?.ucd_key; return(View("_FacilityInfoHomeHealth", model)); } catch (Exception ex) { ViewBag.Title = "Error"; ViewBag.Message = "Unexpected error occurred. Please try again."; Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(GetViewResult("Error")); } }
public ActionResult EditPAC(post_acute_care model) { try { post_acute_care dbObject = _postacutecareService.GetDetails(model.pac_key); #region sync billing and general tab fields if (dbObject.pac_patient == null && model.pac_patient != null) { model.pac_billing_patient_name = model.pac_patient; } if (dbObject.pac_patient == null && model.pac_billing_patient_name != null) { model.pac_patient = model.pac_billing_patient_name; } if (dbObject.pac_patient != null && model.pac_patient != dbObject.pac_patient) { model.pac_billing_patient_name = model.pac_patient; } if (dbObject.pac_patient != null && model.pac_billing_patient_name != dbObject.pac_patient) { model.pac_patient = model.pac_billing_patient_name; } //end patient name if (dbObject.pac_dob == null && model.pac_dob != null) { model.pac_billing_dob = model.pac_dob; } if (dbObject.pac_dob == null && model.pac_billing_dob != null) { model.pac_dob = model.pac_billing_dob; } if (dbObject.pac_dob != null && model.pac_dob != dbObject.pac_dob) { model.pac_billing_dob = model.pac_dob; } if (dbObject.pac_dob != null && model.pac_billing_dob != dbObject.pac_dob) { model.pac_dob = model.pac_billing_dob; } // end dob if (dbObject.pac_identification_type == null && model.pac_identification_type != null) { model.pac_billing_identification_type = model.pac_identification_type; } if (dbObject.pac_identification_type == null && model.pac_billing_identification_type != null) { model.pac_identification_type = model.pac_billing_identification_type; } if (dbObject.pac_identification_type != null && model.pac_identification_type != dbObject.pac_identification_type) { model.pac_billing_identification_type = model.pac_identification_type; } if (dbObject.pac_identification_type != null && model.pac_billing_identification_type != dbObject.pac_identification_type) { model.pac_identification_type = model.pac_billing_identification_type; } //end identification type if (dbObject.pac_identification_number == null && model.pac_identification_number != null) { model.pac_billing_identification_number = model.pac_identification_number; } if (dbObject.pac_identification_number == null && model.pac_billing_identification_number != null) { model.pac_identification_number = model.pac_billing_identification_number; } if (dbObject.pac_identification_number != null && model.pac_identification_number != dbObject.pac_identification_number) { model.pac_billing_identification_number = model.pac_identification_number; } if (dbObject.pac_identification_number != null && model.pac_billing_identification_number != dbObject.pac_identification_number) { model.pac_identification_number = model.pac_billing_identification_number; } //end identification number #endregion model.pac_date_of_completion = DateTime.Now.ToEST(); model.pac_is_active = true; var isRedirect = Request.Params["RedirectPage"] == "0" ? false : true; //if (model.pac_seen_by_telespecialist == 2) // NO //{ // model.pac_seen_type = "Video Consult"; //} _postacutecareService.Edit(model); if (isRedirect) { return(GetSuccessResult(Url.Action("Index", "Case"))); /* commented due to #411 - settings.aps_cas_facility_popup_on_load */ } else { return(GetSuccessResult(Url.Action("EditPAC", new { id = model.pac_key }), "Case has been updated successfully")); } } catch (Exception ex) { ViewBag.PostAcuteModel = _postacutecareService.GetDetails(model.pac_key); Elmah.ErrorSignal.FromCurrentContext().Raise(ex); ModelState.AddModelError("", "Error! Please try again."); return(GetErrorResult(model)); } }
public void Create(post_acute_care model) { _unitOfWork.PostAcuteCareRepository.Insert(model); _unitOfWork.Save(); _unitOfWork.Commit(); }
public void Edit(post_acute_care model) { _unitOfWork.PostAcuteCareRepository.Update(model); _unitOfWork.Save(); _unitOfWork.Commit(); }