001package ca.uhn.fhir.model.api; 002 003/* 004 * #%L 005 * HAPI FHIR - Core Library 006 * %% 007 * Copyright (C) 2014 - 2021 Smile CDR, Inc. 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 ca.uhn.fhir.fhirpath.IFhirPath; 027import org.hl7.fhir.instance.model.api.*; 028 029import ca.uhn.fhir.context.*; 030import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; 031 032/** 033 * Each structure version JAR will have an implementation of this interface. 034 * This is used internally by HAPI and subject to change. Do not use this interface 035 * directly in user code. 036 * 037 * See also IFhirVersionServer for the hapi-fhir-server equivalent. 038 */ 039public interface IFhirVersion { 040 041 IFhirPath createFhirPathExecutor(FhirContext theFhirContext); 042 043 IBaseResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase); 044 045 Class<?> getContainedType(); 046 047 InputStream getFhirVersionPropertiesFile(); 048 049 IPrimitiveType<Date> getLastUpdated(IBaseResource theResource); 050 051 String getPathToSchemaDefinitions(); 052 053 Class<? extends IBase> getResourceReferenceType(); 054 055 FhirVersionEnum getVersion(); 056 057 IVersionSpecificBundleFactory newBundleFactory(FhirContext theContext); 058 059 IBase newCodingDt(); 060 061 IIdType newIdType(); 062 063 /** 064 * Returns an instance of <code>IFhirVersionServer<code> for this version. 065 * Note that this method may only be called if the <code>hapi-fhir-server</code> 066 * JAR is on the classpath. Otherwise it will result in a {@link ClassNotFoundException} 067 */ 068 Object getServerVersion(); 069 070}