001 package org.vmdb.hl7;
002
003 /**
004 * <p><Title:> Processing Type (PT) 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>The method names follow the convention established by other Element type
009 * classes. Names follow the HL7 documentation.</p>
010 * <p>See the HL7 documentation for an explanation of each component.</p>
011 * @author Michael K. Martin
012 * @version 1.0
013 */
014
015 public class PTElement extends HL7Element {
016 private String sNm = "PT";
017 private String sRl = "ST[ST]";
018
019 /**
020 * Construct a Composite ID Element using the default name and type constants.
021 * @param iLevel One of the constants for specifying level as FIELD, COMPONENT, or
022 * SUBCOMPONENT. Default FIELD.
023 */
024 public PTElement( int iLevel ) {
025 super( iLevel );
026 setName( sNm );
027 setRule( sRl );
028 setType( "PT" );
029 }
030
031 /**
032 * Construct a Composite ID Element using the default name and type constants
033 * at the default level FIELD.
034 */
035 public PTElement() {
036 super( FIELD );
037 setName( sNm );
038 setRule( sRl );
039 setType( "PT" );
040 }
041
042 public void setProcessingId( String sId ) {
043 HL7Element e = new SimpleElement( iLevel + 1 );
044 e.setType( "ST" );
045 e.setName( "PT.1" );
046 e.setValue( sId );
047 try {
048 setComponent( e, 1 );
049 } catch( MalformedFieldException mfe ) {
050 mfe.printStackTrace();
051 }
052 }
053
054 public String getProcessingId() {
055 HL7Element e = getComponent( 1 );
056 if( e != null )
057 return e.toString();
058 else
059 return "";
060 }
061
062 public void setProcessingMode( String sProcessingMode ) {
063 HL7Element e = new SimpleElement( iLevel + 1 );
064 e.setType( "ST" );
065 e.setName( "PT.2" );
066 e.setValue( sProcessingMode );
067 try {
068 setComponent( e, 2 );
069 } catch( MalformedFieldException mfe ) {
070 mfe.printStackTrace();
071 }
072 }
073
074 public String getProcessingMode() {
075 HL7Element e = getComponent( 2 );
076 if( e != null )
077 return e.toString();
078 else
079 return "";
080 }
081
082 }