コード例 #1
0
        public static void AddEntry(BugCheckEngine qcEngine, MedQCEntry medQCEntry)
        {
            if (qcEngine == null || medQCEntry == null)
            {
                return;
            }
            BugCheckEntry qcEntry = new BugCheckEntry();

            qcEntry.EntryID    = medQCEntry.EntryID;
            qcEntry.EntryName  = medQCEntry.EntryName;
            qcEntry.EntryType  = medQCEntry.EntryType;
            qcEntry.EntryDesc  = medQCEntry.EntryDesc;
            qcEntry.Operator   = medQCEntry.Operator;
            qcEntry.EntryValue = medQCEntry.EntryValue;
            qcEntry.ValueType  = medQCEntry.ValueType;
            qcEntry.OccurCount = 0;

            string szEntryType = qcEntry.EntryType.ToUpper();

            if (szEntryType == SystemData.QCRule.ENTRY_TYPE_DOCUMENT)
            {
                if (m_htEntryHandlerTable == null)
                {
                    m_htEntryHandlerTable = new Hashtable();
                }
                DocumentEntryHanlder documentEntryHandler = m_htEntryHandlerTable[szEntryType] as DocumentEntryHanlder;
                if (documentEntryHandler == null)
                {
                    documentEntryHandler = new DocumentEntryHanlder(qcEngine);
                    m_htEntryHandlerTable.Add(szEntryType, documentEntryHandler);
                }
                documentEntryHandler.AddEntry(qcEntry);
            }
            else if (szEntryType == SystemData.QCRule.ENTRY_TYPE_REFLECTION)
            {
                if (m_htEntryHandlerTable == null)
                {
                    m_htEntryHandlerTable = new Hashtable();
                }
                ReflectionEntryHandler reflectionEntryHandler = m_htEntryHandlerTable[szEntryType] as ReflectionEntryHandler;
                if (reflectionEntryHandler == null)
                {
                    reflectionEntryHandler = new ReflectionEntryHandler(qcEngine);
                    m_htEntryHandlerTable.Add(szEntryType, reflectionEntryHandler);
                }
                reflectionEntryHandler.AddEntry(qcEntry);
            }
        }
コード例 #2
0
        /// <summary>
        /// 获取文档质控规则Entry列表
        /// </summary>
        /// <param name="lstQCEntrys">质控规则Entry列表</param>
        /// <returns>SystemData.ReturnValue</returns>
        public short GetQCEntryList(ref List <MedQCEntry> lstQCEntrys)
        {
            if (base.MeddocAccess == null)
            {
                return(SystemData.ReturnValue.PARAM_ERROR);
            }

            string szField = string.Format("{0},{1},{2},{3},{4},{5},{6}"
                                           , SystemData.QCEntryTable.ENTRY_ID, SystemData.QCEntryTable.ENTRY_NAME, SystemData.QCEntryTable.ENTRY_TYPE
                                           , SystemData.QCEntryTable.ENTRY_DESC, SystemData.QCEntryTable.OPERATOR, SystemData.QCEntryTable.ENTRY_VALUE
                                           , SystemData.QCEntryTable.VALUE_TYPE);
            string szSQL = string.Format(SystemData.SQL.SELECT_FROM, szField, SystemData.DataTable.QC_ENTRY);

            IDataReader dataReader = null;

            try
            {
                dataReader = base.MeddocAccess.ExecuteReader(szSQL, CommandType.Text);
                if (dataReader == null || dataReader.IsClosed || !dataReader.Read())
                {
                    return(SystemData.ReturnValue.RES_NO_FOUND);
                }
                if (lstQCEntrys == null)
                {
                    lstQCEntrys = new List <MedQCEntry>();
                }
                do
                {
                    MedQCEntry clsQCEntry = new MedQCEntry();
                    clsQCEntry.EntryID    = dataReader.GetString(0).Trim();
                    clsQCEntry.EntryName  = dataReader.GetString(1).Trim();
                    clsQCEntry.EntryType  = dataReader.GetString(2).Trim();
                    clsQCEntry.EntryDesc  = dataReader.GetString(3).Trim();
                    clsQCEntry.Operator   = dataReader.GetString(4).Trim();
                    clsQCEntry.EntryValue = dataReader.GetString(5).Trim();
                    clsQCEntry.ValueType  = dataReader.GetString(6).Trim();
                    lstQCEntrys.Add(clsQCEntry);
                } while (dataReader.Read());
                return(SystemData.ReturnValue.OK);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog("MedQCAccess.GetQCEntryList", new string[] { "szSQL" }, new object[] { szSQL }, ex);
                return(SystemData.ReturnValue.EXCEPTION);
            }
            finally { base.MeddocAccess.CloseConnnection(false); }
        }