Interface IExtendedGenericClient

All Superinterfaces:
IGenericClient, IRestfulClient

public interface IExtendedGenericClient extends IGenericClient
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 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-connect capability omits issuer and jwks_uri.
      Throws:
      AssertionError - if the server does not answer 200 OK
      See Also:
    • startBulkExport

      @Nonnull String startBulkExport(@Nonnull BulkExportJobParameters theParameters)
      Kicks off an asynchronous Bulk Data export by POSTing the parameters as a FHIR Parameters resource with Prefer: respond-async and Cache-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, PATIENT uses [base]/Patient/$export, and GROUP uses [base]/Group/[groupId]/$export. The output format defaults to application/fhir+ndjson when 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-Location header, to pass to awaitBulkExport(String)
      Throws:
      IllegalArgumentException - if a GROUP export has no group ID
      AssertionError - if the server does not answer 202 Accepted with a Content-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 by startBulkExport(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 Accepted means the export is still running, so polling continues. A 200 OK carries the completion manifest. Any other status means the export failed.

      Parameters:
      thePollUrl - the polling URL returned by startBulkExport(BulkExportJobParameters)
      theTimeout - how long to keep polling before giving up
      thePollInterval - how long to wait between polls
      Returns:
      the completion manifest, listing the output files
      Throws:
      AssertionError - if the server answers anything but 200 or 202, giving the status and body, or if the export is still running when theTimeout passes, giving its last X-Progress
      IllegalStateException - if the thread is interrupted while waiting between polls