public async Task SearchUsingPost_UsingSearchParams_SearchReturned() { var client = new FhirClient(_endpointSupportingSearchUsingPost) { PreferredFormat = ResourceFormat.Json, ReturnFullResource = true }; var srch = new SearchParams() .Where("name=Peter") .LimitTo(5) .SummaryOnly() .OrderBy("birthdate", SortOrder.Descending); var result1 = await client.SearchUsingPostAsync <Patient>(srch); Assert.IsTrue(result1.Entry.Count >= 1); while (result1 != null) { foreach (var e in result1.Entry) { Patient p = (Patient)e.Resource; if (p.Name.Any()) { Console.WriteLine( $"NAME: {p.Name[0].Given.FirstOrDefault()} {p.Name[0].Family.FirstOrDefault()}"); } } result1 = client.Continue(result1, PageDirection.Next); } Console.WriteLine("Test Completed"); }
public async Task SearchUsingPostWithCriteria_SyncContinue_SearchReturned() { var client = new FhirClient(_endpointSupportingSearchUsingPost) { PreferredFormat = ResourceFormat.Json, ReturnFullResource = true }; var result1 = await client.SearchUsingPostAsync <Patient>(new[] { "family=Chalmers" }, pageSize : 5); Assert.IsTrue(result1.Entry.Count >= 1); while (result1 != null) { foreach (var e in result1.Entry) { Patient p = (Patient)e.Resource; if (p.Name.Any()) { Console.WriteLine( $"NAME: {p.Name[0].Given.FirstOrDefault()} {p.Name[0].Family.FirstOrDefault()}"); } } result1 = client.Continue(result1, PageDirection.Next); } Console.WriteLine("Test Completed"); }