Beispiel #1
0
        public async Task <ResourceWrapper> UpdateAsync(ResourceWrapper resourceWrapper)
        {
            // Using the FhirClient for Binary resources is causing a
            // 415 Unsupported Media Type on our API Management Proxy in Azure
            // The reason seems to be that the FhirClient converts the Binary
            // xml/json resource to its actual binary representation
            if (resourceWrapper.ResourceType == ResourceTypeWrapper.Binary)
            {
                return(await UpdateUsingHttpClientAsync(resourceWrapper));
            }

            switch (FhirVersion)
            {
            case FhirVersion.R3:
                var resultR3 = await R3Client.UpdateAsync(resourceWrapper.Resource);

                return(resultR3 != null ? new ResourceWrapper(resultR3, FhirVersion.R3) : null);

            case FhirVersion.R4:
                var resultR4 = await R4Client.UpdateAsync(resourceWrapper.Resource);

                return(resultR4 != null ? new ResourceWrapper(resultR4, FhirVersion.R4) : null);

            default:
                return(default);
            }
        }
Beispiel #2
0
        public async Task DeleteAsync(string resourceType, string resourceId)
        {
            switch (FhirVersion)
            {
            case FhirVersion.R3:
                await R3Client.DeleteAsync($"{resourceType}/{resourceId}");

                break;

            case FhirVersion.R4:
                await R4Client.DeleteAsync($"{resourceType}/{resourceId}");

                break;
            }
        }
Beispiel #3
0
        internal async Task <BundleWrapper> ContinueAsync(BundleWrapper bundleWrapper)
        {
            switch (FhirVersion)
            {
            case FhirVersion.R3:
                var resultR3 = await R3Client.ContinueAsync(bundleWrapper.R3Bundle);

                return(resultR3 != null ? new BundleWrapper(resultR3) : null);

            case FhirVersion.R4:
                var resultR4 = await R4Client.ContinueAsync(bundleWrapper.R4Bundle);

                return(resultR4 != null ? new BundleWrapper(resultR4) : null);

            default:
                return(default);
            }
        }
Beispiel #4
0
        public async Task <BundleWrapper> TransactionAsync(BundleWrapper bundleWrapper)
        {
            switch (FhirVersion)
            {
            case FhirVersion.R3:
                var resultR3 = await R3Client.TransactionAsync(bundleWrapper.R3Bundle);

                return(resultR3 != null ? new BundleWrapper(resultR3) : null);

            case FhirVersion.R4:
                var resultR4 = await R4Client.TransactionAsync(bundleWrapper.R4Bundle);

                return(resultR4 != null ? new BundleWrapper(resultR4) : null);

            default:
                return(default);
            }
        }
Beispiel #5
0
        internal async Task <BundleWrapper> SearchAsync(string resource)
        {
            switch (FhirVersion)
            {
            case FhirVersion.R3:
                var resultR3 = await R3Client.SearchAsync(resource);

                return(resultR3 != null ? new BundleWrapper(resultR3) : null);

            case FhirVersion.R4:
                var resultR4 = await R4Client.SearchAsync(resource);

                return(resultR4 != null ? new BundleWrapper(resultR4) : null);

            default:
                return(default);
            }
        }