public IActionResult GetPrimaryCare(Guid appointment_id) { mp_phc_health_history med_history = _evaluationService.GetHealthHistory().FirstOrDefault(e => e.appointment_id == appointment_id); if (med_history == null) { med_history = new mp_phc_health_history(); } mp_phc_mental_status mental_status = _evaluationService.GetMentalStatus().FirstOrDefault(e => e.appointment_id == appointment_id); if (mental_status == null) { mental_status = new mp_phc_mental_status(); } mp_phc_social_history social_history = _evaluationService.GetSocialHistory().FirstOrDefault(e => e.appointment_id == appointment_id); if (social_history == null) { social_history = new mp_phc_social_history(); } return(Ok(new PrimaryCareModel(med_history, mental_status, social_history))); }
public IActionResult PrimaryCareMedicalPartial(Guid profile_id, Guid appointment_id) { ViewBag.appointment_id = appointment_id; ViewBag.profile_id = profile_id; mp_phc_health_history med_history = _evaluationService.GetHealthHistory().FirstOrDefault(e => e.profile_id == profile_id && e.appointment_id == appointment_id); if (med_history == null) { med_history = new mp_phc_health_history(); } mp_phc_mental_status mental_status = _evaluationService.GetMentalStatus().FirstOrDefault(e => e.profile_id == profile_id && e.appointment_id == appointment_id); if (mental_status == null) { mental_status = new mp_phc_mental_status(); } mp_phc_social_history social_history = _evaluationService.GetSocialHistory().FirstOrDefault(e => e.profile_id == profile_id && e.appointment_id == appointment_id); if (social_history == null) { social_history = new mp_phc_social_history(); } ViewBag.med_history = med_history; ViewBag.mental_status = mental_status; ViewBag.social_history = social_history; return(PartialView()); }
public int AddMentalStatus(mp_phc_mental_status mental) { var old = _context.mp_phc_mental_status.FirstOrDefault(e => e.profile_id == mental.profile_id && e.appointment_id == mental.appointment_id); if (old == null) { _context.Add(mental); } else { mental.id = old.id; mental.created_at = old.created_at; mental.create_by = old.create_by; _context.Entry(old).CurrentValues.SetValues(mental); } return(_context.SaveChanges()); }
public string PrimaryCareMedicalPartial(mp_phc_health_history med_history, mp_phc_mental_status mental_status, mp_phc_social_history social_history) { try { med_history.created_at = DateTime.Now; med_history.created_by = _userManager.GetUserId(HttpContext.User); _evaluationService.AddHealthHistory(med_history); mental_status.create_by = _userManager.GetUserId(HttpContext.User); mental_status.created_at = DateTime.Now; _evaluationService.AddMentalStatus(mental_status); social_history.created_at = DateTime.Now; social_history.created_by = _userManager.GetUserId(HttpContext.User); _evaluationService.AddSocialHistory(social_history); return("success"); } catch (System.Exception e) { return("error"); } }
public PrimaryCareModel(mp_phc_health_history health_History, mp_phc_mental_status mental_Status, mp_phc_social_history social_History) { }
public IActionResult MedicalHistory(mp_phc_health_history health_History, mp_phc_medical_history medical_History, mp_phc_mental_status mental_Status, mp_phc_social_history social_History, mp_phc_system_review system_Review) { //save all the information _evaluationService.AddHealthHistory(health_History); _evaluationService.AddMedicaHistory(medical_History); _evaluationService.AddMentalStatus(mental_Status); _evaluationService.AddSocialHistory(social_History); _evaluationService.AddSystemReview(system_Review); return(View()); }