001package ca.uhn.fhir.jpa.api.dao;
002
003import ca.uhn.fhir.context.FhirContext;
004import ca.uhn.fhir.jpa.model.entity.BaseHasResource;
005import ca.uhn.fhir.jpa.model.entity.IBaseResourceEntity;
006import ca.uhn.fhir.jpa.model.entity.ResourceTag;
007import org.hl7.fhir.instance.model.api.IBaseResource;
008
009import java.util.Collection;
010
011/*
012 * #%L
013 * HAPI FHIR JPA API
014 * %%
015 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
016 * %%
017 * Licensed under the Apache License, Version 2.0 (the "License");
018 * you may not use this file except in compliance with the License.
019 * You may obtain a copy of the License at
020 *
021 *      http://www.apache.org/licenses/LICENSE-2.0
022 *
023 * Unless required by applicable law or agreed to in writing, software
024 * distributed under the License is distributed on an "AS IS" BASIS,
025 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
026 * See the License for the specific language governing permissions and
027 * limitations under the License.
028 * #L%
029 */
030
031/**
032 * Note that this interface is not considered a stable interface. While it is possible to build applications
033 * that use it directly, please be aware that we may modify methods, add methods, or even remove methods from
034 * time to time, even within minor point releases.
035 */
036public interface IDao {
037        String RESOURCE_PID_KEY = "RESOURCE_PID";
038
039        MetadataKeyResourcePid RESOURCE_PID = new MetadataKeyResourcePid(RESOURCE_PID_KEY);
040
041        MetadataKeyCurrentlyReindexing CURRENTLY_REINDEXING = new MetadataKeyCurrentlyReindexing("CURRENTLY_REINDEXING");
042
043        FhirContext getContext();
044
045        IBaseResource toResource(BaseHasResource theEntity, boolean theForHistoryOperation);
046
047        <R extends IBaseResource> R toResource(Class<R> theResourceType, IBaseResourceEntity theEntity, Collection<ResourceTag> theTagList, boolean theForHistoryOperation);
048
049}