Package ca.cdr.api.fhir.client
Interface IExtendedGenericClient
- All Superinterfaces:
IGenericClient,IRestfulClient
An
IGenericClient with the FHIR endpoint operations it does not model yet.
Each method here is a candidate for upstreaming into HAPI FHIR's IGenericClient. Once one
is, it moves there and is removed from this interface.
-
Method Summary
Modifier and TypeMethodDescriptionca.uhn.fhir.jpa.bulk.export.model.BulkExportResponseJsonawaitBulkExport(String thePollUrl) Polls a Bulk Data export's status URL until the export completes, for up to five minutes, once a second.ca.uhn.fhir.jpa.bulk.export.model.BulkExportResponseJsonawaitBulkExport(String thePollUrl, Duration theTimeout, Duration thePollInterval) Polls a Bulk Data export's status URL until the export completes.Fetches the endpoint's SMART App Launch discovery document from[base]/.well-known/smart-configuration.startBulkExport(BulkExportJobParameters theParameters) Kicks off an asynchronous Bulk Data export byPOSTing the parameters as a FHIRParametersresource withPrefer: respond-asyncandCache-Control: no-cache.Methods inherited from interface ca.uhn.fhir.rest.client.api.IGenericClient
capabilities, create, delete, fetchConformance, forceConformanceCheck, history, loadPage, meta, operation, patch, rawHttpRequest, read, read, read, read, registerInterceptor, search, setLogRequestAndResponse, transaction, unregisterInterceptor, update, update, update, validate, validate, vread, vreadMethods inherited from interface ca.uhn.fhir.rest.client.api.IRestfulClient
fetchResourceFromUrl, getEncoding, getFhirContext, getHttpClient, getInterceptorService, getServerBase, setEncoding, setFormatParamStyle, setInterceptorService, setPrettyPrint, setSummary
-
Method Details
-
getSmartConfiguration
Fetches the endpoint's SMART App Launch discovery document from[base]/.well-known/smart-configuration.- Returns:
- the discovery document. Every member is optional: a server with SMART disabled
returns an empty document, and one without the
sso-openid-connectcapability omitsissuerandjwks_uri. - Throws:
AssertionError- if the server does not answer200 OK- See Also:
-
startBulkExport
Kicks off an asynchronous Bulk Data export byPOSTing the parameters as a FHIRParametersresource withPrefer: respond-asyncandCache-Control: no-cache. The latter makes the server start a new export job rather than reuse a recent one with the same parameters.The export style picks the endpoint:
SYSTEM(or none) uses[base]/$export,PATIENTuses[base]/Patient/$export, andGROUPuses[base]/Group/[groupId]/$export. The output format defaults toapplication/fhir+ndjsonwhen the parameters name none.- Parameters:
theParameters- what to export: style, resource types,_since/_until, type filters, patients, group and MDM expansion- Returns:
- the status polling URL from the response's
Content-Locationheader, to pass toawaitBulkExport(String) - Throws:
IllegalArgumentException- if aGROUPexport has no group IDAssertionError- if the server does not answer202 Acceptedwith aContent-Location- See Also:
-
awaitBulkExport
@Nonnull ca.uhn.fhir.jpa.bulk.export.model.BulkExportResponseJson awaitBulkExport(@Nonnull String thePollUrl) Polls a Bulk Data export's status URL until the export completes, for up to five minutes, once a second.- Parameters:
thePollUrl- the polling URL returned bystartBulkExport(BulkExportJobParameters)- Returns:
- the completion manifest, listing the output files
- Throws:
AssertionError- if the export fails, or is still running after five minutes- See Also:
-
awaitBulkExport
@Nonnull ca.uhn.fhir.jpa.bulk.export.model.BulkExportResponseJson awaitBulkExport(@Nonnull String thePollUrl, @Nonnull Duration theTimeout, @Nonnull Duration thePollInterval) Polls a Bulk Data export's status URL until the export completes.A
202 Acceptedmeans the export is still running, so polling continues. A200 OKcarries the completion manifest. Any other status means the export failed.- Parameters:
thePollUrl- the polling URL returned bystartBulkExport(BulkExportJobParameters)theTimeout- how long to keep polling before giving upthePollInterval- how long to wait between polls- Returns:
- the completion manifest, listing the output files
- Throws:
AssertionError- if the server answers anything but200or202, giving the status and body, or if the export is still running whentheTimeoutpasses, giving its lastX-ProgressIllegalStateException- if the thread is interrupted while waiting between polls
-