Example #1
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();
            }
        }
Example #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();
            }
        }
Example #3
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();
            }
        }
Example #4
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();
            }
        }
Example #5
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();
            }
        }
Example #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();
            }
        }
Example #7
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();
            }
        }
Example #8
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();
            }
        }
Example #9
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();
            }
        }
Example #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();
                }
            }
Example #11
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();
            }
        }
Example #12
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();
            }
        }
Example #13
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();
            }
        }
Example #14
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();
            }
        }
Example #15
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();
            }
        }
Example #16
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();
            }
        }
Example #17
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();
                }
            }
Example #18
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();
            }
        }
Example #19
0
        // GetMpDiagnosisCmp WF 2015-07-07
        public static DataTable GetMpDiagnosisCmp(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("Type", typeof(int)));
            list.Columns.Add(new DataColumn("TypeName", typeof(string)));
            list.Columns.Add(new DataColumn("Code", typeof(string)));
            list.Columns.Add(new DataColumn("Name", 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.DiagnosisCmp.GetMpDiagnosisCmp(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["Type"].ToString(), cdr["TypeName"].ToString(), cdr["Code"].ToString(), cdr["Name"].ToString(), cdr["HZCode"].ToString(), cdr["HZName"].ToString(), cdr["Redundance"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "MpDivisionCmp.GetMpDivisionCmp", "数据库操作异常! 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();
            }
        }
Example #20
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();
            }
        }
Example #21
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();
            }
        }
Example #22
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();
                }
            }
        /// <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();
            }
        }
Example #24
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();
            }
        }
Example #25
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();
            }
        }
Example #26
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();
                }
            }
Example #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();
                }
            }
        }
Example #28
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();
            }
        }
Example #29
0
        public static DataTable GetTmpOperationByStatus(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("Code", 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.OperationDict.GetListByStatus(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Status", CacheDbType.Int).Value = status;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["HospitalCode"].ToString(), cdr["HospitalName"].ToString(), cdr["Code"].ToString(), cdr["Name"].ToString(), cdr["InputCode"].ToString(), cdr["Description"].ToString(), status);
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Tmp.OperationDict.GetList", "数据库操作异常! 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();
            }
        }
Example #30
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();
                }
            }
        }
Example #31
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();
            }
        }
Example #32
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();
            }
        }
Example #33
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();
            }
        }
Example #34
0
        // GetParameters ZAM 2014-12-4
        public static DataTable GetParameters(DataConnection pclsCache, string Indicators)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("Id", typeof(string)));
            list.Columns.Add(new DataColumn("Name", 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())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return null;
                }

                cmd = new CacheCommand();
                cmd = Ps.Parameters.GetParameters(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Indicators", CacheDbType.NVarChar).Value = Indicators;
                //cmd.Parameters.Add("InvalidFlag", CacheDbType.Int).Value = InvalidFlag;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["Id"].ToString(), cdr["Name"].ToString(), cdr["Value"].ToString(), cdr["Unit"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsParameters.GetParameters", "数据库操作异常! 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();
            }
        }
Example #35
0
        //GetEndingPlan 获取某模块已经结束的计划 LS 2015-06-24
        public static DataTable GetEndingPlan(DataConnection pclsCache, string PatientId, string Module)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("PlanNo", typeof(string)));
            list.Columns.Add(new DataColumn("StartDate", typeof(int)));
            list.Columns.Add(new DataColumn("EndDate", typeof(int)));
            //list.Columns.Add(new DataColumn("Module", typeof(string)));
            //list.Columns.Add(new DataColumn("Status", typeof(string)));
            // list.Columns.Add(new DataColumn("DoctorId", typeof(string)));

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

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["PlanNo"].ToString(), Convert.ToInt32(cdr["StartDate"]), Convert.ToInt32(cdr["EndDate"]));
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Plan.GetEndingPlan", "数据库操作异常! 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();
            }
        }
        //WF 20150408
        public static DataTable GetLifeStyleDetail(DataConnection pclsCache, string Module)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("StyleId", typeof(string)));
            list.Columns.Add(new DataColumn("Name", 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)));

            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.Rows.Add(cdr["StyleId"].ToString(), cdr["Name"].ToString(), cdr["CurativeEffect"].ToString(), cdr["SideEffect"].ToString(), cdr["Instruction"].ToString(), cdr["HealthEffect"].ToString(), cdr["Unit"].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();
            }
        }
Example #37
0
        public static DataTable GetListbyDay(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("TaskDate", typeof(string)));
            list.Columns.Add(new DataColumn("TaskTime", typeof(string)));
            list.Columns.Add(new DataColumn("IsDone", 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.TaskList.GetListbyDay(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;
                cmd.Parameters.Add("StartDate", CacheDbType.NVarChar).Value = StartDate;
                cmd.Parameters.Add("StartTime", CacheDbType.NVarChar).Value = StartTime;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["ReminderNo"].ToString(), cdr["TaskDate"].ToString(), cdr["TaskTime"].ToString(), cdr["IsDone"].ToString(), cdr["Description"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.TaskList.GetListbyDay", "数据库操作异常! 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();
            }
        }
Example #38
0
        /// <summary>
        /// GetModulesByPID LS 2014-12-4 //SYF20151109
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="PatientId"></param>
        /// <returns></returns>
        public List<ModulesByPID> GetModulesByPID(DataConnection pclsCache, string PatientId)
        {
            List<ModulesByPID> list = new List<ModulesByPID>();

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cmd = new CacheCommand();
                cmd = Ps.BasicInfoDetail.GetModulesByPID(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("PatientId", CacheDbType.NVarChar).Value = PatientId;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    ModulesByPID NewLine = new ModulesByPID();
                    NewLine.CategoryCode = cdr["CategoryCode"].ToString();
                    NewLine.Modules = cdr["Modules"].ToString();
                    list.Add(NewLine);
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UsersMethod.GetModulesByPID", "数据库操作异常! 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();
            }
        }
        //获取血压表全部信息 2015-05-29 GL
        public static DataTable GetBloodPressureList(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("Description", typeof(string)));
            list.Columns.Add(new DataColumn("SBP", typeof(string)));
            list.Columns.Add(new DataColumn("DBP", typeof(string)));
            list.Columns.Add(new DataColumn("PatientClass", 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.MstBloodPressure.GetBPGrades(pclsCache.CacheConnectionObject);

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["Code"].ToString(), cdr["Name"].ToString(), cdr["Description"].ToString(), cdr["SBP"].ToString(), cdr["DBP"].ToString(), cdr["PatientClass"].ToString(), cdr["Redundance"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Cm.MstBloodPressure.GetBPGrades", "数据库操作异常! 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();
            }
        }
Example #40
0
        //WF 20150408
        public static DataTable GetPsTaskByType(DataConnection pclsCache, string PlanNo, string Type)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("Id", typeof(string)));
            list.Columns.Add(new DataColumn("Code", typeof(string)));
            list.Columns.Add(new DataColumn("CodeName", typeof(string)));
            list.Columns.Add(new DataColumn("Instruction", typeof(string)));

            CacheCommand cmd = null;
            CacheDataReader cdr = null;
            try
            {
                if (!pclsCache.Connect())
                {
                    return null;
                }
                cmd = new CacheCommand();
                cmd = Ps.Task.GetPsTaskByType(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("PlanNo", CacheDbType.NVarChar).Value = PlanNo;
                cmd.Parameters.Add("Type", CacheDbType.NVarChar).Value = Type;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["Id"].ToString(), cdr["Code"].ToString(), cdr["CodeName"].ToString(), cdr["Instruction"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Task.GetPsTaskByType", "数据库操作异常! 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();
            }
        }
Example #41
0
        // GetDrugNameList 获取所有药品名称列表 CSQ 2015-05-12
        public static DataTable GetDrugNameList(DataConnection pclsCache)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("DrugCode", typeof(string)));
            list.Columns.Add(new DataColumn("DrugName", typeof(string)));

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cmd = new CacheCommand();
                cmd = Cm.MstDrug.GetNameListByCode(pclsCache.CacheConnectionObject);
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["DrugCode"].ToString(), cdr["DrugName"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstDrug.GetDrugNameList", "数据库操作异常! 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();
            }
        }
Example #42
0
        /// <summary>
        /// 获取某个分类的类别 CSQ 20151010
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="Category"></param>
        /// <returns></returns>
        public List<TypeAndName> CmMstTypeGetTypeList(DataConnection pclsCache, string Category)
        {
            List<TypeAndName> list = new List<TypeAndName>();

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cmd = new CacheCommand();
                cmd = Cm.MstType.GetTypeList(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Category", CacheDbType.NVarChar).Value = Category;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Add(new TypeAndName { Type = cdr["Type"].ToString(), Name = cdr["Name"].ToString() });
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "DictMethod.GetTypeList", "数据库操作异常! 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();
            }
        }
Example #43
0
        public static DataTable GetMstTaskByParentCode(DataConnection pclsCache, string ParentCode)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("CategoryCode", typeof(string)));
            list.Columns.Add(new DataColumn("Code", typeof(string)));
            list.Columns.Add(new DataColumn("Name", typeof(string)));
            list.Columns.Add(new DataColumn("ParentCode", typeof(string)));
            list.Columns.Add(new DataColumn("Description", typeof(string)));
            list.Columns.Add(new DataColumn("StartDate", typeof(int)));
            list.Columns.Add(new DataColumn("EndDate", typeof(int)));
            list.Columns.Add(new DataColumn("GroupHeaderFlag", typeof(int)));
            list.Columns.Add(new DataColumn("ControlType", typeof(int)));
            list.Columns.Add(new DataColumn("OptionCategory", typeof(string)));
            list.Columns.Add(new DataColumn("CreateDateTime", 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())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return null;
                }
                cmd = new CacheCommand();
                cmd = Cm.MstTask.GetMstTaskByParentCode(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("ParentCode", CacheDbType.NVarChar).Value = ParentCode;
                cdr = cmd.ExecuteReader();
                DateTime CreateDateTime = new DateTime();
                while (cdr.Read())
                {
                    if (cdr["CreateDateTime"].ToString() != "")
                        CreateDateTime = Convert.ToDateTime(cdr["CreateDateTime"]);
                    list.Rows.Add(cdr["CategoryCode"].ToString(), cdr["Code"].ToString(), cdr["Name"].ToString(), cdr["ParentCode"].ToString(), cdr["Description"].ToString(), Convert.ToInt32(cdr["StartDate"]), Convert.ToInt32(cdr["EndDate"]), Convert.ToInt32(cdr["GroupHeaderFlag"]), Convert.ToInt32(cdr["ControlType"]), cdr["OptionCategory"].ToString(), CreateDateTime, cdr["Author"].ToString(), cdr["AuthorName"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstTask.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();
            }
        }
Example #44
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();
            }
        }
Example #45
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();
            }
        }
Example #46
0
        //GetTasksComByPeriod 其他任务的依从情况(不包括生理测量) LS 2010505  文本集中在ballon web暂用
        public static List<CompliacneDetailByD> GetTasksComByPeriodWeb(DataConnection pclsCache, string PatientId, string PlanNo, int StartDate, int EndDate)
        {
            List<CompliacneDetailByD> resultList = new List<CompliacneDetailByD>();

            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("Date", typeof(string)));
            list.Columns.Add(new DataColumn("ComplianceValue", typeof(double)));
            list.Columns.Add(new DataColumn("TaskType", typeof(string)));
            list.Columns.Add(new DataColumn("TaskId", typeof(string)));
            list.Columns.Add(new DataColumn("TaskName", typeof(string)));
            list.Columns.Add(new DataColumn("Status", typeof(int)));

            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())
                {
                    if (cdr["TaskType"].ToString() != "体征测量")
                    {
                        list.Rows.Add(cdr["Date"].ToString(), Convert.ToDouble(cdr["ComplianceValue"]), cdr["TaskType"].ToString(), cdr["TaskId"].ToString(), cdr["TaskName"].ToString(), Convert.ToInt32(cdr["Status"]));
                    }
                }

                //确保排序
                DataView dv = list.DefaultView;
                dv.Sort = "Date Asc, TaskType Asc, Status Asc";
                DataTable list_sort = dv.ToTable();
                list_sort.Rows.Add("end", 0, "", "", "", 0);  //用于最后一天输出

                if (list_sort.Rows.Count > 1)
                {
                    string temp_date = list_sort.Rows[0]["Date"].ToString();
                    string temp_type = list_sort.Rows[0]["TaskType"].ToString();
                    string temp_str = "";
                    temp_str += "该天依从率:" + list_sort.Rows[0]["ComplianceValue"].ToString() + "<br>";

                    if (list_sort.Rows[0]["TaskType"].ToString() == "生活方式")
                    { }
                    temp_str += "<b><span style='font-size:14px;'>" + list_sort.Rows[0]["TaskType"].ToString() + ":</span></b>";

                    CompliacneDetailByD CompliacneDetailByD = new CompliacneDetailByD();
                    CompliacneDetailByD.Date = list_sort.Rows[0]["Date"].ToString();
                    // CompliacneDetailByD.ComplianceValue = list_sort.Rows[0]["ComplianceValue"].ToString();

                    if (Convert.ToDouble(list_sort.Rows[0]["ComplianceValue"]) == 0)  //某天依从率
                    {
                        CompliacneDetailByD.drugBullet = "";
                        CompliacneDetailByD.drugColor = "#DADADA";
                    }
                    else if (Convert.ToDouble(list_sort.Rows[0]["ComplianceValue"]) == 1)
                    {
                        CompliacneDetailByD.drugBullet = "";
                        CompliacneDetailByD.drugColor = "#777777";
                    }
                    else
                    {
                        CompliacneDetailByD.drugBullet = "amcharts-images/drug.png";
                        CompliacneDetailByD.drugColor = "";
                    }

                    if (Convert.ToInt32(list_sort.Rows[0]["Status"]) == 1)  //某天某项任务的完成情况
                    {
                        temp_str += list_sort.Rows[0]["TaskName"].ToString() + "complete  ";
                    }
                    else
                    {
                        //temp_str += list_sort.Rows[0]["TaskName"].ToString() + "noncomplete  ";
                        temp_str += "<b><span style='font-size:14px;color:red;'>" + list_sort.Rows[0]["TaskName"].ToString() + "noncomplete  " + "</span></b>";
                    }

                    //只有一条数据
                    if (list_sort.Rows.Count == 2)
                    {
                        CompliacneDetailByD.Events = temp_str;
                        resultList.Add(CompliacneDetailByD);
                    }

                    //>一条数据
                    if (list_sort.Rows.Count > 2)
                    {
                        for (int i = 1; i <= list_sort.Rows.Count - 1; i++)
                        {
                            if (temp_date == list_sort.Rows[i]["Date"].ToString())  //同一天
                            {
                                if (temp_type == list_sort.Rows[i]["TaskType"].ToString())     //同天同任务类型
                                {
                                    if (Convert.ToInt32(list_sort.Rows[i]["Status"]) == 1)  //某天某项任务的完成情况
                                    {
                                        temp_str += list_sort.Rows[i]["TaskName"].ToString() + "complete  ";
                                    }
                                    else
                                    {
                                        //temp_str += list_sort.Rows[i]["TaskName"].ToString() + "noncomplete  ";
                                        temp_str += "<b><span style='font-size:14px;color:red;'>" + list_sort.Rows[i]["TaskName"].ToString() + "noncomplete " + "</span></b>";
                                    }
                                }
                                else   //同天不同任务类型
                                {
                                    temp_str += "<br>";
                                    temp_str += "<b><span style='font-size:14px;'>" + list_sort.Rows[i]["TaskType"].ToString() + ":</span></b>";

                                    if (Convert.ToInt32(list_sort.Rows[i]["Status"]) == 1)  //某天某项任务的完成情况
                                    {
                                        temp_str += list_sort.Rows[i]["TaskName"].ToString() + "complete  ";
                                    }
                                    else
                                    {
                                        //temp_str += list_sort.Rows[i]["TaskName"].ToString() + "noncomplete  ";
                                        temp_str += "<b><span style='font-size:14px;color:red;'>" + list_sort.Rows[i]["TaskName"].ToString() + "noncomplete  </span></b>";
                                    }

                                    temp_type = list_sort.Rows[i]["TaskType"].ToString();
                                }

                            }
                            else   //不同天
                            {
                                //上一天输出
                                CompliacneDetailByD.Events = temp_str;
                                resultList.Add(CompliacneDetailByD);

                                if (list_sort.Rows[i]["Date"].ToString() != "end")
                                {
                                    //获取新一天
                                    CompliacneDetailByD = new CompliacneDetailByD();
                                    CompliacneDetailByD.Date = list_sort.Rows[i]["Date"].ToString();
                                    //CompliacneDetailByD.ComplianceValue = list_sort.Rows[i]["ComplianceValue"].ToString();

                                    if (Convert.ToDouble(list_sort.Rows[i]["ComplianceValue"]) == 0)  //某天依从率
                                    {
                                        CompliacneDetailByD.drugBullet = "";
                                        CompliacneDetailByD.drugColor = "#DADADA";
                                    }
                                    else if (Convert.ToDouble(list_sort.Rows[i]["ComplianceValue"]) == 1)
                                    {
                                        CompliacneDetailByD.drugBullet = "";
                                        CompliacneDetailByD.drugColor = "#777777";
                                    }
                                    else
                                    {
                                        CompliacneDetailByD.drugBullet = "amcharts-images/drug.png";
                                        CompliacneDetailByD.drugColor = "";
                                    }

                                    temp_str = "";
                                    temp_str += "该天依从率:" + list_sort.Rows[i]["ComplianceValue"].ToString() + "<br>";
                                    temp_str += "<b><span style='font-size:14px;'>" + list_sort.Rows[i]["TaskType"].ToString() + ":</span></b>";

                                    if (Convert.ToInt32(list_sort.Rows[i]["Status"]) == 1)  //某天某项任务的完成情况
                                    {
                                        temp_str += list_sort.Rows[i]["TaskName"].ToString() + "complete  ";
                                    }
                                    else
                                    {
                                        //temp_str += list_sort.Rows[i]["TaskName"].ToString() + "noncomplete  ";
                                        temp_str += "<b><span style='font-size:14px;color:red;'>" + list_sort.Rows[i]["TaskName"].ToString() + "noncomplete  </span></b>";
                                    }

                                    temp_date = list_sort.Rows[i]["Date"].ToString();
                                    temp_type = list_sort.Rows[i]["TaskType"].ToString();
                                }
                            }
                        }

                    }

                }

                return resultList;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Compliance.GetTasksComByPeriod", "数据库操作异常! 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();
            }
        }
Example #47
0
        //CSQ 2015-3-11
        public static DataTable GetLabTestList(DataConnection pclsCache, string piUserId, string piVisitId)
        {
            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("LabItemType", typeof(string)));
            list.Columns.Add(new DataColumn("LabItemTypeName", typeof(string)));
            list.Columns.Add(new DataColumn("LabItemCode", typeof(string)));
            list.Columns.Add(new DataColumn("LabItemName", typeof(string)));
            list.Columns.Add(new DataColumn("LabTestDate", typeof(string)));
            list.Columns.Add(new DataColumn("StatusCode", typeof(string)));
            list.Columns.Add(new DataColumn("Status", typeof(string)));
            list.Columns.Add(new DataColumn("ReportDate", typeof(string)));
            list.Columns.Add(new DataColumn("DeptCode", typeof(string)));
            list.Columns.Add(new DataColumn("DeptName", typeof(string)));
            //list.Columns.Add(new DataColumn("LabTestDateShow", typeof(string)));
            //list.Columns.Add(new DataColumn("ReportDateShow", typeof(string)));
            list.Columns.Add(new DataColumn("Creator", typeof(string)));
            list.Columns.Add(new DataColumn("LabTestDateCom", typeof(string)));   //20150709 LS

            CacheCommand cmd = null;
            CacheDataReader cdr = null;
            try
            {
                if (!pclsCache.Connect())
                {
                    return null;
                }
                cmd = new CacheCommand();
                cmd = Ps.LabTest.GetLabTestList(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("piUserId", CacheDbType.NVarChar).Value = piUserId;
                cmd.Parameters.Add("piVisitId", CacheDbType.NVarChar).Value = piVisitId;

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    //string LabTestDateShow = "", ReportDateShow = "";
                    //string str = cdr["LabTestDate"].ToString();
                    //if (str != "0")
                    //{
                    //    LabTestDateShow = str.Substring(0, 4) + "-" + str.Substring(4, 2) + "-" + str.Substring(6, 2);
                    //}
                    //string str1 = cdr["ReportDate"].ToString();
                    //if (str1 != "0")
                    //{
                    //    ReportDateShow = str1.Substring(0, 4) + "-" + str1.Substring(4, 2) + "-" + str1.Substring(6, 2);
                    //}
                    string ReportDateShow = "";
                    if (cdr["ReportDate"].ToString() == "9999/1/1 0:00:00")
                    {
                        ReportDateShow = "";
                    }
                    else
                    {
                        ReportDateShow = cdr["ReportDate"].ToString();
                    }
                    list.Rows.Add(cdr["VisitId"].ToString(), cdr["SortNo"].ToString(), cdr["LabItemType"].ToString(), cdr["LabItemTypeName"].ToString(), cdr["LabItemCode"].ToString(), cdr["LabItemName"].ToString(), cdr["LabTestDate"].ToString(), cdr["StatusCode"].ToString(), cdr["Status"].ToString(), ReportDateShow, cdr["DeptCode"].ToString(), cdr["DeptName"].ToString(), cdr["Creator"].ToString(), Convert.ToDateTime(cdr["LabTestDate"]).ToString("yyyy-MM-dd HH:mm:ss"));
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.LabTest.GetLabTestList", "数据库操作异常! 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();
            }
        }
Example #48
0
        //GetDoctorListByNameWithMod  ZYF 2014-12-4
        public static DataTable GetDoctorListByNameWithMod(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)));
            list.Columns.Add(new DataColumn("ModuleString", typeof(string)));
            string strMod = "";
            DataTable DTMod = new DataTable();

            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())
                {
                    strMod = "";
                    DTMod = GetDoctorModuleList(pclsCache, cdr["DoctorId"].ToString());
                    foreach (DataRow dr in DTMod.Rows)
                    {
                        if (dr["Value"] != null)
                        {
                            if (dr["Value"].ToString() == "0")
                            {
                                if (strMod == "")
                                {
                                    strMod = strMod + dr["CategoryName"].ToString();
                                }
                                else
                                {
                                    strMod = strMod + "," + dr["CategoryName"].ToString();
                                }
                            }
                        }
                    }
                    list.Rows.Add(cdr["DoctorId"].ToString(), cdr["DoctorName"].ToString(), Convert.ToInt32(cdr["Birthday"]), Convert.ToInt32(cdr["Gender"]), cdr["IDNo"].ToString(), Convert.ToInt32(cdr["InvalidFlag"]), strMod);
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsDoctorInfo.GetDoctorListByNameWithMod", "数据库操作异常! 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();
            }
        }
Example #49
0
        //GetTasksComByPeriod  某段时间所有任务的依从情况  DataTable数据库形式  LS 2010703
        public static DataTable GetTasksComByPeriodDT(DataConnection pclsCache, string PatientId, string PlanNo, int StartDate, int EndDate)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("Date", typeof(string)));
            list.Columns.Add(new DataColumn("ComplianceValue", typeof(double)));
            list.Columns.Add(new DataColumn("TaskType", typeof(string))); //中文
            list.Columns.Add(new DataColumn("TaskId", typeof(string)));
            list.Columns.Add(new DataColumn("TaskName", typeof(string)));
            list.Columns.Add(new DataColumn("Status", typeof(int)));
            list.Columns.Add(new DataColumn("Type", typeof(string))); //英文

            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())
                {
                    list.Rows.Add(cdr["Date"].ToString(), Convert.ToDouble(cdr["ComplianceValue"]), cdr["TaskType"].ToString(), cdr["TaskId"].ToString(), cdr["TaskName"].ToString(), Convert.ToInt32(cdr["Status"]), cdr["Type"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Compliance.GetTasksComByPeriod", "数据库操作异常! 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();
            }
        }
        //获取健康教育表所有信息 2015-05-29 GL
        public static DataTable GetHealthEducationList(DataConnection pclsCache)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("Module", typeof(string)));
            list.Columns.Add(new DataColumn("HealthId", typeof(string)));
            list.Columns.Add(new DataColumn("Type", 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)));

            CacheCommand cmd = null;
            CacheDataReader cdr = null;
            try
            {
                if (!pclsCache.Connect())
                {
                    return null;
                }
                cmd = new CacheCommand();
                cmd = Cm.MstHealthEducation.GetHealthEducationList(pclsCache.CacheConnectionObject);

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Rows.Add(cdr["Module"].ToString(), cdr["HealthId"].ToString(), cdr["Type"].ToString(), cdr["FileName"].ToString(), cdr["Path"].ToString(), cdr["Introduction"].ToString(), cdr["Redundance"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Cm.MstHealthEducation.GetHealthEducationList", "数据库操作异常! 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();
            }
        }
Example #51
0
        //以下是任务完成情况用到的函数
        //GetCompliacneRate 计算某段时间的总依从率 LS 2015-03-27
        public static 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 = ((int)((sum / count) * 100)).ToString();
                    compliacneRate = (Math.Round(sum / count, 2, MidpointRounding.AwayFromZero) * 100).ToString(); //保留整数

                }

                return compliacneRate;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsCompliacne.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();
            }
        }
        //GetPatientsByDoctorId   LS 2014-12-1
        public static DataTable GetPatientsByDoctorId(DataConnection pclsCache, string DoctorId, string CategoryCode)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("PatientId", typeof(string)));
            list.Columns.Add(new DataColumn("PatientName", typeof(string)));

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cmd = new CacheCommand();
                cmd = Ps.DoctorInfoDetail.GetPatientsByDoctorId(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["PatientId"].ToString(), cdr["PatientName"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.DoctorInfoDetail.GetPatientsByDoctorId", "数据库操作异常! 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();
            }
        }
Example #53
0
        //GetBasicAlert 获得字典表全部信息 YDS 2014-12-09
        public static DataTable GetBasicAlert(DataConnection pclsCache)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("AlertItemCode", typeof(string)));
            list.Columns.Add(new DataColumn("AlertItemName", typeof(string)));
            list.Columns.Add(new DataColumn("Min", typeof(decimal)));
            list.Columns.Add(new DataColumn("Max", typeof(decimal)));
            list.Columns.Add(new DataColumn("Units", typeof(string)));
            list.Columns.Add(new DataColumn("Remarks", typeof(string)));
            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cmd = new CacheCommand();
                cmd = Wn.MstBasicAlert.GetBasicAlert(pclsCache.CacheConnectionObject);
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    decimal Min = 0;
                    decimal Max = 0;
                    if (cdr["Min"].ToString() != "")
                    {
                        Min = Convert.ToDecimal(cdr["Min"]);
                    }
                    if (cdr["Max"].ToString() != "")
                    {
                        Max = Convert.ToDecimal(cdr["Max"]);
                    }
                    list.Rows.Add(cdr["AlertItemCode"].ToString(), cdr["AlertItemName"].ToString(), Min, Max, cdr["Units"].ToString(), cdr["Remarks"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "WnMstBasicAlert.GetBasicAlert", "数据库操作异常! 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();
            }
        }
Example #54
0
        //GetInfoItem WF 2014-12-2 
        public static DataTable GetInfoItem(DataConnection pclsCache)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("CategoryCode", typeof(string)));
            list.Columns.Add(new DataColumn("Code", typeof(string)));
            list.Columns.Add(new DataColumn("Name", typeof(string)));
            list.Columns.Add(new DataColumn("ParentCode", typeof(string)));
            list.Columns.Add(new DataColumn("SortNo", typeof(int)));
            list.Columns.Add(new DataColumn("StartDate", typeof(string)));
            list.Columns.Add(new DataColumn("EndDate", typeof(string)));
            list.Columns.Add(new DataColumn("GroupHeaderFlag", typeof(int)));
            list.Columns.Add(new DataColumn("ControlType", typeof(string)));
            list.Columns.Add(new DataColumn("OptionCategory", typeof(string)));

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cmd = new CacheCommand();
                cmd = Cm.MstInfoItem.GetInfoItem(pclsCache.CacheConnectionObject);
                cdr = cmd.ExecuteReader();
                int SortNo;
                int GroupHeaderFlag;
                //int ControlType;
                while (cdr.Read())
                {
                    if (cdr["SortNo"].ToString() == "")
                    {
                        SortNo = 0;
                    }
                    else
                    {
                        SortNo = Convert.ToInt32(cdr["SortNo"]);
                    }
                    if (cdr["GroupHeaderFlag"].ToString() == "")
                    {
                        GroupHeaderFlag = 0;
                    }
                    else
                    {
                        GroupHeaderFlag = Convert.ToInt32(cdr["GroupHeaderFlag"]);
                    }
                    list.Rows.Add(cdr["CategoryCode"].ToString(), cdr["Code"].ToString(), cdr["Name"].ToString(), cdr["ParentCode"].ToString(), SortNo, cdr["StartDate"].ToString(), cdr["EndDate"].ToString(), GroupHeaderFlag, cdr["ControlType"].ToString(), cdr["OptionCategory"].ToString());
                }
                return list;
            }
            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();
            }
        }
Example #55
0
        /// <summary>
        /// 从数据库拿出相关数据 并增加type字段 区别收缩压、舒张压、脉率  用于phone 体征详细时刻表 GL 2015-10-10
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="ItemType"></param>
        /// <param name="ItemCode"></param>
        /// <param name="StartDate"></param>
        /// <param name="EndDate"></param>
        /// <returns></returns>
        public List<VitalInfo> GetTypedSignDetailByPeriod(DataConnection pclsCache, string UserId, string ItemType, string ItemCode, 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.GetSignDetailByPeriod(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())
                    {
                        VitalInfo item = new VitalInfo();
                        string RecordDate = cdr["RecordDate"].ToString();
                        RecordDate = RecordDate.Substring(0, 4) + "-" + RecordDate.Substring(4, 2) + "-" + RecordDate.Substring(6, 2);
                        string SignType = "";
                        if (ItemCode == "Bloodpressure_1") //收缩压
                        {
                            SignType = "1";
                        }
                        else if (ItemCode == "Bloodpressure_2")  //舒张压
                        {
                            SignType = "2";
                        }
                        else   //脉率"Pulserate_1"
                        {
                            SignType = "3";
                        }
                        item.SignType = SignType;
                        item.RecordDate = RecordDate;
                        item.RecordTime = new CommonFunction().TransTime(cdr["RecordTime"].ToString());
                        item.Value = cdr["Value"].ToString();
                        item.Unit = cdr["Unit"].ToString();
                        items.Add(item);
                    }
                    return items;
                }
                catch (Exception ex)
                {
                    HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "VitalInfoMethod.GetTypedSignDetailByPeriod", "数据库操作异常! 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();
                }
            }
        }
Example #56
0
        //GetDoctorList LS LS 2014-12-1
        public static DataTable GetDoctorList(DataConnection pclsCache)
        {
            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.GetDoctorList(pclsCache.CacheConnectionObject);
                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.GetDoctorList", "数据库操作异常! 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();
            }
        }
Example #57
0
        // GetLabTestSubItems 获取化验子项目信息列表 CSQ 2014-12-01
        public static DataTable GetLabTestSubItems(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("InputCode", typeof(string)));
            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.MstLabTestSubItems.GetLabTestSubItems(pclsCache.CacheConnectionObject);

                cdr = cmd.ExecuteReader();
                int SortNo;
                int InvalidFlag;
                while (cdr.Read())
                {
                    if (cdr["SortNo"].ToString() == "")
                    {
                        SortNo = 0;
                    }
                    else
                    {
                        SortNo = Convert.ToInt32(cdr["SortNo"]);
                    }
                    if (cdr["InvalidFlag"].ToString() == "")
                    {
                        InvalidFlag = 0;
                    }
                    else
                    {
                        InvalidFlag = Convert.ToInt32(cdr["InvalidFlag"]);
                    }
                    list.Rows.Add(cdr["Code"].ToString(), cdr["Name"].ToString(), SortNo, cdr["InputCode"].ToString(), cdr["Redundance"].ToString(), InvalidFlag);
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstLabTestSubItems.GetLabTestSubItems", "数据库操作异常! 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();
            }
        }
Example #58
0
        //GetSignDetailByPeriod 通过Ps.Compliance中的date获取当天某项生理参数值,形成系列  DataTable 形式LS 2015-04-17
        public static DataTable GetSignDetailByPeriod(DataConnection pclsCache, string PatientId, string PlanNo, 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.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())
                {
                    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, "PsCompliacne.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();
            }
        }
        //GetBPGrades LS 2015-03-27  获取血压分级规则
        public static List<MstBloodPressure> GetBPGrades(DataConnection pclsCache)
        {
            List<MstBloodPressure> result = new List<MstBloodPressure>();
            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cmd = new CacheCommand();
                cmd = Cm.MstBloodPressure.GetBPGrades(pclsCache.CacheConnectionObject);
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    MstBloodPressure MstBloodPressure = new MstBloodPressure();
                    MstBloodPressure.Code = cdr["Code"].ToString();
                    MstBloodPressure.Name = cdr["Name"].ToString();
                    MstBloodPressure.Description = cdr["Description"].ToString();
                    MstBloodPressure.SBP = Convert.ToInt32(cdr["SBP"]);
                    MstBloodPressure.DBP = Convert.ToInt32(cdr["DBP"]);
                    MstBloodPressure.PatientClass = cdr["PatientClass"].ToString();
                    MstBloodPressure.Redundance = cdr["Redundance"].ToString();
                    result.Add(MstBloodPressure);

                }
                return result;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstBloodPressure.GetBPGrades", "数据库操作异常! 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();
            }
        }
Example #60
0
        //LS 2015-1-23
        public static DataTable GetDiagnosisInfo(DataConnection pclsCache, string UserId, string VisitId)
        {
            DataTable list = new DataTable();
            list.Columns.Add(new DataColumn("VisitId", typeof(string)));
            list.Columns.Add(new DataColumn("DiagnosisType", typeof(string)));
            list.Columns.Add(new DataColumn("DiagnosisTypeName", typeof(string)));
            list.Columns.Add(new DataColumn("DiagnosisNo", typeof(string)));
            list.Columns.Add(new DataColumn("Type", typeof(string)));
            list.Columns.Add(new DataColumn("TypeName", typeof(string)));
            list.Columns.Add(new DataColumn("DiagnosisCode", typeof(string)));
            list.Columns.Add(new DataColumn("DiagnosisName", typeof(string)));
            list.Columns.Add(new DataColumn("Description", typeof(string)));
            list.Columns.Add(new DataColumn("RecordDate", typeof(string)));
            list.Columns.Add(new DataColumn("RecordDateShow", typeof(string)));
            list.Columns.Add(new DataColumn("Creator", typeof(string)));   //20150124 CSQ

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

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    string RecordDateShow = "";
                    string str1 = cdr["RecordDate"].ToString();
                    if (str1 != "")
                    {
                        RecordDateShow = str1.Substring(0, 4) + "-" + str1.Substring(4, 2) + "-" + str1.Substring(6, 2);
                    }
                    list.Rows.Add(cdr["VisitId"].ToString(), cdr["DiagnosisType"].ToString(), cdr["DiagnosisTypeName"].ToString(), cdr["DiagnosisNo"].ToString(), cdr["Type"].ToString(), cdr["TypeName"].ToString(), cdr["DiagnosisCode"].ToString(), cdr["DiagnosisName"].ToString(), cdr["Description"].ToString(), cdr["RecordDate"].ToString(), RecordDateShow, cdr["Creator"].ToString());
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "Ps.Diagnosis.GetDiagnosisInfo", "数据库操作异常! 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();
            }
        }