public abstract class AbstractModelClassFactory extends Object implements ModelClassFactory
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
).
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_EVENT_MAP_DIRECTORY |
Constructor and Description |
---|
AbstractModelClassFactory() |
Modifier and Type | Method and Description |
---|---|
String |
getEventMapDirectory() |
Map<String,String> |
getEventMapForVersion(Version version)
Returns the event map for a given HL7 version.
|
String |
getMessageStructureForEvent(String name,
Version version) |
protected Map<Version,Map<String,String>> |
loadMessageStructures()
Load event map from a external resource
|
void |
setEventMapDirectory(String eventMapPrefix) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGroupClass, getMessageClass, getMessageClassInASpecificPackage, getSegmentClass, getTypeClass
protected static final String DEFAULT_EVENT_MAP_DIRECTORY
public AbstractModelClassFactory()
public String getEventMapDirectory()
public void setEventMapDirectory(String eventMapPrefix)
eventMapPrefix
- the directory where to read the eventmap file frompublic String getMessageStructureForEvent(String name, Version version) throws HL7Exception
getMessageStructureForEvent
in interface ModelClassFactory
name
- event nameversion
- HL7 versionnull
if none
could be foundHL7Exception
- if the version is unknown or the message structure list is inaccessibleModelClassFactory.getMessageStructureForEvent(java.lang.String,
ca.uhn.hl7v2.Version)
public Map<String,String> getEventMapForVersion(Version version) throws HL7Exception
[type]_[trigger]
, for example:
ADT_A04
, and the values are the corresponding structure for this trigger,
for example: ADT_A01
.version
- the HL7 versionnull
if no event map is found for the given versionHL7Exception
- if the HL7 version is unknownprotected Map<Version,Map<String,String>> loadMessageStructures() throws IOException
IOException
Copyright © 2001–2017 University Health Network. All rights reserved.