001/*
002 * #%L
003 * HAPI FHIR - Core Library
004 * %%
005 * Copyright (C) 2014 - 2023 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package org.hl7.fhir.instance.model.api;
021
022import java.util.Arrays;
023import java.util.Collections;
024import java.util.HashSet;
025import java.util.Set;
026
027import ca.uhn.fhir.context.FhirVersionEnum;
028import ca.uhn.fhir.model.api.IElement;
029import ca.uhn.fhir.model.api.Include;
030
031/**
032 * For now, this is a simple marker interface indicating that a class is a resource type. 
033 * There are two concrete types of implementations of this interrface. The first are
034 * HL7.org's Resource structures (e.g. 
035 * <code>org.hl7.fhir.instance.model.Patient</code>) and
036 * the second are HAPI's Resource structures, e.g. 
037 * <code>ca.uhn.fhir.model.dstu.resource.Patient</code>)
038 */
039public interface IBaseResource extends IBase, IElement {
040
041        IBaseMetaType getMeta();
042
043        /**
044         * Include constant for <code>*</code> (return all includes)
045         */
046        Include INCLUDE_ALL = new Include("*", false).toLocked();
047
048        /**
049         * Include set containing only {@link #INCLUDE_ALL}
050         */
051        Set<Include> WILDCARD_ALL_SET = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(INCLUDE_ALL)));
052
053        IIdType getIdElement();
054        
055        IBaseResource setId(String theId);
056
057        IBaseResource setId(IIdType theId);
058
059        FhirVersionEnum getStructureFhirVersionEnum();
060
061}