Exemple #1
0
        /// <summary>
        /// 初始化质控引擎
        /// </summary>
        /// <returns>DataLayer.SystemData.ReturnValue</returns>
        public short InitializeEngine()
        {
            if (BugCheckRuleManager.RuleTable != null && BugCheckRuleManager.RuleTable.Count > 0)
            {
                return(SystemData.ReturnValue.OK);
            }

            //初始化规则Entry列表
            List <MedQCEntry> lstQCEntryList = null;
            short             shRet          = MedQCEntryAccess.Instance.GetQCEntryList(ref lstQCEntryList);

            if (shRet != SystemData.ReturnValue.OK)
            {
                return(SystemData.ReturnValue.FAILED);
            }
            if (lstQCEntryList == null || lstQCEntryList.Count <= 0)
            {
                return(SystemData.ReturnValue.CANCEL);
            }

            for (int index = 0; index < lstQCEntryList.Count; index++)
            {
                BugCheckEntryManager.AddEntry(this, lstQCEntryList[index]);
            }

            //初始化规则列表
            List <MedQCRule> lstQCRuleList = null;

            shRet = MedQCRuleAccess.Instance.GetQCRuleList(ref lstQCRuleList);
            if (shRet != SystemData.ReturnValue.OK)
            {
                return(SystemData.ReturnValue.FAILED);
            }
            if (lstQCRuleList == null || lstQCRuleList.Count <= 0)
            {
                return(SystemData.ReturnValue.CANCEL);
            }

            for (int index = 0; index < lstQCRuleList.Count; index++)
            {
                BugCheckRuleManager.AddRule(lstQCRuleList[index]);
            }
            return(SystemData.ReturnValue.OK);
        }
Exemple #2
0
 /// <summary>
 /// 执行文档缺陷检查
 /// </summary>
 /// <param name="lstBugList">文档缺陷列表</param>
 /// <returns>DataLayer.SystemData.ReturnValue</returns>
 public List <DocuemntBugInfo> PerformBugCheck()
 {
     BugCheckEntryManager.ComputeEntryOccurCount();
     return(BugCheckRuleManager.ExecuteRule());
 }
Exemple #3
0
 public void Dispose()
 {
     BugCheckEntryManager.Dispose();
     BugCheckRuleManager.Dispose();
 }
Exemple #4
0
        public static void AddRule(MedQCRule medQCRule)
        {
            if (m_htRuleTable == null)
            {
                m_htRuleTable = new Hashtable();
            }

            string       szRuleID = medQCRule.RuleID.Trim();
            BugCheckRule qcRule   = m_htRuleTable[szRuleID] as BugCheckRule;

            if (qcRule == null)
            {
                qcRule        = new BugCheckRule();
                qcRule.RuleID = szRuleID;
                m_htRuleTable.Add(szRuleID, qcRule);
            }
            qcRule.Operator = medQCRule.Operator;
            qcRule.BugKey   = string.Empty;
            qcRule.BugLevel = (BugLevel)medQCRule.BugLevel;
            qcRule.BugDesc  = medQCRule.BugDesc;
            qcRule.Response = medQCRule.Response;

            if (!GlobalMethods.Misc.IsEmptyString(medQCRule.RuleID1))
            {
                string       szSubRule1ID = medQCRule.RuleID1.Trim();
                BugCheckRule qcSubRule1   = m_htRuleTable[szSubRule1ID] as BugCheckRule;
                if (qcSubRule1 == null)
                {
                    qcSubRule1        = new BugCheckRule();
                    qcSubRule1.RuleID = szSubRule1ID;
                    m_htRuleTable.Add(szSubRule1ID, qcSubRule1);
                }
                qcRule.SubRule1 = qcSubRule1;
            }


            if (!GlobalMethods.Misc.IsEmptyString(medQCRule.RuleID2))
            {
                string       szSubRule2ID = medQCRule.RuleID2.Trim();
                BugCheckRule qcSubRule2   = m_htRuleTable[szSubRule2ID] as BugCheckRule;
                if (qcSubRule2 == null)
                {
                    qcSubRule2        = new BugCheckRule();
                    qcSubRule2.RuleID = szSubRule2ID;
                    m_htRuleTable.Add(szSubRule2ID, qcSubRule2);
                }
                qcRule.SubRule2 = qcSubRule2;
            }

            if (!GlobalMethods.Misc.IsEmptyString(medQCRule.EntryID))
            {
                string        szEntryID = medQCRule.EntryID.Trim();
                BugCheckEntry qcEntry   = BugCheckEntryManager.GetEntry(szEntryID);
                if (qcEntry == null)
                {
                    return;
                }
                qcRule.RuleEntry = qcEntry;
            }

            if (!GlobalMethods.Misc.IsEmptyString(medQCRule.RefRuleID))
            {
                string       szResultRuleID = medQCRule.RefRuleID.Trim();
                BugCheckRule qcResultRule   = m_htRuleTable[szResultRuleID] as BugCheckRule;
                if (qcResultRule == null)
                {
                    qcResultRule        = new BugCheckRule();
                    qcResultRule.RuleID = szResultRuleID;
                    m_htRuleTable.Add(szResultRuleID, qcResultRule);
                }
                qcRule.RefRule = qcResultRule;
            }
        }