public void TestShouldMatchLinq() { ProtocolWhenClauseCollection when = new ProtocolWhenClauseCollection() { Clause = new List <object>() { "!_.Target.DeceasedDate.HasValue" } }; Assert.IsFalse(when.Evaluate(new CdssContext <Patient>(this.m_patientUnderTest))); }
public void TestShouldMatchLinq() { ProtocolWhenClauseCollection when = new ProtocolWhenClauseCollection() { Clause = new List <object>() { "!DeceasedDate.HasValue" } }; Assert.IsFalse(when.Evaluate(this.m_patientUnderTest, new Dictionary <string, Delegate>())); }
public void TestShouldMatchSimpleXmlLinq() { Expression <Func <Patient, bool> > filterCondition = (data) => data.DeceasedDate == null; ProtocolWhenClauseCollection when = new ProtocolWhenClauseCollection() { Clause = new List <Object>() { XmlExpression.FromExpression(filterCondition) } }; Assert.IsFalse(when.Evaluate(this.m_patientUnderTest, new Dictionary <string, Delegate>())); }
public void TestShouldMatchSimpleXmlLinq() { Expression <Func <CdssContext <Patient>, bool> > filterCondition = (data) => data.Target.DeceasedDate == null; ProtocolWhenClauseCollection when = new ProtocolWhenClauseCollection() { Clause = new List <Object>() { XmlExpression.FromExpression(filterCondition) } }; Assert.IsFalse(when.Evaluate(new CdssContext <Patient>(this.m_patientUnderTest))); }
public void TestShouldMatchSimpleImsi() { ProtocolWhenClauseCollection when = new ProtocolWhenClauseCollection() { Clause = new List <Object>() { new WhenClauseImsiExpression() { Expression = "deceasedDate=null" } } }; Assert.IsFalse(when.Evaluate(this.m_patientUnderTest, new Dictionary <string, Delegate>())); }
public void TestShouldMatchSimpleHdsi() { ProtocolWhenClauseCollection when = new ProtocolWhenClauseCollection() { Clause = new List <Object>() { new WhenClauseHdsiExpression() { Expression = "deceasedDate=null" } } }; Assert.IsFalse(when.Evaluate(new CdssContext <Patient>(this.m_patientUnderTest))); }
public void TestShouldMatchAllCondition() { Expression <Func <Patient, bool> > filterCondition = (data) => data.DateOfBirth <= DateTime.Now; ProtocolWhenClauseCollection when = new ProtocolWhenClauseCollection() { Operator = BinaryOperatorType.AndAlso, Clause = new List <Object>() { XmlExpression.FromExpression(filterCondition), new WhenClauseImsiExpression() { Expression = "tag[hasBirthCertificate].value=true" }, "StatusConceptKey.Value == Guid.Parse(\"" + StatusKeys.Active + "\")" } }; Assert.IsTrue(when.Evaluate(this.m_patientUnderTest, new Dictionary <string, Delegate>())); when.Clause.Add("Tags.Count == 0"); when.Compile <Patient>(new Dictionary <string, Delegate>()); Assert.IsFalse(when.Evaluate(this.m_patientUnderTest, new Dictionary <string, Delegate>())); }