Package org.hl7.fhir.dstu2.utils.client
Class FHIRToolingClient
- java.lang.Object
-
- org.hl7.fhir.dstu2.utils.client.FHIRToolingClient
-
public class FHIRToolingClient extends Object
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:
Default Accept and Content-Type headers are application/xml+fhir and application/j+fhir. These can be changed by invoking the following setter functions:FHIRSimpleClient fhirClient = new FHIRSimpleClient(); fhirClient.initialize("http://my.fhir.domain/myServiceRoot");
TODO Review all sad paths.setPreferredResourceFormat() setPreferredFeedFormat()- Author:
- Claude Nanjo
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATE_FORMATstatic StringDATETIME_FORMAT
-
Constructor Summary
Constructors Constructor Description FHIRToolingClient(String baseServiceUrl)
-
Method Summary
-
-
-
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
-
-
Constructor Detail
-
FHIRToolingClient
public FHIRToolingClient(String baseServiceUrl) throws URISyntaxException
- Throws:
URISyntaxException
-
-
Method Detail
-
configureProxy
public void configureProxy(String proxyHost, int proxyPort)
-
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)
-
getConformanceStatement
public Conformance getConformanceStatement() throws EFhirClientException
- Throws:
EFhirClientException
-
getConformanceStatement
public Conformance getConformanceStatement(boolean useOptionsVerb)
-
getConformanceStatementQuick
public Conformance getConformanceStatementQuick() throws EFhirClientException
- Throws:
EFhirClientException
-
getConformanceStatementQuick
public Conformance getConformanceStatementQuick(boolean useOptionsVerb)
-
operateType
public <T extends Resource> Parameters operateType(Class<T> resourceClass, String name, Parameters params)
-
transaction
public Bundle transaction(Bundle batch)
-
validate
public <T extends Resource> OperationOutcome validate(Class<T> resourceClass, T resource, String id)
-
handleException
protected void handleException(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:
-
expandValueset
public ValueSet expandValueset(ValueSet source)
-
lookupCode
public Parameters lookupCode(Map<String,String> params)
-
expandValueset
public ValueSet expandValueset(ValueSet source, Parameters expParams, Map<String,String> params)
-
getAddress
public String getAddress()
-
initializeClosure
public ConceptMap initializeClosure(String name)
-
updateClosure
public ConceptMap updateClosure(String name, Coding coding)
-
getTerminologyCapabilities
public Parameters getTerminologyCapabilities()
-
-