001 package org.vmdb.hl7; 002 003 /** 004 * <p><Title:> Financial Class (FC) 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 FCElement extends HL7Element { 016 private String sNm = "FC"; 017 private String sRl = "IS[TS]"; 018 019 /** 020 * Construct a Financial Class 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 FCElement( int iLevel ) { 025 super( iLevel ); 026 setName( sNm ); 027 setRule( sRl ); 028 setType( "FC" ); 029 } 030 031 /** 032 * Construct a Financial Class Element using the default name and type constants 033 * at the default level FIELD. 034 */ 035 public FCElement() { 036 super( FIELD ); 037 setName( sNm ); 038 setRule( sRl ); 039 setType( "FC" ); 040 } 041 042 public void setFinancialClass( String sFinancialClass ) { 043 HL7Element e = new SimpleElement( iLevel + 1 ); 044 e.setType( "IS" ); 045 e.setName( "FC.1" ); 046 e.setValue( sFinancialClass ); 047 try { 048 setComponent( e, 1 ); 049 } catch( MalformedFieldException mfe ) { 050 mfe.printStackTrace(); 051 } 052 } 053 054 public String getFinancialClass() { 055 HL7Element e = getComponent( 1 ); 056 if( e != null ) 057 return e.toString(); 058 else 059 return ""; 060 } 061 062 public void setEffectiveDate( String sEffectiveDate ) { 063 TSElement e = new TSElement( iLevel + 1 ); 064 e.setName( "FC.2" ); 065 e.setDateTime( sEffectiveDate ); 066 try { 067 setComponent( e, 2 ); 068 } catch( MalformedFieldException mfe ) { 069 mfe.printStackTrace(); 070 } 071 } 072 073 public String getEffectiveDate() { 074 TSElement e = (TSElement)getComponent( 2 ); 075 if( e != null ) 076 return e.getDateTime(); 077 else 078 return ""; 079 } 080 }