示例#1
0
        public ActionResult SearchPatient(int srchVal, string value)
        {
            EHMSEntities          ent = new EHMSEntities();
            PatientPartialDetails obj = new PatientPartialDetails();

            if (srchVal == 1)
            {
                try
                {
                    int patientId = Convert.ToInt16(value);
                    PatientPartialDetails modelPartial = new PatientPartialDetails();
                    string str = "";
                    modelPartial.PatientPartialDetailsList = pro.GetDepositForPatient(patientId, str);
                    return(PartialView("_DepositPatientSearch", modelPartial));
                }
                catch (Exception e)
                {
                    TempData["msz"] = "Please Check Patient Id";
                    OpdModel model = new OpdModel();
                    return(PartialView("_DepositPatientSearch", model));
                }
            }


            if (srchVal == 2)
            {
                PatientPartialDetails modelPartial = new PatientPartialDetails();
                modelPartial.PatientPartialDetailsList = pro.GetDepositForPatient(0, value);


                return(PartialView("_DepositPatientSearch", modelPartial));
            }

            return(PartialView("_DepositPatientSearch", obj));
        }
示例#2
0
        //[CustomAuthorize(Roles = "OpdAdmin, OpdCreate,superadmin, admin")]
        public ActionResult Create(OpdModel model)
        {
            var ThisSession = this.Session["OpdTypeIdInt"];

            if (ThisSession != null)
            {
                model.opdtype = ThisSession.ToString();
            }
            else
            {
                model.opdtype = "1";
            }
            int i = pro.Insert(model);

            if (i != 0)
            {
                string actionName     = this.ControllerContext.RouteData.Values["action"].ToString();
                string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                Utility.SaveTrialAudit(controllerName, actionName);
                TempData["success"] = HospitalManagementSystem.UtilityMessage.save;

                int LastInsertdId = pro.GetLastInsertedId();
                return(RedirectToAction("BillForm", new { id = i, FromSource = 1 }));
            }
            else
            {
                TempData["success"] = HospitalManagementSystem.UtilityMessage.savefailed;
                return(RedirectToAction("Index"));
            }
        }
示例#3
0
        public ActionResult SearchPatienNameOT(string s)
        {
            using (EHMSEntities ent = new EHMSEntities())
            {
                OpdModel        model    = new OpdModel();
                List <string>   names    = new List <string>();
                List <OpdModel> templist = new List <OpdModel>();
                templist = (from opd in ent.OpdMasters
                            join y in ent.OperationTheatreMasters
                            on opd.OpdID equals y.SourceID
                            where opd.FirstName.StartsWith(s)
                            select new OpdModel
                {
                    FirstName = opd.FirstName,
                    MiddleName = opd.MiddleName,
                    LastName = opd.LastName
                }).Take(10).ToList();



                foreach (var item in templist)
                {
                    names.Add(item.FirstName + " " + item.MiddleName + " " + item.LastName);
                }
                return(Json(names, JsonRequestBehavior.AllowGet));
            }
        }
示例#4
0
        //[CustomAuthorize(Roles = "OpdCreate, OpdMain, superadmin, admin")]
        public ActionResult ViewOldPatient(int id)
        {
            OpdModel model = new OpdModel();

            model = pro.Getlist().Where(x => x.OpdID == id).FirstOrDefault();
            DateTime TodayDate       = DateTime.Now;
            DateTime PreviousRegDate = model.RegistrationDate;
            decimal  totalDays       = Math.Round(Convert.ToDecimal((TodayDate - PreviousRegDate).TotalDays));

            model.OpdFeeDetailsModel = new OpdFeeDetailsModel();
            model.OpdFeeDetailsModel = new OpdFeeDetailsModel();
            model.OpdDoctorListModel = new OpdDoctorListModel();

            model.OpdFeeDetailsModel.RegistrationFee = Utility.GetCurrentRegistrationFeeForOldPatient();
            model.OpdFeeDetailsModel.TotalAmount     = Utility.GetCurrentRegistrationFeeForOldPatient();

            if (totalDays > 7)//New registration fee
            {
                model.OpdFeeDetailsModel.RegistrationFee = Utility.GetCurrentRegistrationFee();
                model.OpdFeeDetailsModel.TotalAmount     = Utility.GetCurrentRegistrationFee();
            }



            var mod = new OpdDoctorListModel();

            model.OpdDoctorList.Add(mod);
            return(View(model));
        }
示例#5
0
        public async Task <HttpResponseMessage> Post([FromBody] OpdModel mInvoice)
        {
            var formatter = RequestFormat.JsonFormaterString();

            try
            {
                if (mInvoice.UserName == "")
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                        Output = "error", Msg = "UserName is Empty"
                    }, formatter));
                }
                else
                {
                    string msg = await _gtOpd.Save(mInvoice);

                    //   _gtInvoice.PrintReport("DiagnosisInvoiceRPT.rpt", "SP_GET_INVOICE_PRINT", "" + mInvoice.ElementAt(0).InvMasterId + "", "SP_GET_INVOICE_PRINT", "", "", "S");
                    return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                        Output = "success", Msg = msg
                    }, formatter));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                    Output = "error", Msg = ex.ToString()
                }, formatter));
            }
        }
示例#6
0
        //
        // GET: /OperationTheatreMaster/Edit/5

        public ActionResult Edit(int id, int PatientId)
        {
            EHMSEntities ent = new EHMSEntities();
            OperationTheatreMasterModel model = pro.GetObject(id);

            model.refOfOpdModel = new OpdModel();
            OpdModel    opdmodel = new OpdModel();
            OpdProvider proopd   = new OpdProvider();

            opdmodel.OpdModelList = proopd.Getlist().Where(x => x.OpdID == PatientId).ToList();

            foreach (var item in opdmodel.OpdModelList)
            {
                model.refOfOpdModel.FirstName  = item.FirstName;
                model.refOfOpdModel.MiddleName = item.MiddleName;
                model.refOfOpdModel.LastName   = item.LastName;
            }

            //model.SourceID = id;
            model.SourceID            = PatientId;
            model.PersonAllocatedList = new List <PersonAllocated>();
            foreach (var item in pro.GetTheatreDetailsList(id))
            {
                PersonAllocated pa = new PersonAllocated();
                pa.PersonAllocateId      = item.PersonAllocatedID;
                pa.PersonAllocatedTypeId = item.PersonAllocatedTypeID;
                model.PersonAllocatedList.Add(pa);
            }
            //model.ChargeName = ent.SurgeryCharge.Where(x=>x.ChargeAmount==model.Charge).FirstOrDefault().ChargeName;
            return(View(model));
        }
示例#7
0
        public ActionResult Edit(int id, OpdModel model)
        {
            OpdMedicalProvider OMPro = new OpdMedicalProvider();

            if (ModelState.IsValid)
            {
                //update here
                var holo = HospitalManagementSystem.Utility.GetHologramAmount();
                var pre  = HospitalManagementSystem.Utility.GetPremedicalamount();
                if (model.OpdMedicalDetailModel.PreHolo == "Pre-Medical")
                {
                    model.OpdMedicalDetailModel.Commission = model.OpdMedicalDetailModel.Amount - pre;
                }
                else
                {
                    model.OpdMedicalDetailModel.Commission = model.OpdMedicalDetailModel.Amount - holo;
                }
                int i = OMPro.Update(model);
                if (i != 0)
                {
                    TempData["success"] = HospitalManagementSystem.UtilityMessage.edit;
                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["success"] = HospitalManagementSystem.UtilityMessage.savefailed;
                    return(RedirectToAction("Index"));
                }
            }
            return(View(model));
        }
示例#8
0
        // GET: /OperationTheatreMaster/Create

        public ActionResult Create(int id, int Billno)
        {
            OpdModel               opdmodel = new OpdModel();
            OpdProvider            pro      = new OpdProvider();
            BillingCounterProvider Brpro    = new BillingCounterProvider();

            opdmodel.OpdModelList = pro.Getlist().Where(x => x.OpdID == id).ToList();

            //model.BillingCounterPatientInformationModel = pro.GetPatientBasicInformationFromOpd(Convert.ToInt32(ipValue), 0).FirstOrDefault();
            //model.BalanceDeposit = pro.getBalanceDeposit(Convert.ToInt32(model.BillingCounterPatientInformationModel.AccountHeadId));

            OperationTheatreMasterModel obj = new OperationTheatreMasterModel();

            obj.refOfOpdModel = new OpdModel();
            foreach (var item in opdmodel.OpdModelList)
            {
                obj.refOfOpdModel.FirstName  = item.FirstName;
                obj.refOfOpdModel.MiddleName = item.MiddleName;
                obj.refOfOpdModel.LastName   = item.LastName;
                obj.refOfOpdModel.COA        = item.COA;
            }
            obj.PatientACHeadId   = (int)obj.refOfOpdModel.COA;
            obj.PatientDepoAmount = Brpro.getBalanceDeposit(obj.PatientACHeadId);
            obj.SourceID          = id;
            ViewBag.value         = 0;
            return(View(obj));
        }
示例#9
0
        public ActionResult BillForm(int id)
        {
            OpdModel model = new OpdModel();

            model = OMPro.GetOpdDetails(id);
            return(View(model));
        }
示例#10
0
        public ActionResult AssignPatients(int id)
        {
            EHMSEntities ent = new EHMSEntities();
            DemandPatientAssignmentModel model = new DemandPatientAssignmentModel();

            model.OpdModelList = new List <OpdModel>();
            model.DemandId     = id;

            var list = (from om in ent.OpdMasters
                        join
                        pa in ent.DemandPatientAssignments on om.OpdID equals pa.OpdId
                        join
                        dm in ent.ItemDemandMasters on pa.DemandId equals dm.ItemDemandID
                        where pa.DemandId == model.DemandId && pa.Status == true
                        select new { om, pa, dm }).ToList();

            foreach (var item in list)
            {
                OpdModel omodel = new OpdModel();
                omodel.FirstName        = item.om.FirstName;
                omodel.MiddleName       = item.om.MiddleName;
                omodel.LastName         = item.om.LastName;
                omodel.MobileNumber     = item.pa.Remarks;
                omodel.RegistrationMode = item.dm.ItemDemandNo;
                omodel.OpdID            = item.om.OpdID;
                model.OpdModelList.Add(omodel);
            }

            return(View(model));
        }
示例#11
0
        public ActionResult _SearchBillDetails(DateTime Sdate, DateTime Edate, string patientName, string id)
        {
            OpdModel     model = new OpdModel();
            EHMSEntities ent   = new EHMSEntities();
            int          opdid;
            string       PatinetName = "Default";

            if (!string.IsNullOrEmpty(patientName))
            {
                PatinetName = patientName;
            }
            if (id == "")
            {
                opdid = 0;
            }
            else
            {
                opdid = Convert.ToInt32(id);
            }

            if (Sdate != null && Edate != null)
            {
                //model.CentralizeBillingModelList = pro.GetOpdBill(Sdate, Edate, PatinetName, opdid);
                ViewBag.TotalAmousnt = "67.00";
                return(PartialView("_BillingDetails", model));
            }
            else
            {
                return(null);
            }
        }
示例#12
0
        public ActionResult Create(OpdModel model)
        {
            var a    = model.OpdMedicalDetailModel.PreHolo;
            var holo = HospitalManagementSystem.Utility.GetHologramAmount();
            var pre  = HospitalManagementSystem.Utility.GetPremedicalamount();

            if (model.OpdMedicalDetailModel.PreHolo == "Pre-Medical")
            {
                model.OpdMedicalDetailModel.Commission = model.OpdMedicalDetailModel.Amount - model.OpdMedicalDetailModel.Discount - pre;
            }
            else
            {
                model.OpdMedicalDetailModel.Commission = model.OpdMedicalDetailModel.Amount - model.OpdMedicalDetailModel.Discount - holo;
            }

            int i = OMPro.Insert(model);

            if (i != 0)
            {
                TempData["success"] = HospitalManagementSystem.UtilityMessage.save;
                return(RedirectToAction("Index"));
            }
            else
            {
                TempData["success"] = HospitalManagementSystem.UtilityMessage.savefailed;
                return(RedirectToAction("Index"));
            }
        }
示例#13
0
        public ActionResult _OpdSearchBybloodGroup(string bloodgroupid)
        {
            OpdModel model = new OpdModel();

            model.OpdModelList = pro.SearchByBloodGroup(bloodgroupid);
            return(PartialView("_OpdPatientByBloodGroup", model));
        }
示例#14
0
        //[CustomAuthorize(Roles = "OpdView, OpdAdmin, OpdCreate,superadmin, admin")]

        public ActionResult Index(int page = 1)
        {
            int EmployeeId   = Utility.GetCurrentLoginUserId();
            int DepartmentId = Utility.GetCurrentUserDepartmentId();

            int      pagesize = 25;
            OpdModel model    = new OpdModel();

            if (EmployeeId == 999)
            {
                model.OpdModelList  = pro.Getlist(page, pagesize);
                ViewBag.currentPage = page;
                ViewBag.TotalPages  = Math.Ceiling((double)pro.GetTotalItemCount(0) / pagesize);
            }

            else
            {
                model.OpdModelList  = pro.GetlistByDepartmentId(DepartmentId, page, pagesize);
                ViewBag.currentPage = page;
                double totalpage = Math.Ceiling((double)pro.GetTotalItemCount(DepartmentId) / pagesize);
                ViewBag.TotalPages = Math.Ceiling((double)pro.GetTotalItemCount(DepartmentId) / pagesize);
            }

            return(View(model));
        }
示例#15
0
        //[CustomAuthorize(Roles = "OpdSearch, OpdMain, superadmin, admin")]
        public ActionResult SearchIndex(OpdModel model)
        {
            EHMSEntities ent         = new EHMSEntities();
            DateTime     fromdate    = model.FromDate;
            DateTime     todate      = model.toDate;
            int          pagesize    = 25;
            string       PatientName = string.Empty;

            if (!string.IsNullOrEmpty(model.NameofPatent))
            {
                PatientName = model.NameofPatent.ToLower();
            }


            int DepartmentId = Utility.GetCurrentUserDepartmentId();
            var list         = new List <OpdModel>();

            list = pro.GetlistByDepartmentId(DepartmentId, 1, 50).Where(x => x.RegistrationDate <= todate && x.RegistrationDate >= fromdate).ToList();
            model.OpdModelList = list.Where(x => x.FirstName.ToLower().StartsWith(PatientName)).ToList();

            ViewBag.currentPage = 1;
            // double totalpage = Math.Ceiling((double)ent.OpdMaster.Where(x=>x.RegistrationSource == "Opd").Count() / pagesize);
            ViewBag.TotalPages  = Math.Ceiling((double)ent.OpdMasters.Where(x => x.RegistrationSource == "Opd").Count() / pagesize);
            ViewBag.currentPage = 1;
            ViewBag.TotalPages  = 1;
            return(View("Index", model));
        }
示例#16
0
        public ActionResult PrintMultipleBill(int id, int PatientId)
        {
            OpdModel model = new OpdModel();

            model = pro.GetOpdDetailsForMultipleBillCase(id, PatientId);
            return(View("BillForm", model));
        }
示例#17
0
        public ActionResult Main()
        {
            OpdModel obj = new OpdModel();

            obj.OpdModelList = new List <OpdModel>();
            return(View(obj));
        }
示例#18
0
        public ActionResult TransactionDetails(int id)
        {
            OpdModel model = new OpdModel();

            //model.BillingModelList = pro.GetTransacationDetailsById(id);
            return(PartialView("_TransactionDetail", model));
        }
示例#19
0
        public ActionResult Main(int?PatientId)
        {
            OpdModel    opdmodel = new OpdModel();
            OpdProvider pro      = new OpdProvider();

            opdmodel.OpdModelList = pro.Getlist().Where(x => x.OpdID == PatientId).ToList();
            return(View("Main", opdmodel));
        }
示例#20
0
        // [HttpPost]
        public ActionResult SearchPatient1(int srchVal, string value)
        {
            InqueryProvider pro   = new InqueryProvider();
            OpdModel        model = new OpdModel();

            model.OpdModelList = pro.GetDepositForPatient(srchVal, value);
            return(View(model));
        }
示例#21
0
        //[CustomAuthorize(Roles = "OpdAdmin, OpdCreate,superadmin, admin")]
        public ActionResult Edit(int id)
        {
            OpdModel model = new OpdModel();

            model = pro.Getlist().Where(x => x.OpdID == id).FirstOrDefault();
            model.OpdDoctorList      = pro.GetPatientDoctorList(id);
            model.OpdFeeDetailsModel = pro.GetPatientFeeDetailsList(id).LastOrDefault();
            return(View(model));
        }
示例#22
0
        public ActionResult calulateagenttotal()
        {
            OpdModel model = new OpdModel();

            model.OpdMedicalDetailModel = new OpdMedicalDetailModel();
            model.OpdMedicalDetailList  = OMPro.GetAgentAndtotalAmount();

            return(View(model));
        }
示例#23
0
        public ActionResult Index()
        {
            //var obj = ent.EmergencyMaster.Where(x => x.EmergencyMasterId == ent.EmergencyMaster.Max(y => y.EmergencyMasterId)).SingleOrDefault();
            OpdModel model = new OpdModel();

            model.OpdMedicalDetailModel = new OpdMedicalDetailModel();
            model.OpdModelList          = OMPro.Getlist();

            return(View(model));
        }
示例#24
0
        //[CustomAuthorize(Roles = "OpdAdmin, OpdCreate, OpdView, superadmin, admin")]
        public ActionResult Details(int id)
        {
            OpdModel model = new OpdModel();

            model = pro.Getlist().Where(x => x.OpdID == id).FirstOrDefault();
            model.OpdDoctorList      = pro.GetPatientDoctorList(id);
            model.OpdFeeDetailsModel = pro.GetPatientFeeDetailsList(id).LastOrDefault();
            //return PartialView("_Details",model);
            return(PartialView("_Details1", model));
        }
示例#25
0
        //[CustomAuthorize(Roles = "OpdAdmin, OpdCreate,superadmin, admin")]
        public ActionResult OldPatient(int srchVal, string value)
        {
            if (srchVal == 1)
            {
                try
                {
                    int      patientId = Convert.ToInt16(value);
                    OpdModel model     = new OpdModel();
                    string   str       = "";
                    model.OpdModelList = pro.SearchOPD(patientId, str);
                    return(PartialView("_OpdPatientRecordsWithPatientId", model));
                }

                catch (Exception e)
                {
                    TempData["msz"] = "Please Check Patient Id";
                    OpdModel model = new OpdModel();
                    return(PartialView("_OpdPatientRecordsWithPatientId", model));
                }
            }



            if (srchVal == 5)
            {
                int age = Convert.ToInt16(value);
            }

            if (srchVal == 2)
            {
                OpdModel model = new OpdModel();
                model.OpdModelList = pro.SearchOPD(0, value);
                return(PartialView("_OpdPatientRecordsWithPatientId", model));
            }

            if (srchVal == 3)
            {
                OpdModel model = new OpdModel();
                model.OpdModelList = pro.SearchOPDWithArress(value);
                return(PartialView("_OpdPatientRecordsWithPatientId", model));
            }

            if (srchVal == 4)
            {
                OpdModel model = new OpdModel();
                model.OpdModelList = pro.SearchOPDWithPhone(value);
                return(PartialView("_OpdPatientRecordsWithPatientId", model));
            }

            return(View());
        }
示例#26
0
        public ActionResult Edit(int id)
        {
            OpdModel model = new OpdModel();

            model = pro.Getlist().Where(x => x.OpdID == id).FirstOrDefault();
            model.OpdDoctorList = pro.GetPatientDoctorList(id);
            var a = HospitalManagementSystem.Utility.GetGrandtotalamount();

            model.OpdMedicalDetailModel            = new OpdMedicalDetailModel();
            model.OpdMedicalDetailModel.Amount     = a;
            model.OpdMedicalDetailModel.Commission = Utility.GetCommision(id);
            model.OpdMedicalDetailModel.Discount   = Utility.GetDiscount(id);
            return(View(model));
        }
示例#27
0
        public ActionResult OpdBilling(int id)
        {
            OpdModel model = new OpdModel();

            if (id == 1)
            {
                ViewBag.LayoutId = "Master";
            }
            else
            {
                ViewBag.LayoutId = "Slave";
            }
            return(View(model));
        }
示例#28
0
        public ActionResult DoctorCommisionReport(int id)
        {
            OpdModel model = new OpdModel();

            if (id == 1)
            {
                ViewBag.LayoutId = "Master";
            }
            else
            {
                ViewBag.LayoutId = "Slave";
            }
            return(View(model));
        }
        public ActionResult CreateNewPatient(OpdModel model)
        {
            IpdRegistrationMasterProvider pro = new IpdRegistrationMasterProvider();

            if (ModelState.IsValid)
            {
                int i = pro.NewPatientInsert(model);
                return(RedirectToAction("Create", new { id = i }));
            }
            else
            {
                return(View(model));
            }
        }
示例#30
0
        public ActionResult ViewOldPatient(int id, OpdModel model)
        {
            EHMSEntities ent = new EHMSEntities();

            DateTime date = model.OpdDoctorList.Select(x => x.PreferDate.Value).FirstOrDefault();

            int count = ent.OpdPatientDoctorDetails.Where(x => x.OpdID == id && x.PreferDate == date).Count();

            if (count >= 1)
            {
                TempData["PreferDate"] = "Patient Already Prefered On This Date !";
                return(View(model));
            }


            if (ModelState.IsValid)
            {
                //update here
                int i = pro.OldPatientInsert(model);
                if (i != 0)
                {
                    string actionName     = this.ControllerContext.RouteData.Values["action"].ToString();
                    string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                    Utility.SaveTrialAudit(controllerName, actionName);
                    TempData["success"] = HospitalManagementSystem.UtilityMessage.save;
                    //return RedirectToAction("Index");
                    int LastInsertdId = pro.GetLastInsertedId();
                    //return RedirectToAction("Index");
                    return(RedirectToAction("BillForm", new { id = id, FromSource = 1 }));
                    //int TotalCount = pro.GetNumberOfVisitOfPatientInHospital(id);
                    //if (TotalCount > 1)
                    //{
                    //    //model = pro.GetAllBillDate(id);
                    //    //model.OpdID = id;
                    //    ////return View("MultipleBillCase", model);
                    //    ////return RedirectToAction("PrintMultipleBill", new { id = model.OpdFeeDetailsModel.OpdFeeDetailsID, PatientId = model.OpdID });
                    //    //return RedirectToAction("MultipleBillCase", model);
                    //}
                }
                else
                {
                    TempData["success"] = HospitalManagementSystem.UtilityMessage.savefailed;
                    return(RedirectToAction("Index"));
                }
            }
            return(View(model));
        }