private IBundleProvider doEverythingOperation(IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort, StringAndListParam theContent, StringAndListParam theNarrative, RequestDetails theRequestDetails) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } if (theContent != null) { paramMap.add(Constants.PARAM_CONTENT, theContent); } if (theNarrative != null) { paramMap.add(Constants.PARAM_TEXT, theNarrative); } paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setEverythingMode(theId != null ? EverythingModeEnum.PATIENT_INSTANCE : EverythingModeEnum.PATIENT_TYPE); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdated); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } if (!isPagingProviderDatabaseBacked(theRequestDetails)) { paramMap.setLoadSynchronous(true); } return mySearchCoordinatorSvc.registerSearch(this, paramMap, getResourceName(), new CacheControlDirective().parse(theRequestDetails.getHeaders(Constants.HEADER_CACHE_CONTROL))); }
if (theCacheControlDirective != null && theCacheControlDirective.isNoStore()) { if (theCacheControlDirective.getMaxResults() != null) { loadSynchronousUpTo = theCacheControlDirective.getMaxResults(); if (loadSynchronousUpTo > myDaoConfig.getCacheControlNoStoreMaxResultsUpperLimit()) { throw new InvalidRequestException(Constants.HEADER_CACHE_CONTROL + " header " + Constants.CACHE_CONTROL_MAX_RESULTS + " value must not exceed " + myDaoConfig.getCacheControlNoStoreMaxResultsUpperLimit()); if (theCacheControlDirective != null && theCacheControlDirective.isNoCache() == true) { useCache = false;
@Override public IBundleProvider search(SearchParameterMap theParams) { FhirContext fhirContext = myClient.getFhirContext(); IBaseBundle bundle = myClient .search() .forResource(ResourceTypeEnum.SEARCHPARAMETER.getCode()) .cacheControl(new CacheControlDirective().setNoCache(true)) .execute(); return new SimpleBundleProvider(BundleUtil.toListOfResources(fhirContext, bundle)); }
IBundleProvider search = mySearchCoordinatorSvc.registerSearch(callingDao, params, resourceType, new CacheControlDirective()); theJobDetails.setCurrentSearchUuid(search.getUuid()); theJobDetails.setCurrentSearchResourceType(resourceType);
IBundleProvider search = mySearchCoordinatorSvc.registerSearch(callingDao, params, resourceType, new CacheControlDirective()); theJobDetails.setCurrentSearchUuid(search.getUuid()); theJobDetails.setCurrentSearchResourceType(resourceType);
addToCacheControlHeader(b, Constants.CACHE_CONTROL_NO_CACHE, theCacheControlDirective.isNoCache()); addToCacheControlHeader(b, Constants.CACHE_CONTROL_NO_STORE, theCacheControlDirective.isNoStore()); if (theCacheControlDirective.getMaxResults() != null) { addToCacheControlHeader(b, Constants.CACHE_CONTROL_MAX_RESULTS + "=" + Integer.toString(theCacheControlDirective.getMaxResults().intValue()), true);
private IBundleProvider doEverythingOperation(IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort, StringAndListParam theContent, StringAndListParam theNarrative, RequestDetails theRequestDetails) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } if (theContent != null) { paramMap.add(Constants.PARAM_CONTENT, theContent); } if (theNarrative != null) { paramMap.add(Constants.PARAM_TEXT, theNarrative); } paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setEverythingMode(theId != null ? EverythingModeEnum.PATIENT_INSTANCE : EverythingModeEnum.PATIENT_TYPE); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdated); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } if (!isPagingProviderDatabaseBacked(theRequestDetails)) { paramMap.setLoadSynchronous(true); } return mySearchCoordinatorSvc.registerSearch(this, paramMap, getResourceName(), new CacheControlDirective().parse(theRequestDetails.getHeaders(Constants.HEADER_CACHE_CONTROL))); }
@Override public IBundleProvider search(SearchParameterMap theMap) { FhirContext fhirContext = myClient.getFhirContext(); String searchURL = ResourceTypeEnum.SUBSCRIPTION.getCode() + theMap.toNormalizedQueryString(myFhirContext); IBaseBundle bundle = myClient .search() .byUrl(searchURL) .cacheControl(new CacheControlDirective().setNoCache(true)) .execute(); return new SimpleBundleProvider(BundleUtil.toListOfResources(fhirContext, bundle)); }
if (theCacheControlDirective != null && theCacheControlDirective.isNoStore()) { if (theCacheControlDirective.getMaxResults() != null) { loadSynchronousUpTo = theCacheControlDirective.getMaxResults(); if (loadSynchronousUpTo > myDaoConfig.getCacheControlNoStoreMaxResultsUpperLimit()) { throw new InvalidRequestException(Constants.HEADER_CACHE_CONTROL + " header " + Constants.CACHE_CONTROL_MAX_RESULTS + " value must not exceed " + myDaoConfig.getCacheControlNoStoreMaxResultsUpperLimit()); if (theCacheControlDirective != null && theCacheControlDirective.isNoCache() == true) { useCache = false;
private IBundleProvider doEverythingOperation(IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort, StringAndListParam theContent, StringAndListParam theNarrative, RequestDetails theRequestDetails) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } if (theContent != null) { paramMap.add(Constants.PARAM_CONTENT, theContent); } if (theNarrative != null) { paramMap.add(Constants.PARAM_TEXT, theNarrative); } paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setEverythingMode(theId != null ? EverythingModeEnum.PATIENT_INSTANCE : EverythingModeEnum.PATIENT_TYPE); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdated); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } if (!isPagingProviderDatabaseBacked(theRequestDetails)) { paramMap.setLoadSynchronous(true); } return mySearchCoordinatorSvc.registerSearch(this, paramMap, getResourceName(), new CacheControlDirective().parse(theRequestDetails.getHeaders(Constants.HEADER_CACHE_CONTROL))); }
@SuppressWarnings("unused") public void cacheControl() { FhirContext ctx = FhirContext.forDstu3(); // Create the client IGenericClient client = ctx.newRestfulGenericClient("http://localhost:9999/fhir"); Bundle bundle = new Bundle(); // ..populate the bundle.. // START SNIPPET: cacheControl Bundle response = client .search() .forResource(Patient.class) .returnBundle(Bundle.class) .cacheControl(new CacheControlDirective().setNoCache(true)) // <-- add a directive .execute(); // END SNIPPET: cacheControl }
addToCacheControlHeader(b, Constants.CACHE_CONTROL_NO_CACHE, theCacheControlDirective.isNoCache()); addToCacheControlHeader(b, Constants.CACHE_CONTROL_NO_STORE, theCacheControlDirective.isNoStore()); if (theCacheControlDirective.getMaxResults() != null) { addToCacheControlHeader(b, Constants.CACHE_CONTROL_MAX_RESULTS + "=" + Integer.toString(theCacheControlDirective.getMaxResults().intValue()), true);
CacheControlDirective cacheControlDirective = new CacheControlDirective(); if (theRequestDetails != null) { cacheControlDirective.parse(theRequestDetails.getHeaders(Constants.HEADER_CACHE_CONTROL));
private IBundleProvider doEverythingOperation(IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort, StringAndListParam theContent, StringAndListParam theNarrative, RequestDetails theRequestDetails) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } if (theContent != null) { paramMap.add(Constants.PARAM_CONTENT, theContent); } if (theNarrative != null) { paramMap.add(Constants.PARAM_TEXT, theNarrative); } paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setEverythingMode(theId != null ? EverythingModeEnum.PATIENT_INSTANCE : EverythingModeEnum.PATIENT_TYPE); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdated); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } if (!isPagingProviderDatabaseBacked(theRequestDetails)) { paramMap.setLoadSynchronous(true); } return mySearchCoordinatorSvc.registerSearch(this, paramMap, getResourceName(), new CacheControlDirective().parse(theRequestDetails.getHeaders(Constants.HEADER_CACHE_CONTROL))); }
CacheControlDirective cacheControlDirective = new CacheControlDirective(); if (theRequestDetails != null) { cacheControlDirective.parse(theRequestDetails.getHeaders(Constants.HEADER_CACHE_CONTROL));
private IBundleProvider doEverythingOperation(IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort, StringAndListParam theContent, StringAndListParam theNarrative, RequestDetails theRequestDetails) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } if (theContent != null) { paramMap.add(Constants.PARAM_CONTENT, theContent); } if (theNarrative != null) { paramMap.add(Constants.PARAM_TEXT, theNarrative); } paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setEverythingMode(theId != null ? EverythingModeEnum.PATIENT_INSTANCE : EverythingModeEnum.PATIENT_TYPE); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdated); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } if (!isPagingProviderDatabaseBacked(theRequestDetails)) { paramMap.setLoadSynchronous(true); } return mySearchCoordinatorSvc.registerSearch(this, paramMap, getResourceName(), new CacheControlDirective().parse(theRequestDetails.getHeaders(Constants.HEADER_CACHE_CONTROL))); }
private IBundleProvider doEverythingOperation(IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort, StringAndListParam theContent, StringAndListParam theNarrative, RequestDetails theRequestDetails) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } if (theContent != null) { paramMap.add(Constants.PARAM_CONTENT, theContent); } if (theNarrative != null) { paramMap.add(Constants.PARAM_TEXT, theNarrative); } paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setEverythingMode(theId != null ? EverythingModeEnum.PATIENT_INSTANCE : EverythingModeEnum.PATIENT_TYPE); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdated); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } if (!isPagingProviderDatabaseBacked(theRequestDetails)) { paramMap.setLoadSynchronous(true); } return mySearchCoordinatorSvc.registerSearch(this, paramMap, getResourceName(), new CacheControlDirective().parse(theRequestDetails.getHeaders(Constants.HEADER_CACHE_CONTROL))); }