/// <summary> /// 把就诊信息对象转换成就诊信息字符串 /// </summary> /// <param name="visitInfo">就诊信息对象</param> /// <param name="szSplitChar">就诊信息字符串</param> /// <returns>string</returns> public static string GetStrFromVisitInfo(VisitInfo visitInfo, string szSplitChar) { if (visitInfo == null) { visitInfo = new VisitInfo(); } StringBuilder sbVisitInfo = new StringBuilder(); sbVisitInfo.Append(visitInfo.ID); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.InpID); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(((int)visitInfo.Type).ToString()); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.Time); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.DeptCode); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.DeptName); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.WardCode); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.WardName); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.CareCode); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.CareName); sbVisitInfo.Append(szSplitChar); sbVisitInfo.Append(visitInfo.BedCode); sbVisitInfo.Append(szSplitChar); return(sbVisitInfo.ToString()); }
/// <summary> /// 获取就诊类型对应的所写 /// </summary> /// <returns></returns> public static string GetVisitTypeStr(VisitInfo visitInfo) { if (visitInfo == null) { return(SystemData.VisitType.IP); } if (visitInfo.Type == VisitType.OP || visitInfo.Type == VisitType.EP) { return(SystemData.VisitType.OP); } else { return(SystemData.VisitType.IP); } }
public object Clone() { VisitInfo visitInfo = new VisitInfo(); visitInfo.ID = this.m_szID; visitInfo.InpID = this.m_szInpID; visitInfo.Type = this.m_eType; visitInfo.Time = this.m_dtTime; visitInfo.DeptCode = this.m_szDeptCode; visitInfo.DeptName = this.m_szDeptName; visitInfo.WardCode = this.m_szWardCode; visitInfo.WardName = this.m_szWardName; visitInfo.CareCode = this.m_szCareCode; visitInfo.CareName = this.m_szCareName; visitInfo.BedCode = this.m_szBedCode; return(visitInfo); }
/// <summary> /// 比较两个VisitInfo对象 /// </summary> /// <param name="clsVisitInfo">比较的VisitInfo对象</param> /// <returns>bool</returns> public bool Equals(VisitInfo clsVisitInfo) { if (clsVisitInfo == null) { return(false); } return((this.m_szID == clsVisitInfo.ID) && (this.m_szInpID == clsVisitInfo.InpID) && (this.m_eType == clsVisitInfo.Type) && (DateTime.Compare(this.m_dtTime, clsVisitInfo.Time) == 0) && (this.m_szDeptCode == clsVisitInfo.DeptCode) && (this.m_szDeptName == clsVisitInfo.DeptName) && (this.m_szWardCode == clsVisitInfo.WardCode) && (this.m_szWardName == clsVisitInfo.WardName) && (this.m_szBedCode == clsVisitInfo.BedCode) && (this.m_szCareCode == clsVisitInfo.CareCode) && (this.m_szCareName == clsVisitInfo.CareName)); }
/// <summary> /// 验证VisitInfo数据的合法性(抛出异常信息) /// </summary> public static void Validate(VisitInfo visitInfo) { if (visitInfo == null) { throw new Exception("病人就诊信息数据不能为空!"); } if (GlobalMethods.Misc.IsEmptyString(visitInfo.ID)) { throw new Exception("病人就诊ID参数不能为空!"); } if (GlobalMethods.Misc.IsEmptyString(visitInfo.DeptCode)) { throw new Exception("病人就诊科室代码参数不能为空!"); } if (GlobalMethods.Misc.IsEmptyString(visitInfo.DeptName)) { throw new Exception("病人就诊科室名称参数不能为空!"); } }
/// <summary> /// 把字符串表达的就诊信息转换为就诊信息对象 /// </summary> /// <param name="szVisitData">字符串表达的就诊信息</param> /// <param name="szSplitChar">分隔符</param> /// <returns>就诊信息对象</returns> public static VisitInfo GetVisitInfoFromStr(string szVisitData, string szSplitChar) { VisitInfo visitInfo = new VisitInfo(); string[] arrVisitData = szVisitData.Split(new string[] { szSplitChar }, StringSplitOptions.None); if (arrVisitData.Length > 0) { visitInfo.ID = arrVisitData[0]; } if (arrVisitData.Length > 1) { visitInfo.InpID = arrVisitData[1]; } if (arrVisitData.Length > 2) { VisitType eType = VisitType.OP; if (!VisitInfo.GetTypeEnum(arrVisitData[2], ref eType)) { throw new Exception("就诊类型参数非法!"); } visitInfo.Type = eType; } if (arrVisitData.Length > 3) { try { visitInfo.Time = DateTime.Parse(arrVisitData[3]); } catch (Exception ex) { LogManager.Instance.WriteLog("VisitInfo.GetVisitInfoFromStr", new string[] { "szVisitData" } , new object[] { szVisitData }, ex); throw new Exception("就诊时间参数非法!"); } } if (arrVisitData.Length > 4) { visitInfo.DeptCode = arrVisitData[4]; } if (arrVisitData.Length > 5) { visitInfo.DeptName = arrVisitData[5]; } if (arrVisitData.Length > 6) { visitInfo.WardCode = arrVisitData[6]; } if (arrVisitData.Length > 7) { visitInfo.WardName = arrVisitData[7]; } if (arrVisitData.Length > 8) { visitInfo.CareCode = arrVisitData[8]; } if (arrVisitData.Length > 9) { visitInfo.CareName = arrVisitData[9]; } if (arrVisitData.Length > 10) { visitInfo.BedCode = arrVisitData[10]; } return(visitInfo); }