View Javadoc
1   package ca.uhn.fhir.model.api;
2   
3   /*
4    * #%L
5    * HAPI FHIR - Core Library
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   * http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import java.io.InputStream;
24  import java.util.Date;
25  
26  import org.hl7.fhir.instance.model.api.*;
27  
28  import ca.uhn.fhir.context.*;
29  import ca.uhn.fhir.context.support.IContextValidationSupport;
30  import ca.uhn.fhir.fluentpath.IFluentPath;
31  import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory;
32  
33  /**
34   * Each structure version JAR will have an implementation of this interface.
35   * This is used internally by HAPI and subject to change. Do not use this interface
36   * directly in user code.
37   * 
38   * See also IFhirVersionServer for the hapi-fhir-server equivalent.
39   */
40  public interface IFhirVersion {
41  
42  	IFluentPath createFluentPathExecutor(FhirContext theFhirContext);
43  
44  	IContextValidationSupport<?, ?, ?, ?, ?, ?> createValidationSupport();
45  
46  	IBaseResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase);
47  
48  	Class<?> getContainedType();
49  
50  	InputStream getFhirVersionPropertiesFile();
51  
52  	IPrimitiveType<Date> getLastUpdated(IBaseResource theResource);
53  
54  	String getPathToSchemaDefinitions();
55  
56  	Class<? extends IBase> getResourceReferenceType();
57  
58  	FhirVersionEnum getVersion();
59  
60  	IVersionSpecificBundleFactory newBundleFactory(FhirContext theContext);
61  
62  	IBase newCodingDt();
63  
64  	IIdType newIdType();
65  
66  	/**
67  	 * Returns an instance of <code>IFhirVersionServer<code> for this version.
68  	 * Note that this method may only be called if the <code>hapi-fhir-server</code>
69  	 * JAR is on the classpath. Otherwise it will result in a {@link ClassNotFoundException}
70  	 */
71  	Object getServerVersion();
72  
73  }