001 package org.vmdb.hl7;
002
003 /**
004 * <p><Title:> Version ID Element. </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>Note: This element is only used in MSH to identify the specific message.
009 * As such it will probably <i>only</i> be used in implementation of classes
010 * that override HL7Message to implement specific message types.
011 * @author Michael K. Martin
012 * @version 1.0
013 */
014
015 public class VIDElement extends HL7Element {
016 private String sNm = "VID";
017 private String sRl = "[ID][CE][CE]";
018
019 /**
020 * Construct a composite message type element using the default name and type constants
021 * at the default level FIELD.
022 */
023 public VIDElement() {
024 super( FIELD );
025 setName( sNm );
026 setRule( sRl );
027 setType( "VID" );
028 }
029
030 /**
031 * Set the version ID.
032 * @param sMsgType String with version ID, currently always 2.4
033 */
034 public void setVersionID( String sVersionID ) {
035 HL7Element e = new SimpleElement( iLevel + 1 );
036 e.setType( "ID" );
037 e.setName( "VID.1" );
038 e.setValue( sVersionID );
039 try {
040 setComponent( e, 1 );
041 } catch( MalformedFieldException mfe ) {
042 mfe.printStackTrace();
043 }
044 }
045
046 /**
047 * Get the version ID.
048 * @return String with version ID, currently always 2.4
049 */
050 public String getVersionID() {
051 HL7Element e = getComponent( 1 );
052 if( e != null )
053 return e.toString();
054 else
055 return "";
056 }
057
058 /**
059 * Set the Internationalization code.
060 * @param ceIntCode CE Element with code, not currently used
061 */
062 public void setInternationalizationCode( CEElement ceIntCode ) {
063 ceIntCode.setName( "VID.2" );
064 try {
065 setComponent( ceIntCode, 2 );
066 } catch( MalformedFieldException mfe ) {
067 mfe.printStackTrace();
068 }
069 }
070
071 /**
072 * Get the Internationalization code.
073 * @return ceIntCode CE Element with code, not currently used
074 */
075 public CEElement getInternationalizationCode() {
076 CEElement ceIntCode = (CEElement)getComponent( 2 );
077 if( ceIntCode != null )
078 return ceIntCode;
079 else
080 return null;
081 }
082
083 /**
084 * Set the Internationalization version.
085 * @param ceIntCode CE Element with version, not currently used
086 */
087 public void setInternationalizationVersion( CEElement ceIntVersion ) {
088 ceIntVersion.setName( "VID.3" );
089 try {
090 setComponent( ceIntVersion, 3 );
091 } catch( MalformedFieldException mfe ) {
092 mfe.printStackTrace();
093 }
094 }
095
096 /**
097 * Get the Internationalization version.
098 * @return ceIntCode CE Element with version, not currently used
099 */
100 public CEElement getInternationalizationVersion() {
101 CEElement ceIntVersion = (CEElement)getComponent( 3 );
102 if( ceIntVersion != null )
103 return ceIntVersion;
104 else
105 return null;
106 }
107
108 } // End class VID Element