|  |  | @ -16,7 +16,7 @@ import java.util.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.evolute.utils.documents.*; |  |  |  | import com.evolute.utils.documents.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.evolute.utils.data.*; |  |  |  | import com.evolute.utils.data.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.evolute.utils.dataui.*; |  |  |  | import com.evolute.utils.dataui.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.evolute.utils.metadb.*; |  |  |  | //import com.evolute.utils.metadb.*;
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | import com.evolute.utils.ui.*; |  |  |  | import com.evolute.utils.ui.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.evolute.utils.ui.button.*; |  |  |  | import com.evolute.utils.ui.button.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.evolute.utils.ui.panel.*; |  |  |  | import com.evolute.utils.ui.panel.*; | 
			
		
	
	
		
		
			
				
					|  |  | @ -30,6 +30,11 @@ import siprp.data.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | public class ExamePanel extends JPanel |  |  |  | public class ExamePanel extends JPanel | 
			
		
	
		
		
			
				
					
					|  |  |  | 	implements ChangeListener, ControllableComponent, ListSelectionListener |  |  |  | 	implements ChangeListener, ControllableComponent, ListSelectionListener | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	static | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		ExameData.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, ExameData.class ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private JCalendarPanel dataExamePanel; |  |  |  | 	private JCalendarPanel dataExamePanel; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private BetterButtonGroup tipoGroup; |  |  |  | 	private BetterButtonGroup tipoGroup; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private JRadioButton admissaoRadio; |  |  |  | 	private JRadioButton admissaoRadio; | 
			
		
	
	
		
		
			
				
					|  |  | @ -245,20 +250,21 @@ public class ExamePanel extends JPanel | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private void setupComponentsHashtable() |  |  |  | 	private void setupComponentsHashtable() | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 		components = new ComponentsHashtable(); |  |  |  | 		components = new ComponentsHashtable(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putDummy( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.TIPO ); |  |  |  | 		components.putDummy( ExameData.TIPO ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.DATA, dataExamePanel ); |  |  |  | 		components.putComponent( ExameData.DATA, dataExamePanel ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.OCASIONAL, ocasionalPanel ); |  |  |  | 		components.putComponent( ExameData.OCASIONAL, ocasionalPanel ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.OUTRO_TIPO, especificarText ); |  |  |  | 		components.putComponent( ExameData.OUTRO_TIPO, especificarText ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.PROXIMO_EXAME, proximoExamePanel ); |  |  |  | 		components.putComponent( ExameData.PROXIMO_EXAME, proximoExamePanel ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.RESULTADO, resultadoPanel ); |  |  |  | 		components.putComponent( ExameData.RESULTADO, resultadoPanel ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.OUTRA_FUNCAO_1, outrasFuncoesTexts[ 0 ] ); |  |  |  | 		components.putComponent( ExameData.OUTRA_FUNCAO_1, outrasFuncoesTexts[ 0 ] ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.OUTRA_FUNCAO_2, outrasFuncoesTexts[ 1 ] ); |  |  |  | 		components.putComponent( ExameData.OUTRA_FUNCAO_2, outrasFuncoesTexts[ 1 ] ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.OUTRA_FUNCAO_3, outrasFuncoesTexts[ 2 ] ); |  |  |  | 		components.putComponent( ExameData.OUTRA_FUNCAO_3, outrasFuncoesTexts[ 2 ] ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.OUTRA_FUNCAO_4, outrasFuncoesTexts[ 3 ] ); |  |  |  | 		components.putComponent( ExameData.OUTRA_FUNCAO_4, outrasFuncoesTexts[ 3 ] ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putComponent( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.OUTRAS_RECOMENDACOES, recomendacoesText ); |  |  |  | 		components.putComponent( ExameData.OUTRAS_RECOMENDACOES, recomendacoesText ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putDummy( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.INACTIVO ); |  |  |  | 		components.putDummy( ExameData.INACTIVO ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putDummy( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.TRABALHADOR_ID ); |  |  |  | 		components.putDummy( ExameData.TRABALHADOR ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		components.putDummy( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.MEDICO_ID ); |  |  |  | 		components.putDummy( ExameData.MEDICO ); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		components.putDummy( ExameData.PDF ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public void stateChanged( ChangeEvent e )  |  |  |  | 	public void stateChanged( ChangeEvent e )  | 
			
		
	
	
		
		
			
				
					|  |  | @ -331,7 +337,7 @@ public class ExamePanel extends JPanel | 
			
		
	
		
		
			
				
					
					|  |  |  | 		StringBuffer msg = new StringBuffer(); |  |  |  | 		StringBuffer msg = new StringBuffer(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		boolean hasMsg = false; |  |  |  | 		boolean hasMsg = false; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		boolean hasData = false; |  |  |  | 		boolean hasData = false; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		MetaObject exame; |  |  |  | 		ExameData exame; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		if( dataExamePanel.getDate().after( new Date() ) ) |  |  |  | 		if( dataExamePanel.getDate().after( new Date() ) ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			throw new ValuesException( "N\u00E3o \u00E9 poss\u00EDvel gravar exames com datas futuras." ); |  |  |  | 			throw new ValuesException( "N\u00E3o \u00E9 poss\u00EDvel gravar exames com datas futuras." ); | 
			
		
	
	
		
		
			
				
					|  |  | @ -364,22 +370,28 @@ public class ExamePanel extends JPanel | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 			recomendacoesText.setText( recomendacoes.trim() ); |  |  |  | 			recomendacoesText.setText( recomendacoes.trim() ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			 |  |  |  | 			 | 
			
		
	
		
		
			
				
					
					|  |  |  | 			exame = provider.createObject( FichaDataProvider.EXAMES ); |  |  |  | //			exame = provider.createObject( FichaDataProvider.EXAMES );
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			DBField fields[] = FichaDataProvider.EXAMES.getInsertFields(); |  |  |  | 			exame = new ExameData(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			String exameFields[] = new String[ fields.length ]; |  |  |  | //			DBField fields[] = FichaDataProvider.EXAMES.getInsertFields();
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			for( int i = 0; i < exameFields.length; ++i ) |  |  |  | //			String exameFields[] = new String[ fields.length ];
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | //			for( int i = 0; i < exameFields.length; ++i )
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				exameFields[ i ] = fields[ i ].FULL_NAME; |  |  |  | //			{
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | //				exameFields[ i ] = fields[ i ].FULL_NAME;
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			}
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			Hashtable hash = new Hashtable();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			ComponentController.save( exameFields, hash, components );
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			hash.put( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.INACTIVO, "n" );
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			Enumeration enum = hash.keys();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			while( enum.hasMoreElements() )
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			{
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //				String name = ( String )enum.nextElement();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //				exame.setProperty( name, hash.get( name ) );
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //			}
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			String names[] = exame.getFieldNames(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Hashtable hash = new Hashtable(); |  |  |  | 			Hashtable hash = new Hashtable(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			ComponentController.save( exameFields, hash, components ); |  |  |  | 			ComponentController.save( names, hash, components ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			hash.put( FichaDataProvider.T_EXAMES + "." + FichaDataProvider.INACTIVO, "n" ); |  |  |  | 			exame.setHashData( hash ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			Enumeration enum = hash.keys(); |  |  |  | 			 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			while( enum.hasMoreElements() ) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String name = ( String )enum.nextElement(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				exame.setProperty( name, hash.get( name ) ); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			int tipo = 0; |  |  |  | 			int tipo = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if( admissaoRadio.isSelected() ) |  |  |  | 			if( admissaoRadio.isSelected() ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | 			{ | 
			
		
	
	
		
		
			
				
					|  |  | @ -397,18 +409,22 @@ public class ExamePanel extends JPanel | 
			
		
	
		
		
			
				
					
					|  |  |  | //			{
 |  |  |  | //			{
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //				tipo = 4;
 |  |  |  | //				tipo = 4;
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //			}
 |  |  |  | //			}
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 			exame.setProperty( FichaDataProvider.TIPO, new Integer( tipo ) ); |  |  |  | //			exame.setProperty( FichaDataProvider.TIPO, new Integer( tipo ) );
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			exame.set( ExameData.TIPO, new Integer( tipo ) ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if( tipo != 3 ) |  |  |  | 			if( tipo != 3 ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 				exame.setProperty( FichaDataProvider.EXAMES.getFieldByName( FichaDataProvider.OCASIONAL ).FULL_NAME, null ); |  |  |  | //				exame.setProperty( FichaDataProvider.EXAMES.getFieldByName( FichaDataProvider.OCASIONAL ).FULL_NAME, null );
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				exame.setProperty( FichaDataProvider.EXAMES.getFieldByName( FichaDataProvider.OUTRO_TIPO ).FULL_NAME, "" ); |  |  |  | 				exame.set( ExameData.OCASIONAL, null ); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //				exame.setProperty( FichaDataProvider.EXAMES.getFieldByName( FichaDataProvider.OUTRO_TIPO ).FULL_NAME, "" );
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				exame.set( ExameData.OUTRO_TIPO, "" ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 			else |  |  |  | 			else | 
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Integer ocasionalID = ( Integer )ocasionalPanel.save(); |  |  |  | 				Integer ocasionalID = ( Integer )ocasionalPanel.save(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if( ocasionalID == null || ocasionalID.intValue() != 10 ) |  |  |  | 				if( ocasionalID == null || ocasionalID.intValue() != 10 ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 				{ |  |  |  | 				{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 					exame.setProperty( FichaDataProvider.EXAMES.getFieldByName( FichaDataProvider.OUTRO_TIPO ).FULL_NAME, "" ); |  |  |  | //					exame.setProperty( FichaDataProvider.EXAMES.getFieldByName( FichaDataProvider.OUTRO_TIPO ).FULL_NAME, "" );
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					exame.set( ExameData.OUTRO_TIPO, "" ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
	
		
		
			
				
					|  |  | 
 |