Ejemplo n.º 1
0
        public async Task GivenAServer_WhenSearchedByResourceHistory_ThenAuditLogEntriesShouldBeCreated()
        {
            const string url = "Observation/_history";

            await ExecuteAndValidate(
                () => _client.SearchAsync(url),
                "history-type",
                ResourceType.Bundle,
                _ => url,
                HttpStatusCode.OK);
        }
        public static async Task DeleteAllResources(this FhirClient client, ResourceType resourceType, string searchUrl)
        {
            while (true)
            {
                Bundle bundle = await client.SearchAsync(resourceType, searchUrl, count : 100);

                if (!bundle.Entry.Any())
                {
                    break;
                }

                foreach (Bundle.EntryComponent entry in bundle.Entry)
                {
                    await client.DeleteAsync(entry.FullUrl);
                }
            }
        }