001 package org.vmdb.hl7;
002
003 /**
004 * <p><Title:> Message Acknowledgement (MSA) Segment. </p>
005 * <p>Description: HL7 Network Connectivity For VMDB. </p>
006 * <p>Copyright: Copyright (c) 2002-2003. </p>
007 * <p>Company: Veterinary Medical Database (VMDB). </p>
008 * <p>Use of this process has not yet been implemented in high level code. See
009 * HL7 Standard Chapter 2 for details.</p>
010 * @author Michael K. Martin
011 * @version 1.0
012 */
013
014 public class MSASegment extends HL7Segment {
015 private String sNm = "MSA";
016 private String sRl = "DT ID ST[ST][NM][ID][CE]";
017
018 public MSASegment() {
019 setName( sNm );
020 setRule( sRl );
021 }
022
023 public MSASegment( HL7SegmentContainer msgParent ) {
024 super( msgParent );
025 setName( sNm );
026 setRule( sRl );
027 }
028
029 /**
030 * Set the message control ID.<br><br>
031 * This identifier is used to uniquely
032 * identify this message in returned acknowlegements, etc.
033 * @param sMessageControlId a String up to 20 characters usually
034 * a random unique sequence.
035 *
036 */
037 public void setAcknowledgmentCode( String sMessageControlId ) {
038 try {
039 setField( sMessageControlId, 1 );
040 }
041 catch( ArrayIndexOutOfBoundsException ae ) {
042 ae.printStackTrace();
043 }
044 }
045
046 /**
047 * Get the message control ID as a string.
048 * @return String
049 */
050 public String getAcknowledgmentCode() {
051 try {
052 return getFieldValue( 1 );
053 }
054 catch( ArrayIndexOutOfBoundsException ae ) {
055 ae.printStackTrace();
056 }
057 return "";
058 }
059
060 /**
061 * Set the message control ID.<br><br>
062 * This identifier is used to uniquely
063 * identify this message in returned acknowlegements, etc.
064 * @param sMessageControlId a String up to 20 characters usually
065 * a random unique sequence.
066 *
067 */
068 public void setMessageControlId( String sMessageControlId ) {
069 try {
070 setField( sMessageControlId, 2 );
071 }
072 catch( ArrayIndexOutOfBoundsException ae ) {
073 ae.printStackTrace();
074 }
075 }
076
077 /**
078 * Get the message control ID as a string.
079 * @return String
080 */
081 public String getMessageControlId() {
082 try {
083 return getFieldValue( 2 );
084 }
085 catch( ArrayIndexOutOfBoundsException ae ) {
086 ae.printStackTrace();
087 }
088 return "";
089 }
090
091 } // End class MSASegment
092