//private List<CmMstInfoItem> CmMstInfoItemList = new List<CmMstInfoItem>();
     

        //public IEnumerable<CmMstInfoItem> GetAll()
        //{
        //    List<CmMstInfoItem> CmMstInfoItemList = new List<CmMstInfoItem>();
        //    GetCmMstInfoItem(CmMstInfoItemList);
        //    return CmMstInfoItemList;
        //}

        //public CmMstInfoItem Get(string CategoryCode, string Code, int StartDate)
        //{
        //    List<CmMstInfoItem> CmMstInfoItemList = new List<CmMstInfoItem>();
        //    GetCmMstInfoItem(CmMstInfoItemList);
        //    return CmMstInfoItemList.Find(p => p.CategoryCode == CategoryCode && p.Code == Code && p.StartDate == StartDate);
        //}

        public int Remove(DataConnection pclsCache, string CategoryCode, string Code, int StartDate)
        {
             int ret = 3;
             try
             {
                 if (!pclsCache.Connect())
                 {
                     //MessageBox.Show("Cache数据库连接失败");
                     return ret;

                 }
                 ret = (int)Cm.MstInfoItem.DeleteData(pclsCache.CacheConnectionObject, CategoryCode, Code);
                 return ret;
             }
             catch (Exception ex)
             {
                 //MessageBox.Show(ex.ToString(), "保存失败!");
                 HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstInfoItem.DeleteData", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                 return ret;
             }
             finally
             {
                 pclsCache.DisConnect();
             }
        }
Beispiel #2
0
        //ChangePassword ZAM 2014-12-01 //WF 20151010
        public int ChangePassword(DataConnection pclsCache, string UserId, string OldPassword, string newPassword, string revUserId, string TerminalName, string TerminalIP, int DeviceType)
        {
            int ret = 0;
            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return ret;

                }
                ret = (int)Cm.MstUser.ChangePassword(pclsCache.CacheConnectionObject, UserId, OldPassword, newPassword, revUserId, TerminalName, TerminalIP, DeviceType);
                return ret;
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString(), "保存失败!");
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstUser.ChangePassword", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return ret;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
Beispiel #3
0
 /// <summary>
 /// 获取某日期之后的有数据的起止时间 GL 2015-10-10
 /// </summary>
 /// <param name="UserId"></param>
 /// <param name="date"></param>
 /// <param name="Num"></param>
 /// <returns></returns>
 public VitalInfo GetVitalSignDates(DataConnection pclsCache, string UserId, int date, int Num)
 {
     try
     {
         VitalInfo item = new VitalInfo();
         InterSystems.Data.CacheTypes.CacheSysList list = null;
         if (!pclsCache.Connect())
         {
             return null;
         }
         list = Ps.VitalSigns.GetVitalSignDates(pclsCache.CacheConnectionObject, UserId, date, Num);
         if (list != null)
         {
             item.StartDate = list[0];
             item.EndDate = list[1];
         }
         return item;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "VitalInfoMethod.GetVitalSignDates", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
Beispiel #4
0
 /// <summary>
 /// 将消息写入数据库并获取发送时间与显示时间 GL 2015-10-10(修改2015-10-26)
 /// </summary>
 /// <param name="SendBy"></param>
 /// <param name="Reciever"></param>
 /// <param name="Content"></param>
 /// <param name="piUserId"></param>
 /// <param name="piTerminalName"></param>
 /// <param name="piTerminalIP"></param>
 /// <param name="piDeviceType"></param>
 /// <returns></returns>
 public Message SetSMS(DataConnection pclsCache, string SendBy, string Reciever, string Content, string piUserId, string piTerminalName, string piTerminalIP, int piDeviceType)
 {
     try
     {
         Message Meg = new Message();
         if (!pclsCache.Connect())
         {
             return null;
         }
         InterSystems.Data.CacheTypes.CacheSysList list = null;
         list = Mb.MessageRecord.SetSMS(pclsCache.CacheConnectionObject, SendBy, Reciever, Content, piUserId, piTerminalName, piTerminalIP, piDeviceType);
         if (list != null)
         {
             Meg.Flag = list[0];
             Meg.SendDateTime = list[1];
             Meg.Time = list[2];
         }
         return Meg;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "MessageMethod.SetSMS", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }           
 }
 /// <summary>
 /// 同步患者购买模块下的某些信息 LY 2015-10-14
 /// </summary>
 /// <param name="UserId"></param>
 /// <returns></returns>
 public SynBasicInfo SynBasicInfoDetail(DataConnection pclsCache, string UserId)
 {
     SynBasicInfo ret = new SynBasicInfo();
     ret.ExamInfo = new ClinicInfoMethod().GetNewExam(pclsCache, UserId);
     ret.LabTestInfo = new ClinicInfoMethod().GetNewLabTest(pclsCache, UserId);
     return ret;
 }
Beispiel #6
0
        //GetNo 自动编号 CSQ 20151010
        public string GetNo(DataConnection pclsCache, int NumberingType, string TargetDate)
        {
            string number = "";
            try
            {
                if (!pclsCache.Connect())
                {
                    //MessageBox.Show("Cache数据库连接失败");
                    return number;

                }
                number = Cm.MstNumbering.GetNo(pclsCache.CacheConnectionObject, NumberingType, TargetDate);
                return number;
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString(), "获取编号失败!");
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstNumbering.GetNo", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return number;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
Beispiel #7
0
 /// <summary>
 ///  GetUserInfoByUserId ZAM 2014-12-02 //syf 20151014
 /// </summary>
 /// <param name="pclsCache"></param>
 /// <param name="UserId"></param>
 /// <returns></returns>
 public UserInfoByUserId GetUserInfoByUserId(DataConnection pclsCache, string UserId)
 {
     UserInfoByUserId ret = new UserInfoByUserId();
     try
     {
         if (!pclsCache.Connect())
         {
             return null;
         }
         InterSystems.Data.CacheTypes.CacheSysList list = null;
         list = Cm.MstUser.GetUserInfoByUserId(pclsCache.CacheConnectionObject, UserId);
         if (list != null)
         {
             ret.UserId = list[0];
             ret.UserName = list[1];
             ret.Password = list[2];
             ret.Class = list[3];
             ret.ClassName = list[4];
             ret.StartDate = list[5];
             ret.EndDate = list[6];
         }
         return ret;
     }
     catch (Exception ex)
     {
         //MessageBox.Show(ex.ToString(), "获取名称失败!");
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstUser.GetUserInfoByUserId", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
 /// <summary>
 /// 获取最新一条消息 GL 2015-10-10
 /// </summary>
 /// <param name="DoctorId"></param>
 /// <param name="PatientId"></param>
 /// <returns></returns>
 public Message GetLatestSMS(DataConnection pclsCache, string DoctorId, string PatientId)
 {
     try
     {
         Message Meg = new Message();
         if (!pclsCache.Connect())
         {
             return null;
         }
         InterSystems.Data.CacheTypes.CacheSysList list = null;
         list = Mb.MessageRecord.GetLatestSMS(pclsCache.CacheConnectionObject, DoctorId, PatientId);
         if (list != null)
         {
             Meg.MessageNo = list[0];
             Meg.Content = list[1];
             Meg.SendDateTime = list[2];
             Meg.SendByName = list[3];
             Meg.Flag = list[4];
         }
         return Meg;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "MessageMethod.GetLatestSMS", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
Beispiel #9
0
 /// <summary>
 /// 获取患者某项生理参数的RecordDate前的最近一条数据 GL 2015-10-10
 /// </summary>
 /// <param name="UserId"></param>
 /// <param name="ItemType"></param>
 /// <param name="ItemCode"></param>
 /// <param name="RecordDate"></param>
 /// <returns></returns>
 public VitalInfo GetLatestVitalSignsByDate(DataConnection pclsCache,string UserId, string ItemType, string ItemCode, int RecordDate)
 {
     try
     {
         VitalInfo item = new VitalInfo();
         InterSystems.Data.CacheTypes.CacheSysList list = null;
         list = Ps.VitalSigns.GetLatestVitalSignsByDate(pclsCache.CacheConnectionObject, UserId, ItemType, ItemCode, RecordDate);
         if (list != null)
         {
             item.RecordDate = list[0];
             item.RecordTime = list[1];
             item.Value = list[2];
             item.Unit = list[3];
         }
         return item;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "VitalInfoMethod.GetLatestSMS", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
 public ForToken LogOn(DataConnection pclsCache, string PwType, string userId, string password, string role)
 {
     int result = usersMethod.CheckPasswordByInput(pclsCache, PwType, userId, password);
     ForToken response = new ForToken();
     response.Status = "";
     response.Token = "";
     if (result == 1)
     {
         //密码验证成功
         string UId = usersMethod.GetIDByInput(pclsCache, PwType, userId); //输入手机号获取用户ID
         if (UId != "")
         {
             string Class = usersMethod.GetActivatedState(pclsCache, UId, role);
             if (Class == "0")
             {
                 int flag = 0;
                 List<string> AllRoleMatch = usersMethod.GetAllRoleMatch(pclsCache, UId);
                 if (AllRoleMatch != null)
                 {
                     for (int i = 0; i < AllRoleMatch.Count; i++)
                     {
                         if (AllRoleMatch[i].ToString() == role)//查询条件
                         {
                             flag = 1;
                             break;
                         }
                     }
                 }
                 if (flag == 1)
                 {
                     string ticks = new CommonMethod().GetServerTime(pclsCache);
                     response.Token = SecurityManager.GenerateToken(userId, password, role, ticks);
                     response.Status = "已注册激活且有权限,登陆成功,跳转到主页";
                     return response; //"已注册激活且有权限,登陆成功,跳转到主页"1;
                 }
                 else
                 {
                     response.Status = "已注册激活,但没有权限"; //"已注册激活 但没有权限"2;
                 }
             }
             else      //Class == "1" or Class == ""
             {
                 response.Status = "您的账号对应的角色未激活,需要先激活;界面跳转到游客页面(已注册但未激活)";            //您的账号对应的角色未激活,需要先激活;界面跳转到游客页面(已注册但未激活)3
             }
         }
         else
         {
             response.Status = "用户不存在"; //"用户不存在"4;
         }
     }
     else if (result == 0)
     {
         response.Status = "密码错误"; //"密码错误"5;
     }
     else
     {
         response.Status = "用户不存在";   //"用户不存在"4
     }
     return response;
 }
Beispiel #11
0
        /// <summary>
        /// Ps.TreatmentIndicators.SetData GL 2015-10-10
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="SortNo"></param>
        /// <param name="AssessmentType"></param>
        /// <param name="AssessmentName"></param>
        /// <param name="AssessmentTime"></param>
        /// <param name="Result"></param>
        /// <param name="revUserId"></param>
        /// <param name="TerminalName"></param>
        /// <param name="TerminalIP"></param>
        /// <param name="DeviceType"></param>
        /// <returns></returns>
        public int PsTreatmentIndicatorsSetData(DataConnection pclsCache, string UserId, int SortNo, string AssessmentType, string AssessmentName, DateTime AssessmentTime, string Result, string revUserId, string TerminalName, string TerminalIP, int DeviceType)
        {
            int ret = 2;
            try
            {
                if (!pclsCache.Connect())
                {
                    return ret;
                }
                ret = (int)Ps.TreatmentIndicators.SetData(pclsCache.CacheConnectionObject, UserId, SortNo, AssessmentType, AssessmentName, AssessmentTime, Result, revUserId, TerminalName, TerminalIP, DeviceType);
                //if(ret == 1)
                //{
                //    int Ass = 0;
                //    string Amt = "";
                //    Amt = Ps.DoctorInfoDetail.GetValue(pclsCache.CacheConnectionObject, revUserId, "Score", "AssessmentNum", 1);
                //    if(Amt != null)
                //    {
                //        Ass = Convert.ToInt32(Amt);
                //        Ass++;
                //    }
                //    ret = (int)Ps.DoctorInfoDetail.SetData(pclsCache.CacheConnectionObject, revUserId, "Score", "AssessmentNum", 1, Convert.ToString(Ass), "", 1, revUserId, TerminalName, TerminalIP, DeviceType);

                //}
                return ret;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "RiskInfoMethod.SetData", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return 2;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
Beispiel #12
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();
                   }
            }
        //public bool Update(CmMstInfoItem item)
        //{
        //    if (item == null)
        //    {
        //        throw new ArgumentNullException("item");
        //    }
        //    bool ret = SetData(item);
        //    return ret;
        //}

        //public bool AddItem(CmMstInfoItem item)
        //{
        //    if (item == null)
        //    {
        //        throw new ArgumentNullException("item");
        //    }
        //    bool ret = SetData(item);
        //    return ret;
        //}

        #region functions
        private void GetCmMstInfoItem(DataConnection pclsCache, List<CmMstInfoItem> CmMstInfoItemList)
        {
            CacheCommand cmd = null;
            CacheDataReader cdr = null;

            try
            {
                if (!pclsCache.Connect())
                {
                    return;
                }
                //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                                       
                    });
                }
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstInfoItem.GetInfoItem", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return;
            }
            finally
            {

                if ((cdr != null))
                {
                    cdr.Close();
                    cdr.Dispose(true);
                    cdr = null;
                }
                if ((cmd != null))
                {
                    cmd.Parameters.Clear();
                    cmd.Dispose();
                    cmd = null;
                }
                pclsCache.DisConnect();
            }
        }
        //输出一段时间中记录的所有体征信息
        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();
                }
            }
        }
Beispiel #15
0
        /// <summary>
        /// 获取生活方式细节 CSQ 20151010
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="Module"></param>
        /// <returns></returns>
        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(),
                        Name = cdr["Name"].ToString(),
                        CurativeEffect = cdr["CurativeEffect"].ToString(),
                        SideEffect = cdr["SideEffect"].ToString(),
                        Instruction = cdr["Instruction"].ToString(),
                        HealthEffect = cdr["HealthEffect"].ToString(),
                        Unit = cdr["Unit"].ToString(),
                    });
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "DictMethod.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();
            }
        }
        public List<Parameters> GetParameters(DataConnection pclsCache, string Indicators)
        {
            List<Parameters> list = new List<Parameters>();

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Add(new Parameters
                    {
                        Id = cdr["Id"].ToString(),
                        Name = cdr["Name"].ToString(),
                        Value = cdr["Value"].ToString(),
                        Unit = cdr["Unit"].ToString()

                    });
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "RiskInfoMethod.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();
            }
        }
 public List<Insurance> GetInsuranceType(DataConnection pclsCache)
 {
     try
     {
         return dictMethod.GetInsurance(pclsCache);
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "GetInsuranceType", "WebService调用异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
         throw (ex);
     }
 }
Beispiel #18
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();
            }
        }
 public int CmMstTaskSetData(DataConnection pclsCache, string CategoryCode, string Code, string Name, string ParentCode, string Description, int StartDate, int EndDate, int GroupHeaderFlag, int ControlType, string OptionCategory, string revUserId, string TerminalName, string TerminalIP, int DeviceType)
 {
     try
     {
         int IsSaved = 2;
         IsSaved = dictMethod.CmMstTaskSetData(pclsCache, CategoryCode, Code, Name, ParentCode, Description, StartDate, EndDate, GroupHeaderFlag, ControlType, OptionCategory, revUserId, TerminalName, TerminalIP, DeviceType);
         return IsSaved;
     }
     catch (Exception ex)
     {
         return 0;
         throw (ex);
     }
 }
 public int Activition(DataConnection pclsCache, string UserId, string InviteCode, string role)
 {
     int ret = 0;
     int Flag = usersMethod.SetActivition(pclsCache, UserId, role, InviteCode);
     if (Flag == 1)
     {
         ret = 1; // "激活成功";
     }
     else
     {
         ret = 2; // "激活失败";
     }
     return ret;
 }
Beispiel #21
0
        // GetTypeList 返回所有类型代码及名称 CSQ 20151010
        public List<TypeAndName> CmMstHypertensionDrugGetTypeList(DataConnection pclsCache)
        {
            List<TypeAndName> list = new List<TypeAndName>();

            CacheCommand cmd = null;
            CacheDataReader cdr = null;

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

                cmd = new CacheCommand();
                cmd = Cm.MstHypertensionDrug.GetTypeList(pclsCache.CacheConnectionObject);
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    list.Add(new TypeAndName
                    {
                        Type = cdr["Type"].ToString(),
                        Name = cdr["TypeName"].ToString()
                    });
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstHypertensionDrug.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();
            }
        }
Beispiel #22
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();
            }
        }
Beispiel #23
0
        /// <summary>
        /// 获取消息对话 GL 2015-10-10
        /// </summary>
        /// <param name="Reciever"></param>
        /// <param name="SendBy"></param>
        /// <returns></returns>
        public List<Message> GetSMSDialogue(DataConnection pclsCache, string Reciever, string SendBy)
        {
            List<Message> items = new List<Message>();
            CacheCommand cmd = null;
            CacheDataReader cdr = null;
            try
            {
                if (!pclsCache.Connect())
                {
                    return null;
                }
                cmd = Mb.MessageRecord.GetSMSDialogue(pclsCache.CacheConnectionObject);
                cmd.Parameters.Add("Reciever", CacheDbType.NVarChar).Value = Reciever;
                cmd.Parameters.Add("SendBy", CacheDbType.NVarChar).Value = SendBy;
                cdr = cmd.ExecuteReader();
                while (cdr.Read())
                {
                    Message item = new Message();
                    item.Time = cdr["Time"].ToString();
                    item.Content = cdr["Content"].ToString();
                    item.IDFlag = cdr["IDFlag"].ToString();
                    item.SendDateTime = cdr["SendDateTime"].ToString().Replace("-","/");
                    items.Add(item);
                }
                return items;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "MessageMethod.GetSMSDialogue", "数据库操作异常! 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();
            }
        }
        public ClinicalInfoListViewModel GetClinicalInfoList(DataConnection pclsCache, string UserId)
        {
            try
            {
                ClinicInfoViewModel DT_ClinicInfoDetail = new ClinicInfoViewModel();
                return clinicInfoMethod.GetClinicalInfoList(pclsCache, UserId);

            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "GetClinicalInfoList", "WebService调用异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
                throw (ex);
            }
        }
        //创建计划 GL 2015-10-13
        public int CreateTask(DataConnection pclsCache, string PlanNo, string Type, string Code, string SortNo, string Instruction, string UserId, string TerminalName, string TerminalIP, int DeviceType)
        {
            try
            {
                int ret = 3;
                ret = new PlanInfoMethod().PsTaskSetData(pclsCache, PlanNo,  Type, Code, SortNo,Instruction, UserId, TerminalName, TerminalIP, DeviceType);

                return ret;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CreateTask ", "PlanInfoRepository! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return 2;
                throw (ex);
            }
        }
 /// <summary>
 /// 浙大输出接口 LY 2015-10-29
 /// </summary>
 /// <param name="PatientId"></param>
 /// <returns></returns>
 public List<TypeAndName> GetPatientInfo(DataConnection pclsCache, string PatientId)
 {
     List<TypeAndName> List = new List<TypeAndName>();
     PatBasicInfo BasicInfo = new UsersRepository().GetPatBasicInfo(pclsCache, PatientId);
     TypeAndName NewLine1 = new TypeAndName
     {
         Type = "name",
         Name = BasicInfo.UserName
     };
     List.Add(NewLine1);
     TypeAndName NewLine2 = new TypeAndName
     {
         Type = "age",
         Name = BasicInfo.Age
     };
     List.Add(NewLine2);
     TypeAndName NewLine3 = new TypeAndName
     {
         Type = "sex",
         Name = BasicInfo.Gender
     };
     List.Add(NewLine3);
     string Height = new VitalInfoRepository().GetLatestPatientVitalSigns(pclsCache, PatientId, "Height", "Height_1");
     TypeAndName NewLine4 = new TypeAndName
     {
         Type = "height",
         Name = Height
     };
     List.Add(NewLine4);
     string Weight = new VitalInfoRepository().GetLatestPatientVitalSigns(pclsCache, PatientId, "Weight", "Weight_1");
     TypeAndName NewLine5 = new TypeAndName
     {
         Type = "weight",
         Name = Weight
     };
     List.Add(NewLine5);
     string PhoneNumber = new UsersMethod().GetPhoneNoByUserId(pclsCache, PatientId);
     TypeAndName NewLine6 = new TypeAndName
     {
         Type = "mobilephone",
         Name = PhoneNumber
     };
     List.Add(NewLine6);
     return List;
 }
Beispiel #27
0
        //DataConnection pclsCache = new DataConnection();

        #region < "Ps.VitalSigns" >
        /// <summary>
        /// Ps.VitalSigns.SetData GL 2015-10-10
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="RecordDate"></param>
        /// <param name="RecordTime"></param>
        /// <param name="ItemType"></param>
        /// <param name="ItemCode"></param>
        /// <param name="Value"></param>
        /// <param name="Unit"></param>
        /// <param name="revUserId"></param>
        /// <param name="TerminalName"></param>
        /// <param name="TerminalIP"></param>
        /// <param name="DeviceType"></param>
        /// <returns></returns>
        public int SetData(DataConnection pclsCache, string UserId, int RecordDate, int RecordTime, string ItemType, string ItemCode, string Value, string Unit, string revUserId, string TerminalName, string TerminalIP, int DeviceType)
        {
            int ret = 2;
            try
            {
                if (!pclsCache.Connect())
                {
                    return ret;
                }
                ret = (int)Ps.VitalSigns.SetData(pclsCache.CacheConnectionObject, UserId, RecordDate, RecordTime, ItemType, ItemCode, Value, Unit, revUserId, TerminalName, TerminalIP, DeviceType);
                return ret;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "VitalInfoMethod.SetData", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return 2;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
        public M1RiskInput GetM1RiskInput(DataConnection pclsCache, string UserId)
        {
            M1RiskInput Input = new M1RiskInput();
            Input = new UsersMethod().GetM1RiskInput(pclsCache, UserId);
            if(Input != null)
            {
                BasicInfo BaseList = new UsersMethod().GetBasicInfo(pclsCache, UserId);
                if (BaseList != null)
                {
                    if (BaseList.Birthday != "" && BaseList.Birthday != "0" && BaseList.Birthday != null)
                    {
                        Input.Age = new UsersMethod().GetAgeByBirthDay(pclsCache, Convert.ToInt32(BaseList.Birthday));//年龄
                    }
                    if (BaseList.Gender != "" && BaseList.Gender != "0" && BaseList.Gender != null)
                    {
                        Input.Gender = Convert.ToInt32(BaseList.Gender);//性别
                    }
                }
            }

            return Input;
        }
Beispiel #29
0
 public int PsParametersSetData(DataConnection pclsCache, string Indicators, string Id, string Name, string Value, string Unit,  string revUserId, string TerminalName, string TerminalIP, int DeviceType)
 {
     int ret = 2;
     try
     {
         if (!pclsCache.Connect())
         {
             return ret;
         }
         ret = (int)Ps.Parameters.SetData(pclsCache.CacheConnectionObject, Indicators, Id, Name, Value, Unit, revUserId, TerminalName, TerminalIP, DeviceType);
         return ret;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "RiskInfoMethod.PsParametersSetData", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return 2;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
 public int DeteteTask(DataConnection pclsCache, string Plan, string Type, string Code, string SortNo)
 {
     int ret = 0;
     try
     {
         if (!pclsCache.Connect())
         {
             return ret;
         }
         ret = (int)Ps.Task.Delete(pclsCache.CacheConnectionObject, Plan, Type, Code, SortNo);
         return ret;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PlanInfoMethod.DeteteTask", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return ret;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }