ca.uhn.hl7v2.parser
Interface ModelClassFactory
- All Superinterfaces:
- Serializable
- All Known Implementing Classes:
- CanonicalModelClassFactory, CustomModelClassFactory, DefaultModelClassFactory
public interface ModelClassFactory
- extends Serializable
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
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 and instantiates 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 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.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 by getMessageClass(String, String, boolean)
- Throws:
HL7Exception- Since:
- 1.3
getGroupClass
Class<? extends Group> getGroupClass(String theName,
String theVersion)
throws HL7Exception
- 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
Class<? extends Segment> getSegmentClass(String theName,
String theVersion)
throws HL7Exception
- 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
Class<? extends Type> getTypeClass(String theName,
String theVersion)
throws HL7Exception
- 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
Copyright © 2001-2012 University Health Network. All Rights Reserved.