Interface ModelClassFactory

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractModelClassFactory, CanonicalModelClassFactory, CustomModelClassFactory, DefaultModelClassFactory, GenericModelClassFactory

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
  • Method Details

    • getMessageClass

      Class<? extends Message> getMessageClass(String theName, String theVersion, boolean isExplicit) throws HL7Exception
      Parameters:
      theName - name of message
      theVersion - HL7 version
      isExplicit - 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 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)
      Returns:
      message class
      Throws:
      HL7Exception
      Since:
      2.0
    • getGroupClass

      Class<? extends Group> getGroupClass(String theName, String theVersion) throws HL7Exception
      Parameters:
      theName - name of group
      theVersion - 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 segment
      theVersion - 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 type
      theVersion - 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 name
      version - HL7 version
      Returns:
      message structure name for the eventName and version or null if none could be found
      Throws:
      HL7Exception - if the version is unknown or the message structure list is inaccessible