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 classFHIRClientImpl.LFRemaps 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.FHIRResponsebatch(Bundle bundle, FHIRRequestHeader... headers)Invokes the 'batch/transaction' FHIR REST API operation for a request bundle of type 'batch'.FHIRResponsecapabilities(FHIRRequestHeader... headers)Invokes the 'capabilities' FHIR REST API operation to get a capability statement for the target server.FHIRResponseconditionalCreate(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.FHIRResponseconditionalCreate(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.FHIRResponseconditionalDelete(java.lang.String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers)Invokes the 'conditional delete' FHIR REST API operation to conditionally delete a resource.FHIRResponseconditionalUpdate(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).FHIRResponseconditionalUpdate(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).FHIRResponsecreate(jakarta.json.JsonObject resource, FHIRRequestHeader... headers)Invokes the 'create' FHIR REST API operation to create a new resource with a server assigned id.FHIRResponsecreate(Resource resource, FHIRRequestHeader... headers)Invokes the 'create' FHIR REST API operation to create a new resource with a server assigned id.FHIRResponsedelete(java.lang.String resourceType, java.lang.String resourceId, FHIRRequestHeader... headers)Invokes the 'delete' FHIR REST API operation to delete a resource.java.lang.StringgetBaseEndpointURL()java.lang.StringgetDefaultBaseUrl()Returns the default FHIR base URL that is configured for this client instancejava.lang.StringgetDefaultMimeType()Returns a string that represents the default mime-type associated with the FHIRClient interface.HTTPReturnPreferencegetHttpReturnPref()intgetHttpTimeout()java.lang.StringgetKeyStoreKeyPassword()java.lang.StringgetKeyStoreLocation()java.lang.StringgetKeyStorePassword()java.lang.StringgetOAuth2AccessToken()Returns a string that represents the OAuth 2.0 access token to be used by the FHIRClient interface for authorization requests.java.lang.StringgetTenantId()Get the value of the tenant name the client is currently configured to usejava.security.KeyStoregetTrustStore()Allow the client consumer to be able to get and reuse the same TrustStore if necessary.javax.ws.rs.client.WebTargetgetWebTarget()Returns a JAX-RS 2.0 WebTarget object associated with the REST API endpoint.javax.ws.rs.client.WebTargetgetWebTarget(java.lang.String baseURL)Returns a JAX-RS 2.0 WebTarget object associated with a given REST API endpoint.FHIRResponsehistory(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.FHIRResponsehistory(FHIRParameters parameters, FHIRRequestHeader... headers)Invokes the system-level 'history' FHIR REST API operation to retrieve the change history for all resources.FHIRResponseinvoke(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.FHIRResponseinvoke(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.FHIRResponseinvoke(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.FHIRResponseinvoke(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.FHIRResponseinvoke(java.lang.String resourceType, java.lang.String operationName, FHIRParameters parameters, FHIRRequestHeader... headers)Invokes a FHIR extended operation at the type level via HTTP GET.FHIRResponseinvoke(java.lang.String resourceType, java.lang.String operationName, Resource resource, FHIRRequestHeader... headers)Invokes a FHIR extended operation at the type level via HTTP POST.FHIRResponseinvoke(java.lang.String operationName, FHIRParameters parameters, FHIRRequestHeader... headers)Invokes a FHIR extended operation at the system level via HTTP GET.FHIRResponseinvoke(java.lang.String operationName, Resource resource, FHIRRequestHeader... headers)Invokes a FHIR extended operation at the system level via HTTP POST.booleanisHostnameVerificationEnabled()booleanisLoggingEnabled()FHIRResponseread(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.FHIRResponsesearch(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.FHIRResponsesearchAll(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.voidsetDefaultMimeType(java.lang.String mimeType)Sets the default mime-type to be used by the FHIRClient interface when invoking REST API operations.voidsetHostnameVerificationEnabled(boolean hostnameVerficationEnabled)voidsetHttpReturnPref(HTTPReturnPreference returnPref)voidsetHttpTimeout(int httpTimeout)voidsetKeyStoreKeyPassword(java.lang.String keyStoreKeyPassword)voidsetKeyStoreLocation(java.lang.String keyStoreLocation)voidsetKeyStorePassword(java.lang.String keyStorePassword)voidsetLoggingEnabled(boolean loggingEnabled)voidsetOAuth2AccessToken(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.FHIRResponsetransaction(Bundle bundle, FHIRRequestHeader... headers)Invokes the 'batch/transaction' FHIR REST API operation for a request bundle of type 'transaction'.FHIRResponseupdate(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).FHIRResponseupdate(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).FHIRResponsevalidate(jakarta.json.JsonObject resource, FHIRRequestHeader... headers)Invokes the 'validate' FHIR extended operation.FHIRResponsevalidate(Resource resource, FHIRRequestHeader... headers)Invokes the 'validate' FHIR extended operation.FHIRResponsevread(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:FHIRClientInvokes the 'capabilities' FHIR REST API operation to get a capability statement for the target server.- Specified by:
capabilitiesin 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:FHIRClientInvokes the 'create' FHIR REST API operation to create a new resource with a server assigned id.- Specified by:
createin 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:FHIRClientInvokes the 'create' FHIR REST API operation to create a new resource with a server assigned id.- Specified by:
createin 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:FHIRClientInvokes the 'conditional create' FHIR REST API operation to conditionally create a new resource with a server assigned id.- Specified by:
conditionalCreatein 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:FHIRClientInvokes the 'conditional create' FHIR REST API operation to conditionally create a new resource with a server assigned id.- Specified by:
conditionalCreatein 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:FHIRClientInvokes the 'update' FHIR REST API operation to update an existing resource by its id (or create it if it is new).- Specified by:
updatein 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:FHIRClientInvokes the 'update' FHIR REST API operation to update an existing resource by its id (or create it if it is new).- Specified by:
updatein 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:FHIRClientInvokes 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:
conditionalUpdatein 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:FHIRClientInvokes 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:
conditionalUpdatein 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:FHIRClientInvokes the 'delete' FHIR REST API operation to delete a resource.- Specified by:
deletein 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:FHIRClientInvokes the 'conditional delete' FHIR REST API operation to conditionally delete a resource.- Specified by:
conditionalDeletein 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:FHIRClientInvokes the 'read' FHIR REST API operation to read the current state of a resource.- Specified by:
readin 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:FHIRClientInvokes the 'vread' FHIR REST API operation to read the state of a specific version of a resource.- Specified by:
vreadin 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:FHIRClientInvokes the type-level 'history' FHIR REST API operation to retrieve the change history for a particular resource type.- Specified by:
historyin 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:FHIRClientInvokes the system-level 'history' FHIR REST API operation to retrieve the change history for all resources.- Specified by:
historyin 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:FHIRClientInvokes the type-level 'search' FHIR REST API operation to search the resource type based on some filter criteria.- Specified by:
searchin 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:FHIRClientInvokes the type-level 'search' FHIR REST API operation via HTTP POST.- Specified by:
_searchin 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:FHIRClientInvokes the system-level 'search' FHIR REST API operation to search across all resource types based on some filter criteria.- Specified by:
searchAllin 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:FHIRClientInvokes the 'validate' FHIR extended operation.- Specified by:
validatein 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:FHIRClientInvokes the 'validate' FHIR extended operation.- Specified by:
validatein 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:FHIRClientInvokes the 'batch/transaction' FHIR REST API operation for a request bundle of type 'batch'.- Specified by:
batchin 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:FHIRClientInvokes the 'batch/transaction' FHIR REST API operation for a request bundle of type 'transaction'.- Specified by:
transactionin 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:FHIRClientInvokes a FHIR extended operation at the system level via HTTP GET.- Specified by:
invokein 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:FHIRClientInvokes a FHIR extended operation at the system level via HTTP POST.- Specified by:
invokein 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:FHIRClientInvokes a FHIR extended operation at the type level via HTTP GET.- Specified by:
invokein 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:FHIRClientInvokes a FHIR extended operation at the type level via HTTP POST.- Specified by:
invokein 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:FHIRClientInvokes a FHIR extended operation at the instance level via HTTP GET.- Specified by:
invokein 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:FHIRClientInvokes a FHIR extended operation at the instance level via HTTP POST.- Specified by:
invokein 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:FHIRClientInvokes a FHIR extended operation at the instance version level via HTTP GET.- Specified by:
invokein 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:FHIRClientInvokes a FHIR extended operation at the instance version level via HTTP POST.- Specified by:
invokein 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:FHIRClientReturns the default FHIR base URL that is configured for this client instance- Specified by:
getDefaultBaseUrlin interfaceFHIRClient- Returns:
- the FHIR base URL with scheme, host, and path
-
getWebTarget
public javax.ws.rs.client.WebTarget getWebTarget() throws java.lang.ExceptionDescription copied from interface:FHIRClientReturns a JAX-RS 2.0 WebTarget object associated with the REST API endpoint.- Specified by:
getWebTargetin 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.ExceptionDescription copied from interface:FHIRClientReturns a JAX-RS 2.0 WebTarget object associated with a given REST API endpoint.- Specified by:
getWebTargetin 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.ExceptionDescription copied from interface:FHIRClientSets the default mime-type to be used by the FHIRClient interface when invoking REST API operations.- Specified by:
setDefaultMimeTypein 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.ExceptionDescription copied from interface:FHIRClientReturns a string that represents the default mime-type associated with the FHIRClient interface.- Specified by:
getDefaultMimeTypein interfaceFHIRClient- Throws:
java.lang.Exception
-
setOAuth2AccessToken
public void setOAuth2AccessToken(java.lang.String accessToken) throws java.lang.ExceptionDescription copied from interface:FHIRClientSets the OAuth 2.0 access token to be used by the FHIRClient interface for authorization when invoking REST API operations.- Specified by:
setOAuth2AccessTokenin 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.ExceptionDescription copied from interface:FHIRClientReturns a string that represents the OAuth 2.0 access token to be used by the FHIRClient interface for authorization requests.- Specified by:
getOAuth2AccessTokenin interfaceFHIRClient- Throws:
java.lang.Exception
-
getTrustStore
public java.security.KeyStore getTrustStore()
Description copied from interface:FHIRClientAllow the client consumer to be able to get and reuse the same TrustStore if necessary.- Specified by:
getTrustStorein 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:FHIRClientGet the value of the tenant name the client is currently configured to use- Specified by:
getTenantIdin interfaceFHIRClient- Returns:
-
-