Disable automatic bundle inclusion for now

This commit is contained in:
James Agnew 2015-03-12 10:01:49 -04:00
parent 7f9b1baa14
commit c9e54e3a20
2 changed files with 13 additions and 14 deletions

View File

@ -6,16 +6,15 @@ import ca.uhn.fhir.util.ResourceReferenceInfo;
import java.util.Set; import java.util.Set;
/** /**
* Created by Bill de Beaubien on 3/4/2015. * Used to set server bahaviour for adding included resources when responding to search operations.
* *
* Controls how bundles decide whether referenced resources should be included * @author Created by Bill de Beaubien on 3/4/2015.
* @see RestfulServer#setBundleInclusionRule(BundleInclusionRule)
*/ */
public enum BundleInclusionRule { public enum BundleInclusionRule {
/** /**
* Decision is based on whether the resource's Include is in the IncludeSet (e.g. DiagnosticReport.result). Note that * Decision is based on whether the resource's Include is in the IncludeSet (e.g. DiagnosticReport.result). Note that
* the resource has to be populated to be included. * the resource has to be populated to be included.
*
* This is the default behavior
*/ */
BASED_ON_INCLUDES { BASED_ON_INCLUDES {
@Override @Override
@ -27,8 +26,6 @@ public enum BundleInclusionRule {
/** /**
* Decision is based on whether the resource reference is set to a populated resource (in which case its included) or just * Decision is based on whether the resource reference is set to a populated resource (in which case its included) or just
* an id (in which case it's not included) * an id (in which case it's not included)
*
* This is the original HAPI behavior
*/ */
BASED_ON_RESOURCE_PRESENCE { BASED_ON_RESOURCE_PRESENCE {
@Override @Override

View File

@ -27,7 +27,14 @@ import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.UnavailableException; import javax.servlet.UnavailableException;
@ -37,7 +44,6 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.hl7.fhir.instance.model.IBaseResource; import org.hl7.fhir.instance.model.IBaseResource;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
@ -45,8 +51,6 @@ import ca.uhn.fhir.context.ProvidedResourceScanner;
import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.base.resource.BaseOperationOutcome;
import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue;
import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.annotation.Destroy; import ca.uhn.fhir.rest.annotation.Destroy;
import ca.uhn.fhir.rest.annotation.IdParam; import ca.uhn.fhir.rest.annotation.IdParam;
@ -54,12 +58,10 @@ import ca.uhn.fhir.rest.method.BaseMethodBinding;
import ca.uhn.fhir.rest.method.ConformanceMethodBinding; import ca.uhn.fhir.rest.method.ConformanceMethodBinding;
import ca.uhn.fhir.rest.method.OtherOperationTypeEnum; import ca.uhn.fhir.rest.method.OtherOperationTypeEnum;
import ca.uhn.fhir.rest.method.Request; import ca.uhn.fhir.rest.method.Request;
import ca.uhn.fhir.rest.method.RequestDetails;
import ca.uhn.fhir.rest.method.SearchMethodBinding; import ca.uhn.fhir.rest.method.SearchMethodBinding;
import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType; import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType;
import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.NotModifiedException; import ca.uhn.fhir.rest.server.exceptions.NotModifiedException;
import ca.uhn.fhir.rest.server.interceptor.ExceptionHandlingInterceptor; import ca.uhn.fhir.rest.server.interceptor.ExceptionHandlingInterceptor;
@ -78,7 +80,7 @@ public class RestfulServer extends HttpServlet {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private AddProfileTagEnum myAddProfileTag; private AddProfileTagEnum myAddProfileTag;
private BundleInclusionRule myBundleInclusionRule = BundleInclusionRule.BASED_ON_INCLUDES; private BundleInclusionRule myBundleInclusionRule = BundleInclusionRule.BASED_ON_RESOURCE_PRESENCE;
private boolean myDefaultPrettyPrint = false; private boolean myDefaultPrettyPrint = false;
private EncodingEnum myDefaultResponseEncoding = EncodingEnum.XML; private EncodingEnum myDefaultResponseEncoding = EncodingEnum.XML;
private ETagSupportEnum myETagSupport = DEFAULT_ETAG_SUPPORT; private ETagSupportEnum myETagSupport = DEFAULT_ETAG_SUPPORT;