org.openhealthexchange.openpixpdq.ihe
Class HL7Actor

java.lang.Object
  extended by org.openhealthexchange.openpixpdq.ihe.HL7Actor
Direct Known Subclasses:
PdSupplier, PixManager

public class HL7Actor
extends java.lang.Object

This class implements a number of useful methods shared by all IHE Actors.

Version:
1.0 - Nov 20, 2005
Author:
Jim Firby

Constructor Summary
HL7Actor(com.misyshealthcare.connect.net.IConnectionDescription connection)
          Creates a new HL7 Actor.
HL7Actor(com.misyshealthcare.connect.net.IConnectionDescription connection, IheAuditTrail auditTrail)
          Creates a new HL7 Actor
 
Method Summary
 IheAuditTrail getAuditTrail()
          Gets the Audit Trail of this actor.
 com.misyshealthcare.connect.net.IConnectionDescription getConnection()
          Gets the IConnectionDescription of this actor.
 IMesaLogger getMesaLogger()
          Gets the MESA test logger.
 java.lang.String getName()
          Returns a useful name for this Actor so that it can be put into debugging and logging messages.
 IMessageStoreLogger getStoreLogger()
          Gets the Message Store logger.
(package private)  boolean hasMesaLogger()
          Checks whether this actor has a MESA test logger.
 MessageStore initMessageStore(ca.uhn.hl7v2.model.Message message, boolean isInbound)
          Initiates a MessageStore instance, and log the initial message, either in-bound message or out-bound message.
 void logHL7MessageError(org.apache.log4j.Logger log, ca.uhn.hl7v2.model.Message message, java.lang.String description)
          Logs an HL7 message and description to the error log.
 void saveMessageStore(ca.uhn.hl7v2.model.Message message, boolean isInbound, MessageStore msgStore)
          Persists the MessageStore log, and save the return message which could be either in-bound or out-bound.
 void setMesaLogger(IMesaLogger logger)
          Sets the custom logger for MESA test messages.
 void setStoreLogger(IMessageStoreLogger storeLogger)
          Sets the logger to store message.
 void start()
          Starts this actor.
 void stop()
          Stops this actor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HL7Actor

HL7Actor(com.misyshealthcare.connect.net.IConnectionDescription connection)
Creates a new HL7 Actor.


HL7Actor

public HL7Actor(com.misyshealthcare.connect.net.IConnectionDescription connection,
                IheAuditTrail auditTrail)
Creates a new HL7 Actor

Method Detail

start

public void start()
Starts this actor. It must be called once for each actor when the program starts.


stop

public void stop()
Stops this actor. It must be called once for each actor just before the program quits.


getName

public java.lang.String getName()
Returns a useful name for this Actor so that it can be put into debugging and logging messages.


logHL7MessageError

public void logHL7MessageError(org.apache.log4j.Logger log,
                               ca.uhn.hl7v2.model.Message message,
                               java.lang.String description)
Logs an HL7 message and description to the error log.

Parameters:
message - the HL7 message
description - a description of the problem with the message

hasMesaLogger

boolean hasMesaLogger()
Checks whether this actor has a MESA test logger.

Returns:
True if there is a defined MESA test logger.

getMesaLogger

public IMesaLogger getMesaLogger()
Gets the MESA test logger.

Returns:
The MESA test logger.

setMesaLogger

public void setMesaLogger(IMesaLogger logger)
Sets the custom logger for MESA test messages. This is only used by MESA testing programs.

Parameters:
stream - The logger for MESA messages

getStoreLogger

public IMessageStoreLogger getStoreLogger()
Gets the Message Store logger.

Returns:
The Message Store logger.

setStoreLogger

public void setStoreLogger(IMessageStoreLogger storeLogger)
Sets the logger to store message.

Parameters:
storeLogger - the storeLogger to set

initMessageStore

public MessageStore initMessageStore(ca.uhn.hl7v2.model.Message message,
                                     boolean isInbound)
                              throws ca.uhn.hl7v2.HL7Exception
Initiates a MessageStore instance, and log the initial message, either in-bound message or out-bound message.

Parameters:
message - the initial message to log
isInbound - whether the message is an in-bound message or out-bound message
Returns:
a MessageStore
Throws:
ca.uhn.hl7v2.HL7Exception

saveMessageStore

public void saveMessageStore(ca.uhn.hl7v2.model.Message message,
                             boolean isInbound,
                             MessageStore msgStore)
                      throws ca.uhn.hl7v2.HL7Exception
Persists the MessageStore log, and save the return message which could be either in-bound or out-bound.

Parameters:
message - the last message to save and log
isInbound - whether the message is an in-bound message or out-bound message
msgStore - the MessageStore instance to hold the log data
Throws:
ca.uhn.hl7v2.HL7Exception - if the message could not be encoded

getAuditTrail

public IheAuditTrail getAuditTrail()
Gets the Audit Trail of this actor.

Returns:
the auditTrail

getConnection

public com.misyshealthcare.connect.net.IConnectionDescription getConnection()
Gets the IConnectionDescription of this actor.

Returns:
the connection