DownloadRequest

sealed class DownloadRequest

Structure represents a request that can be made to download resources from the FHIR server. The request may contain http headers for conditional requests for getting precise results.

Implementations of DownloadRequest are UrlDownloadRequest and BundleDownloadRequest and the application developers may choose the appropriate DownloadRequest.of companion functions to create request objects.

UrlRequest

The application developer may use a request like below to get an update on Patient/123 since it was last downloaded.

Request.of("/Patient/123", mapOf("If-Modified-Since" to "knownLastUpdatedOfPatient123"))

BundleRequest

The application developer may use a request like below to download multiple resources in a single shot.

Request.of(Bundle().apply {
addEntry(Bundle.BundleEntryComponent().apply {
request = Bundle.BundleEntryRequestComponent().apply {
url = "Patient/123"
method = Bundle.HTTPVerb.GET
}
})
addEntry(Bundle.BundleEntryComponent().apply {
request = Bundle.BundleEntryRequestComponent().apply {
url = "Patient/124"
method = Bundle.HTTPVerb.GET
}
})
})

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val headers: Map<String, String>