Exemplo n.º 1
0
        // GetRole ZAM 2014-12-02
        public static DataTable GetRole(DataConnection pclsCache)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("Code", typeof(string)));
            list.Columns.Add(new DataColumn("Name", typeof(string)));
            list.Columns.Add(new DataColumn("SortNo", typeof(int)));
            list.Columns.Add(new DataColumn("Redundance", typeof(string)));
            list.Columns.Add(new DataColumn("InvalidFlag", typeof(int)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Cm.MstRole.GetRole(pclsCache.CacheConnectionObject);
                //cmd.Parameters.Add("Category", CacheDbType.NVarChar).Value = Category;
                //cmd.Parameters.Add("InvalidFlag", CacheDbType.Int).Value = InvalidFlag;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    int InvalidFlag = 0;        //value check ZAM 2014-1-7
                    if (cdr["InvalidFlag"].ToString() != "")
                    {
                        InvalidFlag = Convert.ToInt32(cdr["InvalidFlag"]);
                    }
                    list.Rows.Add(cdr["Code"].ToString(), cdr["Name"].ToString(), cdr["SortNo"], cdr["Redundance"].ToString(), InvalidFlag);
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstRole.GetRole", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 2
0
        //GetExamDetails 获取患者某次检查的所有详细信息 ZC 2014-12-2
        //CSQ 2015-1-21
        public static DataTable GetExamDetails(DataConnection pclsCache, string UserId, string VisitId, int SortNo, string ItemCode)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("Code", typeof(string)));
            list.Columns.Add(new DataColumn("Name", typeof(string)));
            list.Columns.Add(new DataColumn("Value", typeof(string)));
            list.Columns.Add(new DataColumn("IsAbnormalCode", typeof(int)));
            list.Columns.Add(new DataColumn("IsAbnormal", typeof(string)));
            list.Columns.Add(new DataColumn("UnitCode", typeof(string)));
            list.Columns.Add(new DataColumn("Unit", typeof(string)));
            list.Columns.Add(new DataColumn("Creator", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Ps.ExamDetails.GetExamDetails(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("UserId", CacheDbType.NVarChar).Value   = UserId;
                cmd.Parameters.Add("VisitId", CacheDbType.NVarChar).Value  = VisitId;
                cmd.Parameters.Add("SortNo", CacheDbType.Int).Value        = SortNo;
                cmd.Parameters.Add("ItemCode", CacheDbType.NVarChar).Value = ItemCode;
                cdr = cmd.ExecuteReader();

                while (cdr.Read())
                {
                    list.Rows.Add(cdr["Code"].ToString(), cdr["Name"].ToString(), cdr["Value"].ToString(),
                                  Convert.ToInt32(cdr["IsAbnormalCode"].ToString()), cdr["IsAbnormal"].ToString(),
                                  cdr["UnitCode"].ToString(), cdr["Unit"].ToString(), cdr["Creator"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsExamDetails.GetExamDetails", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 3
0
        public List <CmMstInfoItem> GetCmMstInfoItem(DataConnection pclsCache)
        {
            List <CmMstInfoItem> CmMstInfoItemList = new List <CmMstInfoItem>();

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                //cmd = new CacheCommand();
                cmd = Cm.MstInfoItem.GetInfoItem(pclsCache.CacheConnectionObject);
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    CmMstInfoItemList.Add(new CmMstInfoItem
                    {
                        CategoryCode    = cdr["CategoryCode"].ToString(),
                        Code            = cdr["Code"].ToString(),
                        Name            = cdr["Name"].ToString(),
                        ParentCode      = cdr["ParentCode"].ToString(),
                        SortNo          = Convert.ToInt32(cdr["SortNo"].ToString()),
                        StartDate       = Convert.ToInt32(cdr["StartDate"].ToString()),
                        EndDate         = Convert.ToInt32(cdr["EndDate"].ToString()),
                        GroupHeaderFlag = Convert.ToInt32(cdr["GroupHeaderFlag"].ToString()),
                        ControlType     = cdr["ControlType"].ToString(),
                        OptionCategory  = cdr["OptionCategory"].ToString(),
                        RevUserId       = "",
                        TerminalName    = "",
                        TerminalIP      = "",
                        DeviceType      = 0
                    });
                }
                return(CmMstInfoItemList);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstInfoItem.GetInfoItem", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 4
0
        //WF 2015-1-22
        public static DataTable GetTreatmentList(DataConnection pclsCache, string piUserId)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("SortNo", typeof(string)));
            list.Columns.Add(new DataColumn("TreatmentGoal", typeof(string)));
            list.Columns.Add(new DataColumn("TreatmentGoalName", typeof(string)));
            list.Columns.Add(new DataColumn("TreatmentAction", typeof(string)));
            list.Columns.Add(new DataColumn("TreatmentActionName", typeof(string)));
            list.Columns.Add(new DataColumn("Group", typeof(string)));
            list.Columns.Add(new DataColumn("GroupName", typeof(string)));
            list.Columns.Add(new DataColumn("TreatmentPlan", typeof(string)));
            list.Columns.Add(new DataColumn("Description", typeof(string)));
            list.Columns.Add(new DataColumn("TreatTime", typeof(string)));
            list.Columns.Add(new DataColumn("Duration", typeof(string)));
            list.Columns.Add(new DataColumn("DurationName", typeof(string)));
            list.Columns.Add(new DataColumn("ReInUserId", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Ps.Treatment.GetTreatmentList(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("piUserId", CacheDbType.NVarChar).Value = piUserId;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["SortNo"].ToString(), cdr["TreatmentGoal"].ToString(), cdr["TreatmentGoalName"].ToString(), cdr["TreatmentAction"].ToString(), cdr["TreatmentActionName"].ToString(), cdr["Group"].ToString(), cdr["GroupName"].ToString(), cdr["TreatmentPlan"].ToString(), cdr["Description"].ToString(), cdr["TreatTime"].ToString(), cdr["Duration"].ToString(), cdr["DurationName"].ToString(), cdr["ReInUserId"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Treatment.GetTreatmentList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 5
0
        //GetPatientsMatchByDoctorId   CSQ 20160114
        public static DataTable GetPatientsMatchByDoctorId(DataConnection pclsCache, string DoctorId, string CategoryCode)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("DoctorId", typeof(string)));
            list.Columns.Add(new DataColumn("DoctorName", typeof(string)));
            list.Columns.Add(new DataColumn("PatientId", typeof(string)));
            list.Columns.Add(new DataColumn("PatientName", typeof(string)));
            list.Columns.Add(new DataColumn("HUserId", typeof(string)));
            list.Columns.Add(new DataColumn("HospitalCode", typeof(string)));
            list.Columns.Add(new DataColumn("HospitalName", typeof(string)));
            list.Columns.Add(new DataColumn("Description", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Ps.DoctorInfoDetail.GetPatientsMatchByDoctorId(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("DoctorId", CacheDbType.NVarChar).Value     = DoctorId;
                cmd.Parameters.Add("CategoryCode", CacheDbType.NVarChar).Value = CategoryCode;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["DoctorId"].ToString(), cdr["DoctorName"].ToString(),
                                  cdr["PatientId"].ToString(), cdr["PatientName"].ToString(), cdr["HUserId"].ToString(), cdr["HospitalCode"].ToString(), cdr["HospitalName"].ToString(), cdr["Description"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.DoctorInfoDetail.GetPatientsMatchByDoctorId", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 6
0
        // GetListByStatus WF 2015-07-07
        public static DataTable GetListByStatus(DataConnection pclsCache, int Status)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("HospitalCode", typeof(string)));
            list.Columns.Add(new DataColumn("HospitalName", typeof(string)));
            list.Columns.Add(new DataColumn("Type", typeof(string)));
            list.Columns.Add(new DataColumn("Code", typeof(string)));
            list.Columns.Add(new DataColumn("TypeName", typeof(string)));
            list.Columns.Add(new DataColumn("Name", typeof(string)));
            list.Columns.Add(new DataColumn("InputCode", typeof(string)));
            list.Columns.Add(new DataColumn("Description", typeof(string)));
            list.Columns.Add(new DataColumn("Status", typeof(int)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Tmp.DivisionDict.GetListByStatus(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Status", CacheDbType.Int).Value = Status;
                //cmd.Parameters.Add("InvalidFlag", CacheDbType.Int).Value = InvalidFlag;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["HospitalCode"].ToString(), cdr["HospitalName"].ToString(), cdr["Type"].ToString(), cdr["Code"].ToString(), cdr["TypeName"].ToString(), cdr["Name"].ToString(), cdr["InputCode"].ToString(), cdr["Description"].ToString(), cdr["Status"]);
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Tmp.DivisionDict.GetListByStatus", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 7
0
        //CSQ 2015-1-21
        public static DataTable GetInfobyId(DataConnection pclsCache, string UserId)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("VisitId", typeof(string)));
            list.Columns.Add(new DataColumn("SortNo", typeof(string)));
            list.Columns.Add(new DataColumn("AdmissionDate", typeof(string)));
            list.Columns.Add(new DataColumn("DischargeDate", typeof(string)));
            list.Columns.Add(new DataColumn("HospitalCode", typeof(string)));
            list.Columns.Add(new DataColumn("HospitalName", typeof(string)));
            list.Columns.Add(new DataColumn("Department", typeof(string)));
            list.Columns.Add(new DataColumn("DepartmentName", typeof(string)));
            list.Columns.Add(new DataColumn("Doctor", typeof(string)));
            list.Columns.Add(new DataColumn("Creator", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Ps.InPatientInfo.GetInfobyId(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("UserId", CacheDbType.NVarChar).Value = UserId;
                //cmd.Parameters.Add("InvalidFlag", CacheDbType.Int).Value = InvalidFlag;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["VisitId"].ToString(), cdr["SortNo"].ToString(), cdr["AdmissionDate"].ToString(), cdr["DischargeDate"].ToString(), cdr["HospitalCode"].ToString(), cdr["HospitalName"].ToString(), cdr["Department"].ToString(), cdr["DepartmentName"].ToString(), cdr["Doctor"].ToString(), cdr["Creator"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsInPatientInfo.GetInfobyId", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 8
0
        public List <DutyDoctorInfo> getDutyDoctorInfoList(DataConnection pclsCache, string id)
        {
            List <DutyDoctorInfo> dutyDoctorInfoList = new List <DutyDoctorInfo>();

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Vs.MstSchedule.GetDutyDoctorInfoList(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("DeckId", CacheDbType.NVarChar).Value = id;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    DutyDoctorInfo dutyDoctorInfo = new DutyDoctorInfo();
                    dutyDoctorInfo.DeckId        = cdr["DeckId"].ToString();
                    dutyDoctorInfo.DeckSectionId = cdr["DeckSectionId"].ToString();
                    dutyDoctorInfo.DoctorId      = cdr["DoctorId"].ToString();
                    dutyDoctorInfo.SortNo        = cdr["SortNo"].ToString();
                    dutyDoctorInfo.Time1         = cdr["Time1"].ToString();
                    dutyDoctorInfo.Time2         = cdr["Time2"].ToString();
                    dutyDoctorInfo.DoctorName    = cdr["UserName"].ToString();
                    dutyDoctorInfo.Affiliation   = cdr["Affiliation"].ToString();

                    dutyDoctorInfoList.Add(dutyDoctorInfo);
                }

                return(dutyDoctorInfoList);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "DeckInfoMethod.getDutyDoctorInfoList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 9
0
        //WF 20150514
        public static DataTable GetAddressByType(DataConnection pclsCache, string Module, int Type)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("Module", typeof(string)));
            list.Columns.Add(new DataColumn("ModuleName", typeof(string)));
            list.Columns.Add(new DataColumn("HealthId", typeof(string)));
            list.Columns.Add(new DataColumn("Type", typeof(int)));
            list.Columns.Add(new DataColumn("TypeName", typeof(string)));
            list.Columns.Add(new DataColumn("FileName", typeof(string)));
            list.Columns.Add(new DataColumn("Path", typeof(string)));
            list.Columns.Add(new DataColumn("Introduction", typeof(string)));
            list.Columns.Add(new DataColumn("Redundance", typeof(string)));
            list.Columns.Add(new DataColumn("Author", typeof(string)));
            list.Columns.Add(new DataColumn("AuthorName", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Cm.MstHealthEducation.GetAddressByType(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Module", CacheDbType.NVarChar).Value = Module;
                cmd.Parameters.Add("Type", CacheDbType.Int).Value        = Type;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["Module"].ToString(), cdr["ModuleName"].ToString(), cdr["HealthId"].ToString(), cdr["Type"], cdr["TypeName"].ToString(), cdr["FileName"].ToString(), cdr["Path"].ToString(), cdr["Introduction"].ToString(), cdr["Redundance"].ToString(), cdr["Author"].ToString(), cdr["AuthorName"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Cm.MstHealthEducation.GetAddressByType", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 10
0
            /// <summary>
            /// 计算某段时间的总依从率 syf 2015-10-10
            /// </summary>
            /// <param name="pclsCache"></param>
            /// <param name="PatientId"></param>
            /// <param name="PlanNo"></param>
            /// <param name="StartDate"></param>
            /// <param name="EndDate"></param>
            /// <returns></returns>
            public string GetCompliacneRate(DataConnection pclsCache, string PatientId, string PlanNo, int StartDate, int EndDate)
            {
                string          compliacneRate = "";
                CacheCommand    cmd            = null;
                CacheDataReader cdr            = null;

                try
                {
                    if (!pclsCache.Connect())
                    {
                        return(null);
                    }

                    cmd = new CacheCommand();
                    cmd = Ps.Compliance.GetComplianceListByPeriod(pclsCache.CacheConnectionObject);
                    cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;
                    cmd.Parameters.Add("PlanNo", CacheDbType.NVarChar).Value    = PlanNo;
                    cmd.Parameters.Add("StartDate", CacheDbType.NVarChar).Value = StartDate;
                    cmd.Parameters.Add("EndDate", CacheDbType.NVarChar).Value   = EndDate;

                    cdr = cmd.ExecuteReader();

                    double sum   = 0;
                    int    count = 0;
                    while (cdr.Read())
                    {
                        sum += Convert.ToDouble(cdr["Compliance"]);
                        count++;
                    }

                    if (count != 0)
                    {
                        compliacneRate = (Math.Round(sum / count, 2, MidpointRounding.AwayFromZero) * 100).ToString(); //保留整数
                    }

                    return(compliacneRate);
                }
                catch (Exception ex)
                {
                    HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PlanInfoMethod.GetCompliacneRate", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                    return(null);
                }
                finally
                {
                    if ((cdr != null))
                    {
                        cdr.Close();
                        cdr.Dispose(true);
                        cdr = null;
                    }
                    if ((cmd != null))
                    {
                        cmd.Parameters.Clear();
                        cmd.Dispose();
                        cmd = null;
                    }
                    pclsCache.DisConnect();
                }
            }
Exemplo n.º 11
0
        public List <CmMstTask> GetMstTaskByParentCode(DataConnection pclsCache, string ParentCode)
        {
            List <CmMstTask> list = new List <CmMstTask>();

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Cm.MstTask.GetMstTaskByParentCode(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("DoctorId", CacheDbType.NVarChar).Value = ParentCode;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Add(new CmMstTask
                    {
                        CategoryCode    = cdr["CategoryCode"].ToString(),
                        Code            = cdr["Code"].ToString(),
                        Name            = cdr["Name"].ToString(),
                        ParentCode      = cdr["ParentCode"].ToString(),
                        Description     = cdr["Description"].ToString(),
                        StartDate       = Convert.ToInt32(cdr["StartDate"]),
                        EndDate         = Convert.ToInt32(cdr["EndDate"]),
                        GroupHeaderFlag = Convert.ToInt32(cdr["GroupHeaderFlag"]),
                        ControlType     = Convert.ToInt32(cdr["ControlType"]),
                        OptionCategory  = cdr["OptionCategory"].ToString(),
                    });
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UsersMethod.GetMstTaskByParentCode", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 12
0
        //CSQ 2015-1-21
        public static DataTable GetSymptomsList(DataConnection pclsCache, string UserId, string VisitId)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("VisitId", typeof(string)));
            list.Columns.Add(new DataColumn("SynptomsNo", typeof(string)));
            list.Columns.Add(new DataColumn("SymptomsType", typeof(string)));
            list.Columns.Add(new DataColumn("SymptomsTypeName", typeof(string)));
            list.Columns.Add(new DataColumn("SymptomsCode", typeof(string)));
            list.Columns.Add(new DataColumn("SymptomsName", typeof(string)));
            list.Columns.Add(new DataColumn("Description", typeof(string)));
            list.Columns.Add(new DataColumn("RecordDate", typeof(string)));
            list.Columns.Add(new DataColumn("RecordTime", typeof(string)));
            list.Columns.Add(new DataColumn("Creator", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Ps.Symptoms.GetSymptomsList(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("UserId", CacheDbType.NVarChar).Value  = UserId;
                cmd.Parameters.Add("VisitId", CacheDbType.NVarChar).Value = VisitId;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["VisitId"].ToString(), cdr["SynptomsNo"].ToString(), cdr["SymptomsType"].ToString(), cdr["SymptomsTypeName"].ToString(), cdr["SymptomsCode"].ToString(), cdr["SymptomsName"].ToString(), cdr["Description"].ToString(), cdr["RecordDate"].ToString(), cdr["RecordTime"].ToString(), cdr["Creator"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Symptoms.GetSymptomsList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 13
0
        public static DataTable GetDrugDetail(DataConnection pclsCache, string Module)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("DrugCode", typeof(string)));
            list.Columns.Add(new DataColumn("DrugName", typeof(string)));
            list.Columns.Add(new DataColumn("DrugSpec", typeof(string)));
            list.Columns.Add(new DataColumn("Units", typeof(string)));
            list.Columns.Add(new DataColumn("DrugIndicator", typeof(string)));
            list.Columns.Add(new DataColumn("CurativeEffect", typeof(string)));
            list.Columns.Add(new DataColumn("SideEffect", typeof(string)));
            list.Columns.Add(new DataColumn("Instruction", typeof(string)));
            list.Columns.Add(new DataColumn("HealthEffect", typeof(string)));
            list.Columns.Add(new DataColumn("Unit", typeof(string)));
            list.Columns.Add(new DataColumn("Redundance", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Cm.MstDrugDetail.GetDrugDetail(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Module", CacheDbType.NVarChar).Value = Module;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["DrugCode"].ToString(), cdr["DrugName"].ToString(), cdr["DrugSpec"].ToString(), cdr["Units"].ToString(), cdr["DrugIndicator"].ToString(), cdr["CurativeEffect"].ToString(), cdr["SideEffect"].ToString(), cdr["Instruction"].ToString(), cdr["HealthEffect"].ToString(), cdr["Unit"].ToString(), cdr["Redundance"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Cm.MstDrugDetail.GetDrugDetail", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 14
0
        //ZC 2015-1-21
        public static DataTable GetReminderbyDay(DataConnection pclsCache, string PatientId, int StartDate, int StartTime)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("ReminderNo", typeof(string)));
            list.Columns.Add(new DataColumn("ReminderType", typeof(string)));
            list.Columns.Add(new DataColumn("ReminderTypeName", typeof(string)));
            list.Columns.Add(new DataColumn("Content", typeof(string)));
            list.Columns.Add(new DataColumn("AlertMode", typeof(string)));
            list.Columns.Add(new DataColumn("AlertModeName", typeof(string)));
            list.Columns.Add(new DataColumn("StartDateTime", typeof(string)));
            list.Columns.Add(new DataColumn("NextDate", typeof(string)));
            list.Columns.Add(new DataColumn("NextTime", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Ps.Reminder.GetReminderbyDay(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;
                cmd.Parameters.Add("StartDate", CacheDbType.Int).Value      = StartDate;
                cmd.Parameters.Add("StartTime", CacheDbType.Int).Value      = StartTime;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["ReminderNo"].ToString(), cdr["ReminderType"].ToString(), cdr["ReminderTypeName"].ToString(), cdr["Content"].ToString(), cdr["AlertMode"].ToString(), cdr["AlertModeName"].ToString(), cdr["StartDateTime"].ToString(), cdr["NextDate"].ToString(), cdr["NextTime"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Reminder.GetReminderbyDay", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 15
0
        public List <BedInfo> getBedInfoList(DataConnection pclsCache, string id)
        {
            List <BedInfo> bedInfoList = new List <BedInfo>();

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Vs.DeckBed.GetBedInfoList(pclsCache.CacheConnectionObject);
                //cmd = Vs.MstDeckInfo.SetData(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("DeckId", CacheDbType.NVarChar).Value = id;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    BedInfo bedInfo = new BedInfo();
                    bedInfo.DeckId        = cdr["DeckId"].ToString();
                    bedInfo.DeckSectionId = cdr["DeckSectionId"].ToString();
                    bedInfo.WardCode      = cdr["WardCode"].ToString();
                    bedInfo.RoomCode      = cdr["RoomCode"].ToString();
                    bedInfo.BedCode       = cdr["BedCode"].ToString();
                    bedInfo.Status        = Convert.ToInt32(cdr["Status"]);
                    bedInfo.PatientName   = cdr["PatientId"].ToString();
                    bedInfoList.Add(bedInfo);
                }

                return(bedInfoList);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "DeckInfoMethod.getBedInfoList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 16
0
        // GetTrnAlertRecordList GL 2014-12-26 根据PatientId获取警报列表 (ZAM 12-26: + SortNo )
        public static DataTable GetTrnAlertRecordList(DataConnection pclsCache, string PatientId)
        {
            DataTable AlertRecordList = new DataTable();

            AlertRecordList.Columns.Add(new DataColumn("AlertType", typeof(string)));
            AlertRecordList.Columns.Add(new DataColumn("AlertTypeName", typeof(string)));
            AlertRecordList.Columns.Add(new DataColumn("AlertItemCode", typeof(string)));
            AlertRecordList.Columns.Add(new DataColumn("AlertItem", typeof(string)));
            AlertRecordList.Columns.Add(new DataColumn("AlertDateTime", typeof(string)));
            AlertRecordList.Columns.Add(new DataColumn("PushFlag", typeof(string)));
            AlertRecordList.Columns.Add(new DataColumn("ProcessFlag", typeof(string)));
            AlertRecordList.Columns.Add(new DataColumn("SortNo", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Wn.TrnAlertRecord.GetTrnAlertRecordList(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    AlertRecordList.Rows.Add(cdr["AlertType"].ToString(), cdr["AlertTypeName"].ToString(), cdr["AlertItemCode"].ToString(), cdr["AlertItem"].ToString(), cdr["AlertDateTime"].ToString(), cdr["PushFlag"].ToString(), cdr["ProcessFlag"].ToString(), cdr["SortNo"].ToString());
                }
                return(AlertRecordList);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "WnTrnAlertRecord.GetTrnAlertRecordList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 17
0
        // GetListByStatus WY 2015-07-10
        public static DataTable GetMpDrugCmp(DataConnection pclsCache)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("HospitalCode", typeof(string)));
            list.Columns.Add(new DataColumn("HospitalName", typeof(string)));
            list.Columns.Add(new DataColumn("DrugCode", typeof(string)));
            list.Columns.Add(new DataColumn("DrugName", typeof(string)));
            list.Columns.Add(new DataColumn("DrugSpec", typeof(string)));
            list.Columns.Add(new DataColumn("HZCode", typeof(string)));
            list.Columns.Add(new DataColumn("HZName", typeof(string)));
            list.Columns.Add(new DataColumn("Redundance", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Mp.DrugCmp.GetMpDrugCmp(pclsCache.CacheConnectionObject);

                //cmd.Parameters.Add("InvalidFlag", CacheDbType.Int).Value = InvalidFlag;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["HospitalCode"].ToString(), cdr["HospitalName"].ToString(), cdr["DrugCode"], cdr["DrugName"].ToString(), cdr["DrugSpec"].ToString(), cdr["HZCode"].ToString(), cdr["HZName"].ToString(), cdr["Redundance"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "MpDrugCmp.GetMpDrugCmp", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 18
0
            /// <summary>
            /// 通过Ps.Compliance中的date获取当天某项生理参数值,形成系列  DataTable 形式syf 2015-10-10
            /// </summary>
            /// <param name="pclsCache"></param>
            /// <param name="PatientId"></param>
            /// <param name="PlanNo"></param>
            /// <param name="ItemType"></param>
            /// <param name="ItemCode"></param>
            /// <param name="StartDate"></param>
            /// <param name="EndDate"></param>
            /// <returns></returns>
            public List <SignDetailByPeriod> GetSignDetailByPeriod(DataConnection pclsCache, string PatientId, string PlanNo, string ItemType, string ItemCode, int StartDate, int EndDate)
            {
                List <SignDetailByPeriod> list = new List <SignDetailByPeriod>();
                CacheCommand    cmd            = null;
                CacheDataReader cdr            = null;


                try
                {
                    if (!pclsCache.Connect())
                    {
                        return(null);
                    }

                    cmd = new CacheCommand();
                    cmd = Ps.ComplianceDetail.GetSignDetailByPeriod(pclsCache.CacheConnectionObject);
                    cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;
                    cmd.Parameters.Add("PlanNo", CacheDbType.NVarChar).Value    = PlanNo;
                    cmd.Parameters.Add("ItemType", CacheDbType.NVarChar).Value  = ItemType;
                    cmd.Parameters.Add("ItemCode", CacheDbType.NVarChar).Value  = ItemCode;
                    cmd.Parameters.Add("StartDate", CacheDbType.NVarChar).Value = StartDate;
                    cmd.Parameters.Add("EndDate", CacheDbType.NVarChar).Value   = EndDate;

                    cdr = cmd.ExecuteReader();

                    while (cdr.Read())
                    {
                        SignDetailByPeriod NewLine = new SignDetailByPeriod();
                        NewLine.RecordDate = cdr["RecordDate"].ToString();
                        NewLine.RecordTime = cdr["RecordTime"].ToString();
                        NewLine.Value      = cdr["Value"].ToString();
                        NewLine.Unit       = cdr["Unit"].ToString();
                    }

                    return(list);
                }
                catch (Exception ex)
                {
                    HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PlanInfoMethod.GetSignDetailByPeriod", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                    return(null);
                }
                finally
                {
                    if ((cdr != null))
                    {
                        cdr.Close();
                        cdr.Dispose(true);
                        cdr = null;
                    }
                    if ((cmd != null))
                    {
                        cmd.Parameters.Clear();
                        cmd.Dispose();
                        cmd = null;
                    }
                    pclsCache.DisConnect();
                }
            }
Exemplo n.º 19
0
            /// <summary>
            /// SYF 20151010 获取健康专员负责的所有患者列表
            /// </summary>
            /// <param name="pclsCache"></param>
            /// <param name="DoctorId"></param>
            /// <param name="Module"></param>
            /// <returns></returns>
            public List <PatientPlan> GetPatientsPlanByDoctorId(DataConnection pclsCache, string DoctorId, string Module)
            {
                List <PatientPlan> list = new List <PatientPlan>();
                CacheCommand       cmd  = null;
                CacheDataReader    cdr  = null;

                try
                {
                    if (!pclsCache.Connect())
                    {
                        return(null);
                    }
                    cmd = new CacheCommand();
                    cmd = Ps.Plan.GetPatientsPlanByDoctorId(pclsCache.CacheConnectionObject);
                    cmd.Parameters.Add("DoctorId", CacheDbType.NVarChar).Value = DoctorId;
                    cmd.Parameters.Add("Module", CacheDbType.NVarChar).Value   = Module;

                    cdr = cmd.ExecuteReader();
                    while (cdr.Read())
                    {
                        if (cdr["PatientId"].ToString() == string.Empty)
                        {
                            continue;
                        }
                        PatientPlan NewLine = new PatientPlan();
                        NewLine.PatientId     = cdr["PatientId"].ToString();
                        NewLine.PlanNo        = cdr["PlanNo"].ToString();
                        NewLine.StartDate     = cdr["StartDate"].ToString();
                        NewLine.EndDate       = cdr["EndDate"].ToString();
                        NewLine.TotalDays     = cdr["TotalDays"].ToString();
                        NewLine.RemainingDays = cdr["RemainingDays"].ToString();
                        NewLine.Status        = cdr["Status"].ToString();
                    }
                    return(list);
                }
                catch (Exception ex)
                {
                    HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PlanInfoMethod.GetPatientsPlanByDoctorId", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                    return(null);
                }
                finally
                {
                    if ((cdr != null))
                    {
                        cdr.Close();
                        cdr.Dispose(true);
                        cdr = null;
                    }
                    if ((cmd != null))
                    {
                        cmd.Parameters.Clear();
                        cmd.Dispose();
                        cmd = null;
                    }
                    pclsCache.DisConnect();
                }
            }
Exemplo n.º 20
0
        // GetUserList ZAM 2014-12-03
        public static DataTable GetUserList(DataConnection pclsCache)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("UserId", typeof(string)));
            list.Columns.Add(new DataColumn("UserName", typeof(string)));
            list.Columns.Add(new DataColumn("Password", typeof(string)));
            list.Columns.Add(new DataColumn("Class", typeof(string)));
            list.Columns.Add(new DataColumn("ClassName", typeof(string)));
            list.Columns.Add(new DataColumn("StartDate", typeof(int)));
            list.Columns.Add(new DataColumn("EndDate", typeof(int)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Cm.MstUser.GetUserList(pclsCache.CacheConnectionObject);
                //cmd.Parameters.Add("Category", CacheDbType.NVarChar).Value = Category;
                //cmd.Parameters.Add("InvalidFlag", CacheDbType.Int).Value = InvalidFlag;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["UserId"].ToString(), cdr["UserName"].ToString(), cdr["Password"].ToString(), cdr["Class"].ToString(), cdr["ClassName"].ToString(), cdr["StartDate"], cdr["EndDate"]);
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstUser.GetUserList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// 获取病人住院信息 施宇帆 2016-04-28
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="PatientId"></param>
        /// <returns></returns>
        public List <PsTrnInpatient> GetInPByPID(DataConnection pclsCache, string PatientId)
        {
            List <PsTrnInpatient> items = new List <PsTrnInpatient>();
            CacheCommand          cmd   = null;
            CacheDataReader       cdr   = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = Ps.TrnInpatient.GetInPByPID(pclsCache.CacheConnectionObject);

                cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    PsTrnInpatient item = new PsTrnInpatient();

                    item.AdmissionDate = cdr["AdmissionDate"].ToString();
                    item.AdDays        = Convert.ToInt32(cdr["AdDays"]);
                    item.DoctorName    = cdr["DoctorName"].ToString();
                    item.NurseName     = cdr["NurseName"].ToString();
                    item.RoomName      = cdr["RoomName"].ToString();
                    item.BedName       = cdr["BedName"].ToString();
                    item.WardName      = cdr["WardName"].ToString();
                    item.Diagnosis     = cdr["Diagnosis"].ToString();


                    items.Add(item);
                }
                return(items);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsTrnOutpatientMethod.GetInPByPID", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 22
0
        // GetReceiveList GL 2015-01-28 获取已收到的消息列表
        public static DataTable GetReceiveList(DataConnection pclsCache, string UserId)
        {
            DataTable ReceiveList = new DataTable();

            ReceiveList.Columns.Add(new DataColumn("MessageNo", typeof(string)));
            ReceiveList.Columns.Add(new DataColumn("SendBy", typeof(string)));
            ReceiveList.Columns.Add(new DataColumn("SendByName", typeof(string)));
            ReceiveList.Columns.Add(new DataColumn("Title", typeof(string)));
            ReceiveList.Columns.Add(new DataColumn("SendDateTime", typeof(string)));
            ReceiveList.Columns.Add(new DataColumn("Content", typeof(string)));
            ReceiveList.Columns.Add(new DataColumn("ReadStatus", typeof(int)));
            ReceiveList.Columns.Add(new DataColumn("Flag", typeof(int)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Mb.MessageRecord.GetReceiveList(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("UserId", CacheDbType.NVarChar).Value = UserId;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    ReceiveList.Rows.Add(cdr["MessageNo"].ToString(), cdr["SendBy"].ToString(), cdr["SendByName"].ToString(), cdr["Title"].ToString(), cdr["SendDateTime"].ToString(), cdr["Content"].ToString(), Convert.ToInt32(cdr["ReadStatus"]), Convert.ToInt32(cdr["Flag"]));
                }
                return(ReceiveList);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "MbMessageRecord.GetReceiveList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 23
0
        //GetSignByPeriod LS 2015-03-30  只针对一种参数
        public static DataTable GetSignByPeriod(DataConnection pclsCache, string UserId, string ItemType, string ItemCode, int StartDate, int EndDate)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("RecordDate", typeof(string)));
            list.Columns.Add(new DataColumn("RecordTime", typeof(string)));
            list.Columns.Add(new DataColumn("Value", typeof(string)));
            list.Columns.Add(new DataColumn("Unit", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Ps.VitalSigns.GetSignByPeriod(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("UserId", CacheDbType.NVarChar).Value    = UserId;
                cmd.Parameters.Add("ItemType", CacheDbType.NVarChar).Value  = ItemType;
                cmd.Parameters.Add("ItemCode", CacheDbType.NVarChar).Value  = ItemCode;
                cmd.Parameters.Add("StartDate", CacheDbType.NVarChar).Value = StartDate;
                cmd.Parameters.Add("EndDate", CacheDbType.NVarChar).Value   = EndDate;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["RecordDate"].ToString(), cdr["RecordTime"].ToString(), cdr["Value"].ToString(), cdr["Unit"].ToString());
                }

                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsVitalSigns.GetSignByPeriod", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 24
0
            /// <summary>
            /// 某段时间所有任务的依从情况  DataTable数据库形式  SYF 20151010
            /// </summary>
            /// <param name="pclsCache"></param>
            /// <param name="PatientId"></param>
            /// <param name="PlanNo"></param>
            /// <param name="StartDate"></param>
            /// <param name="EndDate"></param>
            /// <returns></returns>
            public List <TasksComByPeriodDT> GetTasksComByPeriodDT(DataConnection pclsCache, string PatientId, string PlanNo, int StartDate, int EndDate)
            {
                List <TasksComByPeriodDT> list = new List <TasksComByPeriodDT>();

                CacheCommand    cmd = null;
                CacheDataReader cdr = null;

                try
                {
                    if (!pclsCache.Connect())
                    {
                        return(null);
                    }
                    cmd = new CacheCommand();
                    cmd = Ps.Compliance.GetTasksComByPeriod(pclsCache.CacheConnectionObject);
                    cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;
                    cmd.Parameters.Add("PlanNo", CacheDbType.NVarChar).Value    = PlanNo;
                    cmd.Parameters.Add("StartDate", CacheDbType.Int).Value      = StartDate;
                    cmd.Parameters.Add("EndDate", CacheDbType.Int).Value        = EndDate;

                    cdr = cmd.ExecuteReader();
                    while (cdr.Read())
                    {
                        TasksComByPeriodDT NewLine = new TasksComByPeriodDT();
                        NewLine.Date            = cdr["Date"].ToString();
                        NewLine.ComplianceValue = cdr["ComplianceValue"].ToString();
                        NewLine.TaskType        = cdr["TaskType"].ToString();
                        NewLine.TaskId          = cdr["TaskId"].ToString();
                        NewLine.TaskName        = cdr["TaskName"].ToString();
                        NewLine.Status          = cdr["Status"].ToString();
                        NewLine.Type            = cdr["Type"].ToString();
                    }
                    return(list);
                }
                catch (Exception ex)
                {
                    HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PlanInfoMethod.GetTasksComByPeriodDT", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                    return(null);
                }
                finally
                {
                    if ((cdr != null))
                    {
                        cdr.Close();
                        cdr.Dispose(true);
                        cdr = null;
                    }
                    if ((cmd != null))
                    {
                        cmd.Parameters.Clear();
                        cmd.Dispose();
                        cmd = null;
                    }
                    pclsCache.DisConnect();
                }
            }
Exemplo n.º 25
0
        public List <LifeStyleDetail> GetLifeStyleDetail(DataConnection pclsCache, string Module)
        {
            List <LifeStyleDetail> list = new List <LifeStyleDetail>();

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Cm.MstLifeStyleDetail.GetLifeStyleDetail(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Module", CacheDbType.NVarChar).Value = Module;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Add(new LifeStyleDetail
                    {
                        StyleId        = cdr["StyleId"].ToString(),
                        Module         = cdr["Module"].ToString(),
                        CurativeEffect = cdr["CurativeEffect"].ToString(),
                        SideEffect     = cdr["SideEffect"].ToString(),
                        Instruction    = cdr["Instruction"].ToString(),
                        HealthEffect   = cdr["HealthEffect"].ToString(),
                        Unit           = cdr["Unit"].ToString(),
                        Redundance     = cdr["Redundance"].ToString()
                    });
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Cm.MstLifeStyleDetail.GetLifeStyleDetail", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 26
0
        ////GetTargetByCode TDY 2015-04-07
        //public static CacheSysList GetTargetByCode(DataConnection pclsCache, string Plan, string Type, string Code)
        //{
        //    CacheSysList ret = new InterSystems.Data.CacheTypes.CacheSysList(System.Text.Encoding.Unicode, true, true);

        //    try
        //    {
        //        if (!pclsCache.Connect())
        //        {
        //            return ret;
        //        }

        //        ret = Ps.Target.GetTargetByCode(pclsCache.CacheConnectionObject, Plan, Type, Code);
        //        return ret;
        //    }
        //    catch (Exception ex)
        //    {
        //        HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Target.GetTargetByCode", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
        //        return ret;
        //    }
        //    finally
        //    {
        //        pclsCache.DisConnect();
        //    }
        //}

        //GetPsTarget TDY 2015-04-07
        public static DataTable GetPsTarget(DataConnection pclsCache, string PlanNo)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("Id", typeof(string)));
            list.Columns.Add(new DataColumn("Type", typeof(string)));
            list.Columns.Add(new DataColumn("TypeName", typeof(string)));
            list.Columns.Add(new DataColumn("Code", typeof(string)));
            list.Columns.Add(new DataColumn("CodeName", typeof(string)));
            list.Columns.Add(new DataColumn("Value", typeof(string)));
            list.Columns.Add(new DataColumn("Origin", typeof(string)));
            list.Columns.Add(new DataColumn("Instruction", typeof(string)));
            list.Columns.Add(new DataColumn("Unit", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Ps.Target.GetPsTarget(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("PlanNo", CacheDbType.NVarChar).Value = PlanNo;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["Id"].ToString(), cdr["Type"].ToString(), cdr["TypeName"].ToString(), cdr["Code"].ToString(), cdr["CodeName"].ToString(), cdr["Value"].ToString(), cdr["Origin"].ToString(), cdr["Instruction"].ToString(), cdr["Unit"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Target.GetPsTarget", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 27
0
        //输出一段时间中记录的所有体征信息
        public List <VitalInfo> GetAllSignsByPeriod(DataConnection pclsCache, string UserId, int StartDate, int EndDate)
        {
            {
                List <VitalInfo> items = new List <VitalInfo>();
                CacheCommand     cmd   = null;
                CacheDataReader  cdr   = null;
                try
                {
                    if (!pclsCache.Connect())
                    {
                        return(null);
                    }
                    cmd = new CacheCommand();
                    cmd = Ps.VitalSigns.GetAllSignsByPeriod(pclsCache.CacheConnectionObject);
                    cmd.Parameters.Add("UserId", CacheDbType.NVarChar).Value    = UserId;
                    cmd.Parameters.Add("StartDate", CacheDbType.NVarChar).Value = StartDate;
                    cmd.Parameters.Add("EndDate", CacheDbType.NVarChar).Value   = EndDate;

                    cdr = cmd.ExecuteReader();
                    while (cdr.Read())
                    {
                        VitalInfo item = new VitalInfo();
                        item.RecordDate = cdr["RecordDate"].ToString();
                        item.RecordTime = cdr["RecordTime"].ToString();
                        item.ItemType   = cdr["ItemType"].ToString();
                        item.ItemCode   = cdr["ItemCode"].ToString();
                        item.Value      = cdr["Value"].ToString();
                        item.Unit       = cdr["Unit"].ToString();
                        item.Name       = cdr["VitalName"].ToString();
                        items.Add(item);
                    }
                    return(items);
                }
                catch (Exception ex)
                {
                    HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "VitalInfoMethod.GetAllSignsByPeriod", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                    return(null);
                }
                finally
                {
                    if ((cdr != null))
                    {
                        cdr.Close();
                        cdr.Dispose(true);
                        cdr = null;
                    }
                    if ((cmd != null))
                    {
                        cmd.Parameters.Clear();
                        cmd.Dispose();
                        cmd = null;
                    }
                    pclsCache.DisConnect();
                }
            }
        }
Exemplo n.º 28
0
        // ZAM 2015-4-24 获取健康专员负责的所有患者最新结束(status = 4)计划列表
        public static DataTable GetOverDuePlanByDoctorId(DataConnection pclsCache, string DoctorId, string Module)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("PatientId", typeof(string)));
            list.Columns.Add(new DataColumn("PlanNo", typeof(string)));
            list.Columns.Add(new DataColumn("StartDate", typeof(string)));
            list.Columns.Add(new DataColumn("EndDate", typeof(string)));
            list.Columns.Add(new DataColumn("TotalDays", typeof(string)));
            list.Columns.Add(new DataColumn("RemainingDays", typeof(string)));
            list.Columns.Add(new DataColumn("Status", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return(null);
                }
                cmd = new CacheCommand();
                cmd = Ps.Plan.GetOverDuePlanByDoctorId(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("DoctorId", CacheDbType.NVarChar).Value = DoctorId;
                cmd.Parameters.Add("Module", CacheDbType.NVarChar).Value   = Module;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["PatientId"].ToString(), cdr["PlanNo"].ToString(), cdr["StartDate"].ToString(), cdr["EndDate"].ToString(), cdr["TotalDays"].ToString(), cdr["RemainingDays"].ToString(), cdr["Status"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Plan.GetOverDuePlanByDoctorId", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 29
0
        //GetDoctorListByName  LS 2014-12-1
        public static DataTable GetDoctorListByName(DataConnection pclsCache, string DoctorName)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("DoctorId", typeof(string)));
            list.Columns.Add(new DataColumn("DoctorName", typeof(string)));
            list.Columns.Add(new DataColumn("Birthday", typeof(int)));
            list.Columns.Add(new DataColumn("Gender", typeof(int)));
            list.Columns.Add(new DataColumn("IDNo", typeof(string)));
            list.Columns.Add(new DataColumn("InvalidFlag", typeof(int)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Ps.DoctorInfo.GetDoctorListByName(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("DoctorName", CacheDbType.NVarChar).Value = DoctorName;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["DoctorId"].ToString(), cdr["DoctorName"].ToString(), Convert.ToInt32(cdr["Birthday"]), Convert.ToInt32(cdr["Gender"]), cdr["IDNo"].ToString(), Convert.ToInt32(cdr["InvalidFlag"]));
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsDoctorInfo.GetDoctorListByName", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
Exemplo n.º 30
0
        // GetNameList CSQ 2015-06-25
        public static DataTable GetNameList(DataConnection pclsCache)
        {
            DataTable list = new DataTable();

            list.Columns.Add(new DataColumn("CodeSubCode", typeof(string)));
            //list.Columns.Add(new DataColumn("SubCode", typeof(string)));
            list.Columns.Add(new DataColumn("Name", typeof(string)));
            list.Columns.Add(new DataColumn("InputCode", typeof(string)));

            CacheCommand    cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return(null);
                }

                cmd = new CacheCommand();
                cmd = Cm.MstLabTestSubItems.GetNameList(pclsCache.CacheConnectionObject);
                //cmd.Parameters.Add("Code", CacheDbType.NVarChar).Value = Code;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["Code"].ToString(), cdr["Name"].ToString(), cdr["InputCode"].ToString());
                }
                return(list);
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstLabTestSubItems.GetNameList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return(null);
            }
            finally
            {
                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }

                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }