public class MSHSegment extends HL7Segment
This subclass does not allow accessing MSH.1 or MSH.2 except
indirectly via getHL7Seps() and setHL7Seps().
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_PROCESSING_ID |
static String |
DEFAULT_VERSION_ID |
static String |
MSA_SEGMENT_NAME |
static String |
MSH_SEGMENT_NAME |
static String |
TIMESTAMP_FORMAT |
fields| Constructor and Description |
|---|
MSHSegment()
Convenience constructor.
|
MSHSegment(HL7Seps seps)
Constructor.
|
MSHSegment(MSHSegment msh)
Copy constructor.
|
MSHSegment(String line)
Parsing constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(StringBuilder buf,
HL7Seps seps)
Append string encoding of this segment to the provided buffer.
|
HL7Message |
createACK(long serno)
Create an acknowlegement message for this message.
|
HL7Field |
getControlID()
Returns control ID from MSH.10.
|
HL7Seps |
getHL7Seps()
Get the separator and escape characters defined by MSH.1 and MSH.2.
|
HL7Field |
getMessageType()
Returns message type from MSH.9.
|
HL7Field |
getProcessingID()
Returns control ID from MSH.11.
|
HL7Field |
getReceivingApplication()
Returns receiving application from MSH.5.
|
HL7Field |
getReceivingFacility()
Returns receiving facility from MSH.6.
|
HL7Field |
getSendingApplication()
Returns sending application from MSH.3.
|
HL7Field |
getSendingFacility()
Returns sending facility from MSH.4.
|
HL7Field |
getTimestamp()
Returns message timestamp from MSH.7.
|
HL7Field |
getVersionID()
Returns HL7 version from MSH.12.
|
boolean |
isACK(HL7Message ack)
Check whether the given message is an acknowlegement of this MSH.
|
void |
setControlID(HL7Field field) |
void |
setField(int index,
HL7Field field)
This subclass version disallows setting MSH.1 or MSH.2 directly.
|
void |
setHL7Seps(HL7Seps seps)
Set MSH.1 and MSH.2 based on the provided separator and escape characters.
|
void |
setMessageType(HL7Field field) |
void |
setProcessingID(HL7Field field) |
void |
setReceivingApplication(HL7Field field) |
void |
setReceivingFacility(HL7Field field) |
void |
setSendingApplication(HL7Field field) |
void |
setSendingFacility(HL7Field field) |
void |
setTimestamp(HL7Field field) |
void |
setVersionID(HL7Field field) |
String |
toString()
Convert to a string using
HL7Seps.DEFAULT. |
String |
toString(HL7Seps seps)
Convert to a string using the provided separators.
|
void |
trimTo(int size)
This subclass version disallows trimming away MSH.1 or MSH.2.
|
appendField, equals, getField, getFields, getName, getNumFields, hashCode, parseAndAddFields, setField, setNamepublic static final String DEFAULT_PROCESSING_ID
public static final String DEFAULT_VERSION_ID
public static final String MSH_SEGMENT_NAME
public static final String MSA_SEGMENT_NAME
public static final String TIMESTAMP_FORMAT
public MSHSegment(String line) throws HL7ContentException
line - encoded HL7 MSH segmentHL7ContentException - if segment is invalidpublic MSHSegment(HL7Seps seps)
seps - separator and escape characters for this messagepublic MSHSegment()
MSHSegment(HL7Seps.DEFAULT)
public MSHSegment(MSHSegment msh)
msh - MSH segment to copypublic HL7Field getSendingApplication()
public void setSendingApplication(HL7Field field)
public HL7Field getSendingFacility()
public void setSendingFacility(HL7Field field)
public HL7Field getReceivingApplication()
public void setReceivingApplication(HL7Field field)
public HL7Field getReceivingFacility()
public void setReceivingFacility(HL7Field field)
public HL7Field getTimestamp()
public void setTimestamp(HL7Field field)
public HL7Field getMessageType()
public void setMessageType(HL7Field field)
public HL7Field getControlID()
public void setControlID(HL7Field field)
public HL7Field getProcessingID()
public void setProcessingID(HL7Field field)
public HL7Field getVersionID()
public void setVersionID(HL7Field field)
public HL7Seps getHL7Seps()
public void setHL7Seps(HL7Seps seps)
seps - HL7 separatorspublic void trimTo(int size)
trimTo in class HL7Segmentsize - maximum number of fieldsIllegalArgumentException - if size is less than threepublic void setField(int index,
HL7Field field)
setField in class HL7Segmentindex - index of the field in the segment (where zero is the segment name); must be at least onefield - field to setIllegalArgumentException - if index is less than threeIllegalArgumentException - if field is nullpublic HL7Message createACK(long serno) throws HL7ContentException
serno - next local HL7 serial numberHL7ContentException - if the required fields are not present
in this instancepublic boolean isACK(HL7Message ack) throws HL7ContentException
ack - putative acknowlegement of this messageack is an acknowlegement of this MSHHL7ContentException - if the required fields are not present in this instanceIllegalArgumentException - if ack is nullpublic void append(StringBuilder buf, HL7Seps seps)
This overridden version ensures that MSH.1 and MSH.2 are not escaped.
append in class HL7Segmentbuf - string bufferseps - HL7 separator and escape characterspublic String toString(HL7Seps seps)
This overridden version ensures that MSH.1 and MSH.2 are consistent with seps in the generated string.
This separators configured in this instance are not affected regardless.
toString in class HL7Segmentseps - HL7 separator and escape charactersIllegalArgumentException - if seps is nullpublic String toString()
HL7SegmentHL7Seps.DEFAULT.toString in class HL7SegmentCopyright © 2018. All rights reserved.