001    package org.vmdb.hl7;
002    
003    /**
004     * <p><Title:> Response Control Parameter (RCP) 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 RCPSegment extends HL7Segment {
015       private String sNm = "RCP";
016       private String sRl = "DT [ID][CQ][CE][TS][ID][SRT][ID]";
017    
018       public RCPSegment() {
019          setName( sNm );
020          setRule( sRl );
021       }
022    
023       public RCPSegment( HL7SegmentContainer msgParent ) {
024          super( msgParent );
025          setName( sNm );
026          setRule( sRl );
027       }
028    
029       /**
030        * Set the priority as I immediate or D defered (only I used in this app).
031        * @param sPriority
032        */
033       public void setPriority( String sPriority ) {
034          try {
035             setField( sPriority, 1 );
036          }
037          catch( ArrayIndexOutOfBoundsException ae ) {
038             ae.printStackTrace();
039          }
040       }
041    
042       public String getPriority() {
043          try {
044             return getFieldValue( 1 );
045          }
046          catch( ArrayIndexOutOfBoundsException ae ) {
047             ae.printStackTrace();
048          }
049          return "";
050       }
051    
052       /**
053        * Set the Modality as string with just the code R for real time.
054        * @param ceQueryName a constructed CEElement coding for the observation identifier.
055        */
056       public void setModality( String sCode ) {
057          CEElement ceModality = new CEElement();
058          ceModality.setIdentifier( sCode );
059          try {
060             setField( ceModality, 3 );
061          }
062          catch( ArrayIndexOutOfBoundsException ae ) {
063             ae.printStackTrace();
064          }
065          catch( MalformedSegmentException mfe ) {
066             mfe.printStackTrace();
067          }
068       }
069    
070       /**
071        * Set the Modality as coded CE element.
072        * @param ceQueryName a constructed CEElement coding for the observation identifier.
073        */
074       public void setModality( CEElement ceModality ) {
075          try {
076             setField( ceModality, 3 );
077          }
078          catch( ArrayIndexOutOfBoundsException ae ) {
079             ae.printStackTrace();
080          }
081          catch( MalformedSegmentException mfe ) {
082             mfe.printStackTrace();
083          }
084       }
085    
086       public CEElement getModality() { return (CEElement)getField(3); }
087    
088       public String getModalityCode() {
089          try {
090             return getFieldValue( 3 );
091          }
092          catch( ArrayIndexOutOfBoundsException ae ) {
093             ae.printStackTrace();
094          }
095          return "";
096       }
097    
098    
099    } // End class MSASegment
100