コード例 #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);
        }