com.stc.connector.hl7.framework.structure.segment
Class HL7MSHInfo
java.lang.Object
com.stc.connector.hl7.framework.structure.segment.HL7MSHInfo
- All Implemented Interfaces:
- HL7MSHInfoInterface
public class HL7MSHInfo
- extends java.lang.Object
- implements HL7MSHInfoInterface
The MSH segment has the following fields:
MSH-1: Field Separator (ST)
MSH-2: Encoding Characters (ST)
MSH-3: Sending Application (HD)
MSH-4: Sending Facility (HD)
MSH-5: Receiving Application (HD)
MSH-6: Receiving Facility (HD)
MSH-7: Date/Time Of Message (TS)
MSH-8: Security (ST)
MSH-9: Message Type (CM_MSG)
MSH-10: Message Control ID (ST)
MSH-11: Processing ID (PT)
MSH-12: Version ID (VID)
MSH-13: Sequence Number (NM)
MSH-14: Continuation Pointer (ST)
MSH-15: Accept Acknowledgment Type (ID) (Available since Version 2.2)
MSH-16: Application Acknowledgment Type (ID) (Available since Version 2.2)
MSH-17: Country Code (ID) (Available since Version 2.2)
MSH-18: Character Set (ID) (Available since Version 2.3)
MSH-19: Principal Language Of Message (CE) (Available since Version 2.3)
MSH-20: Alternate Character Set Handling Scheme (ID) (Available since Version 2.3.1)
MSH-21: Conformance Statement ID (ID) (Available since Version 2.4, and it becomes
"Message Profile Identifier" since version 2.5)
- Version:
- cvs revision: $Revision: 1.9 $ Last Modified: $Date: 2008/04/10 06:33:24 $
- Author:
- Harry Liu
Field Summary |
static java.lang.String |
version
|
Constructor Summary |
HL7MSHInfo()
Constructor for HL7MSHInfo. |
HL7MSHInfo(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
|
Method Summary |
java.lang.String |
getAlternateCharacterSetHandlingScheme()
Returns the alternateCharacterSetHandlingScheme, MSH-20. |
java.lang.String |
getCharacterSet()
Returns the characterSet, MSH-18. |
java.lang.String |
getConformanceStatementID()
Returns the conformanceStatementID, MSH-21. |
java.lang.String |
getCountryCode()
Returns the countryCode, MSH-17. |
java.lang.String |
getEncodingCharacters()
Returns the encodingCharacters, MSH-02. |
char |
getFieldSeparator()
Returns the fieldSeparator, MSH-01. |
java.lang.String |
getPrincipalLanguageOfMessage()
Returns the principalLanguageOfMessage, MSH-19. |
java.lang.String |
getProcessingID()
Returns the processingID. |
java.lang.String |
getReceivingApplication()
Returns the receivingApplication, MSH-05. |
java.lang.String |
getReceivingFacility()
Returns the receivingFacility, MSH-06. |
java.lang.String |
getSecurity()
Returns the security, MSH-08. |
java.lang.String |
getSendingApplication()
Returns the sendingApplication, MSH-03. |
java.lang.String |
getSendingFacility()
Returns the sendingFacility, MSH-04. |
boolean |
getValidateMSH()
|
java.lang.String |
getVersionID()
Returns the versionID, MSH-12. |
boolean |
isValidateMSH()
|
void |
setAlternateCharacterSetHandlingScheme(java.lang.String alternateCharacterSetHandlingScheme)
Sets the alternateCharacterSetHandlingScheme, MSH-20. |
void |
setCharacterSet(java.lang.String characterSet)
Sets the characterSet, MSH-18. |
void |
setConformanceStatementID(java.lang.String conformanceStatementID)
Sets the conformanceStatementID, MSH-21. |
void |
setCountryCode(java.lang.String countryCode)
Sets the countryCode, MSH-17. |
void |
setEncodingCharacters(java.lang.String encodingCharacters)
Sets the encodingCharacters, MSH-02. |
void |
setFieldSeparator(char fieldSeparator)
Sets the fieldSeparator, MSH-01. |
void |
setPrincipalLanguageOfMessage(java.lang.String principalLanguageOfMessage)
Sets the principalLanguageOfMessage, MSH-19. |
void |
setProcessingID(java.lang.String processingID)
Sets the processingID. |
void |
setReceivingApplication(java.lang.String receivingApplication)
Sets the receivingApplication, MSH-05. |
void |
setReceivingFacility(java.lang.String receivingFacility)
Sets the receivingFacility, MSH-06. |
void |
setSecurity(java.lang.String security)
Sets the security, MSH-08. |
void |
setSendingApplication(java.lang.String sendingApplication)
Sets the sendingApplication, MSH-03. |
void |
setSendingFacility(java.lang.String sendingFacility)
Sets the sendingFacility, MSH-04. |
void |
setValidateMSH(boolean b)
|
void |
setVersionID(java.lang.String versionID)
Sets the versionID, MSH-12. |
void |
validate()
Method validate. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
version
public static final java.lang.String version
- See Also:
- Constant Field Values
HL7MSHInfo
public HL7MSHInfo()
throws HL7ApplicationException
- Constructor for HL7MSHInfo.
- Throws:
HL7ApplicationException
HL7MSHInfo
public HL7MSHInfo(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
throws HL7ApplicationException
- Throws:
HL7ApplicationException
getAlternateCharacterSetHandlingScheme
public java.lang.String getAlternateCharacterSetHandlingScheme()
- Returns the alternateCharacterSetHandlingScheme, MSH-20.
This field is available since HL7 Version 2.3.1.
When any alternative character sets are used (as specified
in the second or later components of MSH-18 character sets),
and if any special handling scheme is needed, this component
is to specify the scheme used, according to HL7 Table 0356-
Alternate character set handling scheme.
- Specified by:
getAlternateCharacterSetHandlingScheme
in interface HL7MSHInfoInterface
- Returns:
- String
getCharacterSet
public java.lang.String getCharacterSet()
- Returns the characterSet, MSH-18.
This field is available since HL7 Version 2.3.
This field contains the character set for the entire message.
Refer to HL7 Table 0211 - Alternate character sets for valid values.
- Specified by:
getCharacterSet
in interface HL7MSHInfoInterface
- Returns:
- String
getConformanceStatementID
public java.lang.String getConformanceStatementID()
- Returns the conformanceStatementID, MSH-21.
This field is available since HL7 Version 2.4.
Sites may use this field to assert adherence to a Conformance
Statement published by HL7 or by a site. Conformance Statements
contain detailed explanations of grammar, syntax, and usage for
a particular message or set of messages. Examples of the use of
Conformance Statements appear in Chapter 5, "Query." Repetition
of this field allows more flexibility in creating and naming
conformance statements. For example, the first repetition could
reference a standard conformance statement, and the second,
just some changes to it. Values for HL7-standard conformance
statements appear in HL7 Table 0449 - Confor mance statements.
- Specified by:
getConformanceStatementID
in interface HL7MSHInfoInterface
- Returns:
- String
getCountryCode
public java.lang.String getCountryCode()
- Returns the countryCode, MSH-17.
This field is available since HL7 Version 2.2.
This field contains the country of origin for the message. It will
be used primarily to specify default elements, such as currency
denominations. The values to be used are those of ISO 3166,
which are reprinted here upon written approval from ANSI.[2].
The ISO 3166 table has three separate forms of the country code:
HL7 specifies that the 3-character (alphabetic) form be used for
the country code. Refer to HL7 Tabl e 0399 - Country code for
the 3-character codes as defined by ISO 3166 table.
- Specified by:
getCountryCode
in interface HL7MSHInfoInterface
- Returns:
- String
getEncodingCharacters
public java.lang.String getEncodingCharacters()
- Returns the encodingCharacters, MSH-02.
This field contains the four characters in the following order:
the component separator, repetition separator, escape character,
and subcomponent separator.
Recommended values are ^~\& (ASCII 94, 126, 92, and 38, respectively).
- Specified by:
getEncodingCharacters
in interface HL7MSHInfoInterface
- Returns:
- String
getFieldSeparator
public char getFieldSeparator()
- Returns the fieldSeparator, MSH-01.
This field contains the separator between the segment ID
and the first real field, MSH-2-encoding characters.
As such it serves as the separator and defines the character
to be used as a separator for the rest of the message.
Recommended value is |, (ASCII 124).
- Specified by:
getFieldSeparator
in interface HL7MSHInfoInterface
- Returns:
- char
getPrincipalLanguageOfMessage
public java.lang.String getPrincipalLanguageOfMessage()
- Returns the principalLanguageOfMessage, MSH-19.
This field is available since HL7 Version 2.3.
This field contains the principal language of the message.
Codes come from ISO 639.
- Specified by:
getPrincipalLanguageOfMessage
in interface HL7MSHInfoInterface
- Returns:
- String
getProcessingID
public java.lang.String getProcessingID()
- Returns the processingID.
- Specified by:
getProcessingID
in interface HL7MSHInfoInterface
- Returns:
- String
getReceivingApplication
public java.lang.String getReceivingApplication()
- Returns the receivingApplication, MSH-05.
This field uniquely identifies the receiving application
among all other applications within the network enterprise.
The network enterprise consists of all those applications
that participate in the exchange of HL7 messages within the
enterprise. Entirely site-defined.
User-defined Table 0361-Sending/receiving application is used
as the HL7 identifier for the user-defined table of values
for the first component.
- Specified by:
getReceivingApplication
in interface HL7MSHInfoInterface
- Returns:
- String
getReceivingFacility
public java.lang.String getReceivingFacility()
- Returns the receivingFacility, MSH-06.
Sets the receivingFacility.
This field identifies the receiving application among
multiple identical instances of the application running
on behalf of different organizations.
User-defined Table 0362 - Sending/rec eiving facility is used
as the HL7 identifier for the user-defined table of values
for the first component. Entirely site-defined.
- Specified by:
getReceivingFacility
in interface HL7MSHInfoInterface
- Returns:
- String
getSecurity
public java.lang.String getSecurity()
- Returns the security, MSH-08.
In some applications of HL7, this field is used to implement
security features. Its use is not yet further specified.
- Specified by:
getSecurity
in interface HL7MSHInfoInterface
- Returns:
- String
getSendingApplication
public java.lang.String getSendingApplication()
- Returns the sendingApplication, MSH-03.
This field uniquely identifies the sending application among
all other applications within the network enterprise.
The network enterprise consists of all those applications
that participate in the exchange of HL7 messages within the
enterprise. Entirely site-defined.
User-defined Table 0361-Sending/receiving application is used
as the user-defined table of values for the first component.
- Specified by:
getSendingApplication
in interface HL7MSHInfoInterface
- Returns:
- String
getSendingFacility
public java.lang.String getSendingFacility()
- Returns the sendingFacility, MSH-04.
This field further describes the sending application,
MSH-3-sending application. With the promotion of this field
to an HD data type, the usage has been broadened to include
not just the sending facility but other organizational entities
such as
a) the organizational entity responsible for sending application;
b) the responsible unit; c) a product or vendor's identifier, etc.
Entirely site-defined.
User-defined Table 0362 - Sending/receiving facility is used as
the HL7 identifier for the user-defined table of values for
the first component.
- Specified by:
getSendingFacility
in interface HL7MSHInfoInterface
- Returns:
- String
getVersionID
public java.lang.String getVersionID()
- Returns the versionID, MSH-12.
This field is matched by the receiving system to its own version
to be sure the message will be interpreted correctly. Beginning
with Version 2.3.1, it has two additional "internationalization"
components, for use by HL7 international affiliates. The
"internationalization code" is CE data type (using the ISO country
codes where appropriate) which represents the HL7 affiliate. The
"internal version ID" is used if the HL7 Affiliate has more than a
single `local' version associated with a single US version. The
"internal version ID" has a CE data type, since the table values vary
for each HL7 Affiliate.
- Specified by:
getVersionID
in interface HL7MSHInfoInterface
- Returns:
- String
setAlternateCharacterSetHandlingScheme
public void setAlternateCharacterSetHandlingScheme(java.lang.String alternateCharacterSetHandlingScheme)
throws HL7ApplicationException
- Sets the alternateCharacterSetHandlingScheme, MSH-20.
This field is available since HL7 Version 2.3.1.
When any alternative character sets are used (as specified
in the second or later components of MSH-18 character sets),
and if any special handling scheme is needed, this component
is to specify the scheme used, according to HL7 Table 0356-
Alternate character set handling scheme.
- Specified by:
setAlternateCharacterSetHandlingScheme
in interface HL7MSHInfoInterface
- Parameters:
alternateCharacterSetHandlingScheme
- The alternateCharacterSetHandlingScheme to set
- Throws:
HL7ApplicationException
setCharacterSet
public void setCharacterSet(java.lang.String characterSet)
throws HL7ApplicationException
- Sets the characterSet, MSH-18.
This field is available since HL7 Version 2.3.
This field contains the character set for the entire message.
Refer to HL7 Table 0211 - Alternate character sets for valid values.
- Specified by:
setCharacterSet
in interface HL7MSHInfoInterface
- Parameters:
characterSet
- The characterSet to set
- Throws:
HL7ApplicationException
setConformanceStatementID
public void setConformanceStatementID(java.lang.String conformanceStatementID)
throws HL7ApplicationException
- Sets the conformanceStatementID, MSH-21.
This field is available since HL7 Version 2.4.
Sites may use this field to assert adherence to a Conformance
Statement published by HL7 or by a site. Conformance Statements
contain detailed explanations of grammar, syntax, and usage for
a particular message or set of messages. Examples of the use of
Conformance Statements appear in Chapter 5, "Query." Repetition
of this field allows more flexibility in creating and naming
conformance statements. For example, the first repetition could
reference a standard conformance statement, and the second,
just some changes to it. Values for HL7-standard conformance
statements appear in HL7 Table 0449 - Confor mance statements.
- Specified by:
setConformanceStatementID
in interface HL7MSHInfoInterface
- Parameters:
conformanceStatementID
- The conformanceStatementID to set
- Throws:
HL7ApplicationException
setCountryCode
public void setCountryCode(java.lang.String countryCode)
throws HL7ApplicationException
- Sets the countryCode, MSH-17.
This field is available since HL7 Version 2.2.
This field contains the country of origin for the message. It will
be used primarily to specify default elements, such as currency
denominations. The values to be used are those of ISO 3166,
which are reprinted here upon written approval from ANSI.[2].
The ISO 3166 table has three separate forms of the country code:
HL7 specifies that the 3-character (alphabetic) form be used for
the country code. Refer to HL7 Tabl e 0399 - Country code for
the 3-character codes as defined by ISO 3166 table.
- Specified by:
setCountryCode
in interface HL7MSHInfoInterface
- Parameters:
countryCode
- The countryCode to set
- Throws:
HL7ApplicationException
setEncodingCharacters
public void setEncodingCharacters(java.lang.String encodingCharacters)
throws HL7ApplicationException
- Sets the encodingCharacters, MSH-02.
This field contains the four characters in the following order:
the component separator, repetition separator, escape character,
and subcomponent separator.
Recommended values are ^~\& (ASCII 94, 126, 92, and 38, respectively).
- Specified by:
setEncodingCharacters
in interface HL7MSHInfoInterface
- Parameters:
encodingCharacters
- The encodingCharacters to set
- Throws:
HL7ApplicationException
setFieldSeparator
public void setFieldSeparator(char fieldSeparator)
throws HL7ApplicationException
- Sets the fieldSeparator, MSH-01.
This field contains the separator between the segment ID
and the first real field, MSH-2-encoding characters.
As such it serves as the separator and defines the character
to be used as a separator for the rest of the message.
Recommended value is |, (ASCII 124).
- Specified by:
setFieldSeparator
in interface HL7MSHInfoInterface
- Parameters:
fieldSeparator
- The fieldSeparator to set
- Throws:
HL7ApplicationException
setPrincipalLanguageOfMessage
public void setPrincipalLanguageOfMessage(java.lang.String principalLanguageOfMessage)
throws HL7ApplicationException
- Sets the principalLanguageOfMessage, MSH-19.
This field is available since HL7 Version 2.3.
This field contains the principal language of the message.
Codes come from ISO 639.
- Specified by:
setPrincipalLanguageOfMessage
in interface HL7MSHInfoInterface
- Parameters:
principalLanguageOfMessage
- The principalLanguageOfMessage to set
- Throws:
HL7ApplicationException
setProcessingID
public void setProcessingID(java.lang.String processingID)
throws HL7ApplicationException
- Sets the processingID.
- Specified by:
setProcessingID
in interface HL7MSHInfoInterface
- Parameters:
processingID
- The processingID to set
- Throws:
HL7ApplicationException
setReceivingApplication
public void setReceivingApplication(java.lang.String receivingApplication)
throws HL7ApplicationException
- Sets the receivingApplication, MSH-05.
This field uniquely identifies the receiving application
among all other applications within the network enterprise.
The network enterprise consists of all those applications
that participate in the exchange of HL7 messages within the
enterprise. Entirely site-defined.
User-defined Table 0361-Sending/receiving application is used
as the HL7 identifier for the user-defined table of values
for the first component.
- Specified by:
setReceivingApplication
in interface HL7MSHInfoInterface
- Parameters:
receivingApplication
- The receivingApplication to set
- Throws:
HL7ApplicationException
setReceivingFacility
public void setReceivingFacility(java.lang.String receivingFacility)
throws HL7ApplicationException
- Sets the receivingFacility, MSH-06.
This field identifies the receiving application among
multiple identical instances of the application running
on behalf of different organizations.
User-defined Table 0362 - Sending/receiving facility is used
as the HL7 identifier for the user-defined table of values
for the first component. Entirely site-defined.
- Specified by:
setReceivingFacility
in interface HL7MSHInfoInterface
- Parameters:
receivingFacility
- The receivingFacility to set
- Throws:
HL7ApplicationException
setSecurity
public void setSecurity(java.lang.String security)
throws HL7ApplicationException
- Sets the security, MSH-08.
In some applications of HL7, this field is used to implement
security features. Its use is not yet further specified.
- Specified by:
setSecurity
in interface HL7MSHInfoInterface
- Parameters:
security
- The security to set
- Throws:
HL7ApplicationException
setSendingApplication
public void setSendingApplication(java.lang.String sendingApplication)
throws HL7ApplicationException
- Sets the sendingApplication, MSH-03.
This field uniquely identifies the sending application among
all other applications within the network enterprise.
The network enterprise consists of all those applications
that participate in the exchange of HL7 messages within the
enterprise. Entirely site-defined.
User-defined Table 0361-Sending/receiving application is used
as the user-defined table of values for the first component.
- Specified by:
setSendingApplication
in interface HL7MSHInfoInterface
- Parameters:
sendingApplication
- The sendingApplication to set
- Throws:
HL7ApplicationException
setSendingFacility
public void setSendingFacility(java.lang.String sendingFacility)
throws HL7ApplicationException
- Sets the sendingFacility, MSH-04.
This field further describes the sending application,
MSH-3-sending application. With the promotion of this field
to an HD data type, the usage has been broadened to include
not just the sending facility but other organizational entities
such as
a) the organizational entity responsible for sending application;
b) the responsible unit; c) a product or vendor's identifier, etc.
Entirely site-defined.
User-defined Table 0362 - Sending/receiving facility is used as
the HL7 identifier for the user-defined table of values for
the first component.
- Specified by:
setSendingFacility
in interface HL7MSHInfoInterface
- Parameters:
sendingFacility
- The sendingFacility to set
- Throws:
HL7ApplicationException
setVersionID
public void setVersionID(java.lang.String versionID)
throws HL7ApplicationException
- Sets the versionID, MSH-12.
This field is matched by the receiving system to its own version
to be sure the message will be interpreted correctly. Beginning
with Version 2.3.1, it has two additional "internationalization"
components, for use by HL7 international affiliates. The
"internationalization code" is CE data type (using the ISO country
codes where appropriate) which represents the HL7 affiliate. The
"internal version ID" is used if the HL7 Affiliate has more than a
single `local' version associated with a single US version. The
"internal version ID" has a CE data type, since the table values vary
for each HL7 Affiliate.
- Specified by:
setVersionID
in interface HL7MSHInfoInterface
- Parameters:
versionID
- The versionID to set
- Throws:
HL7ApplicationException
isValidateMSH
public boolean isValidateMSH()
- Specified by:
isValidateMSH
in interface HL7MSHInfoInterface
- Returns:
getValidateMSH
public boolean getValidateMSH()
- Specified by:
getValidateMSH
in interface HL7MSHInfoInterface
- Returns:
setValidateMSH
public void setValidateMSH(boolean b)
- Specified by:
setValidateMSH
in interface HL7MSHInfoInterface
- Parameters:
b
-
validate
public void validate()
throws HL7ApplicationException
- Method validate.
- Throws:
HL7ApplicationException