public JsonResult saveExaminationData(SaveDocotor Doctormodel)
        {
            try
            {
                ArogyaParivarEntities context = new ArogyaParivarEntities();

                T_Examination modelScreenings = new T_Examination()
                {
                    ComplaintID         = Doctormodel.ChiefComplaintID,
                    PresentingComplaint = Doctormodel.HistoryPresentingComplaint,
                    PastMedicalHistory  = Doctormodel.PastMedicalHistory,
                    PastSurgicalHistory = Doctormodel.PastSurgicalHistory,
                    FamilyHistory       = Doctormodel.FamilyHistory,
                    CurrentMedication   = Doctormodel.CurrentMedication,
                    Diagnosis           = Doctormodel.Diagnosis,
                    Tests         = Doctormodel.Tests,
                    TreatmentPlan = Doctormodel.TreatMentPlan,
                    ArogyaID      = Session["arogyid"].ToString(),
                    Token_Number  = Convert.ToInt32(Session["Token"]),
                    CreateDate    = DateTime.Now,
                    Active        = true,
                    UserID        = Convert.ToInt32(Session["UserID"]),
                    ScreeningID   = Doctormodel.ScreeningoutcomeID
                };
                context.T_Examination.Add(modelScreenings);
                context.SaveChanges();
                return(Json("Data Saved", JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json(-1, JsonRequestBehavior.AllowGet));
            }
        }
        public JsonResult saveMedicationData(string DrugName, int Doseid, int Frequencyid, string Duration, int Routid, string Instruction)
        {
            try
            {
                int savedata = 0;
                ArogyaParivarEntities context = new ArogyaParivarEntities();

                T_Medication modelScreening = new T_Medication()
                {
                    DrugName           = DrugName,
                    DoseID             = Doseid,
                    FrequencyID        = Frequencyid,
                    Duration           = Duration,
                    RouteID            = Routid,
                    SpecialInstruction = Instruction,
                    ArogyaID           = Session["arogyid"].ToString(),
                    Token_Number       = Convert.ToInt32(Session["Token"]),
                    CreateDate         = DateTime.Now,
                    UserID             = Convert.ToInt32(Session["UserID"])
                };
                context.T_Medication.Add(modelScreening);
                context.SaveChanges();
                dynamic obj = new ExpandoObject();
                obj.Token    = modelScreening.Token_Number;
                obj.Arogyaid = modelScreening.ArogyaID;
                obj.date     = modelScreening.CreateDate;
                return(Medication(obj.Arogyaid, obj.Token, obj.date));
                // Json(obj, JsonRequestBehavior.AllowGet);
            }
            catch
            {
                return(Json(-1, JsonRequestBehavior.AllowGet));
            }
        }
        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 saveData(int AllrgyTypid, int Reactionid, int Severityid, int Statusid)
        {
            try
            {

                ArogyaParivarEntities context = new ArogyaParivarEntities();

                T_Allergies modelScreening = new T_Allergies()
                  {
                      AllergenID = AllrgyTypid,
                      ReactionID = Reactionid,
                      SeverityID = Severityid,
                      StatusID = Statusid,
                      ArogyaID = Session["strArogyaID"].ToString(),
                      Token_Number = Convert.ToInt32(Session["intTokenNumber"].ToString()),
                      CreateDate = DateTime.Now,
                      UserID = Convert.ToInt32(Session["UserID"])
                  };
                context.T_Allergies.Add(modelScreening);
                context.SaveChanges();
                return Allrgy(Convert.ToInt32(Session["intTokenNumber"]), Session["strArogyaID"].ToString());
            }
            catch
            {
                return Json(-1, JsonRequestBehavior.AllowGet);
            }
        }
        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);
            }
        }
        public ActionResult UpdateRegistration(Patient model, string command, HttpPostedFileBase Files)
        {
            ArogyaParivarEntities context = new ArogyaParivarEntities();

            try
            {
                try
                {

                    ObjectParameter outParm = new ObjectParameter("callid", typeof(string));

                    context.SP_TokenGenration(outParm);

                    int tokennumber = Convert.ToInt32(outParm.Value);
                    if (command.Equals("Reset"))
                    {
                        return RedirectToAction("PatientRegistration");
                    }
                    else
                    {
                    
                        
                        T_Token tokn = new T_Token()
                        {
                            ArogyaID = model.ArogyaID,
                            Token_Number = tokennumber,
                            Tokem_Date = DateTime.Now
                        };
                        
                      context.T_Token.Add(tokn);
                       var value= context.T_PatientInfo.Where(x => x.ArogyaID == model.ArogyaID).FirstOrDefault();
                        

                            value.FirstName = model.PatientName;
                            value.ArogyaID = model.ArogyaID;
                            value.SurName = model.Surname;
                            value.Age = model.Age;
                            value.AgeType = Convert.ToInt32(Request.Form["AgeType"]);
                            value.FK_GenderID = model.Gender;
                            value.ID_Number = model.AadharID;
                            value.Address = model.Address;
                            value.ContactNumber = model.ContactNo;
                            value.VillageId = Convert.ToInt64(Request.Form["Village"]);
                            value.TownId = Request.Form["Town"];
                            value.RefBy = Convert.ToInt32(Request.Form["RefBy"]);
                            value.RefName = model.RefName;
                            value.Consen = true;
                            value.DistrictId = Convert.ToInt32(Request.Form["District"].ToString());
                            value.SateId = model.Sate;

                        context.SaveChanges();
                        return RedirectToAction("PatientSearch");
                    }
                }
                catch
                {
                    return View(model);
                }


            }
            catch
            {
                return View(model);
            }
        }
        public ActionResult PatientRegistration(Patient model, string command, HttpPostedFileBase Files)
        {
            ArogyaParivarEntities context = new ArogyaParivarEntities();
            try
            {
                try
                {



                    ObjectParameter outParm = new ObjectParameter("callid", typeof(string));

                    context.SP_TokenGenration(outParm);

                    int tokennumber = Convert.ToInt32(outParm.Value);

                    ObjectParameter outParm1 = new ObjectParameter("callid", typeof(string));

                    context.SP_GenarateArogyaID(outParm1);

                    int intarogyaID = Convert.ToInt32(outParm1.Value);
                    string arogyaID = "A" + intarogyaID;
                    var webCamePath = ConfigurationSettings.AppSettings["WebCampath"];
                
                    if (command.Equals("Reset"))
                    {
                        return RedirectToAction("PatientRegistration");
                    }
                    else
                    {
                        var fileName = "";
                        if (Request.Files.Count > 0 && Request.Files[0].ContentLength > 0)
                        {
                            var file = Request.Files[0];

                            if (file != null && file.ContentLength > 0)
                            {
                                fileName = Path.GetFileName(file.FileName);
                                var path = Path.Combine(Server.MapPath(ConfigurationSettings.AppSettings["DocumentUploadPath"]), fileName);
                                file.SaveAs(path);
                            }

                            T_RegUpload upload = new T_RegUpload()
                            {
                                Active = true,
                                ArogyaID = arogyaID,
                                CreateDate = DateTime.Now,
                                FileName = fileName,
                                UserID = Convert.ToInt32(Session["UserID"])
                            };
                            context.T_RegUpload.Add(upload);
                            context.SaveChanges();
                        }
                      

                        PatientModel book = new PatientModel()
                        {

                            PatientName = model.PatientName,
                            ArogyaID = arogyaID,
                            Surname = model.Surname,
                            Age = model.Age,
                            AgeType = model.Cal,
                            Gender = model.Gender,
                            AadharID = model.AadharID,
                            Address = model.Address,
                            ContactNo = model.ContactNo,
                            Village = Convert.ToInt64(Request.Form["Village"]),
                            Town = Request.Form["Mandal"].ToString(),
                            RefBy = Convert.ToInt32(Request.Form["RefBy"]),
                            RefName = model.RefName,
                            Consent = true,
                            District = Convert.ToInt32(Request.Form["city"].ToString()),
                            Sate = model.Sate,

                        };

                        T_Token tokn = new T_Token()
                        {
                            ArogyaID = arogyaID,
                            Token_Number = tokennumber,
                            Tokem_Date = DateTime.Now
                        };

                        context.T_Token.Add(tokn);
                        context.SaveChanges();
                        patientBll.Save(book);
                        return RedirectToAction("PrintCard", new { ArogyaID = arogyaID });
                 
                    }
                }
                catch
                {
                    return View(model);
                }


            }
            catch
            {
                return View(model);
            }
        }
Example #10
0
        public JsonResult saveExaminationData(SaveDocotor Doctormodel)
        {
            try
            {

                ArogyaParivarEntities context = new ArogyaParivarEntities();

                T_Examination modelScreenings = new T_Examination()
                {
                    ComplaintID = Doctormodel.ChiefComplaintID,
                    PresentingComplaint = Doctormodel.HistoryPresentingComplaint,
                    PastMedicalHistory = Doctormodel.PastMedicalHistory,
                    PastSurgicalHistory = Doctormodel.PastSurgicalHistory,
                    FamilyHistory = Doctormodel.FamilyHistory,
                    CurrentMedication = Doctormodel.CurrentMedication,
                    Diagnosis = Doctormodel.Diagnosis,
                    Tests = Doctormodel.Tests,
                    TreatmentPlan = Doctormodel.TreatMentPlan,
                    ArogyaID = Session["arogyid"].ToString(),
                    Token_Number = Convert.ToInt32(Session["Token"]),
                    CreateDate = DateTime.Now,
                    Active = true,
                    UserID = Convert.ToInt32(Session["UserID"]),
                    ScreeningID = Doctormodel.ScreeningoutcomeID
                };
                context.T_Examination.Add(modelScreenings);
                context.SaveChanges();
                return Json("Data Saved", JsonRequestBehavior.AllowGet);
            }
            catch
            {
                return Json(-1, JsonRequestBehavior.AllowGet);
            }
        }
Example #11
0
        public JsonResult saveMedicationData(string DrugName, int Doseid, int Frequencyid, string Duration, int Routid, string Instruction)
        {
            try
            {
                int savedata = 0;
                ArogyaParivarEntities context = new ArogyaParivarEntities();

                T_Medication modelScreening = new T_Medication()
                {
                    DrugName = DrugName,
                    DoseID = Doseid,
                    FrequencyID = Frequencyid,
                    Duration = Duration,
                    RouteID = Routid,
                    SpecialInstruction = Instruction,
                    ArogyaID = Session["arogyid"].ToString(),
                    Token_Number = Convert.ToInt32(Session["Token"]),
                    CreateDate = DateTime.Now,
                    UserID = Convert.ToInt32(Session["UserID"])


                };
                context.T_Medication.Add(modelScreening);
                context.SaveChanges();
                dynamic obj = new ExpandoObject();
                obj.Token = modelScreening.Token_Number;
                obj.Arogyaid = modelScreening.ArogyaID;
                obj.date = modelScreening.CreateDate;
                return Medication(obj.Arogyaid, obj.Token, obj.date);
                // Json(obj, JsonRequestBehavior.AllowGet);
            }
            catch
            {
                return Json(-1, JsonRequestBehavior.AllowGet);
            }
        }