Package org.hl7.fhir.r4.utils.client
Class FHIRToolingClient
- java.lang.Object
-
- org.hl7.fhir.utilities.FHIRBaseToolingClient
-
- org.hl7.fhir.r4.utils.client.FHIRToolingClient
-
public class FHIRToolingClient extends org.hl7.fhir.utilities.FHIRBaseToolingClient
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 Modifier and Type Field Description static StringDATE_FORMATstatic StringDATETIME_FORMATstatic StringhostKeystatic StringportKey
-
Constructor Summary
Constructors Constructor Description FHIRToolingClient(String baseServiceUrl, String userAgent)
-
Method Summary
-
Methods inherited from class org.hl7.fhir.utilities.FHIRBaseToolingClient
getTimeoutEntry, getTimeoutExpand, getTimeoutLong, getTimeoutNormal, getTimeoutOperation, isVersionInMimeTypes, setTimeoutEntry, setTimeoutExpand, setTimeoutFactor, setTimeoutLong, setTimeoutNormal, setTimeoutOperation, setVersionInMimeTypes, withVer
-
-
-
-
Field Detail
-
DATETIME_FORMAT
public static final String DATETIME_FORMAT
- See Also:
- Constant Field Values
-
DATE_FORMAT
public static final String DATE_FORMAT
- See Also:
- Constant Field Values
-
hostKey
public static final String hostKey
- See Also:
- Constant Field Values
-
portKey
public static final String portKey
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FHIRToolingClient
public FHIRToolingClient(String baseServiceUrl, String userAgent) throws URISyntaxException
- Throws:
URISyntaxException
-
-
Method Detail
-
initialize
public void initialize(String baseServiceUrl) throws URISyntaxException
- Throws:
URISyntaxException
-
getPreferredResourceFormat
public String getPreferredResourceFormat()
-
setPreferredResourceFormat
public void setPreferredResourceFormat(ResourceFormat resourceFormat)
-
getMaximumRecordCount
public int getMaximumRecordCount()
-
setMaximumRecordCount
public void setMaximumRecordCount(int maxResultSetSize)
-
getTerminologyCapabilities
public TerminologyCapabilities getTerminologyCapabilities()
-
getCapabilitiesStatement
public CapabilityStatement getCapabilitiesStatement()
-
getCapabilitiesStatementQuick
public CapabilityStatement getCapabilitiesStatementQuick() throws EFhirClientException
- Throws:
EFhirClientException
-
getCanonical
public <T extends Resource> T getCanonical(Class<T> resourceClass, String canonicalURL)
-
operateType
public <T extends Resource> Parameters operateType(Class<T> resourceClass, String name, Parameters params) throws IOException
- Throws:
IOException
-
transaction
public Bundle transaction(Bundle batch)
-
validate
public <T extends Resource> OperationOutcome validate(Class<T> resourceClass, T resource, String id)
-
handleException
protected void handleException(int code, String message, Exception e) throws EFhirClientException
Helper method to prevent nesting of previously thrown EFhirClientExceptions- Parameters:
e-- Throws:
EFhirClientException
-
isJson
protected boolean isJson(String format)
Helper method to determine whether desired resource representation is Json or XML.- Parameters:
format-- Returns:
-
lookupCode
public Parameters lookupCode(Map<String,String> params)
-
lookupCode
public Parameters lookupCode(Parameters p)
-
translate
public Parameters translate(Parameters p)
-
expandValueset
public ValueSet expandValueset(ValueSet source, Parameters expParams)
-
getAddress
public String getAddress()
-
initializeClosure
public ConceptMap initializeClosure(String name)
-
updateClosure
public ConceptMap updateClosure(String name, Coding coding)
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
-
getLogger
public org.hl7.fhir.utilities.ToolingClientLogger getLogger()
-
setLogger
public void setLogger(org.hl7.fhir.utilities.ToolingClientLogger logger)
-
getRetryCount
public int getRetryCount()
-
setRetryCount
public void setRetryCount(int retryCount)
-
setClientHeaders
public void setClientHeaders(ArrayList<okhttp3.internal.http2.Header> headers)
-
basicAuthHeaderExists
public boolean basicAuthHeaderExists()
-
getAuthorizationHeader
public okhttp3.internal.http2.Header getAuthorizationHeader()
-
getUserAgent
public String getUserAgent()
-
setUserAgent
public void setUserAgent(String userAgent)
-
getServerVersion
public String getServerVersion()
-
setAcceptLanguage
public void setAcceptLanguage(String lang)
-
setContentLanguage
public void setContentLanguage(String lang)
-
fetchResource
public <T extends Resource> T fetchResource(Class<T> resourceClass, String id)
-
getUseCount
public int getUseCount()
-
-