View Javadoc
1   package ca.uhn.fhir.jpa.dao;
2   
3   /*-
4    * #%L
5    * HAPI FHIR JPA Server
6    * %%
7    * Copyright (C) 2014 - 2019 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.jpa.searchparam.SearchParameterMap;
25  import ca.uhn.fhir.model.api.Include;
26  import ca.uhn.fhir.rest.param.DateRangeParam;
27  import org.hl7.fhir.instance.model.api.IBaseResource;
28  
29  import javax.persistence.EntityManager;
30  import java.util.Collection;
31  import java.util.Iterator;
32  import java.util.List;
33  import java.util.Set;
34  
35  public interface ISearchBuilder {
36  
37  	IResultIterator createQuery(SearchParameterMap theParams, String theSearchUuid);
38  
39  	void setMaxResultsToFetch(Integer theMaxResultsToFetch);
40  
41  	Iterator<Long> createCountQuery(SearchParameterMap theParams, String theSearchUuid);
42  
43  	void loadResourcesByPid(Collection<Long> theIncludePids, List<IBaseResource> theResourceListToPopulate, Set<Long> theRevIncludedPids, boolean theForHistoryOperation, EntityManager theEntityManager,
44  									FhirContext theContext, IDao theDao);
45  
46  	Set<Long> loadIncludes(FhirContext theContext, EntityManager theEntityManager, Collection<Long> theMatches, Set<Include> theRevIncludes, boolean theReverseMode,
47  								  DateRangeParam theLastUpdated, String theSearchIdOrDescription);
48  
49  	/**
50  	 * How many results may be fetched at once
51  	 */
52  	void setFetchSize(int theFetchSize);
53  
54  	void setType(Class<? extends IBaseResource> theResourceType, String theResourceName);
55  
56  	void setPreviouslyAddedResourcePids(List<Long> thePreviouslyAddedResourcePids);
57  
58  }