public class FhirContext extends Object
Important usage notes:
| Constructor and Description |
|---|
FhirContext()
Default constructor.
|
FhirContext(Class<?>... theResourceTypes) |
FhirContext(Class<? extends IBaseResource> theResourceType) |
FhirContext(Collection<Class<? extends IBaseResource>> theResourceTypes) |
FhirContext(FhirVersionEnum theVersion) |
| Modifier and Type | Method and Description |
|---|---|
static FhirContext |
forDstu1()
Creates and returns a new FhirContext with version
FhirVersionEnum.DSTU1 |
static FhirContext |
forDstu2()
Creates and returns a new FhirContext with version
DSTU 2 |
static FhirContext |
forDstu2Hl7Org() |
static FhirContext |
forDstu3()
Creates and returns a new FhirContext with version
DSTU 3 |
BaseRuntimeElementDefinition<?> |
getElementDefinition(Class<? extends IBase> theElementType)
Returns the scanned runtime model for the given type.
|
BaseRuntimeElementDefinition<?> |
getElementDefinition(String theElementName)
Returns the scanned runtime model for the given type.
|
Collection<BaseRuntimeElementDefinition<?>> |
getElementDefinitions()
Returns all element definitions (resources, datatypes, etc.)
|
HapiLocalizer |
getLocalizer()
This feature is not yet in its final state and should be considered an internal part of HAPI for now - use with
caution
|
INarrativeGenerator |
getNarrativeGenerator() |
RuntimeResourceDefinition |
getResourceDefinition(Class<? extends IBaseResource> theResourceType)
Returns the scanned runtime model for the given type.
|
RuntimeResourceDefinition |
getResourceDefinition(FhirVersionEnum theVersion,
String theResourceName) |
RuntimeResourceDefinition |
getResourceDefinition(IBaseResource theResource)
Returns the scanned runtime model for the given type.
|
RuntimeResourceDefinition |
getResourceDefinition(String theResourceName)
Returns the scanned runtime model for the given type.
|
RuntimeResourceDefinition |
getResourceDefinitionById(String theId)
Returns the scanned runtime model for the given type.
|
Collection<RuntimeResourceDefinition> |
getResourceDefinitions()
Returns the scanned runtime models.
|
IRestfulClientFactory |
getRestfulClientFactory() |
RuntimeChildUndeclaredExtensionDefinition |
getRuntimeChildUndeclaredExtensionDefinition() |
IFhirVersion |
getVersion() |
IVersionSpecificBundleFactory |
newBundleFactory()
This method should be considered experimental and will likely change in future releases
of HAPI.
|
IParser |
newJsonParser()
Create and return a new JSON parser.
|
<T extends IRestfulClient> |
newRestfulClient(Class<T> theClientType,
String theServerBase)
Instantiates a new client instance.
|
IGenericClient |
newRestfulGenericClient(String theServerBase)
Instantiates a new generic client.
|
FhirTerser |
newTerser() |
FhirValidator |
newValidator()
Create a new validator instance.
|
ViewGenerator |
newViewGenerator() |
IParser |
newXmlParser()
Create and return a new XML parser.
|
void |
setLocalizer(HapiLocalizer theMessages)
This feature is not yet in its final state and should be considered an internal part of HAPI for now - use with
caution
|
void |
setNarrativeGenerator(INarrativeGenerator theNarrativeGenerator) |
void |
setParserErrorHandler(IParserErrorHandler theParserErrorHandler)
Sets a parser error handler to use by default on all parsers
|
public FhirContext()
public FhirContext(Class<? extends IBaseResource> theResourceType)
public FhirContext(Class<?>... theResourceTypes)
public FhirContext(Collection<Class<? extends IBaseResource>> theResourceTypes)
public FhirContext(FhirVersionEnum theVersion)
public BaseRuntimeElementDefinition<?> getElementDefinition(Class<? extends IBase> theElementType)
public BaseRuntimeElementDefinition<?> getElementDefinition(String theElementName)
public Collection<BaseRuntimeElementDefinition<?>> getElementDefinitions()
public HapiLocalizer getLocalizer()
public INarrativeGenerator getNarrativeGenerator()
public RuntimeResourceDefinition getResourceDefinition(Class<? extends IBaseResource> theResourceType)
public RuntimeResourceDefinition getResourceDefinition(FhirVersionEnum theVersion, String theResourceName)
public RuntimeResourceDefinition getResourceDefinition(IBaseResource theResource)
public RuntimeResourceDefinition getResourceDefinition(String theResourceName)
public RuntimeResourceDefinition getResourceDefinitionById(String theId)
public Collection<RuntimeResourceDefinition> getResourceDefinitions()
public IRestfulClientFactory getRestfulClientFactory()
public RuntimeChildUndeclaredExtensionDefinition getRuntimeChildUndeclaredExtensionDefinition()
public IFhirVersion getVersion()
public IVersionSpecificBundleFactory newBundleFactory()
public IParser newJsonParser()
Thread safety: Parsers are not guaranteed to be thread safe. Create a new parser instance for every thread or every message being parsed/encoded.
Performance Note: This method is cheap to call, and may be called once for every message being processed without incurring any performance penalty
public <T extends IRestfulClient> T newRestfulClient(Class<T> theClientType, String theServerBase)
IRestfulClient (or commonly its
sub-interface IBasicClient). See the RESTful Client documentation for more
information on how to define this interface.
Performance Note: This method is cheap to call, and may be called once for every operation invocation without incurring any performance penalty
theClientType - The client type, which is an interface type to be instantiatedtheServerBase - The URL of the base for the restful FHIR server to connect toConfigurationException - If the interface type is not an interfacepublic IGenericClient newRestfulGenericClient(String theServerBase)
non-generic clients).
Performance Note: This method is cheap to call, and may be called once for every operation invocation without incurring any performance penalty
theServerBase - The URL of the base for the restful FHIR server to connect topublic FhirTerser newTerser()
public FhirValidator newValidator()
Note on thread safety: Validators are thread safe, you may use a single validator in multiple threads. (This is in contrast to parsers)
public ViewGenerator newViewGenerator()
public IParser newXmlParser()
Thread safety: Parsers are not guaranteed to be thread safe. Create a new parser instance for every thread or every message being parsed/encoded.
Performance Note: This method is cheap to call, and may be called once for every message being processed without incurring any performance penalty
public void setLocalizer(HapiLocalizer theMessages)
public void setNarrativeGenerator(INarrativeGenerator theNarrativeGenerator)
public void setParserErrorHandler(IParserErrorHandler theParserErrorHandler)
theParserErrorHandler - The error handlerpublic static FhirContext forDstu1()
FhirVersionEnum.DSTU1public static FhirContext forDstu2()
DSTU 2public static FhirContext forDstu3()
DSTU 3public static FhirContext forDstu2Hl7Org()
Copyright © 2014–2016 University Health Network. All rights reserved.