
Package org.hl7.fhir.dstu3.utils.client
Class FHIRToolingClient
java.lang.Object
org.hl7.fhir.utilities.FHIRBaseToolingClient
org.hl7.fhir.dstu3.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 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpandValueset
(ValueSet source, Parameters expParams) org.hl7.fhir.utilities.FhirPublication
EnumSet
<org.hl7.fhir.utilities.FhirPublication> <T extends Resource>
TgetCanonical
(Class<T> resourceClass, String canonicalURL) org.hl7.fhir.utilities.ToolingClientLogger
int
int
long
protected void
handleException
(String message, Exception e) Helper method to prevent nesting of previously thrown EFhirClientExceptions.void
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
setAllowedVersions
(EnumSet<org.hl7.fhir.utilities.FhirPublication> versions) void
void
setClientHeaders
(Iterable<org.hl7.fhir.utilities.http.HTTPHeader> headers) void
setLogger
(org.hl7.fhir.utilities.ToolingClientLogger logger) void
setMaximumRecordCount
(int maxResultSetSize) void
setPreferredResourceFormat
(ResourceFormat resourceFormat) void
setRetryCount
(int retryCount) void
setTimeout
(long timeout) EnumSet
<org.hl7.fhir.utilities.FhirPublication> 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
-
supportableVersions
-
setAllowedVersions
-
getAllowedVersions
-
getActualVersion
-
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. If the e param is an instance of EFhirClientException, it will be rethrown. Otherwise, a new EFhirClientException will be thrown with e as the cause.- Parameters:
message
- The EFhirClientException message.e
- The exception- Throws:
EFhirClientException
- EFhirClientException representing the exception.
-
isJson
Helper method to determine whether desired resource representation is Json or XML.- Parameters:
format
- the format- Returns:
- true if the format is JSON, false otherwise
-
fetchFeed
-
lookupCode
-
lookupCode
-
transform
-
expandValueset
-
getAddress
-
initializeClosure
-
updateClosure
-
getTimeout
-
setTimeout
-
getLogger
-
setLogger
-
getRetryCount
-
setRetryCount
-
setClientHeaders
-
getServerVersion
-
search
-