Ejemplo n.º 1
0
        //[CustomAuthorize(Roles = "DepositAdmin, DepositCreate, IPDCreate, IPDAdmin, superadmin, admin")]
        public ActionResult Create(int id, int DeptId)
        {
            DepositMasterModel model = new DepositMasterModel();

            model.objPatientPartialDetail = new PatientPartialDetails();
            PatientPartialDetails objPartialDetails = new PatientPartialDetails();

            if (DeptId == 1000)
            {
                //get opd patient details
                model.objPatientPartialDetail.PatientFullName = pro.GetPatientFullName(DeptId, id);
                objPartialDetails.PatientDepartmentId         = pro.GetPatientDepartmentId(id);
                model.PatientDepartmentId = pro.GetPatientDepartmentId(id);
            }
            else
            {
                //get emergency detail

                model.objPatientPartialDetail.PatientFullName = pro.GetPatientFullName(DeptId, id);;
                model.PatientDepartmentId = 1001;
            }

            //DepositMasterModel model = new DepositMasterModel();
            model.DepartmentId = DeptId;
            model.PatientId    = id;

            return(View(model));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
0
        public List <PatientPartialDetails> SearchOPDFromPhoneDeposit(string address)
        {
            EHMSEntities ent  = new EHMSEntities();
            var          data = ent.OpdMasters.Where(x => x.ContactName.Contains(address)).ToList();
            List <PatientPartialDetails> PatientDetailList = new List <PatientPartialDetails>();

            foreach (var item in data)
            {
                PatientPartialDetails obj = new PatientPartialDetails();
                obj.PatientId           = item.OpdID;
                obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;
                obj.Age                 = item.AgeYear;
                obj.PatientDepartmentId = obj.DepartmentID;
                obj.DepartmentID        = 1000;
                obj.Sex                 = item.Sex;
                PatientDetailList.Add(obj);
            }

            return(PatientDetailList);
        }
Ejemplo n.º 4
0
        public List <PatientPartialDetails> GetDepositForPatient(int opdId, string Name)
        {
            EHMSEntities ent  = new EHMSEntities();
            string       name = Name.Trim();
            List <PatientPartialDetails> PatientDetailList = new List <PatientPartialDetails>();

            if (opdId == 0 && name == "")
            {
                var data = ent.OpdMasters.Take(20).ToList();
                foreach (var item in data)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = item.OpdID;
                    obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;
                    obj.Age                 = item.AgeYear;
                    obj.DepartmentID        = 1000;
                    obj.PatientDepartmentId = item.DepartmentId;
                    obj.Sex                 = item.Sex;
                    obj.Address             = item.Address;
                    obj.ContactNumber       = item.ContactName;
                    obj.RegistrationDate    = (DateTime)item.RegistrationDate;

                    PatientDetailList.Add(obj);
                }

                return(PatientDetailList);
            }

            else if (opdId == 0 && name != "")
            {
                var data = ent.OpdMasters.Where(x => x.FirstName.StartsWith(name)).ToList();
                foreach (var item in data)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = item.OpdID;
                    obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;
                    obj.Age                 = item.AgeYear;
                    obj.DepartmentID        = 1000;
                    obj.PatientDepartmentId = item.DepartmentId;
                    obj.Sex                 = item.Sex;
                    obj.Address             = item.Address;
                    obj.ContactNumber       = item.ContactName;
                    obj.RegistrationDate    = (DateTime)item.RegistrationDate;
                    PatientDetailList.Add(obj);
                }

                return(PatientDetailList);
            }
            else if (opdId != 0 && name == "")
            {
                var data = ent.OpdMasters.Where(x => x.OpdID == opdId).ToList();
                foreach (var item in data)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = item.OpdID;
                    obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;
                    obj.Age                 = item.AgeYear;
                    obj.DepartmentID        = 1000;
                    obj.PatientDepartmentId = item.DepartmentId;
                    obj.Sex                 = item.Sex;
                    obj.Address             = item.Address;
                    obj.ContactNumber       = item.ContactName;
                    obj.RegistrationDate    = (DateTime)item.RegistrationDate;
                    PatientDetailList.Add(obj);
                }

                return(PatientDetailList);
            }
            else
            {
                var data = ent.OpdMasters.Where(x => x.OpdID == opdId).ToList();
                foreach (var item in data)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = item.OpdID;
                    obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;
                    obj.Age                 = item.AgeYear;
                    obj.DepartmentID        = 1000;
                    obj.PatientDepartmentId = item.DepartmentId;
                    obj.Sex                 = item.Sex;
                    obj.Address             = item.Address;
                    obj.ContactNumber       = item.ContactName;
                    obj.RegistrationDate    = (DateTime)item.RegistrationDate;
                    PatientDetailList.Add(obj);
                }

                return(PatientDetailList);

                //return new List<OpdModel>(AutoMapper.Mapper.Map<IEnumerable<OpdMaster>, IEnumerable<OpdModel>>(query)).ToList();
            }
        }
Ejemplo n.º 5
0
        public List <PatientPartialDetails> GetDepositForPatientEmergency(int EmergencyId, string Name)
        {
            EHMSEntities ent  = new EHMSEntities();
            string       name = Name.Trim();
            List <PatientPartialDetails> PatientDetailList  = new List <PatientPartialDetails>();
            List <PatientPartialDetails> PatientDetailList1 = new List <PatientPartialDetails>();

            if (EmergencyId == 0 && name == "")
            {
                var data = ent.OpdMasters.Take(20).ToList();
                foreach (var item in data)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = item.OpdID;
                    obj.PatientDepartmentId = 1001;
                    obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;
                    obj.Age          = item.AgeYear;
                    obj.DepartmentID = 1001;
                    obj.Sex          = item.Sex;
                    PatientDetailList.Add(obj);
                }

                return(PatientDetailList);
            }

            else if (EmergencyId == 0 && name != "")
            {
                OpdMaster a        = new OpdMaster();
                var       dataName = ent.OpdMasters.Take(20).ToList();
                foreach (var item in dataName)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = item.OpdID;
                    obj.PatientDepartmentId = 1001;
                    obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;

                    obj.Age          = item.AgeYear;
                    obj.DepartmentID = 1001;
                    obj.Sex          = item.Sex;
                    PatientDetailList1.Add(obj);
                }



                var data = PatientDetailList1.Where(x => x.PatientFullName.Contains(name)).ToList();

                foreach (var item in data)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = obj.PatientId;
                    obj.PatientDepartmentId = 1001;
                    obj.PatientFullName     = item.PatientFullName;
                    obj.Age          = item.Age;
                    obj.DepartmentID = 1001;
                    obj.Sex          = item.Sex;
                    PatientDetailList.Add(obj);
                }

                return(PatientDetailList);
            }
            else if (EmergencyId != 0 && name == "")
            {
                var data = ent.OpdMasters.Where(x => x.OpdID == EmergencyId).ToList();
                foreach (var item in data)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = item.OpdID;
                    obj.PatientDepartmentId = 1001;
                    obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;
                    obj.Age          = item.AgeYear;
                    obj.DepartmentID = 1001;
                    obj.Sex          = item.Sex;
                    PatientDetailList.Add(obj);
                }

                return(PatientDetailList);
            }
            else
            {
                var data = ent.OpdMasters.Where(x => x.OpdID == EmergencyId).ToList();
                foreach (var item in data)
                {
                    PatientPartialDetails obj = new PatientPartialDetails();
                    obj.PatientId           = item.OpdID;
                    obj.PatientDepartmentId = 1001;
                    obj.PatientFullName     = item.FirstName + ' ' + item.MiddleName + ' ' + item.LastName;
                    obj.Age          = item.AgeYear;
                    obj.DepartmentID = 1001;
                    obj.Sex          = item.Sex;
                    PatientDetailList.Add(obj);
                }

                return(PatientDetailList);

                //return new List<OpdModel>(AutoMapper.Mapper.Map<IEnumerable<OpdMaster>, IEnumerable<OpdModel>>(query)).ToList();
            }
        }