|
|
|
|
@ -10,6 +10,7 @@
|
|
|
|
|
package siprp.medicina.processo.detalhes;
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.Singleton;
|
|
|
|
|
import com.evolute.utils.data.IDObject;
|
|
|
|
|
import com.evolute.utils.jdo.JDOProvider;
|
|
|
|
|
import com.evolute.utils.ui.DialogException;
|
|
|
|
|
import com.evolute.utils.ui.calendar.JCalendarPanel;
|
|
|
|
|
@ -23,6 +24,7 @@ import javax.swing.*;
|
|
|
|
|
import javax.swing.event.ChangeEvent;
|
|
|
|
|
import javax.swing.event.ChangeListener;
|
|
|
|
|
import siprp.medicina.MedicinaConstants;
|
|
|
|
|
import siprp.medicina.processo.ProcessoDataProvider;
|
|
|
|
|
import siprp.medicina.processo.ProcessoListener;
|
|
|
|
|
import siprp.medicina.processo.data.TrabalhadoresConsultasData;
|
|
|
|
|
|
|
|
|
|
@ -42,15 +44,18 @@ public class ConsultaPanel extends JPanel
|
|
|
|
|
|
|
|
|
|
protected final Vector<ProcessoListener> PROCESSO_LISTENERS = new Vector<ProcessoListener>();
|
|
|
|
|
protected JDOProvider JDO;
|
|
|
|
|
protected ProcessoDataProvider provider;
|
|
|
|
|
|
|
|
|
|
protected TrabalhadoresConsultasData consulta;
|
|
|
|
|
protected Integer trabalhadorID;
|
|
|
|
|
|
|
|
|
|
/** Creates a new instance of ConsultaPanel */
|
|
|
|
|
public ConsultaPanel( JFrame owner )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
this.owner = owner;
|
|
|
|
|
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
|
|
|
|
|
provider = ProcessoDataProvider.getProvider();
|
|
|
|
|
setupComponents();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -88,11 +93,25 @@ public class ConsultaPanel extends JPanel
|
|
|
|
|
Object source = e.getSource();
|
|
|
|
|
if( source.equals( observacoesButton ) )
|
|
|
|
|
{
|
|
|
|
|
editarObservacoes();
|
|
|
|
|
}
|
|
|
|
|
else if( source.equals( emailButton ) )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if( source.equals( estadoButton ) )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void stateChanged(ChangeEvent e)
|
|
|
|
|
{
|
|
|
|
|
Object source = e.getSource();
|
|
|
|
|
if( source.equals( dataConsultaPanel ) )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void editarObservacoes()
|
|
|
|
|
@ -101,6 +120,26 @@ public class ConsultaPanel extends JPanel
|
|
|
|
|
{
|
|
|
|
|
observacoesDialog = new ObservacoesDialog( owner );
|
|
|
|
|
}
|
|
|
|
|
String texto = "";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Integer dataID = provider.getLastConsultaDataIDForConsulta( ( Integer ) consulta.get( TrabalhadoresConsultasData.ID ) );
|
|
|
|
|
IDObject observacoes = provider.getObservacoesConsultaData( dataID );
|
|
|
|
|
if( observacoes != null )
|
|
|
|
|
{
|
|
|
|
|
texto = observacoes.toString();
|
|
|
|
|
}
|
|
|
|
|
texto = observacoesDialog.editarObservacao( texto );
|
|
|
|
|
if( texto != null )
|
|
|
|
|
{
|
|
|
|
|
provider.saveObservacoesConsultaData( dataID, texto );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch( Exception ex )
|
|
|
|
|
{
|
|
|
|
|
DialogException.showExceptionMessage( ex, "Erro a carregar dados", true );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addProcessoListener( ProcessoListener listener )
|
|
|
|
|
@ -138,14 +177,12 @@ public class ConsultaPanel extends JPanel
|
|
|
|
|
{
|
|
|
|
|
estadoButton.setText( " " );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch( Exception ex )
|
|
|
|
|
{
|
|
|
|
|
DialogException.showExceptionMessage( ex, "Erro a carregar dados da consulta", true );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setTrabalhadorID( Integer trabalhadorID )
|
|
|
|
|
|