Example #1
0
        public ActionResult ViewReportsWithID(int id)
        {
            if (Convert.ToString(Session["key"]) != "patient")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Reports_Api  rprt = new Reports_Api();
            PatientModel pat  = new PatientModel();

            pat.pid = (int)Session["UserId"];
            List <ReportModel> m = new List <ReportModel>();
            var model            = rprt.GetReportsByAppt(id);

            m.Add(model);
            if (model.appointment_ID != 0)
            {
                return(View("~/Views/Patient/PatientViewReports.cshtml", m));
            }
            else
            {
                ViewBag.info = "Reports are not yet generated";
                return(View("~/Views/Patient/NoReports.cshtml", m));
            }
        }
        public ActionResult UpdateReport(ReportModel report)
        {
            if (Convert.ToString(Session["key"]) != "doctor")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Reports_Api reports_Api = new Reports_Api();

            var model = reports_Api.UpdateReports(report);

            return(View("~/Views/Doctor/DoctorManageReports.cshtml", model));
        }
Example #3
0
        public ActionResult ViewReports()
        {
            if (Convert.ToString(Session["key"]) != "patient")
            {
                return(RedirectToAction("Login", "Home"));
            }
            Reports_Api  rprt = new Reports_Api();
            PatientModel pat  = new PatientModel();

            pat.pid = (int)Session["UserId"];
            var model = rprt.GetReportsByPatient(pat);

            return(View("~/Views/Patient/PatientViewReports.cshtml", model));
        }
        public ActionResult ViewAllReportsByPatient(int patientID)
        {
            if (Convert.ToString(Session["key"]) != "doctor")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Reports_Api  reports_Api = new Reports_Api();
            PatientModel patient     = new PatientModel();

            patient.pid = patientID;

            var model = reports_Api.GetReportsByPatient(patient);

            return(View("~/Views/Doctor/DoctorManageReports.cshtml", model));
        }
        public ActionResult ViewAppointmentsForReport(int patientID)
        {
            int         id         = (int)Session["UserId"];
            Patient_Api patientApi = new Patient_Api();

            IEnumerable <AppointmentModel> patientAppointments = patientApi.GetAppointments(patientID).Where(a => (a.appointment_Date < DateTime.Now &&
                                                                                                                   a.reqReportNotes == "N/A" && a.requestedReport == false && a.doctor_ID == id && a.cancelled == false));
            List <int> patapts = new List <int>();

            foreach (var a in patientAppointments)
            {
                patapts.Add(a.appointment_ID);
            }

            PatientModel patient = new PatientModel();

            patient.pid = patientID;

            Reports_Api reports_Api = new Reports_Api();
            var         allReports  = reports_Api.GetReportsByPatient(patient);
            List <int>  patrptapts  = new List <int>();

            foreach (var a in allReports)
            {
                patrptapts.Add(a.appointment_ID);
            }

            {
                patapts = patapts.Except(patrptapts).ToList();
            }
            List <SelectListItem> patReports = new List <SelectListItem>();

            foreach (var a in patapts)
            {
                patReports.Add(new SelectListItem {
                    Text = a.ToString(), Value = a.ToString()
                });
            }
            return(Json(patReports, JsonRequestBehavior.AllowGet));
        }
        public ActionResult ViewReportsWithID(int id)
        {
            if (Convert.ToString(Session["key"]) != "doctor")
            {
                return(RedirectToAction("Login", "Home"));
            }

            Reports_Api  rprt = new Reports_Api();
            PatientModel pat  = new PatientModel();

            pat.pid = (int)Session["UserId"];
            List <ReportModel> m = new List <ReportModel>();
            var model            = rprt.GetReportsByAppt(id);

            m.Add(model);
            if (model.report_ID != 0)
            {
                return(View("~/Views/Doctor/DoctorManageReports.cshtml", m));
            }
            else
            {
                return(View("~/Views/Doctor/ReportAvailability.cshtml"));
            }
        }