本文整理汇总了C#中Hl7.Fhir.Model.Query类的典型用法代码示例。如果您正苦于以下问题:C# Query类的具体用法?C# Query怎么用?C# Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Query类属于Hl7.Fhir.Model命名空间,在下文中一共展示了Query类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ChainWithModifierToStringExact_FindsResourceOnExactValue
public void ChainWithModifierToStringExact_FindsResourceOnExactValue()
{
var q = new Query().For("Patient").Where("given=nancy").Where("provider:Organization.name:exact=Health Level Seven International");
var results = index.Search(q);
//results = index.Search("Patient", "given=\"ned\"&provider:Organization.name:exact=\"Health Level Seven International\"");
Assert.IsTrue(results.Count == 1);
}
开发者ID:richardschneider,项目名称:spark,代码行数:7,代码来源:FhirIndexTest.cs
示例2: ChainWithModifierToString_FindsResourceOnFirstPartOfValue
public void ChainWithModifierToString_FindsResourceOnFirstPartOfValue()
{
var q = new Query().For("Patient").Where("given=nancy").Where("provider:Organization.name=health");
var results = index.Search(q);
//results = index.Search("Patient", "given=\"nancy\"&provider:Organization.name:partial=\"health\"");
Assert.IsTrue(results.Count == 1);
}
开发者ID:richardschneider,项目名称:spark,代码行数:7,代码来源:FhirIndexTest.cs
示例3: ChainWithModifierToString_DoesNotFindResourceOnWronglySpelledValue
public void ChainWithModifierToString_DoesNotFindResourceOnWronglySpelledValue()
{
var q = new Query().For("Patient").Where("given=nancy").Where("provider:Organization.name=healthy");
var results = index.Search(q);
//results = index.Search("Patient", "given=\"ned\"&provider:Organization.name:partial=\"healthy\"");
Assert.IsTrue(results.Count == 0);
}
开发者ID:richardschneider,项目名称:spark,代码行数:7,代码来源:FhirIndexTest.cs
示例4: String_FindsResourceOnExactValue
public void String_FindsResourceOnExactValue()
{
// Default search = partial from the start
var q = new Query().For("Patient").Where("family=Mckinney");
var r = index.Search(q);
Assert.IsTrue(r.Has("Patient/76"));
}
开发者ID:TonyAbell,项目名称:spark,代码行数:7,代码来源:FhirIndexTest.cs
示例5: String_IgnoresAndReportsInvalidOperator
public void String_IgnoresAndReportsInvalidOperator()
{
var q = new Query().For("Patient").Where("family=>Mckinney");
var r = index.Search(q);
Assert.IsTrue(r.HasIssues);
Assert.AreEqual(String.Empty, r.UsedCriteria);
Assert.IsTrue(r.Count > 0); //All Patient resources should be found.
}
开发者ID:TonyAbell,项目名称:spark,代码行数:8,代码来源:FhirIndexTest.cs
示例6: RetrieveCriteria
public void RetrieveCriteria()
{
var q = new Query()
.For("Patient").Where("name:exact=ewout").OrderBy("birthDate", SortOrder.Descending)
.SummaryOnly().Include("Patient.managingOrganization")
.LimitTo(20);
Assert.AreEqual(1, q.Criteria.Count());
Assert.AreEqual("ewout", Query.ExtractParamValue(q.Criteria.First()));
}
开发者ID:ranjancse26,项目名称:fhir-net-api,代码行数:9,代码来源:QueryTests.cs
示例7: Load
internal static Query Load (String resource, IEnumerable<Tuple<String, String>> parameters)
{
Query result = new Query();
result.ResourceType = resource;
foreach (var p in parameters)
{
result.AddParameter(p.Item1, p.Item2);
};
return result;
}
开发者ID:jamesagnew,项目名称:fhir-net-api,代码行数:10,代码来源:QueryParser.cs
示例8: ReapplySingleParam
public void ReapplySingleParam()
{
var q = new Query()
.Custom("mySearch").OrderBy("adsfadf").OrderBy("q", SortOrder.Descending)
.LimitTo(10).LimitTo(20).Custom("miSearch").SummaryOnly().SummaryOnly(false);
Assert.AreEqual("miSearch", q.QueryName);
Assert.IsFalse(q.Summary);
var o = q.Sort;
Assert.AreEqual("q", o.Item1);
Assert.AreEqual(SortOrder.Descending, o.Item2);
Assert.AreEqual(20, q.Count);
Assert.IsFalse(q.Summary);
}
开发者ID:jamesagnew,项目名称:fhir-net-api,代码行数:17,代码来源:QueryExtensionTests.cs
示例9: ManipulateParameters
public void ManipulateParameters()
{
var q = new Query();
q.AddParameter("testX", "someVal");
q.AddParameter("testX", "someVal2");
q.AddParameter("testXY", "someVal3");
var vals = q.GetValues("testX");
Assert.AreEqual(2, vals.Count());
Assert.AreEqual("someVal", vals.First());
Assert.AreEqual("someVal2", vals.Skip(1).First());
Assert.AreEqual("someVal3", q.GetSingleValue("testXY"));
q.RemoveParameter("testXY");
Assert.IsNull(q.GetSingleValue("testXY"));
Assert.AreEqual(2, q.GetValues("testX").Count());
}
开发者ID:jmandel,项目名称:fhir-with-ivy-dependencies,代码行数:18,代码来源:QueryTests.cs
示例10: Search
public static RestUrl Search(this RestUrl url, Query q)
{
// The ResourceType is the only parameter that needs special handling,
// since the others are all "normal" parameters. Just make sure we don't
// include the special _type parameter on the REST url
var result = url.Search(q.ResourceType);
foreach (var par in q.Parameter)
{
var paramKey = Query.ExtractParamKey(par);
if (paramKey != Query.SEARCH_PARAM_TYPE)
{
result.AddParam(Query.ExtractParamKey(par),
Query.ExtractParamValue(par));
}
}
return result;
}
开发者ID:jamesagnew,项目名称:fhir-net-api,代码行数:19,代码来源:RestUrlOperationExtensions.cs
示例11: TestProperties
public void TestProperties()
{
var q = new Query();
q.QueryName = "special";
q.ResourceType = "Patient";
q.Count = 31;
q.Summary = true;
q.Sort = Tuple.Create("sorted", SortOrder.Descending);
q.Includes.Add("Patient.name");
q.Includes.Add("Observation.subject");
Assert.AreEqual("special", q.QueryName);
Assert.AreEqual("Patient", q.ResourceType);
Assert.AreEqual(31, q.Count);
Assert.AreEqual(true, q.Summary);
Assert.AreEqual(Tuple.Create("sorted", SortOrder.Descending), q.Sort);
Assert.AreEqual(2, q.Includes.Count);
Assert.AreEqual("Patient.name", q.Includes.First());
Assert.AreEqual("Observation.subject", q.Includes.Skip(1).First());
q.QueryName = "special2";
q.ResourceType = "Observation";
q.Count = 32;
q.Summary = false;
q.Sort = Tuple.Create("sorted2", SortOrder.Ascending);
q.Includes.Add("Patient.name2");
q.Includes.Remove("Patient.name");
q.Includes.Add("Observation.subject2");
Assert.AreEqual("special2", q.QueryName);
Assert.AreEqual("Observation", q.ResourceType);
Assert.AreEqual(32, q.Count);
Assert.AreEqual(false, q.Summary);
Assert.AreEqual(Tuple.Create("sorted2", SortOrder.Ascending), q.Sort);
Assert.AreEqual(3, q.Includes.Count);
Assert.IsTrue(q.Includes.Contains("Patient.name2"));
Assert.IsFalse(q.Includes.Contains("Patient.name"));
Assert.IsTrue(q.Includes.Contains("Observation.subject"));
Assert.IsTrue(q.Includes.Contains("Observation.subject2"));
}
开发者ID:jmandel,项目名称:fhir-with-ivy-dependencies,代码行数:41,代码来源:QueryTests.cs
示例12: ManageSearchResult
public void ManageSearchResult()
{
var q = new Query()
.For("Patient").Where("name:exact=ewout").OrderBy("birthDate", SortOrder.Descending)
.SummaryOnly().Include("Patient.managingOrganization")
.LimitTo(20);
var x = FhirSerializer.SerializeResourceToXml(q);
Console.WriteLine(x);
Assert.AreEqual("Patient", q.ResourceType);
var p = q.Parameter.SingleWithName("name");
Assert.AreEqual("name:exact", Query.ExtractParamKey(p));
Assert.AreEqual("ewout", Query.ExtractParamValue(p));
var o = q.Sort;
Assert.AreEqual("birthDate", o.Item1);
Assert.AreEqual(SortOrder.Descending, o.Item2);
Assert.IsTrue(q.Summary);
Assert.IsTrue(q.Includes.Contains("Patient.managingOrganization"));
Assert.AreEqual(20,q.Count);
}
开发者ID:jamesagnew,项目名称:fhir-net-api,代码行数:24,代码来源:QueryExtensionTests.cs
示例13: ChainWithModifierToToken_FindsResourceOnTokenCode
public void ChainWithModifierToToken_FindsResourceOnTokenCode()
{
// THE WORKS
var q = new Query().For("Condition").Where("subject.identifier=12345");
var results = index.Search(q);
//results = index.Search("Condition", "subject.identifier=12345");
Assert.IsTrue(results.Count >= 2);
Assert.IsTrue(results.Has("Condition/example"));
Assert.IsTrue(results.Has("Condition/example2"));
}
开发者ID:richardschneider,项目名称:spark,代码行数:10,代码来源:FhirIndexTest.cs
示例14: StringExact_DoesNotFindResourceOnValueWithDifferentCapitalization
public void StringExact_DoesNotFindResourceOnValueWithDifferentCapitalization()
{
var q = new Query().For("Patient").Where("family:exact=McKinney");
var r = index.Search(q);
Assert.IsFalse(r.Has("Patient/76"));
}
开发者ID:richardschneider,项目名称:spark,代码行数:6,代码来源:FhirIndexTest.cs
示例15: StringExact_FindsResourceOnExactValue
public void StringExact_FindsResourceOnExactValue()
{
var q = new Query().For("Patient").Where("family:exact=Mckinney");
var r = index.Search(q);
Assert.IsTrue(r.Has("Patient/76"));
}
开发者ID:richardschneider,项目名称:spark,代码行数:6,代码来源:FhirIndexTest.cs
示例16: String_DoesNotFindResourceOnMiddlePartOfValue
public void String_DoesNotFindResourceOnMiddlePartOfValue()
{
var q = new Query().For("Patient").Where("family=kinne");
var r = index.Search(q);
Assert.IsFalse(r.Has("Patient/76"));
}
开发者ID:richardschneider,项目名称:spark,代码行数:6,代码来源:FhirIndexTest.cs
示例17: TripleChainToString_FindsResourceOnExactValue
public void TripleChainToString_FindsResourceOnExactValue()
{
var q = new Query().For("CarePlan").Where("condition.asserter.provider.name=Gastroenterology");
var results = index.Search(q);
Assert.AreEqual(1, results.Count);
//TODO: Resulting query is OK, but there is no matching data in the examples. Find an example that does return a result.
}
开发者ID:richardschneider,项目名称:spark,代码行数:8,代码来源:FhirIndexTest.cs
示例18: String_FindsResourceOnTwoExactValues
public void String_FindsResourceOnTwoExactValues()
{
var q = new Query().For("Patient").Where("given=nancy").Where("family=nuclear");
var results = index.Search(q);
//results = index.Search("Patient", "given=\"nancy\"&family=\"nuclear\"");
Assert.IsTrue(results.Count == 1);
}
开发者ID:richardschneider,项目名称:spark,代码行数:7,代码来源:FhirIndexTest.cs
示例19: Reference_FindsResourceOnValidId
public void Reference_FindsResourceOnValidId()
{
var q = new Query().For("Patient").Where("given=ned").Where("provider=Organization/hl7");
var results = index.Search(q);
Assert.AreEqual(1, results.Count);
}
开发者ID:richardschneider,项目名称:spark,代码行数:6,代码来源:FhirIndexTest.cs
示例20: Token_FindsResourceOnNamespaceAndCode
public void Token_FindsResourceOnNamespaceAndCode()
{
var q = new Query().For("Practitioner").Where("gender=urn:oid:2.16.840.1.113883.4.642.1.24|F");
var results = index.Search(q);
Assert.IsTrue(results.Has("Practitioner/f005"));
}
开发者ID:richardschneider,项目名称:spark,代码行数:6,代码来源:FhirIndexTest.cs
注:本文中的Hl7.Fhir.Model.Query类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论