/// <summary> /// 获取健康专员列表 SYF 20151022 /// </summary> /// <param name="pclsCache"></param> /// <returns></returns> public List<HealthCoachList> GetHealthCoachList(DataConnection pclsCache) { List<HealthCoachList> list = new List<HealthCoachList>(); List<ActiveUser> list1 = new List<ActiveUser>(); GetDoctorInfoDetail list2 = new GetDoctorInfoDetail(); string moudlecodes = ""; string[] moudlecode = null; //string DoctorId = ""; try { list1 = GetActiveUserByRole(pclsCache, "HealthCoach");//根据角色获取已激活的用户 if (list1 != null) { for (int i = 0; i < list1.Count; i++) { DoctorInfo dcf = new DoctorInfo(); HealthCoachList hcf = new HealthCoachList(); //一次循环取一个健康专员的信息 // DoctorId = list1[i].UserId; dcf = new UsersMethod().GetDoctorInfo(pclsCache, list1[i].UserId);//获取基本信息 hcf.healthCoachID = list1[i].UserId; hcf.name = ""; hcf.sex = ""; hcf.age = ""; if (dcf != null) { hcf.name = dcf.DoctorName; hcf.sex = dcf.Gender; hcf.age = Convert.ToString(new UsersMethod().GetAgeByBirthDay(pclsCache, Convert.ToInt32(dcf.Birthday))); } moudlecodes = new UsersMethod().GetModuleByDoctorId(pclsCache, list1[i].UserId); if (moudlecodes != null) { moudlecode = moudlecodes.Split(new char[] { '_' }); for (int k = 0; k < moudlecode.Length; k++) { if (k == 0) { hcf.module = new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } else { hcf.module = hcf.module + "/" + new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } } } list2 = new UsersMethod().GetDoctorInfoDetail(pclsCache, list1[i].UserId); if (list2 != null) { hcf.imageURL = list2.PhotoAddress; hcf.score = Math.Round(Convert.ToDouble(list2.GeneralScore),1).ToString(); //hcf.score = list2.GeneralScore; //hcf.score = Double.Parse(hcf.score).ToString("F1"); } list.Add(hcf); } } return list; } catch (Exception ex) { HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UserMethod.GetHealthCoachList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace); return null; } finally { pclsCache.DisConnect(); } }
// GetDoctorInfo返回医生基本信息 ZYF 2014-12-4 public DoctorInfo GetDoctorInfo(DataConnection pclsCache, string DoctorId) { DoctorInfo ret = new DoctorInfo(); try { if (!pclsCache.Connect()) { return null; } ret.DoctorId = Ps.DoctorInfo.GetDoctorInfo(pclsCache.CacheConnectionObject, DoctorId)[0].ToString(); ret.DoctorName = Ps.DoctorInfo.GetDoctorInfo(pclsCache.CacheConnectionObject, DoctorId)[1].ToString(); ret.Birthday = Ps.DoctorInfo.GetDoctorInfo(pclsCache.CacheConnectionObject, DoctorId)[2].ToString(); ret.Gender = Ps.DoctorInfo.GetDoctorInfo(pclsCache.CacheConnectionObject, DoctorId)[3].ToString(); ret.IDNo = Ps.DoctorInfo.GetDoctorInfo(pclsCache.CacheConnectionObject, DoctorId)[4].ToString(); ret.InvalidFlag = Ps.DoctorInfo.GetDoctorInfo(pclsCache.CacheConnectionObject, DoctorId)[5].ToString(); //DataCheck ZAM 2015-1-7 // //list.Rows.Add(CacheList[0].ToString(), CacheList[1].ToString(), CacheList[2].ToString(), CacheList[3].ToString(), CacheList[4], CacheList[5]); return ret; } catch (Exception ex) { //MessageBox.Show(ex.ToString(), "获取名称失败!"); HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsDoctorInfo.GetDoctorInfo", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace); return null; } finally { pclsCache.DisConnect(); } }
/// <summary> /// GetDoctorInfo返回医生基本信息 ZYF 2014-12-4 //王丰 20151010 /// </summary> /// <param name="pclsCache"></param> /// <param name="DoctorId"></param> /// <returns></returns> public DoctorInfo GetDoctorInfo(DataConnection pclsCache, string DoctorId) { DoctorInfo ret = new DoctorInfo(); try { if (!pclsCache.Connect()) { return null; } InterSystems.Data.CacheTypes.CacheSysList list = null; list = Ps.DoctorInfo.GetDoctorInfo(pclsCache.CacheConnectionObject, DoctorId); if (list != null) { ret.DoctorId = list[0]; ret.DoctorName = list[1]; ret.Birthday = list[2]; ret.Gender = list[3]; ret.IDNo = list[4]; ret.InvalidFlag = list[5]; } //DataCheck ZAM 2015-1-7 return ret; } catch (Exception ex) { //MessageBox.Show(ex.ToString(), "获取名称失败!"); HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UsersMethod.GetDoctorInfo", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace); return null; } finally { pclsCache.DisConnect(); } }
/// <summary> /// 获取健康专员列表 SYF 20151022 /// </summary> /// <param name="pclsCache"></param> /// <returns></returns> public List<HealthCoachList> GetHealthCoachList(DataConnection pclsCache) { List<HealthCoachList> list = new List<HealthCoachList>(); List<ActiveUser> list1 = new List<ActiveUser>(); List<CategoryByDoctorId> list2 = new List<CategoryByDoctorId>(); string moudlecodes = ""; string[] moudlecode = null; //string DoctorId = ""; try { list1 = GetActiveUserByRole(pclsCache, "HealthCoach");//根据角色获取已激活的用户 if (list1 != null) { for (int i = 0; i < list1.Count; i++) { DoctorInfo dcf = new DoctorInfo(); HealthCoachList hcf = new HealthCoachList(); //一次循环取一个健康专员的信息 // DoctorId = list1[i].UserId; dcf = new UsersMethod().GetDoctorInfo(pclsCache, list1[i].UserId);//获取基本信息 hcf.healthCoachID = list1[i].UserId; hcf.name = ""; hcf.sex = ""; hcf.age = ""; if (dcf != null) { hcf.name = dcf.DoctorName; hcf.sex = dcf.Gender; hcf.age = Convert.ToString(new UsersMethod().GetAgeByBirthDay(pclsCache, Convert.ToInt32(dcf.Birthday))); } moudlecodes = new UsersMethod().GetModuleByDoctorId(pclsCache, list1[i].UserId); if (moudlecodes != null) { moudlecode = moudlecodes.Split(new char[] { '_' }); for (int k = 0; k < moudlecode.Length; k++) { if (k == 0) { hcf.module = new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } else { hcf.module = hcf.module + "/" + new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } } } list2 = new UsersMethod().GetCategoryByDoctorId(pclsCache, list1[i].UserId); //获取某个健康专员的所有CategoryCode信息 if (list2 != null) { #region for (int j = 0; j < list2.Count; j++) { if ((list2[j].CategoryCode == "Contact") && (list2[j].ItemCode == "Contact001_4")) { hcf.imageURL = list2[j].Value; } //获取头像 else if ((list2[j].CategoryCode == "Score") && (list2[j].ItemCode == "Score_1")) { hcf.score = list2[j].Value; } //获取该专员总体评分 } #endregion } list.Add(hcf); } } return list; } catch (Exception ex) { HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UserMethod.GetHealthCoachList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace); return null; } finally { pclsCache.DisConnect(); } }