Package org.hl7.fhir.r5.utils.client
Class FHIRToolingClient
java.lang.Object
org.hl7.fhir.utilities.FHIRBaseToolingClient
org.hl7.fhir.r5.utils.client.FHIRToolingClient
Very Simple RESTful client. This is purely for use in the standalone
tools jar packages. It doesn't support many features, only what the tools
need.
To use, initialize class and set base service URI as follows:
FHIRSimpleClient fhirClient = new FHIRSimpleClient();
fhirClient.initialize("http://my.fhir.domain/myServiceRoot");
Default Accept and Content-Type headers are application/fhir+xml and application/fhir+json.
These can be changed by invoking the following setter functions:
setPreferredResourceFormat()
setPreferredFeedFormat()
TODO Review all sad paths.
- Author:
- Claude Nanjo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class org.hl7.fhir.utilities.FHIRBaseToolingClient
timeoutEntry, timeoutExpand, timeoutLong, timeoutNormal, timeoutOperation, versionInMimeTypes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
expandValueset
(ValueSet source, Parameters expParams) <T extends Resource>
TfetchResource
(Class<T> resourceClass, String id) okhttp3.internal.http2.Header
<T extends Resource>
TgetCanonical
(Class<T> resourceClass, String canonicalURL) org.hl7.fhir.utilities.ToolingClientLogger
int
int
long
int
protected void
handleException
(String message, Exception e) Helper method to prevent nesting of previously thrown EFhirClientExceptionsvoid
initialize
(String baseServiceUrl) initializeClosure
(String name) protected boolean
Helper method to determine whether desired resource representation is Json or XML.lookupCode
(Map<String, String> params) <T extends Resource>
ParametersoperateType
(Class<T> resourceClass, String name, Parameters params) <T extends Resource>
Tvoid
setAcceptLanguage
(String lang) void
void
setClientHeaders
(ArrayList<okhttp3.internal.http2.Header> headers) void
setContentLanguage
(String lang) void
setLogger
(org.hl7.fhir.utilities.ToolingClientLogger logger) void
setMaximumRecordCount
(int maxResultSetSize) void
setPassword
(String password) void
setPreferredResourceFormat
(ResourceFormat resourceFormat) void
setRetryCount
(int retryCount) void
setTimeout
(long timeout) void
setUserAgent
(String userAgent) void
setUsername
(String username) transaction
(Bundle batch) <T extends Resource>
TupdateClosure
(String name, Coding coding) <T extends Resource>
OperationOutcome<T extends Resource>
TMethods inherited from class org.hl7.fhir.utilities.FHIRBaseToolingClient
getTimeoutEntry, getTimeoutExpand, getTimeoutLong, getTimeoutNormal, getTimeoutOperation, isVersionInMimeTypes, setTimeoutEntry, setTimeoutExpand, setTimeoutFactor, setTimeoutLong, setTimeoutNormal, setTimeoutOperation, setVersionInMimeTypes, withVer
-
Field Details
-
DATETIME_FORMAT
- See Also:
-
DATE_FORMAT
- See Also:
-
hostKey
- See Also:
-
portKey
- See Also:
-
-
Constructor Details
-
FHIRToolingClient
- Throws:
URISyntaxException
-
-
Method Details
-
initialize
- Throws:
URISyntaxException
-
getClient
-
setClient
-
getPreferredResourceFormat
-
setPreferredResourceFormat
-
getMaximumRecordCount
-
setMaximumRecordCount
-
getTerminologyCapabilities
-
getCapabilitiesStatement
-
getCapabilitiesStatementQuick
- Throws:
EFhirClientException
-
read
-
read
-
vread
-
getCanonical
-
update
-
update
-
operateType
public <T extends Resource> Parameters operateType(Class<T> resourceClass, String name, Parameters params) -
transaction
-
validate
public <T extends Resource> OperationOutcome validate(Class<T> resourceClass, T resource, String id) -
handleException
Helper method to prevent nesting of previously thrown EFhirClientExceptions- Parameters:
e
-- Throws:
EFhirClientException
-
isJson
Helper method to determine whether desired resource representation is Json or XML.- Parameters:
format
-- Returns:
-
fetchFeed
-
expandValueset
-
lookupCode
-
lookupCode
-
translate
-
getAddress
-
initializeClosure
-
updateClosure
-
getUsername
-
setUsername
-
getPassword
-
setPassword
-
getTimeout
-
setTimeout
-
getLogger
-
setLogger
-
getRetryCount
-
setRetryCount
-
setClientHeaders
-
basicAuthHeaderExists
-
getAuthorizationHeader
-
getUserAgent
-
setUserAgent
-
getServerVersion
-
setAcceptLanguage
-
setContentLanguage
-
search
-
fetchResource
-
getUseCount
-