Class FHIRClientImpl
- java.lang.Object
-
- org.linuxforhealth.fhir.client.impl.FHIRClientImpl
-
- All Implemented Interfaces:
FHIRClient
public class FHIRClientImpl extends java.lang.Object implements FHIRClient
Provides an implementation of the FHIRClient interface, which can be used as a high-level API for invoking FHIR REST APIs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FHIRClientImpl.LF
Remaps the LogEventSender
-
Field Summary
-
Fields inherited from interface org.linuxforhealth.fhir.client.FHIRClient
PROPNAME_BASE_URL, PROPNAME_BASIC_AUTH_ENABLED, PROPNAME_CLIENT_AUTH_ENABLED, PROPNAME_CLIENT_PASSWORD, PROPNAME_CLIENT_USERNAME, PROPNAME_DEFAULT_MIMETYPE, PROPNAME_HOSTNAME_VERIFICATION_ENABLED, PROPNAME_HTTP_RETURN_PREF, PROPNAME_HTTP_TIMEOUT, PROPNAME_KEYSTORE_KEY_PASSWORD, PROPNAME_KEYSTORE_LOCATION, PROPNAME_KEYSTORE_PASSWORD, PROPNAME_LOGGING_ENABLED, PROPNAME_OAUTH2_ENABLED, PROPNAME_OAUTH2_TOKEN, PROPNAME_TENANT_ID, PROPNAME_TRUSTSTORE_LOCATION, PROPNAME_TRUSTSTORE_PASSWORD
-
-
Constructor Summary
Constructors Constructor Description FHIRClientImpl(java.util.Properties props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FHIRResponse
_search(java.lang.String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the type-level 'search' FHIR REST API operation via HTTP POST.FHIRResponse
batch(Bundle bundle, FHIRRequestHeader... headers)
Invokes the 'batch/transaction' FHIR REST API operation for a request bundle of type 'batch'.FHIRResponse
capabilities(FHIRRequestHeader... headers)
Invokes the 'capabilities' FHIR REST API operation to get a capability statement for the target server.FHIRResponse
conditionalCreate(jakarta.json.JsonObject resource, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the 'conditional create' FHIR REST API operation to conditionally create a new resource with a server assigned id.FHIRResponse
conditionalCreate(Resource resource, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the 'conditional create' FHIR REST API operation to conditionally create a new resource with a server assigned id.FHIRResponse
conditionalDelete(java.lang.String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the 'conditional delete' FHIR REST API operation to conditionally delete a resource.FHIRResponse
conditionalUpdate(jakarta.json.JsonObject resource, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the 'conditional update' FHIR REST API operation to conditionally update an existing resource by its id (or create it if it is new).FHIRResponse
conditionalUpdate(Resource resource, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the 'conditional update' FHIR REST API operation to conditionally update an existing resource by its id (or create it if it is new).FHIRResponse
create(jakarta.json.JsonObject resource, FHIRRequestHeader... headers)
Invokes the 'create' FHIR REST API operation to create a new resource with a server assigned id.FHIRResponse
create(Resource resource, FHIRRequestHeader... headers)
Invokes the 'create' FHIR REST API operation to create a new resource with a server assigned id.FHIRResponse
delete(java.lang.String resourceType, java.lang.String resourceId, FHIRRequestHeader... headers)
Invokes the 'delete' FHIR REST API operation to delete a resource.java.lang.String
getBaseEndpointURL()
java.lang.String
getDefaultBaseUrl()
Returns the default FHIR base URL that is configured for this client instancejava.lang.String
getDefaultMimeType()
Returns a string that represents the default mime-type associated with the FHIRClient interface.HTTPReturnPreference
getHttpReturnPref()
int
getHttpTimeout()
java.lang.String
getKeyStoreKeyPassword()
java.lang.String
getKeyStoreLocation()
java.lang.String
getKeyStorePassword()
java.lang.String
getOAuth2AccessToken()
Returns a string that represents the OAuth 2.0 access token to be used by the FHIRClient interface for authorization requests.java.lang.String
getTenantId()
Get the value of the tenant name the client is currently configured to usejava.security.KeyStore
getTrustStore()
Allow the client consumer to be able to get and reuse the same TrustStore if necessary.javax.ws.rs.client.WebTarget
getWebTarget()
Returns a JAX-RS 2.0 WebTarget object associated with the REST API endpoint.javax.ws.rs.client.WebTarget
getWebTarget(java.lang.String baseURL)
Returns a JAX-RS 2.0 WebTarget object associated with a given REST API endpoint.FHIRResponse
history(java.lang.String resourceType, java.lang.String resourceId, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the type-level 'history' FHIR REST API operation to retrieve the change history for a particular resource type.FHIRResponse
history(FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the system-level 'history' FHIR REST API operation to retrieve the change history for all resources.FHIRResponse
invoke(java.lang.String resourceType, java.lang.String operationName, java.lang.String resourceId, java.lang.String versionId, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes a FHIR extended operation at the instance version level via HTTP GET.FHIRResponse
invoke(java.lang.String resourceType, java.lang.String operationName, java.lang.String resourceId, java.lang.String versionId, Resource resource, FHIRRequestHeader... headers)
Invokes a FHIR extended operation at the instance version level via HTTP POST.FHIRResponse
invoke(java.lang.String resourceType, java.lang.String operationName, java.lang.String resourceId, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes a FHIR extended operation at the instance level via HTTP GET.FHIRResponse
invoke(java.lang.String resourceType, java.lang.String operationName, java.lang.String resourceId, Resource resource, FHIRRequestHeader... headers)
Invokes a FHIR extended operation at the instance level via HTTP POST.FHIRResponse
invoke(java.lang.String resourceType, java.lang.String operationName, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes a FHIR extended operation at the type level via HTTP GET.FHIRResponse
invoke(java.lang.String resourceType, java.lang.String operationName, Resource resource, FHIRRequestHeader... headers)
Invokes a FHIR extended operation at the type level via HTTP POST.FHIRResponse
invoke(java.lang.String operationName, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes a FHIR extended operation at the system level via HTTP GET.FHIRResponse
invoke(java.lang.String operationName, Resource resource, FHIRRequestHeader... headers)
Invokes a FHIR extended operation at the system level via HTTP POST.boolean
isHostnameVerificationEnabled()
boolean
isLoggingEnabled()
FHIRResponse
read(java.lang.String resourceType, java.lang.String resourceId, FHIRRequestHeader... headers)
Invokes the 'read' FHIR REST API operation to read the current state of a resource.FHIRResponse
search(java.lang.String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers)
Invokes the type-level 'search' FHIR REST API operation to search the resource type based on some filter criteria.FHIRResponse
searchAll(FHIRParameters parameters, boolean isPost, FHIRRequestHeader... headers)
Invokes the system-level 'search' FHIR REST API operation to search across all resource types based on some filter criteria.void
setDefaultMimeType(java.lang.String mimeType)
Sets the default mime-type to be used by the FHIRClient interface when invoking REST API operations.void
setHostnameVerificationEnabled(boolean hostnameVerficationEnabled)
void
setHttpReturnPref(HTTPReturnPreference returnPref)
void
setHttpTimeout(int httpTimeout)
void
setKeyStoreKeyPassword(java.lang.String keyStoreKeyPassword)
void
setKeyStoreLocation(java.lang.String keyStoreLocation)
void
setKeyStorePassword(java.lang.String keyStorePassword)
void
setLoggingEnabled(boolean loggingEnabled)
void
setOAuth2AccessToken(java.lang.String accessToken)
Sets the OAuth 2.0 access token to be used by the FHIRClient interface for authorization when invoking REST API operations.FHIRResponse
transaction(Bundle bundle, FHIRRequestHeader... headers)
Invokes the 'batch/transaction' FHIR REST API operation for a request bundle of type 'transaction'.FHIRResponse
update(jakarta.json.JsonObject resource, FHIRRequestHeader... headers)
Invokes the 'update' FHIR REST API operation to update an existing resource by its id (or create it if it is new).FHIRResponse
update(Resource resource, FHIRRequestHeader... headers)
Invokes the 'update' FHIR REST API operation to update an existing resource by its id (or create it if it is new).FHIRResponse
validate(jakarta.json.JsonObject resource, FHIRRequestHeader... headers)
Invokes the 'validate' FHIR extended operation.FHIRResponse
validate(Resource resource, FHIRRequestHeader... headers)
Invokes the 'validate' FHIR extended operation.FHIRResponse
vread(java.lang.String resourceType, java.lang.String resourceId, java.lang.String versionId, FHIRRequestHeader... headers)
Invokes the 'vread' FHIR REST API operation to read the state of a specific version of a resource.
-
-
-
Method Detail
-
capabilities
public FHIRResponse capabilities(FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'capabilities' FHIR REST API operation to get a capability statement for the target server.- Specified by:
capabilities
in interfaceFHIRClient
- Parameters:
headers
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains a Conformance object which describes the FHIR Server's capabilities
- Throws:
java.lang.Exception
-
create
public FHIRResponse create(Resource resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'create' FHIR REST API operation to create a new resource with a server assigned id.- Specified by:
create
in interfaceFHIRClient
- Parameters:
resource
- the FHIR resource to be createdheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'create' operation
- Throws:
java.lang.Exception
-
create
public FHIRResponse create(jakarta.json.JsonObject resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'create' FHIR REST API operation to create a new resource with a server assigned id.- Specified by:
create
in interfaceFHIRClient
- Parameters:
resource
- the resource (in the form of a JsonObject) to be createdheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'create' operation
- Throws:
java.lang.Exception
-
conditionalCreate
public FHIRResponse conditionalCreate(Resource resource, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'conditional create' FHIR REST API operation to conditionally create a new resource with a server assigned id.- Specified by:
conditionalCreate
in interfaceFHIRClient
- Parameters:
resource
- the FHIR resource to be createdparameters
- search-related query parameters to be included in the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'conditional create' operation
- Throws:
java.lang.Exception
-
conditionalCreate
public FHIRResponse conditionalCreate(jakarta.json.JsonObject resource, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'conditional create' FHIR REST API operation to conditionally create a new resource with a server assigned id.- Specified by:
conditionalCreate
in interfaceFHIRClient
- Parameters:
resource
- the resource (in the form of a JsonObject) to be createdparameters
- search-related query parameters to be included in the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'conditional create' operation
- Throws:
java.lang.Exception
-
update
public FHIRResponse update(Resource resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'update' FHIR REST API operation to update an existing resource by its id (or create it if it is new).- Specified by:
update
in interfaceFHIRClient
- Parameters:
resource
- the FHIR resource to be updatedheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'update' operation
- Throws:
java.lang.Exception
-
update
public FHIRResponse update(jakarta.json.JsonObject resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'update' FHIR REST API operation to update an existing resource by its id (or create it if it is new).- Specified by:
update
in interfaceFHIRClient
- Parameters:
resource
- the resource (in the form of a JsonObject) to be updatedheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'update' operation
- Throws:
java.lang.Exception
-
conditionalUpdate
public FHIRResponse conditionalUpdate(Resource resource, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'conditional update' FHIR REST API operation to conditionally update an existing resource by its id (or create it if it is new).- Specified by:
conditionalUpdate
in interfaceFHIRClient
- Parameters:
resource
- the FHIR resource to be createdparameters
- search-related query parameters to be included in the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'conditional update' operation
- Throws:
java.lang.Exception
-
conditionalUpdate
public FHIRResponse conditionalUpdate(jakarta.json.JsonObject resource, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'conditional update' FHIR REST API operation to conditionally update an existing resource by its id (or create it if it is new).- Specified by:
conditionalUpdate
in interfaceFHIRClient
- Parameters:
resource
- the resource (in the form of a JsonObject) to be updatedparameters
- search-related query parameters to be included in the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'conditional update' operation
- Throws:
java.lang.Exception
-
delete
public FHIRResponse delete(java.lang.String resourceType, java.lang.String resourceId, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'delete' FHIR REST API operation to delete a resource.- Specified by:
delete
in interfaceFHIRClient
- Parameters:
resourceType
- a string representing the name of the resource type to be deleted (e.g. "Patient")resourceId
- the id of the resource to be deletedheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'delete' operation
- Throws:
java.lang.Exception
-
conditionalDelete
public FHIRResponse conditionalDelete(java.lang.String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'conditional delete' FHIR REST API operation to conditionally delete a resource.- Specified by:
conditionalDelete
in interfaceFHIRClient
- Parameters:
resourceType
- a string representing the name of the resource type to be deleted (e.g. "Patient")parameters
- search-related query parameters to be included in the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'delete' operation
- Throws:
java.lang.Exception
-
read
public FHIRResponse read(java.lang.String resourceType, java.lang.String resourceId, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'read' FHIR REST API operation to read the current state of a resource.- Specified by:
read
in interfaceFHIRClient
- Parameters:
resourceType
- a string representing the name of the resource type to be retrieved (e.g. "Patient")resourceId
- the id of the resource to be retrievedheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'read' operation
- Throws:
java.lang.Exception
-
vread
public FHIRResponse vread(java.lang.String resourceType, java.lang.String resourceId, java.lang.String versionId, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'vread' FHIR REST API operation to read the state of a specific version of a resource.- Specified by:
vread
in interfaceFHIRClient
- Parameters:
resourceType
- a string representing the name of the resource type to be retrieved (e.g. "Patient")resourceId
- the id of the resource to be retrievedversionId
- the version id of the resource to be retrievedheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'read' operation
- Throws:
java.lang.Exception
-
history
public FHIRResponse history(java.lang.String resourceType, java.lang.String resourceId, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the type-level 'history' FHIR REST API operation to retrieve the change history for a particular resource type.- Specified by:
history
in interfaceFHIRClient
- Parameters:
resourceType
- a string representing the name of the resource type to be retrieved (e.g. "Patient")resourceId
- the id of the resource to be retrievedparameters
- an optional collection of request parameters for the 'history' operation; may be specified as null if no parameters need to be passed to the 'history' operationheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'history' operation
- Throws:
java.lang.Exception
-
history
public FHIRResponse history(FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the system-level 'history' FHIR REST API operation to retrieve the change history for all resources.- Specified by:
history
in interfaceFHIRClient
- Parameters:
parameters
- an optional collection of request parameters for the 'history' operation; may be specified as null if no parameters need to be passed to the 'history' operationheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'history' operation
- Throws:
java.lang.Exception
-
search
public FHIRResponse search(java.lang.String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the type-level 'search' FHIR REST API operation to search the resource type based on some filter criteria.- Specified by:
search
in interfaceFHIRClient
- Parameters:
resourceType
- a string representing the name of the resource type to search for (e.g. "Patient")parameters
- an optional collection of request parameters for the 'search' operation; may be specified as null if no parameters need to be passed to the 'search' operationheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'search' operation
- Throws:
java.lang.Exception
-
_search
public FHIRResponse _search(java.lang.String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the type-level 'search' FHIR REST API operation via HTTP POST.- Specified by:
_search
in interfaceFHIRClient
- Parameters:
resourceType
- a string representing the name of the resource type to search for (e.g. "Patient")parameters
- an optional collection of request parameters for the '_search' operation; may be specified as null if no parameters need to be passed to the '_search' operation; search parameters for this operation will go in the request body- Returns:
- a FHIRResponse that contains the results of the '_search' operation
- Throws:
java.lang.Exception
-
searchAll
public FHIRResponse searchAll(FHIRParameters parameters, boolean isPost, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the system-level 'search' FHIR REST API operation to search across all resource types based on some filter criteria.- Specified by:
searchAll
in interfaceFHIRClient
- Parameters:
parameters
- an optional collection of request parameters for the 'search-all' operation; may be specified as null if no parameters need to be passed to the 'search' operation; for Post, search parameters for this operation will go in the request body as FORM parameters for Get, search parameters for this operation will go in the request url as parameters- Returns:
- a FHIRResponse that contains the results of the 'search-all' operation
- Throws:
java.lang.Exception
-
validate
public FHIRResponse validate(Resource resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'validate' FHIR extended operation.- Specified by:
validate
in interfaceFHIRClient
- Parameters:
resource
- the resource to be validatedheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'validate' operation
- Throws:
java.lang.Exception
-
validate
public FHIRResponse validate(jakarta.json.JsonObject resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'validate' FHIR extended operation.- Specified by:
validate
in interfaceFHIRClient
- Parameters:
resource
- the resource (in the form of a JsonObject) to be validatedheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'validate' operation
- Throws:
java.lang.Exception
-
batch
public FHIRResponse batch(Bundle bundle, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'batch/transaction' FHIR REST API operation for a request bundle of type 'batch'.- Specified by:
batch
in interfaceFHIRClient
- Parameters:
bundle
- the Bundle containing the individual requestsheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'batch/transaction' operation
- Throws:
java.lang.Exception
-
transaction
public FHIRResponse transaction(Bundle bundle, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes the 'batch/transaction' FHIR REST API operation for a request bundle of type 'transaction'.- Specified by:
transaction
in interfaceFHIRClient
- Parameters:
bundle
- the Bundle containing the individual requestsheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'batch/transaction' operation
- Throws:
java.lang.Exception
-
invoke
public FHIRResponse invoke(java.lang.String operationName, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes a FHIR extended operation at the system level via HTTP GET.- Specified by:
invoke
in interfaceFHIRClient
- Parameters:
operationName
- name of the operation to be performedparameters
- query parameters to use for the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'invoke' operation
- Throws:
java.lang.Exception
-
invoke
public FHIRResponse invoke(java.lang.String operationName, Resource resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes a FHIR extended operation at the system level via HTTP POST.- Specified by:
invoke
in interfaceFHIRClient
- Parameters:
operationName
- name of the operation to be performedresource
- the FHIR resource to use as the input for the operationheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'invoke' operation
- Throws:
java.lang.Exception
-
invoke
public FHIRResponse invoke(java.lang.String resourceType, java.lang.String operationName, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes a FHIR extended operation at the type level via HTTP GET.- Specified by:
invoke
in interfaceFHIRClient
- Parameters:
resourceType
- the FHIR resource type used in context for the operationoperationName
- name of the operation to be performedparameters
- query parameters to use for the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'invoke' operation
- Throws:
java.lang.Exception
-
invoke
public FHIRResponse invoke(java.lang.String resourceType, java.lang.String operationName, Resource resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes a FHIR extended operation at the type level via HTTP POST.- Specified by:
invoke
in interfaceFHIRClient
- Parameters:
resourceType
- the FHIR resource type used in context for the operationoperationName
- name of the operation to be performedresource
- the FHIR resource to use as the input for the operationheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'invoke' operation
- Throws:
java.lang.Exception
-
invoke
public FHIRResponse invoke(java.lang.String resourceType, java.lang.String operationName, java.lang.String resourceId, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes a FHIR extended operation at the instance level via HTTP GET.- Specified by:
invoke
in interfaceFHIRClient
- Parameters:
resourceType
- the FHIR resource type used in context for the operationoperationName
- name of the operation to be performedresourceId
- the FHIR resource instance used in context for the operationparameters
- query parameters to use for the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'invoke' operation
- Throws:
java.lang.Exception
-
invoke
public FHIRResponse invoke(java.lang.String resourceType, java.lang.String operationName, java.lang.String resourceId, Resource resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes a FHIR extended operation at the instance level via HTTP POST.- Specified by:
invoke
in interfaceFHIRClient
- Parameters:
resourceType
- the FHIR resource type used in context for the operationoperationName
- name of the operation to be performedresourceId
- the FHIR resource instance used in context for the operationresource
- the FHIR resource to use as the input for the operationheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'invoke' operation
- Throws:
java.lang.Exception
-
invoke
public FHIRResponse invoke(java.lang.String resourceType, java.lang.String operationName, java.lang.String resourceId, java.lang.String versionId, FHIRParameters parameters, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes a FHIR extended operation at the instance version level via HTTP GET.- Specified by:
invoke
in interfaceFHIRClient
- Parameters:
resourceType
- the FHIR resource type used in context for the operationoperationName
- name of the operation to be performedresourceId
- the FHIR resource instance used in context for the operationversionId
- version of the FHIR resource instance used in context for the operationparameters
- query parameters to use for the requestheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'invoke' operation
- Throws:
java.lang.Exception
-
invoke
public FHIRResponse invoke(java.lang.String resourceType, java.lang.String operationName, java.lang.String resourceId, java.lang.String versionId, Resource resource, FHIRRequestHeader... headers) throws java.lang.Exception
Description copied from interface:FHIRClient
Invokes a FHIR extended operation at the instance version level via HTTP POST.- Specified by:
invoke
in interfaceFHIRClient
- Parameters:
resourceType
- the FHIR resource type used in context for the operationoperationName
- name of the operation to be performedresourceId
- the FHIR resource instance used in context for the operationversionId
- version of the FHIR resource instance used in context for the operationresource
- the FHIR resource to use as the input for the operationheaders
- an optional list of request headers to be added to the request- Returns:
- a FHIRResponse that contains the results of the 'invoke' operation
- Throws:
java.lang.Exception
-
getDefaultBaseUrl
public java.lang.String getDefaultBaseUrl()
Description copied from interface:FHIRClient
Returns the default FHIR base URL that is configured for this client instance- Specified by:
getDefaultBaseUrl
in interfaceFHIRClient
- Returns:
- the FHIR base URL with scheme, host, and path
-
getWebTarget
public javax.ws.rs.client.WebTarget getWebTarget() throws java.lang.Exception
Description copied from interface:FHIRClient
Returns a JAX-RS 2.0 WebTarget object associated with the REST API endpoint.- Specified by:
getWebTarget
in interfaceFHIRClient
- Returns:
- a WebTarget instance that can be used to invoke REST APIs.
- Throws:
java.lang.Exception
-
getWebTarget
public javax.ws.rs.client.WebTarget getWebTarget(java.lang.String baseURL) throws java.lang.Exception
Description copied from interface:FHIRClient
Returns a JAX-RS 2.0 WebTarget object associated with a given REST API endpoint.- Specified by:
getWebTarget
in interfaceFHIRClient
- Returns:
- a WebTarget instance that can be used to invoke REST APIs.
- Throws:
java.lang.Exception
-
getBaseEndpointURL
public java.lang.String getBaseEndpointURL()
-
setDefaultMimeType
public void setDefaultMimeType(java.lang.String mimeType) throws java.lang.Exception
Description copied from interface:FHIRClient
Sets the default mime-type to be used by the FHIRClient interface when invoking REST API operations.- Specified by:
setDefaultMimeType
in interfaceFHIRClient
- Parameters:
mimeType
- a string containing the mime-type (e.g. "application/fhir+json")- Throws:
java.lang.Exception
-
getDefaultMimeType
public java.lang.String getDefaultMimeType() throws java.lang.Exception
Description copied from interface:FHIRClient
Returns a string that represents the default mime-type associated with the FHIRClient interface.- Specified by:
getDefaultMimeType
in interfaceFHIRClient
- Throws:
java.lang.Exception
-
setOAuth2AccessToken
public void setOAuth2AccessToken(java.lang.String accessToken) throws java.lang.Exception
Description copied from interface:FHIRClient
Sets the OAuth 2.0 access token to be used by the FHIRClient interface for authorization when invoking REST API operations.- Specified by:
setOAuth2AccessToken
in interfaceFHIRClient
- Parameters:
accessToken
- a string containing the OAuth 2.0 access token- Throws:
java.lang.Exception
-
getOAuth2AccessToken
public java.lang.String getOAuth2AccessToken() throws java.lang.Exception
Description copied from interface:FHIRClient
Returns a string that represents the OAuth 2.0 access token to be used by the FHIRClient interface for authorization requests.- Specified by:
getOAuth2AccessToken
in interfaceFHIRClient
- Throws:
java.lang.Exception
-
getTrustStore
public java.security.KeyStore getTrustStore()
Description copied from interface:FHIRClient
Allow the client consumer to be able to get and reuse the same TrustStore if necessary.- Specified by:
getTrustStore
in interfaceFHIRClient
-
getKeyStoreLocation
public java.lang.String getKeyStoreLocation()
-
setKeyStoreLocation
public void setKeyStoreLocation(java.lang.String keyStoreLocation)
-
getKeyStorePassword
public java.lang.String getKeyStorePassword()
-
setKeyStorePassword
public void setKeyStorePassword(java.lang.String keyStorePassword)
-
getKeyStoreKeyPassword
public java.lang.String getKeyStoreKeyPassword()
-
setKeyStoreKeyPassword
public void setKeyStoreKeyPassword(java.lang.String keyStoreKeyPassword)
-
isLoggingEnabled
public boolean isLoggingEnabled()
-
setLoggingEnabled
public void setLoggingEnabled(boolean loggingEnabled)
-
isHostnameVerificationEnabled
public boolean isHostnameVerificationEnabled()
-
setHostnameVerificationEnabled
public void setHostnameVerificationEnabled(boolean hostnameVerficationEnabled)
-
getHttpTimeout
public int getHttpTimeout()
-
setHttpTimeout
public void setHttpTimeout(int httpTimeout)
-
getHttpReturnPref
public HTTPReturnPreference getHttpReturnPref()
-
setHttpReturnPref
public void setHttpReturnPref(HTTPReturnPreference returnPref)
-
getTenantId
public java.lang.String getTenantId()
Description copied from interface:FHIRClient
Get the value of the tenant name the client is currently configured to use- Specified by:
getTenantId
in interfaceFHIRClient
- Returns:
-
-