Package org.hl7.fhir.r4.utils.client
Class FHIRToolingClient
java.lang.Object
org.hl7.fhir.r4.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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexpandValueset(ValueSet source, Parameters expParams) expandValueset(ValueSet source, Parameters expParams, Map<String, String> params) okhttp3.internal.http2.Header<T extends Resource>
TgetCanonical(Class<T> resourceClass, String canonicalURL) org.hl7.fhir.utilities.ToolingClientLoggerintintlongprotected 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>
TvoidvoidsetClientHeaders(ArrayList<okhttp3.internal.http2.Header> headers) 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>
T
-
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
-
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
-
expandValueset
-
getAddress
-
initializeClosure
-
updateClosure
-
getUsername
-
setUsername
-
getPassword
-
setPassword
-
getTimeout
-
setTimeout
-
getLogger
-
setLogger
-
getRetryCount
-
setRetryCount
-
setClientHeaders
-
basicAuthHeaderExists
-
getAuthorizationHeader
-
getUserAgent
-
setUserAgent
-
getServerVersion
-