|
|
|
@ -9,20 +9,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
package siprp.medicina.locais_realizacao;
|
|
|
|
package siprp.medicina.locais_realizacao;
|
|
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.data.IDObject;
|
|
|
|
|
|
|
|
import com.evolute.utils.data.MappableObject;
|
|
|
|
|
|
|
|
import com.evolute.utils.tables.BaseTable;
|
|
|
|
|
|
|
|
import com.evolute.utils.tables.ColumnizedMappable;
|
|
|
|
|
|
|
|
import com.evolute.utils.tables.VectorTableModel;
|
|
|
|
|
|
|
|
import com.evolute.utils.tracker.TrackableWindow;
|
|
|
|
|
|
|
|
import com.evolute.utils.ui.DialogException;
|
|
|
|
|
|
|
|
import com.evolute.utils.ui.calendar.JCalendarPanel;
|
|
|
|
|
|
|
|
import info.clearthought.layout.TableLayout;
|
|
|
|
import info.clearthought.layout.TableLayout;
|
|
|
|
import info.clearthought.layout.TableLayoutConstraints;
|
|
|
|
import info.clearthought.layout.TableLayoutConstraints;
|
|
|
|
import java.awt.BorderLayout;
|
|
|
|
|
|
|
|
import java.awt.Color;
|
|
|
|
import java.awt.Color;
|
|
|
|
import java.awt.FlowLayout;
|
|
|
|
import java.awt.FlowLayout;
|
|
|
|
import java.awt.GridLayout;
|
|
|
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
import java.awt.event.WindowAdapter;
|
|
|
|
import java.awt.event.WindowAdapter;
|
|
|
|
@ -30,6 +21,7 @@ import java.awt.event.WindowEvent;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Vector;
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory;
|
|
|
|
import javax.swing.BorderFactory;
|
|
|
|
import javax.swing.JButton;
|
|
|
|
import javax.swing.JButton;
|
|
|
|
import javax.swing.JComboBox;
|
|
|
|
import javax.swing.JComboBox;
|
|
|
|
@ -44,9 +36,19 @@ import javax.swing.event.ChangeEvent;
|
|
|
|
import javax.swing.event.ChangeListener;
|
|
|
|
import javax.swing.event.ChangeListener;
|
|
|
|
import javax.swing.event.ListSelectionEvent;
|
|
|
|
import javax.swing.event.ListSelectionEvent;
|
|
|
|
import javax.swing.event.ListSelectionListener;
|
|
|
|
import javax.swing.event.ListSelectionListener;
|
|
|
|
|
|
|
|
|
|
|
|
import siprp.data.Marcacao;
|
|
|
|
import siprp.data.Marcacao;
|
|
|
|
import siprp.medicina.prestadores.PrestadoresDataProvider;
|
|
|
|
import siprp.medicina.prestadores.PrestadoresDataProvider;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.data.IDObject;
|
|
|
|
|
|
|
|
import com.evolute.utils.data.MappableObject;
|
|
|
|
|
|
|
|
import com.evolute.utils.tables.BaseTable;
|
|
|
|
|
|
|
|
import com.evolute.utils.tables.ColumnizedMappable;
|
|
|
|
|
|
|
|
import com.evolute.utils.tables.VectorTableModel;
|
|
|
|
|
|
|
|
import com.evolute.utils.tracker.TrackableWindow;
|
|
|
|
|
|
|
|
import com.evolute.utils.ui.DialogException;
|
|
|
|
|
|
|
|
import com.evolute.utils.ui.calendar.JCalendarPanel;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author fpalma
|
|
|
|
* @author fpalma
|
|
|
|
@ -54,6 +56,11 @@ import siprp.medicina.prestadores.PrestadoresDataProvider;
|
|
|
|
public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
implements ActionListener, TrackableWindow, ListSelectionListener
|
|
|
|
implements ActionListener, TrackableWindow, ListSelectionListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
|
|
protected static final Integer PRESTADOR_ID_SIPRP = new Integer( -1 );
|
|
|
|
protected static final Integer PRESTADOR_ID_SIPRP = new Integer( -1 );
|
|
|
|
|
|
|
|
|
|
|
|
protected static final IDObject PRESTADOR_SIPRP = new MappableObject( PRESTADOR_ID_SIPRP, "SIPRP" );
|
|
|
|
protected static final IDObject PRESTADOR_SIPRP = new MappableObject( PRESTADOR_ID_SIPRP, "SIPRP" );
|
|
|
|
@ -69,10 +76,12 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
protected JComboBox prestadoresConsultasCombo;
|
|
|
|
protected JComboBox prestadoresConsultasCombo;
|
|
|
|
protected JButton enviarConsultasButton;
|
|
|
|
protected JButton enviarConsultasButton;
|
|
|
|
protected JButton faxConsultasButton;
|
|
|
|
protected JButton faxConsultasButton;
|
|
|
|
protected JLabel numeroECDsLabel;
|
|
|
|
// protected JLabel numeroECDsLabel;
|
|
|
|
protected JComboBox prestadoresECDsCombo;
|
|
|
|
protected Integer idsGruposEcds[];
|
|
|
|
|
|
|
|
protected JComboBox prestadoresECDsCombos[];
|
|
|
|
protected JButton enviarECDsButton;
|
|
|
|
protected JButton enviarECDsButton;
|
|
|
|
protected JButton faxECDsButton;
|
|
|
|
protected JScrollPane listaEcdsScroll;
|
|
|
|
|
|
|
|
// protected JButton faxECDsButton;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected LocaisRealizacaoDataProvider provider;
|
|
|
|
protected LocaisRealizacaoDataProvider provider;
|
|
|
|
@ -115,7 +124,7 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
JPanel consultasPanel = new JPanel();
|
|
|
|
JPanel consultasPanel = new JPanel();
|
|
|
|
consultasPanel.setBorder( BorderFactory.createTitledBorder(
|
|
|
|
consultasPanel.setBorder( BorderFactory.createTitledBorder(
|
|
|
|
BorderFactory.createEtchedBorder(), "Consultas" ) );
|
|
|
|
BorderFactory.createEtchedBorder(), "Consultas" ) );
|
|
|
|
JLabel consultasLabel = new JLabel( "Quantidade " );
|
|
|
|
JLabel consultasLabel = new JLabel( "N\u00ba de Consultas: " );
|
|
|
|
numeroConsultasLabel = new JLabel( " " );
|
|
|
|
numeroConsultasLabel = new JLabel( " " );
|
|
|
|
numeroConsultasLabel.setForeground( Color.green.darker() );
|
|
|
|
numeroConsultasLabel.setForeground( Color.green.darker() );
|
|
|
|
prestadoresConsultasCombo = new JComboBox();
|
|
|
|
prestadoresConsultasCombo = new JComboBox();
|
|
|
|
@ -126,14 +135,17 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
JPanel ecdsPanel = new JPanel();
|
|
|
|
JPanel ecdsPanel = new JPanel();
|
|
|
|
ecdsPanel.setBorder( BorderFactory.createTitledBorder(
|
|
|
|
ecdsPanel.setBorder( BorderFactory.createTitledBorder(
|
|
|
|
BorderFactory.createEtchedBorder(), "ECDs" ) );
|
|
|
|
BorderFactory.createEtchedBorder(), "ECDs" ) );
|
|
|
|
JLabel ecdsLabel = new JLabel( "Quantidade " );
|
|
|
|
// JLabel ecdsLabel = new JLabel( "Quantidade " );
|
|
|
|
numeroECDsLabel = new JLabel( " " );
|
|
|
|
// numeroECDsLabel = new JLabel( " " );
|
|
|
|
numeroECDsLabel.setForeground( Color.green.darker() );
|
|
|
|
// numeroECDsLabel.setForeground( Color.green.darker() );
|
|
|
|
prestadoresECDsCombo = new JComboBox();
|
|
|
|
// prestadoresECDsCombo = new JComboBox();
|
|
|
|
|
|
|
|
listaEcdsScroll = new JScrollPane();
|
|
|
|
|
|
|
|
listaEcdsScroll.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED );
|
|
|
|
|
|
|
|
listaEcdsScroll.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
|
|
|
|
enviarECDsButton = new JButton( "Atribuir" );
|
|
|
|
enviarECDsButton = new JButton( "Atribuir" );
|
|
|
|
enviarECDsButton.addActionListener( this );
|
|
|
|
enviarECDsButton.addActionListener( this );
|
|
|
|
faxECDsButton = new JButton( "Fax" );
|
|
|
|
// faxECDsButton = new JButton( "Fax" );
|
|
|
|
faxECDsButton.addActionListener( this );
|
|
|
|
// faxECDsButton.addActionListener( this );
|
|
|
|
dataPanel.addChangeListener( new ChangeListener(){
|
|
|
|
dataPanel.addChangeListener( new ChangeListener(){
|
|
|
|
public void stateChanged(ChangeEvent e)
|
|
|
|
public void stateChanged(ChangeEvent e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -144,11 +156,26 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
|
|
getContentPane().setLayout( new BorderLayout( 5, 5 ) );
|
|
|
|
TableLayout layout =
|
|
|
|
|
|
|
|
new TableLayout(
|
|
|
|
|
|
|
|
new double[]{ TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL },
|
|
|
|
|
|
|
|
new double[]{ TableLayout.MINIMUM, TableLayout.FILL, TableLayout.FILL } );
|
|
|
|
|
|
|
|
layout.setHGap( 5 );
|
|
|
|
|
|
|
|
layout.setVGap( 5 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// getContentPane().setLayout( new BorderLayout( 5, 5 ) );
|
|
|
|
|
|
|
|
getContentPane().setLayout( layout );
|
|
|
|
JPanel upperPanel = new JPanel();
|
|
|
|
JPanel upperPanel = new JPanel();
|
|
|
|
getContentPane().add( upperPanel, BorderLayout.NORTH );
|
|
|
|
getContentPane().add( upperPanel, new TableLayoutConstraints( 0, 0, 3, 0 ) );
|
|
|
|
JPanel centerPanel = new JPanel();
|
|
|
|
getContentPane().add( empresasScp, new TableLayoutConstraints( 0, 1, 1, 1 ) );
|
|
|
|
getContentPane().add( centerPanel, BorderLayout.CENTER );
|
|
|
|
getContentPane().add( estabelecimentosScp, new TableLayoutConstraints( 2, 1, 3, 1 ) );
|
|
|
|
|
|
|
|
// JPanel detalhesPanel = new JPanel();
|
|
|
|
|
|
|
|
// getContentPane().add( detalhesPanel, new TableLayoutConstraints( 0, 2, 1, 2 ) );
|
|
|
|
|
|
|
|
getContentPane().add( consultasPanel, new TableLayoutConstraints( 0, 2 ) );
|
|
|
|
|
|
|
|
getContentPane().add( ecdsPanel, new TableLayoutConstraints( 1, 2, 3, 2 ) );
|
|
|
|
|
|
|
|
// getContentPane().add( upperPanel, BorderLayout.NORTH );
|
|
|
|
|
|
|
|
// JPanel centerPanel = new JPanel();
|
|
|
|
|
|
|
|
// getContentPane().add( centerPanel, BorderLayout.CENTER );
|
|
|
|
|
|
|
|
|
|
|
|
upperPanel.setLayout( new FlowLayout( FlowLayout.CENTER ) );
|
|
|
|
upperPanel.setLayout( new FlowLayout( FlowLayout.CENTER ) );
|
|
|
|
upperPanel.add( dataLabel );
|
|
|
|
upperPanel.add( dataLabel );
|
|
|
|
@ -156,11 +183,11 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
upperPanel.add( carregarButton );
|
|
|
|
upperPanel.add( carregarButton );
|
|
|
|
upperPanel.add( recarregarPrestadoresButton );
|
|
|
|
upperPanel.add( recarregarPrestadoresButton );
|
|
|
|
|
|
|
|
|
|
|
|
centerPanel.setLayout( new GridLayout( 1, 3 ) );
|
|
|
|
// centerPanel.setLayout( new GridLayout( 1, 3 ) );
|
|
|
|
centerPanel.add( empresasScp );
|
|
|
|
// centerPanel.add( empresasScp );
|
|
|
|
centerPanel.add( estabelecimentosScp );
|
|
|
|
// centerPanel.add( estabelecimentosScp );
|
|
|
|
JPanel detalhesPanel = new JPanel();
|
|
|
|
// JPanel detalhesPanel = new JPanel();
|
|
|
|
centerPanel.add( detalhesPanel );
|
|
|
|
// centerPanel.add( detalhesPanel );
|
|
|
|
|
|
|
|
|
|
|
|
double cols[] =
|
|
|
|
double cols[] =
|
|
|
|
new double[]{ TableLayout.MINIMUM, TableLayout.FILL };
|
|
|
|
new double[]{ TableLayout.MINIMUM, TableLayout.FILL };
|
|
|
|
@ -176,25 +203,26 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
consultasPanel.add( enviarConsultasButton, new TableLayoutConstraints( 0, 2, 1, 2 ) );
|
|
|
|
consultasPanel.add( enviarConsultasButton, new TableLayoutConstraints( 0, 2, 1, 2 ) );
|
|
|
|
// consultasPanel.add( faxConsultasButton, new TableLayoutConstraints( 0, 3, 1, 3 ) );
|
|
|
|
// consultasPanel.add( faxConsultasButton, new TableLayoutConstraints( 0, 3, 1, 3 ) );
|
|
|
|
|
|
|
|
|
|
|
|
rows = new double[]{ TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM };
|
|
|
|
rows = new double[]{ TableLayout.FILL, TableLayout.MINIMUM };
|
|
|
|
|
|
|
|
|
|
|
|
tableLayout = new TableLayout( cols,rows );
|
|
|
|
tableLayout = new TableLayout( cols,rows );
|
|
|
|
ecdsPanel.setLayout( tableLayout );
|
|
|
|
ecdsPanel.setLayout( tableLayout );
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// ecdsPanel.add( ecdsLabel, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
|
|
|
// ecdsPanel.add( numeroECDsLabel, new TableLayoutConstraints( 1, 0 ) );
|
|
|
|
|
|
|
|
// ecdsPanel.add( prestadoresECDsCombo, new TableLayoutConstraints( 0, 1, 1, 1 ) );
|
|
|
|
|
|
|
|
ecdsPanel.add( listaEcdsScroll, new TableLayoutConstraints( 0, 0, 1, 0 ) );
|
|
|
|
|
|
|
|
ecdsPanel.add( enviarECDsButton, new TableLayoutConstraints( 0, 1, 1, 1 ) );
|
|
|
|
|
|
|
|
// ecdsPanel.add( faxECDsButton, new TableLayoutConstraints( 0, 3, 1, 3 ) );
|
|
|
|
|
|
|
|
|
|
|
|
ecdsPanel.add( ecdsLabel, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
// cols = new double[]{ TableLayout.FILL };
|
|
|
|
ecdsPanel.add( numeroECDsLabel, new TableLayoutConstraints( 1, 0 ) );
|
|
|
|
// rows = new double[]{ TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL };
|
|
|
|
ecdsPanel.add( prestadoresECDsCombo, new TableLayoutConstraints( 0, 1, 1, 1 ) );
|
|
|
|
//
|
|
|
|
ecdsPanel.add( enviarECDsButton, new TableLayoutConstraints( 0, 2, 1, 2 ) );
|
|
|
|
// tableLayout = new TableLayout( cols,rows );
|
|
|
|
ecdsPanel.add( faxECDsButton, new TableLayoutConstraints( 0, 3, 1, 3 ) );
|
|
|
|
// detalhesPanel.setLayout( tableLayout );
|
|
|
|
|
|
|
|
//
|
|
|
|
cols = new double[]{ TableLayout.FILL };
|
|
|
|
// detalhesPanel.add( consultasPanel, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
rows = new double[]{ TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL };
|
|
|
|
// detalhesPanel.add( ecdsPanel, new TableLayoutConstraints( 0, 1 ) );
|
|
|
|
|
|
|
|
|
|
|
|
tableLayout = new TableLayout( cols,rows );
|
|
|
|
|
|
|
|
detalhesPanel.setLayout( tableLayout );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
detalhesPanel.add( consultasPanel, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
|
|
|
detalhesPanel.add( ecdsPanel, new TableLayoutConstraints( 0, 1 ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
|
|
|
|
setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
|
|
|
|
addWindowListener( new WindowAdapter(){
|
|
|
|
addWindowListener( new WindowAdapter(){
|
|
|
|
@ -263,10 +291,10 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
{
|
|
|
|
{
|
|
|
|
enviarECDs();
|
|
|
|
enviarECDs();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( source.equals( faxECDsButton ) )
|
|
|
|
// else if( source.equals( faxECDsButton ) )
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
faxECDs();
|
|
|
|
// faxECDs();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -341,7 +369,7 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
Date data = dataPanel.getDate();
|
|
|
|
Date data = dataPanel.getDate();
|
|
|
|
int selectedEstabelecimento = estabelecimentosTable.getSelectedRow();
|
|
|
|
int selectedEstabelecimento = estabelecimentosTable.getSelectedRow();
|
|
|
|
numeroConsultasLabel.setText( " " );
|
|
|
|
numeroConsultasLabel.setText( " " );
|
|
|
|
numeroECDsLabel.setText( " " );
|
|
|
|
// numeroECDsLabel.setText( " " );
|
|
|
|
enviarConsultasButton.setEnabled( false );
|
|
|
|
enviarConsultasButton.setEnabled( false );
|
|
|
|
enviarECDsButton.setEnabled( false );
|
|
|
|
enviarECDsButton.setEnabled( false );
|
|
|
|
if( data == null || selectedEstabelecimento == -1 )
|
|
|
|
if( data == null || selectedEstabelecimento == -1 )
|
|
|
|
@ -354,9 +382,9 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
int countConsultas =
|
|
|
|
int countConsultas =
|
|
|
|
provider.getNumeroMarcacoesByEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
provider.getNumeroMarcacoesByEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
Marcacao.TIPO_MARCACAO_TRABALHADOR_CONSULTA, data );
|
|
|
|
Marcacao.TIPO_MARCACAO_TRABALHADOR_CONSULTA, data );
|
|
|
|
int countECDs =
|
|
|
|
// int countECDs =
|
|
|
|
provider.getNumeroMarcacoesByEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
// provider.getNumeroMarcacoesByEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES, data );
|
|
|
|
// Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES, data );
|
|
|
|
if( countConsultas > 0 )
|
|
|
|
if( countConsultas > 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
numeroConsultasLabel.setText( "" + countConsultas );
|
|
|
|
numeroConsultasLabel.setText( "" + countConsultas );
|
|
|
|
@ -396,45 +424,70 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( countECDs > 0 )
|
|
|
|
Object ecds[][] = provider.getGruposEcdsEPrestadoresPorEstabelecimento( estabelecimentoID );
|
|
|
|
|
|
|
|
JPanel ecdsPanel = new JPanel();
|
|
|
|
|
|
|
|
double rows[] = new double[ ecds.length + 1 ];
|
|
|
|
|
|
|
|
for( int n = 0; n < rows.length - 1; n++ )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
numeroECDsLabel.setText( "" + countECDs );
|
|
|
|
rows[ n ] = TableLayoutConstraints.MINIMUM;
|
|
|
|
enviarECDsButton.setEnabled( true );
|
|
|
|
|
|
|
|
Integer[] escolhidos =
|
|
|
|
|
|
|
|
provider.getPrestadoresIDByEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
|
|
|
|
Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES, data );
|
|
|
|
|
|
|
|
if( escolhidos.length == 1 )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
numeroECDsLabel.setForeground( Color.green.darker() );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
numeroECDsLabel.setForeground( Color.red.darker() );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int e;
|
|
|
|
|
|
|
|
for( e = 0; e < escolhidos.length; e++ )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if( escolhidos[ e ] != null )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if( e == escolhidos.length || escolhidos[ e ] == null )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
prestadoresECDsCombo.setSelectedIndex( 0 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for( int p = 0; p < prestadoresECDsCombo.getItemCount(); p++ )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
IDObject prestador = ( IDObject ) prestadoresECDsCombo.getItemAt( p );
|
|
|
|
|
|
|
|
if( prestador.getID().equals( escolhidos[ e ] ) )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
prestadoresECDsCombo.setSelectedIndex( p );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rows[ rows.length - 1 ] = TableLayoutConstraints.FILL;
|
|
|
|
|
|
|
|
TableLayout layout =
|
|
|
|
|
|
|
|
new TableLayout(
|
|
|
|
|
|
|
|
new double[]{ TableLayoutConstraints.FILL, TableLayoutConstraints.MINIMUM,
|
|
|
|
|
|
|
|
TableLayoutConstraints.FILL },
|
|
|
|
|
|
|
|
rows );
|
|
|
|
|
|
|
|
ecdsPanel.setLayout( layout );
|
|
|
|
|
|
|
|
for( int n = 0; n < ecds.length; n++ )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
JLabel ecdLabel = new JLabel( "" + ecds[ n ][ 1 ] );
|
|
|
|
|
|
|
|
JLabel numeroLabel = new JLabel( "" + ( ( n * 23 ) % 7 ), JLabel.RIGHT );
|
|
|
|
|
|
|
|
JComboBox prestadorCombo = new JComboBox();
|
|
|
|
|
|
|
|
prestadorCombo.addItem( "SIPRP" );
|
|
|
|
|
|
|
|
ecdsPanel.add( ecdLabel, new TableLayoutConstraints( 0, n ) );
|
|
|
|
|
|
|
|
ecdsPanel.add( numeroLabel, new TableLayoutConstraints( 1, n ) );
|
|
|
|
|
|
|
|
ecdsPanel.add( prestadorCombo, new TableLayoutConstraints( 2, n ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
listaEcdsScroll.setViewportView( ecdsPanel );
|
|
|
|
|
|
|
|
// if( countECDs > 0 )
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// numeroECDsLabel.setText( "" + countECDs );
|
|
|
|
|
|
|
|
// enviarECDsButton.setEnabled( true );
|
|
|
|
|
|
|
|
// Integer[] escolhidos =
|
|
|
|
|
|
|
|
// provider.getPrestadoresIDByEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
|
|
|
|
// Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES, data );
|
|
|
|
|
|
|
|
// if( escolhidos.length == 1 )
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// numeroECDsLabel.setForeground( Color.green.darker() );
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// numeroECDsLabel.setForeground( Color.red.darker() );
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// int e;
|
|
|
|
|
|
|
|
// for( e = 0; e < escolhidos.length; e++ )
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if( escolhidos[ e ] != null )
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if( e == escolhidos.length || escolhidos[ e ] == null )
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// prestadoresECDsCombo.setSelectedIndex( 0 );
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// for( int p = 0; p < prestadoresECDsCombo.getItemCount(); p++ )
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// IDObject prestador = ( IDObject ) prestadoresECDsCombo.getItemAt( p );
|
|
|
|
|
|
|
|
// if( prestador.getID().equals( escolhidos[ e ] ) )
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// prestadoresECDsCombo.setSelectedIndex( p );
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( Exception ex )
|
|
|
|
catch( Exception ex )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -454,12 +507,12 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
{
|
|
|
|
{
|
|
|
|
prestadoresConsultasCombo.addItem( prestadoresConsultas[ n ] );
|
|
|
|
prestadoresConsultasCombo.addItem( prestadoresConsultas[ n ] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
prestadoresECDsCombo.removeAllItems();
|
|
|
|
// prestadoresECDsCombo.removeAllItems();
|
|
|
|
prestadoresECDsCombo.addItem( PRESTADOR_SIPRP );
|
|
|
|
// prestadoresECDsCombo.addItem( PRESTADOR_SIPRP );
|
|
|
|
for( int n = 0; n < prestadoresECDs.length; n++ )
|
|
|
|
// for( int n = 0; n < prestadoresECDs.length; n++ )
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
prestadoresECDsCombo.addItem( prestadoresECDs[ n ] );
|
|
|
|
// prestadoresECDsCombo.addItem( prestadoresECDs[ n ] );
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( Exception ex )
|
|
|
|
catch( Exception ex )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -478,13 +531,13 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
Integer estabelecimentoID = ( ( ColumnizedMappable ) estabelecimentosModel.getRowAt( selectedEstabelecimento ) ).getID();
|
|
|
|
Integer estabelecimentoID = ( ( ColumnizedMappable ) estabelecimentosModel.getRowAt( selectedEstabelecimento ) ).getID();
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Integer prestadorID = ( ( IDObject ) prestadoresECDsCombo.getSelectedItem() ).getID();
|
|
|
|
// Integer prestadorID = ( ( IDObject ) prestadoresECDsCombo.getSelectedItem() ).getID();
|
|
|
|
if( PRESTADOR_ID_SIPRP.equals( prestadorID ) )
|
|
|
|
// if( PRESTADOR_ID_SIPRP.equals( prestadorID ) )
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
prestadorID = null;
|
|
|
|
// prestadorID = null;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
provider.setPrestadorIDForEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
// provider.setPrestadorIDForEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES, data, prestadorID );
|
|
|
|
// Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES, data, prestadorID );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( Exception ex )
|
|
|
|
catch( Exception ex )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -492,30 +545,30 @@ public class LocaisRealizacaoWindow extends JFrame
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void faxECDs()
|
|
|
|
// protected void faxECDs()
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
Date data = dataPanel.getDate();
|
|
|
|
// Date data = dataPanel.getDate();
|
|
|
|
int selectedEstabelecimento = estabelecimentosTable.getSelectedRow();
|
|
|
|
// int selectedEstabelecimento = estabelecimentosTable.getSelectedRow();
|
|
|
|
if( data == null || selectedEstabelecimento == -1 )
|
|
|
|
// if( data == null || selectedEstabelecimento == -1 )
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
return;
|
|
|
|
// return;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
Integer estabelecimentoID = ( ( ColumnizedMappable ) estabelecimentosModel.getRowAt( selectedEstabelecimento ) ).getID();
|
|
|
|
// Integer estabelecimentoID = ( ( ColumnizedMappable ) estabelecimentosModel.getRowAt( selectedEstabelecimento ) ).getID();
|
|
|
|
try
|
|
|
|
// try
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
Integer prestadorID = ( ( IDObject ) prestadoresECDsCombo.getSelectedItem() ).getID();
|
|
|
|
// Integer prestadorID = ( ( IDObject ) prestadoresECDsCombo.getSelectedItem() ).getID();
|
|
|
|
if( PRESTADOR_ID_SIPRP.equals( prestadorID ) )
|
|
|
|
// if( PRESTADOR_ID_SIPRP.equals( prestadorID ) )
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
prestadorID = null;
|
|
|
|
// prestadorID = null;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
provider.setPrestadorIDForEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
// provider.setPrestadorIDForEstabelecimentoAndTipo( estabelecimentoID,
|
|
|
|
Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES, data, prestadorID );
|
|
|
|
// Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES, data, prestadorID );
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
catch( Exception ex )
|
|
|
|
// catch( Exception ex )
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
DialogException.showExceptionMessage( ex, "Erro a atribuir", true );
|
|
|
|
// DialogException.showExceptionMessage( ex, "Erro a atribuir", true );
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
protected void enviarConsultas()
|
|
|
|
protected void enviarConsultas()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|