/// <summary> /// 调用推理引擎进行推理 /// </summary> /// <param name="oRoles"></param> /// <param name="lstDataModelForIE"></param> /// <param name="oIEOutputInfo"></param> /// <returns></returns> public static bool BeginInference( vMRClsDef.Role oRoles, List <vMRClsDef.DataModel> lstDataModelForIE, ref vMRClsDef.OutputInfo oIEOutputInfo) { ForwardsInference(oRoles, lstDataModelForIE, ref oIEOutputInfo); BackwardsInference(); return(true); }
/// <summary> /// 根据User角色选择Rule Level /// </summary> /// <param name="oRoles"></param> /// <returns></returns> public static string ChooseRuleLevelWithRole(vMRClsDef.Role oRoles) { string strRoleLevel = oRoles.oClinician.strClinicianLevel; switch (strRoleLevel) { default: //根据角色选择规则 return("LEVEL_CLINICIANS"); } }
/// <summary> /// 正向推理 /// </summary> /// <param name="oRoles"></param> /// <param name="lstDataModelForIE"></param> /// <param name="oIEOutputInfo"></param> /// <returns></returns> public static bool ForwardsInference( vMRClsDef.Role oRoles, List <vMRClsDef.DataModel> lstDataModelForIE, ref vMRClsDef.OutputInfo oIEOutputInfo) { string strRuleLevel = ChooseRuleLevelWithRole(oRoles); if (strRuleLevel != string.Empty) { return(ReasonWithCLIPSEngine(strRuleLevel, lstDataModelForIE, ref oIEOutputInfo)); } else { return(false); } }
/// <summary> /// 设置需要推理的事件 /// </summary> /// <param name="lstCDSSEvent"></param> /// <returns></returns> public static bool SetInferenceNeededEvents(List <FunctionTypeDef.EventModels> lstCDSSEvents) { ClearIEInAndOut(); vMRClsDef.Role oRole = new vMRClsDef.Role(); oRole.oClinician.strClinicianLevel = GlobalData.UserInfo.UserID; oRole.oPatient.strPatName = GlobalData.PatBasicInfo.Name; oRole.oPatient.strPatID = GlobalData.PatBasicInfo.Identity; oRole.oPatient.dtPatBirthday = GlobalData.PatBasicInfo.Birthday; oRole.oPatient.strPatSex = GlobalData.PatBasicInfo.Sex; for (int i = 0; i < lstCDSSEvents.Count; i++) { vMRClsDef.InputDataModel oInputDataModel = new vMRClsDef.InputDataModel(); oInputDataModel.oTriggeringEvent.oEvent.strEventName = lstCDSSEvents[i].strEventENName; oInputDataModel.oTriggeringEvent.oDisease.strDiseaseCNName = lstCDSSEvents[i].oDisease.strDiseaseCNName; oInputDataModel.oTriggeringEvent.m_emInferenceType = DataMapper.MapInferTypeFuntionDeftovMR(lstCDSSEvents[i].em_InferneceType); oInputDataModel.oTriggeringEvent.m_emInferenceResultType = DataMapper.MapInferResultTypeFuntiontovMR(lstCDSSEvents[i].em_InferenceResultType); if (lstCDSSEvents[i].em_InferenceResultType == FunctionTypeDef.EnumInferenceResultType.DIAGNOSIS) { oDiagnoseIEvMRInput.oRoles = oRole; oDiagnoseIEvMRInput.lstInputDataModel.Add(oInputDataModel); } else if (lstCDSSEvents[i].em_InferenceResultType == FunctionTypeDef.EnumInferenceResultType.THERAPY) { oTherpayIEvMRInput.oRoles = oRole; oTherpayIEvMRInput.lstInputDataModel.Add(oInputDataModel); } else if (lstCDSSEvents[i].em_InferenceResultType == FunctionTypeDef.EnumInferenceResultType.SELFMONITOR) { oSelfMonitorIEvMRInput.oRoles = oRole; oSelfMonitorIEvMRInput.lstInputDataModel.Add(oInputDataModel); } else if (lstCDSSEvents[i].em_InferenceResultType == FunctionTypeDef.EnumInferenceResultType.MSEVALUATION) { oMSEvaluationIEvMRInput.oRoles = oRole; oMSEvaluationIEvMRInput.lstInputDataModel.Add(oInputDataModel); } else if (lstCDSSEvents[i].em_InferenceResultType == FunctionTypeDef.EnumInferenceResultType.RISKEVALUATION) { oRiskEvaluationIEvMRInput.oRoles = oRole; oRiskEvaluationIEvMRInput.lstInputDataModel.Add(oInputDataModel); } else if (lstCDSSEvents[i].em_InferenceResultType == FunctionTypeDef.EnumInferenceResultType.DIETARY) { oDietaryIEvMRInput.oRoles = oRole; oDietaryIEvMRInput.lstInputDataModel.Add(oInputDataModel); } else if (lstCDSSEvents[i].em_InferenceResultType == FunctionTypeDef.EnumInferenceResultType.PHYSICALACTIVITY) { oPhysicalActivityIEvMRInput.oRoles = oRole; oPhysicalActivityIEvMRInput.lstInputDataModel.Add(oInputDataModel); } } return(true); }