Ejemplo n.º 1
0
        public EntityPatientMaster GetPatientDetailsByPatientId(int PatientId)
        {
            EntityPatientMaster objPatient = null;

            try
            {
                objPatient = (from tbl in objData.tblPatientMasters
                              join tblAdmit in objData.tblPatientAdmitDetails
                              on tbl.PKId equals tblAdmit.PatientId
                              join tblSex in objData.tblGenders
                              on tbl.Gender equals tblSex.PKId
                              where tblAdmit.IsDelete == false &&
                              tblAdmit.PatientId == PatientId
                              select new EntityPatientMaster
                {
                    Age = Convert.ToInt32(tblAdmit.Age),
                    AgeIn = tblAdmit.AgeIn,
                    BloodGroup = tbl.BloodGroup,
                    PatientCode = tbl.PatientCode,
                    GenderDesc = tblSex.GenderDesc,
                    PatientAdmitDate = Convert.ToDateTime(tblAdmit.AdmitDate),
                }).FirstOrDefault();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objPatient);
        }
Ejemplo n.º 2
0
        public EntityPatientMaster GetPatientCate(int Pat)
        {
            EntityPatientMaster cate = (from tbl in objData.tblPatientAdmitDetails
                                        where tbl.AdmitId.Equals(Pat) &&
                                        tbl.IsDischarge == false
                                        select new EntityPatientMaster {
                PatientId = tbl.AdmitId, PatientType = tbl.IsIPD.Value ? "IPD" : "OPD"
            }).SingleOrDefault();

            return(cate);
        }
Ejemplo n.º 3
0
 private List <SqlParameter> CreateParameterDeletePatient(EntityPatientMaster entPatientMaster)
 {
     try
     {
         List <SqlParameter> lstParam = new List <SqlParameter>();
         Commons.ADDParameter(ref lstParam, "@PatientCode", DbType.String, entPatientMaster.PatientCode);
         Commons.ADDParameter(ref lstParam, "@Discontinued", DbType.Boolean, entPatientMaster.Discontinued);
         Commons.ADDParameter(ref lstParam, "@DiscontRemark", DbType.String, entPatientMaster.DiscontRemark);
         return(lstParam);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 4
0
 public EntityPatientMaster GetDeptDoctor(int pintCategoryId)
 {
     try
     {
         EntityPatientMaster objPat = (from tbl in objData.tblDocCategories
                                       join tblAdmit in objData.tblEmployees
                                       on tbl.DocId equals tblAdmit.PKId
                                       where tbl.OperaCatId.Equals(pintCategoryId)
                                       select new EntityPatientMaster {
             FullName = tblAdmit.EmpFirstName + ' ' + tblAdmit.EmpMiddleName + ' ' + tblAdmit.EmpLastName
         }).FirstOrDefault();
         return(objPat);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
 public EntityPatientMaster GetDischargeOnDiadnosis(int patientId)
 {
     try
     {
         EntityPatientMaster objPat = (from tbl in objData.tblPatientMasters
                                       join tblAdmit in objData.tblPatientAdmitDetails
                                       on tbl.PKId equals tblAdmit.PatientId
                                       where tblAdmit.AdmitId.Equals(patientId)
                                       select new EntityPatientMaster {
             Dignosys = Convert.ToString(tblAdmit.Dignosys)
         }).FirstOrDefault();
         return(objPat);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 6
0
        public int UpdateIPDPatient(EntityPatientMaster entPatientMaster)
        {
            int cnt = 0;

            try
            {
                List <SqlParameter> lstParam = new List <SqlParameter>();
                Commons.ADDParameter(ref lstParam, "@PatientCode", DbType.String, entPatientMaster.PatientCode);
                Commons.ADDParameter(ref lstParam, "@Initial", DbType.Int32, entPatientMaster.PatientInitial);
                Commons.ADDParameter(ref lstParam, "@PatientFirstName", DbType.String, entPatientMaster.PatientFirstName);
                Commons.ADDParameter(ref lstParam, "@PatientMiddleName", DbType.String, entPatientMaster.PatientMiddleName);
                Commons.ADDParameter(ref lstParam, "@PatientLastName", DbType.String, entPatientMaster.PatientLastName);
                Commons.ADDParameter(ref lstParam, "@AdminDate", DbType.DateTime, entPatientMaster.PatientAdmitDate);
                Commons.ADDParameter(ref lstParam, "@AdmitTime", DbType.String, entPatientMaster.PatientAdmitTime);
                Commons.ADDParameter(ref lstParam, "@Address", DbType.String, entPatientMaster.PatientAddress);
                Commons.ADDParameter(ref lstParam, "@ContactNo", DbType.String, entPatientMaster.PatientContactNo);
                Commons.ADDParameter(ref lstParam, "@BirthDate", DbType.DateTime, entPatientMaster.BirthDate);
                Commons.ADDParameter(ref lstParam, "@ReferedBy", DbType.String, entPatientMaster.ReferedBy);
                Commons.ADDParameter(ref lstParam, "@Gender", DbType.String, entPatientMaster.Gender);
                Commons.ADDParameter(ref lstParam, "@Age", DbType.Int32, entPatientMaster.Age);
                Commons.ADDParameter(ref lstParam, "@Occupation", DbType.Int32, entPatientMaster.Occupation);
                Commons.ADDParameter(ref lstParam, "@Religion", DbType.String, entPatientMaster.Religion);
                Commons.ADDParameter(ref lstParam, "@Caste", DbType.String, entPatientMaster.Caste);
                Commons.ADDParameter(ref lstParam, "@City", DbType.String, entPatientMaster.City);
                Commons.ADDParameter(ref lstParam, "@State", DbType.String, entPatientMaster.State);
                Commons.ADDParameter(ref lstParam, "@Country", DbType.String, entPatientMaster.Country);
                Commons.ADDParameter(ref lstParam, "@CompanyCode", DbType.String, entPatientMaster.CompanyCode);
                Commons.ADDParameter(ref lstParam, "@ChangeBy", DbType.String, entPatientMaster.EntryBy);
                Commons.ADDParameter(ref lstParam, "@PersonalHistory", DbType.String, entPatientMaster.PersonalHistory);
                Commons.ADDParameter(ref lstParam, "@PastMedHistory", DbType.String, entPatientMaster.PastMedicalHistory);
                Commons.ADDParameter(ref lstParam, "@FamilyHistory", DbType.String, entPatientMaster.FamilyHistory);
                Commons.ADDParameter(ref lstParam, "@BloodGroup", DbType.String, entPatientMaster.BloodGroup);
                cnt = mobjDataAcces.ExecuteQuery("sp_UpdatePatientMaster", lstParam);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(cnt);
        }
Ejemplo n.º 7
0
        public int InsertIPDPatient(EntityPatientMaster entPatientMaster)
        {
            int cnt = 0;

            try
            {
                tblPatientMaster obj = new tblPatientMaster()
                {
                    Address            = entPatientMaster.PatientAddress,
                    AdminDate          = entPatientMaster.PatientAdmitDate,
                    AdmitTime          = entPatientMaster.PatientAdmitTime,
                    Age                = entPatientMaster.Age,
                    AgeIn              = entPatientMaster.AgeIn,
                    Weight             = entPatientMaster.Weight,
                    BedNo              = entPatientMaster.BedNo,
                    BirthDate          = entPatientMaster.BirthDate,
                    BloodGroup         = entPatientMaster.BloodGroup,
                    Caste              = entPatientMaster.Caste.ToString(),
                    City               = entPatientMaster.City,
                    ComContNo          = entPatientMaster.CompanyContact,
                    CompanyCode        = entPatientMaster.CompanyCode,
                    CompanyAddress     = entPatientMaster.CompanyAddress,
                    ContactNo          = entPatientMaster.PatientContactNo,
                    CompanyId          = entPatientMaster.CompanyId,
                    Country            = entPatientMaster.Country,
                    Dignosys           = entPatientMaster.Dignosys,
                    Gender             = Convert.ToChar(entPatientMaster.Gender),
                    Initial            = entPatientMaster.PatientInitial,
                    InsuranceCompanyId = entPatientMaster.InsuranceCompID,
                    InsuranceCompName  = entPatientMaster.InsuranceCompName,
                    Occupation         = entPatientMaster.Occupation,
                    //DeptCategory=entPatientMaster.DeptCategory,
                    //DeptDoctorId=entPatientMaster.DeptDoctorId,
                    PatientCode       = entPatientMaster.PatientCode,
                    PatientFirstName  = entPatientMaster.PatientFirstName,
                    PatientMiddleName = entPatientMaster.PatientMiddleName,
                    PatientLastName   = entPatientMaster.PatientLastName,
                    PatientType       = entPatientMaster.PatientType,
                    Religion          = entPatientMaster.Religion.ToString(),
                    State             = entPatientMaster.State,
                    ReferedBy         = entPatientMaster.ReferedBy,
                    PastMedHistory    = entPatientMaster.PastMedicalHistory,
                    OPDRoomNo         = "0",
                    FloorNo           = 0,
                    WardNo            = 0,
                    ConsultingDr      = 0,
                    EntryDate         = DateTime.Now.Date,
                    FamilyHistory     = "",
                    EntryBy           = "0",
                    ChangeBy          = "0",
                    PatientCategory   = "0",
                    IsDelete          = false,
                    IPDNo             = entPatientMaster.IPDNo,
                    OPDNo             = entPatientMaster.OPDNo,
                    CompanyName       = entPatientMaster.CompName,
                    InsuranceName     = entPatientMaster.InsuName
                                        //AudiometryFile=entPatientMaster.AudiometryFile,
                                        //EndoscopyFile=entPatientMaster.EndoscopyFile
                };

                objData.tblPatientMasters.InsertOnSubmit(obj);
                objData.SubmitChanges();
                cnt++;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(cnt);
        }
Ejemplo n.º 8
0
        public int UpdatePatient(EntityPatientMaster entPatientMaster)
        {
            int i = 0;

            try
            {
                tblPatientMaster objPatient = (from tbl in objData.tblPatientMasters
                                               where tbl.IsDelete == false &&
                                               tbl.PKId == entPatientMaster.PKId
                                               select tbl).FirstOrDefault();
                if (objPatient != null)
                {
                    objPatient.IPDNo      = entPatientMaster.IPDNo;
                    objPatient.OPDNo      = entPatientMaster.OPDNo;
                    objPatient.Address    = entPatientMaster.PatientAddress;
                    objPatient.Age        = entPatientMaster.Age;
                    objPatient.AgeIn      = entPatientMaster.AgeIn;
                    objPatient.Weight     = entPatientMaster.Weight;
                    objPatient.BirthDate  = entPatientMaster.BirthDate;
                    objPatient.BloodGroup = entPatientMaster.BloodGroup;
                    objPatient.Caste      = Convert.ToString(entPatientMaster.Caste);
                    objPatient.City       = entPatientMaster.City;
                    objPatient.ComContNo  = entPatientMaster.CompanyContact;
                    objPatient.ContactNo  = entPatientMaster.PatientContactNo;
                    //objPatient.Gender =Convert.ToChar(entPatientMaster.Gender);
                    objPatient.Initial            = entPatientMaster.PatientInitial;
                    objPatient.PatientFirstName   = entPatientMaster.PatientFirstName;
                    objPatient.PatientMiddleName  = entPatientMaster.PatientMiddleName;
                    objPatient.PatientLastName    = entPatientMaster.PatientLastName;
                    objPatient.Religion           = Convert.ToString(entPatientMaster.Religion);
                    objPatient.State              = entPatientMaster.State;
                    objPatient.ReferedBy          = entPatientMaster.ReferedBy;
                    objPatient.Occupation         = entPatientMaster.Occupation;
                    objPatient.DeptCategory       = entPatientMaster.DeptCategory;
                    objPatient.DeptDoctorId       = entPatientMaster.DeptDoctorId;
                    objPatient.CompanyName        = entPatientMaster.CompName;
                    objPatient.InsuranceName      = entPatientMaster.InsuName;
                    objPatient.CompanyId          = entPatientMaster.CompanyId;
                    objPatient.InsuranceCompanyId = entPatientMaster.InsuranceCompID;
                    objPatient.InsuranceCompName  = entPatientMaster.InsuranceCompName;
                    List <tblPatientAdmitDetail> lst = (from tbl in objData.tblPatientAdmitDetails
                                                        where tbl.IsDelete == false &&
                                                        tbl.PatientId == objPatient.PKId
                                                        select tbl).ToList();
                    if (lst.Count > 0)
                    {
                        foreach (tblPatientAdmitDetail item in lst)
                        {
                            //if (string.IsNullOrEmpty(item.Dignosys))
                            //{
                            item.Dignosys      = entPatientMaster.Dignosys;
                            item.Age           = entPatientMaster.Age;
                            item.AgeIn         = entPatientMaster.AgeIn;
                            item.DeptCategory  = entPatientMaster.DeptCategory;
                            item.DeptDoctorId  = entPatientMaster.DeptDoctorId;
                            item.CompanyName   = entPatientMaster.CompName;
                            item.InsuranceName = entPatientMaster.InsuName;
                            if (entPatientMaster.CompanyId > 0)
                            {
                                item.IsCompany = true;
                                item.CompanyId = entPatientMaster.CompanyId;
                            }
                            if (entPatientMaster.InsuranceCompID > 0)
                            {
                                item.IsInsured      = true;
                                item.InsuranceComId = entPatientMaster.InsuranceCompID;
                            }
                            //}
                        }
                    }
                    objData.SubmitChanges();
                    i++;
                }
            }
            catch (Exception)
            {
                i = 0;
            }
            return(i);
        }