public abstract class Message
extends java.lang.Object
| Constructor and Description |
|---|
Message(IMap objMessageMap,
java.lang.String strMessageCode,
java.lang.String strTriggerEvent,
java.lang.String strMessageStructure)
Parameterized Constructor of Message which takes MessageMap, Message Code, Trigger Event and Message Structure.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(ISegmentKey enumSegments)
Check weather Segment or Group is present or not.
|
void |
dumpMessage(IHL7Stream objIHL7Stream)
Serializes message Information in the form of Attribute Name and its Value.
|
void |
dumpMessage(java.lang.String strFilePath)
Serializes message Information in the form of Attribute Name and its Value.
|
EnumAcknowledgementMode |
getACKMode()
Retrieves ACK mode.
|
ISingleCollection<IGroup> |
getGroup(ISegmentKey enumSegments)
Get the Group Collection from the Message with the help of provided Segment Key.
|
IMap |
getGroupMap(ISegmentKey enumGroupName)
Retrieves Map of specified Group name.
|
MSH |
getHeader()
Retrieves Message Header(MSH)
|
java.lang.String |
getMessageCode()
Retrieves Message Code of Message.
|
java.lang.String |
getMessageControlID()
Returns MessageControlID from MSA segment of this message.
|
java.lang.String |
getMessageStructure()
Retrieves Message Structure of Message.
|
ISingleCollection<IDataType> |
getQueryUserParameters()
Retrieves collection of User Parameters from QPD Segment of Message, if QPD segment is absent returns null.
|
ISingleCollection<ISegment> |
getSegment(ISegmentKey enumSegments)
Get the Segment Collection from the Message with the help of provided Segment Key.
|
ISegmentSet |
getSegmentSet()
Retrieves populated SegmentSet from message structure.
|
EnumSubscriptionType |
getSubscriptionType()
gets SubscriptionType for Message.
|
java.lang.String |
getTriggerEvent()
Retrieves Trigger Event of Message.
|
boolean |
isQuery()
Verifies whether message is Query.
|
boolean |
isResponse()
Verifies whether message is Response.
|
int |
populate(ISegmentSet objSegmentSet)
Populates Message using provided SegmentSet according to Message Structure specified by HL7 standard.
|
void |
removeGroup(ISegmentKey enumSegments)
Remove the Group from the Message.
|
void |
removeSegment(ISegmentKey enumSegments)
Remove the Segment from the Message.
|
int |
removeSegment(ISegmentKey enumSearchSegment,
boolean isForcefullyRemove)
Removes only first level Segments or Group from the HL7 Message.
|
int |
removeSegmentAttribute(ISegmentKey removeSegmentKey,
int iItemID,
boolean isForcefullyRemove)
Removes Attribute of a segment.
|
int |
removeSegmentAttribute(ISegmentKey removeSegmentKey,
java.lang.String strAttributeName,
boolean isForcefullyRemove)
Removes Attribute of a segment.
|
int |
removeSegmentAttribute(MultiValuedPairedCollection<ISegmentKey,java.lang.Integer> objSegmentKeyCollection,
boolean isForcefullyRemove)
Removes Attribute of a segment.
|
int |
removeSegments(ISingleCollection<ISegmentKey> objSegmentKeyCollection,
boolean isForcefullyRemove)
Removes collection of first level message or segments from HL7 message
|
void |
setHeader(MSH objMSH)
Sets Message Header
|
void |
setSubscriptionType(EnumSubscriptionType enumSubscriptionType)
Sets SubscriptionType for Message.
|
int |
updateSegmentAttribute(ISegmentKey removeSegmentKey,
int iItemID,
IDataType objIDataType)
Removes Attribute of a segment.
|
int |
updateSegmentAttribute(ISegmentKey removeSegmentKey,
int iItemID,
java.lang.String strSegmentStream,
IDelimiter objDelimiter)
Removes Attribute of a segment.
|
boolean |
validate()
Validates HL7 Message objects.
|
int |
writeToXML(IHL7Stream objIHL7Stream)
Serializes message Information in the form of Attribute Name and its Value.
|
int |
writeToXML(java.lang.String strFilePath)
Serializes message Information in the form of Attribute Name and its Value.
|
public Message(IMap objMessageMap, java.lang.String strMessageCode, java.lang.String strTriggerEvent, java.lang.String strMessageStructure)
objMessageMap - Object of IMapstrMessageCode - Message Code of MessagestrTriggerEvent - Event of MessagestrMessageStructure - Message structure of Messagepublic java.lang.String getMessageStructure()
public java.lang.String getMessageCode()
public java.lang.String getTriggerEvent()
public ISingleCollection<ISegment> getSegment(ISegmentKey enumSegments)
enumSegments - Object of ISegmentKey provides name of Segmentpublic ISingleCollection<IGroup> getGroup(ISegmentKey enumSegments)
enumSegments - Object of ISegmentKey provides name of Grouppublic boolean contains(ISegmentKey enumSegments)
enumSegments - Object of ISegmentKey provides name of Segmentpublic void removeSegment(ISegmentKey enumSegments)
enumSegments - Object of ISegmentKey provides name of Segmentpublic void removeGroup(ISegmentKey enumSegments)
enumSegments - Object of ISegmentKey provides name of Grouppublic void setHeader(MSH objMSH)
objMSH - Specified Message Header(MSH)public MSH getHeader()
public ISingleCollection<IDataType> getQueryUserParameters()
public EnumAcknowledgementMode getACKMode()
public boolean isQuery()
public boolean isResponse()
public java.lang.String getMessageControlID()
public int populate(ISegmentSet objSegmentSet) throws InvalidMessageException
objSegmentSet - instance of SegmentSetInvalidMessageException - If message validation failspublic ISegmentSet getSegmentSet() throws InvalidMessageException
InvalidMessageException - If message validation failspublic boolean validate()
throws InvalidMessageException
InvalidMessageException - Thrown when Message validation failspublic IMap getGroupMap(ISegmentKey enumGroupName)
enumGroupName - Object of ISegmentKey provides name of Grouppublic void dumpMessage(IHL7Stream objIHL7Stream) throws java.io.IOException
objIHL7Stream - Object of IHL7Streamjava.io.IOException - Signals that an I/O exception of some sort has occurredpublic void dumpMessage(java.lang.String strFilePath)
throws java.io.IOException
strFilePath - Full path with file name where dump will be storedjava.io.IOException - Signals that an I/O exception of some sort has occurredpublic int removeSegment(ISegmentKey enumSearchSegment, boolean isForcefullyRemove)
enumSearchSegment - enumSearchSegment Object of ISegmentKey provides name of Segment or GroupisForecefullyRemove - Boolean value if True - Removes the Segment or Group forcefully regardless of whether
resulting HL7 message is valid or not
If false - Remove the Segment or Group from message only if resulting message is validpublic int removeSegments(ISingleCollection<ISegmentKey> objSegmentKeyCollection, boolean isForcefullyRemove)
objSegmentCollection - Object of ISingleCollection of ISegments to be removedisForecefullyRemove - Boolean value if True - Removes the Segment or Group forcefully regardless of whether
resulting HL7 message is valid or not
If false - Remove the Segment or Group from message only if resulting message is validpublic int removeSegmentAttribute(ISegmentKey removeSegmentKey, java.lang.String strAttributeName, boolean isForcefullyRemove)
removeSegmentKey - Object of ISegmentKey specifies name of a segmentstrAttributeName - String value for name of attributeisForecefullyRemove - Boolean value if True - Removes the Segment or Group forcefully regardless of whether
resulting HL7 message is valid or not
If false - Remove the Segment or Group from message only if resulting message is validpublic int removeSegmentAttribute(MultiValuedPairedCollection<ISegmentKey,java.lang.Integer> objSegmentKeyCollection, boolean isForcefullyRemove)
objSegmentKeyCollection - Object containing Collection of SegmentKey and its item IDpublic int removeSegmentAttribute(ISegmentKey removeSegmentKey, int iItemID, boolean isForcefullyRemove)
removeSegmentKey - Object of ISegmentKey specifies name of a segmentiItemID - Integer value for attribute which is Item ID specified by HL7public int updateSegmentAttribute(ISegmentKey removeSegmentKey, int iItemID, java.lang.String strSegmentStream, IDelimiter objDelimiter) throws java.io.IOException
removeSegmentKey - Object of ISegmentKey specifies name of a segmentiItemID - Integer value for attribute which is Item ID specified by HL7java.io.IOExceptionpublic int updateSegmentAttribute(ISegmentKey removeSegmentKey, int iItemID, IDataType objIDataType) throws java.io.IOException
removeSegmentKey - Object of ISegmentKey specifies name of a segmentiItemID - Integer value for attribute which is Item ID specified by HL7java.io.IOExceptionpublic void setSubscriptionType(EnumSubscriptionType enumSubscriptionType)
enumSubscriptionType - it states for subscription type whether it is new or modifiedpublic EnumSubscriptionType getSubscriptionType()
public int writeToXML(java.lang.String strFilePath)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
strFilePath - Destination file pathjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic int writeToXML(IHL7Stream objIHL7Stream) throws java.io.IOException, javax.xml.stream.XMLStreamException
objIHL7Stream - object if IHL7Streamjava.io.IOExceptionjavax.xml.stream.XMLStreamException