本文整理汇总了C#中FhirClient.Continue方法的典型用法代码示例。如果您正苦于以下问题:C# FhirClient.Continue方法的具体用法?C# FhirClient.Continue怎么用?C# FhirClient.Continue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FhirClient
的用法示例。
在下文中一共展示了FhirClient.Continue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnStart_Click
private void btnStart_Click(object sender, EventArgs e)
{
// Choose your preferred FHIR server or add your own
// More at http://wiki.hl7.org/index.php?title=Publicly_Available_FHIR_Servers_for_testing
//var client = new FhirClient("http://fhir2.healthintersections.com.au/open");
var client = new FhirClient("http://spark.furore.com/fhir");
//var client = new FhirClient("http://fhirtest.uhn.ca/baseDstu2");
//var client = new FhirClient("https://fhir-open-api-dstu2.smarthealthit.org/");
try
{
var q = new SearchParams().Where("name=pete");
//var q = new SearchParams().Where("name=pete").Where("birthdate=1974-12-25");
var results = client.Search<Patient>(q);
txtDisplay.Text = "";
while (results != null)
{
if (results.Total == 0) txtDisplay.Text = "No results found";
foreach (var entry in results.Entry)
{
txtDisplay.Text += "Found patient with id " + entry.Resource.Id + Environment.NewLine;
}
// get the next page of results
results = client.Continue(results);
}
}
catch (Exception err)
{
txtError.Lines = new string[] { "An error has occurred:", err.Message };
}
}
示例2: PagingInJson
public void PagingInJson()
{
FhirClient client = new FhirClient(testEndpoint);
client.PreferredFormat = ResourceFormat.Json;
var result = client.Search<DiagnosticReport>(pageSize: 10);
Assert.IsNotNull(result);
Assert.IsTrue(result.Entry.Count <= 10);
var firstId = result.Entry.First().Resource.Id;
// Browse forward
result = client.Continue(result);
Assert.IsNotNull(result);
var nextId = result.Entry.First().Resource.Id;
Assert.AreNotEqual(firstId, nextId);
// Browse to first
result = client.Continue(result, PageDirection.First);
Assert.IsNotNull(result);
var prevId = result.Entry.First().Resource.Id;
Assert.AreEqual(firstId, prevId);
// Forward, then backwards
result = client.Continue(result, PageDirection.Next);
Assert.IsNotNull(result);
result = client.Continue(result, PageDirection.Previous);
Assert.IsNotNull(result);
prevId = result.Entry.First().Resource.Id;
Assert.AreEqual(firstId, prevId);
}
示例3: Paging
public void Paging()
{
FhirClient client = new FhirClient(testEndpoint);
var result = client.Search(ResourceType.DiagnosticReport, count: 10);
Assert.IsNotNull(result);
Assert.IsTrue(result.Entries.Count <= 10);
var firstId = result.Entries.First().Id;
// Browse forward
result = client.Continue(result);
Assert.IsNotNull(result);
var nextId = result.Entries.First().Id;
Assert.AreNotEqual(firstId, nextId);
// Browse backward
//result = client.Continue(result, PageDirection.Previous);
result = client.Continue(result, PageDirection.First);
Assert.IsNotNull(result);
var prevId = result.Entries.First().Id;
Assert.AreEqual(firstId, prevId);
}