View Javadoc
1   package ca.uhn.fhir.jpa.dao;
2   
3   import ca.uhn.fhir.context.FhirContext;
4   import ca.uhn.fhir.jpa.model.entity.BaseHasResource;
5   import ca.uhn.fhir.jpa.model.entity.IBaseResourceEntity;
6   import ca.uhn.fhir.jpa.model.entity.ResourceTag;
7   import ca.uhn.fhir.jpa.search.PersistedJpaBundleProvider;
8   import ca.uhn.fhir.jpa.searchparam.registry.ISearchParamRegistry;
9   import org.hl7.fhir.instance.model.api.IBaseResource;
10  
11  import java.util.Collection;
12  
13  /*
14   * #%L
15   * HAPI FHIR JPA Server
16   * %%
17   * Copyright (C) 2014 - 2019 University Health Network
18   * %%
19   * Licensed under the Apache License, Version 2.0 (the "License");
20   * you may not use this file except in compliance with the License.
21   * You may obtain a copy of the License at
22   * 
23   *      http://www.apache.org/licenses/LICENSE-2.0
24   * 
25   * Unless required by applicable law or agreed to in writing, software
26   * distributed under the License is distributed on an "AS IS" BASIS,
27   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28   * See the License for the specific language governing permissions and
29   * limitations under the License.
30   * #L%
31   */
32  
33  public interface IDao {
34  
35  	MetadataKeyResourcePid RESOURCE_PID = new MetadataKeyResourcePid("RESOURCE_PID");
36  
37  	MetadataKeyCurrentlyReindexing CURRENTLY_REINDEXING = new MetadataKeyCurrentlyReindexing("CURRENTLY_REINDEXING");
38  
39  	FhirContext getContext();
40  
41  	/**
42  	 * Populate all of the runtime dependencies that a bundle provider requires in order to work
43  	 */
44  	void injectDependenciesIntoBundleProvider(PersistedJpaBundleProvider theProvider);
45  
46  	ISearchBuilder newSearchBuilder();
47  
48  	IBaseResource toResource(BaseHasResource theEntity, boolean theForHistoryOperation);
49  
50  	<R extends IBaseResource> R toResource(Class<R> theResourceType, IBaseResourceEntity theEntity, Collection<ResourceTag> theTagList, boolean theForHistoryOperation);
51  
52  	ISearchParamRegistry getSearchParamRegistry();
53  }