Package ca.uhn.hl7v2.parser
Class AbstractModelClassFactory
java.lang.Object
ca.uhn.hl7v2.parser.AbstractModelClassFactory
- All Implemented Interfaces:
ModelClassFactory,Serializable
- Direct Known Subclasses:
CustomModelClassFactory,DefaultModelClassFactory,GenericModelClassFactory
Abstract base class for
ModelClassFactory implementations that read event maps from the
file system.
The directory can be set using setEventMapDirectory(String) and defaults to
ca/uhn/hl7v2/parser/eventmap/. The file itself is a property file named after the
HL7 version (e.g. 2.4.properties).
- Author:
- Christian Ohr
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEventMapForVersion(Version version) Returns the event map for a given HL7 version.getMessageStructureForEvent(String name, Version version) Load event map from a external resourcevoidsetEventMapDirectory(String eventMapPrefix) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.hl7v2.parser.ModelClassFactory
getGroupClass, getMessageClass, getMessageClassInASpecificPackage, getSegmentClass, getTypeClass
-
Field Details
-
DEFAULT_EVENT_MAP_DIRECTORY
- See Also:
-
-
Constructor Details
-
AbstractModelClassFactory
public AbstractModelClassFactory()
-
-
Method Details
-
getEventMapDirectory
- Returns:
- the directory where to read the eventmap file from
-
setEventMapDirectory
- Parameters:
eventMapPrefix- the directory where to read the eventmap file from
-
getMessageStructureForEvent
- Specified by:
getMessageStructureForEventin interfaceModelClassFactory- Parameters:
name- event nameversion- HL7 version- Returns:
- message structure name for the eventName and version or
nullif none could be found - Throws:
HL7Exception- if the version is unknown or the message structure list is inaccessible- See Also:
-
getEventMapForVersion
Returns the event map for a given HL7 version. In this map, the key is a message type and trigger event in the form[type]_[trigger], for example:ADT_A04, and the values are the corresponding structure for this trigger, for example:ADT_A01.- Parameters:
version- the HL7 version- Returns:
- Returns
nullif no event map is found for the given version - Throws:
HL7Exception- if the HL7 version is unknown
-
loadMessageStructures
Load event map from a external resource- Returns:
- the event map
- Throws:
IOException
-