本文整理汇总了C#中Hl7.Fhir.Model.Bundle.FindEntry方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.FindEntry方法的具体用法?C# Bundle.FindEntry怎么用?C# Bundle.FindEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hl7.Fhir.Model.Bundle
的用法示例。
在下文中一共展示了Bundle.FindEntry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResourceListFiltering
public void ResourceListFiltering()
{
var testBundle = new Bundle();
testBundle.Entry.Add(new Bundle.BundleEntryComponent { Resource = new Patient { Id = "1234", Meta = new Meta { VersionId = "v2" } } });
testBundle.Entry.Add(new Bundle.BundleEntryComponent { Resource = new Patient { Id = "1234", Meta = new Meta { VersionId = "v3" } } });
testBundle.Entry.Add(new Bundle.BundleEntryComponent { Resource = new Patient { Id = "1234", Meta = new Meta { VersionId = "v4"} },
Transaction = new Bundle.BundleEntryTransactionComponent {Method = Bundle.HTTPVerb.DELETE} });
testBundle.Entry.Add(new Bundle.BundleEntryComponent { Resource = new Patient { Id = "5678" }, Base = "http://server1.com/fhir" });
testBundle.Entry.Add(new Bundle.BundleEntryComponent { Resource = new Patient { Id = "1.2.3.4.5" }, Base = "urn:oid:" });
var result = testBundle.FindEntry("Patient", "1234");
Assert.AreEqual(2, result.Count());
result = testBundle.FindEntry("Patient", "1234", includeDeleted: true);
Assert.AreEqual(3, result.Count());
result = testBundle.FindEntry("Patient", "1234", "v3", includeDeleted: true);
Assert.AreEqual(1, result.Count());
result = testBundle.FindEntry(new Uri("http://server3.org/fhir/Patient/1234"));
Assert.AreEqual(0, result.Count());
result = testBundle.FindEntry("Patient", "5678");
Assert.AreEqual(1, result.Count());
result = testBundle.FindEntry(new Uri("http://server1.com/fhir/Patient/5678"));
Assert.AreEqual(1, result.Count());
result = testBundle.FindEntry(new Uri("http://server2.com/fhir/Patient/5678"));
Assert.AreEqual(0, result.Count());
result = testBundle.FindEntry(new Uri("urn:oid:1.2.3.4.5"));
Assert.AreEqual(1, result.Count());
}
示例2: ResourceListFiltering
public void ResourceListFiltering()
{
var testBundle = new Bundle();
testBundle.AddResourceEntry(new Patient { Id = "1234", Meta = new Meta { VersionId = "v2" } }, "http://nu.nl/fhir/Patient/1234");
testBundle.AddResourceEntry(new Patient { Id = "1234", Meta = new Meta { VersionId = "v3" } }, "http://nu.nl/fhir/Patient/1234");
testBundle.AddResourceEntry(new Patient { Id = "1234", Meta = new Meta { VersionId = "v4" } }, "http://nu.nl/fhir/Patient/1234")
.Request = new Bundle.BundleEntryRequestComponent { Method = Bundle.HTTPVerb.DELETE } ;
testBundle.AddResourceEntry(new Patient { Id = "5678" }, "http://server1.com/fhir/Patient/5678");
testBundle.AddResourceEntry(new Patient { Id = "1.2.3.4.5" }, "urn:oid:1.2.3.4.5");
var result = testBundle.FindEntry("http://nu.nl/fhir/Patient/1234");
Assert.AreEqual(2, result.Count());
result = testBundle.FindEntry("http://nu.nl/fhir/Patient/1234", includeDeleted: true);
Assert.AreEqual(3, result.Count());
result = testBundle.FindEntry("http://nu.nl/fhir/Patient/1234/_history/v3", includeDeleted: true);
Assert.AreEqual(1, result.Count());
result = testBundle.FindEntry(new Uri("http://server3.org/fhir/Patient/1234"));
Assert.AreEqual(0, result.Count());
result = testBundle.FindEntry(new Uri("http://server1.com/fhir/Patient/5678"));
Assert.AreEqual(1, result.Count());
result = testBundle.FindEntry(new Uri("http://server2.com/fhir/Patient/5678"));
Assert.AreEqual(0, result.Count());
result = testBundle.FindEntry(new Uri("urn:oid:1.2.3.4.5"));
Assert.AreEqual(1, result.Count());
}
示例3: TestFindEntry
public void TestFindEntry()
{
Bundle b = new Bundle();
b.AddResourceEntry(new Patient { Id = "4" }, "http://some.org/fhir/Patient/4");
b.AddResourceEntry(new Patient { Id = "5", Meta = new Meta { VersionId = "5" } }, "http://some.org/fhir/Patient/5");
b.AddResourceEntry(new Patient { Id = "6" }, "http://some.org/fhir/Patient/8");
Assert.AreEqual(1, b.FindEntry("http://some.org/fhir/Patient/4").Count());
Assert.AreEqual(1, b.FindEntry("http://some.org/fhir/Patient/5").Count());
Assert.AreEqual(0, b.FindEntry("http://some.org/fhir/Patient/6").Count());
Assert.AreEqual(1, b.FindEntry("http://some.org/fhir/Patient/8").Count());
Assert.AreEqual(1, b.FindEntry("http://some.org/fhir/Patient/5/_history/5").Count());
Assert.AreEqual(0, b.FindEntry("http://some.org/fhir/Patient/5/_history/6").Count());
Assert.AreEqual(1, b.FindEntry("https://some.org/fhir/Patient/4").Count());
}