/* * AND * Human Case ID = 'AAA' * Human Case ID = 'BBB' * Exists Human Case Test * AND * Human case Test Type = 6618590000000 ('Anaplasma test') * Human case Test Type <> 6618590000000 ('Anaplasma test') */ private void CreateFilterCondition2(QueryFilterControl filter, ref GroupOperator rootGroup, ref GroupOperator aggrGroup) { CriteriaOperator criteria = filter.FilterCriteria; CreateFilterCondition1(filter, out rootGroup, out aggrGroup); QueryFilterControl.AddFieldOperator(aggrGroup, TestNameAlias, TestNameIdValue, SearchOperator.Binary, BinaryOperatorType.NotEqual, false); filter.FilterCriteria = rootGroup; }
/* * OR * Human Case ID = 'AAA' * Human Case ID = 'BBB' */ private void CreateFilterCondition3(QueryFilterControl filter, out GroupOperator rootGroup) { CriteriaOperator criteria; rootGroup = QueryFilterControl.AddGroupOperator(null, null, null, out criteria); rootGroup.OperatorType = GroupOperatorType.Or; QueryFilterControl.AddFieldOperator(rootGroup, CaseIDAlias, StrValue1, SearchOperator.Binary, BinaryOperatorType.Equal, false); QueryFilterControl.AddFieldOperator(rootGroup, CaseIDAlias, StrValue2, SearchOperator.Binary, BinaryOperatorType.Equal, false); filter.FilterCriteria = criteria; filter.HasChanges = true; }
/* * AND * Human Case ID = 'AAA' * Human Case ID = 'BBB' * Exists Human Case Test * AND * Human case Test Type = 6618590000000 ('Anaplasma test') */ private void CreateFilterCondition1(QueryFilterControl filter, out GroupOperator rootGroup, out GroupOperator aggrGroup) { CriteriaOperator criteria; rootGroup = QueryFilterControl.AddGroupOperator(null, null, null, out criteria); QueryFilterControl.AddFieldOperator(rootGroup, CaseIDAlias, StrValue1, SearchOperator.Binary, BinaryOperatorType.Equal, false); QueryFilterControl.AddFieldOperator(rootGroup, CaseIDAlias, StrValue2, SearchOperator.Binary, BinaryOperatorType.Equal, false); AggregateOperand aggrOp = QueryFilterControl.AddAggregateOperand(rootGroup, "<Human Case Test>", false); CriteriaOperator aggrCriteria; aggrGroup = QueryFilterControl.AddGroupOperator(null, null, null, out aggrCriteria); QueryFilterControl.AddFieldOperator(aggrGroup, TestNameAlias, TestNameIdValue, SearchOperator.Binary, BinaryOperatorType.Equal, false); aggrOp.Condition = aggrCriteria; filter.FilterCriteria = criteria; filter.HasChanges = true; }