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
ConstructorsConstructorDescriptionFHIRToolingClient(String baseServiceUrl)FHIRToolingClient(String baseServiceUrl, String username, String password) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureProxy(String proxyHost, int proxyPort)voidexpandValueset(ValueSet source, Parameters expParams)expandValueset(ValueSet source, Parameters expParams, Map<String,String> params)<T extends Resource>
TgetCanonical(Class<T> resourceClass, String canonicalURL)org.hl7.fhir.utilities.ToolingClientLoggerintintintprotected 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>
TvoidsetLogger(org.hl7.fhir.utilities.ToolingClientLogger logger)voidsetMaximumRecordCount(int maxResultSetSize)voidsetPassword(String password)voidsetPreferredResourceFormat(ResourceFormat resourceFormat)voidsetRetryCount(int retryCount)voidsetTimeout(int timeout)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:
- Constant Field Values
-
DATE_FORMAT
- See Also:
- Constant Field Values
-
hostKey
- See Also:
- Constant Field Values
-
portKey
- See Also:
- Constant Field Values
-
-
Constructor Details
-
FHIRToolingClient
- Throws:
URISyntaxException
-
FHIRToolingClient
public FHIRToolingClient(String baseServiceUrl, String username, String password) throws URISyntaxException- Throws:
URISyntaxException
-
-
Method Details
-
configureProxy
-
detectProxy
-
initialize
- Throws:
URISyntaxException
-
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
-
getTimeout
-
setTimeout
-
getUsername
-
setUsername
-
getPassword
-
setPassword
-
getLogger
-
setLogger
-
getRetryCount
-
setRetryCount
-