Package ca.uhn.hl7v2.parser
Interface ModelClassFactory
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractModelClassFactory,CanonicalModelClassFactory,CustomModelClassFactory,DefaultModelClassFactory,GenericModelClassFactory
Looks up classes for message model components (e.g. concrete implementations of Message, Group,
Segment). A custom factory can be used to point to custom model components.
- Version:
- $Revision: 1.3 $ updated on $Date: 2009-10-03 15:25:46 $ by $Author: jamesagnew $
- Author:
- Bryan Tripp
-
Method Summary
Modifier and TypeMethodDescriptiongetGroupClass(String theName, String theVersion) getMessageClass(String theName, String theVersion, boolean isExplicit) getMessageClassInASpecificPackage(String theName, String theVersion, boolean isExplicit, String packageName) Retrieves a message class by looking in a specific java package for the message type.getMessageStructureForEvent(String eventName, Version version) getSegmentClass(String theName, String theVersion) getTypeClass(String theName, String theVersion)
-
Method Details
-
getMessageClass
Class<? extends Message> getMessageClass(String theName, String theVersion, boolean isExplicit) throws HL7Exception - Parameters:
theName- name of messagetheVersion- HL7 versionisExplicit- 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.- Returns:
- a class that implements the specified message
- Throws:
HL7Exception- if the version if not recognized or an appropriate class can not be found
-
getMessageClassInASpecificPackage
Class<? extends Message> getMessageClassInASpecificPackage(String theName, String theVersion, boolean isExplicit, String packageName) throws HL7Exception Retrieves a message class by looking in a specific java package for the message type.- Parameters:
theName- The message structure type (e.g. "ADT_A01")theVersion- The HL7 version (e.g. "2.3.1")isExplicit- If false, the message structure is looked up usingParser.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.packageName- 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 bygetMessageClass(String, String, boolean)- Returns:
- message class
- Throws:
HL7Exception- Since:
- 2.0
-
getGroupClass
- Parameters:
theName- name of grouptheVersion- HL7 version- Returns:
- a class that implements the specified group
- Throws:
HL7Exception- if the version if not recognized or an appropriate class can not be found
-
getSegmentClass
- Parameters:
theName- name of segmenttheVersion- HL7 version- Returns:
- a class that implements the specified segment
- Throws:
HL7Exception- if the version if not recognized or an appropriate class can not be found
-
getTypeClass
- Parameters:
theName- name of typetheVersion- HL7 version- Returns:
- a class that implements the specified type
- Throws:
HL7Exception- if the version if not recognized or an appropriate class can not be found
-
getMessageStructureForEvent
- Parameters:
eventName- 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
-