Download Request
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"))
Content copied to clipboard
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
}
})
})
Content copied to clipboard