|
|
|
@ -7,6 +7,7 @@
|
|
|
|
package siprp.ficha;
|
|
|
|
package siprp.ficha;
|
|
|
|
|
|
|
|
|
|
|
|
import siprp.*;
|
|
|
|
import siprp.*;
|
|
|
|
|
|
|
|
import siprp.data.*;
|
|
|
|
import siprp.importer.*;
|
|
|
|
import siprp.importer.*;
|
|
|
|
|
|
|
|
|
|
|
|
import java.awt.*;
|
|
|
|
import java.awt.*;
|
|
|
|
@ -183,40 +184,40 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
StringBuffer msg = new StringBuffer();
|
|
|
|
StringBuffer msg = new StringBuffer();
|
|
|
|
MetaObject medico;
|
|
|
|
MedicoData medico;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
medico = (MetaObject)upperPanel.save();
|
|
|
|
medico = (MedicoData)upperPanel.save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( ValuesException vex )
|
|
|
|
catch( ValuesException vex )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
msg.append( vex.getMessage() );
|
|
|
|
msg.append( vex.getMessage() );
|
|
|
|
medico = null;
|
|
|
|
medico = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MetaObject estabelecimento;
|
|
|
|
EstabelecimentoData estabelecimento;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
estabelecimento = (MetaObject)empresaPanel.save();
|
|
|
|
estabelecimento = (EstabelecimentoData)empresaPanel.save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( ValuesException vex )
|
|
|
|
catch( ValuesException vex )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
msg.append( vex.getMessage() );
|
|
|
|
msg.append( vex.getMessage() );
|
|
|
|
estabelecimento = null;
|
|
|
|
estabelecimento = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MetaObject trabalhador;
|
|
|
|
TrabalhadorData trabalhador;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
trabalhador = (MetaObject)trabalhadorPanel.save();
|
|
|
|
trabalhador = (TrabalhadorData)trabalhadorPanel.save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( ValuesException vex )
|
|
|
|
catch( ValuesException vex )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
msg.append( vex.getMessage() );
|
|
|
|
msg.append( vex.getMessage() );
|
|
|
|
trabalhador = null;
|
|
|
|
trabalhador = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MetaObject exame;
|
|
|
|
ExameData exame;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
exame = (MetaObject)examePanel.save();
|
|
|
|
exame = (ExameData)examePanel.save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( ValuesException vex )
|
|
|
|
catch( ValuesException vex )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -228,22 +229,28 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
JOptionPane.showMessageDialog( this, msg.toString(), "Erro...", JOptionPane.ERROR_MESSAGE );
|
|
|
|
JOptionPane.showMessageDialog( this, msg.toString(), "Erro...", JOptionPane.ERROR_MESSAGE );
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
trabalhador.setProperty( FichaDataProvider.R_TRABALHADOR_ESTABELECIMENTO, estabelecimento );
|
|
|
|
// trabalhador.setProperty( FichaDataProvider.R_TRABALHADOR_ESTABELECIMENTO, estabelecimento );
|
|
|
|
trabalhador.setProperty( FichaDataProvider.OBSERVACOES, observacoesPanel.save() );
|
|
|
|
// trabalhador.setProperty( FichaDataProvider.OBSERVACOES, observacoesPanel.save() );
|
|
|
|
|
|
|
|
trabalhador.set( TrabalhadorData.ESTABELECIMENTO, estabelecimento );
|
|
|
|
|
|
|
|
trabalhador.set( TrabalhadorData.OBSERVACOES, observacoesPanel.save() );
|
|
|
|
|
|
|
|
|
|
|
|
exame.setProperty( FichaDataProvider.R_EXAME_MEDICO, medico );
|
|
|
|
// exame.setProperty( FichaDataProvider.R_EXAME_MEDICO, medico );
|
|
|
|
exame.setProperty( FichaDataProvider.R_EXAME_TRABALHADOR, trabalhador );
|
|
|
|
// exame.setProperty( FichaDataProvider.R_EXAME_TRABALHADOR, trabalhador );
|
|
|
|
|
|
|
|
exame.set( ExameData.MEDICO, medico );
|
|
|
|
|
|
|
|
exame.set( ExameData.TRABALHADOR, trabalhador );
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
exame.save();
|
|
|
|
exame.save();
|
|
|
|
exame.setProperty( FichaDataProvider.PDF, createPDF( exame ) );
|
|
|
|
// exame.setProperty( FichaDataProvider.PDF, createPDF( exame ) );
|
|
|
|
fdpProvider.savePDF( exame );
|
|
|
|
// fdpProvider.savePDF( exame );
|
|
|
|
DBKey key = trabalhador.getPrimaryKeyValue();
|
|
|
|
|
|
|
|
DBField fields[] = FichaDataProvider.TRABALHADORES.getPrimaryKey();
|
|
|
|
// DBKey key = trabalhador.getPrimaryKeyValue();
|
|
|
|
trabalhadorID = new Integer( ((Number)key.getFieldValue( fields[ 0 ] )).intValue() );
|
|
|
|
// DBField fields[] = FichaDataProvider.TRABALHADORES.getPrimaryKey();
|
|
|
|
|
|
|
|
// trabalhadorID = new Integer( ((Number)key.getFieldValue( fields[ 0 ] )).intValue() );
|
|
|
|
|
|
|
|
trabalhadorID = ( Integer ) trabalhador.get( TrabalhadorData.ID );
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
siprp.data.Marcacao.saveMarcacaoExameForTrabalhadorID( trabalhadorID, (Date)exame.getProperty( FichaDataProvider.PROXIMO_EXAME ) );
|
|
|
|
Marcacao.saveMarcacaoExameForTrabalhadorID( trabalhadorID, (Date)exame.get( ExameData.PROXIMO_EXAME ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( Exception iex )
|
|
|
|
catch( Exception iex )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -466,30 +473,30 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
private void print( Integer exameID )
|
|
|
|
private void print( Integer exameID )
|
|
|
|
throws Exception
|
|
|
|
throws Exception
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MetaObject exame = fdpProvider.load( fdpProvider.EXAMES, new DBKey( exameID ) );
|
|
|
|
// MetaObject exame = fdpProvider.load( fdpProvider.EXAMES, new DBKey( exameID ) );
|
|
|
|
byte pdf[] = (byte []) exame.getProperty( fdpProvider.PDF );
|
|
|
|
// byte pdf[] = (byte []) exame.get( ExameData.PDF );
|
|
|
|
if( exame == null )
|
|
|
|
// if( exame == null )
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
throw new Exception( "N\u00e3o existe exame" );
|
|
|
|
// throw new Exception( "N\u00e3o existe exame" );
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
ExamePDF ePDF = new ExamePDF();
|
|
|
|
// ExamePDF ePDF = new ExamePDF();
|
|
|
|
ePDF.print( pdf );
|
|
|
|
// ePDF.print( pdf );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public byte[] createPDF( MetaObject exame )
|
|
|
|
public byte[] createPDF( ExameData exame )
|
|
|
|
throws Exception
|
|
|
|
throws Exception
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MetaObject medico = ( (MetaObject []) exame.getProperty( fdpProvider.R_EXAME_MEDICO ) )[0];
|
|
|
|
MedicoData medico = (MedicoData)exame.get( ExameData.MEDICO );
|
|
|
|
MetaObject trabalhador = ( (MetaObject []) exame.getProperty( fdpProvider.R_EXAME_TRABALHADOR ) )[0];
|
|
|
|
TrabalhadorData trabalhador = (TrabalhadorData) exame.get( ExameData.TRABALHADOR );
|
|
|
|
MetaObject estabelecimento = ( (MetaObject []) trabalhador.getProperty( fdpProvider.R_TRABALHADOR_ESTABELECIMENTO ) )[0];
|
|
|
|
EstabelecimentoData estabelecimento = (EstabelecimentoData) trabalhador.get( TrabalhadorData.ESTABELECIMENTO );
|
|
|
|
MetaObject empresa = ( (MetaObject []) estabelecimento.getProperty( fdpProvider.R_ESTABELECIMENTO_EMPRESA ) )[0];
|
|
|
|
EmpresaData empresa = (EmpresaData) estabelecimento.get( EstabelecimentoData.EMPRESA );
|
|
|
|
empresa.load( empresa.getPrimaryKeyValue() );
|
|
|
|
// empresa.load( empresa.getPrimaryKeyValue() );
|
|
|
|
Hashtable ht = new Hashtable();
|
|
|
|
Hashtable ht = new Hashtable();
|
|
|
|
ht.put( "designacao_social", empresa.getProperty( fdpProvider.DESIGNACAO_SOCIAL ) );
|
|
|
|
ht.put( "designacao_social", empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) );
|
|
|
|
ht.put( "estabelecimentos.nome", estabelecimento.getProperty( fdpProvider.NOME ) );
|
|
|
|
ht.put( "estabelecimentos.nome", estabelecimento.get( EstabelecimentoData.NOME ) );
|
|
|
|
String aux = (String)estabelecimento.getProperty( fdpProvider.LOCALIDADE );
|
|
|
|
String aux = (String)estabelecimento.get( EstabelecimentoData.LOCALIDADE );
|
|
|
|
ht.put( "estabelecimentos.localidade", aux != null ? aux : "" );
|
|
|
|
ht.put( "estabelecimentos.localidade", aux != null ? aux : "" );
|
|
|
|
Integer tipo = (Integer)empresa.getProperty( fdpProvider.SERVICO_SAUDE_TIPO );
|
|
|
|
Integer tipo = (Integer)empresa.get( EmpresaData.SERVICO_SAUDE_TIPO );
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
@ -505,8 +512,8 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
ht.put( "servico_saude_tipo_sns", "" );
|
|
|
|
ht.put( "servico_saude_tipo_sns", "" );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ht.put( "servico_saude_designacao", empresa.getProperty( fdpProvider.SERVICO_SAUDE_DESIGNACAO ) );
|
|
|
|
ht.put( "servico_saude_designacao", empresa.get( EmpresaData.SERVICO_SAUDE_DESIGNACAO ) );
|
|
|
|
tipo = (Integer)empresa.getProperty( fdpProvider.SERVICO_HIGIENE_TIPO );
|
|
|
|
tipo = (Integer)empresa.get( EmpresaData.SERVICO_HIGIENE_TIPO );
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
@ -522,9 +529,9 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
ht.put( "servico_higiene_outro", "" );
|
|
|
|
ht.put( "servico_higiene_outro", "" );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ht.put( "servico_higiene_designacao", empresa.getProperty( fdpProvider.SERVICO_HIGIENE_DESIGNACAO ) );
|
|
|
|
ht.put( "servico_higiene_designacao", empresa.get( EmpresaData.SERVICO_HIGIENE_DESIGNACAO ) );
|
|
|
|
ht.put( "trabalhadores.nome", trabalhador.getProperty( fdpProvider.NOME ) );
|
|
|
|
ht.put( "trabalhadores.nome", trabalhador.get( TrabalhadorData.NOME ) );
|
|
|
|
aux = (String)trabalhador.getProperty( fdpProvider.SEXO );
|
|
|
|
aux = (String)trabalhador.get( TrabalhadorData.SEXO );
|
|
|
|
switch( aux.charAt( 0 ) )
|
|
|
|
switch( aux.charAt( 0 ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 'm':
|
|
|
|
case 'm':
|
|
|
|
@ -535,27 +542,27 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DateFormat df = DateFormat.getDateInstance( DateFormat.SHORT );
|
|
|
|
DateFormat df = DateFormat.getDateInstance( DateFormat.SHORT );
|
|
|
|
Date data = ( Date )trabalhador.getProperty( fdpProvider.DATA_NASCIMENTO );
|
|
|
|
Date data = ( Date )trabalhador.get( TrabalhadorData.DATA_NASCIMENTO );
|
|
|
|
ht.put( "data_nascimento", data != null ? df.format( data ) : "" );
|
|
|
|
ht.put( "data_nascimento", data != null ? df.format( data ) : "" );
|
|
|
|
aux = (String)trabalhador.getProperty( fdpProvider.NACIONALIDADE );
|
|
|
|
aux = (String)trabalhador.get( TrabalhadorData.NACIONALIDADE );
|
|
|
|
ht.put( "nacionalidade", aux != null ? aux : "" );
|
|
|
|
ht.put( "nacionalidade", aux != null ? aux : "" );
|
|
|
|
aux = (String)trabalhador.getProperty( fdpProvider.NUMERO_MECANOGRAFICO );
|
|
|
|
aux = (String)trabalhador.get( TrabalhadorData.NUMERO_MECANOGRAFICO );
|
|
|
|
ht.put( "numero_mecanografico", aux != null ? aux : "" );
|
|
|
|
ht.put( "numero_mecanografico", aux != null ? aux : "" );
|
|
|
|
data = ( Date )trabalhador.getProperty( fdpProvider.DATA_ADMISSAO );
|
|
|
|
data = ( Date )trabalhador.get( TrabalhadorData.DATA_ADMISSAO );
|
|
|
|
ht.put( "data_admissao", data != null ? df.format( data ) : "" );
|
|
|
|
ht.put( "data_admissao", data != null ? df.format( data ) : "" );
|
|
|
|
aux = (String)trabalhador.getProperty( fdpProvider.CATEGORIA );
|
|
|
|
aux = (String)trabalhador.get( TrabalhadorData.CATEGORIA );
|
|
|
|
ht.put( "categoria", aux != null ? aux : "" );
|
|
|
|
ht.put( "categoria", aux != null ? aux : "" );
|
|
|
|
aux = (String)trabalhador.getProperty( fdpProvider.LOCAL_TRABALHO );
|
|
|
|
aux = (String)trabalhador.get( TrabalhadorData.LOCAL_TRABALHO );
|
|
|
|
ht.put( "local_trabalho", aux != null ? aux : "" );
|
|
|
|
ht.put( "local_trabalho", aux != null ? aux : "" );
|
|
|
|
aux = (String)trabalhador.getProperty( fdpProvider.FUNCAO_PROPOSTA );
|
|
|
|
aux = (String)trabalhador.get( TrabalhadorData.FUNCAO_PROPOSTA );
|
|
|
|
ht.put( "funcao_proposta", aux != null ? aux : "" );
|
|
|
|
ht.put( "funcao_proposta", aux != null ? aux : "" );
|
|
|
|
data = ( Date )trabalhador.getProperty( fdpProvider.DATA_ADMISSAO_FUNCAO );
|
|
|
|
data = ( Date )trabalhador.get( TrabalhadorData.DATA_ADMISSAO_FUNCAO );
|
|
|
|
ht.put( "data_admissao_funcao", data != null ? df.format( data ) : "" );
|
|
|
|
ht.put( "data_admissao_funcao", data != null ? df.format( data ) : "" );
|
|
|
|
aux = (String)trabalhador.getProperty( fdpProvider.OBSERVACOES );
|
|
|
|
aux = (String)trabalhador.get( TrabalhadorData.OBSERVACOES );
|
|
|
|
ht.put( "observacoes", aux != null ? aux : "" );
|
|
|
|
ht.put( "observacoes", aux != null ? aux : "" );
|
|
|
|
data = ( Date )exame.getProperty( fdpProvider.DATA );
|
|
|
|
data = ( Date )exame.get( ExameData.DATA );
|
|
|
|
ht.put( "exames.data", data != null ? df.format( data ) : "" );
|
|
|
|
ht.put( "exames.data", data != null ? df.format( data ) : "" );
|
|
|
|
tipo = (Integer)exame.getProperty( fdpProvider.TIPO );
|
|
|
|
tipo = (Integer)exame.get( ExameData.TIPO );
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
@ -566,7 +573,7 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 3:
|
|
|
|
ht.put( "tipo_ocasional", "" );
|
|
|
|
ht.put( "tipo_ocasional", "" );
|
|
|
|
tipo = (Integer)exame.getProperty( fdpProvider.OCASIONAL );
|
|
|
|
tipo = (Integer)exame.get( ExameData.OCASIONAL );
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
@ -588,17 +595,17 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
ht.put( "tipo_trabalho", "" );
|
|
|
|
ht.put( "tipo_trabalho", "" );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
case 10:
|
|
|
|
aux = (String)exame.getProperty( fdpProvider.OUTRO_TIPO );
|
|
|
|
aux = (String)exame.get( ExameData.OUTRO_TIPO );
|
|
|
|
ht.put( "tipo_outro", aux != null ? aux : "" );
|
|
|
|
ht.put( "tipo_outro", aux != null ? aux : "" );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
// case 4:
|
|
|
|
// case 4:
|
|
|
|
// aux = (String)exame.getProperty( fdpProvider.OUTRO_TIPO );
|
|
|
|
// aux = (String)exame.get( ExameData.OUTRO_TIPO );
|
|
|
|
// ht.put( "tipo_outro", aux != null ? aux : "" );
|
|
|
|
// ht.put( "tipo_outro", aux != null ? aux : "" );
|
|
|
|
// break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tipo = (Integer)exame.getProperty( fdpProvider.RESULTADO );
|
|
|
|
tipo = (Integer)exame.get( ExameData.RESULTADO );
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
switch( tipo.intValue() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
@ -614,21 +621,21 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
ht.put( "resultado_inapto_def", "" );
|
|
|
|
ht.put( "resultado_inapto_def", "" );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
aux = (String)exame.getProperty( fdpProvider.OUTRA_FUNCAO_1 );
|
|
|
|
aux = (String)exame.get( ExameData.OUTRA_FUNCAO_1 );
|
|
|
|
ht.put( "outra_funcao_1", aux != null ? aux : "" );
|
|
|
|
ht.put( "outra_funcao_1", aux != null ? aux : "" );
|
|
|
|
aux = (String)exame.getProperty( fdpProvider.OUTRA_FUNCAO_2 );
|
|
|
|
aux = (String)exame.get( ExameData.OUTRA_FUNCAO_2 );
|
|
|
|
ht.put( "outra_funcao_2", aux != null ? aux : "" );
|
|
|
|
ht.put( "outra_funcao_2", aux != null ? aux : "" );
|
|
|
|
aux = (String)exame.getProperty( fdpProvider.OUTRA_FUNCAO_3 );
|
|
|
|
aux = (String)exame.get( ExameData.OUTRA_FUNCAO_3 );
|
|
|
|
ht.put( "outra_funcao_3", aux != null ? aux : "" );
|
|
|
|
ht.put( "outra_funcao_3", aux != null ? aux : "" );
|
|
|
|
aux = (String)exame.getProperty( fdpProvider.OUTRA_FUNCAO_4 );
|
|
|
|
aux = (String)exame.get( ExameData.OUTRA_FUNCAO_4 );
|
|
|
|
ht.put( "outra_funcao_4", aux != null ? aux : "" );
|
|
|
|
ht.put( "outra_funcao_4", aux != null ? aux : "" );
|
|
|
|
aux = (String)exame.getProperty( fdpProvider.OUTRAS_RECOMENDACOES );
|
|
|
|
aux = (String)exame.get( ExameData.OUTRAS_RECOMENDACOES );
|
|
|
|
ht.put( "outras_recomendacoes", aux != null ? aux : "" );
|
|
|
|
ht.put( "outras_recomendacoes", aux != null ? aux : "" );
|
|
|
|
data = ( Date )exame.getProperty( fdpProvider.PROXIMO_EXAME );
|
|
|
|
data = ( Date )exame.get( ExameData.PROXIMO_EXAME );
|
|
|
|
ht.put( "proximo_exame", data != null ? df.format( data ) : "n/d" );
|
|
|
|
ht.put( "proximo_exame", data != null ? df.format( data ) : "n/d" );
|
|
|
|
aux = (String)medico.getProperty( fdpProvider.NOME );
|
|
|
|
aux = (String)medico.get( MedicoData.NOME );
|
|
|
|
ht.put( "medicos.nome", aux != null ? aux : "" );
|
|
|
|
ht.put( "medicos.nome", aux != null ? aux : "" );
|
|
|
|
aux = (String)medico.getProperty( fdpProvider.NUMERO_CEDULA );
|
|
|
|
aux = (String)medico.get( MedicoData.NUMERO_CEDULA );
|
|
|
|
ht.put( "numero_cedula", aux != null ? aux : "" );
|
|
|
|
ht.put( "numero_cedula", aux != null ? aux : "" );
|
|
|
|
ExamePDF ePDF = new ExamePDF();
|
|
|
|
ExamePDF ePDF = new ExamePDF();
|
|
|
|
return ePDF.createPDF( ht );
|
|
|
|
return ePDF.createPDF( ht );
|
|
|
|
@ -717,17 +724,19 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
private void delete( Integer exameID )
|
|
|
|
private void delete( Integer exameID )
|
|
|
|
throws Exception
|
|
|
|
throws Exception
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MetaObject exame = fdpProvider.load( fdpProvider.EXAMES, new DBKey( exameID ) );
|
|
|
|
// MetaObject exame = fdpProvider.load( fdpProvider.EXAMES, new DBKey( exameID ) );
|
|
|
|
|
|
|
|
ExameData exame = (ExameData) ExameData.load( ExameData.class, exameID );
|
|
|
|
if( exame == null )
|
|
|
|
if( exame == null )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new Exception( "N\u00e3o existe exame" );
|
|
|
|
throw new Exception( "N\u00e3o existe exame" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( JOptionPane.showConfirmDialog( this,
|
|
|
|
if( JOptionPane.showConfirmDialog( this,
|
|
|
|
"Tem a certeza que quer apagar o exame de " + exame.getProperty( fdpProvider.DATA ) + "?",
|
|
|
|
"Tem a certeza que quer apagar o exame de " + exame.get( ExameData.DATA ) + "?",
|
|
|
|
"...", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null ) == 0 )
|
|
|
|
"...", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null ) == 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
exame.setProperty( fdpProvider.INACTIVO, "y" );
|
|
|
|
// exame.set( ExameData.INACTIVO, "y" );
|
|
|
|
exame.save();
|
|
|
|
// exame.save();
|
|
|
|
|
|
|
|
exame.delete();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|