Пример #1
0
        public JsonResult AddPatientPhoto(OPDPatient patient)
        {
            var profile = Request.Files;

            string imgname   = string.Empty;
            string ImageName = string.Empty;

            //Following code will check that image is there
            //If it will Upload or else it will use Default Image

            if (System.Web.HttpContext.Current.Request.Files.AllKeys.Any())
            {
                var logo = System.Web.HttpContext.Current.Request.Files["file"];
                if (logo.ContentLength > 0)
                {
                    var profileName = Path.GetFileName(logo.FileName);
                    var ext         = Path.GetExtension(logo.FileName);

                    ImageName = profileName;
                    var comPath = Server.MapPath("/DataImages/") + ImageName;

                    logo.SaveAs(comPath);
                    patient.PatientPhoto    = comPath;
                    Session["PatientPhoto"] = "~/DataImages/" + profileName;
                }
            }
            else
            {
                patient.PatientPhoto = Server.MapPath("/DataImages/") + "patientphoto.jpg";
            }

            int response = 1;

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult OPDPatient(OPDPatient p)
        {
            try
            {
                p.PatientPhoto = Session["PatientPhoto"].ToString();

                if (dl.InsertOtpPatient_Sp(p) > 0)
                {
                    TempData["MSG"] = "Patient Added Successfully.";
                }
            }
            catch (Exception ex)
            {
                TempData["MSG"] = "Something went wrong.";
                return(Json(new { data = "error" }, JsonRequestBehavior.AllowGet));
            }
            int response = 1;

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public ActionResult OPDPatient()
        {
            List <OPDPatient> PatientList = new List <OPDPatient>();

            Property p  = new Property();
            DataSet  ds = new DataSet();

            p.OnTable = "FetchOtpPatient";

            ds = dl.FetchOtpPatient_sp(p);

            List <SelectListItem> DoctorList = new List <SelectListItem>();

            DoctorList.Add(new SelectListItem {
                Text = "Select", Value = ""
            });
            foreach (DataRow dr in ds.Tables[1].Rows)
            {
                DoctorList.Add(new SelectListItem {
                    Text = dr["FullName"].ToString(), Value = dr["FullName"].ToString()
                });
            }
            ViewBag.DoctorList = new SelectList(DoctorList, "Value", "Text");

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                OPDPatient m = new OPDPatient();

                m.PatientId        = item["PatientId"].ToString();
                m.Name             = item["Name"].ToString();
                m.GuardianName     = item["GuardianName"].ToString();
                m.Phone            = item["Phone"].ToString();
                m.Gender           = item["Gender"].ToString();
                m.ConsultantDoctor = item["ConsultantDoctor"].ToString();
                PatientList.Add(m);
            }
            ViewBag.PatientList = PatientList;

            return(View());
        }
Пример #4
0
        public ActionResult profile(string id)
        {
            List <OPDPatient> OPDPatientList = new List <OPDPatient>();
            List <Diagnosis>  DiagnosisList  = new List <Diagnosis>();
            List <Timeline>   TimelineList   = new List <Timeline>();

            Property p  = new Property();
            DataSet  ds = new DataSet();

            p.OnTable    = "PatientDetails";
            p.Condition1 = id;

            ds = dl.FetchOpdPatient_sp(p);

            OPDPatient info = new RXGOADMIN.Models.OPDPatient();

            try
            {
                info = new RXGOADMIN.Models.OPDPatient()
                {
                    OPDId           = ds.Tables[0].Rows[0]["OPDId"].ToString(),
                    PatientId       = ds.Tables[0].Rows[0]["PatientId"].ToString(),
                    PatientUniqueId = ds.Tables[0].Rows[0]["PatientUniqueId"].ToString(),
                    Gender          = ds.Tables[0].Rows[0]["Gender"].ToString(),
                    MaritalStatus   = ds.Tables[0].Rows[0]["MaritalStatus"].ToString(),
                    Phone           = ds.Tables[0].Rows[0]["Phone"].ToString(),
                    Email           = ds.Tables[0].Rows[0]["Email"].ToString(),
                    Address         = ds.Tables[0].Rows[0]["Address"].ToString(),
                    //Age= ds.Tables[0].Rows[0]["Age"].ToString(),
                    Year         = ds.Tables[0].Rows[0]["Year"].ToString(),
                    Month        = ds.Tables[0].Rows[0]["Month"].ToString(),
                    GuardianName = ds.Tables[0].Rows[0]["GuardianName"].ToString(),
                    Name         = ds.Tables[0].Rows[0]["Name"].ToString(),
                    PatientPhoto = ds.Tables[0].Rows[0]["PatientPhoto"].ToString(),
                };
            }
            catch (Exception ex)
            {
            }

            foreach (DataRow item in ds.Tables[1].Rows)
            {
                OPDPatient m = new OPDPatient();

                m.OPDId            = item["OPDId"].ToString();
                m.OPDNo            = item["OPDNo"].ToString();
                m.AppointmentDate  = item["AppointmentDate"].ToString();
                m.ConsultantDoctor = item["ConsultantDoctor"].ToString();
                m.Reference        = item["Reference"].ToString();
                m.Symptoms         = item["Symptoms"].ToString();
                m.SymptomsTitle    = item["SymptomsTitle"].ToString();
                OPDPatientList.Add(m);
            }
            ViewBag.OPDPatientList = OPDPatientList;

            foreach (DataRow item in ds.Tables[2].Rows)
            {
                Diagnosis dis = new Diagnosis();

                dis.DId         = item["DiagnosisId"].ToString();
                dis.ReportDate  = item["ReportDate"].ToString();
                dis.ReportType  = item["ReportType"].ToString();
                dis.Description = item["Description"].ToString();
                dis.Attachment  = item["Attachment"].ToString();
                DiagnosisList.Add(dis);
            }
            ViewBag.DiagnosisList = DiagnosisList;

            foreach (DataRow item in ds.Tables[3].Rows)
            {
                Timeline t = new Timeline();

                t.TId         = item["TId"].ToString();
                t.Date        = item["Date"].ToString();
                t.Title       = item["Title"].ToString();
                t.Description = item["Description"].ToString();
                t.Attachment  = item["Attachment"].ToString();
                TimelineList.Add(t);
            }
            ViewBag.TimelineList = TimelineList;

            List <SelectListItem> DoctorList = new List <SelectListItem>();

            DoctorList.Add(new SelectListItem {
                Text = "Select", Value = ""
            });
            foreach (DataRow dr in ds.Tables[4].Rows)
            {
                DoctorList.Add(new SelectListItem {
                    Text = dr["FullName"].ToString(), Value = dr["EmployeeId"].ToString()
                });
            }
            ViewBag.DoctorList = new SelectList(DoctorList, "Value", "Text");

            List <SelectListItem> SymptomsType = new List <SelectListItem>();

            SymptomsType.Add(new SelectListItem {
                Text = "Select", Value = ""
            });
            foreach (DataRow dr in ds.Tables[5].Rows)
            {
                SymptomsType.Add(new SelectListItem {
                    Text = dr["SymptomsType"].ToString(), Value = dr["SymptomsTypeId"].ToString()
                });
            }
            ViewBag.SymptomsType = new SelectList(SymptomsType, "Value", "Text");

            List <SelectListItem> TPA = new List <SelectListItem>();

            TPA.Add(new SelectListItem {
                Text = "Select", Value = ""
            });
            foreach (DataRow dr in ds.Tables[6].Rows)
            {
                TPA.Add(new SelectListItem {
                    Text = dr["TPAName"].ToString(), Value = dr["TPAId"].ToString()
                });
            }
            ViewBag.TPA = new SelectList(TPA, "Value", "Text");

            return(View(info));
        }