diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/build-impl.xml b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/build-impl.xml index cb545f8d..30bc61b4 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/build-impl.xml +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/build-impl.xml @@ -400,6 +400,8 @@ + + @@ -419,7 +421,7 @@ - + @@ -427,6 +429,7 @@ + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/genfiles.properties b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/genfiles.properties index 05622b2a..dac81cc4 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/genfiles.properties +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=f9aca309 +build.xml.data.CRC32=2ba63215 build.xml.script.CRC32=ab1471e9 build.xml.stylesheet.CRC32=95be3570 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=f9aca309 -nbproject/build-impl.xml.script.CRC32=39ccfd31 +nbproject/build-impl.xml.data.CRC32=2ba63215 +nbproject/build-impl.xml.script.CRC32=cae04df0 nbproject/build-impl.xml.stylesheet.CRC32=ac43bae1 diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/project.properties b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/project.properties index fff16ec3..2ae3bd37 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/project.properties +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/project.properties @@ -2,7 +2,7 @@ build.classes.dir=${build.web.dir}/WEB-INF/classes build.classes.excludes=**/*.java,**/*.form build.dir=build build.ear.classes.dir=${build.ear.web.dir}/WEB-INF/classes -build.ear.web.dir=${build.dir}/ear-module +build.ear.web.dir=${build.dir}/web build.generated.dir=${build.dir}/generated build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results @@ -21,6 +21,7 @@ dist.ear.war=${dist.dir}/${war.ear.name} dist.javadoc.dir=${dist.dir}/javadoc dist.war=${dist.dir}/${war.name} file.reference.activation.jar=jars/activation.jar +file.reference.itext-2.0.5.jar=../../../Download/iText205/itext-2.0.5.jar file.reference.mail.jar=jars/mail.jar file.reference.postgresql-8.2-506.jdbc4.jar=jars/postgresql-8.2-506.jdbc4.jar j2ee.platform=1.4 @@ -35,7 +36,8 @@ javac.classpath=\ ${libs.jstl11.classpath}:\ ${file.reference.activation.jar}:\ ${file.reference.mail.jar}:\ - ${file.reference.postgresql-8.2-506.jdbc4.jar} + ${file.reference.postgresql-8.2-506.jdbc4.jar}:\ + ${file.reference.itext-2.0.5.jar} # Space-separated list of extra javac options javac.compilerargs= javac.debug=true @@ -83,3 +85,4 @@ war.ear.name=AnaliseAcidentesTrabalho.war war.name=AnaliseAcidentesTrabalho.war war.package=true web.docbase.dir=web +webinf.dir=web/WEB-INF diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/project.xml b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/project.xml index 4164ef85..11fbc246 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/project.xml +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/nbproject/project.xml @@ -2,7 +2,7 @@ org.netbeans.modules.web.project - + AnaliseAcidentesTrabalho 1.6 @@ -37,6 +37,10 @@ ${file.reference.postgresql-8.2-506.jdbc4.jar} WEB-INF/lib + + ${file.reference.itext-2.0.5.jar} + WEB-INF/lib + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Acidentado.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Acidentado.java new file mode 100644 index 00000000..f8d7fa1d --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Acidentado.java @@ -0,0 +1,138 @@ +/* + * Acidentado.java + * + * Created on October 16, 2007, 2:36 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class Acidentado { + private Integer id; + private String nome; + private java.sql.Date data_nascimento; + private String bilhete_identidade; + private String morada; + private String cod_postal; + private String localidade; + private String contacto_telefonico; + private java.sql.Date data_admissao; + private String funcao; + private String turno; + private Integer trabalhador_id; + private String numero_mecanografico; + /** Creates a new instance of Acidentado */ + public Acidentado() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public java.sql.Date getData_nascimento() { + return data_nascimento; + } + + public void setData_nascimento(java.sql.Date data_nascimento) { + this.data_nascimento = data_nascimento; + } + + public String getBilhete_identidade() { + return bilhete_identidade; + } + + public void setBilhete_identidade(String bilhete_identidade) { + this.bilhete_identidade = bilhete_identidade; + } + + public String getMorada() { + return morada; + } + + public void setMorada(String morada) { + this.morada = morada; + } + + public String getCod_postal() { + return cod_postal; + } + + public void setCod_postal(String cod_postal) { + this.cod_postal = cod_postal; + } + + public String getLocalidade() { + return localidade; + } + + public void setLocalidade(String localidade) { + this.localidade = localidade; + } + + public String getContacto_telefonico() { + return contacto_telefonico; + } + + public void setContacto_telefonico(String contacto_telefonico) { + this.contacto_telefonico = contacto_telefonico; + } + + public java.sql.Date getData_admissao() { + return data_admissao; + } + + public void setData_admissao(java.sql.Date data_admissao) { + this.data_admissao = data_admissao; + } + + public String getFuncao() { + return funcao; + } + + public void setFuncao(String funcao) { + this.funcao = funcao; + } + + public Integer getTrabalhador_id() { + return trabalhador_id; + } + + public void setTrabalhador_id(Integer trabalhador_id) { + this.trabalhador_id = trabalhador_id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getTurno() { + return turno; + } + + public void setTurno(String turno) { + this.turno = turno; + } + + public String getNumero_mecanografico() { + return numero_mecanografico; + } + + public void setNumero_mecanografico(String numero_mecanografico) { + this.numero_mecanografico = numero_mecanografico; + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidente.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidente.java index d44d858a..37fdc5bb 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidente.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidente.java @@ -10,6 +10,7 @@ package analiseacidentestrabalho; import java.sql.Date; +import java.sql.Time; /** * @@ -18,11 +19,15 @@ import java.sql.Date; public class AnaliseAcidente { private Integer id; private Integer nr; + private String analise_nr; private Date data_acidente; - private Integer trabalhador_id; + private Integer acidentado_id; private String nome_acidentado; + private Integer empresa_id; private Integer estabelecimento_id; private Integer estado; + private Integer estado_assinatura; + private String fase; private String morada; private String telefone; @@ -39,6 +44,77 @@ public class AnaliseAcidente { private String conclusoes; private String accoes; + private Time hora_acidente; + private String formacao_shst; + private String formacao_shst_nao_porque; + private String outros_acidentes_com_colaborador; + private Integer nr_acidentes_com_colaborador; + private Integer nr_relatorio_acidente_colaborador1; + private Integer nr_relatorio_acidente_colaborador2; + private Integer nr_relatorio_acidente_colaborador3; + private Integer nr_relatorio_acidente_colaborador4; + private String acidentes_outros_colaboradores; + private Integer nr_acidentes_outros_colaboradores; + private Integer nr_relatorio_acidente_outros_colaboradores1; + private Integer nr_relatorio_acidente_outros_colaboradores2; + private Integer nr_relatorio_acidente_outros_colaboradores3; + private Integer nr_relatorio_acidente_outros_colaboradores4; + + private String lesao_cabeca; + private String lesao_pescoco; + private String lesao_tronco; + private String lesao_membro_sup_dir; + private String lesao_membro_sup_esq; + private String lesao_membro_inf_dir; + private String lesao_membro_inf_esq; + private String especif1; + private String especif2; + private String especif3; + private String especif4; + private String tipo_lesao; + private String tipo_incapacidade; // 't' ou 'p' + private Integer coef_incapacidade; + private Date data_aval_incapacidade; + private Date data_rev_incapacidade; + private Date periodo_incapacidade_de; + private Date periodo_incapacidade_a; + private String img_flexao; + private String img_ext1; + private String img_ext2; + private String img_cab2; + private String img_cab3; + private String img_ma2; + private String img_ma3; + private String img_ma5; + private String img_ma6; + private String img_ma8; + private String img_ma10; + + private String img_rot1; + private String img_rot2; + private String img_cab1; + private String img_cab4; + private String img_ma1; + private String img_ma4; + private String img_ma7; + private String img_ma9; + + private Integer restricao_carga; + private String restricao_motricidade; + private String restricao_conducao; + private String restricao_vibracoes; + private String restricao_outras; + private String med_observ; + + private Integer medico_id; + private Integer tecnico_saude_id; + + private String ass_resp_seg; + private String ass_seg; + private String ass_hs; + private String ass_med; + private String ass_resp_rh; + /** Creates a new instance of AnaliseAcidente */ public AnaliseAcidente() { } @@ -59,12 +135,12 @@ public class AnaliseAcidente { this.data_acidente = data_acidente; } - public Integer getTrabalhador_id() { - return trabalhador_id; + public Integer getAcidentado_id() { + return acidentado_id; } - public void setTrabalhador_id(Integer trabalhador_id) { - this.trabalhador_id = trabalhador_id; + public void setAcidentado_id(Integer acidentado_id) { + this.acidentado_id = acidentado_id; } public Integer getEstado() { @@ -210,5 +286,557 @@ public class AnaliseAcidente { public void setAccoes(String accoes) { this.accoes = accoes; } + + public Time getHora_acidente() { + return hora_acidente; + } + + public void setHora_acidente(Time hora_acidente) { + this.hora_acidente = hora_acidente; + } + + public String getFormacao_shst() { + return formacao_shst; + } + + public void setFormacao_shst(String formacao_shst) { + this.formacao_shst = formacao_shst; + } + + public String getFormacao_shst_nao_porque() { + return formacao_shst_nao_porque; + } + + public void setFormacao_shst_nao_porque(String formacao_shst_nao_porque) { + this.formacao_shst_nao_porque = formacao_shst_nao_porque; + } + + public String getOutros_acidentes_com_colaborador() { + return outros_acidentes_com_colaborador; + } + + public void setOutros_acidentes_com_colaborador(String outros_acidentes_com_colaborador) { + this.outros_acidentes_com_colaborador = outros_acidentes_com_colaborador; + } + + public Integer getNr_acidentes_com_colaborador() { + return nr_acidentes_com_colaborador; + } + + public void setNr_acidentes_com_colaborador(Integer nr_acidentes_com_colaborador) { + this.nr_acidentes_com_colaborador = nr_acidentes_com_colaborador; + } + + public Integer getNr_relatorio_acidente_colaborador1() { + return nr_relatorio_acidente_colaborador1; + } + + public void setNr_relatorio_acidente_colaborador1(Integer nr_relatorio_acidente_colaborador1) { + this.nr_relatorio_acidente_colaborador1 = nr_relatorio_acidente_colaborador1; + } + + public Integer getNr_relatorio_acidente_colaborador2() { + return nr_relatorio_acidente_colaborador2; + } + + public void setNr_relatorio_acidente_colaborador2(Integer nr_relatorio_acidente_colaborador2) { + this.nr_relatorio_acidente_colaborador2 = nr_relatorio_acidente_colaborador2; + } + + public Integer getNr_relatorio_acidente_colaborador3() { + return nr_relatorio_acidente_colaborador3; + } + + public void setNr_relatorio_acidente_colaborador3(Integer nr_relatorio_acidente_colaborador3) { + this.nr_relatorio_acidente_colaborador3 = nr_relatorio_acidente_colaborador3; + } + + public Integer getNr_relatorio_acidente_colaborador4() { + return nr_relatorio_acidente_colaborador4; + } + + public void setNr_relatorio_acidente_colaborador4(Integer nr_relatorio_acidente_colaborador4) { + this.nr_relatorio_acidente_colaborador4 = nr_relatorio_acidente_colaborador4; + } + + public String getAcidentes_outros_colaboradores() { + return acidentes_outros_colaboradores; + } + + public void setAcidentes_outros_colaboradores(String acidentes_outros_colaboradores) { + this.acidentes_outros_colaboradores = acidentes_outros_colaboradores; + } + + public Integer getNr_acidentes_outros_colaboradores() { + return nr_acidentes_outros_colaboradores; + } + + public void setNr_acidentes_outros_colaboradores(Integer nr_acidentes_outros_colaboradores) { + this.nr_acidentes_outros_colaboradores = nr_acidentes_outros_colaboradores; + } + + public Integer getNr_relatorio_acidente_outros_colaboradores1() { + return nr_relatorio_acidente_outros_colaboradores1; + } + + public void setNr_relatorio_acidente_outros_colaboradores1(Integer nr_relatorio_acidente_outros_colaboradores1) { + this.nr_relatorio_acidente_outros_colaboradores1 = nr_relatorio_acidente_outros_colaboradores1; + } + + public Integer getNr_relatorio_acidente_outros_colaboradores2() { + return nr_relatorio_acidente_outros_colaboradores2; + } + + public void setNr_relatorio_acidente_outros_colaboradores2(Integer nr_relatorio_acidente_outros_colaboradores2) { + this.nr_relatorio_acidente_outros_colaboradores2 = nr_relatorio_acidente_outros_colaboradores2; + } + + public Integer getNr_relatorio_acidente_outros_colaboradores3() { + return nr_relatorio_acidente_outros_colaboradores3; + } + + public void setNr_relatorio_acidente_outros_colaboradores3(Integer nr_relatorio_acidente_outros_colaboradores3) { + this.nr_relatorio_acidente_outros_colaboradores3 = nr_relatorio_acidente_outros_colaboradores3; + } + + public Integer getNr_relatorio_acidente_outros_colaboradores4() { + return nr_relatorio_acidente_outros_colaboradores4; + } + + public void setNr_relatorio_acidente_outros_colaboradores4(Integer nr_relatorio_acidente_outros_colaboradores4) { + this.nr_relatorio_acidente_outros_colaboradores4 = nr_relatorio_acidente_outros_colaboradores4; + } + + public String getLesao_cabeca() { + return lesao_cabeca; + } + + public void setLesao_cabeca(String lesao_cabeca) { + this.lesao_cabeca = lesao_cabeca; + } + + public String getLesao_pescoco() { + return lesao_pescoco; + } + + public void setLesao_pescoco(String lesao_pescoco) { + this.lesao_pescoco = lesao_pescoco; + } + + public String getLesao_tronco() { + return lesao_tronco; + } + + public void setLesao_tronco(String lesao_tronco) { + this.lesao_tronco = lesao_tronco; + } + + public String getLesao_membro_sup_dir() { + return lesao_membro_sup_dir; + } + + public void setLesao_membro_sup_dir(String lesao_membro_sup_dir) { + this.lesao_membro_sup_dir = lesao_membro_sup_dir; + } + + public String getLesao_membro_sup_esq() { + return lesao_membro_sup_esq; + } + + public void setLesao_membro_sup_esq(String lesao_membro_sup_esq) { + this.lesao_membro_sup_esq = lesao_membro_sup_esq; + } + + public String getLesao_membro_inf_dir() { + return lesao_membro_inf_dir; + } + + public void setLesao_membro_inf_dir(String lesao_membro_inf_dir) { + this.lesao_membro_inf_dir = lesao_membro_inf_dir; + } + + public String getLesao_membro_inf_esq() { + return lesao_membro_inf_esq; + } + + public void setLesao_membro_inf_esq(String lesao_membro_inf_esq) { + this.lesao_membro_inf_esq = lesao_membro_inf_esq; + } + + public String getEspecif1() { + return especif1; + } + + public void setEspecif1(String especif1) { + this.especif1 = especif1; + } + + public String getEspecif2() { + return especif2; + } + + public void setEspecif2(String especif2) { + this.especif2 = especif2; + } + + public String getEspecif3() { + return especif3; + } + + public void setEspecif3(String especif3) { + this.especif3 = especif3; + } + + public String getEspecif4() { + return especif4; + } + + public void setEspecif4(String especif4) { + this.especif4 = especif4; + } + + public String getTipo_incapacidade() { + return tipo_incapacidade; + } + + public void setTipo_incapacidade(String tipo_incapacidade) { + this.tipo_incapacidade = tipo_incapacidade; + } + + public Integer getCoef_incapacidade() { + return coef_incapacidade; + } + + public void setCoef_incapacidade(Integer coef_incapacidade) { + this.coef_incapacidade = coef_incapacidade; + } + + public Date getData_aval_incapacidade() { + return data_aval_incapacidade; + } + + public void setData_aval_incapacidade(Date data_aval_incapacidade) { + this.data_aval_incapacidade = data_aval_incapacidade; + } + + public Date getData_rev_incapacidade() { + return data_rev_incapacidade; + } + + public void setData_rev_incapacidade(Date data_rev_incapacidade) { + this.data_rev_incapacidade = data_rev_incapacidade; + } + + public Date getPeriodo_incapacidade_de() { + return periodo_incapacidade_de; + } + + public void setPeriodo_incapacidade_de(Date periodo_incapacidade_de) { + this.periodo_incapacidade_de = periodo_incapacidade_de; + } + + public Date getPeriodo_incapacidade_a() { + return periodo_incapacidade_a; + } + + public void setPeriodo_incapacidade_a(Date periodo_incapacidade_a) { + this.periodo_incapacidade_a = periodo_incapacidade_a; + } + + public String getImg_flexao() { + return img_flexao; + } + + public void setImg_flexao(String img_flexao) { + this.img_flexao = img_flexao; + } + + public String getImg_ext1() { + return img_ext1; + } + + public void setImg_ext1(String img_ext1) { + this.img_ext1 = img_ext1; + } + + public String getImg_ext2() { + return img_ext2; + } + + public void setImg_ext2(String img_ext2) { + this.img_ext2 = img_ext2; + } + + public String getImg_cab2() { + return img_cab2; + } + + public void setImg_cab2(String img_cab2) { + this.img_cab2 = img_cab2; + } + + public String getImg_cab3() { + return img_cab3; + } + + public void setImg_cab3(String img_cab3) { + this.img_cab3 = img_cab3; + } + + public String getImg_ma2() { + return img_ma2; + } + + public void setImg_ma2(String img_ma2) { + this.img_ma2 = img_ma2; + } + + public String getImg_ma3() { + return img_ma3; + } + + public void setImg_ma3(String img_ma3) { + this.img_ma3 = img_ma3; + } + + public String getImg_ma5() { + return img_ma5; + } + + public void setImg_ma5(String img_ma5) { + this.img_ma5 = img_ma5; + } + + public String getImg_ma6() { + return img_ma6; + } + + public void setImg_ma6(String img_ma6) { + this.img_ma6 = img_ma6; + } + + public String getImg_ma8() { + return img_ma8; + } + + public void setImg_ma8(String img_ma8) { + this.img_ma8 = img_ma8; + } + + public String getImg_ma10() { + return img_ma10; + } + + public void setImg_ma10(String img_ma10) { + this.img_ma10 = img_ma10; + } + + public Integer getRestricao_carga() { + return restricao_carga; + } + + public void setRestricao_carga(Integer restricao_carga) { + this.restricao_carga = restricao_carga; + } + + public String getRestricao_motricidade() { + return restricao_motricidade; + } + + public void setRestricao_motricidade(String restricao_motricidade) { + this.restricao_motricidade = restricao_motricidade; + } + + public String getRestricao_conducao() { + return restricao_conducao; + } + + public void setRestricao_conducao(String restricao_conducao) { + this.restricao_conducao = restricao_conducao; + } + + public String getRestricao_vibracoes() { + return restricao_vibracoes; + } + + public void setRestricao_vibracoes(String restricao_vibracoes) { + this.restricao_vibracoes = restricao_vibracoes; + } + + public String getRestricao_outras() { + return restricao_outras; + } + + public void setRestricao_outras(String restricao_outras) { + this.restricao_outras = restricao_outras; + } + + public String getMed_observ() { + return med_observ; + } + + public void setMed_observ(String med_observ) { + this.med_observ = med_observ; + } + + public String getTipo_lesao() { + return tipo_lesao; + } + + public void setTipo_lesao(String tipo_lesao) { + this.tipo_lesao = tipo_lesao; + } + + public String getImg_rot1() { + return img_rot1; + } + + public void setImg_rot1(String img_rot1) { + this.img_rot1 = img_rot1; + } + + public String getImg_rot2() { + return img_rot2; + } + + public void setImg_rot2(String img_rot2) { + this.img_rot2 = img_rot2; + } + + public String getImg_cab1() { + return img_cab1; + } + + public void setImg_cab1(String img_cab1) { + this.img_cab1 = img_cab1; + } + + public String getImg_cab4() { + return img_cab4; + } + + public void setImg_cab4(String img_cab4) { + this.img_cab4 = img_cab4; + } + + public String getImg_ma1() { + return img_ma1; + } + + public void setImg_ma1(String img_ma1) { + this.img_ma1 = img_ma1; + } + + public String getImg_ma4() { + return img_ma4; + } + + public void setImg_ma4(String img_ma4) { + this.img_ma4 = img_ma4; + } + + public String getImg_ma7() { + return img_ma7; + } + + public void setImg_ma7(String img_ma7) { + this.img_ma7 = img_ma7; + } + + public String getImg_ma9() { + return img_ma9; + } + + public void setImg_ma9(String img_ma9) { + this.img_ma9 = img_ma9; + } + + public Integer getEmpresa_id() { + return empresa_id; + } + + public void setEmpresa_id(Integer empresa_id) { + this.empresa_id = empresa_id; + } + + public Integer getMedico_id() { + return medico_id; + } + + public void setMedico_id(Integer medico_id) { + this.medico_id = medico_id; + } + + public Integer getTecnico_saude_id() { + return tecnico_saude_id; + } + + public void setTecnico_saude_id(Integer tecnico_saude_id) { + this.tecnico_saude_id = tecnico_saude_id; + } + + public String getAnalise_nr() { + return analise_nr; + } + + public void setAnalise_nr(String analise_nr) { + this.analise_nr = analise_nr; + } + + public String getFase() { + return fase; + } + + public void setFase(String fase) { + this.fase = fase; + } + + public Integer getEstado_assinatura() { + return estado_assinatura; + } + + public void setEstado_assinatura(Integer estado_assinatura) { + this.estado_assinatura = estado_assinatura; + } + + public String getAss_resp_seg() { + return ass_resp_seg; + } + + public void setAss_resp_seg(String ass_resp_seg) { + this.ass_resp_seg = ass_resp_seg; + } + + public String getAss_seg() { + return ass_seg; + } + + public void setAss_seg(String ass_seg) { + this.ass_seg = ass_seg; + } + + public String getAss_hs() { + return ass_hs; + } + + public void setAss_hs(String ass_hs) { + this.ass_hs = ass_hs; + } + + public String getAss_med() { + return ass_med; + } + + public void setAss_med(String ass_med) { + this.ass_med = ass_med; + } + + public String getAss_resp_rh() { + return ass_resp_rh; + } + + public void setAss_resp_rh(String ass_resp_rh) { + this.ass_resp_rh = ass_resp_rh; + } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java index 58dc8fe7..c5b04ce6 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java @@ -10,9 +10,11 @@ import com.sun.data.provider.RowKey; import com.sun.rave.web.ui.appbase.AbstractPageBean; import com.sun.rave.web.ui.component.Body; import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Checkbox; import com.sun.rave.web.ui.component.DropDown; import com.sun.rave.web.ui.component.Form; import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.HiddenField; import com.sun.rave.web.ui.component.Html; import com.sun.rave.web.ui.component.Hyperlink; import com.sun.rave.web.ui.component.ImageComponent; @@ -20,21 +22,44 @@ import com.sun.rave.web.ui.component.ImageHyperlink; import com.sun.rave.web.ui.component.Link; import com.sun.rave.web.ui.component.Page; import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.RadioButton; import com.sun.rave.web.ui.component.StaticText; import com.sun.rave.web.ui.component.Table; import com.sun.rave.web.ui.component.TableColumn; import com.sun.rave.web.ui.component.TableRowGroup; import com.sun.rave.web.ui.component.TextArea; import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.SingleSelectOptionsList; import db.AnalisesDataProvider; import db.TrabalhadoresListDataProvider; +import db.UtilizadoresDataProvider; import java.io.File; +import java.sql.Time; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.ListIterator; +import java.util.Properties; import javax.faces.FacesException; import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.el.MethodBinding; +import javax.faces.event.ValueChangeEvent; +import javax.mail.BodyPart; +import javax.mail.Message; +import javax.mail.Multipart; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeBodyPart; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMultipart; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import pagestate.AnaliseAcidenteTrabalhoState; +import pdf.Pdf; +import utils.Utils; /** *

Page bean that corresponds to a similarly named JSP page. This @@ -135,116 +160,6 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { this.gridLayout1 = hpg; } - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private Hyperlink lnkChangePassword = new Hyperlink(); - - public Hyperlink getLnkChangePassword() { - return lnkChangePassword; - } - - public void setLnkChangePassword(Hyperlink h) { - this.lnkChangePassword = h; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private Hyperlink lnkLogout = new Hyperlink(); - - public Hyperlink getLnkLogout() { - return lnkLogout; - } - - public void setLnkLogout(Hyperlink h) { - this.lnkLogout = h; - } - - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - private HtmlPanelGrid gridMsg = new HtmlPanelGrid(); public HtmlPanelGrid getGridMsg() { @@ -535,14 +450,14 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { this.groupPanel3 = pg; } - private DropDown dropDown1 = new DropDown(); + private DropDown drpTecnicos = new DropDown(); - public DropDown getDropDown1() { - return dropDown1; + public DropDown getDrpTecnicos() { + return drpTecnicos; } - public void setDropDown1(DropDown dd) { - this.dropDown1 = dd; + public void setDrpTecnicos(DropDown dd) { + this.drpTecnicos = dd; } private StaticText staticText10 = new StaticText(); @@ -585,14 +500,14 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { this.groupPanel4 = pg; } - private DropDown dropDown2 = new DropDown(); + private DropDown drpMedicos = new DropDown(); - public DropDown getDropDown2() { - return dropDown2; + public DropDown getDrpMedicos() { + return drpMedicos; } - public void setDropDown2(DropDown dd) { - this.dropDown2 = dd; + public void setDrpMedicos(DropDown dd) { + this.drpMedicos = dd; } private StaticText staticText12 = new StaticText(); @@ -614,6 +529,46 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { public void setTxtCedula(StaticText st) { this.txtCedula = st; } + + // + private String IMAGE_URL = "/resources/images"; + + private final static int ESTADO_SEG = 1; + private final static int ESTADO_RH1 = 2; + private final static int ESTADO_HS = 3; + private final static int ESTADO_RH2 = 4; + private final static int ESTADO_MEDICO = 5; + private final static int ESTADO_ASSINATURAS = 6; + private final static int ESTADO_IMPRESSAO = 7; + private final static int ESTADO_FECHAR = 8; + private final static int ESTADO_CONCLUIDO = 9; + + + private final static int ESTADO_ASSINATURA_1 = 1; + private final static int ESTADO_ASSINATURA_2 = 2; + private final static int ESTADO_ASSINATURA_3 = 3; + + private final static int ESTADO_ASSINATURA_RESP_SEG = 1; + private final static int ESTADO_ASSINATURA_SEG = 2; + private final static int ESTADO_ASSINATURA_HS = 3; + private final static int ESTADO_ASSINATURA_MED = 4; + private final static int ESTADO_ASSINATURA_RH = 5; + private final static int ESTADO_ASSINATURA_RESP_RH = 6; + + private final static int IMAGE_WIDTH = 48; + private final static int IMAGE_HEIGHT = 48; + + private static final String PDFS_FOLDER_URL = "/resources/pdfs"; + + private Hyperlink lnkLblTrabalhador = new Hyperlink(); + + public Hyperlink getLnkLblTrabalhador() { + return lnkLblTrabalhador; + } + + public void setLnkLblTrabalhador(Hyperlink h) { + this.lnkLblTrabalhador = h; + } private HtmlPanelGrid gridAcidentado = new HtmlPanelGrid(); @@ -625,54 +580,54 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { this.gridAcidentado = hpg; } - private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel8() { - return gridPanel8; + public HtmlPanelGrid getGridPanel23() { + return gridPanel23; } - public void setGridPanel8(HtmlPanelGrid hpg) { - this.gridPanel8 = hpg; + public void setGridPanel23(HtmlPanelGrid hpg) { + this.gridPanel23 = hpg; } - private StaticText staticText13 = new StaticText(); + private StaticText staticText29 = new StaticText(); - public StaticText getStaticText13() { - return staticText13; + public StaticText getStaticText29() { + return staticText29; } - public void setStaticText13(StaticText st) { - this.staticText13 = st; + public void setStaticText29(StaticText st) { + this.staticText29 = st; } - private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel9() { - return gridPanel9; + public HtmlPanelGrid getGridPanel24() { + return gridPanel24; } - public void setGridPanel9(HtmlPanelGrid hpg) { - this.gridPanel9 = hpg; + public void setGridPanel24(HtmlPanelGrid hpg) { + this.gridPanel24 = hpg; } - private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid(); + private HtmlPanelGrid gridPanel25 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel10() { - return gridPanel10; + public HtmlPanelGrid getGridPanel25() { + return gridPanel25; } - public void setGridPanel10(HtmlPanelGrid hpg) { - this.gridPanel10 = hpg; + public void setGridPanel25(HtmlPanelGrid hpg) { + this.gridPanel25 = hpg; } - private StaticText staticText14 = new StaticText(); + private StaticText staticText30 = new StaticText(); - public StaticText getStaticText14() { - return staticText14; + public StaticText getStaticText30() { + return staticText30; } - public void setStaticText14(StaticText st) { - this.staticText14 = st; + public void setStaticText30(StaticText st) { + this.staticText30 = st; } private StaticText txtNomeAcidentado = new StaticText(); @@ -685,14 +640,14 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { this.txtNomeAcidentado = st; } - private StaticText staticText15 = new StaticText(); + private StaticText staticText31 = new StaticText(); - public StaticText getStaticText15() { - return staticText15; + public StaticText getStaticText31() { + return staticText31; } - public void setStaticText15(StaticText st) { - this.staticText15 = st; + public void setStaticText31(StaticText st) { + this.staticText31 = st; } private StaticText txtDataNascimento = new StaticText(); @@ -705,1165 +660,9059 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { this.txtDataNascimento = st; } - private StaticText staticText16 = new StaticText(); + private StaticText staticText32 = new StaticText(); - public StaticText getStaticText16() { - return staticText16; + public StaticText getStaticText32() { + return staticText32; } - public void setStaticText16(StaticText st) { - this.staticText16 = st; + public void setStaticText32(StaticText st) { + this.staticText32 = st; } - private TextField txtHorasTurno = new TextField(); + private TextField txtBI = new TextField(); - public TextField getTxtHorasTurno() { - return txtHorasTurno; + public TextField getTxtBI() { + return txtBI; } - public void setTxtHorasTurno(TextField tf) { - this.txtHorasTurno = tf; + public void setTxtBI(TextField tf) { + this.txtBI = tf; } - private StaticText staticText17 = new StaticText(); + private StaticText staticText33 = new StaticText(); - public StaticText getStaticText17() { - return staticText17; + public StaticText getStaticText33() { + return staticText33; } - public void setStaticText17(StaticText st) { - this.staticText17 = st; + public void setStaticText33(StaticText st) { + this.staticText33 = st; } - private TextField txtSeccao = new TextField(); + private TextField txtMorada = new TextField(); - public TextField getTxtSeccao() { - return txtSeccao; + public TextField getTxtMorada() { + return txtMorada; } - public void setTxtSeccao(TextField tf) { - this.txtSeccao = tf; + public void setTxtMorada(TextField tf) { + this.txtMorada = tf; } - private StaticText staticText18 = new StaticText(); + private StaticText staticText34 = new StaticText(); - public StaticText getStaticText18() { - return staticText18; + public StaticText getStaticText34() { + return staticText34; } - public void setStaticText18(StaticText st) { - this.staticText18 = st; + public void setStaticText34(StaticText st) { + this.staticText34 = st; } - private TextField txtLocal = new TextField(); + private PanelGroup groupPanel6 = new PanelGroup(); - public TextField getTxtLocal() { - return txtLocal; + public PanelGroup getGroupPanel6() { + return groupPanel6; } - public void setTxtLocal(TextField tf) { - this.txtLocal = tf; + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; } - private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); + private TextField txtCodPostal1 = new TextField(); - public HtmlPanelGrid getGridPanel11() { - return gridPanel11; + public TextField getTxtCodPostal1() { + return txtCodPostal1; } - public void setGridPanel11(HtmlPanelGrid hpg) { - this.gridPanel11 = hpg; + public void setTxtCodPostal1(TextField tf) { + this.txtCodPostal1 = tf; } - private StaticText staticText19 = new StaticText(); + private StaticText staticText35 = new StaticText(); - public StaticText getStaticText19() { - return staticText19; + public StaticText getStaticText35() { + return staticText35; } - public void setStaticText19(StaticText st) { - this.staticText19 = st; + public void setStaticText35(StaticText st) { + this.staticText35 = st; } - private TextField txtTarefa = new TextField(); + private TextField txtCodPostal2 = new TextField(); - public TextField getTxtTarefa() { - return txtTarefa; + public TextField getTxtCodPostal2() { + return txtCodPostal2; } - public void setTxtTarefa(TextField tf) { - this.txtTarefa = tf; + public void setTxtCodPostal2(TextField tf) { + this.txtCodPostal2 = tf; } - private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); + private StaticText staticText36 = new StaticText(); - public HtmlPanelGrid getGridPanel12() { - return gridPanel12; + public StaticText getStaticText36() { + return staticText36; } - public void setGridPanel12(HtmlPanelGrid hpg) { - this.gridPanel12 = hpg; + public void setStaticText36(StaticText st) { + this.staticText36 = st; } - private StaticText staticText20 = new StaticText(); + private TextField txtLocalidade = new TextField(); - public StaticText getStaticText20() { - return staticText20; + public TextField getTxtLocalidade() { + return txtLocalidade; } - public void setStaticText20(StaticText st) { - this.staticText20 = st; + public void setTxtLocalidade(TextField tf) { + this.txtLocalidade = tf; } - private TextField txtSubstancias = new TextField(); + private StaticText staticText37 = new StaticText(); - public TextField getTxtSubstancias() { - return txtSubstancias; + public StaticText getStaticText37() { + return staticText37; } - public void setTxtSubstancias(TextField tf) { - this.txtSubstancias = tf; + public void setStaticText37(StaticText st) { + this.staticText37 = st; } - private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); + private TextField txtContactoTelefonico = new TextField(); - public HtmlPanelGrid getGridPanel13() { - return gridPanel13; + public TextField getTxtContactoTelefonico() { + return txtContactoTelefonico; } - public void setGridPanel13(HtmlPanelGrid hpg) { - this.gridPanel13 = hpg; + public void setTxtContactoTelefonico(TextField tf) { + this.txtContactoTelefonico = tf; } - private StaticText staticText21 = new StaticText(); + private StaticText staticText38 = new StaticText(); - public StaticText getStaticText21() { - return staticText21; + public StaticText getStaticText38() { + return staticText38; } - public void setStaticText21(StaticText st) { - this.staticText21 = st; + public void setStaticText38(StaticText st) { + this.staticText38 = st; } - private TextField txtSuperior = new TextField(); + private StaticText stDataAdmissao = new StaticText(); - public TextField getTxtSuperior() { - return txtSuperior; + public StaticText getStDataAdmissao() { + return stDataAdmissao; } - public void setTxtSuperior(TextField tf) { - this.txtSuperior = tf; + public void setStDataAdmissao(StaticText st) { + this.stDataAdmissao = st; } - private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); + private StaticText staticText39 = new StaticText(); - public HtmlPanelGrid getGridPanel14() { - return gridPanel14; + public StaticText getStaticText39() { + return staticText39; } - public void setGridPanel14(HtmlPanelGrid hpg) { - this.gridPanel14 = hpg; + public void setStaticText39(StaticText st) { + this.staticText39 = st; } - private StaticText staticText22 = new StaticText(); + private StaticText stFuncao = new StaticText(); - public StaticText getStaticText22() { - return staticText22; + public StaticText getStFuncao() { + return stFuncao; } - public void setStaticText22(StaticText st) { - this.staticText22 = st; + public void setStFuncao(StaticText st) { + this.stFuncao = st; } - private TextField txtCondicoes = new TextField(); + private StaticText staticText40 = new StaticText(); - public TextField getTxtCondicoes() { - return txtCondicoes; + public StaticText getStaticText40() { + return staticText40; } - public void setTxtCondicoes(TextField tf) { - this.txtCondicoes = tf; + public void setStaticText40(StaticText st) { + this.staticText40 = st; } - private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); + private HtmlPanelGrid gridDadosAcidenteSeg = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel15() { - return gridPanel15; + public HtmlPanelGrid getGridDadosAcidenteSeg() { + return gridDadosAcidenteSeg; } - public void setGridPanel15(HtmlPanelGrid hpg) { - this.gridPanel15 = hpg; + public void setGridDadosAcidenteSeg(HtmlPanelGrid hpg) { + this.gridDadosAcidenteSeg = hpg; } - private StaticText staticText23 = new StaticText(); + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); - public StaticText getStaticText23() { - return staticText23; + public HtmlPanelGrid getGridPanel8() { + return gridPanel8; } - public void setStaticText23(StaticText st) { - this.staticText23 = st; + public void setGridPanel8(HtmlPanelGrid hpg) { + this.gridPanel8 = hpg; } - private TextField txtTestemunhas = new TextField(); + private StaticText staticText13 = new StaticText(); - public TextField getTxtTestemunhas() { - return txtTestemunhas; + public StaticText getStaticText13() { + return staticText13; } - public void setTxtTestemunhas(TextField tf) { - this.txtTestemunhas = tf; + public void setStaticText13(StaticText st) { + this.staticText13 = st; } - private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel16() { - return gridPanel16; + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; } - public void setGridPanel16(HtmlPanelGrid hpg) { - this.gridPanel16 = hpg; + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; } - private StaticText staticText24 = new StaticText(); + private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid(); - public StaticText getStaticText24() { - return staticText24; + public HtmlPanelGrid getGridPanel10() { + return gridPanel10; } - public void setStaticText24(StaticText st) { - this.staticText24 = st; + public void setGridPanel10(HtmlPanelGrid hpg) { + this.gridPanel10 = hpg; } - private TextField txtCausas = new TextField(); + private PanelGroup groupPanel8 = new PanelGroup(); - public TextField getTxtCausas() { - return txtCausas; + public PanelGroup getGroupPanel8() { + return groupPanel8; } - public void setTxtCausas(TextField tf) { - this.txtCausas = tf; + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; } - private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); + private StaticText staticText14 = new StaticText(); - public HtmlPanelGrid getGridPanel17() { - return gridPanel17; + public StaticText getStaticText14() { + return staticText14; } - public void setGridPanel17(HtmlPanelGrid hpg) { - this.gridPanel17 = hpg; + public void setStaticText14(StaticText st) { + this.staticText14 = st; } - private StaticText staticText25 = new StaticText(); + private StaticText stDataAcidente = new StaticText(); - public StaticText getStaticText25() { - return staticText25; + public StaticText getStDataAcidente() { + return stDataAcidente; } - public void setStaticText25(StaticText st) { - this.staticText25 = st; + public void setStDataAcidente(StaticText st) { + this.stDataAcidente = st; } - private TextField txtDescricao = new TextField(); + private PanelGroup groupPanel9 = new PanelGroup(); - public TextField getTxtDescricao() { - return txtDescricao; + public PanelGroup getGroupPanel9() { + return groupPanel9; } - public void setTxtDescricao(TextField tf) { - this.txtDescricao = tf; + public void setGroupPanel9(PanelGroup pg) { + this.groupPanel9 = pg; } - private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); + private StaticText staticText15 = new StaticText(); - public HtmlPanelGrid getGridPanel18() { - return gridPanel18; + public StaticText getStaticText15() { + return staticText15; } - public void setGridPanel18(HtmlPanelGrid hpg) { - this.gridPanel18 = hpg; + public void setStaticText15(StaticText st) { + this.staticText15 = st; } - private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); + private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel19() { - return gridPanel19; + public HtmlPanelGrid getGridPanel11() { + return gridPanel11; } - public void setGridPanel19(HtmlPanelGrid hpg) { - this.gridPanel19 = hpg; + public void setGridPanel11(HtmlPanelGrid hpg) { + this.gridPanel11 = hpg; } - private StaticText staticText26 = new StaticText(); + private StaticText staticText16 = new StaticText(); - public StaticText getStaticText26() { - return staticText26; + public StaticText getStaticText16() { + return staticText16; } - public void setStaticText26(StaticText st) { - this.staticText26 = st; + public void setStaticText16(StaticText st) { + this.staticText16 = st; } - private Button butImagem = new Button(); + private TextField txtHorasTurno = new TextField(); - public Button getButImagem() { - return butImagem; + public TextField getTxtHorasTurno() { + return txtHorasTurno; } - public void setButImagem(Button b) { - this.butImagem = b; + public void setTxtHorasTurno(TextField tf) { + this.txtHorasTurno = tf; } - private HtmlPanelGrid gridImages = new HtmlPanelGrid(); + private PanelGroup groupPanel10 = new PanelGroup(); - public HtmlPanelGrid getGridImages() { - return gridImages; + public PanelGroup getGroupPanel10() { + return groupPanel10; } - public void setGridImages(HtmlPanelGrid hpg) { - this.gridImages = hpg; + public void setGroupPanel10(PanelGroup pg) { + this.groupPanel10 = pg; } - private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); + private StaticText staticText17 = new StaticText(); - public HtmlPanelGrid getGridPanel20() { - return gridPanel20; + public StaticText getStaticText17() { + return staticText17; } - public void setGridPanel20(HtmlPanelGrid hpg) { - this.gridPanel20 = hpg; + public void setStaticText17(StaticText st) { + this.staticText17 = st; } - private StaticText staticText27 = new StaticText(); + private TextField txtSeccao = new TextField(); - public StaticText getStaticText27() { - return staticText27; + public TextField getTxtSeccao() { + return txtSeccao; } - public void setStaticText27(StaticText st) { - this.staticText27 = st; + public void setTxtSeccao(TextField tf) { + this.txtSeccao = tf; } - private TextArea txtConclusoes = new TextArea(); + private PanelGroup groupPanel11 = new PanelGroup(); - public TextArea getTxtConclusoes() { - return txtConclusoes; + public PanelGroup getGroupPanel11() { + return groupPanel11; } - public void setTxtConclusoes(TextArea ta) { - this.txtConclusoes = ta; + public void setGroupPanel11(PanelGroup pg) { + this.groupPanel11 = pg; } - private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); + private StaticText staticText18 = new StaticText(); - public HtmlPanelGrid getGridPanel21() { - return gridPanel21; + public StaticText getStaticText18() { + return staticText18; } - public void setGridPanel21(HtmlPanelGrid hpg) { - this.gridPanel21 = hpg; + public void setStaticText18(StaticText st) { + this.staticText18 = st; } - private StaticText staticText28 = new StaticText(); + private TextField txtLocal = new TextField(); - public StaticText getStaticText28() { - return staticText28; + public TextField getTxtLocal() { + return txtLocal; } - public void setStaticText28(StaticText st) { - this.staticText28 = st; + public void setTxtLocal(TextField tf) { + this.txtLocal = tf; } - private TextArea txtAccoes = new TextArea(); + private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); - public TextArea getTxtAccoes() { - return txtAccoes; + public HtmlPanelGrid getGridPanel12() { + return gridPanel12; } - public void setTxtAccoes(TextArea ta) { - this.txtAccoes = ta; + public void setGridPanel12(HtmlPanelGrid hpg) { + this.gridPanel12 = hpg; } - private HtmlPanelGrid gridPanel22 = new HtmlPanelGrid(); + private StaticText staticText19 = new StaticText(); - public HtmlPanelGrid getGridPanel22() { - return gridPanel22; + public StaticText getStaticText19() { + return staticText19; } - public void setGridPanel22(HtmlPanelGrid hpg) { - this.gridPanel22 = hpg; + public void setStaticText19(StaticText st) { + this.staticText19 = st; } - private Button butCancelar = new Button(); + private TextField txtTarefa = new TextField(); - public Button getButCancelar() { - return butCancelar; + public TextField getTxtTarefa() { + return txtTarefa; } - public void setButCancelar(Button b) { - this.butCancelar = b; + public void setTxtTarefa(TextField tf) { + this.txtTarefa = tf; } - - // - private String IMAGE_URL = "/resources/images"; - private PanelGroup groupPanel5 = new PanelGroup(); + private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); - public PanelGroup getGroupPanel5() { - return groupPanel5; + public HtmlPanelGrid getGridPanel13() { + return gridPanel13; } - public void setGroupPanel5(PanelGroup pg) { - this.groupPanel5 = pg; + public void setGridPanel13(HtmlPanelGrid hpg) { + this.gridPanel13 = hpg; } - private Button butGravar = new Button(); + private StaticText staticText20 = new StaticText(); - public Button getButGravar() { - return butGravar; + public StaticText getStaticText20() { + return staticText20; } - public void setButGravar(Button b) { - this.butGravar = b; + public void setStaticText20(StaticText st) { + this.staticText20 = st; } - private Button butEnviar = new Button(); + private TextField txtSubstancias = new TextField(); - public Button getButEnviar() { - return butEnviar; + public TextField getTxtSubstancias() { + return txtSubstancias; } - public void setButEnviar(Button b) { - this.butEnviar = b; + public void setTxtSubstancias(TextField tf) { + this.txtSubstancias = tf; } - private Hyperlink lnkLblTrabalhador = new Hyperlink(); + private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); - public Hyperlink getLnkLblTrabalhador() { - return lnkLblTrabalhador; + public HtmlPanelGrid getGridPanel14() { + return gridPanel14; } - public void setLnkLblTrabalhador(Hyperlink h) { - this.lnkLblTrabalhador = h; + public void setGridPanel14(HtmlPanelGrid hpg) { + this.gridPanel14 = hpg; } - /** - *

Construct a new Page bean instance.

- */ - public AnaliseAcidenteTrabalho() { + + private StaticText staticText21 = new StaticText(); + + public StaticText getStaticText21() { + return staticText21; } - - /** - *

Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.

- * - *

Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.

- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - // - // Initialize automatically managed components - // *Note* - this logic should NOT be modified - try { - _init(); - } catch (Exception e) { - log("AnaliseAcidenteTrabalho Initialization Failure", e); - throw e instanceof FacesException ? (FacesException) e: new FacesException(e); - } - - // - // Perform application initialization that must complete - // *after* managed components are initialized - // TODO - add your own initialization code here - - if (!getSessionBean1().isLoggedIn()) { - try { - getExternalContext().redirect("Login.jsp"); - } catch(Exception e) { - // . . . handle exception . . . - } - } - - HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); - String referer = request.getRequestURI(); - String pageFrom = getPageFrom(referer); - if(!pageFrom.matches("AnaliseAcidenteTrabalho.jsp")) - { - if(pageFrom.matches("LoadImage.jsp")) - { - restorePageState(); - fillImages(); - } - else - { - lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); - if(getSessionBean1().getCurrentAnalise() == null) // new analise - { - getSessionBean1().setAcidentado(null); // Here ????? - lnkLblTrabalhador.setDisabled(true); - lnkLblTrabalhador.setStyleClass(""); - initializePage(); - } - else // edit analise - { - fillPage(); - lnkLblTrabalhador.setDisabled(false); - lnkLblTrabalhador.setStyleClass("labelTrabalhador"); - gridTrabalhadores.setRendered(false); - } - } - } + public void setStaticText21(StaticText st) { + this.staticText21 = st; } - - /** - *

Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.

- */ - public void preprocess() { + + private TextField txtSuperior = new TextField(); + + public TextField getTxtSuperior() { + return txtSuperior; } - - /** - *

Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.

- */ - public void prerender() { - txtMsg.setText(getSessionBean1().getMsg()); - getSessionBean1().setMsg(""); + + public void setTxtSuperior(TextField tf) { + this.txtSuperior = tf; } - - /** - *

Callback method that is called after rendering is completed for - * this request, if init() was called (regardless of whether - * or not this was the page that was actually rendered). Customize this - * method to release resources acquired in the init(), - * preprocess(), or prerender() methods (or - * acquired during execution of an event handler).

- */ - public void destroy() { + + private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel15() { + return gridPanel15; } - /** - *

Return a reference to the scoped data bean.

- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); + public void setGridPanel15(HtmlPanelGrid hpg) { + this.gridPanel15 = hpg; } - /** - *

Return a reference to the scoped data bean.

- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); + private StaticText staticText22 = new StaticText(); + + public StaticText getStaticText22() { + return staticText22; } - /** - *

Return a reference to the scoped data bean.

- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); + public void setStaticText22(StaticText st) { + this.staticText22 = st; } - public String lnkLogout_action() { - // TODO: Replace with your code - - javax.servlet.http.HttpSession session = - (javax.servlet.http.HttpSession) getExternalContext().getSession(true); - session.invalidate(); - return "login"; + private TextField txtCondicoes = new TextField(); + + public TextField getTxtCondicoes() { + return txtCondicoes; } - - - private void initializePage() - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - txtEstabelecimento.setText(adp.getEstabelecimentoNome(getSessionBean1().getCurrentUser().getEstabelecimento_id())); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - fillTrabalhadoresTable(); + + public void setTxtCondicoes(TextField tf) { + this.txtCondicoes = tf; } - - private void fillTrabalhadoresTable() - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - //lblActivos.setRendered(true); - table1.setRendered(true); - ArrayList trabalhadoresList = adp.getTrabalhadoresListByEstabelecimento(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getTrabalhadoresListDataProvider().setList(trabalhadoresList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table1.setRendered(false); - ex.printStackTrace(); - } + private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel16() { + return gridPanel16; } - - private String fillPage() - { - AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); - AnalisesDataProvider adp = new AnalisesDataProvider(); + + public void setGridPanel16(HtmlPanelGrid hpg) { + this.gridPanel16 = hpg; + } + + private StaticText staticText23 = new StaticText(); + + public StaticText getStaticText23() { + return staticText23; + } + + public void setStaticText23(StaticText st) { + this.staticText23 = st; + } + + private TextField txtTestemunhas = new TextField(); + + public TextField getTxtTestemunhas() { + return txtTestemunhas; + } + + public void setTxtTestemunhas(TextField tf) { + this.txtTestemunhas = tf; + } + + private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel17() { + return gridPanel17; + } + + public void setGridPanel17(HtmlPanelGrid hpg) { + this.gridPanel17 = hpg; + } + + private StaticText staticText24 = new StaticText(); + + public StaticText getStaticText24() { + return staticText24; + } + + public void setStaticText24(StaticText st) { + this.staticText24 = st; + } + + private TextField txtCausas = new TextField(); + + public TextField getTxtCausas() { + return txtCausas; + } + + public void setTxtCausas(TextField tf) { + this.txtCausas = tf; + } + + private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel18() { + return gridPanel18; + } + + public void setGridPanel18(HtmlPanelGrid hpg) { + this.gridPanel18 = hpg; + } + + private StaticText staticText25 = new StaticText(); + + public StaticText getStaticText25() { + return staticText25; + } + + public void setStaticText25(StaticText st) { + this.staticText25 = st; + } + + private TextField txtDescricao = new TextField(); + + public TextField getTxtDescricao() { + return txtDescricao; + } + + public void setTxtDescricao(TextField tf) { + this.txtDescricao = tf; + } + + private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel19() { + return gridPanel19; + } + + public void setGridPanel19(HtmlPanelGrid hpg) { + this.gridPanel19 = hpg; + } + + private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel20() { + return gridPanel20; + } + + public void setGridPanel20(HtmlPanelGrid hpg) { + this.gridPanel20 = hpg; + } + + private StaticText staticText26 = new StaticText(); + + public StaticText getStaticText26() { + return staticText26; + } + + public void setStaticText26(StaticText st) { + this.staticText26 = st; + } + + private Button butImagem = new Button(); + + public Button getButImagem() { + return butImagem; + } + + public void setButImagem(Button b) { + this.butImagem = b; + } + + private HtmlPanelGrid gridImages = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImages() { + return gridImages; + } + + public void setGridImages(HtmlPanelGrid hpg) { + this.gridImages = hpg; + } + + private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel21() { + return gridPanel21; + } + + public void setGridPanel21(HtmlPanelGrid hpg) { + this.gridPanel21 = hpg; + } + + private StaticText staticText27 = new StaticText(); + + public StaticText getStaticText27() { + return staticText27; + } + + public void setStaticText27(StaticText st) { + this.staticText27 = st; + } + + private TextArea txtConclusoes = new TextArea(); + + public TextArea getTxtConclusoes() { + return txtConclusoes; + } + + public void setTxtConclusoes(TextArea ta) { + this.txtConclusoes = ta; + } + + private HtmlPanelGrid gridPanel26 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel26() { + return gridPanel26; + } + + public void setGridPanel26(HtmlPanelGrid hpg) { + this.gridPanel26 = hpg; + } + + private StaticText staticText28 = new StaticText(); + + public StaticText getStaticText28() { + return staticText28; + } + + public void setStaticText28(StaticText st) { + this.staticText28 = st; + } + + private TextArea txtAccoes = new TextArea(); + + public TextArea getTxtAccoes() { + return txtAccoes; + } + + public void setTxtAccoes(TextArea ta) { + this.txtAccoes = ta; + } + + private HtmlPanelGrid gridDadosAcidenteRh = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRh() { + return gridDadosAcidenteRh; + } + + public void setGridDadosAcidenteRh(HtmlPanelGrid hpg) { + this.gridDadosAcidenteRh = hpg; + } + + private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel27() { + return gridPanel27; + } + + public void setGridPanel27(HtmlPanelGrid hpg) { + this.gridPanel27 = hpg; + } + + private StaticText staticText46 = new StaticText(); + + public StaticText getStaticText46() { + return staticText46; + } + + public void setStaticText46(StaticText st) { + this.staticText46 = st; + } + + private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel28() { + return gridPanel28; + } + + public void setGridPanel28(HtmlPanelGrid hpg) { + this.gridPanel28 = hpg; + } + + private HtmlPanelGrid gridPanel29 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel29() { + return gridPanel29; + } + + public void setGridPanel29(HtmlPanelGrid hpg) { + this.gridPanel29 = hpg; + } + + private StaticText staticText47 = new StaticText(); + + public StaticText getStaticText47() { + return staticText47; + } + + public void setStaticText47(StaticText st) { + this.staticText47 = st; + } + + private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel30() { + return gridPanel30; + } + + public void setGridPanel30(HtmlPanelGrid hpg) { + this.gridPanel30 = hpg; + } + + private StaticText staticText48 = new StaticText(); + + public StaticText getStaticText48() { + return staticText48; + } + + public void setStaticText48(StaticText st) { + this.staticText48 = st; + } + + private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel31() { + return gridPanel31; + } + + public void setGridPanel31(HtmlPanelGrid hpg) { + this.gridPanel31 = hpg; + } + + private RadioButton rbFormacaoSHSTY = new RadioButton(); + + public RadioButton getRbFormacaoSHSTY() { + return rbFormacaoSHSTY; + } + + public void setRbFormacaoSHSTY(RadioButton rb) { + this.rbFormacaoSHSTY = rb; + } + + private StaticText staticText49 = new StaticText(); + + public StaticText getStaticText49() { + return staticText49; + } + + public void setStaticText49(StaticText st) { + this.staticText49 = st; + } + + private HtmlPanelGrid gridPanel32 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel32() { + return gridPanel32; + } + + public void setGridPanel32(HtmlPanelGrid hpg) { + this.gridPanel32 = hpg; + } + + private StaticText staticText50 = new StaticText(); + + public StaticText getStaticText50() { + return staticText50; + } + + public void setStaticText50(StaticText st) { + this.staticText50 = st; + } + + private HtmlPanelGrid gridPanel33 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel33() { + return gridPanel33; + } + + public void setGridPanel33(HtmlPanelGrid hpg) { + this.gridPanel33 = hpg; + } + + private RadioButton rbFormacaoSHSTN = new RadioButton(); + + public RadioButton getRbFormacaoSHSTN() { + return rbFormacaoSHSTN; + } + + public void setRbFormacaoSHSTN(RadioButton rb) { + this.rbFormacaoSHSTN = rb; + } + + private StaticText stFormacaoDummy = new StaticText(); + + public StaticText getStFormacaoDummy() { + return stFormacaoDummy; + } + + public void setStFormacaoDummy(StaticText st) { + this.stFormacaoDummy = st; + } + + private PanelGroup groupPanel12 = new PanelGroup(); + + public PanelGroup getGroupPanel12() { + return groupPanel12; + } + + public void setGroupPanel12(PanelGroup pg) { + this.groupPanel12 = pg; + } + + private StaticText staticText52 = new StaticText(); + + public StaticText getStaticText52() { + return staticText52; + } + + public void setStaticText52(StaticText st) { + this.staticText52 = st; + } + + private TextField txtFormacaoSHSTNWhy = new TextField(); + + public TextField getTxtFormacaoSHSTNWhy() { + return txtFormacaoSHSTNWhy; + } + + public void setTxtFormacaoSHSTNWhy(TextField tf) { + this.txtFormacaoSHSTNWhy = tf; + } + + private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel34() { + return gridPanel34; + } + + public void setGridPanel34(HtmlPanelGrid hpg) { + this.gridPanel34 = hpg; + } + + private StaticText staticText53 = new StaticText(); + + public StaticText getStaticText53() { + return staticText53; + } + + public void setStaticText53(StaticText st) { + this.staticText53 = st; + } + + private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel35() { + return gridPanel35; + } + + public void setGridPanel35(HtmlPanelGrid hpg) { + this.gridPanel35 = hpg; + } + + private StaticText staticText54 = new StaticText(); + + public StaticText getStaticText54() { + return staticText54; + } + + public void setStaticText54(StaticText st) { + this.staticText54 = st; + } + + private HtmlPanelGrid gridPanel36 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel36() { + return gridPanel36; + } + + public void setGridPanel36(HtmlPanelGrid hpg) { + this.gridPanel36 = hpg; + } + + private RadioButton rbAcidentesColaboradorY = new RadioButton(); + + public RadioButton getRbAcidentesColaboradorY() { + return rbAcidentesColaboradorY; + } + + public void setRbAcidentesColaboradorY(RadioButton rb) { + this.rbAcidentesColaboradorY = rb; + } + + private StaticText staticText55 = new StaticText(); + + public StaticText getStaticText55() { + return staticText55; + } + + public void setStaticText55(StaticText st) { + this.staticText55 = st; + } + + private PanelGroup groupPanel13 = new PanelGroup(); + + public PanelGroup getGroupPanel13() { + return groupPanel13; + } + + public void setGroupPanel13(PanelGroup pg) { + this.groupPanel13 = pg; + } + + private StaticText staticText56 = new StaticText(); + + public StaticText getStaticText56() { + return staticText56; + } + + public void setStaticText56(StaticText st) { + this.staticText56 = st; + } + + private TextField txtNrAcidentesColaborador = new TextField(); + + public TextField getTxtNrAcidentesColaborador() { + return txtNrAcidentesColaborador; + } + + public void setTxtNrAcidentesColaborador(TextField tf) { + this.txtNrAcidentesColaborador = tf; + } + + private HtmlPanelGrid gridPanel37 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel37() { + return gridPanel37; + } + + public void setGridPanel37(HtmlPanelGrid hpg) { + this.gridPanel37 = hpg; + } + + private StaticText staticText57 = new StaticText(); + + public StaticText getStaticText57() { + return staticText57; + } + + public void setStaticText57(StaticText st) { + this.staticText57 = st; + } + + private TextField txtNrRelatorioAcidentesColaborador1 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador1() { + return txtNrRelatorioAcidentesColaborador1; + } + + public void setTxtNrRelatorioAcidentesColaborador1(TextField tf) { + this.txtNrRelatorioAcidentesColaborador1 = tf; + } + + private TextField txtNrRelatorioAcidentesColaborador2 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador2() { + return txtNrRelatorioAcidentesColaborador2; + } + + public void setTxtNrRelatorioAcidentesColaborador2(TextField tf) { + this.txtNrRelatorioAcidentesColaborador2 = tf; + } + + private TextField txtNrRelatorioAcidentesColaborador3 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador3() { + return txtNrRelatorioAcidentesColaborador3; + } + + public void setTxtNrRelatorioAcidentesColaborador3(TextField tf) { + this.txtNrRelatorioAcidentesColaborador3 = tf; + } + + private TextField txtNrRelatorioAcidentesColaborador4 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador4() { + return txtNrRelatorioAcidentesColaborador4; + } + + public void setTxtNrRelatorioAcidentesColaborador4(TextField tf) { + this.txtNrRelatorioAcidentesColaborador4 = tf; + } + + private HtmlPanelGrid gridPanel38 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel38() { + return gridPanel38; + } + + public void setGridPanel38(HtmlPanelGrid hpg) { + this.gridPanel38 = hpg; + } + + private StaticText staticText58 = new StaticText(); + + public StaticText getStaticText58() { + return staticText58; + } + + public void setStaticText58(StaticText st) { + this.staticText58 = st; + } + + private HtmlPanelGrid gridPanel39 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel39() { + return gridPanel39; + } + + public void setGridPanel39(HtmlPanelGrid hpg) { + this.gridPanel39 = hpg; + } + + private RadioButton rbAcidentesColaboradorN = new RadioButton(); + + public RadioButton getRbAcidentesColaboradorN() { + return rbAcidentesColaboradorN; + } + + public void setRbAcidentesColaboradorN(RadioButton rb) { + this.rbAcidentesColaboradorN = rb; + } + + private StaticText staticText59 = new StaticText(); + + public StaticText getStaticText59() { + return staticText59; + } + + public void setStaticText59(StaticText st) { + this.staticText59 = st; + } + + private HtmlPanelGrid gridPanel40 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel40() { + return gridPanel40; + } + + public void setGridPanel40(HtmlPanelGrid hpg) { + this.gridPanel40 = hpg; + } + + private StaticText staticText60 = new StaticText(); + + public StaticText getStaticText60() { + return staticText60; + } + + public void setStaticText60(StaticText st) { + this.staticText60 = st; + } + + private HtmlPanelGrid gridPanel41 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel41() { + return gridPanel41; + } + + public void setGridPanel41(HtmlPanelGrid hpg) { + this.gridPanel41 = hpg; + } + + private StaticText staticText61 = new StaticText(); + + public StaticText getStaticText61() { + return staticText61; + } + + public void setStaticText61(StaticText st) { + this.staticText61 = st; + } + + private HtmlPanelGrid gridPanel42 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel42() { + return gridPanel42; + } + + public void setGridPanel42(HtmlPanelGrid hpg) { + this.gridPanel42 = hpg; + } + + private RadioButton rbAcidentesColaboradoresY = new RadioButton(); + + public RadioButton getRbAcidentesColaboradoresY() { + return rbAcidentesColaboradoresY; + } + + public void setRbAcidentesColaboradoresY(RadioButton rb) { + this.rbAcidentesColaboradoresY = rb; + } + + private StaticText staticText62 = new StaticText(); + + public StaticText getStaticText62() { + return staticText62; + } + + public void setStaticText62(StaticText st) { + this.staticText62 = st; + } + + private PanelGroup groupPanel14 = new PanelGroup(); + + public PanelGroup getGroupPanel14() { + return groupPanel14; + } + + public void setGroupPanel14(PanelGroup pg) { + this.groupPanel14 = pg; + } + + private StaticText staticText63 = new StaticText(); + + public StaticText getStaticText63() { + return staticText63; + } + + public void setStaticText63(StaticText st) { + this.staticText63 = st; + } + + private TextField txtNrAcidentesColaboradores = new TextField(); + + public TextField getTxtNrAcidentesColaboradores() { + return txtNrAcidentesColaboradores; + } + + public void setTxtNrAcidentesColaboradores(TextField tf) { + this.txtNrAcidentesColaboradores = tf; + } + + private HtmlPanelGrid gridPanel43 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel43() { + return gridPanel43; + } + + public void setGridPanel43(HtmlPanelGrid hpg) { + this.gridPanel43 = hpg; + } + + private StaticText staticText64 = new StaticText(); + + public StaticText getStaticText64() { + return staticText64; + } + + public void setStaticText64(StaticText st) { + this.staticText64 = st; + } + + private TextField txtNrRelatorioAcidentesColaboradores1 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores1() { + return txtNrRelatorioAcidentesColaboradores1; + } + + public void setTxtNrRelatorioAcidentesColaboradores1(TextField tf) { + this.txtNrRelatorioAcidentesColaboradores1 = tf; + } + + private TextField txtNrRelatorioAcidentesColaboradores2 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores2() { + return txtNrRelatorioAcidentesColaboradores2; + } + + public void setTxtNrRelatorioAcidentesColaboradores2(TextField tf) { + this.txtNrRelatorioAcidentesColaboradores2 = tf; + } + + private TextField txtNrRelatorioAcidentesColaboradores3 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores3() { + return txtNrRelatorioAcidentesColaboradores3; + } + + public void setTxtNrRelatorioAcidentesColaboradores3(TextField tf) { + this.txtNrRelatorioAcidentesColaboradores3 = tf; + } + + private TextField txtNrRelatorioAcidentesColaboradores4 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores4() { + return txtNrRelatorioAcidentesColaboradores4; + } + + public void setTxtNrRelatorioAcidentesColaboradores4(TextField tf) { + this.txtNrRelatorioAcidentesColaboradores4 = tf; + } + + private HtmlPanelGrid gridPanel44 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel44() { + return gridPanel44; + } + + public void setGridPanel44(HtmlPanelGrid hpg) { + this.gridPanel44 = hpg; + } + + private StaticText staticText65 = new StaticText(); + + public StaticText getStaticText65() { + return staticText65; + } + + public void setStaticText65(StaticText st) { + this.staticText65 = st; + } + + private HtmlPanelGrid gridPanel45 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel45() { + return gridPanel45; + } + + public void setGridPanel45(HtmlPanelGrid hpg) { + this.gridPanel45 = hpg; + } + + private RadioButton rbAcidentesColaboradoresN = new RadioButton(); + + public RadioButton getRbAcidentesColaboradoresN() { + return rbAcidentesColaboradoresN; + } + + public void setRbAcidentesColaboradoresN(RadioButton rb) { + this.rbAcidentesColaboradoresN = rb; + } + + private StaticText staticText66 = new StaticText(); + + public StaticText getStaticText66() { + return staticText66; + } + + public void setStaticText66(StaticText st) { + this.staticText66 = st; + } + + private HtmlPanelGrid gridRecomendacoesHS = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesHS() { + return gridRecomendacoesHS; + } + + public void setGridRecomendacoesHS(HtmlPanelGrid hpg) { + this.gridRecomendacoesHS = hpg; + } + + private HtmlPanelGrid gridPanel46 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel46() { + return gridPanel46; + } + + public void setGridPanel46(HtmlPanelGrid hpg) { + this.gridPanel46 = hpg; + } + + private StaticText staticText67 = new StaticText(); + + public StaticText getStaticText67() { + return staticText67; + } + + public void setStaticText67(StaticText st) { + this.staticText67 = st; + } + + private HtmlPanelGrid gridRecomendacoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoes() { + return gridRecomendacoes; + } + + public void setGridRecomendacoes(HtmlPanelGrid hpg) { + this.gridRecomendacoes = hpg; + } + + private HtmlPanelGrid gridPanel48 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel48() { + return gridPanel48; + } + + public void setGridPanel48(HtmlPanelGrid hpg) { + this.gridPanel48 = hpg; + } + + private StaticText stNrRecomendacao1 = new StaticText(); + + public StaticText getStNrRecomendacao1() { + return stNrRecomendacao1; + } + + public void setStNrRecomendacao1(StaticText st) { + this.stNrRecomendacao1 = st; + } + + private ImageHyperlink lnkMoreRec1 = new ImageHyperlink(); + + public ImageHyperlink getLnkMoreRec1() { + return lnkMoreRec1; + } + + public void setLnkMoreRec1(ImageHyperlink ih) { + this.lnkMoreRec1 = ih; + } + + private HtmlPanelGrid gridSiprpView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSiprpView() { + return gridSiprpView; + } + + public void setGridSiprpView(HtmlPanelGrid hpg) { + this.gridSiprpView = hpg; + } + + private HtmlPanelGrid gridPanel49 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel49() { + return gridPanel49; + } + + public void setGridPanel49(HtmlPanelGrid hpg) { + this.gridPanel49 = hpg; + } + + private StaticText staticText69 = new StaticText(); + + public StaticText getStaticText69() { + return staticText69; + } + + public void setStaticText69(StaticText st) { + this.staticText69 = st; + } + + private HtmlPanelGrid gridPanel50 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel50() { + return gridPanel50; + } + + public void setGridPanel50(HtmlPanelGrid hpg) { + this.gridPanel50 = hpg; + } + + private HtmlPanelGrid gridPanel51 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel51() { + return gridPanel51; + } + + public void setGridPanel51(HtmlPanelGrid hpg) { + this.gridPanel51 = hpg; + } + + private StaticText staticText70 = new StaticText(); + + public StaticText getStaticText70() { + return staticText70; + } + + public void setStaticText70(StaticText st) { + this.staticText70 = st; + } + + private StaticText staticText71 = new StaticText(); + + public StaticText getStaticText71() { + return staticText71; + } + + public void setStaticText71(StaticText st) { + this.staticText71 = st; + } + + private StaticText staticText72 = new StaticText(); + + public StaticText getStaticText72() { + return staticText72; + } + + public void setStaticText72(StaticText st) { + this.staticText72 = st; + } + + private PanelGroup groupPanel15 = new PanelGroup(); + + public PanelGroup getGroupPanel15() { + return groupPanel15; + } + + public void setGroupPanel15(PanelGroup pg) { + this.groupPanel15 = pg; + } + + private StaticText stTecnicoNome = new StaticText(); + + public StaticText getStTecnicoNome() { + return stTecnicoNome; + } + + public void setStTecnicoNome(StaticText st) { + this.stTecnicoNome = st; + } + + private StaticText staticText74 = new StaticText(); + + public StaticText getStaticText74() { + return staticText74; + } + + public void setStaticText74(StaticText st) { + this.staticText74 = st; + } + + private StaticText txtCap1 = new StaticText(); + + public StaticText getTxtCap1() { + return txtCap1; + } + + public void setTxtCap1(StaticText st) { + this.txtCap1 = st; + } + + private StaticText staticText75 = new StaticText(); + + public StaticText getStaticText75() { + return staticText75; + } + + public void setStaticText75(StaticText st) { + this.staticText75 = st; + } + + private PanelGroup groupPanel16 = new PanelGroup(); + + public PanelGroup getGroupPanel16() { + return groupPanel16; + } + + public void setGroupPanel16(PanelGroup pg) { + this.groupPanel16 = pg; + } + + private StaticText stMedicoNome = new StaticText(); + + public StaticText getStMedicoNome() { + return stMedicoNome; + } + + public void setStMedicoNome(StaticText st) { + this.stMedicoNome = st; + } + + private StaticText staticText77 = new StaticText(); + + public StaticText getStaticText77() { + return staticText77; + } + + public void setStaticText77(StaticText st) { + this.staticText77 = st; + } + + private StaticText txtCedula1 = new StaticText(); + + public StaticText getTxtCedula1() { + return txtCedula1; + } + + public void setTxtCedula1(StaticText st) { + this.txtCedula1 = st; + } + + private HtmlPanelGrid gridAcidentadoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAcidentadoView() { + return gridAcidentadoView; + } + + public void setGridAcidentadoView(HtmlPanelGrid hpg) { + this.gridAcidentadoView = hpg; + } + + private HtmlPanelGrid gridPanel52 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel52() { + return gridPanel52; + } + + public void setGridPanel52(HtmlPanelGrid hpg) { + this.gridPanel52 = hpg; + } + + private StaticText staticText78 = new StaticText(); + + public StaticText getStaticText78() { + return staticText78; + } + + public void setStaticText78(StaticText st) { + this.staticText78 = st; + } + + private HtmlPanelGrid gridPanel53 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel53() { + return gridPanel53; + } + + public void setGridPanel53(HtmlPanelGrid hpg) { + this.gridPanel53 = hpg; + } + + private HtmlPanelGrid gridPanel54 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel54() { + return gridPanel54; + } + + public void setGridPanel54(HtmlPanelGrid hpg) { + this.gridPanel54 = hpg; + } + + private StaticText staticText79 = new StaticText(); + + public StaticText getStaticText79() { + return staticText79; + } + + public void setStaticText79(StaticText st) { + this.staticText79 = st; + } + + private StaticText stNomeAcidentado = new StaticText(); + + public StaticText getStNomeAcidentado() { + return stNomeAcidentado; + } + + public void setStNomeAcidentado(StaticText st) { + this.stNomeAcidentado = st; + } + + private StaticText staticText80 = new StaticText(); + + public StaticText getStaticText80() { + return staticText80; + } + + public void setStaticText80(StaticText st) { + this.staticText80 = st; + } + + private StaticText stDataNascimento = new StaticText(); + + public StaticText getStDataNascimento() { + return stDataNascimento; + } + + public void setStDataNascimento(StaticText st) { + this.stDataNascimento = st; + } + + private StaticText staticText81 = new StaticText(); + + public StaticText getStaticText81() { + return staticText81; + } + + public void setStaticText81(StaticText st) { + this.staticText81 = st; + } + + private StaticText stBI = new StaticText(); + + public StaticText getStBI() { + return stBI; + } + + public void setStBI(StaticText st) { + this.stBI = st; + } + + private StaticText staticText82 = new StaticText(); + + public StaticText getStaticText82() { + return staticText82; + } + + public void setStaticText82(StaticText st) { + this.staticText82 = st; + } + + private StaticText stMorada = new StaticText(); + + public StaticText getStMorada() { + return stMorada; + } + + public void setStMorada(StaticText st) { + this.stMorada = st; + } + + private StaticText staticText83 = new StaticText(); + + public StaticText getStaticText83() { + return staticText83; + } + + public void setStaticText83(StaticText st) { + this.staticText83 = st; + } + + private StaticText stCodPostal = new StaticText(); + + public StaticText getStCodPostal() { + return stCodPostal; + } + + public void setStCodPostal(StaticText st) { + this.stCodPostal = st; + } + + private StaticText staticText84 = new StaticText(); + + public StaticText getStaticText84() { + return staticText84; + } + + public void setStaticText84(StaticText st) { + this.staticText84 = st; + } + + private StaticText stContactoTelefonico = new StaticText(); + + public StaticText getStContactoTelefonico() { + return stContactoTelefonico; + } + + public void setStContactoTelefonico(StaticText st) { + this.stContactoTelefonico = st; + } + + private StaticText staticText85 = new StaticText(); + + public StaticText getStaticText85() { + return staticText85; + } + + public void setStaticText85(StaticText st) { + this.staticText85 = st; + } + + private StaticText stDataAdmissao1 = new StaticText(); + + public StaticText getStDataAdmissao1() { + return stDataAdmissao1; + } + + public void setStDataAdmissao1(StaticText st) { + this.stDataAdmissao1 = st; + } + + private StaticText staticText86 = new StaticText(); + + public StaticText getStaticText86() { + return staticText86; + } + + public void setStaticText86(StaticText st) { + this.staticText86 = st; + } + + private StaticText stFuncao1 = new StaticText(); + + public StaticText getStFuncao1() { + return stFuncao1; + } + + public void setStFuncao1(StaticText st) { + this.stFuncao1 = st; + } + + private StaticText staticText87 = new StaticText(); + + public StaticText getStaticText87() { + return staticText87; + } + + public void setStaticText87(StaticText st) { + this.staticText87 = st; + } + + private StaticText stTurno = new StaticText(); + + public StaticText getStTurno() { + return stTurno; + } + + public void setStTurno(StaticText st) { + this.stTurno = st; + } + + private HtmlPanelGrid gridDadosAcidenteRhView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRhView() { + return gridDadosAcidenteRhView; + } + + public void setGridDadosAcidenteRhView(HtmlPanelGrid hpg) { + this.gridDadosAcidenteRhView = hpg; + } + + private HtmlPanelGrid gridPanel55 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel55() { + return gridPanel55; + } + + public void setGridPanel55(HtmlPanelGrid hpg) { + this.gridPanel55 = hpg; + } + + private StaticText staticText88 = new StaticText(); + + public StaticText getStaticText88() { + return staticText88; + } + + public void setStaticText88(StaticText st) { + this.staticText88 = st; + } + + private HtmlPanelGrid gridPanel56 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel56() { + return gridPanel56; + } + + public void setGridPanel56(HtmlPanelGrid hpg) { + this.gridPanel56 = hpg; + } + + private HtmlPanelGrid gridSHST = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSHST() { + return gridSHST; + } + + public void setGridSHST(HtmlPanelGrid hpg) { + this.gridSHST = hpg; + } + + private HtmlPanelGrid gridColaborador = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaborador() { + return gridColaborador; + } + + public void setGridColaborador(HtmlPanelGrid hpg) { + this.gridColaborador = hpg; + } + + private HtmlPanelGrid gridColaboradores = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaboradores() { + return gridColaboradores; + } + + public void setGridColaboradores(HtmlPanelGrid hpg) { + this.gridColaboradores = hpg; + } + + private DropDown drpHours = new DropDown(); + + public DropDown getDrpHours() { + return drpHours; + } + + public void setDrpHours(DropDown dd) { + this.drpHours = dd; + } + + private SingleSelectOptionsList drpHoursDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpHoursDefaultOptions() { + return drpHoursDefaultOptions; + } + + public void setDrpHoursDefaultOptions(SingleSelectOptionsList ssol) { + this.drpHoursDefaultOptions = ssol; + } + + private StaticText staticText92 = new StaticText(); + + public StaticText getStaticText92() { + return staticText92; + } + + public void setStaticText92(StaticText st) { + this.staticText92 = st; + } + + private DropDown drpMinutes = new DropDown(); + + public DropDown getDrpMinutes() { + return drpMinutes; + } + + public void setDrpMinutes(DropDown dd) { + this.drpMinutes = dd; + } + + private SingleSelectOptionsList drpMinutesDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpMinutesDefaultOptions() { + return drpMinutesDefaultOptions; + } + + public void setDrpMinutesDefaultOptions(SingleSelectOptionsList ssol) { + this.drpMinutesDefaultOptions = ssol; + } + + private TextArea txtRecomendacao1 = new TextArea(); + + public TextArea getTxtRecomendacao1() { + return txtRecomendacao1; + } + + public void setTxtRecomendacao1(TextArea ta) { + this.txtRecomendacao1 = ta; + } + + private HtmlPanelGrid gridRecomendacoesViewHS = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesViewHS() { + return gridRecomendacoesViewHS; + } + + public void setGridRecomendacoesViewHS(HtmlPanelGrid hpg) { + this.gridRecomendacoesViewHS = hpg; + } + + private HtmlPanelGrid gridPanel47 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel47() { + return gridPanel47; + } + + public void setGridPanel47(HtmlPanelGrid hpg) { + this.gridPanel47 = hpg; + } + + private StaticText staticText51 = new StaticText(); + + public StaticText getStaticText51() { + return staticText51; + } + + public void setStaticText51(StaticText st) { + this.staticText51 = st; + } + + private HtmlPanelGrid gridRecomendacoesView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesView() { + return gridRecomendacoesView; + } + + public void setGridRecomendacoesView(HtmlPanelGrid hpg) { + this.gridRecomendacoesView = hpg; + } + + private HtmlPanelGrid gridMedidasRH = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasRH() { + return gridMedidasRH; + } + + public void setGridMedidasRH(HtmlPanelGrid hpg) { + this.gridMedidasRH = hpg; + } + + private HtmlPanelGrid gridPanel57 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel57() { + return gridPanel57; + } + + public void setGridPanel57(HtmlPanelGrid hpg) { + this.gridPanel57 = hpg; + } + + private StaticText staticText68 = new StaticText(); + + public StaticText getStaticText68() { + return staticText68; + } + + public void setStaticText68(StaticText st) { + this.staticText68 = st; + } + + private HtmlPanelGrid gridMedidas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidas() { + return gridMedidas; + } + + public void setGridMedidas(HtmlPanelGrid hpg) { + this.gridMedidas = hpg; + } + + private HtmlPanelGrid gridPanel58 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel58() { + return gridPanel58; + } + + public void setGridPanel58(HtmlPanelGrid hpg) { + this.gridPanel58 = hpg; + } + + private StaticText stNrMedida1 = new StaticText(); + + public StaticText getStNrMedida1() { + return stNrMedida1; + } + + public void setStNrMedida1(StaticText st) { + this.stNrMedida1 = st; + } + + private TextArea txtMedida1 = new TextArea(); + + public TextArea getTxtMedida1() { + return txtMedida1; + } + + public void setTxtMedida1(TextArea ta) { + this.txtMedida1 = ta; + } + + private ImageHyperlink lnkMoreMed1 = new ImageHyperlink(); + + public ImageHyperlink getLnkMoreMed1() { + return lnkMoreMed1; + } + + public void setLnkMoreMed1(ImageHyperlink ih) { + this.lnkMoreMed1 = ih; + } + + private HtmlPanelGrid gridMedidasViewRH = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasViewRH() { + return gridMedidasViewRH; + } + + public void setGridMedidasViewRH(HtmlPanelGrid hpg) { + this.gridMedidasViewRH = hpg; + } + + private HtmlPanelGrid gridPanel59 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel59() { + return gridPanel59; + } + + public void setGridPanel59(HtmlPanelGrid hpg) { + this.gridPanel59 = hpg; + } + + private StaticText staticText89 = new StaticText(); + + public StaticText getStaticText89() { + return staticText89; + } + + public void setStaticText89(StaticText st) { + this.staticText89 = st; + } + + private HtmlPanelGrid gridMedidasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasView() { + return gridMedidasView; + } + + public void setGridMedidasView(HtmlPanelGrid hpg) { + this.gridMedidasView = hpg; + } + + private HtmlPanelGrid gridMedico = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedico() { + return gridMedico; + } + + public void setGridMedico(HtmlPanelGrid hpg) { + this.gridMedico = hpg; + } + + private HtmlPanelGrid gridPanel60 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel60() { + return gridPanel60; + } + + public void setGridPanel60(HtmlPanelGrid hpg) { + this.gridPanel60 = hpg; + } + + private StaticText staticText90 = new StaticText(); + + public StaticText getStaticText90() { + return staticText90; + } + + public void setStaticText90(StaticText st) { + this.staticText90 = st; + } + + private HtmlPanelGrid gridLesao1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLesao1() { + return gridLesao1; + } + + public void setGridLesao1(HtmlPanelGrid hpg) { + this.gridLesao1 = hpg; + } + + private StaticText staticText91 = new StaticText(); + + public StaticText getStaticText91() { + return staticText91; + } + + public void setStaticText91(StaticText st) { + this.staticText91 = st; + } + + private HtmlPanelGrid gridPanel61 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel61() { + return gridPanel61; + } + + public void setGridPanel61(HtmlPanelGrid hpg) { + this.gridPanel61 = hpg; + } + + private PanelGroup groupPanel17 = new PanelGroup(); + + public PanelGroup getGroupPanel17() { + return groupPanel17; + } + + public void setGroupPanel17(PanelGroup pg) { + this.groupPanel17 = pg; + } + + private Checkbox chkCabeca = new Checkbox(); + + public Checkbox getChkCabeca() { + return chkCabeca; + } + + public void setChkCabeca(Checkbox c) { + this.chkCabeca = c; + } + + private StaticText staticText93 = new StaticText(); + + public StaticText getStaticText93() { + return staticText93; + } + + public void setStaticText93(StaticText st) { + this.staticText93 = st; + } + + private PanelGroup groupPanel18 = new PanelGroup(); + + public PanelGroup getGroupPanel18() { + return groupPanel18; + } + + public void setGroupPanel18(PanelGroup pg) { + this.groupPanel18 = pg; + } + + private Checkbox chkMembroSupDir = new Checkbox(); + + public Checkbox getChkMembroSupDir() { + return chkMembroSupDir; + } + + public void setChkMembroSupDir(Checkbox c) { + this.chkMembroSupDir = c; + } + + private StaticText staticText94 = new StaticText(); + + public StaticText getStaticText94() { + return staticText94; + } + + public void setStaticText94(StaticText st) { + this.staticText94 = st; + } + + private HtmlPanelGrid gridPanel62 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel62() { + return gridPanel62; + } + + public void setGridPanel62(HtmlPanelGrid hpg) { + this.gridPanel62 = hpg; + } + + private StaticText lblEspecif1 = new StaticText(); + + public StaticText getLblEspecif1() { + return lblEspecif1; + } + + public void setLblEspecif1(StaticText st) { + this.lblEspecif1 = st; + } + + private TextField txtEspecif1 = new TextField(); + + public TextField getTxtEspecif1() { + return txtEspecif1; + } + + public void setTxtEspecif1(TextField tf) { + this.txtEspecif1 = tf; + } + + private PanelGroup groupPanel19 = new PanelGroup(); + + public PanelGroup getGroupPanel19() { + return groupPanel19; + } + + public void setGroupPanel19(PanelGroup pg) { + this.groupPanel19 = pg; + } + + private Checkbox chkPescoco = new Checkbox(); + + public Checkbox getChkPescoco() { + return chkPescoco; + } + + public void setChkPescoco(Checkbox c) { + this.chkPescoco = c; + } + + private StaticText staticText96 = new StaticText(); + + public StaticText getStaticText96() { + return staticText96; + } + + public void setStaticText96(StaticText st) { + this.staticText96 = st; + } + + private PanelGroup groupPanel20 = new PanelGroup(); + + public PanelGroup getGroupPanel20() { + return groupPanel20; + } + + public void setGroupPanel20(PanelGroup pg) { + this.groupPanel20 = pg; + } + + private Checkbox chkMembroSupEsq = new Checkbox(); + + public Checkbox getChkMembroSupEsq() { + return chkMembroSupEsq; + } + + public void setChkMembroSupEsq(Checkbox c) { + this.chkMembroSupEsq = c; + } + + private StaticText staticText97 = new StaticText(); + + public StaticText getStaticText97() { + return staticText97; + } + + public void setStaticText97(StaticText st) { + this.staticText97 = st; + } + + private HtmlPanelGrid gridPanel63 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel63() { + return gridPanel63; + } + + public void setGridPanel63(HtmlPanelGrid hpg) { + this.gridPanel63 = hpg; + } + + private StaticText lblEspecif2 = new StaticText(); + + public StaticText getLblEspecif2() { + return lblEspecif2; + } + + public void setLblEspecif2(StaticText st) { + this.lblEspecif2 = st; + } + + private TextField txtEspecif2 = new TextField(); + + public TextField getTxtEspecif2() { + return txtEspecif2; + } + + public void setTxtEspecif2(TextField tf) { + this.txtEspecif2 = tf; + } + + private PanelGroup groupPanel21 = new PanelGroup(); + + public PanelGroup getGroupPanel21() { + return groupPanel21; + } + + public void setGroupPanel21(PanelGroup pg) { + this.groupPanel21 = pg; + } + + private Checkbox chkTronco = new Checkbox(); + + public Checkbox getChkTronco() { + return chkTronco; + } + + public void setChkTronco(Checkbox c) { + this.chkTronco = c; + } + + private StaticText staticText99 = new StaticText(); + + public StaticText getStaticText99() { + return staticText99; + } + + public void setStaticText99(StaticText st) { + this.staticText99 = st; + } + + private PanelGroup groupPanel22 = new PanelGroup(); + + public PanelGroup getGroupPanel22() { + return groupPanel22; + } + + public void setGroupPanel22(PanelGroup pg) { + this.groupPanel22 = pg; + } + + private Checkbox chkMembroInfDir = new Checkbox(); + + public Checkbox getChkMembroInfDir() { + return chkMembroInfDir; + } + + public void setChkMembroInfDir(Checkbox c) { + this.chkMembroInfDir = c; + } + + private StaticText staticText100 = new StaticText(); + + public StaticText getStaticText100() { + return staticText100; + } + + public void setStaticText100(StaticText st) { + this.staticText100 = st; + } + + private HtmlPanelGrid gridPanel64 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel64() { + return gridPanel64; + } + + public void setGridPanel64(HtmlPanelGrid hpg) { + this.gridPanel64 = hpg; + } + + private StaticText lblEspecif3 = new StaticText(); + + public StaticText getLblEspecif3() { + return lblEspecif3; + } + + public void setLblEspecif3(StaticText st) { + this.lblEspecif3 = st; + } + + private TextField txtEspecif3 = new TextField(); + + public TextField getTxtEspecif3() { + return txtEspecif3; + } + + public void setTxtEspecif3(TextField tf) { + this.txtEspecif3 = tf; + } + + private StaticText staticText102 = new StaticText(); + + public StaticText getStaticText102() { + return staticText102; + } + + public void setStaticText102(StaticText st) { + this.staticText102 = st; + } + + private PanelGroup groupPanel23 = new PanelGroup(); + + public PanelGroup getGroupPanel23() { + return groupPanel23; + } + + public void setGroupPanel23(PanelGroup pg) { + this.groupPanel23 = pg; + } + + private Checkbox chkMembroInfEsq = new Checkbox(); + + public Checkbox getChkMembroInfEsq() { + return chkMembroInfEsq; + } + + public void setChkMembroInfEsq(Checkbox c) { + this.chkMembroInfEsq = c; + } + + private StaticText staticText103 = new StaticText(); + + public StaticText getStaticText103() { + return staticText103; + } + + public void setStaticText103(StaticText st) { + this.staticText103 = st; + } + + private HtmlPanelGrid gridPanel65 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel65() { + return gridPanel65; + } + + public void setGridPanel65(HtmlPanelGrid hpg) { + this.gridPanel65 = hpg; + } + + private StaticText lblEspecif4 = new StaticText(); + + public StaticText getLblEspecif4() { + return lblEspecif4; + } + + public void setLblEspecif4(StaticText st) { + this.lblEspecif4 = st; + } + + private TextField txtEspecif4 = new TextField(); + + public TextField getTxtEspecif4() { + return txtEspecif4; + } + + public void setTxtEspecif4(TextField tf) { + this.txtEspecif4 = tf; + } + + private HtmlPanelGrid gridPanel66 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel66() { + return gridPanel66; + } + + public void setGridPanel66(HtmlPanelGrid hpg) { + this.gridPanel66 = hpg; + } + + private StaticText staticText105 = new StaticText(); + + public StaticText getStaticText105() { + return staticText105; + } + + public void setStaticText105(StaticText st) { + this.staticText105 = st; + } + + private TextField txtTipoLesao = new TextField(); + + public TextField getTxtTipoLesao() { + return txtTipoLesao; + } + + public void setTxtTipoLesao(TextField tf) { + this.txtTipoLesao = tf; + } + + private HtmlPanelGrid gridPanel67 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel67() { + return gridPanel67; + } + + public void setGridPanel67(HtmlPanelGrid hpg) { + this.gridPanel67 = hpg; + } + + private StaticText staticText106 = new StaticText(); + + public StaticText getStaticText106() { + return staticText106; + } + + public void setStaticText106(StaticText st) { + this.staticText106 = st; + } + + private HtmlPanelGrid gridIncapacidade1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridIncapacidade1() { + return gridIncapacidade1; + } + + public void setGridIncapacidade1(HtmlPanelGrid hpg) { + this.gridIncapacidade1 = hpg; + } + + private HtmlPanelGrid gridPanel68 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel68() { + return gridPanel68; + } + + public void setGridPanel68(HtmlPanelGrid hpg) { + this.gridPanel68 = hpg; + } + + private PanelGroup groupPanel24 = new PanelGroup(); + + public PanelGroup getGroupPanel24() { + return groupPanel24; + } + + public void setGroupPanel24(PanelGroup pg) { + this.groupPanel24 = pg; + } + + private StaticText staticText107 = new StaticText(); + + public StaticText getStaticText107() { + return staticText107; + } + + public void setStaticText107(StaticText st) { + this.staticText107 = st; + } + + private RadioButton rbIncapacidadeNone = new RadioButton(); + + public RadioButton getRbIncapacidadeNone() { + return rbIncapacidadeNone; + } + + public void setRbIncapacidadeNone(RadioButton rb) { + this.rbIncapacidadeNone = rb; + } + + private StaticText staticText108 = new StaticText(); + + public StaticText getStaticText108() { + return staticText108; + } + + public void setStaticText108(StaticText st) { + this.staticText108 = st; + } + + private RadioButton rbIncapacidadeTemp = new RadioButton(); + + public RadioButton getRbIncapacidadeTemp() { + return rbIncapacidadeTemp; + } + + public void setRbIncapacidadeTemp(RadioButton rb) { + this.rbIncapacidadeTemp = rb; + } + + private StaticText staticText109 = new StaticText(); + + public StaticText getStaticText109() { + return staticText109; + } + + public void setStaticText109(StaticText st) { + this.staticText109 = st; + } + + private PanelGroup groupPanel25 = new PanelGroup(); + + public PanelGroup getGroupPanel25() { + return groupPanel25; + } + + public void setGroupPanel25(PanelGroup pg) { + this.groupPanel25 = pg; + } + + private StaticText staticText110 = new StaticText(); + + public StaticText getStaticText110() { + return staticText110; + } + + public void setStaticText110(StaticText st) { + this.staticText110 = st; + } + + private TextField txtCoefIncapacidade = new TextField(); + + public TextField getTxtCoefIncapacidade() { + return txtCoefIncapacidade; + } + + public void setTxtCoefIncapacidade(TextField tf) { + this.txtCoefIncapacidade = tf; + } + + private StaticText staticText111 = new StaticText(); + + public StaticText getStaticText111() { + return staticText111; + } + + public void setStaticText111(StaticText st) { + this.staticText111 = st; + } + + private HtmlPanelGrid gridPanel69 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel69() { + return gridPanel69; + } + + public void setGridPanel69(HtmlPanelGrid hpg) { + this.gridPanel69 = hpg; + } + + private StaticText staticText112 = new StaticText(); + + public StaticText getStaticText112() { + return staticText112; + } + + public void setStaticText112(StaticText st) { + this.staticText112 = st; + } + + private com.sun.rave.web.ui.component.Calendar calAvaliacaoIncap = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalAvaliacaoIncap() { + return calAvaliacaoIncap; + } + + public void setCalAvaliacaoIncap(com.sun.rave.web.ui.component.Calendar c) { + this.calAvaliacaoIncap = c; + } + + private StaticText staticText113 = new StaticText(); + + public StaticText getStaticText113() { + return staticText113; + } + + public void setStaticText113(StaticText st) { + this.staticText113 = st; + } + + private com.sun.rave.web.ui.component.Calendar calRevisaoIncap = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalRevisaoIncap() { + return calRevisaoIncap; + } + + public void setCalRevisaoIncap(com.sun.rave.web.ui.component.Calendar c) { + this.calRevisaoIncap = c; + } + + private HtmlPanelGrid gridPanel70 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel70() { + return gridPanel70; + } + + public void setGridPanel70(HtmlPanelGrid hpg) { + this.gridPanel70 = hpg; + } + + private StaticText staticText114 = new StaticText(); + + public StaticText getStaticText114() { + return staticText114; + } + + public void setStaticText114(StaticText st) { + this.staticText114 = st; + } + + private com.sun.rave.web.ui.component.Calendar calPeridoIncapDe = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalPeridoIncapDe() { + return calPeridoIncapDe; + } + + public void setCalPeridoIncapDe(com.sun.rave.web.ui.component.Calendar c) { + this.calPeridoIncapDe = c; + } + + private StaticText staticText115 = new StaticText(); + + public StaticText getStaticText115() { + return staticText115; + } + + public void setStaticText115(StaticText st) { + this.staticText115 = st; + } + + private com.sun.rave.web.ui.component.Calendar calPeriodoIncapA = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalPeriodoIncapA() { + return calPeriodoIncapA; + } + + public void setCalPeriodoIncapA(com.sun.rave.web.ui.component.Calendar c) { + this.calPeriodoIncapA = c; + } + + private HtmlPanelGrid gridPanel71 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel71() { + return gridPanel71; + } + + public void setGridPanel71(HtmlPanelGrid hpg) { + this.gridPanel71 = hpg; + } + + private StaticText staticText116 = new StaticText(); + + public StaticText getStaticText116() { + return staticText116; + } + + public void setStaticText116(StaticText st) { + this.staticText116 = st; + } + + private HtmlPanelGrid gridRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRestricoes() { + return gridRestricoes; + } + + public void setGridRestricoes(HtmlPanelGrid hpg) { + this.gridRestricoes = hpg; + } + + private HtmlPanelGrid gridPanel72 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel72() { + return gridPanel72; + } + + public void setGridPanel72(HtmlPanelGrid hpg) { + this.gridPanel72 = hpg; + } + + private HtmlPanelGrid gridPanel73 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel73() { + return gridPanel73; + } + + public void setGridPanel73(HtmlPanelGrid hpg) { + this.gridPanel73 = hpg; + } + + private HtmlPanelGrid gridPanel74 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel74() { + return gridPanel74; + } + + public void setGridPanel74(HtmlPanelGrid hpg) { + this.gridPanel74 = hpg; + } + + private HtmlPanelGrid gridPanel75 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel75() { + return gridPanel75; + } + + public void setGridPanel75(HtmlPanelGrid hpg) { + this.gridPanel75 = hpg; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private ImageComponent image4 = new ImageComponent(); + + public ImageComponent getImage4() { + return image4; + } + + public void setImage4(ImageComponent ic) { + this.image4 = ic; + } + + private ImageComponent image5 = new ImageComponent(); + + public ImageComponent getImage5() { + return image5; + } + + public void setImage5(ImageComponent ic) { + this.image5 = ic; + } + + private PanelGroup groupPanel26 = new PanelGroup(); + + public PanelGroup getGroupPanel26() { + return groupPanel26; + } + + public void setGroupPanel26(PanelGroup pg) { + this.groupPanel26 = pg; + } + + private StaticText staticText117 = new StaticText(); + + public StaticText getStaticText117() { + return staticText117; + } + + public void setStaticText117(StaticText st) { + this.staticText117 = st; + } + + private Checkbox chkImgFlexao = new Checkbox(); + + public Checkbox getChkImgFlexao() { + return chkImgFlexao; + } + + public void setChkImgFlexao(Checkbox c) { + this.chkImgFlexao = c; + } + + private HtmlPanelGrid gridPanel76 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel76() { + return gridPanel76; + } + + public void setGridPanel76(HtmlPanelGrid hpg) { + this.gridPanel76 = hpg; + } + + private ImageComponent image6 = new ImageComponent(); + + public ImageComponent getImage6() { + return image6; + } + + public void setImage6(ImageComponent ic) { + this.image6 = ic; + } + + private HtmlPanelGrid gridPanel77 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel77() { + return gridPanel77; + } + + public void setGridPanel77(HtmlPanelGrid hpg) { + this.gridPanel77 = hpg; + } + + private ImageComponent image7 = new ImageComponent(); + + public ImageComponent getImage7() { + return image7; + } + + public void setImage7(ImageComponent ic) { + this.image7 = ic; + } + + private ImageComponent image8 = new ImageComponent(); + + public ImageComponent getImage8() { + return image8; + } + + public void setImage8(ImageComponent ic) { + this.image8 = ic; + } + + private PanelGroup groupPanel27 = new PanelGroup(); + + public PanelGroup getGroupPanel27() { + return groupPanel27; + } + + public void setGroupPanel27(PanelGroup pg) { + this.groupPanel27 = pg; + } + + private StaticText staticText118 = new StaticText(); + + public StaticText getStaticText118() { + return staticText118; + } + + public void setStaticText118(StaticText st) { + this.staticText118 = st; + } + + private Checkbox chkImgExt1 = new Checkbox(); + + public Checkbox getChkImgExt1() { + return chkImgExt1; + } + + public void setChkImgExt1(Checkbox c) { + this.chkImgExt1 = c; + } + + private PanelGroup groupPanel28 = new PanelGroup(); + + public PanelGroup getGroupPanel28() { + return groupPanel28; + } + + public void setGroupPanel28(PanelGroup pg) { + this.groupPanel28 = pg; + } + + private StaticText staticText119 = new StaticText(); + + public StaticText getStaticText119() { + return staticText119; + } + + public void setStaticText119(StaticText st) { + this.staticText119 = st; + } + + private Checkbox chkImgExt2 = new Checkbox(); + + public Checkbox getChkImgExt2() { + return chkImgExt2; + } + + public void setChkImgExt2(Checkbox c) { + this.chkImgExt2 = c; + } + + private HtmlPanelGrid gridPanel78 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel78() { + return gridPanel78; + } + + public void setGridPanel78(HtmlPanelGrid hpg) { + this.gridPanel78 = hpg; + } + + private ImageComponent image9 = new ImageComponent(); + + public ImageComponent getImage9() { + return image9; + } + + public void setImage9(ImageComponent ic) { + this.image9 = ic; + } + + private ImageComponent image10 = new ImageComponent(); + + public ImageComponent getImage10() { + return image10; + } + + public void setImage10(ImageComponent ic) { + this.image10 = ic; + } + + private PanelGroup groupPanel29 = new PanelGroup(); + + public PanelGroup getGroupPanel29() { + return groupPanel29; + } + + public void setGroupPanel29(PanelGroup pg) { + this.groupPanel29 = pg; + } + + private StaticText staticText120 = new StaticText(); + + public StaticText getStaticText120() { + return staticText120; + } + + public void setStaticText120(StaticText st) { + this.staticText120 = st; + } + + private Checkbox chkImgCab2 = new Checkbox(); + + public Checkbox getChkImgCab2() { + return chkImgCab2; + } + + public void setChkImgCab2(Checkbox c) { + this.chkImgCab2 = c; + } + + private PanelGroup groupPanel30 = new PanelGroup(); + + public PanelGroup getGroupPanel30() { + return groupPanel30; + } + + public void setGroupPanel30(PanelGroup pg) { + this.groupPanel30 = pg; + } + + private StaticText staticText121 = new StaticText(); + + public StaticText getStaticText121() { + return staticText121; + } + + public void setStaticText121(StaticText st) { + this.staticText121 = st; + } + + private Checkbox chkImgCab3 = new Checkbox(); + + public Checkbox getChkImgCab3() { + return chkImgCab3; + } + + public void setChkImgCab3(Checkbox c) { + this.chkImgCab3 = c; + } + + private HtmlPanelGrid gridPanel79 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel79() { + return gridPanel79; + } + + public void setGridPanel79(HtmlPanelGrid hpg) { + this.gridPanel79 = hpg; + } + + private ImageComponent image12 = new ImageComponent(); + + public ImageComponent getImage12() { + return image12; + } + + public void setImage12(ImageComponent ic) { + this.image12 = ic; + } + + private ImageComponent image13 = new ImageComponent(); + + public ImageComponent getImage13() { + return image13; + } + + public void setImage13(ImageComponent ic) { + this.image13 = ic; + } + + private ImageComponent image14 = new ImageComponent(); + + public ImageComponent getImage14() { + return image14; + } + + public void setImage14(ImageComponent ic) { + this.image14 = ic; + } + + private PanelGroup groupPanel31 = new PanelGroup(); + + public PanelGroup getGroupPanel31() { + return groupPanel31; + } + + public void setGroupPanel31(PanelGroup pg) { + this.groupPanel31 = pg; + } + + private StaticText staticText122 = new StaticText(); + + public StaticText getStaticText122() { + return staticText122; + } + + public void setStaticText122(StaticText st) { + this.staticText122 = st; + } + + private Checkbox chkImgMa2 = new Checkbox(); + + public Checkbox getChkImgMa2() { + return chkImgMa2; + } + + public void setChkImgMa2(Checkbox c) { + this.chkImgMa2 = c; + } + + private PanelGroup groupPanel32 = new PanelGroup(); + + public PanelGroup getGroupPanel32() { + return groupPanel32; + } + + public void setGroupPanel32(PanelGroup pg) { + this.groupPanel32 = pg; + } + + private StaticText staticText123 = new StaticText(); + + public StaticText getStaticText123() { + return staticText123; + } + + public void setStaticText123(StaticText st) { + this.staticText123 = st; + } + + private Checkbox chkImgMa3 = new Checkbox(); + + public Checkbox getChkImgMa3() { + return chkImgMa3; + } + + public void setChkImgMa3(Checkbox c) { + this.chkImgMa3 = c; + } + + private PanelGroup groupPanel33 = new PanelGroup(); + + public PanelGroup getGroupPanel33() { + return groupPanel33; + } + + public void setGroupPanel33(PanelGroup pg) { + this.groupPanel33 = pg; + } + + private StaticText staticText124 = new StaticText(); + + public StaticText getStaticText124() { + return staticText124; + } + + public void setStaticText124(StaticText st) { + this.staticText124 = st; + } + + private Checkbox chkImgMa5 = new Checkbox(); + + public Checkbox getChkImgMa5() { + return chkImgMa5; + } + + public void setChkImgMa5(Checkbox c) { + this.chkImgMa5 = c; + } + + private PanelGroup groupPanel34 = new PanelGroup(); + + public PanelGroup getGroupPanel34() { + return groupPanel34; + } + + public void setGroupPanel34(PanelGroup pg) { + this.groupPanel34 = pg; + } + + private StaticText staticText125 = new StaticText(); + + public StaticText getStaticText125() { + return staticText125; + } + + public void setStaticText125(StaticText st) { + this.staticText125 = st; + } + + private Checkbox chkImgMa6 = new Checkbox(); + + public Checkbox getChkImgMa6() { + return chkImgMa6; + } + + public void setChkImgMa6(Checkbox c) { + this.chkImgMa6 = c; + } + + private HtmlPanelGrid gridPanel80 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel80() { + return gridPanel80; + } + + public void setGridPanel80(HtmlPanelGrid hpg) { + this.gridPanel80 = hpg; + } + + private ImageComponent image15 = new ImageComponent(); + + public ImageComponent getImage15() { + return image15; + } + + public void setImage15(ImageComponent ic) { + this.image15 = ic; + } + + private ImageComponent image16 = new ImageComponent(); + + public ImageComponent getImage16() { + return image16; + } + + public void setImage16(ImageComponent ic) { + this.image16 = ic; + } + + private PanelGroup groupPanel35 = new PanelGroup(); + + public PanelGroup getGroupPanel35() { + return groupPanel35; + } + + public void setGroupPanel35(PanelGroup pg) { + this.groupPanel35 = pg; + } + + private StaticText staticText126 = new StaticText(); + + public StaticText getStaticText126() { + return staticText126; + } + + public void setStaticText126(StaticText st) { + this.staticText126 = st; + } + + private Checkbox chkImgMa8 = new Checkbox(); + + public Checkbox getChkImgMa8() { + return chkImgMa8; + } + + public void setChkImgMa8(Checkbox c) { + this.chkImgMa8 = c; + } + + private PanelGroup groupPanel36 = new PanelGroup(); + + public PanelGroup getGroupPanel36() { + return groupPanel36; + } + + public void setGroupPanel36(PanelGroup pg) { + this.groupPanel36 = pg; + } + + private StaticText staticText127 = new StaticText(); + + public StaticText getStaticText127() { + return staticText127; + } + + public void setStaticText127(StaticText st) { + this.staticText127 = st; + } + + private Checkbox chkImgMa10 = new Checkbox(); + + public Checkbox getChkImgMa10() { + return chkImgMa10; + } + + public void setChkImgMa10(Checkbox c) { + this.chkImgMa10 = c; + } + + private HtmlPanelGrid gridPanel81 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel81() { + return gridPanel81; + } + + public void setGridPanel81(HtmlPanelGrid hpg) { + this.gridPanel81 = hpg; + } + + private StaticText staticText128 = new StaticText(); + + public StaticText getStaticText128() { + return staticText128; + } + + public void setStaticText128(StaticText st) { + this.staticText128 = st; + } + + private PanelGroup groupPanel37 = new PanelGroup(); + + public PanelGroup getGroupPanel37() { + return groupPanel37; + } + + public void setGroupPanel37(PanelGroup pg) { + this.groupPanel37 = pg; + } + + private Checkbox chkRestricaoCargas = new Checkbox(); + + public Checkbox getChkRestricaoCargas() { + return chkRestricaoCargas; + } + + public void setChkRestricaoCargas(Checkbox c) { + this.chkRestricaoCargas = c; + } + + private StaticText staticText129 = new StaticText(); + + public StaticText getStaticText129() { + return staticText129; + } + + public void setStaticText129(StaticText st) { + this.staticText129 = st; + } + + private RadioButton rbKgs2 = new RadioButton(); + + public RadioButton getRbKgs2() { + return rbKgs2; + } + + public void setRbKgs2(RadioButton rb) { + this.rbKgs2 = rb; + } + + private StaticText stKgs2 = new StaticText(); + + public StaticText getStKgs2() { + return stKgs2; + } + + public void setStKgs2(StaticText st) { + this.stKgs2 = st; + } + + private RadioButton rbKgs5 = new RadioButton(); + + public RadioButton getRbKgs5() { + return rbKgs5; + } + + public void setRbKgs5(RadioButton rb) { + this.rbKgs5 = rb; + } + + private StaticText stKgs5 = new StaticText(); + + public StaticText getStKgs5() { + return stKgs5; + } + + public void setStKgs5(StaticText st) { + this.stKgs5 = st; + } + + private RadioButton rbKgs10 = new RadioButton(); + + public RadioButton getRbKgs10() { + return rbKgs10; + } + + public void setRbKgs10(RadioButton rb) { + this.rbKgs10 = rb; + } + + private StaticText stKgs10 = new StaticText(); + + public StaticText getStKgs10() { + return stKgs10; + } + + public void setStKgs10(StaticText st) { + this.stKgs10 = st; + } + + private RadioButton rbKgs15 = new RadioButton(); + + public RadioButton getRbKgs15() { + return rbKgs15; + } + + public void setRbKgs15(RadioButton rb) { + this.rbKgs15 = rb; + } + + private StaticText stKgs15 = new StaticText(); + + public StaticText getStKgs15() { + return stKgs15; + } + + public void setStKgs15(StaticText st) { + this.stKgs15 = st; + } + + private RadioButton rbKgsOutro = new RadioButton(); + + public RadioButton getRbKgsOutro() { + return rbKgsOutro; + } + + public void setRbKgsOutro(RadioButton rb) { + this.rbKgsOutro = rb; + } + + private StaticText stKgsOutro = new StaticText(); + + public StaticText getStKgsOutro() { + return stKgsOutro; + } + + public void setStKgsOutro(StaticText st) { + this.stKgsOutro = st; + } + + private TextField txtKgs = new TextField(); + + public TextField getTxtKgs() { + return txtKgs; + } + + public void setTxtKgs(TextField tf) { + this.txtKgs = tf; + } + + private StaticText stKg = new StaticText(); + + public StaticText getStKg() { + return stKg; + } + + public void setStKg(StaticText st) { + this.stKg = st; + } + + private PanelGroup groupPanel38 = new PanelGroup(); + + public PanelGroup getGroupPanel38() { + return groupPanel38; + } + + public void setGroupPanel38(PanelGroup pg) { + this.groupPanel38 = pg; + } + + private Checkbox chkRestricaoMotricidade = new Checkbox(); + + public Checkbox getChkRestricaoMotricidade() { + return chkRestricaoMotricidade; + } + + public void setChkRestricaoMotricidade(Checkbox c) { + this.chkRestricaoMotricidade = c; + } + + private StaticText staticText136 = new StaticText(); + + public StaticText getStaticText136() { + return staticText136; + } + + public void setStaticText136(StaticText st) { + this.staticText136 = st; + } + + private PanelGroup groupPanel39 = new PanelGroup(); + + public PanelGroup getGroupPanel39() { + return groupPanel39; + } + + public void setGroupPanel39(PanelGroup pg) { + this.groupPanel39 = pg; + } + + private Checkbox chkRestricaoConducao = new Checkbox(); + + public Checkbox getChkRestricaoConducao() { + return chkRestricaoConducao; + } + + public void setChkRestricaoConducao(Checkbox c) { + this.chkRestricaoConducao = c; + } + + private StaticText staticText137 = new StaticText(); + + public StaticText getStaticText137() { + return staticText137; + } + + public void setStaticText137(StaticText st) { + this.staticText137 = st; + } + + private PanelGroup groupPanel40 = new PanelGroup(); + + public PanelGroup getGroupPanel40() { + return groupPanel40; + } + + public void setGroupPanel40(PanelGroup pg) { + this.groupPanel40 = pg; + } + + private Checkbox chkRestricaoVibracoes = new Checkbox(); + + public Checkbox getChkRestricaoVibracoes() { + return chkRestricaoVibracoes; + } + + public void setChkRestricaoVibracoes(Checkbox c) { + this.chkRestricaoVibracoes = c; + } + + private StaticText staticText138 = new StaticText(); + + public StaticText getStaticText138() { + return staticText138; + } + + public void setStaticText138(StaticText st) { + this.staticText138 = st; + } + + private HtmlPanelGrid gridPanel82 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel82() { + return gridPanel82; + } + + public void setGridPanel82(HtmlPanelGrid hpg) { + this.gridPanel82 = hpg; + } + + private PanelGroup groupPanel41 = new PanelGroup(); + + public PanelGroup getGroupPanel41() { + return groupPanel41; + } + + public void setGroupPanel41(PanelGroup pg) { + this.groupPanel41 = pg; + } + + private Checkbox chkRestricaoOutras = new Checkbox(); + + public Checkbox getChkRestricaoOutras() { + return chkRestricaoOutras; + } + + public void setChkRestricaoOutras(Checkbox c) { + this.chkRestricaoOutras = c; + } + + private StaticText staticText139 = new StaticText(); + + public StaticText getStaticText139() { + return staticText139; + } + + public void setStaticText139(StaticText st) { + this.staticText139 = st; + } + + private TextField txtRestricaoOutras = new TextField(); + + public TextField getTxtRestricaoOutras() { + return txtRestricaoOutras; + } + + public void setTxtRestricaoOutras(TextField tf) { + this.txtRestricaoOutras = tf; + } + + private HtmlPanelGrid gridPanel83 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel83() { + return gridPanel83; + } + + public void setGridPanel83(HtmlPanelGrid hpg) { + this.gridPanel83 = hpg; + } + + private StaticText staticText140 = new StaticText(); + + public StaticText getStaticText140() { + return staticText140; + } + + public void setStaticText140(StaticText st) { + this.staticText140 = st; + } + + private TextField txtObservacoes = new TextField(); + + public TextField getTxtObservacoes() { + return txtObservacoes; + } + + public void setTxtObservacoes(TextField tf) { + this.txtObservacoes = tf; + } + + private RadioButton rbIncapacidadePerm = new RadioButton(); + + public RadioButton getRbIncapacidadePerm() { + return rbIncapacidadePerm; + } + + public void setRbIncapacidadePerm(RadioButton rb) { + this.rbIncapacidadePerm = rb; + } + + private StaticText staticText141 = new StaticText(); + + public StaticText getStaticText141() { + return staticText141; + } + + public void setStaticText141(StaticText st) { + this.staticText141 = st; + } + + private ImageComponent image17 = new ImageComponent(); + + public ImageComponent getImage17() { + return image17; + } + + public void setImage17(ImageComponent ic) { + this.image17 = ic; + } + + private ImageComponent image18 = new ImageComponent(); + + public ImageComponent getImage18() { + return image18; + } + + public void setImage18(ImageComponent ic) { + this.image18 = ic; + } + + private HtmlPanelGrid gridPanel84 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel84() { + return gridPanel84; + } + + public void setGridPanel84(HtmlPanelGrid hpg) { + this.gridPanel84 = hpg; + } + + private ImageComponent image19 = new ImageComponent(); + + public ImageComponent getImage19() { + return image19; + } + + public void setImage19(ImageComponent ic) { + this.image19 = ic; + } + + private ImageComponent image20 = new ImageComponent(); + + public ImageComponent getImage20() { + return image20; + } + + public void setImage20(ImageComponent ic) { + this.image20 = ic; + } + + private PanelGroup groupPanel42 = new PanelGroup(); + + public PanelGroup getGroupPanel42() { + return groupPanel42; + } + + public void setGroupPanel42(PanelGroup pg) { + this.groupPanel42 = pg; + } + + private StaticText staticText142 = new StaticText(); + + public StaticText getStaticText142() { + return staticText142; + } + + public void setStaticText142(StaticText st) { + this.staticText142 = st; + } + + private Checkbox chkImgRot1 = new Checkbox(); + + public Checkbox getChkImgRot1() { + return chkImgRot1; + } + + public void setChkImgRot1(Checkbox c) { + this.chkImgRot1 = c; + } + + private PanelGroup groupPanel43 = new PanelGroup(); + + public PanelGroup getGroupPanel43() { + return groupPanel43; + } + + public void setGroupPanel43(PanelGroup pg) { + this.groupPanel43 = pg; + } + + private StaticText staticText143 = new StaticText(); + + public StaticText getStaticText143() { + return staticText143; + } + + public void setStaticText143(StaticText st) { + this.staticText143 = st; + } + + private Checkbox chkImgRot2 = new Checkbox(); + + public Checkbox getChkImgRot2() { + return chkImgRot2; + } + + public void setChkImgRot2(Checkbox c) { + this.chkImgRot2 = c; + } + + private ImageComponent image21 = new ImageComponent(); + + public ImageComponent getImage21() { + return image21; + } + + public void setImage21(ImageComponent ic) { + this.image21 = ic; + } + + private ImageComponent image11 = new ImageComponent(); + + public ImageComponent getImage11() { + return image11; + } + + public void setImage11(ImageComponent ic) { + this.image11 = ic; + } + + private PanelGroup groupPanel44 = new PanelGroup(); + + public PanelGroup getGroupPanel44() { + return groupPanel44; + } + + public void setGroupPanel44(PanelGroup pg) { + this.groupPanel44 = pg; + } + + private StaticText staticText144 = new StaticText(); + + public StaticText getStaticText144() { + return staticText144; + } + + public void setStaticText144(StaticText st) { + this.staticText144 = st; + } + + private Checkbox chkImgCab1 = new Checkbox(); + + public Checkbox getChkImgCab1() { + return chkImgCab1; + } + + public void setChkImgCab1(Checkbox c) { + this.chkImgCab1 = c; + } + + private PanelGroup groupPanel45 = new PanelGroup(); + + public PanelGroup getGroupPanel45() { + return groupPanel45; + } + + public void setGroupPanel45(PanelGroup pg) { + this.groupPanel45 = pg; + } + + private StaticText staticText145 = new StaticText(); + + public StaticText getStaticText145() { + return staticText145; + } + + public void setStaticText145(StaticText st) { + this.staticText145 = st; + } + + private Checkbox chkImgCab4 = new Checkbox(); + + public Checkbox getChkImgCab4() { + return chkImgCab4; + } + + public void setChkImgCab4(Checkbox c) { + this.chkImgCab4 = c; + } + + private ImageComponent image22 = new ImageComponent(); + + public ImageComponent getImage22() { + return image22; + } + + public void setImage22(ImageComponent ic) { + this.image22 = ic; + } + + private ImageComponent image23 = new ImageComponent(); + + public ImageComponent getImage23() { + return image23; + } + + public void setImage23(ImageComponent ic) { + this.image23 = ic; + } + + private ImageComponent image24 = new ImageComponent(); + + public ImageComponent getImage24() { + return image24; + } + + public void setImage24(ImageComponent ic) { + this.image24 = ic; + } + + private PanelGroup groupPanel46 = new PanelGroup(); + + public PanelGroup getGroupPanel46() { + return groupPanel46; + } + + public void setGroupPanel46(PanelGroup pg) { + this.groupPanel46 = pg; + } + + private StaticText staticText146 = new StaticText(); + + public StaticText getStaticText146() { + return staticText146; + } + + public void setStaticText146(StaticText st) { + this.staticText146 = st; + } + + private Checkbox chkImgMa1 = new Checkbox(); + + public Checkbox getChkImgMa1() { + return chkImgMa1; + } + + public void setChkImgMa1(Checkbox c) { + this.chkImgMa1 = c; + } + + private PanelGroup groupPanel47 = new PanelGroup(); + + public PanelGroup getGroupPanel47() { + return groupPanel47; + } + + public void setGroupPanel47(PanelGroup pg) { + this.groupPanel47 = pg; + } + + private StaticText staticText147 = new StaticText(); + + public StaticText getStaticText147() { + return staticText147; + } + + public void setStaticText147(StaticText st) { + this.staticText147 = st; + } + + private Checkbox chkImgMa4 = new Checkbox(); + + public Checkbox getChkImgMa4() { + return chkImgMa4; + } + + public void setChkImgMa4(Checkbox c) { + this.chkImgMa4 = c; + } + + private ImageComponent image25 = new ImageComponent(); + + public ImageComponent getImage25() { + return image25; + } + + public void setImage25(ImageComponent ic) { + this.image25 = ic; + } + + private ImageComponent image26 = new ImageComponent(); + + public ImageComponent getImage26() { + return image26; + } + + public void setImage26(ImageComponent ic) { + this.image26 = ic; + } + + private PanelGroup groupPanel48 = new PanelGroup(); + + public PanelGroup getGroupPanel48() { + return groupPanel48; + } + + public void setGroupPanel48(PanelGroup pg) { + this.groupPanel48 = pg; + } + + private StaticText staticText148 = new StaticText(); + + public StaticText getStaticText148() { + return staticText148; + } + + public void setStaticText148(StaticText st) { + this.staticText148 = st; + } + + private Checkbox chkImgMa7 = new Checkbox(); + + public Checkbox getChkImgMa7() { + return chkImgMa7; + } + + public void setChkImgMa7(Checkbox c) { + this.chkImgMa7 = c; + } + + private PanelGroup groupPanel49 = new PanelGroup(); + + public PanelGroup getGroupPanel49() { + return groupPanel49; + } + + public void setGroupPanel49(PanelGroup pg) { + this.groupPanel49 = pg; + } + + private StaticText staticText149 = new StaticText(); + + public StaticText getStaticText149() { + return staticText149; + } + + public void setStaticText149(StaticText st) { + this.staticText149 = st; + } + + private Checkbox chkImgMa9 = new Checkbox(); + + public Checkbox getChkImgMa9() { + return chkImgMa9; + } + + public void setChkImgMa9(Checkbox c) { + this.chkImgMa9 = c; + } + + private HtmlPanelGrid gridMedicoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedicoView() { + return gridMedicoView; + } + + public void setGridMedicoView(HtmlPanelGrid hpg) { + this.gridMedicoView = hpg; + } + + private HtmlPanelGrid gridPanel85 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel85() { + return gridPanel85; + } + + public void setGridPanel85(HtmlPanelGrid hpg) { + this.gridPanel85 = hpg; + } + + private StaticText staticText150 = new StaticText(); + + public StaticText getStaticText150() { + return staticText150; + } + + public void setStaticText150(StaticText st) { + this.staticText150 = st; + } + + private HtmlPanelGrid gridLesao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLesao() { + return gridLesao; + } + + public void setGridLesao(HtmlPanelGrid hpg) { + this.gridLesao = hpg; + } + + private StaticText staticText151 = new StaticText(); + + public StaticText getStaticText151() { + return staticText151; + } + + public void setStaticText151(StaticText st) { + this.staticText151 = st; + } + + private HtmlPanelGrid gridPanel86 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel86() { + return gridPanel86; + } + + public void setGridPanel86(HtmlPanelGrid hpg) { + this.gridPanel86 = hpg; + } + + private StaticText staticText152 = new StaticText(); + + public StaticText getStaticText152() { + return staticText152; + } + + public void setStaticText152(StaticText st) { + this.staticText152 = st; + } + + private HtmlPanelGrid gridIncapacidade2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridIncapacidade2() { + return gridIncapacidade2; + } + + public void setGridIncapacidade2(HtmlPanelGrid hpg) { + this.gridIncapacidade2 = hpg; + } + + private HtmlPanelGrid gridPanel87 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel87() { + return gridPanel87; + } + + public void setGridPanel87(HtmlPanelGrid hpg) { + this.gridPanel87 = hpg; + } + + private StaticText staticText153 = new StaticText(); + + public StaticText getStaticText153() { + return staticText153; + } + + public void setStaticText153(StaticText st) { + this.staticText153 = st; + } + + private HtmlPanelGrid gridRestricoes1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRestricoes1() { + return gridRestricoes1; + } + + public void setGridRestricoes1(HtmlPanelGrid hpg) { + this.gridRestricoes1 = hpg; + } + + private HtmlPanelGrid gridPanel88 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel88() { + return gridPanel88; + } + + public void setGridPanel88(HtmlPanelGrid hpg) { + this.gridPanel88 = hpg; + } + + private HtmlPanelGrid gridImagesRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImagesRestricoes() { + return gridImagesRestricoes; + } + + public void setGridImagesRestricoes(HtmlPanelGrid hpg) { + this.gridImagesRestricoes = hpg; + } + + private HtmlPanelGrid gridOutrasRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridOutrasRestricoes() { + return gridOutrasRestricoes; + } + + public void setGridOutrasRestricoes(HtmlPanelGrid hpg) { + this.gridOutrasRestricoes = hpg; + } + + private StaticText staticText154 = new StaticText(); + + public StaticText getStaticText154() { + return staticText154; + } + + public void setStaticText154(StaticText st) { + this.staticText154 = st; + } + + private HtmlPanelGrid gridPanel90 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel90() { + return gridPanel90; + } + + public void setGridPanel90(HtmlPanelGrid hpg) { + this.gridPanel90 = hpg; + } + + private StaticText staticText155 = new StaticText(); + + public StaticText getStaticText155() { + return staticText155; + } + + public void setStaticText155(StaticText st) { + this.staticText155 = st; + } + + private StaticText stObservacoes = new StaticText(); + + public StaticText getStObservacoes() { + return stObservacoes; + } + + public void setStObservacoes(StaticText st) { + this.stObservacoes = st; + } + + private HtmlPanelGrid gridAssinaturas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssinaturas() { + return gridAssinaturas; + } + + public void setGridAssinaturas(HtmlPanelGrid hpg) { + this.gridAssinaturas = hpg; + } + + private HtmlPanelGrid gridPanel89 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel89() { + return gridPanel89; + } + + public void setGridPanel89(HtmlPanelGrid hpg) { + this.gridPanel89 = hpg; + } + + private HtmlPanelGrid gridPanel91 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel91() { + return gridPanel91; + } + + public void setGridPanel91(HtmlPanelGrid hpg) { + this.gridPanel91 = hpg; + } + + private StaticText staticText73 = new StaticText(); + + public StaticText getStaticText73() { + return staticText73; + } + + public void setStaticText73(StaticText st) { + this.staticText73 = st; + } + + private HtmlPanelGrid gridPanel92 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel92() { + return gridPanel92; + } + + public void setGridPanel92(HtmlPanelGrid hpg) { + this.gridPanel92 = hpg; + } + + private PanelGroup groupPanel50 = new PanelGroup(); + + public PanelGroup getGroupPanel50() { + return groupPanel50; + } + + public void setGroupPanel50(PanelGroup pg) { + this.groupPanel50 = pg; + } + + private StaticText staticText76 = new StaticText(); + + public StaticText getStaticText76() { + return staticText76; + } + + public void setStaticText76(StaticText st) { + this.staticText76 = st; + } + + private TextField txtAssSeg = new TextField(); + + public TextField getTxtAssSeg() { + return txtAssSeg; + } + + public void setTxtAssSeg(TextField tf) { + this.txtAssSeg = tf; + } + + private HtmlPanelGrid gridPanel93 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel93() { + return gridPanel93; + } + + public void setGridPanel93(HtmlPanelGrid hpg) { + this.gridPanel93 = hpg; + } + + private StaticText stDtAssSeg = new StaticText(); + + public StaticText getStDtAssSeg() { + return stDtAssSeg; + } + + public void setStDtAssSeg(StaticText st) { + this.stDtAssSeg = st; + } + + private HtmlPanelGrid gridPanel94 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel94() { + return gridPanel94; + } + + public void setGridPanel94(HtmlPanelGrid hpg) { + this.gridPanel94 = hpg; + } + + private HtmlPanelGrid gridPanel95 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel95() { + return gridPanel95; + } + + public void setGridPanel95(HtmlPanelGrid hpg) { + this.gridPanel95 = hpg; + } + + private StaticText staticText98 = new StaticText(); + + public StaticText getStaticText98() { + return staticText98; + } + + public void setStaticText98(StaticText st) { + this.staticText98 = st; + } + + private HtmlPanelGrid gridPanel96 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel96() { + return gridPanel96; + } + + public void setGridPanel96(HtmlPanelGrid hpg) { + this.gridPanel96 = hpg; + } + + private PanelGroup groupPanel51 = new PanelGroup(); + + public PanelGroup getGroupPanel51() { + return groupPanel51; + } + + public void setGroupPanel51(PanelGroup pg) { + this.groupPanel51 = pg; + } + + private StaticText staticText101 = new StaticText(); + + public StaticText getStaticText101() { + return staticText101; + } + + public void setStaticText101(StaticText st) { + this.staticText101 = st; + } + + private TextField txtAssHS = new TextField(); + + public TextField getTxtAssHS() { + return txtAssHS; + } + + public void setTxtAssHS(TextField tf) { + this.txtAssHS = tf; + } + + private HtmlPanelGrid gridPanel97 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel97() { + return gridPanel97; + } + + public void setGridPanel97(HtmlPanelGrid hpg) { + this.gridPanel97 = hpg; + } + + private StaticText staticText104 = new StaticText(); + + public StaticText getStaticText104() { + return staticText104; + } + + public void setStaticText104(StaticText st) { + this.staticText104 = st; + } + + private HtmlPanelGrid gridPanel98 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel98() { + return gridPanel98; + } + + public void setGridPanel98(HtmlPanelGrid hpg) { + this.gridPanel98 = hpg; + } + + private HtmlPanelGrid gridPanel99 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel99() { + return gridPanel99; + } + + public void setGridPanel99(HtmlPanelGrid hpg) { + this.gridPanel99 = hpg; + } + + private StaticText staticText130 = new StaticText(); + + public StaticText getStaticText130() { + return staticText130; + } + + public void setStaticText130(StaticText st) { + this.staticText130 = st; + } + + private HtmlPanelGrid gridPanel100 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel100() { + return gridPanel100; + } + + public void setGridPanel100(HtmlPanelGrid hpg) { + this.gridPanel100 = hpg; + } + + private PanelGroup groupPanel52 = new PanelGroup(); + + public PanelGroup getGroupPanel52() { + return groupPanel52; + } + + public void setGroupPanel52(PanelGroup pg) { + this.groupPanel52 = pg; + } + + private StaticText staticText131 = new StaticText(); + + public StaticText getStaticText131() { + return staticText131; + } + + public void setStaticText131(StaticText st) { + this.staticText131 = st; + } + + private TextField txtAssMed = new TextField(); + + public TextField getTxtAssMed() { + return txtAssMed; + } + + public void setTxtAssMed(TextField tf) { + this.txtAssMed = tf; + } + + private HtmlPanelGrid gridPanel101 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel101() { + return gridPanel101; + } + + public void setGridPanel101(HtmlPanelGrid hpg) { + this.gridPanel101 = hpg; + } + + private StaticText staticText132 = new StaticText(); + + public StaticText getStaticText132() { + return staticText132; + } + + public void setStaticText132(StaticText st) { + this.staticText132 = st; + } + + private HtmlPanelGrid gridPanel102 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel102() { + return gridPanel102; + } + + public void setGridPanel102(HtmlPanelGrid hpg) { + this.gridPanel102 = hpg; + } + + private HtmlPanelGrid gridPanel103 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel103() { + return gridPanel103; + } + + public void setGridPanel103(HtmlPanelGrid hpg) { + this.gridPanel103 = hpg; + } + + private StaticText staticText133 = new StaticText(); + + public StaticText getStaticText133() { + return staticText133; + } + + public void setStaticText133(StaticText st) { + this.staticText133 = st; + } + + private HtmlPanelGrid gridPanel104 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel104() { + return gridPanel104; + } + + public void setGridPanel104(HtmlPanelGrid hpg) { + this.gridPanel104 = hpg; + } + + private PanelGroup groupPanel53 = new PanelGroup(); + + public PanelGroup getGroupPanel53() { + return groupPanel53; + } + + public void setGroupPanel53(PanelGroup pg) { + this.groupPanel53 = pg; + } + + private StaticText staticText134 = new StaticText(); + + public StaticText getStaticText134() { + return staticText134; + } + + public void setStaticText134(StaticText st) { + this.staticText134 = st; + } + + private HtmlPanelGrid gridPanel105 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel105() { + return gridPanel105; + } + + public void setGridPanel105(HtmlPanelGrid hpg) { + this.gridPanel105 = hpg; + } + + private StaticText staticText135 = new StaticText(); + + public StaticText getStaticText135() { + return staticText135; + } + + public void setStaticText135(StaticText st) { + this.staticText135 = st; + } + + private StaticText staticText156 = new StaticText(); + + public StaticText getStaticText156() { + return staticText156; + } + + public void setStaticText156(StaticText st) { + this.staticText156 = st; + } + + private HtmlPanelGrid gridPanel106 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel106() { + return gridPanel106; + } + + public void setGridPanel106(HtmlPanelGrid hpg) { + this.gridPanel106 = hpg; + } + + private HtmlPanelGrid gridPanel107 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel107() { + return gridPanel107; + } + + public void setGridPanel107(HtmlPanelGrid hpg) { + this.gridPanel107 = hpg; + } + + private StaticText staticText157 = new StaticText(); + + public StaticText getStaticText157() { + return staticText157; + } + + public void setStaticText157(StaticText st) { + this.staticText157 = st; + } + + private HtmlPanelGrid gridPanel108 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel108() { + return gridPanel108; + } + + public void setGridPanel108(HtmlPanelGrid hpg) { + this.gridPanel108 = hpg; + } + + private StaticText staticText158 = new StaticText(); + + public StaticText getStaticText158() { + return staticText158; + } + + public void setStaticText158(StaticText st) { + this.staticText158 = st; + } + + private PanelGroup groupPanel54 = new PanelGroup(); + + public PanelGroup getGroupPanel54() { + return groupPanel54; + } + + public void setGroupPanel54(PanelGroup pg) { + this.groupPanel54 = pg; + } + + private StaticText staticText159 = new StaticText(); + + public StaticText getStaticText159() { + return staticText159; + } + + public void setStaticText159(StaticText st) { + this.staticText159 = st; + } + + private TextField txtAssRespRh = new TextField(); + + public TextField getTxtAssRespRh() { + return txtAssRespRh; + } + + public void setTxtAssRespRh(TextField tf) { + this.txtAssRespRh = tf; + } + + private HtmlPanelGrid gridPanel109 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel109() { + return gridPanel109; + } + + public void setGridPanel109(HtmlPanelGrid hpg) { + this.gridPanel109 = hpg; + } + + private StaticText staticText160 = new StaticText(); + + public StaticText getStaticText160() { + return staticText160; + } + + public void setStaticText160(StaticText st) { + this.staticText160 = st; + } + + private HtmlPanelGrid gridPanel110 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel110() { + return gridPanel110; + } + + public void setGridPanel110(HtmlPanelGrid hpg) { + this.gridPanel110 = hpg; + } + + private HtmlPanelGrid gridPanel111 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel111() { + return gridPanel111; + } + + public void setGridPanel111(HtmlPanelGrid hpg) { + this.gridPanel111 = hpg; + } + + private StaticText staticText161 = new StaticText(); + + public StaticText getStaticText161() { + return staticText161; + } + + public void setStaticText161(StaticText st) { + this.staticText161 = st; + } + + private HtmlPanelGrid gridPanel112 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel112() { + return gridPanel112; + } + + public void setGridPanel112(HtmlPanelGrid hpg) { + this.gridPanel112 = hpg; + } + + private StaticText staticText162 = new StaticText(); + + public StaticText getStaticText162() { + return staticText162; + } + + public void setStaticText162(StaticText st) { + this.staticText162 = st; + } + + private PanelGroup groupPanel55 = new PanelGroup(); + + public PanelGroup getGroupPanel55() { + return groupPanel55; + } + + public void setGroupPanel55(PanelGroup pg) { + this.groupPanel55 = pg; + } + + private StaticText staticText163 = new StaticText(); + + public StaticText getStaticText163() { + return staticText163; + } + + public void setStaticText163(StaticText st) { + this.staticText163 = st; + } + + private TextField txtAssRespSeg = new TextField(); + + public TextField getTxtAssRespSeg() { + return txtAssRespSeg; + } + + public void setTxtAssRespSeg(TextField tf) { + this.txtAssRespSeg = tf; + } + + private HtmlPanelGrid gridPanel113 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel113() { + return gridPanel113; + } + + public void setGridPanel113(HtmlPanelGrid hpg) { + this.gridPanel113 = hpg; + } + + private StaticText stDtAssRespSeg = new StaticText(); + + public StaticText getStDtAssRespSeg() { + return stDtAssRespSeg; + } + + public void setStDtAssRespSeg(StaticText st) { + this.stDtAssRespSeg = st; + } + + private HtmlPanelGrid gridPanel22 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel22() { + return gridPanel22; + } + + public void setGridPanel22(HtmlPanelGrid hpg) { + this.gridPanel22 = hpg; + } + + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() { + return groupPanel5; + } + + public void setGroupPanel5(PanelGroup pg) { + this.groupPanel5 = pg; + } + + private Button butGravar = new Button(); + + public Button getButGravar() { + return butGravar; + } + + public void setButGravar(Button b) { + this.butGravar = b; + } + + private Button butEnviar = new Button(); + + public Button getButEnviar() { + return butEnviar; + } + + public void setButEnviar(Button b) { + this.butEnviar = b; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + + private HtmlPanelGrid gridHeader1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridHeader1() { + return gridHeader1; + } + + public void setGridHeader1(HtmlPanelGrid hpg) { + this.gridHeader1 = hpg; + } + + private PanelGroup groupPanel56 = new PanelGroup(); + + public PanelGroup getGroupPanel56() { + return groupPanel56; + } + + public void setGroupPanel56(PanelGroup pg) { + this.groupPanel56 = pg; + } + + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + + private StaticText staticText165 = new StaticText(); + + public StaticText getStaticText165() { + return staticText165; + } + + public void setStaticText165(StaticText st) { + this.staticText165 = st; + } + + private Hyperlink lnkEditUser = new Hyperlink(); + + public Hyperlink getLnkEditUser() { + return lnkEditUser; + } + + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; + } + + private StaticText staticText166 = new StaticText(); + + public StaticText getStaticText166() { + return staticText166; + } + + public void setStaticText166(StaticText st) { + this.staticText166 = st; + } + + private Hyperlink lnkLogout = new Hyperlink(); + + public Hyperlink getLnkLogout() { + return lnkLogout; + } + + public void setLnkLogout(Hyperlink h) { + this.lnkLogout = h; + } + + private HtmlPanelGrid gridPanel114 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel114() { + return gridPanel114; + } + + public void setGridPanel114(HtmlPanelGrid hpg) { + this.gridPanel114 = hpg; + } + + private PanelGroup groupPanel57 = new PanelGroup(); + + public PanelGroup getGroupPanel57() { + return groupPanel57; + } + + public void setGroupPanel57(PanelGroup pg) { + this.groupPanel57 = pg; + } + + private ImageComponent image27 = new ImageComponent(); + + public ImageComponent getImage27() { + return image27; + } + + public void setImage27(ImageComponent ic) { + this.image27 = ic; + } + + private HtmlPanelGrid gridPanel115 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel115() { + return gridPanel115; + } + + public void setGridPanel115(HtmlPanelGrid hpg) { + this.gridPanel115 = hpg; + } + + private StaticText staticText168 = new StaticText(); + + public StaticText getStaticText168() { + return staticText168; + } + + public void setStaticText168(StaticText st) { + this.staticText168 = st; + } + + private HtmlPanelGrid gridPanel116 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel116() { + return gridPanel116; + } + + public void setGridPanel116(HtmlPanelGrid hpg) { + this.gridPanel116 = hpg; + } + + private PanelGroup groupPanel58 = new PanelGroup(); + + public PanelGroup getGroupPanel58() { + return groupPanel58; + } + + public void setGroupPanel58(PanelGroup pg) { + this.groupPanel58 = pg; + } + + private StaticText staticText169 = new StaticText(); + + public StaticText getStaticText169() { + return staticText169; + } + + public void setStaticText169(StaticText st) { + this.staticText169 = st; + } + + private StaticText stHeaderNr = new StaticText(); + + public StaticText getStHeaderNr() { + return stHeaderNr; + } + + public void setStHeaderNr(StaticText st) { + this.stHeaderNr = st; + } + + private PanelGroup groupPanel59 = new PanelGroup(); + + public PanelGroup getGroupPanel59() { + return groupPanel59; + } + + public void setGroupPanel59(PanelGroup pg) { + this.groupPanel59 = pg; + } + + private StaticText staticText170 = new StaticText(); + + public StaticText getStaticText170() { + return staticText170; + } + + public void setStaticText170(StaticText st) { + this.staticText170 = st; + } + + private StaticText stHeaderDate = new StaticText(); + + public StaticText getStHeaderDate() { + return stHeaderDate; + } + + public void setStHeaderDate(StaticText st) { + this.stHeaderDate = st; + } + + private ImageComponent image28 = new ImageComponent(); + + public ImageComponent getImage28() { + return image28; + } + + public void setImage28(ImageComponent ic) { + this.image28 = ic; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private RadioButton rbTurnoManha = new RadioButton(); + + public RadioButton getRbTurnoManha() { + return rbTurnoManha; + } + + public void setRbTurnoManha(RadioButton rb) { + this.rbTurnoManha = rb; + } + + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() { + return staticText1; + } + + public void setStaticText1(StaticText st) { + this.staticText1 = st; + } + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private RadioButton rbTurnoTarde = new RadioButton(); + + public RadioButton getRbTurnoTarde() { + return rbTurnoTarde; + } + + public void setRbTurnoTarde(RadioButton rb) { + this.rbTurnoTarde = rb; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private StaticText staticText41 = new StaticText(); + + public StaticText getStaticText41() { + return staticText41; + } + + public void setStaticText41(StaticText st) { + this.staticText41 = st; + } + + private RadioButton rbTurnoNoite = new RadioButton(); + + public RadioButton getRbTurnoNoite() { + return rbTurnoNoite; + } + + public void setRbTurnoNoite(RadioButton rb) { + this.rbTurnoNoite = rb; + } + + private StaticText staticText42 = new StaticText(); + + public StaticText getStaticText42() { + return staticText42; + } + + public void setStaticText42(StaticText st) { + this.staticText42 = st; + } + + private Button butImprimir = new Button(); + + public Button getButImprimir() { + return butImprimir; + } + + public void setButImprimir(Button b) { + this.butImprimir = b; + } + + private HiddenField hidPdf = new HiddenField(); + + public HiddenField getHidPdf() { + return hidPdf; + } + + public void setHidPdf(HiddenField hf) { + this.hidPdf = hf; + } + /** + *

Construct a new Page bean instance.

+ */ + public AnaliseAcidenteTrabalho() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("AnaliseAcidenteTrabalho Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + + initCalendars(); + + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + if(!pageFrom.matches("AnaliseAcidenteTrabalho.jsp")) + { + if(pageFrom.matches("LoadImage.jsp")) + { + restorePageState(); + fillImages(); + } + else + { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + drpTecnicos.setSelected(new Integer(0)); + drpMedicos.setSelected(new Integer(0)); + if(getSessionBean1().getCurrentAnalise() == null) // new analise + { + getSessionBean1().setAcidentado(null); // Here ????? + lnkLblTrabalhador.setDisabled(true); + lnkLblTrabalhador.setStyleClass(""); + initializePage(); + } + else // edit analise + { + lnkLblTrabalhador.setDisabled(false); + lnkLblTrabalhador.setStyleClass("labelTrabalhador"); + gridTrabalhadores.setRendered(false); + + fillPage(); + } + + } + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String lnkLogout_action() { + // TODO: Replace with your code + + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + return "login"; + } + + + private void initializePage() + { + butEnviar.setText("Enviar a RH"); + gridSiprpView.setRendered(false); + gridAcidentadoView.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + gridAssinaturas.setRendered(false); + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + String nome_empresa = adp.getEmpresaNome(getSessionBean1().getCurrentUser().getEmpresa_id()); + txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try + { + txtEstabelecimento.setText(adp.getEstabelecimentoNome(getSessionBean1().getCurrentUser().getEstabelecimento_id())); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + fillTrabalhadoresTable(); + + Calendar c = Calendar.getInstance(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); + stDataAcidente.setText(dateFormat.format(c.getTime())); + + } + + private void fillTrabalhadoresTable() + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + //lblActivos.setRendered(true); + table1.setRendered(true); + + ArrayList trabalhadoresList = adp.getTrabalhadoresListByEstabelecimento(getSessionBean1().getCurrentUser().getEstabelecimento_id()); + getSessionBean1().getTrabalhadoresListDataProvider().setList(trabalhadoresList); + } + catch(Exception ex) + { + //lblActivos.setRendered(false); + table1.setRendered(false); + ex.printStackTrace(); + } + } + + private String fillPage() + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + stHeaderNr.setText(a.getAnalise_nr()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); + stHeaderDate.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); + txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try + { + txtEstabelecimento.setText(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + Acidentado ac = null; + try + { + //Trabalhador t = adp.getTrabalhador(a.getTrabalhador_id()); + //txtDataNascimento.setText(t.getData_nascimento()); + ac = adp.getAcidentado(a.getAcidentado_id()); + txtTrabalhador.setText(ac.getNome()); + getSessionBean1().setAcidentado(ac); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + + int estado_documento = a.getEstado().intValue(); + if(estado_documento != ESTADO_IMPRESSAO) + { + butImprimir.setRendered(false); + } + else + { + butGravar.setRendered(false); + } + switch(estado_documento) + { + case ESTADO_SEG: + butEnviar.setText("Enviar a RH"); + gridSiprpView.setRendered(false); + gridAcidentadoView.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + gridAssinaturas.setRendered(false); + fillSiprp(a); + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + break; + case ESTADO_RH1: + butEnviar.setText("Enviar a HS"); + gridSiprpView.setRendered(false); + gridAcidentadoView.setRendered(false); + //gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + gridAssinaturas.setRendered(false); + if(ac != null) + { + fillAcidentado(ac); + } + fillSiprp(a); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + break; + case ESTADO_HS: + butEnviar.setText("Enviar a RH"); + //gridSiprpView.setRendered(false); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + //gridAcidentadoView.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + gridAssinaturas.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + fillRecomendacoesHs(a); + //gridDadosAcidenteRhView.setRendered(false); + //gridRecomendacoesHS.setRendered(false); + break; + case ESTADO_RH2: + butEnviar.setText("Enviar a Médico"); + + //gridSiprpView.setRendered(false); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + //gridAcidentadoView.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + //gridRecomendacoesViewHS.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + gridAssinaturas.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasRh(a); + break; + case ESTADO_MEDICO: + butEnviar.setText("Enviar a Verificação"); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedicoView.setRendered(false); + gridAssinaturas.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasViewRh(a); + fillMedico(a); + //fillMedicoView(a); + break; + case ESTADO_ASSINATURAS: + butEnviar.setText("Enviar a Impressão"); + if(a.getEstado_assinatura().intValue() < ESTADO_ASSINATURA_3) + { + butEnviar.setDisabled(true); + } + else + { + butEnviar.setDisabled(false); + } + + txtAssSeg.setDisabled(true); + txtAssHS.setDisabled(true); + txtAssMed.setDisabled(true); + txtAssRespRh.setDisabled(true); + txtAssRespSeg.setDisabled(true); + + int tipo_utilizador = getSessionBean1().getCurrentUser().getTipo().intValue(); + + switch(tipo_utilizador) + { + case 1: //seguranca + if(a.getEstado_assinatura().intValue() == 1) + { + txtAssRespSeg.setDisabled(false); + } + else + { + txtAssSeg.setDisabled(false); + } + + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + //fillAssinaturaSeg(a); + break; + + case 2: //rh + txtAssRespRh.setDisabled(false); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasViewRh(a); + break; + + case 3: //hs + txtAssHS.setDisabled(false); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + break; + + case 5: //med + txtAssMed.setDisabled(false); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedico.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasViewRh(a); + //fillMedico(a); + fillMedicoView(a); + break; + } + break; + case ESTADO_IMPRESSAO: + butEnviar.setText("Enviar para Fecho"); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedico.setRendered(false); + gridAssinaturas.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasViewRh(a); + //fillMedico(a); + fillMedicoView(a); + + buildPdf(a); + + break; + case ESTADO_FECHAR: + butEnviar.setText("Fechar"); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedico.setRendered(false); + gridAssinaturas.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasViewRh(a); + //fillMedico(a); + fillMedicoView(a); + break; + case ESTADO_CONCLUIDO: + } + + return null; + } + + private void fillSiprp(AnaliseAcidente a) + { + drpTecnicos.setSelected(a.getTecnico_saude_id()); + drpMedicos.setSelected(a.getMedico_id()); + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); + txtCap.setText(u.getCap()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try + { + Utilizador u = udp.getUtilizador(a.getMedico_id()); + txtCedula.setText(u.getNumero_cedula()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillSiprpView(AnaliseAcidente a) + { + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); + stTecnicoNome.setText(Utils.unicodeToHTML(u.getNome())); + txtCap1.setText(u.getCap()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try + { + Utilizador u = udp.getUtilizador(a.getMedico_id()); + stMedicoNome.setText(Utils.unicodeToHTML(u.getNome())); + txtCedula1.setText(u.getNumero_cedula()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillAcidentado(Acidentado a) + { + txtNomeAcidentado.setText(a.getNome()); + txtDataNascimento.setText(a.getData_nascimento()); + txtBI.setText(a.getBilhete_identidade()); + txtMorada.setText(a.getMorada()); + String cod_postal1 = ""; + String cod_postal2 = ""; + try + { + cod_postal1 = a.getCod_postal().substring(0, 4); + } + catch(Exception ex){} + try + { + cod_postal2 = a.getCod_postal().substring(5, 8); + } + catch(Exception ex){} + + + txtCodPostal1.setText(cod_postal1); + txtCodPostal2.setText(cod_postal2); + txtLocalidade.setText(a.getLocalidade()); + txtContactoTelefonico.setText(a.getContacto_telefonico()); + stDataAdmissao.setText(a.getData_admissao()); + + stFuncao.setText(a.getFuncao()); + if(a.getTurno().matches("m")) + { + rbTurnoManha.setSelected(new Boolean(true)); + } + else if(a.getTurno().matches("t")) + { + rbTurnoTarde.setSelected(new Boolean(true)); + } + else if(a.getTurno().matches("n")) + { + rbTurnoNoite.setSelected(new Boolean(true)); + } + } + + private void fillAcidentadoView(Acidentado a) + { + stNomeAcidentado.setText(a.getNome()); + //stDataNascimento.setText(a.getData_nascimento()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_nascimento().getTime()); + stDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + stBI.setText(a.getBilhete_identidade()); + stMorada.setText(a.getMorada()); + String cod_postal1 = ""; + String cod_postal2 = ""; + try + { + cod_postal1 = a.getCod_postal().substring(0, 4); + } + catch(Exception ex){} + try + { + cod_postal2 = a.getCod_postal().substring(5, 8); + } + catch(Exception ex){} + + //String cod_postal1 = a.getCod_postal().substring(0, 4); + //String cod_postal2 = a.getCod_postal().substring(5, 8); + String cod_postal = cod_postal1 + "-" + cod_postal2 + " " + a.getLocalidade(); + stCodPostal.setText(cod_postal); + stContactoTelefonico.setText(a.getContacto_telefonico()); + //stDataAdmissao1.setText(a.getData_admissao()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_admissao().getTime()); + stDataAdmissao1.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + stFuncao1.setText(a.getFuncao()); + String turno_str = ""; + if(a.getTurno().matches("m")) + { + turno_str = "manhã"; + } + else if(a.getTurno().matches("t")) + { + turno_str += "tarde "; + } + else if(a.getTurno().matches("n")) + { + turno_str += "noite"; + } + stTurno.setText(turno_str); + } + + private void fillDadosAcidenteSeg(AnaliseAcidente a) + { + stDataAcidente.setText(a.getData_acidente()); + Calendar cal = Calendar.getInstance(); + + // set the calendar to have your time + cal.setTimeInMillis(a.getHora_acidente().getTime()); + + int hour = cal.get(Calendar.HOUR); + int minutes = cal.get(Calendar.MINUTE); + drpHours.setSelected(new Integer(hour)); + drpMinutes.setSelected(new Integer(minutes)); + txtHorasTurno.setText(a.getHoras_turno().toString()); + txtSeccao.setText(a.getSeccao()); + txtLocal.setText(a.getLocal_trabalho()); + txtTarefa.setText(a.getTarefa()); + txtSubstancias.setText(a.getSubstancias()); + txtSuperior.setText(a.getSuperior_hierarquico()); + txtCondicoes.setText(a.getCondicoes()); + txtTestemunhas.setText(a.getTestemunhas()); + txtCausas.setText(a.getCausas()); + txtDescricao.setText(a.getDescricao()); + txtConclusoes.setText(a.getConclusoes()); + txtAccoes.setText(a.getAccoes()); + + //fill images + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + String imageFileFolder = theApplicationsServletContext.getRealPath(IMAGE_URL + "/" + getSessionBean1().getCurrentAnalise().getId()); + try + { + File f = new File(imageFileFolder); + + if(f.exists()) + { + File images[] = f.listFiles(); + + for(int i=0;i 0) + { + s = new StaticText(); + s.setId("s103"); + s.setEscape(false); + s.setText(a.getNr_relatorio_acidente_colaborador1()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_colaborador2() != null) + { + if(a.getNr_relatorio_acidente_colaborador2().intValue() > 0) + { + s = new StaticText(); + s.setId("s104"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador2()); + pg.getChildren().add(s); + } + + } + if(a.getNr_relatorio_acidente_colaborador3() != null) + { + if(a.getNr_relatorio_acidente_colaborador3().intValue() > 0) + { + s = new StaticText(); + s.setId("s105"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador3()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_colaborador4() != null) + { + if(a.getNr_relatorio_acidente_colaborador4().intValue() > 0) + { + s = new StaticText(); + s.setId("s106"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador4()); + pg.getChildren().add(s); + } + } + grd.getChildren().add(pg); + } + gridColaborador.getChildren().add(grd); + } + + } + else + { + st1.setText("Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado."); + gridColaborador.getChildren().add(st1); + } + + if(a.getAcidentes_outros_colaboradores().matches("y")) + { + st2.setText("Verificaram-se ocorrências/incidentes semelhantes com outros colaboradores."); + gridColaboradores.getChildren().add(st2); + boolean booShow = false; + boolean booShow1 = false; + boolean booShow2 = false; + if(a.getNr_acidentes_outros_colaboradores() != null) + { + booShow = true; + booShow1 = true; + } + if(a.getNr_relatorio_acidente_outros_colaboradores1() != null || a.getNr_relatorio_acidente_outros_colaboradores2() != null || a.getNr_relatorio_acidente_outros_colaboradores3() != null || a.getNr_relatorio_acidente_outros_colaboradores4() != null) + { + booShow = true; + booShow2 = true; + } + + if(booShow) + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdColaboradoresS"); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft15, gridColLeft85"); + if(booShow1) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId("s200"); + s.setEscape(false); + s.setText("Total:  "); + pg.getChildren().add(s); + s = new StaticText(); + s.setId("s201"); + s.setEscape(false); + s.setText(a.getNr_acidentes_outros_colaboradores()); + pg.getChildren().add(s); + grd.getChildren().add(pg); + } + if(booShow2) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId("s202"); + s.setEscape(false); + s.setText("Relatórios de acidente nº:  "); + pg.getChildren().add(s); + if(a.getNr_relatorio_acidente_outros_colaboradores1() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores1().intValue() > 0) + { + s = new StaticText(); + s.setId("s203"); + s.setEscape(false); + s.setText(a.getNr_relatorio_acidente_outros_colaboradores1()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores2() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores2().intValue() > 0) + { + s = new StaticText(); + s.setId("s204"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores2()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores3() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores3().intValue() > 0) + { + s = new StaticText(); + s.setId("s205"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores3()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores4() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores4().intValue() > 0) + { + s = new StaticText(); + s.setId("s206"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores4()); + pg.getChildren().add(s); + } + } + grd.getChildren().add(pg); + } + gridColaboradores.getChildren().add(grd); + } + } + else + { + st2.setText("Não se verificaram ocorrências/incidentes com outros colaboradores."); + gridColaboradores.getChildren().add(st1); + } + } + + private void fillRecomendacoesHs(AnaliseAcidente a) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList list = adp.getRecomendacoesByAnalise(a.getId()); + ListIterator iter = list.listIterator(); + int seq = 1; + while(iter.hasNext()) + { + Recomendacao r = (Recomendacao) iter.next(); + if(seq==1) + { + txtRecomendacao1.setText(r.getRecomendacao()); + } + else + { + + //int seq = gridRecomendacoes.getChildren().size(); + //seq++; + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grd" + seq); + grd.setColumns(3); + grd.setColumnClasses("gridColLeft5, gridColLeft90,gridColLeft5"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("st" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + TextArea ta = new TextArea(); + ta.setId("ta" + seq); + ta.setStyle("height: 24px; width: 98%"); + ta.setText(r.getRecomendacao()); + grd.getChildren().add(ta); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId("ln" + seq); + ln.setWidth(9); + ln.setHeight(9); + ln.setImageURL("/resources/plus_more.gif"); + MethodBinding mbAction = this.getApplication().createMethodBinding("#{AnaliseAcidenteTrabalho.lnkMoreRec1_action}", null); + ln.setAction(mbAction); + + grd.getChildren().add(ln); + + gridRecomendacoes.getChildren().add(grd); + + } + seq++; + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillRecomendacoesViewHs(AnaliseAcidente a) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList list = adp.getRecomendacoesByAnalise(a.getId()); + ListIterator iter = list.listIterator(); + int seq = 1; + while(iter.hasNext()) + { + Recomendacao r = (Recomendacao) iter.next(); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdRecomendacaoView" + seq); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft5, gridColLeft95"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("stNrRecomendacaoView" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + st = new StaticText(); + st.setId("stRecomendacaoView" + seq); + st.setText(r.getRecomendacao()); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + gridRecomendacoesView.getChildren().add(grd); + seq++; + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillMedidasRh(AnaliseAcidente a) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList list = adp.getMedidasByAnalise(a.getId()); + ListIterator iter = list.listIterator(); + int seq = 1; + while(iter.hasNext()) + { + Medida m = (Medida) iter.next(); + if(seq==1) + { + txtMedida1.setText(m.getMedida()); + } + else + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdMedida" + seq); + grd.setColumns(3); + grd.setColumnClasses("gridColLeft5, gridColLeft90,gridColLeft5"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("stNrMedida" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + TextArea ta = new TextArea(); + ta.setId("taMedida" + seq); + ta.setStyle("height: 24px; width: 98%"); + ta.setText(m.getMedida()); + grd.getChildren().add(ta); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId("lnMedidaMore" + seq); + ln.setWidth(9); + ln.setHeight(9); + ln.setImageURL("/resources/plus_more.gif"); + MethodBinding mbAction = this.getApplication().createMethodBinding("#{AnaliseAcidenteTrabalho.lnkMoreMed_action}", null); + ln.setAction(mbAction); + + grd.getChildren().add(ln); + + gridMedidas.getChildren().add(grd); + } + seq++; + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillMedidasViewRh(AnaliseAcidente a) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList list = adp.getMedidasByAnalise(a.getId()); + ListIterator iter = list.listIterator(); + int seq = 1; + while(iter.hasNext()) + { + Medida m = (Medida) iter.next(); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdMedidaView" + seq); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft5, gridColLeft95"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("stNrMedidaView" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + st = new StaticText(); + st.setId("stMedidaView" + seq); + st.setText(m.getMedida()); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + gridMedidasView.getChildren().add(grd); + seq++; + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillMedico(AnaliseAcidente a) + { + + if(a.getLesao_cabeca().matches("y")) + { + chkCabeca.setSelected( new Boolean(true) ); + } + + if(a.getLesao_pescoco().matches("y")) + { + chkPescoco.setSelected(new Boolean(true)); + } + + if(a.getLesao_tronco().matches("y")) + { + chkTronco.setSelected(new Boolean(true)); + } + + if(a.getLesao_membro_sup_dir().matches("y")) + { + chkMembroSupDir.setSelected(new Boolean(true)); + lblEspecif1.setRendered(true); + txtEspecif1.setRendered(true); + txtEspecif1.setText(a.getEspecif1()); + } + else + { + lblEspecif1.setRendered(false); + txtEspecif1.setRendered(false); + } + + if(a.getLesao_membro_sup_esq().matches("y")) + { + chkMembroSupEsq.setSelected(new Boolean(true)); + lblEspecif2.setRendered(true); + txtEspecif2.setRendered(true); + txtEspecif2.setText(a.getEspecif2()); + } + else + { + lblEspecif2.setRendered(false); + txtEspecif2.setRendered(false); + } + + if(a.getLesao_membro_inf_dir().matches("y")) + { + chkMembroInfDir.setSelected(new Boolean(true)); + lblEspecif3.setRendered(true); + txtEspecif3.setRendered(true); + txtEspecif3.setText(a.getEspecif3()); + } + else + { + lblEspecif3.setRendered(false); + txtEspecif3.setRendered(false); + } + + if(a.getLesao_membro_inf_esq().matches("y")) + { + chkMembroInfEsq.setSelected(new Boolean(true)); + lblEspecif4.setRendered(true); + txtEspecif4.setRendered(true); + txtEspecif4.setText(a.getEspecif4()); + } + else + { + lblEspecif4.setRendered(false); + txtEspecif4.setRendered(false); + } + + txtTipoLesao.setText(a.getTipo_lesao()); + if(a.getTipo_incapacidade().matches("n")) + { + rbIncapacidadeNone.setSelected(new Boolean(true)); + } + else if(a.getTipo_incapacidade().matches("t")) + { + rbIncapacidadeTemp.setSelected(new Boolean(true)); + } + else if(a.getTipo_incapacidade().matches("p")) + { + rbIncapacidadePerm.setSelected(new Boolean(true)); + } + + txtCoefIncapacidade.setText(a.getCoef_incapacidade()); + + if(a.getData_aval_incapacidade() != null) + { + java.util.Date ddate = new java.util.Date(a.getData_aval_incapacidade().getTime()); + calAvaliacaoIncap.setValue(ddate); + } + + if(a.getData_rev_incapacidade() != null) + { + java.util.Date ddate = new java.util.Date(a.getData_rev_incapacidade().getTime()); + calRevisaoIncap.setValue(ddate); + } + + if(a.getPeriodo_incapacidade_de() != null) + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_de().getTime()); + calPeridoIncapDe.setValue(ddate); + } + + if(a.getPeriodo_incapacidade_a() != null) + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_a().getTime()); + calPeriodoIncapA.setValue(ddate); + } + + if(a.getImg_flexao().matches("y")) + { + chkImgFlexao.setSelected(new Boolean(true)); + } + + if(a.getImg_rot1().matches("y")) + { + chkImgRot1.setSelected(new Boolean(true)); + } + + if(a.getImg_rot2().matches("y")) + { + chkImgRot2.setSelected(new Boolean(true)); + } + + if(a.getImg_ext1().matches("y")) + { + chkImgExt1.setSelected(new Boolean(true)); + } + + if(a.getImg_ext2().matches("y")) + { + chkImgExt2.setSelected(new Boolean(true)); + } + + if(a.getImg_cab1().matches("y")) + { + chkImgCab1.setSelected(new Boolean(true)); + } + + if(a.getImg_cab2().matches("y")) + { + chkImgCab2.setSelected(new Boolean(true)); + } + + if(a.getImg_cab3().matches("y")) + { + chkImgCab3.setSelected(new Boolean(true)); + } + + if(a.getImg_cab4().matches("y")) + { + chkImgCab4.setSelected(new Boolean(true)); + } + + if(a.getImg_ma1().matches("y")) + { + chkImgMa1.setSelected(new Boolean(true)); + } + + if(a.getImg_ma2().matches("y")) + { + chkImgMa2.setSelected(new Boolean(true)); + } + + if(a.getImg_ma3().matches("y")) + { + chkImgMa3.setSelected(new Boolean(true)); + } + + if(a.getImg_ma4().matches("y")) + { + chkImgMa4.setSelected(new Boolean(true)); + } + + if(a.getImg_ma5().matches("y")) + { + chkImgMa5.setSelected(new Boolean(true)); + } + + if(a.getImg_ma6().matches("y")) + { + chkImgMa6.setSelected(new Boolean(true)); + } + + if(a.getImg_ma7().matches("y")) + { + chkImgMa7.setSelected(new Boolean(true)); + } + + if(a.getImg_ma8().matches("y")) + { + chkImgMa8.setSelected(new Boolean(true)); + } + + if(a.getImg_ma9().matches("y")) + { + chkImgMa9.setSelected(new Boolean(true)); + } + + if(a.getImg_ma10().matches("y")) + { + chkImgMa10.setSelected(new Boolean(true)); + } + + if(a.getRestricao_carga() != null) + { + if(a.getRestricao_carga().intValue() > 0) + { + chkRestricaoCargas.setSelected(new Boolean(true)); + rbKgs2.setRendered(true); + rbKgs5.setRendered(true); + rbKgs10.setRendered(true); + rbKgs15.setRendered(true); + rbKgsOutro.setRendered(true); + txtKgs.setRendered(true); + stKgs2.setRendered(true); + stKgs5.setRendered(true); + stKgs10.setRendered(true); + stKgs15.setRendered(true); + stKgsOutro.setRendered(true); + stKg.setRendered(true); + int carga = a.getRestricao_carga().intValue(); + switch(carga) + { + case 2: + rbKgs2.setSelected(new Boolean(true)); + break; + case 5: + rbKgs5.setSelected(new Boolean(true)); + break; + case 10: + rbKgs10.setSelected(new Boolean(true)); + break; + case 15: + rbKgs15.setSelected(new Boolean(true)); + break; + default: + rbKgsOutro.setSelected(new Boolean(true)); + txtKgs.setText(a.getRestricao_carga().toString()); + break; + } + } + else + { + chkRestricaoCargas.setSelected(new Boolean(false)); + rbKgs2.setRendered(false); + rbKgs5.setRendered(false); + rbKgs10.setRendered(false); + rbKgs15.setRendered(false); + rbKgsOutro.setRendered(false); + txtKgs.setRendered(false); + stKgs2.setRendered(false); + stKgs5.setRendered(false); + stKgs10.setRendered(false); + stKgs15.setRendered(false); + stKgsOutro.setRendered(false); + stKg.setRendered(false); + } + } + else + { + chkRestricaoCargas.setSelected(new Boolean(false)); + rbKgs2.setRendered(false); + rbKgs5.setRendered(false); + rbKgs10.setRendered(false); + rbKgs15.setRendered(false); + rbKgsOutro.setRendered(false); + txtKgs.setRendered(false); + stKgs2.setRendered(false); + stKgs5.setRendered(false); + stKgs10.setRendered(false); + stKgs15.setRendered(false); + stKgsOutro.setRendered(false); + stKg.setRendered(false); + } + + if(a.getRestricao_motricidade().matches("y")) + { + chkRestricaoMotricidade.setSelected(new Boolean(true)); + } + + if(a.getRestricao_conducao().matches("y")) + { + chkRestricaoConducao.setSelected(new Boolean(true)); + } + + if(a.getRestricao_vibracoes().matches("y")) + { + chkRestricaoVibracoes.setSelected(new Boolean(true)); + } + + if(a.getRestricao_outras() != null) + { + if(a.getRestricao_outras().trim().length() > 0) + { + chkRestricaoOutras.setSelected(new Boolean(true)); + txtRestricaoOutras.setText(a.getRestricao_outras()); + } + } + + txtObservacoes.setText(a.getMed_observ()); + + } + + private void fillMedicoView(AnaliseAcidente a) + { + PanelGroup pg = null; + StaticText st = null; + HtmlPanelGrid grd = null; + ImageComponent img = null; + //LESAO : + + if(a.getLesao_cabeca().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoCabeca"); + st.setEscape(false); + st.setText("Cabeça"); + gridLesao.getChildren().add(st); + } + + if(a.getLesao_pescoco().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoPescoco"); + st.setEscape(false); + st.setText("Pescoço"); + gridLesao.getChildren().add(st); + } + + if(a.getLesao_tronco().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoTronco"); + st.setEscape(false); + st.setText("Tronco"); + gridLesao.getChildren().add(st); + } + + grd = new HtmlPanelGrid(); + grd.setId("gridLesaoMembros"); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft"); + if(a.getLesao_membro_sup_dir().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoMembroSupDir"); + st.setEscape(false); + st.setText("Membro Superior Direito"); + grd.getChildren().add(st); + st = new StaticText(); + st.setId("stEspecif1"); + st.setEscape(false); + st.setText(a.getEspecif1()); + grd.getChildren().add(st); + } + + if(a.getLesao_membro_sup_esq().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoMembroSupEsq"); + st.setEscape(false); + st.setText("Membro Superior Esquerdo"); + grd.getChildren().add(st); + st = new StaticText(); + st.setId("stEspecif2"); + st.setEscape(false); + st.setText(a.getEspecif2()); + grd.getChildren().add(st); + } + + if(a.getLesao_membro_inf_dir().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoMembroInfDir"); + st.setEscape(false); + st.setText("Membro Inferior Direito"); + grd.getChildren().add(st); + st = new StaticText(); + st.setId("stEspecif3"); + st.setEscape(false); + st.setText(a.getEspecif3()); + grd.getChildren().add(st); + } + + if(a.getLesao_membro_inf_esq().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoMembroInfEsq"); + st.setEscape(false); + st.setText("Membro Inferior Esquerdo"); + grd.getChildren().add(st); + st = new StaticText(); + st.setId("stEspecif4"); + st.setEscape(false); + st.setText(a.getEspecif4()); + grd.getChildren().add(st); + } + if(grd.getChildren().size() > 0) + { + gridLesao.getChildren().add(grd); + } + + if(a.getTipo_lesao().trim().length() > 0 ) + { + pg = new PanelGroup(); + pg.setId("pgTipoLesao"); + st = new StaticText(); + st.setId("stTipoLesaoLbl"); + st.setEscape(false); + st.setText("Tipo de lesão:   "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoLesao"); + st.setEscape(false); + st.setText(a.getTipo_lesao()); + pg.getChildren().add(st); + gridLesao.getChildren().add(pg); + } + + //INCAPACIDADE : + pg = new PanelGroup(); + pg.setId("pgTipoIncapacidade"); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl1"); + st.setEscape(false); + st.setText("Tipo de incapacidade:  "); + if(a.getTipo_incapacidade().matches("t")) + { + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidade"); + st.setEscape(false); + st.setText("Temporária  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl2"); + st.setEscape(false); + st.setText("Coeficiente de incapacidade:  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stCoefIncapacidade"); + st.setEscape(false); + st.setText(a.getCoef_incapacidade().toString() + "%"); + pg.getChildren().add(st); + } + else if(a.getTipo_incapacidade().matches("p")) + { + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidade"); + st.setEscape(false); + st.setText("Permanente  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl2"); + st.setEscape(false); + st.setText("Coeficiente de incapacidade:  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stCoefIncapacidade"); + st.setEscape(false); + st.setText(a.getCoef_incapacidade().toString() + "%"); + pg.getChildren().add(st); + } + + if(pg.getChildren().size() > 0) + { + gridIncapacidade2.getChildren().add(pg); + } + + pg = new PanelGroup(); + pg.setId("pgAvaliacaoIncapacidade"); + st = new StaticText(); + st.setId("stDataAvalIncapacidadeLbl1"); + st.setEscape(false); + st.setText("Avaliação de incapacidade realizada em  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stDataAvalIncapacidade"); + st.setEscape(false); + //st.setText(a.getData_aval_incapacidade()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_aval_incapacidade().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stDataRevIncapacidadeLbl1"); + st.setEscape(false); + st.setText("Revisão de incapacidade em  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stDataRevIncapacidade"); + st.setEscape(false); + //st.setText(a.getData_rev_incapacidade()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_rev_incapacidade().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + pg.getChildren().add(st); + gridIncapacidade2.getChildren().add(pg); + + pg = new PanelGroup(); + pg.setId("pgPeriodoIncapacidade"); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeLbl1"); + st.setEscape(false); + st.setText("Período de incapacidade temporária de  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeDe"); + st.setEscape(false); + //st.setText(a.getPeriodo_incapacidade_de()); + try + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_de().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeLbl2"); + st.setEscape(false); + st.setText("  a  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeA"); + st.setEscape(false); + //st.setText(a.getPeriodo_incapacidade_a()); + try + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_a().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + pg.getChildren().add(st); + gridIncapacidade2.getChildren().add(pg); + + //RESTRICOES + + if(a.getImg_flexao().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgFlexao"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + pg = new PanelGroup(); + pg.setId("pgImgFlexao"); + img = new ImageComponent(); + img.setId("imgRestricoes1000"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/fle1.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1001"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/fle2.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1002"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/fle3.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1003"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/fle4.gif"); + pg.getChildren().add(img); + grd.getChildren().add(pg); + st = new StaticText(); + st.setId("stImgRestricaoLbl1"); + st.setEscape(false); + st.setText("Flexão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_rot1().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgRot1"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes1005"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/rot1.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl2"); + st.setEscape(false); + st.setText("Flexão Lateral"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_rot2().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgRot2"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes1006"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/rot2.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl3"); + st.setEscape(false); + st.setText("Rotação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ext1().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgExt1"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes1007"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ext1.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl4"); + st.setEscape(false); + st.setText("Extensão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ext2().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgExt2"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + pg = new PanelGroup(); + pg.setId("pgImgExt2"); + img = new ImageComponent(); + img.setId("imgRestricoes1008"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ext2.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1009"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ext3.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1010"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ext4.gif"); + pg.getChildren().add(img); + grd.getChildren().add(pg); + st = new StaticText(); + st.setId("stImgRestricaoLbl5"); + st.setEscape(false); + st.setText("Flexão/Extensão Lateral + Rotação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_cab1().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgCab1"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10011"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ca1.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl6"); + st.setEscape(false); + st.setText("Flexão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_cab2().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgCab2"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10012"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ca2.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl7"); + st.setEscape(false); + st.setText("Extensão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_cab3().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgCab3"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10013"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ca3.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl8"); + st.setEscape(false); + st.setText("Flexão Lateral"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_cab4().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgCab4"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10014"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ca4.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl9"); + st.setEscape(false); + st.setText("Rotação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma1().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa1"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10015"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma1.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl10"); + st.setEscape(false); + st.setText("Poronação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma2().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa2"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10016"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma2.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl11"); + st.setEscape(false); + st.setText("Supinação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma3().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa3"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10017"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma3.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl12"); + st.setEscape(false); + st.setText("Flexão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma4().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa4"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10018"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma4.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl13"); + st.setEscape(false); + st.setText("Extensão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma5().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa5"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10019"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma5.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl14"); + st.setEscape(false); + st.setText("Desvio Ulnar"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma6().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa6"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10020"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma6.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl15"); + st.setEscape(false); + st.setText("Desvio Radial"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma7().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa7"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10021"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma7.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl16"); + st.setEscape(false); + st.setText("Pinça Digital"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma8().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa8"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10022"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma8.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl17"); + st.setEscape(false); + st.setText("Segurar objectos entre os dedos"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma9().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa9"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10023"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma9.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl18"); + st.setEscape(false); + st.setText("Dedos em extensão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma10().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa10"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10024"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma10.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl19"); + st.setEscape(false); + st.setText("Pega palmar"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getRestricao_carga() != null) + { + if(a.getRestricao_carga().intValue() > 0) + { + pg = new PanelGroup(); + st = new StaticText(); + st.setId("stRestricaoCargaLbl"); + st.setEscape(false); + st.setText("Movimentação e manipulação de cargas com mais de  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stRestricaoCargaKgs"); + st.setEscape(false); + st.setText(a.getRestricao_carga().toString()); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stRestricaoCargaLbl1"); + st.setEscape(false); + st.setText("Kg"); + pg.getChildren().add(st); + gridOutrasRestricoes.getChildren().add(pg); + } + + if(a.getRestricao_motricidade().matches("y")) + { + st = new StaticText(); + st.setId("stRestricaoMotricidadeLbl"); + st.setEscape(false); + st.setText("Operações que requeiram motricidade fina."); + gridOutrasRestricoes.getChildren().add(st); + } + + if(a.getRestricao_conducao().matches("y")) + { + st = new StaticText(); + st.setId("stRestricaoConducaoLbl"); + st.setEscape(false); + st.setText("Condução/interacção com veículos ou outros equipamentos."); + gridOutrasRestricoes.getChildren().add(st); + } + + if(a.getRestricao_vibracoes().matches("y")) + { + st = new StaticText(); + st.setId("stRestricaoVibracoesLbl"); + st.setEscape(false); + st.setText("Utilizaçõo de equipamentos/ferramentas que impliquem exposição a vibrações ou impactos."); + gridOutrasRestricoes.getChildren().add(st); + } + + if(a.getRestricao_outras().trim().length() > 0) + { + st = new StaticText(); + st.setId("stRestricaoOutras"); + st.setEscape(false); + st.setText(a.getRestricao_outras()); + gridOutrasRestricoes.getChildren().add(st); + } + + if(a.getMed_observ().trim().length() > 0) + { + stObservacoes.setText(a.getMed_observ()); + } + } + + } +// private String getPageFrom(String referer) +// { +// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); +// return pageFrom; +// } + + public String lnkNome_action() { + // TODO: Replace with your code + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + TrabalhadoresListDataProvider provider = (TrabalhadoresListDataProvider) tableRowGroup1.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + Trabalhador t = (Trabalhador)list.get(k); + txtTrabalhador.setText(t.getNome()); + txtNomeAcidentado.setText(t.getNome()); + txtDataNascimento.setText(t.getData_nascimento()); + Acidentado a = new Acidentado(); + a.setTrabalhador_id(t.getId()); + a.setData_nascimento(t.getData_nascimento()); + a.setNome(t.getNome()); + a.setFuncao(utils.Utils.unicodeToHTML(t.getFuncao())); + a.setData_admissao(t.getData_admissao()); + getSessionBean1().setAcidentado(a); + if(getSessionBean1().getCurrentAnalise() != null) // new analise) + { + gridTrabalhadores.setRendered(false); + } + + return null; + } + + public String lnkDataNascimento_action() { + // TODO: Replace with your code + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + TrabalhadoresListDataProvider provider = (TrabalhadoresListDataProvider) tableRowGroup1.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + Trabalhador t = (Trabalhador)list.get(k); + txtTrabalhador.setText(t.getNome()); + txtNomeAcidentado.setText(t.getNome()); + txtDataNascimento.setText(t.getData_nascimento()); + Acidentado a = new Acidentado(); + a.setTrabalhador_id(t.getId()); + a.setData_nascimento(t.getData_nascimento()); + a.setNome(t.getNome()); + a.setFuncao(t.getFuncao()); + a.setData_admissao(t.getData_admissao()); + getSessionBean1().setAcidentado(a); + if(getSessionBean1().getCurrentAnalise() != null) // new analise) + { + gridTrabalhadores.setRendered(false); + } + return null; + } + + public String butImagem_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + savePageState(); + return "load_image"; + } + + private void fillImages() + { +// String imageName = getSessionBean1().getImageName(); +// if(imageName != null) +// { +// ImageComponent newImg = new ImageComponent(); +// newImg.setUrl("/resources/imagens/" + imageName); +// System.out.println("IMAGE URL : " + "/resources/imagens/" + imageName); +// newImg.setRendered(true); +// gridImages.getChildren().add(newImg); +// System.out.println("HERE"); +// } + + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + String imageFileFolder = theApplicationsServletContext.getRealPath(IMAGE_URL + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + try + { + File f = new File(imageFileFolder); + + if(f.exists()) + { + File files[] = f.listFiles(); + + for(int i=0;i 0) + { + a.setBilhete_identidade(bi); + } + } + + a.setMorada(""); + if(txtMorada.getText() != null) + { + String morada = (String) txtMorada.getText(); + if(morada.trim().length() > 0) + { + a.setMorada( morada ); + } + } + + a.setCod_postal(""); + String cod_postal = ""; + if(txtCodPostal1.getText() != null ) + { + String cod_postal1 = (String) txtCodPostal1.getText(); + String cod_postal2 = ""; + if(txtCodPostal2.getText() != null) + { + cod_postal2 = (String) txtCodPostal2.getText(); + } + if(cod_postal1.trim().length() > 0) + { + cod_postal =(String) txtCodPostal1.getText() + "-" + (String) txtCodPostal2.getText(); + a.setCod_postal( cod_postal); + } + + } + + a.setLocalidade(""); + if(txtLocalidade.getText() != null) + { + String localidade = (String) txtLocalidade.getText(); + if(localidade.trim().length() > 0) + { + a.setLocalidade( localidade); + } + } + + a.setContacto_telefonico(""); + if(txtContactoTelefonico.getText() != null) + { + String contacto_telefonico = (String) txtContactoTelefonico.getText(); + if(contacto_telefonico.trim().length() > 0) + { + a.setContacto_telefonico( contacto_telefonico ); + } + } + + + a.setTurno("m"); + if(rbTurnoManha.getSelected() != null ) + { + Boolean selected = (Boolean) rbTurnoManha.getSelected(); + if(selected.equals(new Boolean(true))) + { + a.setTurno("m"); + } + } + else if(rbTurnoTarde.getSelected() != null) + { + Boolean selected = (Boolean) rbTurnoTarde.getSelected(); + if(selected.equals(new Boolean(true))) + { + a.setTurno("t"); + } + } + else if(rbTurnoNoite.getSelected() != null) + { + Boolean selected = (Boolean) rbTurnoNoite.getSelected(); + if(selected.equals(new Boolean(true))) + { + a.setTurno("n"); + } + } + + return a; + } + + private AnaliseAcidente fillAnaliseFields() + { + int estado = 0; + AnaliseAcidente a = null; + //fill analise fields + if(getSessionBean1().getCurrentAnalise() == null) //null + { + a = new AnaliseAcidente(); + a.setEspecif1(""); + a.setEspecif2(""); + a.setEspecif3(""); + a.setEspecif4(""); + a.setRestricao_outras(""); + a.setTipo_lesao(""); + a.setMed_observ(""); + estado = ESTADO_SEG; + a.setEstado(new Integer(estado)); + } + else + { + a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + } + + switch(estado) + { + case ESTADO_SEG: + a = fillAnaliseFieldsSeg(a); + break; + case ESTADO_RH1: + a = fillAnaliseFieldsSeg(a); + a = fillAnaliseFieldsRH1(a); + break; + case ESTADO_HS: + //a = fillAnaliseFieldsHS(a); + break; + case ESTADO_RH2: + //a = fillAnaliseFieldsRH2(a); + break; + case ESTADO_MEDICO: + a = fillAnaliseFieldsMedico(a); + break; + case ESTADO_ASSINATURAS: + a = fillAnaliseAssinaturas(a); + break; + } + + return a; + } + + private AnaliseAcidente fillAnaliseFieldsSeg(AnaliseAcidente a) + { + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date(today.getTime()); + a.setData_acidente(sqlToday); + + String hh = drpHours.getSelected().toString(); + String mm = drpMinutes.getSelected().toString(); + SimpleDateFormat formatter = new SimpleDateFormat ( "hh:mm" ); + try + { + Time horaAcidente = new Time(formatter.parse( hh + ":" + mm ).getTime()); + a.setHora_acidente(horaAcidente); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + + + if(getSessionBean1().getCurrentAnalise() == null) // new + { + a.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + a.setEstabelecimento_id(getSessionBean1().getCurrentUser().getEstabelecimento_id()); + } + + Integer medico_id = (Integer) drpMedicos.getSelected(); + Integer tecnico_id = (Integer) drpTecnicos.getSelected(); + if(medico_id.intValue() > 0) + { + a.setMedico_id(medico_id); + } + + if(tecnico_id.intValue() > 0) + { + a.setTecnico_saude_id(tecnico_id); + } + + //if(getSessionBean1().getCurrentAnalise() == null) // new + //{ + // a.setTrabalhador_id(getSessionBean1().getAcidentado().getId()); + //} + +// if(getSessionBean1().getCurrentAnalise() == null) // new +// { +// Integer horas_turno = null; +// try +// { +// String horas_turno_str = (String) txtHorasTurno.getText(); +// horas_turno = new Integer( Integer.parseInt(horas_turno_str) ); +// } +// catch(Exception ex) +// { +// ex.printStackTrace(); +// } +// a.setHoras_turno(horas_turno); +// } +// else // edit +// { +// a.setHoras_turno((Integer )txtHorasTurno.getText()); +// } + + Integer horas_turno = null; + try + { + String horas_turno_str = (String) txtHorasTurno.getText(); + horas_turno = new Integer( Integer.parseInt(horas_turno_str) ); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + a.setHoras_turno(horas_turno); + + try + { + if(txtSeccao.getText() != null) + { + a.setSeccao( (String) txtSeccao.getText() ); + } + else + { + a.setSeccao(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtLocal.getText() != null) + { + a.setLocal_trabalho( (String) txtLocal.getText() ); + } + else + { + a.setLocal_trabalho(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtTarefa.getText() != null) + { + a.setTarefa( (String) txtTarefa.getText() ); + } + else + { + a.setTarefa(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtSubstancias.getText() != null) + { + a.setSubstancias( (String) txtSubstancias.getText() ); + } + else + { + a.setSubstancias(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtSuperior.getText() != null) + { + a.setSuperior_hierarquico( (String) txtSuperior.getText() ); + } + else + { + a.setSuperior_hierarquico(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtCondicoes.getText() != null) + { + a.setCondicoes( (String) txtCondicoes.getText() ); + } + else + { + a.setCondicoes(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try { - txtEstabelecimento.setText(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); + if(txtTestemunhas.getText() != null) + { + a.setTestemunhas( (String) txtTestemunhas.getText() ); + } + else + { + a.setTestemunhas(""); + } } catch(Exception ex) { - ex.printStackTrace(); - } - + ex.printStackTrace(); + } + try { - Trabalhador t = adp.getTrabalhador(a.getTrabalhador_id()); - txtDataNascimento.setText(t.getData_nascimento()); - getSessionBean1().setAcidentado(t); + if(txtCausas.getText() != null) + { + a.setCausas( (String) txtCausas.getText() ); + } + else + { + a.setCausas(""); + } } catch(Exception ex) { - ex.printStackTrace(); - } - - txtTrabalhador.setText(a.getNome_acidentado()); - txtNomeAcidentado.setText(a.getNome_acidentado()); - txtHorasTurno.setText(a.getHoras_turno().toString()); - txtSeccao.setText(a.getSeccao()); - txtLocal.setText(a.getLocal_trabalho()); - txtTarefa.setText(a.getTarefa()); - txtSubstancias.setText(a.getSubstancias()); - txtSuperior.setText(a.getSuperior_hierarquico()); - txtCondicoes.setText(a.getCondicoes()); - txtTestemunhas.setText(a.getTestemunhas()); - txtCausas.setText(a.getCausas()); - txtDescricao.setText(a.getDescricao()); - txtConclusoes.setText(a.getConclusoes()); - txtAccoes.setText(a.getAccoes()); + ex.printStackTrace(); + } - //fill images - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); - String imageFileFolder = theApplicationsServletContext.getRealPath(IMAGE_URL + "/" + getSessionBean1().getCurrentAnalise().getId()); - try - { - File f = new File(imageFileFolder); - - if(f.exists()) + try + { + if(txtDescricao.getText() != null) { - File images[] = f.listFiles(); - - for(int i=0;i 0 ) + { + a.setFormacao_shst_nao_porque( s ); + } + } + } } - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - } - - public String butCancelar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - String navFrom = getSessionBean1().getNavFrom(); - if(navFrom.matches("FormSeguranca")) - { - return "form_seguranca"; } - return null; - } - - - public String butGravar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - if(getSessionBean1().getCurrentAnalise() == null) //new analise + + boolean booAcidentesColaborador = false; + a.setOutros_acidentes_com_colaborador("n"); + if(rbAcidentesColaboradorY.getSelected() != null) { - if(validationOk()) + Boolean f = (Boolean) rbAcidentesColaboradorY.getSelected(); + if(f.equals(new Boolean(true))) { - AnaliseAcidente a = fillAnaliseFields(1); - - try + a.setOutros_acidentes_com_colaborador("y"); + booAcidentesColaborador = true; + if(txtNrAcidentesColaborador.getText() != null) { - Integer analiseId = create(a); - createImagesFolder(analiseId.toString()); - String navFrom = getSessionBean1().getNavFrom(); - if(navFrom.matches("FormSeguranca")) + String nr_str = (String) txtNrAcidentesColaborador.getText(); + if(nr_str.trim().length() > 0) { - return "form_seguranca"; - } + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_acidentes_com_colaborador(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } } - catch(Exception ex) + + if(txtNrRelatorioAcidentesColaborador1.getText() != null) { - getSessionBean1().setMsg("Erro na inserção da análise !"); - ex.printStackTrace(); + String nr_str = (String) txtNrRelatorioAcidentesColaborador1.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_colaborador1(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } } - } + if(txtNrRelatorioAcidentesColaborador2.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaborador2.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_colaborador2(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaborador3.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaborador3.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_colaborador3(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaborador4.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaborador4.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_colaborador4(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + } } - else // edit analise + + if(!booAcidentesColaborador) { - if(validationOk()) + if(rbAcidentesColaboradorN.getSelected() != null) { - - AnaliseAcidente a = fillAnaliseFields(1); - - try - { - update(a); - //createImagesFolder(analiseId.toString()); - updateImagesFolder(a.getId().toString()); - String navFrom = getSessionBean1().getNavFrom(); - if(navFrom.matches("FormSeguranca")) - { - return "form_seguranca"; - } - } - catch(Exception ex) + Boolean f = (Boolean) rbAcidentesColaboradorN.getSelected(); + if(f.equals(new Boolean(true))) { - getSessionBean1().setMsg("Erro na actualização da análise !"); - ex.printStackTrace(); + a.setOutros_acidentes_com_colaborador("n"); } - } + } } - - return null; - } - - public String butEnviar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - if(getSessionBean1().getCurrentAnalise() == null) //new analise + boolean booAcidentesColaboradores = false; + if(rbAcidentesColaboradoresY.getSelected() != null) { - if(validationOk()) + Boolean f = (Boolean) rbAcidentesColaboradoresY.getSelected(); + if(f.equals(new Boolean(true))) { - AnaliseAcidente a = fillAnaliseFields(2); - - try + a.setAcidentes_outros_colaboradores("y"); + booAcidentesColaboradores = true; + if(txtNrAcidentesColaboradores.getText() != null) { - Integer analiseId = create(a); - createImagesFolder(analiseId.toString()); - String navFrom = getSessionBean1().getNavFrom(); - if(navFrom.matches("FormSeguranca")) + String nr_str = (String) txtNrAcidentesColaboradores.getText(); + if(nr_str.trim().length() > 0) { - return "form_seguranca"; - } + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_acidentes_outros_colaboradores(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } } - catch(Exception ex) + + if(txtNrRelatorioAcidentesColaboradores1.getText() != null) { - getSessionBean1().setMsg("Erro no envio da análise !"); - ex.printStackTrace(); + String nr_str = (String) txtNrRelatorioAcidentesColaboradores1.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_outros_colaboradores1(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } } - } + if(txtNrRelatorioAcidentesColaboradores2.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaboradores2.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_outros_colaboradores2(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaboradores3.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaboradores3.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_outros_colaboradores3(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaboradores4.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaboradores4.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_outros_colaboradores4(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + + } } - else // edit analise + + if(!booAcidentesColaboradores) { - if(validationOk()) + if(rbAcidentesColaboradoresN.getSelected() != null) { - AnaliseAcidente a = fillAnaliseFields(2); - - try + Boolean f = (Boolean) rbAcidentesColaboradoresN.getSelected(); + if(f.equals(new Boolean(true))) { - update(a); - //createImagesFolder(analiseId.toString()); - updateImagesFolder(a.getId().toString()); - String navFrom = getSessionBean1().getNavFrom(); - if(navFrom.matches("FormSeguranca")) - { - return "form_seguranca"; - } + a.setAcidentes_outros_colaboradores("y"); } - catch(Exception ex) + } + } + + return a; + } + + private ArrayList fillAnaliseRecomendacoesHs(AnaliseAcidente a) + { + ArrayList list = new ArrayList(); + ListIterator iter = gridRecomendacoes.getChildren().listIterator(); + while(iter.hasNext()) + { + HtmlPanelGrid grd = (HtmlPanelGrid)iter.next(); + TextArea ta = (TextArea) grd.getChildren().get(1); + if(ta.getText() != null ) + { + String txt = (String) ta.getText(); + if(txt.trim().length() > 0) { - getSessionBean1().setMsg("Erro na actualização da análise !"); - ex.printStackTrace(); + Recomendacao r = new Recomendacao(); + r.setAnalise_id(a.getId()); + r.setRecomendacao(txt); + list.add(r); } - } - } - - return null; - } + } + } + return list; + } - private Integer create(AnaliseAcidente a) throws Exception + private ArrayList fillAnaliseMedidasRh(AnaliseAcidente a) { - AnalisesDataProvider adp = new AnalisesDataProvider(); - Integer id = adp.createAnalise(a); - return id; + ArrayList list = new ArrayList(); + ListIterator iter = gridMedidas.getChildren().listIterator(); + while(iter.hasNext()) + { + HtmlPanelGrid grd = (HtmlPanelGrid)iter.next(); + TextArea ta = (TextArea) grd.getChildren().get(1); + if(ta.getText() != null ) + { + String txt = (String) ta.getText(); + if(txt.trim().length() > 0) + { + Medida m = new Medida(); + m.setAnalise_id(a.getId()); + m.setMedida(txt); + list.add(m); + } + } + } + return list; } - private void update(AnaliseAcidente a) throws Exception + private AnaliseAcidente fillAnaliseFieldsRH2(AnaliseAcidente a) { - AnalisesDataProvider adp = new AnalisesDataProvider(); - adp.updateAnalise(a); - } + return a; + } - private AnaliseAcidente fillAnaliseFields(int estado) + private AnaliseAcidente fillAnaliseFieldsMedico(AnaliseAcidente a) { - AnaliseAcidente a = null; - //fill analise fields - if(getSessionBean1().getCurrentAnalise() == null) //null + a.setLesao_cabeca("n"); + if(chkCabeca.getSelected() != null) { - a = new AnaliseAcidente(); + if(chkCabeca.getSelected().equals(new Boolean(true))) + { + a.setLesao_cabeca("y"); + } } - else + + a.setLesao_pescoco("n"); + if(chkPescoco.getSelected() != null) { - a = getSessionBean1().getCurrentAnalise(); + if(chkPescoco.getSelected().equals(new Boolean(true))) + { + a.setLesao_pescoco("y"); + } + } + + a.setLesao_tronco("n"); + if(chkTronco.getSelected() != null) + { + if(chkTronco.getSelected().equals(new Boolean(true))) + { + a.setLesao_tronco("y"); + } + } + + a.setEspecif1(""); + a.setEspecif2(""); + a.setEspecif3(""); + a.setEspecif4(""); + + a.setLesao_membro_sup_dir("n"); + if(chkMembroSupDir.getSelected() != null) + { + if(chkMembroSupDir.getSelected().equals(new Boolean(true))) + { + a.setLesao_membro_sup_dir("y"); + if(txtEspecif1.getText() != null) + { + a.setEspecif1((String) txtEspecif1.getText()); + } + } } - - java.util.Date today = - new java.util.Date(); - java.sql.Date sqlToday = - new java.sql.Date(today.getTime()); - a.setData_acidente(sqlToday); - if(getSessionBean1().getCurrentAnalise() == null) // new + + a.setLesao_membro_sup_esq("n"); + if(chkMembroSupEsq.getSelected() != null) { - a.setEstabelecimento_id(getSessionBean1().getCurrentUser().getEstabelecimento_id()); + if(chkMembroSupEsq.getSelected().equals(new Boolean(true))) + { + a.setLesao_membro_sup_esq("y"); + if(txtEspecif2.getText() != null) + { + a.setEspecif2((String) txtEspecif2.getText()); + } + } + } + + a.setLesao_membro_inf_dir("n"); + if(chkMembroInfDir.getSelected() != null) + { + if(chkMembroInfDir.getSelected().equals(new Boolean(true))) + { + a.setLesao_membro_inf_dir("y"); + if(txtEspecif3.getText() != null) + { + a.setEspecif3((String) txtEspecif3.getText()); + } + } + } + + a.setLesao_membro_inf_esq("n"); + if(chkMembroInfEsq.getSelected() != null) + { + if(chkMembroInfEsq.getSelected().equals(new Boolean(true))) + { + a.setLesao_membro_inf_esq("y"); + if(txtEspecif4.getText() != null) + { + a.setEspecif4((String) txtEspecif4.getText()); + } + } + } + + a.setTipo_lesao(""); + if(txtTipoLesao.getText() != null) + { + a.setTipo_lesao((String) txtTipoLesao.getText()); } - - a.setEstado(new Integer(estado)); - if(getSessionBean1().getCurrentAnalise() == null) // new + + a.setTipo_incapacidade("n"); + if(rbIncapacidadeNone.getSelected() != null) { - a.setTrabalhador_id(getSessionBean1().getAcidentado().getId()); + if(rbIncapacidadeNone.getSelected().equals(new Boolean(true))) + { + a.setTipo_incapacidade("n"); + } } - -// if(getSessionBean1().getCurrentAnalise() == null) // new -// { -// Integer horas_turno = null; -// try -// { -// String horas_turno_str = (String) txtHorasTurno.getText(); -// horas_turno = new Integer( Integer.parseInt(horas_turno_str) ); -// } -// catch(Exception ex) -// { -// ex.printStackTrace(); -// } -// a.setHoras_turno(horas_turno); -// } -// else // edit -// { -// a.setHoras_turno((Integer )txtHorasTurno.getText()); -// } + if(rbIncapacidadeTemp.getSelected() != null) + { + if(rbIncapacidadeTemp.getSelected().equals(new Boolean(true))) + { + a.setTipo_incapacidade("t"); + } + } + if(rbIncapacidadePerm.getSelected() != null) + { + if(rbIncapacidadePerm.getSelected().equals(new Boolean(true))) + { + a.setTipo_incapacidade("p"); + } + } - Integer horas_turno = null; + if(txtCoefIncapacidade.getText() != null) + { + String coef_str = txtCoefIncapacidade.getText().toString(); + int coef = Integer.parseInt(coef_str); + a.setCoef_incapacidade(new Integer(coef)); + } + + DateFormat formatador = new SimpleDateFormat("yyyy-MM-dd"); + + java.util.Date ddate = (java.util.Date) calAvaliacaoIncap.getValue(); try { - String horas_turno_str = (String) txtHorasTurno.getText(); - horas_turno = new Integer( Integer.parseInt(horas_turno_str) ); + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setData_aval_incapacidade(ddate_sql); } catch(Exception ex) { - ex.printStackTrace(); - } - a.setHoras_turno(horas_turno); + a.setData_aval_incapacidade(null); + } + + ddate = (java.util.Date) calRevisaoIncap.getValue(); try { - if(txtSeccao.getText() != null) - { - a.setSeccao( (String) txtSeccao.getText() ); - } - else - { - a.setSeccao(""); - } + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setData_rev_incapacidade(ddate_sql); } catch(Exception ex) { - ex.printStackTrace(); + a.setData_rev_incapacidade(null); + } + + ddate = (java.util.Date) calPeridoIncapDe.getValue(); + try + { + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setPeriodo_incapacidade_de(ddate_sql); } - + catch(Exception ex) + { + a.setPeriodo_incapacidade_de(null); + } + + ddate = (java.util.Date) calPeriodoIncapA.getValue(); try { - if(txtLocal.getText() != null) - { - a.setLocal_trabalho( (String) txtLocal.getText() ); - } - else + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setPeriodo_incapacidade_a(ddate_sql); + } + catch(Exception ex) + { + a.setPeriodo_incapacidade_a(null); + } + + a.setImg_flexao("n"); + if(chkImgFlexao.getSelected() != null) + { + if(chkImgFlexao.getSelected().equals(new Boolean(true))) { - a.setLocal_trabalho(""); + a.setImg_flexao("y"); } } - catch(Exception ex) + + a.setImg_rot1("n"); + if(chkImgRot1.getSelected() != null) { - ex.printStackTrace(); - } - - try + if(chkImgRot1.getSelected().equals(new Boolean(true))) + { + a.setImg_rot1("y"); + } + } + + a.setImg_rot2("n"); + if(chkImgRot2.getSelected() != null) { - if(txtTarefa.getText() != null) + if(chkImgRot2.getSelected().equals(new Boolean(true))) { - a.setTarefa( (String) txtTarefa.getText() ); + a.setImg_rot2("y"); } - else + } + + a.setImg_ext1("n"); + if(chkImgExt1.getSelected() != null) + { + if(chkImgExt1.getSelected().equals(new Boolean(true))) { - a.setTarefa(""); + a.setImg_ext1("y"); } } - catch(Exception ex) - { - ex.printStackTrace(); - } - try + a.setImg_ext2("n"); + if(chkImgExt2.getSelected() != null) { - if(txtSubstancias.getText() != null) + if(chkImgExt2.getSelected().equals(new Boolean(true))) { - a.setSubstancias( (String) txtSubstancias.getText() ); + a.setImg_ext2("y"); } - else + } + + a.setImg_cab1("n"); + if(chkImgCab1.getSelected() != null) + { + if(chkImgCab1.getSelected().equals(new Boolean(true))) { - a.setSubstancias(""); + a.setImg_cab1("y"); } - } - catch(Exception ex) + } + + a.setImg_cab2("n"); + if(chkImgCab2.getSelected() != null) { - ex.printStackTrace(); - } - - try + if(chkImgCab2.getSelected().equals(new Boolean(true))) + { + a.setImg_cab2("y"); + } + } + + a.setImg_cab3("n"); + if(chkImgCab3.getSelected() != null) { - if(txtSuperior.getText() != null) + if(chkImgCab3.getSelected().equals(new Boolean(true))) { - a.setSuperior_hierarquico( (String) txtSuperior.getText() ); + a.setImg_cab3("y"); } - else + } + + a.setImg_cab4("n"); + if(chkImgCab4.getSelected() != null) + { + if(chkImgCab4.getSelected().equals(new Boolean(true))) { - a.setSuperior_hierarquico(""); + a.setImg_cab4("y"); } - } - catch(Exception ex) + } + + a.setImg_ma1("n"); + if(chkImgMa1.getSelected() != null) { - ex.printStackTrace(); - } - - try + if(chkImgMa1.getSelected().equals(new Boolean(true))) + { + a.setImg_ma1("y"); + } + } + + a.setImg_ma2("n"); + if(chkImgMa2.getSelected() != null) { - if(txtCondicoes.getText() != null) + if(chkImgMa2.getSelected().equals(new Boolean(true))) { - a.setCondicoes( (String) txtCondicoes.getText() ); + a.setImg_ma2("y"); } - else + } + + a.setImg_ma3("n"); + if(chkImgMa3.getSelected() != null) + { + if(chkImgMa3.getSelected().equals(new Boolean(true))) { - a.setCondicoes(""); + a.setImg_ma3("y"); } - } - catch(Exception ex) + } + + a.setImg_ma4("n"); + if(chkImgMa4.getSelected() != null) { - ex.printStackTrace(); - } - - try + if(chkImgMa4.getSelected().equals(new Boolean(true))) + { + a.setImg_ma4("y"); + } + } + + a.setImg_ma5("n"); + if(chkImgMa5.getSelected() != null) { - if(txtTestemunhas.getText() != null) + if(chkImgMa5.getSelected().equals(new Boolean(true))) { - a.setTestemunhas( (String) txtTestemunhas.getText() ); + a.setImg_ma5("y"); } - else + } + + a.setImg_ma6("n"); + if(chkImgMa6.getSelected() != null) + { + if(chkImgMa6.getSelected().equals(new Boolean(true))) { - a.setTestemunhas(""); + a.setImg_ma6("y"); } - } - catch(Exception ex) + } + + a.setImg_ma7("n"); + if(chkImgMa7.getSelected() != null) { - ex.printStackTrace(); - } - - try + if(chkImgMa7.getSelected().equals(new Boolean(true))) + { + a.setImg_ma7("y"); + } + } + + a.setImg_ma8("n"); + if(chkImgMa8.getSelected() != null) { - if(txtCausas.getText() != null) + if(chkImgMa8.getSelected().equals(new Boolean(true))) { - a.setCausas( (String) txtCausas.getText() ); + a.setImg_ma8("y"); } - else + } + + a.setImg_ma9("n"); + if(chkImgMa9.getSelected() != null) + { + if(chkImgMa9.getSelected().equals(new Boolean(true))) { - a.setCausas(""); + a.setImg_ma9("y"); } - } - catch(Exception ex) + } + + a.setImg_ma10("n"); + if(chkImgMa10.getSelected() != null) { - ex.printStackTrace(); - } + if(chkImgMa10.getSelected().equals(new Boolean(true))) + { + a.setImg_ma10("y"); + } + } - try + a.setRestricao_carga(new Integer(0)); + if(chkRestricaoCargas.getSelected()!= null) { - if(txtDescricao.getText() != null) + if(chkRestricaoCargas.getSelected().equals(new Boolean(true))) { - a.setDescricao( (String) txtDescricao.getText() ); + if(rbKgs2.getSelected() != null) + { + if(rbKgs2.getSelected().equals(new Boolean(true))) + { + a.setRestricao_carga(new Integer(2)); + } + } + if(rbKgs5.getSelected() != null) + { + if(rbKgs5.getSelected().equals(new Boolean(true))) + { + a.setRestricao_carga(new Integer(5)); + } + } + if(rbKgs10.getSelected() != null) + { + if(rbKgs10.getSelected().equals(new Boolean(true))) + { + a.setRestricao_carga(new Integer(10)); + } + } + if(rbKgs15.getSelected() != null) + { + if(rbKgs15.getSelected().equals(new Boolean(true))) + { + a.setRestricao_carga(new Integer(15)); + } + } + + if(rbKgsOutro.getSelected() != null) + { + if(rbKgsOutro.getSelected().equals(new Boolean(true))) + { + if(txtKgs.getText() != null) + { + String kgs_str = txtKgs.getText().toString(); + int kgs = Integer.parseInt(kgs_str); + a.setRestricao_carga(new Integer(kgs)); + } + } + } } - else + } + + a.setRestricao_motricidade("n"); + if(chkRestricaoMotricidade.getSelected() != null) + { + if(chkRestricaoMotricidade.getSelected().equals(new Boolean(true))) { - a.setDescricao(""); + a.setRestricao_motricidade("y"); } } - catch(Exception ex) + + a.setRestricao_conducao("n"); + if(chkRestricaoConducao.getSelected() != null) { - ex.printStackTrace(); - } - - try + if(chkRestricaoConducao.getSelected().equals(new Boolean(true))) + { + a.setRestricao_conducao("y"); + } + } + + a.setRestricao_vibracoes("n"); + if(chkRestricaoVibracoes.getSelected() != null) { - if(txtConclusoes.getText() != null) + if(chkRestricaoVibracoes.getSelected().equals(new Boolean(true))) { - a.setConclusoes( (String) txtConclusoes.getText() ); + a.setRestricao_vibracoes("y"); } - else + } + + a.setRestricao_outras(""); + if(chkRestricaoOutras.getSelected() != null) + { + if(chkRestricaoOutras.getSelected().equals(new Boolean(true))) { - a.setConclusoes(""); + if(txtRestricaoOutras.getText() != null) + { + a.setRestricao_outras((String)txtRestricaoOutras.getText()); + } } } - catch(Exception ex) + + a.setMed_observ(""); + if(txtObservacoes.getText() != null) { - ex.printStackTrace(); - } - - try + a.setMed_observ( (String) txtObservacoes.getText() ); + } + + return a; + } + + private AnaliseAcidente fillAnaliseAssinaturas(AnaliseAcidente a) + { + int tipo_utilizador = getSessionBean1().getCurrentUser().getTipo().intValue(); + a.setEstado(new Integer(ESTADO_ASSINATURAS)); +// if(a.getEstado_assinatura().intValue() == 0) +// { +// a.setEstado_assinatura(new Integer( ESTADO_ASSINATURA_1 )); +// } + if(a.getEstado_assinatura().intValue() == ESTADO_ASSINATURA_1) { - if(txtAccoes.getText() != null) + a.setEstado_assinatura( new Integer(ESTADO_ASSINATURA_2) ); + notifyNextSignature(new Integer(ESTADO_ASSINATURA_2)); +// switch(tipo_utilizador) +// { +// case 1: //seguranca +// a.setAss_seg("y"); +// break; +// case 3: //hs +// a.setAss_hs("y"); +// break; +// case 5: //medico +// a.setAss_med("y"); +// break; +// } + } + else if(a.getEstado_assinatura().intValue() == ESTADO_ASSINATURA_2) + { + switch(tipo_utilizador) { - a.setAccoes( (String) txtAccoes.getText() ); + case 1: //seguranca + a.setAss_seg("y"); + break; + case 3: //hs + a.setAss_hs("y"); + break; + case 5: //medico + a.setAss_med("y"); + break; } - else + if(a.getAss_seg().matches("y") && a.getAss_hs().matches("y") && a.getAss_med().matches("y")) { - a.setAccoes(""); - } + a.setEstado_assinatura(new Integer( ESTADO_ASSINATURA_3 )); + notifyNextSignature(new Integer(ESTADO_ASSINATURA_3)); + //a.setAss_resp_rh("y"); + //butEnviar.setDisabled(false); + } } - catch(Exception ex) - { - ex.printStackTrace(); - } - return a; } @@ -1874,35 +9723,274 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { getSessionBean1().setMsg("Não seleccionou trabalhador acidentado !"); return false; } - else if(txtHorasTurno.getText() != null) + + int estado = 0; + int estado_assinatura = 0; + if(getSessionBean1().getCurrentAnalise() == null) //null { - String horas_turno = (String) txtHorasTurno.getText(); -// if(getSessionBean1().getCurrentAnalise() == null) // null -// { -// horas_turno = (String) txtHorasTurno.getText(); -// } -// else -// { -// System.out.println("HORAS TURNO A "); -// horas_turno = ( (String) txtHorasTurno.getText() ); -// System.out.println("HORAS TURNO : " + horas_turno); -// } + estado = ESTADO_SEG; + } + else + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + estado_assinatura = a.getEstado_assinatura().intValue(); + } + + + if(estado == ESTADO_SEG || estado == ESTADO_RH1) + { + String cod_postal1 = ""; + String cod_postal2 = ""; + if(txtCodPostal1.getText() != null) + { + cod_postal1 = (String) txtCodPostal1.getText(); + if(cod_postal1.trim().length() > 0) + { + try + { + int nr = Integer.parseInt(cod_postal1); + if(nr < 1000 || nr > 9999) + { + getSessionBean1().setMsg("O formato do código postal é : '9999-999'"); + return false; + } + } + catch(Exception ex) + { + getSessionBean1().setMsg("O código postal tem de ser um valor numérico !"); + return false; + } + } + } + + if(txtCodPostal2.getText() != null) + { + cod_postal2 = (String) txtCodPostal2.getText(); + if(cod_postal2.trim().length() > 0) + { + if(cod_postal1.trim().length() == 0) + { + getSessionBean1().setMsg("O formato do código postal é : '9999-999'"); + return false; + } + try + { + int nr = Integer.parseInt(cod_postal2); + if(cod_postal2.length() > 3 ) + { + getSessionBean1().setMsg("O formato do código postal é : '9999-999'"); + return false; + } + } + catch(Exception ex) + { + getSessionBean1().setMsg("O código postal de ser um valor numérico !"); + return false; + } + } + } + + if(txtHorasTurno.getText() != null) + { + String horas_turno = txtHorasTurno.getText().toString(); + // if(getSessionBean1().getCurrentAnalise() == null) // null + // { + // horas_turno = (String) txtHorasTurno.getText(); + // } + // else + // { + // System.out.println("HORAS TURNO A "); + // horas_turno = ( (String) txtHorasTurno.getText() ); + // System.out.println("HORAS TURNO : " + horas_turno); + // } - try + try + { + int nr = Integer.parseInt(horas_turno); + if(nr > 9) + { + getSessionBean1().setMsg("As horas turno devem ser entre 0 e 9 !"); + return false; + } + } + catch(Exception ex) + { + getSessionBean1().setMsg("As horas turno devem ser um valor numérico !"); + return false; + } + } + + + if(estado == ESTADO_RH1) + { + if(txtNrAcidentesColaborador.getText() != null) + { + String nr_str = txtNrAcidentesColaborador.getText().toString(); + try + { + int nr = Integer.parseInt(nr_str); + } + catch(Exception ex) + { + getSessionBean1().setMsg("O nr de acidentes do colaborador deve ser um valor numérico !"); + return false; + } + } + + if(txtNrAcidentesColaboradores.getText() != null) + { + String nr_str = txtNrAcidentesColaboradores.getText().toString(); + try + { + int nr = Integer.parseInt(nr_str); + } + catch(Exception ex) + { + getSessionBean1().setMsg("O nr de acidentes dos colaboradores deve ser um valor numérico !"); + return false; + } + } + } + + } + else if(estado == ESTADO_MEDICO) + { + if(txtCoefIncapacidade.getText() != null) { - int nr = Integer.parseInt(horas_turno); - if(nr > 99) + String coef_str = txtCoefIncapacidade.getText().toString(); + try { - getSessionBean1().setMsg("As horas turno devem ser entre 0 e 99 !"); + int nr = Integer.parseInt(coef_str); + } + catch(Exception ex) + { + getSessionBean1().setMsg("O coeficiente de incapacidade deve ser um valor numérico !"); return false; + } + } + + if(chkRestricaoCargas.getSelected() != null) + { + Boolean b = (Boolean) chkRestricaoCargas.getSelected(); + if(b.equals(new Boolean(true))) + { + if(txtKgs.getText() != null) + { + String kgs_str = txtKgs.getText().toString(); + try + { + int nr = Integer.parseInt(kgs_str); + } + catch(Exception ex) + { + getSessionBean1().setMsg("O valor de kgs deve ser um valor numérico !"); + return false; + } + } } } - catch(Exception ex) + } + else if(estado == ESTADO_ASSINATURAS) + { + int tipo_utilizador = getSessionBean1().getCurrentUser().getTipo().intValue(); + + switch(tipo_utilizador) { - getSessionBean1().setMsg("As horas turno devem ser um valor numérico !"); - return false; + case 1: //SEGURANCA + if(estado_assinatura == 1) + { + if(txtAssRespSeg.getText() != null) + { + String ass_resp_seg = txtAssRespSeg.getText().toString(); + if(ass_resp_seg.trim().length() == 0) + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + } + else + { + + if(txtAssSeg.getText() != null) + { + String ass_seg = txtAssSeg.getText().toString(); + if(ass_seg.trim().length() == 0) + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + + } + + break; + + case 2: //RH + if(txtAssRespRh.getText() != null) + { + String ass_resp_rh = txtAssRespRh.getText().toString(); + if(ass_resp_rh.trim().length() == 0) + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + break; + + case 3: //HS + if(txtAssHS.getText() != null) + { + String ass_hs = txtAssHS.getText().toString(); + if(ass_hs.trim().length() == 0) + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + break; + + case 5: //Medico + if(txtAssMed.getText() != null) + { + String ass_med = txtAssMed.getText().toString(); + if(ass_med.trim().length() == 0) + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta assinatura !"); + return false; + } + break; } } + + return true; } @@ -1987,7 +10075,54 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { private void savePageState() { AnaliseAcidenteTrabalhoState a = new AnaliseAcidenteTrabalhoState(); + if(getSessionBean1().getCurrentAnalise() == null) + { + a.setEstado(1); + } + else + { + a.setEstado(getSessionBean1().getCurrentAnalise().getEstado().intValue()); + } + a.setEmpresa(txtEmpresa.getText()); a.setHoras_turno(txtHorasTurno.getText()); + + a.setBi(txtBI.getText()); + a.setMorada(txtMorada.getText()); + a.setCod_postal1(txtCodPostal1.getText()); + a.setCod_postal2(txtCodPostal2.getText()); + a.setLocalidade(txtLocalidade.getText()); + a.setContacto_telefonico(txtContactoTelefonico.getText()); + a.setTurno("m"); + if(rbTurnoManha.getSelected() != null) + { + Boolean b = (Boolean) rbTurnoManha.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setTurno("m"); + } + } + + if(rbTurnoTarde.getSelected() != null) + { + Boolean b = (Boolean) rbTurnoTarde.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setTurno("t"); + } + } + + if(rbTurnoNoite.getSelected() != null) + { + Boolean b = (Boolean) rbTurnoNoite.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setTurno("n"); + } + } + Integer hours = (Integer) drpHours.getSelected(); + Integer minutes = (Integer) drpMinutes.getSelected(); + a.setHours(hours); + a.setMinutes(minutes); a.setLocal_trabalho(txtLocal.getText()); a.setSeccao(txtSeccao.getText()); a.setSubstancias(txtSubstancias.getText()); @@ -2003,17 +10138,199 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { a.setDescricao(txtDescricao.getText()); a.setConclusoes(txtConclusoes.getText()); a.setAccoes(txtAccoes.getText()); + + + if(getSessionBean1().getCurrentAnalise() != null) + { + if(getSessionBean1().getCurrentAnalise().getEstado().intValue() == ESTADO_RH1) + { + + a.setFormacao_shst("n"); + if(rbFormacaoSHSTY.getSelected() != null) + { + Boolean b = (Boolean) rbFormacaoSHSTY.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setFormacao_shst("y"); + } + } + if(rbFormacaoSHSTN.getSelected() != null) + { + Boolean b = (Boolean) rbFormacaoSHSTN.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setFormacao_shst("n"); + } + } + + a.setFormacao_shsht_n_why(txtFormacaoSHSTNWhy.getText()); + + a.setAcidentes_colaborador("n"); + if(rbAcidentesColaboradorY.getSelected() != null) + { + Boolean b = (Boolean) rbAcidentesColaboradorY.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setAcidentes_colaborador("y"); + } + } + + if(rbAcidentesColaboradorN.getSelected() != null) + { + Boolean b = (Boolean) rbAcidentesColaboradorN.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setAcidentes_colaborador("n"); + } + } + + a.setNr_acidentes_colaborador(txtNrAcidentesColaborador.getText()); + a.setNr_relatorio_acidentes_colaborador_1(txtNrRelatorioAcidentesColaborador1.getText()); + a.setNr_relatorio_acidentes_colaborador_2(txtNrRelatorioAcidentesColaborador2.getText()); + a.setNr_relatorio_acidentes_colaborador_3(txtNrRelatorioAcidentesColaborador3.getText()); + a.setNr_relatorio_acidentes_colaborador_4(txtNrRelatorioAcidentesColaborador4.getText()); + + a.setAcidentes_colaboradores("n"); + if(rbAcidentesColaboradoresY.getSelected() != null) + { + Boolean b = (Boolean) rbAcidentesColaboradoresY.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setAcidentes_colaboradores("y"); + } + } + + if(rbAcidentesColaboradoresN.getSelected() != null) + { + Boolean b = (Boolean) rbAcidentesColaboradoresN.getSelected(); + if(b.equals(new Boolean(true))) + { + a.setAcidentes_colaboradores("n"); + } + } + + a.setNr_acidentes_colaboradores(txtNrAcidentesColaboradores.getText()); + a.setNr_relatorio_acidentes_colaboradores_1(txtNrRelatorioAcidentesColaboradores1.getText()); + a.setNr_relatorio_acidentes_colaboradores_2(txtNrRelatorioAcidentesColaboradores2.getText()); + a.setNr_relatorio_acidentes_colaboradores_3(txtNrRelatorioAcidentesColaboradores3.getText()); + a.setNr_relatorio_acidentes_colaboradores_4(txtNrRelatorioAcidentesColaboradores4.getText()); + + } + + } + getSessionBean1().setAnalise_acidente_trabalho_state(a); } private void restorePageState() { AnaliseAcidenteTrabalhoState a = getSessionBean1().getAnalise_acidente_trabalho_state(); + + if(a.getEstado() == ESTADO_SEG) + { + butEnviar.setText("Enviar a RH"); + gridSiprpView.setRendered(false); + gridAcidentadoView.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + } + else if(a.getEstado() == ESTADO_RH1) + { + butEnviar.setText("Enviar a HS"); + gridSiprpView.setRendered(false); + gridAcidentadoView.setRendered(false); + //gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + + if(a.getFormacao_shst().matches("y")) + { + rbFormacaoSHSTY.setSelected(new Boolean(true)); + } + else + { + rbFormacaoSHSTN.setSelected(new Boolean(true)); + } + txtFormacaoSHSTNWhy.setText(a.getFormacao_shsht_n_why()); + + if(a.getAcidentes_colaborador().matches("y")) + { + rbAcidentesColaboradorY.setSelected(new Boolean(true)); + } + else + { + rbAcidentesColaboradorN.setSelected(new Boolean(true)); + } + + txtNrAcidentesColaborador.setText(a.getNr_acidentes_colaborador()); + txtNrRelatorioAcidentesColaborador1.setText(a.getNr_relatorio_acidentes_colaborador_1()); + txtNrRelatorioAcidentesColaborador2.setText(a.getNr_relatorio_acidentes_colaborador_2()); + txtNrRelatorioAcidentesColaborador3.setText(a.getNr_relatorio_acidentes_colaborador_3()); + txtNrRelatorioAcidentesColaborador4.setText(a.getNr_relatorio_acidentes_colaborador_4()); + + + if(a.getAcidentes_colaboradores().matches("y")) + { + rbAcidentesColaboradoresY.setSelected(new Boolean(true)); + } + else + { + rbAcidentesColaboradoresN.setSelected(new Boolean(true)); + } + + txtNrAcidentesColaboradores.setText(a.getNr_acidentes_colaboradores()); + txtNrRelatorioAcidentesColaboradores1.setText(a.getNr_relatorio_acidentes_colaboradores_1()); + txtNrRelatorioAcidentesColaboradores2.setText(a.getNr_relatorio_acidentes_colaboradores_2()); + txtNrRelatorioAcidentesColaboradores3.setText(a.getNr_relatorio_acidentes_colaboradores_3()); + txtNrRelatorioAcidentesColaboradores4.setText(a.getNr_relatorio_acidentes_colaboradores_4()); + } + txtEmpresa.setText(a.getEmpresa()); txtEstabelecimento.setText(a.getEstabelecimento()); txtTrabalhador.setText(a.getTrabalhador()); txtNomeAcidentado.setText(a.getTrabalhador()); txtDataNascimento.setText(a.getData_nascimento()); - txtHorasTurno.setText(a.getHoras_turno().toString()); + + try + { + txtHorasTurno.setText(a.getHoras_turno().toString()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + txtBI.setText(a.getBi()); + txtMorada.setText(a.getMorada()); + txtCodPostal1.setText(a.getCod_postal1()); + txtCodPostal2.setText(a.getCod_postal2()); + txtLocalidade.setText(a.getLocalidade()); + txtContactoTelefonico.setText(a.getContacto_telefonico()); + if(a.getTurno().matches("m")) + { + rbTurnoManha.setSelected(new Boolean(true)); + } + if(a.getTurno().matches("t")) + { + rbTurnoTarde.setSelected(new Boolean(true)); + } + if(a.getTurno().matches("n")) + { + rbTurnoNoite.setSelected(new Boolean(true)); + } + + drpHours.setSelected(a.getHours()); + drpMinutes.setSelected(a.getMinutes()); txtLocal.setText(a.getLocal_trabalho()); txtSeccao.setText(a.getSeccao()); txtSubstancias.setText(a.getSubstancias()); @@ -2070,6 +10387,478 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { return null; } + public String lnkEditUser_action() { + // TODO: Replace with your code + savePageState(); + getSessionBean1().setNavFrom("AnaliseAcidenteTrabalho"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + } + + public String lnkMoreRec1_action() { + // TODO: Replace with your code + int seq = gridRecomendacoes.getChildren().size(); + seq++; + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grd" + seq); + grd.setColumns(3); + grd.setColumnClasses("gridColLeft5, gridColLeft90,gridColLeft5"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("st" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + TextArea ta = new TextArea(); + ta.setId("ta" + seq); + ta.setStyle("height: 24px; width: 98%"); + grd.getChildren().add(ta); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId("ln" + seq); + ln.setWidth(9); + ln.setHeight(9); + ln.setImageURL("/resources/plus_more.gif"); + MethodBinding mbAction = this.getApplication().createMethodBinding("#{AnaliseAcidenteTrabalho.lnkMoreRec1_action}", null); + ln.setAction(mbAction); + + grd.getChildren().add(ln); + + gridRecomendacoes.getChildren().add(grd); + return null; + } + + public String lnkMoreMed_action() { + // TODO: Replace with your code + + int seq = gridMedidas.getChildren().size(); + seq++; + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdMedida" + seq); + grd.setColumns(3); + grd.setColumnClasses("gridColLeft5, gridColLeft90,gridColLeft5"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("stNrMedida" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + TextArea ta = new TextArea(); + ta.setId("taMedida" + seq); + ta.setStyle("height: 24px; width: 98%"); + grd.getChildren().add(ta); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId("lnMedidaMore" + seq); + ln.setWidth(9); + ln.setHeight(9); + ln.setImageURL("/resources/plus_more.gif"); + MethodBinding mbAction = this.getApplication().createMethodBinding("#{AnaliseAcidenteTrabalho.lnkMoreMed_action}", null); + ln.setAction(mbAction); + + grd.getChildren().add(ln); + + gridMedidas.getChildren().add(grd); + return null; + } + + + private void initCalendars() + { + java.util.GregorianCalendar gcalendar = new java.util.GregorianCalendar(); + gcalendar.set(1900,1,1); + calAvaliacaoIncap.setMinDate(gcalendar.getTime()); + java.util.GregorianCalendar gcalendar1 = new java.util.GregorianCalendar(); + gcalendar1.set(2099,1,1); + calAvaliacaoIncap.setMaxDate(gcalendar1.getTime()); + + calRevisaoIncap.setMinDate(gcalendar.getTime()); + calRevisaoIncap.setMaxDate(gcalendar1.getTime()); + + calPeridoIncapDe.setMinDate(gcalendar.getTime()); + calPeridoIncapDe.setMaxDate(gcalendar1.getTime()); + + calPeriodoIncapA.setMinDate(gcalendar.getTime()); + calPeriodoIncapA.setMaxDate(gcalendar1.getTime()); + } + + public void chkMembroSupDir_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Boolean b = (Boolean) event.getNewValue(); + if(b.equals(new Boolean(true))) + { + lblEspecif1.setRendered(true); + txtEspecif1.setRendered(true); + } + else + { + lblEspecif1.setRendered(false); + txtEspecif1.setRendered(false); + } + } + + public void chkMembroSupEsq_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Boolean b = (Boolean) event.getNewValue(); + if(b.equals(new Boolean(true))) + { + lblEspecif2.setRendered(true); + txtEspecif2.setRendered(true); + } + else + { + lblEspecif2.setRendered(false); + txtEspecif2.setRendered(false); + } + } + + public void chkMembroInfDir_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Boolean b = (Boolean) event.getNewValue(); + if(b.equals(new Boolean(true))) + { + lblEspecif3.setRendered(true); + txtEspecif3.setRendered(true); + } + else + { + lblEspecif3.setRendered(false); + txtEspecif3.setRendered(false); + } + } + + public void chkMembroInfEsq_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Boolean b = (Boolean) event.getNewValue(); + if(b.equals(new Boolean(true))) + { + lblEspecif4.setRendered(true); + txtEspecif4.setRendered(true); + } + else + { + lblEspecif4.setRendered(false); + txtEspecif4.setRendered(false); + } + } + + public void drpTecnicos_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Integer selected = (Integer) drpTecnicos.getSelected(); + if(selected.intValue() != 0) + { + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + Utilizador u = udp.getUtilizador(selected); + txtCap.setText(u.getCap()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + } + } + + public void drpMedicos_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Integer selected = (Integer) drpMedicos.getSelected(); + if(selected.intValue() != 0) + { + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + Utilizador u = udp.getUtilizador(selected); + txtCedula.setText(u.getNumero_cedula()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + } + + public void chkRestricaoCargas_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Boolean b = (Boolean) event.getNewValue(); + if(b.equals(new Boolean(true))) + { + rbKgs2.setRendered(true); + rbKgs5.setRendered(true); + rbKgs10.setRendered(true); + rbKgs15.setRendered(true); + rbKgsOutro.setRendered(true); + txtKgs.setRendered(true); + stKgs2.setRendered(true); + stKgs5.setRendered(true); + stKgs10.setRendered(true); + stKgs15.setRendered(true); + stKgsOutro.setRendered(true); + stKg.setRendered(true); + } + else + { + rbKgs2.setRendered(false); + rbKgs5.setRendered(false); + rbKgs10.setRendered(false); + rbKgs15.setRendered(false); + rbKgsOutro.setRendered(false); + txtKgs.setRendered(false); + stKgs2.setRendered(false); + stKgs5.setRendered(false); + stKgs10.setRendered(false); + stKgs15.setRendered(false); + stKgsOutro.setRendered(false); + stKg.setRendered(false); + } + } + + private void notifyNextSignature(Integer estado_assinatura) + { + Integer tipo = null; + ArrayList list = null; + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + switch(estado_assinatura.intValue()) + { + case ESTADO_ASSINATURA_1: + tipo = new Integer(1); // seguranca + try + { + list = udp.getUtilizadoresListByTipo(tipo); + ListIterator iter = list.listIterator(); + while(iter.hasNext()) + { + Utilizador u = (Utilizador) iter.next(); + System.out.println("USER MAIL : " + u.getLogin() + " ; " + u.getEmail()); + sendEmail(u.getEmail(), getSessionBean1().getCurrentUser().getEmail()); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + break; + case ESTADO_ASSINATURA_2: + tipo = new Integer(1); // seguranca + try + { + list = udp.getUtilizadoresListByTipo(tipo); + ListIterator iter = list.listIterator(); + while(iter.hasNext()) + { + Utilizador u = (Utilizador) iter.next(); + System.out.println("USER MAIL : " + u.getLogin() + " ; " + u.getEmail()); + sendEmail(u.getEmail(), getSessionBean1().getCurrentUser().getEmail()); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + tipo = new Integer(3); // hs + try + { + list = udp.getUtilizadoresListByTipo(tipo); + ListIterator iter = list.listIterator(); + while(iter.hasNext()) + { + Utilizador u = (Utilizador) iter.next(); + System.out.println("USER MAIL : " + u.getLogin() + " ; " + u.getEmail()); + sendEmail(u.getEmail(), getSessionBean1().getCurrentUser().getEmail()); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + tipo = new Integer(5); // medico + try + { + list = udp.getUtilizadoresListByTipo(tipo); + ListIterator iter = list.listIterator(); + while(iter.hasNext()) + { + Utilizador u = (Utilizador) iter.next(); + System.out.println("USER MAIL : " + u.getLogin() + " ; " + u.getEmail()); + sendEmail(u.getEmail(), getSessionBean1().getCurrentUser().getEmail()); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + break; + case ESTADO_ASSINATURA_3: + tipo = new Integer(2); // recursos humanos + try + { + list = udp.getUtilizadoresListByTipo(tipo); + ListIterator iter = list.listIterator(); + while(iter.hasNext()) + { + Utilizador u = (Utilizador) iter.next(); + System.out.println("USER MAIL : " + u.getLogin() + " ; " + u.getEmail()); + sendEmail(u.getEmail(), getSessionBean1().getCurrentUser().getEmail()); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + break; + } + } + + private void sendMailToNextUser(Integer estado) + { + System.out.println("SEND MAIL NEXT USER"); + Integer tipo = null; + + if(estado.intValue() == ESTADO_IMPRESSAO) + { + tipo = new Integer(2); // rh + } + else if(estado.intValue() == ESTADO_FECHAR) + { + tipo = new Integer(3); // hs + } +// else if(estado.intValue() == ESTADO_ASSINATURAS) +// { +// //tipo = new Integer(?) // manda para Responsavel Seguranca +// } + else + { + tipo = estado; + } + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + ArrayList list = udp.getUtilizadoresListByTipo(tipo); + ListIterator iter = list.listIterator(); + while(iter.hasNext()) + { + Utilizador u = (Utilizador) iter.next(); + System.out.println("USER MAIL : " + u.getLogin() + " ; " + u.getEmail()); + sendEmail(u.getEmail(), getSessionBean1().getCurrentUser().getEmail()); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + System.out.println("MAIL ERROR : " + ex.getMessage()); + } + + } + + private void sendEmail(String emailTo, String emailFrom) throws Exception + { + Properties props = new Properties(); + //props.put("mail.transport.protocol", "smtp"); + props.put("mail.smtp.host", "smtp.netcabo.pt"); + props.put("mail.from", emailFrom); + Session session1 = Session.getInstance(props); + Message msg = new MimeMessage(session1); + +// try +// { + //Address Email_TO = new InternetAddress("myemail@bol.com.br"); + msg.setFrom(new InternetAddress(emailFrom)); + InternetAddress[] address = {new InternetAddress(emailTo)}; + msg.setRecipients(Message.RecipientType.TO, address); + msg.setSubject("Notificacao de fase"); + msg.setSentDate(new Date()); + Multipart multipart = new MimeMultipart(); + BodyPart msgBodyPart = new MimeBodyPart(); + String html; + html=" "; + html+=""; + html+="

Proxima fase

"; + html+=""; + msgBodyPart.setContent(html, "text/html"); + multipart.addBodyPart(msgBodyPart); + msg.setContent(multipart); + Transport.send(msg); + System.out.println("Email Enviado !!!! "); +// } +// catch (Exception ex) +// { +// System.out.println("MAIL ERROR : " + ex.getMessage()); +// ex.printStackTrace(); +// } + + } + + public String butImprimir_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. +// AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); +// if(a.getEstado().intValue() == ESTADO_IMPRESSAO) +// { +// Pdf pdf = new Pdf(); +// pdf.generatePdf(a); +// } + return null; + } + + private void buildPdf(AnaliseAcidente a) + { + + // create pdf folder + String pdf_folder = createPdfFolder(a.getId().toString()); + if(pdf_folder != null) + { + hidPdf.setValue(a.getId().toString()); + Pdf pdf = new Pdf(); + pdf.generatePdf(pdf_folder, a); + } + } + + + private String createPdfFolder(String folderName) + { + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + String pdfFileFolder = theApplicationsServletContext.getRealPath(PDFS_FOLDER_URL + "/" + folderName); + try + { + //String imageFileFolderTmp = theApplicationsServletContext.getRealPath(IMAGE_URL + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + File folder = new File(pdfFileFolder); + if(! folder.exists()) + { + folder.mkdir(); + } + else + { + //remove all existing files + File files[] = folder.listFiles(); + + for(int i=0;i @@ -218,7 +627,7 @@ public class Dummy extends AbstractPageBean { * this page.

*/ public void prerender() { - txtIn.setText("OLA"); + //txtIn.setText("OLA"); } /** @@ -256,7 +665,65 @@ public class Dummy extends AbstractPageBean { public String button1_action() { // TODO: Process the button click action. Return value is a navigation // case name where null will return to the same page. - System.out.println("TEXT : " + txtIn.getText().toString()); + //System.out.println("TEXT : " + txtIn.getText().toString()); + return null; + } + + public String butCancelar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return null; + } + + public String butGravar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return null; + } + + public String butEnviar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return null; + } + + public String butImagem_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return null; + } + + public String lnkMoreMed1_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkNome_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkDataNascimento_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkEditUser_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkLogout_action() { + // TODO: Replace with your code + return null; } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java new file mode 100644 index 00000000..39defa9c --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java @@ -0,0 +1,40 @@ +/* + * Empresa.java + * + * Created on October 11, 2007, 5:19 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class Estabelecimento { + private Integer id; + private String nome_plain; + + /** Creates a new instance of Empresa */ + public Estabelecimento() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNome_plain() { + return nome_plain; + } + + public void setNome_plain(String nome_plain) { + this.nome_plain = nome_plain; + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java new file mode 100644 index 00000000..eeefde7c --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java @@ -0,0 +1,1209 @@ +/* + * FichaUtilizador.java + * + * Created on October 11, 2007, 9:49 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.corba.se.impl.logging.UtilSystemException; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.HiddenField; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.PasswordField; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.SingleSelectOptionsList; +import db.AnalisesDataProvider; +import db.UtilizadoresDataProvider; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FichaUtilizador extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() { + return gridLayout1; + } + + public void setGridLayout1(HtmlPanelGrid hpg) { + this.gridLayout1 = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() { + return image2; + } + + public void setImage2(ImageComponent ic) { + this.image2 = ic; + } + + private PanelGroup groupPanel2 = new PanelGroup(); + + public PanelGroup getGroupPanel2() { + return groupPanel2; + } + + public void setGroupPanel2(PanelGroup pg) { + this.groupPanel2 = pg; + } + + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() { + return staticText1; + } + + public void setStaticText1(StaticText st) { + this.staticText1 = st; + } + + private Hyperlink lnkEditUser = new Hyperlink(); + + public Hyperlink getLnkEditUser() { + return lnkEditUser; + } + + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; + } + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private Hyperlink lnkLogout = new Hyperlink(); + + public Hyperlink getLnkLogout() { + return lnkLogout; + } + + public void setLnkLogout(Hyperlink h) { + this.lnkLogout = h; + } + + private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMsg1() { + return gridMsg1; + } + + public void setGridMsg1(HtmlPanelGrid hpg) { + this.gridMsg1 = hpg; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() { + return groupPanel3; + } + + public void setGroupPanel3(PanelGroup pg) { + this.groupPanel3 = pg; + } + + private StaticText stCriarEditar = new StaticText(); + + public StaticText getStCriarEditar() { + return stCriarEditar; + } + + public void setStCriarEditar(StaticText st) { + this.stCriarEditar = st; + } + + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() { + return staticText4; + } + + public void setStaticText4(StaticText st) { + this.staticText4 = st; + } + + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; + } + + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private DropDown drpTipo = new DropDown(); + + public DropDown getDrpTipo() { + return drpTipo; + } + + public void setDrpTipo(DropDown dd) { + this.drpTipo = dd; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private DropDown drpNome = new DropDown(); + + public DropDown getDrpNome() { + return drpNome; + } + + public void setDrpNome(DropDown dd) { + this.drpNome = dd; + } + + private TextField txtNome = new TextField(); + + public TextField getTxtNome() { + return txtNome; + } + + public void setTxtNome(TextField tf) { + this.txtNome = tf; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private TextField txtLogin = new TextField(); + + public TextField getTxtLogin() { + return txtLogin; + } + + public void setTxtLogin(TextField tf) { + this.txtLogin = tf; + } + + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() { + return staticText8; + } + + public void setStaticText8(StaticText st) { + this.staticText8 = st; + } + + private PasswordField txtPassword = new PasswordField(); + + public PasswordField getTxtPassword() { + return txtPassword; + } + + public void setTxtPassword(PasswordField pf) { + this.txtPassword = pf; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private TextField txtEmail = new TextField(); + + public TextField getTxtEmail() { + return txtEmail; + } + + public void setTxtEmail(TextField tf) { + this.txtEmail = tf; + } + + private StaticText lblCap = new StaticText(); + + public StaticText getLblCap() { + return lblCap; + } + + public void setLblCap(StaticText st) { + this.lblCap = st; + } + + private TextField txtCap = new TextField(); + + public TextField getTxtCap() { + return txtCap; + } + + public void setTxtCap(TextField tf) { + this.txtCap = tf; + } + + private StaticText lblCedula = new StaticText(); + + public StaticText getLblCedula() { + return lblCedula; + } + + public void setLblCedula(StaticText st) { + this.lblCedula = st; + } + + private StaticText stCedula = new StaticText(); + + public StaticText getStCedula() { + return stCedula; + } + + public void setStCedula(StaticText st) { + this.stCedula = st; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private StaticText staticText13 = new StaticText(); + + public StaticText getStaticText13() { + return staticText13; + } + + public void setStaticText13(StaticText st) { + this.staticText13 = st; + } + + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() { + return gridPanel7; + } + + public void setGridPanel7(HtmlPanelGrid hpg) { + this.gridPanel7 = hpg; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() { + return groupPanel5; + } + + public void setGroupPanel5(PanelGroup pg) { + this.groupPanel5 = pg; + } + + private Button butApagar = new Button(); + + public Button getButApagar() { + return butApagar; + } + + public void setButApagar(Button b) { + this.butApagar = b; + } + + private Button butGravar = new Button(); + + public Button getButGravar() { + return butGravar; + } + + public void setButGravar(Button b) { + this.butGravar = b; + } + + private HiddenField hidConfDelUser = new HiddenField(); + + public HiddenField getHidConfDelUser() { + return hidConfDelUser; + } + + public void setHidConfDelUser(HiddenField hf) { + this.hidConfDelUser = hf; + } + + //
+ private boolean isPostData = false; + + private final static int SEG = 1; + private final static int RH = 2; + private final static int HS = 3; + private final static int MEDICO = 5; + private final static int ADMIN_LOJA = 6; + + private StaticText staticText12 = new StaticText(); + + public StaticText getStaticText12() { + return staticText12; + } + + public void setStaticText12(StaticText st) { + this.staticText12 = st; + } + + private DropDown drpEstabelecimentos = new DropDown(); + + public DropDown getDrpEstabelecimentos() { + return drpEstabelecimentos; + } + + public void setDrpEstabelecimentos(DropDown dd) { + this.drpEstabelecimentos = dd; + } + + private SingleSelectOptionsList drpEstabelecimentosDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpEstabelecimentosDefaultOptions() { + return drpEstabelecimentosDefaultOptions; + } + + public void setDrpEstabelecimentosDefaultOptions(SingleSelectOptionsList ssol) { + this.drpEstabelecimentosDefaultOptions = ssol; + } + + /** + *

Construct a new Page bean instance.

+ */ + public FichaUtilizador() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("FichaUtilizador Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + + + + + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + if(pageFrom.matches("FichaUtilizador.jsp")) + { + isPostData = true; + } + if(!isPostData) + { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + getSessionBean1().setTiposOptions(adp.getTiposList()); + drpTipo.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + getSessionBean1().setEstabelecimentosOptions(adp.getEstabelecimentosList( getSessionBean1().getCurrentUser().getEmpresa_id() )); + drpEstabelecimentos.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + } + else //postData + { + String del_user = (String)getExternalContext().getRequestParameterMap().get("del_user"); + if(del_user != null) + { + if(del_user.matches("yes")) + { + hidConfDelUser.setValue(""); + try + { + deleteUser(); + } + catch(Exception ex) + { + ex.printStackTrace(); + getSessionBean1().setMsg("Erro na eliminação do utilizador !"); + } + + //force a page reload +// try +// { +// getExternalContext().redirect("FichaUtilizador.jsp"); +// System.out.println("REDIRECT"); +// } +// catch(Exception ex) +// { +// ex.printStackTrace(); +// } + + } + else if(del_user.matches("no")) + { + hidConfDelUser.setValue(""); + showUser(); + } + } + + } + + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + stCriarEditar.setText("EDITAR"); + butApagar.setRendered(true); + if(getSessionBean1().getModoEdicaoUtilizador().matches("new")) + { + if(!isPostData) + { + txtNome.setStyleClass("hide"); + stCriarEditar.setText("CRIAR"); + } + butApagar.setRendered(false); + } + if(getSessionBean1().getModoEdicaoUtilizador().matches("edit")) + { + //drpNome.setRendered(true); + if(!isPostData) + { + showUser(); + } + } + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + public String lnkLogout_action() { + // TODO: Replace with your code + + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + return "login"; + } + + + public String butCancelar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + String nav_from = getSessionBean1().getNavFrom(); + if(nav_from.matches("FormSeguranca")) + { + return "form_seguranca"; + } + else if(nav_from.matches("FormRH")) + { + return "form_rh"; + } + else if(nav_from.matches("FormHS")) + { + return "form_hs"; + } + else if(nav_from.matches("FormMedico")) + { + return "form_medico"; + } + else if(nav_from.matches("AnaliseAcidenteTrabalho")) + { + System.out.println("GOTO ANALISE ACIDENTE"); + return "analise_acidente"; + } + else if(nav_from.matches("ViewAnaliseAcidenteTrabalho")) + { + return "view_analise"; + } + return "case1"; + } + + public String butGravar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + if(validationOk()) + { + if(getSessionBean1().getModoEdicaoUtilizador().matches("new")) + { + try + { + Utilizador u = addUser(); + addPermissao(u); + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na criação do utilizador"); + ex.printStackTrace(); + } + } + else //edit + { + try + { + updateUser(); + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na actualização do utilizador"); + ex.printStackTrace(); + } + } + + } + + return null; + } + + public void drpTipo_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + drpNome.setVisible(true); + Integer tipo = (Integer) drpTipo.getSelected(); + if(tipo.intValue() == SEG || tipo.intValue() == RH || tipo.intValue() == ADMIN_LOJA) + { + drpNome.setRendered(false); + txtNome.setStyleClass("show"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(false); + stCedula.setRendered(false); + } + else if(tipo.intValue() == HS || tipo.intValue() == MEDICO) + { + drpNome.setRendered(true); + txtNome.setStyleClass("hide"); + AnalisesDataProvider adp = new AnalisesDataProvider(); + if(tipo.intValue() == HS) + { + lblCap.setRendered(true); + txtCap.setRendered(true); + lblCedula.setRendered(false); + stCedula.setRendered(false); + try + { + getSessionBean1().setMedicosOptions(adp.getTecnicosSaudeList()); + drpNome.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + else // medicos + { + lblCedula.setRendered(true); + stCedula.setRendered(true); + lblCap.setRendered(false); + txtCap.setRendered(false); + try + { + getSessionBean1().setMedicosOptions(adp.getMedicosList()); + drpNome.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + } + + private boolean validationOk() + { + Integer tipo = (Integer) drpTipo.getSelected(); + if(tipo.intValue() == 0) + { + getSessionBean1().setMsg("Tem de escolher um tipo !"); + return false; + } + Integer estabelecimento = (Integer) drpEstabelecimentos.getSelected(); + if(estabelecimento.intValue() == 0) + { + getSessionBean1().setMsg("Tem de escolher um estabelecimento !"); + return false; + } + + if(tipo.intValue() == SEG || tipo.intValue() == RH || tipo.intValue() == HS || tipo.intValue() == MEDICO || tipo.intValue() == ADMIN_LOJA) + { + if(txtNome.getText() == null) + { + getSessionBean1().setMsg("Tem de indicar o nome !"); + return false; + } + else + { + String nome = (String) txtNome.getText(); + if(nome.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de indicar o nome !"); + return false; + } + } + } + else if(tipo.intValue() == HS || tipo.intValue() == MEDICO) + { + Integer nome = (Integer) drpNome.getSelected(); + if(nome.intValue() == 0) + { + getSessionBean1().setMsg("Tem de indicar o nome !"); + return false; + } + } + + if(txtLogin.getText() == null) + { + getSessionBean1().setMsg("Tem de indicar o login !"); + return false; + } + else + { + String login = (String) txtLogin.getText(); + if(login.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de indicar o login !"); + return false; + } + } + + if(txtPassword.getText() == null) + { + getSessionBean1().setMsg("Tem de indicar a password !"); + return false; + } + else + { + String password = (String) txtPassword.getText(); + if(password.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de indicar a password !"); + return false; + } + } + + if(tipo.intValue() == HS) + { + if(txtCap.getText() == null ) + { + getSessionBean1().setMsg("Tem de indicar o c.a.p. !"); + return false; + } + else + { + String cap = (String) txtCap.getText(); + if(cap.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de indicar o c.a.p. !"); + return false; + } + } + } + + return true; + } + + public void drpNome_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Integer tipo = (Integer) drpTipo.getSelected(); + if(tipo.intValue() == MEDICO) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + Integer medico_id = (Integer) drpNome.getSelected(); + try + { + String numero_cedula = adp.getNumeroCedula(medico_id); + stCedula.setText(numero_cedula); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + + private Utilizador addUser() throws Exception + { + Utilizador u = fillUser(); + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + Integer id = udp.createNewUtilizador(u); + u.setId(id); + return u; + } + + private void addPermissao(Utilizador u) throws Exception + { + Permissao p = new Permissao(); + p.setUser_id(u.getId()); + p.setCodigo_permissao(u.getTipo()); + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + udp.createPermissao(p); + } + + private void updateUser() throws Exception + { + Utilizador u = fillUser(); + u.setId(getSessionBean1().getCurrentUser().getId()); + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + udp.updateUtilizador(u); + } + + private void deleteUser() throws Exception + { + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + udp.deleteUser(getSessionBean1().getCurrentUser().getId()); + } + + private void showUser() + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + Utilizador u = getSessionBean1().getCurrentUser(); + drpTipo.setSelected(u.getTipo()); + if(u.getTipo().intValue() == SEG || u.getTipo().intValue() == RH || u.getTipo().intValue() == HS || u.getTipo().intValue() == MEDICO || u.getTipo().intValue() == ADMIN_LOJA) + { + drpNome.setRendered(false); + txtNome.setStyleClass("show"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(false); + stCedula.setRendered(false); + System.out.println("NOME == " + u.getNome()); + txtNome.setText(utils.Utils.unicodeToHTML(u.getNome())); + } + else if(u.getTipo().intValue() == HS) + { + //txtNome.setRendered(false); + try + { + getSessionBean1().setMedicosOptions(adp.getTecnicosSaudeList()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + drpNome.setSelected(u.getFuncionario_hst_id()); + drpNome.setStyleClass("show"); + lblCap.setRendered(true); + txtCap.setRendered(true); + lblCedula.setRendered(false); + stCedula.setRendered(false); + txtCap.setText(u.getCap()); + } + else if(u.getTipo().intValue() == MEDICO) //medico + { + drpNome.setRendered(true); + try + { + getSessionBean1().setMedicosOptions(adp.getMedicosList()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + drpNome.setSelected(u.getMedico_id()); + txtNome.setStyleClass("hide"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(true); + stCedula.setRendered(true); + stCedula.setText(u.getNumero_cedula()); + + } + drpEstabelecimentos.setSelected(u.getEstabelecimento_id()); + txtLogin.setText(u.getLogin()); + txtPassword.setText(u.getPassword()); + txtEmail.setText(u.getEmail()); + } + + private Utilizador fillUser() + { + Utilizador u = new Utilizador(); + u.setActivo("y"); + u.setAdministrador("n"); + u.setTipo((Integer) drpTipo.getSelected()); + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + u.setEstabelecimento_id( (Integer) drpEstabelecimentos.getSelected() ); + u.setLogin( (String) txtLogin.getText() ); + u.setPassword( (String) txtPassword.getText() ); + u.setEmail(""); + if(txtEmail.getText() != null) + { + u.setEmail( (String) txtEmail.getText() ); + } + + Integer tipo = (Integer) drpTipo.getSelected(); + + u.setNumero_cedula(""); + u.setCap(""); + if(tipo.intValue() == HS || tipo.intValue() == MEDICO) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + if(tipo.intValue() == HS) + { + try + { + Integer tecnico_id = (Integer) drpNome.getSelected(); + u.setFuncionario_hst_id(tecnico_id); + u.setNome( adp.getTecnicoSaudeNome(tecnico_id) ); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + u.setCap( (String) txtCap.getText()); + } + else // medico + { + try + { + Integer medico_id = (Integer) drpNome.getSelected(); + u.setMedico_id(medico_id); + u.setNome( adp.getMedicoNome(medico_id) ); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + u.setNumero_cedula( (String) stCedula.getText()); + } + } + else + { + u.setNome( (String) txtNome.getText() ); + } + return u; + } + + public String lnkEditUser_action() { + // TODO: Replace with your code + + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + } + + public String butApagar_action() { + // TODO: Replace with your code + hidConfDelUser.setValue("apagar"); + return null; + } +} + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java index 2041d12f..1c0ec398 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java @@ -26,6 +26,7 @@ import com.sun.rave.web.ui.component.TableRowGroup; import com.sun.rave.web.ui.component.TextField; import com.sun.rave.web.ui.model.Option; import db.AnalisesActualDataProvider; +import db.AnalisesConcluidasDataProvider; import db.AnalisesDataProvider; import db.AnalisesSeguimentoDataProvider; import java.util.ArrayList; @@ -36,6 +37,7 @@ import javax.faces.FacesException; import javax.faces.component.html.HtmlPanelGrid; import javax.faces.event.ValueChangeEvent; import javax.servlet.http.HttpServletRequest; +import utils.Utils; /** *

Page bean that corresponds to a similarly named JSP page. This @@ -206,14 +208,14 @@ public class FormHS extends AbstractPageBean { this.staticText1 = st; } - private Hyperlink lnkChangePassword1 = new Hyperlink(); + private Hyperlink lnkEditUser = new Hyperlink(); - public Hyperlink getLnkChangePassword1() { - return lnkChangePassword1; + public Hyperlink getLnkEditUser() { + return lnkEditUser; } - public void setLnkChangePassword1(Hyperlink h) { - this.lnkChangePassword1 = h; + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; } private StaticText staticText2 = new StaticText(); @@ -236,16 +238,6 @@ public class FormHS extends AbstractPageBean { this.lnkLogout = h; } - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); public HtmlPanelGrid getGridLayoutTop1() { @@ -716,14 +708,14 @@ public class FormHS extends AbstractPageBean { this.tableColumn7 = tc; } - private Hyperlink hyperlink1 = new Hyperlink(); + private Hyperlink lnkDataConcluida = new Hyperlink(); - public Hyperlink getHyperlink1() { - return hyperlink1; + public Hyperlink getLnkDataConcluida() { + return lnkDataConcluida; } - public void setHyperlink1(Hyperlink h) { - this.hyperlink1 = h; + public void setLnkDataConcluida(Hyperlink h) { + this.lnkDataConcluida = h; } private TableColumn tableColumn8 = new TableColumn(); @@ -736,14 +728,14 @@ public class FormHS extends AbstractPageBean { this.tableColumn8 = tc; } - private Hyperlink hyperlink2 = new Hyperlink(); + private Hyperlink lnkNrConcluida = new Hyperlink(); - public Hyperlink getHyperlink2() { - return hyperlink2; + public Hyperlink getLnkNrConcluida() { + return lnkNrConcluida; } - public void setHyperlink2(Hyperlink h) { - this.hyperlink2 = h; + public void setLnkNrConcluida(Hyperlink h) { + this.lnkNrConcluida = h; } private TableColumn tableColumn9 = new TableColumn(); @@ -756,14 +748,14 @@ public class FormHS extends AbstractPageBean { this.tableColumn9 = tc; } - private Hyperlink hyperlink3 = new Hyperlink(); + private Hyperlink lnkNomeConcluida = new Hyperlink(); - public Hyperlink getHyperlink3() { - return hyperlink3; + public Hyperlink getLnkNomeConcluida() { + return lnkNomeConcluida; } - public void setHyperlink3(Hyperlink h) { - this.hyperlink3 = h; + public void setLnkNomeConcluida(Hyperlink h) { + this.lnkNomeConcluida = h; } private StaticText txtSearchMsg = new StaticText(); @@ -775,6 +767,46 @@ public class FormHS extends AbstractPageBean { public void setTxtSearchMsg(StaticText st) { this.txtSearchMsg = st; } + + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() { + return tableColumn10; + } + + public void setTableColumn10(TableColumn tc) { + this.tableColumn10 = tc; + } + + private Hyperlink lnkFase = new Hyperlink(); + + public Hyperlink getLnkFase() { + return lnkFase; + } + + public void setLnkFase(Hyperlink h) { + this.lnkFase = h; + } + + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() { + return tableColumn11; + } + + public void setTableColumn11(TableColumn tc) { + this.tableColumn11 = tc; + } + + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() { + return lnkFaseSeg; + } + + public void setLnkFaseSeg(Hyperlink h) { + this.lnkFaseSeg = h; + } // @@ -854,7 +886,8 @@ public class FormHS extends AbstractPageBean { //lblActivos.setRendered(true); table1.setRendered(true); - ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(3)); + //ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(3)); + ArrayList actuaisList = adp.getAnalisesActuaisHsList( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); } catch(Exception ex) @@ -869,7 +902,7 @@ public class FormHS extends AbstractPageBean { //lblActivos.setRendered(true); table2.setRendered(true); - ArrayList seguimentoList = adp.getAnalisesSeguimentoList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(3)); + ArrayList seguimentoList = adp.getAnalisesSeguimentoHsList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList); } catch(Exception ex) @@ -881,7 +914,7 @@ public class FormHS extends AbstractPageBean { HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); String referer = request.getRequestURI(); - String pageFrom = getPageFrom(referer); + String pageFrom = Utils.getPageFrom(referer); if(!pageFrom.matches("FormHS.jsp")) { @@ -949,7 +982,7 @@ public class FormHS extends AbstractPageBean { AnaliseAcidente a = getTableActivosRowData(); getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); + getSessionBean1().setNavFrom("FormHS"); return "analise_acidente"; } @@ -958,7 +991,7 @@ public class FormHS extends AbstractPageBean { AnaliseAcidente a = getTableActivosRowData(); getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); + getSessionBean1().setNavFrom("FormHS"); return "analise_acidente"; } @@ -967,7 +1000,7 @@ public class FormHS extends AbstractPageBean { AnaliseAcidente a = getTableActivosRowData(); getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); + getSessionBean1().setNavFrom("FormHS"); return "analise_acidente"; } @@ -1016,6 +1049,16 @@ public class FormHS extends AbstractPageBean { ArrayList list = (ArrayList) provider.getList(); AnaliseAcidente a = (AnaliseAcidente)list.get(k); return a; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + AnalisesConcluidasDataProvider provider = (AnalisesConcluidasDataProvider) tableRowGroup3.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + AnaliseAcidente a = (AnaliseAcidente)list.get(k); + return a; } public void drpAno_processValueChange(ValueChangeEvent event) { @@ -1124,11 +1167,11 @@ public class FormHS extends AbstractPageBean { return null; } - private String getPageFrom(String referer) - { - String pageFrom = referer.substring(referer.lastIndexOf("/")+1); - return pageFrom; - } +// private String getPageFrom(String referer) +// { +// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); +// return pageFrom; +// } private void fillAnoDropDown() { @@ -1228,5 +1271,57 @@ public class FormHS extends AbstractPageBean { // int day = cal.get(Calendar.DAY_OF_MONTH); // drpDia.setSelected( new Integer(0) ); } + + public String lnkEditUser_action() { + // TODO: Replace with your code + getSessionBean1().setNavFrom("FormHS"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + } + + public String lnkDataConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormHS"); + return "view_analise"; + } + + public String lnkNrConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormHS"); + return "view_analise"; + } + + public String lnkNomeConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormHS"); + return "view_analise"; + } + + public String lnkFase_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormHS"); + return "analise_acidente"; + } + + public String lnkFaseSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormMedico.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormMedico.java new file mode 100644 index 00000000..a3e07fc0 --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormMedico.java @@ -0,0 +1,1275 @@ +/* + * FormMedico.java + * + * Created on October 22, 2007, 1:56 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.AnalisesActualDataProvider; +import db.AnalisesConcluidasDataProvider; +import db.AnalisesDataProvider; +import db.AnalisesSeguimentoDataProvider; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.ListIterator; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FormMedico extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() { + return gridLayout1; + } + + public void setGridLayout1(HtmlPanelGrid hpg) { + this.gridLayout1 = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() { + return image2; + } + + public void setImage2(ImageComponent ic) { + this.image2 = ic; + } + + private PanelGroup groupPanel2 = new PanelGroup(); + + public PanelGroup getGroupPanel2() { + return groupPanel2; + } + + public void setGroupPanel2(PanelGroup pg) { + this.groupPanel2 = pg; + } + + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() { + return staticText1; + } + + public void setStaticText1(StaticText st) { + this.staticText1 = st; + } + + private Hyperlink lnkEditUser = new Hyperlink(); + + public Hyperlink getLnkEditUser() { + return lnkEditUser; + } + + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; + } + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private Hyperlink lnkLogout = new Hyperlink(); + + public Hyperlink getLnkLogout() { + return lnkLogout; + } + + public void setLnkLogout(Hyperlink h) { + this.lnkLogout = h; + } + + private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop1() { + return gridLayoutTop1; + } + + public void setGridLayoutTop1(HtmlPanelGrid hpg) { + this.gridLayoutTop1 = hpg; + } + + private HtmlPanelGrid gridActual = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridActual() { + return gridActual; + } + + public void setGridActual(HtmlPanelGrid hpg) { + this.gridActual = hpg; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() { + return staticText4; + } + + public void setStaticText4(StaticText st) { + this.staticText4 = st; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private Table table1 = new Table(); + + public Table getTable1() { + return table1; + } + + public void setTable1(Table t) { + this.table1 = t; + } + + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() { + return tableRowGroup1; + } + + public void setTableRowGroup1(TableRowGroup trg) { + this.tableRowGroup1 = trg; + } + + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() { + return tableColumn1; + } + + public void setTableColumn1(TableColumn tc) { + this.tableColumn1 = tc; + } + + private Hyperlink lnkDataAcidente = new Hyperlink(); + + public Hyperlink getLnkDataAcidente() { + return lnkDataAcidente; + } + + public void setLnkDataAcidente(Hyperlink h) { + this.lnkDataAcidente = h; + } + + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() { + return tableColumn2; + } + + public void setTableColumn2(TableColumn tc) { + this.tableColumn2 = tc; + } + + private Hyperlink lnkNr = new Hyperlink(); + + public Hyperlink getLnkNr() { + return lnkNr; + } + + public void setLnkNr(Hyperlink h) { + this.lnkNr = h; + } + + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() { + return tableColumn3; + } + + public void setTableColumn3(TableColumn tc) { + this.tableColumn3 = tc; + } + + private Hyperlink lnkNomeAcidentado = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentado() { + return lnkNomeAcidentado; + } + + public void setLnkNomeAcidentado(Hyperlink h) { + this.lnkNomeAcidentado = h; + } + + private HtmlPanelGrid gridSeguimento = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSeguimento() { + return gridSeguimento; + } + + public void setGridSeguimento(HtmlPanelGrid hpg) { + this.gridSeguimento = hpg; + } + + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; + } + + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private Table table2 = new Table(); + + public Table getTable2() { + return table2; + } + + public void setTable2(Table t) { + this.table2 = t; + } + + private TableRowGroup tableRowGroup2 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup2() { + return tableRowGroup2; + } + + public void setTableRowGroup2(TableRowGroup trg) { + this.tableRowGroup2 = trg; + } + + private TableColumn tableColumn4 = new TableColumn(); + + public TableColumn getTableColumn4() { + return tableColumn4; + } + + public void setTableColumn4(TableColumn tc) { + this.tableColumn4 = tc; + } + + private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); + + public Hyperlink getLnkDataAcidenteSeg() { + return lnkDataAcidenteSeg; + } + + public void setLnkDataAcidenteSeg(Hyperlink h) { + this.lnkDataAcidenteSeg = h; + } + + private TableColumn tableColumn5 = new TableColumn(); + + public TableColumn getTableColumn5() { + return tableColumn5; + } + + public void setTableColumn5(TableColumn tc) { + this.tableColumn5 = tc; + } + + private Hyperlink lnkNrSeg = new Hyperlink(); + + public Hyperlink getLnkNrSeg() { + return lnkNrSeg; + } + + public void setLnkNrSeg(Hyperlink h) { + this.lnkNrSeg = h; + } + + private TableColumn tableColumn6 = new TableColumn(); + + public TableColumn getTableColumn6() { + return tableColumn6; + } + + public void setTableColumn6(TableColumn tc) { + this.tableColumn6 = tc; + } + + private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentadoSeg() { + return lnkNomeAcidentadoSeg; + } + + public void setLnkNomeAcidentadoSeg(Hyperlink h) { + this.lnkNomeAcidentadoSeg = h; + } + + private HtmlPanelGrid gridConcluidos = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos() { + return gridConcluidos; + } + + public void setGridConcluidos(HtmlPanelGrid hpg) { + this.gridConcluidos = hpg; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() { + return gridPanel7; + } + + public void setGridPanel7(HtmlPanelGrid hpg) { + this.gridPanel7 = hpg; + } + + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() { + return groupPanel3; + } + + public void setGroupPanel3(PanelGroup pg) { + this.groupPanel3 = pg; + } + + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() { + return staticText8; + } + + public void setStaticText8(StaticText st) { + this.staticText8 = st; + } + + private DropDown drpAno = new DropDown(); + + public DropDown getDrpAno() { + return drpAno; + } + + public void setDrpAno(DropDown dd) { + this.drpAno = dd; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private StaticText lblMes = new StaticText(); + + public StaticText getLblMes() { + return lblMes; + } + + public void setLblMes(StaticText st) { + this.lblMes = st; + } + + private DropDown drpMes = new DropDown(); + + public DropDown getDrpMes() { + return drpMes; + } + + public void setDrpMes(DropDown dd) { + this.drpMes = dd; + } + + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() { + return groupPanel5; + } + + public void setGroupPanel5(PanelGroup pg) { + this.groupPanel5 = pg; + } + + private StaticText lblDia = new StaticText(); + + public StaticText getLblDia() { + return lblDia; + } + + public void setLblDia(StaticText st) { + this.lblDia = st; + } + + private DropDown drpDia = new DropDown(); + + public DropDown getDrpDia() { + return drpDia; + } + + public void setDrpDia(DropDown dd) { + this.drpDia = dd; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private TextField txtNome = new TextField(); + + public TextField getTxtNome() { + return txtNome; + } + + public void setTxtNome(TextField tf) { + this.txtNome = tf; + } + + private Button butPesquisar = new Button(); + + public Button getButPesquisar() { + return butPesquisar; + } + + public void setButPesquisar(Button b) { + this.butPesquisar = b; + } + + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() { + return gridPanel8; + } + + public void setGridPanel8(HtmlPanelGrid hpg) { + this.gridPanel8 = hpg; + } + + private Table table3 = new Table(); + + public Table getTable3() { + return table3; + } + + public void setTable3(Table t) { + this.table3 = t; + } + + private TableRowGroup tableRowGroup3 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup3() { + return tableRowGroup3; + } + + public void setTableRowGroup3(TableRowGroup trg) { + this.tableRowGroup3 = trg; + } + + private TableColumn tableColumn7 = new TableColumn(); + + public TableColumn getTableColumn7() { + return tableColumn7; + } + + public void setTableColumn7(TableColumn tc) { + this.tableColumn7 = tc; + } + + private Hyperlink lnkDataConcluida = new Hyperlink(); + + public Hyperlink getLnkDataConcluida() { + return lnkDataConcluida; + } + + public void setLnkDataConcluida(Hyperlink h) { + this.lnkDataConcluida = h; + } + + private TableColumn tableColumn8 = new TableColumn(); + + public TableColumn getTableColumn8() { + return tableColumn8; + } + + public void setTableColumn8(TableColumn tc) { + this.tableColumn8 = tc; + } + + private Hyperlink lnkNrConcluida = new Hyperlink(); + + public Hyperlink getLnkNrConcluida() { + return lnkNrConcluida; + } + + public void setLnkNrConcluida(Hyperlink h) { + this.lnkNrConcluida = h; + } + + private TableColumn tableColumn9 = new TableColumn(); + + public TableColumn getTableColumn9() { + return tableColumn9; + } + + public void setTableColumn9(TableColumn tc) { + this.tableColumn9 = tc; + } + + private Hyperlink lnkNomeConcluida = new Hyperlink(); + + public Hyperlink getLnkNomeConcluida() { + return lnkNomeConcluida; + } + + public void setLnkNomeConcluida(Hyperlink h) { + this.lnkNomeConcluida = h; + } + + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() { + return txtSearchMsg; + } + + public void setTxtSearchMsg(StaticText st) { + this.txtSearchMsg = st; + } + + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() { + return tableColumn10; + } + + public void setTableColumn10(TableColumn tc) { + this.tableColumn10 = tc; + } + + private Hyperlink lnkFase = new Hyperlink(); + + public Hyperlink getLnkFase() { + return lnkFase; + } + + public void setLnkFase(Hyperlink h) { + this.lnkFase = h; + } + + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() { + return tableColumn11; + } + + public void setTableColumn11(TableColumn tc) { + this.tableColumn11 = tc; + } + + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() { + return lnkFaseSeg; + } + + public void setLnkFaseSeg(Hyperlink h) { + this.lnkFaseSeg = h; + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public FormMedico() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("FormMedico Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + //lblActivos.setRendered(true); + table1.setRendered(true); + + //ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(5)); + ArrayList actuaisList = adp.getAnalisesActuaisMedicoList( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); + getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); + } + catch(Exception ex) + { + //lblActivos.setRendered(false); + table1.setRendered(false); + ex.printStackTrace(); + } + + table2.setRendered(false); + + try + { + //lblActivos.setRendered(true); + table2.setRendered(true); + + ArrayList seguimentoList = adp.getAnalisesSeguimentoMedList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList); + } + catch(Exception ex) + { + //lblActivos.setRendered(false); + table2.setRendered(false); + ex.printStackTrace(); + } + + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + if(!pageFrom.matches("FormMedico.jsp")) + { + + try + { + //lblActivos.setRendered(true); + table3.setRendered(true); + + ArrayList concluidasList = adp.getAnalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); + getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); + } + catch(Exception ex) + { + //lblActivos.setRendered(false); + table3.setRendered(false); + ex.printStackTrace(); + } + fillAnoDropDown(); + } + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String lnkEditUser_action() { + // TODO: Replace with your code + + getSessionBean1().setNavFrom("FormMedico"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + } + + public String lnkLogout_action() { + // TODO: Replace with your code + + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + return "login"; + } + + public String lnkDataAcidente_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "analise_acidente"; + } + + public String lnkNr_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "analise_acidente"; + } + + public String lnkNomeAcidentado_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "analise_acidente"; + } + + private AnaliseAcidente getTableActivosRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + AnalisesActualDataProvider provider = (AnalisesActualDataProvider) tableRowGroup1.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + AnaliseAcidente a = (AnaliseAcidente)list.get(k); + return a; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + AnalisesConcluidasDataProvider provider = (AnalisesConcluidasDataProvider) tableRowGroup3.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + AnaliseAcidente a = (AnaliseAcidente)list.get(k); + return a; + } + + public String lnkDataAcidenteSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + + public String lnkNrSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + + private AnaliseAcidente getTableSeguimentoRowData() + { + RowKey rk = tableRowGroup2.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + AnalisesSeguimentoDataProvider provider = (AnalisesSeguimentoDataProvider) tableRowGroup2.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + AnaliseAcidente a = (AnaliseAcidente)list.get(k); + return a; + } + + public void drpAno_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Object ano = event.getNewValue(); + if(ano == null) + { + lblMes.setVisible(false); + drpMes.setVisible(false); + lblDia.setVisible(false); + drpDia.setVisible(false); + } + else + { + lblMes.setVisible(true); + drpMes.setVisible(true); + fillMesDropDown(); + } + } + + public void drpMes_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + Object mes = event.getNewValue(); + if(mes == null) + { + lblDia.setVisible(false); + drpDia.setVisible(false); + } + else + { + lblDia.setVisible(true); + drpDia.setVisible(true); + fillDiaDropDown(); + } + } + + public void drpDia_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public String butPesquisar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + Object obAno = null; + Object obMes = null; + Object obDia = null; + try + { + obAno = drpAno.getSelected(); + obMes = drpMes.getSelected(); + obDia = drpDia.getSelected(); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + Integer ano = null; + Integer mes = null; + Integer dia = null; + + if(obAno != null) + { + ano = (Integer) obAno; + } + + if(obMes != null) + { + mes = (Integer) obMes; + } + + if(obDia != null) + { + dia = (Integer) obDia; + } + + String nome = null; + if(txtNome.getText() != null) + { + nome = (String) txtNome.getText(); + } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + + //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); + ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, nome); + + table3.setRendered(true); + txtSearchMsg.setRendered(false); + getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); + + + } + catch(Exception ex) + { + table3.setRendered(false); + txtSearchMsg.setRendered(true); + txtSearchMsg.setText("Não foram encontrados registos para a sua pesquisa !"); + ex.printStackTrace(); + } + return null; + } + + private void fillAnoDropDown() + { + ArrayList anosList = new ArrayList(); + for(int ano=2007; ano<2051; ano++) + { + anosList.add(new Integer(ano)); + } + com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[anosList.size()+1]; + anoOptions[0] = new Option("", ""); + ListIterator iter = anosList.listIterator(); + int i = 1; + while(iter.hasNext()) + { + Integer ano = (Integer) iter.next(); + + anoOptions[i] = new Option(ano, ano.toString()); + i++; + } + getSessionBean1().setAnoOptions(anoOptions); + Calendar cal = new GregorianCalendar(); + int year = cal.get(Calendar.YEAR); + //drpAno.setSelected( new Integer(year) ); + } + + private void fillMesDropDown() + { + com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[13]; + mesOptions[0] = new Option("", ""); + mesOptions[1] = new Option(new Integer(1), "Janeiro"); + mesOptions[2] = new Option(new Integer(2), "Fevereiro"); + mesOptions[3] = new Option(new Integer(3), "Março"); + mesOptions[4] = new Option(new Integer(4), "Abril"); + mesOptions[5] = new Option(new Integer(5), "Maio"); + mesOptions[6] = new Option(new Integer(6), "Junho"); + mesOptions[7] = new Option(new Integer(7), "Julho"); + mesOptions[8] = new Option(new Integer(8), "Agosto"); + mesOptions[9] = new Option(new Integer(9), "Setembro"); + mesOptions[10] = new Option(new Integer(10), "Outubro"); + mesOptions[11] = new Option(new Integer(11), "Novembro"); + mesOptions[12] = new Option(new Integer(12), "Dezembro"); + getSessionBean1().setMesOptions(mesOptions); + Calendar cal = new GregorianCalendar(); + int month = cal.get(Calendar.MONTH); // 0=Jan, 1=Feb, ... + //drpMes.setSelected( new Integer(month+1) ); + } + + private void fillDiaDropDown() + { + + } + + public String lnkDataConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + + public String lnkNrConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + + public String lnkNomeConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + + public String lnkFase_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "analise_acidente"; + } + + public String lnkFaseSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + +} + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java index 8b7a3c44..470eabf9 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java @@ -26,6 +26,7 @@ import com.sun.rave.web.ui.component.TableRowGroup; import com.sun.rave.web.ui.component.TextField; import com.sun.rave.web.ui.model.Option; import db.AnalisesActualDataProvider; +import db.AnalisesConcluidasDataProvider; import db.AnalisesDataProvider; import db.AnalisesSeguimentoDataProvider; import java.util.ArrayList; @@ -36,6 +37,7 @@ import javax.faces.FacesException; import javax.faces.component.html.HtmlPanelGrid; import javax.faces.event.ValueChangeEvent; import javax.servlet.http.HttpServletRequest; +import utils.Utils; /** *

Page bean that corresponds to a similarly named JSP page. This @@ -206,14 +208,14 @@ public class FormRH extends AbstractPageBean { this.staticText1 = st; } - private Hyperlink lnkChangePassword1 = new Hyperlink(); + private Hyperlink lnkEditUser = new Hyperlink(); - public Hyperlink getLnkChangePassword1() { - return lnkChangePassword1; + public Hyperlink getLnkEditUser() { + return lnkEditUser; } - public void setLnkChangePassword1(Hyperlink h) { - this.lnkChangePassword1 = h; + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; } private StaticText staticText2 = new StaticText(); @@ -236,16 +238,6 @@ public class FormRH extends AbstractPageBean { this.lnkLogout = h; } - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); public HtmlPanelGrid getGridLayoutTop1() { @@ -716,14 +708,14 @@ public class FormRH extends AbstractPageBean { this.tableColumn7 = tc; } - private Hyperlink hyperlink1 = new Hyperlink(); + private Hyperlink lnkDataConcluida = new Hyperlink(); - public Hyperlink getHyperlink1() { - return hyperlink1; + public Hyperlink getLnkDataConcluida() { + return lnkDataConcluida; } - public void setHyperlink1(Hyperlink h) { - this.hyperlink1 = h; + public void setLnkDataConcluida(Hyperlink h) { + this.lnkDataConcluida = h; } private TableColumn tableColumn8 = new TableColumn(); @@ -736,14 +728,14 @@ public class FormRH extends AbstractPageBean { this.tableColumn8 = tc; } - private Hyperlink hyperlink2 = new Hyperlink(); + private Hyperlink lnkNrConcluida = new Hyperlink(); - public Hyperlink getHyperlink2() { - return hyperlink2; + public Hyperlink getLnkNrConcluida() { + return lnkNrConcluida; } - public void setHyperlink2(Hyperlink h) { - this.hyperlink2 = h; + public void setLnkNrConcluida(Hyperlink h) { + this.lnkNrConcluida = h; } private TableColumn tableColumn9 = new TableColumn(); @@ -756,14 +748,14 @@ public class FormRH extends AbstractPageBean { this.tableColumn9 = tc; } - private Hyperlink hyperlink3 = new Hyperlink(); + private Hyperlink lnkNomeConcluida = new Hyperlink(); - public Hyperlink getHyperlink3() { - return hyperlink3; + public Hyperlink getLnkNomeConcluida() { + return lnkNomeConcluida; } - public void setHyperlink3(Hyperlink h) { - this.hyperlink3 = h; + public void setLnkNomeConcluida(Hyperlink h) { + this.lnkNomeConcluida = h; } private StaticText txtSearchMsg = new StaticText(); @@ -775,6 +767,46 @@ public class FormRH extends AbstractPageBean { public void setTxtSearchMsg(StaticText st) { this.txtSearchMsg = st; } + + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() { + return tableColumn10; + } + + public void setTableColumn10(TableColumn tc) { + this.tableColumn10 = tc; + } + + private Hyperlink lnkFase = new Hyperlink(); + + public Hyperlink getLnkFase() { + return lnkFase; + } + + public void setLnkFase(Hyperlink h) { + this.lnkFase = h; + } + + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() { + return tableColumn11; + } + + public void setTableColumn11(TableColumn tc) { + this.tableColumn11 = tc; + } + + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() { + return lnkFaseSeg; + } + + public void setLnkFaseSeg(Hyperlink h) { + this.lnkFaseSeg = h; + } // @@ -854,7 +886,8 @@ public class FormRH extends AbstractPageBean { //lblActivos.setRendered(true); table1.setRendered(true); - ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); + //ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); + ArrayList actuaisList = adp.getAnalisesActuaisRhList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); } catch(Exception ex) @@ -869,7 +902,7 @@ public class FormRH extends AbstractPageBean { //lblActivos.setRendered(true); table2.setRendered(true); - ArrayList seguimentoList = adp.getAnalisesSeguimentoList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(2)); + ArrayList seguimentoList = adp.getAnalisesSeguimentoRhList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList); } catch(Exception ex) @@ -881,7 +914,7 @@ public class FormRH extends AbstractPageBean { HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); String referer = request.getRequestURI(); - String pageFrom = getPageFrom(referer); + String pageFrom = Utils.getPageFrom(referer); if(!pageFrom.matches("FormRH.jsp")) { @@ -956,7 +989,7 @@ public class FormRH extends AbstractPageBean { AnaliseAcidente a = getTableActivosRowData(); getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); + getSessionBean1().setNavFrom("FormRH"); return "analise_acidente"; } @@ -965,7 +998,7 @@ public class FormRH extends AbstractPageBean { AnaliseAcidente a = getTableActivosRowData(); getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); + getSessionBean1().setNavFrom("FormRH"); return "analise_acidente"; } @@ -974,7 +1007,7 @@ public class FormRH extends AbstractPageBean { AnaliseAcidente a = getTableActivosRowData(); getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); + getSessionBean1().setNavFrom("FormRH"); return "analise_acidente"; } @@ -1024,7 +1057,17 @@ public class FormRH extends AbstractPageBean { ArrayList list = (ArrayList) provider.getList(); AnaliseAcidente a = (AnaliseAcidente)list.get(k); return a; - } + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + AnalisesConcluidasDataProvider provider = (AnalisesConcluidasDataProvider) tableRowGroup3.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + AnaliseAcidente a = (AnaliseAcidente)list.get(k); + return a; + } public void drpAno_processValueChange(ValueChangeEvent event) { // TODO: Replace with your code @@ -1132,11 +1175,11 @@ public class FormRH extends AbstractPageBean { return null; } - private String getPageFrom(String referer) - { - String pageFrom = referer.substring(referer.lastIndexOf("/")+1); - return pageFrom; - } +// private String getPageFrom(String referer) +// { +// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); +// return pageFrom; +// } private void fillAnoDropDown() { @@ -1236,5 +1279,57 @@ public class FormRH extends AbstractPageBean { // int day = cal.get(Calendar.DAY_OF_MONTH); // drpDia.setSelected( new Integer(0) ); } + + public String lnkEditUser_action() { + // TODO: Replace with your code + getSessionBean1().setNavFrom("FormRH"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + } + + public String lnkDataConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormRH"); + return "view_analise"; + } + + public String lnkNrConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormRH"); + return "view_analise"; + } + + public String lnkNomeConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormRH"); + return "view_analise"; + } + + public String lnkFase_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormRH"); + return "analise_acidente"; + } + + public String lnkFaseSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormSeguranca.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormSeguranca.java index d4c978b9..55b895f9 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormSeguranca.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormSeguranca.java @@ -26,6 +26,7 @@ import com.sun.rave.web.ui.component.TableRowGroup; import com.sun.rave.web.ui.component.TextField; import com.sun.rave.web.ui.model.Option; import db.AnalisesActualDataProvider; +import db.AnalisesConcluidasDataProvider; import db.AnalisesDataProvider; import db.AnalisesSeguimentoDataProvider; import java.util.ArrayList; @@ -36,6 +37,7 @@ import javax.faces.FacesException; import javax.faces.component.html.HtmlPanelGrid; import javax.faces.event.ValueChangeEvent; import javax.servlet.http.HttpServletRequest; +import utils.Utils; /** *

Page bean that corresponds to a similarly named JSP page. This @@ -656,14 +658,14 @@ public class FormSeguranca extends AbstractPageBean { this.staticText18 = st; } - private Hyperlink lnkChangePassword = new Hyperlink(); + private Hyperlink lnkEditUser = new Hyperlink(); - public Hyperlink getLnkChangePassword() { - return lnkChangePassword; + public Hyperlink getLnkEditUser() { + return lnkEditUser; } - public void setLnkChangePassword(Hyperlink h) { - this.lnkChangePassword = h; + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; } private StaticText staticText19 = new StaticText(); @@ -746,34 +748,34 @@ public class FormSeguranca extends AbstractPageBean { this.lnkNomeAcidentadoSeg = h; } - private Hyperlink hyperlink7 = new Hyperlink(); + private Hyperlink lnkDataConcluida = new Hyperlink(); - public Hyperlink getHyperlink7() { - return hyperlink7; + public Hyperlink getLnkDataConcluida() { + return lnkDataConcluida; } - public void setHyperlink7(Hyperlink h) { - this.hyperlink7 = h; + public void setLnkDataConcluida(Hyperlink h) { + this.lnkDataConcluida = h; } - private Hyperlink hyperlink8 = new Hyperlink(); + private Hyperlink lnkNrConcluida = new Hyperlink(); - public Hyperlink getHyperlink8() { - return hyperlink8; + public Hyperlink getLnkNrConcluida() { + return lnkNrConcluida; } - public void setHyperlink8(Hyperlink h) { - this.hyperlink8 = h; + public void setLnkNrConcluida(Hyperlink h) { + this.lnkNrConcluida = h; } - private Hyperlink hyperlink9 = new Hyperlink(); + private Hyperlink lnkNomeConcluida = new Hyperlink(); - public Hyperlink getHyperlink9() { - return hyperlink9; + public Hyperlink getLnkNomeConcluida() { + return lnkNomeConcluida; } - public void setHyperlink9(Hyperlink h) { - this.hyperlink9 = h; + public void setLnkNomeConcluida(Hyperlink h) { + this.lnkNomeConcluida = h; } private StaticText txtSearchMsg = new StaticText(); @@ -786,14 +788,44 @@ public class FormSeguranca extends AbstractPageBean { this.txtSearchMsg = st; } - private StaticText staticText5 = new StaticText(); + private TableColumn tableColumn10 = new TableColumn(); - public StaticText getStaticText5() { - return staticText5; + public TableColumn getTableColumn10() { + return tableColumn10; } - public void setStaticText5(StaticText st) { - this.staticText5 = st; + public void setTableColumn10(TableColumn tc) { + this.tableColumn10 = tc; + } + + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() { + return tableColumn11; + } + + public void setTableColumn11(TableColumn tc) { + this.tableColumn11 = tc; + } + + private Hyperlink lnkFase = new Hyperlink(); + + public Hyperlink getLnkFase() { + return lnkFase; + } + + public void setLnkFase(Hyperlink h) { + this.lnkFase = h; + } + + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() { + return lnkFaseSeg; + } + + public void setLnkFaseSeg(Hyperlink h) { + this.lnkFaseSeg = h; } // @@ -875,7 +907,8 @@ public class FormSeguranca extends AbstractPageBean { //lblActivos.setRendered(true); table1.setRendered(true); - ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(1)); + //ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(1)); + ArrayList actuaisList = adp.getAnalisesActuaisSegList( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); } catch(Exception ex) @@ -890,7 +923,7 @@ public class FormSeguranca extends AbstractPageBean { //lblActivos.setRendered(true); table2.setRendered(true); - ArrayList seguimentoList = adp.getAnalisesSeguimentoList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(1)); + ArrayList seguimentoList = adp.getAnalisesSeguimentoSegList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList); } catch(Exception ex) @@ -902,7 +935,7 @@ public class FormSeguranca extends AbstractPageBean { HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); String referer = request.getRequestURI(); - String pageFrom = getPageFrom(referer); + String pageFrom = Utils.getPageFrom(referer); if(!pageFrom.matches("FormSeguranca.jsp")) { @@ -1178,11 +1211,11 @@ public class FormSeguranca extends AbstractPageBean { } - private String getPageFrom(String referer) - { - String pageFrom = referer.substring(referer.lastIndexOf("/")+1); - return pageFrom; - } +// private String getPageFrom(String referer) +// { +// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); +// return pageFrom; +// } public String butNovaAnalise_action() { // TODO: Process the button click action. Return value is a navigation @@ -1264,6 +1297,63 @@ public class FormSeguranca extends AbstractPageBean { AnaliseAcidente a = (AnaliseAcidente)list.get(k); return a; } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + AnalisesConcluidasDataProvider provider = (AnalisesConcluidasDataProvider) tableRowGroup3.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + AnaliseAcidente a = (AnaliseAcidente)list.get(k); + return a; + } + + public String lnkEditUser_action() { + // TODO: Replace with your code + getSessionBean1().setNavFrom("FormSeguranca"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + } + + public String lnkDataConcluida_action() { + // TODO: Replace with your code + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } + + public String lnkNrConcluida_action() { + // TODO: Replace with your code + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } + + public String lnkNomeConcluida_action() { + // TODO: Replace with your code + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } + + public String lnkFase_action() { + // TODO: Replace with your code + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "analise_acidente"; + } + + public String lnkFaseSeg_action() { + // TODO: Replace with your code + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java index 51f5a432..a38ebb06 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java @@ -18,6 +18,8 @@ import com.sun.rave.web.ui.component.Page; import com.sun.rave.web.ui.component.PasswordField; import com.sun.rave.web.ui.component.StaticText; import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.AnalisesDataProvider; import db.UtilizadoresDataProvider; import java.sql.Connection; import javax.faces.FacesException; @@ -295,6 +297,7 @@ public class Login extends AbstractPageBean { * this page.

*/ public void prerender() { + txtMsg.setText(getSessionBean1().getMsg()); getSessionBean1().setMsg(""); } @@ -350,49 +353,68 @@ public class Login extends AbstractPageBean { try { Utilizador u = udp.getUtilizador(utilizador); - if(!password.equals(u.getPassword())) - { - getSessionBean1().setMsg("Palavra-chave inválida !"); - } - else + if(u.getActivo().matches("y")) { - //if(u.getOwner_id().intValue() == 0 ) - - //Login Ok ! - - try + if(!password.equals(u.getPassword())) + { + getSessionBean1().setMsg("Palavra-chave inválida !"); + } + else { - Integer permissao = udp.getPermissionCode(u.getId()); - if(permissao.intValue() == 1) //seguranca + //if(u.getOwner_id().intValue() == 0 ) + + //Login Ok ! + + try { - sRet = "form_seguranca"; + Integer permissao = udp.getPermissionCode(u.getId()); + if(permissao.intValue() == 1) //seguranca + { + sRet = "form_seguranca"; + } + else if(permissao.intValue() == 2) // rh + { + sRet = "form_rh"; + } + else if(permissao.intValue() == 3) // hs + { + System.out.println("PERMISSAO : HS"); + sRet = "form_hs"; + } + else if(permissao.intValue() == 5) // medico + { + sRet = "form_medico"; + } + else if(permissao.intValue() == 6) // administrador de loja + { + //sRet = "loja_admin"; + } + u.setCodigo_permissao(permissao); + getSessionBean1().setCurrentUser( u ); + getSessionBean1().setLoggedIn(true); + initializeClock(); + initializeDropDownOptions(); + + // só para testes. retirar depois : + ///getSessionBean1().setModoEdicaoUtilizador("new"); + ///sRet = "create_user"; } - else if(permissao.intValue() == 2) // rh + catch(Exception e1) { - sRet = "form_rh"; + e1.printStackTrace(); + getSessionBean1().setMsg("Não tem permissão para entrar na aplicação !"); } - else if(permissao.intValue() == 3) // hs - { - sRet = "form_hs"; - } - else if(permissao.intValue() == 5) // medico - { - //sRet = "form_rh"; - } - u.setCodigo_permissao(permissao); - getSessionBean1().setCurrentUser( u ); - getSessionBean1().setLoggedIn(true); - } - catch(Exception e1) - { - e1.printStackTrace(); - getSessionBean1().setMsg("Não tem permissão para entrar na aplicação !"); - } + } + + } + else + { + getSessionBean1().setMsg("Utilizador inválido ! "); } } catch(Exception ex) { - getSessionBean1().setMsg("Utilizador inválido ! " + ex.getMessage()); + getSessionBean1().setMsg("Utilizador inválido ! "); } } else @@ -419,7 +441,7 @@ public class Login extends AbstractPageBean { public String lnkPassRecovery_action() { // TODO: Replace with your code - + return "recuperar_password"; } @@ -443,5 +465,50 @@ public class Login extends AbstractPageBean { ex.printStackTrace(); } } + + private void initializeClock() + { + com.sun.rave.web.ui.model.Option[] horasOptions = new com.sun.rave.web.ui.model.Option[24]; + for(int i=0; i < 24; i++) + { + + horasOptions[i] = new Option(new Integer(i), new Integer(i).toString()); + } + getSessionBean1().setHorasOptions(horasOptions); + + com.sun.rave.web.ui.model.Option[] minutosOptions = new com.sun.rave.web.ui.model.Option[12]; + int j = 0; + for(int i=0; i < 12; i++) + { + + minutosOptions[i] = new Option(new Integer(j), new Integer(j).toString()); + j += 5; + } + getSessionBean1().setMinutosOptions(minutosOptions); + } + + private void initializeDropDownOptions() + { + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + getSessionBean1().setTecnicosOptions(udp.getTecnicosSaudeList()); + //drpTipo.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + getSessionBean1().setMedicosOptions(udp.getMedicosList()); + //drpTipo.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java new file mode 100644 index 00000000..257089e6 --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java @@ -0,0 +1,53 @@ +/* + * Medico.java + * + * Created on October 12, 2007, 11:00 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class Medico { + private Integer id; + private String nome; + private String numero_cedula; + + /** Creates a new instance of Medico */ + public Medico() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getNumero_cedula() { + return numero_cedula; + } + + public void setNumero_cedula(String numero_cedula) { + this.numero_cedula = numero_cedula; + } + + public String toString() { + return utils.Utils.unicodeToHTML(nome); + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java new file mode 100644 index 00000000..5fe9c763 --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java @@ -0,0 +1,49 @@ +/* + * Medida.java + * + * Created on October 19, 2007, 4:59 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class Medida { + private Integer id; + private Integer analise_id; + private String medida; + + /** Creates a new instance of Medida */ + public Medida() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getAnalise_id() { + return analise_id; + } + + public void setAnalise_id(Integer analise_id) { + this.analise_id = analise_id; + } + + public String getMedida() { + return medida; + } + + public void setMedida(String medida) { + this.medida = medida; + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java new file mode 100644 index 00000000..31b0be5b --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java @@ -0,0 +1,49 @@ +/* + * Permissao.java + * + * Created on October 25, 2007, 4:40 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class Permissao { + private Integer id; + private Integer user_id; + private Integer codigo_permissao; + + /** Creates a new instance of Permissao */ + public Permissao() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getUser_id() { + return user_id; + } + + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + public Integer getCodigo_permissao() { + return codigo_permissao; + } + + public void setCodigo_permissao(Integer codigo_permissao) { + this.codigo_permissao = codigo_permissao; + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java new file mode 100644 index 00000000..85aea13e --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java @@ -0,0 +1,49 @@ +/* + * Recomendacao.java + * + * Created on October 16, 2007, 3:13 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class Recomendacao { + private Integer id; + private Integer analise_id; + private String recomendacao; + + /** Creates a new instance of Recomendacao */ + public Recomendacao() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getAnalise_id() { + return analise_id; + } + + public void setAnalise_id(Integer analise_id) { + this.analise_id = analise_id; + } + + public String getRecomendacao() { + return recomendacao; + } + + public void setRecomendacao(String recomendacao) { + this.recomendacao = recomendacao; + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java index cbab194b..deb5b682 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java @@ -31,6 +31,7 @@ import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; +import utils.Utils; /** *

Page bean that corresponds to a similarly named JSP page. This @@ -292,13 +293,13 @@ public class RecuperarPassword extends AbstractPageBean { // Perform application initialization that must complete // *after* managed components are initialized // TODO - add your own initialization code here - if (!getSessionBean1().isLoggedIn()) { - try { - getExternalContext().redirect("Login.jsp"); - } catch(Exception e) { - // . . . handle exception . . . - } - } +// if (!getSessionBean1().isLoggedIn()) { +// try { +// getExternalContext().redirect("Login.jsp"); +// } catch(Exception e) { +// // . . . handle exception . . . +// } +// } } /** @@ -454,7 +455,6 @@ public class RecuperarPassword extends AbstractPageBean { private boolean fieldsValidationOk() { - if(txtUtilizador.getText() != null) { String utilizador = (String) txtUtilizador.getText(); @@ -480,7 +480,7 @@ public class RecuperarPassword extends AbstractPageBean { } else { - if(! isValidEmail(email)) + if(! Utils.isValidEmail(email)) { getSessionBean1().setMsg("Email inválido !"); return false; @@ -496,29 +496,29 @@ public class RecuperarPassword extends AbstractPageBean { return true; } - private boolean isValidEmail(String email){ - boolean res = true; - - int indexOfAtChar=email.indexOf("@"); - - if(indexOfAtChar > 0) - { - int indexOfDotChar = - email.indexOf(".",indexOfAtChar); - if(indexOfDotChar > 0) - { - res = true; - } - else - { - res = false; - } - } - else{ - res = false; - } - return res; - } +// private boolean isValidEmail(String email){ +// boolean res = true; +// +// int indexOfAtChar=email.indexOf("@"); +// +// if(indexOfAtChar > 0) +// { +// int indexOfDotChar = +// email.indexOf(".",indexOfAtChar); +// if(indexOfDotChar > 0) +// { +// res = true; +// } +// else +// { +// res = false; +// } +// } +// else{ +// res = false; +// } +// return res; +// } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java index f32cdeb1..d1a90ab0 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java @@ -48,6 +48,9 @@ public class SessionBean1 extends AbstractSessionBean { setAcidentado(null); setCurrentAnalise(null); setLoggedIn(false); + + modoEdicaoUtilizador = ""; + setIdSequence(1); } /** @@ -264,13 +267,13 @@ public class SessionBean1 extends AbstractSessionBean { this.navFrom = navFrom; } - private Trabalhador acidentado; + private Acidentado acidentado; - public Trabalhador getAcidentado() { + public Acidentado getAcidentado() { return acidentado; } - public void setAcidentado(Trabalhador acidentado) { + public void setAcidentado(Acidentado acidentado) { this.acidentado = acidentado; } @@ -305,5 +308,152 @@ public class SessionBean1 extends AbstractSessionBean { { this.loggedIn = loggedIn; } + + private String modoEdicaoUtilizador; + + public String getModoEdicaoUtilizador() { + return modoEdicaoUtilizador; + } + + public void setModoEdicaoUtilizador(String modoEdicaoUtilizador) { + this.modoEdicaoUtilizador = modoEdicaoUtilizador; + } + + private Integer tipoChoice; + + public Integer getTipoChoice() { + return tipoChoice; + } + + public void setTipoChoice(Integer tipoChoice) { + this.tipoChoice = tipoChoice; + } + + private com.sun.rave.web.ui.model.Option[] tiposOptions; + + public com.sun.rave.web.ui.model.Option[] getTiposOptions() { + return tiposOptions; + } + + public void setTiposOptions(com.sun.rave.web.ui.model.Option[] tiposOptions) { + this.tiposOptions = tiposOptions; + } + + + private Integer estabelecimentoChoice; + + public Integer getEstabelecimentoChoice() { + return estabelecimentoChoice; + } + + public void setEstabelecimentoChoice(Integer estabelecimentoChoice) { + this.estabelecimentoChoice = estabelecimentoChoice; + } + + private com.sun.rave.web.ui.model.Option[] estabelecimentosOptions; + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosOptions() { + return estabelecimentosOptions; + } + + public void setEstabelecimentosOptions(com.sun.rave.web.ui.model.Option[] estabelecimentosOptions) { + this.estabelecimentosOptions = estabelecimentosOptions; + } + + + private Integer tecnicoChoice; + + public Integer getTecnicoChoice() { + return tecnicoChoice; + } + + public void setTecnicoChoice(Integer tecnicoChoice) { + this.tecnicoChoice = tecnicoChoice; + } + + private com.sun.rave.web.ui.model.Option[] tecnicosOptions; + + public com.sun.rave.web.ui.model.Option[] getTecnicosOptions() { + return tecnicosOptions; + } + + public void setTecnicosOptions(com.sun.rave.web.ui.model.Option[] tecnicosOptions) { + this.tecnicosOptions = tecnicosOptions; + } + + + private Integer medicoChoice; + + public Integer getMedicoChoice() { + return medicoChoice; + } + + public void setMedicoChoice(Integer medicoChoice) { + this.medicoChoice = medicoChoice; + } + + private com.sun.rave.web.ui.model.Option[] medicosOptions; + + public com.sun.rave.web.ui.model.Option[] getMedicosOptions() { + return medicosOptions; + } + + public void setMedicosOptions(com.sun.rave.web.ui.model.Option[] medicosOptions) { + this.medicosOptions = medicosOptions; + } + + + // Clock : + private Integer horaChoice; + + public Integer getHoraChoice() { + return horaChoice; + } + + public void setHoraChoice(Integer horaChoice) { + this.horaChoice = horaChoice; + } + + private com.sun.rave.web.ui.model.Option[] horasOptions; + + public com.sun.rave.web.ui.model.Option[] getHorasOptions() { + return horasOptions; + } + + public void setHorasOptions(com.sun.rave.web.ui.model.Option[] horasOptions) { + this.horasOptions = horasOptions; + } + + + private Integer minutoChoice; + + public Integer getMinutoChoice() { + return minutoChoice; + } + + public void setMinutoChoice(Integer minutoChoice) { + this.minutoChoice = minutoChoice; + } + + private com.sun.rave.web.ui.model.Option[] minutosOptions; + + public com.sun.rave.web.ui.model.Option[] getMinutosOptions() { + return minutosOptions; + } + + public void setMinutosOptions(com.sun.rave.web.ui.model.Option[] minutosOptions) { + this.minutosOptions = minutosOptions; + } + + + private int idSequence; + + public int getIdSequence() { + return idSequence; + } + + public void setIdSequence(int idSequence) { + this.idSequence = idSequence; + } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java new file mode 100644 index 00000000..7980ae83 --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java @@ -0,0 +1,44 @@ +/* + * TecnicoSaude.java + * + * Created on October 12, 2007, 11:00 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class TecnicoSaude { + private Integer id; + private String nome; + + /** Creates a new instance of TecnicoSaude */ + public TecnicoSaude() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String toString() { + return utils.Utils.unicodeToHTML(nome); + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java new file mode 100644 index 00000000..749160c9 --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java @@ -0,0 +1,67 @@ +/* + * TipoUtilizador.java + * + * Created on October 11, 2007, 4:32 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class TipoUtilizador { + private Integer id; + private Integer tipo; + private String descricao; + private String activo; + private Integer ordem; + + /** Creates a new instance of TipoUtilizador */ + public TipoUtilizador() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getTipo() { + return tipo; + } + + public void setTipo(Integer tipo) { + this.tipo = tipo; + } + + public String getDescricao() { + return descricao; + } + + public void setDescricao(String descricao) { + this.descricao = descricao; + } + + public String getActivo() { + return activo; + } + + public void setActivo(String activo) { + this.activo = activo; + } + + public Integer getOrdem() { + return ordem; + } + + public void setOrdem(Integer ordem) { + this.ordem = ordem; + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java index 29192394..407b593e 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java @@ -17,6 +17,10 @@ public class Trabalhador { private Integer id; private String nome; private java.sql.Date data_nascimento; + private String funcao; + private java.sql.Date data_admissao; + private String numero_mecanografico; + /** Creates a new instance of Trabalhador */ public Trabalhador() { @@ -45,5 +49,29 @@ public class Trabalhador { public void setData_nascimento(java.sql.Date data_nascimento) { this.data_nascimento = data_nascimento; } + + public String getFuncao() { + return funcao; + } + + public void setFuncao(String funcao) { + this.funcao = funcao; + } + + public java.sql.Date getData_admissao() { + return data_admissao; + } + + public void setData_admissao(java.sql.Date data_admissao) { + this.data_admissao = data_admissao; + } + + public String getNumero_mecanografico() { + return numero_mecanografico; + } + + public void setNumero_mecanografico(String numero_mecanografico) { + this.numero_mecanografico = numero_mecanografico; + } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java index c364c689..c79482e6 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java @@ -21,9 +21,19 @@ public class Utilizador { private Integer empresa_id; private Integer estabelecimento_id; private String administrador; + private Integer tipo; + private String numero_cedula; + private String cap; private Integer codigo_permissao; + private String nome; + + private Integer medico_id; + private Integer funcionario_hst_id; + + private String activo; + /** Creates a new instance of Utilizador */ public Utilizador() { } @@ -91,5 +101,61 @@ public class Utilizador { public void setCodigo_permissao(Integer codigo_permissao) { this.codigo_permissao = codigo_permissao; } + + public Integer getTipo() { + return tipo; + } + + public void setTipo(Integer tipo) { + this.tipo = tipo; + } + + public String getNumero_cedula() { + return numero_cedula; + } + + public void setNumero_cedula(String numero_cedula) { + this.numero_cedula = numero_cedula; + } + + public String getCap() { + return cap; + } + + public void setCap(String cap) { + this.cap = cap; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public Integer getMedico_id() { + return medico_id; + } + + public void setMedico_id(Integer medico_id) { + this.medico_id = medico_id; + } + + public Integer getFuncionario_hst_id() { + return funcionario_hst_id; + } + + public void setFuncionario_hst_id(Integer funcionario_hst_id) { + this.funcionario_hst_id = funcionario_hst_id; + } + + public String getActivo() { + return activo; + } + + public void setActivo(String activo) { + this.activo = activo; + } } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java index 973f072e..ba65604d 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java @@ -9,7 +9,6 @@ package analiseacidentestrabalho; import com.sun.rave.web.ui.appbase.AbstractPageBean; import com.sun.rave.web.ui.component.Body; import com.sun.rave.web.ui.component.Button; -import com.sun.rave.web.ui.component.DropDown; import com.sun.rave.web.ui.component.Form; import com.sun.rave.web.ui.component.Head; import com.sun.rave.web.ui.component.Html; @@ -20,10 +19,14 @@ import com.sun.rave.web.ui.component.Page; import com.sun.rave.web.ui.component.PanelGroup; import com.sun.rave.web.ui.component.StaticText; import db.AnalisesDataProvider; +import db.UtilizadoresDataProvider; import java.io.File; +import java.util.ArrayList; +import java.util.ListIterator; import javax.faces.FacesException; import javax.faces.component.html.HtmlPanelGrid; import javax.servlet.ServletContext; +import utils.Utils; /** *

Page bean that corresponds to a similarly named JSP page. This @@ -174,14 +177,14 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean { this.groupPanel2 = pg; } - private StaticText lblUser1 = new StaticText(); + private StaticText lblUser = new StaticText(); - public StaticText getLblUser1() { - return lblUser1; + public StaticText getLblUser() { + return lblUser; } - public void setLblUser1(StaticText st) { - this.lblUser1 = st; + public void setLblUser(StaticText st) { + this.lblUser = st; } private StaticText staticText1 = new StaticText(); @@ -194,14 +197,14 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean { this.staticText1 = st; } - private Hyperlink lnkChangePassword1 = new Hyperlink(); + private Hyperlink lnkEditUser = new Hyperlink(); - public Hyperlink getLnkChangePassword1() { - return lnkChangePassword1; + public Hyperlink getLnkEditUser() { + return lnkEditUser; } - public void setLnkChangePassword1(Hyperlink h) { - this.lnkChangePassword1 = h; + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; } private StaticText staticText2 = new StaticText(); @@ -224,16 +227,6 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean { this.lnkLogout1 = h; } - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); public HtmlPanelGrid getGridMsg1() { @@ -534,46 +527,6 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean { this.gridPanel10 = hpg; } - private StaticText staticText14 = new StaticText(); - - public StaticText getStaticText14() { - return staticText14; - } - - public void setStaticText14(StaticText st) { - this.staticText14 = st; - } - - private StaticText txtNomeAcidentado = new StaticText(); - - public StaticText getTxtNomeAcidentado() { - return txtNomeAcidentado; - } - - public void setTxtNomeAcidentado(StaticText st) { - this.txtNomeAcidentado = st; - } - - private StaticText staticText15 = new StaticText(); - - public StaticText getStaticText15() { - return staticText15; - } - - public void setStaticText15(StaticText st) { - this.staticText15 = st; - } - - private StaticText txtDataNascimento = new StaticText(); - - public StaticText getTxtDataNascimento() { - return txtDataNascimento; - } - - public void setTxtDataNascimento(StaticText st) { - this.txtDataNascimento = st; - } - private StaticText staticText16 = new StaticText(); public StaticText getStaticText16() { @@ -824,36 +777,6 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean { this.staticText28 = st; } - private HtmlPanelGrid gridPanel22 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel22() { - return gridPanel22; - } - - public void setGridPanel22(HtmlPanelGrid hpg) { - this.gridPanel22 = hpg; - } - - private PanelGroup groupPanel5 = new PanelGroup(); - - public PanelGroup getGroupPanel5() { - return groupPanel5; - } - - public void setGroupPanel5(PanelGroup pg) { - this.groupPanel5 = pg; - } - - private Button butVoltar = new Button(); - - public Button getButVoltar() { - return butVoltar; - } - - public void setButVoltar(Button b) { - this.butVoltar = b; - } - private StaticText txtAccoes = new StaticText(); public StaticText getTxtAccoes() { @@ -995,208 +918,2066 @@ public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean { } // - private String IMAGE_URL = "/resources/images"; - /** - *

Construct a new Page bean instance.

- */ - public ViewAnaliseAcidenteTrabalho() { - } + private String IMAGE_URL = "/resources/images"; - /** - *

Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.

- * - *

Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.

- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - // - // Initialize automatically managed components - // *Note* - this logic should NOT be modified - try { - _init(); - } catch (Exception e) { - log("ViewAnaliseAcidenteTrabalho Initialization Failure", e); - throw e instanceof FacesException ? (FacesException) e: new FacesException(e); - } - - // - // Perform application initialization that must complete - // *after* managed components are initialized - // TODO - add your own initialization code here - - initializePage(); - } + private final static int IMAGE_WIDTH = 48; + private final static int IMAGE_HEIGHT = 48; - /** - *

Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.

- */ - public void preprocess() { + + private HtmlPanelGrid gridDadosAcidenteRhView1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRhView1() { + return gridDadosAcidenteRhView1; } - - /** - *

Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.

- */ - public void prerender() { + + public void setGridDadosAcidenteRhView1(HtmlPanelGrid hpg) { + this.gridDadosAcidenteRhView1 = hpg; } - - /** - *

Callback method that is called after rendering is completed for - * this request, if init() was called (regardless of whether - * or not this was the page that was actually rendered). Customize this - * method to release resources acquired in the init(), - * preprocess(), or prerender() methods (or - * acquired during execution of an event handler).

- */ - public void destroy() { + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; } - /** - *

Return a reference to the scoped data bean.

- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; } - /** - *

Return a reference to the scoped data bean.

- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; } - /** - *

Return a reference to the scoped data bean.

- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); + public void setStaticText5(StaticText st) { + this.staticText5 = st; } - public String lnkLogout_action() { - // TODO: Replace with your code - - return null; + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; } - public String lnkNome_action() { - // TODO: Replace with your code - - return null; + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; } - public String lnkDataNascimento_action() { - // TODO: Replace with your code - - return null; + private HtmlPanelGrid gridSHST = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSHST() { + return gridSHST; } - private void initializePage() - { - fillPage(); - fillImages(); + public void setGridSHST(HtmlPanelGrid hpg) { + this.gridSHST = hpg; } - - private void fillPage() - { - AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - txtEstabelecimento.setText(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - try - { - Trabalhador t = adp.getTrabalhador(a.getTrabalhador_id()); - txtDataNascimento.setText(t.getData_nascimento()); - getSessionBean1().setAcidentado(t); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - txtTrabalhador.setText(a.getNome_acidentado()); - txtNomeAcidentado.setText(a.getNome_acidentado()); - txtHorasTurno.setText(a.getHoras_turno().toString()); - txtSeccao.setText(a.getSeccao()); - txtLocal.setText(a.getLocal_trabalho()); - txtTarefa.setText(a.getTarefa()); - txtSubstancias.setText(a.getSubstancias()); - txtSuperior.setText(a.getSuperior_hierarquico()); - txtCondicoes.setText(a.getCondicoes()); - txtTestemunhas.setText(a.getTestemunhas()); - txtCausas.setText(a.getCausas()); - txtDescricao.setText(a.getDescricao()); - txtConclusoes.setText(a.getConclusoes()); - txtAccoes.setText(a.getAccoes()); - } - - private void fillImages() - { - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); - try - { - String imageFileFolder = theApplicationsServletContext.getRealPath(IMAGE_URL + "/" + getSessionBean1().getCurrentAnalise().getId()); - File f = new File(imageFileFolder); - if( f.exists() ) - { - File files[] = f.listFiles(); - for(int i=0;iConstruct a new Page bean instance.

+ */ + public ViewAnaliseAcidenteTrabalho() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("ViewAnaliseAcidenteTrabalho Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + initializePage(); + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String lnkLogout_action() { + // TODO: Replace with your code + + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + return "login"; + } + + public String lnkNome_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkDataNascimento_action() { + // TODO: Replace with your code + + return null; + } + + private void initializePage() + { + fillPage(); + fillImages(); + } + + private void fillPage() + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + + fillSIPRP(a); + + AnalisesDataProvider adp = new AnalisesDataProvider(); + Acidentado ac = null; + try + { + ac = adp.getAcidentado(a.getAcidentado_id()); + //txtTrabalhador.setText(ac.getNome()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + fillAcidentado(ac); + + fillDadosAcidenteSeg(a); + + fillDadosAcidenteRh(a); + + fillRecomendacoesHs(a); + + fillMedidasRh(a); + + fillMedico(a); + } + + private void fillSIPRP(AnaliseAcidente a) + { + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); + txtTecnicoSuperior.setText(Utils.unicodeToHTML(u.getNome())); + txtCap1.setText(u.getCap()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try + { + Utilizador u = udp.getUtilizador(a.getMedico_id()); + txtMedicoTrabalho.setText(Utils.unicodeToHTML(u.getNome())); + txtCedula1.setText(u.getNumero_cedula()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillAcidentado(Acidentado a) + { + stNomeAcidentado.setText(a.getNome()); + //stDataNascimento.setText(a.getData_nascimento()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_nascimento().getTime()); + stDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + stBI.setText(a.getBilhete_identidade()); + stMorada.setText(a.getMorada()); + String cod_postal1 = ""; + String cod_postal2 = ""; + try + { + cod_postal1 = a.getCod_postal().substring(0, 4); + } + catch(Exception ex){} + try + { + cod_postal2 = a.getCod_postal().substring(5, 8); + } + catch(Exception ex){} + + //String cod_postal1 = a.getCod_postal().substring(0, 4); + //String cod_postal2 = a.getCod_postal().substring(5, 8); + String cod_postal = cod_postal1 + "-" + cod_postal2 + " " + a.getLocalidade(); + stCodPostal.setText(cod_postal); + stContactoTelefonico.setText(a.getContacto_telefonico()); + //stDataAdmissao1.setText(a.getData_admissao()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_admissao().getTime()); + stDataAdmissao.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + stFuncao.setText(a.getFuncao()); + String turno_str = ""; + if(a.getTurno().matches("m")) + { + turno_str = "manhã"; + } + else if(a.getTurno().matches("t")) + { + turno_str += "tarde "; + } + if(a.getTurno().matches("n")) + { + turno_str += "noite"; + } + stTurno.setText(turno_str); + } + + private void fillDadosAcidenteSeg(AnaliseAcidente a) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); + txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try + { + txtEstabelecimento.setText(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + +// try +// { +// //Trabalhador t = adp.getTrabalhador(a.getTrabalhador_id()); +// Acidentado ac = adp.getAcidentado(a.getAcidentado_id()); +// //txtDataNascimento.setText(ac.getData_nascimento()); +// try +// { +// java.util.Date ddate = new java.util.Date(ac.getData_nascimento().getTime()); +// txtDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); +// } +// catch(Exception ex){}; +// getSessionBean1().setAcidentado(ac); +// } +// catch(Exception ex) +// { +// ex.printStackTrace(); +// } + + txtTrabalhador.setText(a.getNome_acidentado()); +// txtNomeAcidentado.setText(a.getNome_acidentado()); + txtHorasTurno.setText(a.getHoras_turno().toString()); + txtSeccao.setText(a.getSeccao()); + txtLocal.setText(a.getLocal_trabalho()); + txtTarefa.setText(a.getTarefa()); + txtSubstancias.setText(a.getSubstancias()); + txtSuperior.setText(a.getSuperior_hierarquico()); + txtCondicoes.setText(a.getCondicoes()); + txtTestemunhas.setText(a.getTestemunhas()); + txtCausas.setText(a.getCausas()); + txtDescricao.setText(a.getDescricao()); + txtConclusoes.setText(a.getConclusoes()); + txtAccoes.setText(a.getAccoes()); + } + + private void fillDadosAcidenteRh(AnaliseAcidente a) + { + StaticText st = new StaticText(); + st.setId("stSHST"); + st.setEscape(false); + + StaticText st1 = new StaticText(); + st1.setId("stColaborador"); + st1.setEscape(false); + + StaticText st2 = new StaticText(); + st2.setId("stColaboradores"); + st2.setEscape(false); + + if(a.getFormacao_shst().matches("y")) + { + st.setText("O colaborador teve formação em SHST."); + gridSHST.getChildren().add(st); + } + else + { + st.setText("O colaborador não teve formação em SHST."); + gridSHST.getChildren().add(st); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdMotivo"); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft5, gridColLeft95"); + StaticText s = new StaticText(); + s.setId("stMotivo"); + s.setEscape(false); + s.setText("Motivo: "); + grd.getChildren().add(s); + s = new StaticText(); + s.setId("stMotivo1"); + s.setEscape(false); + s.setText(a.getFormacao_shst_nao_porque()); + grd.getChildren().add(s); + gridSHST.getChildren().add(grd); + } + + + if(a.getOutros_acidentes_com_colaborador().matches("y")) + { + st1.setText("Verificaram-se outras ocurrências/inicidências no mesmo posto de trabalho com o colaborador acidentado."); + gridColaborador.getChildren().add(st1); + boolean booShow = false; + boolean booShow1 = false; + boolean booShow2 = false; + if(a.getNr_acidentes_com_colaborador() != null) + { + booShow = true; + booShow1 = true; + } + if(a.getNr_relatorio_acidente_colaborador1() != null || a.getNr_relatorio_acidente_colaborador2() != null || a.getNr_relatorio_acidente_colaborador3() != null || a.getNr_relatorio_acidente_colaborador4() != null) + { + booShow = true; + booShow2 = true; + } + + if(booShow) + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdColaboradorS"); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft15, gridColLeft85"); + if(booShow1) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId("s100"); + s.setEscape(false); + s.setText("Total:  "); + pg.getChildren().add(s); + s = new StaticText(); + s.setId("s101"); + s.setEscape(false); + s.setText(a.getNr_acidentes_com_colaborador().toString()); + pg.getChildren().add(s); + grd.getChildren().add(pg); + } + if(booShow2) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId("s102"); + s.setEscape(false); + s.setText("   Relatórios de acidente nº:  "); + pg.getChildren().add(s); + if(a.getNr_relatorio_acidente_colaborador1() != null) + { + if(a.getNr_relatorio_acidente_colaborador1().intValue() > 0) + { + s = new StaticText(); + s.setId("s103"); + s.setEscape(false); + s.setText(a.getNr_relatorio_acidente_colaborador1()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_colaborador2() != null) + { + if(a.getNr_relatorio_acidente_colaborador2().intValue() > 0) + { + s = new StaticText(); + s.setId("s104"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador2()); + pg.getChildren().add(s); + } + + } + if(a.getNr_relatorio_acidente_colaborador3() != null) + { + if(a.getNr_relatorio_acidente_colaborador3().intValue() > 0) + { + s = new StaticText(); + s.setId("s105"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador3()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_colaborador4() != null) + { + if(a.getNr_relatorio_acidente_colaborador4().intValue() > 0) + { + s = new StaticText(); + s.setId("s106"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador4()); + pg.getChildren().add(s); + } + } + grd.getChildren().add(pg); + } + gridColaborador.getChildren().add(grd); + } + + } + else + { + st1.setText("Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado."); + gridColaborador.getChildren().add(st1); + } + + if(a.getAcidentes_outros_colaboradores().matches("y")) + { + st2.setText("Verificaram-se ocorrências/incidentes semelhantes com outros colaboradores."); + gridColaboradores.getChildren().add(st2); + boolean booShow = false; + boolean booShow1 = false; + boolean booShow2 = false; + if(a.getNr_acidentes_outros_colaboradores() != null) + { + booShow = true; + booShow1 = true; + } + if(a.getNr_relatorio_acidente_outros_colaboradores1() != null || a.getNr_relatorio_acidente_outros_colaboradores2() != null || a.getNr_relatorio_acidente_outros_colaboradores3() != null || a.getNr_relatorio_acidente_outros_colaboradores4() != null) + { + booShow = true; + booShow2 = true; + } + + if(booShow) + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdColaboradoresS"); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft15, gridColLeft85"); + if(booShow1) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId("s200"); + s.setEscape(false); + s.setText("Total:  "); + pg.getChildren().add(s); + s = new StaticText(); + s.setId("s201"); + s.setEscape(false); + s.setText(a.getNr_acidentes_outros_colaboradores()); + pg.getChildren().add(s); + grd.getChildren().add(pg); + } + if(booShow2) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId("s202"); + s.setEscape(false); + s.setText("   Relatórios de acidente nº:  "); + pg.getChildren().add(s); + if(a.getNr_relatorio_acidente_outros_colaboradores1() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores1().intValue() > 0) + { + s = new StaticText(); + s.setId("s203"); + s.setEscape(false); + s.setText(a.getNr_relatorio_acidente_outros_colaboradores1()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores2() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores2().intValue() > 0) + { + s = new StaticText(); + s.setId("s204"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores2()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores3() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores3().intValue() > 0) + { + s = new StaticText(); + s.setId("s205"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores3()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores4() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores4().intValue() > 0) + { + s = new StaticText(); + s.setId("s206"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores4()); + pg.getChildren().add(s); + } + } + grd.getChildren().add(pg); + } + gridColaboradores.getChildren().add(grd); + } + } + else + { + st2.setText("Não se verificaram ocurrências/inicidentes com outros colaboradores."); + gridColaboradores.getChildren().add(st1); + } + } + + private void fillRecomendacoesHs(AnaliseAcidente a) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList list = adp.getRecomendacoesByAnalise(a.getId()); + ListIterator iter = list.listIterator(); + int seq = 1; + while(iter.hasNext()) + { + Recomendacao r = (Recomendacao) iter.next(); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdRecomendacaoView" + seq); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft5, gridColLeft95"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("stNrRecomendacaoView" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + st = new StaticText(); + st.setId("stRecomendacaoView" + seq); + st.setText(r.getRecomendacao()); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + gridRecomendacoesView.getChildren().add(grd); + seq++; + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillMedidasRh(AnaliseAcidente a) + { + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList list = adp.getMedidasByAnalise(a.getId()); + ListIterator iter = list.listIterator(); + int seq = 1; + while(iter.hasNext()) + { + Medida m = (Medida) iter.next(); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdMedidaView" + seq); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft5, gridColLeft95"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("stNrMedidaView" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + st = new StaticText(); + st.setId("stMedidaView" + seq); + st.setText(m.getMedida()); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + gridMedidasView.getChildren().add(grd); + seq++; + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillMedico(AnaliseAcidente a) + { + + PanelGroup pg = null; + StaticText st = null; + HtmlPanelGrid grd = null; + ImageComponent img = null; + //LESAO : + + if(a.getLesao_cabeca().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoCabeca"); + st.setEscape(false); + st.setText("Cabeça"); + gridLesao.getChildren().add(st); + } + + if(a.getLesao_pescoco().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoPescoco"); + st.setEscape(false); + st.setText("Pescoço"); + gridLesao.getChildren().add(st); + } + + if(a.getLesao_tronco().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoTronco"); + st.setEscape(false); + st.setText("Tronco"); + gridLesao.getChildren().add(st); + } + + grd = new HtmlPanelGrid(); + grd.setId("gridLesaoMembros"); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft"); + if(a.getLesao_membro_sup_dir().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoMembroSupDir"); + st.setEscape(false); + st.setText("Membro Superior Direito"); + grd.getChildren().add(st); + st = new StaticText(); + st.setId("stEspecif1"); + st.setEscape(false); + st.setText(a.getEspecif1()); + grd.getChildren().add(st); + } + + if(a.getLesao_membro_sup_esq().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoMembroSupEsq"); + st.setEscape(false); + st.setText("Membro Superior Esquerdo"); + grd.getChildren().add(st); + st = new StaticText(); + st.setId("stEspecif2"); + st.setEscape(false); + st.setText(a.getEspecif2()); + grd.getChildren().add(st); + } + + if(a.getLesao_membro_inf_dir().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoMembroInfDir"); + st.setEscape(false); + st.setText("Membro Inferior Direito"); + grd.getChildren().add(st); + st = new StaticText(); + st.setId("stEspecif3"); + st.setEscape(false); + st.setText(a.getEspecif3()); + grd.getChildren().add(st); + } + + if(a.getLesao_membro_inf_esq().matches("y")) + { + st = new StaticText(); + st.setId("stLesaoMembroInfEsq"); + st.setEscape(false); + st.setText("Membro Inferior Esquerdo"); + grd.getChildren().add(st); + st = new StaticText(); + st.setId("stEspecif4"); + st.setEscape(false); + st.setText(a.getEspecif4()); + grd.getChildren().add(st); + } + if(grd.getChildren().size() > 0) + { + gridLesao.getChildren().add(grd); + } + + if(a.getTipo_lesao().trim().length() > 0 ) + { + pg = new PanelGroup(); + pg.setId("pgTipoLesao"); + st = new StaticText(); + st.setId("stTipoLesaoLbl"); + st.setEscape(false); + st.setText("Tipo de lesão:   "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoLesao"); + st.setEscape(false); + st.setText(a.getTipo_lesao()); + pg.getChildren().add(st); + gridLesao.getChildren().add(pg); + } + + //INCAPACIDADE : + pg = new PanelGroup(); + pg.setId("pgTipoIncapacidade"); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl1"); + st.setEscape(false); + st.setStyle("font-weight: bold"); + st.setText("Tipo de incapacidade:  "); + if(a.getTipo_incapacidade().matches("t")) + { + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidade"); + st.setEscape(false); + st.setText("Temporária  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl2"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("   Coeficiente de incapacidade:  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stCoefIncapacidade"); + st.setEscape(false); + st.setText(a.getCoef_incapacidade().toString() + "%"); + pg.getChildren().add(st); + } + else if(a.getTipo_incapacidade().matches("p")) + { + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidade"); + st.setEscape(false); + st.setText("Permanente  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl2"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("   Coeficiente de incapacidade:  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stCoefIncapacidade"); + st.setEscape(false); + st.setText(a.getCoef_incapacidade().toString() + "%"); + pg.getChildren().add(st); + } + + if(pg.getChildren().size() > 0) + { + gridIncapacidade.getChildren().add(pg); + + } + + pg = new PanelGroup(); + pg.setId("pgAvaliacaoIncapacidade"); + if(a.getData_aval_incapacidade() != null) + { + st = new StaticText(); + st.setId("stDataAvalIncapacidadeLbl1"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("Avaliação de incapacidade realizada em  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stDataAvalIncapacidade"); + st.setEscape(false); + //st.setText(a.getData_aval_incapacidade()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_aval_incapacidade().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + pg.getChildren().add(st); + } + + + if(a.getData_rev_incapacidade() != null) + { + st = new StaticText(); + st.setId("stDataRevIncapacidadeLbl1"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("Revisão de incapacidade em  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stDataRevIncapacidade"); + st.setEscape(false); + //st.setText(a.getData_rev_incapacidade()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_rev_incapacidade().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + pg.getChildren().add(st); + } + + if(pg.getChildren().size() > 0) + { + gridIncapacidade.getChildren().add(pg); + } + + if(a.getPeriodo_incapacidade_a() != null || a.getPeriodo_incapacidade_de() != null) + { + pg = new PanelGroup(); + pg.setId("pgPeriodoIncapacidade"); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeLbl1"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("Período de incapacidade temporária de  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeDe"); + st.setEscape(false); + //st.setText(a.getPeriodo_incapacidade_de()); + try + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_de().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeLbl2"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("  a  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeA"); + st.setEscape(false); + //st.setText(a.getPeriodo_incapacidade_a()); + try + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_a().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + pg.getChildren().add(st); + gridIncapacidade.getChildren().add(pg); + } + + + + //RESTRICOES + + if(a.getImg_flexao().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgFlexao"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + pg = new PanelGroup(); + pg.setId("pgImgFlexao"); + img = new ImageComponent(); + img.setId("imgRestricoes1000"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/fle1.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1001"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/fle2.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1002"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/fle3.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1003"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/fle4.gif"); + pg.getChildren().add(img); + grd.getChildren().add(pg); + st = new StaticText(); + st.setId("stImgRestricaoLbl1"); + st.setEscape(false); + st.setText("Flexão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_rot1().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgRot1"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes1005"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/rot1.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl2"); + st.setEscape(false); + st.setText("Flexão Lateral"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_rot2().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgRot2"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes1006"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/rot2.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl3"); + st.setEscape(false); + st.setText("Rotação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ext1().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgExt1"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes1007"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ext1.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl4"); + st.setEscape(false); + st.setText("Extensão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ext2().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgExt2"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + pg = new PanelGroup(); + pg.setId("pgImgExt2"); + img = new ImageComponent(); + img.setId("imgRestricoes1008"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ext2.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1009"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ext3.gif"); + pg.getChildren().add(img); + img = new ImageComponent(); + img.setId("imgRestricoes1010"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ext4.gif"); + pg.getChildren().add(img); + grd.getChildren().add(pg); + st = new StaticText(); + st.setId("stImgRestricaoLbl5"); + st.setEscape(false); + st.setText("Flexão/Extensão Lateral + Rotação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_cab1().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgCab1"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10011"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ca1.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl6"); + st.setEscape(false); + st.setText("Flexão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_cab2().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgCab2"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10012"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ca2.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl7"); + st.setEscape(false); + st.setText("Extensão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_cab3().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgCab3"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10013"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ca3.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl8"); + st.setEscape(false); + st.setText("Flexão Lateral"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_cab4().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgCab4"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10014"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ca4.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl9"); + st.setEscape(false); + st.setText("Rotação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma1().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa1"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10015"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma1.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl10"); + st.setEscape(false); + st.setText("Poronação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma2().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa2"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10016"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma2.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl11"); + st.setEscape(false); + st.setText("Supinação"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma3().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa3"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10017"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma3.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl12"); + st.setEscape(false); + st.setText("Flexão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma4().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa4"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10018"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma4.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl13"); + st.setEscape(false); + st.setText("Extensão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma5().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa5"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10019"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma5.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl14"); + st.setEscape(false); + st.setText("Desvio Ulnar"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma6().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa6"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10020"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma6.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl15"); + st.setEscape(false); + st.setText("Desvio Radial"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma7().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa7"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10021"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma7.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl16"); + st.setEscape(false); + st.setText("Pinça Digital"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma8().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa8"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10022"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma8.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl17"); + st.setEscape(false); + st.setText("Segurar objectos entre os dedos"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma9().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa9"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10023"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma9.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl18"); + st.setEscape(false); + st.setText("Dedos em extensão"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getImg_ma10().matches("y")) + { + grd = new HtmlPanelGrid(); + grd.setId("grdImgMa10"); + grd.setColumns(1); + grd.setColumnClasses("gridColCenter"); + grd.setStyleClass("centerBlock"); + + img = new ImageComponent(); + img.setId("imgRestricoes10024"); + img.setWidth(IMAGE_WIDTH); + img.setHeight(IMAGE_HEIGHT); + img.setUrl("/resources/images/medico/ma10.gif"); + grd.getChildren().add(img); + st = new StaticText(); + st.setId("stImgRestricaoLbl19"); + st.setEscape(false); + st.setText("Pega palmar"); + grd.getChildren().add(st); + gridImagesRestricoes.getChildren().add(grd); + } + + if(a.getRestricao_carga() != null) + { + if(a.getRestricao_carga().intValue() > 0) + { + pg = new PanelGroup(); + st = new StaticText(); + st.setId("stRestricaoCargaLbl"); + st.setEscape(false); + st.setText("Movimentação e manipulação de cargas com mais de  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stRestricaoCargaKgs"); + st.setEscape(false); + st.setText(a.getRestricao_carga().toString()); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stRestricaoCargaLbl1"); + st.setEscape(false); + st.setText("Kg"); + pg.getChildren().add(st); + gridOutrasRestricoes.getChildren().add(pg); + } + + if(a.getRestricao_motricidade().matches("y")) + { + st = new StaticText(); + st.setId("stRestricaoMotricidadeLbl"); + st.setEscape(false); + st.setText("Operações que requeiram motricidade fina."); + gridOutrasRestricoes.getChildren().add(st); + } + + if(a.getRestricao_conducao().matches("y")) + { + st = new StaticText(); + st.setId("stRestricaoConducaoLbl"); + st.setEscape(false); + st.setText("Condução/interacção com veículos ou outros equipamentos."); + gridOutrasRestricoes.getChildren().add(st); + } + + if(a.getRestricao_vibracoes().matches("y")) + { + st = new StaticText(); + st.setId("stRestricaoVibracoesLbl"); + st.setEscape(false); + st.setText("Utilizaçõo de equipamentos/ferramentas que impliquem exposição a vibrações ou impactos."); + gridOutrasRestricoes.getChildren().add(st); + } + + if(a.getRestricao_outras().trim().length() > 0) + { + st = new StaticText(); + st.setId("stRestricaoOutras"); + st.setEscape(false); + st.setText(a.getRestricao_outras()); + gridOutrasRestricoes.getChildren().add(st); + } + + if(a.getMed_observ().trim().length() > 0) + { + stObservacoes.setText(a.getMed_observ()); + } + } + + } + + private void fillImages() + { + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + try + { + String imageFileFolder = theApplicationsServletContext.getRealPath(IMAGE_URL + "/" + getSessionBean1().getCurrentAnalise().getId()); + File f = new File(imageFileFolder); + if( f.exists() ) + { + File files[] = f.listFiles(); + + for(int i=0;i " + estado + " AND estado < 6 AND estabelecimento_id = " + estabelecimento_id; - } - else if(estado.intValue() == 2) - { - sql ="SELECT * FROM analises_acidentes WHERE estado = 3 or estado = 5 AND estabelecimento_id = " + estabelecimento_id; - } - + String sql ="SELECT * FROM analises_acidentes WHERE (estado = " + ESTADO_MEDICO + " OR (estado = " + ESTADO_ASSINATURAS + " AND estado_assinatura = 2 and ass_med = 'n')) AND estabelecimento_id = " + estabelecimento_id; ResultSet rs = st.executeQuery(sql); - rs.first(); - int nr = 0; - do - { - AnaliseAcidente a = new AnaliseAcidente(); - a.setId(new Integer(rs.getInt("id"))); - nr++; - a.setNr(new Integer(nr)); - a.setData_acidente(rs.getDate("data_acidente")); - a.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); - a.setEstado(new Integer(rs.getInt("estado"))); - a.setTrabalhador_id(new Integer( rs.getInt("trabalhador_id"))); - String sqllocal = "SELECT nome FROM trabalhadores WHERE id = " + a.getTrabalhador_id(); - ResultSet rslocal = stlocal.executeQuery(sqllocal); - rslocal.first(); - a.setNome_acidentado(rslocal.getString("nome")); - - a.setHoras_turno(new Integer(rs.getInt("horas_turno"))); - a.setSeccao(rs.getString("seccao")); - a.setLocal_trabalho(rs.getString("local_trabalho")); - a.setTarefa(rs.getString("tarefa")); - a.setSubstancias(rs.getString("substancias")); - a.setSuperior_hierarquico(rs.getString("superior_hierarquico")); - a.setCondicoes(rs.getString("condicoes")); - a.setTestemunhas(rs.getString("testemunhas")); - a.setCausas(rs.getString("causas")); - a.setDescricao(rs.getString("descricao")); - a.setConclusoes(rs.getString("conclusoes")); - a.setAccoes(rs.getString("accoes")); - list.add(a); - }while(rs.next()); - dblocal.close(); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + + public ArrayList getAnalisesSeguimentoSegList(Integer estabelecimento_id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM analises_acidentes WHERE (estado = 6 and ass_seg = 'y') OR (estado > 1 AND estado < 6 ) OR (estado > 6 AND estado < 9) AND estabelecimento_id = " + estabelecimento_id; + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoHsList(Integer estabelecimento_id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM analises_acidentes WHERE estado < 3 OR (estado > 3 AND estado < 6) OR (estado = 6 AND ass_hs = 'y') OR (estado = 7) AND estabelecimento_id = " + estabelecimento_id; + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoRhList(Integer estabelecimento_id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM analises_acidentes WHERE estado = 1 OR estado = 3 OR (estado > 4 AND estado < 6) OR (estado = 6 AND estado_assinatura < 3) OR (estado = 8) AND estabelecimento_id = " + estabelecimento_id; + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoMedList(Integer estabelecimento_id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM analises_acidentes WHERE estado < 5 OR (estado = 6 AND estado_assinatura <> 2) OR (estado = 6 AND estado_assinatura = 2 AND ass_med = 'y') OR (estado > 6 AND estado < 9) AND estabelecimento_id = " + estabelecimento_id; + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); return list; } public ArrayList getAnalisesConcluidasList(Integer estabelecimento_id) throws Exception { - Dblocal dblocal = new Dblocal(); - dblocal.connect(); - Statement stlocal = dblocal.createStatement(); - ArrayList list = new ArrayList(); Statement st = createStatement(); - String sql ="SELECT * FROM analises_acidentes WHERE estado = 6 AND estabelecimento_id = " + estabelecimento_id; + String sql ="SELECT * FROM analises_acidentes WHERE estado = 9 AND estabelecimento_id = " + estabelecimento_id; ResultSet rs = st.executeQuery(sql); - rs.first(); - int nr = 0; - do - { - AnaliseAcidente a = new AnaliseAcidente(); - a.setId(new Integer(rs.getInt("id"))); - nr++; - a.setNr(new Integer(nr)); - a.setData_acidente(rs.getDate("data_acidente")); - a.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); - a.setEstado(new Integer(rs.getInt("estado"))); - a.setTrabalhador_id(new Integer( rs.getInt("trabalhador_id"))); - String sqllocal = "SELECT nome FROM trabalhadores WHERE id = " + a.getTrabalhador_id(); - ResultSet rslocal = stlocal.executeQuery(sqllocal); - rslocal.first(); - a.setNome_acidentado(rslocal.getString("nome")); - - a.setHoras_turno(new Integer(rs.getInt("horas_turno"))); - a.setSeccao(rs.getString("seccao")); - a.setLocal_trabalho(rs.getString("local_trabalho")); - a.setTarefa(rs.getString("tarefa")); - a.setSubstancias(rs.getString("substancias")); - a.setSuperior_hierarquico(rs.getString("superior_hierarquico")); - a.setCondicoes(rs.getString("condicoes")); - a.setTestemunhas(rs.getString("testemunhas")); - a.setCausas(rs.getString("causas")); - a.setDescricao(rs.getString("descricao")); - a.setConclusoes(rs.getString("conclusoes")); - a.setAccoes(rs.getString("accoes")); - list.add(a); - }while(rs.next()); - dblocal.close(); + ArrayList list = fillAnaliseFields(rs); + return list; } public ArrayList searchAanalisesConcluidasList(Integer estabelecimento_id, Integer ano, Integer mes, Integer dia, String nome) throws Exception { +// Strings strings = new Strings(); Calendar cal = Calendar.getInstance(); - ArrayList list = new ArrayList(); - Dblocal dblocal = new Dblocal(); - dblocal.connect(); - Statement stlocal = dblocal.createStatement(); +// ArrayList list = new ArrayList(); +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); Statement st = createStatement(); String sql = ""; - + if(nome != null) + { + nome = nome.toUpperCase(); + } + if( ano != null) { if( mes != null) @@ -232,16 +180,13 @@ public class AnalisesDataProvider { cal.set( cal.MONTH, mes.intValue() -1 ); cal.set( cal.DATE, dia.intValue() ); java.sql.Date data_acidente = new java.sql.Date( cal.getTime().getTime() ); - System.out.println("DATA_ACIDENTE : " + data_acidente); if( nome != null) { - sql = "SELECT * FROM analises_acidentes WHERE data_acidente = '" + data_acidente + "' AND nome LIKE '%" + nome + "%' AND estado = 6 AND estabelecimento_id = " + estabelecimento_id; + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + "' AND nome LIKE '%" + nome + "%' AND estado = 9 AND estabelecimento_id = " + estabelecimento_id; } else { - System.out.println("DIA != NULL ; NOME = NULL"); - sql = "SELECT * FROM analises_acidentes WHERE data_acidente = '" + data_acidente + "' AND estado = 6 AND estabelecimento_id = " + estabelecimento_id; - System.out.println ("SQL = " + sql); + sql = "SELECT * FROM analises_acidentes WHERE data_acidente = '" + data_acidente + "' AND estado = 9 AND estabelecimento_id = " + estabelecimento_id; } } else @@ -254,12 +199,11 @@ public class AnalisesDataProvider { java.sql.Date data_acidente_to = new java.sql.Date( cal.getTime().getTime() ); if( nome != null) { - sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' AND estado = 6 AND estabelecimento_id = " + estabelecimento_id; + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' AND estado = 9 AND estabelecimento_id = " + estabelecimento_id; } else { - System.out.println("DIA = NULL ; NOME = NULL"); - sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND estado = 6 AND estabelecimento_id = " + estabelecimento_id; + sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND estado = 9 AND estabelecimento_id = " + estabelecimento_id; } } // dia } // mes @@ -274,12 +218,12 @@ public class AnalisesDataProvider { java.sql.Date data_acidente_to = new java.sql.Date( cal.getTime().getTime() ); if( nome != null) { - sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' AND estado = 6 AND estabelecimento_id = " + estabelecimento_id; + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' AND estado = 9 AND estabelecimento_id = " + estabelecimento_id; } else { - System.out.println("MES = NULL; DIA = NULL ; NOME = NULL"); - sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND estado = 6 AND estabelecimento_id = " + estabelecimento_id; + System.out.println("HERE c"); + sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND estado = 9 AND estabelecimento_id = " + estabelecimento_id; } } } // ano @@ -287,14 +231,27 @@ public class AnalisesDataProvider { { if( nome != null ) { - sql = "SELECT * FROM analises_acidentes WHERE nome LIKE '%" + nome + "%' AND estado = 6 AND estabelecimento_id = " + estabelecimento_id; + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND nome LIKE '%" + nome + "%' AND estado = 9 AND estabelecimento_id = " + estabelecimento_id; } else { - sql = "SELECT * FROM analises_acidentes WHERE estado = 6 AND estabelecimento_id = " + estabelecimento_id; + sql = "SELECT * FROM analises_acidentes WHERE estado = 9 AND estabelecimento_id = " + estabelecimento_id; } } ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + + return list; + } + + private ArrayList fillAnaliseFields(ResultSet rs) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + + ArrayList list = new ArrayList(); + rs.first(); int nr = 0; do @@ -304,27 +261,207 @@ public class AnalisesDataProvider { nr++; a.setNr(new Integer(nr)); a.setData_acidente(rs.getDate("data_acidente")); + a.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); a.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); a.setEstado(new Integer(rs.getInt("estado"))); - a.setTrabalhador_id(new Integer( rs.getInt("trabalhador_id"))); - String sqllocal = "SELECT nome FROM trabalhadores WHERE id = " + a.getTrabalhador_id(); + a.setEstado_assinatura(new Integer(rs.getInt("estado_assinatura"))); + a.setFase(getFase(a.getEstado().intValue())); + a.setAcidentado_id(new Integer( rs.getInt("acidentado_id"))); + Acidentado ac = getAcidentado(a.getAcidentado_id()); + String sqllocal = "SELECT nome FROM trabalhadores WHERE id = " + ac.getTrabalhador_id(); ResultSet rslocal = stlocal.executeQuery(sqllocal); rslocal.first(); - a.setNome_acidentado(rslocal.getString("nome")); + String nome_acidentado = rslocal.getString("nome"); + a.setNome_acidentado(utils.Utils.unicodeToHTML(nome_acidentado)); + + a.setHoras_turno(new Integer(rs.getInt("horas_turno"))); + a.setSeccao(rs.getString("seccao")); + a.setLocal_trabalho(rs.getString("local_trabalho")); + a.setTarefa(rs.getString("tarefa")); + a.setSubstancias(rs.getString("substancias")); + a.setSuperior_hierarquico(rs.getString("superior_hierarquico")); + a.setCondicoes(rs.getString("condicoes")); + a.setTestemunhas(rs.getString("testemunhas")); + a.setCausas(rs.getString("causas")); + a.setDescricao(rs.getString("descricao")); + a.setConclusoes(rs.getString("conclusoes")); + a.setAccoes(rs.getString("accoes")); + + a.setHora_acidente(rs.getTime("hora_acidente")); + a.setFormacao_shst(rs.getString("formacao_shst")); + Object o = rs.getString("formacao_shst_nao_porque"); + if(o == null) + { + a.setFormacao_shst_nao_porque(""); + } + else + { + a.setFormacao_shst_nao_porque(rs.getString("formacao_shst_nao_porque")); + } + a.setOutros_acidentes_com_colaborador(rs.getString("outros_acidentes_com_colaborador")); + a.setNr_acidentes_com_colaborador(new Integer(rs.getInt("nr_acidentes_com_colaborador"))); + a.setNr_relatorio_acidente_colaborador1(new Integer(rs.getInt("nr_relatorio_acidente_colaborador1"))); + a.setNr_relatorio_acidente_colaborador2(new Integer(rs.getInt("nr_relatorio_acidente_colaborador2"))); + a.setNr_relatorio_acidente_colaborador3(new Integer(rs.getInt("nr_relatorio_acidente_colaborador3"))); + a.setNr_relatorio_acidente_colaborador4(new Integer(rs.getInt("nr_relatorio_acidente_colaborador4"))); + a.setAcidentes_outros_colaboradores(rs.getString("acidentes_outros_colaboradores")); + a.setNr_acidentes_outros_colaboradores(new Integer(rs.getInt("nr_acidentes_outros_colaboradores"))); + a.setNr_relatorio_acidente_outros_colaboradores1(new Integer(rs.getInt("nr_relatorio_acidente_outros_colaboradores1"))); + a.setNr_relatorio_acidente_outros_colaboradores2(new Integer(rs.getInt("nr_relatorio_acidente_outros_colaboradores2"))); + a.setNr_relatorio_acidente_outros_colaboradores3(new Integer(rs.getInt("nr_relatorio_acidente_outros_colaboradores3"))); + a.setNr_relatorio_acidente_outros_colaboradores4(new Integer(rs.getInt("nr_relatorio_acidente_outros_colaboradores4"))); + + a.setLesao_cabeca(rs.getString("lesao_cabeca")); + a.setLesao_pescoco(rs.getString("lesao_pescoco")); + a.setLesao_tronco(rs.getString("lesao_tronco")); + a.setLesao_membro_sup_dir(rs.getString("lesao_membro_sup_dir")); + a.setLesao_membro_sup_esq(rs.getString("lesao_membro_sup_esq")); + a.setLesao_membro_inf_dir(rs.getString("lesao_membro_inf_dir")); + a.setLesao_membro_inf_esq(rs.getString("lesao_membro_inf_esq")); + Object ob = rs.getString("especif1"); + if(ob == null) + { + a.setEspecif1(""); + } + else + { + a.setEspecif1(rs.getString("especif1")); + } + ob = rs.getString("especif2"); + if(ob == null) + { + a.setEspecif2(""); + } + else + { + a.setEspecif2(rs.getString("especif2")); + } + ob = rs.getString("especif3"); + if(ob == null) + { + a.setEspecif3(""); + } + else + { + a.setEspecif3(rs.getString("especif3")); + } + ob = rs.getString("especif4"); + if(ob == null) + { + a.setEspecif4(""); + } + else + { + a.setEspecif4(rs.getString("especif4")); + } + ob = rs.getString("tipo_lesao"); + if(ob == null) + { + a.setTipo_lesao(""); + } + else + { + a.setTipo_lesao(rs.getString("tipo_lesao")); + } + a.setTipo_incapacidade(rs.getString("tipo_incapacidade")); + a.setCoef_incapacidade(new Integer(( rs.getInt("coef_incapacidade") ))); + a.setData_aval_incapacidade(rs.getDate("data_aval_incapacidade")); + a.setData_rev_incapacidade(rs.getDate("data_rev_incapacidade")); + a.setPeriodo_incapacidade_de(rs.getDate("periodo_incapacidade_de")); + a.setPeriodo_incapacidade_a(rs.getDate("periodo_incapacidade_a")); + a.setImg_flexao(rs.getString("img_flexao")); + a.setImg_ext1(rs.getString("img_ext1")); + a.setImg_ext2(rs.getString("img_ext2")); + a.setImg_cab2(rs.getString("img_cab2")); + a.setImg_cab3(rs.getString("img_cab3")); + a.setImg_ma2(rs.getString("img_ma2")); + a.setImg_ma3(rs.getString("img_ma3")); + a.setImg_ma5(rs.getString("img_ma5")); + a.setImg_ma6(rs.getString("img_ma6")); + a.setImg_ma8(rs.getString("img_ma8")); + a.setImg_ma10(rs.getString("img_ma10")); + a.setImg_rot1(rs.getString("img_rot1")); + a.setImg_rot2(rs.getString("img_rot2")); + a.setImg_cab1(rs.getString("img_cab1")); + a.setImg_cab4(rs.getString("img_cab4")); + a.setImg_ma1(rs.getString("img_ma1")); + a.setImg_ma4(rs.getString("img_ma4")); + a.setImg_ma7(rs.getString("img_ma7")); + a.setImg_ma9(rs.getString("img_ma9")); + a.setRestricao_carga(new Integer( rs.getInt("restricao_carga") )); + a.setRestricao_motricidade(rs.getString("restricao_motricidade")); + a.setRestricao_conducao(rs.getString("restricao_conducao")); + a.setRestricao_vibracoes(rs.getString("restricao_vibracoes")); + ob = rs.getString("restricao_outras"); + if(ob == null) + { + a.setRestricao_outras(""); + } + else + { + a.setRestricao_outras(rs.getString("restricao_outras")); + } + ob = rs.getString("med_observ"); + if(ob == null) + { + a.setMed_observ(""); + } + else + { + a.setMed_observ(rs.getString("med_observ")); + } + a.setAnalise_nr(rs.getString("analise_nr")); + a.setMedico_id(new Integer(rs.getInt("medico_id"))); + a.setTecnico_saude_id(new Integer(rs.getInt("tecnico_saude_id"))); + + a.setAss_hs(rs.getString("ass_hs")); + a.setAss_seg(rs.getString("ass_seg")); + a.setAss_resp_seg(rs.getString("ass_resp_seg")); + a.setAss_med(rs.getString("ass_med")); + a.setAss_resp_rh(rs.getString("ass_resp_rh")); list.add(a); }while(rs.next()); dblocal.close(); + return list; } - public ArrayList getTrabalhadoresListByEstabelecimento(Integer estabelecimento_id) throws Exception + public Trabalhador searchTrabalhador(String nrMecanografico, String nome) throws Exception { - ArrayList list = new ArrayList(); Dblocal dblocal = new Dblocal(); dblocal.connect(); - Statement stlocal = dblocal.createStatement(); - String sql ="SELECT * FROM trabalhadores WHERE estabelecimento_id = " + estabelecimento_id; + Statement stlocal = dblocal.createStatement(); + String sql = ""; + if(nrMecanografico != null) + { + sql = "SELECT * FROM trabalhadores WHERE numero_mecanografico = '" + nrMecanografico + "'"; + } + else if(nome != null) + { + sql = "SELECT * FROM trabalhadores WHERE nome LIKE '%" + nome + "%'"; + } + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + Trabalhador t = new Trabalhador(); + t.setId(new Integer(rslocal.getInt("id"))); + String nome = rslocal.getString("nome"); + t.setNome(utils.unicodeToHTML(nome)); + t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setFuncao(rslocal.getString("funcao_proposta")); + t.setData_admissao(rslocal.getDate("data_admissao")); + t.setNumero_mecanografico(rslocal.getString("numero_mecanografico")); + dblocal.close(); + } + + public ArrayList getTrabalhadoresListByEstabelecimento(Integer estabelecimento_id) throws Exception + { + Utils utils = new Utils(); + ArrayList list = new ArrayList(); + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT * FROM trabalhadores WHERE estabelecimento_id = " + estabelecimento_id; ResultSet rslocal = stlocal.executeQuery(sql); rslocal.first(); int nr = 0; @@ -332,8 +469,11 @@ public class AnalisesDataProvider { { Trabalhador t = new Trabalhador(); t.setId(new Integer(rslocal.getInt("id"))); - t.setNome(rslocal.getString("nome")); + String nome = rslocal.getString("nome"); + t.setNome(utils.unicodeToHTML(nome)); t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setFuncao(rslocal.getString("funcao_proposta")); + t.setData_admissao(rslocal.getDate("data_admissao")); list.add(t); }while(rslocal.next()); dblocal.close(); @@ -352,11 +492,53 @@ public class AnalisesDataProvider { Trabalhador t = new Trabalhador(); t.setId(new Integer(rslocal.getInt("id"))); t.setNome(rslocal.getString("nome")); - t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setFuncao(rslocal.getString("funcao_proposta")); + t.setData_admissao(rslocal.getDate("data_admissao")); dblocal.close(); return t; } + public Acidentado getAcidentado(Integer acidentado_id) throws Exception + { + Strings strings = new Strings(); + Acidentado a = new Acidentado(); + Statement st = createStatement(); + String sql ="SELECT * FROM acidentados WHERE id = " + acidentado_id; + ResultSet rs = st.executeQuery(sql); + rs.first(); + a.setId(new Integer(rs.getInt("id"))); + a.setNome(rs.getString("nome")); + a.setData_nascimento(rs.getDate("data_nascimento")); + a.setBilhete_identidade(rs.getString("bilhete_identidade")); + a.setMorada(rs.getString("morada")); + a.setCod_postal(rs.getString("cod_postal")); + a.setLocalidade(rs.getString("localidade")); + a.setContacto_telefonico(rs.getString("contacto_telefonico")); + a.setData_admissao(rs.getDate("data_admissao")); + a.setTurno(rs.getString("turno")); + String funcao = rs.getString("funcao"); + a.setFuncao(utils.Utils.unicodeToHTML(funcao)); + a.setTrabalhador_id(new Integer(rs.getInt("trabalhador_id"))); + //a.setAnalise_acidente_id(new Integer("analise_acidente_id")); + return a; + } + + public String getEmpresaNome(Integer empresa_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT designacao_social FROM empresas WHERE id = " + empresa_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String nome = rslocal.getString("designacao_social"); + dblocal.close(); + return nome; + } + + + public String getEstabelecimentoNome(Integer estabelecimento_id) throws Exception { Dblocal dblocal = new Dblocal(); @@ -370,6 +552,100 @@ public class AnalisesDataProvider { return nome; } + public String getMedicoNome(Integer medico_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT nome FROM medicos WHERE id = " + medico_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String nome = rslocal.getString("nome"); + dblocal.close(); + return nome; + } + + public String getTecnicoSaudeNome(Integer tecnico_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT nome FROM marcacoes_tecnicos_hst WHERE id = " + tecnico_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String nome = rslocal.getString("nome"); + dblocal.close(); + return nome; + } + + + public Integer getMaxAcidentadoId() + { + Statement st = createStatement(); + String sql = "SELECT max(acidentados.id)+1 AS MAXACIDENTADOID FROM acidentados"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXACIDENTADOID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + return new Integer(1); + } + } + + public Integer createAcidentado(Acidentado a) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxAcidentadoId(); + String sql = "INSERT INTO acidentados (id, nome, data_nascimento, bilhete_identidade, morada, cod_postal, localidade, contacto_telefonico, data_admissao, turno, funcao, trabalhador_id, numero_mecanografico) VALUES ("; + sql += newId + ", '"; + sql += a.getNome() + "', '"; + sql += a.getData_nascimento() + "', '"; + sql += a.getBilhete_identidade() + "', '"; + sql += a.getMorada() + "', '"; + sql += a.getCod_postal() + "', '"; + sql += a.getLocalidade() + "', '"; + sql += a.getContacto_telefonico() + "', '"; + sql += a.getData_admissao() + "', '"; + sql += a.getTurno() + "', '"; + sql += a.getFuncao() + "', "; + sql += a.getTrabalhador_id() + ", '"; + sql += a.getNumero_mecanografico() + "') " + //sql += a.getAnalise_acidente_id() + ")"; + System.out.println("SQL ACIDENTADO : " + sql); + st.execute(sql); + + return newId; + } + + public void updateAcidentado(Acidentado a) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE acidentados SET nome = '" + a.getNome() + "', "; + sql += "data_nascimento = '" + a.getData_nascimento() + "', "; + sql += "bilhete_identidade = '" + a.getBilhete_identidade() + "', "; + sql += "morada = '" + a.getMorada() + "', "; + sql += "cod_postal = '" + a.getCod_postal() + "', "; + sql += "localidade = '" + a.getLocalidade() + "', "; + sql += "contacto_telefonico = '" + a.getContacto_telefonico() + "', "; + sql += "data_admissao = '" + a.getData_admissao() + "', "; + sql += "turno = '" + a.getTurno() + "', "; + sql += "funcao = '" + a.getFuncao() + "', "; + sql += "trabalhador_id = " + a.getTrabalhador_id() + ", "; + sql += "numero_mecanografico = '" + a.getNumero_mecanografico() + "' "; + //sql += "analise_acidente_id = '" + a.getAnalise_acidente_id() + " "; + sql += "WHERE id = " + a.getId(); + //System.out.println("SQL : " + sql); + st.execute(sql); + } + public Integer getMaxAnaliseId() { Statement st = createStatement(); @@ -379,6 +655,10 @@ public class AnalisesDataProvider { ResultSet rs = st.executeQuery(sql); rs.first(); Integer newId = new Integer(rs.getInt("MAXANALISEID")); + if(newId.intValue() == 0 ) + { + newId = new Integer(1); + } return newId; } catch(Exception ex) @@ -390,16 +670,27 @@ public class AnalisesDataProvider { public Integer createAnalise(AnaliseAcidente a) throws Exception { + Statement st = createStatement(); Integer newId = getMaxAnaliseId(); - + + //calc analise_nr + java.util.Date now = new java.util.Date(); + Calendar cal = new GregorianCalendar(); + cal.setTime(now); + int ano = cal.get(Calendar.YEAR); + //Integer analise_nr = new Integer( ano * 10000 + newId.intValue() ); + String seq_str = new Integer(10000 + newId.intValue()).toString(); + String ano_str = new Integer(ano).toString(); + String analise_nr = ano_str.substring(2) + "/" + seq_str.substring(1); //java.util.Date today = new java.util.Date(); //java.sql.Date sqlToday = new java.sql.Date(today.getTime()); - String sql = "INSERT INTO analises_acidentes (id, data_acidente, trabalhador_id, estado, estabelecimento_id, horas_turno, seccao, local_trabalho, tarefa, substancias, superior_hierarquico, condicoes, testemunhas, causas, descricao, conclusoes, accoes) VALUES ("; + String sql = "INSERT INTO analises_acidentes (id, data_acidente, acidentado_id, estado, empresa_id, estabelecimento_id, horas_turno, seccao, local_trabalho, tarefa, substancias, superior_hierarquico, condicoes, testemunhas, causas, descricao, conclusoes, accoes, hora_acidente, medico_id, tecnico_saude_id, analise_nr) VALUES ("; sql += newId + ", '"; sql += a.getData_acidente() + "', "; - sql += a.getTrabalhador_id() + ", "; + sql += a.getAcidentado_id() + ", "; sql += a.getEstado() + ", "; + sql += a.getEmpresa_id() + ", "; sql += a.getEstabelecimento_id() + ", "; sql += a.getHoras_turno() + ", '"; sql += a.getSeccao() + "', '"; @@ -412,7 +703,26 @@ public class AnalisesDataProvider { sql += a.getCausas() + "', '"; sql += a.getDescricao() + "', '"; sql += a.getConclusoes() + "', '"; - sql += a.getAccoes() + "')"; + sql += a.getAccoes() + "', '"; + sql += a.getHora_acidente() + "', "; + sql += a.getMedico_id() + ", "; + sql += a.getTecnico_saude_id() + ", '"; + sql += analise_nr + "')"; +// sql += a.getFormacao_shst() + "', '"; +// sql += a.getFormacao_shst_nao_porque() + "', '"; +// sql += a.getOutros_acidentes_com_colaborador() + "', "; +// sql += a.getNr_acidentes_com_colaborador() + ", "; +// sql += a.getNr_relatorio_acidente_colaborador1() + ", "; +// sql += a.getNr_relatorio_acidente_colaborador2() + ", "; +// sql += a.getNr_relatorio_acidente_colaborador3() + ", "; +// sql += a.getNr_relatorio_acidente_colaborador4() + ", '"; +// sql += a.getAcidentes_outros_colaboradores()+ "', "; +// sql += a.getNr_acidentes_outros_colaboradores()+ ", "; +// sql += a.getNr_relatorio_acidente_outros_colaboradores1() + ", "; +// sql += a.getNr_relatorio_acidente_outros_colaboradores2() + ", "; +// sql += a.getNr_relatorio_acidente_outros_colaboradores3() + ", "; +// sql += a.getNr_relatorio_acidente_outros_colaboradores4() + ")"; + System.out.println("SQL : " + sql); st.execute(sql); return newId; @@ -420,10 +730,43 @@ public class AnalisesDataProvider { public void updateAnalise(AnaliseAcidente a) throws Exception { + if(a.getEspecif1().matches("null")) + { + a.setEspecif1(""); + } + if(a.getEspecif2().matches("null")) + { + a.setEspecif2(""); + } + if(a.getEspecif3().matches("null")) + { + a.setEspecif3(""); + } + if(a.getEspecif4().matches("null")) + { + a.setEspecif4(""); + } + if(a.getRestricao_outras().matches("null")) + { + a.setRestricao_outras(""); + } + if(a.getTipo_lesao().matches("null")) + { + a.setTipo_lesao(""); + } + if(a.getMed_observ().matches("null")) + { + a.setMed_observ(""); + } + if(a.getFormacao_shst_nao_porque().matches("null")) + { + a.setFormacao_shst_nao_porque(""); + } Statement st = createStatement(); String sql = "UPDATE analises_acidentes SET data_acidente = '" + a.getData_acidente() + "', "; - sql += "trabalhador_id = " + a.getTrabalhador_id() + ", "; - sql += "estado = " + a.getEstado() + ", "; + sql += "acidentado_id = " + a.getAcidentado_id() + ", "; + sql += "estado = " + a.getEstado() + ", "; + sql += "empresa_id = " + a.getEmpresa_id() + ", "; sql += "estabelecimento_id = " + a.getEstabelecimento_id() + ", "; sql += "horas_turno = " + a.getHoras_turno() + ", "; sql += "seccao = '" + a.getSeccao() + "', "; @@ -436,13 +779,432 @@ public class AnalisesDataProvider { sql += "causas = '" + a.getCausas() + "', "; sql += "descricao = '" + a.getDescricao() + "', "; sql += "conclusoes = '" + a.getConclusoes() + "', "; - sql += "accoes = '" + a.getAccoes() + "' "; + sql += "accoes = '" + a.getAccoes() + "', "; + sql += "hora_acidente = '" + a.getHora_acidente() + "', "; + sql += "formacao_shst = '" + a.getFormacao_shst() + "', "; + sql += "formacao_shst_nao_porque = '" + a.getFormacao_shst_nao_porque() + "', "; + sql += "outros_acidentes_com_colaborador = '" + a.getOutros_acidentes_com_colaborador() + "', "; + sql += "nr_acidentes_com_colaborador = " + a.getNr_acidentes_com_colaborador() + ", "; + sql += "nr_relatorio_acidente_colaborador1 = " + a.getNr_relatorio_acidente_colaborador1() + ", "; + sql += "nr_relatorio_acidente_colaborador2 = " + a.getNr_relatorio_acidente_colaborador2() + ", "; + sql += "nr_relatorio_acidente_colaborador3 = " + a.getNr_relatorio_acidente_colaborador3() + ", "; + sql += "nr_relatorio_acidente_colaborador4 = " + a.getNr_relatorio_acidente_colaborador4() + ", "; + sql += "acidentes_outros_colaboradores = '" + a.getAcidentes_outros_colaboradores() + "', "; + sql += "nr_acidentes_outros_colaboradores = " + a.getNr_acidentes_outros_colaboradores() + ", "; + sql += "nr_relatorio_acidente_outros_colaboradores1 = " + a.getNr_relatorio_acidente_outros_colaboradores1() + ", "; + sql += "nr_relatorio_acidente_outros_colaboradores2 = " + a.getNr_relatorio_acidente_outros_colaboradores2() + ", "; + sql += "nr_relatorio_acidente_outros_colaboradores3 = " + a.getNr_relatorio_acidente_outros_colaboradores3() + ", "; + sql += "nr_relatorio_acidente_outros_colaboradores4 = " + a.getNr_relatorio_acidente_outros_colaboradores4() + ", "; + sql += "lesao_cabeca = '" + a.getLesao_cabeca() + "', "; + sql += "lesao_pescoco = '" + a.getLesao_pescoco() + "', "; + sql += "lesao_tronco = '" + a.getLesao_tronco() + "', "; + sql += "lesao_membro_sup_dir = '" + a.getLesao_membro_sup_dir() + "', "; + sql += "lesao_membro_sup_esq = '" + a.getLesao_membro_sup_esq() + "', "; + sql += "lesao_membro_inf_dir = '" + a.getLesao_membro_inf_dir() + "', "; + sql += "lesao_membro_inf_esq = '" + a.getLesao_membro_inf_esq() + "', "; + sql += "especif1 = '" + a.getEspecif1() + "', "; + sql += "especif2 = '" + a.getEspecif2() + "', "; + sql += "especif3 = '" + a.getEspecif3() + "', "; + sql += "especif4 = '" + a.getEspecif4() + "', "; + sql += "tipo_lesao = '" + a.getTipo_lesao() + "', "; + sql += "tipo_incapacidade = '" + a.getTipo_incapacidade() + "', "; + sql += "coef_incapacidade = " + a.getCoef_incapacidade() + ", "; + if(a.getData_aval_incapacidade() == null) + { + sql += "data_aval_incapacidade = " + null + ", "; + } + else + { + sql += "data_aval_incapacidade = '" + a.getData_aval_incapacidade() + "', "; + } + if(a.getData_rev_incapacidade() == null) + { + sql += "data_rev_incapacidade = " + null + ", "; + } + else + { + sql += "data_rev_incapacidade = '" + a.getData_rev_incapacidade() + "', "; + } + if(a.getPeriodo_incapacidade_de() == null) + { + sql += "periodo_incapacidade_de = " + null + ", "; + } + else + { + sql += "periodo_incapacidade_de = '" + a.getPeriodo_incapacidade_de() + "', "; + } + if(a.getPeriodo_incapacidade_a() == null) + { + sql += "periodo_incapacidade_a = " + null + ", "; + } + else + { + sql += "periodo_incapacidade_a = '" + a.getPeriodo_incapacidade_a() + "', "; + } + sql += "img_flexao = '" + a.getImg_flexao() + "', "; + sql += "img_ext1 = '" + a.getImg_ext1() + "', "; + sql += "img_ext2 = '" + a.getImg_ext2() + "', "; + sql += "img_cab2 = '" + a.getImg_cab2() + "', "; + sql += "img_cab3 = '" + a.getImg_cab3() + "', "; + sql += "img_ma2 = '" + a.getImg_ma2() + "', "; + sql += "img_ma3 = '" + a.getImg_ma3() + "', "; + sql += "img_ma5 = '" + a.getImg_ma5() + "', "; + sql += "img_ma6 = '" + a.getImg_ma6() + "', "; + sql += "img_ma8 = '" + a.getImg_ma8() + "', "; + sql += "img_ma10 = '" + a.getImg_ma10() + "', "; + sql += "img_rot1 = '" + a.getImg_rot1() + "', "; + sql += "img_rot2 = '" + a.getImg_rot2() + "', "; + sql += "img_cab1 = '" + a.getImg_cab1() + "', "; + sql += "img_cab4 = '" + a.getImg_cab4() + "', "; + sql += "img_ma1 = '" + a.getImg_ma1() + "', "; + sql += "img_ma4 = '" + a.getImg_ma4() + "', "; + sql += "img_ma7 = '" + a.getImg_ma7() + "', "; + sql += "img_ma9 = '" + a.getImg_ma9() + "', "; + sql += "restricao_carga = " + a.getRestricao_carga() + ", "; + sql += "restricao_motricidade = '" + a.getRestricao_motricidade() + "', "; + sql += "restricao_conducao = '" + a.getRestricao_conducao() + "', "; + sql += "restricao_vibracoes = '" + a.getRestricao_vibracoes() + "', "; + sql += "restricao_outras = '" + a.getRestricao_outras() + "', "; + sql += "med_observ = '" + a.getMed_observ() + "', "; + sql += "estado_assinatura = " + a.getEstado_assinatura() + ", "; + sql += "ass_seg = '" + a.getAss_seg() + "', "; + sql += "ass_hs = '" + a.getAss_hs() + "', "; + sql += "ass_med = '" + a.getAss_med() + "' "; sql += "WHERE id = " + a.getId(); - System.out.println("SQL : " + sql); + //System.out.println("SQL : " + sql); st.execute(sql); } + public Integer getMaxRecomendacaoId() + { + Statement st = createStatement(); + String sql = "SELECT max(recomendacoes.id)+1 AS MAXRECOMENDACAOID FROM recomendacoes"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXRECOMENDACAOID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + return new Integer(1); + } + } + + public Integer createRecomendacao(Recomendacao r) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxRecomendacaoId(); + String sql = "INSERT INTO recomendacoes (id, analise_id, recomendacao) VALUES ("; + sql += newId + ", "; + sql += r.getAnalise_id() + ", '"; + sql += r.getRecomendacao() + "')"; + st.execute(sql); + + return newId; + } + + public void updateRecomendacao(Recomendacao r) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE recomendacoes SET analise_id = " + r.getAnalise_id() + ", "; + sql += "recomendacao = '" + r.getRecomendacao() + "' "; + sql += "WHERE id = " + r.getId(); + //System.out.println("SQL : " + sql); + st.execute(sql); + } + + public void deleteRecomendacoesByAnalise(Integer analise_id) throws Exception + { + Statement st = createStatement(); + String sql = "DELETE FROM recomendacoes WHERE analise_id = " + analise_id; + st.execute(sql); + } + + public ArrayList getRecomendacoesByAnalise(Integer analiseId) throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = "SELECT * FROM recomendacoes WHERE analise_id = " + analiseId; + //System.out.println("SQL : " + sql); + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Recomendacao r = new Recomendacao(); + r.setId(new Integer(rs.getInt("id"))); + r.setAnalise_id(new Integer(rs.getInt("analise_id"))); + r.setRecomendacao(rs.getString("recomendacao")); + list.add(r); + }while(rs.next()); + return list; + } + + public Integer getMaxMedidaId() + { + Statement st = createStatement(); + String sql = "SELECT max(medidas.id)+1 AS MAXMEDIDAID FROM medidas"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXMEDIDAID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + return new Integer(1); + } + } + + public Integer createMedida(Medida m) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxMedidaId(); + String sql = "INSERT INTO medidas (id, analise_id, medida) VALUES ("; + sql += newId + ", "; + sql += m.getAnalise_id() + ", '"; + sql += m.getMedida() + "')"; + st.execute(sql); + + return newId; + } + + public void updateMedida(Medida m) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE medidas SET analise_id = " + m.getAnalise_id() + ", "; + sql += "medida = '" + m.getMedida() + "' "; + sql += "WHERE id = " + m.getId(); + //System.out.println("SQL : " + sql); + st.execute(sql); + } + + public void deleteMedidasByAnalise(Integer analise_id) throws Exception + { + Statement st = createStatement(); + String sql = "DELETE FROM medidas WHERE analise_id = " + analise_id; + st.execute(sql); + } + + public ArrayList getMedidasByAnalise(Integer analiseId) throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = "SELECT * FROM medidas WHERE analise_id = " + analiseId; + //System.out.println("SQL : " + sql); + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Medida m = new Medida(); + m.setId(new Integer(rs.getInt("id"))); + m.setAnalise_id(new Integer(rs.getInt("analise_id"))); + m.setMedida(rs.getString("medida")); + list.add(m); + }while(rs.next()); + return list; + } + + + + public String getNumeroCedula(Integer medico_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT numero_cedula FROM medicos WHERE id = " + medico_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String numero_cedula = rslocal.getString("numero_cedula"); + dblocal.close(); + return numero_cedula; + } + + public com.sun.rave.web.ui.model.Option[] getTiposList() throws Exception + { + ArrayList list = new ArrayList(); + TipoUtilizador t = new TipoUtilizador(); + t.setId(new Integer(0)); + t.setTipo(new Integer(0)); + t.setDescricao(""); + list.add(t); + Statement st = createStatement(); + String sql ="SELECT * FROM tipos_utilizadores WHERE activo = 'y' ORDER BY ordem"; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + t = new TipoUtilizador(); + t.setId(new Integer(rs.getInt("id"))); + t.setTipo(new Integer(rs.getInt("tipo"))); + t.setDescricao(rs.getString("descricao")); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add(t); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + t = (TipoUtilizador) iter.next(); + + listOptions[i] = new Option(t.getTipo(), t.getDescricao()); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosList(Integer empresa_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + ArrayList list = new ArrayList(); + Estabelecimento e = new Estabelecimento(); + e.setId(new Integer(0)); + e.setNome_plain(""); + list.add(e); + String sql ="SELECT * FROM estabelecimentos WHERE empresa_id = " + empresa_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + do + { + e = new Estabelecimento(); + e.setId(new Integer(rslocal.getInt("id"))); + e.setNome_plain(rslocal.getString("nome_plain")); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add(e); + }while(rslocal.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + e = (Estabelecimento) iter.next(); + + listOptions[i] = new Option(e.getId(), e.getNome_plain()); + i++; + } + dblocal.close(); + return listOptions; + } + public com.sun.rave.web.ui.model.Option[] getMedicosList() throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + ArrayList list = new ArrayList(); + Medico m = new Medico(); + m.setId(new Integer(0)); + m.setNome(""); + list.add(m); + String sql ="SELECT * FROM medicos WHERE inactivo = 'n'"; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + do + { + m = new Medico(); + m.setId(new Integer(rslocal.getInt("id"))); + m.setNome(rslocal.getString("nome")); + list.add(m); + }while(rslocal.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + m = (Medico) iter.next(); + + listOptions[i] = new Option(m.getId(), Utils.unicodeToHTML(m.getNome())); + i++; + } + dblocal.close(); + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTecnicosSaudeList() throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + ArrayList list = new ArrayList(); + TecnicoSaude t = new TecnicoSaude(); + t.setId(new Integer(0)); + t.setNome(""); + list.add(t); + String sql ="SELECT * FROM marcacoes_tecnicos_hst WHERE inactivo = 'n'"; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + do + { + t = new TecnicoSaude(); + t.setId(new Integer(rslocal.getInt("id"))); + t.setNome(rslocal.getString("nome")); + list.add(t); + }while(rslocal.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + t = (TecnicoSaude) iter.next(); + + listOptions[i] = new Option(t.getId(), Utils.unicodeToHTML(t.getNome())); + i++; + } + dblocal.close(); + return listOptions; + } + + private String getFase(int estado) + { + if(estado == ESTADO_SEG) + { + return "Abertura"; + } + else if(estado == ESTADO_RH1) + { + return "Acompanhamento"; + } + else if(estado == ESTADO_HS) + { + return "Recomendações"; + } + else if(estado == ESTADO_RH2) + { + return "Medidas"; + } + else if(estado == ESTADO_MEDICO) + { + return "Consulta"; + } + else if(estado == ESTADO_ASSINATURAS) + { + return "Verificação"; + } + else if(estado == ESTADO_IMPRESSAO) + { + return "Impressão"; + } + else if(estado == ESTADO_FECHAR) + { + return "Conclusão"; + } + return null; + } private Statement createStatement() { diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/db/UtilizadoresDataProvider.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/db/UtilizadoresDataProvider.java index 7100737c..3464a514 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/db/UtilizadoresDataProvider.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/db/UtilizadoresDataProvider.java @@ -9,9 +9,16 @@ package db; +import analiseacidentestrabalho.Medico; +import analiseacidentestrabalho.Permissao; +import analiseacidentestrabalho.TecnicoSaude; import analiseacidentestrabalho.Utilizador; +import com.sun.rave.web.ui.model.Option; import java.sql.ResultSet; import java.sql.Statement; +import java.util.ArrayList; +import java.util.ListIterator; +import utils.Utils; /** * @@ -26,16 +33,21 @@ public class UtilizadoresDataProvider { public Integer getMaxUserId() { Statement st = createStatement(); - String sql = "SELECT max(qst_users.id)+1 AS MAXUSERID FROM utilizadores"; + String sql = "SELECT max(utilizadores.id)+1 AS MAXUSERID FROM utilizadores"; try { ResultSet rs = st.executeQuery(sql); rs.first(); Integer newId = new Integer(rs.getInt("MAXUSERID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } return newId; } catch(Exception ex) { + ex.printStackTrace(); return new Integer(1); } } @@ -45,14 +57,23 @@ public class UtilizadoresDataProvider { Statement st = createStatement(); Integer newUserId = getMaxUserId(); - st.execute("INSERT INTO utilizadores (id, login, password, email, empresa_id, estabelecimento_id, administrador) VALUES (" + newUserId + ", '" + u.getLogin() + "', '" + u.getPassword() + "', '" + u.getEmail() + "', " + u.getEmpresa_id() + ", " + u.getEstabelecimento_id() + ", '" + u.getAdministrador() + "')"); + String sql = "INSERT INTO utilizadores (id, login, password, email, empresa_id, estabelecimento_id, administrador, tipo, numero_cedula, cap, nome, medico_id, funcionario_hst_id, activo) VALUES (" + newUserId + ", '" + u.getLogin() + "', '" + u.getPassword() + "', '" + u.getEmail() + "', " + u.getEmpresa_id() + ", " + u.getEstabelecimento_id() + ", '" + u.getAdministrador() + "', " + u.getTipo() + ", '" + u.getNumero_cedula() + "', '" + u.getCap() + "', '" + u.getNome() + "', " + u.getMedico_id() + ", " + u.getFuncionario_hst_id() + ", '" + u.getActivo() + "')"; + System.out.println("SQL CREATE : " + sql); + st.execute(sql); return newUserId; } public void updateUtilizador(Utilizador u) throws Exception { Statement st = createStatement(); - String sql = "UPDATE utilizadores SET login = '" + u.getLogin() + "', password = '" + u.getPassword() + "', email = '" + u.getEmail() + "', empresa_id = " + u.getEmpresa_id() + ", estabelecimento_id = " + u.getEstabelecimento_id() + ", administrador = '" + u.getAdministrador() + "' WHERE id = " + u.getId(); + String sql = "UPDATE utilizadores SET login = '" + u.getLogin() + "', password = '" + u.getPassword() + "', email = '" + u.getEmail() + "', empresa_id = " + u.getEmpresa_id() + ", estabelecimento_id = " + u.getEstabelecimento_id() + ", administrador = '" + u.getAdministrador() + "', tipo = " + u.getTipo() + ", numero_cedula = '" + u.getNumero_cedula() + "', cap = '" + u.getCap() + "', nome = '" + u.getNome() + "', medico_id = " + u.getMedico_id() + ", funcionario_hst_id = " + u.getFuncionario_hst_id() + ", activo = '" + u.getActivo() + "' WHERE id = " + u.getId(); + st.execute(sql); + } + + public void deleteUser(Integer userId) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE utilizadores SET activo = 'n' WHERE id = " + userId; st.execute(sql); } @@ -69,10 +90,172 @@ public class UtilizadoresDataProvider { u.setEmail(rs.getString("email")); u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); - u.setAdministrador(rs.getString("administrador")); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); + return u; + } + + public Utilizador getUtilizador(Integer id) throws Exception + { + Utilizador u = new Utilizador(); + Statement st = createStatement(); + String sql = "SELECT * FROM utilizadores WHERE id = " + id; + ResultSet rs = st.executeQuery(sql); + rs.first(); + u.setId(new Integer(rs.getInt("id"))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); return u; + } + + public ArrayList getUtilizadoresListByTipo(Integer tipo) throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = "SELECT * FROM utilizadores WHERE tipo = " + tipo; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Utilizador u = new Utilizador(); + u.setId(new Integer(rs.getInt("id"))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); + list.add(u); + }while(rs.next()); + return list; } + public com.sun.rave.web.ui.model.Option[] getMedicosList() throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement st = createStatement(); + ArrayList list = new ArrayList(); + Medico m = new Medico(); + m.setId(new Integer(0)); + m.setNome(""); + list.add(m); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = 5"; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + m = new Medico(); + m.setId(new Integer(rs.getInt("id"))); + m.setNome(Utils.unicodeToHTML(rs.getString("nome"))); + list.add(m); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + m = (Medico) iter.next(); + + listOptions[i] = new Option(m.getId(), Utils.unicodeToHTML(m.getNome())); + i++; + } +// dblocal.close(); + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTecnicosSaudeList() throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement st = createStatement(); + ArrayList list = new ArrayList(); + TecnicoSaude t = new TecnicoSaude(); + t.setId(new Integer(0)); + t.setNome(""); + list.add(t); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = 3"; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + t = new TecnicoSaude(); + t.setId(new Integer(rs.getInt("id"))); + t.setNome(Utils.unicodeToHTML(rs.getString("nome"))); + list.add(t); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + t = (TecnicoSaude) iter.next(); + + listOptions[i] = new Option(t.getId(), Utils.unicodeToHTML(t.getNome())); + i++; + } +// dblocal.close(); + return listOptions; + } + + public Integer getMaxPermissaoId() + { + Statement st = createStatement(); + String sql = "SELECT max(permissoes.id)+1 AS MAXPERMISSAOID FROM permissoes"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXPERMISSAOID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + ex.printStackTrace(); + return new Integer(1); + } + } + + public Integer createPermissao(Permissao p) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxPermissaoId(); + + String sql = "INSERT INTO permissoes (id, user_id, codigo_permissao) VALUES (" + newId + ", " + p.getUser_id() + ", " + p.getCodigo_permissao() + ")"; + st.execute(sql); + return newId; + } + public Integer getPermissionCode(Integer userId) throws Exception { Statement st = createStatement(); diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/pagestate/AnaliseAcidenteTrabalhoState.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/pagestate/AnaliseAcidenteTrabalhoState.java index 898a7874..f4aebc98 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/pagestate/AnaliseAcidenteTrabalhoState.java +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/pagestate/AnaliseAcidenteTrabalhoState.java @@ -14,12 +14,25 @@ package pagestate; * @author lluis */ public class AnaliseAcidenteTrabalhoState { + private int estado; + private Object empresa; private Object estabelecimento; private Object trabalhador; private Object data_nascimento; + + private Object bi; + private Object morada; + private Object cod_postal1; + private Object cod_postal2; + private Object localidade; + private Object contacto_telefonico; + private String turno; + private Object horas_turno; private Object seccao; private Object local_trabalho; + private Integer hours; + private Integer minutes; private Object tarefa; private Object substancias; @@ -30,7 +43,25 @@ public class AnaliseAcidenteTrabalhoState { private Object descricao; private Object conclusoes; private Object accoes; - + + + private String formacao_shst; + private Object formacao_shsht_n_why; + private String acidentes_colaborador; + private Object nr_acidentes_colaborador; + private String acidentes_colaboradores; + private Object nr_acidentes_colaboradores; + + private Object nr_relatorio_acidentes_colaborador_1; + private Object nr_relatorio_acidentes_colaborador_2; + private Object nr_relatorio_acidentes_colaborador_3; + private Object nr_relatorio_acidentes_colaborador_4; + + private Object nr_relatorio_acidentes_colaboradores_1; + private Object nr_relatorio_acidentes_colaboradores_2; + private Object nr_relatorio_acidentes_colaboradores_3; + private Object nr_relatorio_acidentes_colaboradores_4; + /** Creates a new instance of AnaliseAcidenteTrabalhoState */ public AnaliseAcidenteTrabalhoState() { } @@ -154,5 +185,207 @@ public class AnaliseAcidenteTrabalhoState { public void setConclusoes(Object conclusoes) { this.conclusoes = conclusoes; } + + public Object getEmpresa() { + return empresa; + } + + public void setEmpresa(Object empresa) { + this.empresa = empresa; + } + + public int getEstado() { + return estado; + } + + public void setEstado(int estado) { + this.estado = estado; + } + + public Object getBi() { + return bi; + } + + public void setBi(Object bi) { + this.bi = bi; + } + + public Object getMorada() { + return morada; + } + + public void setMorada(Object morada) { + this.morada = morada; + } + + public Object getCod_postal1() { + return cod_postal1; + } + + public void setCod_postal1(Object cod_postal1) { + this.cod_postal1 = cod_postal1; + } + + public Object getCod_postal2() { + return cod_postal2; + } + + public void setCod_postal2(Object cod_postal2) { + this.cod_postal2 = cod_postal2; + } + + public Object getLocalidade() { + return localidade; + } + + public void setLocalidade(Object localidade) { + this.localidade = localidade; + } + + public Object getContacto_telefonico() { + return contacto_telefonico; + } + + public void setContacto_telefonico(Object contacto_telefonico) { + this.contacto_telefonico = contacto_telefonico; + } + + public String getTurno() { + return turno; + } + + public void setTurno(String turno) { + this.turno = turno; + } + + public Integer getHours() { + return hours; + } + + public void setHours(Integer hours) { + this.hours = hours; + } + + public Integer getMinutes() { + return minutes; + } + + public void setMinutes(Integer minutes) { + this.minutes = minutes; + } + + public String getFormacao_shst() { + return formacao_shst; + } + + public void setFormacao_shst(String formacao_shst) { + this.formacao_shst = formacao_shst; + } + + public Object getFormacao_shsht_n_why() { + return formacao_shsht_n_why; + } + + public void setFormacao_shsht_n_why(Object formacao_shsht_n_why) { + this.formacao_shsht_n_why = formacao_shsht_n_why; + } + + public String getAcidentes_colaborador() { + return acidentes_colaborador; + } + + public void setAcidentes_colaborador(String acidentes_colaborador) { + this.acidentes_colaborador = acidentes_colaborador; + } + + public Object getNr_acidentes_colaborador() { + return nr_acidentes_colaborador; + } + + public void setNr_acidentes_colaborador(Object nr_acidentes_colaborador) { + this.nr_acidentes_colaborador = nr_acidentes_colaborador; + } + + public String getAcidentes_colaboradores() { + return acidentes_colaboradores; + } + + public void setAcidentes_colaboradores(String acidentes_colaboradores) { + this.acidentes_colaboradores = acidentes_colaboradores; + } + + public Object getNr_acidentes_colaboradores() { + return nr_acidentes_colaboradores; + } + + public void setNr_acidentes_colaboradores(Object nr_acidentes_colaboradores) { + this.nr_acidentes_colaboradores = nr_acidentes_colaboradores; + } + + public Object getNr_relatorio_acidentes_colaborador_1() { + return nr_relatorio_acidentes_colaborador_1; + } + + public void setNr_relatorio_acidentes_colaborador_1(Object nr_relatorio_acidentes_colaborador_1) { + this.nr_relatorio_acidentes_colaborador_1 = nr_relatorio_acidentes_colaborador_1; + } + + public Object getNr_relatorio_acidentes_colaborador_2() { + return nr_relatorio_acidentes_colaborador_2; + } + + public void setNr_relatorio_acidentes_colaborador_2(Object nr_relatorio_acidentes_colaborador_2) { + this.nr_relatorio_acidentes_colaborador_2 = nr_relatorio_acidentes_colaborador_2; + } + + public Object getNr_relatorio_acidentes_colaborador_3() { + return nr_relatorio_acidentes_colaborador_3; + } + + public void setNr_relatorio_acidentes_colaborador_3(Object nr_relatorio_acidentes_colaborador_3) { + this.nr_relatorio_acidentes_colaborador_3 = nr_relatorio_acidentes_colaborador_3; + } + + public Object getNr_relatorio_acidentes_colaborador_4() { + return nr_relatorio_acidentes_colaborador_4; + } + + public void setNr_relatorio_acidentes_colaborador_4(Object nr_relatorio_acidentes_colaborador_4) { + this.nr_relatorio_acidentes_colaborador_4 = nr_relatorio_acidentes_colaborador_4; + } + + public Object getNr_relatorio_acidentes_colaboradores_1() { + return nr_relatorio_acidentes_colaboradores_1; + } + + public void setNr_relatorio_acidentes_colaboradores_1(Object nr_relatorio_acidentes_colaboradores_1) { + this.nr_relatorio_acidentes_colaboradores_1 = nr_relatorio_acidentes_colaboradores_1; + } + + public Object getNr_relatorio_acidentes_colaboradores_2() { + return nr_relatorio_acidentes_colaboradores_2; + } + + public void setNr_relatorio_acidentes_colaboradores_2(Object nr_relatorio_acidentes_colaboradores_2) { + this.nr_relatorio_acidentes_colaboradores_2 = nr_relatorio_acidentes_colaboradores_2; + } + + public Object getNr_relatorio_acidentes_colaboradores_3() { + return nr_relatorio_acidentes_colaboradores_3; + } + + public void setNr_relatorio_acidentes_colaboradores_3(Object nr_relatorio_acidentes_colaboradores_3) { + this.nr_relatorio_acidentes_colaboradores_3 = nr_relatorio_acidentes_colaboradores_3; + } + + public Object getNr_relatorio_acidentes_colaboradores_4() { + return nr_relatorio_acidentes_colaboradores_4; + } + + public void setNr_relatorio_acidentes_colaboradores_4(Object nr_relatorio_acidentes_colaboradores_4) { + this.nr_relatorio_acidentes_colaboradores_4 = nr_relatorio_acidentes_colaboradores_4; + } + + } diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/pdf/Pdf.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/pdf/Pdf.java new file mode 100644 index 00000000..e02f8c17 --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/pdf/Pdf.java @@ -0,0 +1,168 @@ +/* + * Pdf.java + * + * Created on November 13, 2007, 11:33 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package pdf; + +import analiseacidentestrabalho.Acidentado; +import analiseacidentestrabalho.AnaliseAcidente; +import com.lowagie.text.Chunk; +import com.lowagie.text.Document; +import com.lowagie.text.Font; +import com.lowagie.text.FontFactory; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.BaseFont; +import com.lowagie.text.pdf.PdfAction; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfWriter; +import db.AnalisesDataProvider; +import java.awt.Color; +import java.io.FileOutputStream; +import javax.faces.context.FacesContext; + +/** + * + * @author lluis + */ +public class Pdf { + + PdfPCell cell = null; + Paragraph p = null; + private final static int FONT_SIZE = 5; + /** Creates a new instance of Pdf */ + public Pdf() { + } + + public void generatePdf(String folder, AnaliseAcidente a) + { + PdfPTable table = null; + FacesContext ctx = FacesContext.getCurrentInstance(); + ////HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse(); + Document document = new Document(); + ////response.setContentType("application/pdf"); + + try + { + ////PdfWriter writer = PdfWriter.getInstance(document, response.getOutputStream()); + PdfWriter.getInstance(document, new FileOutputStream(folder + "/" + a.getId().toString() + ".pdf")); + document.open(); + //document.add(new Paragraph("Hello World")); + //document.add(new Paragraph(new Date().toString())); + + table = createTableEmpresa(a); + document.add(table); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + document.close(); + } + + private PdfPTable createTableHeader(AnaliseAcidente a) + { + PdfPTable table = new PdfPTable(3); + return table; + } + + private PdfPTable createTableEmpresa(AnaliseAcidente a) + { + String empresa_str = ""; + String estabelecimento_str = ""; + String trabalhador_str = ""; + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); + empresa_str = utils.Utils.unicodeToHTML(nome_empresa); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try + { + estabelecimento_str = adp.getEstabelecimentoNome(a.getEstabelecimento_id()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + Acidentado ac = null; + try + { + ac = adp.getAcidentado(a.getAcidentado_id()); + trabalhador_str = ac.getNome(); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + //TableEvents event = new TableEvents(); + + float[] widths = { 1f, 4f }; + PdfPTable table = new PdfPTable(widths); + table.getDefaultCell().setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.TOP | Rectangle.BOTTOM); + //PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3")); + //cell.setColspan(3); + //table.addCell(cell); + + + + + cell = new PdfPCell(new Paragraph("Empresa:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(empresa_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)) )); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Estabelecimento:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(estabelecimento_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Trabalhador:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(trabalhador_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + table.getDefaultCell().setBackgroundColor(new Color(102, 133, 151)); + table.getDefaultCell().setPadding(0f); + table.setSpacingAfter(0f); + table.setSpacingBefore(0f); + return table; + } + + private PdfPTable createTableEmpresaHs(AnaliseAcidente a) + { + PdfPTable table = new PdfPTable(3); + return table; + } + + + + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/utils/Strings.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/utils/Strings.java new file mode 100644 index 00000000..1fbfc2d0 --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/utils/Strings.java @@ -0,0 +1,151 @@ +/* + * Strings.java + * + * Created on October 8, 2007, 9:17 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package utils; + +/** + * + * @author lluis + */ +public class Strings { + public static String unicodeToHTML( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + + String output = text; + output = output.replace( "\\u0009", " " ); + output = output.replace( "\\u000a", "
" ); + + output = output.replace( "\\u00a0", " " ); + output = output.replace( "\\u00aa", "ª" ); + output = output.replace( "\\u00ba", "º" ); + + output = output.replace( "\\u00c0", "À" ); + output = output.replace( "\\u00c1", "Á" ); + output = output.replace( "\\u00c2", "Â" ); + output = output.replace( "\\u00c3", "Ã" ); + output = output.replace( "\\u00c7", "Ç" ); + output = output.replace( "\\u00c8", "È" ); + output = output.replace( "\\u00c9", "É" ); + + output = output.replace( "\\u00ca", "Ê" ); + output = output.replace( "\\u00cc", "Ì" ); + output = output.replace( "\\u00cd", "Í" ); + output = output.replace( "\\u00ce", "Î" ); + output = output.replace( "\\u00d2", "ò" ); + output = output.replace( "\\u00d3", "ó" ); + output = output.replace( "\\u00d4", "ô" ); + output = output.replace( "\\u00d5", "õ" ); + output = output.replace( "\\u00d9", "Ù" ); + output = output.replace( "\\u00da", "Ú" ); + output = output.replace( "\\u00db", "Û" ); + + output = output.replace( "\\u00e0", "à" ); + output = output.replace( "\\u00e1", "á" ); + output = output.replace( "\\u00e2", "â" ); + output = output.replace( "\\u00e3", "ã" ); + output = output.replace( "\\u00e7", "ç" ); + output = output.replace( "\\u00e8", "è" ); + output = output.replace( "\\u00e9", "é" ); + output = output.replace( "\\u00ea", "ê" ); + output = output.replace( "\\u00ec", "ì" ); + output = output.replace( "\\u00ed", "í" ); + output = output.replace( "\\u00ee", "î" ); + output = output.replace( "\\u00f2", "ò" ); + output = output.replace( "\\u00f3", "ó" ); + output = output.replace( "\\u00f4", "ô" ); + output = output.replace( "\\u00f5", "õ" ); + output = output.replace( "\\u00f9", "ù" ); + output = output.replace( "\\u00fa", "ú" ); + output = output.replace( "\\u00fb", "û" ); + + output = output.replace( "\\u0153", "œ" ); + + output = output.replace( "\\u2013", "-" ); + output = output.replace( "\\u2014", "-" ); + output = output.replace( "\\u2018|\\u2019", "'" ); + output = output.replace( "\\u201c|\\u201d", "\"" ); + + output = output.replace( "\\u2022", "*" ); + output = output.replace( "\\u2026", "..." ); + + return output; + } + + public static String textToUnicode( String text ) + { + String output = text; + output = output.replace( "À", "\\u00c0" ); + output = output.replace( "Á", "\\u00c1" ); + output = output.replace( "Â", "\\u00c2" ); + output = output.replace( "Ã", "\\u00c3" ); + output = output.replace( "Ç", "\\u00c7" ); + output = output.replace( "È", "\\u00c8" ); + output = output.replace( "É", "\\u00c9" ); + + output = output.replace( "Ê", "\\u00ca" ); + output = output.replace( "Ì", "\\u00cc" ); + output = output.replace( "Í", "\\u00cd" ); + output = output.replace( "Î", "\\u00ce" ); + output = output.replace( "ò", "\\u00d2" ); + output = output.replace( "ó", "\\u00d3" ); + output = output.replace( "ô", "\\u00d4" ); + output = output.replace( "õ", "\\u00d5" ); + output = output.replace( "Ù", "\\u00d9" ); + output = output.replace( "Ú", "\\u00da" ); + output = output.replace( "Û", "\\u00db" ); + + output = output.replace( "à", "\\u00e0" ); + output = output.replace( "á", "\\u00e1" ); + output = output.replace( "â", "\\u00e2" ); + output = output.replace( "ã", "\\u00e3" ); + output = output.replace( "ç", "\\u00e7" ); + output = output.replace( "è", "\\u00e8" ); + output = output.replace( "é", "\\u00e9" ); + output = output.replace( "ê", "\\u00ea" ); + output = output.replace( "ì", "\\u00ec" ); + output = output.replace( "í", "\\u00ed" ); + output = output.replace( "î", "\\u00ee" ); + output = output.replace( "ò", "\\u00f2" ); + output = output.replace( "ó", "\\u00f3" ); + output = output.replace( "ô", "\\u00f4" ); + output = output.replace( "õ", "\\u00f5" ); + output = output.replace( "ù", "\\u00f9" ); + output = output.replace( "ú", "\\u00fa" ); + output = output.replace( "û", "\\u00fb" ); + + return output; + } + + public static String RTFToUnicode( String text ) + { + if( text == null || text.length() < 4 ) + { + return text; + } + String output = text; + output = output.replaceAll( "\\'", "\\u00" ); + return output; + } + + public static String unicodeToRTF( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + String output = text; + output = output.replaceAll( "\\\\u00", "\\\\'" ); + return output; + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/utils/Utils.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/utils/Utils.java new file mode 100644 index 00000000..be0aabdb --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/utils/Utils.java @@ -0,0 +1,133 @@ +/* + * Utils.java + * + * Created on October 12, 2007, 9:39 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package utils; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; + +/** + * + * @author lluis + */ +public class Utils { + + /** Creates a new instance of Utils */ + public Utils() { + } + + public static String unicodeToHTML( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + + String output = text; + output = output.replace( "\\u0009", " " ); + output = output.replace( "\\u000a", "
" ); + + output = output.replace( "\\u00a0", " " ); + output = output.replace( "\\u00aa", "ª" ); + output = output.replace( "\\u00ba", "º" ); + + output = output.replace( "\\u00c0", "À" ); + output = output.replace( "\\u00c1", "Á" ); + output = output.replace( "\\u00c2", "Â" ); + output = output.replace( "\\u00c3", "Ã" ); + output = output.replace( "\\u00c7", "Ç" ); + output = output.replace( "\\u00c8", "È" ); + output = output.replace( "\\u00c9", "É" ); + + output = output.replace( "\\u00ca", "Ê" ); + output = output.replace( "\\u00cc", "Ì" ); + output = output.replace( "\\u00cd", "Í" ); + output = output.replace( "\\u00ce", "Î" ); + output = output.replace( "\\u00d2", "ò" ); + output = output.replace( "\\u00d3", "ó" ); + output = output.replace( "\\u00d4", "ô" ); + output = output.replace( "\\u00d5", "õ" ); + output = output.replace( "\\u00d9", "Ù" ); + output = output.replace( "\\u00da", "Ú" ); + output = output.replace( "\\u00db", "Û" ); + + output = output.replace( "\\u00e0", "à" ); + output = output.replace( "\\u00e1", "á" ); + output = output.replace( "\\u00e2", "â" ); + output = output.replace( "\\u00e3", "ã" ); + output = output.replace( "\\u00e7", "ç" ); + output = output.replace( "\\u00e8", "è" ); + output = output.replace( "\\u00e9", "é" ); + output = output.replace( "\\u00ea", "ê" ); + output = output.replace( "\\u00ec", "ì" ); + output = output.replace( "\\u00ed", "í" ); + output = output.replace( "\\u00ee", "î" ); + output = output.replace( "\\u00f2", "ò" ); + output = output.replace( "\\u00f3", "ó" ); + output = output.replace( "\\u00f4", "ô" ); + output = output.replace( "\\u00f5", "õ" ); + output = output.replace( "\\u00f9", "ù" ); + output = output.replace( "\\u00fa", "ú" ); + output = output.replace( "\\u00fb", "û" ); + + output = output.replace( "\\u0153", "œ" ); + + output = output.replace( "\\u2013", "-" ); + output = output.replace( "\\u2014", "-" ); + output = output.replace( "\\u2018|\\u2019", "'" ); + output = output.replace( "\\u201c|\\u201d", "\"" ); + + output = output.replace( "\\u2022", "*" ); + output = output.replace( "\\u2026", "..." ); + + return output; + } + + public static String getPageFrom(String referer) + { + String pageFrom = referer.substring(referer.lastIndexOf("/")+1); + return pageFrom; + } + + public static boolean isValidEmail(String email){ + boolean res = true; + + int indexOfAtChar=email.indexOf("@"); + + if(indexOfAtChar > 0) + { + int indexOfDotChar = + email.indexOf(".",indexOfAtChar); + if(indexOfDotChar > 0) + { + res = true; + } + else + { + res = false; + } + } + else{ + res = false; + } + return res; + } + + public static String dateToYYYYMMDD(Date ddate) + { + Calendar cal = new GregorianCalendar(); + cal.setTime(ddate); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); + String date_str = dateFormat.format(cal.getTime()); + return date_str; + } + +} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Dummy.jsp b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Dummy.jsp index 5b3cf3ab..3c8c070e 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Dummy.jsp +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Dummy.jsp @@ -6,16 +6,77 @@ + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Footer.jspf b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Footer.jspf index 6c3d280f..f4eb9342 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Footer.jspf +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Footer.jspf @@ -2,7 +2,7 @@
- + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormHS.jsp b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormHS.jsp index 3a0083d9..31f98e17 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormHS.jsp +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormHS.jsp @@ -9,9 +9,6 @@ -
- -
@@ -22,12 +19,11 @@
- + - + - - +
+ styleClass="centerBlock" width="560"> - + + + + @@ -72,7 +72,7 @@ + styleClass="centerBlock" width="560"> - + + + + @@ -131,14 +135,17 @@ - + - + - + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormMedico.jsp b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormMedico.jsp new file mode 100644 index 00000000..a99d509a --- /dev/null +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormMedico.jsp @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormRH.jsp b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormRH.jsp index 003e8d6d..92d5582e 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormRH.jsp +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormRH.jsp @@ -9,9 +9,6 @@ -
- -
@@ -22,12 +19,11 @@ - + - + - - + + styleClass="centerBlock" width="560"> - + + + + @@ -72,7 +72,7 @@ + styleClass="centerBlock" width="544"> - - + + + + + @@ -131,14 +136,17 @@ - + - + - + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormSeguranca.jsp b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormSeguranca.jsp index cb7b8b61..645369c5 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormSeguranca.jsp +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/FormSeguranca.jsp @@ -10,9 +10,6 @@ -
- -
@@ -23,12 +20,11 @@ - + - + - - + - + - + + + + @@ -74,7 +75,8 @@ - + + id="lnkNrSeg" text="#{currentRow.value['analise_nr']}"/> + + + @@ -136,14 +142,17 @@ sourceData="#{SessionBean1.analisesConcluidasDataProvider}" sourceVar="currentRow"> - + - + - + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Login.jsp b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Login.jsp index 717f0f87..97e50fd9 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Login.jsp +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/Login.jsp @@ -34,9 +34,6 @@
-
- -
diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/RecuperarPassword.jsp b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/RecuperarPassword.jsp index 84dea9bc..72cd236b 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/RecuperarPassword.jsp +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/RecuperarPassword.jsp @@ -35,9 +35,6 @@
-
- -
diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp index 379b3232..a0ee7a26 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp @@ -9,9 +9,6 @@ -
- -
- + - + - + binding="#{ViewAnaliseAcidenteTrabalho.lnkLogout1}" id="lnkLogout1" text="sair>>"/> - + - - - - - - + + + + + + + style="background-color: #668597; border-bottom: solid #000000 1px; height: 24px; width: 100%" width="192"> + style="height: 24px; width: 168px" styleClass="labelBold" text="EMPRESA PRESTADORA DE SERVI&Ccedil;OS DE SEGURAN&Ccedil;A, HIGIENE E SA&Uacute;DE DO TRABALHO"/> + style="height: 24px; width: 144px" styleClass="labelBold" text="Identificação:"/> + style="height: 24px; width: 144px" styleClass="labelBold" text="T&#233;cnico(a) Superior de Higiene e Seguran&#231;a do Trabalho:"/> + style="height: 24px; width: 168px" text="&nbsp;&nbsp;C.A.P. n&#186;:&nbsp;&nbsp;"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="M&#233;dico(a) do Trabalho:"/> + style="height: 24px; width: 168px" text="&nbsp;&nbsp;C&#233;dula Prof. n&#186;:&nbsp;&nbsp;"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + style="background-color: #668597; border-bottom: solid #000000 1px; height: 24px; width: 100%" width="192"> + style="height: 24px; width: 168px" styleClass="labelBold" text="DADOS DO ACIDENTE DE TRABALHO"/> - - - - - + + style="height: 24px; width: 288px" styleClass="labelBold" text="N&#186; horas trabalhadas no turno:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Sec&#231;&#227;o:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Local espec&#237;fico:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Tarefa/Actividade que se encontra a realizar:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Subst&#226;ncias, equipamentos, ferramentas e objetos utilizados:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Identifica&#231;&#227;o do superior hier&#225;rquico/respons&#225;vel superior do posto de trabalho:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Condi&#231;&#245;es que contribu&#237;ram para o acidente e respectiva explica&#231;&#227;o da sua exist&#234;ncia:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Testemunhas:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Causas do acidente:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Descri&#231;&#227;o do acidente:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Fotografia(s) e/ou croqui(s) do local do acidente:"/> @@ -161,17 +194,97 @@ + style="height: 24px; width: 288px" styleClass="labelBold" text="Conclus&#245;es:"/> + style="height: 24px; width: 288px" styleClass="labelBold" text="Ac&#231;&#245;es imediatas tomadas:"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/WEB-INF/managed-beans.xml b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/WEB-INF/managed-beans.xml index 62ae9326..cf67abaf 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/WEB-INF/managed-beans.xml +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/WEB-INF/managed-beans.xml @@ -82,4 +82,14 @@ analiseacidentestrabalho.FormHS request + + FichaUtilizador + analiseacidentestrabalho.FichaUtilizador + request + + + FormMedico + analiseacidentestrabalho.FormMedico + request + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/WEB-INF/navigation.xml b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/WEB-INF/navigation.xml index f56c0e67..1002faf6 100644 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/WEB-INF/navigation.xml +++ b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/WEB-INF/navigation.xml @@ -23,7 +23,15 @@ form_hs /FormHS.jsp - + + + form_medico + /FormMedico.jsp + + + create_user + /FichaUtilizador.jsp + /RecuperarPassword.jsp @@ -46,6 +54,10 @@ view_analise /ViewAnaliseAcidenteTrabalho.jsp + + user + /FichaUtilizador.jsp + /FormRH.jsp @@ -61,7 +73,11 @@ view_analise /ViewAnaliseAcidenteTrabalho.jsp - + + user + /FichaUtilizador.jsp + + /FormHS.jsp @@ -76,7 +92,30 @@ view_analise /ViewAnaliseAcidenteTrabalho.jsp - + + user + /FichaUtilizador.jsp + + + + /FormMedico.jsp + + login + /Login.jsp + + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + user + /FichaUtilizador.jsp + + /AnaliseAcidenteTrabalho.jsp @@ -87,10 +126,26 @@ form_seguranca /FormSeguranca.jsp + + form_rh + /FormRH.jsp + + + form_hs + /FormHS.jsp + + + form_medico + /FormMedico.jsp + + + user + /FichaUtilizador.jsp + login /Login.jsp - + /LoadImage.jsp @@ -99,4 +154,62 @@ /AnaliseAcidenteTrabalho.jsp + + /FichaUtilizador.jsp + + form_seguranca + /FormSeguranca.jsp + + + form_rh + /FormRH.jsp + + + form_hs + /FormHS.jsp + + + form_medico + /FormMedico.jsp + + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + login + /Login.jsp + + + + /ViewAnaliseAcidenteTrabalho.jsp + + login + /Login.jsp + + + user + /FichaUtilizador.jsp + + + form_seguranca + /FormSeguranca.jsp + + + form_rh + /FormRH.jsp + + + form_hs + /FormHS.jsp + + + form_medico + /FormMedico.jsp + + diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ca2.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ca2.gif new file mode 100644 index 00000000..97c08970 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ca2.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ca3.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ca3.gif new file mode 100644 index 00000000..07b00dc5 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ca3.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext1.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext1.gif new file mode 100644 index 00000000..6278e9de Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext1.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext2.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext2.gif new file mode 100644 index 00000000..d50ab9f5 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext2.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext3.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext3.gif new file mode 100644 index 00000000..cb2a14e3 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ext3.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle2.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle2.gif new file mode 100644 index 00000000..dbf9cb41 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle2.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle3.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle3.gif new file mode 100644 index 00000000..5406a2be Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle3.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle4.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle4.gif new file mode 100644 index 00000000..7342e330 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/fle4.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma10.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma10.gif new file mode 100644 index 00000000..94748d7b Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma10.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma2.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma2.gif new file mode 100644 index 00000000..a1f65bf0 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma2.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma3.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma3.gif new file mode 100644 index 00000000..3ec7862b Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma3.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma5.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma5.gif new file mode 100644 index 00000000..c6719c98 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma5.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma6.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma6.gif new file mode 100644 index 00000000..f1b5170b Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma6.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma8.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma8.gif new file mode 100644 index 00000000..b98a9b2a Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/medico/ma8.gif differ diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/plus_more.gif b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/plus_more.gif new file mode 100644 index 00000000..f10da648 Binary files /dev/null and b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/web/resources/images/plus_more.gif differ