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