Merge 38b5b12322
into 3f6d1eb29b
This commit is contained in:
commit
4af9be6ebd
|
@ -25,6 +25,7 @@ import ca.uhn.fhir.context.BaseRuntimeElementDefinition;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||||
import ca.uhn.fhir.i18n.Msg;
|
import ca.uhn.fhir.i18n.Msg;
|
||||||
|
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
||||||
import ca.uhn.fhir.model.primitive.IdDt;
|
import ca.uhn.fhir.model.primitive.IdDt;
|
||||||
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
|
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
|
||||||
import ca.uhn.fhir.rest.api.PatchTypeEnum;
|
import ca.uhn.fhir.rest.api.PatchTypeEnum;
|
||||||
|
@ -595,6 +596,16 @@ public class BundleUtil {
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setSearchModeMetadata(FhirContext theContext, IBaseBundle theBundle) {
|
||||||
|
List<SearchBundleEntryParts> searchBundleEntryParts = getSearchBundleEntryParts(theContext, theBundle);
|
||||||
|
searchBundleEntryParts.forEach(searchBundleEntryPart -> {
|
||||||
|
IBaseResource resource = searchBundleEntryPart.getResource();
|
||||||
|
if (resource != null) {
|
||||||
|
ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.put(resource, searchBundleEntryPart.getSearchMode());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private static SearchBundleEntryParts getSearchBundleEntryParts(
|
private static SearchBundleEntryParts getSearchBundleEntryParts(
|
||||||
BaseRuntimeChildDefinition theFullUrlChildDef,
|
BaseRuntimeChildDefinition theFullUrlChildDef,
|
||||||
BaseRuntimeChildDefinition theResourceChildDef,
|
BaseRuntimeChildDefinition theResourceChildDef,
|
||||||
|
|
|
@ -128,6 +128,7 @@ import ca.uhn.fhir.rest.param.TokenParam;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
|
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
|
||||||
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.util.BundleUtil;
|
||||||
import ca.uhn.fhir.util.ICallable;
|
import ca.uhn.fhir.util.ICallable;
|
||||||
import ca.uhn.fhir.util.ParametersUtil;
|
import ca.uhn.fhir.util.ParametersUtil;
|
||||||
import ca.uhn.fhir.util.UrlUtil;
|
import ca.uhn.fhir.util.UrlUtil;
|
||||||
|
@ -582,7 +583,7 @@ public class GenericClient extends BaseClient implements IGenericClient {
|
||||||
myLastRequest = theInvocation.asHttpRequest(getServerBase(), theParams, getEncoding(), myPrettyPrint);
|
myLastRequest = theInvocation.asHttpRequest(getServerBase(), theParams, getEncoding(), myPrettyPrint);
|
||||||
}
|
}
|
||||||
|
|
||||||
Z resp = invokeClient(
|
return invokeClient(
|
||||||
myContext,
|
myContext,
|
||||||
theHandler,
|
theHandler,
|
||||||
theInvocation,
|
theInvocation,
|
||||||
|
@ -594,7 +595,6 @@ public class GenericClient extends BaseClient implements IGenericClient {
|
||||||
myCacheControlDirective,
|
myCacheControlDirective,
|
||||||
myCustomAcceptHeaderValue,
|
myCustomAcceptHeaderValue,
|
||||||
myCustomHeaderValues);
|
myCustomHeaderValues);
|
||||||
return resp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IBaseResource parseResourceBody(String theResourceBody) {
|
protected IBaseResource parseResourceBody(String theResourceBody) {
|
||||||
|
@ -2198,7 +2198,13 @@ public class GenericClient extends BaseClient implements IGenericClient {
|
||||||
myContext, myResourceName, params, resourceId, myCompartmentName, mySearchStyle);
|
myContext, myResourceName, params, resourceId, myCompartmentName, mySearchStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (OUTPUT) invoke(params, binding, invocation);
|
OUTPUT invoke = (OUTPUT) invoke(params, binding, invocation);
|
||||||
|
|
||||||
|
if (invoke instanceof IBaseBundle) {
|
||||||
|
BundleUtil.setSearchModeMetadata(myContext, (IBaseBundle) invoke);
|
||||||
|
}
|
||||||
|
|
||||||
|
return invoke;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue