public ActionResult PatientHealthRecord(string arogyaID, int tokenNumber)
        {

            ArogyaParivarEntities context = new ArogyaParivarEntities();
            Screening model = new Screening();


            string searchString = "";

            if (arogyaID != "")
            {
                searchString = arogyaID;
            }
            Session["strArogyaID"] = arogyaID;
            Session["intTokenNumber"] = tokenNumber;

            strArogyaID = Session["strArogyaID"].ToString();
            intTokenNumber = Convert.ToInt32(Session["intTokenNumber"]);
            string sortOrder = "";
            ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            IList<PatientModel> BookList = new List<PatientModel>();
            ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date";
            if (!String.IsNullOrEmpty(searchString))
            {

                BookList = patientBll.Get_PrintCard(sortOrder, searchString);

            }

            else
            {
                searchString = "";
                BookList = patientBll.Get_PrintCard(sortOrder, searchString);

            }

            var query2 = from allergy in context.T_Allergies

                         from at in context.M_AllergyType
                         .Where(x => x.ID == allergy.AllergenID).DefaultIfEmpty()
                         //on allergy.AllergenID equals at.ID

                         from ar in context.M_Reaction
                         .Where(x => x.ID == allergy.ReactionID).DefaultIfEmpty()
                         //on allergy.ReactionID equals ar.ID

                         from asev in context.M_Severity
                         .Where(x => x.ID == allergy.SeverityID).DefaultIfEmpty()
                         //on allergy.SeverityID equals asev.ID

                         from ast in context.M_Status
                         .Where(x => x.ID == allergy.StatusID).DefaultIfEmpty()
                         //on allergy.StatusID equals ast.ID

                         where allergy.Token_Number == tokenNumber
                            && EntityFunctions.TruncateTime(allergy.CreateDate).Value == EntityFunctions.TruncateTime(DateTime.Now).Value
                            && allergy.ArogyaID == arogyaID
                         select new Allergy
                         {
                             AllergyType = at.AllergyType,

                             ReactionName = ar.Reaction,
                             SeverityrName = asev.Severity,
                             Status = ast.M_StatusName,
                             // CreateDate =  EntityFunctions.TruncateTime(allergy.CreateDate).Value.ToString()
                             //CreateDateString=allergy.CreateDate.Value.ToString("dd/MM/yyyy")
                         };
            model.Allergys = query2.ToList();
            return View(model);
        }
        public ActionResult PatientHealthRecord(Screening model, string command)
        {
            ArogyaParivarEntities context = new ArogyaParivarEntities();
            try
            {
                try
                {



                    T_Vitals Vitals = new T_Vitals()
                    {
                        Height = model.Height,
                        Weight = model.Weight,
                        BMI = model.BMI,
                        SysBP = model.SysBP,
                        DiaBP = model.DiaBP,
                        Temparature = model.Temparature,
                        Pulse = model.Pulse,
                        Respiratory = model.Respiratory,
                        Token_Number = 1

                    };

                    T_Screenings screenings = new T_Screenings()
                    {
                        ComplaintID = model.ComplaintID,
                        CheckListID = model.CheckListID,
                        PresentingComplaint = model.PresentingComplaint,
                        PastMedicalHistory = model.PastMedicalHistory,
                        PastSurgicalHistory = model.PastSurgicalHistory,
                        FamilyHistory = model.FamilyHistory,
                        CurrentMedication = model.CurrentMedication,
                        ECGOutcomeID = model.ECGOutcomeID,
                        ScreenOutcomeID = model.ScreenOutcomeID,
                        SpecialtyID = model.SpecialtyID,
                        AppointDate = model.AppointDate,
                        CreateDate = model.CreateDate,
                        Token_Number = 1
                    };
                    context.T_Screenings.Add(screenings);
                    context.SaveChanges();
                    return RedirectToAction("PatientSearch");

                }
                catch
                {
                    return View(model);
                }


            }
            catch
            {
                return View(model);
            }
        }
        public JsonResult saveScreenData(Screening model)
        {



            try
            {

                ArogyaParivarEntities context = new ArogyaParivarEntities();




                T_Screenings modelScreenings = new T_Screenings()
                {
                    PresentingComplaint = model.PresentingComplaint,
                    PastMedicalHistory = model.PastMedicalHistory,
                    PastSurgicalHistory = model.PastSurgicalHistory,
                    FamilyHistory = model.FamilyHistory,
                    CurrentMedication = model.CurrentMedication,
                    ECGOutcomeID = model.ECGOutcomeID,
                    ScreenOutcomeID = model.ScreenOutcomeID,
                    ArogyaID = Session["strArogyaID"].ToString(),
                    Token_Number = Convert.ToInt32(Session["intTokenNumber"].ToString()),
                    ComplaintID = model.ComplaintID,
                    CheckListID = model.chkId,
                    CreateDate = DateTime.Now,
                    UserID = Convert.ToInt32(Session["UserID"]),
                };

                context.T_Screenings.Add(modelScreenings);
                context.SaveChanges();


                return Json(1, JsonRequestBehavior.AllowGet);
            }
            catch
            {
                return Json(-1, JsonRequestBehavior.AllowGet);
            }
        }
        public JsonResult CadSaveData(Screening model)
        {
            //string str = "Anemia";

            ArogyaParivarEntities context = new ArogyaParivarEntities();
            double k = 0.0;
            try
            {
                for (int i = 1; i <= 7; i++)
                {
                    k += model.Cadmiaradio[i - 1] * model.CadmiaWeightage[i - 1] / 100.0;

                    T_ChkAnemia chkanemia = new T_ChkAnemia()
                    {

                        ChkID = i,
                        AnsID = model.Cadmiaradio[i - 1],
                        ArogyaID = Session["strArogyaID"].ToString(),
                        Token_Number = Convert.ToInt32(Session["intTokenNumber"].ToString()),
                        CreateDate = DateTime.Now,
                        UserID = Convert.ToInt32(Session["UserID"])


                    };

                    context.T_ChkAnemia.Add(chkanemia);
                    context.SaveChanges();
                }

                return Json(new { score = k }, JsonRequestBehavior.AllowGet);

            }
            catch
            {
                return Json(-1, JsonRequestBehavior.AllowGet);
            }
        }
        public JsonResult saveVitaltData(Screening model)
        {
            try
            {

                ArogyaParivarEntities context = new ArogyaParivarEntities();
                T_Vitals modelVitals = new T_Vitals()
                {
                    Height = model.Height,
                    Weight = model.Weight,
                    BMI = model.BMI,
                    SysBP = model.SysBP,
                    Pulse = model.Pulse,
                    DiaBP = model.DiaBP,
                    Temparature = model.Temparature,
                    Respiratory = model.Respiratory,
                    ArogyaID = Session["strArogyaID"].ToString(),
                    UserID = Convert.ToInt32(Session["UserID"]),
                    Token_Number = Convert.ToInt32(Session["intTokenNumber"].ToString()),
                    CreateDate = DateTime.Now,
                };
                context.T_Vitals.Add(modelVitals);
                context.SaveChanges();
                return Json(1, JsonRequestBehavior.AllowGet);
            }
            catch
            {
                return Json(-1, JsonRequestBehavior.AllowGet);
            }
        }
Example #6
0
        public int SaveScreening(Screening screening)
        {
            using (var context = new impiloEntities())
            {
                if (screening.ScreeningID != String.Empty)
                {

                    context.Screening.Attach(screening);
                    context.Entry(screening).State = EntityState.Modified;
                    context.SaveChanges();
                }
                else
                {
                    context.Screening.Add(screening);
                    context.SaveChanges();
                }

            }
            return 0;
        }