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

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Tiago Simão 18 years ago
parent 7699efba68
commit bfdcd1cd26

@ -22,6 +22,9 @@
<db-attribute name="nome" type="VARCHAR" length="255"/>
<db-attribute name="telefone" type="VARCHAR" length="255"/>
<db-attribute name="telemovel" type="VARCHAR" length="255"/>
<db-key-generator>
<db-generator-type>ORACLE</db-generator-type>
</db-key-generator>
</db-entity>
<db-entity name="ecd_oficial" schema="public">
<db-attribute name="activo" type="CHAR" length="1"/>
@ -90,7 +93,8 @@
<db-entity name="estabelecimentos" schema="public">
<db-attribute name="actualizacao" type="TIMESTAMP" length="29"/>
<db-attribute name="codigo_postal" type="VARCHAR" length="255"/>
<db-attribute name="contacto" type="VARCHAR" length="255"/>
<db-attribute name="contacto_backup" type="VARCHAR" length="255"/>
<db-attribute name="contacto_id" type="INTEGER" length="10"/>
<db-attribute name="empresa_id" type="INTEGER" isMandatory="true" length="10"/>
<db-attribute name="historico" type="VARCHAR" length="65535"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
@ -100,6 +104,8 @@
<db-attribute name="morada" type="VARCHAR" length="255"/>
<db-attribute name="nome" type="VARCHAR" isMandatory="true" length="255"/>
<db-attribute name="nome_plain" type="VARCHAR" length="255"/>
<db-attribute name="prestador_consulta_id" type="INTEGER" length="10"/>
<db-attribute name="prestador_ecds_id" type="INTEGER" length="10"/>
</db-entity>
<db-entity name="etiquetas" schema="public">
<db-attribute name="altura" type="REAL" length="8" scale="8"/>
@ -400,9 +406,12 @@
<db-attribute name="ecd_oficial_id" type="INTEGER" length="10"/>
<db-attribute name="estado" type="INTEGER" length="10"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="prestador_id" type="INTEGER" length="10"/>
<db-attribute name="trabalhadores_ecds_datas_id" type="INTEGER" length="10"/>
<db-attribute name="trabalhadores_ecds_id" type="INTEGER" length="10"/>
<db-key-generator>
<db-generator-type>ORACLE</db-generator-type>
<db-generator-name>trabalhadores_ecd_id_seq</db-generator-name>
<db-key-cache-size>1</db-key-cache-size>
</db-key-generator>
</db-entity>
<db-entity name="trabalhadores_ecds" schema="public">
<db-attribute name="data" type="DATE" length="13"/>
@ -475,26 +484,29 @@
<db-key-cache-size>1</db-key-cache-size>
</db-key-generator>
</db-entity>
<obj-entity name="Avisos" className="siprp.database.cayenne.objects.Avisos" dbEntityName="avisos">
<obj-entity name="Avisos" className="siprp.database.cayenne.objects.Avisos" dbEntityName="avisos" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="dataAviso" type="java.util.Date" db-attribute-path="data_aviso"/>
<obj-attribute name="dataEvento" type="java.util.Date" db-attribute-path="data_evento"/>
<obj-attribute name="descricao" type="java.lang.String" db-attribute-path="descricao"/>
<obj-attribute name="eventoId" type="java.lang.Integer" db-attribute-path="evento_id"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="tipo" type="java.lang.Integer" db-attribute-path="tipo"/>
<obj-attribute name="trabalhadorId" type="java.lang.Integer" db-attribute-path="trabalhador_id"/>
</obj-entity>
<obj-entity name="Contactos" className="siprp.database.cayenne.objects.Contactos" dbEntityName="contactos">
<obj-entity name="Contactos" className="siprp.database.cayenne.objects.Contactos" dbEntityName="contactos" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="cargo" type="java.lang.String" db-attribute-path="cargo"/>
<obj-attribute name="email" type="java.lang.String" db-attribute-path="email"/>
<obj-attribute name="fax" type="java.lang.String" db-attribute-path="fax"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="nome" type="java.lang.String" db-attribute-path="nome"/>
<obj-attribute name="telefone" type="java.lang.String" db-attribute-path="telefone"/>
<obj-attribute name="telemovel" type="java.lang.String" db-attribute-path="telemovel"/>
</obj-entity>
<obj-entity name="EcdOficial" className="siprp.database.cayenne.objects.EcdOficial" dbEntityName="ecd_oficial">
<obj-entity name="EcdOficial" className="siprp.database.cayenne.objects.EcdOficial" dbEntityName="ecd_oficial" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="activo" type="java.lang.String" db-attribute-path="activo"/>
<obj-attribute name="descricao" type="java.lang.String" db-attribute-path="descricao"/>
<obj-attribute name="descricaoPlain" type="java.lang.String" db-attribute-path="descricao_plain"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="ordem" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="Empresas" className="siprp.database.cayenne.objects.Empresas" dbEntityName="empresas" superClassName="siprp.database.cayenne.objects.BaseObject">
@ -540,16 +552,17 @@
<obj-attribute name="servicoSaudeTipo" type="java.lang.Integer" db-attribute-path="servico_saude_tipo"/>
<obj-attribute name="servicos" type="java.lang.Integer" db-attribute-path="servicos"/>
</obj-entity>
<obj-entity name="Errors" className="siprp.database.cayenne.objects.Errors" dbEntityName="errors">
<obj-entity name="Errors" className="siprp.database.cayenne.objects.Errors" dbEntityName="errors" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="date" type="java.util.Date" db-attribute-path="date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="environment" type="java.lang.String" db-attribute-path="environment"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="type" type="java.lang.String" db-attribute-path="type"/>
</obj-entity>
<obj-entity name="Estabelecimentos" className="siprp.database.cayenne.objects.Estabelecimentos" dbEntityName="estabelecimentos" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="actualizacao" type="java.util.Date" db-attribute-path="actualizacao"/>
<obj-attribute name="codigoPostal" type="java.lang.String" db-attribute-path="codigo_postal"/>
<obj-attribute name="contacto" type="java.lang.String" db-attribute-path="contacto"/>
<obj-attribute name="contactoBackup" type="java.lang.String" db-attribute-path="contacto_backup"/>
<obj-attribute name="historico" type="java.lang.String" db-attribute-path="historico"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="inactivo" type="java.lang.String" db-attribute-path="inactivo"/>
@ -558,13 +571,14 @@
<obj-attribute name="nome" type="java.lang.String" db-attribute-path="nome"/>
<obj-attribute name="nomePlain" type="java.lang.String" db-attribute-path="nome_plain"/>
</obj-entity>
<obj-entity name="Etiquetas" className="siprp.database.cayenne.objects.Etiquetas" dbEntityName="etiquetas">
<obj-entity name="Etiquetas" className="siprp.database.cayenne.objects.Etiquetas" dbEntityName="etiquetas" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="altura" type="java.lang.Float" db-attribute-path="altura"/>
<obj-attribute name="alturaFolha" type="java.lang.Float" db-attribute-path="altura_folha"/>
<obj-attribute name="colunas" type="java.lang.Integer" db-attribute-path="colunas"/>
<obj-attribute name="continua" type="java.lang.String" db-attribute-path="continua"/>
<obj-attribute name="descricao" type="java.lang.String" db-attribute-path="descricao"/>
<obj-attribute name="descricaoPlain" type="java.lang.String" db-attribute-path="descricao_plain"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="largura" type="java.lang.Float" db-attribute-path="largura"/>
<obj-attribute name="larguraFolha" type="java.lang.Float" db-attribute-path="largura_folha"/>
<obj-attribute name="linhas" type="java.lang.Integer" db-attribute-path="linhas"/>
@ -573,9 +587,10 @@
<obj-attribute name="margemHorizontalFolha" type="java.lang.Float" db-attribute-path="margem_horizontal_folha"/>
<obj-attribute name="margemVerticalFolha" type="java.lang.Float" db-attribute-path="margem_vertical_folha"/>
</obj-entity>
<obj-entity name="Exames" className="siprp.database.cayenne.objects.Exames" dbEntityName="exames">
<obj-entity name="Exames" className="siprp.database.cayenne.objects.Exames" dbEntityName="exames" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="fo" type="byte[]" db-attribute-path="fo"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="inactivo" type="java.lang.String" db-attribute-path="inactivo"/>
<obj-attribute name="ocasional" type="java.lang.Integer" db-attribute-path="ocasional"/>
<obj-attribute name="outraFuncao1" type="java.lang.String" db-attribute-path="outra_funcao_1"/>
@ -590,107 +605,123 @@
<obj-attribute name="tipo" type="java.lang.Integer" db-attribute-path="tipo"/>
<obj-attribute name="trabalhadorId" type="java.lang.Integer" db-attribute-path="trabalhador_id"/>
</obj-entity>
<obj-entity name="ExamesPerfis" className="siprp.database.cayenne.objects.ExamesPerfis" dbEntityName="exames_perfis">
<obj-entity name="ExamesPerfis" className="siprp.database.cayenne.objects.ExamesPerfis" dbEntityName="exames_perfis" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="multiplicador" type="java.lang.Integer" db-attribute-path="multiplicador"/>
<obj-attribute name="perfil" type="java.lang.Integer" db-attribute-path="perfil"/>
</obj-entity>
<obj-entity name="ExamesPortaria" className="siprp.database.cayenne.objects.ExamesPortaria" dbEntityName="exames_portaria">
<obj-entity name="ExamesPortaria" className="siprp.database.cayenne.objects.ExamesPortaria" dbEntityName="exames_portaria" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="dataEntrada" type="java.util.Date" db-attribute-path="data_entrada"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="portaria" type="java.lang.String" db-attribute-path="portaria"/>
</obj-entity>
<obj-entity name="HistoricoEstabelecimento" className="siprp.database.cayenne.objects.HistoricoEstabelecimento" dbEntityName="historico_estabelecimento">
<obj-entity name="HistoricoEstabelecimento" className="siprp.database.cayenne.objects.HistoricoEstabelecimento" dbEntityName="historico_estabelecimento" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="texto" type="java.lang.String" db-attribute-path="texto"/>
</obj-entity>
<obj-entity name="Ids" className="siprp.database.cayenne.objects.Ids" dbEntityName="ids">
<obj-entity name="Ids" className="siprp.database.cayenne.objects.Ids" dbEntityName="ids" superClassName="siprp.database.cayenne.objects.BaseObject">
</obj-entity>
<obj-entity name="Lembretes" className="siprp.database.cayenne.objects.Lembretes" dbEntityName="lembretes">
<obj-entity name="Lembretes" className="siprp.database.cayenne.objects.Lembretes" dbEntityName="lembretes" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="descricao" type="java.lang.String" db-attribute-path="descricao"/>
<obj-attribute name="enviarEmail" type="java.lang.String" db-attribute-path="enviar_email"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="periodicidadeDias" type="java.lang.Integer" db-attribute-path="periodicidade_dias"/>
<obj-attribute name="periodicidadeMeses" type="java.lang.Integer" db-attribute-path="periodicidade_meses"/>
<obj-attribute name="texto" type="java.lang.String" db-attribute-path="texto"/>
<obj-attribute name="ultimoEnvio" type="java.util.Date" db-attribute-path="ultimo_envio"/>
</obj-entity>
<obj-entity name="LembretesTipos" className="siprp.database.cayenne.objects.LembretesTipos" dbEntityName="lembretes_tipos">
<obj-entity name="LembretesTipos" className="siprp.database.cayenne.objects.LembretesTipos" dbEntityName="lembretes_tipos" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="activo" type="java.lang.String" db-attribute-path="activo"/>
<obj-attribute name="codigo" type="java.lang.String" db-attribute-path="codigo"/>
<obj-attribute name="descricao" type="java.lang.String" db-attribute-path="descricao"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="ordem" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="MarcacoesEmpresa" className="siprp.database.cayenne.objects.MarcacoesEmpresa" dbEntityName="marcacoes_empresa">
<obj-entity name="MarcacoesEmpresa" className="siprp.database.cayenne.objects.MarcacoesEmpresa" dbEntityName="marcacoes_empresa" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="realizada" type="java.lang.String" db-attribute-path="realizada"/>
<obj-attribute name="texto" type="java.lang.String" db-attribute-path="texto"/>
</obj-entity>
<obj-entity name="MarcacoesEstabelecimento" className="siprp.database.cayenne.objects.MarcacoesEstabelecimento" dbEntityName="marcacoes_estabelecimento">
<obj-entity name="MarcacoesEstabelecimento" className="siprp.database.cayenne.objects.MarcacoesEstabelecimento" dbEntityName="marcacoes_estabelecimento" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="dataEmail" type="java.util.Date" db-attribute-path="data_email"/>
<obj-attribute name="dataRelatorio" type="java.util.Date" db-attribute-path="data_relatorio"/>
<obj-attribute name="estado" type="java.lang.Integer" db-attribute-path="estado"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="observacoes" type="java.lang.String" db-attribute-path="observacoes"/>
<obj-attribute name="realizada" type="java.lang.String" db-attribute-path="realizada"/>
</obj-entity>
<obj-entity name="MarcacoesGruposRealizados" className="siprp.database.cayenne.objects.MarcacoesGruposRealizados" dbEntityName="marcacoes_grupos_realizados">
<obj-entity name="MarcacoesGruposRealizados" className="siprp.database.cayenne.objects.MarcacoesGruposRealizados" dbEntityName="marcacoes_grupos_realizados" superClassName="siprp.database.cayenne.objects.BaseObject">
</obj-entity>
<obj-entity name="MarcacoesTecnicosHst" className="siprp.database.cayenne.objects.MarcacoesTecnicosHst" dbEntityName="marcacoes_tecnicos_hst">
<obj-entity name="MarcacoesTecnicosHst" className="siprp.database.cayenne.objects.MarcacoesTecnicosHst" dbEntityName="marcacoes_tecnicos_hst" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="identificador" type="java.lang.Integer" db-attribute-path="identificador"/>
<obj-attribute name="inactivo" type="java.lang.String" db-attribute-path="inactivo"/>
<obj-attribute name="iniciais" type="java.lang.String" db-attribute-path="iniciais"/>
<obj-attribute name="nome" type="java.lang.String" db-attribute-path="nome"/>
<obj-attribute name="nomePlain" type="java.lang.String" db-attribute-path="nome_plain"/>
</obj-entity>
<obj-entity name="MarcacoesTrabalhador" className="siprp.database.cayenne.objects.MarcacoesTrabalhador" dbEntityName="marcacoes_trabalhador">
<obj-entity name="MarcacoesTrabalhador" className="siprp.database.cayenne.objects.MarcacoesTrabalhador" dbEntityName="marcacoes_trabalhador" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="dataEmail" type="java.util.Date" db-attribute-path="data_email"/>
<obj-attribute name="dataRelatorio" type="java.util.Date" db-attribute-path="data_relatorio"/>
<obj-attribute name="estado" type="java.lang.Integer" db-attribute-path="estado"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="motivo" type="java.lang.Integer" db-attribute-path="motivo"/>
<obj-attribute name="observacoes" type="java.lang.String" db-attribute-path="observacoes"/>
<obj-attribute name="realizada" type="java.lang.String" db-attribute-path="realizada"/>
<obj-attribute name="tipo" type="java.lang.Integer" db-attribute-path="tipo"/>
<obj-attribute name="trabalhadorId" type="java.lang.Integer" db-attribute-path="trabalhador_id"/>
</obj-entity>
<obj-entity name="MarcacoesTrabalhadorEstados" className="siprp.database.cayenne.objects.MarcacoesTrabalhadorEstados" dbEntityName="marcacoes_trabalhador_estados">
<obj-entity name="MarcacoesTrabalhadorEstados" className="siprp.database.cayenne.objects.MarcacoesTrabalhadorEstados" dbEntityName="marcacoes_trabalhador_estados" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="estado" type="java.lang.Integer" db-attribute-path="estado"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
</obj-entity>
<obj-entity name="Medicos" className="siprp.database.cayenne.objects.Medicos" dbEntityName="medicos">
<obj-entity name="Medicos" className="siprp.database.cayenne.objects.Medicos" dbEntityName="medicos" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="inactivo" type="java.lang.String" db-attribute-path="inactivo"/>
<obj-attribute name="nome" type="java.lang.String" db-attribute-path="nome"/>
<obj-attribute name="numeroCedula" type="java.lang.String" db-attribute-path="numero_cedula"/>
</obj-entity>
<obj-entity name="Prestadores" className="siprp.database.cayenne.objects.Prestadores" dbEntityName="prestadores">
<obj-entity name="Prestadores" className="siprp.database.cayenne.objects.Prestadores" dbEntityName="prestadores" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="activo" type="java.lang.String" db-attribute-path="activo"/>
<obj-attribute name="codigoPostal" type="java.lang.String" db-attribute-path="codigo_postal"/>
<obj-attribute name="contribuinte" type="java.lang.String" db-attribute-path="contribuinte"/>
<obj-attribute name="fazConsultas" type="java.lang.String" db-attribute-path="faz_consultas"/>
<obj-attribute name="fazEcds" type="java.lang.String" db-attribute-path="faz_ecds"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="localidade" type="java.lang.String" db-attribute-path="localidade"/>
<obj-attribute name="localidadeCp" type="java.lang.String" db-attribute-path="localidade_cp"/>
<obj-attribute name="morada" type="java.lang.String" db-attribute-path="morada"/>
<obj-attribute name="nome" type="java.lang.String" db-attribute-path="nome"/>
<obj-attribute name="nomePlain" type="java.lang.String" db-attribute-path="nome_plain"/>
</obj-entity>
<obj-entity name="PrestadoresGruposProtocolo" className="siprp.database.cayenne.objects.PrestadoresGruposProtocolo" dbEntityName="prestadores_grupos_protocolo">
<obj-entity name="PrestadoresGruposProtocolo" className="siprp.database.cayenne.objects.PrestadoresGruposProtocolo" dbEntityName="prestadores_grupos_protocolo" superClassName="siprp.database.cayenne.objects.BaseObject">
</obj-entity>
<obj-entity name="PrtElementosProtocolo" className="siprp.database.cayenne.objects.PrtElementosProtocolo" dbEntityName="prt_elementos_protocolo">
<obj-entity name="PrtElementosProtocolo" className="siprp.database.cayenne.objects.PrtElementosProtocolo" dbEntityName="prt_elementos_protocolo" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="numeroPerfil" type="java.lang.Integer" db-attribute-path="numero_perfil"/>
</obj-entity>
<obj-entity name="PrtGruposProtocolo" className="siprp.database.cayenne.objects.PrtGruposProtocolo" dbEntityName="prt_grupos_protocolo">
<obj-entity name="PrtGruposProtocolo" className="siprp.database.cayenne.objects.PrtGruposProtocolo" dbEntityName="prt_grupos_protocolo" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="descricao" type="java.lang.String" db-attribute-path="descricao"/>
<obj-attribute name="descricaoPlain" type="java.lang.String" db-attribute-path="descricao_plain"/>
<obj-attribute name="grupoReal" type="java.lang.String" db-attribute-path="grupo_real"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="ordem" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="PrtTiposElementosProtocolo" className="siprp.database.cayenne.objects.PrtTiposElementosProtocolo" dbEntityName="prt_tipos_elementos_protocolo">
<obj-entity name="PrtTiposElementosProtocolo" className="siprp.database.cayenne.objects.PrtTiposElementosProtocolo" dbEntityName="prt_tipos_elementos_protocolo" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="descricao" type="java.lang.String" db-attribute-path="descricao"/>
<obj-attribute name="descricaoPlain" type="java.lang.String" db-attribute-path="descricao_plain"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="ordem" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="TiposExamesComp" className="siprp.database.cayenne.objects.TiposExamesComp" dbEntityName="tipos_exames_comp">
<obj-entity name="TiposExamesComp" className="siprp.database.cayenne.objects.TiposExamesComp" dbEntityName="tipos_exames_comp" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="descricao" type="java.lang.String" db-attribute-path="descricao"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="ordem" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="Trabalhadores" className="siprp.database.cayenne.objects.Trabalhadores" dbEntityName="trabalhadores" superClassName="siprp.database.cayenne.objects.BaseObject">
@ -740,21 +771,26 @@
<obj-entity name="TrabalhadoresEcds" className="siprp.database.cayenne.objects.TrabalhadoresEcds" dbEntityName="trabalhadores_ecds" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="estado" type="java.lang.Integer" db-attribute-path="estado"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
</obj-entity>
<obj-entity name="TrabalhadoresEcdsDatas" className="siprp.database.cayenne.objects.TrabalhadoresEcdsDatas" dbEntityName="trabalhadores_ecds_datas" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="estado" type="java.lang.Integer" db-attribute-path="estado"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
</obj-entity>
<obj-entity name="TrabalhadoresEcdsDatasEmails" className="siprp.database.cayenne.objects.TrabalhadoresEcdsDatasEmails" dbEntityName="trabalhadores_ecds_datas_emails" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="body" type="java.lang.String" db-attribute-path="body"/>
<obj-attribute name="data" type="java.util.Date" db-attribute-path="data"/>
<obj-attribute name="destination" type="java.lang.String" db-attribute-path="destination"/>
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="subject" type="java.lang.String" db-attribute-path="subject"/>
</obj-entity>
<obj-entity name="TrabalhadoresEcdsDatasObservacoes" className="siprp.database.cayenne.objects.TrabalhadoresEcdsDatasObservacoes" dbEntityName="trabalhadores_ecds_datas_observacoes" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="observacao" type="java.lang.String" db-attribute-path="observacao"/>
</obj-entity>
<obj-entity name="TrabalhadoresFichasAptidao" className="siprp.database.cayenne.objects.TrabalhadoresFichasAptidao" dbEntityName="trabalhadores_fichas_aptidao" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
</obj-entity>
<obj-entity name="TrabalhadoresProcesso" className="siprp.database.cayenne.objects.TrabalhadoresProcesso" dbEntityName="trabalhadores_processo" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="dataFim" type="java.util.Date" db-attribute-path="data_fim"/>
@ -776,6 +812,9 @@
<db-relationship name="empresasArray1" source="contactos" target="empresas" toMany="true">
<db-attribute-pair source="id" target="contacto_2"/>
</db-relationship>
<db-relationship name="estabelecimentosArray" source="contactos" target="estabelecimentos" toMany="true">
<db-attribute-pair source="id" target="contacto_id"/>
</db-relationship>
<db-relationship name="prestadoresArray" source="contactos" target="prestadores" toMany="true">
<db-attribute-pair source="id" target="contacto_id"/>
</db-relationship>
@ -815,12 +854,21 @@
<db-relationship name="marcacoesEstabelecimentoArray" source="estabelecimentos" target="marcacoes_estabelecimento" toMany="true">
<db-attribute-pair source="id" target="estabelecimento_id"/>
</db-relationship>
<db-relationship name="toContactos" source="estabelecimentos" target="contactos" toMany="false">
<db-attribute-pair source="contacto_id" target="id"/>
</db-relationship>
<db-relationship name="toEmpresas" source="estabelecimentos" target="empresas" toMany="false">
<db-attribute-pair source="empresa_id" target="id"/>
</db-relationship>
<db-relationship name="toMedicos" source="estabelecimentos" target="medicos" toMany="false">
<db-attribute-pair source="medico_id" target="id"/>
</db-relationship>
<db-relationship name="toPrestadores" source="estabelecimentos" target="prestadores" toMany="false">
<db-attribute-pair source="prestador_consulta_id" target="id"/>
</db-relationship>
<db-relationship name="toPrestadores1" source="estabelecimentos" target="prestadores" toMany="false">
<db-attribute-pair source="prestador_ecds_id" target="id"/>
</db-relationship>
<db-relationship name="trabalhadoresArray" source="estabelecimentos" target="trabalhadores" toMany="true">
<db-attribute-pair source="id" target="estabelecimento_id"/>
</db-relationship>
@ -908,6 +956,12 @@
<db-relationship name="examesArray" source="medicos" target="exames" toMany="true">
<db-attribute-pair source="id" target="medico_id"/>
</db-relationship>
<db-relationship name="estabelecimentosArray" source="prestadores" target="estabelecimentos" toMany="true">
<db-attribute-pair source="id" target="prestador_consulta_id"/>
</db-relationship>
<db-relationship name="estabelecimentosArray1" source="prestadores" target="estabelecimentos" toMany="true">
<db-attribute-pair source="id" target="prestador_ecds_id"/>
</db-relationship>
<db-relationship name="marcacoesTrabalhadorArray" source="prestadores" target="marcacoes_trabalhador" toMany="true">
<db-attribute-pair source="id" target="prestador_id"/>
</db-relationship>
@ -926,9 +980,6 @@
<db-relationship name="trabalhadoresConsultasDatasArray" source="prestadores" target="trabalhadores_consultas_datas" toMany="true">
<db-attribute-pair source="id" target="prestador_id"/>
</db-relationship>
<db-relationship name="trabalhadoresEcdArray" source="prestadores" target="trabalhadores_ecd" toMany="true">
<db-attribute-pair source="id" target="prestador_id"/>
</db-relationship>
<db-relationship name="trabalhadoresEcdsDatasArray" source="prestadores" target="trabalhadores_ecds_datas" toMany="true">
<db-attribute-pair source="id" target="prestador_id"/>
</db-relationship>
@ -1013,15 +1064,9 @@
<db-relationship name="toEcdOficial" source="trabalhadores_ecd" target="ecd_oficial" toMany="false">
<db-attribute-pair source="ecd_oficial_id" target="id"/>
</db-relationship>
<db-relationship name="toPrestadores" source="trabalhadores_ecd" target="prestadores" toMany="false">
<db-attribute-pair source="prestador_id" target="id"/>
</db-relationship>
<db-relationship name="toPrtTiposElementosProtocolo" source="trabalhadores_ecd" target="prt_tipos_elementos_protocolo" toMany="false">
<db-attribute-pair source="ecd_id" target="id"/>
</db-relationship>
<db-relationship name="toTrabalhadoresEcds" source="trabalhadores_ecd" target="trabalhadores_ecds" toMany="false">
<db-attribute-pair source="trabalhadores_ecds_id" target="id"/>
</db-relationship>
<db-relationship name="toTrabalhadoresEcdsDatas" source="trabalhadores_ecd" target="trabalhadores_ecds_datas" toMany="false">
<db-attribute-pair source="trabalhadores_ecds_datas_id" target="id"/>
</db-relationship>
@ -1031,9 +1076,6 @@
<db-relationship name="toTrabalhadoresProcesso" source="trabalhadores_ecds" target="trabalhadores_processo" toMany="false">
<db-attribute-pair source="processo_id" target="id"/>
</db-relationship>
<db-relationship name="trabalhadoresEcdArray" source="trabalhadores_ecds" target="trabalhadores_ecd" toMany="true">
<db-attribute-pair source="id" target="trabalhadores_ecds_id"/>
</db-relationship>
<db-relationship name="trabalhadoresEcdsDatasArray" source="trabalhadores_ecds" target="trabalhadores_ecds_datas" toMany="true">
<db-attribute-pair source="id" target="trabalhadores_ecds_id"/>
</db-relationship>
@ -1080,6 +1122,7 @@
<obj-relationship name="toEstabelecimentos" source="Avisos" target="Estabelecimentos" db-relationship-path="toEstabelecimentos"/>
<obj-relationship name="empresasArray" source="Contactos" target="Empresas" db-relationship-path="empresasArray"/>
<obj-relationship name="empresasArray1" source="Contactos" target="Empresas" db-relationship-path="empresasArray1"/>
<obj-relationship name="estabelecimentosArray" source="Contactos" target="Estabelecimentos" db-relationship-path="estabelecimentosArray"/>
<obj-relationship name="prestadoresArray" source="Contactos" target="Prestadores" db-relationship-path="prestadoresArray"/>
<obj-relationship name="trabalhadoresEcdArray" source="EcdOficial" target="TrabalhadoresEcd" db-relationship-path="trabalhadoresEcdArray"/>
<obj-relationship name="avisosArray" source="Empresas" target="Avisos" db-relationship-path="avisosArray"/>
@ -1093,8 +1136,11 @@
<obj-relationship name="historicoEstabelecimentoArray" source="Estabelecimentos" target="HistoricoEstabelecimento" db-relationship-path="historicoEstabelecimentoArray"/>
<obj-relationship name="lembretesArray" source="Estabelecimentos" target="Lembretes" db-relationship-path="lembretesArray"/>
<obj-relationship name="marcacoesEstabelecimentoArray" source="Estabelecimentos" target="MarcacoesEstabelecimento" db-relationship-path="marcacoesEstabelecimentoArray"/>
<obj-relationship name="toContactos" source="Estabelecimentos" target="Contactos" db-relationship-path="toContactos"/>
<obj-relationship name="toEmpresas" source="Estabelecimentos" target="Empresas" db-relationship-path="toEmpresas"/>
<obj-relationship name="toMedicos" source="Estabelecimentos" target="Medicos" db-relationship-path="toMedicos"/>
<obj-relationship name="toPrestadores" source="Estabelecimentos" target="Prestadores" db-relationship-path="toPrestadores"/>
<obj-relationship name="toPrestadores1" source="Estabelecimentos" target="Prestadores" db-relationship-path="toPrestadores1"/>
<obj-relationship name="trabalhadoresArray" source="Estabelecimentos" target="Trabalhadores" db-relationship-path="trabalhadoresArray"/>
<obj-relationship name="toMedicos" source="Exames" target="Medicos" db-relationship-path="toMedicos"/>
<obj-relationship name="trabalhadoresFichasAptidaoArray" source="Exames" target="TrabalhadoresFichasAptidao" db-relationship-path="trabalhadoresFichasAptidaoArray"/>
@ -1124,13 +1170,14 @@
<obj-relationship name="toPrestadores" source="MarcacoesTrabalhadorEstados" target="Prestadores" db-relationship-path="toPrestadores"/>
<obj-relationship name="estabelecimentosArray" source="Medicos" target="Estabelecimentos" db-relationship-path="estabelecimentosArray"/>
<obj-relationship name="examesArray" source="Medicos" target="Exames" db-relationship-path="examesArray"/>
<obj-relationship name="estabelecimentosArray" source="Prestadores" target="Estabelecimentos" db-relationship-path="estabelecimentosArray"/>
<obj-relationship name="estabelecimentosArray1" source="Prestadores" target="Estabelecimentos" db-relationship-path="estabelecimentosArray1"/>
<obj-relationship name="marcacoesTrabalhadorArray" source="Prestadores" target="MarcacoesTrabalhador" db-relationship-path="marcacoesTrabalhadorArray"/>
<obj-relationship name="marcacoesTrabalhadorEstadosArray" source="Prestadores" target="MarcacoesTrabalhadorEstados" db-relationship-path="marcacoesTrabalhadorEstadosArray"/>
<obj-relationship name="prestadoresGruposProtocoloArray" source="Prestadores" target="PrestadoresGruposProtocolo" db-relationship-path="prestadoresGruposProtocoloArray"/>
<obj-relationship name="toContactos" source="Prestadores" target="Contactos" db-relationship-path="toContactos"/>
<obj-relationship name="trabalhadoresConsultasArray" source="Prestadores" target="TrabalhadoresConsultas" db-relationship-path="trabalhadoresConsultasArray"/>
<obj-relationship name="trabalhadoresConsultasDatasArray" source="Prestadores" target="TrabalhadoresConsultasDatas" db-relationship-path="trabalhadoresConsultasDatasArray"/>
<obj-relationship name="trabalhadoresEcdArray" source="Prestadores" target="TrabalhadoresEcd" db-relationship-path="trabalhadoresEcdArray"/>
<obj-relationship name="trabalhadoresEcdsDatasArray" source="Prestadores" target="TrabalhadoresEcdsDatas" db-relationship-path="trabalhadoresEcdsDatasArray"/>
<obj-relationship name="toPrestadores" source="PrestadoresGruposProtocolo" target="Prestadores" db-relationship-path="toPrestadores"/>
<obj-relationship name="toPrtGruposProtocolo" source="PrestadoresGruposProtocolo" target="PrtGruposProtocolo" db-relationship-path="toPrtGruposProtocolo"/>
@ -1159,13 +1206,10 @@
<obj-relationship name="toTrabalhadoresConsultasDatas" source="TrabalhadoresConsultasDatasEmails" target="TrabalhadoresConsultasDatas" db-relationship-path="toTrabalhadoresConsultasDatas"/>
<obj-relationship name="toTrabalhadoresConsultasDatas" source="TrabalhadoresConsultasDatasObservacoes" target="TrabalhadoresConsultasDatas" db-relationship-path="toTrabalhadoresConsultasDatas"/>
<obj-relationship name="toEcdOficial" source="TrabalhadoresEcd" target="EcdOficial" db-relationship-path="toEcdOficial"/>
<obj-relationship name="toPrestadores" source="TrabalhadoresEcd" target="Prestadores" db-relationship-path="toPrestadores"/>
<obj-relationship name="toPrtTiposElementosProtocolo" source="TrabalhadoresEcd" target="PrtTiposElementosProtocolo" db-relationship-path="toPrtTiposElementosProtocolo"/>
<obj-relationship name="toTrabalhadoresEcds" source="TrabalhadoresEcd" target="TrabalhadoresEcds" db-relationship-path="toTrabalhadoresEcds"/>
<obj-relationship name="toTrabalhadoresEcdsDatas" source="TrabalhadoresEcd" target="TrabalhadoresEcdsDatas" db-relationship-path="toTrabalhadoresEcdsDatas"/>
<obj-relationship name="toTrabalhadores" source="TrabalhadoresEcds" target="Trabalhadores" db-relationship-path="toTrabalhadores"/>
<obj-relationship name="toTrabalhadoresProcesso" source="TrabalhadoresEcds" target="TrabalhadoresProcesso" db-relationship-path="toTrabalhadoresProcesso"/>
<obj-relationship name="trabalhadoresEcdArray" source="TrabalhadoresEcds" target="TrabalhadoresEcd" db-relationship-path="trabalhadoresEcdArray"/>
<obj-relationship name="trabalhadoresEcdsDatasArray" source="TrabalhadoresEcds" target="TrabalhadoresEcdsDatas" db-relationship-path="trabalhadoresEcdsDatasArray"/>
<obj-relationship name="toPrestadores" source="TrabalhadoresEcdsDatas" target="Prestadores" db-relationship-path="toPrestadores"/>
<obj-relationship name="toTrabalhadoresEcds" source="TrabalhadoresEcdsDatas" target="TrabalhadoresEcds" db-relationship-path="toTrabalhadoresEcds"/>

@ -1,6 +1,8 @@
package siprp.database.cayenne.objects;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import siprp.database.cayenne.objects.auto._Trabalhadores;
@ -53,5 +55,31 @@ public class Trabalhadores extends _Trabalhadores
{
return getNomePlain();
}
public List<PrtTiposElementosProtocolo> getAllEcdForGrupo( PrtGruposProtocolo grupo )
{
List<PrtTiposElementosProtocolo> result = new ArrayList<PrtTiposElementosProtocolo>();
Integer perfil = getPerfil();
if( perfil != null )
{
Empresas empresa = getToEstabelecimentos().getToEmpresas();
List<PrtElementosProtocolo> ecdsPerfil = (List<PrtElementosProtocolo>) empresa.getPrtElementosProtocoloArray();
for( PrtElementosProtocolo ecdPerfil : ecdsPerfil )
{
if( perfil.equals( ecdPerfil.getNumeroPerfil() ) )
{
PrtTiposElementosProtocolo ecd = ecdPerfil.getToPrtTiposElementosProtocolo();
if( ecd != null )
{
if( ecd.getToPrtGruposProtocolo().equals( grupo ) && !result.contains( ecd ))
{
result.add( ecd );
}
}
}
}
}
return result;
}
}

@ -1,9 +1,11 @@
package siprp.database.cayenne.objects;
import java.util.HashMap;
import java.util.List;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcds;
import siprp.medicina.MedicinaConstants;
import siprp.medicina.processo.ui.OrderedMap;
public class TrabalhadoresEcds extends _TrabalhadoresEcds implements MedicinaConstants
{
@ -38,4 +40,38 @@ public class TrabalhadoresEcds extends _TrabalhadoresEcds implements MedicinaCon
return getDataString() + ": " + getEstadoString();
}
public OrderedMap<PrtGruposProtocolo> getGruposExamesForPerfil()
{
OrderedMap<PrtGruposProtocolo> grupos = new OrderedMap<PrtGruposProtocolo>();
Trabalhadores trabalhador = this.getToTrabalhadores();
Integer perfil = trabalhador.getPerfil();
if( perfil != null )
{
Empresas empresa = trabalhador.getToEstabelecimentos().getToEmpresas();
List<PrtElementosProtocolo> ecdsPerfil = (List<PrtElementosProtocolo>) empresa.getPrtElementosProtocoloArray();
for( PrtElementosProtocolo ecdPerfil : ecdsPerfil )
{
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.containsKey( grupoEcd ) )
{
grupos.putLast( grupoEcd, descricao );
// TODO: calcular estado
grupos.putLast( grupoEcd, MedicinaConstants.ESTADOS_EXAME_STR[MedicinaConstants.ESTADO_POR_REALIZAR] );
}
}
}
}
}
}
return grupos;
}
}

@ -2,9 +2,12 @@ package siprp.database.cayenne.objects;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcdsDatas;
import siprp.database.cayenne.providers.MedicinaDAO;
import siprp.medicina.MedicinaConstants;
import siprp.medicina.processo.ui.OrderedMap;
public class TrabalhadoresEcdsDatas extends _TrabalhadoresEcdsDatas implements MedicinaConstants{
private static final long serialVersionUID = 1L;
@ -57,6 +60,40 @@ public class TrabalhadoresEcdsDatas extends _TrabalhadoresEcdsDatas implements M
{
return getDataString() + ": " + getEstadoString();
}
public OrderedMap<PrtGruposProtocolo> getGruposExames()
{
OrderedMap<PrtGruposProtocolo> grupos = new OrderedMap<PrtGruposProtocolo>();
List<TrabalhadoresEcd> exames = this.getTrabalhadoresEcdArray();
if( exames != null )
{
for(TrabalhadoresEcd exame : exames)
{
String estado = MedicinaConstants.ESTADOS_EXAME_STR[exame.getEstado()];
PrtGruposProtocolo grupo = exame.getToPrtTiposElementosProtocolo().getToPrtGruposProtocolo();
if( !grupos.containsKey( grupo ))
{
grupos.putLast( grupo, grupo.getDescricao() );
grupos.putLast( grupo, estado );
}
}
}
return grupos;
}
public void marcarGrupoExames( PrtGruposProtocolo grupo )
{
List<PrtTiposElementosProtocolo> allEcd = getToTrabalhadoresEcds().getToTrabalhadores().getAllEcdForGrupo( grupo );
for(PrtTiposElementosProtocolo ecd : allEcd)
{
TrabalhadoresEcd trabEcd = new TrabalhadoresEcd();
trabEcd.setEstado( MedicinaConstants.ESTADO_POR_REALIZAR );
trabEcd.setToPrtTiposElementosProtocolo( ecd );
trabEcd.setToTrabalhadoresEcdsDatas( this );
addToTrabalhadoresEcdArray( trabEcd );
}
}
}

@ -5,12 +5,13 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Avisos extends org.apache.cayenne.CayenneDataObject {
public abstract class _Avisos extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_AVISO_PROPERTY = "dataAviso";
public static final String DATA_EVENTO_PROPERTY = "dataEvento";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String EVENTO_ID_PROPERTY = "eventoId";
public static final String ID_PROPERTY = "id";
public static final String TIPO_PROPERTY = "tipo";
public static final String TRABALHADOR_ID_PROPERTY = "trabalhadorId";
public static final String TO_EMPRESAS_PROPERTY = "toEmpresas";
@ -50,6 +51,14 @@ public abstract class _Avisos extends org.apache.cayenne.CayenneDataObject {
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setTipo(Integer tipo) {
writeProperty("tipo", tipo);
}

@ -5,16 +5,18 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Contactos extends org.apache.cayenne.CayenneDataObject {
public abstract class _Contactos extends siprp.database.cayenne.objects.BaseObject {
public static final String CARGO_PROPERTY = "cargo";
public static final String EMAIL_PROPERTY = "email";
public static final String FAX_PROPERTY = "fax";
public static final String ID_PROPERTY = "id";
public static final String NOME_PROPERTY = "nome";
public static final String TELEFONE_PROPERTY = "telefone";
public static final String TELEMOVEL_PROPERTY = "telemovel";
public static final String EMPRESAS_ARRAY_PROPERTY = "empresasArray";
public static final String EMPRESAS_ARRAY1_PROPERTY = "empresasArray1";
public static final String ESTABELECIMENTOS_ARRAY_PROPERTY = "estabelecimentosArray";
public static final String PRESTADORES_ARRAY_PROPERTY = "prestadoresArray";
public static final String ID_PK_COLUMN = "id";
@ -43,6 +45,14 @@ public abstract class _Contactos extends org.apache.cayenne.CayenneDataObject {
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setNome(String nome) {
writeProperty("nome", nome);
}
@ -89,6 +99,17 @@ public abstract class _Contactos extends org.apache.cayenne.CayenneDataObject {
}
public void addToEstabelecimentosArray(siprp.database.cayenne.objects.Estabelecimentos obj) {
addToManyTarget("estabelecimentosArray", obj, true);
}
public void removeFromEstabelecimentosArray(siprp.database.cayenne.objects.Estabelecimentos obj) {
removeToManyTarget("estabelecimentosArray", obj, true);
}
public java.util.List getEstabelecimentosArray() {
return (java.util.List)readProperty("estabelecimentosArray");
}
public void addToPrestadoresArray(siprp.database.cayenne.objects.Prestadores obj) {
addToManyTarget("prestadoresArray", obj, true);
}

@ -5,11 +5,12 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _EcdOficial extends org.apache.cayenne.CayenneDataObject {
public abstract class _EcdOficial extends siprp.database.cayenne.objects.BaseObject {
public static final String ACTIVO_PROPERTY = "activo";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String DESCRICAO_PLAIN_PROPERTY = "descricaoPlain";
public static final String ID_PROPERTY = "id";
public static final String ORDEM_PROPERTY = "ordem";
public static final String TRABALHADORES_ECD_ARRAY_PROPERTY = "trabalhadoresEcdArray";
@ -39,6 +40,14 @@ public abstract class _EcdOficial extends org.apache.cayenne.CayenneDataObject {
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setOrdem(Integer ordem) {
writeProperty("ordem", ordem);
}

@ -5,11 +5,12 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Errors extends org.apache.cayenne.CayenneDataObject {
public abstract class _Errors extends siprp.database.cayenne.objects.BaseObject {
public static final String DATE_PROPERTY = "date";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String ENVIRONMENT_PROPERTY = "environment";
public static final String ID_PROPERTY = "id";
public static final String TYPE_PROPERTY = "type";
public static final String ID_PK_COLUMN = "id";
@ -38,6 +39,14 @@ public abstract class _Errors extends org.apache.cayenne.CayenneDataObject {
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setType(String type) {
writeProperty("type", type);
}

@ -9,7 +9,7 @@ public abstract class _Estabelecimentos extends siprp.database.cayenne.objects.B
public static final String ACTUALIZACAO_PROPERTY = "actualizacao";
public static final String CODIGO_POSTAL_PROPERTY = "codigoPostal";
public static final String CONTACTO_PROPERTY = "contacto";
public static final String CONTACTO_BACKUP_PROPERTY = "contactoBackup";
public static final String HISTORICO_PROPERTY = "historico";
public static final String ID_PROPERTY = "id";
public static final String INACTIVO_PROPERTY = "inactivo";
@ -21,8 +21,11 @@ public abstract class _Estabelecimentos extends siprp.database.cayenne.objects.B
public static final String HISTORICO_ESTABELECIMENTO_ARRAY_PROPERTY = "historicoEstabelecimentoArray";
public static final String LEMBRETES_ARRAY_PROPERTY = "lembretesArray";
public static final String MARCACOES_ESTABELECIMENTO_ARRAY_PROPERTY = "marcacoesEstabelecimentoArray";
public static final String TO_CONTACTOS_PROPERTY = "toContactos";
public static final String TO_EMPRESAS_PROPERTY = "toEmpresas";
public static final String TO_MEDICOS_PROPERTY = "toMedicos";
public static final String TO_PRESTADORES_PROPERTY = "toPrestadores";
public static final String TO_PRESTADORES1_PROPERTY = "toPrestadores1";
public static final String TRABALHADORES_ARRAY_PROPERTY = "trabalhadoresArray";
public static final String ID_PK_COLUMN = "id";
@ -43,11 +46,11 @@ public abstract class _Estabelecimentos extends siprp.database.cayenne.objects.B
}
public void setContacto(String contacto) {
writeProperty("contacto", contacto);
public void setContactoBackup(String contactoBackup) {
writeProperty("contactoBackup", contactoBackup);
}
public String getContacto() {
return (String)readProperty("contacto");
public String getContactoBackup() {
return (String)readProperty("contactoBackup");
}
@ -151,6 +154,15 @@ public abstract class _Estabelecimentos extends siprp.database.cayenne.objects.B
}
public void setToContactos(siprp.database.cayenne.objects.Contactos toContactos) {
setToOneTarget("toContactos", toContactos, true);
}
public siprp.database.cayenne.objects.Contactos getToContactos() {
return (siprp.database.cayenne.objects.Contactos)readProperty("toContactos");
}
public void setToEmpresas(siprp.database.cayenne.objects.Empresas toEmpresas) {
setToOneTarget("toEmpresas", toEmpresas, true);
}
@ -169,6 +181,24 @@ public abstract class _Estabelecimentos extends siprp.database.cayenne.objects.B
}
public void setToPrestadores(siprp.database.cayenne.objects.Prestadores toPrestadores) {
setToOneTarget("toPrestadores", toPrestadores, true);
}
public siprp.database.cayenne.objects.Prestadores getToPrestadores() {
return (siprp.database.cayenne.objects.Prestadores)readProperty("toPrestadores");
}
public void setToPrestadores1(siprp.database.cayenne.objects.Prestadores toPrestadores1) {
setToOneTarget("toPrestadores1", toPrestadores1, true);
}
public siprp.database.cayenne.objects.Prestadores getToPrestadores1() {
return (siprp.database.cayenne.objects.Prestadores)readProperty("toPrestadores1");
}
public void addToTrabalhadoresArray(siprp.database.cayenne.objects.Trabalhadores obj) {
addToManyTarget("trabalhadoresArray", obj, true);
}

@ -5,7 +5,7 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Etiquetas extends org.apache.cayenne.CayenneDataObject {
public abstract class _Etiquetas extends siprp.database.cayenne.objects.BaseObject {
public static final String ALTURA_PROPERTY = "altura";
public static final String ALTURA_FOLHA_PROPERTY = "alturaFolha";
@ -13,6 +13,7 @@ public abstract class _Etiquetas extends org.apache.cayenne.CayenneDataObject {
public static final String CONTINUA_PROPERTY = "continua";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String DESCRICAO_PLAIN_PROPERTY = "descricaoPlain";
public static final String ID_PROPERTY = "id";
public static final String LARGURA_PROPERTY = "largura";
public static final String LARGURA_FOLHA_PROPERTY = "larguraFolha";
public static final String LINHAS_PROPERTY = "linhas";
@ -71,6 +72,14 @@ public abstract class _Etiquetas extends org.apache.cayenne.CayenneDataObject {
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setLargura(Float largura) {
writeProperty("largura", largura);
}

@ -5,10 +5,11 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Exames extends org.apache.cayenne.CayenneDataObject {
public abstract class _Exames extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String FO_PROPERTY = "fo";
public static final String ID_PROPERTY = "id";
public static final String INACTIVO_PROPERTY = "inactivo";
public static final String OCASIONAL_PROPERTY = "ocasional";
public static final String OUTRA_FUNCAO1_PROPERTY = "outraFuncao1";
@ -43,6 +44,14 @@ public abstract class _Exames extends org.apache.cayenne.CayenneDataObject {
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setInactivo(String inactivo) {
writeProperty("inactivo", inactivo);
}

@ -5,14 +5,23 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _ExamesPerfis extends org.apache.cayenne.CayenneDataObject {
public abstract class _ExamesPerfis extends siprp.database.cayenne.objects.BaseObject {
public static final String ID_PROPERTY = "id";
public static final String MULTIPLICADOR_PROPERTY = "multiplicador";
public static final String PERFIL_PROPERTY = "perfil";
public static final String TO_TIPOS_EXAMES_COMP_PROPERTY = "toTiposExamesComp";
public static final String ID_PK_COLUMN = "id";
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setMultiplicador(Integer multiplicador) {
writeProperty("multiplicador", multiplicador);
}

@ -5,9 +5,10 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _ExamesPortaria extends org.apache.cayenne.CayenneDataObject {
public abstract class _ExamesPortaria extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_ENTRADA_PROPERTY = "dataEntrada";
public static final String ID_PROPERTY = "id";
public static final String PORTARIA_PROPERTY = "portaria";
public static final String ID_PK_COLUMN = "id";
@ -20,6 +21,14 @@ public abstract class _ExamesPortaria extends org.apache.cayenne.CayenneDataObje
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setPortaria(String portaria) {
writeProperty("portaria", portaria);
}

@ -5,9 +5,10 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HistoricoEstabelecimento extends org.apache.cayenne.CayenneDataObject {
public abstract class _HistoricoEstabelecimento extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String ID_PROPERTY = "id";
public static final String TEXTO_PROPERTY = "texto";
public static final String TO_ESTABELECIMENTOS_PROPERTY = "toEstabelecimentos";
@ -21,6 +22,14 @@ public abstract class _HistoricoEstabelecimento extends org.apache.cayenne.Cayen
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setTexto(String texto) {
writeProperty("texto", texto);
}

@ -5,7 +5,7 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Ids extends org.apache.cayenne.CayenneDataObject {
public abstract class _Ids extends siprp.database.cayenne.objects.BaseObject {
public static final String ID_PK_COLUMN = "id";

@ -5,11 +5,12 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Lembretes extends org.apache.cayenne.CayenneDataObject {
public abstract class _Lembretes extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String ENVIAR_EMAIL_PROPERTY = "enviarEmail";
public static final String ID_PROPERTY = "id";
public static final String PERIODICIDADE_DIAS_PROPERTY = "periodicidadeDias";
public static final String PERIODICIDADE_MESES_PROPERTY = "periodicidadeMeses";
public static final String TEXTO_PROPERTY = "texto";
@ -47,6 +48,14 @@ public abstract class _Lembretes extends org.apache.cayenne.CayenneDataObject {
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setPeriodicidadeDias(Integer periodicidadeDias) {
writeProperty("periodicidadeDias", periodicidadeDias);
}

@ -5,11 +5,12 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _LembretesTipos extends org.apache.cayenne.CayenneDataObject {
public abstract class _LembretesTipos extends siprp.database.cayenne.objects.BaseObject {
public static final String ACTIVO_PROPERTY = "activo";
public static final String CODIGO_PROPERTY = "codigo";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String ID_PROPERTY = "id";
public static final String ORDEM_PROPERTY = "ordem";
public static final String LEMBRETES_ARRAY_PROPERTY = "lembretesArray";
@ -39,6 +40,14 @@ public abstract class _LembretesTipos extends org.apache.cayenne.CayenneDataObje
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setOrdem(Integer ordem) {
writeProperty("ordem", ordem);
}

@ -5,9 +5,10 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _MarcacoesEmpresa extends org.apache.cayenne.CayenneDataObject {
public abstract class _MarcacoesEmpresa extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String ID_PROPERTY = "id";
public static final String REALIZADA_PROPERTY = "realizada";
public static final String TEXTO_PROPERTY = "texto";
public static final String TO_EMPRESAS_PROPERTY = "toEmpresas";
@ -22,6 +23,14 @@ public abstract class _MarcacoesEmpresa extends org.apache.cayenne.CayenneDataOb
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setRealizada(String realizada) {
writeProperty("realizada", realizada);
}

@ -5,12 +5,13 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _MarcacoesEstabelecimento extends org.apache.cayenne.CayenneDataObject {
public abstract class _MarcacoesEstabelecimento extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String DATA_EMAIL_PROPERTY = "dataEmail";
public static final String DATA_RELATORIO_PROPERTY = "dataRelatorio";
public static final String ESTADO_PROPERTY = "estado";
public static final String ID_PROPERTY = "id";
public static final String OBSERVACOES_PROPERTY = "observacoes";
public static final String REALIZADA_PROPERTY = "realizada";
public static final String LEMBRETES_ARRAY_PROPERTY = "lembretesArray";
@ -51,6 +52,14 @@ public abstract class _MarcacoesEstabelecimento extends org.apache.cayenne.Cayen
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setObservacoes(String observacoes) {
writeProperty("observacoes", observacoes);
}

@ -5,7 +5,7 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _MarcacoesGruposRealizados extends org.apache.cayenne.CayenneDataObject {
public abstract class _MarcacoesGruposRealizados extends siprp.database.cayenne.objects.BaseObject {
public static final String TO_MARCACOES_TRABALHADOR_PROPERTY = "toMarcacoesTrabalhador";
public static final String TO_MARCACOES_TRABALHADOR_ESTADOS_PROPERTY = "toMarcacoesTrabalhadorEstados";

@ -5,8 +5,9 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _MarcacoesTecnicosHst extends org.apache.cayenne.CayenneDataObject {
public abstract class _MarcacoesTecnicosHst extends siprp.database.cayenne.objects.BaseObject {
public static final String ID_PROPERTY = "id";
public static final String IDENTIFICADOR_PROPERTY = "identificador";
public static final String INACTIVO_PROPERTY = "inactivo";
public static final String INICIAIS_PROPERTY = "iniciais";
@ -16,6 +17,14 @@ public abstract class _MarcacoesTecnicosHst extends org.apache.cayenne.CayenneDa
public static final String ID_PK_COLUMN = "id";
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setIdentificador(Integer identificador) {
writeProperty("identificador", identificador);
}

@ -5,12 +5,13 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _MarcacoesTrabalhador extends org.apache.cayenne.CayenneDataObject {
public abstract class _MarcacoesTrabalhador extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String DATA_EMAIL_PROPERTY = "dataEmail";
public static final String DATA_RELATORIO_PROPERTY = "dataRelatorio";
public static final String ESTADO_PROPERTY = "estado";
public static final String ID_PROPERTY = "id";
public static final String MOTIVO_PROPERTY = "motivo";
public static final String OBSERVACOES_PROPERTY = "observacoes";
public static final String REALIZADA_PROPERTY = "realizada";
@ -55,6 +56,14 @@ public abstract class _MarcacoesTrabalhador extends org.apache.cayenne.CayenneDa
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setMotivo(Integer motivo) {
writeProperty("motivo", motivo);
}

@ -5,10 +5,11 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _MarcacoesTrabalhadorEstados extends org.apache.cayenne.CayenneDataObject {
public abstract class _MarcacoesTrabalhadorEstados extends siprp.database.cayenne.objects.BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String ESTADO_PROPERTY = "estado";
public static final String ID_PROPERTY = "id";
public static final String MARCACOES_GRUPOS_REALIZADOS_ARRAY_PROPERTY = "marcacoesGruposRealizadosArray";
public static final String TO_MARCACOES_TRABALHADOR_PROPERTY = "toMarcacoesTrabalhador";
public static final String TO_PRESTADORES_PROPERTY = "toPrestadores";
@ -31,6 +32,14 @@ public abstract class _MarcacoesTrabalhadorEstados extends org.apache.cayenne.Ca
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void addToMarcacoesGruposRealizadosArray(siprp.database.cayenne.objects.MarcacoesGruposRealizados obj) {
addToManyTarget("marcacoesGruposRealizadosArray", obj, true);
}

@ -5,8 +5,9 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Medicos extends org.apache.cayenne.CayenneDataObject {
public abstract class _Medicos extends siprp.database.cayenne.objects.BaseObject {
public static final String ID_PROPERTY = "id";
public static final String INACTIVO_PROPERTY = "inactivo";
public static final String NOME_PROPERTY = "nome";
public static final String NUMERO_CEDULA_PROPERTY = "numeroCedula";
@ -15,6 +16,14 @@ public abstract class _Medicos extends org.apache.cayenne.CayenneDataObject {
public static final String ID_PK_COLUMN = "id";
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setInactivo(String inactivo) {
writeProperty("inactivo", inactivo);
}

@ -5,25 +5,27 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Prestadores extends org.apache.cayenne.CayenneDataObject {
public abstract class _Prestadores extends siprp.database.cayenne.objects.BaseObject {
public static final String ACTIVO_PROPERTY = "activo";
public static final String CODIGO_POSTAL_PROPERTY = "codigoPostal";
public static final String CONTRIBUINTE_PROPERTY = "contribuinte";
public static final String FAZ_CONSULTAS_PROPERTY = "fazConsultas";
public static final String FAZ_ECDS_PROPERTY = "fazEcds";
public static final String ID_PROPERTY = "id";
public static final String LOCALIDADE_PROPERTY = "localidade";
public static final String LOCALIDADE_CP_PROPERTY = "localidadeCp";
public static final String MORADA_PROPERTY = "morada";
public static final String NOME_PROPERTY = "nome";
public static final String NOME_PLAIN_PROPERTY = "nomePlain";
public static final String ESTABELECIMENTOS_ARRAY_PROPERTY = "estabelecimentosArray";
public static final String ESTABELECIMENTOS_ARRAY1_PROPERTY = "estabelecimentosArray1";
public static final String MARCACOES_TRABALHADOR_ARRAY_PROPERTY = "marcacoesTrabalhadorArray";
public static final String MARCACOES_TRABALHADOR_ESTADOS_ARRAY_PROPERTY = "marcacoesTrabalhadorEstadosArray";
public static final String PRESTADORES_GRUPOS_PROTOCOLO_ARRAY_PROPERTY = "prestadoresGruposProtocoloArray";
public static final String TO_CONTACTOS_PROPERTY = "toContactos";
public static final String TRABALHADORES_CONSULTAS_ARRAY_PROPERTY = "trabalhadoresConsultasArray";
public static final String TRABALHADORES_CONSULTAS_DATAS_ARRAY_PROPERTY = "trabalhadoresConsultasDatasArray";
public static final String TRABALHADORES_ECD_ARRAY_PROPERTY = "trabalhadoresEcdArray";
public static final String TRABALHADORES_ECDS_DATAS_ARRAY_PROPERTY = "trabalhadoresEcdsDatasArray";
public static final String ID_PK_COLUMN = "id";
@ -68,6 +70,14 @@ public abstract class _Prestadores extends org.apache.cayenne.CayenneDataObject
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setLocalidade(String localidade) {
writeProperty("localidade", localidade);
}
@ -108,6 +118,28 @@ public abstract class _Prestadores extends org.apache.cayenne.CayenneDataObject
}
public void addToEstabelecimentosArray(siprp.database.cayenne.objects.Estabelecimentos obj) {
addToManyTarget("estabelecimentosArray", obj, true);
}
public void removeFromEstabelecimentosArray(siprp.database.cayenne.objects.Estabelecimentos obj) {
removeToManyTarget("estabelecimentosArray", obj, true);
}
public java.util.List getEstabelecimentosArray() {
return (java.util.List)readProperty("estabelecimentosArray");
}
public void addToEstabelecimentosArray1(siprp.database.cayenne.objects.Estabelecimentos obj) {
addToManyTarget("estabelecimentosArray1", obj, true);
}
public void removeFromEstabelecimentosArray1(siprp.database.cayenne.objects.Estabelecimentos obj) {
removeToManyTarget("estabelecimentosArray1", obj, true);
}
public java.util.List getEstabelecimentosArray1() {
return (java.util.List)readProperty("estabelecimentosArray1");
}
public void addToMarcacoesTrabalhadorArray(siprp.database.cayenne.objects.MarcacoesTrabalhador obj) {
addToManyTarget("marcacoesTrabalhadorArray", obj, true);
}
@ -172,17 +204,6 @@ public abstract class _Prestadores extends org.apache.cayenne.CayenneDataObject
}
public void addToTrabalhadoresEcdArray(siprp.database.cayenne.objects.TrabalhadoresEcd obj) {
addToManyTarget("trabalhadoresEcdArray", obj, true);
}
public void removeFromTrabalhadoresEcdArray(siprp.database.cayenne.objects.TrabalhadoresEcd obj) {
removeToManyTarget("trabalhadoresEcdArray", obj, true);
}
public java.util.List getTrabalhadoresEcdArray() {
return (java.util.List)readProperty("trabalhadoresEcdArray");
}
public void addToTrabalhadoresEcdsDatasArray(siprp.database.cayenne.objects.TrabalhadoresEcdsDatas obj) {
addToManyTarget("trabalhadoresEcdsDatasArray", obj, true);
}

@ -5,7 +5,7 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _PrestadoresGruposProtocolo extends org.apache.cayenne.CayenneDataObject {
public abstract class _PrestadoresGruposProtocolo extends siprp.database.cayenne.objects.BaseObject {
public static final String TO_PRESTADORES_PROPERTY = "toPrestadores";
public static final String TO_PRT_GRUPOS_PROTOCOLO_PROPERTY = "toPrtGruposProtocolo";

@ -5,14 +5,23 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _PrtElementosProtocolo extends org.apache.cayenne.CayenneDataObject {
public abstract class _PrtElementosProtocolo extends siprp.database.cayenne.objects.BaseObject {
public static final String ID_PROPERTY = "id";
public static final String NUMERO_PERFIL_PROPERTY = "numeroPerfil";
public static final String TO_EMPRESAS_PROPERTY = "toEmpresas";
public static final String TO_PRT_TIPOS_ELEMENTOS_PROTOCOLO_PROPERTY = "toPrtTiposElementosProtocolo";
public static final String ID_PK_COLUMN = "id";
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setNumeroPerfil(Integer numeroPerfil) {
writeProperty("numeroPerfil", numeroPerfil);
}

@ -5,11 +5,12 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _PrtGruposProtocolo extends org.apache.cayenne.CayenneDataObject {
public abstract class _PrtGruposProtocolo extends siprp.database.cayenne.objects.BaseObject {
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String DESCRICAO_PLAIN_PROPERTY = "descricaoPlain";
public static final String GRUPO_REAL_PROPERTY = "grupoReal";
public static final String ID_PROPERTY = "id";
public static final String ORDEM_PROPERTY = "ordem";
public static final String MARCACOES_GRUPOS_REALIZADOS_ARRAY_PROPERTY = "marcacoesGruposRealizadosArray";
public static final String PRESTADORES_GRUPOS_PROTOCOLO_ARRAY_PROPERTY = "prestadoresGruposProtocoloArray";
@ -41,6 +42,14 @@ public abstract class _PrtGruposProtocolo extends org.apache.cayenne.CayenneData
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setOrdem(Integer ordem) {
writeProperty("ordem", ordem);
}

@ -5,10 +5,11 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _PrtTiposElementosProtocolo extends org.apache.cayenne.CayenneDataObject {
public abstract class _PrtTiposElementosProtocolo extends siprp.database.cayenne.objects.BaseObject {
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String DESCRICAO_PLAIN_PROPERTY = "descricaoPlain";
public static final String ID_PROPERTY = "id";
public static final String ORDEM_PROPERTY = "ordem";
public static final String PRT_ELEMENTOS_PROTOCOLO_ARRAY_PROPERTY = "prtElementosProtocoloArray";
public static final String TO_PRT_GRUPOS_PROTOCOLO_PROPERTY = "toPrtGruposProtocolo";
@ -32,6 +33,14 @@ public abstract class _PrtTiposElementosProtocolo extends org.apache.cayenne.Cay
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setOrdem(Integer ordem) {
writeProperty("ordem", ordem);
}

@ -5,9 +5,10 @@ package siprp.database.cayenne.objects.auto;
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _TiposExamesComp extends org.apache.cayenne.CayenneDataObject {
public abstract class _TiposExamesComp extends siprp.database.cayenne.objects.BaseObject {
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String ID_PROPERTY = "id";
public static final String ORDEM_PROPERTY = "ordem";
public static final String EXAMES_PERFIS_ARRAY_PROPERTY = "examesPerfisArray";
@ -21,6 +22,14 @@ public abstract class _TiposExamesComp extends org.apache.cayenne.CayenneDataObj
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setOrdem(Integer ordem) {
writeProperty("ordem", ordem);
}

@ -9,9 +9,7 @@ public abstract class _TrabalhadoresEcd extends siprp.database.cayenne.objects.B
public static final String ESTADO_PROPERTY = "estado";
public static final String TO_ECD_OFICIAL_PROPERTY = "toEcdOficial";
public static final String TO_PRESTADORES_PROPERTY = "toPrestadores";
public static final String TO_PRT_TIPOS_ELEMENTOS_PROTOCOLO_PROPERTY = "toPrtTiposElementosProtocolo";
public static final String TO_TRABALHADORES_ECDS_PROPERTY = "toTrabalhadoresEcds";
public static final String TO_TRABALHADORES_ECDS_DATAS_PROPERTY = "toTrabalhadoresEcdsDatas";
public static final String ID_PK_COLUMN = "id";
@ -33,15 +31,6 @@ public abstract class _TrabalhadoresEcd extends siprp.database.cayenne.objects.B
}
public void setToPrestadores(siprp.database.cayenne.objects.Prestadores toPrestadores) {
setToOneTarget("toPrestadores", toPrestadores, true);
}
public siprp.database.cayenne.objects.Prestadores getToPrestadores() {
return (siprp.database.cayenne.objects.Prestadores)readProperty("toPrestadores");
}
public void setToPrtTiposElementosProtocolo(siprp.database.cayenne.objects.PrtTiposElementosProtocolo toPrtTiposElementosProtocolo) {
setToOneTarget("toPrtTiposElementosProtocolo", toPrtTiposElementosProtocolo, true);
}
@ -51,15 +40,6 @@ public abstract class _TrabalhadoresEcd extends siprp.database.cayenne.objects.B
}
public void setToTrabalhadoresEcds(siprp.database.cayenne.objects.TrabalhadoresEcds toTrabalhadoresEcds) {
setToOneTarget("toTrabalhadoresEcds", toTrabalhadoresEcds, true);
}
public siprp.database.cayenne.objects.TrabalhadoresEcds getToTrabalhadoresEcds() {
return (siprp.database.cayenne.objects.TrabalhadoresEcds)readProperty("toTrabalhadoresEcds");
}
public void setToTrabalhadoresEcdsDatas(siprp.database.cayenne.objects.TrabalhadoresEcdsDatas toTrabalhadoresEcdsDatas) {
setToOneTarget("toTrabalhadoresEcdsDatas", toTrabalhadoresEcdsDatas, true);
}

@ -9,9 +9,9 @@ public abstract class _TrabalhadoresEcds extends siprp.database.cayenne.objects.
public static final String DATA_PROPERTY = "data";
public static final String ESTADO_PROPERTY = "estado";
public static final String ID_PROPERTY = "id";
public static final String TO_TRABALHADORES_PROPERTY = "toTrabalhadores";
public static final String TO_TRABALHADORES_PROCESSO_PROPERTY = "toTrabalhadoresProcesso";
public static final String TRABALHADORES_ECD_ARRAY_PROPERTY = "trabalhadoresEcdArray";
public static final String TRABALHADORES_ECDS_DATAS_ARRAY_PROPERTY = "trabalhadoresEcdsDatasArray";
public static final String ID_PK_COLUMN = "id";
@ -32,6 +32,14 @@ public abstract class _TrabalhadoresEcds extends siprp.database.cayenne.objects.
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setToTrabalhadores(siprp.database.cayenne.objects.Trabalhadores toTrabalhadores) {
setToOneTarget("toTrabalhadores", toTrabalhadores, true);
}
@ -50,17 +58,6 @@ public abstract class _TrabalhadoresEcds extends siprp.database.cayenne.objects.
}
public void addToTrabalhadoresEcdArray(siprp.database.cayenne.objects.TrabalhadoresEcd obj) {
addToManyTarget("trabalhadoresEcdArray", obj, true);
}
public void removeFromTrabalhadoresEcdArray(siprp.database.cayenne.objects.TrabalhadoresEcd obj) {
removeToManyTarget("trabalhadoresEcdArray", obj, true);
}
public java.util.List getTrabalhadoresEcdArray() {
return (java.util.List)readProperty("trabalhadoresEcdArray");
}
public void addToTrabalhadoresEcdsDatasArray(siprp.database.cayenne.objects.TrabalhadoresEcdsDatas obj) {
addToManyTarget("trabalhadoresEcdsDatasArray", obj, true);
}

@ -9,6 +9,7 @@ public abstract class _TrabalhadoresEcdsDatas extends siprp.database.cayenne.obj
public static final String DATA_PROPERTY = "data";
public static final String ESTADO_PROPERTY = "estado";
public static final String ID_PROPERTY = "id";
public static final String TO_PRESTADORES_PROPERTY = "toPrestadores";
public static final String TO_TRABALHADORES_ECDS_PROPERTY = "toTrabalhadoresEcds";
public static final String TRABALHADORES_ECD_ARRAY_PROPERTY = "trabalhadoresEcdArray";
@ -33,6 +34,14 @@ public abstract class _TrabalhadoresEcdsDatas extends siprp.database.cayenne.obj
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setToPrestadores(siprp.database.cayenne.objects.Prestadores toPrestadores) {
setToOneTarget("toPrestadores", toPrestadores, true);
}

@ -10,6 +10,7 @@ public abstract class _TrabalhadoresEcdsDatasEmails extends siprp.database.cayen
public static final String BODY_PROPERTY = "body";
public static final String DATA_PROPERTY = "data";
public static final String DESTINATION_PROPERTY = "destination";
public static final String ID_PROPERTY = "id";
public static final String SUBJECT_PROPERTY = "subject";
public static final String TO_TRABALHADORES_ECDS_DATAS_PROPERTY = "toTrabalhadoresEcdsDatas";
@ -39,6 +40,14 @@ public abstract class _TrabalhadoresEcdsDatasEmails extends siprp.database.cayen
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setSubject(String subject) {
writeProperty("subject", subject);
}

@ -7,11 +7,20 @@ package siprp.database.cayenne.objects.auto;
*/
public abstract class _TrabalhadoresEcdsDatasObservacoes extends siprp.database.cayenne.objects.BaseObject {
public static final String ID_PROPERTY = "id";
public static final String OBSERVACAO_PROPERTY = "observacao";
public static final String TO_TRABALHADORES_ECDS_DATAS_PROPERTY = "toTrabalhadoresEcdsDatas";
public static final String ID_PK_COLUMN = "id";
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setObservacao(String observacao) {
writeProperty("observacao", observacao);
}

@ -7,11 +7,20 @@ package siprp.database.cayenne.objects.auto;
*/
public abstract class _TrabalhadoresFichasAptidao extends siprp.database.cayenne.objects.BaseObject {
public static final String ID_PROPERTY = "id";
public static final String TO_EXAMES_PROPERTY = "toExames";
public static final String TO_TRABALHADORES_PROCESSO_PROPERTY = "toTrabalhadoresProcesso";
public static final String ID_PK_COLUMN = "id";
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setToExames(siprp.database.cayenne.objects.Exames toExames) {
setToOneTarget("toExames", toExames, true);
}

@ -1,6 +1,9 @@
package siprp.medicina.processo.logic;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.DESMARCAR_CONSULTA_MARCACAO;
import java.util.Date;
import java.util.HashMap;
import java.util.Vector;
import javax.swing.tree.DefaultMutableTreeNode;
@ -18,9 +21,11 @@ import siprp.database.cayenne.objects.TrabalhadoresEcdsDatasObservacoes;
import siprp.database.cayenne.objects.TrabalhadoresProcesso;
import siprp.database.cayenne.providers.MedicinaDAO;
import siprp.logic.SIPRPLogic;
import siprp.logic.SIPRPLogic.LeafUIActionBinding;
import siprp.medicina.MedicinaConstants;
import siprp.medicina.processo.ProcessoConstants;
import siprp.medicina.processo.estrutura.FichaAptidaoMutableTreeNode;
import siprp.medicina.processo.ui.LeafOptionDialog;
import siprp.ui.SIPRPWindow.LeafObject;
import com.evolute.utils.tables.ColumnizedMappable;
@ -146,6 +151,15 @@ public class MedicinaProcessoLogic extends SIPRPLogic
@Action(isSave = true)
public static final String FALTOU_CONSULTA_MARCACAO = "FALTOU_CONSULTA_MARCACAO";
@Action(isSave = true)
public static final String DESMARCAR_EXAME_MARCACAO = "DESMARCAR_EXAME_MARCACAO";
@Action(isSave = true)
public static final String REALIZAR_EXAME_MARCACAO = "REALIZAR_EXAME_MARCACAO";
@Action(isSave = true)
public static final String FALTOU_EXAME_MARCACAO = "FALTOU_EXAME_MARCACAO";
private MedicinaDAO provider = null;
@ -247,8 +261,19 @@ public class MedicinaProcessoLogic extends SIPRPLogic
{
if( currentConsultaMarcacao != null )
{
currentConsultaMarcacao.setEstado( MedicinaConstants.ESTADO_DESMARCADO_EMPRESA );
//TODO motivo
HashMap<Boolean, String> options = new HashMap<Boolean, String>();
options.put( true, "SIPRP" );
options.put( false, "Trabalhador" );
LeafOptionDialog<Boolean> optionDialog = new LeafOptionDialog<Boolean>(options, "Desmarcado por:", false);
Boolean isDesmarcadoPorSIPRP = optionDialog.getOption();
if(isDesmarcadoPorSIPRP)
{
currentConsultaMarcacao.setEstado( MedicinaConstants.ESTADO_DESMARCADO_EMPRESA );
}
else
{
currentConsultaMarcacao.setEstado( MedicinaConstants.ESTADO_DESMARCADO_TRABALHADOR );
}
saveObject( currentConsultaMarcacao );
}
}

@ -1,9 +1,6 @@
package siprp.medicina.processo.ui;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JPanel;
@ -13,7 +10,7 @@ public class LeafGradientPanel extends JPanel
public LeafGradientPanel()
{
setBackground( new Color(200,200,230) );
setBackground( new Color(200,200,200) );
}
// @Override

@ -1,5 +1,8 @@
package siprp.medicina.processo.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
@ -9,19 +12,26 @@ import java.awt.event.FocusListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import siprp.ui.SIPRPWindow;
public class LeafInputField<ObjClass extends Object> extends JTextArea
public class LeafInputField<ObjClass extends Object> extends JPanel implements FocusListener, MouseListener
{
public static final String PROPERTY_CHANGED_CONSTANT = "LEAF_INPUT_PROPERTY_CHANGED";
public static final String PROPERTY_CHANGED_CLICK = "LEAF_PROPERTY_CHANGED_CLICK";
private static final long serialVersionUID = 1L;
private static final DateFormat sdf = DateFormat.getDateInstance( DateFormat.SHORT, new Locale( "pt", "PT" ) );
@ -35,6 +45,7 @@ public class LeafInputField<ObjClass extends Object> extends JTextArea
private Color background = null;
private Color startColor = null;
private Color endColor = null;
private Color highLightColor = Color.GREEN.brighter().brighter();
private Object selectedOption = null;
@ -42,6 +53,12 @@ public class LeafInputField<ObjClass extends Object> extends JTextArea
private boolean isEditable = false;
private boolean isClickable = false;
private boolean highLighted = false;
private boolean collapseOptions = true;
private ObjClass object = null;
private GradientPaint outerContour = null;
@ -49,93 +66,34 @@ public class LeafInputField<ObjClass extends Object> extends JTextArea
private GradientPaint innerContour = null;
private GradientPaint innerReversedContour = null;
private GradientPaint gradient = null;
private TableLayout layout = null;
private JComponent thiz = null;
private List<JComponent> theeze = null;
public LeafInputField()
{
super();
setOpaque( false );
super.setEditable( false );
// super.setEditable( false );
setBorder( BorderFactory.createEmptyBorder( 3, 10, 3, 10 ) );
setBackground( Color.WHITE );
hot = getBackground();
cold = new Color( hot.getRed() > colorDec ? hot.getRed() - colorDec : 0, hot.getGreen() > colorDec ? hot.getGreen() - colorDec : 0, hot.getBlue() > colorDec ? hot.getBlue() - colorDec : 0, hot.getAlpha() );
background = cold;
}
this.addFocusListener( new FocusListener()
{
@Override
public void focusLost( FocusEvent e )
{
repaint();
}
@Override
public void focusGained( FocusEvent e )
{
repaint();
}
} );
this.addMouseListener( new MouseListener()
{
@Override
public void mouseReleased( MouseEvent e )
{
}
@Override
public void mousePressed( MouseEvent e )
{
}
@Override
public void mouseExited( MouseEvent e )
{
background = isEditable ? cold : background;
repaint();
}
@Override
public void mouseEntered( MouseEvent e )
{
background = isEditable ? hot : background;
repaint();
}
@Override
public void mouseClicked( MouseEvent e )
{
ObjClass obj = object;
if( obj != null && isEditable )
{
if( obj instanceof Date )
{
obj = (ObjClass) getDateFromUser();
}
else if( obj instanceof Map )
{
ObjClass out = (ObjClass) getOptionFromUser();
selectedOption = out == null ? selectedOption : out;
obj = object;
}
else if( obj instanceof String )
{
obj = (ObjClass) getStringFromUser();
}
if( obj != null )
{
firePropertyChange( PROPERTY_CHANGED_CONSTANT, object, obj);
setObject( obj );
}
}
}
} );
public boolean isCollapseOptions()
{
return collapseOptions;
}
public void setCollapseOptions( boolean collapse )
{
collapseOptions = collapse;
}
@Override
public void setText( String text )
{
try
@ -155,8 +113,9 @@ public class LeafInputField<ObjClass extends Object> extends JTextArea
private Object getOptionFromUser()
{
LeafOptionDialog<Object> optionDialog = new LeafOptionDialog<Object>( getParentFrame(), this, (Map) object );
LeafOptionDialog<Object> optionDialog = new LeafOptionDialog<Object>( (Map) object );
return optionDialog.getOption();
}
private Date getDateFromUser()
@ -239,27 +198,141 @@ public class LeafInputField<ObjClass extends Object> extends JTextArea
return getParent() != null ? getParent().getBackground() : startColor;
}
@Override
public void setEditable( boolean editable )
{
isEditable = editable;
}
@Override
public boolean isEditable()
{
return isEditable;
}
public void setSelectedObject( Object key )
public void setClickable( boolean clickable )
{
isClickable = clickable;
}
public boolean isClickable()
{
return isClickable;
}
private void setupCollapsedPanel()
{
List<Object> values = ((OrderedMap) object).getValues( selectedOption );
theeze = new ArrayList<JComponent>();
if( values != null )
{
double[] rows = new double[] {
TableLayout.MINIMUM
};
double[] cols = new double[values.size() > 0 ? (values.size() * 2 - 1) : 0];
for( int i = 0; i < cols.length; ++i )
{
cols[i] = (i % 2 == 0) ? TableLayout.FILL : TableLayout.MINIMUM;
}
TableLayout layout = new TableLayout( cols, rows );
layout.setHGap( 5 );
thiz.setLayout( layout );
for( int i = 0, a = 0; i < cols.length; ++i )
{
JComponent comp = null;
if( i % 2 == 0 )
{
Object value = values.get( a++ );
comp = new JLabel( value == null ? " " : value.toString() );
theeze.add( comp );
}
else
{
comp = new JSeparator( JSeparator.VERTICAL );
}
thiz.add( comp, new TableLayoutConstraints( i, 0 ) );
}
}
}
private void setupUncollapsedPanel()
{
theeze = new ArrayList<JComponent>();
OrderedMap<Object> map = (OrderedMap<Object>) object;
double[] rows = new double[map.rows() > 0 ? (map.rows() * 2 - 1) : 0];
double[] cols = new double[map.columns() > 0 ? (map.columns() * 2 - 1) : 0];
for( int i = 0; i < rows.length; ++i )
{
rows[i] = (i % 2 == 0) ? TableLayout.MINIMUM : TableLayout.MINIMUM;
}
for( int i = 0; i < cols.length; ++i )
{
cols[i] = (i % 2 == 0) ? TableLayout.FILL : TableLayout.MINIMUM;
}
TableLayout layout = new TableLayout( cols, rows );
layout.setHGap( 5 );
thiz.setLayout( layout );
for( int i = 0, a = 0; i < rows.length; ++i )
{
if( i % 2 == 0 )
{
List<Object> values = map.getValuesAt( a++ );
for( int j = 0, b = 0; j < cols.length; ++j )
{
JComponent comp = null;
if( j % 2 == 0 )
{
Object value = values.get( b++ );
comp = new JLabel( value == null ? " " : value.toString() );
theeze.add( comp );
}
else
{
comp = new JSeparator( JSeparator.VERTICAL );
}
thiz.add( comp, new TableLayoutConstraints( j, i ) );
}
}
else
{
thiz.add( new JSeparator(), new TableLayoutConstraints( 0, i, cols.length - 1, i ) );
}
}
}
private void setSelectedObject( Object key )
{
selectedOption = key;
Object value = null;
if( key != null && object instanceof Map )
if( object != null && thiz != null && selectedOption != null )
{
value = ((Map) object).get( selectedOption );
if( object instanceof Map )
{
Object value = null;
value = ((Map) object).get( selectedOption );
if( thiz instanceof JTextArea )
{
((JTextArea) thiz).setText( value == null ? " " : value.toString() );
}
else if( thiz instanceof JTextField )
{
((JTextField) thiz).setText( value == null ? " " : value.toString() );
}
else if( thiz instanceof JLabel )
{
((JLabel) thiz).setText( value == null ? " " : value.toString() );
}
}
else if( object instanceof OrderedMap )
{
if( thiz instanceof JPanel && collapseOptions )
{
setupCollapsedPanel();
}
else if( thiz instanceof JPanel && !collapseOptions )
{
setupUncollapsedPanel();
}
}
}
super.setText( value == null ? " " : value.toString() );
}
public Object getSelectedObject()
@ -267,6 +340,12 @@ public class LeafInputField<ObjClass extends Object> extends JTextArea
return selectedOption;
}
public void setObject( ObjClass object, Object selected )
{
this.selectedOption = selected;
setObject( object );
}
public void setObject( ObjClass object )
{
this.object = object;
@ -274,25 +353,154 @@ public class LeafInputField<ObjClass extends Object> extends JTextArea
{
if( object instanceof Date )
{
super.setText( ((Date) object).getTime() <= 0 ? " " : sdf.format( object ) );
thiz = new JLabel( ((Date) object).getTime() <= 0 ? " " : sdf.format( object ) );
}
else if( object instanceof Map )
{
thiz = new JLabel( " " );
setSelectedObject( selectedOption );
}
else if( object instanceof OrderedMap && collapseOptions )
{
thiz = new JPanel();
setSelectedObject( selectedOption );
}
else if( object instanceof OrderedMap && !collapseOptions )
{
thiz = new JPanel();
setSelectedObject( selectedOption );
}
else
{
super.setText( object.toString() );
thiz = new JLabel( object.toString() );
}
}
else
{
super.setText( " " );
thiz = new JLabel( " " );
}
reListen();
reLayout();
}
public ObjClass getObject()
{
return this.object;
}
private void reListen()
{
if( thiz != null )
{
thiz.addFocusListener( this );
thiz.addMouseListener( this );
}
}
private void reLayout()
{
if( thiz != null )
{
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run()
{
if( layout == null )
{
layout = new TableLayout(new double []{TableLayout.FILL}, new double[]{TableLayout.FILL});
LeafInputField.this.setLayout( layout );
}else
{
removeAll();
}
LeafInputField.this.add( thiz, new TableLayoutConstraints( 0, 0 ) );
revalidate();
repaint();
}
});
}
}
@Override
public void focusLost( FocusEvent e )
{
repaint();
}
@Override
public void focusGained( FocusEvent e )
{
repaint();
}
@Override
public void mouseReleased( MouseEvent e )
{
}
@Override
public void mousePressed( MouseEvent e )
{
}
@Override
public void mouseExited( MouseEvent e )
{
background = (!highLighted && (isEditable || isClickable)) ? cold : background;
repaint();
}
@Override
public void mouseEntered( MouseEvent e )
{
background = (!highLighted && (isEditable || isClickable)) ? hot : background;
repaint();
}
public boolean getSelected()
{
return highLighted;
}
public void setSelected( boolean selected )
{
highLighted = selected;
background = selected ? highLightColor : cold;
}
@Override
public void mouseClicked( MouseEvent e )
{
ObjClass obj = object;
if( obj != null && isEditable )
{
if( obj instanceof Date )
{
obj = (ObjClass) getDateFromUser();
}
else if( obj instanceof Map && collapseOptions )
{
ObjClass out = (ObjClass) getOptionFromUser();
setSelectedObject( out );
obj = object;
}
else if( obj instanceof OrderedMap )
{
}
else if( obj instanceof String )
{
obj = (ObjClass) getStringFromUser();
}
if( obj != null )
{
firePropertyChange( PROPERTY_CHANGED_CONSTANT, object, obj );
setObject( obj );
}
}
if( isClickable )
{
firePropertyChange( PROPERTY_CHANGED_CLICK, false, true );
}
}
}

@ -3,49 +3,78 @@ package siprp.medicina.processo.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class LeafOptionDialog<KeyClass extends Object> extends JDialog
{
private static final long serialVersionUID = 1L;
private static final String OK_LABEL = "Ok";
private static final String CANCEL_LABEL = "Cancelar";
private final JLabel labelMessage = new JLabel();
private boolean cancelActive = true;
private LeafInputField<String> submitButton = new LeafInputField<String>();
private Map<KeyClass, ? extends Object> map = null;
private KeyClass selected = null;
private OrderedMap<KeyClass> orderedMap = null;
private List<KeyClass> selected = new ArrayList<KeyClass>();
private String message = null;
private boolean ordered = false;
/** Creates a new instance of JCalendarDialog */
public LeafOptionDialog(Map<KeyClass, ? extends Object> map)
{
super( );
startup( map, null );
}
/** Creates a new instance of JCalendarDialog */
public LeafOptionDialog( Map<KeyClass, ? extends Object> map, String message, boolean cancelActive)
{
super( );
this.cancelActive = cancelActive;
this.message = message;
startup( map, null );
}
/** Creates a new instance of JCalendarDialog */
public LeafOptionDialog(JFrame parentFrame, JComponent parent, Map<KeyClass, ? extends Object> map)
public LeafOptionDialog(Map<KeyClass, ? extends Object> map, String message)
{
super( parentFrame );
startup( parent, map );
super( );
this.message = message;
startup( map, null );
}
/** Creates a new instance of JCalendarDialog */
public LeafOptionDialog(JFrame parentFrame, JComponent parent, Map<KeyClass, ? extends Object> map, String message)
public LeafOptionDialog(OrderedMap<KeyClass> orderedMap, String message)
{
super( parentFrame );
super( );
ordered = true;
this.message = message;
startup( parent, map );
startup( null, orderedMap );
}
private void startup( JComponent parent, Map<KeyClass, ? extends Object> map )
private void startup( Map<KeyClass, ? extends Object> map, OrderedMap<KeyClass> orderedMap )
{
if( map == null )
{
@ -55,26 +84,32 @@ public class LeafOptionDialog<KeyClass extends Object> extends JDialog
{
this.map = map;
}
if( orderedMap == null )
{
this.orderedMap = new OrderedMap<KeyClass>();
}
else
{
this.orderedMap = orderedMap;
}
setupComponents( map == null ? orderedMap.keySet() : map.keySet(), map == null ? true : false );
setModal( true );
setupComponents();
setUndecorated( true );
setLocationRelativeTo( parent );
setVisible( true );
}
private void setupComponents()
private void setupComponents( Set<KeyClass> keySet, boolean ordered )
{
Set<KeyClass> keySet = map.keySet();
Iterator<KeyClass> iterator = keySet.iterator();
KeyClass current = null;
double[] cols = new double[] {
TableLayout.MINIMUM
TableLayout.FILL
};
double[] rows = new double[message == null ? 0 : 1 + keySet.size() + 1];
double[] rows = new double[(message == null ? 0 : 1) + keySet.size() + (cancelActive ? 1 : 0)];
for( int i = 0; i < rows.length; ++i )
{
rows[i] = TableLayout.MINIMUM;
rows[i] = TableLayout.FILL;
}
TableLayout layout = new TableLayout( cols, rows );
layout.setVGap( 3 );
@ -91,16 +126,31 @@ public class LeafOptionDialog<KeyClass extends Object> extends JDialog
{
current = iterator.next();
LeafInputField<Object> component = new LeafInputField<Object>();
component.setObject( map.get( current ) );
Object value;
if( ordered )
{
List<Object> values = orderedMap.getValues( current );
value = (values == null || values.size() == 0) ? null : values.get( 0 );
}
else
{
value = map.get( current );
}
component.setObject( value );
component.setClickable( true );
getContentPane().add( component, new TableLayoutConstraints( 0, i + shift ) );
addListenerToComponent( component );
}
LeafInputField<String> cancelButton = new LeafInputField<String>();
cancelButton.setObject( CANCEL_LABEL );
getContentPane().add( cancelButton, new TableLayoutConstraints( 0, keySet.size() + shift ) );
addListenerToComponent( cancelButton );
if( cancelActive )
{
submitButton.setObject( ordered ? OK_LABEL : CANCEL_LABEL );
submitButton.setClickable( true );
getContentPane().add( submitButton, new TableLayoutConstraints( 0, keySet.size() + shift ) );
addListenerToComponent( submitButton );
}
((JComponent) getContentPane()).setBorder( BorderFactory.createRaisedBevelBorder() );
setSize( layout.preferredLayoutSize( this.getContentPane() ) );
setLocationRelativeTo( getParent() );
}
private KeyClass getKeyForValue( Object value )
@ -115,52 +165,58 @@ public class LeafOptionDialog<KeyClass extends Object> extends JDialog
}
}
}
else if( ordered )
{
return orderedMap.getKeyForValue( value );
}
return null;
}
private void addListenerToComponent( JComponent component )
{
component.addMouseListener( new MouseListener()
component.addPropertyChangeListener( new PropertyChangeListener()
{
@Override
public void mouseReleased( MouseEvent e )
{
}
@Override
public void mousePressed( MouseEvent e )
{
}
@Override
public void mouseExited( MouseEvent e )
{
}
@Override
public void mouseEntered( MouseEvent e )
{
}
@Override
public void mouseClicked( MouseEvent e )
public void propertyChange( PropertyChangeEvent e )
{
if( e.getSource() instanceof LeafInputField )
{
Object value = ((LeafInputField<Object>) e.getSource()).getObject();
if( value != null )
LeafInputField<Object> source = (LeafInputField<Object>) e.getSource();
if( LeafInputField.PROPERTY_CHANGED_CLICK.equals( e.getPropertyName() ) )
{
selected = getKeyForValue( value );
Object value = source.getObject();
if( value != null )
{
KeyClass key = getKeyForValue( value );
if( selected.contains( key ) )
{
selected.remove( key );
source.setSelected( false );
}
else
{
selected.add( key );
source.setSelected( true );
}
}
if( !ordered || source.equals( submitButton ) )
{
close();
}
}
}
close();
}
} );
}
public KeyClass getOption()
{
return selected.isEmpty() ? null : selected.get( 0 );
}
public List<KeyClass> getSelected()
{
return selected;
}

@ -3,55 +3,113 @@ package siprp.medicina.processo.ui;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.Vector;
public class OrderedMap<KeyClass extends Object> extends HashMap<KeyClass, List<Object>>
public class OrderedMap<KeyClass extends Object>
{
private static final long serialVersionUID = 1L;
private Vector<KeyClass> order = new Vector<KeyClass>();
private HashMap<KeyClass, List<Object>> map = new HashMap<KeyClass, List<Object>>();
public OrderedMap()
{
}
public List<Object> getValuesAt(int row)
public List<Object> getValuesAt( int row )
{
return this.get( order.get( row ) );
return map.get( order.get( row ) );
}
public Object getValueAt(int column, int row)
public List<Object> getValues( KeyClass key )
{
return this.getValuesAt( row ).get( column );
return map.get( key );
}
public int rows()
{
return order.size();
}
public void putLast( KeyClass key, Object value)
public KeyClass getKeyForValue( Object value )
{
if(this.containsKey( key ))
for( KeyClass key : map.keySet() )
{
this.remove( key );
List<Object> values = map.get( key );
if( value.equals( values ))
{
return key;
}else
{
for(Object currentValue : values)
{
if(currentValue.equals(value))
{
return key;
}
}
}
}
List<Object> list = new ArrayList<Object>();
list.add( value );
this.put( key, list );
order.add( key );
return null;
}
public void putLast( KeyClass key, List<Object> values)
/**
* returns the length of the biggest column
*
* @return
*/
public int columns()
{
if(this.containsKey( key ))
int result = 0;
for( KeyClass key : order )
{
this.remove( key );
result = map.get( key ).size() > result ? map.get( key ).size() : result;
}
this.put( key, values );
order.add( key );
return result;
}
public KeyClass getFirst()
{
return order.isEmpty() ? null : order.get( 0 );
}
public Set<KeyClass> keySet()
{
return map.keySet();
}
@Override
public boolean containsKey( KeyClass key )
{
return map.containsKey( key );
}
public Object getValueAt( int column, int row )
{
return this.getValuesAt( row ).get( column );
}
public void putLast( KeyClass key, Object value )
{
List<Object> list;
if( map.containsKey( key ) )
{
list = map.get( key );
}
else
{
list = new ArrayList<Object>();
order.add( key );
}
list.add( value );
map.put( key, list );
}
public List<Object> remove( Object key )
{
order.remove( key );
return super.remove( key );
return map.remove( key );
}
}

@ -129,6 +129,15 @@ public class ProcessoAccoesPanel extends JPanel
public final LeafButton buttonNovoExameMarcacaoEmail = new LeafButton( "Enviar e-Mail" );
@ActionActivation(onSelect = CREATE_EXAME_MARCACAO_OBSERVACOES, onChange = "")
public final LeafButton buttonNovoExameMarcacaoObservacoes = new LeafButton( "Adicionar Observa" + ccedil + atilde + "o" );
@ActionActivation(onSelect = DESMARCAR_EXAME_MARCACAO, onChange = "")
public final LeafButton buttonExameMarcacaoDesmarcar = new LeafButton( "Desmarcar" );
@ActionActivation(onSelect = REALIZAR_EXAME_MARCACAO, onChange = "")
public final LeafButton buttonExameMarcacaoRealizar = new LeafButton( "Realizar" );
@ActionActivation(onSelect = FALTOU_EXAME_MARCACAO, onChange = "")
public final LeafButton buttonExameMarcacaoFaltou = new LeafButton( "Faltou" );
// email marcacao exame
@ -382,15 +391,23 @@ public class ProcessoAccoesPanel extends JPanel
panelConsultaMarcacao.add( new JPanel(), new TableLayoutConstraints(0,1) );
panelConsultaMarcacao.add( consultaMarcacaoLowerPanel, new TableLayoutConstraints(0,2) );
}
private void setupExamePanel()
private void setupExameMarcacaoPanel()
{
setupSimpleActionsPanel( panelExame, buttonNovoExameMarcacao, new JPanel() );
JPanel exameMarcacaoUpperPanel = new JPanel();
JPanel exameMarcacaoLowerPanel = new JPanel();
setupSimpleActionsPanel( exameMarcacaoUpperPanel, buttonNovoExameMarcacaoEmail, buttonNovoExameMarcacaoObservacoes, new JPanel() );
setupSimpleActionsPanel( exameMarcacaoLowerPanel, buttonExameMarcacaoRealizar, buttonExameMarcacaoDesmarcar, buttonExameMarcacaoFaltou);
TableLayout exameMarcacaoLayout = new TableLayout(new double[]{TableLayout.FILL}, new double[]{TableLayout.MINIMUM, TableLayout.FILL,TableLayout.MINIMUM});
panelExameMarcacao.setLayout( exameMarcacaoLayout );
panelExameMarcacao.add( exameMarcacaoUpperPanel, new TableLayoutConstraints(0,0) );
panelExameMarcacao.add( new JPanel(), new TableLayoutConstraints(0,1) );
panelExameMarcacao.add( exameMarcacaoLowerPanel, new TableLayoutConstraints(0,2) );
}
private void setupExameMarcacaoPanel()
private void setupExamePanel()
{
setupSimpleActionsPanel( panelExameMarcacao, buttonNovoExameMarcacaoEmail, buttonNovoExameMarcacaoObservacoes, new JPanel() );
setupSimpleActionsPanel( panelExame, buttonNovoExameMarcacao, new JPanel() );
}
private void setupSimpleActionsPanel( JPanel panel, JComponent... field )

@ -26,9 +26,11 @@ import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.CardLayout;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
@ -52,6 +54,7 @@ import siprp.database.cayenne.objects.TrabalhadoresEcdsDatasEmails;
import siprp.database.cayenne.objects.TrabalhadoresEcdsDatasObservacoes;
import siprp.database.cayenne.objects.TrabalhadoresProcesso;
import siprp.logic.SIPRPLogic.LeafUIActionBinding;
import siprp.medicina.MedicinaConstants;
import siprp.medicina.processo.ProcessoConstants;
import siprp.ui.SIPRPWindow;
import siprp.ui.SIPRPWindow.ActionActivation;
@ -154,15 +157,17 @@ public class ProcessoDadosPanel extends JPanel
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<OrderedMap<PrtGruposProtocolo>> inputExameGruposEcds = new LeafInputField<OrderedMap<PrtGruposProtocolo>>();
public final LeafInputField<Date> inputExameData = new LeafInputField<Date>();
// marcacao exame
private final JLabel labelExameMarcacaoEstado = new JLabel( "Estado" );
private final JLabel labelExameMarcacaoData = new JLabel( "Data" );
private final JLabel labelExameMarcacaoGruposEcds = new JLabel( "Ecds" );
public final LeafInputField<HashMap<Integer, String>> inputExameMarcacaoEstado = new LeafInputField<HashMap<Integer, String>>();
public final LeafInputField<Date> inputExameMarcacaoData = new LeafInputField<Date>();
public final LeafInputField<OrderedMap<PrtGruposProtocolo>> inputExameMarcacaoGruposEcds = new LeafInputField<OrderedMap<PrtGruposProtocolo>>();
// email marcacao exame
private final JLabel labelExameMarcacaoEmailData = new JLabel( "Data" );
@ -227,8 +232,7 @@ public class ProcessoDadosPanel extends JPanel
if( trabalhador != null )
{
inputTrabalhadorDataNascimento.setObject( trabalhador.getDataNascimento() );
inputTrabalhadorSexo.setObject( trabalhador.getSexos() );
inputTrabalhadorSexo.setSelectedObject( trabalhador.getSexo() );
inputTrabalhadorSexo.setObject( trabalhador.getSexos(), trabalhador.getSexo() );
inputTrabalhadorNome.setObject( trabalhador.getNome() );
inputTrabalhadorNacionalidade.setObject( trabalhador.getNacionalidade() );
inputTrabalhadorObservacoes.setObject( trabalhador.getObservacoes() );
@ -248,10 +252,8 @@ public class ProcessoDadosPanel extends JPanel
{
inputProcessoDataFim.setObject( processo.getDataFim() );
inputProcessoDataInicio.setObject( processo.getDataInicio() );
inputProcessoEstado.setObject( processo.getEstados() );
inputProcessoEstado.setSelectedObject( processo.getEstado() );
inputProcessoMotivo.setObject( processo.getMotivos() );
inputProcessoMotivo.setSelectedObject( processo.getMotivo() );
inputProcessoEstado.setObject( processo.getEstados(), processo.getEstado() );
inputProcessoMotivo.setObject( processo.getMotivos(), processo.getMotivo() );
cardLayout.show( this, PANEL_PROCESSO_NAME );
}
@ -266,8 +268,7 @@ public class ProcessoDadosPanel extends JPanel
{
if( consulta != null )
{
inputConsultaEstado.setObject( consulta.getConsultaEstados() );
inputConsultaEstado.setSelectedObject( consulta.getEstado() );
inputConsultaEstado.setObject( consulta.getConsultaEstados(), consulta.getEstado() );
inputConsultaData.setObject( consulta.getData() == null ? new Date( 0 ) : consulta.getData() );
// inputConsultaData.setError( consulta.getData() == null ||
@ -287,8 +288,7 @@ public class ProcessoDadosPanel extends JPanel
if( marcacao != null )
{
inputConsultaMarcacaoData.setObject( marcacao.getData() );
inputConsultaMarcacaoEstado.setObject( marcacao.getConsultaEstados() );
inputConsultaMarcacaoEstado.setSelectedObject( marcacao.getEstado() );
inputConsultaMarcacaoEstado.setObject( marcacao.getConsultaEstados(), marcacao.getEstado() );
cardLayout.show( this, PANEL_CONSULTA_MARCACAO_NAME );
}
else
@ -334,37 +334,10 @@ public class ProcessoDadosPanel extends JPanel
if( exame != null )
{
inputExameData.setObject( exame.getData() );
inputExameEstado.setObject( exame.getEstados() );
inputExameEstado.setSelectedObject( exame.getEstado() );
HashMap<PrtGruposProtocolo, String> grupos = new HashMap<PrtGruposProtocolo, String>();
Trabalhadores trabalhador = exame.getToTrabalhadores();
Integer perfil = trabalhador.getPerfil();
if( perfil != null )
{
Empresas empresa = trabalhador.getToEstabelecimentos().getToEmpresas();
List<PrtElementosProtocolo> ecdsPerfil = (List<PrtElementosProtocolo>) empresa.getPrtElementosProtocoloArray();
for( PrtElementosProtocolo ecdPerfil : ecdsPerfil )
{
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 );
inputExameEstado.setObject( exame.getEstados() , exame.getEstado());
OrderedMap<PrtGruposProtocolo> grupos = exame.getGruposExamesForPerfil();
inputExameGruposEcds.setCollapseOptions( false );
inputExameGruposEcds.setObject( grupos,grupos.getFirst() );
cardLayout.show( this, PANEL_EXAME_NAME );
}
else
@ -379,15 +352,10 @@ public class ProcessoDadosPanel extends JPanel
if( exameMarcacao != null )
{
inputExameMarcacaoData.setObject( exameMarcacao.getData() );
inputExameMarcacaoEstado.setObject( exameMarcacao.getEstados() );
inputExameMarcacaoEstado.setSelectedObject( exameMarcacao.getEstado() );
// TODO mostrar lista de exames disponiveis para a marcacao
List<TrabalhadoresEcd> ecds = (List<TrabalhadoresEcd>) exameMarcacao.getTrabalhadoresEcdArray();
for( TrabalhadoresEcd ecd : ecds )
{
Integer ecdEstado = ecd.getEstado();
// ecd.get
}
inputExameMarcacaoEstado.setObject( exameMarcacao.getEstados(), exameMarcacao.getEstado() );
OrderedMap<PrtGruposProtocolo> grupos = exameMarcacao.getGruposExames();
inputExameMarcacaoGruposEcds.setCollapseOptions( false );
inputExameMarcacaoGruposEcds.setObject( grupos, grupos.getFirst() );
cardLayout.show( this, PANEL_EXAME_MARCACAO_NAME );
}
else
@ -430,7 +398,7 @@ public class ProcessoDadosPanel extends JPanel
public void setForNewProcesso( TrabalhadoresProcesso processo )
{
HashMap<Integer, String> tipos = processo.getMotivos();
LeafOptionDialog<Integer> option = new LeafOptionDialog<Integer>(getParentFrame(), this, tipos, "Escolha o tipo de processo:");
LeafOptionDialog<Integer> option = new LeafOptionDialog<Integer>(tipos, "Escolha o tipo de processo:");
Integer chosen = option.getOption();
if(chosen != null)
{
@ -454,6 +422,7 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = CREATE_CONSULTA_MARCACAO_EMAIL)
public void setForNewConsultaMarcacaoEmail( TrabalhadoresConsultasDatasEmails email )
{
}
@LeafUIActionBinding(action = CREATE_CONSULTA_MARCACAO_OBSERVACOES)
@ -476,6 +445,13 @@ public class ProcessoDadosPanel extends JPanel
LeafCalendarDialog calendar = new LeafCalendarDialog( getParentFrame(), this, false, false );
Date date = calendar.getDate();
marcacao.setData( date );
OrderedMap<PrtGruposProtocolo> grupos = marcacao.getToTrabalhadoresEcds().getGruposExamesForPerfil();
LeafOptionDialog<PrtGruposProtocolo> gruposChosen = new LeafOptionDialog<PrtGruposProtocolo>(grupos,"Escolha os ECDs a marcar");
for(PrtGruposProtocolo grupo : gruposChosen.getSelected())
{
marcacao.marcarGrupoExames(grupo);
}
}
@LeafUIActionBinding(action = CREATE_EXAME_MARCACAO_EMAIL)
@ -514,7 +490,7 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = SAVE_CONSULTA_MARCACAO_OBSERVACOES)
public void updateToSaveConsultaMarcacaoObservacoes( TrabalhadoresConsultasDatasObservacoes observacoes )
{
observacoes.setObservacao( inputConsultaMarcacaoObsMensagem.getText() );
observacoes.setObservacao( inputConsultaMarcacaoObsMensagem.getObject() );
}
@LeafUIActionBinding(action = SAVE_EXAME)
@ -539,9 +515,10 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = SAVE_EXAME_MARCACAO_OBSERVACOES)
public void updateToSaveExameMarcacaoObservacoes( TrabalhadoresEcdsDatasObservacoes observacoes )
{
observacoes.setObservacao( inputExameMarcacaoObsMensagem.getText() );
observacoes.setObservacao( inputExameMarcacaoObsMensagem.getObject() );
}
private void setupStartPanel()
{
}
@ -552,7 +529,7 @@ public class ProcessoDadosPanel extends JPanel
FILL
};
double[] rows = new double[field.length];
for( int i = 0; i < field.length; rows[i++] = MINIMUM )
for( int i = 0; i < field.length; rows[i++] = TableLayout.PREFERRED )
;
rows[rows.length - 1] = FILL;
TableLayout layout = new TableLayout( cols, rows );
@ -572,11 +549,6 @@ public class ProcessoDadosPanel extends JPanel
private void setupTrabalhadorPanel()
{
// 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 );
}
@ -588,8 +560,6 @@ public class ProcessoDadosPanel extends JPanel
private void setupConsultaPanel()
{
setupSimpleDataPanel( panelConsulta, "Consulta", labelConsultaEstado, inputConsultaEstado, labelConsultaData, inputConsultaData, new JPanel() );
// inputConsultaEstado.setEditable( true );
// inputConsultaData.setEditable( true );
}
private void setupConsultaMarcacaoPanel()
@ -604,7 +574,6 @@ public class ProcessoDadosPanel extends JPanel
private void setupConsultaMarcacaoObservacoesPanel()
{
// inputConsultaMarcacaoObsMensagem.setEditable( false );
setupSimpleDataPanel( panelConsultaMarcacaoObservacao, "Observa" + ccedil + otilde + "es", inputConsultaMarcacaoObsMensagem );
}
@ -615,7 +584,7 @@ public class ProcessoDadosPanel extends JPanel
private void setupExameMarcacaoPanel()
{
setupSimpleDataPanel( panelExameMarcacao, "Marca" + ccedil + atilde + "o de Exame", labelExameMarcacaoEstado, inputExameMarcacaoEstado, labelExameMarcacaoData, inputExameMarcacaoData, new JPanel() );
setupSimpleDataPanel( panelExameMarcacao, "Marca" + ccedil + atilde + "o de Exame", labelExameMarcacaoEstado, inputExameMarcacaoEstado, labelExameMarcacaoData, inputExameMarcacaoData, labelExameMarcacaoGruposEcds, inputExameMarcacaoGruposEcds,new JPanel() );
}
private void setupExameMarcacaoEmailPanel()
@ -625,7 +594,6 @@ public class ProcessoDadosPanel extends JPanel
private void setupExameMarcacaoObservacoesPanel()
{
// inputExameMarcacaoObsMensagem.setEditable( false );
setupSimpleDataPanel( panelExameMarcacaoObservacao, "Observa" + ccedil + otilde + "es", inputExameMarcacaoObsMensagem );
}

@ -2,6 +2,7 @@ package siprp.ui;
import static siprp.logic.SIPRPLogic.ACTION_STARTUP;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
@ -419,28 +420,34 @@ public class SIPRPWindow extends JFrame implements TrackableWindow, ListSelectio
private void runGivenAction( String actionName, Object argument )
{
System.out.println( "Running: " + actionName );
if( actionName != null && mapActionByName.containsKey( actionName ) )
{
Action action = mapActionByName.get( actionName );
if( action.isSave() )
try{
this.setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ));
if( actionName != null && mapActionByName.containsKey( actionName ) )
{
Object windowArgument = getObjectForAction( actionName );
Object logicArgument = windowArgument;
for( Method currentWindowMethod : mapWindowMethodsByActionName.get( actionName ) )
Action action = mapActionByName.get( actionName );
if( action.isSave() )
{
Object currentLogicArgument = runWindowMethod( currentWindowMethod, windowArgument != null ? windowArgument : argument );
logicArgument = logicArgument == null ? currentLogicArgument : logicArgument;
Object windowArgument = getObjectForAction( actionName );
Object logicArgument = windowArgument;
for( Method currentWindowMethod : mapWindowMethodsByActionName.get( actionName ) )
{
Object currentLogicArgument = runWindowMethod( currentWindowMethod, windowArgument != null ? windowArgument : argument );
logicArgument = logicArgument == null ? currentLogicArgument : logicArgument;
}
runLogicMethod( mapLogicMethodByActionName.get( actionName ), logicArgument );
}
runLogicMethod( mapLogicMethodByActionName.get( actionName ), logicArgument );
}
else
{
Object windowArgument = runLogicMethod( mapLogicMethodByActionName.get( actionName ), argument );
for( Method currentWindowMethod : mapWindowMethodsByActionName.get( actionName ) )
else
{
runWindowMethod( currentWindowMethod, windowArgument != null ? windowArgument : argument );
Object windowArgument = runLogicMethod( mapLogicMethodByActionName.get( actionName ), argument );
for( Method currentWindowMethod : mapWindowMethodsByActionName.get( actionName ) )
{
runWindowMethod( currentWindowMethod, windowArgument != null ? windowArgument : argument );
}
}
}
}finally
{
this.setCursor( Cursor.getDefaultCursor());
}
}

Loading…
Cancel
Save