public class RestfulServerUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RestfulServerUtils.ResponseEncoding
Return type for
determineRequestEncodingNoDefault(RequestDetails) |
| Constructor and Description |
|---|
RestfulServerUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
configureResponseParser(RequestDetails theRequestDetails,
ca.uhn.fhir.parser.IParser parser) |
static String |
createEtag(String theVersionId) |
static String |
createPagingLink(Set<ca.uhn.fhir.model.api.Include> theIncludes,
RequestDetails theRequestDetails,
String theSearchId,
int theOffset,
int theCount,
Map<String,String[]> theRequestParameters,
boolean thePrettyPrint,
ca.uhn.fhir.model.valueset.BundleTypeEnum theBundleType) |
static String |
createPagingLink(Set<ca.uhn.fhir.model.api.Include> theIncludes,
RequestDetails theRequestDetails,
String theSearchId,
String thePageId,
Map<String,String[]> theRequestParameters,
boolean thePrettyPrint,
ca.uhn.fhir.model.valueset.BundleTypeEnum theBundleType) |
static ca.uhn.fhir.rest.api.EncodingEnum |
determineRequestEncoding(RequestDetails theReq) |
static ca.uhn.fhir.rest.api.EncodingEnum |
determineRequestEncodingNoDefault(RequestDetails theReq) |
static RestfulServerUtils.ResponseEncoding |
determineResponseEncodingNoDefault(RequestDetails theReq,
ca.uhn.fhir.rest.api.EncodingEnum thePrefer)
Returns null if the request doesn't express that it wants FHIR.
|
static RestfulServerUtils.ResponseEncoding |
determineResponseEncodingNoDefault(RequestDetails theReq,
ca.uhn.fhir.rest.api.EncodingEnum thePrefer,
String thePreferContentType)
Try to determing the response content type, given the request Accept header and
_format parameter.
|
static RestfulServerUtils.ResponseEncoding |
determineResponseEncodingWithDefault(RequestDetails theReq)
Determine whether a response should be given in JSON or XML format based on the incoming HttpServletRequest's
"_format" parameter and "Accept:" HTTP header. |
static Set<ca.uhn.fhir.rest.api.SummaryEnum> |
determineSummaryMode(RequestDetails theRequest) |
static Integer |
extractCountParameter(RequestDetails theRequest) |
static org.hl7.fhir.instance.model.api.IPrimitiveType<Date> |
extractLastUpdatedFromResource(org.hl7.fhir.instance.model.api.IBaseResource theResource) |
static org.hl7.fhir.instance.model.api.IIdType |
fullyQualifyResourceIdOrReturnNull(IRestfulServerDefaults theServer,
org.hl7.fhir.instance.model.api.IBaseResource theResource,
String theServerBase,
org.hl7.fhir.instance.model.api.IIdType theResourceId) |
static ca.uhn.fhir.parser.IParser |
getNewParser(ca.uhn.fhir.context.FhirContext theContext,
ca.uhn.fhir.context.FhirVersionEnum theForVersion,
RequestDetails theRequestDetails) |
static Set<String> |
parseAcceptHeaderAndReturnHighestRankedOptions(javax.servlet.http.HttpServletRequest theRequest) |
static ca.uhn.fhir.rest.api.PreferReturnEnum |
parsePreferHeader(String theValue) |
static boolean |
prettyPrintResponse(IRestfulServerDefaults theServer,
RequestDetails theRequest) |
static Object |
streamResponseAsResource(IRestfulServerDefaults theServer,
org.hl7.fhir.instance.model.api.IBaseResource theResource,
Set<ca.uhn.fhir.rest.api.SummaryEnum> theSummaryMode,
int stausCode,
boolean theAddContentLocationHeader,
boolean respondGzip,
RequestDetails theRequestDetails) |
static Object |
streamResponseAsResource(IRestfulServerDefaults theServer,
org.hl7.fhir.instance.model.api.IBaseResource theResource,
Set<ca.uhn.fhir.rest.api.SummaryEnum> theSummaryMode,
int theStatusCode,
String theStatusMessage,
boolean theAddContentLocationHeader,
boolean respondGzip,
RequestDetails theRequestDetails,
org.hl7.fhir.instance.model.api.IIdType theOperationResourceId,
org.hl7.fhir.instance.model.api.IPrimitiveType<Date> theOperationResourceLastUpdated) |
static Integer |
tryToExtractNamedParameter(RequestDetails theRequest,
String theParamName) |
static void |
validateResourceListNotNull(List<? extends org.hl7.fhir.instance.model.api.IBaseResource> theResourceList) |
public RestfulServerUtils()
public static void configureResponseParser(RequestDetails theRequestDetails, ca.uhn.fhir.parser.IParser parser)
public static String createPagingLink(Set<ca.uhn.fhir.model.api.Include> theIncludes, RequestDetails theRequestDetails, String theSearchId, int theOffset, int theCount, Map<String,String[]> theRequestParameters, boolean thePrettyPrint, ca.uhn.fhir.model.valueset.BundleTypeEnum theBundleType)
public static String createPagingLink(Set<ca.uhn.fhir.model.api.Include> theIncludes, RequestDetails theRequestDetails, String theSearchId, String thePageId, Map<String,String[]> theRequestParameters, boolean thePrettyPrint, ca.uhn.fhir.model.valueset.BundleTypeEnum theBundleType)
public static ca.uhn.fhir.rest.api.EncodingEnum determineRequestEncoding(RequestDetails theReq)
public static ca.uhn.fhir.rest.api.EncodingEnum determineRequestEncodingNoDefault(RequestDetails theReq)
public static RestfulServerUtils.ResponseEncoding determineResponseEncodingNoDefault(RequestDetails theReq, ca.uhn.fhir.rest.api.EncodingEnum thePrefer)
public static RestfulServerUtils.ResponseEncoding determineResponseEncodingNoDefault(RequestDetails theReq, ca.uhn.fhir.rest.api.EncodingEnum thePrefer, String thePreferContentType)
public static RestfulServerUtils.ResponseEncoding determineResponseEncodingWithDefault(RequestDetails theReq)
"_format" parameter and "Accept:" HTTP header.public static Set<ca.uhn.fhir.rest.api.SummaryEnum> determineSummaryMode(RequestDetails theRequest)
public static Integer extractCountParameter(RequestDetails theRequest)
public static org.hl7.fhir.instance.model.api.IPrimitiveType<Date> extractLastUpdatedFromResource(org.hl7.fhir.instance.model.api.IBaseResource theResource)
public static org.hl7.fhir.instance.model.api.IIdType fullyQualifyResourceIdOrReturnNull(IRestfulServerDefaults theServer, org.hl7.fhir.instance.model.api.IBaseResource theResource, String theServerBase, org.hl7.fhir.instance.model.api.IIdType theResourceId)
public static ca.uhn.fhir.parser.IParser getNewParser(ca.uhn.fhir.context.FhirContext theContext, ca.uhn.fhir.context.FhirVersionEnum theForVersion, RequestDetails theRequestDetails)
public static Set<String> parseAcceptHeaderAndReturnHighestRankedOptions(javax.servlet.http.HttpServletRequest theRequest)
public static ca.uhn.fhir.rest.api.PreferReturnEnum parsePreferHeader(String theValue)
public static boolean prettyPrintResponse(IRestfulServerDefaults theServer, RequestDetails theRequest)
public static Object streamResponseAsResource(IRestfulServerDefaults theServer, org.hl7.fhir.instance.model.api.IBaseResource theResource, Set<ca.uhn.fhir.rest.api.SummaryEnum> theSummaryMode, int stausCode, boolean theAddContentLocationHeader, boolean respondGzip, RequestDetails theRequestDetails) throws IOException
IOExceptionpublic static Object streamResponseAsResource(IRestfulServerDefaults theServer, org.hl7.fhir.instance.model.api.IBaseResource theResource, Set<ca.uhn.fhir.rest.api.SummaryEnum> theSummaryMode, int theStatusCode, String theStatusMessage, boolean theAddContentLocationHeader, boolean respondGzip, RequestDetails theRequestDetails, org.hl7.fhir.instance.model.api.IIdType theOperationResourceId, org.hl7.fhir.instance.model.api.IPrimitiveType<Date> theOperationResourceLastUpdated) throws IOException
IOExceptionpublic static String createEtag(String theVersionId)
public static Integer tryToExtractNamedParameter(RequestDetails theRequest, String theParamName)
public static void validateResourceListNotNull(List<? extends org.hl7.fhir.instance.model.api.IBaseResource> theResourceList)
Copyright © 2014–2019 University Health Network. All rights reserved.