@Produces(value={"application/json","application/xml","text/plain","application/json+fhir","application/xml+fhir"})
@Consumes(value={"application/x-www-form-urlencoded","application/json","application/json+fhir","application/xml+fhir","application/fhir+json","application/fhir+xml","application/octet-stream"})
public abstract class AbstractJaxRsResourceProvider<R extends org.hl7.fhir.instance.model.api.IBaseResource>
extends AbstractJaxRsProvider
implements IRestfulServer<JaxRsRequest>, IResourceProvider
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractJaxRsResourceProvider()
The default constructor.
|
protected |
AbstractJaxRsResourceProvider(Class<? extends AbstractJaxRsProvider> theProviderClass)
This constructor takes in an explicit interface class.
|
protected |
AbstractJaxRsResourceProvider(ca.uhn.fhir.context.FhirContext ctx)
Provides the ability to specify the
FhirContext. |
protected |
AbstractJaxRsResourceProvider(ca.uhn.fhir.context.FhirContext ctx,
Class<? extends AbstractJaxRsProvider> theProviderClass)
This constructor takes in an explicit interface class.
|
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
conditionalUpdate(String resource)
Update an existing resource based on the given condition
|
javax.ws.rs.core.Response |
create(String resource)
Create a new resource with a server assigned id
|
protected javax.ws.rs.core.Response |
customOperation(String resource,
ca.uhn.fhir.rest.api.RequestTypeEnum requestType,
String id,
String operationName,
ca.uhn.fhir.rest.api.RestOperationTypeEnum operationType)
Execute a custom operation
|
javax.ws.rs.core.Response |
delete()
Delete a resource based on the given condition
|
javax.ws.rs.core.Response |
delete(String id)
Delete a resource
|
javax.ws.rs.core.Response |
find(String id)
Read the current state of the resource
|
javax.ws.rs.core.Response |
findCompartment(String id,
String compartment)
Compartment Based Access
|
javax.ws.rs.core.Response |
findHistory(String id,
String version)
Retrieve the update history for a particular resource
|
String |
getBaseForRequest()
The base for request for a resource provider has the following form:
getBaseForServer() + "/" +
getResourceType()
.getSimpleName() |
protected BaseMethodBinding<?> |
getBinding(ca.uhn.fhir.rest.api.RestOperationTypeEnum restOperation,
String theBindingKey)
Return the method binding for the given rest operation
|
JaxRsMethodBindings |
getBindings()
Return the bindings defined in this resource provider
|
ca.uhn.fhir.context.api.BundleInclusionRule |
getBundleInclusionRule()
Default: BundleInclusionRule.BASED_ON_INCLUDES
|
ca.uhn.fhir.rest.api.PreferReturnEnum |
getDefaultPreferReturn() |
IPagingProvider |
getPagingProvider()
Default: no paging provider
|
abstract Class<R> |
getResourceType()
The resource type should return conform to the generic resource included
in the topic
|
javax.ws.rs.core.Response |
search()
Search the resource type based on some filter criteria
|
javax.ws.rs.core.Response |
searchWithPost()
Search the resource type based on some filter criteria
|
javax.ws.rs.core.Response |
update(String id,
String resource)
Update an existing resource by its id (or create it if it is new)
|
javax.ws.rs.core.Response |
validate(String resource) |
getAddProfileTag, getBaseForServer, getDefaultResponseEncoding, getElementsSupport, getETagSupport, getFhirContext, getHeaders, getInterceptors_, getInterceptorService, getParameters, getRequest, getRequest, getServerAddressStrategy, getUriInfo, handleException, isDefaultPrettyPrint, setHeaders, setUriInfo, withStackTraceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAddProfileTag, getDefaultResponseEncoding, getElementsSupport, getETagSupport, getFhirContext, getInterceptors_, getInterceptorService, isDefaultPrettyPrintprotected AbstractJaxRsResourceProvider()
protected AbstractJaxRsResourceProvider(ca.uhn.fhir.context.FhirContext ctx)
FhirContext.ctx - the FhirContext instance.protected AbstractJaxRsResourceProvider(Class<? extends AbstractJaxRsProvider> theProviderClass)
theProviderClass - the interface of the classprotected AbstractJaxRsResourceProvider(ca.uhn.fhir.context.FhirContext ctx, Class<? extends AbstractJaxRsProvider> theProviderClass)
ctx - the FhirContext instance.theProviderClass - the interface of the classpublic String getBaseForRequest()
getBaseForServer() + "/" +
getResourceType()
.getSimpleName()getBaseForRequest in class AbstractJaxRsProvider@POST public javax.ws.rs.core.Response create(String resource) throws IOException
resource - the body of the post method containing resource being created in a xml/json formIOException@POST @Path(value="/_search") public javax.ws.rs.core.Response searchWithPost() throws IOException
IOException@GET public javax.ws.rs.core.Response search() throws IOException
IOException@PUT public javax.ws.rs.core.Response conditionalUpdate(String resource) throws IOException
resource - the body contents for the put methodIOException@PUT
@Path(value="/{id}")
public javax.ws.rs.core.Response update(@PathParam(value="id")
String id,
String resource)
throws IOException
id - the id of the resourceresource - the body contents for the put methodIOException@DELETE public javax.ws.rs.core.Response delete() throws IOException
IOException@DELETE
@Path(value="/{id}")
public javax.ws.rs.core.Response delete(@PathParam(value="id")
String id)
throws IOException
id - the id of the resource to deleteIOException@GET
@Path(value="/{id}")
public javax.ws.rs.core.Response find(@PathParam(value="id")
String id)
throws IOException
id - the id of the resource to readIOExceptionprotected javax.ws.rs.core.Response customOperation(String resource, ca.uhn.fhir.rest.api.RequestTypeEnum requestType, String id, String operationName, ca.uhn.fhir.rest.api.RestOperationTypeEnum operationType) throws IOException
resource - the resource to createrequestType - the type of requestid - the id of the resource on which to perform the operationoperationName - the name of the operation to executeoperationType - the rest operation typeIOException@GET
@Path(value="/{id}/_history/{version}")
public javax.ws.rs.core.Response findHistory(@PathParam(value="id")
String id,
@PathParam(value="version")
String version)
throws IOException
id - the id of the resourceversion - the version of the resourceIOException@GET
@Path(value="/{id}/{compartment}")
public javax.ws.rs.core.Response findCompartment(@PathParam(value="id")
String id,
@PathParam(value="compartment")
String compartment)
throws IOException
id - the resource to which the compartment belongscompartment - the compartmentIOException@POST @Path(value="/$validate") public javax.ws.rs.core.Response validate(String resource) throws IOException
IOExceptionprotected BaseMethodBinding<?> getBinding(ca.uhn.fhir.rest.api.RestOperationTypeEnum restOperation, String theBindingKey)
restOperation - the rest operation to retrievetheBindingKey - the key determining the method to be executed (needed for e.g. custom operation)public IPagingProvider getPagingProvider()
getPagingProvider in interface IRestfulServer<JaxRsRequest>getPagingProvider in interface IRestfulServerDefaultsgetPagingProvider in class AbstractJaxRsProviderpublic ca.uhn.fhir.context.api.BundleInclusionRule getBundleInclusionRule()
getBundleInclusionRule in interface IRestfulServer<JaxRsRequest>public ca.uhn.fhir.rest.api.PreferReturnEnum getDefaultPreferReturn()
getDefaultPreferReturn in interface IRestfulServer<JaxRsRequest>public abstract Class<R> getResourceType()
getResourceType in interface IResourceProviderpublic JaxRsMethodBindings getBindings()
Copyright © 2014–2019 University Health Network. All rights reserved.