001package ca.uhn.fhir.model.api;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2019 University Health Network
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 *
013 * http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import java.io.InputStream;
024import java.util.Date;
025
026import org.hl7.fhir.instance.model.api.*;
027
028import ca.uhn.fhir.context.*;
029import ca.uhn.fhir.context.support.IContextValidationSupport;
030import ca.uhn.fhir.fluentpath.IFluentPath;
031import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory;
032
033/**
034 * Each structure version JAR will have an implementation of this interface.
035 * This is used internally by HAPI and subject to change. Do not use this interface
036 * directly in user code.
037 * 
038 * See also IFhirVersionServer for the hapi-fhir-server equivalent.
039 */
040public interface IFhirVersion {
041
042        IFluentPath createFluentPathExecutor(FhirContext theFhirContext);
043
044        IContextValidationSupport<?, ?, ?, ?, ?, ?> createValidationSupport();
045
046        IBaseResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase);
047
048        Class<?> getContainedType();
049
050        InputStream getFhirVersionPropertiesFile();
051
052        IPrimitiveType<Date> getLastUpdated(IBaseResource theResource);
053
054        String getPathToSchemaDefinitions();
055
056        Class<? extends IBase> getResourceReferenceType();
057
058        FhirVersionEnum getVersion();
059
060        IVersionSpecificBundleFactory newBundleFactory(FhirContext theContext);
061
062        IBase newCodingDt();
063
064        IIdType newIdType();
065
066        /**
067         * Returns an instance of <code>IFhirVersionServer<code> for this version.
068         * Note that this method may only be called if the <code>hapi-fhir-server</code>
069         * JAR is on the classpath. Otherwise it will result in a {@link ClassNotFoundException}
070         */
071        Object getServerVersion();
072
073}