
ca.uhn.fhir.rest.gclient.IQuery Maven / Gradle / Ivy
package ca.uhn.fhir.rest.gclient;
import java.util.Collection;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2016 University Health Network
* %%
* 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%
*/
import org.hl7.fhir.instance.model.api.IBaseBundle;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.rest.method.SearchStyleEnum;
import ca.uhn.fhir.rest.param.DateRangeParam;
public interface IQuery extends IClientExecutable, T>, IBaseQuery> {
/**
* 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);
ISort sort();
/**
* 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)
*/
@Deprecated
IQuery limitTo(int theLimitTo);
/**
* 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);
/**
* 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);
/**
* 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 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);
/**
* 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);
/**
* 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);
IQuery withIdAndCompartment(String theResourceId, String theCompartmentName);
/**
* Add a "_revinclude" specification
*
* @since HAPI FHIR 1.0 - Note that option was added to FHIR itself in DSTU2
*/
IQuery revInclude(Include theIncludeTarget);
/**
* Add a "_lastUpdated" specification
*
* @since HAPI FHIR 1.1 - Note that option was added to FHIR itself in DSTU2
*/
IQuery lastUpdated(DateRangeParam theLastUpdated);
/**
* Request that the client return the specified bundle type, e.g. org.hl7.fhir.instance.model.Bundle.class
* or ca.uhn.fhir.model.dstu2.resource.Bundle.class
*/
IClientExecutable, B> returnBundle(Class theClass);
/**
* {@inheritDoc}
*/
// This is here as an overridden method to allow mocking clients with Mockito to work
@Override
IQuery where(ICriterion> theCriterion);
/**
* {@inheritDoc}
*/
// This is here as an overridden method to allow mocking clients with Mockito to work
@Override
IQuery and(ICriterion> theCriterion);
/**
* @deprecated You should call {@link #returnBundle(Class)} on the method chain before calling
* {@link #execute()} in order to specify why return type to use
*/
// This is overriding in order to deprecate
@Deprecated
@Override
T execute();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy