/// <summary> /// 获取某专员相关信息 SYF 20151022 /// </summary> /// <param name="pclsCache"></param> /// <param name="HealthCoachID"></param> /// <returns></returns> public HealthCoachInfo GetHealthCoachInfo(DataConnection pclsCache, string HealthCoachID) { HealthCoachInfo ret = new HealthCoachInfo(); try { DoctorInfo ret1 = GetDoctorInfo(pclsCache, HealthCoachID);//获取基本信息 ret.name = ""; ret.sex = ""; ret.age = ""; if (ret1 != null) { ret.name = ret1.DoctorName; ret.sex = ret1.Gender; ret.age = Convert.ToString(new UsersMethod().GetAgeByBirthDay(pclsCache, Convert.ToInt32(ret1.Birthday))); } string moudlecodes = ""; string[] moudlecode = null; moudlecodes = new UsersMethod().GetModuleByDoctorId(pclsCache, HealthCoachID); if (moudlecodes != null) { moudlecode = moudlecodes.Split(new char[] { '_' }); for (int k = 0; k < moudlecode.Length; k++) { if (k == 0) { ret.module = new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } else { ret.module = ret.module + "/" + new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } } } GetDoctorInfoDetail ret2 = new GetDoctorInfoDetail(); ret2 = new UsersMethod().GetDoctorInfoDetail(pclsCache, HealthCoachID); if (ret2 != null) { ret.imageURL = ret2.PhotoAddress; ret.generalscore = Math.Round(Convert.ToDouble(ret2.GeneralScore), 1).ToString(); //ret.generalscore = Double.Parse(ret2.GeneralScore).ToString("F1"); ret.activityDegree = ret2.ActivityDegree; ret.generalComment = ret2.GeneralComment; ret.commentNum = ret2.commentNum; ret.Description = ret2.Description; ret.UnitName = ret2.UnitName; ret.UnitCode = ret2.UnitCode; ret.Dept = ret2.DeptName; ret.DeptCode = ret2.DeptCode; ret.JobTitle = ret2.JobTitle; ret.Level = ret2.Level; ret.AssessmentNum = ret2.AssessmentNum; ret.MSGNum = ret2.MSGNum; ret.AppointmentNum = ret2.AppointmentNum; ret.Activedays = ret2.Activedays; } ret.PatientNum = GetPatientNumByDoctorId(pclsCache, HealthCoachID); //管理病人数量 ret.OnPlanPatientNum = GetOnPlanPatientNumByDoctorId(pclsCache, HealthCoachID); //管理病人中有正在计划的人数量 ret.DoneCalendarNum = 0; List<Calendar> ListCal = new List<Calendar>(); ListCal = GetCalendar(pclsCache, HealthCoachID); if(ListCal != null) { for (int Cali = 0; Cali < ListCal.Count; Cali++) { if(ListCal[Cali].Status == 2) { ret.DoneCalendarNum++; } } } 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 20151112 /// </summary> /// <param name="pclsCache"></param> /// <param name="UserId"></param> /// <returns></returns> public GetDoctorInfoDetail GetDoctorInfoDetail(DataConnection pclsCache, string UserId) { GetDoctorInfoDetail ret = new GetDoctorInfoDetail(); try { if (!pclsCache.Connect()) { return ret; } InterSystems.Data.CacheTypes.CacheSysList list = null; list = Ps.DoctorInfoDetail.GetDoctorInfoDetail(pclsCache.CacheConnectionObject, UserId); if (list != null) { ret.IDNo = list[0]; ret.PhotoAddress = list[1]; ret.UnitName = list[2]; ret.JobTitle = list[3]; ret.Level = list[4]; ret.Dept = list[5]; ret.ActivatePhotoAddr = list[6]; ret.DeptName = list[7]; ret.GeneralScore = list[8]; ret.ActivityDegree = list[9]; ret.GeneralComment = list[10]; ret.commentNum = list[11]; ret.Description = list[12]; ret.AssessmentNum = Convert.ToInt32(list[13]); ret.MSGNum = Convert.ToInt32(list[14]); ret.AppointmentNum = Convert.ToInt32(list[15]); ret.Activedays = Convert.ToInt32(list[16]); ret.UnitCode = list[17]; ret.DeptCode = list[18]; } //DataCheck ZAM 2015-1-7 return ret; } catch (Exception ex) { HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UsersMethod.GetPatientDetailInfo", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace); return ret; } 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>(); 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(); } }