本文整理汇总了C#中Hl7.Fhir.Model.Bundle.AddResourceEntry方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.AddResourceEntry方法的具体用法?C# Bundle.AddResourceEntry怎么用?C# Bundle.AddResourceEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hl7.Fhir.Model.Bundle
的用法示例。
在下文中一共展示了Bundle.AddResourceEntry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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());
}
示例2: 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());
}
示例3: TestBundleSummary
public void TestBundleSummary()
{
var p = new Patient();
p.BirthDate = "1972-11-30"; // present in both summary and full
p.Photo = new List<Attachment>() { new Attachment() { ContentType = "text/plain" } };
var b = new Bundle();
b.AddResourceEntry(p, "http://nu.nl/fhir/Patient/1");
var full = FhirSerializer.SerializeResourceToXml(b);
Assert.IsTrue(full.Contains("<entry"));
Assert.IsTrue(full.Contains("<birthDate"));
Assert.IsTrue(full.Contains("<photo"));
var summ = FhirSerializer.SerializeResourceToXml(b, summary: true);
Assert.IsTrue(summ.Contains("<entry"));
Assert.IsTrue(summ.Contains("<birthDate"));
Assert.IsFalse(summ.Contains("<photo"));
}