Exemplo n.º 1
0
        public SurgicalInfo GetPatientDetails(string PatientId)
        {
            SurgicalInfo ObjMTDMaster = new SurgicalInfo();

            try
            {
                var objDetails = SqlMapper.QueryMultiple(con, "PatientInfo", new { HospitalNum = PatientId }, null, null, commandType: CommandType.StoredProcedure);

                ObjMTDMaster = objDetails.Read <SurgicalInfo>().SingleOrDefault();
                con.Close();
            }
            catch (Exception ex)
            {
                if (ex.Message == "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)")
                {
                    TempData["error2"] = "Please check your internet Connection";
                }
                else
                {
                    TempData["error2"] = string.Format("An Error has occured:{0}", ex.Message);
                }
                //return RedirectToAction("Index");
            }
            return(ObjMTDMaster);
        }
Exemplo n.º 2
0
        public ActionResult InvestigationsForms(SurgicalInfo model)
        {
            if (Session["hosNo"] != null)
            {
                var Regno = Session["hosNo"].ToString();
                var id    = ProcedureSectonID(DateTime.Today, Regno);
                using (IDbConnection db = new SqlConnection(constr))
                {
                    string insertQuery = @"INSERT INTO [dbo].[Forminvestigations]([Unit], [Cost], [InvestigationId], [investigationDate], [RegistrationNo],[Active],[SurgeryBookId])VALUES (@Unit, @Cost, @InvestigationId, @investigationDate, @RegistrationNo,@Active,@SurgeryBookId)";

                    Investigations inv = new Investigations();
                    inv.InvestigationId   = model.investID;
                    inv.InvestigationDate = DateTime.Today;
                    inv.Unit           = model.Labunit;
                    inv.Cost           = decimal.Parse(model.LabCost) * model.Labunit;
                    inv.RegistrationNo = Regno;
                    inv.Active         = true;
                    inv.SurgeryBookId  = id;
                    var result = db.Execute(insertQuery, inv);
                }
                var getPatList = LabInvest(DateTime.Today, Regno);
                model.ListofLabTest  = getPatList;
                model.investigations = GetLabInvestigationsItems();
            }
            else
            {
                model.investigations = GetLabInvestigationsItems();
                Session["error"]     = "This Session has expired please click the back button";
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult BillinProcess(SurgicalInfo model)
        {
            var getPatList = SurgeryReport(model.Start, model.End);

            model.ListOfEntries = getPatList;



            return(View(model));
        }
Exemplo n.º 4
0
        public ActionResult BillinProcess()
        {
            SurgicalInfo model = new SurgicalInfo();


            DateTime start      = DateTime.Today;
            DateTime end        = DateTime.Today;
            var      getPatList = SurgeryReport(start, end);

            model.ListOfEntries = getPatList;



            return(View(model));
        }
Exemplo n.º 5
0
        public ActionResult Details(int Id)
        {
            var objDetails = SqlMapper.QueryMultiple(con, "DetailSurgeryInfo", new { Id = Id }, null, null, commandType: CommandType.StoredProcedure);
            var t          = objDetails.Read <SurgicalInfo>().ToList();

            SurgicalInfo model = new SurgicalInfo();

            model.ListofLabTest = LabInvest(Id);
            model.Beds          = GetBeds();
            foreach (var x in t)
            {
                model.PatientName        = x.PatientName;
                model.hospitalNo         = x.hospitalNo;
                model.Gender             = x.Gender;
                model.Age                = x.Age;
                model.ProcedureText      = x.ProcedureText;
                model.consultantIncharge = x.consultantIncharge;
                model.AddmisionDate      = x.AddmisionDate;
                model.ProcedureDate      = x.ProcedureDate;

                model.Diagnosis               = x.Diagnosis;
                model.surgeryclassID          = x.surgeryclassID;
                model.AnathesiaListId         = x.AnathesiaListId;
                model.TheatreListId           = x.TheatreListId;
                model.FirstName               = x.FirstName;
                model.LastName                = x.LastName;
                model.Diagnosistext           = x.Diagnosistext;
                model.CoexistingMedConditions = x.CoexistingMedConditions;
                model.SpecialRequirement      = x.SpecialRequirement;
                model.CurrentMedication       = x.CurrentMedication;
                model.BedID = x.BedID;

                model.Beddays = x.Beddays;
                model.BedCost = x.BedCost;

                model.surgeryclassID = x.surgeryclassID;
                model.surgeryCost    = x.surgeryCost;

                model.AnathesiaListId = x.AnathesiaListId;
                model.AnathesiaCost   = x.AnathesiaCost;

                model.TheatreListId = x.TheatreListId;
                model.TheatreCost   = x.TheatreCost;
            }
            return(View(model));
        }
Exemplo n.º 6
0
        public ActionResult InvestigationsForms()
        {
            SurgicalInfo model = new SurgicalInfo();

            if (Session["hosNo"] != null)
            {
                model.investigations = GetLabInvestigationsItems();
                var RegNo      = Session["hosNo"].ToString();
                var getPatList = LabInvest(DateTime.Today, RegNo);

                model.ListofLabTest = getPatList;
            }
            else
            {
                model.investigations = GetLabInvestigationsItems();
                Session["error"]     = "This Session has expired please click the back button";
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
Exemplo n.º 7
0
        private List <SelectListItem> GetLabInvestigationsItemsById(int labId)
        {
            SurgicalInfo ObjMTDMaster = new SurgicalInfo();
            var          objDetails   = SqlMapper.QueryMultiple(con, "LabInvestigationById", commandType: CommandType.StoredProcedure);

            ObjMTDMaster.LabInvestigations = objDetails.Read <LabInvestigations>().ToList();
            con.Close();
            var selectList = new List <SelectListItem>();

            foreach (var element in ObjMTDMaster.LabInvestigations)
            {
                selectList.Add(new SelectListItem
                {
                    Value = element.ServiceId.ToString(),
                    Text  = element.ServiceName
                });
            }

            return(selectList);
        }
Exemplo n.º 8
0
        private List <SelectListItem> GetSurgeryClassList()
        {
            SurgicalInfo ObjMTDMaster = new SurgicalInfo();
            var          objDetails   = SqlMapper.QueryMultiple(con, "SurgeryClass", commandType: CommandType.StoredProcedure);

            ObjMTDMaster.surgeryList = objDetails.Read <SurgeryCategory>().ToList();
            con.Close();
            var selectList = new List <SelectListItem>();

            foreach (var element in ObjMTDMaster.surgeryList)
            {
                selectList.Add(new SelectListItem
                {
                    Value = element.Id.ToString(),
                    Text  = element.Name
                });
            }

            return(selectList);
        }
Exemplo n.º 9
0
        private List <SelectListItem> GetDiagnosisListItems()
        {
            SurgicalInfo ObjMTDMaster = new SurgicalInfo();
            var          objDetails   = SqlMapper.QueryMultiple(con, "FormDiagnosis", commandType: CommandType.StoredProcedure);

            ObjMTDMaster.DiagnosisList = objDetails.Read <DiagnosisList>().ToList();
            //var json = JsonConvert.SerializeObject(ObjMTDMaster.DiagnosisList);
            //System.IO.File.WriteAllText(@"C:\Users\festu\Desktop\HappinessForm\HappinessForm\Content\Diagnosis.json", json);

            con.Close();
            var selectList = new List <SelectListItem>();

            foreach (var element in ObjMTDMaster.DiagnosisList)
            {
                selectList.Add(new SelectListItem
                {
                    Value = element.ICDId.ToString(),
                    Text  = element.Diagnosis
                });
            }

            return(selectList);
        }
Exemplo n.º 10
0
        public ActionResult GetPatientInfo(SurgicalInfo model)
        {
            Regex regex = new Regex(@"^[0-9]*$");
            Match match = regex.Match(model.hospitalNo);

            if (match.Success)
            {
                var values = GetPatientDetails(model.hospitalNo);
                model.hospitalNo  = values.hospitalNo;
                model.PatientName = values.PatientName;
                model.Gender      = values.Gender;
                model.Age         = values.Age;
                ViewBag.data      = model;
                return(Redirect("Home/Index"));
            }
            else
            {
                TempData["error"] = "Invalid Value: This is not an Hospital Number";
                return(Redirect("Home/Index"));
            }
            //return Redirect("Home/Index");
            //RedirectToAction("Index","Home");
        }
Exemplo n.º 11
0
        public ActionResult Index()
        {
            SurgicalInfo model = new SurgicalInfo();

            model.AddmisionDate = DateTime.Today.ToShortDateString();
            model.ProcedureDate = DateTime.Today.ToShortDateString();

            //model.Doctors = GetSelectListItems();
            //model.DiagnosisCount = GetDiagnosisListItems();
            //model.Procedures = GetProcedureListItems();
            //model.Beds = GetBedCategoryListItems();
            //model.surgeryClasses = GetSurgeryClassList();

            //model.investigations = GetLabInvestigationsItems();

            model.Doctors = GetDoctorsList();
            //model.DiagnosisCount = GetDiagnosisList();
            model.Procedures     = GetProcedures();
            model.Beds           = GetBeds();
            model.surgeryClasses = GetSurgeryClasses();
            model.investigations = GetInvestigations();

            //model.GenderList.Add(new SelectListItem { Text = "Select Gender", Value = "0" });
            model.GenderList.Add(new SelectListItem {
                Text = "Male", Value = "Male"
            });
            model.GenderList.Add(new SelectListItem {
                Text = "Female", Value = "Female"
            });


            //model.AnathesiaList.Add(new SelectListItem { Text = "Select Anaesthesia Type", Value = "0" });
            //model.AnathesiaList.Add(new SelectListItem { Text = "Anaesthesia", Value = "0" });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Sedation", Value = "Sedation"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Local", Value = "Local"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Minor", Value = "Minor"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Intermidiate", Value = "Intermidiate"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Major 1", Value = "Major 1"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Major 2", Value = "Major 2"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Major Plus", Value = "Major Plus"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Complex Major", Value = "Complex Major"
            });



            //model.TheatreList.Add(new SelectListItem { Text = "Theathre", Value = "0" });
            model.TheatreList.Add(new SelectListItem {
                Text = "Minor", Value = "Minor"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Intermidiate", Value = "Intermidiate"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Major 1", Value = "Major 1"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Major 2", Value = "Major 2"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Major Plus", Value = "Major Plus"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Complex Major", Value = "Complex Major"
            });



            return(View(model));
        }
Exemplo n.º 12
0
        public ActionResult PostingResult(SurgicalInfo model)
        {
            if (model.Doctor != 0 && model.Gender != null)
            {
                try
                {
                    using (IDbConnection db = new SqlConnection(constr))
                    {
                        string insertQuery = @"INSERT INTO [dbo].[SurgicalOperationBooking]([RegistrationNo],[PatientName],[Gender],
                                    [Age], [ConsultantID], [Diagnosis],[AdmissionDate],[ProcedureDate],[ProcedureId], 
                                    [CoexistingMedicalCondition],[CurrentMedications],[SepecialRequrement],
                                    [AllotedTime],[BedCategoryId],[BedCost],[BedDays],[SugeryId],[SurgeryCost],
                                    [AnthesiaCategory],[AnthersiaCost],[TheretherCategory],[ThearterCost],[DateSubmitted]
                                     )VALUES (@hospitalNo,@PatientName, @Gender,
                                    @Age, @Doctor, @Diagnosistext,@AddmisionDate,@ProcedureDate,@Procedure, 
                                    @CoexistingMedConditions,@CurrentMedication,@SpecialRequirement,
                                    @AllottedTime,@BedID,@BedCost,@Beddays,@surgeryclassID,@surgeryCost,
                                    @AnathesiaListId,@AnathesiaCost,@TheatreListId,@TheatreCost, @DateSubmitted)";

                        SurgicalInfo sur = new SurgicalInfo();
                        sur.hospitalNo              = model.hospitalNo;
                        sur.PatientName             = model.PatientName;
                        sur.Gender                  = model.Gender;
                        sur.Age                     = model.Age;
                        sur.Doctor                  = model.Doctor;
                        sur.Diagnosistext           = model.Diagnosistext;
                        sur.AddmisionDate           = model.AddmisionDate;
                        sur.ProcedureDate           = model.ProcedureDate;
                        sur.Procedure               = model.Procedure;
                        sur.CoexistingMedConditions = model.CoexistingMedConditions;
                        sur.CurrentMedication       = model.CurrentMedication;
                        sur.SpecialRequirement      = model.SpecialRequirement;
                        sur.AllottedTime            = model.AllottedTime;
                        sur.BedID                   = model.BedID;
                        sur.BedCost                 = model.BedCost;
                        sur.Beddays                 = model.Beddays;
                        sur.surgeryclassID          = model.surgeryclassID;
                        sur.surgeryCost             = model.surgeryCost;
                        sur.AnathesiaListId         = model.AnathesiaListId;
                        sur.AnathesiaCost           = model.AnathesiaCost;
                        sur.TheatreListId           = model.TheatreListId;
                        sur.TheatreCost             = model.TheatreCost;
                        sur.BedID                   = model.BedID;
                        sur.BedCost                 = model.BedCost;
                        sur.DateSubmitted           = DateTime.Now;
                        var result = db.Execute(insertQuery, sur);
                        Session["sucess"] = "Values sucessfully submitted";
                    }
                }
                catch (Exception ex)
                {
                    if (ex.Message == "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)")
                    {
                        TempData["error2"] = "Please check your internet Connection";
                    }
                    else
                    {
                        TempData["error2"] = string.Format("An Error has occured:{0}", ex.Message);
                    }
                    return(RedirectToAction("Index"));
                }
            }
            else
            {
            }

            var values = GetPatientDetails(model.hospitalNo);

            model.hospitalNo  = values.hospitalNo;
            model.PatientName = values.PatientName;
            model.Gender      = values.Gender;
            model.Age         = values.Age;



            model.AddmisionDate = DateTime.Today.ToShortDateString();
            model.ProcedureDate = DateTime.Today.ToShortDateString();

            //model.Doctors = GetSelectListItems();
            //model.DiagnosisCount = GetDiagnosisListItems();

            model.Doctors        = GetDoctorsList();
            model.DiagnosisCount = GetDiagnosisList();


            //model.Procedures = GetProcedureListItems();
            //model.Beds = GetBedCategoryListItems();
            //model.surgeryClasses = GetSurgeryClassList();
            //model.investigations = GetLabInvestigationsItems();


            model.Procedures     = GetProcedures();
            model.Beds           = GetBeds();
            model.surgeryClasses = GetSurgeryClasses();
            model.investigations = GetInvestigations();


            model.AnathesiaList.Add(new SelectListItem {
                Text = "Anaesthesia", Value = "0"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Sedation", Value = "Sedation"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Local", Value = "Local"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Minor", Value = "Minor"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Intermidiate", Value = "Intermidiate"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Major 1", Value = "Major 1"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Major 2", Value = "Major 2"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Major Plus", Value = "Major Plus"
            });
            model.AnathesiaList.Add(new SelectListItem {
                Text = "Complex Major", Value = "Complex Major"
            });



            //model.TheatreList.Add(new SelectListItem { Text = "Theathre", Value = "0" });
            model.TheatreList.Add(new SelectListItem {
                Text = "Minor", Value = "Minor"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Intermidiate", Value = "Intermidiate"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Major 1", Value = "Major 1"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Major 2", Value = "Major 2"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Major Plus", Value = "Major Plus"
            });
            model.TheatreList.Add(new SelectListItem {
                Text = "Complex Major", Value = "Complex Major"
            });

            Session["hosNo"] = model.hospitalNo;

            return(RedirectToAction("InvestigationsForms"));
        }
Exemplo n.º 13
0
        public ActionResult Index(SurgicalInfo model)
        {
            Regex regex = new Regex(@"^[0-9]*$");
            Match match = regex.Match(model.hospitalNo);

            if (match.Success)
            {
                var values = GetPatientDetails(model.hospitalNo);


                model.hospitalNo  = values.hospitalNo;
                model.PatientName = values.PatientName;
                model.Gender      = values.Gender;
                model.Age         = values.Age;



                model.AddmisionDate = DateTime.Today.ToShortDateString();
                model.ProcedureDate = DateTime.Today.ToShortDateString();

                //model.Doctors = GetSelectListItems();
                //model.DiagnosisCount = GetDiagnosisListItems();

                model.Doctors        = GetDoctorsList();
                model.DiagnosisCount = GetDiagnosisList();


                //model.Procedures = GetProcedureListItems();
                //model.Beds = GetBedCategoryListItems();
                //model.surgeryClasses = GetSurgeryClassList();
                //model.investigations = GetLabInvestigationsItems();


                model.Procedures     = GetProcedures();
                model.Beds           = GetBeds();
                model.surgeryClasses = GetSurgeryClasses();
                model.investigations = GetInvestigations();

                model.GenderList.Add(new SelectListItem {
                    Text = "Male", Value = "Male"
                });
                model.GenderList.Add(new SelectListItem {
                    Text = "Female", Value = "Female"
                });

                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Anaesthesia", Value = "0"
                });
                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Sedation", Value = "Sedation"
                });
                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Local", Value = "Local"
                });
                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Minor", Value = "Minor"
                });
                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Intermidiate", Value = "Intermidiate"
                });
                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Major 1", Value = "Major 1"
                });
                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Major 2", Value = "Major 2"
                });
                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Major Plus", Value = "Major Plus"
                });
                model.AnathesiaList.Add(new SelectListItem {
                    Text = "Complex Major", Value = "Complex Major"
                });



                //model.TheatreList.Add(new SelectListItem { Text = "Theathre", Value = "0" });
                model.TheatreList.Add(new SelectListItem {
                    Text = "Minor", Value = "Minor"
                });
                model.TheatreList.Add(new SelectListItem {
                    Text = "Intermidiate", Value = "Intermidiate"
                });
                model.TheatreList.Add(new SelectListItem {
                    Text = "Major 1", Value = "Major 1"
                });
                model.TheatreList.Add(new SelectListItem {
                    Text = "Major 2", Value = "Major 2"
                });
                model.TheatreList.Add(new SelectListItem {
                    Text = "Major Plus", Value = "Major Plus"
                });
                model.TheatreList.Add(new SelectListItem {
                    Text = "Complex Major", Value = "Complex Major"
                });
            }
            else
            {
                TempData["error"] = "Invalid Value: This is not an Hospital Number";
                return(Redirect("Home/Index"));
            }


            return(View(model));
        }