git-svn-id: https://svn.coded.pt/svn/SIPRP@613 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 18 years ago
parent d6b09410fc
commit b244b5210e

@ -6,26 +6,33 @@
package siprp;
import java.text.*;
import java.util.*;
import java.text.DateFormat;
import java.util.Date;
import java.util.Hashtable;
import com.evolute.utils.*;
import com.evolute.utils.arrays.*;
import com.evolute.utils.data.*;
import com.evolute.utils.db.*;
import com.evolute.utils.db.keyretrievers.*;
import com.evolute.utils.metadb.*;
import com.evolute.utils.ui.search.*;
import com.evolute.utils.sql.*;
import com.evolute.utils.strings.*;
import siprp.data.AvisoConstants;
import siprp.data.Marcacao;
import siprp.data.*;
import com.evolute.utils.Singleton;
import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.data.MappableObject;
import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.Executer;
import com.evolute.utils.sql.Assignment;
import com.evolute.utils.sql.Field;
import com.evolute.utils.sql.Select;
import com.evolute.utils.sql.Update;
import com.evolute.utils.strings.StringPlainer;
import com.evolute.utils.ui.search.SearchDialog;
import com.evolute.utils.ui.search.SearchExecuter;
/**
*
* @author pars
*/
public class FichaDataProvider extends MetaProvider implements SearchExecuter {
public class FichaDataProvider
implements SearchExecuter {
private static final Object LOCK = new Object();
private static FichaDataProvider instance = null;
@ -43,15 +50,15 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
public static final String SERVICO_HIGIENE_DESIGNACAO = "servico_higiene_designacao";
public static final String INACTIVO = "inactivo";
public static final DBTable EMPRESAS =
new DBTable( T_EMPRESAS,
new String[]{ DESIGNACAO_SOCIAL,
SERVICO_SAUDE_TIPO,
SERVICO_SAUDE_DESIGNACAO,
SERVICO_HIGIENE_TIPO,
SERVICO_HIGIENE_DESIGNACAO,
INACTIVO },
ID );
// public static final DBTable EMPRESAS =
// new DBTable( T_EMPRESAS,
// new String[]{ DESIGNACAO_SOCIAL,
// SERVICO_SAUDE_TIPO,
// SERVICO_SAUDE_DESIGNACAO,
// SERVICO_HIGIENE_TIPO,
// SERVICO_HIGIENE_DESIGNACAO,
// INACTIVO },
// ID );
// estabelecimentos
public static final String T_ESTABELECIMENTOS = "estabelecimentos";
@ -61,10 +68,10 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
public static final String EMPRESA_ID = "empresa_id";
// INACTIVO
public static final DBTable ESTABELECIMENTOS =
new DBTable( T_ESTABELECIMENTOS,
new String[]{ NOME, LOCALIDADE, EMPRESA_ID, INACTIVO },
ID );
// public static final DBTable ESTABELECIMENTOS =
// new DBTable( T_ESTABELECIMENTOS,
// new String[]{ NOME, LOCALIDADE, EMPRESA_ID, INACTIVO },
// ID );
// trabalhadores
public static final String T_TRABALHADORES = "trabalhadores";
@ -83,23 +90,23 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
public static final String ESTABELECIMENTO_ID = "estabelecimento_id";
// INACTIVO
public static final DBTable TRABALHADORES =
new DBTable( T_TRABALHADORES,
new String[]{ NOME, SEXO, DATA_NASCIMENTO,
NACIONALIDADE, NUMERO_MECANOGRAFICO,
DATA_ADMISSAO, CATEGORIA, LOCAL_TRABALHO,
FUNCAO_PROPOSTA, DATA_ADMISSAO_FUNCAO,
OBSERVACOES, ESTABELECIMENTO_ID, INACTIVO },
ID );
// public static final DBTable TRABALHADORES =
// new DBTable( T_TRABALHADORES,
// new String[]{ NOME, SEXO, DATA_NASCIMENTO,
// NACIONALIDADE, NUMERO_MECANOGRAFICO,
// DATA_ADMISSAO, CATEGORIA, LOCAL_TRABALHO,
// FUNCAO_PROPOSTA, DATA_ADMISSAO_FUNCAO,
// OBSERVACOES, ESTABELECIMENTO_ID, INACTIVO },
// ID );
//medicos
public static final String T_MEDICOS = "medicos";
public static final String NUMERO_CEDULA = "numero_cedula";
public static final DBTable MEDICOS =
new DBTable( T_MEDICOS,
new String[]{ NOME, NUMERO_CEDULA }, ID );
// public static final DBTable MEDICOS =
// new DBTable( T_MEDICOS,
// new String[]{ NOME, NUMERO_CEDULA }, ID );
// exames
public static final String T_EXAMES = "exames";
@ -119,45 +126,45 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
public static final String MEDICO_ID = "medico_id";
public static final String PDF = "pdf";
public static final DBTable EXAMES =
new DBTable( T_EXAMES,
new String[]{ DATA, TIPO, OCASIONAL,
OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1,
OUTRA_FUNCAO_2, OUTRA_FUNCAO_3,
OUTRA_FUNCAO_4, PROXIMO_EXAME,
OUTRAS_RECOMENDACOES, TRABALHADOR_ID, MEDICO_ID, PDF, INACTIVO },
ID );
public static DBReference R_ESTABELECIMENTO_EMPRESA = new DBReference( ESTABELECIMENTOS.getFieldByName( EMPRESA_ID ) );
public static DBReference R_TRABALHADOR_ESTABELECIMENTO = new DBReference( TRABALHADORES.getFieldByName( ESTABELECIMENTO_ID ) );
public static DBReference R_EXAME_TRABALHADOR = new DBReference( EXAMES.getFieldByName( TRABALHADOR_ID ) );
public static DBReference R_EXAME_MEDICO = new DBReference( EXAMES.getFieldByName( MEDICO_ID ) );
static
{
try
{
EXAMES.addRelation( MEDICOS,
new DBField[]{ EXAMES.getFieldByName( MEDICO_ID ) },
"R_EXAMES_MEDICOS" );
EXAMES.addRelation( TRABALHADORES,
new DBField[]{ EXAMES.getFieldByName( TRABALHADOR_ID ) },
"R_EXAMES_TRABALHADORES" );
TRABALHADORES.addRelation( ESTABELECIMENTOS,
new DBField[]{ TRABALHADORES.getFieldByName( ESTABELECIMENTO_ID ) },
"R_TRABALHADORES_ESTABELECIMENTOS" );
ESTABELECIMENTOS.addRelation( EMPRESAS,
new DBField[]{ ESTABELECIMENTOS.getFieldByName( EMPRESA_ID ) },
"R_ESTABELECIMENTOS_EMPRESAS" );
EMPRESAS.disableSave( INACTIVO );
ESTABELECIMENTOS.disableSave( INACTIVO );
TRABALHADORES.disableSave( INACTIVO );
EXAMES.disableSave( PDF );
}
catch( Exception e )
{
throw new RuntimeException( e );
}
}
// public static final DBTable EXAMES =
// new DBTable( T_EXAMES,
// new String[]{ DATA, TIPO, OCASIONAL,
// OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1,
// OUTRA_FUNCAO_2, OUTRA_FUNCAO_3,
// OUTRA_FUNCAO_4, PROXIMO_EXAME,
// OUTRAS_RECOMENDACOES, TRABALHADOR_ID, MEDICO_ID, PDF, INACTIVO },
// ID );
//
// public static DBReference R_ESTABELECIMENTO_EMPRESA = new DBReference( ESTABELECIMENTOS.getFieldByName( EMPRESA_ID ) );
// public static DBReference R_TRABALHADOR_ESTABELECIMENTO = new DBReference( TRABALHADORES.getFieldByName( ESTABELECIMENTO_ID ) );
// public static DBReference R_EXAME_TRABALHADOR = new DBReference( EXAMES.getFieldByName( TRABALHADOR_ID ) );
// public static DBReference R_EXAME_MEDICO = new DBReference( EXAMES.getFieldByName( MEDICO_ID ) );
// static
// {
// try
// {
// EXAMES.addRelation( MEDICOS,
// new DBField[]{ EXAMES.getFieldByName( MEDICO_ID ) },
// "R_EXAMES_MEDICOS" );
// EXAMES.addRelation( TRABALHADORES,
// new DBField[]{ EXAMES.getFieldByName( TRABALHADOR_ID ) },
// "R_EXAMES_TRABALHADORES" );
// TRABALHADORES.addRelation( ESTABELECIMENTOS,
// new DBField[]{ TRABALHADORES.getFieldByName( ESTABELECIMENTO_ID ) },
// "R_TRABALHADORES_ESTABELECIMENTOS" );
// ESTABELECIMENTOS.addRelation( EMPRESAS,
// new DBField[]{ ESTABELECIMENTOS.getFieldByName( EMPRESA_ID ) },
// "R_ESTABELECIMENTOS_EMPRESAS" );
// EMPRESAS.disableSave( INACTIVO );
// ESTABELECIMENTOS.disableSave( INACTIVO );
// TRABALHADORES.disableSave( INACTIVO );
// EXAMES.disableSave( PDF );
// }
// catch( Exception e )
// {
// throw new RuntimeException( e );
// }
// }
public static final int SEARCH_EMPRESAS = 0;
public static final int SEARCH_ESTABELECIMENTOS = 1;
@ -178,11 +185,24 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ );
executer = dbm.getSharedExecuter( this );
setDBTable( EXAMES );
// setDBTable( EXAMES );
}
public static MetaProvider getProvider()
// public static MetaProvider getProvider()
// throws Exception
// {
// synchronized( LOCK )
// {
// if( instance == null )
// {
// instance = new FichaDataProvider();
// }
// }
// return instance;
// }
public static FichaDataProvider getProvider()
throws Exception
{
synchronized( LOCK )
@ -323,24 +343,24 @@ public class FichaDataProvider extends MetaProvider implements SearchExecuter {
return array.getObjects();
}
public void savePDF( MetaObject exame )
throws Exception
{
if( exame == null )
{
return;
}
DBKey key = exame.getPrimaryKeyValue();
DBField fields[] = EXAMES.getPrimaryKey();
Integer id = new Integer( ((Number)key.getFieldValue( fields[ 0 ] )).intValue() );
if( id == null )
{
throw new Exception( "Error saving pdf: id is null" );
}
byte []pdf = (byte[]) exame.getProperty( PDF );
BlobUpdate bUpdate = new BlobUpdate( T_EXAMES, PDF, pdf, new Field( ID ).isEqual( id ) );
executer.executeQuery( bUpdate );
}
// public void savePDF( MetaObject exame )
// throws Exception
// {
// if( exame == null )
// {
// return;
// }
// DBKey key = exame.getPrimaryKeyValue();
// DBField fields[] = EXAMES.getPrimaryKey();
// Integer id = new Integer( ((Number)key.getFieldValue( fields[ 0 ] )).intValue() );
// if( id == null )
// {
// throw new Exception( "Error saving pdf: id is null" );
// }
// byte []pdf = (byte[]) exame.getProperty( PDF );
// BlobUpdate bUpdate = new BlobUpdate( T_EXAMES, PDF, pdf, new Field( ID ).isEqual( id ) );
// executer.executeQuery( bUpdate );
// }
public Integer getLastExameIDForTrabalhador( Integer trabalhadorID )
throws Exception

@ -6,23 +6,53 @@
package siprp.clientes;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import com.evolute.utils.*;
import com.evolute.utils.data.*;
import com.evolute.utils.dataui.*;
import com.evolute.utils.documents.*;
import com.evolute.utils.jdo.*;
import com.evolute.utils.tables.*;
import com.evolute.utils.ui.*;
import com.evolute.utils.ui.text.*;
import java.awt.CardLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.Hashtable;
import java.util.Vector;
import siprp.*;
import siprp.data.*;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import siprp.SIPRPTracker;
import siprp.SingletonConstants;
import siprp.data.EmpresaData;
import siprp.data.EstabelecimentoData;
import siprp.data.HistoricoEstabelecimento;
import siprp.data.HistoricoEstabelecimentoData;
import siprp.medicina.prestadores.PrestadoresDataProvider;
import com.evolute.utils.Singleton;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.data.MappableObject;
import com.evolute.utils.dataui.ComponentController;
import com.evolute.utils.dataui.ComponentsHashtable;
import com.evolute.utils.dataui.ControllableComponent;
import com.evolute.utils.documents.MaximumLengthDocument;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.tables.BaseTable;
import com.evolute.utils.tables.ColumnizedObject;
import com.evolute.utils.tables.VectorTableModel;
import com.evolute.utils.ui.DialogException;
import com.evolute.utils.ui.text.CopyPasteHandler;
/**
*
* @author fpalma
@ -49,12 +79,15 @@ public class EstabelecimentoPanel extends JPanel
private ContactoPanel contactoPanel;
private JTextArea historicoText;
private JButton marcacoesButton;
private JPanel historicoPanel;
private JPanel listaHistoricoPanel;
private BaseTable historicoTable;
private HistoricoEstabelecimentoPanel edicaoHistoricoPanel;
private CardLayout historicoCardLayout;
private JComboBox prestadorConsultaCombo;
private JComboBox prestadorEcdsCombo;
private PrestadoresDataProvider prestadoresProvider;
// private MarcacaoPanel marcacaoPanel;
private SIPRPTracker tracker;
@ -63,16 +96,19 @@ public class EstabelecimentoPanel extends JPanel
/** Creates a new instance of EstabelecimentoPanel */
public EstabelecimentoPanel( JPanel toolbarPanel, JTextField designacaoText, JTable estabelecimentosTable )
throws Exception
{
this.toolbarPanel = toolbarPanel;
this.designacaoText = designacaoText;
this.estabelecimentosTable = estabelecimentosTable;
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
prestadoresProvider = PrestadoresDataProvider.getProvider();
setupComponents();
setupComponentsHashtable();
}
private void setupComponents()
throws Exception
{
JPanel dadosEstabelecimentoPanel = new JPanel();
JLabel designacaoLabel = new JLabel( "Designa\u00e7\u00e3o" );
@ -107,6 +143,27 @@ public class EstabelecimentoPanel extends JPanel
// marcacaoPanel.setBorder( BorderFactory.createTitledBorder(
// BorderFactory.createEtchedBorder(),
// "Visita" ) );
MappableObject prestadorDefaultGeral = new MappableObject( null, Singleton.getInstance( SingletonConstants.COMPANY_ACRONYM ) );
prestadorDefaultGeral.nullEqualsNull( true );
JLabel prestadorConsultaLabel = new JLabel( "Consultas" );
prestadorConsultaCombo = new JComboBox();
IDObject[] prestadoresConsultas = prestadoresProvider.getPrestadoresConsultasActivos();
prestadorConsultaCombo.addItem( prestadorDefaultGeral );
for( int n = 0; n < prestadoresConsultas.length; n++ )
{
prestadorConsultaCombo.addItem( prestadoresConsultas[ n ] );
}
JLabel prestadorEcdsLabel = new JLabel( "ECDs" );
prestadorEcdsCombo = new JComboBox();
IDObject[] prestadoresEcds = prestadoresProvider.getPrestadoresECDsActivos();
prestadorEcdsCombo.addItem( prestadorDefaultGeral );
for( int n = 0; n < prestadoresEcds.length; n++ )
{
prestadorEcdsCombo.addItem( prestadoresEcds[ n ] );
}
JPanel prestadoresPanel = new JPanel();
prestadoresPanel.setBorder( BorderFactory.createTitledBorder(
BorderFactory.createEtchedBorder(), "Prestadores" ) );
GridBagLayout gridbag = new GridBagLayout();
dadosEstabelecimentoPanel.setLayout( gridbag );
@ -189,15 +246,21 @@ public class EstabelecimentoPanel extends JPanel
constraints.gridwidth = 1;
constraints.gridheight = GridBagConstraints.REMAINDER;
gridbag.setConstraints( historicoPanel, constraints );
constraints.weightx = 0.5;
constraints.weightx = 0.25;
constraints.weighty = 1;
constraints.gridheight = GridBagConstraints.REMAINDER;
constraints.gridwidth = GridBagConstraints.REMAINDER;
constraints.gridwidth = 1;
gridbag.setConstraints( observacoesScp, constraints );
constraints.weightx = 0.25;
constraints.weighty = 1;
constraints.gridheight = GridBagConstraints.REMAINDER;
constraints.gridwidth = GridBagConstraints.REMAINDER;;
gridbag.setConstraints( prestadoresPanel, constraints );
add( dadosEstabelecimentoPanel );
add( contactoPanel );
add( historicoPanel );
add( observacoesScp );
add( prestadoresPanel );
listaHistoricoPanel = new JPanel();
listaHistoricoPanel.setLayout( new GridLayout( 1, 1 ) );
@ -239,6 +302,19 @@ public class EstabelecimentoPanel extends JPanel
}
} );
TableLayout prestadoresLayout =
new TableLayout( new double[]{ TableLayoutConstraints.FILL },
new double[]{ TableLayoutConstraints.PREFERRED, TableLayoutConstraints.PREFERRED,
TableLayoutConstraints.PREFERRED, TableLayoutConstraints.PREFERRED,
TableLayoutConstraints.FILL } );
prestadoresLayout.setHGap( 1 );
prestadoresLayout.setVGap( 1 );
prestadoresPanel.setLayout( prestadoresLayout );
prestadoresPanel.add( prestadorConsultaLabel, new TableLayoutConstraints( 0, 0 ) );
prestadoresPanel.add( prestadorConsultaCombo, new TableLayoutConstraints( 0, 1 ) );
prestadoresPanel.add( prestadorEcdsLabel, new TableLayoutConstraints( 0, 2 ) );
prestadoresPanel.add( prestadorEcdsCombo, new TableLayoutConstraints( 0, 3 ) );
new CopyPasteHandler( designacaoText );
new CopyPasteHandler( moradaText );
new CopyPasteHandler( localText );
@ -255,6 +331,8 @@ public class EstabelecimentoPanel extends JPanel
components.putComponent( EstabelecimentoData.CONTACTO, contactoPanel );
// components.putComponent( EstabelecimentoData.HISTORICO, historicoText );
components.putComponent( EstabelecimentoData.HISTORICO, historicoText );
components.putComponent( EstabelecimentoData.PRESTADOR_CONSULTA_ID, prestadorConsultaCombo );
components.putComponent( EstabelecimentoData.PRESTADOR_ECDS_ID, prestadorEcdsCombo );
components.putDummy( EstabelecimentoData.EMPRESA );
components.putDummy( EstabelecimentoData.NOME_PLAIN );
// components.putDummy( EstabelecimentoData.INACTIVO );
@ -264,6 +342,7 @@ public class EstabelecimentoPanel extends JPanel
{
String names[] = (String[])components.keySet().toArray( new String[0] );
ComponentController.clear( names, components );
// prestadorConsultaCombo.setSelectedIndex( 1 );
clearHistorico();
estabelecimento = null;
}

@ -23,6 +23,8 @@ public final class Estabelecimento implements JDOInnerObject
private Contacto contacto;
private String inactivo;
private Date actualizacao;
private Integer prestador_consulta_id;
private Integer prestador_ecds_id;
public Estabelecimento()
{
@ -74,6 +76,14 @@ public final class Estabelecimento implements JDOInnerObject
{
return actualizacao;
}
else if( fieldName == EstabelecimentoData.PRESTADOR_CONSULTA_ID )
{
return prestador_consulta_id;
}
else if( fieldName == EstabelecimentoData.PRESTADOR_ECDS_ID )
{
return prestador_ecds_id;
}
else if( fieldName.equals( EstabelecimentoData.ID ) )
{
return id;
@ -118,6 +128,14 @@ public final class Estabelecimento implements JDOInnerObject
{
return actualizacao;
}
else if( fieldName.equals( EstabelecimentoData.PRESTADOR_CONSULTA_ID ) )
{
return prestador_consulta_id;
}
else if( fieldName.equals( EstabelecimentoData.PRESTADOR_ECDS_ID ) )
{
return prestador_ecds_id;
}
return null;
}
@ -167,6 +185,14 @@ public final class Estabelecimento implements JDOInnerObject
{
actualizacao = ( Date ) value;
}
else if( fieldName == EstabelecimentoData.PRESTADOR_CONSULTA_ID )
{
prestador_consulta_id = ( Integer ) value;
}
else if( fieldName == EstabelecimentoData.PRESTADOR_ECDS_ID )
{
prestador_ecds_id = ( Integer ) value;
}
else if( fieldName.equals( EstabelecimentoData.ID ) )
{
id = ( Integer ) value;
@ -211,6 +237,14 @@ public final class Estabelecimento implements JDOInnerObject
{
actualizacao = ( Date ) value;
}
else if( fieldName.equals( EstabelecimentoData.PRESTADOR_CONSULTA_ID ) )
{
prestador_consulta_id = ( Integer ) value;
}
else if( fieldName.equals( EstabelecimentoData.PRESTADOR_ECDS_ID ) )
{
prestador_ecds_id = ( Integer ) value;
}
}
public Class getOuterClass()

@ -24,14 +24,16 @@ public final class EstabelecimentoData extends JDOObject
public static final String CONTACTO = "contacto";
public static final String INACTIVO = "inactivo";
public static final String ACTUALIZACAO = "actualizacao";
public static final String PRESTADOR_CONSULTA_ID = "prestador_consulta_id";
public static final String PRESTADOR_ECDS_ID = "prestador_ecds_id";
public static final String FIELD_NAMES[] = new String[]{
NOME, NOME_PLAIN, MORADA, CODIGO_POSTAL, LOCALIDADE, HISTORICO, EMPRESA, CONTACTO, };
NOME, NOME_PLAIN, MORADA, CODIGO_POSTAL, LOCALIDADE, HISTORICO, EMPRESA, CONTACTO, PRESTADOR_CONSULTA_ID, PRESTADOR_ECDS_ID };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, NOME, NOME_PLAIN, MORADA, CODIGO_POSTAL, LOCALIDADE, HISTORICO, EMPRESA, CONTACTO,
INACTIVO, ACTUALIZACAO, };
PRESTADOR_CONSULTA_ID, PRESTADOR_ECDS_ID, INACTIVO, ACTUALIZACAO, };
private HashMap dataHash;

@ -404,7 +404,7 @@
</field>
<field name="contacto">
<extension vendor-name="jpox" key="column-name" value="contacto"/>
<extension vendor-name="jpox" key="column-name" value="contacto_id"/>
<extension vendor-name="evolute" key="java-type" value="Contacto"/>
</field>
@ -417,12 +417,22 @@
<extension vendor-name="evolute" key="java-type" value="String"/>
</field>
<field name="actualizacao" null-value="default">
<field name="actualizacao" null-value="default">
<extension vendor-name="jpox" key="column-name" value="actualizacao"/>
<extension vendor-name="evolute" key="visible" value="false"/>
<extension vendor-name="evolute" key="java-type" value="Date"/>
</field>
<field name="prestador_consulta_id" null-value="default">
<extension vendor-name="jpox" key="column-name" value="prestador_consulta_id"/>
<extension vendor-name="evolute" key="java-type" value="Integer"/>
</field>
<field name="prestador_ecds_id" null-value="default">
<extension vendor-name="jpox" key="column-name" value="prestador_ecds_id"/>
<extension vendor-name="evolute" key="java-type" value="Integer"/>
</field>
</class>
<!-- TRABALHADOR -->
<class name="Trabalhador" identity-type="application" objectid-class="siprp.data.TrabalhadorID">

@ -0,0 +1,120 @@
package siprp.ficha;
import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Window;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import com.evolute.utils.dataui.ControllableComponent;
class FichaMainPanel extends JPanel
implements ControllableComponent
{
protected Window owner;
private UpperPanel upperPanel;
private EmpresaPanel empresaPanel;
private TrabalhadorPanel trabalhadorPanel;
private ObservacoesPanel observacoesPanel;
private ExamePanel examePanel;
public FichaMainPanel( Window owner )
{
this.owner = owner;
}
private void setupComponents()
throws Exception
{
upperPanel = new UpperPanel();
JTabbedPane tabbedPane = new JTabbedPane();
setLayout( new BorderLayout( ) );
add( upperPanel, BorderLayout.NORTH );
add( tabbedPane, BorderLayout.CENTER );
JPanel empresaTrabalhadorPanel = new JPanel();
JPanel exameRecomendacoesPanel = new JPanel();
tabbedPane.add( empresaTrabalhadorPanel, "Empresa/Trabalhador" );
tabbedPane.add( exameRecomendacoesPanel, "Exame" );
GridBagLayout gridbag = new GridBagLayout();
empresaTrabalhadorPanel.setLayout( gridbag );
GridBagConstraints constraints = new GridBagConstraints();
constraints.insets = new Insets( 0, 1, 0, 1 );
constraints.fill = GridBagConstraints.BOTH;
constraints.weightx = 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
constraints.gridheight = 1;
constraints.weighty = 0;
empresaPanel = new EmpresaPanel();
empresaPanel.setEnabled( false );
gridbag.setConstraints( empresaPanel, constraints );
empresaTrabalhadorPanel.add( empresaPanel );
constraints.weighty = 0;
trabalhadorPanel = new TrabalhadorPanel();
gridbag.setConstraints( trabalhadorPanel, constraints );
empresaTrabalhadorPanel.add( trabalhadorPanel );
constraints.weighty = 1;
observacoesPanel = new ObservacoesPanel();
gridbag.setConstraints( observacoesPanel, constraints );
empresaTrabalhadorPanel.add( observacoesPanel );
gridbag = new GridBagLayout();
exameRecomendacoesPanel.setLayout( gridbag );
constraints = new GridBagConstraints();
constraints.insets = new Insets( 0, 1, 0, 1 );
constraints.fill = GridBagConstraints.BOTH;
constraints.weightx = 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
constraints.gridheight = 1;
constraints.weighty = 0;
constraints.weighty = 1;
examePanel = new ExamePanel();
gridbag.setConstraints( examePanel, constraints );
exameRecomendacoesPanel.add( examePanel );
}
@Override
public void clear()
{
// TODO Auto-generated method stub
}
@Override
public void setEnabled( boolean enable )
{
// TODO Auto-generated method stub
}
@Override
public void fill( Object value )
{
// TODO Auto-generated method stub
}
@Override
public Object save()
{
// TODO Auto-generated method stub
return null;
}
}

@ -255,6 +255,9 @@ public class FichaWindow extends TabbedWindow
JOptionPane.showMessageDialog( this, msg.toString(), "Erro...", JOptionPane.ERROR_MESSAGE );
return false;
}
String observacoes = ( String ) observacoesPanel.save();
estabelecimento.set( EstabelecimentoData.NOME_PLAIN,
com.evolute.utils.strings.StringPlainer.convertString( ( String )
estabelecimento.get( EstabelecimentoData.NOME ) ) );
@ -262,7 +265,7 @@ public class FichaWindow extends TabbedWindow
// trabalhador.setProperty( FichaDataProvider.R_TRABALHADOR_ESTABELECIMENTO, estabelecimento );
// trabalhador.setProperty( FichaDataProvider.OBSERVACOES, observacoesPanel.save() );
trabalhador.set( TrabalhadorData.ESTABELECIMENTO, estabelecimento );
trabalhador.set( TrabalhadorData.OBSERVACOES, observacoesPanel.save() );
trabalhador.set( TrabalhadorData.OBSERVACOES, observacoes );
trabalhador.set( TrabalhadorData.NOME_PLAIN,
com.evolute.utils.strings.StringPlainer.convertString( ( String )
trabalhador.get( TrabalhadorData.NOME ) ) );

Loading…
Cancel
Save