Package ca.uhn.fhir.rest.client.api
Interface IGenericClient
-
- All Superinterfaces:
IRestfulClient
public interface IGenericClient extends IRestfulClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description IFetchConformanceUntypedcapabilities()Fetch the capability statement for the serverICreatecreate()Fluent method for the "create" operation, which creates a new resource instance on the serverIDeletedelete()Fluent method for the "delete" operation, which performs a logical delete on a server resourceIFetchConformanceUntypedfetchConformance()Deprecated.As of HAPI 3.0.0 this method has been deprecated, as the operation is now called "capabilities".voidforceConformanceCheck()Force the client to fetch the server's conformance statement and validate that it is appropriate for this client.IHistoryhistory()Implementation of the "history" methodIGetPageloadPage()Loads the previous/next bundle of resources from a paged set, using the link specified in the "link type=next" tag within the atom bundle.IMetameta()Fluent method for the "meta" operations, which can be used to get, add and remove tags and other Meta elements from a resource or across the server.IOperationoperation()Implementation of the FHIR "extended operations" actionIPatchpatch()Fluent method for the "patch" operation, which performs a logical patch on a server resourceIReadread()Fluent method for "read" and "vread" methods.IBaseResourceread(UriDt theUrl)Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)<T extends IBaseResource>
Tread(Class<T> theType, UriDt theUrl)Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)<T extends IBaseResource>
Tread(Class<T> theType, String theId)Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)voidregisterInterceptor(Object theInterceptor)Register a new interceptor for this client.<T extends IBaseBundle>
IUntypedQuery<T>search()Search for resources matching a given set of criteria.voidsetLogRequestAndResponse(boolean theLogRequestAndResponse)Deprecated.Use LoggingInterceptor as a client interceptor registered to your client instead, as this provides much more fine-grained control over what is logged.ITransactiontransaction()Send a transaction (collection of resources) to the server to be executed as a single unitvoidunregisterInterceptor(Object theInterceptor)Remove an intercaptor that was previously registered usingIRestfulClient.registerInterceptor(Object)IUpdateupdate()Fluent method for the "update" operation, which performs a logical delete on a server resourceMethodOutcomeupdate(IdDt theId, IBaseResource theResource)Deprecated.Useupdate() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)MethodOutcomeupdate(String theId, IBaseResource theResource)Deprecated.Useupdate() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)IValidatevalidate()Validate a resourceMethodOutcomevalidate(IBaseResource theResource)Deprecated.Usevalidate() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)<T extends IBaseResource>
Tvread(Class<T> theType, IdDt theId)Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)<T extends IBaseResource>
Tvread(Class<T> theType, String theId, String theVersionId)Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)-
Methods inherited from interface ca.uhn.fhir.rest.client.api.IRestfulClient
fetchResourceFromUrl, getEncoding, getFhirContext, getHttpClient, getInterceptorService, getServerBase, setEncoding, setFormatParamStyle, setInterceptorService, setPrettyPrint, setSummary
-
-
-
-
Method Detail
-
capabilities
IFetchConformanceUntyped capabilities()
Fetch the capability statement for the server
-
create
ICreate create()
Fluent method for the "create" operation, which creates a new resource instance on the server
-
delete
IDelete delete()
Fluent method for the "delete" operation, which performs a logical delete on a server resource
-
fetchConformance
IFetchConformanceUntyped fetchConformance()
Deprecated.As of HAPI 3.0.0 this method has been deprecated, as the operation is now called "capabilities". Usecapabilities()insteadRetrieves the server's conformance statement
-
forceConformanceCheck
void forceConformanceCheck() throws FhirClientConnectionException
Force the client to fetch the server's conformance statement and validate that it is appropriate for this client.- Throws:
FhirClientConnectionException- if the conformance statement cannot be read, or if the clientFhirClientInappropriateForServerException- If the conformance statement indicates that the server is inappropriate for this client (e.g. it implements the wrong version of FHIR)
-
loadPage
IGetPage loadPage()
Loads the previous/next bundle of resources from a paged set, using the link specified in the "link type=next" tag within the atom bundle.
-
meta
IMeta meta()
Fluent method for the "meta" operations, which can be used to get, add and remove tags and other Meta elements from a resource or across the server.- Since:
- 1.1
-
operation
IOperation operation()
Implementation of the FHIR "extended operations" action
-
patch
IPatch patch()
Fluent method for the "patch" operation, which performs a logical patch on a server resource
-
read
@Deprecated <T extends IBaseResource> T read(Class<T> theType, String theId)
Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)Implementation of the "instance read" method.- Parameters:
theType- The type of resource to loadtheId- The ID to load- Returns:
- The resource
-
read
@Deprecated <T extends IBaseResource> T read(Class<T> theType, UriDt theUrl)
Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)Perform the "read" operation (retrieve the latest version of a resource instance by ID) using an absolute URL.- Parameters:
theType- The resource type that is being retrievedtheUrl- The absolute URL, e.g. "http://example.com/fhir/Patient/123"- Returns:
- The returned resource from the server
-
read
@Deprecated IBaseResource read(UriDt theUrl)
Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)Perform the "read" operation (retrieve the latest version of a resource instance by ID) using an absolute URL.- Parameters:
theUrl- The absolute URL, e.g. "http://example.com/fhir/Patient/123"- Returns:
- The returned resource from the server
-
registerInterceptor
void registerInterceptor(Object theInterceptor)
Register a new interceptor for this client. An interceptor can be used to add additional logging, or add security headers, or pre-process responses, etc.- Specified by:
registerInterceptorin interfaceIRestfulClient
-
search
<T extends IBaseBundle> IUntypedQuery<T> search()
Search for resources matching a given set of criteria. Searching is a very powerful feature in FHIR with many features for specifying exactly what should be seaerched for and how it should be returned. See the specification on search for more information.
-
setLogRequestAndResponse
@Deprecated void setLogRequestAndResponse(boolean theLogRequestAndResponse)
Deprecated.Use LoggingInterceptor as a client interceptor registered to your client instead, as this provides much more fine-grained control over what is logged. This method will be removed at some point (deprecated in HAPI 1.6 - 2016-06-16)If set totrue, the client will log all requests and all responses. This is probably not a good production setting since it will result in a lot of extra logging, but it can be useful for troubleshooting.- Parameters:
theLogRequestAndResponse- Should requests and responses be logged
-
transaction
ITransaction transaction()
Send a transaction (collection of resources) to the server to be executed as a single unit
-
unregisterInterceptor
void unregisterInterceptor(Object theInterceptor)
Remove an intercaptor that was previously registered usingIRestfulClient.registerInterceptor(Object)- Specified by:
unregisterInterceptorin interfaceIRestfulClient
-
update
IUpdate update()
Fluent method for the "update" operation, which performs a logical delete on a server resource
-
update
@Deprecated MethodOutcome update(IdDt theId, IBaseResource theResource)
Deprecated.Useupdate() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)Implementation of the "instance update" method.- Parameters:
theId- The ID to updatetheResource- The new resource body- Returns:
- An outcome containing the results and possibly the new version ID
-
update
@Deprecated MethodOutcome update(String theId, IBaseResource theResource)
Deprecated.Useupdate() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)Implementation of the "instance update" method.- Parameters:
theId- The ID to updatetheResource- The new resource body- Returns:
- An outcome containing the results and possibly the new version ID
-
validate
@Deprecated MethodOutcome validate(IBaseResource theResource)
Deprecated.Usevalidate() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)Implementation of the "type validate" method.- Parameters:
theResource- The resource to validate- Returns:
- An outcome containing any validation issues
-
vread
@Deprecated <T extends IBaseResource> T vread(Class<T> theType, IdDt theId)
Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)Implementation of the "instance vread" method. Note that this method expectstheIdto contain a resource ID as well as a version ID, and will fail if it does not.Note that if an absolute resource ID is passed in (i.e. a URL containing a protocol and host as well as the resource type and ID) the server base for the client will be ignored, and the URL passed in will be queried.
- Parameters:
theType- The type of resource to loadtheId- The ID to load, including the resource ID and the resource version ID. Valid values include "Patient/123/_history/222", or "http://example.com/fhir/Patient/123/_history/222"- Returns:
- The resource
-
vread
@Deprecated <T extends IBaseResource> T vread(Class<T> theType, String theId, String theVersionId)
Deprecated.Useread() fluent methodinstead (deprecated in HAPI FHIR 3.0.0)Implementation of the "instance vread" method.- Parameters:
theType- The type of resource to loadtheId- The ID to loadtheVersionId- The version ID- Returns:
- The resource
-
-