|
|
|
|
@ -11,7 +11,6 @@ package siprp.medicina.presencas;
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.data.IDObject;
|
|
|
|
|
import com.evolute.utils.data.MappableObject;
|
|
|
|
|
import com.evolute.utils.strings.StringPlainer;
|
|
|
|
|
import com.evolute.utils.tracker.TrackableWindow;
|
|
|
|
|
import com.evolute.utils.ui.DialogException;
|
|
|
|
|
import com.evolute.utils.ui.calendar.JCalendarPanel;
|
|
|
|
|
@ -22,14 +21,14 @@ import java.awt.event.ActionEvent;
|
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
|
import java.awt.event.WindowAdapter;
|
|
|
|
|
import java.awt.event.WindowEvent;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
import siprp.data.Marcacao;
|
|
|
|
|
import siprp.medicina.MedicinaDataProvider;
|
|
|
|
|
import siprp.medicina.prestadores.PrestadoresDataProvider;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
@ -38,28 +37,30 @@ import siprp.medicina.MedicinaDataProvider;
|
|
|
|
|
public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
implements ActionListener, TrackableWindow
|
|
|
|
|
{
|
|
|
|
|
protected static final Integer PRESTADOR_ID_SIPRP = new Integer( -1 );
|
|
|
|
|
protected static final Integer PRESTADOR_ID_TODOS = new Integer( -2 );
|
|
|
|
|
|
|
|
|
|
protected static final IDObject PRESTADOR_SIPRP = new MappableObject( PRESTADOR_ID_SIPRP, "SIPRP" );
|
|
|
|
|
protected static final IDObject PRESTADOR_TODOS = new MappableObject( PRESTADOR_ID_TODOS, "Todos" );
|
|
|
|
|
|
|
|
|
|
protected JCalendarPanel dataPanel;
|
|
|
|
|
protected JButton carregarButton;
|
|
|
|
|
protected JComboBox prestadoresCombo;
|
|
|
|
|
protected JButton recarregarPrestadoresButton;
|
|
|
|
|
protected JScrollPane listECDsScroll;
|
|
|
|
|
protected JScrollPane listConsultasScroll;
|
|
|
|
|
protected MultipleActionListPanel listECDsPanel;
|
|
|
|
|
protected MultipleActionListPanel listConsultasPanel;
|
|
|
|
|
|
|
|
|
|
protected MedicinaDataProvider provider;
|
|
|
|
|
|
|
|
|
|
public static void main( String args[] )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
RegistarPresencasWindow window = new RegistarPresencasWindow();
|
|
|
|
|
window.setVisible( true );
|
|
|
|
|
window.setExtendedState( window.getExtendedState() | MAXIMIZED_BOTH );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected PrestadoresDataProvider prestadoresProvider;
|
|
|
|
|
|
|
|
|
|
/** Creates a new instance of RegistarPresencasWindow */
|
|
|
|
|
public RegistarPresencasWindow()
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
provider = ( MedicinaDataProvider ) MedicinaDataProvider.getProvider();
|
|
|
|
|
prestadoresProvider = PrestadoresDataProvider.getProvider();
|
|
|
|
|
setupComponents();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -72,6 +73,10 @@ public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
dataPanel = new JCalendarPanel( this );
|
|
|
|
|
carregarButton = new JButton( "Carregar" );
|
|
|
|
|
carregarButton.addActionListener( this );
|
|
|
|
|
JLabel prestadoresLabel = new JLabel( "Prestador" );
|
|
|
|
|
prestadoresCombo = new JComboBox ();
|
|
|
|
|
recarregarPrestadoresButton = new JButton( "Recarregar Prestadores" );
|
|
|
|
|
recarregarPrestadoresButton.addActionListener( this );
|
|
|
|
|
|
|
|
|
|
PresencasActionFactory realizouFactory = new PresencasActionFactory( PresencasActionFactory.REALIZOU );
|
|
|
|
|
PresencasActionFactory realizouParcialmenteFactory = new PresencasActionFactory( PresencasActionFactory.REALIZOU_PARCIALMENTE );
|
|
|
|
|
@ -109,6 +114,9 @@ public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
upperPanel.add( dataLabel );
|
|
|
|
|
upperPanel.add( dataPanel );
|
|
|
|
|
upperPanel.add( carregarButton );
|
|
|
|
|
upperPanel.add( prestadoresLabel );
|
|
|
|
|
upperPanel.add( prestadoresCombo );
|
|
|
|
|
upperPanel.add( recarregarPrestadoresButton );
|
|
|
|
|
|
|
|
|
|
setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
|
|
|
|
|
addWindowListener( new WindowAdapter(){
|
|
|
|
|
@ -123,7 +131,7 @@ public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
recarregarPrestadores();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void actionPerformed( ActionEvent e )
|
|
|
|
|
@ -133,6 +141,10 @@ public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
{
|
|
|
|
|
carregar();
|
|
|
|
|
}
|
|
|
|
|
else if( source.equals( recarregarPrestadoresButton ) )
|
|
|
|
|
{
|
|
|
|
|
recarregarPrestadores();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void refresh()
|
|
|
|
|
@ -202,4 +214,23 @@ public class RegistarPresencasWindow extends JFrame
|
|
|
|
|
DialogException.showExceptionMessage( ex, "Erro a carregar dados", true );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void recarregarPrestadores()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
IDObject prestadores[] = prestadoresProvider.getPrestadoresActivos();
|
|
|
|
|
prestadoresCombo.removeAllItems();
|
|
|
|
|
prestadoresCombo.addItem( PRESTADOR_TODOS );
|
|
|
|
|
prestadoresCombo.addItem( PRESTADOR_SIPRP );
|
|
|
|
|
for( int n = 0; n < prestadores.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
prestadoresCombo.addItem( prestadores[ n ] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch( Exception ex )
|
|
|
|
|
{
|
|
|
|
|
DialogException.showExceptionMessage( ex, "Erro a carregar prestadores", true );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|