no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@59 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 22 years ago
parent e23c17cf6a
commit f217e5781f

@ -142,29 +142,53 @@ public class ExamePDF {
FONT_BOLD ) ); FONT_BOLD ) );
StringBuffer texto = new StringBuffer(); StringBuffer texto = new StringBuffer();
Phrase ph = new Phrase( 12f );
Cell cell = new Cell(); Cell cell = new Cell();
texto.append( "DESIGNA\u00c7\u00c3O SOCIAL: " + values.get( "designacao_social" ) + "\n" ); texto.append( "DESIGNA\u00c7\u00c3O SOCIAL: " + values.get( "designacao_social" ) + "\n" );
texto.append( "ESTABELECIMENTO: " + values.get( "estabelecimentos.nome" ) texto.append( "ESTABELECIMENTO: " + values.get( "estabelecimentos.nome" )
+ " LOCALIDADE: " + values.get( "estabelecimentos.localidade" ) + "\n" ); + " LOCALIDADE: " + values.get( "estabelecimentos.localidade" ) + "\n" );
texto.append( "SERVI\u00c7O DE SA\u00DaDE: Tipo Interno " texto.append( "SERVI\u00c7O DE SA\u00DaDE: Tipo " );
+ ( ( values.get( "servico_saude_tipo_interno" ) == null ) ? "\u2610" : "\u2612" ) ph.add( new Chunk( texto.toString(), FONT_NORMAL ) );
+ " Interempresas "
+ ( ( values.get( "servico_saude_tipo_interempresas" ) == null ) ? "\u2610" : "\u2612" ) texto = new StringBuffer( "Interno" );
+ " Externo " ph.add( doCheckedPhrase( texto.toString(), values.get( "servico_saude_tipo_interno" ) != null ) );
+ ( ( values.get( "servico_saude_tipo_externo" ) == null ) ? "\u2610" : "\u2612" )
+ " Servi\u00e7o Nacional de Sa\u00fade " texto = new StringBuffer( "Interempresas" );
+ ( ( values.get( "servico_saude_tipo_sns" ) == null ) ? "\u2610" : "\u2612" ) + "\n" ); ph.add( doCheckedPhrase( texto.toString(), values.get( "servico_saude_tipo_interempresas" ) != null, true ) );
texto = new StringBuffer( "Externo" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "servico_saude_tipo_externo" ) != null, true ) );
texto = new StringBuffer( "Servi\u00e7o Nacional de Sa\u00fade\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "servico_saude_tipo_sns" ) != null, true ) );
texto = new StringBuffer();
texto.append( "DESIGNA\u00c7\u00c3O: " + values.get( "servico_saude_designacao" ) + "\n" ); texto.append( "DESIGNA\u00c7\u00c3O: " + values.get( "servico_saude_designacao" ) + "\n" );
texto.append( "SERVI\u00c7O DE HIGIENE E SEGURAN\u00c7A: Tipo Interno " texto.append( "SERVI\u00c7O DE HIGIENE E SEGURAN\u00c7A: Tipo " );
+ ( ( values.get( "servico_higiene_tipo_interno" ) == null ) ? "\u2610" : "\u2612" ) ph.add( new Chunk( texto.toString(), FONT_NORMAL ) );
+ " Interempresas "
+ ( ( values.get( "servico_higiene_tipo_interempresas" ) == null ) ? "\u2610" : "\u2612" ) texto = new StringBuffer( "Interno" );
+ " Externo " ph.add( doCheckedPhrase( texto.toString(), values.get( "servico_higiene_tipo_interno" ) != null ) );
+ ( ( values.get( "servico_higiene_tipo_externo" ) == null ) ? "\u2610" : "\u2612" )
+ " Outro " texto = new StringBuffer( "Interempresas" );
+ ( ( values.get( "servico_higiene_outro" ) == null ) ? "\u2610" : "\u2612" ) + "\n" ); ph.add( doCheckedPhrase( texto.toString(), values.get( "servico_higiene_tipo_interempresas" ) != null, true ) );
texto = new StringBuffer( "Externo" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "servico_higiene_tipo_externo" ) != null, true ) );
texto = new StringBuffer( "Outro\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "servico_higiene_outro" ) != null, true ) );
texto = new StringBuffer();
texto.append( "DESIGNA\u00c7\u00c3O: " + values.get( "servico_higiene_designacao" ) + "" ); texto.append( "DESIGNA\u00c7\u00c3O: " + values.get( "servico_higiene_designacao" ) + "" );
cell.addElement( new Phrase( 12f, texto.toString(), FONT_NORMAL ) );
ph.add( new Chunk( texto.toString(), FONT_NORMAL ) );
cell.addElement( ph );
//cell.addElement( new Phrase( 12f, texto.toString(), FONT_NORMAL ) );
table.addCell( cell ); table.addCell( cell );
document.add( table ); document.add( table );
@ -222,146 +246,78 @@ public class ExamePDF {
table.addCell( cell ); table.addCell( cell );
texto = new StringBuffer(); texto = new StringBuffer();
ph = new Phrase( 12f );
texto.append( "DATA DO EXAME: " + values.get( "exames.data" ) + "\n" ); texto.append( "DATA DO EXAME: " + values.get( "exames.data" ) + "\n" );
texto.append( "TIPO\n" ); texto.append( "TIPO\n" );
texto.append( "ADMISS\u00c3O ...................................................................................... " ph.add( new Chunk( texto.toString(), FONT_NORMAL ) );
+ ( ( values.get( "tipo_admissao" ) == null ) ? "" : "X" ) + "\n" );
texto.append( "PERI\u00d3DICO ..................................................................................... " //texto = new StringBuffer( "ADMISS\u00c3O ...................................................................................... " );
+ ( ( values.get( "tipo_periodico" ) == null ) ? "" : "X" ) + "\n" ); texto = new StringBuffer( "ADMISS\u00c3O\n" );
texto.append( "OCASIONAL .................................................................................... " ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_admissao" ) != null ) );
+ ( ( values.get( "tipo_ocasional" ) == null ) ? "" : "X" ) + "\n" );
texto.append( " AP\u00d3S DOEN\u00c7A ...................................................................... " //texto = new StringBuffer( "PERI\u00d3DICO ..................................................................................... " );
+ ( ( values.get( "tipo_apos_doenca" ) == null ) ? "" : "X" ) + "\n" ); texto = new StringBuffer( "PERI\u00d3DICO\n" );
texto.append( " AP\u00d3S ACIDENTE ................................................................... " ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_periodico" ) != null ) );
+ ( ( values.get( "tipo_apos_acidente" ) == null ) ? "" : "X" ) + "\n" );
texto.append( " A PEDIDO DO TRABALHADOR ............................................. " //texto = new StringBuffer( "OCASIONAL .................................................................................... " );
+ ( ( values.get( "tipo_pedido_trabalhador" ) == null ) ? "" : "X" ) + "\n" ); texto = new StringBuffer( "OCASIONAL\n" );
texto.append( " A PEDIDO DO SERVI\u00c7O ........................................................ " ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_ocasional" ) != null ) );
+ ( ( values.get( "tipo_pedido_empresa" ) == null ) ? "" : "X" ) + "\n" );
texto.append( " POR MUDAN\u00c7A DE FUN\u00c7\u00c3O ................................................ " //texto = new StringBuffer( " AP\u00d3S DOEN\u00c7A ...................................................................... " );
+ ( ( values.get( "tipo_mudanca_funcao" ) == null ) ? "" : "X" ) + "\n" ); texto = new StringBuffer( "AP\u00d3S DOEN\u00c7A\n" );
texto.append( " POR ALTERA\u00c7\u00c3O DAS CONDI\u00c7\u00d5ES DE TRABALHO ......... " ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_apos_doenca" ) != null, true ) );
+ ( ( values.get( "tipo_trabalho" ) == null ) ? "" : "X" ) + "\n" );
texto.append( "OUTRO ............................................................................................ " //texto = new StringBuffer( " AP\u00d3S ACIDENTE ................................................................... " );
+ ( ( values.get( "tipo_outro" ) == null ) ? "" : "X" ) + "\n" ); texto = new StringBuffer( "AP\u00d3S ACIDENTE\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_apos_acidente" ) != null, true ) );
//texto = new StringBuffer( " A PEDIDO DO TRABALHADOR ............................................. " );
texto = new StringBuffer( "A PEDIDO DO TRABALHADOR\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_pedido_trabalhador" ) != null, true ) );
//texto = new StringBuffer( " A PEDIDO DO SERVI\u00c7O ........................................................ " );
texto = new StringBuffer( "A PEDIDO DO SERVI\u00c7O\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_pedido_empresa" ) != null, true ) );
//texto = new StringBuffer( " POR MUDAN\u00c7A DE FUN\u00c7\u00c3O ................................................ " );
texto = new StringBuffer( "POR MUDAN\u00c7A DE FUN\u00c7\u00c3O\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_mudanca_funcao" ) != null, true ) );
//texto = new StringBuffer( " POR ALTERA\u00c7\u00c3O DAS CONDI\u00c7\u00d5ES DE TRABALHO ......... " );
texto = new StringBuffer( "POR ALTERA\u00c7\u00c3O DAS CONDI\u00c7\u00d5ES DE TRABALHO\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_trabalho" ) != null, true ) );
//texto = new StringBuffer( "OUTRO ............................................................................................ " );
texto = new StringBuffer( "OUTRO\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "tipo_outro" ) != null ) );
texto = new StringBuffer();
texto.append( "ESPECIFIQUE: " texto.append( "ESPECIFIQUE: "
+ ( ( values.get( "tipo_outro" ) == null ) ? "" : values.get( "tipo_outro" ) ) + "" ); + ( ( values.get( "tipo_outro" ) == null ) ? "" : values.get( "tipo_outro" ) ) + "" );
table.addCell( new Phrase( texto.toString(), FONT_NORMAL ) ); ph.add( new Chunk( texto.toString(), FONT_NORMAL ) );
table.addCell( ph );
Cell cellVazia = new Cell( new Phrase( 12f, "", FONT_NORMAL ) ); //table.addCell( new Phrase( texto.toString(), FONT_NORMAL ) );
Cell cellDataExame = new Cell( new Phrase( 12f, "DATA DO EXAME: " + values.get( "exames.data" ) + "\n", FONT_NORMAL ) );
Cell cellTipo = new Cell( new Phrase( 12f, "TIPO\n", FONT_NORMAL ) );
Cell cellAdmissao = new Cell( new Phrase( 12f, "ADMISS\u00c3O ...................................................................................... ", FONT_NORMAL ) );
Cell cellAdmissaoValor = new Cell( new Phrase( 12f, ( ( values.get( "tipo_admissao" ) == null ) ? "" : "X" ), FONT_NORMAL ) );
Cell cellPeriodico = new Cell( new Phrase( 12f, "PERI\u00d3DICO ..................................................................................... ", FONT_NORMAL ) );
Cell cellPeriodicoValor = new Cell( new Phrase( 12f, ( ( values.get( "tipo_periodico" ) == null ) ? "" : "X" ), FONT_NORMAL ) );
Cell cellOcasional = new Cell( new Phrase( 12f, "OCASIONAL .................................................................................... ", FONT_NORMAL ) );
Cell cellOcasionalValor = new Cell( new Phrase( 12f, ( ( values.get( "tipo_ocasional" ) == null ) ? "" : "X" ), FONT_NORMAL ) );
Cell cellAposDoenca = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellAposDoencaValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellAposAcidente = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellAposAcidenteValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellPedidoTrabalhador = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellPedidoTrabalhadorValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellPedidoServico = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellPedidoServicoValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellMudancaFuncao = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellMudancaFuncaoValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellCondicoes = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellCondicoesValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellOutro = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellOutroValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellEspecifique = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellResultado = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellApto = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellAptoValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellAptoCond = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellAptoCondValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellInaptoTemp = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellInaptoTempValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellInaptoDef = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellInaptoDefValor = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellOutrasFuncoes = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellOutrasFuncoes1 = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellOutrasFuncoes2 = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellOutrasFuncoes3 = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
Cell cellOutrasFuncoes4 = new Cell( new Phrase( 12f, "", FONT_NORMAL ) );
// table.endHeaders();
// table.addCell( cellDataExame );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellResultado );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellTipo );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellApto );
// table.addCell( cellAptoValor );
// table.addCell( cellAdmissao );
// table.addCell( cellAdmissaoValor );
// table.addCell( cellAptoCond );
// table.addCell( cellAptoCondValor );
// table.addCell( cellPeriodico );
// table.addCell( cellPeriodicoValor );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellOcasional );
// table.addCell( cellOcasionalValor );
// table.addCell( cellInaptoTemp );
// table.addCell( cellInaptoTempValor );
// table.addCell( cellAposDoenca );
// table.addCell( cellAposDoencaValor );
// table.addCell( cellInaptoDef );
// table.addCell( cellInaptoDefValor );
// table.addCell( cellAposAcidente );
// table.addCell( cellAposAcidenteValor );
// table.addCell( cellOutrasFuncoes );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellPedidoTrabalhador );
// table.addCell( cellPedidoTrabalhadorValor );
// table.addCell( cellOutrasFuncoes1 );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellPedidoServico );
// table.addCell( cellPedidoServicoValor );
// table.addCell( cellOutrasFuncoes2 );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellMudancaFuncao );
// table.addCell( cellMudancaFuncaoValor );
// table.addCell( cellOutrasFuncoes3 );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellCondicoes );
// table.addCell( cellCondicoesValor );
// table.addCell( cellOutrasFuncoes4 );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellOutro );
// table.addCell( cellOutroValor );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( cellEspecifique );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
// table.addCell( new Cell( new Phrase( 12f, "", FONT_NORMAL ) ) );
texto = new StringBuffer(); texto = new StringBuffer();
Phrase ph = new Phrase( 12f ); ph = new Phrase( 12f );
texto.append( "RESULTADO" ); texto.append( "RESULTADO\n" );
ph.add( new Chunk( texto.toString(), FONT_NORMAL ) ); ph.add( new Chunk( texto.toString(), FONT_NORMAL ) );
// texto.append( "APTO ................................................................................................ " //texto = new StringBuffer( "\nAPTO ............................................................................................ " );
// + ( ( values.get( "resultado_apto" ) == null ) ? "" : "X" ) + "\n" ); texto = new StringBuffer( "APTO\n" );
texto = new StringBuffer( "\nAPTO ............................................................................................ " );
ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_apto" ) != null ) ); ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_apto" ) != null ) );
texto = new StringBuffer( "\nAPTO CONDICIONALMENTE ..................................................... " ); //texto = new StringBuffer( "\nAPTO CONDICIONALMENTE ..................................................... " );
texto = new StringBuffer( "APTO CONDICIONALMENTE\n\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_apto_condicionalmente" ) != null ) ); ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_apto_condicionalmente" ) != null ) );
texto = new StringBuffer( "INAPTO TEMPORARIAMENTE ................................................... " ); //texto = new StringBuffer( "INAPTO TEMPORARIAMENTE ................................................... " );
texto = new StringBuffer( "INAPTO TEMPORARIAMENTE\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_inapto_temp" ) != null ) ); ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_inapto_temp" ) != null ) );
//texto = new StringBuffer( "INAPTO DEFINITIVAMENTE ....................................................... " );
texto = new StringBuffer( "INAPTO DEFINITIVAMENTE ....................................................... " ); texto = new StringBuffer( "INAPTO DEFINITIVAMENTE\n\n" );
ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_inapto_def" ) != null ) ); ph.add( doCheckedPhrase( texto.toString(), values.get( "resultado_inapto_def" ) != null ) );
texto = new StringBuffer(); texto = new StringBuffer();
@ -425,12 +381,23 @@ public class ExamePDF {
return bos.toByteArray(); return bos.toByteArray();
} }
private Phrase doCheckedPhrase( String text, boolean checked ) private Phrase doCheckedPhrase( String text, boolean checked, boolean ident )
{ {
Phrase p = new Phrase( 12f ); Phrase p = new Phrase( 12f );
if( ident )
{
p.add( new Chunk( " " + ( char )( checked? 110: 111) + " ", FONT_ZAPFDINGBATS ) );
}
else
{
p.add( new Chunk( "" + ( char )( checked? 110: 111) + " ", FONT_ZAPFDINGBATS ) );
}
p.add( new Chunk( text, FONT_NORMAL ) ); p.add( new Chunk( text, FONT_NORMAL ) );
p.add( new Chunk( "" + ( char )( checked? 108: 109), FONT_ZAPFDINGBATS ) );
return p; return p;
} }
private Phrase doCheckedPhrase( String text, boolean checked )
{
return doCheckedPhrase( text, checked, false );
}
} }
Loading…
Cancel
Save