Ejemplo n.º 1
0
        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)));
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
 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());
 }
Ejemplo n.º 4
0
        public int AddSocialHistory(mp_phc_social_history social)
        {
            var old = _context.mp_phc_social_history.FirstOrDefault(e => e.appointment_id == social.appointment_id && e.profile_id == social.profile_id);

            if (old == null)
            {
                _context.Add(social);
            }
            else
            {
                social.id         = old.id;
                social.created_at = old.created_at;
                social.created_by = old.created_by;

                _context.Entry(old).CurrentValues.SetValues(social);
            }

            return(_context.SaveChanges());
        }
 public PrimaryCareModel(mp_phc_health_history health_History, mp_phc_mental_status mental_Status, mp_phc_social_history social_History)
 {
 }
Ejemplo n.º 6
0
        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");
            }
        }