View Javadoc
1   package ca.uhn.fhir.jpa.dao;
2   
3   /*-
4    * #%L
5    * HAPI FHIR JPA Server
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import ca.uhn.fhir.context.FhirContext;
24  import ca.uhn.fhir.model.api.Include;
25  import ca.uhn.fhir.rest.param.DateRangeParam;
26  import org.hl7.fhir.instance.model.api.IBaseResource;
27  
28  import javax.persistence.EntityManager;
29  import java.util.Collection;
30  import java.util.Iterator;
31  import java.util.List;
32  import java.util.Set;
33  
34  public interface ISearchBuilder {
35  
36  	IResultIterator createQuery(SearchParameterMap theParams, String theSearchUuid);
37  
38  	void setMaxResultsToFetch(Integer theMaxResultsToFetch);
39  
40  	Iterator<Long> createCountQuery(SearchParameterMap theParams, String theSearchUuid);
41  
42  	void loadResourcesByPid(Collection<Long> theIncludePids, List<IBaseResource> theResourceListToPopulate, Set<Long> theRevIncludedPids, boolean theForHistoryOperation, EntityManager theEntityManager,
43  									FhirContext theContext, IDao theDao);
44  
45  	Set<Long> loadIncludes(IDao theCallingDao, FhirContext theContext, EntityManager theEntityManager, Collection<Long> theMatches, Set<Include> theRevIncludes, boolean theReverseMode,
46  								  DateRangeParam theLastUpdated, String theSearchIdOrDescription);
47  
48  	/**
49  	 * How many results may be fetched at once
50  	 */
51  	void setFetchSize(int theFetchSize);
52  
53  	void setType(Class<? extends IBaseResource> theResourceType, String theResourceName);
54  
55  	void setPreviouslyAddedResourcePids(List<Long> thePreviouslyAddedResourcePids);
56  
57  }