|
|
|
|
@ -38,6 +38,8 @@ import javax.swing.JPanel;
|
|
|
|
|
|
|
|
|
|
import siprp.database.cayenne.objects.Empresas;
|
|
|
|
|
import siprp.database.cayenne.objects.PrtElementosProtocolo;
|
|
|
|
|
import siprp.database.cayenne.objects.PrtGruposProtocolo;
|
|
|
|
|
import siprp.database.cayenne.objects.PrtTiposElementosProtocolo;
|
|
|
|
|
import siprp.database.cayenne.objects.Trabalhadores;
|
|
|
|
|
import siprp.database.cayenne.objects.TrabalhadoresConsultas;
|
|
|
|
|
import siprp.database.cayenne.objects.TrabalhadoresConsultasDatas;
|
|
|
|
|
@ -101,7 +103,7 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
private final JLabel labelTrabalhadorObservacoes = new JLabel( "Observa" + ccedil + otilde + "es" );
|
|
|
|
|
|
|
|
|
|
public final LeafInputField<String> inputTrabalhadorNome = new LeafInputField<String>();
|
|
|
|
|
public final LeafInputField<HashMap<String,String>> inputTrabalhadorSexo = new LeafInputField<HashMap<String,String>>();
|
|
|
|
|
public final LeafInputField<HashMap<String, String>> inputTrabalhadorSexo = new LeafInputField<HashMap<String, String>>();
|
|
|
|
|
public final LeafInputField<Date> inputTrabalhadorDataNascimento = new LeafInputField<Date>();
|
|
|
|
|
public final LeafInputField<String> inputTrabalhadorNacionalidade = new LeafInputField<String>();
|
|
|
|
|
public final LeafInputField<String> inputTrabalhadorObservacoes = new LeafInputField<String>();
|
|
|
|
|
@ -113,10 +115,10 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
private final JLabel labelProcessoDataFim = new JLabel( "Fim" );
|
|
|
|
|
private final JLabel labelProcessoMotivo = new JLabel( "Motivo" );
|
|
|
|
|
|
|
|
|
|
public final LeafInputField<HashMap<String,String>> inputProcessoEstado = new LeafInputField<HashMap<String,String>>();
|
|
|
|
|
public final LeafInputField<HashMap<String, String>> inputProcessoEstado = new LeafInputField<HashMap<String, String>>();
|
|
|
|
|
public final LeafInputField<Date> inputProcessoDataInicio = new LeafInputField<Date>();
|
|
|
|
|
public final LeafInputField<Date> inputProcessoDataFim = new LeafInputField<Date>();
|
|
|
|
|
public final LeafInputField<HashMap<Integer,String>> inputProcessoMotivo = new LeafInputField<HashMap<Integer,String>>();
|
|
|
|
|
public final LeafInputField<HashMap<Integer, String>> inputProcessoMotivo = new LeafInputField<HashMap<Integer, String>>();
|
|
|
|
|
|
|
|
|
|
// consulta
|
|
|
|
|
private final JLabel labelConsultaEstado = new JLabel( "Estado" );
|
|
|
|
|
@ -142,14 +144,16 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
public final LeafInputField<String> inputConsultaMarcacaoEmailBody = new LeafInputField<String>();
|
|
|
|
|
|
|
|
|
|
// observacao marcacao consulta
|
|
|
|
|
@ActionActivation(onSelect="", onChange=SAVE_CONSULTA_MARCACAO_OBSERVACOES)
|
|
|
|
|
@ActionActivation(onSelect = "", onChange = SAVE_CONSULTA_MARCACAO_OBSERVACOES)
|
|
|
|
|
public final LeafInputField<String> inputConsultaMarcacaoObsMensagem = new LeafInputField<String>();
|
|
|
|
|
|
|
|
|
|
// exame
|
|
|
|
|
private final JLabel labelExameEstado = new JLabel( "Estado" );
|
|
|
|
|
private final JLabel labelExameData = new JLabel( "Data" );
|
|
|
|
|
private final JLabel labelExameGruposEcds = new JLabel( "Ecds" );
|
|
|
|
|
|
|
|
|
|
public final LeafInputField<HashMap<Integer, String>> inputExameEstado = new LeafInputField<HashMap<Integer, String>>();
|
|
|
|
|
public final LeafInputField<HashMap<PrtGruposProtocolo, String>> inputExameGruposEcds = new LeafInputField<HashMap<PrtGruposProtocolo, String>>();
|
|
|
|
|
public final LeafInputField<Date> inputExameData = new LeafInputField<Date>();
|
|
|
|
|
|
|
|
|
|
// marcacao exame
|
|
|
|
|
@ -214,7 +218,9 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
add( panelExameMarcacaoObservacao, PANEL_EXAME_MARCACAO_OBSERVACAO_NAME );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@LeafUIActionBinding(action = { LOAD_TRABALHADOR, SELECT_TRABALHADOR })
|
|
|
|
|
@LeafUIActionBinding(action = {
|
|
|
|
|
LOAD_TRABALHADOR, SELECT_TRABALHADOR
|
|
|
|
|
})
|
|
|
|
|
public void setForTrabalhador( Trabalhadores trabalhador )
|
|
|
|
|
{
|
|
|
|
|
if( trabalhador != null )
|
|
|
|
|
@ -242,9 +248,9 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
inputProcessoDataFim.setObject( processo.getDataFim() );
|
|
|
|
|
inputProcessoDataInicio.setObject( processo.getDataInicio() );
|
|
|
|
|
inputProcessoEstado.setObject( processo.getEstados() );
|
|
|
|
|
inputProcessoEstado.setSelectedObject( processo.getEstado() );
|
|
|
|
|
inputProcessoEstado.setSelectedObject( processo.getEstado() );
|
|
|
|
|
inputProcessoMotivo.setObject( processo.getMotivos() );
|
|
|
|
|
inputProcessoMotivo.setSelectedObject( processo.getMotivo() );
|
|
|
|
|
inputProcessoMotivo.setSelectedObject( processo.getMotivo() );
|
|
|
|
|
|
|
|
|
|
cardLayout.show( this, PANEL_PROCESSO_NAME );
|
|
|
|
|
}
|
|
|
|
|
@ -329,21 +335,35 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
inputExameData.setObject( exame.getData() );
|
|
|
|
|
inputExameEstado.setObject( exame.getEstados() );
|
|
|
|
|
inputExameEstado.setSelectedObject( exame.getEstado() );
|
|
|
|
|
//TODO mostrar lista de exames disponiveis para o trabalhador
|
|
|
|
|
HashMap<PrtGruposProtocolo, String> grupos = new HashMap<PrtGruposProtocolo, String>();
|
|
|
|
|
Trabalhadores trabalhador = exame.getToTrabalhadores();
|
|
|
|
|
Integer perfil = trabalhador.getPerfil();
|
|
|
|
|
if(perfil != null)
|
|
|
|
|
if( perfil != null )
|
|
|
|
|
{
|
|
|
|
|
Empresas empresa = trabalhador.getToEstabelecimentos().getToEmpresas();
|
|
|
|
|
List<PrtElementosProtocolo> ecdsPerfil = (List<PrtElementosProtocolo> )empresa.getPrtElementosProtocoloArray();
|
|
|
|
|
List<PrtElementosProtocolo> ecdsPerfil = (List<PrtElementosProtocolo>) empresa.getPrtElementosProtocoloArray();
|
|
|
|
|
for( PrtElementosProtocolo ecdPerfil : ecdsPerfil )
|
|
|
|
|
{
|
|
|
|
|
if(perfil.equals( ecdPerfil.getNumeroPerfil() ) )
|
|
|
|
|
if( perfil.equals( ecdPerfil.getNumeroPerfil() ) )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
PrtTiposElementosProtocolo ecd = ecdPerfil.getToPrtTiposElementosProtocolo();
|
|
|
|
|
if( ecd != null )
|
|
|
|
|
{
|
|
|
|
|
PrtGruposProtocolo grupoEcd = ecd.getToPrtGruposProtocolo();
|
|
|
|
|
if( grupoEcd != null )
|
|
|
|
|
{
|
|
|
|
|
String descricao = grupoEcd.getDescricao();
|
|
|
|
|
if( descricao != null )
|
|
|
|
|
{
|
|
|
|
|
grupos.put( grupoEcd, descricao );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
inputExameGruposEcds.setObject(grupos);
|
|
|
|
|
inputExameGruposEcds.setEditable( true );
|
|
|
|
|
cardLayout.show( this, PANEL_EXAME_NAME );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -362,10 +382,10 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
inputExameMarcacaoEstado.setSelectedObject( exameMarcacao.getEstado() );
|
|
|
|
|
// TODO mostrar lista de exames disponiveis para a marcacao
|
|
|
|
|
List<TrabalhadoresEcd> ecds = (List<TrabalhadoresEcd>) exameMarcacao.getTrabalhadoresEcdArray();
|
|
|
|
|
for(TrabalhadoresEcd ecd : ecds)
|
|
|
|
|
for( TrabalhadoresEcd ecd : ecds )
|
|
|
|
|
{
|
|
|
|
|
Integer ecdEstado = ecd.getEstado();
|
|
|
|
|
// ecd.get
|
|
|
|
|
// ecd.get
|
|
|
|
|
}
|
|
|
|
|
cardLayout.show( this, PANEL_EXAME_MARCACAO_NAME );
|
|
|
|
|
}
|
|
|
|
|
@ -413,7 +433,7 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
@LeafUIActionBinding(action = CREATE_CONSULTA_MARCACAO)
|
|
|
|
|
public void setForNewConsultaMarcacao( TrabalhadoresConsultasDatas marcacao )
|
|
|
|
|
{
|
|
|
|
|
LeafCalendarDialog calendar = new LeafCalendarDialog( getParentFrame(), this, false, false);
|
|
|
|
|
LeafCalendarDialog calendar = new LeafCalendarDialog( getParentFrame(), this, false, false );
|
|
|
|
|
Date date = calendar.getDate();
|
|
|
|
|
marcacao.setData( date );
|
|
|
|
|
}
|
|
|
|
|
@ -426,21 +446,21 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
@LeafUIActionBinding(action = CREATE_CONSULTA_MARCACAO_OBSERVACOES)
|
|
|
|
|
public void setForNewConsultaMarcacaoObservacoes( TrabalhadoresConsultasDatasObservacoes observacoes )
|
|
|
|
|
{
|
|
|
|
|
LeafTextDialog textDialog = new LeafTextDialog( getParentFrame(), this, "");
|
|
|
|
|
LeafTextDialog textDialog = new LeafTextDialog( getParentFrame(), this, "" );
|
|
|
|
|
String text = textDialog.getText();
|
|
|
|
|
observacoes.setObservacao( text );
|
|
|
|
|
inputConsultaMarcacaoObsMensagem.setEditable( true );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@LeafUIActionBinding(action = CREATE_EXAME)
|
|
|
|
|
public void setForNewExame( TrabalhadoresEcdsDatas exame )
|
|
|
|
|
public void setForNewExame( TrabalhadoresEcds exame )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@LeafUIActionBinding(action = CREATE_EXAME_MARCACAO)
|
|
|
|
|
public void setForNewExameMarcacao( TrabalhadoresEcdsDatas marcacao )
|
|
|
|
|
{
|
|
|
|
|
LeafCalendarDialog calendar = new LeafCalendarDialog( getParentFrame(), this, false, false);
|
|
|
|
|
LeafCalendarDialog calendar = new LeafCalendarDialog( getParentFrame(), this, false, false );
|
|
|
|
|
Date date = calendar.getDate();
|
|
|
|
|
marcacao.setData( date );
|
|
|
|
|
}
|
|
|
|
|
@ -453,7 +473,7 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
@LeafUIActionBinding(action = CREATE_EXAME_MARCACAO_OBSERVACOES)
|
|
|
|
|
public void setForNewExameMarcacaoObservacoes( TrabalhadoresEcdsDatasObservacoes observacoes )
|
|
|
|
|
{
|
|
|
|
|
LeafTextDialog textDialog = new LeafTextDialog( getParentFrame(), this, "");
|
|
|
|
|
LeafTextDialog textDialog = new LeafTextDialog( getParentFrame(), this, "" );
|
|
|
|
|
String text = textDialog.getText();
|
|
|
|
|
observacoes.setObservacao( text );
|
|
|
|
|
inputExameMarcacaoObsMensagem.setEditable( true );
|
|
|
|
|
@ -483,7 +503,7 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
{
|
|
|
|
|
observacoes.setObservacao( inputConsultaMarcacaoObsMensagem.getText() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@LeafUIActionBinding(action = SAVE_EXAME)
|
|
|
|
|
public void updateToSaveExame( TrabalhadoresEcds exame )
|
|
|
|
|
{
|
|
|
|
|
@ -539,11 +559,11 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
|
|
|
|
|
private void setupTrabalhadorPanel()
|
|
|
|
|
{
|
|
|
|
|
// inputTrabalhadorNacionalidade.setEditable( false );
|
|
|
|
|
// inputTrabalhadorDataNascimento.setEditable( false );
|
|
|
|
|
// inputTrabalhadorNome.setEditable( false );
|
|
|
|
|
// inputTrabalhadorSexo.setEditable( false );
|
|
|
|
|
// inputTrabalhadorObservacoes.setEditable( false );
|
|
|
|
|
// inputTrabalhadorNacionalidade.setEditable( false );
|
|
|
|
|
// inputTrabalhadorDataNascimento.setEditable( false );
|
|
|
|
|
// inputTrabalhadorNome.setEditable( false );
|
|
|
|
|
// inputTrabalhadorSexo.setEditable( false );
|
|
|
|
|
// inputTrabalhadorObservacoes.setEditable( false );
|
|
|
|
|
setupSimpleDataPanel( panelTrabalhador, "Trabalhador", labelTrabalhadorNome, inputTrabalhadorNome, labelTrabalhadorSexo, inputTrabalhadorSexo, labelTrabalhadorNacionalidade, inputTrabalhadorNacionalidade, labelTrabalhadorDataNascimento, inputTrabalhadorDataNascimento, labelTrabalhadorObservacoes, inputTrabalhadorObservacoes );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -555,8 +575,8 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
private void setupConsultaPanel()
|
|
|
|
|
{
|
|
|
|
|
setupSimpleDataPanel( panelConsulta, "Consulta", labelConsultaEstado, inputConsultaEstado, labelConsultaData, inputConsultaData, new JPanel() );
|
|
|
|
|
// inputConsultaEstado.setEditable( true );
|
|
|
|
|
// inputConsultaData.setEditable( true );
|
|
|
|
|
// inputConsultaEstado.setEditable( true );
|
|
|
|
|
// inputConsultaData.setEditable( true );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setupConsultaMarcacaoPanel()
|
|
|
|
|
@ -571,13 +591,13 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
|
|
|
|
|
private void setupConsultaMarcacaoObservacoesPanel()
|
|
|
|
|
{
|
|
|
|
|
// inputConsultaMarcacaoObsMensagem.setEditable( false );
|
|
|
|
|
// inputConsultaMarcacaoObsMensagem.setEditable( false );
|
|
|
|
|
setupSimpleDataPanel( panelConsultaMarcacaoObservacao, "Observa" + ccedil + otilde + "es", inputConsultaMarcacaoObsMensagem );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setupExamePanel()
|
|
|
|
|
{
|
|
|
|
|
setupSimpleDataPanel( panelExame, "Exame", labelExameEstado, inputExameEstado, labelExameData, inputExameData, new JPanel() );
|
|
|
|
|
setupSimpleDataPanel( panelExame, "Exame", labelExameEstado, inputExameEstado, labelExameData, inputExameData, labelExameGruposEcds, inputExameGruposEcds, new JPanel() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setupExameMarcacaoPanel()
|
|
|
|
|
@ -592,7 +612,7 @@ public class ProcessoDadosPanel extends JPanel
|
|
|
|
|
|
|
|
|
|
private void setupExameMarcacaoObservacoesPanel()
|
|
|
|
|
{
|
|
|
|
|
// inputExameMarcacaoObsMensagem.setEditable( false );
|
|
|
|
|
// inputExameMarcacaoObsMensagem.setEditable( false );
|
|
|
|
|
setupSimpleDataPanel( panelExameMarcacaoObservacao, "Observa" + ccedil + otilde + "es", inputExameMarcacaoObsMensagem );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|