/// <summary> /// 检索符合条件的患者就诊信息 /// </summary> /// <param name="szDeptCode">科室代码</param> /// <param name="patientType">患者列表检索方式</param> /// <param name="dtBeginTime">起始时间</param> /// <param name="dtEndTime">截止时间</param> /// <param name="patientListForm">患者列表窗口</param> /// <returns>SystemData.ReturnValue</returns> public short ExecuteSearch(string szDeptCode, EMRDBLib.PatientType patientType, DateTime dtBeginTime, DateTime dtEndTime , PatientListForm patientListForm, EMRDBLib.PatSearchType SearchType, string szOperationCode, MDSDBLib.DocTypeInfo docTypeInfo) { if (patientListForm == null || patientListForm.IsDisposed) { return(SystemData.ReturnValue.FAILED); } if (this.StopThreadsWork() != SystemData.ReturnValue.OK) { return(SystemData.ReturnValue.FAILED); } if (this.m_ThrdList != null && this.m_ThrdList.Count > 0) { this.m_ThrdList.Clear(); } while (dtBeginTime.AddDays(30) < dtEndTime) { this.AddSearchThread(szDeptCode, dtBeginTime, dtBeginTime.AddDays(30), patientType, patientListForm, SearchType, szOperationCode, docTypeInfo); dtBeginTime = dtBeginTime.AddDays(31); } if (dtBeginTime < dtEndTime) { this.AddSearchThread(szDeptCode, dtBeginTime, dtEndTime, patientType, patientListForm, SearchType, szOperationCode, docTypeInfo); } this.StartNextThread(); return(SystemData.ReturnValue.OK); }
public PatSearchCondition(string szThrdName, string szDeptCode, PatientListForm patientListForm, DateTime dtBeginTime , DateTime dtEndTime, EMRDBLib.PatientType patientType, EMRDBLib.PatSearchType patSearchType, string szOperationCode, MDSDBLib.DocTypeInfo docTypeInfo) { this.m_szDeptCode = szDeptCode; this.m_szThreadName = szThrdName; this.m_PatientListForm = patientListForm; this.m_dtBeginTime = dtBeginTime; this.m_dtEndTime = dtEndTime; this.m_PatientType = patientType; this.m_PatSearchType = patSearchType; this.m_szOperationCode = szOperationCode; this.m_DocType = docTypeInfo; }
/// <summary> /// 将线程添加到线程池中 /// </summary> /// <param name="szDeptCode">科室代码</param> /// <param name="dtBeginTime">查询起始时间</param> /// <param name="dtEndTime">查询截止时间</param> /// <param name="patientType">检索方式</param> /// <param name="patientListForm">患者列表检索窗口</param> /// <param name="patSearchType">患者质控方式</param> private void AddSearchThread(string szDeptCode, DateTime dtBeginTime, DateTime dtEndTime, EMRDBLib.PatientType patientType , PatientListForm patientListForm, EMRDBLib.PatSearchType patSearchType, string szOperationCode, MDSDBLib.DocTypeInfo docTypeInfo) { if (this.m_ThrdList == null) { this.m_ThrdList = new ArrayList(); } string szThreadName = "Thread" + (this.m_ThrdList.Count + 1).ToString(); dtEndTime = DateTime.Parse(dtEndTime.ToString("yyyy-M-d 23:59:59")); PatSearchCondition searchConditon = new PatSearchCondition(szThreadName, szDeptCode, patientListForm, dtBeginTime, dtEndTime , patientType, patSearchType, szOperationCode, docTypeInfo); SearchThread searchThread = new SearchThread(); searchThread.Name = szThreadName; searchThread.Thread = null; searchThread.ThreadState = EMRDBLib.SearchThreadState.ready; searchThread.PatSearchCondition = searchConditon; this.m_ThrdList.Add(searchThread); }