public class GenericModelClassFactory extends AbstractModelClassFactory
GenericModelClassFactory is a ModelClassFactory
implementation
which always returns generic types:
This can be used to run HAPI without any structure JARs, as the generic MCF has no structure dependencies. See the using multiple versions example for more information.
In combination with ParserConfiguration.setAllowUnknownVersions(boolean)
, the GenericModelClassFactory
can be used to parse future versions of HL7 for which HAPI has no support.
DEFAULT_EVENT_MAP_DIRECTORY
Constructor and Description |
---|
GenericModelClassFactory() |
Modifier and Type | Method and Description |
---|---|
Class<? extends Group> |
getGroupClass(String theName,
String theVersion) |
Class<? extends Message> |
getMessageClass(String theName,
String theVersion,
boolean theIsExplicit) |
Class<? extends Message> |
getMessageClassInASpecificPackage(String theName,
String theVersion,
boolean theIsExplicit,
String thePackageName)
Retrieves a message class by looking in a specific java package for the message type.
|
Class<? extends Segment> |
getSegmentClass(String theName,
String theVersion) |
Class<? extends Type> |
getTypeClass(String theName,
String theVersion) |
getEventMapDirectory, getEventMapForVersion, getMessageStructureForEvent, loadMessageStructures, setEventMapDirectory
public GenericModelClassFactory()
public Class<? extends Message> getMessageClass(String theName, String theVersion, boolean theIsExplicit) throws HL7Exception
theName
- name of messagetheVersion
- HL7 versiontheIsExplicit
- true if the structure was specified explicitly in MSH-9-3, false if it was
inferred from MSH-9-1 and MSH-9-2. If false, a lookup may be performed to find an
alternate structure corresponding to that message type and event.HL7Exception
- if the version if not recognized or an appropriate class can not be
foundpublic Class<? extends Message> getMessageClassInASpecificPackage(String theName, String theVersion, boolean theIsExplicit, String thePackageName) throws HL7Exception
theName
- The message structure type (e.g. "ADT_A01")theVersion
- The HL7 version (e.g. "2.3.1")theIsExplicit
- If false, the message structure is looked up using
Parser.getMessageStructureForEvent(String, String)
and converted to the
appropriate structure type. For example, "ADT_A04" would be converted to "ADT_A01"
because the A04 trigger uses the A01 message structure according to HL7.thePackageName
- The package name to use. Note that if the message type can't be found in
this package, HAPI will return the standard type returned by
ModelClassFactory.getMessageClass(String, String, boolean)
HL7Exception
public Class<? extends Group> getGroupClass(String theName, String theVersion) throws HL7Exception
theName
- name of grouptheVersion
- HL7 versionHL7Exception
- if the version if not recognized or an appropriate class can not be
foundpublic Class<? extends Segment> getSegmentClass(String theName, String theVersion) throws HL7Exception
theName
- name of segmenttheVersion
- HL7 versionHL7Exception
- if the version if not recognized or an appropriate class can not be
foundpublic Class<? extends Type> getTypeClass(String theName, String theVersion) throws HL7Exception
theName
- name of typetheVersion
- HL7 versionHL7Exception
- if the version if not recognized or an appropriate class can not be
foundCopyright © 2001–2017 University Health Network. All rights reserved.