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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.hl7.fhir.utilities.FHIRBaseToolingClient
timeoutEntry, timeoutExpand, timeoutLong, timeoutNormal, timeoutOperation, versionInMimeTypes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexpandValueset(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.ToolingClientLoggerintintlongintprotected voidhandleException(String message, Exception e) Helper method to prevent nesting of previously thrown EFhirClientExceptionsvoidinitialize(String baseServiceUrl) initializeClosure(String name) protected booleanHelper 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>
TvoidsetAcceptLanguage(String lang) voidvoidsetClientHeaders(ArrayList<okhttp3.internal.http2.Header> headers) voidsetContentLanguage(String lang) voidsetLogger(org.hl7.fhir.utilities.ToolingClientLogger logger) voidsetMaximumRecordCount(int maxResultSetSize) voidsetPassword(String password) voidsetPreferredResourceFormat(ResourceFormat resourceFormat) voidsetRetryCount(int retryCount) voidsetTimeout(long timeout) voidsetUserAgent(String userAgent) voidsetUsername(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
-