Add count(int) method to fluent client search

This commit is contained in:
James Agnew 2015-12-01 10:22:50 -05:00
parent 9dbeee3576
commit 4398040451
3 changed files with 25 additions and 0 deletions

View File

@ -1854,6 +1854,11 @@ public class GenericClient extends BaseClient implements IGenericClient {
@Override
public IQuery limitTo(int theLimitTo) {
return count(theLimitTo);
}
@Override
public IQuery count(int theLimitTo) {
if (theLimitTo > 0) {
myParamLimit = theLimitTo;
} else {

View File

@ -41,8 +41,22 @@ public interface IQuery<T> extends IClientExecutable<IQuery<T>, T>, IBaseQuery<I
ISort<T> sort();
/**
* Specifies the <code>_count</code> 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)
*/
IQuery<T> limitTo(int theLimitTo);
/**
* Specifies the <code>_count</code> parameter, which indicates to the server how many resources should be returned
* on a single page.
*
* @since 1.4
*/
IQuery<T> count(int theCount);
/**
* Match only resources where the resource has the given tag. This parameter corresponds to
* the <code>_tag</code> URL parameter.

View File

@ -40,6 +40,12 @@
and a QuestionnaireResponse, it would fail because the QuestionnaireResponse
validator wouldn't be able to find the questionnaire. This is now corrected.
</action>
<action type="add">
Add a new method to the generic/fluent client for searching:
<![CDATA[<code>.count(int)</code><br/>]]>
This replaces the existing ".limitTo(int)" method which has
now been deprocated because it was badly named and undocumented.
</action>
</release>
<release version="1.3" date="2015-11-14">
<action type="add">