ca.uhn.fhir.rest.gclient.IQuery Maven / Gradle / Ivy
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.rest.gclient;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.rest.api.SearchStyleEnum;
import ca.uhn.fhir.rest.api.SearchTotalModeEnum;
import ca.uhn.fhir.rest.api.SortSpec;
import ca.uhn.fhir.rest.param.DateRangeParam;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import java.util.Collection;
public interface IQuery extends IBaseQuery>, IClientExecutable, Y> {
/**
* {@inheritDoc}
*/
// This is here as an overridden method to allow mocking clients with Mockito to work
@Override
IQuery and(ICriterion> theCriterion);
/**
* Specifies the _count
parameter, which indicates to the server how many resources should be returned
* on a single page.
*
* @since 1.4
*/
IQuery count(int theCount);
/**
* Specifies the _offset
parameter, which indicates to the server the offset of the query. Use
* with {@link #count(int)}.
*
* This parameter is not part of the FHIR standard, all servers might not implement it.
*
* @since 5.2
*/
IQuery offset(int theOffset);
/**
* Add an "_include" specification or an "_include:recurse" specification. If you are using
* a constant from one of the built-in structures you can select whether you want recursive
* behaviour by using the following syntax:
*
* - Recurse:
.include(Patient.INCLUDE_ORGANIZATION.asRecursive())
* - No Recurse:
.include(Patient.INCLUDE_ORGANIZATION.asNonRecursive())
*
*/
IQuery include(Include theInclude);
/**
* Add a "_lastUpdated" specification
*
* @since HAPI FHIR 1.1 - Note that option was added to FHIR itself in DSTU2
*/
IQuery lastUpdated(DateRangeParam theLastUpdated);
/**
* Specifies the _count
parameter, which indicates to the server how many resources should be returned
* on a single page.
*
* @deprecated This parameter is badly named, since FHIR calls this parameter "_count" and not "_limit". Use {@link #count(int)} instead (it also sets the _count parameter)
* @see #count(int)
*/
@Deprecated
IQuery limitTo(int theLimitTo);
/**
* Request that the client return the specified bundle type, e.g. org.hl7.fhir.dstu2.model.Bundle.class
* or ca.uhn.fhir.model.dstu2.resource.Bundle.class
*/
IQuery returnBundle(Class theClass);
/**
* Request that the server modify the response using the _total
param
*
* THIS IS AN EXPERIMENTAL FEATURE - Use with caution, as it may be
* removed or modified in a future version.
*/
IQuery totalMode(SearchTotalModeEnum theTotalMode);
/**
* Add a "_revinclude" specification
*
* @since HAPI FHIR 1.0 - Note that option was added to FHIR itself in DSTU2
*/
IQuery revInclude(Include theIncludeTarget);
/**
* Adds a sort criteria
*
* @see #sort(SortSpec) for an alternate way of speciyfing sorts
*/
ISort sort();
/**
* Adds a sort using a {@link SortSpec} object
*
* @see #sort() for an alternate way of speciyfing sorts
*/
IQuery sort(SortSpec theSortSpec);
/**
* Forces the query to perform the search using the given method (allowable methods are described in the
* FHIR Search Specification)
*
* This can be used to force the use of an HTTP POST instead of an HTTP GET
*
*
* @see SearchStyleEnum
* @since 0.6
*/
IQuery usingStyle(SearchStyleEnum theStyle);
/**
* {@inheritDoc}
*/
// This is here as an overridden method to allow mocking clients with Mockito to work
@Override
IQuery where(ICriterion> theCriterion);
/**
* Matches any of the profiles given as argument. This would result in an OR search for resources matching one or more profiles.
* To do an AND search, make multiple calls to {@link #withProfile(String)}.
*
* @param theProfileUris The URIs of a given profile to search for resources which match.
*/
IQuery withAnyProfile(Collection theProfileUris);
IQuery withIdAndCompartment(String theResourceId, String theCompartmentName);
/**
* Match only resources where the resource has the given profile declaration. This parameter corresponds to
* the _profile
URL parameter.
*
* @param theProfileUri The URI of a given profile to search for resources which match
*/
IQuery withProfile(String theProfileUri);
/**
* Match only resources where the resource has the given security tag. This parameter corresponds to
* the _security
URL parameter.
*
* @param theSystem The tag code system, or null
to match any code system (this may not be supported on all servers)
* @param theCode The tag code. Must not be null
or empty.
*/
IQuery withSecurity(String theSystem, String theCode);
/**
* Match only resources where the resource has the given tag. This parameter corresponds to
* the _tag
URL parameter.
*
* @param theSystem The tag code system, or null
to match any code system (this may not be supported on all servers)
* @param theCode The tag code. Must not be null
or empty.
*/
IQuery withTag(String theSystem, String theCode);
// Y execute();
}