au.gov.nehta.vendorlibrary.mdm.segments
Class MSH.Builder

java.lang.Object
  extended by au.gov.nehta.vendorlibrary.mdm.segments.MSH.Builder
Enclosing class:
MSH

public static final class MSH.Builder
extends java.lang.Object

MSH.Builder Build class used to construct and validate an (@link MSH} object.


Constructor Summary
MSH.Builder()
          Default constructor.
 
Method Summary
 MSH build()
          Build MSH and validate necessary fields.
 MSH.Builder messageControlId(java.lang.String value)
          Set the message control ID.
 MSH.Builder messageDateTime(java.util.Date value)
          Set the date/time message.
 MSH.Builder receivingApplication(HD value)
          Set the receiving application.
 MSH.Builder receivingFacility(HD value)
          Set the receiving facility.
 MSH.Builder sendingApplication(HD value)
          Set the sending application.
 MSH.Builder sendingFacility(HD value)
          Set the sending facility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MSH.Builder

public MSH.Builder()
Default constructor.

Method Detail

messageDateTime

public MSH.Builder messageDateTime(java.util.Date value)
Set the date/time message.

Parameters:
value - Date/time message (not null).
Returns:
MSH.Builder.

messageControlId

public MSH.Builder messageControlId(java.lang.String value)
Set the message control ID.

Parameters:
value - Message control ID (not null nor blank).
Returns:
MSH.Builder.

sendingApplication

public MSH.Builder sendingApplication(HD value)
Set the sending application.

Parameters:
value - Sending application (not null).
Returns:
MSH.Builder.

sendingFacility

public MSH.Builder sendingFacility(HD value)
Set the sending facility.

Parameters:
value - Sending facility (not null).
Returns:
MSH.Builder.

receivingApplication

public MSH.Builder receivingApplication(HD value)
Set the receiving application.

Parameters:
value - Receiving application (not null).
Returns:
MSH.Builder.

receivingFacility

public MSH.Builder receivingFacility(HD value)
Set the receiving facility.

Parameters:
value - Receiving facility (not null).
Returns:
MSH.Builder.

build

public MSH build()
          throws MDMValidationException
Build MSH and validate necessary fields.

Returns:
MSH
Throws:
MDMValidationException - Thrown when validation of the MSH contents fails.