cdac.medinfo.sdk.hl7282.baselibs.messages

## Class LocalExtensionAgent

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.messages.LocalExtensionAgent

-     public final class LocalExtensionAgent
      extends java.lang.Object

  LocalExtensionAgent works as a factory for locally extended messages and segments. Locally extended message or segment should follow the structure constraints defined by HL7 standard. Every modified, extended or a new z-message or z-segment must register itself with LocalExtensionAgent.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalExtensionAgent()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Message` | `createMessage(java.lang.String strMessageCode, java.lang.String strTriggerEvent)` Creates Empty Message with Message Structure & Trigger Event specified.
    `ISegment` | `createSegment(java.lang.String strSegmentName)` Creates empty Segment for specified locally extended segment.
    `java.lang.String` | `getMsgQualifiedName(java.lang.String strMsgCode, java.lang.String strTriggerEvent)` Retrieves the Fully Qualified Name of Locally Extended Message.
    `java.lang.String` | `getSegmentQualifiedName(java.lang.String strSegmentName)` Retrieves the Fully Qualified Name of Locally Extended Segment.
    `boolean` | `isMsgLocallyRegistered(java.lang.String strMsgCode, java.lang.String strTriggerEvent)` Checks whether message with provided code and trigger event is registered as locally extended message.
    `boolean` | `isSegmentLocallyRegistered(java.lang.String strSegmentName)` Checks whether segment is registered as locally extended segment.
    `Message` | `populateMessage(ISegmentSet objSegmentSet)` Populates a locally extended message.
    `Message` | `populateMessage(java.lang.String strMessageCode, java.lang.String strTriggerEvent, ISegmentSet objSegmentSet)` Populates a locally extended message with provided message code and trigger event.
    `void` | `registerMessage(java.lang.String strMsgCode, java.lang.String strTriggerEvent, java.lang.String strQualifiedName)` Registers message with provided code and trigger event as locally extended message.
    `void` | `registerSegment(java.lang.String strSegmentName, java.lang.String strQualifiedName)` Registers segment with provided segment name as locally extended segment.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LocalExtensionAgent

          public LocalExtensionAgent()

  - ### Method Detail

    - #### getMsgQualifiedName

          public java.lang.String getMsgQualifiedName(java.lang.String strMsgCode,
                                             java.lang.String strTriggerEvent)

      Retrieves the Fully Qualified Name of Locally Extended Message.
      Parameters:
        `strMsgCode` - value of message code
        `strTriggerEvent` - value of trigger event
      Returns:
        String - value of Fully Qualified Name for Locally Extended Message

    - #### getSegmentQualifiedName

          public java.lang.String getSegmentQualifiedName(java.lang.String strSegmentName)

      Retrieves the Fully Qualified Name of Locally Extended Segment.
      Parameters:
        `strSegmentName` - name of segment
      Returns:
        String - value of Fully Qualified Name for Locally Extended Message

    - #### isMsgLocallyRegistered

          public boolean isMsgLocallyRegistered(java.lang.String strMsgCode,
                                       java.lang.String strTriggerEvent)

      Checks whether message with provided code and trigger event is registered as locally extended message.
      Parameters:
        `strMsgCode` - value of message code
        `strTriggerEvent` - value of trigger event
      Returns:
        boolean - shows status as success or failure

    - #### isSegmentLocallyRegistered

          public boolean isSegmentLocallyRegistered(java.lang.String strSegmentName)

      Checks whether segment is registered as locally extended segment.
      Parameters:
        `strSegmentName` - name of segment
      Returns:
        boolean - shows status as success or failure

    - #### registerMessage

          public void registerMessage(java.lang.String strMsgCode,
                             java.lang.String strTriggerEvent,
                             java.lang.String strQualifiedName)

      Registers message with provided code and trigger event as locally extended message.
      Parameters:
        `strMsgCode` - value of message code
        `strTriggerEvent` - value of trigger event
        `strQualifiedName` - value of Fully Qualified Name for Locally Extended Message

    - #### registerSegment

          public void registerSegment(java.lang.String strSegmentName,
                             java.lang.String strQualifiedName)

      Registers segment with provided segment name as locally extended segment.
      Parameters:
        `strSegmentName` - name of segment
        `strQualifiedName` - value of Fully Qualified Name for Locally Extended Segment

    - #### createMessage

          public Message createMessage(java.lang.String strMessageCode,
                              java.lang.String strTriggerEvent)

      Creates Empty Message with Message Structure & Trigger Event specified.
      Parameters:
        `strMessageCode` - specified message code
        `strTriggerEvent` - specified trigger event
      Returns:
        Message - Generated Empty Message

    - #### createSegment

          public ISegment createSegment(java.lang.String strSegmentName)

      Creates empty Segment for specified locally extended segment.
      Parameters:
        `strSegmentName` - name of segment
      Returns:
        ISegment - Generated Empty Segment

    - #### populateMessage

          public Message populateMessage(ISegmentSet objSegmentSet)
                                  throws MessageNotSupportedException,
                                         InvalidMessageException

      Populates a locally extended message.
      Parameters:
        `objSegmentSet` - instance of SegmentSet
      Returns:
        Message - the Message present in this message or null if unavailable
      Throws:
        `MessageNotSupportedException` - if message is not supported or loading of class fails
        `InvalidMessageException` - If Message validation fails

    - #### populateMessage

          public Message populateMessage(java.lang.String strMessageCode,
                                java.lang.String strTriggerEvent,
                                ISegmentSet objSegmentSet)
                                  throws MessageNotSupportedException,
                                         InvalidMessageException

      Populates a locally extended message with provided message code and trigger event.
      Parameters:
        `strMessageCode` - value of message code
        `strTriggerEvent` - value of trigger event
        `objSegmentSet` - instance of SegmentSet
      Returns:
        Message - the Message present in this message or null if unavailable
      Throws:
        `MessageNotSupportedException` - if message is not supported or loading of class fails
        `InvalidMessageException` - If Message validation fails